@teseor/css 1.4.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.
Files changed (39) hide show
  1. package/dist/compiled.css +1 -1
  2. package/dist/index.css +14 -0
  3. package/package.json +1 -1
  4. package/src/04-components/actions/close-button/close-button-visual.png +0 -0
  5. package/src/04-components/actions/close-button/close-button.api.json +71 -0
  6. package/src/04-components/actions/close-button/close-button.docs.json +264 -0
  7. package/src/04-components/actions/close-button/close-button.visual.spec.ts +14 -0
  8. package/src/04-components/actions/close-button/index.scss +101 -0
  9. package/src/04-components/data-display/image/image-visual.png +0 -0
  10. package/src/04-components/data-display/image/image.api.json +76 -0
  11. package/src/04-components/data-display/image/image.docs.json +337 -0
  12. package/src/04-components/data-display/image/image.visual.spec.ts +14 -0
  13. package/src/04-components/data-display/image/index.scss +103 -0
  14. package/src/04-components/feedback/progress-circle/index.scss +92 -0
  15. package/src/04-components/feedback/progress-circle/progress-circle-visual.png +0 -0
  16. package/src/04-components/feedback/progress-circle/progress-circle.api.json +53 -0
  17. package/src/04-components/feedback/progress-circle/progress-circle.docs.json +377 -0
  18. package/src/04-components/feedback/progress-circle/progress-circle.visual.spec.ts +14 -0
  19. package/src/04-components/forms/fieldset/fieldset-visual.png +0 -0
  20. package/src/04-components/forms/fieldset/fieldset.api.json +49 -0
  21. package/src/04-components/forms/fieldset/fieldset.docs.json +520 -0
  22. package/src/04-components/forms/fieldset/fieldset.visual.spec.ts +14 -0
  23. package/src/04-components/forms/fieldset/index.scss +69 -0
  24. package/src/04-components/forms/form/form-visual.png +0 -0
  25. package/src/04-components/forms/form/form.api.json +38 -0
  26. package/src/04-components/forms/form/form.docs.json +482 -0
  27. package/src/04-components/forms/form/form.visual.spec.ts +14 -0
  28. package/src/04-components/forms/form/index.scss +62 -0
  29. package/src/04-components/index.scss +7 -0
  30. package/src/04-components/typography/code-block/code-block-visual.png +0 -0
  31. package/src/04-components/typography/code-block/code-block.api.json +56 -0
  32. package/src/04-components/typography/code-block/code-block.docs.json +289 -0
  33. package/src/04-components/typography/code-block/code-block.visual.spec.ts +14 -0
  34. package/src/04-components/typography/code-block/index.scss +87 -0
  35. package/src/04-components/typography/list/index.scss +65 -0
  36. package/src/04-components/typography/list/list-visual.png +0 -0
  37. package/src/04-components/typography/list/list.api.json +33 -0
  38. package/src/04-components/typography/list/list.docs.json +293 -0
  39. package/src/04-components/typography/list/list.visual.spec.ts +14 -0
@@ -0,0 +1,520 @@
1
+ {
2
+ "id": "fieldset",
3
+ "type": "component",
4
+ "title": "Fieldset",
5
+ "description": "Groups related form fields with an optional legend and border.",
6
+ "api": "./fieldset.api.json",
7
+ "sections": [
8
+ {
9
+ "title": "Default",
10
+ "examples": [
11
+ {
12
+ "items": [
13
+ {
14
+ "tag": "fieldset",
15
+ "class": "ui-fieldset",
16
+ "children": [
17
+ {
18
+ "tag": "legend",
19
+ "class": "ui-fieldset__legend",
20
+ "text": "Personal Information"
21
+ },
22
+ {
23
+ "tag": "div",
24
+ "class": "ui-field",
25
+ "children": [
26
+ {
27
+ "tag": "label",
28
+ "class": "ui-label",
29
+ "text": "First Name",
30
+ "attrs": { "for": "fname" }
31
+ },
32
+ {
33
+ "tag": "div",
34
+ "class": "ui-field__control",
35
+ "children": [
36
+ {
37
+ "tag": "input",
38
+ "class": "ui-input",
39
+ "attrs": {
40
+ "type": "text",
41
+ "id": "fname",
42
+ "placeholder": "Jane"
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "tag": "div",
51
+ "class": "ui-field",
52
+ "children": [
53
+ {
54
+ "tag": "label",
55
+ "class": "ui-label",
56
+ "text": "Last Name",
57
+ "attrs": { "for": "lname" }
58
+ },
59
+ {
60
+ "tag": "div",
61
+ "class": "ui-field__control",
62
+ "children": [
63
+ {
64
+ "tag": "input",
65
+ "class": "ui-input",
66
+ "attrs": {
67
+ "type": "text",
68
+ "id": "lname",
69
+ "placeholder": "Doe"
70
+ }
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ ],
79
+ "code": "<fieldset class=\"ui-fieldset\">\n <legend class=\"ui-fieldset__legend\">Personal Information</legend>\n <div class=\"ui-field\">\n <label class=\"ui-label\" for=\"fname\">First Name</label>\n <div class=\"ui-field__control\">\n <input type=\"text\" id=\"fname\" class=\"ui-input\">\n </div>\n </div>\n <div class=\"ui-field\">\n <label class=\"ui-label\" for=\"lname\">Last Name</label>\n <div class=\"ui-field__control\">\n <input type=\"text\" id=\"lname\" class=\"ui-input\">\n </div>\n </div>\n</fieldset>"
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ "title": "Bordered",
85
+ "description": "Visible border wrapping the field group",
86
+ "examples": [
87
+ {
88
+ "items": [
89
+ {
90
+ "tag": "fieldset",
91
+ "class": "ui-fieldset ui-fieldset--bordered",
92
+ "children": [
93
+ {
94
+ "tag": "legend",
95
+ "class": "ui-fieldset__legend",
96
+ "text": "Shipping Address"
97
+ },
98
+ {
99
+ "tag": "div",
100
+ "class": "ui-field",
101
+ "children": [
102
+ {
103
+ "tag": "label",
104
+ "class": "ui-label",
105
+ "text": "Street",
106
+ "attrs": { "for": "street" }
107
+ },
108
+ {
109
+ "tag": "div",
110
+ "class": "ui-field__control",
111
+ "children": [
112
+ {
113
+ "tag": "input",
114
+ "class": "ui-input",
115
+ "attrs": {
116
+ "type": "text",
117
+ "id": "street",
118
+ "placeholder": "123 Example St"
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "tag": "div",
127
+ "class": "ui-field",
128
+ "children": [
129
+ {
130
+ "tag": "label",
131
+ "class": "ui-label",
132
+ "text": "City",
133
+ "attrs": { "for": "city" }
134
+ },
135
+ {
136
+ "tag": "div",
137
+ "class": "ui-field__control",
138
+ "children": [
139
+ {
140
+ "tag": "input",
141
+ "class": "ui-input",
142
+ "attrs": {
143
+ "type": "text",
144
+ "id": "city",
145
+ "placeholder": "Springfield"
146
+ }
147
+ }
148
+ ]
149
+ }
150
+ ]
151
+ }
152
+ ]
153
+ }
154
+ ],
155
+ "code": "<fieldset class=\"ui-fieldset ui-fieldset--bordered\">\n <legend class=\"ui-fieldset__legend\">Shipping Address</legend>\n <div class=\"ui-field\">\n <label class=\"ui-label\" for=\"street\">Street</label>\n <div class=\"ui-field__control\">\n <input type=\"text\" id=\"street\" class=\"ui-input\">\n </div>\n </div>\n <div class=\"ui-field\">\n <label class=\"ui-label\" for=\"city\">City</label>\n <div class=\"ui-field__control\">\n <input type=\"text\" id=\"city\" class=\"ui-input\">\n </div>\n </div>\n</fieldset>"
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "title": "Compact",
161
+ "description": "Reduced spacing for dense forms",
162
+ "examples": [
163
+ {
164
+ "items": [
165
+ {
166
+ "tag": "fieldset",
167
+ "class": "ui-fieldset ui-fieldset--compact",
168
+ "children": [
169
+ {
170
+ "tag": "legend",
171
+ "class": "ui-fieldset__legend",
172
+ "text": "Preferences"
173
+ },
174
+ {
175
+ "tag": "div",
176
+ "class": "ui-field",
177
+ "children": [
178
+ {
179
+ "tag": "label",
180
+ "class": "ui-label",
181
+ "text": "Language",
182
+ "attrs": { "for": "lang" }
183
+ },
184
+ {
185
+ "tag": "div",
186
+ "class": "ui-field__control",
187
+ "children": [
188
+ {
189
+ "tag": "select",
190
+ "class": "ui-select",
191
+ "attrs": { "id": "lang" },
192
+ "children": [
193
+ {
194
+ "tag": "option",
195
+ "text": "English"
196
+ },
197
+ {
198
+ "tag": "option",
199
+ "text": "Spanish"
200
+ }
201
+ ]
202
+ }
203
+ ]
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "tag": "div",
209
+ "class": "ui-field",
210
+ "children": [
211
+ {
212
+ "tag": "label",
213
+ "class": "ui-label",
214
+ "text": "Timezone",
215
+ "attrs": { "for": "tz" }
216
+ },
217
+ {
218
+ "tag": "div",
219
+ "class": "ui-field__control",
220
+ "children": [
221
+ {
222
+ "tag": "select",
223
+ "class": "ui-select",
224
+ "attrs": { "id": "tz" },
225
+ "children": [
226
+ {
227
+ "tag": "option",
228
+ "text": "UTC-5 Eastern"
229
+ },
230
+ {
231
+ "tag": "option",
232
+ "text": "UTC-8 Pacific"
233
+ }
234
+ ]
235
+ }
236
+ ]
237
+ }
238
+ ]
239
+ }
240
+ ]
241
+ }
242
+ ],
243
+ "code": "<fieldset class=\"ui-fieldset ui-fieldset--compact\">\n <legend class=\"ui-fieldset__legend\">Preferences</legend>\n <div class=\"ui-field\">...</div>\n <div class=\"ui-field\">...</div>\n</fieldset>"
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "title": "Bordered Compact",
249
+ "description": "Bordered with reduced spacing",
250
+ "examples": [
251
+ {
252
+ "items": [
253
+ {
254
+ "tag": "fieldset",
255
+ "class": "ui-fieldset ui-fieldset--bordered ui-fieldset--compact",
256
+ "children": [
257
+ {
258
+ "tag": "legend",
259
+ "class": "ui-fieldset__legend",
260
+ "text": "Payment"
261
+ },
262
+ {
263
+ "tag": "div",
264
+ "class": "ui-field",
265
+ "children": [
266
+ {
267
+ "tag": "label",
268
+ "class": "ui-label",
269
+ "text": "Card Number",
270
+ "attrs": { "for": "card" }
271
+ },
272
+ {
273
+ "tag": "div",
274
+ "class": "ui-field__control",
275
+ "children": [
276
+ {
277
+ "tag": "input",
278
+ "class": "ui-input",
279
+ "attrs": {
280
+ "type": "text",
281
+ "id": "card",
282
+ "placeholder": "4242 4242 4242 4242"
283
+ }
284
+ }
285
+ ]
286
+ }
287
+ ]
288
+ },
289
+ {
290
+ "tag": "div",
291
+ "class": "ui-field",
292
+ "children": [
293
+ {
294
+ "tag": "label",
295
+ "class": "ui-label",
296
+ "text": "Expiry",
297
+ "attrs": { "for": "exp" }
298
+ },
299
+ {
300
+ "tag": "div",
301
+ "class": "ui-field__control",
302
+ "children": [
303
+ {
304
+ "tag": "input",
305
+ "class": "ui-input",
306
+ "attrs": {
307
+ "type": "text",
308
+ "id": "exp",
309
+ "placeholder": "MM/YY"
310
+ }
311
+ }
312
+ ]
313
+ }
314
+ ]
315
+ }
316
+ ]
317
+ }
318
+ ],
319
+ "code": "<fieldset class=\"ui-fieldset ui-fieldset--bordered ui-fieldset--compact\">\n <legend class=\"ui-fieldset__legend\">Payment</legend>\n <div class=\"ui-field\">...</div>\n <div class=\"ui-field\">...</div>\n</fieldset>"
320
+ }
321
+ ]
322
+ },
323
+ {
324
+ "title": "Disabled",
325
+ "description": "Native disabled attribute disables all child controls",
326
+ "examples": [
327
+ {
328
+ "items": [
329
+ {
330
+ "tag": "fieldset",
331
+ "class": "ui-fieldset ui-fieldset--bordered",
332
+ "attrs": { "disabled": "" },
333
+ "children": [
334
+ {
335
+ "tag": "legend",
336
+ "class": "ui-fieldset__legend",
337
+ "text": "Account (locked)"
338
+ },
339
+ {
340
+ "tag": "div",
341
+ "class": "ui-field",
342
+ "children": [
343
+ {
344
+ "tag": "label",
345
+ "class": "ui-label",
346
+ "text": "Username",
347
+ "attrs": { "for": "uname" }
348
+ },
349
+ {
350
+ "tag": "div",
351
+ "class": "ui-field__control",
352
+ "children": [
353
+ {
354
+ "tag": "input",
355
+ "class": "ui-input",
356
+ "attrs": {
357
+ "type": "text",
358
+ "id": "uname",
359
+ "value": "janedoe"
360
+ }
361
+ }
362
+ ]
363
+ }
364
+ ]
365
+ },
366
+ {
367
+ "tag": "div",
368
+ "class": "ui-field",
369
+ "children": [
370
+ {
371
+ "tag": "label",
372
+ "class": "ui-label",
373
+ "text": "Role",
374
+ "attrs": { "for": "role" }
375
+ },
376
+ {
377
+ "tag": "div",
378
+ "class": "ui-field__control",
379
+ "children": [
380
+ {
381
+ "tag": "input",
382
+ "class": "ui-input",
383
+ "attrs": {
384
+ "type": "text",
385
+ "id": "role",
386
+ "value": "Editor"
387
+ }
388
+ }
389
+ ]
390
+ }
391
+ ]
392
+ }
393
+ ]
394
+ }
395
+ ],
396
+ "code": "<fieldset class=\"ui-fieldset ui-fieldset--bordered\" disabled>\n <legend class=\"ui-fieldset__legend\">Account (locked)</legend>\n <div class=\"ui-field\">...</div>\n</fieldset>"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "title": "Without Legend",
402
+ "description": "Fieldset as a spacing container without visible legend",
403
+ "examples": [
404
+ {
405
+ "items": [
406
+ {
407
+ "tag": "fieldset",
408
+ "class": "ui-fieldset",
409
+ "children": [
410
+ {
411
+ "tag": "div",
412
+ "class": "ui-field",
413
+ "children": [
414
+ {
415
+ "tag": "label",
416
+ "class": "ui-label",
417
+ "text": "Search",
418
+ "attrs": { "for": "search" }
419
+ },
420
+ {
421
+ "tag": "div",
422
+ "class": "ui-field__control",
423
+ "children": [
424
+ {
425
+ "tag": "input",
426
+ "class": "ui-input",
427
+ "attrs": {
428
+ "type": "search",
429
+ "id": "search",
430
+ "placeholder": "Search..."
431
+ }
432
+ }
433
+ ]
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "tag": "div",
439
+ "class": "ui-field",
440
+ "children": [
441
+ {
442
+ "tag": "label",
443
+ "class": "ui-label",
444
+ "text": "Category",
445
+ "attrs": { "for": "cat" }
446
+ },
447
+ {
448
+ "tag": "div",
449
+ "class": "ui-field__control",
450
+ "children": [
451
+ {
452
+ "tag": "select",
453
+ "class": "ui-select",
454
+ "attrs": { "id": "cat" },
455
+ "children": [
456
+ {
457
+ "tag": "option",
458
+ "text": "All"
459
+ },
460
+ {
461
+ "tag": "option",
462
+ "text": "Articles"
463
+ }
464
+ ]
465
+ }
466
+ ]
467
+ }
468
+ ]
469
+ }
470
+ ]
471
+ }
472
+ ],
473
+ "code": "<fieldset class=\"ui-fieldset\">\n <div class=\"ui-field\">...</div>\n <div class=\"ui-field\">...</div>\n</fieldset>"
474
+ }
475
+ ]
476
+ }
477
+ ],
478
+ "customization": [
479
+ {
480
+ "token": "--ui-fieldset-spacing",
481
+ "default": "var(--ui-space-2)",
482
+ "description": "Gap between child fields"
483
+ },
484
+ {
485
+ "token": "--ui-fieldset-border-color",
486
+ "default": "var(--ui-color-border)",
487
+ "description": "Border color for bordered variant"
488
+ },
489
+ {
490
+ "token": "--ui-fieldset-border-width",
491
+ "default": "var(--ui-border-width-sm)",
492
+ "description": "Border width for bordered variant"
493
+ },
494
+ {
495
+ "token": "--ui-fieldset-border-radius",
496
+ "default": "var(--ui-radius-md)",
497
+ "description": "Border radius for bordered variant"
498
+ },
499
+ {
500
+ "token": "--ui-fieldset-padding",
501
+ "default": "var(--ui-space-2)",
502
+ "description": "Inner padding for bordered variant"
503
+ },
504
+ {
505
+ "token": "--ui-fieldset-legend-size",
506
+ "default": "var(--ui-font-size-sm)",
507
+ "description": "Legend font size"
508
+ },
509
+ {
510
+ "token": "--ui-fieldset-legend-weight",
511
+ "default": "var(--ui-weight-medium)",
512
+ "description": "Legend font weight"
513
+ },
514
+ {
515
+ "token": "--ui-fieldset-legend-color",
516
+ "default": "var(--ui-color-text)",
517
+ "description": "Legend text color"
518
+ }
519
+ ]
520
+ }
@@ -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, 'fieldset.docs.json');
6
+
7
+ test.describe('fieldset visual regression', () => {
8
+ test('all variations', async ({ page }) => {
9
+ await setupVisualTestFromDocs(page, DOCS_PATH);
10
+ await validateGridRhythm(page, 'fieldset');
11
+ await saveForLostPixel(page, 'fieldset');
12
+ await expect(page.locator('body')).toHaveScreenshot('fieldset.visual.png');
13
+ });
14
+ });
@@ -0,0 +1,69 @@
1
+ @use '../../../00-config/tokens/variables' as t;
2
+
3
+ // Fieldset - groups related form fields
4
+ // Resets native fieldset chrome, provides consistent spacing and optional border
5
+
6
+ @layer components.tokens {
7
+ .fieldset {
8
+ --_spacing: var(--ui-fieldset-spacing, var(--ui-space-2, #{t.$space-2}));
9
+ --_border-color: var(--ui-fieldset-border-color, var(--ui-color-border, #{t.$color-border}));
10
+ --_border-width: var(--ui-fieldset-border-width, var(--ui-border-width-sm, #{t.$border-width-sm}));
11
+ --_border-radius: var(--ui-fieldset-border-radius, var(--ui-radius-md, #{t.$radius-md}));
12
+ --_padding: var(--ui-fieldset-padding, var(--ui-space-2, #{t.$space-2}));
13
+ --_legend-size: var(--ui-fieldset-legend-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
14
+ --_legend-weight: var(--ui-fieldset-legend-weight, var(--ui-weight-medium, #{t.$weight-medium}));
15
+ --_legend-color: var(--ui-fieldset-legend-color, var(--ui-color-text, #{t.$color-text}));
16
+ }
17
+
18
+ .fieldset--compact {
19
+ --_spacing: var(--ui-fieldset-spacing-compact, var(--ui-space-1, #{t.$space-1}));
20
+ --_padding: var(--ui-fieldset-padding-compact, var(--ui-space-1, #{t.$space-1}));
21
+ }
22
+ }
23
+
24
+ @layer components.styles {
25
+ .fieldset {
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: var(--_spacing);
29
+
30
+ min-inline-size: 0;
31
+ padding: 0;
32
+ margin: 0;
33
+
34
+ border: none;
35
+ }
36
+
37
+ .fieldset__legend {
38
+ inline-size: 100%;
39
+ padding: 0;
40
+
41
+ font-size: var(--_legend-size);
42
+ font-weight: var(--_legend-weight);
43
+ line-height: var(--ui-leading-tight-sm, var(--ui-row-1, #{t.$leading-tight-sm}));
44
+ color: var(--_legend-color);
45
+ }
46
+
47
+ // Bordered variant - visible border wrapping the group
48
+ // Legend absorbs the top border; compensate bottom border to keep grid rhythm
49
+ .fieldset--bordered {
50
+ padding: var(--_padding);
51
+ padding-block-end: calc(var(--_padding) - var(--_border-width));
52
+
53
+ border: var(--_border-width) solid var(--_border-color);
54
+ border-radius: var(--_border-radius);
55
+ }
56
+
57
+ .fieldset--bordered > .fieldset__legend {
58
+ inline-size: auto;
59
+ padding-inline: var(--ui-space-half, #{t.$space-0});
60
+ margin-inline-start: calc(-1 * var(--ui-space-half, #{t.$space-0}));
61
+ }
62
+
63
+ // Disabled state - fieldset[disabled] natively disables children
64
+ .fieldset:disabled,
65
+ .fieldset[aria-disabled='true'] {
66
+ opacity: 0.5;
67
+ cursor: not-allowed;
68
+ }
69
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "form",
3
+ "element": "form",
4
+ "modifiers": {
5
+ "compact": {
6
+ "type": "boolean"
7
+ },
8
+ "inline": {
9
+ "type": "boolean"
10
+ }
11
+ },
12
+ "elements": {
13
+ "section": {},
14
+ "actions": {}
15
+ },
16
+ "cssVars": [
17
+ {
18
+ "name": "--ui-form-spacing",
19
+ "default": "var(--ui-space-3)"
20
+ },
21
+ {
22
+ "name": "--ui-form-actions-gap",
23
+ "default": "var(--ui-space-2)"
24
+ },
25
+ {
26
+ "name": "--ui-form-section-spacing",
27
+ "default": "var(--ui-space-4)"
28
+ },
29
+ {
30
+ "name": "--ui-form-spacing-compact",
31
+ "default": "var(--ui-space-2)"
32
+ },
33
+ {
34
+ "name": "--ui-form-section-spacing-compact",
35
+ "default": "var(--ui-space-3)"
36
+ }
37
+ ]
38
+ }