@yahoo/uds-v5-wip 1.13.0 → 1.14.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 (35) hide show
  1. package/dist/config/dist/createConfig.d.ts +58 -20
  2. package/dist/config/dist/createConfig.js +120 -70
  3. package/dist/config/dist/index.d.ts +2 -2
  4. package/dist/config/dist/index.js +1 -1
  5. package/dist/config/dist/preset-merge.js +9 -4
  6. package/dist/config/dist/propertyGroups.d.ts +11 -0
  7. package/dist/config/dist/propertyGroups.js +432 -0
  8. package/dist/config/dist/types.d.ts +2 -62
  9. package/dist/config.d.ts +3 -3842
  10. package/dist/config.js +1 -2
  11. package/dist/foundational-presets/dist/boldVibrant.d.ts +2 -3839
  12. package/dist/foundational-presets/dist/brutalist.d.ts +2 -3839
  13. package/dist/foundational-presets/dist/candy.d.ts +2 -3839
  14. package/dist/foundational-presets/dist/cleanMinimalist.d.ts +2 -3839
  15. package/dist/foundational-presets/dist/corporate.d.ts +2 -3839
  16. package/dist/foundational-presets/dist/darkMoody.d.ts +2 -3839
  17. package/dist/foundational-presets/dist/defaultPreset.d.ts +2 -3839
  18. package/dist/foundational-presets/dist/defaultPreset.js +219 -605
  19. package/dist/foundational-presets/dist/forest.d.ts +2 -3839
  20. package/dist/foundational-presets/dist/highContrast.d.ts +2 -3839
  21. package/dist/foundational-presets/dist/lavender.d.ts +2 -3839
  22. package/dist/foundational-presets/dist/luxury.d.ts +2 -3839
  23. package/dist/foundational-presets/dist/monochrome.d.ts +2 -3839
  24. package/dist/foundational-presets/dist/motion.d.ts +2 -1
  25. package/dist/foundational-presets/dist/neonCyber.d.ts +2 -3839
  26. package/dist/foundational-presets/dist/newspaper.d.ts +2 -3839
  27. package/dist/foundational-presets/dist/ocean.d.ts +2 -3839
  28. package/dist/foundational-presets/dist/slate.d.ts +2 -3839
  29. package/dist/foundational-presets/dist/sunset.d.ts +2 -3839
  30. package/dist/foundational-presets/dist/terminal.d.ts +2 -3839
  31. package/dist/foundational-presets/dist/warmOrganic.d.ts +2 -3839
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +3 -3
  34. package/dist/config/dist/resolvedMappings.d.ts +0 -22
  35. package/dist/config/dist/resolvedMappings.js +0 -43
@@ -0,0 +1,432 @@
1
+ //#region ../config/dist/propertyGroups.js
2
+ const ALL_PROPERTY_GROUPS = [
3
+ {
4
+ id: "textColor",
5
+ label: "Text Color",
6
+ properties: ["color"]
7
+ },
8
+ {
9
+ id: "background",
10
+ label: "Background",
11
+ properties: ["bg"]
12
+ },
13
+ {
14
+ id: "borderColor",
15
+ label: "Border Color",
16
+ properties: [
17
+ "borderColor",
18
+ "borderYColor",
19
+ "borderXColor",
20
+ "borderStartColor",
21
+ "borderLeftColor",
22
+ "borderEndColor",
23
+ "borderRightColor",
24
+ "borderTopColor",
25
+ "borderBottomColor"
26
+ ]
27
+ },
28
+ {
29
+ id: "outlineColor",
30
+ label: "Outline Color",
31
+ properties: ["outlineColor"]
32
+ },
33
+ {
34
+ id: "ringColor",
35
+ label: "Ring Color",
36
+ properties: ["ringColor", "ringOffsetColor"]
37
+ },
38
+ {
39
+ id: "divideColor",
40
+ label: "Divide Color",
41
+ properties: ["divideColor"]
42
+ },
43
+ {
44
+ id: "shadowColor",
45
+ label: "Shadow Color",
46
+ properties: ["shadowColor"]
47
+ },
48
+ {
49
+ id: "svgFill",
50
+ label: "SVG Fill",
51
+ properties: ["fillColor"]
52
+ },
53
+ {
54
+ id: "svgStroke",
55
+ label: "SVG Stroke",
56
+ properties: ["strokeColor"]
57
+ },
58
+ {
59
+ id: "caretColor",
60
+ label: "Caret Color",
61
+ properties: ["caretColor"]
62
+ },
63
+ {
64
+ id: "textDecorationColor",
65
+ label: "Text Decoration Color",
66
+ properties: ["textDecorationColor"]
67
+ },
68
+ {
69
+ id: "opacity",
70
+ label: "Opacity",
71
+ properties: ["opacity"]
72
+ },
73
+ {
74
+ id: "colorOpacity",
75
+ label: "Color Opacity",
76
+ properties: ["colorOpacity"]
77
+ },
78
+ {
79
+ id: "bgOpacity",
80
+ label: "Background Opacity",
81
+ properties: ["bgOpacity"]
82
+ },
83
+ {
84
+ id: "borderColorOpacity",
85
+ label: "Border Color Opacity",
86
+ properties: [
87
+ "borderColorOpacity",
88
+ "borderYColorOpacity",
89
+ "borderXColorOpacity",
90
+ "borderStartColorOpacity",
91
+ "borderLeftColorOpacity",
92
+ "borderEndColorOpacity",
93
+ "borderRightColorOpacity",
94
+ "borderTopColorOpacity",
95
+ "borderBottomColorOpacity"
96
+ ]
97
+ },
98
+ {
99
+ id: "divideColorOpacity",
100
+ label: "Divide Color Opacity",
101
+ properties: ["divideColorOpacity"]
102
+ },
103
+ {
104
+ id: "outlineColorOpacity",
105
+ label: "Outline Color Opacity",
106
+ properties: ["outlineColorOpacity"]
107
+ },
108
+ {
109
+ id: "ringColorOpacity",
110
+ label: "Ring Color Opacity",
111
+ properties: ["ringColorOpacity", "ringOffsetColorOpacity"]
112
+ },
113
+ {
114
+ id: "textDecorationColorOpacity",
115
+ label: "Text Decoration Opacity",
116
+ properties: ["textDecorationColorOpacity"]
117
+ },
118
+ {
119
+ id: "svgFillOpacity",
120
+ label: "SVG Fill Opacity",
121
+ properties: ["fillColorOpacity"]
122
+ },
123
+ {
124
+ id: "svgStrokeOpacity",
125
+ label: "SVG Stroke Opacity",
126
+ properties: ["strokeColorOpacity"]
127
+ },
128
+ {
129
+ id: "shadowColorOpacity",
130
+ label: "Shadow Color Opacity",
131
+ properties: ["shadowColorOpacity"]
132
+ },
133
+ {
134
+ id: "caretColorOpacity",
135
+ label: "Caret Color Opacity",
136
+ properties: ["caretColorOpacity"]
137
+ },
138
+ {
139
+ id: "fontFamily",
140
+ label: "Font Family",
141
+ properties: ["fontFamily"]
142
+ },
143
+ {
144
+ id: "fontSize",
145
+ label: "Font Size",
146
+ properties: ["fontSize"]
147
+ },
148
+ {
149
+ id: "fontWeight",
150
+ label: "Font Weight",
151
+ properties: ["fontWeight"]
152
+ },
153
+ {
154
+ id: "lineHeight",
155
+ label: "Line Height",
156
+ properties: ["lineHeight"]
157
+ },
158
+ {
159
+ id: "letterSpacing",
160
+ label: "Letter Spacing",
161
+ properties: ["letterSpacing"]
162
+ },
163
+ {
164
+ id: "blur",
165
+ label: "Blur",
166
+ properties: ["blur"]
167
+ },
168
+ {
169
+ id: "backdropBlur",
170
+ label: "Backdrop Blur",
171
+ properties: ["backdropBlur"]
172
+ },
173
+ {
174
+ id: "animation",
175
+ label: "Animation",
176
+ properties: ["animation"]
177
+ },
178
+ {
179
+ id: "shadow",
180
+ label: "Shadow",
181
+ properties: ["shadow"]
182
+ },
183
+ {
184
+ id: "textShadow",
185
+ label: "Text Shadow",
186
+ properties: ["textShadow"]
187
+ },
188
+ {
189
+ id: "zIndex",
190
+ label: "Z-Index",
191
+ properties: ["zIndex"]
192
+ },
193
+ {
194
+ id: "borderWidth",
195
+ label: "Border Width",
196
+ properties: [
197
+ "borderWidth",
198
+ "borderYWidth",
199
+ "borderXWidth",
200
+ "borderStartWidth",
201
+ "borderLeftWidth",
202
+ "borderEndWidth",
203
+ "borderRightWidth",
204
+ "borderTopWidth",
205
+ "borderBottomWidth"
206
+ ]
207
+ },
208
+ {
209
+ id: "borderRadius",
210
+ label: "Border Radius",
211
+ properties: [
212
+ "borderRadius",
213
+ "borderRadiusTop",
214
+ "borderRadiusBottom",
215
+ "borderRadiusStart",
216
+ "borderRadiusEnd",
217
+ "borderRadiusTopStart",
218
+ "borderRadiusTopEnd",
219
+ "borderRadiusBottomStart",
220
+ "borderRadiusBottomEnd"
221
+ ]
222
+ },
223
+ {
224
+ id: "outlineWidth",
225
+ label: "Outline Width",
226
+ properties: ["outlineWidth", "outlineOffset"]
227
+ },
228
+ {
229
+ id: "divideWidth",
230
+ label: "Divide Width",
231
+ properties: ["divideWidth"]
232
+ },
233
+ {
234
+ id: "ringWidth",
235
+ label: "Ring Width",
236
+ properties: ["ringWidth", "ringOffsetWidth"]
237
+ },
238
+ {
239
+ id: "padding",
240
+ label: "Padding",
241
+ properties: [
242
+ "spacing",
243
+ "spacingX",
244
+ "spacingY",
245
+ "spacingRight",
246
+ "spacingEnd",
247
+ "spacingLeft",
248
+ "spacingStart",
249
+ "spacingTop",
250
+ "spacingBottom"
251
+ ]
252
+ },
253
+ {
254
+ id: "margin",
255
+ label: "Margin",
256
+ properties: [
257
+ "margin",
258
+ "marginX",
259
+ "marginY",
260
+ "marginBottom",
261
+ "marginEnd",
262
+ "marginRight",
263
+ "marginStart",
264
+ "marginLeft",
265
+ "marginTop"
266
+ ]
267
+ },
268
+ {
269
+ id: "offset",
270
+ label: "Offset",
271
+ properties: [
272
+ "offset",
273
+ "offsetY",
274
+ "offsetX",
275
+ "offsetBottom",
276
+ "offsetEnd",
277
+ "offsetRight",
278
+ "offsetStart",
279
+ "offsetLeft",
280
+ "offsetTop"
281
+ ]
282
+ },
283
+ {
284
+ id: "gap",
285
+ label: "Gap",
286
+ properties: [
287
+ "gap",
288
+ "gapX",
289
+ "gapY"
290
+ ]
291
+ },
292
+ {
293
+ id: "indent",
294
+ label: "Indent",
295
+ properties: ["indent"]
296
+ },
297
+ {
298
+ id: "scrollSnapGap",
299
+ label: "Scroll Snap Gap",
300
+ properties: [
301
+ "scrollSnapGap",
302
+ "scrollSnapGapTop",
303
+ "scrollSnapGapBottom",
304
+ "scrollSnapGapStart",
305
+ "scrollSnapGapEnd",
306
+ "scrollSnapGapX",
307
+ "scrollSnapGapY"
308
+ ]
309
+ },
310
+ {
311
+ id: "scrollSnapSpacing",
312
+ label: "Scroll Snap Spacing",
313
+ properties: [
314
+ "scrollSnapSpacing",
315
+ "scrollSnapSpacingTop",
316
+ "scrollSnapSpacingBottom",
317
+ "scrollSnapSpacingStart",
318
+ "scrollSnapSpacingEnd",
319
+ "scrollSnapSpacingX",
320
+ "scrollSnapSpacingY"
321
+ ]
322
+ },
323
+ {
324
+ id: "tableBorderSpacing",
325
+ label: "Table Border Spacing",
326
+ properties: [
327
+ "tableBorderSpacing",
328
+ "tableBorderSpacingX",
329
+ "tableBorderSpacingY"
330
+ ]
331
+ },
332
+ {
333
+ id: "width",
334
+ label: "Width",
335
+ properties: [
336
+ "width",
337
+ "minWidth",
338
+ "maxWidth"
339
+ ]
340
+ },
341
+ {
342
+ id: "height",
343
+ label: "Height",
344
+ properties: [
345
+ "height",
346
+ "minHeight",
347
+ "maxHeight"
348
+ ]
349
+ },
350
+ {
351
+ id: "aspectRatio",
352
+ label: "Aspect Ratio",
353
+ properties: ["aspectRatio"]
354
+ },
355
+ {
356
+ id: "positionPlacement",
357
+ label: "Position",
358
+ properties: [
359
+ "top",
360
+ "bottom",
361
+ "left",
362
+ "right",
363
+ "inset",
364
+ "insetX",
365
+ "insetY"
366
+ ]
367
+ },
368
+ {
369
+ id: "flex",
370
+ label: "Flex",
371
+ properties: [
372
+ "flex",
373
+ "flexGrow",
374
+ "flexShrink"
375
+ ]
376
+ },
377
+ {
378
+ id: "transform",
379
+ label: "Transform",
380
+ properties: [
381
+ "scaleX",
382
+ "scaleY",
383
+ "skewX",
384
+ "skewY",
385
+ "translateX",
386
+ "translateY",
387
+ "rotate",
388
+ "scale"
389
+ ]
390
+ },
391
+ {
392
+ id: "strokeWidth",
393
+ label: "Stroke Width",
394
+ properties: ["strokeWidth"]
395
+ }
396
+ ];
397
+ const groupById = new Map(ALL_PROPERTY_GROUPS.map((g) => [g.id, g]));
398
+ const propToGroupId = /* @__PURE__ */ new Map();
399
+ for (const group of ALL_PROPERTY_GROUPS) for (const prop of group.properties) propToGroupId.set(prop, group.id);
400
+ const COLOR_GROUPS = [
401
+ "textColor",
402
+ "background",
403
+ "borderColor",
404
+ "outlineColor",
405
+ "ringColor",
406
+ "divideColor",
407
+ "shadowColor",
408
+ "svgFill",
409
+ "svgStroke",
410
+ "caretColor",
411
+ "textDecorationColor"
412
+ ];
413
+ [...COLOR_GROUPS], [...COLOR_GROUPS], [...COLOR_GROUPS];
414
+ /**
415
+ * Given an array of group IDs, returns the flat union of all their
416
+ * member ConfigurableProps (deduplicated).
417
+ */
418
+ function expandPropertyGroups(groupIds) {
419
+ const seen = /* @__PURE__ */ new Set();
420
+ const result = [];
421
+ for (const id of groupIds) {
422
+ const group = groupById.get(id);
423
+ if (!group) continue;
424
+ for (const prop of group.properties) if (!seen.has(prop)) {
425
+ seen.add(prop);
426
+ result.push(prop);
427
+ }
428
+ }
429
+ return result;
430
+ }
431
+ //#endregion
432
+ export { expandPropertyGroups };
@@ -1,5 +1,3 @@
1
- import { StyleProp } from "@uds/types";
2
-
3
1
  //#region ../config/dist/types.d.ts
4
2
  //#region src/types.d.ts
5
3
  /**
@@ -31,64 +29,6 @@ type VarGroupDef<M extends `_${string}` = `_${string}`> = Record<string, VarToke
31
29
  * spacing: { 1: { value: '0.25rem' }, 2: { value: '0.5rem' } },
32
30
  * }
33
31
  */
34
- type VarsConfig<M extends `_${string}` = `_${string}`> = Record<string, VarGroupDef<M>>;
35
- /**
36
- * A single utility definition mapping a style prop to CSS output.
37
- *
38
- * @example
39
- * {
40
- * className: 'bg',
41
- * values: '{bg}',
42
- * transform(value) { return { 'background-color': value } },
43
- * }
44
- */
45
- interface UtilityDef {
46
- /** Class name prefix for runtime generation. Empty string means value IS the class. */
47
- className: string;
48
- /**
49
- * Reference to defineVars namespace(s). Tokens from referenced namespaces become allowed values.
50
- *
51
- * - Single: `'{namespace}'` — tokens from one namespace
52
- * - Array: `['{ns1}', '{ns2}']` — tokens from multiple namespaces, last entry wins on name collision
53
- *
54
- * The namespace name determines the CSS custom property prefix (e.g., `'{color}'` → `--uds-color-*`).
55
- */
56
- values?: string | string[] | {
57
- type: 'boolean';
58
- };
59
- /** Literal enum values (e.g., `['block', 'flex', 'grid']`). */
60
- literalValues?: string[];
61
- /** Transform a token/literal value into CSS property declarations.
62
- * Optional for Phase 0 — only needed by resolveUtilityMappings() to derive cssProperty. */
63
- transform?: (value: string, ctx: {
64
- token: (ref: string) => string;
65
- }) => Record<string, string>;
66
- }
67
- /**
68
- * Internal utilities config — used for resolved/stored data.
69
- * Keys are plain strings so internal iteration (Object.entries, etc.) stays clean.
70
- *
71
- * @example
72
- * {
73
- * bg: { className: 'bg', values: '{bg}', transform(v) { return { 'background-color': v } } },
74
- * display: { className: '', literalValues: ['block', 'flex'], transform(v) { return { display: v } } },
75
- * }
76
- */
77
- type UtilitiesConfig = Record<string, UtilityDef>;
78
- /**
79
- * Input type for `defineUtilities()` — keys must be valid UDS style prop names (`StyleProp`).
80
- *
81
- * This is the public-facing constraint used by the builder method. It ensures callers
82
- * only map props that exist in the UDS component style API. Unlike `UtilitiesConfig`
83
- * (which uses `Record<string, ...>` for clean internal iteration), this type enforces
84
- * named keys at the call site.
85
- *
86
- * @example
87
- * {
88
- * color: { className: 'text', values: '{color}' },
89
- * bg: { className: 'bg', values: ['{color}', '{bg}'] },
90
- * display: { className: '', literalValues: ['block', 'flex', 'grid'] },
91
- * }
92
- */
32
+ type VarsConfig<M extends `_${string}` = `_${string}`> = Record<string, VarGroupDef<M>>; //#endregion
93
33
  //#endregion
94
- export { UtilitiesConfig, UtilityDef, VarGroupDef, VarTokenDef, VarsConfig };
34
+ export { VarGroupDef, VarTokenDef, VarsConfig };