@yahoo/uds 0.2.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cli/README.md +78 -131
- package/cli/commands/purge.ts +7 -3
- package/cli/env.d.ts +1 -0
- package/cli/preload.ts +10 -0
- package/cli/utils/purgeCSS.test.ts +88 -8
- package/cli/utils/purgeCSS.ts +165 -15
- package/dist/Image.native-B3I4JoH3.d.cts +38 -0
- package/dist/Image.native-DUAFJodS.d.ts +38 -0
- package/dist/VStack-BHlRUsOR.d.cts +103 -0
- package/dist/VStack-DMb_RGRS.d.ts +103 -0
- package/dist/experimental/index.cjs +1 -1
- package/dist/experimental/index.d.cts +8 -8
- package/dist/experimental/index.d.ts +8 -8
- package/dist/experimental/index.js +1 -1
- package/dist/experimental/index.native.cjs +1 -1
- package/dist/experimental/index.native.d.cts +3 -3
- package/dist/experimental/index.native.d.ts +3 -3
- package/dist/experimental/index.native.js +1 -1
- package/dist/fixtures.cjs +1946 -0
- package/dist/fixtures.d.ts +81 -0
- package/dist/fixtures.js +1910 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +41 -236
- package/dist/index.d.ts +41 -236
- package/dist/index.js +1 -1
- package/dist/{index.native-CisPq4BI.d.ts → index.native-BTfOSmUx.d.ts} +1 -1
- package/dist/{index.native-DJlx-bfM.d.cts → index.native-Bm-r2Dpa.d.cts} +1 -1
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.d.cts +20 -83
- package/dist/index.native.d.ts +20 -83
- package/dist/index.native.js +1 -1
- package/dist/styles/globals.css +0 -1
- package/dist/styles/toast.css +1 -0
- package/dist/styles/toast.d.cts +2 -0
- package/dist/styles/toast.d.ts +2 -0
- package/dist/tailwindPlugin.cjs +1 -1
- package/dist/tailwindPlugin.d.cts +8 -2
- package/dist/tailwindPlugin.d.ts +8 -2
- package/dist/tailwindPlugin.js +1 -1
- package/dist/tailwindPurge/utils.cjs +1 -0
- package/dist/tailwindPurge/utils.d.cts +25 -0
- package/dist/tailwindPurge/utils.d.ts +25 -0
- package/dist/tailwindPurge/utils.js +1 -0
- package/dist/tailwindPurge.cjs +1 -1
- package/dist/tailwindPurge.d.cts +5 -1
- package/dist/tailwindPurge.d.ts +5 -1
- package/dist/tailwindPurge.js +1 -1
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.native.cjs +1 -1
- package/dist/tokens/index.native.d.cts +2 -2
- package/dist/tokens/index.native.d.ts +2 -2
- package/dist/tokens/index.native.js +1 -1
- package/dist/tokens/parseTokens.cjs +1 -1
- package/dist/tokens/parseTokens.d.cts +8 -18
- package/dist/tokens/parseTokens.d.ts +8 -18
- package/dist/tokens/parseTokens.js +1 -1
- package/dist/tokens/parseTokens.native.cjs +1 -1
- package/dist/tokens/parseTokens.native.d.cts +4 -21
- package/dist/tokens/parseTokens.native.d.ts +4 -21
- package/dist/tokens/parseTokens.native.js +1 -1
- package/dist/{types-CzJpH_Oi.d.cts → types-COiuE8XK.d.cts} +49 -138
- package/dist/{types-CzJpH_Oi.d.ts → types-COiuE8XK.d.ts} +49 -138
- package/package.json +26 -11
- package/dist/Image.native-C6kOWgnf.d.ts +0 -38
- package/dist/Image.native-VeXt5aeI.d.cts +0 -38
- package/dist/VStack-BSD9TbBd.d.cts +0 -114
- package/dist/VStack-Dk3-8IyU.d.ts +0 -114
- package/dist/fixtures/index.cjs +0 -1
- package/dist/fixtures/index.d.cts +0 -154
- package/dist/fixtures/index.d.ts +0 -154
- package/dist/fixtures/index.js +0 -1
@@ -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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
type
|
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 |
|
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
|
92
|
-
|
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
|
99
|
-
|
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
|
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 =
|
105
|
+
type ColorMode = 'light' | 'dark';
|
173
106
|
type ColorModeForApp = ColorMode | 'system';
|
174
|
-
type ScaleMode =
|
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
|
-
/**
|
159
|
+
/** Border color on active. */
|
241
160
|
borderColorOnActive?: LineColor;
|
242
|
-
/**
|
161
|
+
/** Border color on focus. */
|
243
162
|
borderColorOnFocus?: LineColor;
|
244
|
-
/**
|
163
|
+
/** Border color on checked. */
|
245
164
|
borderColorOnChecked?: LineColor;
|
246
|
-
/**
|
165
|
+
/** Border color on hover. */
|
247
166
|
borderColorOnHover?: LineColor;
|
248
|
-
/**
|
167
|
+
/** Start border color */
|
249
168
|
borderStartColor?: LineColor;
|
250
|
-
/**
|
169
|
+
/** End border color */
|
251
170
|
borderEndColor?: LineColor;
|
252
|
-
/**
|
171
|
+
/** Top border color */
|
253
172
|
borderTopColor?: LineColor;
|
254
|
-
/**
|
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
|
-
/**
|
277
|
+
/** Color of a Text or Icon element */
|
364
278
|
color?: ForegroundColor;
|
365
|
-
/**
|
366
|
-
colorChecked?: ForegroundColor;
|
367
|
-
/** Utility for controlling the color of a placeholder element */
|
279
|
+
/** Color of placeholder text */
|
368
280
|
placeholderColor?: ForegroundColor;
|
369
|
-
/**
|
281
|
+
/** Font family for the text */
|
370
282
|
fontFamily?: TextVariant | FontFamilyGlobalAlias;
|
371
|
-
/**
|
283
|
+
/** Font size of the text */
|
372
284
|
fontSize?: TextVariant;
|
373
|
-
/**
|
285
|
+
/** Font weight of the text */
|
374
286
|
fontWeight?: TextVariant | FontWeightDescriptive;
|
375
|
-
/**
|
287
|
+
/** Line height of the text */
|
376
288
|
lineHeight?: TextVariant;
|
377
|
-
/**
|
289
|
+
/** Text alignment of the text */
|
378
290
|
textAlign?: 'center' | 'justify' | 'start' | 'end';
|
379
|
-
/**
|
291
|
+
/** Sets the text transform for the text */
|
380
292
|
textTransform?: TextVariant | TextTransform;
|
381
293
|
}
|
382
294
|
interface BackgroundStyleProps {
|
383
|
-
/**
|
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 &
|
401
|
-
interface UniversalBoxProps extends PropsWithChildren, BackgroundStyleProps, BorderStyleProps, FlexStyleProps, LayoutStyleProps,
|
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<
|
416
|
-
|
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` |
|
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
|
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 };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yahoo/uds",
|
3
3
|
"description": "Yahoo Universal System",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.4.0",
|
5
5
|
"type": "module",
|
6
6
|
"bin": {
|
7
7
|
"uds": "./cli/uds-cli"
|
@@ -64,14 +64,24 @@
|
|
64
64
|
"default": "./dist/tailwindPurge.cjs"
|
65
65
|
}
|
66
66
|
},
|
67
|
+
"./tailwindPurge/utils": {
|
68
|
+
"import": {
|
69
|
+
"types": "./dist/tailwindPurge/utils.d.ts",
|
70
|
+
"default": "./dist/tailwindPurge/utils.js"
|
71
|
+
},
|
72
|
+
"require": {
|
73
|
+
"types": "./dist/tailwindPurge/utils.cjs",
|
74
|
+
"default": "./dist/tailwindPurge/utils.cjs"
|
75
|
+
}
|
76
|
+
},
|
67
77
|
"./fixtures": {
|
68
78
|
"import": {
|
69
|
-
"types": "./dist/fixtures
|
70
|
-
"default": "./dist/fixtures
|
79
|
+
"types": "./dist/fixtures.d.ts",
|
80
|
+
"default": "./dist/fixtures.js"
|
71
81
|
},
|
72
82
|
"require": {
|
73
|
-
"types": "./dist/fixtures
|
74
|
-
"default": "./dist/fixtures
|
83
|
+
"types": "./dist/fixtures.d.ts",
|
84
|
+
"default": "./dist/fixtures.cjs"
|
75
85
|
}
|
76
86
|
},
|
77
87
|
"./fonts/*.otf": "./fonts/*.otf",
|
@@ -110,7 +120,7 @@
|
|
110
120
|
"./package.json": "./package.json"
|
111
121
|
},
|
112
122
|
"scripts": {
|
113
|
-
"build": "bun run ./scripts/
|
123
|
+
"build": "bun run ./scripts/prebuild.ts && tsup && bun run ./scripts/postbuild.ts",
|
114
124
|
"build:css": "tailwindcss --input ./src/tailwind/uds.css --output ./generated/uds.css --config ./src/tailwind/tailwind.config.ts",
|
115
125
|
"build:fixtures": "bun run ./scripts/buildFixtures.ts",
|
116
126
|
"build:fontcss": "bun run ./scripts/generateFontCSS.ts --output ./generated/fonts.css",
|
@@ -136,22 +146,27 @@
|
|
136
146
|
"typecheck:uds": "tsc -p . --noEmit"
|
137
147
|
},
|
138
148
|
"dependencies": {
|
139
|
-
"@ariakit/react": "^0.4.
|
149
|
+
"@ariakit/react": "^0.4.2",
|
140
150
|
"bluebun": "0.0.34",
|
141
151
|
"clsx": "^2.1.0",
|
142
152
|
"fast-glob": "^3.3.2",
|
143
|
-
"
|
153
|
+
"lodash-es": "^4.17.21",
|
154
|
+
"react-toastify": "^10.0.4",
|
144
155
|
"tailwind-merge": "^2.2.1",
|
145
156
|
"ts-morph": "^21.0.1"
|
146
157
|
},
|
147
158
|
"devDependencies": {
|
148
|
-
"@
|
149
|
-
"@types/react
|
159
|
+
"@fullhuman/postcss-purgecss": "^5.0.0",
|
160
|
+
"@types/react": "^18.2.63",
|
161
|
+
"@types/react-dom": "^18.2.20",
|
162
|
+
"autoprefixer": "^10.4.18",
|
150
163
|
"chalk": "^5.3.0",
|
151
164
|
"concurrently": "^8.2.2",
|
165
|
+
"postcss": "^8.4.35",
|
152
166
|
"shared": "workspace:*",
|
167
|
+
"tailwindcss": "^3.4.1",
|
153
168
|
"tsconfig": "workspace:*",
|
154
|
-
"tsup": "^8.0.
|
169
|
+
"tsup": "^8.0.2"
|
155
170
|
},
|
156
171
|
"peerDependencies": {
|
157
172
|
"@gorhom/bottom-sheet": "^4.6.0",
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import * as react from 'react';
|
2
|
-
import { l as UniversalPressableProps, n as UniversalIconButtonProps, o as UniversalImageProps } from './types-CzJpH_Oi.js';
|
3
|
-
import { View, PressableProps as PressableProps$1, StyleProp, ViewStyle } from 'react-native';
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
5
|
-
import { ImageProps as ImageProps$1 } from 'expo-image';
|
6
|
-
|
7
|
-
type NativePressableProps = Omit<PressableProps$1, 'children' | 'style' | 'onPress'> & {
|
8
|
-
style?: StyleProp<ViewStyle>;
|
9
|
-
};
|
10
|
-
interface PressableProps extends UniversalPressableProps, NativePressableProps {
|
11
|
-
}
|
12
|
-
declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<View>>;
|
13
|
-
|
14
|
-
interface IconButtonProps extends PressableProps, UniversalIconButtonProps {
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* An icon button element that can be used to trigger an action.
|
18
|
-
* @example
|
19
|
-
```tsx
|
20
|
-
import { IconButton } from "@yahoo/uds"
|
21
|
-
|
22
|
-
export function IconButtonDemo() {
|
23
|
-
return (
|
24
|
-
<IconButton variant="accent-outline" name="close" onPress={console.log} />
|
25
|
-
)
|
26
|
-
}
|
27
|
-
```
|
28
|
-
*/
|
29
|
-
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<View>>;
|
30
|
-
|
31
|
-
interface ImageProps extends Omit<ImageProps$1, 'alt' | 'source'>, UniversalImageProps {
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* An image element
|
35
|
-
*/
|
36
|
-
declare function Image({ width: imageWidth, height: imageHeight, src, alt, contentFit, elevation, backgroundColor, backgroundColorOnActive, backgroundColorOnHover, backgroundColorOnChecked, opacity, bordered, borderedTop, borderedBottom, borderedStart, borderedEnd, borderedHorizontal, borderedVertical, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderColorOnActive, borderColorOnFocus, borderColorOnChecked, borderColorOnHover, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, zIndex, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, minHeight, maxHeight, minWidth, maxWidth, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
37
|
-
|
38
|
-
export { type ImageProps as I, type PressableProps as P, IconButton as a, type IconButtonProps as b, Image as c, Pressable as d };
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import * as react from 'react';
|
2
|
-
import { l as UniversalPressableProps, n as UniversalIconButtonProps, o as UniversalImageProps } from './types-CzJpH_Oi.cjs';
|
3
|
-
import { View, PressableProps as PressableProps$1, StyleProp, ViewStyle } from 'react-native';
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
5
|
-
import { ImageProps as ImageProps$1 } from 'expo-image';
|
6
|
-
|
7
|
-
type NativePressableProps = Omit<PressableProps$1, 'children' | 'style' | 'onPress'> & {
|
8
|
-
style?: StyleProp<ViewStyle>;
|
9
|
-
};
|
10
|
-
interface PressableProps extends UniversalPressableProps, NativePressableProps {
|
11
|
-
}
|
12
|
-
declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<View>>;
|
13
|
-
|
14
|
-
interface IconButtonProps extends PressableProps, UniversalIconButtonProps {
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* An icon button element that can be used to trigger an action.
|
18
|
-
* @example
|
19
|
-
```tsx
|
20
|
-
import { IconButton } from "@yahoo/uds"
|
21
|
-
|
22
|
-
export function IconButtonDemo() {
|
23
|
-
return (
|
24
|
-
<IconButton variant="accent-outline" name="close" onPress={console.log} />
|
25
|
-
)
|
26
|
-
}
|
27
|
-
```
|
28
|
-
*/
|
29
|
-
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<View>>;
|
30
|
-
|
31
|
-
interface ImageProps extends Omit<ImageProps$1, 'alt' | 'source'>, UniversalImageProps {
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* An image element
|
35
|
-
*/
|
36
|
-
declare function Image({ width: imageWidth, height: imageHeight, src, alt, contentFit, elevation, backgroundColor, backgroundColorOnActive, backgroundColorOnHover, backgroundColorOnChecked, opacity, bordered, borderedTop, borderedBottom, borderedStart, borderedEnd, borderedHorizontal, borderedVertical, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderColorOnActive, borderColorOnFocus, borderColorOnChecked, borderColorOnHover, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, flexBasis, display, zIndex, overflow, overflowX, overflowY, position, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, minHeight, maxHeight, minWidth, maxWidth, ...props }: ImageProps): react_jsx_runtime.JSX.Element;
|
37
|
-
|
38
|
-
export { type ImageProps as I, type PressableProps as P, IconButton as a, type IconButtonProps as b, Image as c, Pressable as d };
|
@@ -1,114 +0,0 @@
|
|
1
|
-
import * as react from 'react';
|
2
|
-
import { k as UniversalBoxProps, l as UniversalPressableProps, m as UniversalStackProps } from './types-CzJpH_Oi.cjs';
|
3
|
-
|
4
|
-
type DivProps = React.HTMLAttributes<HTMLDivElement>;
|
5
|
-
interface BoxProps extends UniversalBoxProps, DivProps {
|
6
|
-
}
|
7
|
-
/**
|
8
|
-
* A layout primitive that can be used to compose other components.
|
9
|
-
* @example
|
10
|
-
```tsx
|
11
|
-
import { Box } from "@yahoo/uds"
|
12
|
-
|
13
|
-
export function Demo() {
|
14
|
-
return (
|
15
|
-
<Box
|
16
|
-
bordered
|
17
|
-
backgroundColor="primary"
|
18
|
-
borderRadius="md"
|
19
|
-
spacing='6'
|
20
|
-
>
|
21
|
-
Any kind of content can go here!
|
22
|
-
</Box>
|
23
|
-
)
|
24
|
-
}
|
25
|
-
```
|
26
|
-
*/
|
27
|
-
declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLDivElement>>;
|
28
|
-
|
29
|
-
type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
|
30
|
-
interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
|
31
|
-
}
|
32
|
-
/**
|
33
|
-
* Provides press interactions with accessibility support.
|
34
|
-
* @example
|
35
|
-
```tsx
|
36
|
-
import { Pressable, Text } from "@yahoo/uds"
|
37
|
-
|
38
|
-
export function Demo() {
|
39
|
-
return (
|
40
|
-
<Pressable
|
41
|
-
onClick={console.log}
|
42
|
-
backgroundColor="secondary"
|
43
|
-
bordered
|
44
|
-
borderColor="primary"
|
45
|
-
borderRadius="lg"
|
46
|
-
>
|
47
|
-
<Text variant="body1" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
|
48
|
-
</Pressable>
|
49
|
-
)
|
50
|
-
}
|
51
|
-
```
|
52
|
-
*/
|
53
|
-
declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
|
54
|
-
|
55
|
-
type VStackProps = UniversalStackProps & DivProps;
|
56
|
-
/**
|
57
|
-
* The VStack is essentially the same component as [Box](/components/box) where it uses [flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox) but it lays out content in a column. VStack also allows for gaps between children via the `gap` prop.
|
58
|
-
*
|
59
|
-
* You should use VStack when:
|
60
|
-
*
|
61
|
-
* - you want to lay content out in rows that are sized to their content (height only, by default each child will fill the width of the VStack)
|
62
|
-
* - you want to add gaps between columns
|
63
|
-
* - you want to lay content out in columns that fill the available space within the parent container
|
64
|
-
* - you need columns of proportionate size to each other (also known as a ratio-based layout)
|
65
|
-
*
|
66
|
-
* @example
|
67
|
-
* #### Rows with Gaps
|
68
|
-
*
|
69
|
-
* ```tsx
|
70
|
-
* import { Box, VStack } from "@yahoo/uds"
|
71
|
-
*
|
72
|
-
* export function Demo() {
|
73
|
-
* return (
|
74
|
-
* <VStack gap="6">
|
75
|
-
* <Box spacing="6" backgroundColor="secondary">
|
76
|
-
* First
|
77
|
-
* </Box>
|
78
|
-
* <Box spacing="6" backgroundColor="secondary">
|
79
|
-
* Second
|
80
|
-
* </Box>
|
81
|
-
* <Box spacing="6" backgroundColor="secondary">
|
82
|
-
* Third
|
83
|
-
* </Box>
|
84
|
-
* </VStack>
|
85
|
-
* )
|
86
|
-
* }
|
87
|
-
* ```
|
88
|
-
*
|
89
|
-
* #### Rows that Have Proportionate Sizes
|
90
|
-
*
|
91
|
-
* ```tsx
|
92
|
-
* import { Box, VStack } from "@yahoo/uds"
|
93
|
-
*
|
94
|
-
* export function Demo() {
|
95
|
-
* return (
|
96
|
-
* <VStack gap="6">
|
97
|
-
* <Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
98
|
-
* First
|
99
|
-
* </Box>
|
100
|
-
* <Box spacing="6" flexGrow="2" backgroundColor="secondary">
|
101
|
-
* Second
|
102
|
-
* </Box>
|
103
|
-
* <Box spacing="6" flexGrow="3" backgroundColor="secondary">
|
104
|
-
* Third
|
105
|
-
* </Box>
|
106
|
-
* </VStack>
|
107
|
-
* )
|
108
|
-
* }
|
109
|
-
* ```
|
110
|
-
*
|
111
|
-
**/
|
112
|
-
declare const VStack: react.ForwardRefExoticComponent<UniversalStackProps & DivProps & react.RefAttributes<HTMLDivElement>>;
|
113
|
-
|
114
|
-
export { Box as B, type DivProps as D, Pressable as P, VStack as V, type BoxProps as a, type PressableProps as b, type VStackProps as c };
|