@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
@@ -27,18 +27,82 @@
27
27
  },
28
28
  {
29
29
  "title": "Sizes",
30
- "data": {
31
- "sizes": [
32
- { "mod": "xs", "label": "2u" },
33
- { "mod": "sm", "label": "3u" },
34
- { "mod": "md", "label": "4u" },
35
- { "mod": "lg", "label": "5u" },
36
- { "mod": "xl", "label": "6u" }
37
- ]
38
- },
30
+ "description": "Scale icons from extra small to extra large.",
39
31
  "examples": [
40
32
  {
41
- "html": "<div class=\"ui-cluster ui-cluster--gap-2\" style=\"align-items: center\">{% for s in sizes %}<div class=\"ui-stack ui-stack--gap-half\" style=\"align-items: center\"><svg class=\"ui-icon ui-icon--{{ s.mod }}\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/></svg><small>{{ s.label }}</small></div>{% endfor %}</div>"
33
+ "layout": "cluster",
34
+ "items": [
35
+ {
36
+ "tag": "div",
37
+ "class": "ui-stack",
38
+ "style": { "align-items": "center", "gap": "var(--ui-space-1)" },
39
+ "children": [
40
+ {
41
+ "tag": "svg",
42
+ "class": "ui-icon ui-icon--xs",
43
+ "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 24 24" },
44
+ "html": "<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/>"
45
+ },
46
+ { "tag": "small", "text": "xs" }
47
+ ]
48
+ },
49
+ {
50
+ "tag": "div",
51
+ "class": "ui-stack",
52
+ "style": { "align-items": "center", "gap": "var(--ui-space-1)" },
53
+ "children": [
54
+ {
55
+ "tag": "svg",
56
+ "class": "ui-icon ui-icon--sm",
57
+ "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 24 24" },
58
+ "html": "<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/>"
59
+ },
60
+ { "tag": "small", "text": "sm" }
61
+ ]
62
+ },
63
+ {
64
+ "tag": "div",
65
+ "class": "ui-stack",
66
+ "style": { "align-items": "center", "gap": "var(--ui-space-1)" },
67
+ "children": [
68
+ {
69
+ "tag": "svg",
70
+ "class": "ui-icon ui-icon--md",
71
+ "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 24 24" },
72
+ "html": "<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/>"
73
+ },
74
+ { "tag": "small", "text": "md" }
75
+ ]
76
+ },
77
+ {
78
+ "tag": "div",
79
+ "class": "ui-stack",
80
+ "style": { "align-items": "center", "gap": "var(--ui-space-1)" },
81
+ "children": [
82
+ {
83
+ "tag": "svg",
84
+ "class": "ui-icon ui-icon--lg",
85
+ "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 24 24" },
86
+ "html": "<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/>"
87
+ },
88
+ { "tag": "small", "text": "lg" }
89
+ ]
90
+ },
91
+ {
92
+ "tag": "div",
93
+ "class": "ui-stack",
94
+ "style": { "align-items": "center", "gap": "var(--ui-space-1)" },
95
+ "children": [
96
+ {
97
+ "tag": "svg",
98
+ "class": "ui-icon ui-icon--xl",
99
+ "attrs": { "xmlns": "http://www.w3.org/2000/svg", "viewBox": "0 0 24 24" },
100
+ "html": "<circle cx=\"11\" cy=\"11\" r=\"8\"/><path d=\"m21 21-4.3-4.3\"/>"
101
+ },
102
+ { "tag": "small", "text": "xl" }
103
+ ]
104
+ }
105
+ ]
42
106
  }
43
107
  ]
44
108
  },
@@ -120,33 +184,33 @@
120
184
  "customization": [
121
185
  {
122
186
  "token": "--ui-icon-size",
123
- "default": "1em",
124
- "description": "Default size (inherits from font)"
187
+ "default": "var(--ui-ctx-size, 1rem)",
188
+ "description": "3-tier: global > context > default"
125
189
  },
126
190
  {
127
191
  "token": "--ui-icon-size-xs",
128
- "default": "calc(var(--unit) * 2)",
129
- "description": "Extra small size (16px)"
192
+ "default": "var(--ui-size-xs)",
193
+ "description": "Extra small size"
130
194
  },
131
195
  {
132
196
  "token": "--ui-icon-size-sm",
133
- "default": "calc(var(--unit) * 3)",
134
- "description": "Small size (24px)"
197
+ "default": "var(--ui-size-sm)",
198
+ "description": "Small size"
135
199
  },
136
200
  {
137
201
  "token": "--ui-icon-size-md",
138
- "default": "calc(var(--unit) * 4)",
139
- "description": "Medium size (32px)"
202
+ "default": "var(--ui-size-md)",
203
+ "description": "Medium size"
140
204
  },
141
205
  {
142
206
  "token": "--ui-icon-size-lg",
143
- "default": "calc(var(--unit) * 5)",
144
- "description": "Large size (40px)"
207
+ "default": "var(--ui-size-lg)",
208
+ "description": "Large size"
145
209
  },
146
210
  {
147
211
  "token": "--ui-icon-size-xl",
148
- "default": "calc(var(--unit) * 6)",
149
- "description": "Extra large size (48px)"
212
+ "default": "var(--ui-size-xl)",
213
+ "description": "Extra large size"
150
214
  },
151
215
  { "token": "--ui-icon-stroke", "default": "2", "description": "Default stroke width" },
152
216
  { "token": "--ui-icon-stroke-thin", "default": "1", "description": "Thin stroke width" },
@@ -5,29 +5,16 @@
5
5
 
6
6
  @layer components.tokens {
7
7
  .icon {
8
- --_size: var(--ui-icon-size, 1em);
8
+ // 3-tier inheritance: global > context > default
9
+ --_size: var(--ui-icon-size, var(--ui-ctx-size, #{t.size(md)}));
9
10
  --_stroke: var(--ui-icon-stroke, 2);
10
11
  }
11
12
 
12
13
  // @modifier size
13
- .icon--xs {
14
- --_size: var(--ui-icon-size-xs, calc(#{t.$unit} * 2));
15
- }
16
-
17
- .icon--sm {
18
- --_size: var(--ui-icon-size-sm, calc(#{t.$unit} * 3));
19
- }
20
-
21
- .icon--md {
22
- --_size: var(--ui-icon-size-md, calc(#{t.$unit} * 4));
23
- }
24
-
25
- .icon--lg {
26
- --_size: var(--ui-icon-size-lg, calc(#{t.$unit} * 5));
27
- }
28
-
29
- .icon--xl {
30
- --_size: var(--ui-icon-size-xl, calc(#{t.$unit} * 6));
14
+ @each $name, $value in t.$sizes {
15
+ .icon--#{$name} {
16
+ --_size: var(--ui-icon-size-#{$name}, var(--ui-size-#{$name}, #{$value}));
17
+ }
31
18
  }
32
19
 
33
20
  // @modifier stroke
@@ -23,6 +23,7 @@
23
23
  @forward './link/index';
24
24
  @forward './menu/index';
25
25
  @forward './modal/index';
26
+ @forward './nav/index';
26
27
  @forward './overlay/index';
27
28
  @forward './pagination/index';
28
29
  @forward './popover/index';
@@ -10,8 +10,39 @@
10
10
  },
11
11
  "state": {
12
12
  "values": ["error", "success"]
13
+ },
14
+ "block": {
15
+ "type": "boolean"
13
16
  }
14
17
  },
18
+ "relatedComponents": [
19
+ {
20
+ "name": "input-group",
21
+ "modifiers": {
22
+ "has-prefix": {
23
+ "type": "boolean"
24
+ },
25
+ "has-suffix": {
26
+ "type": "boolean"
27
+ }
28
+ },
29
+ "elements": {
30
+ "addon": {
31
+ "modifiers": {
32
+ "start": {
33
+ "type": "boolean"
34
+ },
35
+ "end": {
36
+ "type": "boolean"
37
+ },
38
+ "interactive": {
39
+ "type": "boolean"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ],
15
46
  "cssVars": [
16
47
  {
17
48
  "name": "--ui-input-height",
@@ -6,6 +6,10 @@
6
6
  "values": ["lg"]
7
7
  }
8
8
  },
9
+ "elements": {
10
+ "required": {},
11
+ "optional": {}
12
+ },
9
13
  "cssVars": [
10
14
  {
11
15
  "name": "--ui-label-font-size",
@@ -4,6 +4,12 @@
4
4
  "modifiers": {
5
5
  "variant": {
6
6
  "values": ["muted", "subtle"]
7
+ },
8
+ "external": {
9
+ "type": "boolean"
10
+ },
11
+ "disabled": {
12
+ "type": "boolean"
7
13
  }
8
14
  },
9
15
  "cssVars": [
@@ -2,6 +2,30 @@
2
2
  "name": "menu",
3
3
  "element": "div",
4
4
  "modifiers": {},
5
+ "elements": {
6
+ "group": {},
7
+ "label": {},
8
+ "separator": {},
9
+ "item": {
10
+ "modifiers": {
11
+ "disabled": {
12
+ "type": "boolean"
13
+ },
14
+ "danger": {
15
+ "type": "boolean"
16
+ },
17
+ "check": {
18
+ "type": "boolean"
19
+ },
20
+ "radio": {
21
+ "type": "boolean"
22
+ }
23
+ }
24
+ },
25
+ "item-icon": {},
26
+ "item-shortcut": {},
27
+ "item-indicator": {}
28
+ },
5
29
  "cssVars": [
6
30
  {
7
31
  "name": "--ui-menu-min-width",
@@ -1,7 +1,18 @@
1
1
  {
2
2
  "name": "modal",
3
3
  "element": "div",
4
- "modifiers": {},
4
+ "modifiers": {
5
+ "visible": {
6
+ "type": "boolean"
7
+ },
8
+ "size": {
9
+ "values": ["sm"]
10
+ }
11
+ },
12
+ "elements": {
13
+ "content": {},
14
+ "body": {}
15
+ },
5
16
  "cssVars": [
6
17
  {
7
18
  "name": "--ui-modal-bg",
@@ -0,0 +1,142 @@
1
+ @use '../../00-config/tokens/variables' as t;
2
+
3
+ // @component nav
4
+ // @element nav
5
+
6
+ @layer components.tokens {
7
+ .nav {
8
+ --_gap: var(--ui-nav-gap, var(--ui-space-1, #{t.$space-1}));
9
+ --_item-height: var(--ui-nav-item-height, var(--ui-row-2, #{t.$row-2}));
10
+ --_item-padding-x: var(--ui-nav-item-padding-x, var(--ui-space-2, #{t.$space-2}));
11
+ --_item-font-size: var(--ui-nav-item-font-size, var(--ui-font-size-sm, #{t.$font-size-sm}));
12
+ --_item-font-weight: var(--ui-nav-item-font-weight, var(--ui-weight-medium, #{t.$weight-medium}));
13
+ --_item-color: var(--ui-nav-item-color, var(--ui-color-text-muted, #{t.$color-text-muted}));
14
+ --_item-color-hover: var(--ui-nav-item-color-hover, var(--ui-color-text, #{t.$color-text}));
15
+ --_item-color-active: var(--ui-nav-item-color-active, var(--ui-color-primary, #{t.$color-primary}));
16
+ --_item-radius: var(--ui-nav-item-radius, var(--ui-radius-sm, #{t.$radius-sm}));
17
+ --_border-color: var(--ui-nav-border-color, var(--ui-color-border, #{t.$color-border}));
18
+ }
19
+
20
+ // @modifier pills
21
+ .nav--pills {
22
+ --_item-bg-hover: var(--ui-nav-item-bg-hover, var(--ui-color-bg-muted, #{t.$color-bg-muted}));
23
+ --_item-bg-active: var(--ui-nav-item-bg-active, var(--ui-color-primary, #{t.$color-primary}));
24
+ --_item-color-active: var(--ui-nav-item-color-active, var(--ui-color-text-inverse, #{t.$color-text-inverse}));
25
+ }
26
+
27
+ // @modifier boolean vertical
28
+ }
29
+
30
+ @layer components.styles {
31
+ .nav__list {
32
+ display: flex;
33
+ align-items: stretch;
34
+ gap: var(--_gap);
35
+
36
+ box-sizing: border-box;
37
+ block-size: var(--_item-height);
38
+ padding: 0;
39
+ margin: 0;
40
+
41
+ list-style: none;
42
+
43
+ // Bottom border via box-shadow to avoid height impact
44
+ box-shadow: inset 0 calc(var(--ui-border-width-sm, #{t.$border-width-sm}) * -1) 0 var(--_border-color);
45
+ }
46
+
47
+ .nav__item {
48
+ display: inline-flex;
49
+ align-items: center;
50
+
51
+ box-sizing: border-box;
52
+ block-size: var(--_item-height);
53
+ padding-inline: var(--_item-padding-x);
54
+
55
+ font-family: var(--ui-font-sans, #{t.$font-sans});
56
+ font-size: var(--_item-font-size);
57
+ font-weight: var(--_item-font-weight);
58
+ line-height: 1;
59
+ text-decoration: none;
60
+ white-space: nowrap;
61
+ color: var(--_item-color);
62
+
63
+ background: transparent;
64
+ border: none;
65
+ // Underline indicator via box-shadow
66
+ box-shadow: inset 0 calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 transparent;
67
+ cursor: pointer;
68
+
69
+ transition:
70
+ color var(--ui-duration-base) var(--ui-ease-default),
71
+ background var(--ui-duration-base) var(--ui-ease-default),
72
+ box-shadow var(--ui-duration-base) var(--ui-ease-default);
73
+
74
+ &:hover {
75
+ color: var(--_item-color-hover);
76
+ }
77
+
78
+ &--active {
79
+ color: var(--_item-color-active);
80
+
81
+ box-shadow: inset 0 calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 var(--_item-color-active);
82
+ }
83
+
84
+ &--disabled {
85
+ opacity: 0.5;
86
+ pointer-events: none;
87
+ }
88
+ }
89
+
90
+ // Pills variant - background instead of underline
91
+ .nav--pills {
92
+ .nav__list {
93
+ box-shadow: none;
94
+ }
95
+
96
+ .nav__item {
97
+ border-radius: var(--_item-radius);
98
+ box-shadow: none;
99
+
100
+ &:hover {
101
+ background: var(--_item-bg-hover);
102
+ }
103
+
104
+ &--active {
105
+ color: var(--_item-color-active);
106
+
107
+ background: var(--_item-bg-active);
108
+ }
109
+ }
110
+ }
111
+
112
+ // Vertical orientation
113
+ .nav--vertical {
114
+ .nav__list {
115
+ flex-direction: column;
116
+ align-items: stretch;
117
+
118
+ block-size: auto;
119
+
120
+ box-shadow: inset calc(var(--ui-border-width-sm, #{t.$border-width-sm}) * -1) 0 0 var(--_border-color);
121
+ }
122
+
123
+ .nav__item {
124
+ box-shadow: inset calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 0 transparent;
125
+
126
+ &--active {
127
+ box-shadow: inset calc(var(--ui-border-width-md, #{t.$border-width-md}) * -1) 0 0 var(--_item-color-active);
128
+ }
129
+ }
130
+ }
131
+
132
+ // Vertical + pills
133
+ .nav--vertical.nav--pills {
134
+ .nav__list {
135
+ box-shadow: none;
136
+ }
137
+
138
+ .nav__item {
139
+ box-shadow: none;
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "nav",
3
+ "element": "nav",
4
+ "modifiers": {
5
+ "pills": {
6
+ "type": "boolean"
7
+ },
8
+ "vertical": {
9
+ "type": "boolean"
10
+ }
11
+ },
12
+ "elements": {
13
+ "list": {},
14
+ "item": {
15
+ "modifiers": {
16
+ "active": {
17
+ "type": "boolean"
18
+ },
19
+ "disabled": {
20
+ "type": "boolean"
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "cssVars": [
26
+ {
27
+ "name": "--ui-nav-gap",
28
+ "default": "var(--ui-space-1)"
29
+ },
30
+ {
31
+ "name": "--ui-nav-item-height",
32
+ "default": "var(--ui-row-2)"
33
+ },
34
+ {
35
+ "name": "--ui-nav-item-padding-x",
36
+ "default": "var(--ui-space-2)"
37
+ },
38
+ {
39
+ "name": "--ui-nav-item-font-size",
40
+ "default": "var(--ui-font-size-sm)"
41
+ },
42
+ {
43
+ "name": "--ui-nav-item-color",
44
+ "default": "var(--ui-color-text-muted)"
45
+ },
46
+ {
47
+ "name": "--ui-nav-item-color-active",
48
+ "default": "var(--ui-color-primary)"
49
+ },
50
+ {
51
+ "name": "--ui-nav-border-color",
52
+ "default": "var(--ui-color-border)"
53
+ }
54
+ ]
55
+ }