@yahoo/uds 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/cli/README.md +78 -131
  2. package/cli/commands/purge.ts +7 -3
  3. package/cli/env.d.ts +1 -0
  4. package/cli/utils/purgeCSS.test.ts +43 -3
  5. package/cli/utils/purgeCSS.ts +100 -14
  6. package/dist/Image.native-B3I4JoH3.d.cts +38 -0
  7. package/dist/Image.native-DUAFJodS.d.ts +38 -0
  8. package/dist/VStack-BHlRUsOR.d.cts +103 -0
  9. package/dist/VStack-DMb_RGRS.d.ts +103 -0
  10. package/dist/experimental/index.cjs +1 -1
  11. package/dist/experimental/index.d.cts +8 -8
  12. package/dist/experimental/index.d.ts +8 -8
  13. package/dist/experimental/index.js +1 -1
  14. package/dist/experimental/index.native.cjs +1 -1
  15. package/dist/experimental/index.native.d.cts +3 -3
  16. package/dist/experimental/index.native.d.ts +3 -3
  17. package/dist/experimental/index.native.js +1 -1
  18. package/dist/fixtures.cjs +1946 -0
  19. package/dist/fixtures.d.ts +81 -0
  20. package/dist/fixtures.js +1910 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.cts +41 -236
  23. package/dist/index.d.ts +41 -236
  24. package/dist/index.js +1 -1
  25. package/dist/{index.native-CisPq4BI.d.ts → index.native-BTfOSmUx.d.ts} +1 -1
  26. package/dist/{index.native-DJlx-bfM.d.cts → index.native-Bm-r2Dpa.d.cts} +1 -1
  27. package/dist/index.native.cjs +1 -1
  28. package/dist/index.native.d.cts +20 -83
  29. package/dist/index.native.d.ts +20 -83
  30. package/dist/index.native.js +1 -1
  31. package/dist/styles/globals.css +0 -1
  32. package/dist/styles/toast.css +1 -0
  33. package/dist/styles/toast.d.cts +2 -0
  34. package/dist/styles/toast.d.ts +2 -0
  35. package/dist/tailwindPlugin.cjs +1 -1
  36. package/dist/tailwindPlugin.d.cts +8 -2
  37. package/dist/tailwindPlugin.d.ts +8 -2
  38. package/dist/tailwindPlugin.js +1 -1
  39. package/dist/tailwindPurge.cjs +1 -1
  40. package/dist/tailwindPurge.js +1 -1
  41. package/dist/tokens/index.cjs +1 -1
  42. package/dist/tokens/index.d.cts +2 -2
  43. package/dist/tokens/index.d.ts +2 -2
  44. package/dist/tokens/index.js +1 -1
  45. package/dist/tokens/index.native.cjs +1 -1
  46. package/dist/tokens/index.native.d.cts +2 -2
  47. package/dist/tokens/index.native.d.ts +2 -2
  48. package/dist/tokens/index.native.js +1 -1
  49. package/dist/tokens/parseTokens.cjs +1 -1
  50. package/dist/tokens/parseTokens.d.cts +8 -18
  51. package/dist/tokens/parseTokens.d.ts +8 -18
  52. package/dist/tokens/parseTokens.js +1 -1
  53. package/dist/tokens/parseTokens.native.cjs +1 -1
  54. package/dist/tokens/parseTokens.native.d.cts +4 -21
  55. package/dist/tokens/parseTokens.native.d.ts +4 -21
  56. package/dist/tokens/parseTokens.native.js +1 -1
  57. package/dist/{types-CzJpH_Oi.d.cts → types-COiuE8XK.d.cts} +49 -138
  58. package/dist/{types-CzJpH_Oi.d.ts → types-COiuE8XK.d.ts} +49 -138
  59. package/package.json +13 -12
  60. package/dist/Image.native-C6kOWgnf.d.ts +0 -38
  61. package/dist/Image.native-VeXt5aeI.d.cts +0 -38
  62. package/dist/VStack-BSD9TbBd.d.cts +0 -114
  63. package/dist/VStack-Dk3-8IyU.d.ts +0 -114
  64. package/dist/fixtures/index.cjs +0 -1
  65. package/dist/fixtures/index.d.cts +0 -154
  66. package/dist/fixtures/index.d.ts +0 -154
  67. package/dist/fixtures/index.js +0 -1
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var a in e)_(t,a,{get:e[a],enumerable:!0})},z=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of X(e))!P.call(t,n)&&n!==a&&_(t,n,{get:()=>e[n],enumerable:!(i=k(e,n))||i.enumerable});return t};var V=t=>z(_({},"__esModule",{value:!0}),t);var q={};D(q,{parseTokens:()=>Y});module.exports=V(q);var S={thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};var W={fontSize:{display1:46,display2:37,display3:33,title1:29,title2:25,title3:21,title4:17,headline1:13,body1:13,label1:12,label2:12,caption1:11,caption2:11,legal1:10},lineHeight:{display1:44,display2:44,display3:44,title1:36,title2:32,title3:28,title4:24,headline1:16,body1:16,label1:16,label2:16,caption1:16,caption2:16,legal1:12}},w={fontSize:{display1:46,display2:38,display3:34,title1:30,title2:26,title3:22,title4:18,headline1:14,body1:14,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...W.lineHeight,title1:40,headline1:20,body1:20,legal1:16}},u={fontSize:{display1:47,display2:39,display3:35,title1:31,title2:27,title3:23,title4:19,headline1:15,body1:15,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...w.lineHeight,title2:36,title3:32}},G={fontSize:{...u.fontSize,display1:48,display2:40,display3:36,title1:32,title2:28,title3:24,title4:20,headline1:16,body1:16,label1:14,label2:14},lineHeight:{...u.lineHeight,title2:36,title3:32,headline1:20,body1:20,label1:20,label2:20}},U={fontSize:{display1:50,display2:42,display3:38,title1:34,title2:30,title3:26,title4:22,headline1:18,body1:16,label1:16,label2:16,caption1:14,caption2:14,legal1:13},lineHeight:{...G.lineHeight,title1:44,headline1:24,body1:24,caption1:20,caption2:20}},K={fontSize:{display1:52,display2:44,display3:40,title1:36,title2:32,title3:28,title4:26,headline1:20,body1:20,label1:18,label2:18,caption1:16,caption2:16,legal1:15},lineHeight:{...U.lineHeight,title2:40,title3:36,headline1:28,body1:28,label1:24,label2:24,legal1:20}},Q={fontSize:{display1:54,display2:46,display3:42,title1:38,title2:34,title3:30,title4:28,headline1:22,body1:22,label1:20,label2:20,caption1:18,caption2:18,legal1:17},lineHeight:{...K.lineHeight,title1:48,title2:44,title4:32,label1:28,label2:28,caption1:24,caption2:24}};var o="uds",R=`${o}-spectrum-color`,m=`${o}-font`,E=`${o}-icon-size`,C=`${o}-avatar-size`,F=`${o}-border-radius`,x=`${o}-border-width`,T=`${o}-spacing`,h=`${o}-font-size`,A=`${o}-line-height`,$=`${o}-font-weight`,I=`${o}-text-transform`,te=`${o}-color-mode-dark`,oe=`${o}-color-mode-light`,ne=`${o}-scale-mode-xsmall`,ie=`${o}-scale-mode-small`,ae=`${o}-scale-mode-medium`,se=`${o}-scale-mode-large`,le=`${o}-scale-mode-xlarge`,re=`${o}-scale-mode-xxlarge`,pe=`${o}-scale-mode-xxxlarge`;var ce=`--${o}-font-icons`,fe=`--${o}-font-sans`,de=`--${o}-font-sans-beta`,ge=`--${o}-font-sans-condensed`,ye=`--${o}-font-serif-display`,me=`--${o}-font-serif-text`;function c(t){return Object.entries(t)}function b(t,e){return Object.keys(t).reduce((a,i,n)=>(a[i]=e(t[i],i,n),a),{})}function L(t){let{palette:e,spectrum:a}=t,i={},n={spectrum:{},palette:{}};for(let[s,l]of c(a))for(let[r,p]of c(l)){let f=`${s}-${r}`,d=`--${R}-${f}`;n.spectrum[s]||(n.spectrum[s]={}),n.spectrum[s][r]=`rgb(var(${d}))`,i[d]=p}return c(e).forEach(([s,l])=>{for(let[r,{hue:p,step:f,opacity:d}]of Object.entries(l)){s in n.palette||(n.palette[s]={});let y=`--${o}-${s}-color-${r}`;i[y]=`var(--${R}-${p}-${f})`,n.palette[s][r]=d?`rgb(var(${y}) / ${d})`:`rgb(var(${y}))`}}),{_vars:i,_raw:t,tailwindConfig:n}}function Z(t){let e={},a={};for(let[i,n="regular"]of c(t)){let s=`--${$}-${i}`,l=S[n];e[s]=l,a[i]=`var(${s})`}return{_vars:e,_raw:t,tailwindConfig:{...S,...a}}}function N(t,e,a){let i={},n={};for(let[s,l]of c(e)){let r=`--${t}-${s}`,p=a?a(l):l;i[r]=p,n[s]=`var(${r})`}return{_vars:i,_raw:e,tailwindConfig:n}}function g(t,e){if(!e)return{_vars:{},_raw:{},tailwindConfig:{}};let a={},i={};for(let[n,s]of c(e)){let l=`--${t}-${n}`,r=`${s}px`;a[l]=r,i[n]=`var(${l})`}return{_vars:a,_raw:e,tailwindConfig:i}}function j(t){let e={};for(let[a,i]of c(t)){let n=i.map(({color:s,offsetX:l,offsetY:r,blurRadius:p,spreadRadius:f})=>`${l}px ${r}px ${p}px ${f}px ${s}`).join(", ");e[a]=n}return e}function B(t){return b(t,(e,a)=>{let{fallbacks:i=[]}=e??{};return[`var(--${m}-${a})`,...i]})}function Y(t){let{colorMode:e,scaleMode:a,elevation:i,fontFamily:n}=t;return{...t,colorMode:{light:L(e.light),dark:L(e.dark)},scaleMode:b(a,({borderRadius:s,borderWidth:l,spacing:r,fontSize:p,lineHeight:f,fontFamily:d,fontWeight:y,textTransform:O,avatarSizes:M,iconSizes:v})=>({fontFamily:N(m,d,H=>`var(--${m}-${H})`),fontSize:g(h,p),fontWeight:Z(y),lineHeight:g(A,f),textTransform:N(I,O),borderRadius:g(F,s),borderWidth:g(x,l),spacing:g(T,r),avatarSizes:g(C,M),iconSizes:g(E,v)})),elevation:j(i),fontFamily:B(n)}}0&&(module.exports={parseTokens});
1
+ "use strict";var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var P=(o,e)=>{for(var a in e)m(o,a,{get:e[a],enumerable:!0})},D=(o,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of v(e))!X.call(o,n)&&n!==a&&m(o,n,{get:()=>e[n],enumerable:!(i=k(e,n))||i.enumerable});return o};var z=o=>D(m({},"__esModule",{value:!0}),o);var j={};P(j,{parseTokens:()=>B});module.exports=z(j);var S={thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};var W={fontSize:{display1:46,display2:37,display3:33,title1:29,title2:25,title3:21,title4:17,headline1:13,body1:13,label1:12,label2:12,caption1:11,caption2:11,legal1:10},lineHeight:{display1:44,display2:44,display3:44,title1:36,title2:32,title3:28,title4:24,headline1:16,body1:16,label1:16,label2:16,caption1:16,caption2:16,legal1:12}},V={fontSize:{display1:46,display2:38,display3:34,title1:30,title2:26,title3:22,title4:18,headline1:14,body1:14,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...W.lineHeight,title1:40,headline1:20,body1:20,legal1:16}},u={fontSize:{display1:47,display2:39,display3:35,title1:31,title2:27,title3:23,title4:19,headline1:15,body1:15,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...V.lineHeight,title2:36,title3:32}},G={fontSize:{...u.fontSize,display1:48,display2:40,display3:36,title1:32,title2:28,title3:24,title4:20,headline1:16,body1:16,label1:14,label2:14},lineHeight:{...u.lineHeight,title2:36,title3:32,headline1:20,body1:20,label1:20,label2:20}},w={fontSize:{display1:50,display2:42,display3:38,title1:34,title2:30,title3:26,title4:22,headline1:18,body1:16,label1:16,label2:16,caption1:14,caption2:14,legal1:13},lineHeight:{...G.lineHeight,title1:44,headline1:24,body1:24,caption1:20,caption2:20}},U={fontSize:{display1:52,display2:44,display3:40,title1:36,title2:32,title3:28,title4:26,headline1:20,body1:20,label1:18,label2:18,caption1:16,caption2:16,legal1:15},lineHeight:{...w.lineHeight,title2:40,title3:36,headline1:28,body1:28,label1:24,label2:24,legal1:20}},q={fontSize:{display1:54,display2:46,display3:42,title1:38,title2:34,title3:30,title4:28,headline1:22,body1:22,label1:20,label2:20,caption1:18,caption2:18,legal1:17},lineHeight:{...U.lineHeight,title1:48,title2:44,title4:32,label1:28,label2:28,caption1:24,caption2:24}};var t="uds",b=`${t}-spectrum-color`,_=`${t}-font`,E=`${t}-icon-size`,F=`${t}-avatar-size`,C=`${t}-border-radius`,T=`${t}-border-width`,x=`${t}-spacing`,h=`${t}-font-size`,A=`${t}-line-height`,$=`${t}-font-weight`,I=`${t}-text-transform`,Q=`${t}-color-mode-dark`,ee=`${t}-color-mode-light`,te=`${t}-scale-mode-xsmall`,oe=`${t}-scale-mode-small`,ne=`${t}-scale-mode-medium`,ie=`${t}-scale-mode-large`,ae=`${t}-scale-mode-xlarge`,se=`${t}-scale-mode-xxlarge`,le=`${t}-scale-mode-xxxlarge`;var re=`--${t}-font-icons`,ce=`--${t}-font-sans`,pe=`--${t}-font-sans-beta`,fe=`--${t}-font-sans-condensed`,de=`--${t}-font-serif-display`,ge=`--${t}-font-serif-text`;function f(o){return Object.entries(o)}function R(o,e){return Object.keys(o).reduce((a,i,n)=>(a[i]=e(o[i],i,n),a),{})}function L(o){let{palette:e,spectrum:a}=o,i={},n={spectrum:{},palette:{}};for(let[s,l]of f(a))for(let[r,c]of f(l)){let g=`${s}-${r}`,p=`--${b}-${g}`;n.spectrum[s]||(n.spectrum[s]={}),n.spectrum[s][r]=`rgb(var(${p}))`,i[p]=c}return f(e).forEach(([s,l])=>{for(let[r,{hue:c,step:g,opacity:p}]of Object.entries(l)){s in n.palette||(n.palette[s]={});let y=`--${t}-${s}-color-${r}`;i[y]=`var(--${b}-${c}-${g})`,n.palette[s][r]=p?`rgb(var(${y}) / ${p})`:`rgb(var(${y}))`}}),{_vars:i,_raw:o,tailwindConfig:n}}function K(o){let e={},a={};for(let[i,n="regular"]of f(o)){let s=`--${$}-${i}`,l=S[n];e[s]=l,a[i]=`var(${s})`}return{_vars:e,_raw:o,tailwindConfig:{...S,...a}}}function N(o,e,a){let i={},n={};for(let[s,l]of f(e)){let r=`--${o}-${s}`,c=a?a(l):l;i[r]=c,n[s]=`var(${r})`}return{_vars:i,_raw:e,tailwindConfig:n}}function d(o,e){if(!e)return{_vars:{},_raw:{},tailwindConfig:{}};let a={},i={};for(let[n,s]of f(e)){let l=`--${o}-${n}`,r=`${s}px`;a[l]=r,i[n]=`var(${l})`}return{_vars:a,_raw:e,tailwindConfig:i}}function Z(o){return R(o,(e,a)=>{let{fallbacks:i=[]}=e??{};return[`var(--${_}-${a})`,...i]})}function B(o){let{colorMode:e,scaleMode:a,fontFamily:i}=o;return{...o,colorMode:{light:L(e.light),dark:L(e.dark)},scaleMode:R(a,({borderRadius:n,borderWidth:s,spacing:l,fontSize:r,lineHeight:c,fontFamily:g,fontWeight:p,textTransform:y,avatarSizes:O,iconSizes:M})=>({fontFamily:N(_,g,H=>`var(--${_}-${H})`),fontSize:d(h,r),fontWeight:K(p),lineHeight:d(A,c),textTransform:N(I,y),borderRadius:d(C,n),borderWidth:d(T,s),spacing:d(x,l),avatarSizes:d(F,O),iconSizes:d(E,M)})),fontFamily:Z(i)}}0&&(module.exports={parseTokens});
@@ -1,4 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, P as PaletteValue, c as CorePalette, B as BackgroundPalette, d as BackgroundWashPalette, F as ForegroundPalette, L as LinePalette, e as FontWeightConfig, f as FontWeightNumeric, E as ElevationConfig, g as Elevation, h as FontFamilyGlobalConfig } from '../types-CzJpH_Oi.cjs';
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-COiuE8XK.cjs';
2
2
  import 'react';
3
3
 
4
4
  declare function transformColors(colors: ColorsConfig): {
@@ -7,18 +7,10 @@ declare function transformColors(colors: ColorsConfig): {
7
7
  tailwindConfig: {
8
8
  spectrum: Record<Hue, Record<HueStep, string>>;
9
9
  palette: {
10
- elevation: Record<keyof {
11
- 'elevation-1': PaletteValue;
12
- 'elevation-2': PaletteValue;
13
- 'elevation-3': PaletteValue;
14
- 'elevation-3-inverse': PaletteValue;
15
- overlay: PaletteValue;
16
- }, string>;
17
- core: Record<keyof CorePalette, string>;
18
- background: Record<keyof BackgroundPalette, string>;
19
- backgroundWash: Record<keyof BackgroundWashPalette, string>;
20
- foreground: Record<keyof ForegroundPalette, string>;
21
- line: Record<keyof LinePalette, string>;
10
+ core: Record<CorePaletteAlias, string>;
11
+ background: Record<BackgroundPaletteAlias, string>;
12
+ foreground: Record<ForegroundPaletteAlias, string>;
13
+ line: Record<LinePaletteAlias, string>;
22
14
  };
23
15
  };
24
16
  };
@@ -27,9 +19,9 @@ declare function transformFontWeight(config: FontWeightConfig): {
27
19
  _raw: FontWeightConfig;
28
20
  tailwindConfig: {
29
21
  medium: FontWeightNumeric;
30
- light: FontWeightNumeric;
31
- black: FontWeightNumeric;
32
22
  thin: FontWeightNumeric;
23
+ black: FontWeightNumeric;
24
+ light: FontWeightNumeric;
33
25
  extralight: FontWeightNumeric;
34
26
  regular: FontWeightNumeric;
35
27
  semibold: FontWeightNumeric;
@@ -51,7 +43,6 @@ declare function transformNumeric<T extends Record<string, number>>(prefix: stri
51
43
  _raw: T;
52
44
  tailwindConfig: Record<string, string>;
53
45
  };
54
- declare function transformElevation(elevation: ElevationConfig): Record<Elevation, string>;
55
46
  declare function transformFontFamilyGlobal(fontFamily: FontFamilyGlobalConfig): {
56
47
  icons: string[];
57
48
  sans: string[];
@@ -60,9 +51,8 @@ declare function transformFontFamilyGlobal(fontFamily: FontFamilyGlobalConfig):
60
51
  "serif-text": string[];
61
52
  "serif-display": string[];
62
53
  };
63
- type WebTokens = Omit<UniversalTokensConfig, 'colorMode' | 'scaleMode' | 'fontFamily' | 'elevation'> & {
54
+ type WebTokens = Omit<UniversalTokensConfig, 'colorMode' | 'scaleMode' | 'fontFamily'> & {
64
55
  fontFamily: ReturnType<typeof transformFontFamilyGlobal>;
65
- elevation: ReturnType<typeof transformElevation>;
66
56
  colorMode: Record<ColorMode, ReturnType<typeof transformColors>>;
67
57
  scaleMode: Record<ScaleMode, {
68
58
  fontFamily: ReturnType<typeof transformString>;
@@ -1,4 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, S as ScaleMode, a as ColorsConfig, H as Hue, b as HueStep, P as PaletteValue, c as CorePalette, B as BackgroundPalette, d as BackgroundWashPalette, F as ForegroundPalette, L as LinePalette, e as FontWeightConfig, f as FontWeightNumeric, E as ElevationConfig, g as Elevation, h as FontFamilyGlobalConfig } from '../types-CzJpH_Oi.js';
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-COiuE8XK.js';
2
2
  import 'react';
3
3
 
4
4
  declare function transformColors(colors: ColorsConfig): {
@@ -7,18 +7,10 @@ declare function transformColors(colors: ColorsConfig): {
7
7
  tailwindConfig: {
8
8
  spectrum: Record<Hue, Record<HueStep, string>>;
9
9
  palette: {
10
- elevation: Record<keyof {
11
- 'elevation-1': PaletteValue;
12
- 'elevation-2': PaletteValue;
13
- 'elevation-3': PaletteValue;
14
- 'elevation-3-inverse': PaletteValue;
15
- overlay: PaletteValue;
16
- }, string>;
17
- core: Record<keyof CorePalette, string>;
18
- background: Record<keyof BackgroundPalette, string>;
19
- backgroundWash: Record<keyof BackgroundWashPalette, string>;
20
- foreground: Record<keyof ForegroundPalette, string>;
21
- line: Record<keyof LinePalette, string>;
10
+ core: Record<CorePaletteAlias, string>;
11
+ background: Record<BackgroundPaletteAlias, string>;
12
+ foreground: Record<ForegroundPaletteAlias, string>;
13
+ line: Record<LinePaletteAlias, string>;
22
14
  };
23
15
  };
24
16
  };
@@ -27,9 +19,9 @@ declare function transformFontWeight(config: FontWeightConfig): {
27
19
  _raw: FontWeightConfig;
28
20
  tailwindConfig: {
29
21
  medium: FontWeightNumeric;
30
- light: FontWeightNumeric;
31
- black: FontWeightNumeric;
32
22
  thin: FontWeightNumeric;
23
+ black: FontWeightNumeric;
24
+ light: FontWeightNumeric;
33
25
  extralight: FontWeightNumeric;
34
26
  regular: FontWeightNumeric;
35
27
  semibold: FontWeightNumeric;
@@ -51,7 +43,6 @@ declare function transformNumeric<T extends Record<string, number>>(prefix: stri
51
43
  _raw: T;
52
44
  tailwindConfig: Record<string, string>;
53
45
  };
54
- declare function transformElevation(elevation: ElevationConfig): Record<Elevation, string>;
55
46
  declare function transformFontFamilyGlobal(fontFamily: FontFamilyGlobalConfig): {
56
47
  icons: string[];
57
48
  sans: string[];
@@ -60,9 +51,8 @@ declare function transformFontFamilyGlobal(fontFamily: FontFamilyGlobalConfig):
60
51
  "serif-text": string[];
61
52
  "serif-display": string[];
62
53
  };
63
- type WebTokens = Omit<UniversalTokensConfig, 'colorMode' | 'scaleMode' | 'fontFamily' | 'elevation'> & {
54
+ type WebTokens = Omit<UniversalTokensConfig, 'colorMode' | 'scaleMode' | 'fontFamily'> & {
64
55
  fontFamily: ReturnType<typeof transformFontFamilyGlobal>;
65
- elevation: ReturnType<typeof transformElevation>;
66
56
  colorMode: Record<ColorMode, ReturnType<typeof transformColors>>;
67
57
  scaleMode: Record<ScaleMode, {
68
58
  fontFamily: ReturnType<typeof transformString>;
@@ -1 +1 @@
1
- var _={thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};var H={fontSize:{display1:46,display2:37,display3:33,title1:29,title2:25,title3:21,title4:17,headline1:13,body1:13,label1:12,label2:12,caption1:11,caption2:11,legal1:10},lineHeight:{display1:44,display2:44,display3:44,title1:36,title2:32,title3:28,title4:24,headline1:16,body1:16,label1:16,label2:16,caption1:16,caption2:16,legal1:12}},k={fontSize:{display1:46,display2:38,display3:34,title1:30,title2:26,title3:22,title4:18,headline1:14,body1:14,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...H.lineHeight,title1:40,headline1:20,body1:20,legal1:16}},b={fontSize:{display1:47,display2:39,display3:35,title1:31,title2:27,title3:23,title4:19,headline1:15,body1:15,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...k.lineHeight,title2:36,title3:32}},X={fontSize:{...b.fontSize,display1:48,display2:40,display3:36,title1:32,title2:28,title3:24,title4:20,headline1:16,body1:16,label1:14,label2:14},lineHeight:{...b.lineHeight,title2:36,title3:32,headline1:20,body1:20,label1:20,label2:20}},P={fontSize:{display1:50,display2:42,display3:38,title1:34,title2:30,title3:26,title4:22,headline1:18,body1:16,label1:16,label2:16,caption1:14,caption2:14,legal1:13},lineHeight:{...X.lineHeight,title1:44,headline1:24,body1:24,caption1:20,caption2:20}},D={fontSize:{display1:52,display2:44,display3:40,title1:36,title2:32,title3:28,title4:26,headline1:20,body1:20,label1:18,label2:18,caption1:16,caption2:16,legal1:15},lineHeight:{...P.lineHeight,title2:40,title3:36,headline1:28,body1:28,label1:24,label2:24,legal1:20}},w={fontSize:{display1:54,display2:46,display3:42,title1:38,title2:34,title3:30,title4:28,headline1:22,body1:22,label1:20,label2:20,caption1:18,caption2:18,legal1:17},lineHeight:{...D.lineHeight,title1:48,title2:44,title4:32,label1:28,label2:28,caption1:24,caption2:24}};var e="uds",S=`${e}-spectrum-color`,m=`${e}-font`,u=`${e}-icon-size`,E=`${e}-avatar-size`,C=`${e}-border-radius`,F=`${e}-border-width`,x=`${e}-spacing`,T=`${e}-font-size`,h=`${e}-line-height`,A=`${e}-font-weight`,$=`${e}-text-transform`,U=`${e}-color-mode-dark`,K=`${e}-color-mode-light`,Z=`${e}-scale-mode-xsmall`,j=`${e}-scale-mode-small`,B=`${e}-scale-mode-medium`,Y=`${e}-scale-mode-large`,q=`${e}-scale-mode-xlarge`,J=`${e}-scale-mode-xxlarge`,Q=`${e}-scale-mode-xxxlarge`;var ee=`--${e}-font-icons`,te=`--${e}-font-sans`,oe=`--${e}-font-sans-beta`,ne=`--${e}-font-sans-condensed`,ie=`--${e}-font-serif-display`,ae=`--${e}-font-serif-text`;function c(o){return Object.entries(o)}function R(o,n){return Object.keys(o).reduce((s,t,i)=>(s[t]=n(o[t],t,i),s),{})}function I(o){let{palette:n,spectrum:s}=o,t={},i={spectrum:{},palette:{}};for(let[a,l]of c(s))for(let[r,p]of c(l)){let f=`${a}-${r}`,d=`--${S}-${f}`;i.spectrum[a]||(i.spectrum[a]={}),i.spectrum[a][r]=`rgb(var(${d}))`,t[d]=p}return c(n).forEach(([a,l])=>{for(let[r,{hue:p,step:f,opacity:d}]of Object.entries(l)){a in i.palette||(i.palette[a]={});let y=`--${e}-${a}-color-${r}`;t[y]=`var(--${S}-${p}-${f})`,i.palette[a][r]=d?`rgb(var(${y}) / ${d})`:`rgb(var(${y}))`}}),{_vars:t,_raw:o,tailwindConfig:i}}function z(o){let n={},s={};for(let[t,i="regular"]of c(o)){let a=`--${A}-${t}`,l=_[i];n[a]=l,s[t]=`var(${a})`}return{_vars:n,_raw:o,tailwindConfig:{..._,...s}}}function L(o,n,s){let t={},i={};for(let[a,l]of c(n)){let r=`--${o}-${a}`,p=s?s(l):l;t[r]=p,i[a]=`var(${r})`}return{_vars:t,_raw:n,tailwindConfig:i}}function g(o,n){if(!n)return{_vars:{},_raw:{},tailwindConfig:{}};let s={},t={};for(let[i,a]of c(n)){let l=`--${o}-${i}`,r=`${a}px`;s[l]=r,t[i]=`var(${l})`}return{_vars:s,_raw:n,tailwindConfig:t}}function V(o){let n={};for(let[s,t]of c(o)){let i=t.map(({color:a,offsetX:l,offsetY:r,blurRadius:p,spreadRadius:f})=>`${l}px ${r}px ${p}px ${f}px ${a}`).join(", ");n[s]=i}return n}function W(o){return R(o,(n,s)=>{let{fallbacks:t=[]}=n??{};return[`var(--${m}-${s})`,...t]})}function ge(o){let{colorMode:n,scaleMode:s,elevation:t,fontFamily:i}=o;return{...o,colorMode:{light:I(n.light),dark:I(n.dark)},scaleMode:R(s,({borderRadius:a,borderWidth:l,spacing:r,fontSize:p,lineHeight:f,fontFamily:d,fontWeight:y,textTransform:N,avatarSizes:O,iconSizes:M})=>({fontFamily:L(m,d,v=>`var(--${m}-${v})`),fontSize:g(T,p),fontWeight:z(y),lineHeight:g(h,f),textTransform:L($,N),borderRadius:g(C,a),borderWidth:g(F,l),spacing:g(x,r),avatarSizes:g(E,O),iconSizes:g(u,M)})),elevation:V(t),fontFamily:W(i)}}export{ge as parseTokens};
1
+ var m={thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};var H={fontSize:{display1:46,display2:37,display3:33,title1:29,title2:25,title3:21,title4:17,headline1:13,body1:13,label1:12,label2:12,caption1:11,caption2:11,legal1:10},lineHeight:{display1:44,display2:44,display3:44,title1:36,title2:32,title3:28,title4:24,headline1:16,body1:16,label1:16,label2:16,caption1:16,caption2:16,legal1:12}},k={fontSize:{display1:46,display2:38,display3:34,title1:30,title2:26,title3:22,title4:18,headline1:14,body1:14,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...H.lineHeight,title1:40,headline1:20,body1:20,legal1:16}},R={fontSize:{display1:47,display2:39,display3:35,title1:31,title2:27,title3:23,title4:19,headline1:15,body1:15,label1:13,label2:13,caption1:12,caption2:12,legal1:11},lineHeight:{...k.lineHeight,title2:36,title3:32}},v={fontSize:{...R.fontSize,display1:48,display2:40,display3:36,title1:32,title2:28,title3:24,title4:20,headline1:16,body1:16,label1:14,label2:14},lineHeight:{...R.lineHeight,title2:36,title3:32,headline1:20,body1:20,label1:20,label2:20}},X={fontSize:{display1:50,display2:42,display3:38,title1:34,title2:30,title3:26,title4:22,headline1:18,body1:16,label1:16,label2:16,caption1:14,caption2:14,legal1:13},lineHeight:{...v.lineHeight,title1:44,headline1:24,body1:24,caption1:20,caption2:20}},P={fontSize:{display1:52,display2:44,display3:40,title1:36,title2:32,title3:28,title4:26,headline1:20,body1:20,label1:18,label2:18,caption1:16,caption2:16,legal1:15},lineHeight:{...X.lineHeight,title2:40,title3:36,headline1:28,body1:28,label1:24,label2:24,legal1:20}},W={fontSize:{display1:54,display2:46,display3:42,title1:38,title2:34,title3:30,title4:28,headline1:22,body1:22,label1:20,label2:20,caption1:18,caption2:18,legal1:17},lineHeight:{...P.lineHeight,title1:48,title2:44,title4:32,label1:28,label2:28,caption1:24,caption2:24}};var e="uds",S=`${e}-spectrum-color`,_=`${e}-font`,u=`${e}-icon-size`,E=`${e}-avatar-size`,F=`${e}-border-radius`,C=`${e}-border-width`,T=`${e}-spacing`,x=`${e}-font-size`,h=`${e}-line-height`,A=`${e}-font-weight`,$=`${e}-text-transform`,G=`${e}-color-mode-dark`,w=`${e}-color-mode-light`,U=`${e}-scale-mode-xsmall`,K=`${e}-scale-mode-small`,Z=`${e}-scale-mode-medium`,B=`${e}-scale-mode-large`,j=`${e}-scale-mode-xlarge`,Y=`${e}-scale-mode-xxlarge`,q=`${e}-scale-mode-xxxlarge`;var J=`--${e}-font-icons`,Q=`--${e}-font-sans`,ee=`--${e}-font-sans-beta`,te=`--${e}-font-sans-condensed`,oe=`--${e}-font-serif-display`,ne=`--${e}-font-serif-text`;function f(o){return Object.entries(o)}function b(o,a){return Object.keys(o).reduce((s,t,n)=>(s[t]=a(o[t],t,n),s),{})}function I(o){let{palette:a,spectrum:s}=o,t={},n={spectrum:{},palette:{}};for(let[i,l]of f(s))for(let[r,c]of f(l)){let g=`${i}-${r}`,p=`--${S}-${g}`;n.spectrum[i]||(n.spectrum[i]={}),n.spectrum[i][r]=`rgb(var(${p}))`,t[p]=c}return f(a).forEach(([i,l])=>{for(let[r,{hue:c,step:g,opacity:p}]of Object.entries(l)){i in n.palette||(n.palette[i]={});let y=`--${e}-${i}-color-${r}`;t[y]=`var(--${S}-${c}-${g})`,n.palette[i][r]=p?`rgb(var(${y}) / ${p})`:`rgb(var(${y}))`}}),{_vars:t,_raw:o,tailwindConfig:n}}function D(o){let a={},s={};for(let[t,n="regular"]of f(o)){let i=`--${A}-${t}`,l=m[n];a[i]=l,s[t]=`var(${i})`}return{_vars:a,_raw:o,tailwindConfig:{...m,...s}}}function L(o,a,s){let t={},n={};for(let[i,l]of f(a)){let r=`--${o}-${i}`,c=s?s(l):l;t[r]=c,n[i]=`var(${r})`}return{_vars:t,_raw:a,tailwindConfig:n}}function d(o,a){if(!a)return{_vars:{},_raw:{},tailwindConfig:{}};let s={},t={};for(let[n,i]of f(a)){let l=`--${o}-${n}`,r=`${i}px`;s[l]=r,t[n]=`var(${l})`}return{_vars:s,_raw:a,tailwindConfig:t}}function z(o){return b(o,(a,s)=>{let{fallbacks:t=[]}=a??{};return[`var(--${_}-${s})`,...t]})}function fe(o){let{colorMode:a,scaleMode:s,fontFamily:t}=o;return{...o,colorMode:{light:I(a.light),dark:I(a.dark)},scaleMode:b(s,({borderRadius:n,borderWidth:i,spacing:l,fontSize:r,lineHeight:c,fontFamily:g,fontWeight:p,textTransform:y,avatarSizes:N,iconSizes:O})=>({fontFamily:L(_,g,M=>`var(--${_}-${M})`),fontSize:d(x,r),fontWeight:D(p),lineHeight:d(h,c),textTransform:L($,y),borderRadius:d(F,n),borderWidth:d(C,i),spacing:d(T,l),avatarSizes:d(E,N),iconSizes:d(u,O)})),fontFamily:z(t)}}export{fe as parseTokens};
@@ -1 +1 @@
1
- "use strict";var f=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var m=(e,o)=>{for(var t in o)f(e,t,{get:o[t],enumerable:!0})},w=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of T(o))!C.call(e,n)&&n!==t&&f(e,n,{get:()=>o[n],enumerable:!(r=d(o,n))||r.enumerable});return e};var b=e=>w(f({},"__esModule",{value:!0}),e);var O={};m(O,{parseTokens:()=>h});module.exports=b(O);function p(e){return Object.entries(e)}function s(e,o){return Object.keys(e).reduce((t,r,n)=>(t[r]=o(e[r],r,n),t),{})}function u({spectrum:e,palette:o}){let t=s(e,n=>s(n,i=>`rgb(${i.replaceAll(" ",",")})`)),r=s(o,n=>Object.entries(n).reduce((i,[a,{hue:l,step:k,opacity:y}])=>{let c=e[l][k],g=y?`rgb(${c.replaceAll(" ",",")} / ${y})`:`rgb(${c.replaceAll(" ",",")})`;return{...i,[a]:g}},{}));return{spectrum:t,palette:r}}function v(e){let o={};for(let[t,[{color:r,offsetX:n,offsetY:i,blurRadius:a}]]of p(e)){let l={shadowColor:r,shadowOffset:{width:n,height:i},shadowOpacity:1,shadowRadius:a};o[t]=l}return o}function h({colorMode:e,elevation:o,...t}){return{...t,colorMode:{light:u(e.light),dark:u(e.dark)},elevation:v(o)}}0&&(module.exports={parseTokens});
1
+ "use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var d=(e,o)=>{for(var r in o)i(e,r,{get:o[r],enumerable:!0})},b=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of C(o))!T.call(e,n)&&n!==r&&i(e,n,{get:()=>o[n],enumerable:!(t=g(o,n))||t.enumerable});return e};var m=e=>b(i({},"__esModule",{value:!0}),e);var A={};d(A,{parseTokens:()=>M});module.exports=m(A);function l(e,o){return Object.keys(e).reduce((r,t,n)=>(r[t]=o(e[t],t,n),r),{})}function p({spectrum:e,palette:o}){let r=l(e,n=>l(n,s=>`rgb(${s.replaceAll(" ",",")})`)),t=l(o,n=>Object.entries(n).reduce((s,[y,{hue:k,step:u,opacity:a}])=>{let f=e[k][u],c=a?`rgb(${f.replaceAll(" ",",")} / ${a})`:`rgb(${f.replaceAll(" ",",")})`;return{...s,[y]:c}},{}));return{spectrum:r,palette:t}}function M({colorMode:e,...o}){return{...o,colorMode:{light:p(e.light),dark:p(e.dark)}}}0&&(module.exports={parseTokens});
@@ -1,5 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, a as ColorsConfig, E as ElevationConfig, g as Elevation } from '../types-CzJpH_Oi.cjs';
2
- import { ShadowStyleIOS } from 'react-native';
1
+ import { U as UniversalTokensConfig, C as ColorMode, a as ColorsConfig } from '../types-COiuE8XK.cjs';
3
2
  import 'react';
4
3
 
5
4
  declare function transformColors({ spectrum, palette }: ColorsConfig): {
@@ -377,26 +376,12 @@ declare function transformColors({ spectrum, palette }: ColorsConfig): {
377
376
  primary: string;
378
377
  secondary: string;
379
378
  };
380
- backgroundWash: {
381
- 'accent-wash': string;
382
- 'alert-wash': string;
383
- 'brand-wash': string;
384
- 'positive-wash': string;
385
- 'warning-wash': string;
386
- };
387
- elevation: {
388
- 'elevation-1': string;
389
- 'elevation-2': string;
390
- 'elevation-3': string;
391
- 'elevation-3-inverse': string;
392
- overlay: string;
393
- };
394
379
  foreground: {
395
380
  primary: string;
396
381
  secondary: string;
397
382
  tertiary: string;
398
383
  muted: string;
399
- 'on-color': string;
384
+ "on-color": string;
400
385
  };
401
386
  line: {
402
387
  primary: string;
@@ -406,11 +391,9 @@ declare function transformColors({ spectrum, palette }: ColorsConfig): {
406
391
  };
407
392
  };
408
393
  };
409
- declare function transformElevation(elevation: ElevationConfig): Record<Elevation, ShadowStyleIOS>;
410
- type MobileTokens = Omit<UniversalTokensConfig, 'colorMode' | 'elevation'> & {
411
- elevation: ReturnType<typeof transformElevation>;
394
+ type MobileTokens = Omit<UniversalTokensConfig, 'colorMode'> & {
412
395
  colorMode: Record<ColorMode, ReturnType<typeof transformColors>>;
413
396
  };
414
- declare function parseTokens({ colorMode, elevation, ...config }: UniversalTokensConfig): MobileTokens;
397
+ declare function parseTokens({ colorMode, ...config }: UniversalTokensConfig): MobileTokens;
415
398
 
416
399
  export { parseTokens };
@@ -1,5 +1,4 @@
1
- import { U as UniversalTokensConfig, C as ColorMode, a as ColorsConfig, E as ElevationConfig, g as Elevation } from '../types-CzJpH_Oi.js';
2
- import { ShadowStyleIOS } from 'react-native';
1
+ import { U as UniversalTokensConfig, C as ColorMode, a as ColorsConfig } from '../types-COiuE8XK.js';
3
2
  import 'react';
4
3
 
5
4
  declare function transformColors({ spectrum, palette }: ColorsConfig): {
@@ -377,26 +376,12 @@ declare function transformColors({ spectrum, palette }: ColorsConfig): {
377
376
  primary: string;
378
377
  secondary: string;
379
378
  };
380
- backgroundWash: {
381
- 'accent-wash': string;
382
- 'alert-wash': string;
383
- 'brand-wash': string;
384
- 'positive-wash': string;
385
- 'warning-wash': string;
386
- };
387
- elevation: {
388
- 'elevation-1': string;
389
- 'elevation-2': string;
390
- 'elevation-3': string;
391
- 'elevation-3-inverse': string;
392
- overlay: string;
393
- };
394
379
  foreground: {
395
380
  primary: string;
396
381
  secondary: string;
397
382
  tertiary: string;
398
383
  muted: string;
399
- 'on-color': string;
384
+ "on-color": string;
400
385
  };
401
386
  line: {
402
387
  primary: string;
@@ -406,11 +391,9 @@ declare function transformColors({ spectrum, palette }: ColorsConfig): {
406
391
  };
407
392
  };
408
393
  };
409
- declare function transformElevation(elevation: ElevationConfig): Record<Elevation, ShadowStyleIOS>;
410
- type MobileTokens = Omit<UniversalTokensConfig, 'colorMode' | 'elevation'> & {
411
- elevation: ReturnType<typeof transformElevation>;
394
+ type MobileTokens = Omit<UniversalTokensConfig, 'colorMode'> & {
412
395
  colorMode: Record<ColorMode, ReturnType<typeof transformColors>>;
413
396
  };
414
- declare function parseTokens({ colorMode, elevation, ...config }: UniversalTokensConfig): MobileTokens;
397
+ declare function parseTokens({ colorMode, ...config }: UniversalTokensConfig): MobileTokens;
415
398
 
416
399
  export { parseTokens };
@@ -1 +1 @@
1
- function c(e){return Object.entries(e)}function s(e,o){return Object.keys(e).reduce((t,n,r)=>(t[n]=o(e[n],n,r),t),{})}function p({spectrum:e,palette:o}){let t=s(e,r=>s(r,i=>`rgb(${i.replaceAll(" ",",")})`)),n=s(o,r=>Object.entries(r).reduce((i,[a,{hue:l,step:u,opacity:f}])=>{let y=e[l][u],k=f?`rgb(${y.replaceAll(" ",",")} / ${f})`:`rgb(${y.replaceAll(" ",",")})`;return{...i,[a]:k}},{}));return{spectrum:t,palette:n}}function g(e){let o={};for(let[t,[{color:n,offsetX:r,offsetY:i,blurRadius:a}]]of c(e)){let l={shadowColor:n,shadowOffset:{width:r,height:i},shadowOpacity:1,shadowRadius:a};o[t]=l}return o}function w({colorMode:e,elevation:o,...t}){return{...t,colorMode:{light:p(e.light),dark:p(e.dark)},elevation:g(o)}}export{w as parseTokens};
1
+ function l(e,o){return Object.keys(e).reduce((t,n,r)=>(t[n]=o(e[n],n,r),t),{})}function f({spectrum:e,palette:o}){let t=l(e,r=>l(r,s=>`rgb(${s.replaceAll(" ",",")})`)),n=l(o,r=>Object.entries(r).reduce((s,[p,{hue:y,step:k,opacity:i}])=>{let a=e[y][k],u=i?`rgb(${a.replaceAll(" ",",")} / ${i})`:`rgb(${a.replaceAll(" ",",")})`;return{...s,[p]:u}},{}));return{spectrum:t,palette:n}}function C({colorMode:e,...o}){return{...o,colorMode:{light:f(e.light),dark:f(e.dark)}}}export{C as parseTokens};
@@ -20,55 +20,19 @@ type Palette = {
20
20
  type Hue = 'gray' | 'purple' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'mint' | 'green' | 'lime' | 'citron' | 'yellow' | 'brown' | 'nude' | 'orange' | 'sunset' | 'red' | 'rose' | 'pink' | 'magenta' | 'carbon';
21
21
  type HueStep = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15';
22
22
  type SpectrumColor = `${Hue}-${HueStep}`;
23
- type CorePalette = {
24
- accent: PaletteValue;
25
- alert: PaletteValue;
26
- brand: PaletteValue;
27
- positive: PaletteValue;
28
- warning: PaletteValue;
29
- };
30
- type CorePaletteAlias = keyof CorePalette;
31
- type BackgroundPalette = {
32
- primary: PaletteValue;
33
- secondary: PaletteValue;
34
- };
35
- type BackgroundPaletteAlias = keyof BackgroundPalette;
36
- type BackgroundWashPalette = {
37
- 'accent-wash': PaletteValue;
38
- 'alert-wash': PaletteValue;
39
- 'brand-wash': PaletteValue;
40
- 'positive-wash': PaletteValue;
41
- 'warning-wash': PaletteValue;
42
- };
43
- type BackgroundWashPaletteAlias = keyof BackgroundWashPalette;
44
- type ElevationPalette = {
45
- 'elevation-1': PaletteValue;
46
- 'elevation-2': PaletteValue;
47
- 'elevation-3': PaletteValue;
48
- 'elevation-3-inverse': PaletteValue;
49
- overlay: PaletteValue;
50
- };
51
- type ElevationPaletteAlias = keyof ElevationPalette;
52
- type ForegroundPalette = {
53
- primary: PaletteValue;
54
- secondary: PaletteValue;
55
- tertiary: PaletteValue;
56
- muted: PaletteValue;
57
- 'on-color': PaletteValue;
58
- };
59
- type ForegroundPaletteAlias = keyof ForegroundPalette;
60
- type LinePalette = {
61
- primary: PaletteValue;
62
- secondary: PaletteValue;
63
- tertiary: PaletteValue;
64
- muted: PaletteValue;
65
- };
66
- type LinePaletteAlias = keyof LinePalette;
23
+ type CorePalette = Record<CorePaletteAlias, PaletteValue>;
24
+ type CorePaletteAlias = 'accent' | 'alert' | 'brand' | 'positive' | 'warning';
25
+ type BackgroundPaletteAlias = 'primary' | 'secondary';
26
+ type BackgroundPalette = Record<BackgroundPaletteAlias, PaletteValue>;
27
+ type ForegroundPalette = Record<ForegroundPaletteAlias, PaletteValue>;
28
+ type ForegroundPaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted' | 'on-color';
29
+ type LinePalette = Record<LinePaletteAlias, PaletteValue>;
30
+ type LinePaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted';
67
31
  type AlwaysPalette = typeof alwaysPalette;
68
32
  type AlwaysPaletteAlias = keyof AlwaysPalette;
69
33
  type ForegroundColor = CorePaletteAlias | ForegroundPaletteAlias | AlwaysPaletteAlias;
70
34
  type LineColor = CorePaletteAlias | LinePaletteAlias | AlwaysPaletteAlias;
71
- type BackgroundColor = CorePaletteAlias | BackgroundPaletteAlias | BackgroundWashPaletteAlias | ElevationPaletteAlias | AlwaysPaletteAlias;
35
+ type BackgroundColor = CorePaletteAlias | BackgroundPaletteAlias | AlwaysPaletteAlias;
72
36
  type TextVariant = 'display1' | 'display2' | 'display3' | 'title1' | 'title2' | 'title3' | 'title4' | 'headline1' | 'body1' | 'label1' | 'label2' | 'caption1' | 'caption2' | 'legal1';
73
37
  type FontFamilyGlobalAlias = 'icons' | 'sans' | 'sans-beta' | 'sans-condensed' | 'serif-text' | 'serif-display';
74
38
  type FontFamilyGlobalConfig = Record<FontFamilyGlobalAlias, {
@@ -88,29 +52,15 @@ type FontFamilyConfig = Record<TextVariant, FontFamilyGlobalAlias>;
88
52
  type FontWeightConfig = Record<TextVariant, FontWeightDescriptive>;
89
53
  type LineHeightConfig = Record<TextVariant, LineHeight>;
90
54
  type ConfigurableTextProperty = 'fontFamily' | 'fontSize' | 'fontWeight' | 'lineHeight' | 'textTransform';
91
- type AvatarSizeConfig = {
92
- s: number;
93
- m: number;
94
- l: number;
95
- };
96
- type AvatarSize = keyof AvatarSizeConfig;
55
+ type AvatarSize = 's' | 'm' | 'l';
56
+ type AvatarSizeConfig = Record<AvatarSize, number>;
97
57
  type AvatarShape = BorderRadius;
98
- type IconSizeConfig = {
99
- s: number;
100
- m: number;
101
- l: number;
102
- };
103
- type IconSize = keyof IconSizeConfig;
104
- type AspectRatioConfig = Record<string, string>;
105
- type AspectRatio = keyof AspectRatioConfig;
58
+ type IconSize = 'sm' | 'md' | 'lg';
59
+ type IconSizeConfig = Record<IconSize, number>;
106
60
  type SpacingAlias = 'none' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14';
107
61
  type SpacingConfig = Record<SpacingAlias, number>;
108
- type ZIndex = 'auto' | '0' | '10' | '20' | '30' | '40' | '50';
109
- type ZIndexConfig = Record<ZIndex, string>;
110
62
  type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
111
63
  type BorderRadiusConfig = Record<BorderRadius, number>;
112
- type Elevation = '1' | '2' | '3';
113
- type ElevationConfig = Record<Elevation, BoxShadowConfig>;
114
64
  type BorderWidth = 'none' | 'thin' | 'medium' | 'thick';
115
65
  type BorderWidthConfig = Record<BorderWidth, number>;
116
66
  type BoxShadowConfig = {
@@ -120,11 +70,7 @@ type BoxShadowConfig = {
120
70
  blurRadius: number;
121
71
  spreadRadius: number;
122
72
  }[];
123
- type Opacity = '0' | '5' | '10' | '20' | '25' | '30' | '40' | '50' | '60' | '70' | '75' | '80' | '90' | '95' | '100';
124
- type ColorModeConfig = {
125
- light: ColorsConfig;
126
- dark: ColorsConfig;
127
- };
73
+ type ColorModeConfig = Record<ColorMode, ColorsConfig>;
128
74
  type ColorsConfig = {
129
75
  palette: PaletteConfig;
130
76
  spectrum: SpectrumConfig;
@@ -134,8 +80,6 @@ type SpectrumConfig = Record<Hue, SpectrumValue>;
134
80
  type PaletteConfig = {
135
81
  core: CorePalette;
136
82
  background: BackgroundPalette;
137
- backgroundWash: BackgroundWashPalette;
138
- elevation: ElevationPalette;
139
83
  foreground: ForegroundPalette;
140
84
  line: LinePalette;
141
85
  };
@@ -151,27 +95,16 @@ type ScaleConfig = {
151
95
  lineHeight: LineHeightConfig;
152
96
  textTransform: TextTransformConfig;
153
97
  };
154
- type ScaleModeConfig = {
155
- xSmall: ScaleConfig;
156
- small: ScaleConfig;
157
- medium: ScaleConfig;
158
- large: ScaleConfig;
159
- xLarge: ScaleConfig;
160
- xxLarge: ScaleConfig;
161
- xxxLarge: ScaleConfig;
162
- };
98
+ type ScaleModeConfig = Record<ScaleMode, ScaleConfig>;
163
99
  type UniversalTokensConfig = {
164
100
  colorMode: ColorModeConfig;
165
101
  scaleMode: ScaleModeConfig;
166
- aspectRatio: Record<string, string>;
167
102
  fontFamily: FontFamilyGlobalConfig;
168
- elevation: ElevationConfig;
169
- zIndex: ZIndexConfig;
170
103
  };
171
104
  type PlatformMode = 'web' | 'ios' | 'android';
172
- type ColorMode = keyof ColorModeConfig;
105
+ type ColorMode = 'light' | 'dark';
173
106
  type ColorModeForApp = ColorMode | 'system';
174
- type ScaleMode = keyof ScaleModeConfig;
107
+ type ScaleMode = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge' | 'xxxLarge';
175
108
  type ScaleModeForApp = ScaleMode | 'system';
176
109
  type HighContrastMode = boolean;
177
110
  type RegionMode = '🇺🇸 US' | '🇩🇪 DE' | '🇫🇷 FR' | '🇨🇳 CN';
@@ -211,20 +144,6 @@ type ImageStyleProps = {
211
144
  contentFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
212
145
  };
213
146
  interface BorderStyleProps {
214
- /** Add a border around all sides of the box. */
215
- bordered?: boolean;
216
- /** Add a border to the top side of the box. */
217
- borderedTop?: boolean;
218
- /** Add a border to the bottom side of the box. */
219
- borderedBottom?: boolean;
220
- /** Add a border to the leading side of the box. */
221
- borderedStart?: boolean;
222
- /** Add a border to the trailing side of the box. */
223
- borderedEnd?: boolean;
224
- /** Add a border to the leading and trailing sides of the box. */
225
- borderedHorizontal?: boolean;
226
- /** Add a border to the top and bottom sides of the box. */
227
- borderedVertical?: boolean;
228
147
  /** Add a border radius to all corners of the box. */
229
148
  borderRadius?: BorderRadius;
230
149
  /** Add a border radius to top left corner of the box. */
@@ -237,21 +156,21 @@ interface BorderStyleProps {
237
156
  borderBottomEndRadius?: BorderRadius;
238
157
  /** Adds a custom border color from the palette */
239
158
  borderColor?: LineColor;
240
- /** Utility for controlling an element's border color on active. */
159
+ /** Border color on active. */
241
160
  borderColorOnActive?: LineColor;
242
- /** Utility for controlling an element's border color on focus. */
161
+ /** Border color on focus. */
243
162
  borderColorOnFocus?: LineColor;
244
- /** Utility for controlling an element's border color on checked. */
163
+ /** Border color on checked. */
245
164
  borderColorOnChecked?: LineColor;
246
- /** Utility for controlling an element's border color on hover. */
165
+ /** Border color on hover. */
247
166
  borderColorOnHover?: LineColor;
248
- /** Adds a custom border color from the palette */
167
+ /** Start border color */
249
168
  borderStartColor?: LineColor;
250
- /** Adds a custom border color from the palette */
169
+ /** End border color */
251
170
  borderEndColor?: LineColor;
252
- /** Adds a custom border color from the palette */
171
+ /** Top border color */
253
172
  borderTopColor?: LineColor;
254
- /** Adds a custom border color from the palette */
173
+ /** Bottom border color */
255
174
  borderBottomColor?: LineColor;
256
175
  /** Shorthand property to the width of an element's border. */
257
176
  borderWidth?: BorderWidth;
@@ -271,8 +190,6 @@ interface BorderStyleProps {
271
190
  interface LayoutStyleProps {
272
191
  /** Sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
273
192
  display?: Display;
274
- /** Sets the z-order of a positioned element and its descendants or flex and grid items. Overlapping elements with a larger z-index cover those with a smaller one. */
275
- zIndex?: ZIndex;
276
193
  /** Shorthand property which sets the desired behavior when content does not fit in the parent element box (overflows) in the horizontal and/or vertical direction. */
277
194
  overflow?: Overflow;
278
195
  /** Sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the overflow shorthand property. */
@@ -338,9 +255,6 @@ interface FlexStyleProps {
338
255
  /** Sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with box-sizing. https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis */
339
256
  flexBasis?: FlexBasis;
340
257
  }
341
- interface OpacityStyleProps {
342
- opacity?: Opacity;
343
- }
344
258
  interface SizingStyleProps {
345
259
  /** Sets the height of an element */
346
260
  height?: Height;
@@ -360,45 +274,33 @@ interface StateStyleProps {
360
274
  focusable?: boolean;
361
275
  }
362
276
  interface TextStyleProps {
363
- /** Utility for controlling the color of a Text or Icon element */
277
+ /** Color of a Text or Icon element */
364
278
  color?: ForegroundColor;
365
- /** Utility for controlling the color of a Text or Icon element when checked */
366
- colorChecked?: ForegroundColor;
367
- /** Utility for controlling the color of a placeholder element */
279
+ /** Color of placeholder text */
368
280
  placeholderColor?: ForegroundColor;
369
- /** Utility for controlling the font family of a Text element */
281
+ /** Font family for the text */
370
282
  fontFamily?: TextVariant | FontFamilyGlobalAlias;
371
- /** Utility for controlling the font size of a Text element */
283
+ /** Font size of the text */
372
284
  fontSize?: TextVariant;
373
- /** Utility for controlling the font weight of a Text element */
285
+ /** Font weight of the text */
374
286
  fontWeight?: TextVariant | FontWeightDescriptive;
375
- /** Utility for controlling the line height of a Text element */
287
+ /** Line height of the text */
376
288
  lineHeight?: TextVariant;
377
- /** Utility for controlling the text alignment of a Text element */
289
+ /** Text alignment of the text */
378
290
  textAlign?: 'center' | 'justify' | 'start' | 'end';
379
- /** Utility for controlling the text transformation of a Text element */
291
+ /** Sets the text transform for the text */
380
292
  textTransform?: TextVariant | TextTransform;
381
293
  }
382
294
  interface BackgroundStyleProps {
383
- /** Utility for controlling an element's background color. */
295
+ /** Sets the background color. */
384
296
  backgroundColor?: BackgroundColor;
385
- /** Utility for controlling an element's background color on active. */
386
- backgroundColorOnActive?: BackgroundColor;
387
- /** Utility for controlling an element's background color on focus. */
388
- backgroundColorOnFocus?: BackgroundColor;
389
- /** Utility for controlling an element's background color on checked. */
390
- backgroundColorOnChecked?: BackgroundColor;
391
- /** Utility for controlling an element's background color on hover. */
392
- backgroundColorOnHover?: BackgroundColor;
393
- /** Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. */
394
- elevation?: Elevation;
395
297
  }
396
298
  type CustomSizingStyleProps = {
397
299
  iconSize?: IconSize;
398
300
  avatarSize?: AvatarSize;
399
301
  };
400
- type StyleProps = BackgroundStyleProps & BorderStyleProps & LayoutStyleProps & FlexStyleProps & SpacingStyleProps & TextStyleProps & OpacityStyleProps & SizingStyleProps & ImageStyleProps & CustomSizingStyleProps;
401
- interface UniversalBoxProps extends PropsWithChildren, BackgroundStyleProps, BorderStyleProps, FlexStyleProps, LayoutStyleProps, OpacityStyleProps, SizingStyleProps, SpacingStyleProps {
302
+ type StyleProps = BackgroundStyleProps & BorderStyleProps & LayoutStyleProps & FlexStyleProps & SpacingStyleProps & TextStyleProps & SizingStyleProps & ImageStyleProps & CustomSizingStyleProps;
303
+ interface UniversalBoxProps extends PropsWithChildren, BackgroundStyleProps, BorderStyleProps, FlexStyleProps, LayoutStyleProps, SizingStyleProps, SpacingStyleProps {
402
304
  /**
403
305
  * When asChild is set to true, the component's child will be cloned and passed
404
306
  * the props and behavior required to make it functional.
@@ -409,17 +311,24 @@ interface UniversalStackProps extends Omit<UniversalBoxProps, 'flexDirection'> {
409
311
  gap?: SpacingAlias;
410
312
  }
411
313
  interface UniversalTextProps extends PropsWithChildren, TextStyleProps, UniversalBoxProps {
314
+ /** Style of text. */
412
315
  variant?: TextVariant;
316
+ /** Color of the text. */
317
+ color?: ForegroundColor;
413
318
  }
414
319
  type IconName = IconName$1;
415
- interface UniversalIconProps extends Omit<UniversalTextProps, 'children' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'lineHeight'>, UniversalBoxProps {
416
- size?: IconSize;
320
+ interface UniversalIconProps extends Omit<TextStyleProps, 'fontFamily' | 'fontSize' | 'fontWeight' | 'lineHeight'>, UniversalBoxProps {
321
+ /** Size of the icon. */
322
+ size: IconSize;
323
+ /** Name of the icon. */
417
324
  name: IconName;
325
+ /** Color of the icon. */
326
+ color?: ForegroundColor;
418
327
  }
419
328
  interface UniversalPressableProps extends UniversalBoxProps {
420
329
  onPress?: () => void;
421
330
  }
422
- type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | `${CorePaletteAlias}-wash` | 'primary-ghost' | 'primary-outline' | 'secondary';
331
+ type ButtonVariant = CorePaletteAlias | `${CorePaletteAlias}-outline` | `${CorePaletteAlias}-ghost` | 'primary-ghost' | 'primary-outline' | 'secondary';
423
332
  type ButtonSize = 's' | 'm' | 'l';
424
333
  interface UniversalIconButtonProps {
425
334
  /**
@@ -434,6 +343,8 @@ interface UniversalIconButtonProps {
434
343
  size?: ButtonSize;
435
344
  /** The name of the icon to be displayed at the start of the button. */
436
345
  name: IconName;
346
+ /** Color for the icon. */
347
+ color: ForegroundColor;
437
348
  }
438
349
  interface UniversalButtonProps {
439
350
  /**
@@ -481,4 +392,4 @@ interface UniversalTextInputProps {
481
392
  spacingHorizontal?: SpacingAlias;
482
393
  }
483
394
 
484
- export { type Display as $, type AlwaysPalette as A, type BackgroundPalette as B, type ColorMode as C, type BackgroundColor as D, type ElevationConfig as E, type ForegroundPalette as F, type BackgroundPaletteAlias as G, type Hue as H, type BackgroundStyleProps as I, type BackgroundWashPaletteAlias as J, type BorderRadius as K, type LinePalette as L, type BorderRadiusConfig as M, type BorderStyleProps as N, type BorderWidth as O, type PaletteValue as P, type BorderWidthConfig as Q, type BoxShadowConfig as R, type ScaleMode as S, type ButtonSize as T, type UniversalTokensConfig as U, type ButtonVariant as V, type ColorModeForApp as W, type ConfigurableTextProperty as X, type CorePaletteAlias as Y, type CustomSizingStyleProps as Z, type DataAttribute as _, type ColorsConfig as a, type TransitionTiming as a$, type ElevationPaletteAlias 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 Modes as aA, type Opacity as aB, type OpacityStyleProps as aC, type Overflow as aD, type Palette as aE, type PaletteConfig as aF, type PaletteType as aG, type PlatformMode as aH, type Position as aI, type RegionMode as aJ, type ScaleConfig as aK, type ScaleModeConfig as aL, type ScaleModeForApp as aM, type SizingStyleProps as aN, type SpacingAlias as aO, type SpacingConfig as aP, type SpacingStyleProps as aQ, type SpectrumColor as aR, type SpectrumConfig as aS, type StateStyleProps as aT, type StyleProps as aU, type TextStyleProps as aV, type TextTransform as aW, type TextTransformConfig as aX, type TextVariant as aY, type TransitionDelay as aZ, type TransitionDuration as a_, type FlexStyleProps as aa, type FlexWrap as ab, type FontFamilyConfig as ac, type FontFamilyGlobalAlias as ad, type FontSize as ae, type FontSizeConfig as af, type FontWeightDescriptive as ag, type ForegroundColor as ah, type ForegroundPaletteAlias as ai, type Height as aj, type HighContrastMode as ak, type IconName as al, type IconSize as am, type IconSizeConfig as an, type ImageStyleProps as ao, type LayoutStyleProps as ap, type LetterSpacing as aq, type LineClampAlias as ar, type LineColor as as, type LineHeight as at, type LineHeightConfig as au, type LinePaletteAlias as av, type MaxHeight as aw, type MaxWidth as ax, type MinHeight as ay, type MinWidth as az, type HueStep as b, type UniversalTextInputProps as b0, type Width as b1, type ZIndex as b2, type ZIndexConfig as b3, type CorePalette as c, type BackgroundWashPalette as d, type FontWeightConfig as e, type FontWeightNumeric as f, type Elevation as g, type FontFamilyGlobalConfig as h, type UniversalAvatarProps as i, type UniversalButtonProps as j, type UniversalBoxProps as k, type UniversalPressableProps as l, type UniversalStackProps as m, type UniversalIconButtonProps as n, type UniversalImageProps as o, type UniversalIconProps as p, type UniversalTextProps as q, alwaysPalette as r, type AlwaysPaletteAlias as s, type Animation as t, type AriaAttribute as u, type AspectRatio as v, type AspectRatioConfig as w, type AvatarShape as x, type AvatarSize as y, type AvatarSizeConfig as z };
395
+ export { type FlexJustifyContent as $, type AlwaysPalette as A, type BackgroundPaletteAlias as B, type ColorMode as C, type BorderWidth as D, type BorderWidthConfig as E, type ForegroundPaletteAlias as F, type BoxShadowConfig as G, type Hue as H, type ButtonSize as I, type ButtonVariant as J, type ColorModeConfig as K, type LinePaletteAlias as L, type ColorModeForApp as M, type ConfigurableTextProperty as N, type CorePalette as O, type CustomSizingStyleProps as P, type DataAttribute as Q, type Display as R, type ScaleMode as S, type Flex as T, type UniversalTokensConfig as U, type FlexAlignContent as V, type FlexAlignItems as W, type FlexAlignSelf as X, type FlexBasis as Y, type FlexDirection as Z, type FlexGrow as _, type ColorsConfig as a, type FlexShrink as a0, type FlexStyleProps as a1, type FlexWrap as a2, type FontFamilyConfig as a3, type FontFamilyGlobalAlias as a4, type FontSize as a5, type FontSizeConfig as a6, type FontWeightDescriptive as a7, type ForegroundColor as a8, type ForegroundPalette as a9, type ScaleConfig as aA, type ScaleModeConfig as aB, type ScaleModeForApp as aC, type SizingStyleProps as aD, type SpacingAlias as aE, type SpacingConfig as aF, type SpacingStyleProps as aG, type SpectrumColor as aH, type SpectrumConfig as aI, type StateStyleProps as aJ, type StyleProps as aK, type TextStyleProps as aL, type TextTransform as aM, type TextTransformConfig as aN, type TextVariant as aO, type TransitionDelay as aP, type TransitionDuration as aQ, type TransitionTiming as aR, type UniversalBoxProps as aS, type UniversalTextInputProps as aT, type UniversalTextProps as aU, type Width as aV, type Height as aa, type HighContrastMode as ab, type IconName as ac, type IconSize as ad, type IconSizeConfig as ae, type ImageStyleProps as af, type LayoutStyleProps as ag, type LetterSpacing as ah, type LineClampAlias as ai, type LineColor as aj, type LineHeight as ak, type LineHeightConfig as al, type LinePalette as am, type MaxHeight as an, type MaxWidth as ao, type MinHeight as ap, type MinWidth as aq, type Modes 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 HueStep as b, type CorePaletteAlias as c, type FontWeightConfig as d, type FontWeightNumeric as e, type FontFamilyGlobalConfig as f, type UniversalAvatarProps as g, type UniversalButtonProps as h, type UniversalPressableProps as i, type UniversalIconButtonProps as j, type UniversalImageProps as k, type UniversalStackProps as l, type UniversalIconProps as m, alwaysPalette as n, type AlwaysPaletteAlias as o, type Animation as p, type AriaAttribute as q, type AvatarShape as r, type AvatarSize as s, type AvatarSizeConfig as t, type BackgroundColor as u, type BackgroundPalette as v, type BackgroundStyleProps as w, type BorderRadius as x, type BorderRadiusConfig as y, type BorderStyleProps as z };