@yahoo/uds-v5-wip 1.3.0 → 1.5.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 (70) hide show
  1. package/dist/config/dist/createConfig.d.ts +47 -35
  2. package/dist/config/dist/createConfig.js +136 -12
  3. package/dist/config/dist/index.d.ts +2 -0
  4. package/dist/config/dist/index.js +1 -0
  5. package/dist/config/dist/preset-merge.js +8 -1
  6. package/dist/config/dist/resolvedMappings.d.ts +22 -0
  7. package/dist/config/dist/resolvedMappings.js +43 -0
  8. package/dist/config/dist/serialize.js +14 -11
  9. package/dist/config/dist/types.d.ts +94 -0
  10. package/dist/config.d.ts +4739 -3329
  11. package/dist/config.js +2 -1
  12. package/dist/core/dist/createComponent.d.ts +2 -1
  13. package/dist/core/dist/createComponentExample.d.ts +2 -1
  14. package/dist/core/dist/createProvider.d.ts +2 -1
  15. package/dist/core/dist/generated/stylePropsTwMap.d.ts +2 -1
  16. package/dist/core/dist/getComponentStyles.d.ts +2 -1
  17. package/dist/core/dist/getStyles.d.ts +2 -1
  18. package/dist/core/dist/getStyles.js +1 -1
  19. package/dist/core/dist/macros.d.ts +2 -1
  20. package/dist/core/dist/propMappings.d.ts +2 -1
  21. package/dist/core/dist/resolveMotionState.d.ts +2 -1
  22. package/dist/core/dist/resolveProps.boundaries.js +1 -0
  23. package/dist/core/dist/transformPreset.d.ts +2 -1
  24. package/dist/core/dist/withDefaultStyleProps.d.ts +2 -1
  25. package/dist/foundational-presets/dist/boldVibrant.d.ts +4981 -3393
  26. package/dist/foundational-presets/dist/boldVibrant.js +221 -317
  27. package/dist/foundational-presets/dist/brutalist.d.ts +4981 -3393
  28. package/dist/foundational-presets/dist/brutalist.js +221 -317
  29. package/dist/foundational-presets/dist/candy.d.ts +4981 -3393
  30. package/dist/foundational-presets/dist/candy.js +221 -317
  31. package/dist/foundational-presets/dist/cleanMinimalist.d.ts +4981 -3393
  32. package/dist/foundational-presets/dist/cleanMinimalist.js +221 -317
  33. package/dist/foundational-presets/dist/corporate.d.ts +4981 -3393
  34. package/dist/foundational-presets/dist/corporate.js +221 -317
  35. package/dist/foundational-presets/dist/darkMoody.d.ts +4981 -3393
  36. package/dist/foundational-presets/dist/darkMoody.js +221 -317
  37. package/dist/foundational-presets/dist/defaultPreset.d.ts +4736 -3327
  38. package/dist/foundational-presets/dist/defaultPreset.js +1107 -1609
  39. package/dist/foundational-presets/dist/forest.d.ts +4981 -3393
  40. package/dist/foundational-presets/dist/forest.js +221 -317
  41. package/dist/foundational-presets/dist/highContrast.d.ts +4981 -3393
  42. package/dist/foundational-presets/dist/highContrast.js +221 -317
  43. package/dist/foundational-presets/dist/lavender.d.ts +4981 -3393
  44. package/dist/foundational-presets/dist/lavender.js +221 -317
  45. package/dist/foundational-presets/dist/luxury.d.ts +4981 -3393
  46. package/dist/foundational-presets/dist/luxury.js +221 -317
  47. package/dist/foundational-presets/dist/monochrome.d.ts +4981 -3393
  48. package/dist/foundational-presets/dist/monochrome.js +221 -317
  49. package/dist/foundational-presets/dist/motion.d.ts +2 -1
  50. package/dist/foundational-presets/dist/neonCyber.d.ts +4981 -3393
  51. package/dist/foundational-presets/dist/neonCyber.js +221 -317
  52. package/dist/foundational-presets/dist/newspaper.d.ts +4981 -3393
  53. package/dist/foundational-presets/dist/newspaper.js +221 -317
  54. package/dist/foundational-presets/dist/ocean.d.ts +4981 -3393
  55. package/dist/foundational-presets/dist/ocean.js +221 -317
  56. package/dist/foundational-presets/dist/slate.d.ts +4981 -3393
  57. package/dist/foundational-presets/dist/slate.js +221 -317
  58. package/dist/foundational-presets/dist/sunset.d.ts +4981 -3393
  59. package/dist/foundational-presets/dist/sunset.js +221 -317
  60. package/dist/foundational-presets/dist/terminal.d.ts +4981 -3393
  61. package/dist/foundational-presets/dist/terminal.js +221 -317
  62. package/dist/foundational-presets/dist/warmOrganic.d.ts +4981 -3393
  63. package/dist/foundational-presets/dist/warmOrganic.js +221 -317
  64. package/dist/loader/dist/loader/dynamic-style-codegen.js +3 -2
  65. package/dist/loader/dist/loader/style-transform.js +1 -1
  66. package/dist/loader/dist/packages/core/dist/getStyles.js +1 -1
  67. package/dist/tsconfig.tsbuildinfo +1 -1
  68. package/dist/utils/dist/string-utils/cssVar.d.ts +4 -2
  69. package/dist/utils/dist/string-utils/cssVar.js +5 -3
  70. package/package.json +3 -3
package/dist/config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { defaultColors } from "./config/dist/consts/defaultColors.js";
2
2
  import { buildTokenReference, createConfigBuilder, darker, lighter, resolveConfig } from "./config/dist/createConfig.js";
3
+ import { resolveUtilityMappings } from "./config/dist/resolvedMappings.js";
3
4
  import { buildReverseMap, deserializeConfig, serializeConfig } from "./config/dist/serialize.js";
4
5
  import "./config/dist/index.js";
5
6
  import { defaultPreset as defaultPreset$1 } from "./presets/dist/defaultPreset.js";
@@ -19,4 +20,4 @@ const uds = createConfigBuilder({
19
20
  });
20
21
  const defaultPreset = defaultPreset$1;
21
22
  //#endregion
22
- export { buildReverseMap, buildTokenReference, createConfigBuilder, darker, defaultColors, defaultPreset, deserializeConfig, lighter, resolveConfig, serializeConfig, uds };
23
+ export { buildReverseMap, buildTokenReference, createConfigBuilder, darker, defaultColors, defaultPreset, deserializeConfig, lighter, resolveConfig, resolveUtilityMappings, serializeConfig, uds };
@@ -1,6 +1,7 @@
1
1
  import { CreateComponentConfig, CreateComponentProps, CreateComponentRenderFn, CreateComponentSlotTagConfig, CreateComponentTypeInput } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/createComponent.d.ts
4
+ //#region src/createComponent.d.ts
4
5
  type PrimitiveTag = keyof React.JSX.IntrinsicElements;
5
6
  type SpecConfig<TSpec> = TSpec extends {
6
7
  config: infer TConfig extends CreateComponentTypeInput;
@@ -51,6 +52,6 @@ declare function createComponent<TSpecOrProps = {}>(tag: PrimitiveTag): React.FC
51
52
  props: infer TOwnProps;
52
53
  } ? CreateComponentProps<TConfig, TOwnProps, PrimitiveTag> : PrimitiveOwnProps<TSpecOrProps>>;
53
54
  declare function createComponent<TSpec>(renderFn: CreateComponentRenderFn<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>): React.FC<CreateComponentProps<SpecConfig<TSpec>, SpecOwnProps<TSpec>, SpecSlotConfig<TSpec>>>;
54
- declare function createComponent(config: CreateComponentConfig<string>, renderFn: CreateComponentRenderFn<any, any, any>): React.FC<any>;
55
+ declare function createComponent(config: CreateComponentConfig<string>, renderFn: CreateComponentRenderFn<any, any, any>): React.FC<any>; //#endregion
55
56
  //#endregion
56
57
  export { createComponent };
@@ -1,6 +1,7 @@
1
1
  import { ComponentProps, ComponentType } from "react";
2
2
 
3
3
  //#region ../core/dist/createComponentExample.d.ts
4
+ //#region src/createComponentExample.d.ts
4
5
  /**
5
6
  * Extracts variant fixtures from a Component's props type.
6
7
  * If Button has `variant?: 'brand' | 'outline'` and `size?: 'sm' | 'md'`,
@@ -36,6 +37,6 @@ type ExamplesResult<TComponent extends ComponentType<any>> = {
36
37
  * }));
37
38
  * ```
38
39
  */
39
- declare function createComponentExample<TComponent extends ComponentType<any>, T extends Record<string, ExampleFn<TComponent>>>(Component: TComponent, examplesFn: (fixtures: VariantFixtures<TComponent>) => ExamplesResult<TComponent>): ComponentExample<T>;
40
+ declare function createComponentExample<TComponent extends ComponentType<any>, T extends Record<string, ExampleFn<TComponent>>>(Component: TComponent, examplesFn: (fixtures: VariantFixtures<TComponent>) => ExamplesResult<TComponent>): ComponentExample<T>; //#endregion
40
41
  //#endregion
41
42
  export { ComponentExample, createComponentExample };
@@ -1,4 +1,5 @@
1
1
  //#region ../core/dist/createProvider.d.ts
2
+ //#region src/createProvider.d.ts
2
3
  type ProviderRenderFn<TContext, TProps = Record<never, never>> = (props: {
3
4
  children: React.ReactNode;
4
5
  } & TProps) => {
@@ -7,6 +8,6 @@ type ProviderRenderFn<TContext, TProps = Record<never, never>> = (props: {
7
8
  };
8
9
  declare function createProvider<TContext, TProps = Record<never, never>>(name: string, renderFn: ProviderRenderFn<TContext, TProps>): [React.FC<{
9
10
  children: React.ReactNode;
10
- } & TProps>, () => TContext];
11
+ } & TProps>, () => TContext]; //#endregion
11
12
  //#endregion
12
13
  export { createProvider };
@@ -1,4 +1,5 @@
1
1
  //#region ../core/dist/generated/stylePropsTwMap.d.ts
2
+ //#region src/generated/stylePropsTwMap.d.ts
2
3
  declare const stylePropsTwMap: {
3
4
  readonly "border-boolean": {
4
5
  readonly border: "boolean";
@@ -1695,6 +1696,6 @@ declare const stylePropsTwMap: {
1695
1696
  readonly "hyphens-manual": {
1696
1697
  readonly hyphens: "manual";
1697
1698
  };
1698
- };
1699
+ }; //#endregion
1699
1700
  //#endregion
1700
1701
  export { stylePropsTwMap };
@@ -1,6 +1,7 @@
1
1
  import { ComponentRegistry, ComponentSlotsOf, ComponentVariantsOf } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/getComponentStyles.d.ts
4
+ //#region src/getComponentStyles.d.ts
4
5
  type ResolveSlots<Name extends string> = Name extends keyof ComponentRegistry ? ComponentSlotsOf<Name> : string;
5
6
  type ResolveVariants<Name extends string> = Name extends keyof ComponentRegistry ? ComponentVariantsOf<Name> : Record<string, string>;
6
7
  interface UdsRuntimeMeta {
@@ -44,6 +45,6 @@ interface ComponentStyler<Name extends string> {
44
45
  * @param slots - Array of slot names
45
46
  * @param element - Optional HTML element tag for element-specific prop forwarding
46
47
  */
47
- declare function createComponentStyler<Name extends string>(componentName: Name, slots: readonly string[], element?: string, variants?: readonly string[]): ComponentStyler<Name>;
48
+ declare function createComponentStyler<Name extends string>(componentName: Name, slots: readonly string[], element?: string, variants?: readonly string[]): ComponentStyler<Name>; //#endregion
48
49
  //#endregion
49
50
  export { createComponentStyler };
@@ -2,6 +2,7 @@ import { ClassValue } from "clsx";
2
2
  import { ModifierProp, ModifierProps, StyleAndModifierProps, StyleProps } from "@uds/types";
3
3
 
4
4
  //#region ../core/dist/getStyles.d.ts
5
+ //#region src/getStyles.d.ts
5
6
  /** Convert kebab-case CSS property to camelCase for React inline styles.
6
7
  * CSS custom properties (--*) are kept as-is since React supports them verbatim. */
7
8
  declare function toCamelCase(str: string): string;
@@ -37,6 +38,6 @@ interface GetStylesParams extends StyleProps, ModifierProps {
37
38
  * so they can be included in the CSS safelist.
38
39
  */
39
40
  declare function getStyles(props: GetStylesParams): string;
40
- declare function getVariantClassName(componentName: string, variant: string | undefined): string;
41
+ declare function getVariantClassName(componentName: string, variant: string | undefined): string; //#endregion
41
42
  //#endregion
42
43
  export { createVariants, cx, getStyles, getVariantClassName, processStyleProps, toCamelCase };
@@ -112,7 +112,7 @@ function createVariants(variants) {
112
112
  }
113
113
  const parse = (prefix, value) => {
114
114
  if (value === "") return prefix;
115
- return (prefix === value ? String(value) : `${prefix}-${value}`).replace(/[./]/g, "_");
115
+ return (prefix === value ? String(value) : `${prefix}-${value}`).replace(/\./g, "_").replace(/\//g, "-");
116
116
  };
117
117
  const classnames = {};
118
118
  const styleOptionsByProp = {};
@@ -1,6 +1,7 @@
1
1
  import { MacroConfig } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/macros.d.ts
4
+ //#region src/macros.d.ts
4
5
  /** Set the macro config (called by loader at build time) */
5
6
  declare function setMacroConfig(config: MacroConfig): void;
6
7
  /** Get the current macro config */
@@ -16,6 +17,6 @@ declare function getMacroConfig(): MacroConfig;
16
17
  declare function expandMacros(props: Record<string, unknown>, config?: MacroConfig): {
17
18
  expanded: Record<string, unknown>;
18
19
  markerClasses: string[];
19
- };
20
+ }; //#endregion
20
21
  //#endregion
21
22
  export { expandMacros, getMacroConfig, setMacroConfig };
@@ -1,6 +1,7 @@
1
1
  import { ConfigurableProp, ModifierProp, StyleProp } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/propMappings.d.ts
4
+ //#region src/propMappings.d.ts
4
5
  interface PropMapping {
5
6
  /** Class name prefix for runtime class generation. 'no-prefix' means value IS the class. */
6
7
  classPrefix: string;
@@ -71,6 +72,6 @@ interface ModifierEntry {
71
72
  *
72
73
  * e.g. `bg="primary"` + `bgOpacity="75"` → class `bg-primary_75`
73
74
  */
74
- declare const colorPropToOpacityProp: Record<string, string>;
75
+ declare const colorPropToOpacityProp: Record<string, string>; //#endregion
75
76
  //#endregion
76
77
  export { ConfigurablePropertyEntry, CssVariablePrefixEntry, ModifierEntry, PropMapping, colorPropToOpacityProp, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes, modifierMappings, propMappings };
@@ -1,4 +1,5 @@
1
1
  //#region ../core/dist/resolveMotionState.d.ts
2
- declare function resolveMotionState(stateKeyframe: Record<string, unknown>, index: number): Record<string, number>;
2
+ //#region src/resolveMotionState.d.ts
3
+ declare function resolveMotionState(stateKeyframe: Record<string, unknown>, index: number): Record<string, number>; //#endregion
3
4
  //#endregion
4
5
  export { resolveMotionState };
@@ -8,6 +8,7 @@ function isPatternMatchedHtmlProp(key) {
8
8
  /** HTML attributes that are universally forwarded on every element. */
9
9
  const UNIVERSAL_HTML_PROPS = new Set([
10
10
  "id",
11
+ "ref",
11
12
  "style",
12
13
  "tabIndex",
13
14
  "role",
@@ -1,6 +1,7 @@
1
1
  import { MotionPreset } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/transformPreset.d.ts
4
+ //#region src/transformPreset.d.ts
4
5
  interface TransformedMotionProps {
5
6
  initial?: Record<string, unknown>;
6
7
  animate?: Record<string, unknown>;
@@ -12,6 +13,6 @@ interface TransformedMotionProps {
12
13
  /**
13
14
  * Convert a JS-runtime MotionPreset to a motion/react-compatible props object.
14
15
  */
15
- declare function transformPreset(preset: MotionPreset): TransformedMotionProps;
16
+ declare function transformPreset(preset: MotionPreset): TransformedMotionProps; //#endregion
16
17
  //#endregion
17
18
  export { TransformedMotionProps, transformPreset };
@@ -1,6 +1,7 @@
1
1
  import { BorderRadius, GridSpan, GridStartEnd, GridTemplate, StyleAndModifierProps } from "@uds/types";
2
2
 
3
3
  //#region ../core/dist/withDefaultStyleProps.d.ts
4
+ //#region src/withDefaultStyleProps.d.ts
4
5
  interface StackDefaultsInput extends StyleAndModifierProps {
5
6
  gap?: StyleAndModifierProps['gap'];
6
7
  }
@@ -38,6 +39,6 @@ declare const withDefaultStyleProps: {
38
39
  shape?: BorderRadius;
39
40
  }) => StyleAndModifierProps;
40
41
  Svg: (props: SvgDefaultsInput) => StyleAndModifierProps;
41
- };
42
+ }; //#endregion
42
43
  //#endregion
43
44
  export { withDefaultStyleProps };