Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the diamond docs to the template #9

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .posthtmlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": {
"posthtml-include": {}
}
}
71 changes: 69 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
"@parcel/packager-xml": "2.11.0",
"@parcel/transformer-webmanifest": "2.11.0",
"@parcel/transformer-xml": "2.11.0",
"parcel": "2.11.0"
"parcel": "2.11.0",
"posthtml-include": "2.0.1"
},
"dependencies": {
"@etchteam/diamond-ui": "^1.27.4"
"@etchteam/diamond-ui": "^1.27.4",
"highlight.js": "11.9.0"
}
}
756 changes: 756 additions & 0 deletions src/components/templates/docs.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 50 additions & 100 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,112 +26,62 @@
<body>
<main>
<diamond-section padding="fluid">
<diamond-grid justify-content="center" class="diamond-spacing-bottom-lg">
<diamond-grid-item>
<img src="images/logo.svg" alt="Diamond ui" width="124" height="20" />
</diamond-grid-item>
</diamond-grid>
<diamond-wrap size="xl">
<diamond-enter type="fade">
<h1 class="diamond-text-align-center diamond-spacing-bottom-md">
Bring clarity to<br />
your components
</h1>
<diamond-wrap size="md" class="diamond-spacing-bottom-fluid-lg">
<p class="diamond-text-size-xl diamond-spacing-bottom-lg diamond-text-weight-light diamond-text-align-center">
Diamond UI is a method for organising components to cleanly separate their responsibilities.
</p>
</diamond-wrap>
</diamond-enter>
</diamond-wrap>

<diamond-enter type="fade-in-up" delay="0.2">
<diamond-wrap size="md" class="diamond-spacing-bottom-fluid">
<h2 class="diamond-text-size-h3">
Design Systems can get messy
</h2>

<p>Are you fed up of bloated components?</p>

<p>Can't decide if it's an atom, a molecule or an organism?</p>

<p>Do you add more and more props to your components?</p>

<p>Do you have to update components for every design change?</p>

<p class="diamond-spacing-bottom-lg">Are your components awkward to test?</p>

<h2 class="diamond-text-size-h3">Make things clear and simple</h2>

<p>
As a product grows and evolves, its UI can get harder to update and maintain, often leading to:
</p>

<ul>
<li>bloated components</li>
<li>complicated props</li>
<li>maintenance hell</li>
</ul>

<p>
Diamond principles force components become more robust, reusable and flexible.
<diamond-wrap size="md" class="diamond-spacing-bottom-lg">
<img class="diamond-spacing-bottom-md" src="images/logo.svg" alt="Diamond ui" width="149" height="24" />

<h1 class="diamond-spacing-bottom-md">
Bring clarity to
your components
</h1>
<diamond-wrap size="md" gutter="none" class="diamond-spacing-bottom-lg">
<p class="diamond-text-size-lg diamond-text-weight-light">
Diamond UI is a method for organising components to cleanly separate their responsibilities.
</p>
</diamond-wrap>
</diamond-wrap>

<p>
For developers this means:
</p>
<diamond-wrap size="md" class="diamond-spacing-bottom-fluid">

<ul>
<li>there’s fewer components to maintain</li>
<li>clear definitions and less ambiguity</li>
<li>future problems are easier to solve</li>
<li>components can be framework agnostic</li>
</ul>
<include src="src/components/templates/docs.html"></include>

<p>
The approach has been tried and tested on a variety of design systems and we’re in the process of building Diamond UI for public use.
</p>
</diamond-wrap>
</diamond-enter>
</diamond-wrap>

<diamond-enter type="fade-in-up" enter-on-scroll>
<diamond-wrap size="md">
<diamond-card class="diamond-text-align-center diamond-spacing-bottom-lg theme-medium" padding="fluid-sm" radius>
<form
action="https://etchapps.us6.list-manage.com/subscribe/post?u=6399ac2bf5&amp;id=fa635584a8&amp;f_id=00f23de3f0"
method="post"
target="_blank"
>
<div aria-hidden="true" style="position: absolute; left: -5000px;">
<input type="text" name="b_6399ac2bf5_fa635584a8" tabindex="-1" value="">
</div>
<diamond-form-group class="diamond-spacing-bottom-md">
<diamond-grid justify-content="center">
<diamond-grid-item>
<label for="email" class="diamond-text-weight-bold">Diamond UI is coming soon</label>
</diamond-grid-item>
</diamond-grid>
<diamond-input>
<input type="email" name="EMAIL" placeholder="[email protected]" id="email" required />
</diamond-input>
<p class="diamond-text-size-sm">
We promise to treat your inbox with respect.
</p>
</diamond-form-group>
<diamond-button width="full-width" variant="primary">
<button type="submit" class="diamond-text-weight-bold" data-umami-event="subscribe">
Notify me
</button>
</diamond-button>
<p class="diamond-spacing-top-md diamond-text-weight-bold">
<a href="https://etch.co/blog/bring-clarity-to-your-components" target="_blank" rel="noopener noreferrer">
Learn more about Diamond UI
</a>
<diamond-wrap size="md">
<diamond-card class="diamond-text-align-center diamond-spacing-bottom-lg theme-medium" padding="fluid-sm" radius>
<form
action="https://etchapps.us6.list-manage.com/subscribe/post?u=6399ac2bf5&amp;id=fa635584a8&amp;f_id=00f23de3f0"
method="post"
target="_blank"
>
<div aria-hidden="true" style="position: absolute; left: -5000px;">
<input type="text" name="b_6399ac2bf5_fa635584a8" tabindex="-1" value="">
</div>
<diamond-form-group class="diamond-spacing-bottom-md">
<diamond-grid justify-content="center">
<diamond-grid-item>
<label for="email" class="diamond-text-weight-bold">Diamond UI is coming soon</label>
</diamond-grid-item>
</diamond-grid>
<diamond-input>
<input type="email" name="EMAIL" placeholder="[email protected]" id="email" required />
</diamond-input>
<p class="diamond-text-size-sm">
We promise to treat your inbox with respect.
</p>
</form>
</diamond-card>
</diamond-wrap>
</diamond-enter>
</diamond-form-group>
<diamond-button width="full-width" variant="primary">
<button type="submit" class="diamond-text-weight-bold" data-umami-event="subscribe">
Notify me
</button>
</diamond-button>
<p class="diamond-spacing-top-md diamond-text-weight-bold">
<a href="https://etch.co/blog/bring-clarity-to-your-components" target="_blank" rel="noopener noreferrer">
Learn more about Diamond UI
</a>
</p>
</form>
</diamond-card>
</diamond-wrap>
</diamond-section>
</main>
<footer class="diamond-text-align-center">
Expand Down
5 changes: 5 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '@etchteam/diamond-ui/composition/Enter/Enter';
import hljs from 'highlight.js';

const form = document.querySelector('form');
const email = document.querySelector('input[type="email"]');
Expand All @@ -17,4 +18,8 @@ document.querySelector('form').addEventListener('submit', (e) => {
e.preventDefault();
email.closest('diamond-input').setAttribute('state', 'invalid');
}
});

document.addEventListener('DOMContentLoaded', () => {
hljs.highlightAll();
});
Loading
Loading