@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.
Files changed (73) hide show
  1. package/dist/compiled.css +212 -107
  2. package/dist/index.css +276 -171
  3. package/package.json +1 -1
  4. package/src/00-config/tokens/_variables.scss +39 -25
  5. package/src/00-config/tokens/colors/index.scss +22 -21
  6. package/src/02-base/typography/typography.scss +16 -0
  7. package/src/03-layout/cluster/cluster-visual.png +0 -0
  8. package/src/03-layout/cluster/cluster.visual.spec.ts +15 -0
  9. package/src/03-layout/sidebar/sidebar-visual.png +0 -0
  10. package/src/03-layout/sidebar/sidebar.docs.json +62 -0
  11. package/src/03-layout/sidebar/sidebar.visual.spec.ts +14 -0
  12. package/src/03-layout/sidebar-nav/sidebar-nav.api.json +29 -80
  13. package/src/04-components/accordion/accordion.api.json +5 -1
  14. package/src/04-components/alert/alert.api.json +6 -0
  15. package/src/04-components/alert/index.scss +10 -15
  16. package/src/04-components/avatar/avatar.api.json +5 -0
  17. package/src/04-components/badge/index.scss +12 -9
  18. package/src/04-components/breadcrumb/breadcrumb.api.json +5 -0
  19. package/src/04-components/button/button-visual.png +0 -0
  20. package/src/04-components/button/button.api.json +30 -56
  21. package/src/04-components/button/button.docs.json +75 -0
  22. package/src/04-components/button/index.scss +27 -17
  23. package/src/04-components/button-group/button-group-visual.png +0 -0
  24. package/src/04-components/button-group/button-group.api.json +5 -1
  25. package/src/04-components/button-group/button-group.visual.spec.ts +2 -1
  26. package/src/04-components/checkbox/checkbox-visual.png +0 -0
  27. package/src/04-components/checkbox/checkbox.api.json +1 -1
  28. package/src/04-components/code/code.api.json +6 -1
  29. package/src/04-components/data-list/data-list-visual.png +0 -0
  30. package/src/04-components/data-list/data-list.api.json +16 -1
  31. package/src/04-components/data-list/data-list.visual.spec.ts +2 -1
  32. package/src/04-components/data-list/index.scss +3 -2
  33. package/src/04-components/dialog/dialog.api.json +12 -1
  34. package/src/04-components/disclosure/disclosure.api.json +13 -1
  35. package/src/04-components/divider/divider.api.json +3 -0
  36. package/src/04-components/drawer/drawer.api.json +17 -1
  37. package/src/04-components/field/field.api.json +9 -1
  38. package/src/04-components/form-error/form-error-visual.png +0 -0
  39. package/src/04-components/form-error/form-error.api.json +3 -0
  40. package/src/04-components/icon/icon-visual.png +0 -0
  41. package/src/04-components/icon/icon.api.json +7 -6
  42. package/src/04-components/icon/icon.docs.json +86 -22
  43. package/src/04-components/icon/index.scss +6 -19
  44. package/src/04-components/index.scss +1 -0
  45. package/src/04-components/input/input-visual.png +0 -0
  46. package/src/04-components/input/input.api.json +31 -0
  47. package/src/04-components/label/label.api.json +4 -0
  48. package/src/04-components/link/link-visual.png +0 -0
  49. package/src/04-components/link/link.api.json +6 -0
  50. package/src/04-components/menu/menu.api.json +24 -0
  51. package/src/04-components/modal/modal.api.json +12 -1
  52. package/src/04-components/nav/index.scss +142 -0
  53. package/src/04-components/nav/nav-visual.png +0 -0
  54. package/src/04-components/nav/nav.api.json +55 -0
  55. package/src/04-components/nav/nav.docs.json +242 -0
  56. package/src/04-components/nav/nav.visual.spec.ts +14 -0
  57. package/src/04-components/overlay/overlay.api.json +14 -1
  58. package/src/04-components/pagination/pagination.api.json +22 -1
  59. package/src/04-components/popover/popover.api.json +9 -1
  60. package/src/04-components/progress/progress.api.json +20 -1
  61. package/src/04-components/radio/radio-visual.png +0 -0
  62. package/src/04-components/radio/radio.api.json +1 -1
  63. package/src/04-components/select/select.api.json +3 -0
  64. package/src/04-components/skeleton/skeleton.api.json +8 -1
  65. package/src/04-components/status/status.api.json +14 -1
  66. package/src/04-components/table/table.api.json +8 -1
  67. package/src/04-components/tabs/tabs.api.json +17 -0
  68. package/src/04-components/tag/tag.api.json +4 -0
  69. package/src/04-components/textarea/textarea.api.json +3 -0
  70. package/src/04-components/toast/toast.api.json +22 -1
  71. package/src/04-components/toggle/toggle.api.json +5 -0
  72. package/src/04-components/tooltip/tooltip.api.json +11 -1
  73. 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,15 @@
1
1
  {
2
2
  "name": "popover",
3
3
  "element": "div",
4
- "modifiers": {},
4
+ "modifiers": {
5
+ "position": {
6
+ "values": ["top"]
7
+ }
8
+ },
9
+ "elements": {
10
+ "header": {},
11
+ "title": {}
12
+ },
5
13
  "cssVars": [
6
14
  {
7
15
  "name": "--ui-popover-bg",
@@ -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",
@@ -3,7 +3,7 @@
3
3
  "element": "input",
4
4
  "modifiers": {
5
5
  "size": {
6
- "values": ["lg"]
6
+ "values": ["sm", "lg"]
7
7
  },
8
8
  "error": {
9
9
  "type": "boolean"
@@ -10,6 +10,9 @@
10
10
  },
11
11
  "state": {
12
12
  "values": ["error", "success"]
13
+ },
14
+ "block": {
15
+ "type": "boolean"
13
16
  }
14
17
  },
15
18
  "cssVars": [
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "skeleton",
3
3
  "element": "div",
4
- "modifiers": {},
4
+ "modifiers": {
5
+ "variant": {
6
+ "values": ["text", "circle", "heading", "rect"]
7
+ },
8
+ "pulse": {
9
+ "type": "boolean"
10
+ }
11
+ },
5
12
  "cssVars": [
6
13
  {
7
14
  "name": "--ui-skeleton-bg",
@@ -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",
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "table",
3
3
  "element": "div",
4
- "modifiers": {},
4
+ "modifiers": {
5
+ "compact": {
6
+ "type": "boolean"
7
+ },
8
+ "striped": {
9
+ "type": "boolean"
10
+ }
11
+ },
5
12
  "cssVars": [
6
13
  {
7
14
  "name": "--ui-table-font-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",
@@ -9,6 +9,10 @@
9
9
  "values": ["primary", "success", "warning", "danger"]
10
10
  }
11
11
  },
12
+ "elements": {
13
+ "remove": {}
14
+ },
15
+ "relatedComponents": ["tag-group"],
12
16
  "cssVars": [
13
17
  {
14
18
  "name": "--ui-tag-height",
@@ -10,6 +10,9 @@
10
10
  },
11
11
  "state": {
12
12
  "values": ["error", "success"]
13
+ },
14
+ "resize": {
15
+ "values": ["resize-none", "resize-both"]
13
16
  }
14
17
  },
15
18
  "cssVars": [
@@ -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",
@@ -6,6 +6,11 @@
6
6
  "values": ["sm", "lg"]
7
7
  }
8
8
  },
9
+ "elements": {
10
+ "input": {},
11
+ "track": {},
12
+ "thumb": {}
13
+ },
9
14
  "cssVars": [
10
15
  {
11
16
  "name": "--ui-toggle-track-width",
@@ -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: string;
13
- text: string;
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 attrs = item.attrs
45
- ? Object.entries(item.attrs)
46
- .map(([k, v]) => (v === '' ? k : `${k}="${v}"`))
47
- .join(' ')
48
- : '';
49
- const attrStr = attrs ? ` ${attrs}` : '';
50
- return `<${item.tag} class="${item.class}"${attrStr}>${item.text}</${item.tag}>`;
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 {