@teseor/css 1.2.4 → 1.3.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 +12 -1
- package/package.json +1 -1
- package/src/03-layout/aspect-ratio/aspect-ratio-visual.png +0 -0
- package/src/03-layout/aspect-ratio/aspect-ratio.api.json +16 -0
- package/src/03-layout/aspect-ratio/aspect-ratio.docs.json +193 -0
- package/src/03-layout/aspect-ratio/aspect-ratio.visual.spec.ts +14 -0
- package/src/03-layout/aspect-ratio/index.scss +23 -0
- package/src/03-layout/index.scss +1 -0
- package/src/04-components/actions/button-group/button-group-visual.png +0 -0
- package/src/04-components/actions/button-group/button-group.visual.spec.ts +1 -2
- package/src/04-components/actions/button-group/index.scss +3 -1
- package/src/04-components/data-display/stat/index.scss +47 -0
- package/src/04-components/data-display/stat/stat-visual.png +0 -0
- package/src/04-components/data-display/stat/stat.api.json +18 -0
- package/src/04-components/data-display/stat/stat.docs.json +114 -0
- package/src/04-components/data-display/stat/stat.visual.spec.ts +14 -0
- package/src/04-components/index.scss +5 -0
- package/src/04-components/layout/spacer/index.scss +11 -0
- package/src/04-components/layout/spacer/spacer-visual.png +0 -0
- package/src/04-components/layout/spacer/spacer.api.json +6 -0
- package/src/04-components/layout/spacer/spacer.docs.json +102 -0
- package/src/04-components/layout/spacer/spacer.visual.spec.ts +14 -0
- package/src/04-components/typography/blockquote/blockquote-visual.png +0 -0
- package/src/04-components/typography/blockquote/blockquote.api.json +18 -0
- package/src/04-components/typography/blockquote/blockquote.docs.json +89 -0
- package/src/04-components/typography/blockquote/blockquote.visual.spec.ts +14 -0
- package/src/04-components/typography/blockquote/index.scss +41 -0
- package/src/04-components/typography/kbd/index.scss +33 -0
- package/src/04-components/typography/kbd/kbd-visual.png +0 -0
- package/src/04-components/typography/kbd/kbd.api.json +15 -0
- package/src/04-components/typography/kbd/kbd.docs.json +61 -0
- package/src/04-components/typography/kbd/kbd.visual.spec.ts +14 -0
- package/src/04-components/typography/mark/index.scss +22 -0
- package/src/04-components/typography/mark/mark-visual.png +0 -0
- package/src/04-components/typography/mark/mark.api.json +12 -0
- package/src/04-components/typography/mark/mark.docs.json +60 -0
- package/src/04-components/typography/mark/mark.visual.spec.ts +14 -0
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@forward './data-display/icon/index';
|
|
8
8
|
@forward './data-display/status/index';
|
|
9
9
|
@forward './data-display/table/index';
|
|
10
|
+
@forward './data-display/stat/index';
|
|
10
11
|
@forward './data-display/tag/index';
|
|
11
12
|
@forward './disclosure/accordion/index';
|
|
12
13
|
@forward './disclosure/disclosure/index';
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
@forward './forms/textarea/index';
|
|
27
28
|
@forward './forms/toggle/index';
|
|
28
29
|
@forward './layout/divider/index';
|
|
30
|
+
@forward './layout/spacer/index';
|
|
29
31
|
@forward './navigation/breadcrumb/index';
|
|
30
32
|
@forward './navigation/menu/index';
|
|
31
33
|
@forward './navigation/nav/index';
|
|
@@ -37,6 +39,9 @@
|
|
|
37
39
|
@forward './overlays/overlay/index';
|
|
38
40
|
@forward './overlays/popover/index';
|
|
39
41
|
@forward './overlays/tooltip/index';
|
|
42
|
+
@forward './typography/blockquote/index';
|
|
40
43
|
@forward './typography/code/index';
|
|
41
44
|
@forward './typography/heading/index';
|
|
45
|
+
@forward './typography/kbd/index';
|
|
42
46
|
@forward './typography/link/index';
|
|
47
|
+
@forward './typography/mark/index';
|
|
Binary file
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "spacer",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Spacer",
|
|
5
|
+
"description": "Flexible space filler that grows to fill available space in flex containers.",
|
|
6
|
+
"api": "./spacer.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-cluster",
|
|
16
|
+
"style": {
|
|
17
|
+
"inline-size": "100%",
|
|
18
|
+
"background": "var(--ui-color-bg-subtle)",
|
|
19
|
+
"padding": "var(--ui-space-2)"
|
|
20
|
+
},
|
|
21
|
+
"children": [
|
|
22
|
+
{
|
|
23
|
+
"tag": "span",
|
|
24
|
+
"text": "Start",
|
|
25
|
+
"style": {
|
|
26
|
+
"background": "var(--ui-color-bg-muted)",
|
|
27
|
+
"padding": "var(--ui-space-1)"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{ "tag": "div", "class": "ui-spacer" },
|
|
31
|
+
{
|
|
32
|
+
"tag": "span",
|
|
33
|
+
"text": "End",
|
|
34
|
+
"style": {
|
|
35
|
+
"background": "var(--ui-color-bg-muted)",
|
|
36
|
+
"padding": "var(--ui-space-1)"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"title": "Between items",
|
|
47
|
+
"examples": [
|
|
48
|
+
{
|
|
49
|
+
"items": [
|
|
50
|
+
{
|
|
51
|
+
"tag": "div",
|
|
52
|
+
"class": "ui-cluster",
|
|
53
|
+
"style": {
|
|
54
|
+
"inline-size": "100%",
|
|
55
|
+
"background": "var(--ui-color-bg-subtle)",
|
|
56
|
+
"padding": "var(--ui-space-2)"
|
|
57
|
+
},
|
|
58
|
+
"children": [
|
|
59
|
+
{
|
|
60
|
+
"tag": "span",
|
|
61
|
+
"text": "Logo",
|
|
62
|
+
"style": {
|
|
63
|
+
"background": "var(--ui-color-bg-muted)",
|
|
64
|
+
"padding": "var(--ui-space-1)"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{ "tag": "div", "class": "ui-spacer" },
|
|
68
|
+
{
|
|
69
|
+
"tag": "span",
|
|
70
|
+
"text": "Nav 1",
|
|
71
|
+
"style": {
|
|
72
|
+
"background": "var(--ui-color-bg-muted)",
|
|
73
|
+
"padding": "var(--ui-space-1)"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"tag": "span",
|
|
78
|
+
"text": "Nav 2",
|
|
79
|
+
"style": {
|
|
80
|
+
"background": "var(--ui-color-bg-muted)",
|
|
81
|
+
"padding": "var(--ui-space-1)"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"tag": "span",
|
|
86
|
+
"text": "Nav 3",
|
|
87
|
+
"style": {
|
|
88
|
+
"background": "var(--ui-color-bg-muted)",
|
|
89
|
+
"padding": "var(--ui-space-1)"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"customization": [
|
|
100
|
+
{ "token": "--ui-spacer-size", "default": "1", "description": "Flex grow factor" }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'spacer.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('spacer visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
// skip validateGridRhythm: spacer has no intrinsic height
|
|
11
|
+
await saveForLostPixel(page, 'spacer');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('spacer.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blockquote",
|
|
3
|
+
"element": "blockquote",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"variant": {
|
|
6
|
+
"values": ["accent"]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"subElements": ["cite"],
|
|
10
|
+
"cssVars": [
|
|
11
|
+
{ "name": "--ui-blockquote-border-color", "default": "var(--ui-color-border-strong)" },
|
|
12
|
+
{ "name": "--ui-blockquote-border-width", "default": "var(--ui-border-width-lg)" },
|
|
13
|
+
{ "name": "--ui-blockquote-padding-inline", "default": "var(--ui-space-3)" },
|
|
14
|
+
{ "name": "--ui-blockquote-color", "default": "var(--ui-color-text-muted)" },
|
|
15
|
+
{ "name": "--ui-blockquote-font-size", "default": "var(--ui-font-size-lg)" },
|
|
16
|
+
{ "name": "--ui-blockquote-line-height", "default": "var(--ui-leading-lg)" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "blockquote",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Blockquote",
|
|
5
|
+
"description": "Quote block with left border and optional citation.",
|
|
6
|
+
"api": "./blockquote.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "blockquote",
|
|
15
|
+
"class": "ui-blockquote",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "p",
|
|
19
|
+
"text": "Design is not just what it looks like and feels like. Design is how it works."
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"title": "With citation",
|
|
29
|
+
"examples": [
|
|
30
|
+
{
|
|
31
|
+
"items": [
|
|
32
|
+
{
|
|
33
|
+
"tag": "blockquote",
|
|
34
|
+
"class": "ui-blockquote",
|
|
35
|
+
"children": [
|
|
36
|
+
{ "tag": "p", "text": "The best way to predict the future is to invent it." },
|
|
37
|
+
{ "tag": "cite", "class": "ui-blockquote__cite", "text": "Alan Kay" }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "Accent variant",
|
|
46
|
+
"examples": [
|
|
47
|
+
{
|
|
48
|
+
"items": [
|
|
49
|
+
{
|
|
50
|
+
"tag": "blockquote",
|
|
51
|
+
"class": "ui-blockquote ui-blockquote--accent",
|
|
52
|
+
"children": [
|
|
53
|
+
{ "tag": "p", "text": "Simplicity is the ultimate sophistication." },
|
|
54
|
+
{ "tag": "cite", "class": "ui-blockquote__cite", "text": "Leonardo da Vinci" }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"customization": [
|
|
63
|
+
{
|
|
64
|
+
"token": "--ui-blockquote-border-color",
|
|
65
|
+
"default": "var(--ui-color-border-strong)",
|
|
66
|
+
"description": "Left border color"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"token": "--ui-blockquote-border-width",
|
|
70
|
+
"default": "var(--ui-border-width-lg)",
|
|
71
|
+
"description": "Left border width"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"token": "--ui-blockquote-padding-inline",
|
|
75
|
+
"default": "var(--ui-space-3)",
|
|
76
|
+
"description": "Inline padding"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"token": "--ui-blockquote-color",
|
|
80
|
+
"default": "var(--ui-color-text-muted)",
|
|
81
|
+
"description": "Text color"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"token": "--ui-blockquote-font-size",
|
|
85
|
+
"default": "var(--ui-font-size-lg)",
|
|
86
|
+
"description": "Font size"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
@@ -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, 'blockquote.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('blockquote visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'blockquote');
|
|
11
|
+
await saveForLostPixel(page, 'blockquote');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('blockquote.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
@layer components.tokens {
|
|
4
|
+
.blockquote {
|
|
5
|
+
--_border-color: var(--ui-blockquote-border-color, var(--ui-color-border-strong, #{t.$color-border-strong}));
|
|
6
|
+
--_border-width: var(--ui-blockquote-border-width, var(--ui-border-width-lg, #{t.$border-width-lg}));
|
|
7
|
+
--_padding-inline: var(--ui-blockquote-padding-inline, var(--ui-space-3, #{t.$space-3}));
|
|
8
|
+
--_color: var(--ui-blockquote-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
9
|
+
--_font-size: var(--ui-blockquote-font-size, var(--ui-font-size-lg, #{t.$font-size-lg}));
|
|
10
|
+
--_line-height: var(--ui-blockquote-line-height, var(--ui-leading-lg, #{t.$leading-lg}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.blockquote--accent {
|
|
14
|
+
--_border-color: var(--ui-color-primary, #{t.$color-primary});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@layer components.styles {
|
|
19
|
+
.blockquote {
|
|
20
|
+
padding-inline-start: var(--_padding-inline);
|
|
21
|
+
margin: 0;
|
|
22
|
+
|
|
23
|
+
font-size: var(--_font-size);
|
|
24
|
+
font-style: italic;
|
|
25
|
+
line-height: var(--_line-height);
|
|
26
|
+
color: var(--_color);
|
|
27
|
+
|
|
28
|
+
border-inline-start: var(--_border-width) solid var(--_border-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.blockquote__cite {
|
|
32
|
+
display: block;
|
|
33
|
+
|
|
34
|
+
margin-block-start: var(--ui-space-1, #{t.$space-1});
|
|
35
|
+
|
|
36
|
+
font-size: var(--ui-font-size-sm, #{t.$font-size-sm});
|
|
37
|
+
font-style: normal;
|
|
38
|
+
line-height: var(--ui-leading-sm, #{t.$leading-sm});
|
|
39
|
+
color: var(--ui-color-text-muted, #{t.$color-text-muted});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
@layer components.tokens {
|
|
4
|
+
.kbd {
|
|
5
|
+
--_font-size: var(--ui-kbd-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
6
|
+
--_font-family: var(--ui-kbd-font-family, var(--ui-font-mono, #{t.$font-mono}));
|
|
7
|
+
--_padding-x: var(--ui-kbd-padding-x, var(--ui-space-0, #{t.$space-0}));
|
|
8
|
+
--_padding-y: var(--ui-kbd-padding-y, var(--ui-space-0, #{t.$space-0}));
|
|
9
|
+
--_bg: var(--ui-kbd-bg, var(--ui-color-bg-subtle, #{t.$color-bg-subtle}));
|
|
10
|
+
--_border-color: var(--ui-kbd-border-color, var(--ui-color-border, #{t.$color-border}));
|
|
11
|
+
--_radius: var(--ui-kbd-radius, var(--ui-radius-sm, #{t.$radius-sm}));
|
|
12
|
+
--_color: var(--ui-kbd-color, var(--ui-color-text, #{t.$color-text}));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@layer components.styles {
|
|
17
|
+
.kbd {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
|
|
21
|
+
padding: var(--_padding-y) var(--_padding-x);
|
|
22
|
+
|
|
23
|
+
font-family: var(--_font-family);
|
|
24
|
+
font-size: var(--_font-size);
|
|
25
|
+
line-height: 1;
|
|
26
|
+
color: var(--_color);
|
|
27
|
+
|
|
28
|
+
background: var(--_bg);
|
|
29
|
+
border: var(--ui-border-width-sm, #{t.$border-width-sm}) solid var(--_border-color);
|
|
30
|
+
border-radius: var(--_radius);
|
|
31
|
+
box-shadow: 0 var(--ui-space-quarter, #{t.$space-quarter}) 0 var(--_border-color);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kbd",
|
|
3
|
+
"element": "kbd",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{ "name": "--ui-kbd-font-size", "default": "var(--ui-font-size-sm)" },
|
|
7
|
+
{ "name": "--ui-kbd-font-family", "default": "var(--ui-font-mono)" },
|
|
8
|
+
{ "name": "--ui-kbd-padding-x", "default": "var(--ui-space-0)" },
|
|
9
|
+
{ "name": "--ui-kbd-padding-y", "default": "var(--ui-space-0)" },
|
|
10
|
+
{ "name": "--ui-kbd-bg", "default": "var(--ui-color-bg-subtle)" },
|
|
11
|
+
{ "name": "--ui-kbd-border-color", "default": "var(--ui-color-border)" },
|
|
12
|
+
{ "name": "--ui-kbd-radius", "default": "var(--ui-radius-sm)" },
|
|
13
|
+
{ "name": "--ui-kbd-color", "default": "var(--ui-color-text)" }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "kbd",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Kbd",
|
|
5
|
+
"description": "Keyboard shortcut display with monospace font and key-cap styling.",
|
|
6
|
+
"api": "./kbd.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "p",
|
|
15
|
+
"children": [
|
|
16
|
+
{ "tag": "span", "text": "Press " },
|
|
17
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Ctrl" },
|
|
18
|
+
{ "tag": "span", "text": " + " },
|
|
19
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "S" },
|
|
20
|
+
{ "tag": "span", "text": " to save" }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"title": "Variations",
|
|
29
|
+
"examples": [
|
|
30
|
+
{
|
|
31
|
+
"items": [
|
|
32
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Esc" },
|
|
33
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Enter" },
|
|
34
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Tab" },
|
|
35
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Shift" },
|
|
36
|
+
{ "tag": "kbd", "class": "ui-kbd", "text": "Space" }
|
|
37
|
+
],
|
|
38
|
+
"layout": "cluster"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"customization": [
|
|
44
|
+
{
|
|
45
|
+
"token": "--ui-kbd-font-size",
|
|
46
|
+
"default": "var(--ui-font-size-sm)",
|
|
47
|
+
"description": "Font size"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"token": "--ui-kbd-bg",
|
|
51
|
+
"default": "var(--ui-color-bg-subtle)",
|
|
52
|
+
"description": "Background color"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"token": "--ui-kbd-border-color",
|
|
56
|
+
"default": "var(--ui-color-border)",
|
|
57
|
+
"description": "Border color"
|
|
58
|
+
},
|
|
59
|
+
{ "token": "--ui-kbd-radius", "default": "var(--ui-radius-sm)", "description": "Border radius" }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'kbd.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('kbd visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'kbd');
|
|
11
|
+
await saveForLostPixel(page, 'kbd');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('kbd.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
@layer components.tokens {
|
|
4
|
+
.mark {
|
|
5
|
+
--_bg: var(--ui-mark-bg, var(--ui-color-warning, #{t.$color-warning}));
|
|
6
|
+
--_color: var(--ui-mark-color, var(--ui-color-text, #{t.$color-text}));
|
|
7
|
+
--_padding-x: var(--ui-mark-padding-x, var(--ui-space-quarter, #{t.$space-quarter}));
|
|
8
|
+
--_padding-y: var(--ui-mark-padding-y, 0);
|
|
9
|
+
--_radius: var(--ui-mark-radius, var(--ui-radius-sm, #{t.$radius-sm}));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@layer components.styles {
|
|
14
|
+
.mark {
|
|
15
|
+
padding: var(--_padding-y) var(--_padding-x);
|
|
16
|
+
|
|
17
|
+
color: var(--_color);
|
|
18
|
+
|
|
19
|
+
background: var(--_bg);
|
|
20
|
+
border-radius: var(--_radius);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mark",
|
|
3
|
+
"element": "mark",
|
|
4
|
+
"modifiers": {},
|
|
5
|
+
"cssVars": [
|
|
6
|
+
{ "name": "--ui-mark-bg", "default": "var(--ui-color-warning)" },
|
|
7
|
+
{ "name": "--ui-mark-color", "default": "var(--ui-color-text)" },
|
|
8
|
+
{ "name": "--ui-mark-padding-x", "default": "var(--ui-space-quarter)" },
|
|
9
|
+
{ "name": "--ui-mark-padding-y", "default": "0" },
|
|
10
|
+
{ "name": "--ui-mark-radius", "default": "var(--ui-radius-sm)" }
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "mark",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Mark",
|
|
5
|
+
"description": "Highlighted text for search results, emphasis, or annotations.",
|
|
6
|
+
"api": "./mark.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "p",
|
|
15
|
+
"children": [
|
|
16
|
+
{ "tag": "span", "text": "The " },
|
|
17
|
+
{ "tag": "mark", "class": "ui-mark", "text": "highlighted" },
|
|
18
|
+
{ "tag": "span", "text": " text stands out from surrounding content." }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"title": "Search results",
|
|
27
|
+
"examples": [
|
|
28
|
+
{
|
|
29
|
+
"items": [
|
|
30
|
+
{
|
|
31
|
+
"tag": "p",
|
|
32
|
+
"children": [
|
|
33
|
+
{ "tag": "span", "text": "Results for " },
|
|
34
|
+
{ "tag": "mark", "class": "ui-mark", "text": "design tokens" },
|
|
35
|
+
{ "tag": "span", "text": ": CSS custom properties that store " },
|
|
36
|
+
{ "tag": "mark", "class": "ui-mark", "text": "design" },
|
|
37
|
+
{ "tag": "span", "text": " decisions as reusable " },
|
|
38
|
+
{ "tag": "mark", "class": "ui-mark", "text": "tokens" },
|
|
39
|
+
{ "tag": "span", "text": "." }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"customization": [
|
|
48
|
+
{
|
|
49
|
+
"token": "--ui-mark-bg",
|
|
50
|
+
"default": "var(--ui-color-warning)",
|
|
51
|
+
"description": "Highlight color"
|
|
52
|
+
},
|
|
53
|
+
{ "token": "--ui-mark-color", "default": "var(--ui-color-text)", "description": "Text color" },
|
|
54
|
+
{
|
|
55
|
+
"token": "--ui-mark-radius",
|
|
56
|
+
"default": "var(--ui-radius-sm)",
|
|
57
|
+
"description": "Border radius"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import { saveForLostPixel, setupVisualTestFromDocs, validateGridRhythm } from '../../../testing';
|
|
4
|
+
|
|
5
|
+
const DOCS_PATH = resolve(__dirname, 'mark.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('mark visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'mark');
|
|
11
|
+
await saveForLostPixel(page, 'mark');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('mark.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|