@yahoo/uds 3.120.0 → 3.122.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 (69) hide show
  1. package/dist/components/client/Popover/Popover.cjs +1 -1
  2. package/dist/components/client/Popover/Popover.js +1 -1
  3. package/dist/components/client/Popover/PopoverContent.cjs +12 -17
  4. package/dist/components/client/Popover/PopoverContent.js +12 -17
  5. package/dist/components/client/Popover/UDSPopoverConfigProvider.cjs +13 -3
  6. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +13 -5
  7. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +13 -5
  8. package/dist/components/client/Popover/UDSPopoverConfigProvider.js +13 -3
  9. package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
  10. package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
  11. package/dist/fixtures/dist/index.cjs +1 -2
  12. package/dist/fixtures/dist/index.js +1 -2
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.ts +2 -2
  15. package/dist/runtime/popoverConfig.cjs +2 -0
  16. package/dist/runtime/popoverConfig.d.cts +3 -1
  17. package/dist/runtime/popoverConfig.d.ts +3 -1
  18. package/dist/runtime/popoverConfig.js +2 -0
  19. package/dist/styles/styler.d.cts +43 -43
  20. package/dist/styles/styler.d.ts +43 -43
  21. package/dist/tailwind/dist/commands/generateComponentData.cjs +5 -1
  22. package/dist/tailwind/dist/commands/generateComponentData.d.cts +3 -0
  23. package/dist/tailwind/dist/commands/generateComponentData.d.cts.map +1 -1
  24. package/dist/tailwind/dist/commands/generateComponentData.d.ts +3 -0
  25. package/dist/tailwind/dist/commands/generateComponentData.d.ts.map +1 -1
  26. package/dist/tailwind/dist/commands/generateComponentData.js +5 -1
  27. package/dist/tailwind/dist/commands/generateComponentData.js.map +1 -1
  28. package/dist/tailwind/dist/css/generate.cjs +2 -1
  29. package/dist/tailwind/dist/css/generate.d.cts.map +1 -1
  30. package/dist/tailwind/dist/css/generate.d.ts.map +1 -1
  31. package/dist/tailwind/dist/css/generate.js +3 -2
  32. package/dist/tailwind/dist/css/generate.js.map +1 -1
  33. package/dist/tailwind/dist/css/nodeUtils.cjs +7 -5
  34. package/dist/tailwind/dist/css/nodeUtils.js +7 -5
  35. package/dist/tailwind/dist/css/nodeUtils.js.map +1 -1
  36. package/dist/tailwind/dist/css/runner.cjs +4 -3
  37. package/dist/tailwind/dist/css/runner.js +5 -4
  38. package/dist/tailwind/dist/css/runner.js.map +1 -1
  39. package/dist/tailwind/dist/css/utils.cjs +62 -0
  40. package/dist/tailwind/dist/css/utils.js +62 -1
  41. package/dist/tailwind/dist/css/utils.js.map +1 -1
  42. package/dist/tailwind/dist/fixtures/dist/index.js.map +1 -1
  43. package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +104 -19
  44. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts +5 -0
  45. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.cts.map +1 -1
  46. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts +5 -0
  47. package/dist/tailwind/dist/purger/optimized/purgeFromCode.d.ts.map +1 -1
  48. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +104 -19
  49. package/dist/tailwind/dist/purger/optimized/purgeFromCode.js.map +1 -1
  50. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +99 -10
  51. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +99 -10
  52. package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -1
  53. package/dist/tailwind/dist/runtimeConfig/hookMetadata.cjs +364 -0
  54. package/dist/tailwind/dist/runtimeConfig/hookMetadata.js +358 -0
  55. package/dist/tailwind/dist/runtimeConfig/hookMetadata.js.map +1 -0
  56. package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
  57. package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
  58. package/dist/tokens/index.d.cts +2 -2
  59. package/dist/tokens/index.d.ts +2 -2
  60. package/dist/tokens/types.d.cts +2 -2
  61. package/dist/tokens/types.d.ts +2 -2
  62. package/dist/types/dist/index.d.cts +2 -1
  63. package/dist/types/dist/index.d.ts +2 -1
  64. package/dist/uds/generated/componentData.cjs +915 -628
  65. package/dist/uds/generated/componentData.js +915 -628
  66. package/dist/uds/package.cjs +3 -3
  67. package/dist/uds/package.js +3 -3
  68. package/generated/componentData.json +1131 -782
  69. package/package.json +4 -4
@@ -0,0 +1,364 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
2
+
3
+ //#region src/runtimeConfig/hookMetadata.ts
4
+ const defineRuntimeHookMetadata = (metadata) => metadata;
5
+ const runtimeHookMetadata = defineRuntimeHookMetadata({
6
+ useBottomSheetConfig: {
7
+ defaultProps: {},
8
+ selectorParamValues: { variant: ["default"] },
9
+ tokenConfigPath: ["bottomSheet", "variables"],
10
+ fields: { backgroundColor: {
11
+ bindingSelector: "bottomSheet.backgroundColor",
12
+ selectorTemplates: ["bottomSheet.backgroundColor.${variant}"],
13
+ tokenSource: {
14
+ variableTemplate: "variant/${variant}/root",
15
+ valuePath: [
16
+ "backgroundColor",
17
+ "rest",
18
+ "value"
19
+ ]
20
+ }
21
+ } }
22
+ },
23
+ useToastConfig: {
24
+ defaultProps: {
25
+ size: "toast.defaultSize",
26
+ variant: "toast.defaultVariant"
27
+ },
28
+ defaultPropSources: {
29
+ size: [
30
+ "toast",
31
+ "defaults",
32
+ "size"
33
+ ],
34
+ variant: [
35
+ "toast",
36
+ "defaults",
37
+ "variant"
38
+ ]
39
+ },
40
+ selectorParamValues: {
41
+ size: ["default"],
42
+ variant: [
43
+ "success",
44
+ "error",
45
+ "info",
46
+ "warning",
47
+ "loading"
48
+ ]
49
+ },
50
+ tokenConfigPath: ["toast", "variables"],
51
+ fields: {
52
+ autoClose: {
53
+ bindingSelector: "toast.autoClose",
54
+ selectorTemplates: ["toast.autoClose"],
55
+ staticValue: 6e3
56
+ },
57
+ position: {
58
+ bindingSelector: "toast.position",
59
+ selectorTemplates: ["toast.position"],
60
+ staticValue: "bottom-center"
61
+ },
62
+ size: {
63
+ bindingSelector: "toast.defaultSize",
64
+ selectorTemplates: ["toast.defaultSize"]
65
+ },
66
+ variant: {
67
+ bindingSelector: "toast.defaultVariant",
68
+ selectorTemplates: ["toast.defaultVariant"]
69
+ },
70
+ textVariant: {
71
+ bindingSelector: "toast.textVariant.${size}",
72
+ selectorTemplates: ["toast.textVariant.${size}"],
73
+ tokenSource: {
74
+ variableTemplate: "size/${size}/label",
75
+ valuePath: [
76
+ "textVariant",
77
+ "rest",
78
+ "value"
79
+ ]
80
+ }
81
+ },
82
+ textColor: {
83
+ bindingSelector: "toast.textColor.${variant}",
84
+ selectorTemplates: ["toast.textColor.${variant}"],
85
+ tokenSource: {
86
+ variableTemplate: "variant/${variant}/root",
87
+ valuePath: [
88
+ "color",
89
+ "rest",
90
+ "value"
91
+ ]
92
+ }
93
+ },
94
+ iconSize: {
95
+ bindingSelector: "toast.iconSize.${size}",
96
+ selectorTemplates: ["toast.iconSize.${size}"],
97
+ tokenSource: {
98
+ variableTemplate: "size/${size}/icon",
99
+ valuePath: [
100
+ "size",
101
+ "rest",
102
+ "value"
103
+ ]
104
+ }
105
+ },
106
+ buttonSize: {
107
+ bindingSelector: "toast.buttonSize.${size}",
108
+ selectorTemplates: ["toast.buttonSize.${size}"],
109
+ tokenSource: {
110
+ variableTemplate: "size/${size}/actionButton",
111
+ valuePath: [
112
+ "buttonSize",
113
+ "rest",
114
+ "value"
115
+ ]
116
+ }
117
+ },
118
+ buttonVariant: {
119
+ bindingSelector: "toast.buttonVariant.${variant}",
120
+ selectorTemplates: ["toast.buttonVariant.${variant}"],
121
+ tokenSource: {
122
+ variableTemplate: "variant/${variant}/actionButton",
123
+ valuePath: [
124
+ "buttonVariant",
125
+ "rest",
126
+ "value"
127
+ ]
128
+ }
129
+ },
130
+ iconVariant: {
131
+ bindingSelector: "toast.iconVariant.${variant}",
132
+ selectorTemplates: ["toast.iconVariant.${variant}"],
133
+ tokenSource: {
134
+ variableTemplate: "variant/${variant}/icon",
135
+ valuePath: [
136
+ "iconVariant",
137
+ "rest",
138
+ "value"
139
+ ]
140
+ }
141
+ },
142
+ backgroundColor: {
143
+ bindingSelector: "toast.backgroundColor",
144
+ selectorTemplates: ["toast.backgroundColor.${variant}"],
145
+ tokenSource: {
146
+ variableTemplate: "variant/${variant}/root",
147
+ valuePath: [
148
+ "backgroundColor",
149
+ "rest",
150
+ "value"
151
+ ]
152
+ }
153
+ }
154
+ }
155
+ },
156
+ useTooltipConfig: {
157
+ defaultProps: {},
158
+ selectorParamValues: { size: ["default"] },
159
+ tokenConfigPath: ["tooltip", "variables"],
160
+ fields: {
161
+ animationDuration: {
162
+ bindingSelector: "tooltip.animationDuration",
163
+ selectorTemplates: ["tooltip.animationDuration"],
164
+ staticValue: 200
165
+ },
166
+ placement: {
167
+ bindingSelector: "tooltip.placement",
168
+ selectorTemplates: ["tooltip.placement"],
169
+ staticValue: "top"
170
+ },
171
+ borderRadius: {
172
+ bindingSelector: "tooltip.borderRadius",
173
+ selectorTemplates: ["tooltip.borderRadius.${size}"],
174
+ tokenSource: {
175
+ variableTemplate: "size/${size}/svg",
176
+ valuePath: [
177
+ "borderRadius",
178
+ "rest",
179
+ "value"
180
+ ],
181
+ transformConfigPath: [
182
+ "scaleMode",
183
+ "medium",
184
+ "borderRadius"
185
+ ]
186
+ }
187
+ }
188
+ }
189
+ },
190
+ usePopoverConfig: {
191
+ defaultProps: {
192
+ size: "popover.defaultSize",
193
+ variant: "popover.defaultVariant"
194
+ },
195
+ defaultPropValues: {
196
+ size: "default",
197
+ variant: "default"
198
+ },
199
+ selectorParamValues: { size: ["default"] },
200
+ tokenConfigPath: ["popover", "variables"],
201
+ fields: {
202
+ animationDuration: {
203
+ bindingSelector: "popover.animationDuration",
204
+ selectorTemplates: ["popover.animationDuration"],
205
+ staticValue: 200
206
+ },
207
+ placement: {
208
+ bindingSelector: "popover.placement",
209
+ selectorTemplates: ["popover.placement"],
210
+ staticValue: "top"
211
+ },
212
+ size: {
213
+ bindingSelector: "popover.defaultSize",
214
+ selectorTemplates: ["popover.defaultSize"]
215
+ },
216
+ variant: {
217
+ bindingSelector: "popover.defaultVariant",
218
+ selectorTemplates: ["popover.defaultVariant"]
219
+ },
220
+ borderRadius: {
221
+ bindingSelector: "popover.borderRadius.${size}",
222
+ selectorTemplates: ["popover.borderRadius.${size}"],
223
+ tokenSource: {
224
+ variableTemplate: "size/${size}/svgBase",
225
+ valuePath: [
226
+ "borderRadius",
227
+ "rest",
228
+ "value"
229
+ ],
230
+ transformConfigPath: [
231
+ "scaleMode",
232
+ "medium",
233
+ "borderRadius"
234
+ ]
235
+ }
236
+ },
237
+ gap: {
238
+ bindingSelector: "popover.gap.${size}",
239
+ selectorTemplates: ["popover.gap.${size}"],
240
+ tokenSource: {
241
+ variableTemplate: "size/${size}/contentWrapper",
242
+ valuePath: [
243
+ "gap",
244
+ "rest",
245
+ "value"
246
+ ]
247
+ }
248
+ },
249
+ spacingHorizontal: {
250
+ bindingSelector: "popover.spacingHorizontal.${size}",
251
+ selectorTemplates: ["popover.spacingHorizontal.${size}"],
252
+ tokenSource: {
253
+ variableTemplate: "size/${size}/contentWrapper",
254
+ valuePath: [
255
+ "spacingHorizontal",
256
+ "rest",
257
+ "value"
258
+ ]
259
+ }
260
+ },
261
+ spacingVertical: {
262
+ bindingSelector: "popover.spacingVertical.${size}",
263
+ selectorTemplates: ["popover.spacingVertical.${size}"],
264
+ tokenSource: {
265
+ variableTemplate: "size/${size}/contentWrapper",
266
+ valuePath: [
267
+ "spacingVertical",
268
+ "rest",
269
+ "value"
270
+ ]
271
+ }
272
+ },
273
+ dismissButtonSpacing: {
274
+ bindingSelector: "popover.dismissButtonSpacing.${size}",
275
+ selectorTemplates: ["popover.dismissButtonSpacing.${size}"],
276
+ tokenSource: {
277
+ variableTemplate: "size/${size}/closeIconContainer",
278
+ valuePath: [
279
+ "spacing",
280
+ "rest",
281
+ "value"
282
+ ]
283
+ }
284
+ },
285
+ dismissIconSize: {
286
+ bindingSelector: "popover.dismissIconSize.${size}",
287
+ selectorTemplates: ["popover.dismissIconSize.${size}"],
288
+ tokenSource: {
289
+ variableTemplate: "size/${size}/closeIcon",
290
+ valuePath: [
291
+ "size",
292
+ "rest",
293
+ "value"
294
+ ],
295
+ transformConfigPath: [
296
+ "scaleMode",
297
+ "medium",
298
+ "iconSizes"
299
+ ]
300
+ }
301
+ }
302
+ }
303
+ }
304
+ });
305
+ const getNestedValue = (value, path) => {
306
+ return path.reduce((currentValue, segment) => {
307
+ if (typeof currentValue !== "object" || currentValue === null) return;
308
+ return currentValue[segment];
309
+ }, value);
310
+ };
311
+ const isRuntimeConfigValue = (value) => {
312
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
313
+ };
314
+ const getRuntimeHookConfig = (hookName) => {
315
+ return runtimeHookMetadata[hookName] ?? null;
316
+ };
317
+ const getRuntimeSelectorParamValues = (hookName, paramName) => {
318
+ return [...runtimeHookMetadata[hookName].selectorParamValues?.[paramName] ?? []];
319
+ };
320
+ const expandRuntimeSelectorTemplate = (template, params = {}) => {
321
+ return template.replace(/\$\{(\w+)\}/g, (match, paramName) => params[paramName] ?? match);
322
+ };
323
+ const getRuntimeDefaultPropSelector = (hookName, propName, params = {}) => {
324
+ const selector = getRuntimeHookConfig(hookName)?.defaultProps[propName];
325
+ return selector ? expandRuntimeSelectorTemplate(selector, params) : null;
326
+ };
327
+ const getRuntimeDefaultPropValue = (config, hookName, propName) => {
328
+ const hookConfig = getRuntimeHookConfig(hookName);
329
+ const configuredValue = getNestedValue(config, hookConfig?.defaultPropSources?.[propName] ?? []);
330
+ if (isRuntimeConfigValue(configuredValue)) return configuredValue;
331
+ const staticValue = hookConfig?.defaultPropValues?.[propName];
332
+ return staticValue === void 0 ? void 0 : staticValue;
333
+ };
334
+ const getRuntimeFieldSelector = (hookName, fieldName, params = {}) => {
335
+ const selectorTemplate = getRuntimeHookConfig(hookName)?.fields[fieldName]?.selectorTemplates[0];
336
+ return selectorTemplate ? expandRuntimeSelectorTemplate(selectorTemplate, params) : null;
337
+ };
338
+ const getRuntimeFieldStaticValue = (hookName, fieldName) => {
339
+ return getRuntimeHookConfig(hookName)?.fields[fieldName]?.staticValue ?? null;
340
+ };
341
+ const getRuntimeFieldTokenValue = (config, hookName, fieldName, params = {}) => {
342
+ const hookConfig = getRuntimeHookConfig(hookName);
343
+ const tokenConfigPath = hookConfig?.tokenConfigPath;
344
+ const tokenSource = hookConfig?.fields[fieldName]?.tokenSource;
345
+ if (!tokenConfigPath || !tokenSource) return;
346
+ const variableTemplate = expandRuntimeSelectorTemplate(tokenSource.variableTemplate, params);
347
+ const rawValue = getNestedValue(getNestedValue(config, [...tokenConfigPath, variableTemplate]), tokenSource.valuePath);
348
+ if (rawValue === void 0) return;
349
+ if (!tokenSource.transformConfigPath) return isRuntimeConfigValue(rawValue) ? rawValue : void 0;
350
+ const transformedValue = getNestedValue(tokenSource.transformConfigPath.reduce((currentValue, segment) => {
351
+ if (typeof currentValue !== "object" || currentValue === null) return;
352
+ return currentValue[segment];
353
+ }, config), [String(rawValue)]);
354
+ return isRuntimeConfigValue(transformedValue) ? transformedValue : void 0;
355
+ };
356
+
357
+ //#endregion
358
+ exports.getRuntimeDefaultPropSelector = getRuntimeDefaultPropSelector;
359
+ exports.getRuntimeDefaultPropValue = getRuntimeDefaultPropValue;
360
+ exports.getRuntimeFieldSelector = getRuntimeFieldSelector;
361
+ exports.getRuntimeFieldStaticValue = getRuntimeFieldStaticValue;
362
+ exports.getRuntimeFieldTokenValue = getRuntimeFieldTokenValue;
363
+ exports.getRuntimeHookConfig = getRuntimeHookConfig;
364
+ exports.getRuntimeSelectorParamValues = getRuntimeSelectorParamValues;