@yahoo/uds-create-config 2.13.6 → 2.15.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.
package/dist/types.d.ts CHANGED
@@ -26,6 +26,16 @@ type TokenType = string;
26
26
  */
27
27
  type TokenValue = string | number | boolean | TokenRef | AssetRef | ColorExpression;
28
28
  type TokenModifierKey = `_${string}`;
29
+ /**
30
+ * Platform-neutral authored token definition. Web and native configs share
31
+ * the definition envelope (value, type, link provenance, and nested modifier
32
+ * overrides) while supplying their own supported value union.
33
+ */
34
+ type TokenDefinitionFor<TValue> = {
35
+ value: TValue;
36
+ type?: TokenType; /** Set when this token is linked from another system — see {@link SystemLink}. */
37
+ link?: SystemLink;
38
+ } & { [K in `_${string}`]?: TValue | TokenDefinitionFor<TValue> };
29
39
  type TokenModifierValue = TokenValue | TokenDefinition;
30
40
  /**
31
41
  * Provenance marker on an entity linked from another system: it records where
@@ -64,11 +74,7 @@ interface SystemLink {
64
74
  * time so consumers reading the class instance work with the
65
75
  * doc-described class shape.
66
76
  */
67
- type TokenDefinition = {
68
- value: TokenValue;
69
- type?: TokenType; /** Set when this token is linked from another system — see {@link SystemLink}. */
70
- link?: SystemLink;
71
- } & { [K in `_${string}`]?: TokenModifierValue };
77
+ type TokenDefinition = TokenDefinitionFor<TokenValue>;
72
78
  /**
73
79
  * Authored shape — the bare tokens record. Mirrors the old `@yahoo/uds-create-config`
74
80
  * `defineTokenGroup(tokens)` signature: input is the tokens map; group
@@ -82,11 +88,12 @@ type TokenDefinition = {
82
88
  * appear here. Tokens nest under `tokens` so a token named `'label'`
83
89
  * (or any meta key) can never collide with group metadata.
84
90
  */
85
- interface TokenGroupDefinition {
86
- tokens: Record<string, TokenDefinition>;
91
+ interface TokenGroupDefinitionFor<TDefinition> {
92
+ tokens: Record<string, TDefinition>;
87
93
  label?: string;
88
94
  description?: string;
89
95
  }
96
+ type TokenGroupDefinition = TokenGroupDefinitionFor<TokenDefinition>;
90
97
  /**
91
98
  * Alias for the on-disk wire shape — structurally identical to
92
99
  * `TokenGroupDefinition`. Used as the return type of
@@ -1100,4 +1107,4 @@ interface SerializedConfig {
1100
1107
  linkedComponents?: Record<string, LinkedSystemEntry>;
1101
1108
  }
1102
1109
  //#endregion
1103
- export { AnyStylePropDefinition, ArbitraryEntry, ArbitrarySpec, BaseStyles, BuildOptions, CanvasRole, CanvasRoleEntry, CanvasRoleEntryInput, CanvasRolesDefinition, CanvasRolesDefinitionInput, CanvasRolesInputConstraint, ComponentDefinition, ComponentGroupDefinition, ComponentMetadata, ComponentMotionValue, CompositeStyleDefinition, CompositeStyleObject, CompoundPropsEntry, CssMotionDefinition, CssMotionFields, CssSlotMotion, FontAssetMember, GlobalStylesDef, JsMotionDefinition, JsMotionFields, JsSlotMotion, LayerInput, LinkedComponentsInput, LinkedSystemEntry, LiteralFor, ModeDefinition, ModeOptionDefinition, ModifierDefinition, MotionDefinitionInput, MotionDragBox, MotionKeyframes, MotionMetadata, MotionState, MotionStateKeyframe, MotionTransition, MotionVariants, MotionViewportOptions, OpacityPairSpec, PlaygroundOptions, PlaygroundPage, PlaygroundSpec, PreviewDefinition, PropBinding, RefElement, RefTag, RootTag, SerializedAssetGroup, SerializedComponent, SerializedComponentGroup, SerializedConfig, SerializedFontAssetGroup, SerializedIconAssetGroup, SerializedPlaygroundOptions, SerializedTokenGroup, SlotMotion, StylePropDefinition, StylePropMetadata, StylePropProperty, SystemLink, TokenDefinition, TokenGroupDefinition, TokenModifierKey, TokenModifierValue, TokenType, TokenValue, ValuesEntry };
1110
+ export { AnyStylePropDefinition, ArbitraryEntry, ArbitrarySpec, BaseStyles, BuildOptions, CanvasRole, CanvasRoleEntry, CanvasRoleEntryInput, CanvasRolesDefinition, CanvasRolesDefinitionInput, CanvasRolesInputConstraint, ComponentDefinition, ComponentGroupDefinition, ComponentMetadata, ComponentMotionValue, CompositeStyleDefinition, CompositeStyleObject, CompoundPropsEntry, CssMotionDefinition, CssMotionFields, CssSlotMotion, FontAssetMember, GlobalStylesDef, JsMotionDefinition, JsMotionFields, JsSlotMotion, LayerInput, LinkedComponentsInput, LinkedSystemEntry, LiteralFor, ModeDefinition, ModeOptionDefinition, ModifierDefinition, MotionDefinitionInput, MotionDragBox, MotionKeyframes, MotionMetadata, MotionState, MotionStateKeyframe, MotionTransition, MotionVariants, MotionViewportOptions, OpacityPairSpec, PlaygroundOptions, PlaygroundPage, PlaygroundSpec, PreviewDefinition, PropBinding, RefElement, RefTag, RootTag, SerializedAssetGroup, SerializedComponent, SerializedComponentGroup, SerializedConfig, SerializedFontAssetGroup, SerializedIconAssetGroup, SerializedPlaygroundOptions, SerializedTokenGroup, SlotMotion, StylePropDefinition, StylePropMetadata, StylePropProperty, SystemLink, TokenDefinition, TokenDefinitionFor, TokenGroupDefinition, TokenGroupDefinitionFor, TokenModifierKey, TokenModifierValue, TokenType, TokenValue, ValuesEntry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-config",
3
- "version": "2.13.6",
3
+ "version": "2.15.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "files": [
@@ -11,6 +11,10 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "default": "./dist/index.js"
13
13
  },
14
+ "./native": {
15
+ "types": "./dist/native.d.ts",
16
+ "default": "./dist/native.js"
17
+ },
14
18
  "./utils": {
15
19
  "types": "./dist/utils/index.d.ts",
16
20
  "default": "./dist/utils/index.js"
@@ -68,8 +72,8 @@
68
72
  "dependencies": {
69
73
  "@babel/parser": "^7.29.0",
70
74
  "motion": "^12.35.0",
71
- "@yahoo/uds-create-types": "2.13.6",
72
- "@yahoo/uds-create-utils": "2.13.6"
75
+ "@yahoo/uds-create-types": "2.15.0",
76
+ "@yahoo/uds-create-utils": "2.15.0"
73
77
  },
74
78
  "devDependencies": {
75
79
  "@babel/types": "^7.29.0",