@teseor/css 1.2.3 → 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 +138 -1
- package/package.json +2 -4
- package/src/00-config/tokens/_variables.scss +3 -3
- package/src/00-config/tokens/typography/index.scss +3 -3
- 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/cluster/cluster-visual.png +0 -0
- package/src/03-layout/index.scss +1 -0
- package/src/03-layout/sidebar/sidebar-visual.png +0 -0
- package/src/04-components/actions/button/button-visual.png +0 -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/avatar/avatar-visual.png +0 -0
- package/src/04-components/data-display/badge/badge-visual.png +0 -0
- package/src/04-components/data-display/card/card-visual.png +0 -0
- package/src/04-components/data-display/data-list/data-list-visual.png +0 -0
- package/src/04-components/data-display/icon/icon-visual.png +0 -0
- 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/data-display/status/status-visual.png +0 -0
- package/src/04-components/data-display/table/table-visual.png +0 -0
- package/src/04-components/data-display/tag/tag-visual.png +0 -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/alert/alert-visual.png +0 -0
- package/src/04-components/feedback/progress/progress-visual.png +0 -0
- package/src/04-components/feedback/skeleton/skeleton-visual.png +0 -0
- package/src/04-components/feedback/spinner/spinner-visual.png +0 -0
- package/src/04-components/feedback/toast/toast-visual.png +0 -0
- package/src/04-components/forms/checkbox/checkbox-visual.png +0 -0
- package/src/04-components/forms/field/field-visual.png +0 -0
- package/src/04-components/forms/form-error/form-error-visual.png +0 -0
- package/src/04-components/forms/form-helper/form-helper-visual.png +0 -0
- package/src/04-components/forms/input/input-visual.png +0 -0
- package/src/04-components/forms/label/label-visual.png +0 -0
- package/src/04-components/forms/radio/radio-visual.png +0 -0
- package/src/04-components/forms/select/select-visual.png +0 -0
- package/src/04-components/forms/textarea/textarea-visual.png +0 -0
- package/src/04-components/forms/toggle/toggle-visual.png +0 -0
- package/src/04-components/index.scss +5 -0
- package/src/04-components/layout/divider/divider-visual.png +0 -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/navigation/breadcrumb/breadcrumb-visual.png +0 -0
- package/src/04-components/navigation/menu/menu-visual.png +0 -0
- package/src/04-components/navigation/nav/nav-visual.png +0 -0
- package/src/04-components/navigation/pagination/pagination-visual.png +0 -0
- package/src/04-components/navigation/tabs/tabs-visual.png +0 -0
- package/src/04-components/overlays/dialog/dialog-visual.png +0 -0
- package/src/04-components/overlays/drawer/drawer-visual.png +0 -0
- package/src/04-components/overlays/modal/modal-visual.png +0 -0
- package/src/04-components/overlays/overlay/overlay-visual.png +0 -0
- package/src/04-components/overlays/popover/popover-visual.png +0 -0
- package/src/04-components/overlays/tooltip/tooltip-visual.png +0 -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/code/code-visual.png +0 -0
- package/src/04-components/typography/heading/heading-visual.png +0 -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/link/link-visual.png +0 -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
- package/src/index.scss +0 -3
- package/fonts/.gitkeep +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teseor/css",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "CSS library - reset, primitives, components, utilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "letanure",
|
|
@@ -22,13 +22,11 @@
|
|
|
22
22
|
"main": "dist/index.css",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": "./dist/index.css",
|
|
25
|
-
"./fonts/*": "./src/fonts/*",
|
|
26
25
|
"./dist/*": "./dist/*"
|
|
27
26
|
},
|
|
28
27
|
"files": [
|
|
29
28
|
"dist",
|
|
30
|
-
"src"
|
|
31
|
-
"fonts"
|
|
29
|
+
"src"
|
|
32
30
|
],
|
|
33
31
|
"scripts": {
|
|
34
32
|
"build": "pnpm --filter @teseor/source sync:components && sass src/index.scss dist/index.css --style=compressed",
|
|
@@ -39,9 +39,9 @@ $sizes: (
|
|
|
39
39
|
@return map.get($sizes, $name);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Typography - Font families
|
|
43
|
-
$font-sans:
|
|
44
|
-
$font-mono: "
|
|
42
|
+
// Typography - Font families (system stack, consumers override via CSS tokens)
|
|
43
|
+
$font-sans: system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
|
|
44
|
+
$font-mono: ui-monospace, sfmono-regular, "SF Mono", menlo, consolas, "Liberation Mono", monospace;
|
|
45
45
|
|
|
46
46
|
// Typography - Font sizes (1.2 modular scale)
|
|
47
47
|
$font-size-xs: 0.75rem; // 12px
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
// Font families
|
|
3
|
-
--ui-font-sans:
|
|
4
|
-
--ui-font-mono: "
|
|
2
|
+
// Font families — system font stack, override with custom fonts via these tokens
|
|
3
|
+
--ui-font-sans: system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
|
|
4
|
+
--ui-font-mono: ui-monospace, sfmono-regular, "SF Mono", menlo, consolas, "Liberation Mono", monospace;
|
|
5
5
|
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
// PRIMITIVE TOKENS - Font Size Scale
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aspect-ratio",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"ratio": {
|
|
6
|
+
"values": ["square", "video", "photo", "wide", "portrait"]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"cssVars": [
|
|
10
|
+
{
|
|
11
|
+
"name": "--ui-aspect-ratio",
|
|
12
|
+
"description": "Custom aspect ratio",
|
|
13
|
+
"default": "1 / 1"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "aspect-ratio",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Aspect Ratio",
|
|
5
|
+
"description": "Constrains a container to a specific aspect ratio. Media children fill the container automatically.",
|
|
6
|
+
"api": "aspect-ratio.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Presets",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-cluster ui-cluster--md",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"tag": "div",
|
|
19
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--square",
|
|
20
|
+
"style": {
|
|
21
|
+
"inline-size": "160px",
|
|
22
|
+
"background": "var(--ui-color-bg-muted)"
|
|
23
|
+
},
|
|
24
|
+
"children": [
|
|
25
|
+
{
|
|
26
|
+
"tag": "span",
|
|
27
|
+
"text": "square",
|
|
28
|
+
"style": {
|
|
29
|
+
"padding": "var(--ui-space-2)"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"tag": "div",
|
|
36
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--video",
|
|
37
|
+
"style": {
|
|
38
|
+
"inline-size": "160px",
|
|
39
|
+
"background": "var(--ui-color-bg-muted)"
|
|
40
|
+
},
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"tag": "span",
|
|
44
|
+
"text": "video",
|
|
45
|
+
"style": {
|
|
46
|
+
"padding": "var(--ui-space-2)"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"tag": "div",
|
|
53
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--photo",
|
|
54
|
+
"style": {
|
|
55
|
+
"inline-size": "160px",
|
|
56
|
+
"background": "var(--ui-color-bg-muted)"
|
|
57
|
+
},
|
|
58
|
+
"children": [
|
|
59
|
+
{
|
|
60
|
+
"tag": "span",
|
|
61
|
+
"text": "photo",
|
|
62
|
+
"style": {
|
|
63
|
+
"padding": "var(--ui-space-2)"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"tag": "div",
|
|
70
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--wide",
|
|
71
|
+
"style": {
|
|
72
|
+
"inline-size": "160px",
|
|
73
|
+
"background": "var(--ui-color-bg-muted)"
|
|
74
|
+
},
|
|
75
|
+
"children": [
|
|
76
|
+
{
|
|
77
|
+
"tag": "span",
|
|
78
|
+
"text": "wide",
|
|
79
|
+
"style": {
|
|
80
|
+
"padding": "var(--ui-space-2)"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"tag": "div",
|
|
87
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--portrait",
|
|
88
|
+
"style": {
|
|
89
|
+
"inline-size": "160px",
|
|
90
|
+
"background": "var(--ui-color-bg-muted)"
|
|
91
|
+
},
|
|
92
|
+
"children": [
|
|
93
|
+
{
|
|
94
|
+
"tag": "span",
|
|
95
|
+
"text": "portrait",
|
|
96
|
+
"style": {
|
|
97
|
+
"padding": "var(--ui-space-2)"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"title": "With Media",
|
|
110
|
+
"examples": [
|
|
111
|
+
{
|
|
112
|
+
"items": [
|
|
113
|
+
{
|
|
114
|
+
"tag": "div",
|
|
115
|
+
"class": "ui-cluster ui-cluster--md",
|
|
116
|
+
"children": [
|
|
117
|
+
{
|
|
118
|
+
"tag": "div",
|
|
119
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--video",
|
|
120
|
+
"style": {
|
|
121
|
+
"inline-size": "240px"
|
|
122
|
+
},
|
|
123
|
+
"children": [
|
|
124
|
+
{
|
|
125
|
+
"tag": "div",
|
|
126
|
+
"text": "img (video)",
|
|
127
|
+
"style": {
|
|
128
|
+
"inline-size": "100%",
|
|
129
|
+
"block-size": "100%",
|
|
130
|
+
"background": "var(--ui-color-primary)",
|
|
131
|
+
"color": "var(--ui-color-on-primary)",
|
|
132
|
+
"display": "grid",
|
|
133
|
+
"place-items": "center"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"tag": "div",
|
|
140
|
+
"class": "ui-aspect-ratio ui-aspect-ratio--square",
|
|
141
|
+
"style": {
|
|
142
|
+
"inline-size": "240px"
|
|
143
|
+
},
|
|
144
|
+
"children": [
|
|
145
|
+
{
|
|
146
|
+
"tag": "div",
|
|
147
|
+
"text": "img (square)",
|
|
148
|
+
"style": {
|
|
149
|
+
"inline-size": "100%",
|
|
150
|
+
"block-size": "100%",
|
|
151
|
+
"background": "var(--ui-color-primary)",
|
|
152
|
+
"color": "var(--ui-color-on-primary)",
|
|
153
|
+
"display": "grid",
|
|
154
|
+
"place-items": "center"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"title": "Custom Ratio",
|
|
167
|
+
"examples": [
|
|
168
|
+
{
|
|
169
|
+
"items": [
|
|
170
|
+
{
|
|
171
|
+
"tag": "div",
|
|
172
|
+
"class": "ui-aspect-ratio",
|
|
173
|
+
"style": {
|
|
174
|
+
"--ui-aspect-ratio": "2.35 / 1",
|
|
175
|
+
"inline-size": "320px",
|
|
176
|
+
"background": "var(--ui-color-bg-muted)"
|
|
177
|
+
},
|
|
178
|
+
"children": [
|
|
179
|
+
{
|
|
180
|
+
"tag": "span",
|
|
181
|
+
"text": "2.35:1 (cinemascope)",
|
|
182
|
+
"style": {
|
|
183
|
+
"padding": "var(--ui-space-2)"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
@@ -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, 'aspect-ratio.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('aspect-ratio visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
// skip validateGridRhythm: aspect-ratio controls proportions, not fixed heights
|
|
11
|
+
await saveForLostPixel(page, 'aspect-ratio');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('aspect-ratio.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer primitives {
|
|
2
|
+
.aspect-ratio {
|
|
3
|
+
aspect-ratio: var(--aspect-ratio, 1 / 1);
|
|
4
|
+
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Media children fill the container
|
|
9
|
+
.aspect-ratio > img,
|
|
10
|
+
.aspect-ratio > video,
|
|
11
|
+
.aspect-ratio > iframe {
|
|
12
|
+
block-size: 100%;
|
|
13
|
+
inline-size: 100%;
|
|
14
|
+
object-fit: cover;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Preset ratios — functional names, not math
|
|
18
|
+
.aspect-ratio--square { --aspect-ratio: 1 / 1; }
|
|
19
|
+
.aspect-ratio--video { --aspect-ratio: 16 / 9; }
|
|
20
|
+
.aspect-ratio--photo { --aspect-ratio: 4 / 3; }
|
|
21
|
+
.aspect-ratio--wide { --aspect-ratio: 21 / 9; }
|
|
22
|
+
.aspect-ratio--portrait { --aspect-ratio: 3 / 4; }
|
|
23
|
+
}
|
|
Binary file
|
package/src/03-layout/index.scss
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,8 +7,7 @@ const DOCS_PATH = resolve(__dirname, 'button-group.docs.json');
|
|
|
7
7
|
test.describe('button-group visual regression', () => {
|
|
8
8
|
test('all variations', async ({ page }) => {
|
|
9
9
|
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
-
|
|
11
|
-
// await validateGridRhythm(page, 'button-group');
|
|
10
|
+
await validateGridRhythm(page, 'button-group');
|
|
12
11
|
await saveForLostPixel(page, 'button-group');
|
|
13
12
|
await expect(page.locator('body')).toHaveScreenshot('button-group.visual.png');
|
|
14
13
|
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@use '../../../00-config/tokens/variables' as t;
|
|
2
|
+
|
|
3
|
+
@layer components.tokens {
|
|
4
|
+
.stat {
|
|
5
|
+
--_gap: var(--ui-stat-gap, var(--ui-space-1, #{t.$space-1}));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.stat__value {
|
|
9
|
+
--_font-size: var(--ui-stat-value-font-size, var(--ui-font-size-3xl, #{t.$font-size-3xl}));
|
|
10
|
+
--_font-weight: var(--ui-stat-value-font-weight, var(--ui-weight-bold, #{t.$weight-bold}));
|
|
11
|
+
--_line-height: var(--ui-stat-value-line-height, var(--ui-leading-3xl, #{t.$leading-3xl}));
|
|
12
|
+
--_color: var(--ui-stat-value-color, var(--ui-color-text, #{t.$color-text}));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.stat__label {
|
|
16
|
+
--_font-size: var(--ui-stat-label-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
|
|
17
|
+
--_color: var(--ui-stat-label-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
|
|
18
|
+
--_line-height: var(--ui-stat-label-line-height, var(--ui-leading-sm, #{t.$leading-sm}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.stat--sm .stat__value {
|
|
22
|
+
--_font-size: var(--ui-font-size-xl, #{t.$font-size-xl});
|
|
23
|
+
--_line-height: var(--ui-leading-xl, #{t.$leading-xl});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@layer components.styles {
|
|
28
|
+
.stat {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--_gap);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.stat__value {
|
|
35
|
+
font-size: var(--_font-size);
|
|
36
|
+
font-weight: var(--_font-weight);
|
|
37
|
+
line-height: var(--_line-height);
|
|
38
|
+
letter-spacing: var(--ui-tracking-display, #{t.$tracking-display});
|
|
39
|
+
color: var(--_color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.stat__label {
|
|
43
|
+
font-size: var(--_font-size);
|
|
44
|
+
line-height: var(--_line-height);
|
|
45
|
+
color: var(--_color);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stat",
|
|
3
|
+
"element": "div",
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm"]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"subElements": ["value", "label"],
|
|
10
|
+
"cssVars": [
|
|
11
|
+
{ "name": "--ui-stat-gap", "default": "var(--ui-space-1)" },
|
|
12
|
+
{ "name": "--ui-stat-value-font-size", "default": "var(--ui-font-size-3xl)" },
|
|
13
|
+
{ "name": "--ui-stat-value-font-weight", "default": "var(--ui-weight-bold)" },
|
|
14
|
+
{ "name": "--ui-stat-value-color", "default": "var(--ui-color-text)" },
|
|
15
|
+
{ "name": "--ui-stat-label-font-size", "default": "var(--ui-font-size-sm)" },
|
|
16
|
+
{ "name": "--ui-stat-label-color", "default": "var(--ui-color-text-muted)" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "stat",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Stat",
|
|
5
|
+
"description": "Statistic display with prominent value and descriptive label.",
|
|
6
|
+
"api": "./stat.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Default",
|
|
10
|
+
"examples": [
|
|
11
|
+
{
|
|
12
|
+
"items": [
|
|
13
|
+
{
|
|
14
|
+
"tag": "div",
|
|
15
|
+
"class": "ui-stat",
|
|
16
|
+
"children": [
|
|
17
|
+
{ "tag": "span", "class": "ui-stat__value", "text": "2,847" },
|
|
18
|
+
{ "tag": "span", "class": "ui-stat__label", "text": "Total users" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"title": "Multiple stats",
|
|
27
|
+
"examples": [
|
|
28
|
+
{
|
|
29
|
+
"items": [
|
|
30
|
+
{
|
|
31
|
+
"tag": "div",
|
|
32
|
+
"class": "ui-cluster ui-cluster--lg",
|
|
33
|
+
"children": [
|
|
34
|
+
{
|
|
35
|
+
"tag": "div",
|
|
36
|
+
"class": "ui-stat",
|
|
37
|
+
"children": [
|
|
38
|
+
{ "tag": "span", "class": "ui-stat__value", "text": "12.5k" },
|
|
39
|
+
{ "tag": "span", "class": "ui-stat__label", "text": "Revenue" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"tag": "div",
|
|
44
|
+
"class": "ui-stat",
|
|
45
|
+
"children": [
|
|
46
|
+
{ "tag": "span", "class": "ui-stat__value", "text": "573" },
|
|
47
|
+
{ "tag": "span", "class": "ui-stat__label", "text": "Orders" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"tag": "div",
|
|
52
|
+
"class": "ui-stat",
|
|
53
|
+
"children": [
|
|
54
|
+
{ "tag": "span", "class": "ui-stat__value", "text": "98%" },
|
|
55
|
+
{ "tag": "span", "class": "ui-stat__label", "text": "Satisfaction" }
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "Small",
|
|
66
|
+
"examples": [
|
|
67
|
+
{
|
|
68
|
+
"items": [
|
|
69
|
+
{
|
|
70
|
+
"tag": "div",
|
|
71
|
+
"class": "ui-stat ui-stat--sm",
|
|
72
|
+
"children": [
|
|
73
|
+
{ "tag": "span", "class": "ui-stat__value", "text": "42" },
|
|
74
|
+
{ "tag": "span", "class": "ui-stat__label", "text": "Active now" }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"customization": [
|
|
83
|
+
{
|
|
84
|
+
"token": "--ui-stat-gap",
|
|
85
|
+
"default": "var(--ui-space-1)",
|
|
86
|
+
"description": "Gap between value and label"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"token": "--ui-stat-value-font-size",
|
|
90
|
+
"default": "var(--ui-font-size-3xl)",
|
|
91
|
+
"description": "Value font size"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"token": "--ui-stat-value-font-weight",
|
|
95
|
+
"default": "var(--ui-weight-bold)",
|
|
96
|
+
"description": "Value font weight"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"token": "--ui-stat-value-color",
|
|
100
|
+
"default": "var(--ui-color-text)",
|
|
101
|
+
"description": "Value text color"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"token": "--ui-stat-label-font-size",
|
|
105
|
+
"default": "var(--ui-font-size-sm)",
|
|
106
|
+
"description": "Label font size"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"token": "--ui-stat-label-color",
|
|
110
|
+
"default": "var(--ui-color-text-muted)",
|
|
111
|
+
"description": "Label text color"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
@@ -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, 'stat.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('stat visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'stat');
|
|
11
|
+
await saveForLostPixel(page, 'stat');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('stat.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
|
Binary file
|