@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,15 @@
|
|
|
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, 'spinner.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('spinner visual regression', () => {
|
|
8
|
+
// TODO: Skip grid rhythm until #154 is resolved (CSS var resolution issue)
|
|
9
|
+
test('all variations', async ({ page }) => {
|
|
10
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
11
|
+
// await validateGridRhythm(page, 'spinner');
|
|
12
|
+
await saveForLostPixel(page, 'spinner');
|
|
13
|
+
await expect(page.locator('body')).toHaveScreenshot('spinner.visual.png');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Status - visual status indicator
|
|
4
|
+
// Small dot or badge to show state
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.status {
|
|
8
|
+
--_size: var(--ui-status-size, calc(#{t.$unit} * 1));
|
|
9
|
+
--_color: var(--ui-status-color, var(--ui-color-text-muted));
|
|
10
|
+
--_gap: var(--ui-status-gap, calc(#{t.$unit} * 1));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.status--success {
|
|
14
|
+
--_color: var(--ui-color-success);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.status--warning {
|
|
18
|
+
--_color: var(--ui-color-warning);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.status--danger {
|
|
22
|
+
--_color: var(--ui-color-danger);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.status--info {
|
|
26
|
+
--_color: var(--ui-color-primary);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@layer components.styles {
|
|
31
|
+
.status {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: var(--_gap);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.status__dot {
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
|
|
40
|
+
block-size: var(--_size);
|
|
41
|
+
inline-size: var(--_size);
|
|
42
|
+
|
|
43
|
+
background: var(--_color);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Pulse animation for active status
|
|
48
|
+
.status--pulse .status__dot {
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.status--pulse .status__dot::before {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
|
|
57
|
+
background: var(--_color);
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
|
|
60
|
+
animation: status-pulse 2s infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes status-pulse {
|
|
64
|
+
0% {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
transform: scale(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
100% {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
transform: scale(2.5);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Size variants
|
|
76
|
+
.status--sm {
|
|
77
|
+
--_size: calc(#{t.$unit} * 0.75);
|
|
78
|
+
--_gap: calc(#{t.$unit} * 0.75);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.status--lg {
|
|
82
|
+
--_size: calc(#{t.$unit} * 1.5);
|
|
83
|
+
--_gap: calc(#{t.$unit} * 1.5);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "status",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-status-size",
|
|
8
|
+
"default": "calc(#{t.$unit} * 1"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-status-color",
|
|
12
|
+
"default": "var(--ui-color-text-muted)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-status-gap",
|
|
16
|
+
"default": "calc(#{t.$unit} * 1"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "status",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Status",
|
|
5
|
+
"description": "Visual status indicator with colored dot to show state.",
|
|
6
|
+
"api": "./status.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Variants",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<div style=\"display: flex; flex-direction: column; gap: var(--ui-space-2);\"><span class=\"ui-status\"><span class=\"ui-status__dot\"></span>Default</span><span class=\"ui-status ui-status--success\"><span class=\"ui-status__dot\"></span>Online</span><span class=\"ui-status ui-status--warning\"><span class=\"ui-status__dot\"></span>Away</span><span class=\"ui-status ui-status--danger\"><span class=\"ui-status__dot\"></span>Busy</span><span class=\"ui-status ui-status--info\"><span class=\"ui-status__dot\"></span>In a meeting</span></div>",
|
|
13
|
+
"code": "<span class=\"ui-status ui-status--success\">\n <span class=\"ui-status__dot\"></span>\n Online\n</span>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Sizes",
|
|
19
|
+
"examples": [
|
|
20
|
+
{
|
|
21
|
+
"html": "<div style=\"display: flex; gap: var(--ui-space-4); align-items: center;\"><span class=\"ui-status ui-status--success ui-status--sm\"><span class=\"ui-status__dot\"></span>Small</span><span class=\"ui-status ui-status--success\"><span class=\"ui-status__dot\"></span>Default</span><span class=\"ui-status ui-status--success ui-status--lg\"><span class=\"ui-status__dot\"></span>Large</span></div>",
|
|
22
|
+
"code": "<span class=\"ui-status ui-status--sm\">...</span>\n<span class=\"ui-status\">...</span>\n<span class=\"ui-status ui-status--lg\">...</span>"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Pulse Animation",
|
|
28
|
+
"description": "For live or active indicators",
|
|
29
|
+
"api": "./status.api.json",
|
|
30
|
+
"examples": [
|
|
31
|
+
{
|
|
32
|
+
"html": "<span class=\"ui-status ui-status--success ui-status--pulse\"><span class=\"ui-status__dot\"></span>Live</span>",
|
|
33
|
+
"code": "<span class=\"ui-status ui-status--success ui-status--pulse\">\n <span class=\"ui-status__dot\"></span>\n Live\n</span>"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"title": "Dot Only",
|
|
39
|
+
"examples": [
|
|
40
|
+
{
|
|
41
|
+
"html": "<div style=\"display: flex; gap: var(--ui-space-2);\"><span class=\"ui-status ui-status--success\"><span class=\"ui-status__dot\"></span></span><span class=\"ui-status ui-status--warning\"><span class=\"ui-status__dot\"></span></span><span class=\"ui-status ui-status--danger\"><span class=\"ui-status__dot\"></span></span></div>",
|
|
42
|
+
"code": "<span class=\"ui-status ui-status--success\">\n <span class=\"ui-status__dot\"></span>\n</span>"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"customization": [
|
|
48
|
+
{ "token": "--ui-status-size", "default": "var(--unit)", "description": "Dot size" },
|
|
49
|
+
{
|
|
50
|
+
"token": "--ui-status-color",
|
|
51
|
+
"default": "var(--ui-color-text-muted)",
|
|
52
|
+
"description": "Default dot color"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"token": "--ui-status-gap",
|
|
56
|
+
"default": "var(--unit)",
|
|
57
|
+
"description": "Gap between dot and text"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -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, 'status.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('status visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'status');
|
|
11
|
+
await saveForLostPixel(page, 'status');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('status.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Token definitions
|
|
4
|
+
@layer components.tokens {
|
|
5
|
+
.table {
|
|
6
|
+
--_font-size: var(--ui-table-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
7
|
+
--_border-color: var(--ui-table-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
8
|
+
--_header-bg: var(--ui-table-header-bg, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
9
|
+
--_cell-padding-x: var(--ui-table-cell-padding-x, var(--ui-space-2, #{t.$space-2}));
|
|
10
|
+
--_cell-padding-y: var(--ui-table-cell-padding-y, var(--ui-space-1, #{t.$space-1}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.table--compact {
|
|
14
|
+
--_cell-padding-y: var(--ui-space-0, #{t.$space-0});
|
|
15
|
+
--_cell-padding-x: var(--ui-space-1, #{t.$space-1});
|
|
16
|
+
--_font-size: var(--ui-font-size-xs, #{t.$font-size-xs});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Implementation
|
|
21
|
+
@layer components.styles {
|
|
22
|
+
.table {
|
|
23
|
+
inline-size: 100%;
|
|
24
|
+
|
|
25
|
+
font-size: var(--_font-size);
|
|
26
|
+
// Use separate to avoid sub-pixel border issues
|
|
27
|
+
border-collapse: separate;
|
|
28
|
+
border-spacing: 0;
|
|
29
|
+
|
|
30
|
+
th,
|
|
31
|
+
td {
|
|
32
|
+
// Subtract border from bottom padding to keep row on grid
|
|
33
|
+
padding-block-start: var(--_cell-padding-y);
|
|
34
|
+
padding-block-end: calc(var(--_cell-padding-y) - var(--ui-border-width-sm, #{t.$border-width-sm}));
|
|
35
|
+
padding-inline: var(--_cell-padding-x);
|
|
36
|
+
// Grid-aligned line-height (3 units = 24px at 8px unit)
|
|
37
|
+
line-height: calc(var(--unit, #{t.$unit}) * 3);
|
|
38
|
+
text-align: start;
|
|
39
|
+
|
|
40
|
+
border-block-end: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
th {
|
|
44
|
+
font-weight: var(--ui-weight-medium, #{t.$weight-medium});
|
|
45
|
+
|
|
46
|
+
background: var(--_header-bg);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Striped variant
|
|
50
|
+
&--striped {
|
|
51
|
+
tbody tr:nth-child(odd) {
|
|
52
|
+
background: var(--ui-color-bg-subtle, #{t.$color-bg-subtle});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
th {
|
|
56
|
+
background: var(--ui-color-bg-muted, #{t.$color-bg-muted});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "table",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-table-font-size",
|
|
8
|
+
"default": "var(--ui-font-size-sm)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-table-border-color",
|
|
12
|
+
"default": "var(--ui-color-border)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-table-header-bg",
|
|
16
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-table-cell-padding-x",
|
|
20
|
+
"default": "var(--ui-space-2)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-table-cell-padding-y",
|
|
24
|
+
"default": "var(--ui-space-1)"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "table",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Table",
|
|
5
|
+
"description": "Styled table with header formatting and optional variants.",
|
|
6
|
+
"api": "./table.api.json",
|
|
7
|
+
"componentName": "table",
|
|
8
|
+
"sections": [
|
|
9
|
+
{
|
|
10
|
+
"title": "Basic table",
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"title": "Default",
|
|
14
|
+
"html": "<table class=\"ui-table\"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Alpha</td><td>100</td></tr><tr><td>Beta</td><td>200</td></tr></tbody></table>"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"title": "Variants",
|
|
20
|
+
"examples": [
|
|
21
|
+
{
|
|
22
|
+
"title": "Compact",
|
|
23
|
+
"html": "<table class=\"ui-table ui-table--compact\"><thead><tr><th>Token</th><th>Value</th></tr></thead><tbody><tr><td><code class=\"ui-code ui-code--sm\">--space-1</code></td><td>0.5rem</td></tr><tr><td><code class=\"ui-code ui-code--sm\">--space-2</code></td><td>1rem</td></tr></tbody></table>"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"title": "Striped",
|
|
27
|
+
"html": "<table class=\"ui-table ui-table--striped\"><thead><tr><th>Item</th><th>Status</th></tr></thead><tbody><tr><td>Task 1</td><td>Done</td></tr><tr><td>Task 2</td><td>Pending</td></tr><tr><td>Task 3</td><td>Done</td></tr></tbody></table>"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"customization": [
|
|
33
|
+
{
|
|
34
|
+
"token": "--ui-table-font-size",
|
|
35
|
+
"default": "var(--ui-font-size-sm)",
|
|
36
|
+
"description": "Table font size"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"token": "--ui-table-border-color",
|
|
40
|
+
"default": "var(--ui-color-border)",
|
|
41
|
+
"description": "Border color"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"token": "--ui-table-header-bg",
|
|
45
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
46
|
+
"description": "Header background"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"token": "--ui-table-cell-padding-x",
|
|
50
|
+
"default": "var(--ui-space-2)",
|
|
51
|
+
"description": "Cell horizontal padding"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"token": "--ui-table-cell-padding-y",
|
|
55
|
+
"default": "var(--ui-space-1)",
|
|
56
|
+
"description": "Cell vertical padding"
|
|
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, 'table.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('table visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'table');
|
|
11
|
+
await saveForLostPixel(page, 'table');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('table.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Token definitions
|
|
4
|
+
@layer components.tokens {
|
|
5
|
+
.tabs {
|
|
6
|
+
--_border-color: var(--ui-tabs-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
7
|
+
--_tab-padding-x: var(--ui-tabs-tab-padding-x, var(--ui-space-2, #{t.$space-2}));
|
|
8
|
+
--_tab-padding-y: var(--ui-tabs-tab-padding-y, var(--ui-space-1, #{t.$space-1}));
|
|
9
|
+
--_tab-bg: var(--ui-tabs-tab-bg, transparent);
|
|
10
|
+
--_tab-bg-active: var(--ui-tabs-tab-bg-active, var(--ui-color-bg, #{t.$color-bg}));
|
|
11
|
+
--_panel-padding: var(--ui-tabs-panel-padding, var(--ui-space-3, #{t.$space-3}));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Implementation
|
|
16
|
+
@layer components.styles {
|
|
17
|
+
.tabs__list {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: stretch;
|
|
20
|
+
gap: var(--ui-space-1, #{t.$space-1});
|
|
21
|
+
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
block-size: var(--ui-row-2, #{t.$row-2});
|
|
24
|
+
|
|
25
|
+
// Use box-shadow instead of border to avoid affecting height
|
|
26
|
+
box-shadow: inset 0 calc(var(--ui-border-width-sm, #{t.$border-width-sm}) * -1) 0 var(--_border-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tabs__tab {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
block-size: var(--ui-row-2, #{t.$row-2});
|
|
35
|
+
padding-inline: var(--_tab-padding-x);
|
|
36
|
+
margin: 0;
|
|
37
|
+
|
|
38
|
+
font-family: var(--ui-font-sans, #{t.$font-sans});
|
|
39
|
+
font-size: var(--ui-font-size-sm, #{t.$font-size-sm});
|
|
40
|
+
font-weight: var(--ui-weight-medium, #{t.$weight-medium});
|
|
41
|
+
line-height: 1;
|
|
42
|
+
color: var(--ui-color-text-muted, #{t.$color-text-muted});
|
|
43
|
+
|
|
44
|
+
background: var(--_tab-bg);
|
|
45
|
+
border: none;
|
|
46
|
+
// Use box-shadow for indicator to avoid affecting height
|
|
47
|
+
box-shadow: inset 0 calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 transparent;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
|
|
50
|
+
transition:
|
|
51
|
+
color var(--ui-duration-base) var(--ui-ease-default),
|
|
52
|
+
box-shadow var(--ui-duration-base) var(--ui-ease-default);
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
color: var(--ui-color-text, #{t.$color-text});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--active {
|
|
59
|
+
color: var(--ui-color-primary, #{t.$color-primary});
|
|
60
|
+
|
|
61
|
+
background: var(--_tab-bg-active);
|
|
62
|
+
box-shadow: inset 0 calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 var(--ui-color-primary, #{t.$color-primary});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.tabs__panel {
|
|
67
|
+
display: none;
|
|
68
|
+
|
|
69
|
+
padding: var(--_panel-padding);
|
|
70
|
+
|
|
71
|
+
line-height: var(--ui-row-1, #{t.$row});
|
|
72
|
+
|
|
73
|
+
&--active {
|
|
74
|
+
display: block;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tabs",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-tabs-border-color",
|
|
8
|
+
"default": "var(--ui-color-border)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-tabs-tab-padding-x",
|
|
12
|
+
"default": "var(--ui-space-2)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-tabs-tab-padding-y",
|
|
16
|
+
"default": "var(--ui-space-1)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-tabs-tab-bg",
|
|
20
|
+
"default": "transparent"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-tabs-tab-bg-active",
|
|
24
|
+
"default": "var(--ui-color-bg)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-tabs-panel-padding",
|
|
28
|
+
"default": "var(--ui-space-3)"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": "./tabs.api.json",
|
|
3
|
+
"sections": [
|
|
4
|
+
{
|
|
5
|
+
"title": "Default",
|
|
6
|
+
"data": {
|
|
7
|
+
"tabs": [
|
|
8
|
+
{ "label": "Tab 1", "active": true, "content": "Panel 1 content" },
|
|
9
|
+
{ "label": "Tab 2", "active": false, "content": "Panel 2 content" },
|
|
10
|
+
{ "label": "Tab 3", "active": false, "content": "Panel 3 content" }
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"examples": [
|
|
14
|
+
{
|
|
15
|
+
"html": "<div class=\"ui-tabs\"><div class=\"ui-tabs__list\"><button class=\"ui-tabs__tab ui-tabs__tab--active\">Tab 1</button><button class=\"ui-tabs__tab\">Tab 2</button><button class=\"ui-tabs__tab\">Tab 3</button></div><div class=\"ui-tabs__panel ui-tabs__panel--active\">Panel 1 content</div><div class=\"ui-tabs__panel\">Panel 2 content</div><div class=\"ui-tabs__panel\">Panel 3 content</div></div>",
|
|
16
|
+
"code": "<div class=\"ui-tabs\">\n <div class=\"ui-tabs__list\">\n{% for t in tabs %} <button class=\"ui-tabs__tab{% if t.active %} ui-tabs__tab--active{% endif %}\">{{ t.label }}</button>\n{% endfor %} </div>\n{% for t in tabs %} <div class=\"ui-tabs__panel{% if t.active %} ui-tabs__panel--active{% endif %}\">{{ t.content }}</div>\n{% endfor %}</div>"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"title": "Two Tabs",
|
|
22
|
+
"data": {
|
|
23
|
+
"tabs": [{ "label": "Preview", "active": true }, { "label": "Code", "active": false }]
|
|
24
|
+
},
|
|
25
|
+
"examples": [
|
|
26
|
+
{
|
|
27
|
+
"html": "<div class=\"ui-tabs\"><div class=\"ui-tabs__list\"><button class=\"ui-tabs__tab ui-tabs__tab--active\">Preview</button><button class=\"ui-tabs__tab\">Code</button></div><div class=\"ui-tabs__panel ui-tabs__panel--active\"><div class=\"ui-card\">Preview content goes here</div></div><div class=\"ui-tabs__panel\"><pre class=\"ui-code-block\"><code><div>Code snippet</div></code></pre></div></div>",
|
|
28
|
+
"code": "<div class=\"ui-tabs\">\n <div class=\"ui-tabs__list\">\n{% for t in tabs %} <button class=\"ui-tabs__tab{% if t.active %} ui-tabs__tab--active{% endif %}\">{{ t.label }}</button>\n{% endfor %} </div>\n <div class=\"ui-tabs__panel ui-tabs__panel--active\">...</div>\n <div class=\"ui-tabs__panel\">...</div>\n</div>"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"customization": [
|
|
34
|
+
{
|
|
35
|
+
"token": "--ui-tabs-border-color",
|
|
36
|
+
"default": "var(--ui-color-border)",
|
|
37
|
+
"description": "Tab list border color"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"token": "--ui-tabs-tab-padding-x",
|
|
41
|
+
"default": "var(--ui-space-2)",
|
|
42
|
+
"description": "Tab horizontal padding"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"token": "--ui-tabs-tab-padding-y",
|
|
46
|
+
"default": "var(--ui-space-1)",
|
|
47
|
+
"description": "Tab vertical padding"
|
|
48
|
+
},
|
|
49
|
+
{ "token": "--ui-tabs-tab-bg", "default": "transparent", "description": "Tab background" },
|
|
50
|
+
{
|
|
51
|
+
"token": "--ui-tabs-tab-bg-active",
|
|
52
|
+
"default": "var(--ui-color-bg)",
|
|
53
|
+
"description": "Active tab background"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"token": "--ui-tabs-panel-padding",
|
|
57
|
+
"default": "var(--ui-space-3)",
|
|
58
|
+
"description": "Panel padding"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -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, 'tabs.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('tabs visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'tabs');
|
|
11
|
+
await saveForLostPixel(page, 'tabs');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('tabs.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component tag
|
|
4
|
+
// @element span
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.tag {
|
|
8
|
+
--_height: var(--ui-tag-height, calc(#{t.$unit} * 3));
|
|
9
|
+
--_padding-x: var(--ui-tag-padding-x, var(--ui-space-1, #{t.$space-1}));
|
|
10
|
+
--_gap: var(--ui-tag-gap, calc(#{t.$unit} * 0.5));
|
|
11
|
+
--_radius: var(--ui-tag-radius, var(--ui-radius-full, #{t.$radius-full}));
|
|
12
|
+
--_font-size: var(--ui-tag-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
13
|
+
--_bg: var(--ui-tag-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
|
|
14
|
+
--_color: var(--ui-tag-color, var(--ui-color-text, #{t.$color-text}));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// @modifier size
|
|
18
|
+
.tag--sm {
|
|
19
|
+
--_height: var(--ui-tag-height-sm, calc(#{t.$unit} * 2.5));
|
|
20
|
+
--_padding-x: var(--ui-tag-padding-x-sm, calc(#{t.$unit} * 1));
|
|
21
|
+
--_font-size: var(--ui-tag-font-size-sm, var(--ui-font-size-xs, #{t.$font-size-xs}));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// @modifier variant
|
|
25
|
+
.tag--primary {
|
|
26
|
+
--_bg: var(--ui-tag-primary-bg, var(--ui-color-primary, #{t.$color-primary}));
|
|
27
|
+
--_color: var(--ui-tag-primary-color, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tag--success {
|
|
31
|
+
--_bg: var(--ui-tag-success-bg, var(--ui-color-success, #{t.$color-success}));
|
|
32
|
+
--_color: var(--ui-tag-success-color, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tag--warning {
|
|
36
|
+
--_bg: var(--ui-tag-warning-bg, var(--ui-color-warning, #{t.$color-warning}));
|
|
37
|
+
--_color: var(--ui-tag-warning-color, var(--ui-color-text, #{t.$color-text}));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tag--danger {
|
|
41
|
+
--_bg: var(--ui-tag-danger-bg, var(--ui-color-danger, #{t.$color-danger}));
|
|
42
|
+
--_color: var(--ui-tag-danger-color, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@layer components.styles {
|
|
47
|
+
.tag {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: var(--_gap);
|
|
51
|
+
|
|
52
|
+
block-size: var(--_height);
|
|
53
|
+
padding-inline: var(--_padding-x);
|
|
54
|
+
|
|
55
|
+
font-size: var(--_font-size);
|
|
56
|
+
font-weight: var(--ui-weight-medium, #{t.$weight-medium});
|
|
57
|
+
line-height: 1;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
color: var(--_color);
|
|
60
|
+
|
|
61
|
+
background: var(--_bg);
|
|
62
|
+
border-radius: var(--_radius);
|
|
63
|
+
|
|
64
|
+
&:disabled,
|
|
65
|
+
&[aria-disabled='true'] {
|
|
66
|
+
opacity: 0.5;
|
|
67
|
+
cursor: not-allowed;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.tag__remove {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
|
|
77
|
+
padding: 0;
|
|
78
|
+
margin-inline-start: calc(var(--_gap) * -0.5);
|
|
79
|
+
|
|
80
|
+
color: currentcolor;
|
|
81
|
+
|
|
82
|
+
background: none;
|
|
83
|
+
border: none;
|
|
84
|
+
opacity: 0.7;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
|
|
87
|
+
&:hover {
|
|
88
|
+
opacity: 1;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Tag group for multiple tags
|
|
93
|
+
.tag-group {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-wrap: wrap;
|
|
96
|
+
gap: calc(#{t.$unit} * 0.5);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
Binary file
|