@teseor/css 1.3.0 → 1.5.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/dist/compiled.css +1 -1
- package/dist/index.css +28 -9
- package/package.json +1 -1
- package/src/03-layout/app-shell/app-shell.api.json +18 -0
- package/src/03-layout/app-shell/app-shell.docs.json +18 -0
- package/src/03-layout/content/content-visual.png +0 -0
- package/src/03-layout/content/content.api.json +26 -0
- package/src/03-layout/content/content.docs.json +82 -0
- package/src/03-layout/content/content.visual.spec.ts +14 -0
- package/src/03-layout/content/index.scss +25 -0
- package/src/03-layout/footer/footer-visual.png +0 -0
- package/src/03-layout/footer/footer.api.json +45 -0
- package/src/03-layout/footer/footer.docs.json +110 -0
- package/src/03-layout/footer/footer.visual.spec.ts +14 -0
- package/src/03-layout/footer/index.scss +62 -0
- package/src/03-layout/index.scss +11 -6
- package/src/03-layout/main/index.scss +1 -0
- package/src/03-layout/nav-rail/index.scss +50 -0
- package/src/03-layout/nav-rail/nav-rail-visual.png +0 -0
- package/src/03-layout/nav-rail/nav-rail.api.json +35 -0
- package/src/03-layout/nav-rail/nav-rail.docs.json +76 -0
- package/src/03-layout/nav-rail/nav-rail.visual.spec.ts +14 -0
- package/src/03-layout/page-header/index.scss +52 -0
- package/src/03-layout/page-header/page-header-visual.png +0 -0
- package/src/03-layout/page-header/page-header.api.json +35 -0
- package/src/03-layout/page-header/page-header.docs.json +124 -0
- package/src/03-layout/page-header/page-header.visual.spec.ts +14 -0
- package/src/03-layout/sidebar/index.scss +2 -2
- package/src/03-layout/topbar/index.scss +62 -0
- package/src/03-layout/topbar/topbar-visual.png +0 -0
- package/src/03-layout/topbar/topbar.api.json +45 -0
- package/src/03-layout/topbar/topbar.docs.json +110 -0
- package/src/03-layout/topbar/topbar.visual.spec.ts +14 -0
- package/src/04-components/actions/close-button/close-button-visual.png +0 -0
- package/src/04-components/actions/close-button/close-button.api.json +71 -0
- package/src/04-components/actions/close-button/close-button.docs.json +264 -0
- package/src/04-components/actions/close-button/close-button.visual.spec.ts +14 -0
- package/src/04-components/actions/close-button/index.scss +101 -0
- package/src/04-components/data-display/avatar/avatar-visual.png +0 -0
- package/src/04-components/data-display/image/image-visual.png +0 -0
- package/src/04-components/data-display/image/image.api.json +76 -0
- package/src/04-components/data-display/image/image.docs.json +337 -0
- package/src/04-components/data-display/image/image.visual.spec.ts +14 -0
- package/src/04-components/data-display/image/index.scss +103 -0
- package/src/04-components/disclosure/accordion/accordion-visual.png +0 -0
- package/src/04-components/disclosure/disclosure/disclosure-visual.png +0 -0
- package/src/04-components/feedback/progress-circle/index.scss +92 -0
- package/src/04-components/feedback/progress-circle/progress-circle-visual.png +0 -0
- package/src/04-components/feedback/progress-circle/progress-circle.api.json +53 -0
- package/src/04-components/feedback/progress-circle/progress-circle.docs.json +377 -0
- package/src/04-components/feedback/progress-circle/progress-circle.visual.spec.ts +14 -0
- package/src/04-components/forms/field/field-visual.png +0 -0
- package/src/04-components/forms/fieldset/fieldset-visual.png +0 -0
- package/src/04-components/forms/fieldset/fieldset.api.json +49 -0
- package/src/04-components/forms/fieldset/fieldset.docs.json +520 -0
- package/src/04-components/forms/fieldset/fieldset.visual.spec.ts +14 -0
- package/src/04-components/forms/fieldset/index.scss +69 -0
- package/src/04-components/forms/form/form-visual.png +0 -0
- package/src/04-components/forms/form/form.api.json +38 -0
- package/src/04-components/forms/form/form.docs.json +482 -0
- package/src/04-components/forms/form/form.visual.spec.ts +14 -0
- package/src/04-components/forms/form/index.scss +62 -0
- package/src/04-components/forms/input/input-visual.png +0 -0
- package/src/04-components/index.scss +8 -1
- package/src/04-components/typography/code-block/code-block-visual.png +0 -0
- package/src/04-components/typography/code-block/code-block.api.json +56 -0
- package/src/04-components/typography/code-block/code-block.docs.json +289 -0
- package/src/04-components/typography/code-block/code-block.visual.spec.ts +14 -0
- package/src/04-components/typography/code-block/index.scss +87 -0
- package/src/04-components/typography/list/index.scss +65 -0
- package/src/04-components/typography/list/list-visual.png +0 -0
- package/src/04-components/typography/list/list.api.json +33 -0
- package/src/04-components/typography/list/list.docs.json +293 -0
- package/src/04-components/typography/list/list.visual.spec.ts +14 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "topbar",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Topbar",
|
|
5
|
+
"description": "Fixed or sticky header bar for app layouts with start, center, and end sections.",
|
|
6
|
+
"api": "./topbar.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"description": "Basic topbar with three sections: start (brand), center (search/nav), and end (actions).",
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"items": [
|
|
14
|
+
{
|
|
15
|
+
"tag": "header",
|
|
16
|
+
"class": "ui-topbar ui-topbar--bordered",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"tag": "div",
|
|
20
|
+
"class": "ui-topbar__start",
|
|
21
|
+
"children": [{ "tag": "strong", "text": "Brand" }]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"tag": "div",
|
|
25
|
+
"class": "ui-topbar__center",
|
|
26
|
+
"children": [{ "tag": "span", "text": "Center content" }]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"tag": "div",
|
|
30
|
+
"class": "ui-topbar__end",
|
|
31
|
+
"children": [{ "tag": "span", "text": "Actions" }]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"title": "Sticky",
|
|
41
|
+
"description": "Stays at the top of the viewport on scroll.",
|
|
42
|
+
"examples": [
|
|
43
|
+
{
|
|
44
|
+
"code": "<header class=\"ui-topbar ui-topbar--sticky ui-topbar--bordered\">\n <div class=\"ui-topbar__start\"><strong>Brand</strong></div>\n <div class=\"ui-topbar__center\">Nav</div>\n <div class=\"ui-topbar__end\">Actions</div>\n</header>"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"title": "Bordered",
|
|
50
|
+
"description": "Bottom border via inset box-shadow to preserve grid rhythm.",
|
|
51
|
+
"examples": [
|
|
52
|
+
{
|
|
53
|
+
"items": [
|
|
54
|
+
{
|
|
55
|
+
"tag": "header",
|
|
56
|
+
"class": "ui-topbar ui-topbar--bordered",
|
|
57
|
+
"children": [
|
|
58
|
+
{
|
|
59
|
+
"tag": "div",
|
|
60
|
+
"class": "ui-topbar__start",
|
|
61
|
+
"children": [{ "tag": "strong", "text": "Bordered" }]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"tag": "div",
|
|
65
|
+
"class": "ui-topbar__end",
|
|
66
|
+
"children": [{ "tag": "span", "text": "Actions" }]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "Raised",
|
|
76
|
+
"description": "Subtle drop shadow below the topbar.",
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"items": [
|
|
80
|
+
{
|
|
81
|
+
"tag": "header",
|
|
82
|
+
"class": "ui-topbar ui-topbar--raised",
|
|
83
|
+
"children": [
|
|
84
|
+
{
|
|
85
|
+
"tag": "div",
|
|
86
|
+
"class": "ui-topbar__start",
|
|
87
|
+
"children": [{ "tag": "strong", "text": "Raised" }]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"tag": "div",
|
|
91
|
+
"class": "ui-topbar__end",
|
|
92
|
+
"children": [{ "tag": "span", "text": "Actions" }]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"title": "Integration with Sidebar",
|
|
102
|
+
"description": "Set --topbar-height on .app-shell so sidebar and main offset correctly. The topbar itself uses --fixed, and sidebar/main read --topbar-height.",
|
|
103
|
+
"examples": [
|
|
104
|
+
{
|
|
105
|
+
"code": "<body class=\"ui-app-shell\" style=\"--topbar-height: var(--ui-row-3)\">\n <header class=\"ui-topbar ui-topbar--fixed ui-topbar--bordered\">\n <div class=\"ui-topbar__start\"><strong>App</strong></div>\n <div class=\"ui-topbar__end\">User</div>\n </header>\n <aside class=\"ui-sidebar\">Sidebar</aside>\n <main class=\"ui-main\">\n <div class=\"ui-container\">Content</div>\n </main>\n</body>"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
@@ -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, 'topbar.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('topbar visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'topbar');
|
|
11
|
+
await saveForLostPixel(page, 'topbar');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('topbar.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "close-button",
|
|
3
|
+
"element": "button",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
},
|
|
8
|
+
"subtle": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"elements": {
|
|
13
|
+
"icon": {}
|
|
14
|
+
},
|
|
15
|
+
"cssVars": [
|
|
16
|
+
{
|
|
17
|
+
"name": "--ui-close-button-size",
|
|
18
|
+
"description": "Overall button size (width and height)",
|
|
19
|
+
"default": "var(--ui-row-2)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "--ui-close-button-icon-size",
|
|
23
|
+
"description": "Size of the X icon",
|
|
24
|
+
"default": "var(--ui-size-md)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "--ui-close-button-color",
|
|
28
|
+
"description": "Icon color",
|
|
29
|
+
"default": "var(--ui-color-text-muted)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "--ui-close-button-bg",
|
|
33
|
+
"description": "Background color",
|
|
34
|
+
"default": "transparent"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "--ui-close-button-hover-bg",
|
|
38
|
+
"description": "Background color on hover",
|
|
39
|
+
"default": "var(--ui-color-bg-muted)"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "--ui-close-button-radius",
|
|
43
|
+
"description": "Border radius",
|
|
44
|
+
"default": "var(--ui-radius-md)"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "--ui-close-button-size-sm",
|
|
48
|
+
"default": "calc(var(--ui-unit) * 3)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "--ui-close-button-icon-size-sm",
|
|
52
|
+
"default": "var(--ui-size-sm)"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "--ui-close-button-size-lg",
|
|
56
|
+
"default": "var(--ui-row-3)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "--ui-close-button-icon-size-lg",
|
|
60
|
+
"default": "var(--ui-size-lg)"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "--ui-close-button-subtle-color",
|
|
64
|
+
"default": "var(--ui-color-border-strong)"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "--ui-close-button-subtle-hover-bg",
|
|
68
|
+
"default": "var(--ui-color-bg-subtle)"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "close-button",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Close Button",
|
|
5
|
+
"description": "Dismiss button for closing modals, alerts, drawers, and other dismissible elements.",
|
|
6
|
+
"api": "./close-button.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "button",
|
|
15
|
+
"class": "ui-close-button",
|
|
16
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"tag": "svg",
|
|
20
|
+
"class": "ui-close-button__icon",
|
|
21
|
+
"attrs": {
|
|
22
|
+
"viewBox": "0 0 24 24",
|
|
23
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
24
|
+
},
|
|
25
|
+
"children": [
|
|
26
|
+
{
|
|
27
|
+
"tag": "line",
|
|
28
|
+
"attrs": {
|
|
29
|
+
"x1": "18",
|
|
30
|
+
"y1": "6",
|
|
31
|
+
"x2": "6",
|
|
32
|
+
"y2": "18"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"tag": "line",
|
|
37
|
+
"attrs": {
|
|
38
|
+
"x1": "6",
|
|
39
|
+
"y1": "6",
|
|
40
|
+
"x2": "18",
|
|
41
|
+
"y2": "18"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"code": "<button class=\"ui-close-button\" type=\"button\" aria-label=\"Close\">\n <svg class=\"ui-close-button__icon\" viewBox=\"0 0 24 24\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n</button>"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"title": "Sizes",
|
|
55
|
+
"examples": [
|
|
56
|
+
{
|
|
57
|
+
"layout": "cluster",
|
|
58
|
+
"items": [
|
|
59
|
+
{
|
|
60
|
+
"tag": "button",
|
|
61
|
+
"class": "ui-close-button ui-close-button--sm",
|
|
62
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
63
|
+
"children": [
|
|
64
|
+
{
|
|
65
|
+
"tag": "svg",
|
|
66
|
+
"class": "ui-close-button__icon",
|
|
67
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
68
|
+
"children": [
|
|
69
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
70
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"tag": "button",
|
|
77
|
+
"class": "ui-close-button",
|
|
78
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"tag": "svg",
|
|
82
|
+
"class": "ui-close-button__icon",
|
|
83
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
84
|
+
"children": [
|
|
85
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
86
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"tag": "button",
|
|
93
|
+
"class": "ui-close-button ui-close-button--lg",
|
|
94
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
95
|
+
"children": [
|
|
96
|
+
{
|
|
97
|
+
"tag": "svg",
|
|
98
|
+
"class": "ui-close-button__icon",
|
|
99
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
100
|
+
"children": [
|
|
101
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
102
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"code": "<button class=\"ui-close-button ui-close-button--sm\" aria-label=\"Close\">...</button>\n<button class=\"ui-close-button\" aria-label=\"Close\">...</button>\n<button class=\"ui-close-button ui-close-button--lg\" aria-label=\"Close\">...</button>"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"title": "Subtle",
|
|
114
|
+
"description": "Lower visual prominence for secondary dismiss actions.",
|
|
115
|
+
"examples": [
|
|
116
|
+
{
|
|
117
|
+
"layout": "cluster",
|
|
118
|
+
"items": [
|
|
119
|
+
{
|
|
120
|
+
"tag": "button",
|
|
121
|
+
"class": "ui-close-button ui-close-button--subtle",
|
|
122
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
123
|
+
"children": [
|
|
124
|
+
{
|
|
125
|
+
"tag": "svg",
|
|
126
|
+
"class": "ui-close-button__icon",
|
|
127
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
128
|
+
"children": [
|
|
129
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
130
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"tag": "button",
|
|
137
|
+
"class": "ui-close-button ui-close-button--subtle ui-close-button--sm",
|
|
138
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
139
|
+
"children": [
|
|
140
|
+
{
|
|
141
|
+
"tag": "svg",
|
|
142
|
+
"class": "ui-close-button__icon",
|
|
143
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
144
|
+
"children": [
|
|
145
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
146
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"code": "<button class=\"ui-close-button ui-close-button--subtle\" aria-label=\"Close\">...</button>"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"title": "States",
|
|
158
|
+
"examples": [
|
|
159
|
+
{
|
|
160
|
+
"layout": "cluster",
|
|
161
|
+
"items": [
|
|
162
|
+
{
|
|
163
|
+
"tag": "button",
|
|
164
|
+
"class": "ui-close-button",
|
|
165
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
166
|
+
"children": [
|
|
167
|
+
{
|
|
168
|
+
"tag": "svg",
|
|
169
|
+
"class": "ui-close-button__icon",
|
|
170
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
171
|
+
"children": [
|
|
172
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
173
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"tag": "button",
|
|
180
|
+
"class": "ui-close-button ui-close-button--hover",
|
|
181
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
182
|
+
"children": [
|
|
183
|
+
{
|
|
184
|
+
"tag": "svg",
|
|
185
|
+
"class": "ui-close-button__icon",
|
|
186
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
187
|
+
"children": [
|
|
188
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
189
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"tag": "button",
|
|
196
|
+
"class": "ui-close-button ui-close-button--focus",
|
|
197
|
+
"attrs": { "type": "button", "aria-label": "Close" },
|
|
198
|
+
"children": [
|
|
199
|
+
{
|
|
200
|
+
"tag": "svg",
|
|
201
|
+
"class": "ui-close-button__icon",
|
|
202
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
203
|
+
"children": [
|
|
204
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
205
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"tag": "button",
|
|
212
|
+
"class": "ui-close-button",
|
|
213
|
+
"attrs": { "type": "button", "aria-label": "Close", "disabled": "" },
|
|
214
|
+
"children": [
|
|
215
|
+
{
|
|
216
|
+
"tag": "svg",
|
|
217
|
+
"class": "ui-close-button__icon",
|
|
218
|
+
"attrs": { "viewBox": "0 0 24 24", "xmlns": "http://www.w3.org/2000/svg" },
|
|
219
|
+
"children": [
|
|
220
|
+
{ "tag": "line", "attrs": { "x1": "18", "y1": "6", "x2": "6", "y2": "18" } },
|
|
221
|
+
{ "tag": "line", "attrs": { "x1": "6", "y1": "6", "x2": "18", "y2": "18" } }
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
"code": "<button class=\"ui-close-button\" aria-label=\"Close\">...</button>\n<button class=\"ui-close-button ui-close-button--hover\">...</button>\n<button class=\"ui-close-button ui-close-button--focus\">...</button>\n<button class=\"ui-close-button\" disabled>...</button>"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"customization": [
|
|
233
|
+
{
|
|
234
|
+
"token": "--ui-close-button-size",
|
|
235
|
+
"default": "var(--ui-row-2)",
|
|
236
|
+
"description": "Overall button dimensions"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"token": "--ui-close-button-icon-size",
|
|
240
|
+
"default": "var(--ui-size-md)",
|
|
241
|
+
"description": "X icon dimensions"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"token": "--ui-close-button-color",
|
|
245
|
+
"default": "var(--ui-color-text-muted)",
|
|
246
|
+
"description": "Icon color"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"token": "--ui-close-button-bg",
|
|
250
|
+
"default": "transparent",
|
|
251
|
+
"description": "Background color"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"token": "--ui-close-button-hover-bg",
|
|
255
|
+
"default": "var(--ui-color-bg-muted)",
|
|
256
|
+
"description": "Hover background"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"token": "--ui-close-button-radius",
|
|
260
|
+
"default": "var(--ui-radius-md)",
|
|
261
|
+
"description": "Border radius"
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
@@ -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, 'close-button.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('close-button visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'close-button');
|
|
11
|
+
await saveForLostPixel(page, 'close-button');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('close-button.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
// @component close-button
|
|
4
|
+
// @element button
|
|
5
|
+
|
|
6
|
+
@layer components.tokens {
|
|
7
|
+
.close-button {
|
|
8
|
+
--_size: var(--ui-close-button-size, var(--ui-row-2, #{t.$row-2}));
|
|
9
|
+
--_icon-size: var(--ui-close-button-icon-size, var(--ui-size-md, #{t.size(md)}));
|
|
10
|
+
--_color: var(--ui-close-button-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
11
|
+
--_bg: var(--ui-close-button-bg, transparent);
|
|
12
|
+
--_hover-bg: var(--ui-close-button-hover-bg, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
|
|
13
|
+
--_radius: var(--ui-close-button-radius, var(--ui-radius-md, #{t.$radius-md}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// @modifier size
|
|
17
|
+
.close-button--sm {
|
|
18
|
+
--_size: var(--ui-close-button-size-sm, calc(#{t.$unit} * 3));
|
|
19
|
+
--_icon-size: var(--ui-close-button-icon-size-sm, var(--ui-size-sm, #{t.size(sm)}));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.close-button--lg {
|
|
23
|
+
--_size: var(--ui-close-button-size-lg, var(--ui-row-3, #{t.$row-3}));
|
|
24
|
+
--_icon-size: var(--ui-close-button-icon-size-lg, var(--ui-size-lg, #{t.size(lg)}));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// @modifier boolean subtle
|
|
28
|
+
.close-button--subtle {
|
|
29
|
+
--_color: var(--ui-close-button-subtle-color, var(--ui-color-border-strong, #{t.$color-border-strong}));
|
|
30
|
+
--_hover-bg: var(--ui-close-button-subtle-hover-bg, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@layer components.styles {
|
|
35
|
+
.close-button {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
|
|
40
|
+
block-size: var(--_size);
|
|
41
|
+
inline-size: var(--_size);
|
|
42
|
+
padding: 0;
|
|
43
|
+
margin: 0;
|
|
44
|
+
|
|
45
|
+
font: inherit;
|
|
46
|
+
color: var(--_color);
|
|
47
|
+
|
|
48
|
+
background: var(--_bg);
|
|
49
|
+
border: none;
|
|
50
|
+
border-radius: var(--_radius);
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
appearance: none;
|
|
53
|
+
|
|
54
|
+
transition:
|
|
55
|
+
background-color var(--ui-duration-base, 150ms) var(--ui-ease-default, ease),
|
|
56
|
+
color var(--ui-duration-base, 150ms) var(--ui-ease-default, ease);
|
|
57
|
+
|
|
58
|
+
&:hover,
|
|
59
|
+
&--hover {
|
|
60
|
+
color: var(--ui-color-text, #{t.$color-text});
|
|
61
|
+
|
|
62
|
+
background: var(--_hover-bg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus-visible,
|
|
66
|
+
&--focus {
|
|
67
|
+
outline: var(--ui-border-width-md, #{t.$border-width-md}) solid var(--ui-color-focus, #{t.$color-focus});
|
|
68
|
+
outline-offset: var(--ui-border-width-md, #{t.$border-width-md});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:active,
|
|
72
|
+
&--active {
|
|
73
|
+
transform: scale(0.92);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:disabled {
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
|
|
80
|
+
&:hover {
|
|
81
|
+
color: var(--_color);
|
|
82
|
+
|
|
83
|
+
background: var(--_bg);
|
|
84
|
+
transform: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.close-button__icon {
|
|
90
|
+
flex-shrink: 0;
|
|
91
|
+
|
|
92
|
+
block-size: var(--_icon-size);
|
|
93
|
+
inline-size: var(--_icon-size);
|
|
94
|
+
|
|
95
|
+
fill: none;
|
|
96
|
+
stroke: currentcolor;
|
|
97
|
+
stroke-width: 2;
|
|
98
|
+
stroke-linecap: round;
|
|
99
|
+
stroke-linejoin: round;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "image",
|
|
3
|
+
"element": "figure",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "md", "lg", "xl", "full"]
|
|
7
|
+
},
|
|
8
|
+
"rounded": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
},
|
|
11
|
+
"circle": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
},
|
|
14
|
+
"object-fit": {
|
|
15
|
+
"values": ["cover", "contain"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"elements": {
|
|
19
|
+
"img": {},
|
|
20
|
+
"caption": {}
|
|
21
|
+
},
|
|
22
|
+
"cssVars": [
|
|
23
|
+
{
|
|
24
|
+
"name": "--ui-image-size",
|
|
25
|
+
"default": "auto"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "--ui-image-size-sm",
|
|
29
|
+
"default": "calc(var(--unit) * 12)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "--ui-image-size-md",
|
|
33
|
+
"default": "calc(var(--unit) * 24)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "--ui-image-size-lg",
|
|
37
|
+
"default": "calc(var(--unit) * 40)"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "--ui-image-size-xl",
|
|
41
|
+
"default": "calc(var(--unit) * 60)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "--ui-image-bg",
|
|
45
|
+
"default": "var(--ui-color-bg-muted)"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "--ui-image-radius",
|
|
49
|
+
"default": "0"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "--ui-image-radius-rounded",
|
|
53
|
+
"default": "var(--ui-radius-lg)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "--ui-image-radius-circle",
|
|
57
|
+
"default": "50%"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "--ui-image-object-fit",
|
|
61
|
+
"default": "cover"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "--ui-image-caption-color",
|
|
65
|
+
"default": "var(--ui-color-text-muted)"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "--ui-image-caption-font-size",
|
|
69
|
+
"default": "var(--ui-font-size-sm)"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "--ui-image-caption-spacing",
|
|
73
|
+
"default": "var(--ui-space-1)"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|