@yahoo/uds-v5-wip 1.36.0 → 1.37.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 (96) hide show
  1. package/dist/config/dist/component-resolution.js +1 -1
  2. package/dist/config/dist/createConfig.d.ts +11 -75
  3. package/dist/config/dist/createConfig.js +67 -161
  4. package/dist/config/dist/defineComponent.d.ts +1 -0
  5. package/dist/config/dist/defineStyleProp.js +25 -0
  6. package/dist/config/dist/index.d.ts +1 -2
  7. package/dist/config/dist/index.js +3 -1
  8. package/dist/config/dist/preset-merge.js +0 -12
  9. package/dist/config/dist/propertyAcceptedTypes.js +17 -4
  10. package/dist/config/dist/propertyGroups.d.ts +1 -11
  11. package/dist/config/dist/propertyGroups.js +1 -19
  12. package/dist/config/dist/refs.js +1 -0
  13. package/dist/config/dist/resolveStyleProp.js +11 -2
  14. package/dist/config/dist/serialize.d.ts +10 -2
  15. package/dist/config/dist/serialize.js +3 -3
  16. package/dist/config.d.ts +1 -1
  17. package/dist/core/dist/color-opacity-map.d.ts +13 -0
  18. package/dist/core/dist/color-opacity-map.js +33 -0
  19. package/dist/core/dist/compositeStyles.d.ts +2 -1
  20. package/dist/core/dist/configurable-prop-helpers.d.ts +32 -0
  21. package/dist/core/dist/configurable-prop-helpers.js +61 -0
  22. package/dist/core/dist/createComponent.d.ts +2 -1
  23. package/dist/core/dist/createComponentExample.d.ts +2 -1
  24. package/dist/core/dist/createProvider.d.ts +2 -1
  25. package/dist/core/dist/generated/stylePropsTwMap.d.ts +2 -1
  26. package/dist/core/dist/getComponentStyles.d.ts +2 -1
  27. package/dist/core/dist/getStyles.d.ts +2 -1
  28. package/dist/core/dist/getStyles.js +3 -1
  29. package/dist/core/dist/index.d.ts +4 -1
  30. package/dist/core/dist/index.js +4 -1
  31. package/dist/core/dist/modifier-mappings.d.ts +13 -0
  32. package/dist/core/dist/modifier-mappings.js +61 -0
  33. package/dist/core/dist/resolveMotionState.d.ts +2 -1
  34. package/dist/core/dist/style-prop-data.d.ts +33 -0
  35. package/dist/{loader/dist/packages/core/dist/propMappings.js → core/dist/style-prop-data.js} +2 -93
  36. package/dist/core/dist/transformPreset.d.ts +2 -1
  37. package/dist/core/dist/withDefaultStyleProps.d.ts +2 -1
  38. package/dist/core.d.ts +4 -1
  39. package/dist/core.js +4 -1
  40. package/dist/fixtures.d.ts +3 -1
  41. package/dist/fixtures.js +3 -1
  42. package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +13 -0
  43. package/dist/foundational-presets/dist/boldVibrant.d.ts +350 -0
  44. package/dist/foundational-presets/dist/brutalist.d.ts +350 -0
  45. package/dist/foundational-presets/dist/candy.d.ts +350 -0
  46. package/dist/foundational-presets/dist/cleanMinimalist.d.ts +350 -0
  47. package/dist/foundational-presets/dist/corporate.d.ts +350 -0
  48. package/dist/foundational-presets/dist/darkMoody.d.ts +350 -0
  49. package/dist/foundational-presets/dist/defaultPreset.d.ts +1 -1
  50. package/dist/foundational-presets/dist/defaultPreset.js +2 -312
  51. package/dist/foundational-presets/dist/forest.d.ts +350 -0
  52. package/dist/foundational-presets/dist/highContrast.d.ts +350 -0
  53. package/dist/foundational-presets/dist/lavender.d.ts +350 -0
  54. package/dist/foundational-presets/dist/luxury.d.ts +350 -0
  55. package/dist/foundational-presets/dist/monochrome.d.ts +350 -0
  56. package/dist/foundational-presets/dist/motion.d.ts +2 -1
  57. package/dist/foundational-presets/dist/neonCyber.d.ts +350 -0
  58. package/dist/foundational-presets/dist/newspaper.d.ts +350 -0
  59. package/dist/foundational-presets/dist/ocean.d.ts +350 -0
  60. package/dist/foundational-presets/dist/slate.d.ts +547 -196
  61. package/dist/foundational-presets/dist/style-props.js +1384 -0
  62. package/dist/foundational-presets/dist/sunset.d.ts +547 -196
  63. package/dist/foundational-presets/dist/terminal.d.ts +547 -196
  64. package/dist/foundational-presets/dist/warmOrganic.d.ts +547 -196
  65. package/dist/loader/dist/loader/style-transform.js +2 -1
  66. package/dist/loader/dist/packages/core/dist/color-opacity-map.js +33 -0
  67. package/dist/loader/dist/packages/core/dist/getStyles.js +3 -1
  68. package/dist/loader/dist/packages/core/dist/modifier-mappings.js +61 -0
  69. package/dist/{core/dist/propMappings.js → loader/dist/packages/core/dist/style-prop-data.js} +2 -150
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/dist/utils/dist/array-utils/closestItem.d.ts +2 -1
  72. package/dist/utils/dist/array-utils/removeItem.d.ts +2 -1
  73. package/dist/utils/dist/component-style-defaults.d.ts +2 -1
  74. package/dist/utils/dist/math-utils/clamp.d.ts +2 -1
  75. package/dist/utils/dist/motion-utils/interpolate.d.ts +2 -1
  76. package/dist/utils/dist/object-utils/entries.d.ts +2 -1
  77. package/dist/utils/dist/object-utils/flattenObj.d.ts +2 -1
  78. package/dist/utils/dist/object-utils/fromEntries.d.ts +2 -1
  79. package/dist/utils/dist/object-utils/keys.d.ts +2 -1
  80. package/dist/utils/dist/object-utils/mapKeys.d.ts +2 -1
  81. package/dist/utils/dist/object-utils/mapValues.d.ts +2 -1
  82. package/dist/utils/dist/string-utils/arrayToUnion.d.ts +2 -1
  83. package/dist/utils/dist/string-utils/capitalize.d.ts +2 -1
  84. package/dist/utils/dist/string-utils/componentClassName.d.ts +2 -1
  85. package/dist/utils/dist/string-utils/createTemplate.d.ts +2 -1
  86. package/dist/utils/dist/string-utils/cssVar.d.ts +2 -1
  87. package/dist/utils/dist/string-utils/cssVars.d.ts +2 -1
  88. package/dist/utils/dist/string-utils/dedent.d.ts +2 -1
  89. package/dist/utils/dist/string-utils/indent.d.ts +2 -1
  90. package/dist/utils/dist/string-utils/join.d.ts +2 -1
  91. package/dist/utils/dist/string-utils/kebabCase.d.ts +2 -1
  92. package/dist/utils/dist/string-utils/split.d.ts +2 -1
  93. package/dist/utils/dist/string-utils/tsProperties.d.ts +2 -1
  94. package/dist/utils.d.ts +1 -1
  95. package/package.json +3 -3
  96. package/dist/core/dist/propMappings.d.ts +0 -76
@@ -2,8 +2,9 @@ import { applyComponentStyleDefaults } from "../../../utils/dist/component-style
2
2
  import { kebabCase } from "../../../utils/dist/string-utils/kebabCase.js";
3
3
  import { componentVariantClass } from "../../../utils/dist/string-utils/componentClassName.js";
4
4
  import "../../../utils/dist/index.js";
5
+ import { colorPropToOpacityProp } from "../packages/core/dist/color-opacity-map.js";
5
6
  import { expandCompositeStyles } from "../packages/core/dist/compositeStyles.js";
6
- import { colorPropToOpacityProp, propMappings } from "../packages/core/dist/propMappings.js";
7
+ import { propMappings } from "../packages/core/dist/style-prop-data.js";
7
8
  import { toCamelCase } from "../packages/core/dist/getStyles.js";
8
9
  import "../packages/core/dist/index.js";
9
10
  import { buildDynamicClassExpression, parseHandlerString } from "./dynamic-style-codegen.js";
@@ -0,0 +1,33 @@
1
+ //#region ../loader/dist/packages/core/dist/color-opacity-map.js
2
+ /**
3
+ * Maps each color prop name to its corresponding opacity prop name.
4
+ * Used by the runtime (`getStyles`) and loader (`style-transform`) to merge
5
+ * a color value with its opacity before class generation.
6
+ *
7
+ * @example
8
+ * `bg="primary"` + `bgOpacity="75"` → class `bg-primary_75`
9
+ */
10
+ const colorPropToOpacityProp = {
11
+ bg: "bgOpacity",
12
+ color: "colorOpacity",
13
+ textDecorationColor: "textDecorationColorOpacity",
14
+ borderColor: "borderColorOpacity",
15
+ borderYColor: "borderYColorOpacity",
16
+ borderXColor: "borderXColorOpacity",
17
+ borderStartColor: "borderStartColorOpacity",
18
+ borderLeftColor: "borderLeftColorOpacity",
19
+ borderEndColor: "borderEndColorOpacity",
20
+ borderRightColor: "borderRightColorOpacity",
21
+ borderTopColor: "borderTopColorOpacity",
22
+ borderBottomColor: "borderBottomColorOpacity",
23
+ divideColor: "divideColorOpacity",
24
+ outlineColor: "outlineColorOpacity",
25
+ ringColor: "ringColorOpacity",
26
+ ringOffsetColor: "ringOffsetColorOpacity",
27
+ fillColor: "fillColorOpacity",
28
+ strokeColor: "strokeColorOpacity",
29
+ shadowColor: "shadowColorOpacity",
30
+ caretColor: "caretColorOpacity"
31
+ };
32
+ //#endregion
33
+ export { colorPropToOpacityProp };
@@ -1,7 +1,9 @@
1
1
  import "../../../../../utils/dist/index.js";
2
+ import { colorPropToOpacityProp } from "./color-opacity-map.js";
2
3
  import "./compositeStyles.js";
3
- import { colorPropToOpacityProp, modifierMappings, propMappings } from "./propMappings.js";
4
+ import { propMappings } from "./style-prop-data.js";
4
5
  import { stylePropsTwMap } from "./generated/stylePropsTwMap.js";
6
+ import { modifierMappings } from "./modifier-mappings.js";
5
7
  //#region ../loader/dist/packages/core/dist/getStyles.js
6
8
  /** Convert kebab-case CSS property to camelCase for React inline styles.
7
9
  * CSS custom properties (--*) are kept as-is since React supports them verbatim. */
@@ -0,0 +1,61 @@
1
+ //#region ../loader/dist/packages/core/dist/modifier-mappings.js
2
+ const modifierMappings = {
3
+ _after: "after:",
4
+ _hover: "hover:",
5
+ _focus: "focus:",
6
+ _focusWithin: "focus-within:",
7
+ _focusVisible: "focus-visible:",
8
+ _active: "active:",
9
+ _visited: "visited:",
10
+ _target: "target:",
11
+ _first: "first:",
12
+ _last: "last:",
13
+ _only: "only:",
14
+ _odd: "odd:",
15
+ _even: "even:",
16
+ _firstOfType: "first-of-type:",
17
+ _lastOfType: "last-of-type:",
18
+ _onlyOfType: "only-of-type:",
19
+ _empty: "empty:",
20
+ _disabled: "disabled:",
21
+ _enabled: "enabled:",
22
+ _checked: "checked:",
23
+ _indeterminate: "indeterminate:",
24
+ _default: "default:",
25
+ _required: "required:",
26
+ _valid: "valid:",
27
+ _invalid: "invalid:",
28
+ _inRange: "in-range:",
29
+ _outOfRange: "out-of-range:",
30
+ _placeholderShown: "placeholder-shown:",
31
+ _autofill: "autofill:",
32
+ _readonly: "read-only:",
33
+ _file: "file:",
34
+ _selection: "selection:",
35
+ _backdrop: "backdrop:",
36
+ _motionReduce: "motion-reduce:",
37
+ _motionSafe: "motion-safe:",
38
+ _contrastMore: "contrast-more:",
39
+ _contrastLess: "contrast-less:",
40
+ _forcedColors: "forced-colors:",
41
+ _placeholder: "placeholder:",
42
+ _ariaBusy: "aria-busy:",
43
+ _ariaChecked: "aria-checked:",
44
+ _ariaHidden: "aria-hidden:",
45
+ _ariaPressed: "aria-pressed:",
46
+ _ariaReadonly: "aria-readonly:",
47
+ _ariaRequired: "aria-required:",
48
+ _ariaSelected: "aria-selected:",
49
+ _ariaCurrent: "aria-[current]:",
50
+ _ariaDisabled: "aria-disabled:",
51
+ _ariaExpanded: "aria-expanded:",
52
+ _dataDisabled: "data-[disabled=true]:",
53
+ _dataStateOpen: "data-[state=open]:",
54
+ _dataStateClosed: "data-[state=closed]:",
55
+ _startingStyle: "starting-style:",
56
+ _scrollbar: "*::-webkit-scrollbar:",
57
+ _scrollbarThumb: "*::-webkit-scrollbar-thumb:",
58
+ _scrollbarTrack: "*::-webkit-scrollbar-track:"
59
+ };
60
+ //#endregion
61
+ export { modifierMappings };
@@ -1,4 +1,4 @@
1
- //#region ../core/dist/propMappings.js
1
+ //#region ../loader/dist/packages/core/dist/style-prop-data.js
2
2
  const propMappings = {
3
3
  animation: {
4
4
  classPrefix: "animation",
@@ -1253,153 +1253,5 @@ const propMappings = {
1253
1253
  augmentType: "CustomTextShadow"
1254
1254
  }
1255
1255
  };
1256
- /**
1257
- * Built-in modifier mappings (pseudo-classes, pseudo-elements, etc.).
1258
- * Custom modifiers from defineModes() are handled dynamically in the runtime.
1259
- */
1260
- const modifierMappings = {
1261
- _after: "after:",
1262
- _hover: "hover:",
1263
- _focus: "focus:",
1264
- _focusWithin: "focus-within:",
1265
- _focusVisible: "focus-visible:",
1266
- _active: "active:",
1267
- _visited: "visited:",
1268
- _target: "target:",
1269
- _first: "first:",
1270
- _last: "last:",
1271
- _only: "only:",
1272
- _odd: "odd:",
1273
- _even: "even:",
1274
- _firstOfType: "first-of-type:",
1275
- _lastOfType: "last-of-type:",
1276
- _onlyOfType: "only-of-type:",
1277
- _empty: "empty:",
1278
- _disabled: "disabled:",
1279
- _enabled: "enabled:",
1280
- _checked: "checked:",
1281
- _indeterminate: "indeterminate:",
1282
- _default: "default:",
1283
- _required: "required:",
1284
- _valid: "valid:",
1285
- _invalid: "invalid:",
1286
- _inRange: "in-range:",
1287
- _outOfRange: "out-of-range:",
1288
- _placeholderShown: "placeholder-shown:",
1289
- _autofill: "autofill:",
1290
- _readonly: "read-only:",
1291
- _file: "file:",
1292
- _selection: "selection:",
1293
- _backdrop: "backdrop:",
1294
- _motionReduce: "motion-reduce:",
1295
- _motionSafe: "motion-safe:",
1296
- _contrastMore: "contrast-more:",
1297
- _contrastLess: "contrast-less:",
1298
- _forcedColors: "forced-colors:",
1299
- _placeholder: "placeholder:",
1300
- _ariaBusy: "aria-busy:",
1301
- _ariaChecked: "aria-checked:",
1302
- _ariaHidden: "aria-hidden:",
1303
- _ariaPressed: "aria-pressed:",
1304
- _ariaReadonly: "aria-readonly:",
1305
- _ariaRequired: "aria-required:",
1306
- _ariaSelected: "aria-selected:",
1307
- _ariaCurrent: "aria-[current]:",
1308
- _ariaDisabled: "aria-disabled:",
1309
- _ariaExpanded: "aria-expanded:",
1310
- _dataDisabled: "data-[disabled=true]:",
1311
- _dataStateOpen: "data-[state=open]:",
1312
- _dataStateClosed: "data-[state=closed]:",
1313
- _startingStyle: "starting-style:",
1314
- _scrollbar: "*::-webkit-scrollbar:",
1315
- _scrollbarThumb: "*::-webkit-scrollbar-thumb:",
1316
- _scrollbarTrack: "*::-webkit-scrollbar-track:"
1317
- };
1318
- /** Maps ConfigurableProp names to propMappings keys when they differ */
1319
- const configurablePropAliases = {};
1320
- /** Look up a PropMapping by ConfigurableProp name */
1321
- function getConfigurablePropMapping(prop) {
1322
- return propMappings[configurablePropAliases[prop] ?? prop];
1323
- }
1324
- /**
1325
- * Derives the configurable properties table from propMappings.
1326
- * Groups props by augmentType — the primary prop is the one matching
1327
- * a ConfigurableProp name, the rest are sub-properties.
1328
- */
1329
- function getConfigurableProperties() {
1330
- const byAugment = {};
1331
- for (const [prop, mapping] of Object.entries(propMappings)) {
1332
- if (!mapping.augmentType) continue;
1333
- const aug = mapping.augmentType;
1334
- if (!byAugment[aug]) byAugment[aug] = [];
1335
- byAugment[aug].push(prop);
1336
- }
1337
- const entries = [];
1338
- for (const [augmentType, props] of Object.entries(byAugment)) {
1339
- const sorted = [...props].sort((a, b) => a.length - b.length);
1340
- const primary = sorted[0];
1341
- const subs = sorted.slice(1);
1342
- entries.push({
1343
- property: primary,
1344
- subProperties: subs,
1345
- augmentType
1346
- });
1347
- }
1348
- return entries;
1349
- }
1350
- /**
1351
- * Derives the CSS variable prefix table from propMappings.
1352
- * Only includes props that have both cssProperty and defaultVarPrefix.
1353
- * Deduplicates by defaultVarPrefix so each namespace appears once.
1354
- */
1355
- function getCssVariablePrefixes() {
1356
- const seen = /* @__PURE__ */ new Set();
1357
- const entries = [];
1358
- for (const [prop, mapping] of Object.entries(propMappings)) {
1359
- if (!mapping.defaultVarPrefix || !mapping.cssProperty) continue;
1360
- if (seen.has(mapping.defaultVarPrefix)) continue;
1361
- seen.add(mapping.defaultVarPrefix);
1362
- const prefix = `--uds-${mapping.defaultVarPrefix}-*`;
1363
- const exampleToken = mapping.defaultVarPrefix.includes("color") ? "brand" : mapping.defaultVarPrefix === "spacing" ? "4" : mapping.defaultVarPrefix === "radius" ? "lg" : mapping.defaultVarPrefix === "border-width" ? "2" : "value";
1364
- const exampleVar = `--uds-${mapping.defaultVarPrefix}-${exampleToken}`;
1365
- const exampleUtility = `${mapping.classPrefix}-${exampleToken}`;
1366
- entries.push({
1367
- property: prop,
1368
- cssPrefix: prefix,
1369
- exampleVariable: exampleVar,
1370
- exampleUtility
1371
- });
1372
- }
1373
- return entries;
1374
- }
1375
- /**
1376
- * Maps each color prop name to its corresponding opacity prop name.
1377
- * Used by runtime (getStyles) and loader (style-transform) to merge
1378
- * a color value with its opacity before class generation.
1379
- *
1380
- * e.g. `bg="primary"` + `bgOpacity="75"` → class `bg-primary_75`
1381
- */
1382
- const colorPropToOpacityProp = {
1383
- bg: "bgOpacity",
1384
- color: "colorOpacity",
1385
- textDecorationColor: "textDecorationColorOpacity",
1386
- borderColor: "borderColorOpacity",
1387
- borderYColor: "borderYColorOpacity",
1388
- borderXColor: "borderXColorOpacity",
1389
- borderStartColor: "borderStartColorOpacity",
1390
- borderLeftColor: "borderLeftColorOpacity",
1391
- borderEndColor: "borderEndColorOpacity",
1392
- borderRightColor: "borderRightColorOpacity",
1393
- borderTopColor: "borderTopColorOpacity",
1394
- borderBottomColor: "borderBottomColorOpacity",
1395
- divideColor: "divideColorOpacity",
1396
- outlineColor: "outlineColorOpacity",
1397
- ringColor: "ringColorOpacity",
1398
- ringOffsetColor: "ringOffsetColorOpacity",
1399
- fillColor: "fillColorOpacity",
1400
- strokeColor: "strokeColorOpacity",
1401
- shadowColor: "shadowColorOpacity",
1402
- caretColor: "caretColorOpacity"
1403
- };
1404
1256
  //#endregion
1405
- export { colorPropToOpacityProp, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes, modifierMappings, propMappings };
1257
+ export { propMappings };