@teseor/css 1.0.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/README.md +102 -0
- package/dist/compiled.css +4463 -0
- package/dist/index.css +4445 -0
- package/fonts/.gitkeep +9 -0
- package/package.json +38 -0
- package/src/00-config/layers/layers.scss +1 -0
- package/src/00-config/mixins/_border.scss +13 -0
- package/src/00-config/mixins/index.scss +1 -0
- package/src/00-config/tokens/_variables.scss +120 -0
- package/src/00-config/tokens/borders/index.scss +6 -0
- package/src/00-config/tokens/colors/colors.docs.json +168 -0
- package/src/00-config/tokens/colors/index.scss +25 -0
- package/src/00-config/tokens/grid/grid.docs.json +54 -0
- package/src/00-config/tokens/grid/index.scss +11 -0
- package/src/00-config/tokens/index.scss +15 -0
- package/src/00-config/tokens/input.scss +14 -0
- package/src/00-config/tokens/motion/index.scss +25 -0
- package/src/00-config/tokens/radius/index.scss +7 -0
- package/src/00-config/tokens/semantic/colors/index.scss +30 -0
- package/src/00-config/tokens/semantic/spacing/index.scss +10 -0
- package/src/00-config/tokens/shadows/index.scss +5 -0
- package/src/00-config/tokens/spacing/index.scss +15 -0
- package/src/00-config/tokens/spacing/spacing.docs.json +114 -0
- package/src/00-config/tokens/theming.docs.json +77 -0
- package/src/00-config/tokens/typography/index.scss +119 -0
- package/src/00-config/tokens/zindex/index.scss +14 -0
- package/src/01-reset/index.scss +1 -0
- package/src/01-reset/reset.scss +8 -0
- package/src/02-base/index.scss +2 -0
- package/src/02-base/root/root.scss +12 -0
- package/src/02-base/typography/typography.docs.json +94 -0
- package/src/02-base/typography/typography.scss +145 -0
- package/src/03-layout/app-shell/app-shell.api.json +26 -0
- package/src/03-layout/app-shell/app-shell.docs.json +119 -0
- package/src/03-layout/app-shell/index.scss +5 -0
- package/src/03-layout/box/box.api.json +15 -0
- package/src/03-layout/box/box.docs.json +57 -0
- package/src/03-layout/box/index.scss +34 -0
- package/src/03-layout/center/center.api.json +6 -0
- package/src/03-layout/center/center.docs.json +24 -0
- package/src/03-layout/center/index.scss +11 -0
- package/src/03-layout/cluster/cluster.api.json +10 -0
- package/src/03-layout/cluster/cluster.docs.json +129 -0
- package/src/03-layout/cluster/index.scss +18 -0
- package/src/03-layout/container/container.api.json +13 -0
- package/src/03-layout/container/index.scss +17 -0
- package/src/03-layout/flex/flex.api.json +15 -0
- package/src/03-layout/flex/flex.docs.json +56 -0
- package/src/03-layout/flex/index.scss +51 -0
- package/src/03-layout/grid/grid.api.json +10 -0
- package/src/03-layout/grid/grid.docs.json +116 -0
- package/src/03-layout/grid/index.scss +15 -0
- package/src/03-layout/index.scss +11 -0
- package/src/03-layout/main/index.scss +17 -0
- package/src/03-layout/main/main.api.json +13 -0
- package/src/03-layout/sidebar/index.scss +30 -0
- package/src/03-layout/sidebar/sidebar.api.json +13 -0
- package/src/03-layout/sidebar-nav/index.scss +209 -0
- package/src/03-layout/sidebar-nav/sidebar-nav-all.png +0 -0
- package/src/03-layout/sidebar-nav/sidebar-nav.api.json +115 -0
- package/src/03-layout/sidebar-nav/sidebar-nav.docs.json +100 -0
- package/src/03-layout/sidebar-nav/sidebar-nav.visual.spec.ts +14 -0
- package/src/03-layout/stack/index.scss +13 -0
- package/src/03-layout/stack/stack.api.json +10 -0
- package/src/03-layout/stack/stack.docs.json +131 -0
- package/src/04-components/accordion/accordion-visual.png +0 -0
- package/src/04-components/accordion/accordion.api.json +19 -0
- package/src/04-components/accordion/accordion.docs.json +51 -0
- package/src/04-components/accordion/accordion.visual.spec.ts +14 -0
- package/src/04-components/accordion/index.scss +78 -0
- package/src/04-components/alert/alert-visual.png +0 -0
- package/src/04-components/alert/alert.api.json +91 -0
- package/src/04-components/alert/alert.docs.json +79 -0
- package/src/04-components/alert/alert.visual.spec.ts +14 -0
- package/src/04-components/alert/index.scss +108 -0
- package/src/04-components/avatar/avatar-visual.png +0 -0
- package/src/04-components/avatar/avatar.api.json +70 -0
- package/src/04-components/avatar/avatar.docs.json +200 -0
- package/src/04-components/avatar/avatar.visual.spec.ts +14 -0
- package/src/04-components/avatar/index.scss +104 -0
- package/src/04-components/badge/badge-visual.png +0 -0
- package/src/04-components/badge/badge.api.json +86 -0
- package/src/04-components/badge/badge.docs.json +89 -0
- package/src/04-components/badge/badge.visual.spec.ts +14 -0
- package/src/04-components/badge/index.scss +64 -0
- package/src/04-components/breadcrumb/breadcrumb-visual.png +0 -0
- package/src/04-components/breadcrumb/breadcrumb.api.json +31 -0
- package/src/04-components/breadcrumb/breadcrumb.docs.json +59 -0
- package/src/04-components/breadcrumb/breadcrumb.visual.spec.ts +14 -0
- package/src/04-components/breadcrumb/index.scss +77 -0
- package/src/04-components/button/button-visual.png +0 -0
- package/src/04-components/button/button.api.json +138 -0
- package/src/04-components/button/button.docs.json +75 -0
- package/src/04-components/button/button.visual.spec.ts +14 -0
- package/src/04-components/button/index.scss +222 -0
- package/src/04-components/button-group/button-group-visual.png +0 -0
- package/src/04-components/button-group/button-group.api.json +11 -0
- package/src/04-components/button-group/button-group.docs.json +52 -0
- package/src/04-components/button-group/button-group.visual.spec.ts +14 -0
- package/src/04-components/button-group/index.scss +78 -0
- package/src/04-components/card/card-visual.png +0 -0
- package/src/04-components/card/card.api.json +53 -0
- package/src/04-components/card/card.docs.json +103 -0
- package/src/04-components/card/card.visual.spec.ts +14 -0
- package/src/04-components/card/index.scss +41 -0
- package/src/04-components/checkbox/checkbox-visual.png +0 -0
- package/src/04-components/checkbox/checkbox.api.json +50 -0
- package/src/04-components/checkbox/checkbox.docs.json +151 -0
- package/src/04-components/checkbox/checkbox.visual.spec.ts +14 -0
- package/src/04-components/checkbox/index.scss +104 -0
- package/src/04-components/code/code-visual.png +0 -0
- package/src/04-components/code/code.api.json +47 -0
- package/src/04-components/code/code.docs.json +84 -0
- package/src/04-components/code/code.visual.spec.ts +14 -0
- package/src/04-components/code/index.scss +64 -0
- package/src/04-components/data-list/data-list-visual.png +0 -0
- package/src/04-components/data-list/data-list.api.json +23 -0
- package/src/04-components/data-list/data-list.docs.json +79 -0
- package/src/04-components/data-list/data-list.visual.spec.ts +14 -0
- package/src/04-components/data-list/index.scss +98 -0
- package/src/04-components/dialog/dialog-visual.png +0 -0
- package/src/04-components/dialog/dialog.api.json +23 -0
- package/src/04-components/dialog/dialog.docs.json +58 -0
- package/src/04-components/dialog/dialog.visual.spec.ts +14 -0
- package/src/04-components/dialog/index.scss +74 -0
- package/src/04-components/disclosure/disclosure-visual.png +0 -0
- package/src/04-components/disclosure/disclosure.api.json +31 -0
- package/src/04-components/disclosure/disclosure.docs.json +73 -0
- package/src/04-components/disclosure/disclosure.visual.spec.ts +14 -0
- package/src/04-components/disclosure/index.scss +111 -0
- package/src/04-components/divider/divider-visual.png +0 -0
- package/src/04-components/divider/divider.api.json +30 -0
- package/src/04-components/divider/divider.docs.json +68 -0
- package/src/04-components/divider/divider.visual.spec.ts +14 -0
- package/src/04-components/divider/index.scss +115 -0
- package/src/04-components/drawer/drawer-visual.png +0 -0
- package/src/04-components/drawer/drawer.api.json +39 -0
- package/src/04-components/drawer/drawer.docs.json +78 -0
- package/src/04-components/drawer/drawer.visual.spec.ts +14 -0
- package/src/04-components/drawer/index.scss +251 -0
- package/src/04-components/field/field-visual.png +0 -0
- package/src/04-components/field/field.api.json +11 -0
- package/src/04-components/field/field.docs.json +59 -0
- package/src/04-components/field/field.visual.spec.ts +14 -0
- package/src/04-components/field/index.scss +44 -0
- package/src/04-components/form-error/form-error-visual.png +0 -0
- package/src/04-components/form-error/form-error.api.json +19 -0
- package/src/04-components/form-error/form-error.docs.json +40 -0
- package/src/04-components/form-error/form-error.visual.spec.ts +14 -0
- package/src/04-components/form-error/index.scss +31 -0
- package/src/04-components/form-helper/form-helper-visual.png +0 -0
- package/src/04-components/form-helper/form-helper.api.json +19 -0
- package/src/04-components/form-helper/form-helper.docs.json +31 -0
- package/src/04-components/form-helper/form-helper.visual.spec.ts +14 -0
- package/src/04-components/form-helper/index.scss +24 -0
- package/src/04-components/heading/heading-visual.png +0 -0
- package/src/04-components/heading/heading.api.json +83 -0
- package/src/04-components/heading/heading.docs.json +98 -0
- package/src/04-components/heading/heading.visual.spec.ts +14 -0
- package/src/04-components/heading/index.scss +61 -0
- package/src/04-components/icon/icon-visual.png +0 -0
- package/src/04-components/icon/icon.api.json +56 -0
- package/src/04-components/icon/icon.docs.json +155 -0
- package/src/04-components/icon/icon.visual.spec.ts +14 -0
- package/src/04-components/icon/index.scss +79 -0
- package/src/04-components/index.scss +41 -0
- package/src/04-components/input/index.scss +154 -0
- package/src/04-components/input/input-visual.png +0 -0
- package/src/04-components/input/input.api.json +85 -0
- package/src/04-components/input/input.docs.json +189 -0
- package/src/04-components/input/input.visual.spec.ts +14 -0
- package/src/04-components/label/index.scss +46 -0
- package/src/04-components/label/label-visual.png +0 -0
- package/src/04-components/label/label.api.json +27 -0
- package/src/04-components/label/label.docs.json +73 -0
- package/src/04-components/label/label.visual.spec.ts +14 -0
- package/src/04-components/link/index.scss +73 -0
- package/src/04-components/link/link-visual.png +0 -0
- package/src/04-components/link/link.api.json +39 -0
- package/src/04-components/link/link.docs.json +104 -0
- package/src/04-components/link/link.visual.spec.ts +14 -0
- package/src/04-components/menu/index.scss +145 -0
- package/src/04-components/menu/menu-visual.png +0 -0
- package/src/04-components/menu/menu.api.json +47 -0
- package/src/04-components/menu/menu.docs.json +81 -0
- package/src/04-components/menu/menu.visual.spec.ts +14 -0
- package/src/04-components/modal/index.scss +93 -0
- package/src/04-components/modal/modal-visual.png +0 -0
- package/src/04-components/modal/modal.api.json +43 -0
- package/src/04-components/modal/modal.docs.json +86 -0
- package/src/04-components/modal/modal.visual.spec.ts +14 -0
- package/src/04-components/overlay/index.scss +49 -0
- package/src/04-components/overlay/overlay-visual.png +0 -0
- package/src/04-components/overlay/overlay.api.json +23 -0
- package/src/04-components/overlay/overlay.docs.json +63 -0
- package/src/04-components/overlay/overlay.visual.spec.ts +14 -0
- package/src/04-components/pagination/index.scss +114 -0
- package/src/04-components/pagination/pagination-visual.png +0 -0
- package/src/04-components/pagination/pagination.api.json +39 -0
- package/src/04-components/pagination/pagination.docs.json +88 -0
- package/src/04-components/pagination/pagination.visual.spec.ts +14 -0
- package/src/04-components/popover/index.scss +114 -0
- package/src/04-components/popover/popover-visual.png +0 -0
- package/src/04-components/popover/popover.api.json +39 -0
- package/src/04-components/popover/popover.docs.json +70 -0
- package/src/04-components/popover/popover.visual.spec.ts +14 -0
- package/src/04-components/progress/index.scss +102 -0
- package/src/04-components/progress/progress-visual.png +0 -0
- package/src/04-components/progress/progress.api.json +23 -0
- package/src/04-components/progress/progress.docs.json +87 -0
- package/src/04-components/progress/progress.visual.spec.ts +14 -0
- package/src/04-components/radio/index.scss +96 -0
- package/src/04-components/radio/radio-visual.png +0 -0
- package/src/04-components/radio/radio.api.json +46 -0
- package/src/04-components/radio/radio.docs.json +159 -0
- package/src/04-components/radio/radio.visual.spec.ts +14 -0
- package/src/04-components/select/index.scss +113 -0
- package/src/04-components/select/select-visual.png +0 -0
- package/src/04-components/select/select.api.json +85 -0
- package/src/04-components/select/select.docs.json +162 -0
- package/src/04-components/select/select.visual.spec.ts +14 -0
- package/src/04-components/skeleton/index.scss +99 -0
- package/src/04-components/skeleton/skeleton-visual.png +0 -0
- package/src/04-components/skeleton/skeleton.api.json +19 -0
- package/src/04-components/skeleton/skeleton.docs.json +62 -0
- package/src/04-components/skeleton/skeleton.visual.spec.ts +14 -0
- package/src/04-components/spinner/index.scss +60 -0
- package/src/04-components/spinner/spinner-visual.png +0 -0
- package/src/04-components/spinner/spinner.api.json +63 -0
- package/src/04-components/spinner/spinner.docs.json +88 -0
- package/src/04-components/spinner/spinner.visual.spec.ts +15 -0
- package/src/04-components/status/index.scss +85 -0
- package/src/04-components/status/status-visual.png +0 -0
- package/src/04-components/status/status.api.json +19 -0
- package/src/04-components/status/status.docs.json +60 -0
- package/src/04-components/status/status.visual.spec.ts +14 -0
- package/src/04-components/table/index.scss +60 -0
- package/src/04-components/table/table-visual.png +0 -0
- package/src/04-components/table/table.api.json +27 -0
- package/src/04-components/table/table.docs.json +59 -0
- package/src/04-components/table/table.visual.spec.ts +14 -0
- package/src/04-components/tabs/index.scss +77 -0
- package/src/04-components/tabs/tabs-visual.png +0 -0
- package/src/04-components/tabs/tabs.api.json +31 -0
- package/src/04-components/tabs/tabs.docs.json +61 -0
- package/src/04-components/tabs/tabs.visual.spec.ts +14 -0
- package/src/04-components/tag/index.scss +98 -0
- package/src/04-components/tag/tag-visual.png +0 -0
- package/src/04-components/tag/tag.api.json +86 -0
- package/src/04-components/tag/tag.docs.json +108 -0
- package/src/04-components/tag/tag.visual.spec.ts +14 -0
- package/src/04-components/textarea/index.scss +124 -0
- package/src/04-components/textarea/textarea-visual.png +0 -0
- package/src/04-components/textarea/textarea.api.json +93 -0
- package/src/04-components/textarea/textarea.docs.json +191 -0
- package/src/04-components/textarea/textarea.visual.spec.ts +14 -0
- package/src/04-components/toast/index.scss +180 -0
- package/src/04-components/toast/toast-visual.png +0 -0
- package/src/04-components/toast/toast.api.json +43 -0
- package/src/04-components/toast/toast.docs.json +99 -0
- package/src/04-components/toast/toast.visual.spec.ts +14 -0
- package/src/04-components/toggle/index.scss +117 -0
- package/src/04-components/toggle/toggle-visual.png +0 -0
- package/src/04-components/toggle/toggle.api.json +43 -0
- package/src/04-components/toggle/toggle.docs.json +92 -0
- package/src/04-components/toggle/toggle.visual.spec.ts +14 -0
- package/src/04-components/tooltip/index.scss +102 -0
- package/src/04-components/tooltip/tooltip-visual.png +0 -0
- package/src/04-components/tooltip/tooltip.api.json +39 -0
- package/src/04-components/tooltip/tooltip.docs.json +63 -0
- package/src/04-components/tooltip/tooltip.visual.spec.ts +14 -0
- package/src/05-utilities/border/index.scss +21 -0
- package/src/05-utilities/display/display.api.json +6 -0
- package/src/05-utilities/display/display.docs.json +28 -0
- package/src/05-utilities/display/display.scss +195 -0
- package/src/05-utilities/index.scss +6 -0
- package/src/05-utilities/spacing/spacing.api.json +6 -0
- package/src/05-utilities/spacing/spacing.docs.json +43 -0
- package/src/05-utilities/spacing/spacing.scss +399 -0
- package/src/05-utilities/text/text.api.json +38 -0
- package/src/05-utilities/text/text.docs.json +132 -0
- package/src/05-utilities/text/text.scss +246 -0
- package/src/05-utilities/view-transition/index.scss +198 -0
- package/src/05-utilities/view-transition/view-transition.api.json +21 -0
- package/src/05-utilities/view-transition/view-transition.docs.json +63 -0
- package/src/05-utilities/visually-hidden/index.scss +38 -0
- package/src/05-utilities/visually-hidden/visually-hidden.api.json +8 -0
- package/src/05-utilities/visually-hidden/visually-hidden.docs.json +29 -0
- package/src/99-debug/grid-overlay.scss +79 -0
- package/src/99-debug/index.scss +1 -0
- package/src/index.scss +30 -0
- package/src/testing/api-types.ts +20 -0
- package/src/testing/grid-alignment.spec.ts +92 -0
- package/src/testing/html-generator.ts +151 -0
- package/src/testing/index.ts +15 -0
- package/src/testing/page-setup.ts +131 -0
- package/src/testing/rhythm.ts +146 -0
- package/src/testing/scaffold.ts +50 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "grid-primitive",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Grid",
|
|
5
|
+
"description": "CSS Grid with column variants.",
|
|
6
|
+
"api": "grid.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Columns",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-grid ui-grid--2",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "div",
|
|
19
|
+
"text": "1",
|
|
20
|
+
"style": {
|
|
21
|
+
"background": "var(--ui-color-bg-muted)",
|
|
22
|
+
"padding": "var(--ui-space-2)"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"tag": "div",
|
|
27
|
+
"text": "2",
|
|
28
|
+
"style": {
|
|
29
|
+
"background": "var(--ui-color-bg-muted)",
|
|
30
|
+
"padding": "var(--ui-space-2)"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"items": [
|
|
39
|
+
{
|
|
40
|
+
"tag": "div",
|
|
41
|
+
"class": "ui-grid ui-grid--3",
|
|
42
|
+
"children": [
|
|
43
|
+
{
|
|
44
|
+
"tag": "div",
|
|
45
|
+
"text": "1",
|
|
46
|
+
"style": {
|
|
47
|
+
"background": "var(--ui-color-bg-muted)",
|
|
48
|
+
"padding": "var(--ui-space-2)"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"tag": "div",
|
|
53
|
+
"text": "2",
|
|
54
|
+
"style": {
|
|
55
|
+
"background": "var(--ui-color-bg-muted)",
|
|
56
|
+
"padding": "var(--ui-space-2)"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"tag": "div",
|
|
61
|
+
"text": "3",
|
|
62
|
+
"style": {
|
|
63
|
+
"background": "var(--ui-color-bg-muted)",
|
|
64
|
+
"padding": "var(--ui-space-2)"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"items": [
|
|
73
|
+
{
|
|
74
|
+
"tag": "div",
|
|
75
|
+
"class": "ui-grid ui-grid--4",
|
|
76
|
+
"children": [
|
|
77
|
+
{
|
|
78
|
+
"tag": "div",
|
|
79
|
+
"text": "1",
|
|
80
|
+
"style": {
|
|
81
|
+
"background": "var(--ui-color-bg-muted)",
|
|
82
|
+
"padding": "var(--ui-space-2)"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"tag": "div",
|
|
87
|
+
"text": "2",
|
|
88
|
+
"style": {
|
|
89
|
+
"background": "var(--ui-color-bg-muted)",
|
|
90
|
+
"padding": "var(--ui-space-2)"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"tag": "div",
|
|
95
|
+
"text": "3",
|
|
96
|
+
"style": {
|
|
97
|
+
"background": "var(--ui-color-bg-muted)",
|
|
98
|
+
"padding": "var(--ui-space-2)"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"tag": "div",
|
|
103
|
+
"text": "4",
|
|
104
|
+
"style": {
|
|
105
|
+
"background": "var(--ui-color-bg-muted)",
|
|
106
|
+
"padding": "var(--ui-space-2)"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer primitives {
|
|
2
|
+
.grid {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: var(--grid-gap, var(--ui-space-4));
|
|
5
|
+
grid-template-columns: repeat(var(--grid-cols, 1), minmax(0, 1fr));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.grid--2 { --grid-cols: 2; }
|
|
9
|
+
.grid--3 { --grid-cols: 3; }
|
|
10
|
+
.grid--4 { --grid-cols: 4; }
|
|
11
|
+
|
|
12
|
+
.grid--auto {
|
|
13
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--grid-min, 16rem), 1fr));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@layer primitives {
|
|
2
|
+
.main {
|
|
3
|
+
margin-inline-start: var(--sidebar-width, calc(var(--unit) * 30));
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* When sidebar is on the end */
|
|
7
|
+
.main--sidebar-end {
|
|
8
|
+
margin-inline-start: 0;
|
|
9
|
+
margin-inline-end: var(--sidebar-width, calc(var(--unit) * 30));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* No sidebar */
|
|
13
|
+
.main--full {
|
|
14
|
+
margin-inline-start: 0;
|
|
15
|
+
margin-inline-end: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@layer primitives {
|
|
2
|
+
.sidebar {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset-block-start: 0;
|
|
7
|
+
inset-inline-start: 0;
|
|
8
|
+
z-index: var(--ui-z-sticky);
|
|
9
|
+
|
|
10
|
+
block-size: 100vh;
|
|
11
|
+
inline-size: var(--sidebar-width, calc(var(--unit) * 30));
|
|
12
|
+
overflow-y: auto;
|
|
13
|
+
|
|
14
|
+
background: var(--ui-color-bg-subtle);
|
|
15
|
+
box-shadow: inset calc(var(--ui-border-width-sm) * -1) 0 0 0 var(--ui-color-border);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Width modifiers */
|
|
19
|
+
.sidebar--sm { --sidebar-width: calc(var(--unit) * 24); }
|
|
20
|
+
.sidebar--md { --sidebar-width: calc(var(--unit) * 30); }
|
|
21
|
+
.sidebar--lg { --sidebar-width: calc(var(--unit) * 40); }
|
|
22
|
+
|
|
23
|
+
/* Position modifier - sidebar on end (right in LTR) */
|
|
24
|
+
.sidebar--end {
|
|
25
|
+
inset-inline-start: auto;
|
|
26
|
+
inset-inline-end: 0;
|
|
27
|
+
|
|
28
|
+
box-shadow: inset var(--ui-border-width-sm) 0 0 0 var(--ui-color-border);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// Sidebar Navigation
|
|
2
|
+
// Primary navigation for sidebar with groups, items, and nested levels
|
|
3
|
+
|
|
4
|
+
@layer primitives {
|
|
5
|
+
.sidebar-nav {
|
|
6
|
+
// Tokens
|
|
7
|
+
--_width: var(--ui-sidebar-nav-width, calc(var(--ui-unit) * 30));
|
|
8
|
+
--_bg: var(--ui-sidebar-nav-bg, var(--ui-color-bg-subtle));
|
|
9
|
+
--_border-color: var(--ui-sidebar-nav-border-color, var(--ui-color-border));
|
|
10
|
+
--_padding: var(--ui-sidebar-nav-padding, var(--ui-space-2));
|
|
11
|
+
|
|
12
|
+
// Styles
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
|
|
16
|
+
block-size: 100%;
|
|
17
|
+
inline-size: var(--_width);
|
|
18
|
+
|
|
19
|
+
background: var(--_bg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Header - sticky at top
|
|
23
|
+
.sidebar-nav__header {
|
|
24
|
+
--_padding: var(--ui-sidebar-nav-header-padding, var(--ui-space-2));
|
|
25
|
+
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
|
|
28
|
+
padding: var(--_padding);
|
|
29
|
+
|
|
30
|
+
box-shadow: inset 0 calc(var(--ui-border-width-sm) * -1) 0 0 var(--_border-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Content - scrollable
|
|
34
|
+
.sidebar-nav__content {
|
|
35
|
+
flex: 1;
|
|
36
|
+
|
|
37
|
+
padding: var(--_padding);
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Footer - sticky at bottom
|
|
42
|
+
.sidebar-nav__footer {
|
|
43
|
+
--_padding: var(--ui-sidebar-nav-footer-padding, var(--ui-space-2));
|
|
44
|
+
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
|
|
47
|
+
padding: var(--_padding);
|
|
48
|
+
|
|
49
|
+
box-shadow: inset 0 var(--ui-border-width-sm) 0 0 var(--_border-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Group container
|
|
53
|
+
.sidebar-nav__group {
|
|
54
|
+
margin-block-end: var(--ui-space-2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Group label (section heading)
|
|
58
|
+
.sidebar-nav__group-label {
|
|
59
|
+
--_font-size: var(--ui-sidebar-nav-group-label-size, var(--ui-size-xs));
|
|
60
|
+
--_color: var(--ui-sidebar-nav-group-label-color, var(--ui-color-text-muted));
|
|
61
|
+
--_weight: var(--ui-sidebar-nav-group-label-weight, var(--ui-weight-bold));
|
|
62
|
+
|
|
63
|
+
display: block;
|
|
64
|
+
|
|
65
|
+
padding: var(--ui-space-1) var(--ui-space-2);
|
|
66
|
+
margin: 0;
|
|
67
|
+
|
|
68
|
+
font-size: var(--_font-size);
|
|
69
|
+
font-weight: var(--_weight);
|
|
70
|
+
letter-spacing: 0.05em;
|
|
71
|
+
text-transform: uppercase;
|
|
72
|
+
color: var(--_color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Group items container
|
|
76
|
+
.sidebar-nav__group-items {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: var(--ui-space-half);
|
|
80
|
+
|
|
81
|
+
padding: 0;
|
|
82
|
+
margin: 0;
|
|
83
|
+
list-style: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Subgroup label (nested section)
|
|
87
|
+
.sidebar-nav__subgroup-label {
|
|
88
|
+
display: block;
|
|
89
|
+
|
|
90
|
+
padding: var(--ui-space-1) var(--ui-space-2);
|
|
91
|
+
margin: 0;
|
|
92
|
+
margin-block-start: var(--ui-space-1);
|
|
93
|
+
|
|
94
|
+
font-size: var(--ui-size-xs);
|
|
95
|
+
font-weight: var(--ui-weight-medium);
|
|
96
|
+
color: var(--ui-color-text-muted);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Nav item (link wrapper)
|
|
100
|
+
.sidebar-nav__item {
|
|
101
|
+
--_height: var(--ui-sidebar-nav-item-height, var(--ui-row-2));
|
|
102
|
+
--_padding-inline: var(--ui-sidebar-nav-item-padding-inline, var(--ui-space-2));
|
|
103
|
+
--_font-size: var(--ui-sidebar-nav-item-size, var(--ui-size-sm));
|
|
104
|
+
--_color: var(--ui-sidebar-nav-item-color, var(--ui-color-text));
|
|
105
|
+
--_bg: var(--ui-sidebar-nav-item-bg, transparent);
|
|
106
|
+
--_radius: var(--ui-sidebar-nav-item-radius, var(--ui-radius-sm));
|
|
107
|
+
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: var(--ui-space-1);
|
|
111
|
+
|
|
112
|
+
min-block-size: var(--_height);
|
|
113
|
+
padding-inline: var(--_padding-inline);
|
|
114
|
+
|
|
115
|
+
font-size: var(--_font-size);
|
|
116
|
+
font-weight: var(--_weight, normal);
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
color: var(--_color);
|
|
119
|
+
|
|
120
|
+
background: var(--_bg);
|
|
121
|
+
border-radius: var(--_radius);
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
|
|
124
|
+
transition:
|
|
125
|
+
background var(--ui-duration-fast) var(--ui-easing-default),
|
|
126
|
+
color var(--ui-duration-fast) var(--ui-easing-default);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.sidebar-nav__item:hover {
|
|
130
|
+
--_bg: var(--ui-sidebar-nav-item-hover-bg, var(--ui-color-bg-muted));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.sidebar-nav__item:visited {
|
|
134
|
+
color: var(--_color);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.sidebar-nav__item:focus-visible {
|
|
138
|
+
outline: 2px solid var(--ui-color-focus);
|
|
139
|
+
outline-offset: -2px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Active state
|
|
143
|
+
.sidebar-nav__item--active {
|
|
144
|
+
--_bg: var(--ui-sidebar-nav-item-active-bg, var(--ui-color-primary-subtle));
|
|
145
|
+
--_color: var(--ui-sidebar-nav-item-active-color, var(--ui-color-primary));
|
|
146
|
+
--_weight: var(--ui-sidebar-nav-item-active-weight, var(--ui-weight-medium));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Nested item indent
|
|
150
|
+
.sidebar-nav__item--nested {
|
|
151
|
+
--_padding-inline-start: var(--ui-sidebar-nav-item-nested-indent, var(--ui-space-4));
|
|
152
|
+
|
|
153
|
+
padding-inline-start: var(--_padding-inline-start);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Disabled state
|
|
157
|
+
.sidebar-nav__item--disabled {
|
|
158
|
+
opacity: 0.5;
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Icon container
|
|
164
|
+
.sidebar-nav__icon {
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-shrink: 0;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
|
|
170
|
+
block-size: var(--ui-size-md);
|
|
171
|
+
inline-size: var(--ui-size-md);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Label text
|
|
175
|
+
.sidebar-nav__label {
|
|
176
|
+
flex: 1;
|
|
177
|
+
|
|
178
|
+
min-inline-size: 0;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
white-space: nowrap;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Badge (counts, status)
|
|
186
|
+
.sidebar-nav__badge {
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
|
|
189
|
+
margin-inline-start: auto;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Collapsed mode - icon only
|
|
193
|
+
.sidebar-nav--collapsed {
|
|
194
|
+
--_width: var(--ui-sidebar-nav-width-collapsed, var(--ui-row-3));
|
|
195
|
+
|
|
196
|
+
.sidebar-nav__label,
|
|
197
|
+
.sidebar-nav__badge,
|
|
198
|
+
.sidebar-nav__group-label,
|
|
199
|
+
.sidebar-nav__subgroup-label {
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.sidebar-nav__item {
|
|
204
|
+
justify-content: center;
|
|
205
|
+
|
|
206
|
+
padding-inline: var(--ui-space-1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sidebar-nav",
|
|
3
|
+
"baseClass": "sidebar-nav",
|
|
4
|
+
"element": "nav",
|
|
5
|
+
"description": "Navigation component for sidebars with support for groups, nested items, icons, and badges",
|
|
6
|
+
"modifiers": {
|
|
7
|
+
"collapsed": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Icon-only mode, hides labels and badges"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"elements": {
|
|
13
|
+
"header": {
|
|
14
|
+
"element": "div",
|
|
15
|
+
"description": "Sticky header section"
|
|
16
|
+
},
|
|
17
|
+
"content": {
|
|
18
|
+
"element": "div",
|
|
19
|
+
"description": "Scrollable content area"
|
|
20
|
+
},
|
|
21
|
+
"footer": {
|
|
22
|
+
"element": "div",
|
|
23
|
+
"description": "Sticky footer section"
|
|
24
|
+
},
|
|
25
|
+
"group": {
|
|
26
|
+
"element": "div",
|
|
27
|
+
"description": "Navigation group container"
|
|
28
|
+
},
|
|
29
|
+
"group-label": {
|
|
30
|
+
"element": "span",
|
|
31
|
+
"description": "Group section heading"
|
|
32
|
+
},
|
|
33
|
+
"group-items": {
|
|
34
|
+
"element": "ul",
|
|
35
|
+
"description": "List of nav items in a group"
|
|
36
|
+
},
|
|
37
|
+
"subgroup-label": {
|
|
38
|
+
"element": "span",
|
|
39
|
+
"description": "Nested subgroup heading"
|
|
40
|
+
},
|
|
41
|
+
"item": {
|
|
42
|
+
"element": "a",
|
|
43
|
+
"description": "Navigation link",
|
|
44
|
+
"modifiers": {
|
|
45
|
+
"active": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Current/active page state"
|
|
48
|
+
},
|
|
49
|
+
"disabled": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Non-interactive item"
|
|
52
|
+
},
|
|
53
|
+
"nested": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Indented nested item"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"icon": {
|
|
60
|
+
"element": "span",
|
|
61
|
+
"description": "Icon container"
|
|
62
|
+
},
|
|
63
|
+
"label": {
|
|
64
|
+
"element": "span",
|
|
65
|
+
"description": "Text label"
|
|
66
|
+
},
|
|
67
|
+
"badge": {
|
|
68
|
+
"element": "span",
|
|
69
|
+
"description": "Badge or count indicator"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"accessibility": {
|
|
73
|
+
"role": "navigation",
|
|
74
|
+
"aria-label": "Required - descriptive label for the navigation",
|
|
75
|
+
"aria-current": "Use 'page' on active item link",
|
|
76
|
+
"keyboard": "Tab navigation between focusable items"
|
|
77
|
+
},
|
|
78
|
+
"customization": [
|
|
79
|
+
{
|
|
80
|
+
"token": "--ui-sidebar-nav-width",
|
|
81
|
+
"default": "calc(var(--ui-unit) * 30)",
|
|
82
|
+
"description": "Default sidebar width"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"token": "--ui-sidebar-nav-width-collapsed",
|
|
86
|
+
"default": "var(--ui-row-3)",
|
|
87
|
+
"description": "Width in collapsed/icon-only mode"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"token": "--ui-sidebar-nav-bg",
|
|
91
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
92
|
+
"description": "Background color"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"token": "--ui-sidebar-nav-item-height",
|
|
96
|
+
"default": "var(--ui-row-2)",
|
|
97
|
+
"description": "Nav item height"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"token": "--ui-sidebar-nav-item-hover-bg",
|
|
101
|
+
"default": "var(--ui-color-bg-muted)",
|
|
102
|
+
"description": "Item hover background"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"token": "--ui-sidebar-nav-item-active-bg",
|
|
106
|
+
"default": "var(--ui-color-primary-subtle)",
|
|
107
|
+
"description": "Active item background"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"token": "--ui-sidebar-nav-item-active-color",
|
|
111
|
+
"default": "var(--ui-color-primary)",
|
|
112
|
+
"description": "Active item text color"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "sidebar-nav",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Sidebar Nav",
|
|
5
|
+
"description": "Navigation component for sidebars with support for groups, nested items, icons, and badges.",
|
|
6
|
+
"api": "./sidebar-nav.api.json",
|
|
7
|
+
"customization": [
|
|
8
|
+
{
|
|
9
|
+
"token": "--ui-sidebar-nav-width",
|
|
10
|
+
"default": "calc(var(--ui-unit) * 30)",
|
|
11
|
+
"description": "Default sidebar width"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"token": "--ui-sidebar-nav-width-collapsed",
|
|
15
|
+
"default": "var(--ui-row-3)",
|
|
16
|
+
"description": "Width in collapsed mode"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"token": "--ui-sidebar-nav-bg",
|
|
20
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
21
|
+
"description": "Background color"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"token": "--ui-sidebar-nav-item-height",
|
|
25
|
+
"default": "var(--ui-row-2)",
|
|
26
|
+
"description": "Nav item height"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"token": "--ui-sidebar-nav-item-hover-bg",
|
|
30
|
+
"default": "var(--ui-color-bg-muted)",
|
|
31
|
+
"description": "Item hover background"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"token": "--ui-sidebar-nav-item-active-bg",
|
|
35
|
+
"default": "var(--ui-color-primary-subtle)",
|
|
36
|
+
"description": "Active item background"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"token": "--ui-sidebar-nav-item-active-color",
|
|
40
|
+
"default": "var(--ui-color-primary)",
|
|
41
|
+
"description": "Active item text color"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"sections": [
|
|
45
|
+
{
|
|
46
|
+
"title": "Basic",
|
|
47
|
+
"description": "Simple navigation with grouped items.",
|
|
48
|
+
"examples": [
|
|
49
|
+
{
|
|
50
|
+
"html": "<nav class=\"ui-sidebar-nav\" aria-label=\"Main navigation\" style=\"block-size: 400px;\">\n <div class=\"ui-sidebar-nav__header\">\n <strong>App Name</strong>\n </div>\n <div class=\"ui-sidebar-nav__content\">\n <div class=\"ui-sidebar-nav__group\">\n <span class=\"ui-sidebar-nav__group-label\">Main</span>\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--active\" aria-current=\"page\"><span class=\"ui-sidebar-nav__label\">Dashboard</span></a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Projects</span></a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Tasks</span></a></li>\n </ul>\n </div>\n <div class=\"ui-sidebar-nav__group\">\n <span class=\"ui-sidebar-nav__group-label\">Settings</span>\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Profile</span></a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Preferences</span></a></li>\n </ul>\n </div>\n </div>\n <div class=\"ui-sidebar-nav__footer\">\n <a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Logout</span></a>\n </div>\n</nav>"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"title": "With Icons",
|
|
56
|
+
"description": "Navigation items with icons for visual clarity.",
|
|
57
|
+
"examples": [
|
|
58
|
+
{
|
|
59
|
+
"html": "<nav class=\"ui-sidebar-nav\" aria-label=\"Navigation\" style=\"block-size: 300px;\">\n <div class=\"ui-sidebar-nav__content\">\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--active\" aria-current=\"page\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Home</span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Users</span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Settings</span>\n </a></li>\n </ul>\n </div>\n</nav>"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"title": "With Badges",
|
|
65
|
+
"description": "Navigation items with badges for counts or status indicators.",
|
|
66
|
+
"examples": [
|
|
67
|
+
{
|
|
68
|
+
"html": "<nav class=\"ui-sidebar-nav\" aria-label=\"Navigation\" style=\"block-size: 200px;\">\n <div class=\"ui-sidebar-nav__content\">\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\">\n <span class=\"ui-sidebar-nav__label\">Inbox</span>\n <span class=\"ui-sidebar-nav__badge\"><span class=\"ui-badge ui-badge--primary\">12</span></span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\">\n <span class=\"ui-sidebar-nav__label\">Notifications</span>\n <span class=\"ui-sidebar-nav__badge\"><span class=\"ui-badge ui-badge--danger\">3</span></span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\">\n <span class=\"ui-sidebar-nav__label\">Updates</span>\n <span class=\"ui-sidebar-nav__badge\"><span class=\"ui-status ui-status--success\"></span></span>\n </a></li>\n </ul>\n </div>\n</nav>"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"title": "Nested Items",
|
|
74
|
+
"description": "Navigation with nested/indented items for sub-sections.",
|
|
75
|
+
"examples": [
|
|
76
|
+
{
|
|
77
|
+
"html": "<nav class=\"ui-sidebar-nav\" aria-label=\"Navigation\" style=\"block-size: 280px;\">\n <div class=\"ui-sidebar-nav__content\">\n <div class=\"ui-sidebar-nav__group\">\n <span class=\"ui-sidebar-nav__group-label\">Components</span>\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><span class=\"ui-sidebar-nav__subgroup-label\">Actions</span></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--nested\"><span class=\"ui-sidebar-nav__label\">Button</span></a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--nested ui-sidebar-nav__item--active\" aria-current=\"page\"><span class=\"ui-sidebar-nav__label\">Button Group</span></a></li>\n <li><span class=\"ui-sidebar-nav__subgroup-label\">Forms</span></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--nested\"><span class=\"ui-sidebar-nav__label\">Input</span></a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--nested\"><span class=\"ui-sidebar-nav__label\">Select</span></a></li>\n </ul>\n </div>\n </div>\n</nav>"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"title": "Collapsed",
|
|
83
|
+
"description": "Icon-only mode for compact sidebars.",
|
|
84
|
+
"examples": [
|
|
85
|
+
{
|
|
86
|
+
"html": "<nav class=\"ui-sidebar-nav ui-sidebar-nav--collapsed\" aria-label=\"Navigation\" style=\"block-size: 200px;\">\n <div class=\"ui-sidebar-nav__content\">\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item ui-sidebar-nav__item--active\" aria-current=\"page\" aria-label=\"Home\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Home</span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\" aria-label=\"Users\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\"/><circle cx=\"9\" cy=\"7\" r=\"4\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Users</span>\n </a></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\" aria-label=\"Settings\">\n <span class=\"ui-sidebar-nav__icon\"><svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg></span>\n <span class=\"ui-sidebar-nav__label\">Settings</span>\n </a></li>\n </ul>\n </div>\n</nav>"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "Disabled Items",
|
|
92
|
+
"description": "Non-interactive navigation items.",
|
|
93
|
+
"examples": [
|
|
94
|
+
{
|
|
95
|
+
"html": "<nav class=\"ui-sidebar-nav\" aria-label=\"Navigation\" style=\"block-size: 180px;\">\n <div class=\"ui-sidebar-nav__content\">\n <ul class=\"ui-sidebar-nav__group-items\">\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Active Link</span></a></li>\n <li><span class=\"ui-sidebar-nav__item ui-sidebar-nav__item--disabled\"><span class=\"ui-sidebar-nav__label\">Disabled Link</span></span></li>\n <li><a href=\"#\" class=\"ui-sidebar-nav__item\"><span class=\"ui-sidebar-nav__label\">Another Link</span></a></li>\n </ul>\n </div>\n</nav>"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'sidebar-nav.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('sidebar-nav visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'sidebar-nav__item');
|
|
11
|
+
await saveForLostPixel(page, 'sidebar-nav');
|
|
12
|
+
await expect(page.locator('.test-container')).toHaveScreenshot('sidebar-nav-all.png');
|
|
13
|
+
});
|
|
14
|
+
});
|