@whatsaaaa/design-system 0.8.3 → 0.9.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/tokens.js CHANGED
@@ -6,6 +6,26 @@ export const PERMUTATIONS = {
6
6
  "border-width.medium":{"$type":"dimension","$description":"Active markers and the focus ring.","$value":{"value":2,"unit":"px"}},
7
7
  "border-width.thick":{"$type":"dimension","$description":"The bar of a callout.","$value":{"value":3,"unit":"px"}},
8
8
  "border-width.thin":{"$type":"dimension","$description":"Dividers and outlines.","$value":{"value":1,"unit":"px"}},
9
+ "button.border.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
10
+ "button.danger.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"alpha":0.09,"hex":"#eb6f92"}},
11
+ "button.danger.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"alpha":0.09,"hex":"#eb6f92"}},
12
+ "button.danger.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
13
+ "button.danger.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
14
+ "button.ghost.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.149,0.1373,0.2275],"hex":"#26233a","alpha":1}},
15
+ "button.ghost.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.149,0.1373,0.2275],"hex":"#26233a","alpha":1}},
16
+ "button.ghost.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.8784,0.8706,0.9569],"hex":"#e0def4","alpha":1}},
17
+ "button.primary.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7373,0.9412,0.9765],"hex":"#bcf0f9","alpha":1}},
18
+ "button.primary.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.6745,0.8745,0.9098],"hex":"#acdfe8","alpha":1}},
19
+ "button.primary.bg.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.6118,0.8118,0.8471],"hex":"#9ccfd8","alpha":1}},
20
+ "button.primary.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.098,0.0902,0.1412],"hex":"#191724","alpha":1}},
21
+ "button.quiet.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.6118,0.8118,0.8471],"hex":"#9ccfd8","alpha":1}},
22
+ "button.secondary.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.149,0.1373,0.2275],"hex":"#26233a","alpha":1}},
23
+ "button.secondary.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.149,0.1373,0.2275],"hex":"#26233a","alpha":1}},
24
+ "button.secondary.border.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.5647,0.549,0.6667],"hex":"#908caa","alpha":1}},
25
+ "button.secondary.border.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.5647,0.549,0.6667],"hex":"#908caa","alpha":1}},
26
+ "button.secondary.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
27
+ "button.secondary.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.8784,0.8706,0.9569],"hex":"#e0def4","alpha":1}},
28
+ "button.text.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
9
29
  "code.bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.1216,0.1137,0.1804],"hex":"#1f1d2e","alpha":1}},
10
30
  "code.border":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.251,0.2392,0.3216],"hex":"#403d52","alpha":1}},
11
31
  "code.header-bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.098,0.0902,0.1412],"hex":"#191724","alpha":1}},
@@ -20,6 +40,7 @@ export const PERMUTATIONS = {
20
40
  "color.border-strong":{"$type":"color","$description":"Key caps.","$value":{"colorSpace":"srgb","components":[0.3216,0.3098,0.4039],"hex":"#524f67","alpha":1}},
21
41
  "color.brand":{"$type":"color","$description":"The brand accent: tongue, cursor, prompt chevron, active markers. Graphics and large type.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
22
42
  "color.brand-fill":{"$type":"color","$description":"Solid chip behind small text, such as the mode segment.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
43
+ "color.brand-text":{"$type":"color","$description":"Brand red as small text, such as the required mark of a field. Love on dark; on light love 0.05 further from the page in OKLab lightness, so it reads at 4.5:1.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
23
44
  "color.danger":{"$type":"color","$description":"Status danger: field error border and bar.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
24
45
  "color.danger-text":{"$type":"color","$description":"Status danger: label and error message text.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
25
46
  "color.danger-tint":{"$type":"color","$description":"Status danger: block background.","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"alpha":0.09,"hex":"#eb6f92"}},
@@ -46,6 +67,38 @@ export const PERMUTATIONS = {
46
67
  "color.warning":{"$type":"color","$description":"Status warning and \"experimental\": bar.","$value":{"colorSpace":"srgb","components":[0.9647,0.7569,0.4667],"hex":"#f6c177","alpha":1}},
47
68
  "color.warning-text":{"$type":"color","$description":"Status warning: label text.","$value":{"colorSpace":"srgb","components":[0.9647,0.7569,0.4667],"hex":"#f6c177","alpha":1}},
48
69
  "color.warning-tint":{"$type":"color","$description":"Status warning: block background.","$value":{"colorSpace":"srgb","components":[0.9647,0.7569,0.4667],"alpha":0.09,"hex":"#f6c177"}},
70
+ "control.border-width.invalid":{"$type":"dimension","$value":{"value":2,"unit":"px"}},
71
+ "control.border-width.rest":{"$type":"dimension","$value":{"value":1,"unit":"px"}},
72
+ "control.gap.lg":{"$type":"dimension","$value":{"value":0.5,"unit":"rem"}},
73
+ "control.gap.md":{"$type":"dimension","$value":{"value":0.5,"unit":"rem"}},
74
+ "control.gap.sm":{"$type":"dimension","$value":{"value":0.375,"unit":"rem"}},
75
+ "control.gap.xl":{"$type":"dimension","$value":{"value":0.625,"unit":"rem"}},
76
+ "control.gap.xs":{"$type":"dimension","$value":{"value":0.375,"unit":"rem"}},
77
+ "control.height.lg":{"$type":"dimension","$value":{"value":2.75,"unit":"rem"}},
78
+ "control.height.md":{"$type":"dimension","$value":{"value":2.5,"unit":"rem"}},
79
+ "control.height.sm":{"$type":"dimension","$value":{"value":2,"unit":"rem"}},
80
+ "control.height.xl":{"$type":"dimension","$value":{"value":3,"unit":"rem"}},
81
+ "control.height.xs":{"$type":"dimension","$value":{"value":1.75,"unit":"rem"}},
82
+ "control.icon-size.lg":{"$type":"dimension","$value":{"value":1.25,"unit":"rem"}},
83
+ "control.icon-size.md":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
84
+ "control.icon-size.sm":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
85
+ "control.icon-size.xl":{"$type":"dimension","$value":{"value":1.25,"unit":"rem"}},
86
+ "control.icon-size.xs":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
87
+ "control.radius":{"$type":"dimension","$description":"The same at every size, as in Nuxt UI.","$value":{"value":6,"unit":"px"}},
88
+ "field.bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.098,0.0902,0.1412],"hex":"#191724","alpha":1}},
89
+ "field.border.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
90
+ "field.border.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.5647,0.549,0.6667],"hex":"#908caa","alpha":1}},
91
+ "field.border.invalid":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
92
+ "field.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
93
+ "field.error.font-weight":{"$type":"fontWeight","$value":500},
94
+ "field.error.icon":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
95
+ "field.error.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
96
+ "field.help.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.5647,0.549,0.6667],"hex":"#908caa","alpha":1}},
97
+ "field.icon":{"$type":"color","$description":"An icon in the field, such as a select's chevron.","$value":{"colorSpace":"srgb","components":[0.5647,0.549,0.6667],"hex":"#908caa","alpha":1}},
98
+ "field.label.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.8784,0.8706,0.9569],"hex":"#e0def4","alpha":1}},
99
+ "field.required.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9216,0.4353,0.5725],"hex":"#eb6f92","alpha":1}},
100
+ "field.text.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4314,0.4157,0.5255],"hex":"#6e6a86","alpha":1}},
101
+ "field.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.8784,0.8706,0.9569],"hex":"#e0def4","alpha":1}},
49
102
  "font.family.mono":{"$type":"fontFamily","$description":"The voice: headings, labels, navigation and code.","$value":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"]},
50
103
  "font.family.sans":{"$type":"fontFamily","$description":"Long-form text and form values.","$value":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"]},
51
104
  "font.line-height.loose":{"$type":"number","$value":1.75},
@@ -119,9 +172,14 @@ export const PERMUTATIONS = {
119
172
  "radius.xs":{"$type":"dimension","$description":"Key caps.","$value":{"value":3,"unit":"px"}},
120
173
  "size.check":{"$type":"dimension","$description":"A checkbox or a radio button.","$value":{"value":1.25,"unit":"rem"}},
121
174
  "size.content":{"$type":"dimension","$description":"Widest a column of long-form text gets, padding included.","$value":{"value":50,"unit":"rem"}},
122
- "size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control.","$value":{"value":2.5,"unit":"rem"}},
175
+ "size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control. The medium size, md, and the default.","$value":{"value":2.5,"unit":"rem"}},
176
+ "size.control-lg":{"$type":"dimension","$description":"Height of a one-line control of the large size, lg.","$value":{"value":2.75,"unit":"rem"}},
177
+ "size.control-sm":{"$type":"dimension","$description":"Height of a one-line control of the small size, sm.","$value":{"value":2,"unit":"rem"}},
178
+ "size.control-xl":{"$type":"dimension","$description":"Height of a one-line control of the extra large size, xl.","$value":{"value":3,"unit":"rem"}},
179
+ "size.control-xs":{"$type":"dimension","$description":"Height of a one-line control of the extra small size, xs.","$value":{"value":1.75,"unit":"rem"}},
123
180
  "size.frame":{"$type":"dimension","$description":"Widest a page frame gets.","$value":{"value":90,"unit":"rem"}},
124
181
  "size.icon":{"$type":"dimension","$description":"An icon next to text, such as a tick, the icon of a callout or a calendar.","$value":{"value":1,"unit":"rem"}},
182
+ "size.icon-lg":{"$type":"dimension","$description":"An icon in a control of the two large sizes, lg and xl.","$value":{"value":1.25,"unit":"rem"}},
125
183
  "size.outline":{"$type":"dimension","$description":"Page outline.","$value":{"value":15,"unit":"rem"}},
126
184
  "size.sidebar":{"$type":"dimension","$description":"Side navigation.","$value":{"value":17,"unit":"rem"}},
127
185
  "size.status-line":{"$type":"dimension","$description":"Height of the status line.","$value":{"value":2,"unit":"rem"}},
@@ -172,6 +230,26 @@ export const PERMUTATIONS = {
172
230
  "border-width.medium":{"$type":"dimension","$description":"Active markers and the focus ring.","$value":{"value":2,"unit":"px"}},
173
231
  "border-width.thick":{"$type":"dimension","$description":"The bar of a callout.","$value":{"value":3,"unit":"px"}},
174
232
  "border-width.thin":{"$type":"dimension","$description":"Dividers and outlines.","$value":{"value":1,"unit":"px"}},
233
+ "button.border.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
234
+ "button.danger.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"alpha":0.09,"hex":"#b4637a"}},
235
+ "button.danger.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"alpha":0.09,"hex":"#b4637a"}},
236
+ "button.danger.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"hex":"#b4637a","alpha":1}},
237
+ "button.danger.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
238
+ "button.ghost.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.949,0.9137,0.8824],"hex":"#f2e9e1","alpha":1}},
239
+ "button.ghost.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.949,0.9137,0.8824],"hex":"#f2e9e1","alpha":1}},
240
+ "button.ghost.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
241
+ "button.primary.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0,0.302,0.3961],"hex":"#004d65","alpha":1}},
242
+ "button.primary.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.0863,0.3569,0.4549],"hex":"#165b74","alpha":1}},
243
+ "button.primary.bg.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.1569,0.4118,0.5137],"hex":"#286983","alpha":1}},
244
+ "button.primary.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9804,0.9569,0.9294],"hex":"#faf4ed","alpha":1}},
245
+ "button.quiet.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.1569,0.4118,0.5137],"hex":"#286983","alpha":1}},
246
+ "button.secondary.bg.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.949,0.9137,0.8824],"hex":"#f2e9e1","alpha":1}},
247
+ "button.secondary.bg.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.949,0.9137,0.8824],"hex":"#f2e9e1","alpha":1}},
248
+ "button.secondary.border.active":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
249
+ "button.secondary.border.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
250
+ "button.secondary.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
251
+ "button.secondary.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
252
+ "button.text.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
175
253
  "code.bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.1216,0.1137,0.1804],"hex":"#1f1d2e","alpha":1}},
176
254
  "code.border":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.251,0.2392,0.3216],"hex":"#403d52","alpha":1}},
177
255
  "code.header-bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.098,0.0902,0.1412],"hex":"#191724","alpha":1}},
@@ -186,6 +264,7 @@ export const PERMUTATIONS = {
186
264
  "color.border-strong":{"$type":"color","$description":"Key caps.","$value":{"colorSpace":"srgb","components":[0.8078,0.7922,0.8039],"hex":"#cecacd","alpha":1}},
187
265
  "color.brand":{"$type":"color","$description":"The brand accent: tongue, cursor, prompt chevron, active markers. Graphics and large type.","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"hex":"#b4637a","alpha":1}},
188
266
  "color.brand-fill":{"$type":"color","$description":"Solid chip behind small text, such as the mode segment.","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
267
+ "color.brand-text":{"$type":"color","$description":"Brand red as small text, such as the required mark of a field. Love on dark; on light love 0.05 further from the page in OKLab lightness, so it reads at 4.5:1.","$value":{"colorSpace":"srgb","components":[0.6431,0.3294,0.4196],"hex":"#a4546b","alpha":1}},
189
268
  "color.danger":{"$type":"color","$description":"Status danger: field error border and bar.","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"hex":"#b4637a","alpha":1}},
190
269
  "color.danger-text":{"$type":"color","$description":"Status danger: label and error message text.","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
191
270
  "color.danger-tint":{"$type":"color","$description":"Status danger: block background.","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"alpha":0.09,"hex":"#b4637a"}},
@@ -212,6 +291,38 @@ export const PERMUTATIONS = {
212
291
  "color.warning":{"$type":"color","$description":"Status warning and \"experimental\": bar.","$value":{"colorSpace":"srgb","components":[0.9176,0.6157,0.2039],"hex":"#ea9d34","alpha":1}},
213
292
  "color.warning-text":{"$type":"color","$description":"Status warning: label text.","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
214
293
  "color.warning-tint":{"$type":"color","$description":"Status warning: block background.","$value":{"colorSpace":"srgb","components":[0.9176,0.6157,0.2039],"alpha":0.09,"hex":"#ea9d34"}},
294
+ "control.border-width.invalid":{"$type":"dimension","$value":{"value":2,"unit":"px"}},
295
+ "control.border-width.rest":{"$type":"dimension","$value":{"value":1,"unit":"px"}},
296
+ "control.gap.lg":{"$type":"dimension","$value":{"value":0.5,"unit":"rem"}},
297
+ "control.gap.md":{"$type":"dimension","$value":{"value":0.5,"unit":"rem"}},
298
+ "control.gap.sm":{"$type":"dimension","$value":{"value":0.375,"unit":"rem"}},
299
+ "control.gap.xl":{"$type":"dimension","$value":{"value":0.625,"unit":"rem"}},
300
+ "control.gap.xs":{"$type":"dimension","$value":{"value":0.375,"unit":"rem"}},
301
+ "control.height.lg":{"$type":"dimension","$value":{"value":2.75,"unit":"rem"}},
302
+ "control.height.md":{"$type":"dimension","$value":{"value":2.5,"unit":"rem"}},
303
+ "control.height.sm":{"$type":"dimension","$value":{"value":2,"unit":"rem"}},
304
+ "control.height.xl":{"$type":"dimension","$value":{"value":3,"unit":"rem"}},
305
+ "control.height.xs":{"$type":"dimension","$value":{"value":1.75,"unit":"rem"}},
306
+ "control.icon-size.lg":{"$type":"dimension","$value":{"value":1.25,"unit":"rem"}},
307
+ "control.icon-size.md":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
308
+ "control.icon-size.sm":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
309
+ "control.icon-size.xl":{"$type":"dimension","$value":{"value":1.25,"unit":"rem"}},
310
+ "control.icon-size.xs":{"$type":"dimension","$value":{"value":1,"unit":"rem"}},
311
+ "control.radius":{"$type":"dimension","$description":"The same at every size, as in Nuxt UI.","$value":{"value":6,"unit":"px"}},
312
+ "field.bg":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.9804,0.9569,0.9294],"hex":"#faf4ed","alpha":1}},
313
+ "field.border.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
314
+ "field.border.hover":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
315
+ "field.border.invalid":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"hex":"#b4637a","alpha":1}},
316
+ "field.border.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
317
+ "field.error.font-weight":{"$type":"fontWeight","$value":500},
318
+ "field.error.icon":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.7059,0.3882,0.4784],"hex":"#b4637a","alpha":1}},
319
+ "field.error.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
320
+ "field.help.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
321
+ "field.icon":{"$type":"color","$description":"An icon in the field, such as a select's chevron.","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
322
+ "field.label.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
323
+ "field.required.text":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.6431,0.3294,0.4196],"hex":"#a4546b","alpha":1}},
324
+ "field.text.disabled":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.4745,0.4588,0.5765],"hex":"#797593","alpha":1}},
325
+ "field.text.rest":{"$type":"color","$value":{"colorSpace":"srgb","components":[0.3412,0.3216,0.4745],"hex":"#575279","alpha":1}},
215
326
  "font.family.mono":{"$type":"fontFamily","$description":"The voice: headings, labels, navigation and code.","$value":["JetBrains Mono","ui-monospace","SFMono-Regular","Menlo","Consolas","monospace"]},
216
327
  "font.family.sans":{"$type":"fontFamily","$description":"Long-form text and form values.","$value":["Inter","system-ui","-apple-system","Segoe UI","sans-serif"]},
217
328
  "font.line-height.loose":{"$type":"number","$value":1.75},
@@ -285,9 +396,14 @@ export const PERMUTATIONS = {
285
396
  "radius.xs":{"$type":"dimension","$description":"Key caps.","$value":{"value":3,"unit":"px"}},
286
397
  "size.check":{"$type":"dimension","$description":"A checkbox or a radio button.","$value":{"value":1.25,"unit":"rem"}},
287
398
  "size.content":{"$type":"dimension","$description":"Widest a column of long-form text gets, padding included.","$value":{"value":50,"unit":"rem"}},
288
- "size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control.","$value":{"value":2.5,"unit":"rem"}},
399
+ "size.control":{"$type":"dimension","$description":"Height of a one-line field, a button and a segmented control. The medium size, md, and the default.","$value":{"value":2.5,"unit":"rem"}},
400
+ "size.control-lg":{"$type":"dimension","$description":"Height of a one-line control of the large size, lg.","$value":{"value":2.75,"unit":"rem"}},
401
+ "size.control-sm":{"$type":"dimension","$description":"Height of a one-line control of the small size, sm.","$value":{"value":2,"unit":"rem"}},
402
+ "size.control-xl":{"$type":"dimension","$description":"Height of a one-line control of the extra large size, xl.","$value":{"value":3,"unit":"rem"}},
403
+ "size.control-xs":{"$type":"dimension","$description":"Height of a one-line control of the extra small size, xs.","$value":{"value":1.75,"unit":"rem"}},
289
404
  "size.frame":{"$type":"dimension","$description":"Widest a page frame gets.","$value":{"value":90,"unit":"rem"}},
290
405
  "size.icon":{"$type":"dimension","$description":"An icon next to text, such as a tick, the icon of a callout or a calendar.","$value":{"value":1,"unit":"rem"}},
406
+ "size.icon-lg":{"$type":"dimension","$description":"An icon in a control of the two large sizes, lg and xl.","$value":{"value":1.25,"unit":"rem"}},
291
407
  "size.outline":{"$type":"dimension","$description":"Page outline.","$value":{"value":15,"unit":"rem"}},
292
408
  "size.sidebar":{"$type":"dimension","$description":"Side navigation.","$value":{"value":17,"unit":"rem"}},
293
409
  "size.status-line":{"$type":"dimension","$description":"Height of the status line.","$value":{"value":2,"unit":"rem"}},
package/docs/usage.md CHANGED
@@ -32,13 +32,12 @@ Or take pieces. `tokens.css` and `fonts.css` first, then what you use:
32
32
  | `@whatsaaaa/design-system/css/theme.css` | `ws-theme-dark` and `ws-theme-light`, for an element of one theme only |
33
33
  | `@whatsaaaa/design-system/css/ghost.css` | Styles of `<ws-ghost>` |
34
34
  | `@whatsaaaa/design-system/css/icons.css` | The icons the callouts and prompts draw, and the icons of a form: `--ws-icon-check`, the tick, and `--ws-icon-calendar`. Needed with `callout.css` and `terminal.css`, and for those |
35
- | `@whatsaaaa/design-system/css/nuxt-ui.css` | Deprecated, removed in 0.9.0. Nuxt UI's colors on the roles. Only in an app on Nuxt UI, after it: see With Tailwind CSS below |
36
35
 
37
- Everything is prefixed: classes with `ws-`, variables with `--ws-`. Only `nuxt-ui.css` sets variables of another prefix, Nuxt UI's `--ui-*`.
36
+ Everything is prefixed: classes with `ws-`, variables with `--ws-`.
38
37
 
39
38
  ### With Tailwind CSS
40
39
 
41
- An app on Tailwind CSS v4, such as one on Nuxt UI, imports the Tailwind entry in place of both `tailwindcss` and `index.css`. It goes first in the app's stylesheet, before the app's other imports and its own rules:
40
+ An app on Tailwind CSS v4 imports the Tailwind entry in place of both `tailwindcss` and `index.css`. It goes first in the app's stylesheet, before the app's other imports and its own rules:
42
41
 
43
42
  ```css
44
43
  @import '@whatsaaaa/design-system/tailwind.css';
@@ -48,22 +47,7 @@ An app on Tailwind CSS v4, such as one on Nuxt UI, imports the Tailwind entry in
48
47
 
49
48
  Install `tailwindcss` 4.3.5 or a later 4.x next to the package. Only this entry needs it.
50
49
 
51
- The entry gives Nuxt UI the system's fonts, weights, radii and spacing, but not its colors. Nuxt UI takes its colors from its own `--ui-*` variables, which fall back to its green and slate, and without `--ui-bg` it paints the body in its own background. `css/nuxt-ui.css` points them at the roles.
52
-
53
- `css/nuxt-ui.css` is deprecated and is removed in 0.9.0. An app on Nuxt UI gets it from ui-vue, which `@whatsaaaa/ui-vue/index.css` brings, and imports none of the lines below. An app that imports it directly copies the file from 0.8.3 into its own stylesheets and imports that copy in its place.
54
-
55
- It is not in the entry, as it has to come after Nuxt UI, so an app on Nuxt UI without ui-vue imports it last, until 0.9.0:
56
-
57
- ```css
58
- @import '@whatsaaaa/design-system/tailwind.css';
59
- @import '@nuxt/ui';
60
- @import '@whatsaaaa/design-system/tailwind/variants.css';
61
- @import '@whatsaaaa/design-system/css/nuxt-ui.css';
62
- ```
63
-
64
- It sets them outside any layer, so they win over Nuxt UI's own, which it keeps in its theme layer and in a style it adds at runtime. A variable takes the role's value where it is set, so it sets them on `:root`, which follows the system, and again on every element that chooses a theme, with `data-theme` or the `dark` or `light` class, where Nuxt UI sets its own. The primary color is `--ws-color-interactive`, success, info, warning and error are tip, note, warning and danger, and `secondary` has no role, so it is left out. A step the system has no role for, such as `--ui-bg-accented` or a shade of a color other than 500, is mixed from the roles around it in oklab: a color's shades run from the page at 50 through the color at 500 to the text at 950, so a low shade is a faint tint in both themes. It also sets `--ui-radius` to `--ws-radius-sm`, and `--ui-header-height` to the height of the tab bar, 3rem where Nuxt UI's own is 4rem. Nuxt UI makes its headers that tall: the app's `UHeader`, a dashboard's navbar and the header of its sidebar, and at least the header of a modal, a slideover or a sidebar. It also leaves room for the app's header by it: `UMain` and `UError` are at least the height of the window less it, and `UPageAside`, `UContentToc` and a heading scrolled to stop below it.
65
-
66
- To change one of them, set it after the import, outside any layer, on the same selectors: `:root, :host, [data-theme], .dark, .light`. On `:root` alone it holds only where no element around chooses a theme, as the stylesheet sets its own value again on each one that does.
50
+ An app on Nuxt UI imports `@whatsaaaa/ui-vue/index.css` alone, in place of the three lines above: it brings them, and Nuxt UI's colors on the roles.
67
51
 
68
52
  The entry brings Tailwind and everything `index.css` brings, in cascade layers, so a utility wins over a class of the system and the app's rules outside any layer win over both:
69
53
 
@@ -128,14 +112,14 @@ Rules:
128
112
 
129
113
  - **Brand is not for controls.** What you press, and its hover, focus and checked states, uses `--ws-color-interactive`: buttons, links, the focus ring, checked boxes. `--ws-color-brand` is the accent: the mark, the cursor, a prompt's chevron, and the marks of where you are, such as the bar and number of the current tab and the mode of the status line. A mark of where you are may sit on a control, as on the current tab, because it says where you are, not what to press. So the current step of a form takes brand too: its number in `--ws-color-on-brand` on `--ws-color-brand-fill`.
130
114
  - **An error uses the danger tokens, not brand.** A field in error takes `--ws-color-danger` for its border and its icon, and its message `--ws-color-danger-text`. On the dark theme they have the value of brand, but they are other roles: on the light theme brand is too light for small text, and the message takes the text color.
131
- - **Brand is for graphics and large type.** For small text on the brand color use `--ws-color-on-brand` on `--ws-color-brand-fill`.
115
+ - **Brand is for graphics and large type.** For small text on the brand color use `--ws-color-on-brand` on `--ws-color-brand-fill`. For small text in the brand red, such as the required mark of a field, use `--ws-color-brand-text`, which reads at 4.5:1 in both themes.
132
116
  - **Faint is never body text.** `--ws-color-text-faint` is 3:1.
133
117
  - **Status text uses the `-text` token**, not the status color. On the light theme the two differ.
134
118
  - **A status is never color alone.** Give it a label, an icon or a word.
135
119
  - **Code blocks are dark in both themes.** Use `--ws-code-*` and `--ws-syntax-*` for them, not the roles.
136
120
  - **No placeholders in fields.** Put the hint under the field.
137
121
 
138
- The pairs that are checked for contrast are in `tokens/contrast.json`. If you need a new pair, add it there.
122
+ The pairs that are checked for contrast are in `tokens/contrast.json`, and those of the component tokens of section 12 follow from their names. If you need a new pair, add it there.
139
123
 
140
124
  ## 3. Theme
141
125
 
@@ -239,7 +223,7 @@ Do not load other fonts, and do not load these from a CDN. Set `font-variant-lig
239
223
 
240
224
  - Space: `--ws-space-2` to `--ws-space-64`, named by px, set in rem. Use them for padding, margin and gap.
241
225
  - The gutter of a phone is `--ws-space-16`. Below 64rem the tab bar starts its brand that far in from the window's edge, and ends its end that far from the other. Pad what is under it by the same, a pane, a page or a form, and its content starts at the pixel the brand starts at. From 64rem a pane takes the padding of its own design.
242
- - Sizes: `--ws-size-control` (40 px) is the height of a one-line field, a button and a segmented control. `--ws-size-check` (20 px) is a checkbox or a radio button, `--ws-size-step` (24 px) the circle of a step number and `--ws-size-icon` (16 px) an icon next to text. Use them for those, not a space token.
226
+ - Sizes: `--ws-size-control` (40 px) is the height of a one-line field, a button and a segmented control. `--ws-size-check` (20 px) is a checkbox or a radio button, `--ws-size-step` (24 px) the circle of a step number and `--ws-size-icon` (16 px) an icon next to text. Use them for those, not a space token. A control of another size takes its height and its icon size from the component tokens of section 12.
243
227
  - Radius: `--ws-radius-xs` (key caps), `-sm` (inline code, tags), `-md` (inputs, buttons), `-lg` (blocks, cards), `-xl` (the window), `-full` (dots).
244
228
  - Borders, not shadows: `--ws-border-width-thin`, `-medium`, `-thick`.
245
229
  - Motion: `--ws-motion-duration-fast`, `-base`, `-slow` with `--ws-motion-easing-standard`. Wrap movement in `@media (prefers-reduced-motion: no-preference)`.
@@ -282,7 +266,7 @@ The markup of each piece is in the comment above its rules, in its stylesheet in
282
266
 
283
267
  ### Forms
284
268
 
285
- The system draws no fields and no buttons: draw them from the roles, with these.
269
+ The system draws no fields and no buttons: draw them as the specs of section 12 say, from the roles and the component tokens, with these.
286
270
 
287
271
  - **One height.** A one-line field, a button and a segmented control are `--ws-size-control` tall. A checkbox or a radio button is `--ws-size-check`, a step number's circle `--ws-size-step`.
288
272
  - **Rows of fields.** Fields that belong together, such as a date and a time, may share a row from 40rem up. Below it, `@media (width < 40rem)`, each takes a line of its own.
@@ -475,6 +459,51 @@ dark['color.bg'].$value.hex // '#191724'
475
459
 
476
460
  The sources are in `tokens/`, in the Design Tokens Community Group format.
477
461
 
462
+ ## 12. Components: specs and the tier
463
+
464
+ The system draws no components: it specifies them, and an implementation draws them, such as ui-vue on Nuxt UI, ui-react on shadcn/ui with Radix, or an app that draws its own fields. Two things hold them alike.
465
+
466
+ **Specs.** Each component has a spec, `specs/<component>.spec.json`, in the package as `@whatsaaaa/design-system/specs/button.spec.json`, checked against `specs/spec.schema.json`. Its state table is the whole mapping: for each kind, state and part, the token each CSS property takes, or a value the system writes without a token. A state lists what it changes from rest:
467
+
468
+ ```json
469
+ {
470
+ "variant": "primary",
471
+ "state": "hover",
472
+ "part": "root",
473
+ "property": "background-color",
474
+ "token": "button.primary.bg.hover"
475
+ }
476
+ ```
477
+
478
+ A token id reads as its variable, `--ws-button-primary-bg-hover`, and a text style on a font property as that part of it: `text.label` on `font-size` is `--ws-text-label-font-size`. The states are one closed list, the one the component tokens end in: `rest`, `hover`, `active`, `focus`, `disabled`, `checked`, `indeterminate`, `invalid`, `open`, `selected`, `current`, `loading`. A spec also names its parts, which are the `data-slot` of each part or what an implementation maps them to, its kinds and sizes, its keys and accessibility rules, the Lucide names of the icons it draws, and its gallery contract: the examples a gallery shows, each marked with its id in `data-spec`, `button.primary.hover`, and `.<size>` at the end for a size other than the default. The specs so far, both drafts: `button` (primary, secondary, ghost, quiet and danger, in the five sizes) and `input` (the field with its label, help and error). Each has a page in the style guide, drawn from its file.
479
+
480
+ Draw a component the system specifies as its spec says, and read the spec in a test where you can, rather than copying values from it.
481
+
482
+ **The component tier.** Where every implementation has to make the same decision, a spec's row names a component token. Each is an alias of a role or a measure, and follows the theme as the roles do, in a part held in the other theme too. Three groups so far:
483
+
484
+ - `--ws-control-*`, every one-line control: a button, a field, a select's trigger. For each of the five sizes, `xs`, `sm`, `md` (the default), `lg` and `xl`: `--ws-control-height-<size>`, `--ws-control-gap-<size>` between the icon and the label or value, and `--ws-control-icon-size-<size>`. At every size `--ws-control-radius`, and the edge `--ws-control-border-width-rest`, `-invalid` with an error.
485
+ - `--ws-field-*`, a text field, a select and a select menu: `--ws-field-bg`, the value `--ws-field-text-rest` and `-disabled`, the edge `--ws-field-border-rest`, `-hover`, `-invalid` and `-disabled`, an icon in it `--ws-field-icon`, and around it `--ws-field-label-text`, `--ws-field-help-text`, `--ws-field-error-text` with `--ws-field-error-icon` and `--ws-field-error-font-weight`, and `--ws-field-required-text` for the asterisk.
486
+ - `--ws-button-*`, the colors of each kind of button: `--ws-button-<kind>-<bg|border|text>-<state>`, such as `--ws-button-primary-bg-hover` or `--ws-button-danger-border-rest`, for the kinds `primary`, `secondary`, `ghost`, `quiet` and `danger`, and `--ws-button-text-disabled` and `--ws-button-border-disabled` for a disabled button of every kind. Danger is an outline in both themes. A button's height, gap, radius and icon size are the control's.
487
+
488
+ Read them by name, where the control is drawn, and they keep in step with the system:
489
+
490
+ ```css
491
+ .field {
492
+ height: var(--ws-control-height-md);
493
+ border: var(--ws-control-border-width-rest) solid var(--ws-field-border-rest);
494
+ border-radius: var(--ws-control-radius);
495
+ background: var(--ws-field-bg);
496
+ color: var(--ws-field-text-rest);
497
+ }
498
+
499
+ .field[aria-invalid='true'] {
500
+ border-color: var(--ws-field-border-invalid);
501
+ border-width: var(--ws-control-border-width-invalid);
502
+ }
503
+ ```
504
+
505
+ They are not in Tailwind's theme, so no other element takes a field's color by accident. With Tailwind, read them with the variable shorthand: `h-(--ws-control-height-md) rounded-(--ws-control-radius) border-(--ws-field-border-rest) hover:bg-(--ws-button-secondary-bg-hover)`. The tokens are in `tokens/components/`, one file per group, and in the data of section 11. Every one of them is read by a spec.
506
+
478
507
  ## Before you finish
479
508
 
480
509
  - No hex values, no `--ws-palette-*` in interface code, no fonts from elsewhere.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatsaaaa/design-system",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Whatsaaaa's design system: brand identity, design tokens, typography, docs theme and asset kit",
5
5
  "homepage": "https://github.com/whatsaaaa/design-system#readme",
6
6
  "bugs": "https://github.com/whatsaaaa/design-system/issues",
@@ -15,6 +15,7 @@
15
15
  "dist",
16
16
  "docs/usage.md",
17
17
  "licenses",
18
+ "specs",
18
19
  "src/vitepress",
19
20
  "tokens"
20
21
  ],
@@ -36,6 +37,7 @@
36
37
  "default": "./dist/tokens.js"
37
38
  },
38
39
  "./tokens/*.json": "./tokens/*.json",
40
+ "./specs/*.json": "./specs/*.json",
39
41
  "./ghost": {
40
42
  "types": "./dist/ghost/index.d.ts",
41
43
  "default": "./dist/ghost/index.js"
@@ -94,6 +96,7 @@
94
96
  "@types/node": "^24.19.2",
95
97
  "@types/opentype.js": "^1.3.10",
96
98
  "@vue/eslint-config-typescript": "^14.9.0",
99
+ "ajv": "^8.20.0",
97
100
  "culori": "^4.0.2",
98
101
  "eslint": "^10.14.0",
99
102
  "eslint-config-prettier": "^10.1.8",