@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,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "overlay",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Overlay",
|
|
5
|
+
"description": "Full viewport backdrop for modals, dialogs, and drawers. Controls visibility via state modifiers.",
|
|
6
|
+
"api": "./overlay.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<div style=\"position: relative; height: 120px; background: var(--ui-color-bg-subtle);\"><div class=\"ui-overlay\" style=\"position: absolute;\"></div><p style=\"position: relative; padding: var(--ui-space-2);\">Content behind overlay</p></div>",
|
|
13
|
+
"code": "<div class=\"ui-overlay\"></div>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Light Variant",
|
|
19
|
+
"examples": [
|
|
20
|
+
{
|
|
21
|
+
"html": "<div style=\"position: relative; height: 120px; background: var(--ui-color-text);\"><div class=\"ui-overlay ui-overlay--light\" style=\"position: absolute;\"></div><p style=\"position: relative; padding: var(--ui-space-2); color: white;\">Dark content behind light overlay</p></div>",
|
|
22
|
+
"code": "<div class=\"ui-overlay ui-overlay--light\"></div>"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Blur Variant",
|
|
28
|
+
"examples": [
|
|
29
|
+
{
|
|
30
|
+
"html": "<div style=\"position: relative; height: 120px; background: linear-gradient(45deg, var(--ui-color-primary), var(--ui-color-success));\"><div class=\"ui-overlay ui-overlay--blur\" style=\"position: absolute;\"></div><p style=\"position: relative; padding: var(--ui-space-2); color: white;\">Blurred backdrop</p></div>",
|
|
31
|
+
"code": "<div class=\"ui-overlay ui-overlay--blur\"></div>"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": "With Animation",
|
|
37
|
+
"examples": [
|
|
38
|
+
{
|
|
39
|
+
"html": "<div style=\"position: relative; height: 120px; background: var(--ui-color-bg-subtle);\"><div class=\"ui-overlay ui-overlay--animate ui-overlay--visible\" style=\"position: absolute;\"></div></div>",
|
|
40
|
+
"code": "<div class=\"ui-overlay ui-overlay--animate ui-overlay--visible\"></div>\n<!-- JS toggles between --visible and --hidden -->"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"customization": [
|
|
46
|
+
{
|
|
47
|
+
"token": "--ui-overlay-bg",
|
|
48
|
+
"default": "rgb(0 0 0 / 0.5)",
|
|
49
|
+
"description": "Default backdrop color"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"token": "--ui-overlay-bg-light",
|
|
53
|
+
"default": "rgb(255 255 255 / 0.7)",
|
|
54
|
+
"description": "Light variant backdrop color"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"token": "--ui-overlay-bg-blur",
|
|
58
|
+
"default": "rgb(0 0 0 / 0.3)",
|
|
59
|
+
"description": "Blur variant backdrop color"
|
|
60
|
+
},
|
|
61
|
+
{ "token": "--ui-overlay-z", "default": "var(--ui-z-overlay)", "description": "Z-index layer" }
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -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, 'overlay.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('overlay visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'overlay');
|
|
11
|
+
await saveForLostPixel(page, 'overlay');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('overlay.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Pagination - page navigation
|
|
4
|
+
// Navigation through paginated content
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.pagination {
|
|
8
|
+
--_gap: var(--ui-pagination-gap, calc(#{t.$unit} * 0.5));
|
|
9
|
+
--_item-size: var(--ui-pagination-item-size, calc(#{t.$unit} * 4));
|
|
10
|
+
--_item-radius: var(--ui-pagination-item-radius, var(--ui-radius-sm, #{t.$radius-sm}));
|
|
11
|
+
--_item-bg: var(--ui-pagination-item-bg, transparent);
|
|
12
|
+
--_item-bg-hover: var(--ui-pagination-item-bg-hover, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
13
|
+
--_item-bg-active: var(--ui-pagination-item-bg-active, var(--ui-color-primary));
|
|
14
|
+
--_item-color: var(--ui-pagination-item-color, var(--ui-color-text, #{t.$color-text}));
|
|
15
|
+
--_item-color-active: var(--ui-pagination-item-color-active, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@layer components.styles {
|
|
20
|
+
.pagination {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--_gap);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pagination__list {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--_gap);
|
|
30
|
+
|
|
31
|
+
padding: 0;
|
|
32
|
+
margin: 0;
|
|
33
|
+
|
|
34
|
+
list-style: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.pagination__item {
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pagination__link {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
|
|
46
|
+
block-size: var(--_item-size);
|
|
47
|
+
min-inline-size: var(--_item-size);
|
|
48
|
+
padding-inline: calc(#{t.$unit} * 1);
|
|
49
|
+
|
|
50
|
+
font-size: var(--ui-font-size-sm, #{t.$font-size-sm});
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
color: var(--_item-color);
|
|
53
|
+
|
|
54
|
+
background: var(--_item-bg);
|
|
55
|
+
border-radius: var(--_item-radius);
|
|
56
|
+
|
|
57
|
+
transition:
|
|
58
|
+
background var(--ui-duration-fast, 100ms) var(--ui-ease-default, ease),
|
|
59
|
+
color var(--ui-duration-fast, 100ms) var(--ui-ease-default, ease);
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
background: var(--_item-bg-hover);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Current page
|
|
67
|
+
.pagination__link[aria-current="page"],
|
|
68
|
+
.pagination__link--active {
|
|
69
|
+
color: var(--_item-color-active);
|
|
70
|
+
|
|
71
|
+
background: var(--_item-bg-active);
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Disabled state
|
|
76
|
+
.pagination__link[aria-disabled="true"],
|
|
77
|
+
.pagination__link--disabled {
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Previous/Next buttons
|
|
83
|
+
.pagination__prev,
|
|
84
|
+
.pagination__next {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: calc(#{t.$unit} * 0.5);
|
|
88
|
+
|
|
89
|
+
padding-inline: calc(#{t.$unit} * 1.5);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Ellipsis
|
|
93
|
+
.pagination__ellipsis {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
|
|
98
|
+
block-size: var(--_item-size);
|
|
99
|
+
min-inline-size: var(--_item-size);
|
|
100
|
+
|
|
101
|
+
color: var(--ui-color-text-muted, #{t.$color-text-muted});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Size variants
|
|
105
|
+
.pagination--sm {
|
|
106
|
+
--_item-size: calc(#{t.$unit} * 3);
|
|
107
|
+
--_gap: calc(#{t.$unit} * 0.25);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pagination--lg {
|
|
111
|
+
--_item-size: calc(#{t.$unit} * 5);
|
|
112
|
+
--_gap: calc(#{t.$unit} * 0.75);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pagination",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-pagination-gap",
|
|
8
|
+
"default": "calc(#{t.$unit} * 0.5"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-pagination-item-size",
|
|
12
|
+
"default": "calc(#{t.$unit} * 4"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-pagination-item-radius",
|
|
16
|
+
"default": "var(--ui-radius-sm)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-pagination-item-bg",
|
|
20
|
+
"default": "transparent"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-pagination-item-bg-hover",
|
|
24
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-pagination-item-bg-active",
|
|
28
|
+
"default": "var(--ui-color-primary)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "--ui-pagination-item-color",
|
|
32
|
+
"default": "var(--ui-color-text)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "--ui-pagination-item-color-active",
|
|
36
|
+
"default": "var(--ui-color-text-inverse)"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": "./pagination.api.json",
|
|
3
|
+
"sections": [
|
|
4
|
+
{
|
|
5
|
+
"title": "Default",
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"html": "<nav class=\"ui-pagination\"><a class=\"ui-pagination__link ui-pagination__prev\" href=\"#\">Prev</a><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">2</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">3</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">4</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">5</a></li></ul><a class=\"ui-pagination__link ui-pagination__next\" href=\"#\">Next</a></nav>"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"title": "With Ellipsis",
|
|
14
|
+
"examples": [
|
|
15
|
+
{
|
|
16
|
+
"html": "<nav class=\"ui-pagination\"><a class=\"ui-pagination__link ui-pagination__prev\" href=\"#\">Prev</a><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><span class=\"ui-pagination__ellipsis\">...</span></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">4</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">5</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">6</a></li><li class=\"ui-pagination__item\"><span class=\"ui-pagination__ellipsis\">...</span></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">20</a></li></ul><a class=\"ui-pagination__link ui-pagination__next\" href=\"#\">Next</a></nav>"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"title": "Disabled States",
|
|
22
|
+
"examples": [
|
|
23
|
+
{
|
|
24
|
+
"html": "<nav class=\"ui-pagination\"><a class=\"ui-pagination__link ui-pagination__prev ui-pagination__link--disabled\" aria-disabled=\"true\">Prev</a><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">2</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">3</a></li></ul><a class=\"ui-pagination__link ui-pagination__next\" href=\"#\">Next</a></nav>"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Sizes",
|
|
30
|
+
"examples": [
|
|
31
|
+
{
|
|
32
|
+
"html": "<nav class=\"ui-pagination ui-pagination--sm\"><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">2</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">3</a></li></ul></nav>",
|
|
33
|
+
"layout": "stack"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"html": "<nav class=\"ui-pagination\"><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">2</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">3</a></li></ul></nav>",
|
|
37
|
+
"layout": "stack"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"html": "<nav class=\"ui-pagination ui-pagination--lg\"><ul class=\"ui-pagination__list\"><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">1</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link ui-pagination__link--active\" aria-current=\"page\" href=\"#\">2</a></li><li class=\"ui-pagination__item\"><a class=\"ui-pagination__link\" href=\"#\">3</a></li></ul></nav>",
|
|
41
|
+
"layout": "stack"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"customization": [
|
|
47
|
+
{
|
|
48
|
+
"token": "--ui-pagination-gap",
|
|
49
|
+
"default": "calc(var(--unit) * 0.5)",
|
|
50
|
+
"description": "Gap between items"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"token": "--ui-pagination-item-size",
|
|
54
|
+
"default": "calc(var(--unit) * 4)",
|
|
55
|
+
"description": "Item size"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"token": "--ui-pagination-item-radius",
|
|
59
|
+
"default": "var(--ui-radius-sm)",
|
|
60
|
+
"description": "Item border radius"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"token": "--ui-pagination-item-bg",
|
|
64
|
+
"default": "transparent",
|
|
65
|
+
"description": "Item background"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"token": "--ui-pagination-item-bg-hover",
|
|
69
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
70
|
+
"description": "Item hover background"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"token": "--ui-pagination-item-bg-active",
|
|
74
|
+
"default": "var(--ui-color-primary)",
|
|
75
|
+
"description": "Active item background"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"token": "--ui-pagination-item-color",
|
|
79
|
+
"default": "var(--ui-color-text)",
|
|
80
|
+
"description": "Item text color"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"token": "--ui-pagination-item-color-active",
|
|
84
|
+
"default": "var(--ui-color-text-inverse)",
|
|
85
|
+
"description": "Active item text color"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -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, 'pagination.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('pagination visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'pagination');
|
|
11
|
+
await saveForLostPixel(page, 'pagination');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('pagination.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
@use '../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// Popover - floating panel for additional content
|
|
4
|
+
// Larger than tooltip, can contain structured content
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.popover {
|
|
8
|
+
--_bg: var(--ui-popover-bg, var(--ui-color-bg, white));
|
|
9
|
+
--_border-color: var(--ui-popover-border-color, var(--ui-color-border, rgb(0 0 0 / 0.1)));
|
|
10
|
+
--_radius: var(--ui-popover-radius, var(--ui-radius-md, calc(#{t.$unit} * 1)));
|
|
11
|
+
--_shadow: var(--ui-popover-shadow, 0 calc(#{t.$unit} / 2) calc(#{t.$unit} * 2) rgb(0 0 0 / 0.15));
|
|
12
|
+
--_padding: var(--ui-popover-padding, calc(#{t.$unit} * 2));
|
|
13
|
+
--_max-width: var(--ui-popover-max-width, calc(#{t.$unit} * 40));
|
|
14
|
+
--_z: var(--ui-popover-z, var(--ui-z-popover, 500));
|
|
15
|
+
--_arrow-size: var(--ui-popover-arrow-size, calc(#{t.$unit}));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@layer components.styles {
|
|
20
|
+
.popover {
|
|
21
|
+
position: absolute;
|
|
22
|
+
z-index: var(--_z);
|
|
23
|
+
|
|
24
|
+
max-inline-size: var(--_max-width);
|
|
25
|
+
padding: var(--_padding);
|
|
26
|
+
|
|
27
|
+
line-height: var(--ui-row-1, #{t.$row});
|
|
28
|
+
|
|
29
|
+
background: var(--_bg);
|
|
30
|
+
border-radius: var(--_radius);
|
|
31
|
+
outline: var(--ui-border-width-sm, 0.0625rem) solid var(--_border-color);
|
|
32
|
+
box-shadow: var(--_shadow);
|
|
33
|
+
outline-offset: calc(var(--ui-border-width-sm, 0.0625rem) * -1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Header section
|
|
37
|
+
.popover__header {
|
|
38
|
+
padding-block-end: calc(#{t.$unit} * 2);
|
|
39
|
+
margin-block-end: calc(#{t.$unit} * 2);
|
|
40
|
+
|
|
41
|
+
box-shadow: inset 0 calc(var(--ui-border-width-sm, 1px) * -1) 0 var(--_border-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.popover__title {
|
|
45
|
+
margin: 0;
|
|
46
|
+
|
|
47
|
+
font-size: var(--ui-font-size-md, #{t.$font-size-md});
|
|
48
|
+
font-weight: var(--ui-weight-semibold, 600);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Arrow pointing down (popover above trigger)
|
|
52
|
+
.popover--top::after {
|
|
53
|
+
|
|
54
|
+
content: "";
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset-block-start: 100%;
|
|
57
|
+
inset-inline-start: 50%;
|
|
58
|
+
|
|
59
|
+
border: var(--_arrow-size) solid transparent;
|
|
60
|
+
border-block-start-color: var(--_bg);
|
|
61
|
+
transform: translateX(-50%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.popover--top::before {
|
|
65
|
+
|
|
66
|
+
content: "";
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset-block-start: 100%;
|
|
69
|
+
inset-inline-start: 50%;
|
|
70
|
+
|
|
71
|
+
border: calc(var(--_arrow-size) + 1px) solid transparent;
|
|
72
|
+
border-block-start-color: var(--_border-color);
|
|
73
|
+
transform: translateX(-50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Arrow pointing up (popover below trigger)
|
|
77
|
+
.popover--bottom::after {
|
|
78
|
+
|
|
79
|
+
content: "";
|
|
80
|
+
position: absolute;
|
|
81
|
+
inset-block-end: 100%;
|
|
82
|
+
inset-inline-start: 50%;
|
|
83
|
+
|
|
84
|
+
border: var(--_arrow-size) solid transparent;
|
|
85
|
+
border-block-end-color: var(--_bg);
|
|
86
|
+
transform: translateX(-50%);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.popover--bottom::before {
|
|
90
|
+
|
|
91
|
+
content: "";
|
|
92
|
+
position: absolute;
|
|
93
|
+
inset-block-end: 100%;
|
|
94
|
+
inset-inline-start: 50%;
|
|
95
|
+
|
|
96
|
+
border: calc(var(--_arrow-size) + 1px) solid transparent;
|
|
97
|
+
border-block-end-color: var(--_border-color);
|
|
98
|
+
transform: translateX(-50%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Animation states
|
|
102
|
+
.popover--visible {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.popover--hidden {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.popover--animate {
|
|
112
|
+
transition: opacity var(--ui-duration-fast, 100ms) var(--ui-ease-default, ease);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "popover",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{
|
|
7
|
+
"name": "--ui-popover-bg",
|
|
8
|
+
"default": "var(--ui-color-bg)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-popover-border-color",
|
|
12
|
+
"default": "var(--ui-color-border)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "--ui-popover-radius",
|
|
16
|
+
"default": "var(--ui-radius-md)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "--ui-popover-shadow",
|
|
20
|
+
"default": "0 calc(#{t.$unit} / 2"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "--ui-popover-padding",
|
|
24
|
+
"default": "calc(#{t.$unit} * 2"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-popover-max-width",
|
|
28
|
+
"default": "calc(#{t.$unit} * 40"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "--ui-popover-z",
|
|
32
|
+
"default": "var(--ui-z-popover)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "--ui-popover-arrow-size",
|
|
36
|
+
"default": "calc(#{t.$unit}"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "popover",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Popover",
|
|
5
|
+
"description": "Floating panel for additional content. Larger than tooltip, can contain structured content.",
|
|
6
|
+
"api": "./popover.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"html": "<div class=\"ui-popover\" style=\"position: relative;\"><p>Popover content goes here. Can contain multiple paragraphs and other elements.</p></div>",
|
|
13
|
+
"code": "<div class=\"ui-popover\">\n <p>Popover content goes here.</p>\n</div>"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "With Header",
|
|
19
|
+
"examples": [
|
|
20
|
+
{
|
|
21
|
+
"html": "<div class=\"ui-popover\" style=\"position: relative;\"><header class=\"ui-popover__header\"><h3 class=\"ui-popover__title\">Popover Title</h3></header><p>Content with a header section.</p></div>",
|
|
22
|
+
"code": "<div class=\"ui-popover\">\n <header class=\"ui-popover__header\">\n <h3 class=\"ui-popover__title\">Popover Title</h3>\n </header>\n <p>Content with a header section.</p>\n</div>"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "With Arrow",
|
|
28
|
+
"examples": [
|
|
29
|
+
{
|
|
30
|
+
"html": "<div style=\"padding: var(--ui-space-4);\"><div class=\"ui-popover ui-popover--top\" style=\"position: relative;\"><p>Popover with arrow pointing down</p></div></div>",
|
|
31
|
+
"code": "<div class=\"ui-popover ui-popover--top\">\n <p>Popover with arrow pointing down</p>\n</div>"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"customization": [
|
|
37
|
+
{
|
|
38
|
+
"token": "--ui-popover-bg",
|
|
39
|
+
"default": "var(--ui-color-bg)",
|
|
40
|
+
"description": "Background color"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"token": "--ui-popover-border-color",
|
|
44
|
+
"default": "var(--ui-color-border)",
|
|
45
|
+
"description": "Border color"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"token": "--ui-popover-radius",
|
|
49
|
+
"default": "var(--ui-radius-md)",
|
|
50
|
+
"description": "Border radius"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"token": "--ui-popover-shadow",
|
|
54
|
+
"default": "0 4px 16px rgb(0 0 0 / 0.15)",
|
|
55
|
+
"description": "Box shadow"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"token": "--ui-popover-padding",
|
|
59
|
+
"default": "calc(var(--unit) * 2)",
|
|
60
|
+
"description": "Content padding"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"token": "--ui-popover-max-width",
|
|
64
|
+
"default": "calc(var(--unit) * 40)",
|
|
65
|
+
"description": "Maximum width"
|
|
66
|
+
},
|
|
67
|
+
{ "token": "--ui-popover-z", "default": "var(--ui-z-popover)", "description": "Z-index layer" },
|
|
68
|
+
{ "token": "--ui-popover-arrow-size", "default": "var(--unit)", "description": "Arrow size" }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -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, 'popover.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('popover visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'popover');
|
|
11
|
+
await saveForLostPixel(page, 'popover');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('popover.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|