@yahoo/uds 0.5.7 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/cli/README.md +1 -0
  2. package/cli/bin/uds-darwin-arm64-baseline +0 -0
  3. package/cli/bin/uds-darwin-x64 +0 -0
  4. package/cli/bin/uds-linux-arm64 +0 -0
  5. package/cli/bin/uds-linux-x64-baseline +0 -0
  6. package/cli/bin/uds-windows-x64-baseline.exe +0 -0
  7. package/cli/cli.ts +6 -0
  8. package/cli/commands/purge.ts +6 -2
  9. package/cli/compile.ts +35 -0
  10. package/cli/consts.ts +9 -0
  11. package/cli/exec.ts +34 -0
  12. package/cli/tsconfig.json +1 -0
  13. package/cli/uds-cli +32 -6
  14. package/cli/utils/configWorker.ts +2 -0
  15. package/cli/utils/purgeCSS.test.ts +2 -1
  16. package/cli/utils/purgeCSS.ts +31 -11
  17. package/cli/utils/setupConfigWorker.ts +12 -1
  18. package/dist/{Image.native-CIafNow6.d.cts → Image.native-BhqVvnKU.d.cts} +1 -1
  19. package/dist/{Image.native-Cbv-erHz.d.ts → Image.native-DZW5ek69.d.ts} +1 -1
  20. package/dist/{VStack-DTK919lo.d.ts → VStack-BohShRVo.d.ts} +1 -1
  21. package/dist/{VStack-DnjkTYdB.d.cts → VStack-C6VjEoRP.d.cts} +1 -1
  22. package/dist/experimental/index.cjs +4 -4
  23. package/dist/experimental/index.d.cts +2 -2
  24. package/dist/experimental/index.d.ts +2 -2
  25. package/dist/experimental/index.js +3 -3
  26. package/dist/experimental/index.native.cjs +1 -1
  27. package/dist/experimental/index.native.d.cts +3 -3
  28. package/dist/experimental/index.native.d.ts +3 -3
  29. package/dist/experimental/index.native.js +1 -1
  30. package/dist/fixtures.cjs +2 -1
  31. package/dist/fixtures.d.ts +5 -5
  32. package/dist/fixtures.js +2 -1
  33. package/dist/index.cjs +2 -2
  34. package/dist/index.d.cts +16 -13
  35. package/dist/index.d.ts +16 -13
  36. package/dist/index.js +3 -3
  37. package/dist/index.native-dtcAO8DN.d.cts +317 -0
  38. package/dist/index.native-uBCD4Hr4.d.ts +317 -0
  39. package/dist/index.native.cjs +1 -1
  40. package/dist/index.native.d.cts +60 -9
  41. package/dist/index.native.d.ts +60 -9
  42. package/dist/index.native.js +1 -1
  43. package/dist/metafile-cjs.json +1 -1
  44. package/dist/metafile-esm.json +1 -1
  45. package/dist/tailwind/plugin.cjs +1 -1
  46. package/dist/tailwind/plugin.d.cts +3 -3
  47. package/dist/tailwind/plugin.d.ts +3 -3
  48. package/dist/tailwind/plugin.js +3 -3
  49. package/dist/tailwind/purger.cjs +2 -2
  50. package/dist/tailwind/purger.js +2 -2
  51. package/dist/tailwind/tsMorph.cjs +1 -1
  52. package/dist/tailwind/tsMorph.js +2 -2
  53. package/dist/tokens/index.cjs +1 -1
  54. package/dist/tokens/index.d.cts +358 -5
  55. package/dist/tokens/index.d.ts +358 -5
  56. package/dist/tokens/index.js +2 -2
  57. package/dist/tokens/index.native.cjs +1 -1
  58. package/dist/tokens/index.native.d.cts +2 -2
  59. package/dist/tokens/index.native.d.ts +2 -2
  60. package/dist/tokens/index.native.js +1 -1
  61. package/dist/tokens/parseTokens.cjs +1 -1
  62. package/dist/tokens/parseTokens.d.cts +4 -4
  63. package/dist/tokens/parseTokens.d.ts +4 -4
  64. package/dist/tokens/parseTokens.js +1 -1
  65. package/dist/{types-BB7LBOmj.d.cts → types-BE7_GGFX.d.cts} +48 -41
  66. package/dist/{types-BB7LBOmj.d.ts → types-BE7_GGFX.d.ts} +48 -41
  67. package/dist/{types-DDJJDimt.d.cts → types-D0b0TPQ4.d.cts} +48 -41
  68. package/dist/{types-DDJJDimt.d.ts → types-D0b0TPQ4.d.ts} +48 -41
  69. package/package.json +199 -198
  70. package/dist/index.native-B7lxeKHq.d.ts +0 -15
  71. package/dist/index.native-y03H93Or.d.cts +0 -15
@@ -1,4 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, c as CorePaletteAlias, B as BackgroundPaletteAlias, F as ForegroundPaletteAlias, L as LinePaletteAlias, d as FontWeightConfig, e as FontWeightNumeric, f as FontFamilyGlobalConfig } from '../types-BB7LBOmj.cjs';
1
+ import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, B as BackgroundPaletteAlias, c as CorePaletteAlias, F as ForegroundPaletteAlias, L as LinePaletteAlias, d as FontWeightConfig, e as FontWeightNumeric, f as FontFamilyGlobalConfig } from '../types-D0b0TPQ4.cjs';
2
2
  import 'react';
3
3
 
4
4
  declare function transformColors(colors: ColorsConfig): {
@@ -7,8 +7,8 @@ declare function transformColors(colors: ColorsConfig): {
7
7
  tailwindConfig: {
8
8
  spectrum: Record<Hue, Record<HueStep, string>>;
9
9
  palette: {
10
- core: Record<CorePaletteAlias, string>;
11
10
  background: Record<BackgroundPaletteAlias, string>;
11
+ core: Record<CorePaletteAlias, string>;
12
12
  foreground: Record<ForegroundPaletteAlias, string>;
13
13
  line: Record<LinePaletteAlias, string>;
14
14
  };
@@ -18,15 +18,15 @@ declare function transformFontWeight(config: FontWeightConfig): {
18
18
  _vars: Record<string, string>;
19
19
  _raw: FontWeightConfig;
20
20
  tailwindConfig: {
21
- medium: FontWeightNumeric;
22
21
  thin: FontWeightNumeric;
22
+ medium: FontWeightNumeric;
23
23
  black: FontWeightNumeric;
24
24
  light: FontWeightNumeric;
25
25
  extralight: FontWeightNumeric;
26
+ regular: FontWeightNumeric;
26
27
  semibold: FontWeightNumeric;
27
28
  bold: FontWeightNumeric;
28
29
  extrabold: FontWeightNumeric;
29
- regular: FontWeightNumeric;
30
30
  };
31
31
  };
32
32
  declare function transformString<T extends Record<string, string>>(prefix: string, config: T, transformValue?: (value: string) => string): {
@@ -1,4 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, c as CorePaletteAlias, B as BackgroundPaletteAlias, F as ForegroundPaletteAlias, L as LinePaletteAlias, d as FontWeightConfig, e as FontWeightNumeric, f as FontFamilyGlobalConfig } from '../types-BB7LBOmj.js';
1
+ import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, B as BackgroundPaletteAlias, c as CorePaletteAlias, F as ForegroundPaletteAlias, L as LinePaletteAlias, d as FontWeightConfig, e as FontWeightNumeric, f as FontFamilyGlobalConfig } from '../types-D0b0TPQ4.js';
2
2
  import 'react';
3
3
 
4
4
  declare function transformColors(colors: ColorsConfig): {
@@ -7,8 +7,8 @@ declare function transformColors(colors: ColorsConfig): {
7
7
  tailwindConfig: {
8
8
  spectrum: Record<Hue, Record<HueStep, string>>;
9
9
  palette: {
10
- core: Record<CorePaletteAlias, string>;
11
10
  background: Record<BackgroundPaletteAlias, string>;
11
+ core: Record<CorePaletteAlias, string>;
12
12
  foreground: Record<ForegroundPaletteAlias, string>;
13
13
  line: Record<LinePaletteAlias, string>;
14
14
  };
@@ -18,15 +18,15 @@ declare function transformFontWeight(config: FontWeightConfig): {
18
18
  _vars: Record<string, string>;
19
19
  _raw: FontWeightConfig;
20
20
  tailwindConfig: {
21
- medium: FontWeightNumeric;
22
21
  thin: FontWeightNumeric;
22
+ medium: FontWeightNumeric;
23
23
  black: FontWeightNumeric;
24
24
  light: FontWeightNumeric;
25
25
  extralight: FontWeightNumeric;
26
+ regular: FontWeightNumeric;
26
27
  semibold: FontWeightNumeric;
27
28
  bold: FontWeightNumeric;
28
29
  extrabold: FontWeightNumeric;
29
- regular: FontWeightNumeric;
30
30
  };
31
31
  };
32
32
  declare function transformString<T extends Record<string, string>>(prefix: string, config: T, transformValue?: (value: string) => string): {
@@ -1,2 +1,2 @@
1
- /*! © 2024 Yahoo, Inc. UDS v0.5.7 */
1
+ /*! © 2024 Yahoo, Inc. UDS v0.5.9 */
2
2
  var t={thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},r="uds",o=`${r}-spectrum-color`,e=`${r}-font`,n=`${r}-icon-size`,i=`${r}-avatar-size`,a=`${r}-border-radius`,s=`${r}-border-width`,c=`${r}-font-size`,f=`${r}-line-height`,$=`${r}-font-weight`,l=`${r}-text-transform`;function u(t){return Object.entries(t)}function d(t,r){return Object.keys(t).reduce(((o,e,n)=>(o[e]=r(t[e],e,n),o)),{})}function g(t){const{palette:e,spectrum:n}=t,i={},a={spectrum:{},palette:{}};for(const[t,r]of u(n))for(const[e,n]of u(r)){const r=`--${o}-${`${t}-${e}`}`;a.spectrum[t]||(a.spectrum[t]={}),a.spectrum[t][e]=`rgb(var(${r}))`,i[r]=n}return u(e).forEach((([t,e])=>{for(const[n,{hue:s,step:c,opacity:f}]of Object.entries(e)){t in a.palette||(a.palette[t]={});const e=`--${r}-${t}-color-${n}`;i[e]=`var(--${o}-${s}-${c})`,a.palette[t][n]=f?`rgb(var(${e}) / ${f})`:`rgb(var(${e}))`}})),{_vars:i,_raw:t,tailwindConfig:a}}function v(r){const o={},e={};for(const[n,i="regular"]of u(r)){const r=`--${$}-${n}`,a=t[i];o[r]=a,e[n]=`var(${r})`}return{_vars:o,_raw:r,tailwindConfig:{...t,...e}}}function b(t,r,o){const e={},n={};for(const[i,a]of u(r)){const r=`--${t}-${i}`,s=o?o(a):a;e[r]=s,n[i]=`var(${r})`}return{_vars:e,_raw:r,tailwindConfig:n}}function h(t,r){if(!r)return{_vars:{},_raw:{},tailwindConfig:{}};const o={},e={};for(const[n,i]of u(r)){const r=`--${t}-${n}`,a=`${i}px`;o[r]=a,e[n]=`var(${r})`}return{_vars:o,_raw:r,tailwindConfig:e}}function m(t){return d(t,((t,r)=>{const{fallbacks:o=[]}=t??{};return[`var(--${e}-${r})`,...o]}))}function p(t){const{colorMode:r,scaleMode:o,fontFamily:$}=t;return{...t,colorMode:{light:g(r.light),dark:g(r.dark)},scaleMode:d(o,(({borderRadius:t,borderWidth:r,fontSize:o,lineHeight:$,fontFamily:u,fontWeight:d,textTransform:g,avatarSizes:m,iconSizes:p})=>({fontFamily:b(e,u,(t=>`var(--${e}-${t})`)),fontSize:h(c,o),fontWeight:v(d),lineHeight:h(f,$),textTransform:b(l,g),borderRadius:h(a,t),borderWidth:h(s,r),avatarSizes:h(i,m),iconSizes:h(n,p)}))),fontFamily:m($)}}export{p as parseTokens};
@@ -8,6 +8,7 @@ declare const alwaysPalette: {
8
8
  white: string;
9
9
  black: string;
10
10
  transparent: string;
11
+ current: string;
11
12
  };
12
13
 
13
14
  type PaletteType = keyof PaletteConfig;
@@ -103,57 +104,64 @@ type ButtonSpectrumColor = {
103
104
  type: 'spectrum';
104
105
  value: SpectrumColor;
105
106
  };
106
- type ButtonComputedColor = {
107
- type: 'computed';
108
- value: `${string} ${string} ${string}`;
109
- meta: {
110
- effect: 'lighten' | 'darken';
111
- hue: Hue;
112
- hueStep: HueStep;
113
- };
114
- };
115
- type ButtonBackgroundPaletteColor = {
107
+ type ButtonSize = TShirtSizeCommon;
108
+ type ButtonCategory = CorePaletteAlias;
109
+ type ButtonVariant2 = 'primary' | 'secondary' | 'tertiary';
110
+ type ButtonState = 'rest' | 'hover' | 'pressed';
111
+ type ButtonKind = 'fill' | 'outline' | 'ghost';
112
+ type ButtonBackgroundColor = {
116
113
  type: 'palette';
117
114
  value: BackgroundColor;
118
- };
119
- type ButtonForegroundPaletteColor = {
115
+ } | ButtonSpectrumColor;
116
+ type ButtonForegroundColor = {
120
117
  type: 'palette';
121
118
  value: ForegroundColor;
122
- };
123
- type ButtonBorderPaletteColor = {
119
+ } | ButtonSpectrumColor;
120
+ type ButtonBorderColor = {
124
121
  type: 'palette';
125
122
  value: LineColor;
126
- };
127
- interface ButtonStateConfig {
128
- backgroundColor?: ButtonSpectrumColor | ButtonBackgroundPaletteColor | ButtonComputedColor;
129
- foregroundColor: ButtonSpectrumColor | ButtonForegroundPaletteColor | ButtonComputedColor;
130
- borderColor?: ButtonSpectrumColor | ButtonBorderPaletteColor | ButtonComputedColor;
131
- }
132
- interface ButtonVariantConfig {
133
- kind: 'fill' | 'outline' | 'ghost';
134
- borderWidth: BorderWidth;
135
- rest: ButtonStateConfig;
136
- hover: ButtonStateConfig;
137
- pressed: ButtonStateConfig;
138
- disabled: ButtonStateConfig;
139
- }
140
- interface ButtonSizeConfig {
141
- spacingHorizontal: SpacingAlias;
142
- spacingVertical: SpacingAlias;
143
- gap: SpacingAlias;
144
- iconSize: IconSize;
145
- textStyle: TextVariant;
146
- shape: BorderRadius;
147
- }
123
+ } | ButtonSpectrumColor;
148
124
  interface ButtonConfig {
149
- sizes: Record<TShirtSizeCommon, ButtonSizeConfig>;
150
- variants: Record<'primary' | 'secondary' | 'tertiary', ButtonVariantConfig>;
125
+ defaults: {
126
+ category: ButtonCategory;
127
+ variant: ButtonVariant2;
128
+ size: ButtonSize;
129
+ };
130
+ size: {
131
+ [size in ButtonSize]: {
132
+ spacingHorizontal: SpacingAlias;
133
+ spacingVertical: SpacingAlias;
134
+ gap: SpacingAlias;
135
+ iconSize: IconSize;
136
+ textVariant: TextVariant;
137
+ };
138
+ };
139
+ category: {
140
+ [category in ButtonCategory]: {
141
+ [variant in ButtonVariant2]: {
142
+ kind: ButtonKind;
143
+ state: {
144
+ [state in ButtonState]: state extends 'rest' ? {
145
+ borderWidth: BorderWidth;
146
+ borderRadius: BorderRadius;
147
+ backgroundColor: ButtonBackgroundColor;
148
+ color: ButtonForegroundColor;
149
+ borderColor: ButtonBorderColor;
150
+ } : {
151
+ backgroundColor: ButtonBackgroundColor;
152
+ color: ButtonForegroundColor;
153
+ borderColor: ButtonBorderColor;
154
+ };
155
+ };
156
+ };
157
+ };
158
+ };
151
159
  }
152
160
  type UniversalTokensConfig = {
153
161
  colorMode: ColorModeConfig;
154
162
  scaleMode: ScaleModeConfig;
155
163
  fontFamily: FontFamilyGlobalConfig;
156
- buttons?: ButtonConfig;
164
+ button?: ButtonConfig;
157
165
  };
158
166
  type PlatformMode = 'web' | 'ios' | 'android';
159
167
  type ColorMode = 'light' | 'dark';
@@ -356,7 +364,6 @@ interface UniversalPressableProps extends UniversalBoxProps {
356
364
  onPress?: () => void;
357
365
  }
358
366
  type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | 'primary-ghost' | 'primary-outline' | 'secondary';
359
- type ButtonSize = TShirtSizeCommon;
360
367
  interface UniversalIconButtonProps {
361
368
  /** The variant of the button. */
362
369
  variant?: ButtonVariant;
@@ -415,4 +422,4 @@ interface UniversalTextInputProps {
415
422
  spacingHorizontal?: SpacingAlias;
416
423
  }
417
424
 
418
- export { type FontFamilyConfig as $, type AlwaysPalette as A, type BackgroundPaletteAlias as B, type ColorMode as C, type ButtonVariant as D, type ColorModeConfig as E, type ForegroundPaletteAlias as F, type ColorModeForApp as G, type Hue as H, type ConfigurableTextProperty as I, type CorePalette as J, type CustomSizingStyleProps as K, type LinePaletteAlias as L, type DataAttribute as M, type Display as N, type Flex as O, type FlexAlignContent as P, type FlexAlignItems as Q, type FlexAlignSelf as R, type ScaleMode as S, type FlexBasis as T, type UniversalTokensConfig as U, type FlexDirection as V, type FlexGrow as W, type FlexJustifyContent as X, type FlexShrink as Y, type FlexStyleProps as Z, type FlexWrap as _, type ColorsConfig as a, type FontFamilyGlobalAlias as a0, type FontSize as a1, type FontSizeConfig as a2, type FontWeightDescriptive as a3, type ForegroundColor as a4, type ForegroundPalette as a5, type HighContrastMode as a6, type IconSize as a7, type IconSizeConfig as a8, type ImageStyleProps as a9, type TextStyleProps as aA, type TextTransform as aB, type TextTransformConfig as aC, type TextVariant as aD, type TransitionDelay as aE, type TransitionDuration as aF, type TransitionTiming as aG, type TShirtSize as aH, type TShirtSizeCommon as aI, type UniversalAvatarProps as aJ, type UniversalBoxProps as aK, type UniversalButtonProps as aL, type UniversalIconButtonProps as aM, type UniversalIconProps as aN, type UniversalPressableProps as aO, type UniversalTextInputProps as aP, type UniversalTextProps as aQ, type LayoutStyleProps as aa, type LetterSpacing as ab, type LineClampAlias as ac, type LineColor as ad, type LineHeight as ae, type LineHeightConfig as af, type LinePalette as ag, type Modes as ah, type Overflow as ai, type Palette as aj, type PaletteConfig as ak, type PaletteType as al, type PaletteValue as am, type PlatformMode as an, type Position as ao, type RegionMode as ap, type ScaleConfig as aq, type ScaleModeConfig as ar, type ScaleModeForApp as as, type SpacingAlias as at, type SpacingConfig as au, type SpacingStyleProps as av, type SpectrumColor as aw, type SpectrumConfig as ax, type StateStyleProps as ay, type StyleProps as az, type HueStep as b, type CorePaletteAlias as c, type FontWeightConfig as d, type FontWeightNumeric as e, type FontFamilyGlobalConfig as f, type UniversalStackProps as g, type UniversalImageProps as h, alwaysPalette as i, type AlwaysPaletteAlias as j, type Animation as k, type AriaAttribute as l, type AvatarShape as m, type AvatarSize as n, type AvatarSizeConfig as o, type BackgroundColor as p, type BackgroundPalette as q, type BackgroundStyleProps as r, type BorderRadius as s, type BorderRadiusConfig as t, type BorderStyleProps as u, type BorderWidth as v, type BorderWidthConfig as w, type BoxShadowConfig as x, type ButtonConfig as y, type ButtonSize as z };
425
+ export { type DataAttribute as $, type AvatarSizeConfig as A, type ButtonConfig as B, type ColorModeForApp as C, type BackgroundPaletteAlias as D, type BackgroundStyleProps as E, type FontFamilyConfig as F, type BorderRadius as G, type BorderStyleProps as H, type IconSizeConfig as I, type BorderWidth as J, type BoxShadowConfig as K, type LineHeightConfig as L, type Modes as M, type ButtonCategory as N, type ButtonSize as O, type ButtonState as P, type ButtonVariant as Q, type ButtonVariant2 as R, type ScaleModeForApp as S, type TextTransformConfig as T, type UniversalAvatarProps as U, type ColorModeConfig as V, type ColorsConfig as W, type ConfigurableTextProperty as X, type CorePalette as Y, type CorePaletteAlias as Z, type CustomSizingStyleProps as _, type UniversalButtonProps as a, type Display as a0, type Flex as a1, type FlexAlignContent as a2, type FlexAlignItems as a3, type FlexAlignSelf as a4, type FlexBasis as a5, type FlexDirection as a6, type FlexGrow as a7, type FlexJustifyContent as a8, type FlexShrink as a9, type PlatformMode as aA, type Position as aB, type RegionMode as aC, type ScaleConfig as aD, type ScaleModeConfig as aE, type SpacingAlias as aF, type SpacingConfig as aG, type SpacingStyleProps as aH, type SpectrumColor as aI, type SpectrumConfig as aJ, type StateStyleProps as aK, type TextStyleProps as aL, type TextTransform as aM, type TextVariant as aN, type TransitionDelay as aO, type TransitionDuration as aP, type TransitionTiming as aQ, type TShirtSize as aR, type TShirtSizeCommon as aS, type UniversalTextInputProps as aT, type FlexStyleProps as aa, type FlexWrap as ab, type FontFamilyGlobalAlias as ac, type FontSize as ad, type FontWeightDescriptive as ae, type FontWeightNumeric as af, type ForegroundColor as ag, type ForegroundPalette as ah, type ForegroundPaletteAlias as ai, type HighContrastMode as aj, type Hue as ak, type HueStep as al, type IconSize as am, type ImageStyleProps as an, type LayoutStyleProps as ao, type LetterSpacing as ap, type LineClampAlias as aq, type LineColor as ar, type LineHeight as as, type LinePalette as at, type LinePaletteAlias as au, type Overflow as av, type Palette as aw, type PaletteConfig as ax, type PaletteType as ay, type PaletteValue as az, type UniversalPressableProps as b, type UniversalIconButtonProps as c, type UniversalImageProps as d, type UniversalBoxProps as e, type UniversalStackProps as f, type UniversalTextProps as g, type UniversalIconProps as h, type ColorMode as i, type ScaleMode as j, type UniversalTokensConfig as k, type StyleProps as l, type BorderRadiusConfig as m, type BorderWidthConfig as n, type FontSizeConfig as o, type FontWeightConfig as p, type FontFamilyGlobalConfig as q, alwaysPalette as r, type AlwaysPalette as s, type AlwaysPaletteAlias as t, type Animation as u, type AriaAttribute as v, type AvatarShape as w, type AvatarSize as x, type BackgroundColor as y, type BackgroundPalette as z };
@@ -8,6 +8,7 @@ declare const alwaysPalette: {
8
8
  white: string;
9
9
  black: string;
10
10
  transparent: string;
11
+ current: string;
11
12
  };
12
13
 
13
14
  type PaletteType = keyof PaletteConfig;
@@ -103,57 +104,64 @@ type ButtonSpectrumColor = {
103
104
  type: 'spectrum';
104
105
  value: SpectrumColor;
105
106
  };
106
- type ButtonComputedColor = {
107
- type: 'computed';
108
- value: `${string} ${string} ${string}`;
109
- meta: {
110
- effect: 'lighten' | 'darken';
111
- hue: Hue;
112
- hueStep: HueStep;
113
- };
114
- };
115
- type ButtonBackgroundPaletteColor = {
107
+ type ButtonSize = TShirtSizeCommon;
108
+ type ButtonCategory = CorePaletteAlias;
109
+ type ButtonVariant2 = 'primary' | 'secondary' | 'tertiary';
110
+ type ButtonState = 'rest' | 'hover' | 'pressed';
111
+ type ButtonKind = 'fill' | 'outline' | 'ghost';
112
+ type ButtonBackgroundColor = {
116
113
  type: 'palette';
117
114
  value: BackgroundColor;
118
- };
119
- type ButtonForegroundPaletteColor = {
115
+ } | ButtonSpectrumColor;
116
+ type ButtonForegroundColor = {
120
117
  type: 'palette';
121
118
  value: ForegroundColor;
122
- };
123
- type ButtonBorderPaletteColor = {
119
+ } | ButtonSpectrumColor;
120
+ type ButtonBorderColor = {
124
121
  type: 'palette';
125
122
  value: LineColor;
126
- };
127
- interface ButtonStateConfig {
128
- backgroundColor?: ButtonSpectrumColor | ButtonBackgroundPaletteColor | ButtonComputedColor;
129
- foregroundColor: ButtonSpectrumColor | ButtonForegroundPaletteColor | ButtonComputedColor;
130
- borderColor?: ButtonSpectrumColor | ButtonBorderPaletteColor | ButtonComputedColor;
131
- }
132
- interface ButtonVariantConfig {
133
- kind: 'fill' | 'outline' | 'ghost';
134
- borderWidth: BorderWidth;
135
- rest: ButtonStateConfig;
136
- hover: ButtonStateConfig;
137
- pressed: ButtonStateConfig;
138
- disabled: ButtonStateConfig;
139
- }
140
- interface ButtonSizeConfig {
141
- spacingHorizontal: SpacingAlias;
142
- spacingVertical: SpacingAlias;
143
- gap: SpacingAlias;
144
- iconSize: IconSize;
145
- textStyle: TextVariant;
146
- shape: BorderRadius;
147
- }
123
+ } | ButtonSpectrumColor;
148
124
  interface ButtonConfig {
149
- sizes: Record<TShirtSizeCommon, ButtonSizeConfig>;
150
- variants: Record<'primary' | 'secondary' | 'tertiary', ButtonVariantConfig>;
125
+ defaults: {
126
+ category: ButtonCategory;
127
+ variant: ButtonVariant2;
128
+ size: ButtonSize;
129
+ };
130
+ size: {
131
+ [size in ButtonSize]: {
132
+ spacingHorizontal: SpacingAlias;
133
+ spacingVertical: SpacingAlias;
134
+ gap: SpacingAlias;
135
+ iconSize: IconSize;
136
+ textVariant: TextVariant;
137
+ };
138
+ };
139
+ category: {
140
+ [category in ButtonCategory]: {
141
+ [variant in ButtonVariant2]: {
142
+ kind: ButtonKind;
143
+ state: {
144
+ [state in ButtonState]: state extends 'rest' ? {
145
+ borderWidth: BorderWidth;
146
+ borderRadius: BorderRadius;
147
+ backgroundColor: ButtonBackgroundColor;
148
+ color: ButtonForegroundColor;
149
+ borderColor: ButtonBorderColor;
150
+ } : {
151
+ backgroundColor: ButtonBackgroundColor;
152
+ color: ButtonForegroundColor;
153
+ borderColor: ButtonBorderColor;
154
+ };
155
+ };
156
+ };
157
+ };
158
+ };
151
159
  }
152
160
  type UniversalTokensConfig = {
153
161
  colorMode: ColorModeConfig;
154
162
  scaleMode: ScaleModeConfig;
155
163
  fontFamily: FontFamilyGlobalConfig;
156
- buttons?: ButtonConfig;
164
+ button?: ButtonConfig;
157
165
  };
158
166
  type PlatformMode = 'web' | 'ios' | 'android';
159
167
  type ColorMode = 'light' | 'dark';
@@ -356,7 +364,6 @@ interface UniversalPressableProps extends UniversalBoxProps {
356
364
  onPress?: () => void;
357
365
  }
358
366
  type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | 'primary-ghost' | 'primary-outline' | 'secondary';
359
- type ButtonSize = TShirtSizeCommon;
360
367
  interface UniversalIconButtonProps {
361
368
  /** The variant of the button. */
362
369
  variant?: ButtonVariant;
@@ -415,4 +422,4 @@ interface UniversalTextInputProps {
415
422
  spacingHorizontal?: SpacingAlias;
416
423
  }
417
424
 
418
- export { type FontFamilyConfig as $, type AlwaysPalette as A, type BackgroundPaletteAlias as B, type ColorMode as C, type ButtonVariant as D, type ColorModeConfig as E, type ForegroundPaletteAlias as F, type ColorModeForApp as G, type Hue as H, type ConfigurableTextProperty as I, type CorePalette as J, type CustomSizingStyleProps as K, type LinePaletteAlias as L, type DataAttribute as M, type Display as N, type Flex as O, type FlexAlignContent as P, type FlexAlignItems as Q, type FlexAlignSelf as R, type ScaleMode as S, type FlexBasis as T, type UniversalTokensConfig as U, type FlexDirection as V, type FlexGrow as W, type FlexJustifyContent as X, type FlexShrink as Y, type FlexStyleProps as Z, type FlexWrap as _, type ColorsConfig as a, type FontFamilyGlobalAlias as a0, type FontSize as a1, type FontSizeConfig as a2, type FontWeightDescriptive as a3, type ForegroundColor as a4, type ForegroundPalette as a5, type HighContrastMode as a6, type IconSize as a7, type IconSizeConfig as a8, type ImageStyleProps as a9, type TextStyleProps as aA, type TextTransform as aB, type TextTransformConfig as aC, type TextVariant as aD, type TransitionDelay as aE, type TransitionDuration as aF, type TransitionTiming as aG, type TShirtSize as aH, type TShirtSizeCommon as aI, type UniversalAvatarProps as aJ, type UniversalBoxProps as aK, type UniversalButtonProps as aL, type UniversalIconButtonProps as aM, type UniversalIconProps as aN, type UniversalPressableProps as aO, type UniversalTextInputProps as aP, type UniversalTextProps as aQ, type LayoutStyleProps as aa, type LetterSpacing as ab, type LineClampAlias as ac, type LineColor as ad, type LineHeight as ae, type LineHeightConfig as af, type LinePalette as ag, type Modes as ah, type Overflow as ai, type Palette as aj, type PaletteConfig as ak, type PaletteType as al, type PaletteValue as am, type PlatformMode as an, type Position as ao, type RegionMode as ap, type ScaleConfig as aq, type ScaleModeConfig as ar, type ScaleModeForApp as as, type SpacingAlias as at, type SpacingConfig as au, type SpacingStyleProps as av, type SpectrumColor as aw, type SpectrumConfig as ax, type StateStyleProps as ay, type StyleProps as az, type HueStep as b, type CorePaletteAlias as c, type FontWeightConfig as d, type FontWeightNumeric as e, type FontFamilyGlobalConfig as f, type UniversalStackProps as g, type UniversalImageProps as h, alwaysPalette as i, type AlwaysPaletteAlias as j, type Animation as k, type AriaAttribute as l, type AvatarShape as m, type AvatarSize as n, type AvatarSizeConfig as o, type BackgroundColor as p, type BackgroundPalette as q, type BackgroundStyleProps as r, type BorderRadius as s, type BorderRadiusConfig as t, type BorderStyleProps as u, type BorderWidth as v, type BorderWidthConfig as w, type BoxShadowConfig as x, type ButtonConfig as y, type ButtonSize as z };
425
+ export { type DataAttribute as $, type AvatarSizeConfig as A, type ButtonConfig as B, type ColorModeForApp as C, type BackgroundPaletteAlias as D, type BackgroundStyleProps as E, type FontFamilyConfig as F, type BorderRadius as G, type BorderStyleProps as H, type IconSizeConfig as I, type BorderWidth as J, type BoxShadowConfig as K, type LineHeightConfig as L, type Modes as M, type ButtonCategory as N, type ButtonSize as O, type ButtonState as P, type ButtonVariant as Q, type ButtonVariant2 as R, type ScaleModeForApp as S, type TextTransformConfig as T, type UniversalAvatarProps as U, type ColorModeConfig as V, type ColorsConfig as W, type ConfigurableTextProperty as X, type CorePalette as Y, type CorePaletteAlias as Z, type CustomSizingStyleProps as _, type UniversalButtonProps as a, type Display as a0, type Flex as a1, type FlexAlignContent as a2, type FlexAlignItems as a3, type FlexAlignSelf as a4, type FlexBasis as a5, type FlexDirection as a6, type FlexGrow as a7, type FlexJustifyContent as a8, type FlexShrink as a9, type PlatformMode as aA, type Position as aB, type RegionMode as aC, type ScaleConfig as aD, type ScaleModeConfig as aE, type SpacingAlias as aF, type SpacingConfig as aG, type SpacingStyleProps as aH, type SpectrumColor as aI, type SpectrumConfig as aJ, type StateStyleProps as aK, type TextStyleProps as aL, type TextTransform as aM, type TextVariant as aN, type TransitionDelay as aO, type TransitionDuration as aP, type TransitionTiming as aQ, type TShirtSize as aR, type TShirtSizeCommon as aS, type UniversalTextInputProps as aT, type FlexStyleProps as aa, type FlexWrap as ab, type FontFamilyGlobalAlias as ac, type FontSize as ad, type FontWeightDescriptive as ae, type FontWeightNumeric as af, type ForegroundColor as ag, type ForegroundPalette as ah, type ForegroundPaletteAlias as ai, type HighContrastMode as aj, type Hue as ak, type HueStep as al, type IconSize as am, type ImageStyleProps as an, type LayoutStyleProps as ao, type LetterSpacing as ap, type LineClampAlias as aq, type LineColor as ar, type LineHeight as as, type LinePalette as at, type LinePaletteAlias as au, type Overflow as av, type Palette as aw, type PaletteConfig as ax, type PaletteType as ay, type PaletteValue as az, type UniversalPressableProps as b, type UniversalIconButtonProps as c, type UniversalImageProps as d, type UniversalBoxProps as e, type UniversalStackProps as f, type UniversalTextProps as g, type UniversalIconProps as h, type ColorMode as i, type ScaleMode as j, type UniversalTokensConfig as k, type StyleProps as l, type BorderRadiusConfig as m, type BorderWidthConfig as n, type FontSizeConfig as o, type FontWeightConfig as p, type FontFamilyGlobalConfig as q, alwaysPalette as r, type AlwaysPalette as s, type AlwaysPaletteAlias as t, type Animation as u, type AriaAttribute as v, type AvatarShape as w, type AvatarSize as x, type BackgroundColor as y, type BackgroundPalette as z };
@@ -8,6 +8,7 @@ declare const alwaysPalette: {
8
8
  white: string;
9
9
  black: string;
10
10
  transparent: string;
11
+ current: string;
11
12
  };
12
13
 
13
14
  type PaletteType = keyof PaletteConfig;
@@ -103,57 +104,64 @@ type ButtonSpectrumColor = {
103
104
  type: 'spectrum';
104
105
  value: SpectrumColor;
105
106
  };
106
- type ButtonComputedColor = {
107
- type: 'computed';
108
- value: `${string} ${string} ${string}`;
109
- meta: {
110
- effect: 'lighten' | 'darken';
111
- hue: Hue;
112
- hueStep: HueStep;
113
- };
114
- };
115
- type ButtonBackgroundPaletteColor = {
107
+ type ButtonSize = TShirtSizeCommon;
108
+ type ButtonCategory = CorePaletteAlias;
109
+ type ButtonVariant2 = 'primary' | 'secondary' | 'tertiary';
110
+ type ButtonState = 'rest' | 'hover' | 'pressed';
111
+ type ButtonKind = 'fill' | 'outline' | 'ghost';
112
+ type ButtonBackgroundColor = {
116
113
  type: 'palette';
117
114
  value: BackgroundColor;
118
- };
119
- type ButtonForegroundPaletteColor = {
115
+ } | ButtonSpectrumColor;
116
+ type ButtonForegroundColor = {
120
117
  type: 'palette';
121
118
  value: ForegroundColor;
122
- };
123
- type ButtonBorderPaletteColor = {
119
+ } | ButtonSpectrumColor;
120
+ type ButtonBorderColor = {
124
121
  type: 'palette';
125
122
  value: LineColor;
126
- };
127
- interface ButtonStateConfig {
128
- backgroundColor?: ButtonSpectrumColor | ButtonBackgroundPaletteColor | ButtonComputedColor;
129
- foregroundColor: ButtonSpectrumColor | ButtonForegroundPaletteColor | ButtonComputedColor;
130
- borderColor?: ButtonSpectrumColor | ButtonBorderPaletteColor | ButtonComputedColor;
131
- }
132
- interface ButtonVariantConfig {
133
- kind: 'fill' | 'outline' | 'ghost';
134
- borderWidth: BorderWidth;
135
- rest: ButtonStateConfig;
136
- hover: ButtonStateConfig;
137
- pressed: ButtonStateConfig;
138
- disabled: ButtonStateConfig;
139
- }
140
- interface ButtonSizeConfig {
141
- spacingHorizontal: SpacingAlias;
142
- spacingVertical: SpacingAlias;
143
- gap: SpacingAlias;
144
- iconSize: IconSize;
145
- textStyle: TextVariant;
146
- shape: BorderRadius;
147
- }
123
+ } | ButtonSpectrumColor;
148
124
  interface ButtonConfig {
149
- sizes: Record<TShirtSizeCommon, ButtonSizeConfig>;
150
- variants: Record<'primary' | 'secondary' | 'tertiary', ButtonVariantConfig>;
125
+ defaults: {
126
+ category: ButtonCategory;
127
+ variant: ButtonVariant2;
128
+ size: ButtonSize;
129
+ };
130
+ size: {
131
+ [size in ButtonSize]: {
132
+ spacingHorizontal: SpacingAlias;
133
+ spacingVertical: SpacingAlias;
134
+ gap: SpacingAlias;
135
+ iconSize: IconSize;
136
+ textVariant: TextVariant;
137
+ };
138
+ };
139
+ category: {
140
+ [category in ButtonCategory]: {
141
+ [variant in ButtonVariant2]: {
142
+ kind: ButtonKind;
143
+ state: {
144
+ [state in ButtonState]: state extends 'rest' ? {
145
+ borderWidth: BorderWidth;
146
+ borderRadius: BorderRadius;
147
+ backgroundColor: ButtonBackgroundColor;
148
+ color: ButtonForegroundColor;
149
+ borderColor: ButtonBorderColor;
150
+ } : {
151
+ backgroundColor: ButtonBackgroundColor;
152
+ color: ButtonForegroundColor;
153
+ borderColor: ButtonBorderColor;
154
+ };
155
+ };
156
+ };
157
+ };
158
+ };
151
159
  }
152
160
  type UniversalTokensConfig = {
153
161
  colorMode: ColorModeConfig;
154
162
  scaleMode: ScaleModeConfig;
155
163
  fontFamily: FontFamilyGlobalConfig;
156
- buttons?: ButtonConfig;
164
+ button?: ButtonConfig;
157
165
  };
158
166
  type PlatformMode = 'web' | 'ios' | 'android';
159
167
  type ColorMode = 'light' | 'dark';
@@ -356,7 +364,6 @@ interface UniversalPressableProps extends UniversalBoxProps {
356
364
  onPress?: () => void;
357
365
  }
358
366
  type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | 'primary-ghost' | 'primary-outline' | 'secondary';
359
- type ButtonSize = TShirtSizeCommon;
360
367
  interface UniversalIconButtonProps {
361
368
  /** The variant of the button. */
362
369
  variant?: ButtonVariant;
@@ -415,4 +422,4 @@ interface UniversalTextInputProps {
415
422
  spacingHorizontal?: SpacingAlias;
416
423
  }
417
424
 
418
- export { type FlexAlignContent as $, type AvatarSizeConfig as A, type ButtonConfig as B, type ColorModeForApp as C, type BackgroundPaletteAlias as D, type BackgroundStyleProps as E, type FontFamilyConfig as F, type BorderRadius as G, type BorderStyleProps as H, type IconSizeConfig as I, type BorderWidth as J, type BoxShadowConfig as K, type LineHeightConfig as L, type Modes as M, type ButtonSize as N, type ButtonVariant as O, type ColorModeConfig as P, type ColorsConfig as Q, type ConfigurableTextProperty as R, type ScaleModeForApp as S, type TextTransformConfig as T, type UniversalAvatarProps as U, type CorePalette as V, type CorePaletteAlias as W, type CustomSizingStyleProps as X, type DataAttribute as Y, type Display as Z, type Flex as _, type UniversalButtonProps as a, type FlexAlignItems as a0, type FlexAlignSelf as a1, type FlexBasis as a2, type FlexDirection as a3, type FlexGrow as a4, type FlexJustifyContent as a5, type FlexShrink as a6, type FlexStyleProps as a7, type FlexWrap as a8, type FontFamilyGlobalAlias as a9, type ScaleConfig as aA, type ScaleModeConfig as aB, type SpacingAlias as aC, type SpacingConfig as aD, type SpacingStyleProps as aE, type SpectrumColor as aF, type SpectrumConfig as aG, type StateStyleProps as aH, type TextStyleProps as aI, type TextTransform as aJ, type TextVariant as aK, type TransitionDelay as aL, type TransitionDuration as aM, type TransitionTiming as aN, type TShirtSize as aO, type TShirtSizeCommon as aP, type UniversalTextInputProps as aQ, type FontSize as aa, type FontWeightDescriptive as ab, type FontWeightNumeric as ac, type ForegroundColor as ad, type ForegroundPalette as ae, type ForegroundPaletteAlias as af, type HighContrastMode as ag, type Hue as ah, type HueStep as ai, type IconSize as aj, type ImageStyleProps as ak, type LayoutStyleProps as al, type LetterSpacing as am, type LineClampAlias as an, type LineColor as ao, type LineHeight as ap, type LinePalette as aq, type LinePaletteAlias as ar, type Overflow as as, type Palette as at, type PaletteConfig as au, type PaletteType as av, type PaletteValue as aw, type PlatformMode as ax, type Position as ay, type RegionMode as az, type UniversalPressableProps as b, type UniversalIconButtonProps as c, type UniversalImageProps as d, type UniversalBoxProps as e, type UniversalStackProps as f, type UniversalTextProps as g, type UniversalIconProps as h, type ColorMode as i, type ScaleMode as j, type UniversalTokensConfig as k, type StyleProps as l, type BorderRadiusConfig as m, type BorderWidthConfig as n, type FontSizeConfig as o, type FontWeightConfig as p, type FontFamilyGlobalConfig as q, alwaysPalette as r, type AlwaysPalette as s, type AlwaysPaletteAlias as t, type Animation as u, type AriaAttribute as v, type AvatarShape as w, type AvatarSize as x, type BackgroundColor as y, type BackgroundPalette as z };
425
+ export { type FlexShrink as $, type AlwaysPalette as A, type BackgroundPaletteAlias as B, type ColorMode as C, type ButtonSize as D, type ButtonState as E, type ForegroundPaletteAlias as F, type ButtonVariant as G, type Hue as H, type ButtonVariant2 as I, type ColorModeConfig as J, type ColorModeForApp as K, type LinePaletteAlias as L, type ConfigurableTextProperty as M, type CorePalette as N, type CustomSizingStyleProps as O, type DataAttribute as P, type Display as Q, type Flex as R, type ScaleMode as S, type FlexAlignContent as T, type UniversalTokensConfig as U, type FlexAlignItems as V, type FlexAlignSelf as W, type FlexBasis as X, type FlexDirection as Y, type FlexGrow as Z, type FlexJustifyContent as _, type ColorsConfig as a, type FlexStyleProps as a0, type FlexWrap as a1, type FontFamilyConfig as a2, type FontFamilyGlobalAlias as a3, type FontSize as a4, type FontSizeConfig as a5, type FontWeightDescriptive as a6, type ForegroundColor as a7, type ForegroundPalette as a8, type HighContrastMode as a9, type SpectrumConfig as aA, type StateStyleProps as aB, type StyleProps as aC, type TextStyleProps as aD, type TextTransform as aE, type TextTransformConfig as aF, type TextVariant as aG, type TransitionDelay as aH, type TransitionDuration as aI, type TransitionTiming as aJ, type TShirtSize as aK, type TShirtSizeCommon as aL, type UniversalAvatarProps as aM, type UniversalBoxProps as aN, type UniversalButtonProps as aO, type UniversalIconButtonProps as aP, type UniversalIconProps as aQ, type UniversalPressableProps as aR, type UniversalTextInputProps as aS, type UniversalTextProps as aT, type IconSize as aa, type IconSizeConfig as ab, type ImageStyleProps as ac, type LayoutStyleProps as ad, type LetterSpacing as ae, type LineClampAlias as af, type LineColor as ag, type LineHeight as ah, type LineHeightConfig as ai, type LinePalette as aj, type Modes as ak, type Overflow as al, type Palette as am, type PaletteConfig as an, type PaletteType as ao, type PaletteValue as ap, type PlatformMode as aq, type Position as ar, type RegionMode as as, type ScaleConfig as at, type ScaleModeConfig as au, type ScaleModeForApp as av, type SpacingAlias as aw, type SpacingConfig as ax, type SpacingStyleProps as ay, type SpectrumColor as az, type HueStep as b, type CorePaletteAlias as c, type FontWeightConfig as d, type FontWeightNumeric as e, type FontFamilyGlobalConfig as f, type UniversalStackProps as g, type UniversalImageProps as h, alwaysPalette as i, type AlwaysPaletteAlias as j, type Animation as k, type AriaAttribute as l, type AvatarShape as m, type AvatarSize as n, type AvatarSizeConfig as o, type BackgroundColor as p, type BackgroundPalette as q, type BackgroundStyleProps as r, type BorderRadius as s, type BorderRadiusConfig as t, type BorderStyleProps as u, type BorderWidth as v, type BorderWidthConfig as w, type BoxShadowConfig as x, type ButtonCategory as y, type ButtonConfig as z };
@@ -8,6 +8,7 @@ declare const alwaysPalette: {
8
8
  white: string;
9
9
  black: string;
10
10
  transparent: string;
11
+ current: string;
11
12
  };
12
13
 
13
14
  type PaletteType = keyof PaletteConfig;
@@ -103,57 +104,64 @@ type ButtonSpectrumColor = {
103
104
  type: 'spectrum';
104
105
  value: SpectrumColor;
105
106
  };
106
- type ButtonComputedColor = {
107
- type: 'computed';
108
- value: `${string} ${string} ${string}`;
109
- meta: {
110
- effect: 'lighten' | 'darken';
111
- hue: Hue;
112
- hueStep: HueStep;
113
- };
114
- };
115
- type ButtonBackgroundPaletteColor = {
107
+ type ButtonSize = TShirtSizeCommon;
108
+ type ButtonCategory = CorePaletteAlias;
109
+ type ButtonVariant2 = 'primary' | 'secondary' | 'tertiary';
110
+ type ButtonState = 'rest' | 'hover' | 'pressed';
111
+ type ButtonKind = 'fill' | 'outline' | 'ghost';
112
+ type ButtonBackgroundColor = {
116
113
  type: 'palette';
117
114
  value: BackgroundColor;
118
- };
119
- type ButtonForegroundPaletteColor = {
115
+ } | ButtonSpectrumColor;
116
+ type ButtonForegroundColor = {
120
117
  type: 'palette';
121
118
  value: ForegroundColor;
122
- };
123
- type ButtonBorderPaletteColor = {
119
+ } | ButtonSpectrumColor;
120
+ type ButtonBorderColor = {
124
121
  type: 'palette';
125
122
  value: LineColor;
126
- };
127
- interface ButtonStateConfig {
128
- backgroundColor?: ButtonSpectrumColor | ButtonBackgroundPaletteColor | ButtonComputedColor;
129
- foregroundColor: ButtonSpectrumColor | ButtonForegroundPaletteColor | ButtonComputedColor;
130
- borderColor?: ButtonSpectrumColor | ButtonBorderPaletteColor | ButtonComputedColor;
131
- }
132
- interface ButtonVariantConfig {
133
- kind: 'fill' | 'outline' | 'ghost';
134
- borderWidth: BorderWidth;
135
- rest: ButtonStateConfig;
136
- hover: ButtonStateConfig;
137
- pressed: ButtonStateConfig;
138
- disabled: ButtonStateConfig;
139
- }
140
- interface ButtonSizeConfig {
141
- spacingHorizontal: SpacingAlias;
142
- spacingVertical: SpacingAlias;
143
- gap: SpacingAlias;
144
- iconSize: IconSize;
145
- textStyle: TextVariant;
146
- shape: BorderRadius;
147
- }
123
+ } | ButtonSpectrumColor;
148
124
  interface ButtonConfig {
149
- sizes: Record<TShirtSizeCommon, ButtonSizeConfig>;
150
- variants: Record<'primary' | 'secondary' | 'tertiary', ButtonVariantConfig>;
125
+ defaults: {
126
+ category: ButtonCategory;
127
+ variant: ButtonVariant2;
128
+ size: ButtonSize;
129
+ };
130
+ size: {
131
+ [size in ButtonSize]: {
132
+ spacingHorizontal: SpacingAlias;
133
+ spacingVertical: SpacingAlias;
134
+ gap: SpacingAlias;
135
+ iconSize: IconSize;
136
+ textVariant: TextVariant;
137
+ };
138
+ };
139
+ category: {
140
+ [category in ButtonCategory]: {
141
+ [variant in ButtonVariant2]: {
142
+ kind: ButtonKind;
143
+ state: {
144
+ [state in ButtonState]: state extends 'rest' ? {
145
+ borderWidth: BorderWidth;
146
+ borderRadius: BorderRadius;
147
+ backgroundColor: ButtonBackgroundColor;
148
+ color: ButtonForegroundColor;
149
+ borderColor: ButtonBorderColor;
150
+ } : {
151
+ backgroundColor: ButtonBackgroundColor;
152
+ color: ButtonForegroundColor;
153
+ borderColor: ButtonBorderColor;
154
+ };
155
+ };
156
+ };
157
+ };
158
+ };
151
159
  }
152
160
  type UniversalTokensConfig = {
153
161
  colorMode: ColorModeConfig;
154
162
  scaleMode: ScaleModeConfig;
155
163
  fontFamily: FontFamilyGlobalConfig;
156
- buttons?: ButtonConfig;
164
+ button?: ButtonConfig;
157
165
  };
158
166
  type PlatformMode = 'web' | 'ios' | 'android';
159
167
  type ColorMode = 'light' | 'dark';
@@ -356,7 +364,6 @@ interface UniversalPressableProps extends UniversalBoxProps {
356
364
  onPress?: () => void;
357
365
  }
358
366
  type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | 'primary-ghost' | 'primary-outline' | 'secondary';
359
- type ButtonSize = TShirtSizeCommon;
360
367
  interface UniversalIconButtonProps {
361
368
  /** The variant of the button. */
362
369
  variant?: ButtonVariant;
@@ -415,4 +422,4 @@ interface UniversalTextInputProps {
415
422
  spacingHorizontal?: SpacingAlias;
416
423
  }
417
424
 
418
- export { type FlexAlignContent as $, type AvatarSizeConfig as A, type ButtonConfig as B, type ColorModeForApp as C, type BackgroundPaletteAlias as D, type BackgroundStyleProps as E, type FontFamilyConfig as F, type BorderRadius as G, type BorderStyleProps as H, type IconSizeConfig as I, type BorderWidth as J, type BoxShadowConfig as K, type LineHeightConfig as L, type Modes as M, type ButtonSize as N, type ButtonVariant as O, type ColorModeConfig as P, type ColorsConfig as Q, type ConfigurableTextProperty as R, type ScaleModeForApp as S, type TextTransformConfig as T, type UniversalAvatarProps as U, type CorePalette as V, type CorePaletteAlias as W, type CustomSizingStyleProps as X, type DataAttribute as Y, type Display as Z, type Flex as _, type UniversalButtonProps as a, type FlexAlignItems as a0, type FlexAlignSelf as a1, type FlexBasis as a2, type FlexDirection as a3, type FlexGrow as a4, type FlexJustifyContent as a5, type FlexShrink as a6, type FlexStyleProps as a7, type FlexWrap as a8, type FontFamilyGlobalAlias as a9, type ScaleConfig as aA, type ScaleModeConfig as aB, type SpacingAlias as aC, type SpacingConfig as aD, type SpacingStyleProps as aE, type SpectrumColor as aF, type SpectrumConfig as aG, type StateStyleProps as aH, type TextStyleProps as aI, type TextTransform as aJ, type TextVariant as aK, type TransitionDelay as aL, type TransitionDuration as aM, type TransitionTiming as aN, type TShirtSize as aO, type TShirtSizeCommon as aP, type UniversalTextInputProps as aQ, type FontSize as aa, type FontWeightDescriptive as ab, type FontWeightNumeric as ac, type ForegroundColor as ad, type ForegroundPalette as ae, type ForegroundPaletteAlias as af, type HighContrastMode as ag, type Hue as ah, type HueStep as ai, type IconSize as aj, type ImageStyleProps as ak, type LayoutStyleProps as al, type LetterSpacing as am, type LineClampAlias as an, type LineColor as ao, type LineHeight as ap, type LinePalette as aq, type LinePaletteAlias as ar, type Overflow as as, type Palette as at, type PaletteConfig as au, type PaletteType as av, type PaletteValue as aw, type PlatformMode as ax, type Position as ay, type RegionMode as az, type UniversalPressableProps as b, type UniversalIconButtonProps as c, type UniversalImageProps as d, type UniversalBoxProps as e, type UniversalStackProps as f, type UniversalTextProps as g, type UniversalIconProps as h, type ColorMode as i, type ScaleMode as j, type UniversalTokensConfig as k, type StyleProps as l, type BorderRadiusConfig as m, type BorderWidthConfig as n, type FontSizeConfig as o, type FontWeightConfig as p, type FontFamilyGlobalConfig as q, alwaysPalette as r, type AlwaysPalette as s, type AlwaysPaletteAlias as t, type Animation as u, type AriaAttribute as v, type AvatarShape as w, type AvatarSize as x, type BackgroundColor as y, type BackgroundPalette as z };
425
+ export { type FlexShrink as $, type AlwaysPalette as A, type BackgroundPaletteAlias as B, type ColorMode as C, type ButtonSize as D, type ButtonState as E, type ForegroundPaletteAlias as F, type ButtonVariant as G, type Hue as H, type ButtonVariant2 as I, type ColorModeConfig as J, type ColorModeForApp as K, type LinePaletteAlias as L, type ConfigurableTextProperty as M, type CorePalette as N, type CustomSizingStyleProps as O, type DataAttribute as P, type Display as Q, type Flex as R, type ScaleMode as S, type FlexAlignContent as T, type UniversalTokensConfig as U, type FlexAlignItems as V, type FlexAlignSelf as W, type FlexBasis as X, type FlexDirection as Y, type FlexGrow as Z, type FlexJustifyContent as _, type ColorsConfig as a, type FlexStyleProps as a0, type FlexWrap as a1, type FontFamilyConfig as a2, type FontFamilyGlobalAlias as a3, type FontSize as a4, type FontSizeConfig as a5, type FontWeightDescriptive as a6, type ForegroundColor as a7, type ForegroundPalette as a8, type HighContrastMode as a9, type SpectrumConfig as aA, type StateStyleProps as aB, type StyleProps as aC, type TextStyleProps as aD, type TextTransform as aE, type TextTransformConfig as aF, type TextVariant as aG, type TransitionDelay as aH, type TransitionDuration as aI, type TransitionTiming as aJ, type TShirtSize as aK, type TShirtSizeCommon as aL, type UniversalAvatarProps as aM, type UniversalBoxProps as aN, type UniversalButtonProps as aO, type UniversalIconButtonProps as aP, type UniversalIconProps as aQ, type UniversalPressableProps as aR, type UniversalTextInputProps as aS, type UniversalTextProps as aT, type IconSize as aa, type IconSizeConfig as ab, type ImageStyleProps as ac, type LayoutStyleProps as ad, type LetterSpacing as ae, type LineClampAlias as af, type LineColor as ag, type LineHeight as ah, type LineHeightConfig as ai, type LinePalette as aj, type Modes as ak, type Overflow as al, type Palette as am, type PaletteConfig as an, type PaletteType as ao, type PaletteValue as ap, type PlatformMode as aq, type Position as ar, type RegionMode as as, type ScaleConfig as at, type ScaleModeConfig as au, type ScaleModeForApp as av, type SpacingAlias as aw, type SpacingConfig as ax, type SpacingStyleProps as ay, type SpectrumColor as az, type HueStep as b, type CorePaletteAlias as c, type FontWeightConfig as d, type FontWeightNumeric as e, type FontFamilyGlobalConfig as f, type UniversalStackProps as g, type UniversalImageProps as h, alwaysPalette as i, type AlwaysPaletteAlias as j, type Animation as k, type AriaAttribute as l, type AvatarShape as m, type AvatarSize as n, type AvatarSizeConfig as o, type BackgroundColor as p, type BackgroundPalette as q, type BackgroundStyleProps as r, type BorderRadius as s, type BorderRadiusConfig as t, type BorderStyleProps as u, type BorderWidth as v, type BorderWidthConfig as w, type BoxShadowConfig as x, type ButtonCategory as y, type ButtonConfig as z };