@yahoo/uds-create-config 1.1.1

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 (130) hide show
  1. package/dist/AssetGroup.d.ts +77 -0
  2. package/dist/AssetGroup.js +125 -0
  3. package/dist/Component.d.ts +308 -0
  4. package/dist/Component.js +896 -0
  5. package/dist/ComponentGroup.d.ts +20 -0
  6. package/dist/ComponentGroup.js +46 -0
  7. package/dist/CompositeStyle.d.ts +27 -0
  8. package/dist/CompositeStyle.js +52 -0
  9. package/dist/Config.d.ts +423 -0
  10. package/dist/Config.js +1429 -0
  11. package/dist/Mode.d.ts +41 -0
  12. package/dist/Mode.js +81 -0
  13. package/dist/Modifier.d.ts +51 -0
  14. package/dist/Modifier.js +97 -0
  15. package/dist/MotionDef.d.ts +49 -0
  16. package/dist/MotionDef.js +97 -0
  17. package/dist/Props.d.ts +317 -0
  18. package/dist/Props.js +35 -0
  19. package/dist/Provider.d.ts +20 -0
  20. package/dist/Provider.js +14 -0
  21. package/dist/StyleProp.d.ts +112 -0
  22. package/dist/StyleProp.js +197 -0
  23. package/dist/Token.d.ts +55 -0
  24. package/dist/Token.js +112 -0
  25. package/dist/TokenGroup.d.ts +32 -0
  26. package/dist/TokenGroup.js +68 -0
  27. package/dist/asset-kind.d.ts +55 -0
  28. package/dist/asset-kind.js +29 -0
  29. package/dist/brands.d.ts +30 -0
  30. package/dist/brands.js +20 -0
  31. package/dist/captureCallerPath.d.ts +48 -0
  32. package/dist/captureCallerPath.js +95 -0
  33. package/dist/colorExpressions.d.ts +131 -0
  34. package/dist/colorExpressions.js +148 -0
  35. package/dist/defineAssetGroup.d.ts +166 -0
  36. package/dist/defineAssetGroup.js +264 -0
  37. package/dist/defineProvider.d.ts +29 -0
  38. package/dist/defineProvider.js +60 -0
  39. package/dist/element-marker.d.ts +54 -0
  40. package/dist/element-marker.js +113 -0
  41. package/dist/entity-utils.d.ts +56 -0
  42. package/dist/entity-utils.js +105 -0
  43. package/dist/factories.d.ts +707 -0
  44. package/dist/factories.js +393 -0
  45. package/dist/foreign-component-name.d.ts +21 -0
  46. package/dist/foreign-component-name.js +42 -0
  47. package/dist/index.d.ts +32 -0
  48. package/dist/index.js +28 -0
  49. package/dist/interpolate.d.ts +20 -0
  50. package/dist/interpolate.js +10 -0
  51. package/dist/jsx/__fixtures__/cross-component-preview.d.ts +3 -0
  52. package/dist/jsx/__fixtures__/cross-component-preview.js +15 -0
  53. package/dist/jsx/jsx-dev-runtime.d.ts +15 -0
  54. package/dist/jsx/jsx-dev-runtime.js +11 -0
  55. package/dist/jsx/jsx-runtime.d.ts +48 -0
  56. package/dist/jsx/jsx-runtime.js +305 -0
  57. package/dist/markers.d.ts +217 -0
  58. package/dist/markers.js +67 -0
  59. package/dist/refs.d.ts +158 -0
  60. package/dist/refs.js +104 -0
  61. package/dist/renderer/RendererErrorBoundary.d.ts +26 -0
  62. package/dist/renderer/RendererErrorBoundary.js +30 -0
  63. package/dist/renderer/UdsRenderer.d.ts +80 -0
  64. package/dist/renderer/UdsRenderer.js +33 -0
  65. package/dist/renderer/assetRenderable.d.ts +13 -0
  66. package/dist/renderer/assetRenderable.js +13 -0
  67. package/dist/renderer/index.d.ts +14 -0
  68. package/dist/renderer/index.js +14 -0
  69. package/dist/renderer/makeRegistry.d.ts +34 -0
  70. package/dist/renderer/makeRegistry.js +52 -0
  71. package/dist/renderer/makeUdsRenderer.d.ts +29 -0
  72. package/dist/renderer/makeUdsRenderer.js +35 -0
  73. package/dist/renderer/primitives/FragmentRenderer.d.ts +12 -0
  74. package/dist/renderer/primitives/FragmentRenderer.js +11 -0
  75. package/dist/renderer/primitives/SlotRenderer.d.ts +21 -0
  76. package/dist/renderer/primitives/SlotRenderer.js +20 -0
  77. package/dist/renderer/wrapRegistry.d.ts +64 -0
  78. package/dist/renderer/wrapRegistry.js +39 -0
  79. package/dist/renderer/wrappers/component-slots.d.ts +41 -0
  80. package/dist/renderer/wrappers/component-slots.js +66 -0
  81. package/dist/renderer/wrappers/event-bridge.d.ts +20 -0
  82. package/dist/renderer/wrappers/event-bridge.js +78 -0
  83. package/dist/renderer/wrappers/hex-normalize.d.ts +14 -0
  84. package/dist/renderer/wrappers/hex-normalize.js +35 -0
  85. package/dist/renderer/wrappers/html-aliases.d.ts +24 -0
  86. package/dist/renderer/wrappers/html-aliases.js +62 -0
  87. package/dist/renderer/wrappers/inline-styles.d.ts +16 -0
  88. package/dist/renderer/wrappers/inline-styles.js +104 -0
  89. package/dist/renderer/wrappers/slot-resolution.d.ts +25 -0
  90. package/dist/renderer/wrappers/slot-resolution.js +68 -0
  91. package/dist/renderer/wrappers/void-elements.d.ts +23 -0
  92. package/dist/renderer/wrappers/void-elements.js +28 -0
  93. package/dist/spec/apply-forced-modifiers.d.ts +19 -0
  94. package/dist/spec/apply-forced-modifiers.js +49 -0
  95. package/dist/spec/asset-jsx.d.ts +48 -0
  96. package/dist/spec/asset-jsx.js +48 -0
  97. package/dist/spec/collapse-text-labels.d.ts +44 -0
  98. package/dist/spec/collapse-text-labels.js +107 -0
  99. package/dist/spec/empty-node-slots.d.ts +51 -0
  100. package/dist/spec/empty-node-slots.js +141 -0
  101. package/dist/spec/index.d.ts +10 -0
  102. package/dist/spec/index.js +10 -0
  103. package/dist/spec/jsxToSpec.d.ts +48 -0
  104. package/dist/spec/jsxToSpec.js +506 -0
  105. package/dist/spec/layer-props.d.ts +52 -0
  106. package/dist/spec/layer-props.js +149 -0
  107. package/dist/spec/preview-controls.d.ts +44 -0
  108. package/dist/spec/preview-controls.js +139 -0
  109. package/dist/spec/slot-refs.d.ts +39 -0
  110. package/dist/spec/slot-refs.js +56 -0
  111. package/dist/spec/specToJsx.d.ts +35 -0
  112. package/dist/spec/specToJsx.js +127 -0
  113. package/dist/token-override-rows.d.ts +66 -0
  114. package/dist/token-override-rows.js +223 -0
  115. package/dist/tokenValueType.d.ts +34 -0
  116. package/dist/tokenValueType.js +138 -0
  117. package/dist/tsconfig.tsbuildinfo +1 -0
  118. package/dist/types/css-properties.d.ts +232 -0
  119. package/dist/types/css-properties.js +14 -0
  120. package/dist/types/css-property-keywords.d.ts +156 -0
  121. package/dist/types/css-property-keywords.js +616 -0
  122. package/dist/types/css-values.d.ts +63 -0
  123. package/dist/types/css-values.js +16 -0
  124. package/dist/types.d.ts +708 -0
  125. package/dist/types.js +12 -0
  126. package/dist/units.d.ts +14 -0
  127. package/dist/units.js +16 -0
  128. package/dist/utils/index.d.ts +4 -0
  129. package/dist/utils/index.js +4 -0
  130. package/package.json +81 -0
@@ -0,0 +1,616 @@
1
+ //#region src/types/css-property-keywords.ts
2
+ /**
3
+ * Single source of truth for CSS keyword enums.
4
+ *
5
+ * These hand-authored runtime arrays list every plain string-literal
6
+ * keyword each CSS property accepts. The type unions in
7
+ * `./css-properties.ts` are DERIVED from these tuples
8
+ * (`(typeof CSS_PROPERTY_KEYWORDS)['<prop>'][number]`), so the keyword
9
+ * data lives in exactly one place and is available at runtime — Studio
10
+ * and other consumers can import the arrays directly instead of
11
+ * re-declaring a parallel hardcoded map.
12
+ *
13
+ * Scope: only concrete keyword literals belong here. Value-type aliases
14
+ * (lengths, percentages, numbers, colors, `CssVarRef`, intrinsic-size
15
+ * keywords expressed via shared aliases, template-literal/number types,
16
+ * bare `string`) stay in `css-properties.ts` and are NOT transcribed.
17
+ * Properties whose union is purely value-typed (e.g. `flex-grow`) get no
18
+ * entry here.
19
+ */
20
+ /** The CSS-wide keyword set, available as a runtime array. */
21
+ const CSS_GLOBAL_KEYWORDS = [
22
+ "inherit",
23
+ "initial",
24
+ "unset",
25
+ "revert",
26
+ "revert-layer"
27
+ ];
28
+ /**
29
+ * Per-property keyword tuples. Each tuple holds, in source order, every
30
+ * plain string-literal keyword that property's union in
31
+ * `css-properties.ts` lists.
32
+ */
33
+ const CSS_PROPERTY_KEYWORDS = {
34
+ margin: ["auto"],
35
+ "margin-top": ["auto"],
36
+ "margin-right": ["auto"],
37
+ "margin-bottom": ["auto"],
38
+ "margin-left": ["auto"],
39
+ "margin-block": ["auto"],
40
+ "margin-inline": ["auto"],
41
+ "margin-inline-start": ["auto"],
42
+ "margin-inline-end": ["auto"],
43
+ top: ["auto"],
44
+ right: ["auto"],
45
+ bottom: ["auto"],
46
+ left: ["auto"],
47
+ inset: ["auto"],
48
+ "inset-block": ["auto"],
49
+ "inset-inline": ["auto"],
50
+ "inset-inline-start": ["auto"],
51
+ "inset-inline-end": ["auto"],
52
+ "inset-block-start": ["auto"],
53
+ "inset-block-end": ["auto"],
54
+ "max-width": ["none"],
55
+ "max-height": ["none"],
56
+ "border-width": [
57
+ "thin",
58
+ "medium",
59
+ "thick"
60
+ ],
61
+ "border-top-width": [
62
+ "thin",
63
+ "medium",
64
+ "thick"
65
+ ],
66
+ "border-right-width": [
67
+ "thin",
68
+ "medium",
69
+ "thick"
70
+ ],
71
+ "border-bottom-width": [
72
+ "thin",
73
+ "medium",
74
+ "thick"
75
+ ],
76
+ "border-left-width": [
77
+ "thin",
78
+ "medium",
79
+ "thick"
80
+ ],
81
+ "border-block-width": [
82
+ "thin",
83
+ "medium",
84
+ "thick"
85
+ ],
86
+ "border-inline-width": [
87
+ "thin",
88
+ "medium",
89
+ "thick"
90
+ ],
91
+ "border-inline-start-width": [
92
+ "thin",
93
+ "medium",
94
+ "thick"
95
+ ],
96
+ "border-inline-end-width": [
97
+ "thin",
98
+ "medium",
99
+ "thick"
100
+ ],
101
+ "outline-width": [
102
+ "thin",
103
+ "medium",
104
+ "thick"
105
+ ],
106
+ "border-style": [
107
+ "none",
108
+ "hidden",
109
+ "dotted",
110
+ "dashed",
111
+ "solid",
112
+ "double",
113
+ "groove",
114
+ "ridge",
115
+ "inset",
116
+ "outset"
117
+ ],
118
+ "border-top-style": [
119
+ "none",
120
+ "hidden",
121
+ "dotted",
122
+ "dashed",
123
+ "solid",
124
+ "double",
125
+ "groove",
126
+ "ridge",
127
+ "inset",
128
+ "outset"
129
+ ],
130
+ "border-bottom-style": [
131
+ "none",
132
+ "hidden",
133
+ "dotted",
134
+ "dashed",
135
+ "solid",
136
+ "double",
137
+ "groove",
138
+ "ridge",
139
+ "inset",
140
+ "outset"
141
+ ],
142
+ "border-inline-start-style": [
143
+ "none",
144
+ "hidden",
145
+ "dotted",
146
+ "dashed",
147
+ "solid",
148
+ "double",
149
+ "groove",
150
+ "ridge",
151
+ "inset",
152
+ "outset"
153
+ ],
154
+ "border-inline-end-style": [
155
+ "none",
156
+ "hidden",
157
+ "dotted",
158
+ "dashed",
159
+ "solid",
160
+ "double",
161
+ "groove",
162
+ "ridge",
163
+ "inset",
164
+ "outset"
165
+ ],
166
+ "outline-style": [
167
+ "none",
168
+ "hidden",
169
+ "dotted",
170
+ "dashed",
171
+ "solid",
172
+ "double",
173
+ "groove",
174
+ "ridge",
175
+ "inset",
176
+ "outset",
177
+ "auto"
178
+ ],
179
+ "text-decoration-style": [
180
+ "solid",
181
+ "double",
182
+ "dotted",
183
+ "dashed",
184
+ "wavy"
185
+ ],
186
+ "text-decoration-thickness": ["auto", "from-font"],
187
+ "text-underline-offset": ["auto"],
188
+ "outline-color": ["invert"],
189
+ "caret-color": ["auto"],
190
+ fill: [
191
+ "none",
192
+ "context-fill",
193
+ "context-stroke"
194
+ ],
195
+ stroke: [
196
+ "none",
197
+ "context-fill",
198
+ "context-stroke"
199
+ ],
200
+ "scrollbar-color": ["auto"],
201
+ "font-size": [
202
+ "xx-small",
203
+ "x-small",
204
+ "small",
205
+ "medium",
206
+ "large",
207
+ "x-large",
208
+ "xx-large",
209
+ "smaller",
210
+ "larger"
211
+ ],
212
+ "font-style": [
213
+ "normal",
214
+ "italic",
215
+ "oblique"
216
+ ],
217
+ "font-stretch": [
218
+ "normal",
219
+ "ultra-condensed",
220
+ "extra-condensed",
221
+ "condensed",
222
+ "semi-condensed",
223
+ "semi-expanded",
224
+ "expanded",
225
+ "extra-expanded",
226
+ "ultra-expanded"
227
+ ],
228
+ "line-height": ["normal"],
229
+ "letter-spacing": ["normal"],
230
+ "text-align": [
231
+ "left",
232
+ "right",
233
+ "center",
234
+ "justify",
235
+ "start",
236
+ "end"
237
+ ],
238
+ "text-transform": [
239
+ "none",
240
+ "capitalize",
241
+ "uppercase",
242
+ "lowercase",
243
+ "full-width",
244
+ "full-size-kana"
245
+ ],
246
+ "text-wrap": [
247
+ "wrap",
248
+ "nowrap",
249
+ "balance",
250
+ "pretty",
251
+ "stable"
252
+ ],
253
+ "text-overflow": ["clip", "ellipsis"],
254
+ "text-decoration-line": [
255
+ "none",
256
+ "underline",
257
+ "overline",
258
+ "line-through",
259
+ "blink"
260
+ ],
261
+ "text-shadow": ["none"],
262
+ "white-space": [
263
+ "normal",
264
+ "nowrap",
265
+ "pre",
266
+ "pre-wrap",
267
+ "pre-line",
268
+ "break-spaces"
269
+ ],
270
+ "word-break": [
271
+ "normal",
272
+ "break-all",
273
+ "keep-all",
274
+ "break-word"
275
+ ],
276
+ "overflow-wrap": [
277
+ "normal",
278
+ "break-word",
279
+ "anywhere"
280
+ ],
281
+ hyphens: [
282
+ "none",
283
+ "manual",
284
+ "auto"
285
+ ],
286
+ "list-style-image": ["none"],
287
+ "list-style-position": ["inside", "outside"],
288
+ "vertical-align": [
289
+ "baseline",
290
+ "sub",
291
+ "super",
292
+ "text-top",
293
+ "text-bottom",
294
+ "middle",
295
+ "top",
296
+ "bottom"
297
+ ],
298
+ "-webkit-font-smoothing": [
299
+ "auto",
300
+ "none",
301
+ "antialiased",
302
+ "subpixel-antialiased"
303
+ ],
304
+ "-webkit-line-clamp": ["none"],
305
+ display: [
306
+ "block",
307
+ "inline",
308
+ "inline-block",
309
+ "flex",
310
+ "inline-flex",
311
+ "grid",
312
+ "inline-grid",
313
+ "flow-root",
314
+ "none",
315
+ "contents",
316
+ "table",
317
+ "inline-table",
318
+ "table-row-group",
319
+ "table-header-group",
320
+ "table-footer-group",
321
+ "table-row",
322
+ "table-cell",
323
+ "table-column-group",
324
+ "table-column",
325
+ "table-caption",
326
+ "list-item"
327
+ ],
328
+ visibility: [
329
+ "visible",
330
+ "hidden",
331
+ "collapse"
332
+ ],
333
+ isolation: ["auto", "isolate"],
334
+ position: [
335
+ "static",
336
+ "relative",
337
+ "absolute",
338
+ "fixed",
339
+ "sticky"
340
+ ],
341
+ "box-sizing": ["content-box", "border-box"],
342
+ "container-type": [
343
+ "normal",
344
+ "size",
345
+ "inline-size"
346
+ ],
347
+ columns: ["auto"],
348
+ flex: [
349
+ "none",
350
+ "auto",
351
+ "initial"
352
+ ],
353
+ "flex-direction": [
354
+ "row",
355
+ "row-reverse",
356
+ "column",
357
+ "column-reverse"
358
+ ],
359
+ "flex-wrap": [
360
+ "nowrap",
361
+ "wrap",
362
+ "wrap-reverse"
363
+ ],
364
+ "flex-basis": ["content"],
365
+ "justify-content": [
366
+ "flex-start",
367
+ "flex-end",
368
+ "start",
369
+ "end",
370
+ "center",
371
+ "space-between",
372
+ "space-around",
373
+ "space-evenly",
374
+ "stretch",
375
+ "normal",
376
+ "left",
377
+ "right"
378
+ ],
379
+ "align-items": [
380
+ "normal",
381
+ "stretch",
382
+ "center",
383
+ "start",
384
+ "end",
385
+ "flex-start",
386
+ "flex-end",
387
+ "self-start",
388
+ "self-end",
389
+ "baseline",
390
+ "first baseline",
391
+ "last baseline"
392
+ ],
393
+ "align-content": [
394
+ "normal",
395
+ "start",
396
+ "end",
397
+ "center",
398
+ "flex-start",
399
+ "flex-end",
400
+ "space-between",
401
+ "space-around",
402
+ "space-evenly",
403
+ "stretch",
404
+ "baseline"
405
+ ],
406
+ "align-self": [
407
+ "auto",
408
+ "normal",
409
+ "stretch",
410
+ "center",
411
+ "start",
412
+ "end",
413
+ "flex-start",
414
+ "flex-end",
415
+ "self-start",
416
+ "self-end",
417
+ "baseline"
418
+ ],
419
+ "grid-template-columns": ["none"],
420
+ "grid-template-rows": ["none"],
421
+ "grid-column": ["auto"],
422
+ "grid-column-start": ["auto"],
423
+ "grid-column-end": ["auto"],
424
+ "grid-row": ["auto"],
425
+ "grid-row-start": ["auto"],
426
+ "grid-row-end": ["auto"],
427
+ transform: ["none"],
428
+ rotate: ["none"],
429
+ scale: ["none"],
430
+ translate: ["none"],
431
+ transition: ["none"],
432
+ "transition-property": ["none", "all"],
433
+ "transition-behavior": ["normal", "allow-discrete"],
434
+ animation: ["none"],
435
+ "box-shadow": ["none"],
436
+ filter: ["none"],
437
+ "backdrop-filter": ["none"],
438
+ "mix-blend-mode": [
439
+ "normal",
440
+ "multiply",
441
+ "screen",
442
+ "overlay",
443
+ "darken",
444
+ "lighten",
445
+ "color-dodge",
446
+ "color-burn",
447
+ "hard-light",
448
+ "soft-light",
449
+ "difference",
450
+ "exclusion",
451
+ "hue",
452
+ "saturation",
453
+ "color",
454
+ "luminosity",
455
+ "plus-darker",
456
+ "plus-lighter"
457
+ ],
458
+ "background-blend-mode": [
459
+ "normal",
460
+ "multiply",
461
+ "screen",
462
+ "overlay",
463
+ "darken",
464
+ "lighten",
465
+ "color-dodge",
466
+ "color-burn",
467
+ "hard-light",
468
+ "soft-light",
469
+ "difference",
470
+ "exclusion",
471
+ "hue",
472
+ "saturation",
473
+ "color",
474
+ "luminosity"
475
+ ],
476
+ overflow: [
477
+ "visible",
478
+ "hidden",
479
+ "clip",
480
+ "scroll",
481
+ "auto"
482
+ ],
483
+ "overflow-x": [
484
+ "visible",
485
+ "hidden",
486
+ "clip",
487
+ "scroll",
488
+ "auto"
489
+ ],
490
+ "overflow-y": [
491
+ "visible",
492
+ "hidden",
493
+ "clip",
494
+ "scroll",
495
+ "auto"
496
+ ],
497
+ "overscroll-behavior": [
498
+ "auto",
499
+ "contain",
500
+ "none"
501
+ ],
502
+ "scroll-behavior": ["auto", "smooth"],
503
+ "scroll-snap-align": [
504
+ "none",
505
+ "start",
506
+ "end",
507
+ "center"
508
+ ],
509
+ "scroll-snap-stop": ["normal", "always"],
510
+ "scroll-snap-type": ["none"],
511
+ "scrollbar-width": [
512
+ "auto",
513
+ "thin",
514
+ "none"
515
+ ],
516
+ cursor: [
517
+ "auto",
518
+ "default",
519
+ "none",
520
+ "context-menu",
521
+ "help",
522
+ "pointer",
523
+ "progress",
524
+ "wait",
525
+ "cell",
526
+ "crosshair",
527
+ "text",
528
+ "vertical-text",
529
+ "alias",
530
+ "copy",
531
+ "move",
532
+ "no-drop",
533
+ "not-allowed",
534
+ "grab",
535
+ "grabbing",
536
+ "all-scroll",
537
+ "col-resize",
538
+ "row-resize",
539
+ "n-resize",
540
+ "e-resize",
541
+ "s-resize",
542
+ "w-resize",
543
+ "ne-resize",
544
+ "nw-resize",
545
+ "se-resize",
546
+ "sw-resize",
547
+ "ew-resize",
548
+ "ns-resize",
549
+ "nesw-resize",
550
+ "nwse-resize",
551
+ "zoom-in",
552
+ "zoom-out"
553
+ ],
554
+ "pointer-events": [
555
+ "auto",
556
+ "none",
557
+ "visiblePainted",
558
+ "visibleFill",
559
+ "visibleStroke",
560
+ "visible",
561
+ "painted",
562
+ "fill",
563
+ "stroke",
564
+ "all"
565
+ ],
566
+ "user-select": [
567
+ "none",
568
+ "auto",
569
+ "text",
570
+ "contain",
571
+ "all"
572
+ ],
573
+ resize: [
574
+ "none",
575
+ "both",
576
+ "horizontal",
577
+ "vertical",
578
+ "block",
579
+ "inline"
580
+ ],
581
+ appearance: [
582
+ "none",
583
+ "auto",
584
+ "menulist-button",
585
+ "textfield"
586
+ ],
587
+ "touch-action": [
588
+ "auto",
589
+ "none",
590
+ "manipulation"
591
+ ],
592
+ "will-change": [
593
+ "auto",
594
+ "scroll-position",
595
+ "contents"
596
+ ],
597
+ "z-index": ["auto"],
598
+ "aspect-ratio": ["auto"],
599
+ "object-fit": [
600
+ "fill",
601
+ "contain",
602
+ "cover",
603
+ "none",
604
+ "scale-down"
605
+ ],
606
+ "caption-side": [
607
+ "top",
608
+ "bottom",
609
+ "inline-start",
610
+ "inline-end"
611
+ ],
612
+ "border-collapse": ["collapse", "separate"],
613
+ "table-layout": ["auto", "fixed"]
614
+ };
615
+ //#endregion
616
+ export { CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS };
@@ -0,0 +1,63 @@
1
+ //#region src/types/css-values.d.ts
2
+ /**
3
+ * CSS value-type primitives — template-literal types for the subset of
4
+ * the CSS Values & Units vocabulary that token values, color
5
+ * expressions, and per-property keyword unions author against.
6
+ *
7
+ * `CssValue` is the registry keyed by spec value-type names (`color`,
8
+ * `length`, `percentage`, etc.). `CssPropertyValues` in `./css-properties`
9
+ * composes these entries plus per-property keywords into the union each
10
+ * CSS property accepts.
11
+ *
12
+ * Named colors (`red`, `blue`, etc.) are intentionally NOT in the
13
+ * `CssColor` union — authors use a token, a hex code, or a function
14
+ * form (`rgb(...)`, etc.). The CSS-wide keywords (`inherit`, `initial`,
15
+ * `unset`, `revert`) are bundled into `ColorKeyword` because color is
16
+ * the most common channel for them.
17
+ */
18
+ type ColorKeyword = 'transparent' | 'currentColor' | 'inherit' | 'initial' | 'unset' | 'revert';
19
+ type HexColor = `#${string}`;
20
+ type RgbColor = `rgb(${string})` | `rgba(${string})`;
21
+ type HslColor = `hsl(${string})` | `hsla(${string})`;
22
+ type ColorFn = `color(${string})` | `lab(${string})` | `lch(${string})` | `oklab(${string})` | `oklch(${string})`;
23
+ type CssColor = HexColor | RgbColor | HslColor | ColorFn | ColorKeyword;
24
+ type CssLength = `${number}px` | `${number}rem` | `${number}em` | `${number}ch` | `${number}ex` | `${number}vh` | `${number}vw` | `${number}vmin` | `${number}vmax` | 0;
25
+ type CssPercentage = `${number}%`;
26
+ type CssAngle = `${number}deg` | `${number}rad` | `${number}grad` | `${number}turn`;
27
+ type CssTime = `${number}ms` | `${number}s`;
28
+ type CssRatio = `${number}/${number}`;
29
+ type CssVarRef = `var(--${string})` | `var(--${string}, ${string})`;
30
+ /**
31
+ * Registry of CSS value types, keyed by their spec-defined names.
32
+ *
33
+ * Used in two places:
34
+ * 1. As the source of truth for what shapes count as e.g. a "length"
35
+ * or a "color" when validating token values and `defineStyleProp`
36
+ * `arbitrary` specs.
37
+ * 2. By `CssPropertyValues` in `./css-properties`, which composes
38
+ * these entries (plus per-property keywords) into the union
39
+ * accepted by each CSS property.
40
+ */
41
+ type CssValue = {
42
+ color: CssColor;
43
+ length: CssLength;
44
+ percentage: CssPercentage;
45
+ 'length-percentage': CssLength | CssPercentage;
46
+ number: number;
47
+ integer: number;
48
+ angle: CssAngle;
49
+ time: CssTime;
50
+ ratio: CssRatio;
51
+ image: string;
52
+ url: `url(${string})`;
53
+ 'font-weight': number | 'normal' | 'bold' | 'lighter' | 'bolder';
54
+ 'font-family': string;
55
+ 'easing-function': 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end' | `cubic-bezier(${string})` | `steps(${string})`;
56
+ shadow: string;
57
+ gradient: string;
58
+ ident: string;
59
+ string: string;
60
+ };
61
+ type CssValueTypeName = keyof CssValue;
62
+ //#endregion
63
+ export { ColorFn, ColorKeyword, CssAngle, CssColor, CssLength, CssPercentage, CssRatio, CssTime, CssValue, CssValueTypeName, CssVarRef, HexColor, HslColor, RgbColor };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * CSS value-type primitives — template-literal types for the subset of
3
+ * the CSS Values & Units vocabulary that token values, color
4
+ * expressions, and per-property keyword unions author against.
5
+ *
6
+ * `CssValue` is the registry keyed by spec value-type names (`color`,
7
+ * `length`, `percentage`, etc.). `CssPropertyValues` in `./css-properties`
8
+ * composes these entries plus per-property keywords into the union each
9
+ * CSS property accepts.
10
+ *
11
+ * Named colors (`red`, `blue`, etc.) are intentionally NOT in the
12
+ * `CssColor` union — authors use a token, a hex code, or a function
13
+ * form (`rgb(...)`, etc.). The CSS-wide keywords (`inherit`, `initial`,
14
+ * `unset`, `revert`) are bundled into `ColorKeyword` because color is
15
+ * the most common channel for them.
16
+ */