@unkn0wndo3s/nova-design-system 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +47 -0
- package/README.md +165 -0
- package/package.json +29 -0
- package/src/components/Button/_button.scss +37 -0
- package/src/components/Button/button.astro +15 -0
- package/src/components/Icons/Arrow2/Arrow2.astro +45 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-16-down.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-16-left.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-16-right.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-16-up.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-24-down.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-24-left.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-24-right.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-24-up.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-32-down.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-32-left.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-32-right.svg +3 -0
- package/src/components/Icons/Arrow2/svgs/arrow2-32-up.svg +3 -0
- package/src/components/Icons/bin/bin.astro +26 -0
- package/src/components/Icons/bin/svgs/bin-16.svg +3 -0
- package/src/components/Icons/bin/svgs/bin-24.svg +3 -0
- package/src/components/Icons/bin/svgs/bin-32.svg +3 -0
- package/src/components/Icons/burger/burger.astro +26 -0
- package/src/components/Icons/burger/svgs/burger-16.svg +3 -0
- package/src/components/Icons/burger/svgs/burger-24.svg +3 -0
- package/src/components/Icons/burger/svgs/burger-32.svg +3 -0
- package/src/components/Icons/calendar/calendar.astro +26 -0
- package/src/components/Icons/calendar/svgs/calendar-16.svg +3 -0
- package/src/components/Icons/calendar/svgs/calendar-24.svg +3 -0
- package/src/components/Icons/calendar/svgs/calendar-32.svg +3 -0
- package/src/components/Icons/check/check.astro +26 -0
- package/src/components/Icons/check/svgs/check-16.svg +3 -0
- package/src/components/Icons/check/svgs/check-24.svg +3 -0
- package/src/components/Icons/check/svgs/check-32.svg +3 -0
- package/src/components/Icons/close/close.astro +27 -0
- package/src/components/Icons/close/svgs/close-16.svg +3 -0
- package/src/components/Icons/close/svgs/close-24.svg +3 -0
- package/src/components/Icons/close/svgs/close-32.svg +3 -0
- package/src/components/Icons/code/code.astro +26 -0
- package/src/components/Icons/code/svgs/code-16.svg +3 -0
- package/src/components/Icons/code/svgs/code-24.svg +3 -0
- package/src/components/Icons/code/svgs/code-32.svg +3 -0
- package/src/components/Icons/cube/cube.astro +26 -0
- package/src/components/Icons/cube/svgs/cube-16.svg +3 -0
- package/src/components/Icons/cube/svgs/cube-24.svg +3 -0
- package/src/components/Icons/cube/svgs/cube-32.svg +3 -0
- package/src/components/Icons/download/download.astro +26 -0
- package/src/components/Icons/download/svgs/download-16.svg +5 -0
- package/src/components/Icons/download/svgs/download-24.svg +4 -0
- package/src/components/Icons/download/svgs/download-32.svg +4 -0
- package/src/components/Icons/filter/filter.astro +26 -0
- package/src/components/Icons/filter/svgs/filter-16.svg +3 -0
- package/src/components/Icons/filter/svgs/filter-24.svg +3 -0
- package/src/components/Icons/filter/svgs/filter-32.svg +3 -0
- package/src/components/Icons/help/help.astro +26 -0
- package/src/components/Icons/help/svgs/help-16.svg +5 -0
- package/src/components/Icons/help/svgs/help-24.svg +5 -0
- package/src/components/Icons/help/svgs/help-32.svg +4 -0
- package/src/components/Icons/home/home.astro +26 -0
- package/src/components/Icons/home/svgs/home-16.svg +3 -0
- package/src/components/Icons/home/svgs/home-24.svg +3 -0
- package/src/components/Icons/home/svgs/home-32.svg +3 -0
- package/src/components/Icons/index.ts +25 -0
- package/src/components/Icons/link/link.astro +26 -0
- package/src/components/Icons/link/svgs/link-16.svg +3 -0
- package/src/components/Icons/link/svgs/link-24.svg +3 -0
- package/src/components/Icons/link/svgs/link-32.svg +3 -0
- package/src/components/Icons/minus/minus.astro +26 -0
- package/src/components/Icons/minus/svgs/minus-16.svg +3 -0
- package/src/components/Icons/minus/svgs/minus-24.svg +3 -0
- package/src/components/Icons/minus/svgs/minus-32.svg +3 -0
- package/src/components/Icons/more/more.astro +26 -0
- package/src/components/Icons/more/svgs/more-16.svg +3 -0
- package/src/components/Icons/more/svgs/more-24.svg +3 -0
- package/src/components/Icons/more/svgs/more-32.svg +3 -0
- package/src/components/Icons/overview/overview.astro +26 -0
- package/src/components/Icons/overview/svgs/overview-16.svg +3 -0
- package/src/components/Icons/overview/svgs/overview-24.svg +3 -0
- package/src/components/Icons/overview/svgs/overview-32.svg +3 -0
- package/src/components/Icons/plus/plus.astro +26 -0
- package/src/components/Icons/plus/svgs/plus-16.svg +3 -0
- package/src/components/Icons/plus/svgs/plus-24.svg +3 -0
- package/src/components/Icons/plus/svgs/plus-32.svg +3 -0
- package/src/components/Icons/profile/profile.astro +27 -0
- package/src/components/Icons/profile/svgs/profile-16.svg +3 -0
- package/src/components/Icons/profile/svgs/profile-24.svg +3 -0
- package/src/components/Icons/profile/svgs/profile-32.svg +3 -0
- package/src/components/Icons/search/search.astro +27 -0
- package/src/components/Icons/search/svgs/search-16.svg +3 -0
- package/src/components/Icons/search/svgs/search-24.svg +3 -0
- package/src/components/Icons/search/svgs/search-32.svg +3 -0
- package/src/components/Icons/settings/settings.astro +26 -0
- package/src/components/Icons/settings/svgs/settings-16.svg +3 -0
- package/src/components/Icons/settings/svgs/settings-24.svg +3 -0
- package/src/components/Icons/settings/svgs/settings-32.svg +3 -0
- package/src/components/Icons/share/share.astro +27 -0
- package/src/components/Icons/share/svgs/share-16.svg +3 -0
- package/src/components/Icons/share/svgs/share-24.svg +3 -0
- package/src/components/Icons/share/svgs/share-32.svg +3 -0
- package/src/components/Icons/shield/shield.astro +26 -0
- package/src/components/Icons/shield/svgs/shield-16.svg +3 -0
- package/src/components/Icons/shield/svgs/shield-24.svg +3 -0
- package/src/components/Icons/shield/svgs/shield-32.svg +3 -0
- package/src/components/Icons/sort/sort.astro +38 -0
- package/src/components/Icons/sort/svgs/sort-16-ascend.svg +4 -0
- package/src/components/Icons/sort/svgs/sort-16-default.svg +3 -0
- package/src/components/Icons/sort/svgs/sort-16-descend.svg +4 -0
- package/src/components/Icons/sort/svgs/sort-24-ascend.svg +4 -0
- package/src/components/Icons/sort/svgs/sort-24-default.svg +3 -0
- package/src/components/Icons/sort/svgs/sort-24-descend.svg +4 -0
- package/src/components/Icons/sort/svgs/sort-32-ascend.svg +4 -0
- package/src/components/Icons/sort/svgs/sort-32-default.svg +3 -0
- package/src/components/Icons/sort/svgs/sort-32-descend.svg +4 -0
- package/src/components/Icons/stats/stats.astro +26 -0
- package/src/components/Icons/stats/svgs/stats-16.svg +3 -0
- package/src/components/Icons/stats/svgs/stats-24.svg +3 -0
- package/src/components/Icons/stats/svgs/stats-32.svg +3 -0
- package/src/components/Icons/upload/svgs/upload-16.svg +3 -0
- package/src/components/Icons/upload/svgs/upload-24.svg +3 -0
- package/src/components/Icons/upload/svgs/upload-32.svg +3 -0
- package/src/components/Icons/upload/upload.astro +27 -0
- package/src/components/Link/_link.scss +30 -0
- package/src/components/Link/link.astro +16 -0
- package/src/components/ListItem/_listItem.scss +21 -0
- package/src/components/ListItem/listItem.astro +15 -0
- package/src/components/ListItem/listItemSubtitle.astro +7 -0
- package/src/components/ListItem/listItemTitle.astro +7 -0
- package/src/components/Notifications/_notification.scss +61 -0
- package/src/components/Notifications/notification.astro +23 -0
- package/src/components/Tabs/_tab.scss +33 -0
- package/src/components/Tabs/tab.astro +54 -0
- package/src/components/Tabs/tabContent.astro +21 -0
- package/src/components/Tabs/tabItem.astro +41 -0
- package/src/components/Toggle/_toggle.scss +33 -0
- package/src/components/Toggle/toggle.astro +62 -0
- package/src/components/index.ts +10 -0
- package/src/index.ts +1 -0
- package/src/layouts/Layout.astro +29 -0
- package/src/pages/index.astro +338 -0
- package/src/styles/index.scss +10 -0
- package/src/styles/tokens/_colors.scss +69 -0
- package/src/styles/tokens/_spacing.scss +32 -0
- package/src/styles/tokens/_typography.scss +51 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { CloseIcon } from "../Icons";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface Props {
|
|
6
|
+
type: 'info' | 'success' | 'warning' | 'error';
|
|
7
|
+
}
|
|
8
|
+
const notificationUUID = `notification-${Math.random().toString(36).substr(2, 9)}`;
|
|
9
|
+
const { type } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={`notification notification__${type}`} role="alert" id={notificationUUID}>
|
|
13
|
+
<div class=`notification__${type}__content`>
|
|
14
|
+
<slot />
|
|
15
|
+
</div>
|
|
16
|
+
<button class={`notification__${type}__close`} aria-label="Close notification" onclick={`document.getElementById('${notificationUUID}')?.remove()`}>
|
|
17
|
+
<CloseIcon size={16} label="Close notification" />
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style lang="scss">
|
|
22
|
+
@use './_notification.scss';
|
|
23
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use '../../styles/tokens/typography' as *;
|
|
2
|
+
|
|
3
|
+
.tab {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: var(--nds-spacing-xs);
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: fit-content;
|
|
9
|
+
|
|
10
|
+
&__item {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
height: fit-content;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
padding: var(--nds-spacing-2xs);
|
|
18
|
+
@include text-base;
|
|
19
|
+
|
|
20
|
+
&--active {
|
|
21
|
+
color: var(--nds-primary);
|
|
22
|
+
|
|
23
|
+
&::after {
|
|
24
|
+
content: '';
|
|
25
|
+
display: block;
|
|
26
|
+
width: 120%;
|
|
27
|
+
height: 1px;
|
|
28
|
+
background-color: var(--nds-primary);
|
|
29
|
+
border-radius: var(--nds-radius-sm);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultActive?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { id, defaultActive } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<div class="tab" data-tab-group id={id} data-default-active={defaultActive}>
|
|
11
|
+
<slot />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
document.querySelectorAll<HTMLElement>('[data-tab-group]').forEach((group) => {
|
|
16
|
+
const defaultActive = group.dataset.defaultActive;
|
|
17
|
+
|
|
18
|
+
function setActive(itemId: string) {
|
|
19
|
+
const groupId = group.id;
|
|
20
|
+
|
|
21
|
+
group.querySelectorAll<HTMLElement>('[data-tab-item]').forEach((item) => {
|
|
22
|
+
item.classList.toggle('tab__item--active', item.dataset.tabItem === itemId);
|
|
23
|
+
item.setAttribute('aria-selected', String(item.dataset.tabItem === itemId));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
document.querySelectorAll<HTMLElement>(`[data-tab-content][data-tab-id="${groupId}"]`).forEach((content) => {
|
|
27
|
+
content.hidden = content.dataset.tabItemId !== itemId;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
group.dispatchEvent(new CustomEvent('tab:change', {
|
|
31
|
+
detail: { itemId },
|
|
32
|
+
bubbles: true,
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const firstItem = group.querySelector<HTMLElement>('[data-tab-item]');
|
|
37
|
+
const initialId = defaultActive ?? firstItem?.dataset.tabItem ?? '';
|
|
38
|
+
if (initialId) setActive(initialId);
|
|
39
|
+
|
|
40
|
+
group.addEventListener('tab-item:click', (e: Event) => {
|
|
41
|
+
setActive((e as CustomEvent<{ itemId: string }>).detail.itemId);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
group.addEventListener('tab:set', (e: Event) => {
|
|
45
|
+
setActive((e as CustomEvent<{ itemId: string }>).detail.itemId);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
(group as any).setActiveTab = (itemId: string) => setActive(itemId);
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
@use './tab';
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
itemId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { id, itemId } = Astro.props;
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
data-tab-content
|
|
12
|
+
data-tab-id={id}
|
|
13
|
+
data-tab-item-id={itemId}
|
|
14
|
+
hidden
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
@use './tab';
|
|
21
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
export interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { id } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
class="tab__item"
|
|
11
|
+
data-tab-item={id}
|
|
12
|
+
role="tab"
|
|
13
|
+
aria-selected="false"
|
|
14
|
+
tabindex="0"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
document.querySelectorAll<HTMLElement>('[data-tab-item]').forEach((item) => {
|
|
21
|
+
function notify() {
|
|
22
|
+
const group = item.closest('[data-tab-group]');
|
|
23
|
+
if (!group) return;
|
|
24
|
+
group.dispatchEvent(new CustomEvent('tab-item:click', {
|
|
25
|
+
detail: { itemId: item.dataset.tabItem },
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
item.addEventListener('click', notify);
|
|
30
|
+
item.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
31
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
notify();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss">
|
|
40
|
+
@use './tab';
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.toggle {
|
|
2
|
+
background-color: var(--nds-disabled);
|
|
3
|
+
border-radius: var(--nds-radius-full);
|
|
4
|
+
padding: var(--nds-spacing-2xs);
|
|
5
|
+
width: 50px;
|
|
6
|
+
height: 25px;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: left;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
transition: background-color 160ms ease;
|
|
12
|
+
position: relative;
|
|
13
|
+
&-switch {
|
|
14
|
+
color: var(--nds-text);
|
|
15
|
+
width: 15px;
|
|
16
|
+
height: 15px;
|
|
17
|
+
background-color: var(--nds-text);
|
|
18
|
+
border-radius: var(--nds-radius-full);
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: var(--nds-spacing-2xs);
|
|
21
|
+
top: 50%;
|
|
22
|
+
transform: translateY(-50%);
|
|
23
|
+
transition: left 160ms ease, background-color 160ms ease, transform 160ms ease;
|
|
24
|
+
}
|
|
25
|
+
&-active {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: right;
|
|
28
|
+
background-color: var(--nds-primary);
|
|
29
|
+
.toggle-switch {
|
|
30
|
+
left: calc(100% - var(--nds-spacing-2xs) - 15px);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { boolean } from 'astro:schema';
|
|
3
|
+
|
|
4
|
+
export interface Props {
|
|
5
|
+
'data-checked': boolean;
|
|
6
|
+
name?: string;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { 'data-checked': dataChecked = 'false', name = 'toggle', id } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<toggle-switch data-checked={dataChecked} data-name={name} id={id}>
|
|
14
|
+
<div class="toggle">
|
|
15
|
+
<div class="toggle-switch"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</toggle-switch>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
class ToggleSwitch extends HTMLElement {
|
|
21
|
+
private _checked: boolean = false;
|
|
22
|
+
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this._checked = this.dataset.checked === 'true';
|
|
25
|
+
this.updateUI();
|
|
26
|
+
|
|
27
|
+
this.querySelector('.toggle')?.addEventListener('click', () => {
|
|
28
|
+
this.toggle();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
toggle() {
|
|
33
|
+
this._checked = !this._checked;
|
|
34
|
+
this.updateUI();
|
|
35
|
+
|
|
36
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
37
|
+
detail: { checked: this._checked, name: this.dataset.name },
|
|
38
|
+
bubbles: true,
|
|
39
|
+
composed: true,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
set checked(value: boolean) {
|
|
43
|
+
this._checked = value;
|
|
44
|
+
this.updateUI();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get checked() {
|
|
48
|
+
return this._checked;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private updateUI() {
|
|
52
|
+
this.dataset.checked = String(this._checked);
|
|
53
|
+
this.querySelector('.toggle')?.classList.toggle('toggle-active', this._checked);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
customElements.define('toggle-switch', ToggleSwitch);
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang="scss">
|
|
61
|
+
@use './_toggle.scss';
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-barrel.mjs — do not edit manually.
|
|
2
|
+
|
|
3
|
+
export * from './Icons/index.ts';
|
|
4
|
+
export { default as Notification } from './Notifications/notification.astro';
|
|
5
|
+
export { default as Toggle } from './Toggle/toggle.astro';
|
|
6
|
+
export { default as Tab } from './Tabs/tab.astro';
|
|
7
|
+
export { default as TabItem } from './Tabs/tabItem.astro';
|
|
8
|
+
export { default as TabContent } from './Tabs/tabContent.astro';
|
|
9
|
+
export { default as Button } from './Button/button.astro';
|
|
10
|
+
export { default as Link } from './Link/link.astro';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/index.ts';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '../styles/index.scss';
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<!doctype html>
|
|
6
|
+
<html lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<meta charset="UTF-8" />
|
|
9
|
+
<meta name="viewport" content="width=device-width" />
|
|
10
|
+
<link rel="icon" href="/favicon.ico" />
|
|
11
|
+
<meta name="generator" content={Astro.generator} />
|
|
12
|
+
<title>Nova Design System</title>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<slot />
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
html,
|
|
21
|
+
body {
|
|
22
|
+
margin: 0;
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-height: 100%;
|
|
25
|
+
font-family: var(--nds-font-family-base);
|
|
26
|
+
background-color: var(--nds-page-low);
|
|
27
|
+
color: var(--nds-default);
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Layout from '../layouts/Layout.astro';
|
|
3
|
+
import Notification from '../components/Notifications/notification.astro';
|
|
4
|
+
import Toggle from '../components/Toggle/toggle.astro';
|
|
5
|
+
import Tab from '../components/Tabs/tab.astro';
|
|
6
|
+
import TabItem from '../components/Tabs/tabItem.astro';
|
|
7
|
+
import TabContent from '../components/Tabs/tabContent.astro';
|
|
8
|
+
import Button from '../components/Button/button.astro';
|
|
9
|
+
import Link from '../components/Link/link.astro';
|
|
10
|
+
import ListItem from '../components/ListItem/listItem.astro';
|
|
11
|
+
import ListItemTitle from '../components/ListItem/listItemTitle.astro';
|
|
12
|
+
import ListItemSubtitle from '../components/ListItem/listItemSubtitle.astro';
|
|
13
|
+
import {
|
|
14
|
+
Arrow2Icon, BinIcon, BurgerIcon, CalendarIcon, CheckIcon, CloseIcon,
|
|
15
|
+
CodeIcon, CubeIcon, DownloadIcon, FilterIcon, HelpIcon, HomeIcon,
|
|
16
|
+
LinkIcon, MinusIcon, MoreIcon, OverviewIcon, PlusIcon, ProfileIcon,
|
|
17
|
+
SearchIcon, SettingsIcon, ShareIcon, ShieldIcon, SortIcon, StatsIcon,
|
|
18
|
+
UploadIcon,
|
|
19
|
+
} from '../components/Icons/index.ts';
|
|
20
|
+
|
|
21
|
+
const initialChecked = true;
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<Layout>
|
|
25
|
+
<main>
|
|
26
|
+
<h1>Nova Design System</h1>
|
|
27
|
+
<section>
|
|
28
|
+
<h2>List Item</h2>
|
|
29
|
+
<div style="display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
30
|
+
<ListItem>
|
|
31
|
+
<ListItemTitle>List Item Title</ListItemTitle>
|
|
32
|
+
<ListItemSubtitle>List Item Subtitle</ListItemSubtitle>
|
|
33
|
+
</ListItem>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
<section>
|
|
37
|
+
<h2>Link</h2>
|
|
38
|
+
<div style="display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
39
|
+
<Link url="https://example.com">Example Link</Link>
|
|
40
|
+
<Link url="https://example.com" blank={true}>Example Link (opens in new tab)</Link>
|
|
41
|
+
</div>
|
|
42
|
+
</section>
|
|
43
|
+
<section>
|
|
44
|
+
<h2>Button</h2>
|
|
45
|
+
<div style="display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
46
|
+
<Button type="primary">Primary Button</Button>
|
|
47
|
+
<Button type="secondary">Secondary Button</Button>
|
|
48
|
+
<Button type="primary" disabled>disabled</Button>
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
<section>
|
|
52
|
+
<h2>Tabs</h2>
|
|
53
|
+
<div style="display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
54
|
+
<Tab id="my-tab" defaultActive="images">
|
|
55
|
+
<TabItem id="images">images</TabItem>
|
|
56
|
+
<TabItem id="videos">Videos</TabItem>
|
|
57
|
+
<TabItem id="docs">Documents</TabItem>
|
|
58
|
+
</Tab>
|
|
59
|
+
<TabContent id="my-tab" itemId="images">
|
|
60
|
+
<p>my images</p>
|
|
61
|
+
</TabContent>
|
|
62
|
+
|
|
63
|
+
<TabContent id="my-tab" itemId="videos">
|
|
64
|
+
<p>Video player here</p>
|
|
65
|
+
</TabContent>
|
|
66
|
+
|
|
67
|
+
<TabContent id="my-tab" itemId="docs">
|
|
68
|
+
<p>Document list here</p>
|
|
69
|
+
</TabContent>
|
|
70
|
+
</div>
|
|
71
|
+
</section>
|
|
72
|
+
<section>
|
|
73
|
+
<h2>Toggle</h2>
|
|
74
|
+
<div style="display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
75
|
+
<Toggle data-checked={initialChecked} data-name="notifications" id="my-toggle" />
|
|
76
|
+
<p id="toggle-state">State: {initialChecked ? 'Checked' : 'Unchecked'}</p>
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
79
|
+
<section>
|
|
80
|
+
<h2>Notifications — Error / Warning / Success / Info</h2>
|
|
81
|
+
<div style="max-width: 400px; display: flex; flex-direction: column; gap: var(--nds-spacing-md);">
|
|
82
|
+
<Notification type="error">
|
|
83
|
+
An error occurred during the operation. Please try again.
|
|
84
|
+
</Notification>
|
|
85
|
+
<Notification type="success">
|
|
86
|
+
The operation was completed successfully.
|
|
87
|
+
</Notification>
|
|
88
|
+
<Notification type="warning">
|
|
89
|
+
A warning occurred during the operation. Please check the details.
|
|
90
|
+
</Notification>
|
|
91
|
+
<Notification type="info">
|
|
92
|
+
Information about the operation.
|
|
93
|
+
</Notification>
|
|
94
|
+
</div>
|
|
95
|
+
</section>
|
|
96
|
+
<section>
|
|
97
|
+
<h2>Icon — 16 / 24 / 32</h2>
|
|
98
|
+
<div class="icon-grid">
|
|
99
|
+
<div class="icon-row">
|
|
100
|
+
<Arrow2Icon size={16} orientation="up" />
|
|
101
|
+
<Arrow2Icon size={16} orientation="right" />
|
|
102
|
+
<Arrow2Icon size={16} orientation="down" />
|
|
103
|
+
<Arrow2Icon size={16} orientation="left" />
|
|
104
|
+
</div>
|
|
105
|
+
<div class="icon-row">
|
|
106
|
+
<Arrow2Icon size={24} orientation="up" />
|
|
107
|
+
<Arrow2Icon size={24} orientation="right" />
|
|
108
|
+
<Arrow2Icon size={24} orientation="down" />
|
|
109
|
+
<Arrow2Icon size={24} orientation="left" />
|
|
110
|
+
</div>
|
|
111
|
+
<div class="icon-row">
|
|
112
|
+
<Arrow2Icon size={32} orientation="up" />
|
|
113
|
+
<Arrow2Icon size={32} orientation="right" />
|
|
114
|
+
<Arrow2Icon size={32} orientation="down" />
|
|
115
|
+
<Arrow2Icon size={32} orientation="left" />
|
|
116
|
+
</div>
|
|
117
|
+
<div class="icon-row">
|
|
118
|
+
<ProfileIcon size={16} />
|
|
119
|
+
<ProfileIcon size={24} />
|
|
120
|
+
<ProfileIcon size={32} />
|
|
121
|
+
</div>
|
|
122
|
+
<div class="icon-row">
|
|
123
|
+
<ShareIcon size={16} />
|
|
124
|
+
<ShareIcon size={24} />
|
|
125
|
+
<ShareIcon size={32} />
|
|
126
|
+
</div>
|
|
127
|
+
<div class="icon-row">
|
|
128
|
+
<SearchIcon size={16} />
|
|
129
|
+
<SearchIcon size={24} />
|
|
130
|
+
<SearchIcon size={32} />
|
|
131
|
+
</div>
|
|
132
|
+
<div class="icon-row">
|
|
133
|
+
<CloseIcon size={16} />
|
|
134
|
+
<CloseIcon size={24} />
|
|
135
|
+
<CloseIcon size={32} />
|
|
136
|
+
</div>
|
|
137
|
+
<div class="icon-row">
|
|
138
|
+
<UploadIcon size={16} />
|
|
139
|
+
<UploadIcon size={24} />
|
|
140
|
+
<UploadIcon size={32} />
|
|
141
|
+
</div>
|
|
142
|
+
<div class="icon-row">
|
|
143
|
+
<BinIcon size={16} />
|
|
144
|
+
<BinIcon size={24} />
|
|
145
|
+
<BinIcon size={32} />
|
|
146
|
+
</div>
|
|
147
|
+
<div class="icon-row">
|
|
148
|
+
<BurgerIcon size={16} />
|
|
149
|
+
<BurgerIcon size={24} />
|
|
150
|
+
<BurgerIcon size={32} />
|
|
151
|
+
</div>
|
|
152
|
+
<div class="icon-row">
|
|
153
|
+
<CalendarIcon size={16} />
|
|
154
|
+
<CalendarIcon size={24} />
|
|
155
|
+
<CalendarIcon size={32} />
|
|
156
|
+
</div>
|
|
157
|
+
<div class="icon-row">
|
|
158
|
+
<CheckIcon size={16} />
|
|
159
|
+
<CheckIcon size={24} />
|
|
160
|
+
<CheckIcon size={32} />
|
|
161
|
+
</div>
|
|
162
|
+
<div class="icon-row">
|
|
163
|
+
<CodeIcon size={16} />
|
|
164
|
+
<CodeIcon size={24} />
|
|
165
|
+
<CodeIcon size={32} />
|
|
166
|
+
</div>
|
|
167
|
+
<div class="icon-row">
|
|
168
|
+
<CubeIcon size={16} />
|
|
169
|
+
<CubeIcon size={24} />
|
|
170
|
+
<CubeIcon size={32} />
|
|
171
|
+
</div>
|
|
172
|
+
<div class="icon-row">
|
|
173
|
+
<DownloadIcon size={16} />
|
|
174
|
+
<DownloadIcon size={24} />
|
|
175
|
+
<DownloadIcon size={32} />
|
|
176
|
+
</div>
|
|
177
|
+
<div class="icon-row">
|
|
178
|
+
<FilterIcon size={16} />
|
|
179
|
+
<FilterIcon size={24} />
|
|
180
|
+
<FilterIcon size={32} />
|
|
181
|
+
</div>
|
|
182
|
+
<div class="icon-row">
|
|
183
|
+
<HelpIcon size={16} />
|
|
184
|
+
<HelpIcon size={24} />
|
|
185
|
+
<HelpIcon size={32} />
|
|
186
|
+
</div>
|
|
187
|
+
<div class="icon-row">
|
|
188
|
+
<HomeIcon size={16} />
|
|
189
|
+
<HomeIcon size={24} />
|
|
190
|
+
<HomeIcon size={32} />
|
|
191
|
+
</div>
|
|
192
|
+
<div class="icon-row">
|
|
193
|
+
<LinkIcon size={16} />
|
|
194
|
+
<LinkIcon size={24} />
|
|
195
|
+
<LinkIcon size={32} />
|
|
196
|
+
</div>
|
|
197
|
+
<div class="icon-row">
|
|
198
|
+
<MinusIcon size={16} />
|
|
199
|
+
<MinusIcon size={24} />
|
|
200
|
+
<MinusIcon size={32} />
|
|
201
|
+
</div>
|
|
202
|
+
<div class="icon-row">
|
|
203
|
+
<MoreIcon size={16} />
|
|
204
|
+
<MoreIcon size={24} />
|
|
205
|
+
<MoreIcon size={32} />
|
|
206
|
+
</div>
|
|
207
|
+
<div class="icon-row">
|
|
208
|
+
<OverviewIcon size={16} />
|
|
209
|
+
<OverviewIcon size={24} />
|
|
210
|
+
<OverviewIcon size={32} />
|
|
211
|
+
</div>
|
|
212
|
+
<div class="icon-row">
|
|
213
|
+
<PlusIcon size={16} />
|
|
214
|
+
<PlusIcon size={24} />
|
|
215
|
+
<PlusIcon size={32} />
|
|
216
|
+
</div>
|
|
217
|
+
<div class="icon-row">
|
|
218
|
+
<SettingsIcon size={16} />
|
|
219
|
+
<SettingsIcon size={24} />
|
|
220
|
+
<SettingsIcon size={32} />
|
|
221
|
+
</div>
|
|
222
|
+
<div class="icon-row">
|
|
223
|
+
<ShieldIcon size={16} />
|
|
224
|
+
<ShieldIcon size={24} />
|
|
225
|
+
<ShieldIcon size={32} />
|
|
226
|
+
</div>
|
|
227
|
+
<div class="icon-row">
|
|
228
|
+
<SortIcon size={16} variant="default" />
|
|
229
|
+
<SortIcon size={16} variant="ascend" />
|
|
230
|
+
<SortIcon size={16} variant="descend" />
|
|
231
|
+
<SortIcon size={24} variant="default" />
|
|
232
|
+
<SortIcon size={24} variant="ascend" />
|
|
233
|
+
<SortIcon size={24} variant="descend" />
|
|
234
|
+
<SortIcon size={32} variant="default" />
|
|
235
|
+
<SortIcon size={32} variant="ascend" />
|
|
236
|
+
<SortIcon size={32} variant="descend" />
|
|
237
|
+
</div>
|
|
238
|
+
<div class="icon-row">
|
|
239
|
+
<StatsIcon size={16} />
|
|
240
|
+
<StatsIcon size={24} />
|
|
241
|
+
<StatsIcon size={32} />
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</section>
|
|
245
|
+
</main>
|
|
246
|
+
</Layout>
|
|
247
|
+
|
|
248
|
+
<script>
|
|
249
|
+
const toggle = document.getElementById('my-toggle') as any;
|
|
250
|
+
const stateLabel = document.getElementById('toggle-state');
|
|
251
|
+
|
|
252
|
+
// Défaut: thème sombre
|
|
253
|
+
if (!document.documentElement.hasAttribute('data-theme')) {
|
|
254
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
255
|
+
}
|
|
256
|
+
if (stateLabel) stateLabel.textContent = 'Thème : Sombre';
|
|
257
|
+
|
|
258
|
+
toggle?.addEventListener('change', (e: CustomEvent) => {
|
|
259
|
+
const { checked } = e.detail;
|
|
260
|
+
|
|
261
|
+
if (checked) {
|
|
262
|
+
document.documentElement.setAttribute('data-theme', 'dark');
|
|
263
|
+
if (stateLabel) stateLabel.textContent = 'Thème : Sombre';
|
|
264
|
+
} else {
|
|
265
|
+
document.documentElement.setAttribute('data-theme', 'light');
|
|
266
|
+
if (stateLabel) stateLabel.textContent = 'Thème : Clair';
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
</script>
|
|
270
|
+
|
|
271
|
+
<style lang="scss" scoped>
|
|
272
|
+
|
|
273
|
+
body {
|
|
274
|
+
background-color: var(--nds-background);
|
|
275
|
+
color: var(--nds-text);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
main {
|
|
279
|
+
max-width: 900px;
|
|
280
|
+
margin: 0 auto;
|
|
281
|
+
padding: var(--nds-spacing-xl) var(--nds-spacing-md);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
h1 {
|
|
285
|
+
font-size: var(--nds-type-h1-size);
|
|
286
|
+
font-weight: var(--nds-type-h1-weight);
|
|
287
|
+
line-height: var(--nds-type-h1-line-height);
|
|
288
|
+
letter-spacing: var(--nds-type-h1-letter-spacing);
|
|
289
|
+
margin-bottom: var(--nds-spacing-xl);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
h2 {
|
|
293
|
+
font-size: var(--nds-type-h2-size);
|
|
294
|
+
font-weight: var(--nds-type-h2-weight);
|
|
295
|
+
line-height: var(--nds-type-h2-line-height);
|
|
296
|
+
letter-spacing: var(--nds-type-h2-letter-spacing);
|
|
297
|
+
color: var(--nds-text-muted);
|
|
298
|
+
margin-bottom: var(--nds-spacing-md);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
section {
|
|
302
|
+
margin-bottom: var(--nds-spacing-2xl);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.row {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-wrap: wrap;
|
|
308
|
+
align-items: center;
|
|
309
|
+
gap: var(--nds-spacing-sm);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.icon-grid {
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
gap: var(--nds-spacing-xs);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.icon-row {
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
gap: var(--nds-spacing-lg);
|
|
322
|
+
color: var(--nds-text);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.icon-name {
|
|
326
|
+
font-size: var(--nds-type-body-small-size);
|
|
327
|
+
color: var(--nds-text-muted);
|
|
328
|
+
width: 100px;
|
|
329
|
+
flex-shrink: 0;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.icon-sizes {
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
gap: var(--nds-spacing-md);
|
|
336
|
+
color: var(--nds-default);
|
|
337
|
+
}
|
|
338
|
+
</style>
|