@teseor/css 1.0.0 → 1.2.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 +212 -107
- package/dist/index.css +276 -171
- package/package.json +1 -1
- package/src/00-config/tokens/_variables.scss +39 -25
- package/src/00-config/tokens/colors/index.scss +22 -21
- package/src/02-base/typography/typography.scss +16 -0
- package/src/03-layout/cluster/cluster-visual.png +0 -0
- package/src/03-layout/cluster/cluster.visual.spec.ts +15 -0
- package/src/03-layout/sidebar/sidebar-visual.png +0 -0
- package/src/03-layout/sidebar/sidebar.docs.json +62 -0
- package/src/03-layout/sidebar/sidebar.visual.spec.ts +14 -0
- package/src/03-layout/sidebar-nav/sidebar-nav.api.json +29 -80
- package/src/04-components/accordion/accordion.api.json +5 -1
- package/src/04-components/alert/alert.api.json +6 -0
- package/src/04-components/alert/index.scss +10 -15
- package/src/04-components/avatar/avatar.api.json +5 -0
- package/src/04-components/badge/index.scss +12 -9
- package/src/04-components/breadcrumb/breadcrumb.api.json +5 -0
- package/src/04-components/button/button-visual.png +0 -0
- package/src/04-components/button/button.api.json +30 -56
- package/src/04-components/button/button.docs.json +75 -0
- package/src/04-components/button/index.scss +27 -17
- package/src/04-components/button-group/button-group-visual.png +0 -0
- package/src/04-components/button-group/button-group.api.json +5 -1
- package/src/04-components/button-group/button-group.visual.spec.ts +2 -1
- package/src/04-components/checkbox/checkbox-visual.png +0 -0
- package/src/04-components/checkbox/checkbox.api.json +1 -1
- package/src/04-components/code/code.api.json +6 -1
- package/src/04-components/data-list/data-list-visual.png +0 -0
- package/src/04-components/data-list/data-list.api.json +16 -1
- package/src/04-components/data-list/data-list.visual.spec.ts +2 -1
- package/src/04-components/data-list/index.scss +3 -2
- package/src/04-components/dialog/dialog.api.json +12 -1
- package/src/04-components/disclosure/disclosure.api.json +13 -1
- package/src/04-components/divider/divider.api.json +3 -0
- package/src/04-components/drawer/drawer.api.json +17 -1
- package/src/04-components/field/field.api.json +9 -1
- package/src/04-components/form-error/form-error-visual.png +0 -0
- package/src/04-components/form-error/form-error.api.json +3 -0
- package/src/04-components/icon/icon-visual.png +0 -0
- package/src/04-components/icon/icon.api.json +7 -6
- package/src/04-components/icon/icon.docs.json +86 -22
- package/src/04-components/icon/index.scss +6 -19
- package/src/04-components/index.scss +1 -0
- package/src/04-components/input/input-visual.png +0 -0
- package/src/04-components/input/input.api.json +31 -0
- package/src/04-components/label/label.api.json +4 -0
- package/src/04-components/link/link-visual.png +0 -0
- package/src/04-components/link/link.api.json +6 -0
- package/src/04-components/menu/menu.api.json +24 -0
- package/src/04-components/modal/modal.api.json +12 -1
- package/src/04-components/nav/index.scss +142 -0
- package/src/04-components/nav/nav-visual.png +0 -0
- package/src/04-components/nav/nav.api.json +55 -0
- package/src/04-components/nav/nav.docs.json +242 -0
- package/src/04-components/nav/nav.visual.spec.ts +14 -0
- package/src/04-components/overlay/overlay.api.json +14 -1
- package/src/04-components/pagination/pagination.api.json +22 -1
- package/src/04-components/popover/popover.api.json +9 -1
- package/src/04-components/progress/progress.api.json +20 -1
- package/src/04-components/radio/radio-visual.png +0 -0
- package/src/04-components/radio/radio.api.json +1 -1
- package/src/04-components/select/select.api.json +3 -0
- package/src/04-components/skeleton/skeleton.api.json +8 -1
- package/src/04-components/status/status.api.json +14 -1
- package/src/04-components/table/table.api.json +8 -1
- package/src/04-components/tabs/tabs.api.json +17 -0
- package/src/04-components/tag/tag.api.json +4 -0
- package/src/04-components/textarea/textarea.api.json +3 -0
- package/src/04-components/toast/toast.api.json +22 -1
- package/src/04-components/toggle/toggle.api.json +5 -0
- package/src/04-components/tooltip/tooltip.api.json +11 -1
- package/src/testing/page-setup.ts +25 -9
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "nav",
|
|
3
|
+
"type": "component",
|
|
4
|
+
"title": "Nav",
|
|
5
|
+
"description": "Horizontal or vertical navigation links for primary and secondary navigation.",
|
|
6
|
+
"api": "./nav.api.json",
|
|
7
|
+
"sections": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Basic",
|
|
10
|
+
"description": "Underline-style navigation with active state indicator.",
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"items": [
|
|
14
|
+
{
|
|
15
|
+
"tag": "nav",
|
|
16
|
+
"class": "ui-nav",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"tag": "ul",
|
|
20
|
+
"class": "ui-nav__list",
|
|
21
|
+
"children": [
|
|
22
|
+
{
|
|
23
|
+
"tag": "li",
|
|
24
|
+
"children": [
|
|
25
|
+
{
|
|
26
|
+
"tag": "a",
|
|
27
|
+
"class": "ui-nav__item ui-nav__item--active",
|
|
28
|
+
"text": "Dashboard",
|
|
29
|
+
"attrs": { "href": "#" }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"tag": "li",
|
|
35
|
+
"children": [
|
|
36
|
+
{
|
|
37
|
+
"tag": "a",
|
|
38
|
+
"class": "ui-nav__item",
|
|
39
|
+
"text": "Projects",
|
|
40
|
+
"attrs": { "href": "#" }
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"tag": "li",
|
|
46
|
+
"children": [
|
|
47
|
+
{
|
|
48
|
+
"tag": "a",
|
|
49
|
+
"class": "ui-nav__item",
|
|
50
|
+
"text": "Settings",
|
|
51
|
+
"attrs": { "href": "#" }
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"tag": "li",
|
|
57
|
+
"children": [
|
|
58
|
+
{
|
|
59
|
+
"tag": "a",
|
|
60
|
+
"class": "ui-nav__item ui-nav__item--disabled",
|
|
61
|
+
"text": "Disabled",
|
|
62
|
+
"attrs": { "href": "#" }
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "Pills",
|
|
76
|
+
"description": "Background-filled variant for standalone navigation.",
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"items": [
|
|
80
|
+
{
|
|
81
|
+
"tag": "nav",
|
|
82
|
+
"class": "ui-nav ui-nav--pills",
|
|
83
|
+
"children": [
|
|
84
|
+
{
|
|
85
|
+
"tag": "ul",
|
|
86
|
+
"class": "ui-nav__list",
|
|
87
|
+
"children": [
|
|
88
|
+
{
|
|
89
|
+
"tag": "li",
|
|
90
|
+
"children": [
|
|
91
|
+
{
|
|
92
|
+
"tag": "a",
|
|
93
|
+
"class": "ui-nav__item ui-nav__item--active",
|
|
94
|
+
"text": "Overview",
|
|
95
|
+
"attrs": { "href": "#" }
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"tag": "li",
|
|
101
|
+
"children": [
|
|
102
|
+
{
|
|
103
|
+
"tag": "a",
|
|
104
|
+
"class": "ui-nav__item",
|
|
105
|
+
"text": "Analytics",
|
|
106
|
+
"attrs": { "href": "#" }
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"tag": "li",
|
|
112
|
+
"children": [
|
|
113
|
+
{
|
|
114
|
+
"tag": "a",
|
|
115
|
+
"class": "ui-nav__item",
|
|
116
|
+
"text": "Reports",
|
|
117
|
+
"attrs": { "href": "#" }
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"title": "Vertical",
|
|
131
|
+
"description": "Vertical navigation with start-side indicator.",
|
|
132
|
+
"examples": [
|
|
133
|
+
{
|
|
134
|
+
"items": [
|
|
135
|
+
{
|
|
136
|
+
"tag": "nav",
|
|
137
|
+
"class": "ui-nav ui-nav--vertical",
|
|
138
|
+
"style": { "inline-size": "200px" },
|
|
139
|
+
"children": [
|
|
140
|
+
{
|
|
141
|
+
"tag": "ul",
|
|
142
|
+
"class": "ui-nav__list",
|
|
143
|
+
"children": [
|
|
144
|
+
{
|
|
145
|
+
"tag": "li",
|
|
146
|
+
"children": [
|
|
147
|
+
{
|
|
148
|
+
"tag": "a",
|
|
149
|
+
"class": "ui-nav__item ui-nav__item--active",
|
|
150
|
+
"text": "Profile",
|
|
151
|
+
"attrs": { "href": "#" }
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"tag": "li",
|
|
157
|
+
"children": [
|
|
158
|
+
{
|
|
159
|
+
"tag": "a",
|
|
160
|
+
"class": "ui-nav__item",
|
|
161
|
+
"text": "Account",
|
|
162
|
+
"attrs": { "href": "#" }
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"tag": "li",
|
|
168
|
+
"children": [
|
|
169
|
+
{
|
|
170
|
+
"tag": "a",
|
|
171
|
+
"class": "ui-nav__item",
|
|
172
|
+
"text": "Security",
|
|
173
|
+
"attrs": { "href": "#" }
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"title": "Vertical Pills",
|
|
187
|
+
"description": "Vertical navigation with pill-style active indicator.",
|
|
188
|
+
"examples": [
|
|
189
|
+
{
|
|
190
|
+
"items": [
|
|
191
|
+
{
|
|
192
|
+
"tag": "nav",
|
|
193
|
+
"class": "ui-nav ui-nav--vertical ui-nav--pills",
|
|
194
|
+
"style": { "inline-size": "200px" },
|
|
195
|
+
"children": [
|
|
196
|
+
{
|
|
197
|
+
"tag": "ul",
|
|
198
|
+
"class": "ui-nav__list",
|
|
199
|
+
"children": [
|
|
200
|
+
{
|
|
201
|
+
"tag": "li",
|
|
202
|
+
"children": [
|
|
203
|
+
{
|
|
204
|
+
"tag": "a",
|
|
205
|
+
"class": "ui-nav__item ui-nav__item--active",
|
|
206
|
+
"text": "General",
|
|
207
|
+
"attrs": { "href": "#" }
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"tag": "li",
|
|
213
|
+
"children": [
|
|
214
|
+
{
|
|
215
|
+
"tag": "a",
|
|
216
|
+
"class": "ui-nav__item",
|
|
217
|
+
"text": "Notifications",
|
|
218
|
+
"attrs": { "href": "#" }
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"tag": "li",
|
|
224
|
+
"children": [
|
|
225
|
+
{
|
|
226
|
+
"tag": "a",
|
|
227
|
+
"class": "ui-nav__item",
|
|
228
|
+
"text": "Billing",
|
|
229
|
+
"attrs": { "href": "#" }
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
@@ -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, 'nav.docs.json');
|
|
6
|
+
|
|
7
|
+
test.describe('nav visual regression', () => {
|
|
8
|
+
test('all variations', async ({ page }) => {
|
|
9
|
+
await setupVisualTestFromDocs(page, DOCS_PATH);
|
|
10
|
+
await validateGridRhythm(page, 'nav');
|
|
11
|
+
await saveForLostPixel(page, 'nav');
|
|
12
|
+
await expect(page.locator('body')).toHaveScreenshot('nav.visual.png');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "overlay",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"light": {
|
|
6
|
+
"type": "boolean"
|
|
7
|
+
},
|
|
8
|
+
"blur": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
},
|
|
11
|
+
"animate": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
},
|
|
14
|
+
"visible": {
|
|
15
|
+
"type": "boolean"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
5
18
|
"cssVars": [
|
|
6
19
|
{
|
|
7
20
|
"name": "--ui-overlay-bg",
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagination",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"elements": {
|
|
10
|
+
"prev": {},
|
|
11
|
+
"next": {},
|
|
12
|
+
"list": {},
|
|
13
|
+
"item": {},
|
|
14
|
+
"ellipsis": {},
|
|
15
|
+
"link": {
|
|
16
|
+
"modifiers": {
|
|
17
|
+
"active": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"disabled": {
|
|
21
|
+
"type": "boolean"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
5
26
|
"cssVars": [
|
|
6
27
|
{
|
|
7
28
|
"name": "--ui-pagination-gap",
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "progress",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"size": {
|
|
6
|
+
"values": ["sm", "lg"]
|
|
7
|
+
},
|
|
8
|
+
"variant": {
|
|
9
|
+
"values": ["success", "warning", "danger"]
|
|
10
|
+
},
|
|
11
|
+
"striped": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
},
|
|
14
|
+
"animated": {
|
|
15
|
+
"type": "boolean"
|
|
16
|
+
},
|
|
17
|
+
"indeterminate": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"elements": {
|
|
22
|
+
"bar": {}
|
|
23
|
+
},
|
|
5
24
|
"cssVars": [
|
|
6
25
|
{
|
|
7
26
|
"name": "--ui-progress-height",
|
|
Binary file
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "status",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"variant": {
|
|
6
|
+
"values": ["success", "warning", "danger", "info"]
|
|
7
|
+
},
|
|
8
|
+
"size": {
|
|
9
|
+
"values": ["sm", "lg"]
|
|
10
|
+
},
|
|
11
|
+
"pulse": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"elements": {
|
|
16
|
+
"dot": {}
|
|
17
|
+
},
|
|
5
18
|
"cssVars": [
|
|
6
19
|
{
|
|
7
20
|
"name": "--ui-status-size",
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
"name": "tabs",
|
|
3
3
|
"element": "div",
|
|
4
4
|
"modifiers": {},
|
|
5
|
+
"elements": {
|
|
6
|
+
"list": {},
|
|
7
|
+
"tab": {
|
|
8
|
+
"modifiers": {
|
|
9
|
+
"active": {
|
|
10
|
+
"type": "boolean"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"panel": {
|
|
15
|
+
"modifiers": {
|
|
16
|
+
"active": {
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
5
22
|
"cssVars": [
|
|
6
23
|
{
|
|
7
24
|
"name": "--ui-tabs-border-color",
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toast",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"variant": {
|
|
6
|
+
"values": ["success", "warning", "danger", "info"]
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"elements": {
|
|
10
|
+
"content": {},
|
|
11
|
+
"title": {},
|
|
12
|
+
"description": {},
|
|
13
|
+
"close": {},
|
|
14
|
+
"action": {}
|
|
15
|
+
},
|
|
16
|
+
"relatedComponents": [
|
|
17
|
+
{
|
|
18
|
+
"name": "toast-viewport",
|
|
19
|
+
"modifiers": {
|
|
20
|
+
"position": {
|
|
21
|
+
"values": ["top-end", "bottom-end"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
5
26
|
"cssVars": [
|
|
6
27
|
{
|
|
7
28
|
"name": "--ui-toast-viewport-gap",
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tooltip",
|
|
3
3
|
"element": "div",
|
|
4
|
-
"modifiers": {
|
|
4
|
+
"modifiers": {
|
|
5
|
+
"position": {
|
|
6
|
+
"values": ["top", "bottom", "start", "end"]
|
|
7
|
+
},
|
|
8
|
+
"animate": {
|
|
9
|
+
"type": "boolean"
|
|
10
|
+
},
|
|
11
|
+
"visible": {
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
5
15
|
"cssVars": [
|
|
6
16
|
{
|
|
7
17
|
"name": "--ui-tooltip-bg",
|
|
@@ -9,9 +9,11 @@ import { scaffoldCss } from './scaffold';
|
|
|
9
9
|
|
|
10
10
|
interface DocsItem {
|
|
11
11
|
tag: string;
|
|
12
|
-
class
|
|
13
|
-
text
|
|
12
|
+
class?: string;
|
|
13
|
+
text?: string;
|
|
14
14
|
attrs?: Record<string, string>;
|
|
15
|
+
style?: Record<string, string>;
|
|
16
|
+
children?: DocsItem[];
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
interface DocsExample {
|
|
@@ -41,13 +43,27 @@ export function loadComponentApi(apiPath: string): ComponentAPI {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
function renderItem(item: DocsItem): string {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const parts: string[] = [];
|
|
47
|
+
|
|
48
|
+
if (item.class) parts.push(`class="${item.class}"`);
|
|
49
|
+
|
|
50
|
+
if (item.style) {
|
|
51
|
+
const css = Object.entries(item.style)
|
|
52
|
+
.map(([k, v]) => `${k}: ${v}`)
|
|
53
|
+
.join('; ');
|
|
54
|
+
parts.push(`style="${css}"`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (item.attrs) {
|
|
58
|
+
for (const [k, v] of Object.entries(item.attrs)) {
|
|
59
|
+
parts.push(v === '' ? k : `${k}="${v}"`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const attrStr = parts.length ? ` ${parts.join(' ')}` : '';
|
|
64
|
+
const content = item.children ? item.children.map(renderItem).join('\n') : (item.text ?? '');
|
|
65
|
+
|
|
66
|
+
return `<${item.tag}${attrStr}>${content}</${item.tag}>`;
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
export function loadDocsJson(docsPath: string): DocsJson {
|