@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,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "breadcrumb",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Breadcrumb",
|
|
5
|
+
"description": "Navigation hierarchy showing current page location in site structure.",
|
|
6
|
+
"api": "./breadcrumb.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<nav class=\"ui-breadcrumb\" aria-label=\"Breadcrumb\"><ol class=\"ui-breadcrumb\"><li class=\"ui-breadcrumb__item\"><a href=\"#\" class=\"ui-breadcrumb__link\">Home</a></li><li class=\"ui-breadcrumb__item\"><a href=\"#\" class=\"ui-breadcrumb__link\">Products</a></li><li class=\"ui-breadcrumb__item\"><span class=\"ui-breadcrumb__current\" aria-current=\"page\">Shoes</span></li></ol></nav>",
|
|
13
|
+
"code": "<nav aria-label=\"Breadcrumb\">\n <ol class=\"ui-breadcrumb\">\n <li class=\"ui-breadcrumb__item\">\n <a href=\"#\" class=\"ui-breadcrumb__link\">Home</a>\n </li>\n <li class=\"ui-breadcrumb__item\">\n <a href=\"#\" class=\"ui-breadcrumb__link\">Products</a>\n </li>\n <li class=\"ui-breadcrumb__item\">\n <span aria-current=\"page\">Shoes</span>\n </li>\n </ol>\n</nav>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "With Icons",
|
|
19
|
+
"examples": [
|
|
20
|
+
{
|
|
21
|
+
"html": "<nav aria-label=\"Breadcrumb\"><ol class=\"ui-breadcrumb\"><li class=\"ui-breadcrumb__item\"><a href=\"#\" class=\"ui-breadcrumb__link\"><svg class=\"ui-icon ui-icon--sm\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\"/></svg></a></li><li class=\"ui-breadcrumb__item\"><a href=\"#\" class=\"ui-breadcrumb__link\">Settings</a></li><li class=\"ui-breadcrumb__item\"><span class=\"ui-breadcrumb__current\" aria-current=\"page\">Profile</span></li></ol></nav>",
|
|
22
|
+
"code": "<ol class=\"ui-breadcrumb\">\n <li class=\"ui-breadcrumb__item\">\n <a href=\"#\" class=\"ui-breadcrumb__link\">\n <svg class=\"ui-icon\">...</svg>\n </a>\n </li>\n ...\n</ol>"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"customization": [
|
|
28
|
+
{
|
|
29
|
+
"token": "--ui-breadcrumb-height",
|
|
30
|
+
"default": "var(--ui-row-1)",
|
|
31
|
+
"description": "Container height"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"token": "--ui-breadcrumb-gap",
|
|
35
|
+
"default": "var(--unit)",
|
|
36
|
+
"description": "Gap between items"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"token": "--ui-breadcrumb-separator",
|
|
40
|
+
"default": "\"/\"",
|
|
41
|
+
"description": "Separator character"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"token": "--ui-breadcrumb-separator-color",
|
|
45
|
+
"default": "var(--ui-color-text-muted)",
|
|
46
|
+
"description": "Separator color"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"token": "--ui-breadcrumb-link-color",
|
|
50
|
+
"default": "var(--ui-color-text-muted)",
|
|
51
|
+
"description": "Link color"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"token": "--ui-breadcrumb-current-color",
|
|
55
|
+
"default": "var(--ui-color-text)",
|
|
56
|
+
"description": "Current page color"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
@@ -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, 'breadcrumb.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('breadcrumb visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'breadcrumb');
|
|
11
|
+
await saveForLostPixel(page, 'breadcrumb');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('breadcrumb.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Breadcrumb - navigation hierarchy
|
|
4
|
+
// Shows current page location in site structure
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.breadcrumb {
|
|
8
|
+
--_height: var(--ui-breadcrumb-height, var(--ui-row-1, #{t.$row}));
|
|
9
|
+
--_gap: var(--ui-breadcrumb-gap, calc(#{t.$unit} * 1));
|
|
10
|
+
--_separator-color: var(--ui-breadcrumb-separator-color, var(--ui-color-text-muted));
|
|
11
|
+
--_link-color: var(--ui-breadcrumb-link-color, var(--ui-color-text-muted));
|
|
12
|
+
--_current-color: var(--ui-breadcrumb-current-color, var(--ui-color-text));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@layer components.styles {
|
|
17
|
+
.breadcrumb {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--_gap);
|
|
22
|
+
|
|
23
|
+
block-size: var(--_height);
|
|
24
|
+
padding: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
|
|
27
|
+
font-size: var(--ui-font-size-sm, #{t.$font-size-sm});
|
|
28
|
+
line-height: 1;
|
|
29
|
+
|
|
30
|
+
list-style: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.breadcrumb__item {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--_gap);
|
|
37
|
+
|
|
38
|
+
block-size: var(--_height);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Separator after each item except last
|
|
42
|
+
.breadcrumb__item:not(:last-child)::after {
|
|
43
|
+
|
|
44
|
+
content: var(--ui-breadcrumb-separator, "/");
|
|
45
|
+
|
|
46
|
+
color: var(--_separator-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.breadcrumb__link {
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
color: var(--_link-color);
|
|
52
|
+
|
|
53
|
+
transition: color var(--ui-duration-fast, 100ms) var(--ui-ease-default, ease);
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
text-decoration: underline;
|
|
57
|
+
color: var(--ui-color-primary);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Current page (last item)
|
|
62
|
+
.breadcrumb__item:last-child .breadcrumb__link,
|
|
63
|
+
.breadcrumb__current {
|
|
64
|
+
color: var(--_current-color);
|
|
65
|
+
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Collapsed state - use data attribute on items to hide
|
|
70
|
+
.breadcrumb__item--hidden {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.breadcrumb__ellipsis {
|
|
75
|
+
color: var(--_separator-color);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "button",
|
|
3
|
+
"element": "button",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
},
|
|
8
|
+
"variant": {
|
|
9
|
+
"values": ["secondary", "ghost", "outline", "danger", "link"]
|
|
10
|
+
},
|
|
11
|
+
"icon": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
},
|
|
14
|
+
"radius": {
|
|
15
|
+
"values": ["radius-none", "radius-sm", "radius-lg", "radius-full"]
|
|
16
|
+
},
|
|
17
|
+
"block": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"loading": {
|
|
21
|
+
"type": "boolean"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"cssVars": [
|
|
25
|
+
{
|
|
26
|
+
"name": "--ui-button-height",
|
|
27
|
+
"default": "var(--ui-row-2)"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "--ui-button-padding-x",
|
|
31
|
+
"default": "var(--ui-space-2)"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "--ui-button-font-size",
|
|
35
|
+
"default": "var(--ui-font-size-sm)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "--ui-button-font-weight",
|
|
39
|
+
"default": "var(--ui-weight-medium)"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "--ui-button-radius",
|
|
43
|
+
"default": "var(--ui-radius-md)"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "--ui-button-bg",
|
|
47
|
+
"default": "var(--ui-color-primary)"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "--ui-button-bg-hover",
|
|
51
|
+
"default": "var(--ui-color-primary-dark)"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "--ui-button-text",
|
|
55
|
+
"default": "var(--ui-color-text-inverse)"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "--ui-button-height-sm",
|
|
59
|
+
"default": "var(--row)"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "--ui-button-font-size-sm",
|
|
63
|
+
"default": "var(--ui-font-size-xs)"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "--ui-button-height-lg",
|
|
67
|
+
"default": "var(--row)"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "--ui-button-padding-x-lg",
|
|
71
|
+
"default": "var(--ui-space-3)"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "--ui-button-font-size-lg",
|
|
75
|
+
"default": "var(--ui-font-size-md)"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "--ui-button-secondary-bg",
|
|
79
|
+
"default": "var(--ui-color-bg-muted)"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "--ui-button-secondary-bg-hover",
|
|
83
|
+
"default": "var(--ui-color-border-strong)"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "--ui-button-secondary-text",
|
|
87
|
+
"default": "var(--ui-color-text)"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "--ui-button-ghost-bg",
|
|
91
|
+
"default": "transparent"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "--ui-button-ghost-bg-hover",
|
|
95
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "--ui-button-ghost-text",
|
|
99
|
+
"default": "var(--ui-color-primary)"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "--ui-button-outline-bg",
|
|
103
|
+
"default": "transparent"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "--ui-button-outline-bg-hover",
|
|
107
|
+
"default": "var(--ui-color-primary)"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "--ui-button-outline-text",
|
|
111
|
+
"default": "var(--ui-color-primary)"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "--ui-button-outline-text-hover",
|
|
115
|
+
"default": "var(--ui-color-text-inverse)"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "--ui-button-outline-border",
|
|
119
|
+
"default": "var(--ui-border-width-sm)"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "--ui-button-danger-bg",
|
|
123
|
+
"default": "var(--ui-color-danger)"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "--ui-button-danger-bg-hover",
|
|
127
|
+
"default": "#{t.$color-danger-dark}"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "--ui-button-link-text",
|
|
131
|
+
"default": "var(--ui-color-primary)"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "--ui-button-link-text-hover",
|
|
135
|
+
"default": "var(--ui-color-primary-dark)"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": "./button.api.json",
|
|
3
|
+
"description": "Buttons trigger actions. Use primary for main CTA, secondary for less important actions.",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"usage": "Default is 32px (2 rows). Use small for dense UIs, large for prominent CTAs."
|
|
7
|
+
},
|
|
8
|
+
"variant": {
|
|
9
|
+
"usage": "Primary for main actions. Secondary for less important. Outline for subtle. Ghost for toolbar. Danger for destructive. Link for inline."
|
|
10
|
+
},
|
|
11
|
+
"icon": {
|
|
12
|
+
"usage": "Square icon-only buttons. Always add aria-label for accessibility."
|
|
13
|
+
},
|
|
14
|
+
"radius": {
|
|
15
|
+
"usage": "Override border radius. Use radius-full for pill-shaped buttons."
|
|
16
|
+
},
|
|
17
|
+
"block": {
|
|
18
|
+
"usage": "Full width button. Use for mobile or form submit."
|
|
19
|
+
},
|
|
20
|
+
"loading": {
|
|
21
|
+
"usage": "Shows spinner animation. Button becomes non-interactive."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"sections": [
|
|
25
|
+
{
|
|
26
|
+
"title": "Icon Button",
|
|
27
|
+
"description": "Square icon-only buttons. Use with SVG icons from Lucide or similar sets.",
|
|
28
|
+
"examples": [
|
|
29
|
+
{
|
|
30
|
+
"layout": "cluster",
|
|
31
|
+
"items": [
|
|
32
|
+
{
|
|
33
|
+
"tag": "button",
|
|
34
|
+
"class": "ui-button ui-button--icon ui-button--sm",
|
|
35
|
+
"html": "<svg class=\"ui-icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"tag": "button",
|
|
39
|
+
"class": "ui-button ui-button--icon",
|
|
40
|
+
"html": "<svg class=\"ui-icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M5 12h14\"/><path d=\"M12 5v14\"/></svg>"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"tag": "button",
|
|
44
|
+
"class": "ui-button ui-button--icon ui-button--lg",
|
|
45
|
+
"html": "<svg class=\"ui-icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/></svg>"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"code": "<button class=\"ui-button ui-button--icon ui-button--sm\">\n <svg class=\"ui-icon\"><!-- x icon --></svg>\n</button>\n<button class=\"ui-button ui-button--icon\">\n <svg class=\"ui-icon\"><!-- plus icon --></svg>\n</button>\n<button class=\"ui-button ui-button--icon ui-button--lg\">\n <svg class=\"ui-icon\"><!-- search icon --></svg>\n</button>"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"title": "With Icon",
|
|
54
|
+
"description": "Buttons with icon and text. Use ui-button__icon element with --start or --end modifier.",
|
|
55
|
+
"examples": [
|
|
56
|
+
{
|
|
57
|
+
"layout": "cluster",
|
|
58
|
+
"items": [
|
|
59
|
+
{
|
|
60
|
+
"tag": "button",
|
|
61
|
+
"class": "ui-button",
|
|
62
|
+
"html": "<svg class=\"ui-icon ui-button__icon ui-button__icon--start\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M5 12h14\"/><path d=\"M12 5v14\"/></svg> Add Item"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"tag": "button",
|
|
66
|
+
"class": "ui-button ui-button--secondary",
|
|
67
|
+
"html": "Next <svg class=\"ui-icon ui-button__icon ui-button__icon--end\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"m9 18 6-6-6-6\"/></svg>"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"code": "<button class=\"ui-button\">\n <svg class=\"ui-icon ui-button__icon ui-button__icon--start\"><!-- plus --></svg>\n Add Item\n</button>\n<button class=\"ui-button ui-button--secondary\">\n Next\n <svg class=\"ui-icon ui-button__icon ui-button__icon--end\"><!-- chevron-right --></svg>\n</button>"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
@@ -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, 'button.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('button visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'button');
|
|
11
|
+
await saveForLostPixel(page, 'button');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('button.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component button
|
|
4
|
+
// @element button
|
|
5
|
+
|
|
6
|
+
// Token definitions - what makes each variant
|
|
7
|
+
@layer components.tokens {
|
|
8
|
+
.button {
|
|
9
|
+
--_height: var(--ui-button-height, var(--ui-row-2, #{t.$row-2}));
|
|
10
|
+
--_padding-x: var(--ui-button-padding-x, var(--ui-space-2, #{t.$space-2}));
|
|
11
|
+
--_font-size: var(--ui-button-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
12
|
+
--_font-weight: var(--ui-button-font-weight, var(--ui-weight-medium, #{t.$weight-medium}));
|
|
13
|
+
--_radius: var(--ui-button-radius, var(--ui-radius-md, #{t.$radius-md}));
|
|
14
|
+
--_bg: var(--ui-button-bg, var(--ui-color-primary, #{t.$color-primary}));
|
|
15
|
+
--_bg-hover: var(--ui-button-bg-hover, var(--ui-color-primary-dark, #{t.$color-primary-dark}));
|
|
16
|
+
--_text: var(--ui-button-text, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @modifier size
|
|
20
|
+
.button--sm {
|
|
21
|
+
--_height: var(--ui-button-height-sm, calc(var(--row, #{t.$row}) * 1.5));
|
|
22
|
+
--_font-size: var(--ui-button-font-size-sm, var(--ui-font-size-xs, #{t.$font-size-xs}));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.button--lg {
|
|
26
|
+
--_height: var(--ui-button-height-lg, calc(var(--row, #{t.$row}) * 2.5));
|
|
27
|
+
--_padding-x: var(--ui-button-padding-x-lg, var(--ui-space-3, #{t.$space-3}));
|
|
28
|
+
--_font-size: var(--ui-button-font-size-lg, var(--ui-font-size-md, #{t.$font-size-md}));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// @modifier variant
|
|
32
|
+
.button--secondary {
|
|
33
|
+
--_bg: var(--ui-button-secondary-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
|
|
34
|
+
--_bg-hover: var(--ui-button-secondary-bg-hover, var(--ui-color-border-strong, #{t.$color-border-strong}));
|
|
35
|
+
--_text: var(--ui-button-secondary-text, var(--ui-color-text, #{t.$color-text}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.button--ghost {
|
|
39
|
+
--_bg: var(--ui-button-ghost-bg, transparent);
|
|
40
|
+
--_bg-hover: var(--ui-button-ghost-bg-hover, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
41
|
+
--_text: var(--ui-button-ghost-text, var(--ui-color-primary, #{t.$color-primary}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.button--outline {
|
|
45
|
+
--_bg: var(--ui-button-outline-bg, transparent);
|
|
46
|
+
--_bg-hover: var(--ui-button-outline-bg-hover, var(--ui-color-primary, #{t.$color-primary}));
|
|
47
|
+
--_text: var(--ui-button-outline-text, var(--ui-color-primary, #{t.$color-primary}));
|
|
48
|
+
--_text-hover: var(--ui-button-outline-text-hover, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
49
|
+
--_border: var(--ui-button-outline-border, var(--ui-border-width-sm, #{t.$border-width-sm}) solid currentColor);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button--danger {
|
|
53
|
+
--_bg: var(--ui-button-danger-bg, var(--ui-color-danger, #{t.$color-danger}));
|
|
54
|
+
--_bg-hover: var(--ui-button-danger-bg-hover, #{t.$color-danger-dark});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button--link {
|
|
58
|
+
--_bg: transparent;
|
|
59
|
+
--_bg-hover: transparent;
|
|
60
|
+
--_text: var(--ui-button-link-text, var(--ui-color-primary, #{t.$color-primary}));
|
|
61
|
+
--_text-hover: var(--ui-button-link-text-hover, var(--ui-color-primary-dark, #{t.$color-primary-dark}));
|
|
62
|
+
--_height: auto;
|
|
63
|
+
--_padding-x: 0;
|
|
64
|
+
--_radius: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// @modifier boolean icon
|
|
68
|
+
.button--icon {
|
|
69
|
+
--_padding-x: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// @modifier radius
|
|
73
|
+
.button--radius-none {
|
|
74
|
+
--_radius: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.button--radius-sm {
|
|
78
|
+
--_radius: var(--ui-radius-sm, #{t.$radius-sm});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.button--radius-lg {
|
|
82
|
+
--_radius: var(--ui-radius-lg, #{t.$radius-lg});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.button--radius-full {
|
|
86
|
+
--_radius: 624.9375rem; // large value for pill shape
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// @modifier boolean block
|
|
90
|
+
// @modifier boolean loading
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Implementation - structural styles
|
|
94
|
+
@layer components.styles {
|
|
95
|
+
.button {
|
|
96
|
+
// Layout
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
gap: var(--ui-space-1, #{t.$space-1});
|
|
101
|
+
|
|
102
|
+
// Size
|
|
103
|
+
block-size: var(--_height);
|
|
104
|
+
padding-inline: var(--_padding-x);
|
|
105
|
+
|
|
106
|
+
// Visual
|
|
107
|
+
margin: 0;
|
|
108
|
+
|
|
109
|
+
// Typography
|
|
110
|
+
font-family: var(--ui-font-sans, #{t.$font-sans});
|
|
111
|
+
font-size: var(--_font-size);
|
|
112
|
+
font-weight: var(--_font-weight);
|
|
113
|
+
line-height: 1;
|
|
114
|
+
text-decoration: none;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
color: var(--_text);
|
|
117
|
+
|
|
118
|
+
background: var(--_bg);
|
|
119
|
+
border: var(--_border, none);
|
|
120
|
+
border-radius: var(--_radius);
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
|
|
123
|
+
// Transitions
|
|
124
|
+
transition:
|
|
125
|
+
background-color var(--ui-duration-base) var(--ui-ease-default),
|
|
126
|
+
color var(--ui-duration-base) var(--ui-ease-default),
|
|
127
|
+
transform var(--ui-duration-fast) var(--ui-ease-default);
|
|
128
|
+
|
|
129
|
+
// States - modifiers mirror pseudo-classes for testing/docs
|
|
130
|
+
&:hover,
|
|
131
|
+
&--hover {
|
|
132
|
+
color: var(--_text-hover, var(--_text));
|
|
133
|
+
|
|
134
|
+
background: var(--_bg-hover);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&:focus-visible,
|
|
138
|
+
&--focus {
|
|
139
|
+
outline: var(--ui-border-width-md, #{t.$border-width-md}) solid var(--ui-color-focus, #{t.$color-focus});
|
|
140
|
+
outline-offset: var(--ui-border-width-md, #{t.$border-width-md});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&:active,
|
|
144
|
+
&--active {
|
|
145
|
+
transform: scale(0.98);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:disabled {
|
|
149
|
+
opacity: 0.5;
|
|
150
|
+
cursor: not-allowed;
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
background: var(--_bg);
|
|
154
|
+
transform: none;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Icon-only button
|
|
159
|
+
&--icon {
|
|
160
|
+
inline-size: var(--_height);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Full width
|
|
164
|
+
&--block {
|
|
165
|
+
inline-size: 100%;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Link variant underline
|
|
169
|
+
&--link {
|
|
170
|
+
text-decoration: underline;
|
|
171
|
+
text-underline-offset: var(--ui-space-quarter);
|
|
172
|
+
|
|
173
|
+
&:hover {
|
|
174
|
+
text-decoration-thickness: var(--ui-space-quarter);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Icon elements
|
|
179
|
+
&__icon {
|
|
180
|
+
flex-shrink: 0;
|
|
181
|
+
|
|
182
|
+
block-size: 1em;
|
|
183
|
+
inline-size: 1em;
|
|
184
|
+
|
|
185
|
+
&--start {
|
|
186
|
+
order: -1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&--end {
|
|
190
|
+
order: 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Loading state
|
|
195
|
+
&--loading {
|
|
196
|
+
position: relative;
|
|
197
|
+
|
|
198
|
+
opacity: 0.7;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
|
|
201
|
+
&::after {
|
|
202
|
+
content: '';
|
|
203
|
+
position: absolute;
|
|
204
|
+
|
|
205
|
+
block-size: 1em;
|
|
206
|
+
inline-size: 1em;
|
|
207
|
+
|
|
208
|
+
border: 2px solid currentcolor;
|
|
209
|
+
border-radius: 50%;
|
|
210
|
+
|
|
211
|
+
animation: button-spin 0.6s linear infinite;
|
|
212
|
+
border-inline-end-color: transparent;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@keyframes button-spin {
|
|
218
|
+
to {
|
|
219
|
+
transform: rotate(360deg);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "button-group",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Button Group",
|
|
5
|
+
"description": "Container for grouped buttons that share borders and have connected appearance.",
|
|
6
|
+
"api": "./button-group.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<div class=\"ui-button-group\" role=\"group\"><button class=\"ui-button ui-button--outline\">Left</button><button class=\"ui-button ui-button--outline\">Middle</button><button class=\"ui-button ui-button--outline\">Right</button></div>",
|
|
13
|
+
"code": "<div class=\"ui-button-group\" role=\"group\">\n <button class=\"ui-button ui-button--outline\">Left</button>\n <button class=\"ui-button ui-button--outline\">Middle</button>\n <button class=\"ui-button ui-button--outline\">Right</button>\n</div>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Primary Buttons",
|
|
19
|
+
"examples": [
|
|
20
|
+
{
|
|
21
|
+
"html": "<div class=\"ui-button-group\" role=\"group\"><button class=\"ui-button\">Save</button><button class=\"ui-button\">Save & Close</button></div>",
|
|
22
|
+
"code": "<div class=\"ui-button-group\" role=\"group\">\n <button class=\"ui-button\">Save</button>\n <button class=\"ui-button\">Save & Close</button>\n</div>"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Vertical",
|
|
28
|
+
"examples": [
|
|
29
|
+
{
|
|
30
|
+
"html": "<div class=\"ui-button-group ui-button-group--vertical\" role=\"group\"><button class=\"ui-button ui-button--outline\">Top</button><button class=\"ui-button ui-button--outline\">Middle</button><button class=\"ui-button ui-button--outline\">Bottom</button></div>",
|
|
31
|
+
"code": "<div class=\"ui-button-group ui-button-group--vertical\" role=\"group\">\n <button class=\"ui-button ui-button--outline\">Top</button>\n <button class=\"ui-button ui-button--outline\">Middle</button>\n <button class=\"ui-button ui-button--outline\">Bottom</button>\n</div>"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": "With Icons",
|
|
37
|
+
"examples": [
|
|
38
|
+
{
|
|
39
|
+
"html": "<div class=\"ui-button-group\" role=\"group\" aria-label=\"Text formatting\"><button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Bold\"><svg class=\"ui-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg></button><button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Italic\"><svg class=\"ui-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z\"/></svg></button><button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Underline\"><svg class=\"ui-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z\"/></svg></button></div>",
|
|
40
|
+
"code": "<div class=\"ui-button-group\" role=\"group\" aria-label=\"Text formatting\">\n <button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Bold\">...</button>\n <button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Italic\">...</button>\n <button class=\"ui-button ui-button--outline ui-button--icon\" aria-label=\"Underline\">...</button>\n</div>"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"customization": [
|
|
46
|
+
{
|
|
47
|
+
"token": "--ui-button-group-radius",
|
|
48
|
+
"default": "var(--ui-radius-md)",
|
|
49
|
+
"description": "Border radius for first and last buttons"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|