@yahoo/uds 2.11.0 → 3.0.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/cli/ButtonFile2.mock.tsx +11 -0
- package/cli/bin/uds-darwin-arm64-baseline +0 -0
- package/cli/bin/uds-linux-arm64 +0 -0
- package/cli/bin/uds-linux-x64-baseline +0 -0
- package/cli/cli.ts +1 -1
- package/cli/codemods/addCommentAboveComponents.ts +9 -3
- package/cli/codemods/flattenButtonVariant.ts +143 -0
- package/cli/codemods/utils/index.ts +1 -1
- package/cli/commands/codemod/flattenButtonVariant.ts +16 -0
- package/cli/commands/expo/_setup.ts +1 -0
- package/cli/commands/sync.ts +3 -0
- package/cli/preload.ts +1 -0
- package/cli/tailwindcss.d.ts +2 -0
- package/cli/tsconfig.json +30 -8
- package/cli/utils/auth.ts +1 -0
- package/cli/utils/configWorker.ts +11 -3
- package/cli/utils/purgeCSS.ts +21 -9
- package/cli/utils/setupConfigWorker.ts +2 -2
- package/cli/utils/sortKeys.ts +5 -0
- package/cli/utils/types.ts +3 -1
- package/dist/{Text-UCDorZDD.d.cts → Text-yeQcITg9.d.cts} +30 -69
- package/dist/{Text-UCDorZDD.d.ts → Text-yeQcITg9.d.ts} +30 -69
- package/dist/VStack-CJs5afN8.d.ts +145 -0
- package/dist/VStack-GpQHE4xQ.d.cts +145 -0
- package/dist/chunk-4G4TBHHL.js +2 -0
- package/dist/chunk-6CVEYTLQ.js +2 -0
- package/dist/chunk-6XNKVFUM.cjs +2 -0
- package/dist/chunk-AFPPCX7S.js +2 -0
- package/dist/chunk-BNLUH23E.cjs +1 -0
- package/dist/chunk-EWJ3J526.js +2 -0
- package/dist/chunk-FOX6Q5GR.cjs +1 -0
- package/dist/chunk-HTL6WRXY.cjs +1 -0
- package/dist/chunk-J7PUOUXC.cjs +1 -0
- package/dist/chunk-N3FKHXEJ.js +2 -0
- package/dist/chunk-NUEZVMWZ.cjs +1 -0
- package/dist/chunk-O26JIFUR.cjs +3 -0
- package/dist/chunk-S5UKKXRV.js +2 -0
- package/dist/chunk-WCB4EHGZ.js +3 -0
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.d.cts +913 -21
- package/dist/client/index.d.ts +913 -21
- package/dist/client/index.js +3 -3
- package/dist/experimental/client/index.cjs +2 -2
- package/dist/experimental/client/index.d.cts +14 -49
- package/dist/experimental/client/index.d.ts +14 -49
- package/dist/experimental/client/index.js +2 -2
- package/dist/experimental/index.cjs +2 -2
- package/dist/experimental/index.d.cts +4 -55
- package/dist/experimental/index.d.ts +4 -55
- package/dist/experimental/index.js +1 -1
- package/dist/fixtures.cjs +1546 -55
- package/dist/fixtures.d.cts +33 -14
- package/dist/fixtures.d.ts +33 -14
- package/dist/fixtures.js +1519 -49
- package/dist/index-CU_UPAew.d.ts +202 -0
- package/dist/index-DUFUMc1S.d.cts +202 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +245 -128
- package/dist/index.d.ts +245 -128
- package/dist/index.js +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/tailwind/plugin.cjs +1 -2
- package/dist/tailwind/plugin.d.cts +19 -5
- package/dist/tailwind/plugin.d.ts +19 -5
- package/dist/tailwind/plugin.js +2 -2
- package/dist/tailwind/purger.cjs +1 -1
- package/dist/tailwind/purger.js +2 -2
- package/dist/tailwind/tsMorph.cjs +1 -1
- package/dist/tailwind/tsMorph.js +1 -1
- package/dist/tailwind/utils.cjs +1 -1
- package/dist/tailwind/utils.d.cts +80 -28
- package/dist/tailwind/utils.d.ts +80 -28
- package/dist/tailwind/utils.js +1 -1
- package/dist/tokens/automation/configs.cjs +1 -0
- package/dist/tokens/automation/configs.d.cts +110 -0
- package/dist/tokens/automation/configs.d.ts +110 -0
- package/dist/tokens/automation/configs.js +1 -0
- package/dist/tokens/automation/properties.cjs +1 -0
- package/dist/tokens/automation/properties.d.cts +7 -0
- package/dist/tokens/automation/properties.d.ts +7 -0
- package/dist/tokens/automation/properties.js +1 -0
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +9355 -15
- package/dist/tokens/index.d.ts +9355 -15
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/parseTokens.cjs +1 -1
- package/dist/tokens/parseTokens.d.cts +7 -23
- package/dist/tokens/parseTokens.d.ts +7 -23
- package/dist/tokens/parseTokens.js +1 -1
- package/dist/types-d2CfR7zp.d.cts +10245 -0
- package/dist/types-d2CfR7zp.d.ts +10245 -0
- package/package.json +15 -2
- package/dist/chunk-3G7IRLGN.js +0 -2
- package/dist/chunk-5WBROFT5.cjs +0 -1
- package/dist/chunk-6453EQCC.cjs +0 -1
- package/dist/chunk-7QHJ6LHA.js +0 -1
- package/dist/chunk-EYFQOFYW.cjs +0 -1
- package/dist/chunk-FWF2C6TL.cjs +0 -1
- package/dist/chunk-FYVGDNGL.js +0 -2
- package/dist/chunk-GIJ2FHY5.cjs +0 -1
- package/dist/chunk-GL5JI7EX.cjs +0 -2
- package/dist/chunk-MOUM7BAW.js +0 -2
- package/dist/chunk-PE2P7J44.js +0 -2
- package/dist/chunk-RXSJCGB3.cjs +0 -1
- package/dist/chunk-SUASN3GG.js +0 -2
- package/dist/chunk-U2K4DT7E.js +0 -3
- package/dist/chunk-VPR62GYQ.js +0 -2
- package/dist/chunk-WJ55DEUW.cjs +0 -2
- package/dist/chunk-X6F5UEQ5.js +0 -2
- package/dist/chunk-XZCEFUNX.cjs +0 -2
- package/dist/types-DPT0rst4.d.cts +0 -991
- package/dist/types-DPT0rst4.d.ts +0 -991
- /package/dist/{motionFeatures-HQUM526D.cjs → motionFeatures-6LIGGXPL.cjs} +0 -0
- /package/dist/{motionFeatures-PRT45UQH.js → motionFeatures-SJISLQ4M.js} +0 -0
@@ -0,0 +1,202 @@
|
|
1
|
+
import * as properties from '@yahoo/uds/fixtures';
|
2
|
+
import { d as ShadowPreset, U as UniversalTokensConfig } from './types-d2CfR7zp.js';
|
3
|
+
|
4
|
+
interface ConfigurableProperty<T extends AllPossibleProperties, CVR = unknown> {
|
5
|
+
name: string;
|
6
|
+
cssProperties: string | string[];
|
7
|
+
twThemePath: (selected: T, value: string) => string;
|
8
|
+
possibleFixtures: T[];
|
9
|
+
extendedProperties?: ConfigurablePropertiesName[];
|
10
|
+
customValueRenderer?: (schemaStateValue: SchemaStateValue<CVR>, schema: unknown) => string;
|
11
|
+
concatenate?: boolean;
|
12
|
+
concatenationDelimiter?: string;
|
13
|
+
}
|
14
|
+
declare const configurableProperties: {
|
15
|
+
readonly backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
16
|
+
readonly borderWidth: ConfigurableProperty<"spacingAliases" | "borderWidths", unknown>;
|
17
|
+
readonly borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
18
|
+
readonly borderColor: ConfigurableProperty<"linePaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
19
|
+
readonly fontFamily: ConfigurableProperty<"textVariants", unknown>;
|
20
|
+
readonly fontSize: ConfigurableProperty<"textVariants", unknown>;
|
21
|
+
readonly lineHeight: ConfigurableProperty<"textVariants", unknown>;
|
22
|
+
readonly textTransform: ConfigurableProperty<"textVariants", unknown>;
|
23
|
+
readonly padding: ConfigurableProperty<"spacingAliases", unknown>;
|
24
|
+
readonly gap: ConfigurableProperty<"spacingAliases", unknown>;
|
25
|
+
readonly color: ConfigurableProperty<"foregroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
26
|
+
readonly fontWeight: ConfigurableProperty<"textVariants", unknown>;
|
27
|
+
readonly iconSize: ConfigurableProperty<"iconSizes", unknown>;
|
28
|
+
readonly spacingHorizontal: ConfigurableProperty<"spacingAliases", unknown>;
|
29
|
+
readonly spacingVertical: ConfigurableProperty<"spacingAliases", unknown>;
|
30
|
+
readonly textVariant: ConfigurableProperty<"textVariants", unknown>;
|
31
|
+
readonly shadow: ConfigurableProperty<"shadowVariants", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
32
|
+
readonly insetShadow: ConfigurableProperty<"shadowVariantsWithInvert", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
33
|
+
readonly height: ConfigurableProperty<"spacingAliases", unknown>;
|
34
|
+
readonly width: ConfigurableProperty<"spacingAliases", unknown>;
|
35
|
+
};
|
36
|
+
type ConfigurablePropertiesName = keyof typeof configurableProperties;
|
37
|
+
interface SelectedConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'] = (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly string[])[] = readonly (readonly string[])[]> {
|
38
|
+
label: string;
|
39
|
+
name: C;
|
40
|
+
typeOfFixture: T;
|
41
|
+
values: V;
|
42
|
+
pseudoStates?: PossibleStates[];
|
43
|
+
supportsCustom?: boolean;
|
44
|
+
defaults: {
|
45
|
+
[K in O]: V[number][number];
|
46
|
+
};
|
47
|
+
}
|
48
|
+
|
49
|
+
type AllPossibleProperties = Exclude<keyof typeof properties, 'iconButtonClassNames' | 'iconButtonSize' | 'iconButtonStates' | 'buttonClassNames' | 'buttonColorProperties' | 'buttonIconSvgSize' | 'buttonKinds' | 'buttonMotionEffects' | 'buttonMotionProperties' | 'buttonPalettes' | 'buttonSizeProperties' | 'buttonSizes' | 'buttonStates' | 'buttonVariants'> | 'shadowVariantConfig';
|
50
|
+
type PossibleStates = 'hover' | 'pressed' | 'focused' | 'invalid' | 'focus-within' | 'focused-keyboard' | 'visited' | 'readonly' | 'disabled' | 'invalid&hover' | 'invalid&pressed';
|
51
|
+
type PossibleStatesWithRest = 'rest' | PossibleStates;
|
52
|
+
interface LayerConfig {
|
53
|
+
label: string;
|
54
|
+
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
55
|
+
pseudoSelector?: string;
|
56
|
+
}
|
57
|
+
interface ComponentStateConfig {
|
58
|
+
label: string;
|
59
|
+
options: string[];
|
60
|
+
layers: {
|
61
|
+
root: LayerConfig;
|
62
|
+
} & Record<string, LayerConfig>;
|
63
|
+
}
|
64
|
+
interface SubComponentConfig {
|
65
|
+
label: string;
|
66
|
+
description: string;
|
67
|
+
overrideComponentName?: string;
|
68
|
+
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
69
|
+
}
|
70
|
+
interface VariantConfig<O extends string = string> {
|
71
|
+
label: string;
|
72
|
+
description: string;
|
73
|
+
isConfigurable: boolean;
|
74
|
+
default: O;
|
75
|
+
options: readonly O[];
|
76
|
+
}
|
77
|
+
interface VariantConfigWithProperties<O extends string = string> extends VariantConfig<O> {
|
78
|
+
layers: {
|
79
|
+
root: LayerConfig;
|
80
|
+
} & Record<string, LayerConfig>;
|
81
|
+
}
|
82
|
+
interface VariantConfigWithComponentStates<O extends string = string> extends VariantConfig<O> {
|
83
|
+
componentStates?: Readonly<Record<string, ComponentStateConfig>>;
|
84
|
+
}
|
85
|
+
interface ComponentConfig {
|
86
|
+
label: string;
|
87
|
+
description: string;
|
88
|
+
overrideComponentName?: string;
|
89
|
+
subComponents?: Record<string, SubComponentConfig>;
|
90
|
+
variants?: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
91
|
+
}
|
92
|
+
type AutoComponents = Omit<UniversalTokensConfig, 'colorMode' | 'font' | 'scaleMode' | 'version' | 'motion' | 'button' | 'iconButton' | 'shadow'>;
|
93
|
+
type AutoComponentName = keyof AutoComponents;
|
94
|
+
type AllVariantKeys = {
|
95
|
+
[K in keyof AutoComponents]: {
|
96
|
+
[V in keyof AutoComponents[K]['defaults']]: V;
|
97
|
+
}[keyof AutoComponents[K]['defaults']];
|
98
|
+
}[keyof AutoComponents];
|
99
|
+
|
100
|
+
type ThemeFn = (path: string) => string;
|
101
|
+
type SchemaStateValue<T = any> = {
|
102
|
+
type: string;
|
103
|
+
valueType: 'alias' | 'custom';
|
104
|
+
value: T;
|
105
|
+
};
|
106
|
+
declare const statePseudoMapDocsMode: Record<PossibleStates | 'rest', string>;
|
107
|
+
declare function findFixtureType(property: SelectedConfigurableProperty<ConfigurablePropertiesName, string>, variantKey: string): string;
|
108
|
+
declare function toMinimalDbConfigObject<C extends ComponentConfig>(config: C): any;
|
109
|
+
declare function generateClassName({ componentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, subComponentName, stateKey, stateValue, }: {
|
110
|
+
componentName: string;
|
111
|
+
variantKey: string;
|
112
|
+
variantValue?: string;
|
113
|
+
layer: string;
|
114
|
+
layerOptionalPseudoSelector?: string;
|
115
|
+
subComponentName?: string;
|
116
|
+
stateKey?: string;
|
117
|
+
stateValue?: string;
|
118
|
+
}): string;
|
119
|
+
declare function generateDeclaration({ componentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, subComponentName, stateKey, stateValue, schema, propertyKey, originalPropertyDefinition, theme, currentStyles, generatePseudoStateSuffixes, }: {
|
120
|
+
componentName: string;
|
121
|
+
variantKey: string;
|
122
|
+
variantValue: string;
|
123
|
+
layer: string;
|
124
|
+
layerOptionalPseudoSelector?: string;
|
125
|
+
subComponentName?: string;
|
126
|
+
stateKey?: string;
|
127
|
+
stateValue?: string;
|
128
|
+
schema: unknown;
|
129
|
+
propertyKey: string;
|
130
|
+
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
131
|
+
theme: ThemeFn;
|
132
|
+
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
133
|
+
generatePseudoStateSuffixes?: boolean;
|
134
|
+
}): Record<string, Record<string, string>>;
|
135
|
+
declare function generateStyles<C extends ComponentConfig>(config: C, schema: any, theme: ThemeFn, generatePseudoStateSuffixes?: boolean): Record<string, Record<string, string>>;
|
136
|
+
declare function createConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly string[])[] = readonly (readonly string[])[]>(prop: {
|
137
|
+
name: C;
|
138
|
+
typeOfFixture: T;
|
139
|
+
values: V;
|
140
|
+
defaults: {
|
141
|
+
[K in O]: V[number][number];
|
142
|
+
};
|
143
|
+
label: string;
|
144
|
+
pseudoStates?: PossibleStates[];
|
145
|
+
supportsCustom?: boolean;
|
146
|
+
}): SelectedConfigurableProperty<C, O, T, V>;
|
147
|
+
/**
|
148
|
+
* @deprecated use the new functions instead
|
149
|
+
*/
|
150
|
+
declare function createVariantConfig<O extends string, T extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, O>>>(config: {
|
151
|
+
label: string;
|
152
|
+
description: string;
|
153
|
+
isConfigurable: boolean;
|
154
|
+
default: O;
|
155
|
+
options: readonly O[];
|
156
|
+
properties: T;
|
157
|
+
}): VariantConfig<O>;
|
158
|
+
declare function createComponentStateConfig(config: {
|
159
|
+
label: string;
|
160
|
+
options: string[];
|
161
|
+
layers: {
|
162
|
+
root: LayerConfig;
|
163
|
+
} & Record<string, LayerConfig>;
|
164
|
+
}): ComponentStateConfig;
|
165
|
+
declare function createVariantConfigWithProperties(config: {
|
166
|
+
label: string;
|
167
|
+
description: string;
|
168
|
+
isConfigurable: boolean;
|
169
|
+
default: string;
|
170
|
+
options: readonly string[];
|
171
|
+
layers: {
|
172
|
+
root: LayerConfig;
|
173
|
+
} & Record<string, LayerConfig>;
|
174
|
+
}): VariantConfigWithProperties;
|
175
|
+
declare function createVariantConfigWithComponentStates(config: {
|
176
|
+
label: string;
|
177
|
+
description: string;
|
178
|
+
isConfigurable: boolean;
|
179
|
+
default: string;
|
180
|
+
options: readonly string[];
|
181
|
+
componentStates: Record<string, ComponentStateConfig>;
|
182
|
+
}): VariantConfigWithComponentStates;
|
183
|
+
declare function createComponentStates(config: {
|
184
|
+
label: string;
|
185
|
+
options: string[];
|
186
|
+
layers: {
|
187
|
+
root: LayerConfig;
|
188
|
+
} & Record<string, LayerConfig>;
|
189
|
+
}): ComponentStateConfig;
|
190
|
+
declare function createLayerConfig(config: {
|
191
|
+
label: string;
|
192
|
+
pseudoSelector?: string;
|
193
|
+
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
194
|
+
}): LayerConfig;
|
195
|
+
declare function createSubComponentConfig(config: {
|
196
|
+
label: string;
|
197
|
+
description: string;
|
198
|
+
overrideComponentName?: string;
|
199
|
+
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
200
|
+
}): SubComponentConfig;
|
201
|
+
|
202
|
+
export { type AllPossibleProperties as A, type ConfigurablePropertiesName as C, type LayerConfig as L, type PossibleStates as P, type SelectedConfigurableProperty as S, type VariantConfig as V, type PossibleStatesWithRest as a, type ComponentStateConfig as b, configurableProperties as c, type SubComponentConfig as d, type VariantConfigWithProperties as e, type VariantConfigWithComponentStates as f, type ComponentConfig as g, type AutoComponents as h, type AutoComponentName as i, type AllVariantKeys as j, type SchemaStateValue as k, findFixtureType as l, generateClassName as m, generateDeclaration as n, generateStyles as o, createConfigurableProperty as p, createVariantConfig as q, createComponentStateConfig as r, statePseudoMapDocsMode as s, toMinimalDbConfigObject as t, createVariantConfigWithProperties as u, createVariantConfigWithComponentStates as v, createComponentStates as w, createLayerConfig as x, createSubComponentConfig as y };
|
@@ -0,0 +1,202 @@
|
|
1
|
+
import * as properties from '@yahoo/uds/fixtures';
|
2
|
+
import { d as ShadowPreset, U as UniversalTokensConfig } from './types-d2CfR7zp.cjs';
|
3
|
+
|
4
|
+
interface ConfigurableProperty<T extends AllPossibleProperties, CVR = unknown> {
|
5
|
+
name: string;
|
6
|
+
cssProperties: string | string[];
|
7
|
+
twThemePath: (selected: T, value: string) => string;
|
8
|
+
possibleFixtures: T[];
|
9
|
+
extendedProperties?: ConfigurablePropertiesName[];
|
10
|
+
customValueRenderer?: (schemaStateValue: SchemaStateValue<CVR>, schema: unknown) => string;
|
11
|
+
concatenate?: boolean;
|
12
|
+
concatenationDelimiter?: string;
|
13
|
+
}
|
14
|
+
declare const configurableProperties: {
|
15
|
+
readonly backgroundColor: ConfigurableProperty<"backgroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
16
|
+
readonly borderWidth: ConfigurableProperty<"spacingAliases" | "borderWidths", unknown>;
|
17
|
+
readonly borderRadius: ConfigurableProperty<"borderRadii", unknown>;
|
18
|
+
readonly borderColor: ConfigurableProperty<"linePaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
19
|
+
readonly fontFamily: ConfigurableProperty<"textVariants", unknown>;
|
20
|
+
readonly fontSize: ConfigurableProperty<"textVariants", unknown>;
|
21
|
+
readonly lineHeight: ConfigurableProperty<"textVariants", unknown>;
|
22
|
+
readonly textTransform: ConfigurableProperty<"textVariants", unknown>;
|
23
|
+
readonly padding: ConfigurableProperty<"spacingAliases", unknown>;
|
24
|
+
readonly gap: ConfigurableProperty<"spacingAliases", unknown>;
|
25
|
+
readonly color: ConfigurableProperty<"foregroundPaletteColors" | "spectrumColors" | "alwaysPaletteAliases", unknown>;
|
26
|
+
readonly fontWeight: ConfigurableProperty<"textVariants", unknown>;
|
27
|
+
readonly iconSize: ConfigurableProperty<"iconSizes", unknown>;
|
28
|
+
readonly spacingHorizontal: ConfigurableProperty<"spacingAliases", unknown>;
|
29
|
+
readonly spacingVertical: ConfigurableProperty<"spacingAliases", unknown>;
|
30
|
+
readonly textVariant: ConfigurableProperty<"textVariants", unknown>;
|
31
|
+
readonly shadow: ConfigurableProperty<"shadowVariants", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
32
|
+
readonly insetShadow: ConfigurableProperty<"shadowVariantsWithInvert", string | [] | [ShadowPreset] | [ShadowPreset, ShadowPreset] | [ShadowPreset, ShadowPreset, ShadowPreset]>;
|
33
|
+
readonly height: ConfigurableProperty<"spacingAliases", unknown>;
|
34
|
+
readonly width: ConfigurableProperty<"spacingAliases", unknown>;
|
35
|
+
};
|
36
|
+
type ConfigurablePropertiesName = keyof typeof configurableProperties;
|
37
|
+
interface SelectedConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'] = (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly string[])[] = readonly (readonly string[])[]> {
|
38
|
+
label: string;
|
39
|
+
name: C;
|
40
|
+
typeOfFixture: T;
|
41
|
+
values: V;
|
42
|
+
pseudoStates?: PossibleStates[];
|
43
|
+
supportsCustom?: boolean;
|
44
|
+
defaults: {
|
45
|
+
[K in O]: V[number][number];
|
46
|
+
};
|
47
|
+
}
|
48
|
+
|
49
|
+
type AllPossibleProperties = Exclude<keyof typeof properties, 'iconButtonClassNames' | 'iconButtonSize' | 'iconButtonStates' | 'buttonClassNames' | 'buttonColorProperties' | 'buttonIconSvgSize' | 'buttonKinds' | 'buttonMotionEffects' | 'buttonMotionProperties' | 'buttonPalettes' | 'buttonSizeProperties' | 'buttonSizes' | 'buttonStates' | 'buttonVariants'> | 'shadowVariantConfig';
|
50
|
+
type PossibleStates = 'hover' | 'pressed' | 'focused' | 'invalid' | 'focus-within' | 'focused-keyboard' | 'visited' | 'readonly' | 'disabled' | 'invalid&hover' | 'invalid&pressed';
|
51
|
+
type PossibleStatesWithRest = 'rest' | PossibleStates;
|
52
|
+
interface LayerConfig {
|
53
|
+
label: string;
|
54
|
+
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
55
|
+
pseudoSelector?: string;
|
56
|
+
}
|
57
|
+
interface ComponentStateConfig {
|
58
|
+
label: string;
|
59
|
+
options: string[];
|
60
|
+
layers: {
|
61
|
+
root: LayerConfig;
|
62
|
+
} & Record<string, LayerConfig>;
|
63
|
+
}
|
64
|
+
interface SubComponentConfig {
|
65
|
+
label: string;
|
66
|
+
description: string;
|
67
|
+
overrideComponentName?: string;
|
68
|
+
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
69
|
+
}
|
70
|
+
interface VariantConfig<O extends string = string> {
|
71
|
+
label: string;
|
72
|
+
description: string;
|
73
|
+
isConfigurable: boolean;
|
74
|
+
default: O;
|
75
|
+
options: readonly O[];
|
76
|
+
}
|
77
|
+
interface VariantConfigWithProperties<O extends string = string> extends VariantConfig<O> {
|
78
|
+
layers: {
|
79
|
+
root: LayerConfig;
|
80
|
+
} & Record<string, LayerConfig>;
|
81
|
+
}
|
82
|
+
interface VariantConfigWithComponentStates<O extends string = string> extends VariantConfig<O> {
|
83
|
+
componentStates?: Readonly<Record<string, ComponentStateConfig>>;
|
84
|
+
}
|
85
|
+
interface ComponentConfig {
|
86
|
+
label: string;
|
87
|
+
description: string;
|
88
|
+
overrideComponentName?: string;
|
89
|
+
subComponents?: Record<string, SubComponentConfig>;
|
90
|
+
variants?: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
91
|
+
}
|
92
|
+
type AutoComponents = Omit<UniversalTokensConfig, 'colorMode' | 'font' | 'scaleMode' | 'version' | 'motion' | 'button' | 'iconButton' | 'shadow'>;
|
93
|
+
type AutoComponentName = keyof AutoComponents;
|
94
|
+
type AllVariantKeys = {
|
95
|
+
[K in keyof AutoComponents]: {
|
96
|
+
[V in keyof AutoComponents[K]['defaults']]: V;
|
97
|
+
}[keyof AutoComponents[K]['defaults']];
|
98
|
+
}[keyof AutoComponents];
|
99
|
+
|
100
|
+
type ThemeFn = (path: string) => string;
|
101
|
+
type SchemaStateValue<T = any> = {
|
102
|
+
type: string;
|
103
|
+
valueType: 'alias' | 'custom';
|
104
|
+
value: T;
|
105
|
+
};
|
106
|
+
declare const statePseudoMapDocsMode: Record<PossibleStates | 'rest', string>;
|
107
|
+
declare function findFixtureType(property: SelectedConfigurableProperty<ConfigurablePropertiesName, string>, variantKey: string): string;
|
108
|
+
declare function toMinimalDbConfigObject<C extends ComponentConfig>(config: C): any;
|
109
|
+
declare function generateClassName({ componentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, subComponentName, stateKey, stateValue, }: {
|
110
|
+
componentName: string;
|
111
|
+
variantKey: string;
|
112
|
+
variantValue?: string;
|
113
|
+
layer: string;
|
114
|
+
layerOptionalPseudoSelector?: string;
|
115
|
+
subComponentName?: string;
|
116
|
+
stateKey?: string;
|
117
|
+
stateValue?: string;
|
118
|
+
}): string;
|
119
|
+
declare function generateDeclaration({ componentName, variantKey, variantValue, layer, layerOptionalPseudoSelector, subComponentName, stateKey, stateValue, schema, propertyKey, originalPropertyDefinition, theme, currentStyles, generatePseudoStateSuffixes, }: {
|
120
|
+
componentName: string;
|
121
|
+
variantKey: string;
|
122
|
+
variantValue: string;
|
123
|
+
layer: string;
|
124
|
+
layerOptionalPseudoSelector?: string;
|
125
|
+
subComponentName?: string;
|
126
|
+
stateKey?: string;
|
127
|
+
stateValue?: string;
|
128
|
+
schema: unknown;
|
129
|
+
propertyKey: string;
|
130
|
+
originalPropertyDefinition: SelectedConfigurableProperty<ConfigurablePropertiesName, any>;
|
131
|
+
theme: ThemeFn;
|
132
|
+
currentStyles: Readonly<Record<string, Record<string, string>>>;
|
133
|
+
generatePseudoStateSuffixes?: boolean;
|
134
|
+
}): Record<string, Record<string, string>>;
|
135
|
+
declare function generateStyles<C extends ComponentConfig>(config: C, schema: any, theme: ThemeFn, generatePseudoStateSuffixes?: boolean): Record<string, Record<string, string>>;
|
136
|
+
declare function createConfigurableProperty<C extends ConfigurablePropertiesName, O extends string, T extends (typeof configurableProperties)[C]['possibleFixtures'], V extends readonly (readonly string[])[] = readonly (readonly string[])[]>(prop: {
|
137
|
+
name: C;
|
138
|
+
typeOfFixture: T;
|
139
|
+
values: V;
|
140
|
+
defaults: {
|
141
|
+
[K in O]: V[number][number];
|
142
|
+
};
|
143
|
+
label: string;
|
144
|
+
pseudoStates?: PossibleStates[];
|
145
|
+
supportsCustom?: boolean;
|
146
|
+
}): SelectedConfigurableProperty<C, O, T, V>;
|
147
|
+
/**
|
148
|
+
* @deprecated use the new functions instead
|
149
|
+
*/
|
150
|
+
declare function createVariantConfig<O extends string, T extends Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, O>>>(config: {
|
151
|
+
label: string;
|
152
|
+
description: string;
|
153
|
+
isConfigurable: boolean;
|
154
|
+
default: O;
|
155
|
+
options: readonly O[];
|
156
|
+
properties: T;
|
157
|
+
}): VariantConfig<O>;
|
158
|
+
declare function createComponentStateConfig(config: {
|
159
|
+
label: string;
|
160
|
+
options: string[];
|
161
|
+
layers: {
|
162
|
+
root: LayerConfig;
|
163
|
+
} & Record<string, LayerConfig>;
|
164
|
+
}): ComponentStateConfig;
|
165
|
+
declare function createVariantConfigWithProperties(config: {
|
166
|
+
label: string;
|
167
|
+
description: string;
|
168
|
+
isConfigurable: boolean;
|
169
|
+
default: string;
|
170
|
+
options: readonly string[];
|
171
|
+
layers: {
|
172
|
+
root: LayerConfig;
|
173
|
+
} & Record<string, LayerConfig>;
|
174
|
+
}): VariantConfigWithProperties;
|
175
|
+
declare function createVariantConfigWithComponentStates(config: {
|
176
|
+
label: string;
|
177
|
+
description: string;
|
178
|
+
isConfigurable: boolean;
|
179
|
+
default: string;
|
180
|
+
options: readonly string[];
|
181
|
+
componentStates: Record<string, ComponentStateConfig>;
|
182
|
+
}): VariantConfigWithComponentStates;
|
183
|
+
declare function createComponentStates(config: {
|
184
|
+
label: string;
|
185
|
+
options: string[];
|
186
|
+
layers: {
|
187
|
+
root: LayerConfig;
|
188
|
+
} & Record<string, LayerConfig>;
|
189
|
+
}): ComponentStateConfig;
|
190
|
+
declare function createLayerConfig(config: {
|
191
|
+
label: string;
|
192
|
+
pseudoSelector?: string;
|
193
|
+
properties: Readonly<Record<string, SelectedConfigurableProperty<ConfigurablePropertiesName, string>>>;
|
194
|
+
}): LayerConfig;
|
195
|
+
declare function createSubComponentConfig(config: {
|
196
|
+
label: string;
|
197
|
+
description: string;
|
198
|
+
overrideComponentName?: string;
|
199
|
+
variants: Record<string, VariantConfigWithProperties | VariantConfigWithComponentStates>;
|
200
|
+
}): SubComponentConfig;
|
201
|
+
|
202
|
+
export { type AllPossibleProperties as A, type ConfigurablePropertiesName as C, type LayerConfig as L, type PossibleStates as P, type SelectedConfigurableProperty as S, type VariantConfig as V, type PossibleStatesWithRest as a, type ComponentStateConfig as b, configurableProperties as c, type SubComponentConfig as d, type VariantConfigWithProperties as e, type VariantConfigWithComponentStates as f, type ComponentConfig as g, type AutoComponents as h, type AutoComponentName as i, type AllVariantKeys as j, type SchemaStateValue as k, findFixtureType as l, generateClassName as m, generateDeclaration as n, generateStyles as o, createConfigurableProperty as p, createVariantConfig as q, createComponentStateConfig as r, statePseudoMapDocsMode as s, toMinimalDbConfigObject as t, createVariantConfigWithProperties as u, createVariantConfigWithComponentStates as v, createComponentStates as w, createLayerConfig as x, createSubComponentConfig as y };
|
package/dist/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var e=require("./chunk-XZCEFUNX.cjs"),r=require("./chunk-WJ55DEUW.cjs"),t=require("./chunk-6453EQCC.cjs"),o=require("./chunk-GIJ2FHY5.cjs"),n=require("./chunk-5WBROFT5.cjs"),i=require("react"),a=require("react/jsx-runtime"),d=require("lodash-es"),f=require("@yahoo/uds/client"),l=e.createSlot(),s=i.forwardRef((function({asChild:r,className:t,backgroundColor:o,borderRadius:n,borderTopStartRadius:i,borderTopEndRadius:d,borderBottomStartRadius:f,borderBottomEndRadius:s,borderColor:u,borderStartColor:p,borderEndColor:c,borderTopColor:b,borderBottomColor:E,borderWidth:_,borderVerticalWidth:S,borderHorizontalWidth:g,borderStartWidth:O,borderEndWidth:C,borderTopWidth:A,borderBottomWidth:m,alignContent:R,alignItems:x,alignSelf:T,flex:P,flexDirection:L,flexGrow:h,flexShrink:M,flexWrap:y,justifyContent:D,flexBasis:I,display:j="flex",overflow:F,overflowX:B,overflowY:W,position:N,spacing:X,spacingHorizontal:w,spacingVertical:G,spacingBottom:H,spacingEnd:U,spacingStart:V,spacingTop:v,offset:k,offsetVertical:z,offsetHorizontal:Y,offsetBottom:q,offsetEnd:Z,offsetStart:J,offsetTop:K,columnGap:Q,rowGap:$,width:ee,height:re,...te},oe){const ne=e.getStyles({backgroundColor:o,borderRadius:n,borderTopStartRadius:i,borderTopEndRadius:d,borderBottomStartRadius:f,borderBottomEndRadius:s,borderColor:u,borderStartColor:p,borderEndColor:c,borderTopColor:b,borderBottomColor:E,borderWidth:_,borderVerticalWidth:S,borderHorizontalWidth:g,borderStartWidth:O,borderEndWidth:C,borderTopWidth:A,borderBottomWidth:m,alignContent:R,alignItems:x,alignSelf:T,flex:P,flexDirection:L,flexGrow:h,flexShrink:M,flexWrap:y,justifyContent:D,flexBasis:I,display:j,overflow:F,overflowX:B,overflowY:W,position:N,spacing:X,spacingHorizontal:w,spacingVertical:G,spacingBottom:H,spacingEnd:U,spacingStart:V,spacingTop:v,offset:k,offsetVertical:z,offsetHorizontal:Y,offsetBottom:q,offsetEnd:Z,offsetStart:J,offsetTop:K,columnGap:Q,rowGap:$,width:ee,height:re,className:t}),ie=r?l:"div";return a.jsx(ie,{className:ne,ref:oe,...te})})),u=(e,r)=>((e,r)=>{const t=d.isFunction(r)?r:()=>r;return e.flatMap(((e,r)=>0!==r?[t(r),e]:[e]))})(i.Children.toArray(e),(e=>{const t=d.isFunction(r)?r(e):r;return i.isValidElement(t)?i.cloneElement(t,{...t.props,key:t.key??`interspersed-${e}`}):null})),p=i.forwardRef((function({gap:e,children:r,separator:t,...o},n){return a.jsx(s,{ref:n,flexDirection:"row",rowGap:e,columnGap:e,...o,children:t?u(r,t):r})}));/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var c=e.createSlot(),b={display1:"h1",display2:"h1",display3:"h1",title1:"h1",title2:"h2",title3:"h3",title4:"h4",headline1:"h5",body1:"p",label1:"p",label2:"p",caption1:"p",caption2:"p",legal1:"p"},E=i.forwardRef((function({className:r,asChild:t,color:o="primary",variant:n="body1",as:i=b[n],fontSize:d=n,fontFamily:f=n,fontWeight:l=n,lineHeight:s=n,textTransform:u=n,textAlign:p,backgroundColor:E,borderRadius:_,borderTopStartRadius:S,borderTopEndRadius:g,borderBottomStartRadius:O,borderBottomEndRadius:C,borderColor:A,borderStartColor:m,borderEndColor:R,borderTopColor:x,borderBottomColor:T,borderWidth:P,borderVerticalWidth:L,borderHorizontalWidth:h,borderStartWidth:M,borderEndWidth:y,borderTopWidth:D,borderBottomWidth:I,alignContent:j,alignItems:F,alignSelf:B,flex:W,flexDirection:N,flexGrow:X,flexShrink:w,flexWrap:G,justifyContent:H,flexBasis:U,display:V,overflow:v,overflowX:k,overflowY:z,position:Y,spacing:q,spacingHorizontal:Z,spacingVertical:J,spacingBottom:K,spacingEnd:Q,spacingStart:$,spacingTop:ee,offset:re,offsetVertical:te,offsetHorizontal:oe,offsetBottom:ne,offsetEnd:ie,offsetStart:ae,offsetTop:de,columnGap:fe,rowGap:le,...se},ue){const pe=e.getStyles({className:r,color:o,fontFamily:f,fontSize:d,fontWeight:l,lineHeight:s,textTransform:u,textAlign:p,backgroundColor:E,borderRadius:_,borderTopStartRadius:S,borderTopEndRadius:g,borderBottomStartRadius:O,borderBottomEndRadius:C,borderColor:A,borderStartColor:m,borderEndColor:R,borderTopColor:x,borderBottomColor:T,borderWidth:P,borderVerticalWidth:L,borderHorizontalWidth:h,borderStartWidth:M,borderEndWidth:y,borderTopWidth:D,borderBottomWidth:I,alignContent:j,alignItems:F,alignSelf:B,flex:W,flexDirection:N,flexGrow:X,flexShrink:w,flexWrap:G,justifyContent:H,flexBasis:U,display:V,overflow:v,overflowX:k,overflowY:z,position:Y,spacing:q,spacingHorizontal:Z,spacingVertical:J,spacingBottom:K,spacingEnd:Q,spacingStart:$,spacingTop:ee,offset:re,offsetVertical:te,offsetHorizontal:oe,offsetBottom:ne,offsetEnd:ie,offsetStart:ae,offsetTop:de,columnGap:fe,rowGap:le}),ce=t?c:i;return a.jsx(ce,{className:pe,ref:ue,...se})})),_=i.forwardRef((function({gap:e,children:r,separator:t,...o},n){return a.jsx(s,{ref:n,flexDirection:"column",columnGap:e,rowGap:e,...o,children:t?u(r,t):r})}));Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return e.Icon}}),Object.defineProperty(exports,"cva",{enumerable:!0,get:function(){return e.cva}}),Object.defineProperty(exports,"cx",{enumerable:!0,get:function(){return e.cx}}),Object.defineProperty(exports,"getStyles",{enumerable:!0,get:function(){return e.getStyles}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE",{enumerable:!0,get:function(){return r.DEFAULT_COLOR_MODE}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_FOR_APP",{enumerable:!0,get:function(){return r.DEFAULT_COLOR_MODE_FOR_APP}}),Object.defineProperty(exports,"DEFAULT_HIGH_CONTRAST_MODE",{enumerable:!0,get:function(){return r.DEFAULT_HIGH_CONTRAST_MODE}}),Object.defineProperty(exports,"DEFAULT_REGION_MODE",{enumerable:!0,get:function(){return r.DEFAULT_REGION_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE",{enumerable:!0,get:function(){return r.DEFAULT_SCALE_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_FOR_APP",{enumerable:!0,get:function(){return r.DEFAULT_SCALE_MODE_FOR_APP}}),Object.defineProperty(exports,"FONT_DECLARATIONS_MAP",{enumerable:!0,get:function(){return r.FONT_DECLARATIONS_MAP}}),Object.defineProperty(exports,"alwaysPalette",{enumerable:!0,get:function(){return r.alwaysPalette}}),Object.defineProperty(exports,"button",{enumerable:!0,get:function(){return r.button}}),Object.defineProperty(exports,"defaultTokensConfig",{enumerable:!0,get:function(){return r.defaultTokensConfig}}),Object.defineProperty(exports,"fromEntries",{enumerable:!0,get:function(){return r.fromEntries}}),Object.defineProperty(exports,"generateConfigCombinations",{enumerable:!0,get:function(){return r.generateConfigCombinations}}),Object.defineProperty(exports,"getDefaultButtonBaseMap",{enumerable:!0,get:function(){return r.getDefaultButtonBaseMap}}),Object.defineProperty(exports,"variants",{enumerable:!0,get:function(){return t.variants}}),Object.defineProperty(exports,"entries",{enumerable:!0,get:function(){return o.entries}}),Object.defineProperty(exports,"fontWeightMap",{enumerable:!0,get:function(){return o.fontWeightMap}}),Object.defineProperty(exports,"mapValues",{enumerable:!0,get:function(){return o.mapValues}}),Object.defineProperty(exports,"AVATAR_SIZE_PREFIX",{enumerable:!0,get:function(){return n.AVATAR_SIZE_PREFIX}}),Object.defineProperty(exports,"BORDER_RADIUS_PREFIX",{enumerable:!0,get:function(){return n.BORDER_RADIUS_PREFIX}}),Object.defineProperty(exports,"BORDER_WIDTH_PREFIX",{enumerable:!0,get:function(){return n.BORDER_WIDTH_PREFIX}}),Object.defineProperty(exports,"BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return n.BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"DARK_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DARK_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DEFAULT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DEFAULT_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"FONT_FAMILY_PREFIX",{enumerable:!0,get:function(){return n.FONT_FAMILY_PREFIX}}),Object.defineProperty(exports,"FONT_SIZE_PREFIX",{enumerable:!0,get:function(){return n.FONT_SIZE_PREFIX}}),Object.defineProperty(exports,"FONT_WEIGHT_PREFIX",{enumerable:!0,get:function(){return n.FONT_WEIGHT_PREFIX}}),Object.defineProperty(exports,"ICON_BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return n.ICON_BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"ICON_SIZE_PREFIX",{enumerable:!0,get:function(){return n.ICON_SIZE_PREFIX}}),Object.defineProperty(exports,"LARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.LARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"LIGHT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.LIGHT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"LINE_HEIGHT_PREFIX",{enumerable:!0,get:function(){return n.LINE_HEIGHT_PREFIX}}),Object.defineProperty(exports,"MEDIUM_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.MEDIUM_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"MOTION_PREFIX",{enumerable:!0,get:function(){return n.MOTION_PREFIX}}),Object.defineProperty(exports,"PSEUDO_STYLE_SELECTOR_MAP",{enumerable:!0,get:function(){return n.PSEUDO_STYLE_SELECTOR_MAP}}),Object.defineProperty(exports,"SMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.SMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"SPECTRUM_COLOR_PREFIX",{enumerable:!0,get:function(){return n.SPECTRUM_COLOR_PREFIX}}),Object.defineProperty(exports,"TEXT_TRANSFORM_PREFIX",{enumerable:!0,get:function(){return n.TEXT_TRANSFORM_PREFIX}}),Object.defineProperty(exports,"UDS_PREFIX",{enumerable:!0,get:function(){return n.UDS_PREFIX}}),Object.defineProperty(exports,"XLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XSMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XSMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XXLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XXXLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return f.Button}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return f.IconButton}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return f.Pressable}}),Object.defineProperty(exports,"SpringMotionConfig",{enumerable:!0,get:function(){return f.SpringMotionConfig}}),exports.Box=s,exports.HStack=p,exports.Image=function({width:r,height:t,src:o,alt:n,contentFit:i,backgroundColor:d,borderRadius:f,borderTopStartRadius:l,borderTopEndRadius:s,borderBottomStartRadius:u,borderBottomEndRadius:p,borderColor:c,borderStartColor:b,borderEndColor:E,borderTopColor:_,borderBottomColor:S,borderWidth:g,borderVerticalWidth:O,borderHorizontalWidth:C,borderStartWidth:A,borderEndWidth:m,borderTopWidth:R,borderBottomWidth:x,alignContent:T,alignItems:P,alignSelf:L,flex:h,flexDirection:M,flexGrow:y,flexShrink:D,flexWrap:I,justifyContent:j,flexBasis:F,display:B,overflow:W,overflowX:N,overflowY:X,position:w,spacing:G,spacingHorizontal:H,spacingVertical:U,spacingBottom:V,spacingEnd:v,spacingStart:k,spacingTop:z,offset:Y,offsetVertical:q,offsetHorizontal:Z,offsetBottom:J,offsetEnd:K,offsetStart:Q,offsetTop:$,columnGap:ee,rowGap:re,...te}){const oe=e.getStyles({contentFit:i,backgroundColor:d,borderRadius:f,borderTopStartRadius:l,borderTopEndRadius:s,borderBottomStartRadius:u,borderBottomEndRadius:p,borderColor:c,borderStartColor:b,borderEndColor:E,borderTopColor:_,borderBottomColor:S,borderWidth:g,borderVerticalWidth:O,borderHorizontalWidth:C,borderStartWidth:A,borderEndWidth:m,borderTopWidth:R,borderBottomWidth:x,alignContent:T,alignItems:P,alignSelf:L,flex:h,flexDirection:M,flexGrow:y,flexShrink:D,flexWrap:I,justifyContent:j,flexBasis:F,display:B,overflow:W,overflowX:N,overflowY:X,position:w,spacing:G,spacingHorizontal:H,spacingVertical:U,spacingBottom:V,spacingEnd:v,spacingStart:k,spacingTop:z,offset:Y,offsetVertical:q,offsetHorizontal:Z,offsetBottom:J,offsetEnd:K,offsetStart:Q,offsetTop:$,columnGap:ee,rowGap:re});return a.jsx("img",{src:o,alt:n,className:oe,style:{objectPosition:"left",width:r,height:t},...te})},exports.Text=E,exports.VStack=_;
|
1
|
+
"use strict";var e=require("./chunk-O26JIFUR.cjs"),t=require("./chunk-6XNKVFUM.cjs"),r=require("./chunk-FOX6Q5GR.cjs"),n=require("./chunk-J7PUOUXC.cjs"),o=require("./chunk-HTL6WRXY.cjs"),i=require("react"),u=require("react/jsx-runtime"),a=require("@yahoo/uds/client"),c=i.forwardRef((function({variant:t="primary",textVariant:r,startIcon:n,endIcon:o,alwaysUnderline:a=!1,children:c,className:f,...p},b){const s=!r,O=i.useMemo((()=>{const n=!s&&e.getStyles({linkTextStyleRoot:r,fontSize:r,fontFamily:r,fontWeight:r,lineHeight:r,textTransform:r});return e.getStyles({linkVariantRoot:t,display:"inline-flex",alignItems:"center",className:e.cx(n,"uds-ring",a?"underline":"hover:underline",f)})}),[a,s,r,t,f]),g=e.getStyles({linkVariantIconStart:t,linkTextStyleIcon:r,className:e.cx(s&&"w-[0.7em] h-[0.7em]")}),l=e.getStyles({linkVariantIconEnd:t,linkTextStyleIcon:r,className:e.cx(s&&"w-[0.7em] h-[0.7em]")}),P={variant:"outline",color:"current"};return u.jsxs("a",{ref:b,className:O,...p,children:[n&&u.jsx(e.IconSlot,{className:g,icon:n,iconProps:P,"data-testid":"start-icon"}),c,o&&u.jsx(e.IconSlot,{className:l,icon:o,iconProps:P,"data-testid":"end-icon"})]})}));/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return e.Box}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return e.Divider}}),Object.defineProperty(exports,"FormLabel",{enumerable:!0,get:function(){return e.FormLabel}}),Object.defineProperty(exports,"HStack",{enumerable:!0,get:function(){return e.HStack}}),Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return e.Icon}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return e.Image}}),Object.defineProperty(exports,"InputHelpText",{enumerable:!0,get:function(){return e.InputHelpTextMemo}}),Object.defineProperty(exports,"Text",{enumerable:!0,get:function(){return e.Text}}),Object.defineProperty(exports,"VStack",{enumerable:!0,get:function(){return e.VStack}}),Object.defineProperty(exports,"cva",{enumerable:!0,get:function(){return e.cva}}),Object.defineProperty(exports,"cx",{enumerable:!0,get:function(){return e.cx}}),Object.defineProperty(exports,"getStyles",{enumerable:!0,get:function(){return e.getStyles}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE",{enumerable:!0,get:function(){return t.DEFAULT_COLOR_MODE}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_FOR_APP",{enumerable:!0,get:function(){return t.DEFAULT_COLOR_MODE_FOR_APP}}),Object.defineProperty(exports,"DEFAULT_HIGH_CONTRAST_MODE",{enumerable:!0,get:function(){return t.DEFAULT_HIGH_CONTRAST_MODE}}),Object.defineProperty(exports,"DEFAULT_REGION_MODE",{enumerable:!0,get:function(){return t.DEFAULT_REGION_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE",{enumerable:!0,get:function(){return t.DEFAULT_SCALE_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_FOR_APP",{enumerable:!0,get:function(){return t.DEFAULT_SCALE_MODE_FOR_APP}}),Object.defineProperty(exports,"FONT_DECLARATIONS_MAP",{enumerable:!0,get:function(){return t.FONT_DECLARATIONS_MAP}}),Object.defineProperty(exports,"alwaysPalette",{enumerable:!0,get:function(){return t.alwaysPalette}}),Object.defineProperty(exports,"button",{enumerable:!0,get:function(){return t.button}}),Object.defineProperty(exports,"cartesianProduct",{enumerable:!0,get:function(){return t.cartesianProduct}}),Object.defineProperty(exports,"coalesceConfigVariant",{enumerable:!0,get:function(){return t.coalesceConfigVariant}}),Object.defineProperty(exports,"configurableProperties",{enumerable:!0,get:function(){return t.configurableProperties}}),Object.defineProperty(exports,"createComponentStateConfig",{enumerable:!0,get:function(){return t.createComponentStateConfig}}),Object.defineProperty(exports,"createComponentStates",{enumerable:!0,get:function(){return t.createComponentStates}}),Object.defineProperty(exports,"createConfigurableProperty",{enumerable:!0,get:function(){return t.createConfigurableProperty}}),Object.defineProperty(exports,"createLayerConfig",{enumerable:!0,get:function(){return t.createLayerConfig}}),Object.defineProperty(exports,"createSubComponentConfig",{enumerable:!0,get:function(){return t.createSubComponentConfig}}),Object.defineProperty(exports,"createVariantConfig",{enumerable:!0,get:function(){return t.createVariantConfig}}),Object.defineProperty(exports,"createVariantConfigWithComponentStates",{enumerable:!0,get:function(){return t.createVariantConfigWithComponentStates}}),Object.defineProperty(exports,"createVariantConfigWithProperties",{enumerable:!0,get:function(){return t.createVariantConfigWithProperties}}),Object.defineProperty(exports,"defaultTokensConfig",{enumerable:!0,get:function(){return t.defaultTokensConfig}}),Object.defineProperty(exports,"defaultUniversalTokensConfigAuto",{enumerable:!0,get:function(){return t.defaultUniversalTokensConfigAuto}}),Object.defineProperty(exports,"findFixtureType",{enumerable:!0,get:function(){return t.findFixtureType}}),Object.defineProperty(exports,"fontWeightMap",{enumerable:!0,get:function(){return t.fontWeightMap}}),Object.defineProperty(exports,"fromEntries",{enumerable:!0,get:function(){return t.fromEntries}}),Object.defineProperty(exports,"generateClassName",{enumerable:!0,get:function(){return t.generateClassName}}),Object.defineProperty(exports,"generateDeclaration",{enumerable:!0,get:function(){return t.generateDeclaration}}),Object.defineProperty(exports,"generateKeyFromFlatConfigPath",{enumerable:!0,get:function(){return t.generateKeyFromFlatConfigPath}}),Object.defineProperty(exports,"generateSchemaKey",{enumerable:!0,get:function(){return t.generateSchemaKey}}),Object.defineProperty(exports,"generateStyles",{enumerable:!0,get:function(){return t.generateStyles}}),Object.defineProperty(exports,"getConfigDefaultValue",{enumerable:!0,get:function(){return t.getConfigDefaultValue}}),Object.defineProperty(exports,"getConfigPseudoStateVariables",{enumerable:!0,get:function(){return t.getConfigPseudoStateVariables}}),Object.defineProperty(exports,"getConfigPseudoStateVariablesWithSetter",{enumerable:!0,get:function(){return t.getConfigPseudoStateVariablesWithSetter}}),Object.defineProperty(exports,"getConfigSubcomponents",{enumerable:!0,get:function(){return t.getConfigSubcomponents}}),Object.defineProperty(exports,"getConfigVariantComponentStates",{enumerable:!0,get:function(){return t.getConfigVariantComponentStates}}),Object.defineProperty(exports,"getConfigVariantComponentStatesMatrix",{enumerable:!0,get:function(){return t.getConfigVariantComponentStatesMatrix}}),Object.defineProperty(exports,"getConfigVariantProperties",{enumerable:!0,get:function(){return t.getConfigVariantProperties}}),Object.defineProperty(exports,"getConfigVariantPseudoStates",{enumerable:!0,get:function(){return t.getConfigVariantPseudoStates}}),Object.defineProperty(exports,"getConfigVariants",{enumerable:!0,get:function(){return t.getConfigVariants}}),Object.defineProperty(exports,"getDefaultButtonBaseMap",{enumerable:!0,get:function(){return t.getDefaultButtonBaseMap}}),Object.defineProperty(exports,"isConfigDefaultValue",{enumerable:!0,get:function(){return t.isConfigDefaultValue}}),Object.defineProperty(exports,"parseButtonVariantFlat",{enumerable:!0,get:function(){return t.parseButtonVariantFlat}}),Object.defineProperty(exports,"parseDeprecatedButtonPaletteVariant",{enumerable:!0,get:function(){return t.parseDeprecatedButtonPaletteVariant}}),Object.defineProperty(exports,"setConfigPseudoStateVariable",{enumerable:!0,get:function(){return t.setConfigPseudoStateVariable}}),Object.defineProperty(exports,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(exports,"statePseudoMapDocsMode",{enumerable:!0,get:function(){return t.statePseudoMapDocsMode}}),Object.defineProperty(exports,"toMinimalDbConfigObject",{enumerable:!0,get:function(){return t.toMinimalDbConfigObject}}),Object.defineProperty(exports,"variants",{enumerable:!0,get:function(){return r.variants}}),Object.defineProperty(exports,"entries",{enumerable:!0,get:function(){return n.entries}}),Object.defineProperty(exports,"mapValues",{enumerable:!0,get:function(){return n.mapValues}}),Object.defineProperty(exports,"AVATAR_SIZE_PREFIX",{enumerable:!0,get:function(){return o.AVATAR_SIZE_PREFIX}}),Object.defineProperty(exports,"BORDER_RADIUS_PREFIX",{enumerable:!0,get:function(){return o.BORDER_RADIUS_PREFIX}}),Object.defineProperty(exports,"BORDER_WIDTH_PREFIX",{enumerable:!0,get:function(){return o.BORDER_WIDTH_PREFIX}}),Object.defineProperty(exports,"BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return o.BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"DARK_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.DARK_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.DEFAULT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.DEFAULT_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"FONT_FAMILY_PREFIX",{enumerable:!0,get:function(){return o.FONT_FAMILY_PREFIX}}),Object.defineProperty(exports,"FONT_SIZE_PREFIX",{enumerable:!0,get:function(){return o.FONT_SIZE_PREFIX}}),Object.defineProperty(exports,"FONT_SLANT_PREFIX",{enumerable:!0,get:function(){return o.FONT_SLANT_PREFIX}}),Object.defineProperty(exports,"FONT_WEIGHT_PREFIX",{enumerable:!0,get:function(){return o.FONT_WEIGHT_PREFIX}}),Object.defineProperty(exports,"FONT_WIDTH_PREFIX",{enumerable:!0,get:function(){return o.FONT_WIDTH_PREFIX}}),Object.defineProperty(exports,"ICON_BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return o.ICON_BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"ICON_SIZE_PREFIX",{enumerable:!0,get:function(){return o.ICON_SIZE_PREFIX}}),Object.defineProperty(exports,"LARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.LARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"LIGHT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.LIGHT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"LINE_HEIGHT_PREFIX",{enumerable:!0,get:function(){return o.LINE_HEIGHT_PREFIX}}),Object.defineProperty(exports,"MEDIUM_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.MEDIUM_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"MOTION_PREFIX",{enumerable:!0,get:function(){return o.MOTION_PREFIX}}),Object.defineProperty(exports,"PSEUDO_STYLE_SELECTOR_MAP",{enumerable:!0,get:function(){return o.PSEUDO_STYLE_SELECTOR_MAP}}),Object.defineProperty(exports,"SMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.SMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"SPECTRUM_COLOR_PREFIX",{enumerable:!0,get:function(){return o.SPECTRUM_COLOR_PREFIX}}),Object.defineProperty(exports,"TEXT_TRANSFORM_PREFIX",{enumerable:!0,get:function(){return o.TEXT_TRANSFORM_PREFIX}}),Object.defineProperty(exports,"UDS_PREFIX",{enumerable:!0,get:function(){return o.UDS_PREFIX}}),Object.defineProperty(exports,"XLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.XLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XSMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.XSMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.XXLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return o.XXXLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return a.Avatar}}),Object.defineProperty(exports,"AvatarIcon",{enumerable:!0,get:function(){return a.AvatarIcon}}),Object.defineProperty(exports,"AvatarImage",{enumerable:!0,get:function(){return a.AvatarImage}}),Object.defineProperty(exports,"AvatarText",{enumerable:!0,get:function(){return a.AvatarText}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return a.Badge}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return a.Button}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return a.Checkbox}}),Object.defineProperty(exports,"Chip",{enumerable:!0,get:function(){return a.Chip}}),Object.defineProperty(exports,"ChipButton",{enumerable:!0,get:function(){return a.ChipButton}}),Object.defineProperty(exports,"ChipDismissible",{enumerable:!0,get:function(){return a.ChipDismissible}}),Object.defineProperty(exports,"ChipLink",{enumerable:!0,get:function(){return a.ChipLink}}),Object.defineProperty(exports,"ChipToggle",{enumerable:!0,get:function(){return a.ChipToggle}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return a.IconButton}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return a.Input}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return a.Menu}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return a.Pressable}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return a.Radio}}),Object.defineProperty(exports,"RadioGroupProvider",{enumerable:!0,get:function(){return a.RadioGroupProvider}}),Object.defineProperty(exports,"SpringMotionConfig",{enumerable:!0,get:function(){return a.SpringMotionConfig}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return a.Switch}}),exports.Link=c;
|