@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,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, 'link.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('link visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'link');
|
|
11
|
+
await saveForLostPixel(page, 'link');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('link.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Menu - action menu
|
|
4
|
+
// Dropdown list of actions or options
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.menu {
|
|
8
|
+
--_min-width: var(--ui-menu-min-width, calc(#{t.$unit} * 16));
|
|
9
|
+
--_max-height: var(--ui-menu-max-height, calc(#{t.$unit} * 40));
|
|
10
|
+
--_padding: var(--ui-menu-padding, calc(#{t.$unit} * 1));
|
|
11
|
+
--_radius: var(--ui-menu-radius, var(--ui-radius-md, #{t.$radius-md}));
|
|
12
|
+
--_bg: var(--ui-menu-bg, var(--ui-color-bg, #{t.$color-bg}));
|
|
13
|
+
--_border-color: var(--ui-menu-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
14
|
+
--_shadow: var(--ui-menu-shadow, var(--shadow-lg));
|
|
15
|
+
--_item-padding: var(--ui-menu-item-padding, calc(#{t.$unit} * 1) calc(#{t.$unit} * 2));
|
|
16
|
+
--_item-radius: var(--ui-menu-item-radius, var(--ui-radius-sm, #{t.$radius-sm}));
|
|
17
|
+
--_item-bg-hover: var(--ui-menu-item-bg-hover, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@layer components.styles {
|
|
22
|
+
.menu {
|
|
23
|
+
min-inline-size: var(--_min-width);
|
|
24
|
+
max-block-size: var(--_max-height);
|
|
25
|
+
padding: var(--_padding);
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
|
|
28
|
+
background: var(--_bg);
|
|
29
|
+
border-radius: var(--_radius);
|
|
30
|
+
outline: var(--ui-border-width-sm, 0.0625rem) solid var(--_border-color);
|
|
31
|
+
box-shadow: var(--_shadow);
|
|
32
|
+
outline-offset: calc(var(--ui-border-width-sm, 0.0625rem) * -1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.menu__group {
|
|
36
|
+
padding: 0;
|
|
37
|
+
margin: 0;
|
|
38
|
+
|
|
39
|
+
list-style: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.menu__label {
|
|
43
|
+
padding: var(--_item-padding);
|
|
44
|
+
|
|
45
|
+
font-size: var(--ui-font-size-xs, #{t.$font-size-xs});
|
|
46
|
+
font-weight: var(--ui-weight-medium, #{t.$weight-medium});
|
|
47
|
+
line-height: var(--ui-row-1, #{t.$row});
|
|
48
|
+
letter-spacing: 0.05em;
|
|
49
|
+
text-transform: uppercase;
|
|
50
|
+
color: var(--ui-color-text-muted, #{t.$color-text-muted});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.menu__item {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: calc(#{t.$unit} * 1);
|
|
57
|
+
|
|
58
|
+
padding: var(--_item-padding);
|
|
59
|
+
|
|
60
|
+
font-size: var(--ui-font-size-sm, #{t.$font-size-sm});
|
|
61
|
+
line-height: var(--ui-row-1, #{t.$row});
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
color: var(--ui-color-text, #{t.$color-text});
|
|
64
|
+
|
|
65
|
+
background: transparent;
|
|
66
|
+
border: none;
|
|
67
|
+
border-radius: var(--_item-radius);
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
|
|
70
|
+
transition: background var(--ui-duration-fast, 100ms) var(--ui-ease-default, ease);
|
|
71
|
+
|
|
72
|
+
&:hover,
|
|
73
|
+
&:focus-visible {
|
|
74
|
+
background: var(--_item-bg-hover);
|
|
75
|
+
outline: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.menu__item--danger {
|
|
80
|
+
color: var(--ui-color-danger, #{t.$color-danger});
|
|
81
|
+
|
|
82
|
+
&:hover,
|
|
83
|
+
&:focus-visible {
|
|
84
|
+
color: var(--ui-color-danger, #{t.$color-danger});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.menu__item--disabled,
|
|
89
|
+
.menu__item[aria-disabled="true"] {
|
|
90
|
+
opacity: 0.5;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.menu__item-icon {
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
|
|
97
|
+
block-size: calc(#{t.$unit} * 2);
|
|
98
|
+
inline-size: calc(#{t.$unit} * 2);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.menu__item-shortcut {
|
|
102
|
+
margin-inline-start: auto;
|
|
103
|
+
|
|
104
|
+
font-size: var(--ui-font-size-xs, #{t.$font-size-xs});
|
|
105
|
+
color: var(--ui-color-text-muted, #{t.$color-text-muted});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.menu__separator {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
|
|
112
|
+
block-size: calc(#{t.$unit} * 2);
|
|
113
|
+
margin: 0;
|
|
114
|
+
|
|
115
|
+
&::before {
|
|
116
|
+
content: '';
|
|
117
|
+
flex: 1;
|
|
118
|
+
|
|
119
|
+
block-size: var(--ui-border-width-sm, 1px);
|
|
120
|
+
|
|
121
|
+
background: var(--ui-color-border, #{t.$color-border});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Checkbox/radio items
|
|
126
|
+
.menu__item--check,
|
|
127
|
+
.menu__item--radio {
|
|
128
|
+
|
|
129
|
+
position: relative;
|
|
130
|
+
|
|
131
|
+
padding-inline-start: calc(#{t.$unit} * 4);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.menu__item-indicator {
|
|
135
|
+
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset-inline-start: calc(#{t.$unit} * 1);
|
|
141
|
+
|
|
142
|
+
block-size: calc(#{t.$unit} * 2);
|
|
143
|
+
inline-size: calc(#{t.$unit} * 2);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "menu",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-menu-min-width",
|
|
8
|
+
"default": "calc(#{t.$unit} * 16"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-menu-max-height",
|
|
12
|
+
"default": "calc(#{t.$unit} * 40"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-menu-padding",
|
|
16
|
+
"default": "calc(#{t.$unit} * 1"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-menu-radius",
|
|
20
|
+
"default": "var(--ui-radius-md)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-menu-bg",
|
|
24
|
+
"default": "var(--ui-color-bg)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-menu-border-color",
|
|
28
|
+
"default": "var(--ui-color-border)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "--ui-menu-shadow",
|
|
32
|
+
"default": "var(--shadow-lg)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "--ui-menu-item-padding",
|
|
36
|
+
"default": "calc(#{t.$unit} * 1"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "--ui-menu-item-radius",
|
|
40
|
+
"default": "var(--ui-radius-sm)"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "--ui-menu-item-bg-hover",
|
|
44
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": "./menu.api.json",
|
|
3
|
+
"sections": [
|
|
4
|
+
{
|
|
5
|
+
"title": "Default",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"html": "<div class=\"ui-menu\"><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item\">Edit</button></li><li><button class=\"ui-menu__item\">Duplicate</button></li><li><button class=\"ui-menu__item\">Archive</button></li></ul></div>"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"title": "With Icons and Shortcuts",
|
|
14
|
+
"examples": [
|
|
15
|
+
{
|
|
16
|
+
"html": "<div class=\"ui-menu\"><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item\"><span class=\"ui-menu__item-icon\">+</span>New File<span class=\"ui-menu__item-shortcut\">Cmd+N</span></button></li><li><button class=\"ui-menu__item\"><span class=\"ui-menu__item-icon\">O</span>Open<span class=\"ui-menu__item-shortcut\">Cmd+O</span></button></li><li><button class=\"ui-menu__item\"><span class=\"ui-menu__item-icon\">S</span>Save<span class=\"ui-menu__item-shortcut\">Cmd+S</span></button></li></ul></div>"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"title": "Groups with Labels",
|
|
22
|
+
"examples": [
|
|
23
|
+
{
|
|
24
|
+
"html": "<div class=\"ui-menu\"><div class=\"ui-menu__label\">Edit</div><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item\">Cut</button></li><li><button class=\"ui-menu__item\">Copy</button></li><li><button class=\"ui-menu__item\">Paste</button></li></ul><div class=\"ui-menu__separator\"></div><div class=\"ui-menu__label\">View</div><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item\">Zoom In</button></li><li><button class=\"ui-menu__item\">Zoom Out</button></li></ul></div>"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "States",
|
|
30
|
+
"examples": [
|
|
31
|
+
{
|
|
32
|
+
"html": "<div class=\"ui-menu\"><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item\">Normal Item</button></li><li><button class=\"ui-menu__item ui-menu__item--disabled\" aria-disabled=\"true\">Disabled Item</button></li><li><button class=\"ui-menu__item ui-menu__item--danger\">Delete</button></li></ul></div>"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "Checkable Items",
|
|
38
|
+
"examples": [
|
|
39
|
+
{
|
|
40
|
+
"html": "<div class=\"ui-menu\"><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item ui-menu__item--check\"><span class=\"ui-menu__item-indicator\">✓</span>Show Toolbar</button></li><li><button class=\"ui-menu__item ui-menu__item--check\"><span class=\"ui-menu__item-indicator\"></span>Show Sidebar</button></li></ul><div class=\"ui-menu__separator\"></div><ul class=\"ui-menu__group\"><li><button class=\"ui-menu__item ui-menu__item--radio\"><span class=\"ui-menu__item-indicator\">•</span>List View</button></li><li><button class=\"ui-menu__item ui-menu__item--radio\"><span class=\"ui-menu__item-indicator\"></span>Grid View</button></li></ul></div>"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"customization": [
|
|
46
|
+
{
|
|
47
|
+
"token": "--ui-menu-min-width",
|
|
48
|
+
"default": "calc(var(--unit) * 16)",
|
|
49
|
+
"description": "Minimum width"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"token": "--ui-menu-max-height",
|
|
53
|
+
"default": "calc(var(--unit) * 40)",
|
|
54
|
+
"description": "Maximum height"
|
|
55
|
+
},
|
|
56
|
+
{ "token": "--ui-menu-padding", "default": "var(--unit)", "description": "Container padding" },
|
|
57
|
+
{
|
|
58
|
+
"token": "--ui-menu-radius",
|
|
59
|
+
"default": "var(--ui-radius-md)",
|
|
60
|
+
"description": "Border radius"
|
|
61
|
+
},
|
|
62
|
+
{ "token": "--ui-menu-bg", "default": "var(--ui-color-bg)", "description": "Background color" },
|
|
63
|
+
{
|
|
64
|
+
"token": "--ui-menu-border-color",
|
|
65
|
+
"default": "var(--ui-color-border)",
|
|
66
|
+
"description": "Border color"
|
|
67
|
+
},
|
|
68
|
+
{ "token": "--ui-menu-shadow", "default": "var(--shadow-lg)", "description": "Box shadow" },
|
|
69
|
+
{ "token": "--ui-menu-item-padding", "default": "8px 16px", "description": "Item padding" },
|
|
70
|
+
{
|
|
71
|
+
"token": "--ui-menu-item-radius",
|
|
72
|
+
"default": "var(--ui-radius-sm)",
|
|
73
|
+
"description": "Item border radius"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"token": "--ui-menu-item-bg-hover",
|
|
77
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
78
|
+
"description": "Item hover background"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
@@ -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, 'menu.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('menu visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'menu');
|
|
11
|
+
await saveForLostPixel(page, 'menu');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('menu.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Modal - container for modal dialogs
|
|
4
|
+
// Centered container with backdrop that appears over page content
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.modal {
|
|
8
|
+
--_bg: var(--ui-modal-bg, var(--ui-color-bg, white));
|
|
9
|
+
--_radius: var(--ui-modal-radius, var(--ui-radius-lg, calc(#{t.$unit} * 1.5)));
|
|
10
|
+
--_shadow: var(--ui-modal-shadow, 0 calc(#{t.$unit} * 3) calc(#{t.$unit} * 6) rgb(0 0 0 / 0.25));
|
|
11
|
+
--_padding: var(--ui-modal-padding, calc(#{t.$unit} * 3));
|
|
12
|
+
--_max-width: var(--ui-modal-max-width, calc(#{t.$unit} * 60));
|
|
13
|
+
--_max-height: var(--ui-modal-max-height, calc(100vh - #{t.$unit} * 8));
|
|
14
|
+
--_z: var(--ui-modal-z, var(--ui-z-modal, 400));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.modal--sm {
|
|
18
|
+
--_max-width: var(--ui-modal-max-width-sm, calc(#{t.$unit} * 40));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.modal--lg {
|
|
22
|
+
--_max-width: var(--ui-modal-max-width-lg, calc(#{t.$unit} * 80));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.modal--full {
|
|
26
|
+
--_max-width: calc(100vw - #{t.$unit} * 4);
|
|
27
|
+
--_max-height: calc(100vh - #{t.$unit} * 4);
|
|
28
|
+
--_radius: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@layer components.styles {
|
|
33
|
+
.modal {
|
|
34
|
+
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
position: fixed;
|
|
39
|
+
inset: 0;
|
|
40
|
+
z-index: var(--_z);
|
|
41
|
+
|
|
42
|
+
padding: calc(#{t.$unit} * 2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.modal__content {
|
|
46
|
+
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
position: relative;
|
|
50
|
+
|
|
51
|
+
inline-size: 100%;
|
|
52
|
+
max-block-size: var(--_max-height);
|
|
53
|
+
max-inline-size: var(--_max-width);
|
|
54
|
+
padding: var(--_padding);
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
|
|
57
|
+
background: var(--_bg);
|
|
58
|
+
border-radius: var(--_radius);
|
|
59
|
+
box-shadow: var(--_shadow);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Scrollable body
|
|
63
|
+
.modal__body {
|
|
64
|
+
flex: 1 1 auto;
|
|
65
|
+
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Animation states
|
|
70
|
+
.modal--entering .modal__content,
|
|
71
|
+
.modal--visible .modal__content {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
transform: scale(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.modal--exiting .modal__content,
|
|
77
|
+
.modal--hidden .modal__content {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transform: scale(0.95);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.modal--animate .modal__content {
|
|
83
|
+
transition:
|
|
84
|
+
opacity var(--ui-duration-normal, 200ms) var(--ui-ease-default, ease),
|
|
85
|
+
transform var(--ui-duration-normal, 200ms) var(--ui-ease-default, ease);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Hidden state hides entire modal
|
|
89
|
+
.modal--hidden {
|
|
90
|
+
visibility: hidden;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "modal",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-modal-bg",
|
|
8
|
+
"default": "var(--ui-color-bg)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-modal-radius",
|
|
12
|
+
"default": "var(--ui-radius-lg)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-modal-shadow",
|
|
16
|
+
"default": "0 calc(#{t.$unit} * 3"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-modal-padding",
|
|
20
|
+
"default": "calc(#{t.$unit} * 3"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-modal-max-width",
|
|
24
|
+
"default": "calc(#{t.$unit} * 60"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-modal-max-height",
|
|
28
|
+
"default": "calc(100vh - #{t.$unit} * 8"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "--ui-modal-z",
|
|
32
|
+
"default": "var(--ui-z-modal)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "--ui-modal-max-width-sm",
|
|
36
|
+
"default": "calc(#{t.$unit} * 40"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "--ui-modal-max-width-lg",
|
|
40
|
+
"default": "calc(#{t.$unit} * 80"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "modal",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Modal",
|
|
5
|
+
"description": "Container for modal dialogs. Use with overlay for backdrop effect.",
|
|
6
|
+
"api": "./modal.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<div style=\"position: relative; height: 200px; background: var(--ui-color-bg-subtle);\"><div class=\"ui-modal ui-modal--visible\" style=\"position: absolute;\"><div class=\"ui-modal__content\"><p>Modal content goes here</p></div></div></div>",
|
|
13
|
+
"code": "<div class=\"ui-overlay\"></div>\n<div class=\"ui-modal\">\n <div class=\"ui-modal__content\">\n <p>Modal content goes here</p>\n </div>\n</div>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Sizes",
|
|
19
|
+
"data": {
|
|
20
|
+
"sizes": [
|
|
21
|
+
{ "mod": "sm", "label": "Small" },
|
|
22
|
+
{ "mod": "", "label": "Default" },
|
|
23
|
+
{ "mod": "lg", "label": "Large" }
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"examples": [
|
|
27
|
+
{
|
|
28
|
+
"html": "<div style=\"position: relative; height: 120px; background: var(--ui-color-bg-subtle);\"><div class=\"ui-modal ui-modal--sm ui-modal--visible\" style=\"position: absolute;\"><div class=\"ui-modal__content\"><p>Small modal</p></div></div></div>",
|
|
29
|
+
"code": "<div class=\"ui-modal ui-modal--sm\">\n <div class=\"ui-modal__content\">Small modal</div>\n</div>"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"title": "With Scrollable Content",
|
|
35
|
+
"examples": [
|
|
36
|
+
{
|
|
37
|
+
"html": "<div style=\"position: relative; height: 200px; background: var(--ui-color-bg-subtle);\"><div class=\"ui-modal ui-modal--visible\" style=\"position: absolute;\"><div class=\"ui-modal__content\" style=\"max-height: 150px;\"><div class=\"ui-modal__body\"><p>Line 1</p><p>Line 2</p><p>Line 3</p><p>Line 4</p><p>Line 5</p><p>Line 6</p></div></div></div></div>",
|
|
38
|
+
"code": "<div class=\"ui-modal\">\n <div class=\"ui-modal__content\">\n <div class=\"ui-modal__body\">\n <!-- Scrollable content -->\n </div>\n </div>\n</div>"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"customization": [
|
|
44
|
+
{
|
|
45
|
+
"token": "--ui-modal-bg",
|
|
46
|
+
"default": "var(--ui-color-bg)",
|
|
47
|
+
"description": "Background color"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"token": "--ui-modal-radius",
|
|
51
|
+
"default": "var(--ui-radius-lg)",
|
|
52
|
+
"description": "Border radius"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"token": "--ui-modal-shadow",
|
|
56
|
+
"default": "0 24px 48px rgb(0 0 0 / 0.25)",
|
|
57
|
+
"description": "Box shadow"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"token": "--ui-modal-padding",
|
|
61
|
+
"default": "calc(var(--unit) * 3)",
|
|
62
|
+
"description": "Content padding"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"token": "--ui-modal-max-width",
|
|
66
|
+
"default": "calc(var(--unit) * 60)",
|
|
67
|
+
"description": "Max width (default)"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"token": "--ui-modal-max-width-sm",
|
|
71
|
+
"default": "calc(var(--unit) * 40)",
|
|
72
|
+
"description": "Max width (small)"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"token": "--ui-modal-max-width-lg",
|
|
76
|
+
"default": "calc(var(--unit) * 80)",
|
|
77
|
+
"description": "Max width (large)"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"token": "--ui-modal-max-height",
|
|
81
|
+
"default": "calc(100vh - var(--unit) * 8)",
|
|
82
|
+
"description": "Max height"
|
|
83
|
+
},
|
|
84
|
+
{ "token": "--ui-modal-z", "default": "var(--ui-z-modal)", "description": "Z-index" }
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -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, 'modal.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('modal visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'modal');
|
|
11
|
+
await saveForLostPixel(page, 'modal');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('modal.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Overlay - backdrop for modals, dialogs, drawers
|
|
4
|
+
// Full viewport coverage with semi-transparent background
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.overlay {
|
|
8
|
+
--_bg: var(--ui-overlay-bg, rgb(0 0 0 / 0.5));
|
|
9
|
+
--_z: var(--ui-overlay-z, var(--ui-z-overlay, 300));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.overlay--light {
|
|
13
|
+
--_bg: var(--ui-overlay-bg-light, rgb(255 255 255 / 0.7));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.overlay--blur {
|
|
17
|
+
--_bg: var(--ui-overlay-bg-blur, rgb(0 0 0 / 0.3));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@layer components.styles {
|
|
22
|
+
.overlay {
|
|
23
|
+
position: fixed;
|
|
24
|
+
inset: 0;
|
|
25
|
+
z-index: var(--_z);
|
|
26
|
+
|
|
27
|
+
background: var(--_bg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.overlay--blur {
|
|
31
|
+
backdrop-filter: blur(calc(#{t.$unit} * 0.5));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Animation states (controlled via JS)
|
|
35
|
+
.overlay--entering,
|
|
36
|
+
.overlay--visible {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.overlay--exiting,
|
|
41
|
+
.overlay--hidden {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.overlay--animate {
|
|
47
|
+
transition: opacity var(--ui-duration-normal, 200ms) var(--ui-ease-default, ease);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "overlay",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-overlay-bg",
|
|
8
|
+
"default": "rgb(0 0 0 / 0.5"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-overlay-z",
|
|
12
|
+
"default": "var(--ui-z-overlay)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-overlay-bg-light",
|
|
16
|
+
"default": "rgb(255 255 255 / 0.7"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-overlay-bg-blur",
|
|
20
|
+
"default": "rgb(0 0 0 / 0.3"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|