@yahoo/uds 0.1.20 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/README.md +2 -8
- package/cli/bunfig.toml +3 -0
- package/cli/commands/expo/_setup.ts +1 -0
- package/cli/commands/expo/build.ts +1 -1
- package/cli/commands/expo/launch.ts +1 -1
- package/cli/commands/purge.ts +1 -1
- package/cli/commands/sync.ts +16 -4
- package/cli/commands/uds.ts +4 -1
- package/cli/commands/version.ts +1 -1
- package/cli/preload.ts +32 -0
- package/cli/utils/configWorker.ts +30 -11
- package/cli/utils/getCommandHelp.ts +22 -13
- package/cli/utils/purgeCSS.test.ts +99 -0
- package/cli/utils/purgeCSS.ts +5 -7
- package/cli/utils/setupConfigWorker.ts +8 -38
- package/cli/utils/types.ts +5 -2
- package/dist/Image.native-C6kOWgnf.d.ts +38 -0
- package/dist/Image.native-VeXt5aeI.d.cts +38 -0
- package/dist/VStack-BSD9TbBd.d.cts +114 -0
- package/dist/VStack-Dk3-8IyU.d.ts +114 -0
- package/dist/experimental/index.cjs +1 -0
- package/dist/experimental/index.d.cts +229 -0
- package/dist/experimental/index.d.ts +229 -0
- package/dist/experimental/index.js +1 -0
- package/dist/experimental/index.native.cjs +1 -0
- package/dist/experimental/index.native.d.cts +51 -0
- package/dist/experimental/index.native.d.ts +51 -0
- package/dist/experimental/index.native.js +1 -0
- package/dist/fixtures/index.cjs +1 -1
- package/dist/fixtures/index.d.cts +15 -1
- package/dist/fixtures/index.d.ts +15 -1
- package/dist/fixtures/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +134 -456
- package/dist/index.d.ts +134 -456
- package/dist/index.js +1 -1
- package/dist/{index.native-C5-xv9Na.d.cts → index.native-CisPq4BI.d.ts} +1 -1
- package/dist/{index.native-DqJv5EjY.d.ts → index.native-DJlx-bfM.d.cts} +1 -1
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.d.cts +11 -83
- package/dist/index.native.d.ts +11 -83
- package/dist/index.native.js +1 -1
- package/dist/tailwindPlugin.cjs +1 -1
- package/dist/tailwindPlugin.d.cts +1 -1
- package/dist/tailwindPlugin.d.ts +1 -1
- package/dist/tailwindPlugin.js +1 -1
- package/dist/tailwindPurge.cjs +1 -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 +1 -1
- package/dist/tokens/parseTokens.d.ts +1 -1
- package/dist/tokens/parseTokens.js +1 -1
- package/dist/tokens/parseTokens.native.d.cts +1 -1
- package/dist/tokens/parseTokens.native.d.ts +1 -1
- package/dist/{types-ZrxnB4cM.d.cts → types-CzJpH_Oi.d.cts} +2 -2
- package/dist/{types-ZrxnB4cM.d.ts → types-CzJpH_Oi.d.ts} +2 -2
- package/dist/{types-BO2kLynl.d.cts → types-FO65RM-W.d.cts} +1 -1
- package/dist/{types-BO2kLynl.d.ts → types-FO65RM-W.d.ts} +1 -1
- package/package.json +19 -2
package/dist/index.d.ts
CHANGED
@@ -1,397 +1,153 @@
|
|
1
|
-
import
|
1
|
+
import { D as DivProps } from './VStack-Dk3-8IyU.js';
|
2
|
+
export { B as Box, a as BoxProps, P as Pressable, b as PressableProps, V as VStack, c as VStackProps } from './VStack-Dk3-8IyU.js';
|
2
3
|
import * as react from 'react';
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
export {
|
6
|
-
import * as
|
7
|
-
import {
|
8
|
-
export {
|
9
|
-
|
10
|
-
export { toast } from 'react-toastify';
|
11
|
-
import { a as CX, C as CVA } from './types-BO2kLynl.js';
|
12
|
-
export { S as SetState } from './types-BO2kLynl.js';
|
13
|
-
export { c as DEFAULT_COLOR_MODE, D as DEFAULT_COLOR_MODE_FOR_APP, g as DEFAULT_HIGH_CONTRAST_MODE, h as DEFAULT_REGION_MODE, e as DEFAULT_SCALE_MODE, b as DEFAULT_SCALE_MODE_FOR_APP, d as defaultTokensConfig, f as fontFamilyGlobal, a as fontWeightMap } from './index.native-DqJv5EjY.js';
|
4
|
+
import { Ref } from 'react';
|
5
|
+
import { m as UniversalStackProps, p as UniversalIconProps, o as UniversalImageProps, q as UniversalTextProps } from './types-CzJpH_Oi.js';
|
6
|
+
export { A as AlwaysPalette, s as AlwaysPaletteAlias, t as Animation, u as AriaAttribute, v as AspectRatio, w as AspectRatioConfig, x as AvatarShape, y as AvatarSize, z as AvatarSizeConfig, D as BackgroundColor, B as BackgroundPalette, G as BackgroundPaletteAlias, I as BackgroundStyleProps, d as BackgroundWashPalette, J as BackgroundWashPaletteAlias, K as BorderRadius, M as BorderRadiusConfig, N as BorderStyleProps, O as BorderWidth, Q as BorderWidthConfig, R as BoxShadowConfig, T as ButtonSize, V as ButtonVariant, C as ColorMode, W as ColorModeForApp, a as ColorsConfig, X as ConfigurableTextProperty, c as CorePalette, Y as CorePaletteAlias, Z as CustomSizingStyleProps, _ as DataAttribute, $ as Display, g as Elevation, E as ElevationConfig, a0 as ElevationPaletteAlias, a1 as Flex, a2 as FlexAlignContent, a3 as FlexAlignItems, a4 as FlexAlignSelf, a5 as FlexBasis, a6 as FlexDirection, a7 as FlexGrow, a8 as FlexJustifyContent, a9 as FlexShrink, aa as FlexStyleProps, ab as FlexWrap, ac as FontFamilyConfig, ad as FontFamilyGlobalAlias, h as FontFamilyGlobalConfig, ae as FontSize, af as FontSizeConfig, e as FontWeightConfig, ag as FontWeightDescriptive, f as FontWeightNumeric, ah as ForegroundColor, F as ForegroundPalette, ai as ForegroundPaletteAlias, aj as Height, ak as HighContrastMode, H as Hue, b as HueStep, al as IconName, am as IconSize, an as IconSizeConfig, ao as ImageStyleProps, ap as LayoutStyleProps, aq as LetterSpacing, ar as LineClampAlias, as as LineColor, at as LineHeight, au as LineHeightConfig, L as LinePalette, av as LinePaletteAlias, aw as MaxHeight, ax as MaxWidth, ay as MinHeight, az as MinWidth, aA as Modes, aB as Opacity, aC as OpacityStyleProps, aD as Overflow, aE as Palette, aF as PaletteConfig, aG as PaletteType, P as PaletteValue, aH as PlatformMode, aI as Position, aJ as RegionMode, aK as ScaleConfig, S as ScaleMode, aL as ScaleModeConfig, aM as ScaleModeForApp, aN as SizingStyleProps, aO as SpacingAlias, aP as SpacingConfig, aQ as SpacingStyleProps, aR as SpectrumColor, aS as SpectrumConfig, aT as StateStyleProps, aU as StyleProps, aV as TextStyleProps, aW as TextTransform, aX as TextTransformConfig, aY as TextVariant, aZ as TransitionDelay, a_ as TransitionDuration, a$ as TransitionTiming, i as UniversalAvatarProps, k as UniversalBoxProps, j as UniversalButtonProps, n as UniversalIconButtonProps, l as UniversalPressableProps, b0 as UniversalTextInputProps, U as UniversalTokensConfig, b1 as Width, b2 as ZIndex, b3 as ZIndexConfig, r as alwaysPalette } from './types-CzJpH_Oi.js';
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
8
|
+
import { C as CX, a as CVA } from './types-FO65RM-W.js';
|
9
|
+
export { S as SetState } from './types-FO65RM-W.js';
|
10
|
+
export { c as DEFAULT_COLOR_MODE, D as DEFAULT_COLOR_MODE_FOR_APP, g as DEFAULT_HIGH_CONTRAST_MODE, h as DEFAULT_REGION_MODE, e as DEFAULT_SCALE_MODE, b as DEFAULT_SCALE_MODE_FOR_APP, d as defaultTokensConfig, f as fontFamilyGlobal, a as fontWeightMap } from './index.native-CisPq4BI.js';
|
14
11
|
export { AVATAR_SIZE_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, FONT_FAMILY_PREFIX, FONT_ICONS_CSS_VAR, FONT_SANS_BETA_CSS_VAR, FONT_SANS_CONDENSED_CSS_VAR, FONT_SANS_CSS_VAR, FONT_SERIF_DISPLAY_CSS_VAR, FONT_SERIF_TEXT_CSS_VAR, FONT_SIZE_PREFIX, FONT_WEIGHT_PREFIX, ICON_SIZE_PREFIX, LARGE_SCALE_MODE_CLASSNAME, LIGHT_COLOR_MODE_CLASSNAME, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, SMALL_SCALE_MODE_CLASSNAME, SPACING_PREFIX, SPECTRUM_COLOR_PREFIX, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, entries } from './tokens/index.js';
|
15
12
|
|
16
|
-
|
17
|
-
interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Provides press interactions with accessibility support.
|
21
|
-
* @example
|
22
|
-
```tsx
|
23
|
-
import { Pressable, Text } from "@yahoo/uds"
|
24
|
-
|
25
|
-
export function Demo() {
|
26
|
-
return (
|
27
|
-
<Pressable
|
28
|
-
onClick={console.log}
|
29
|
-
backgroundColor="secondary"
|
30
|
-
bordered
|
31
|
-
borderColor="primary"
|
32
|
-
borderRadius="lg"
|
33
|
-
>
|
34
|
-
<Text variant="body1" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
|
35
|
-
</Pressable>
|
36
|
-
)
|
37
|
-
}
|
38
|
-
```
|
39
|
-
*/
|
40
|
-
declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
|
41
|
-
|
42
|
-
interface AccordionProps extends PressableProps {
|
43
|
-
label: string;
|
44
|
-
open?: boolean;
|
45
|
-
onClick?: () => void;
|
46
|
-
}
|
47
|
-
declare function Accordion({ label, children, onClick, open, spacingHorizontal, ...pressableProps }: AccordionProps): react_jsx_runtime.JSX.Element;
|
48
|
-
|
49
|
-
type NativeImageProps$1 = Omit<react__default.ImgHTMLAttributes<HTMLImageElement>, 'size' | 'color' | 'height' | 'width' | 'alt' | 'src'>;
|
50
|
-
interface AvatarProps extends NativeImageProps$1, UniversalAvatarProps {
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Avatar can be used for profile images.
|
54
|
-
*/
|
55
|
-
declare function Avatar({ size: avatarSize, shape: borderRadius, src, alt, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
56
|
-
|
57
|
-
type DivProps$1 = React.HTMLAttributes<HTMLDivElement>;
|
58
|
-
interface BoxProps extends UniversalBoxProps, DivProps$1 {
|
13
|
+
interface HStackProps extends UniversalStackProps, DivProps {
|
59
14
|
}
|
60
15
|
/**
|
61
16
|
* A layout primitive that can be used to compose other components.
|
17
|
+
* The HStack 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) to lay content out in a row. Where it differs is HStack also allows for gaps between children via the `gap` prop.
|
18
|
+
*
|
19
|
+
* You should use HStack when:
|
20
|
+
*
|
21
|
+
* - you want to lay content out in columns that are sized to their content
|
22
|
+
* - you want to add gaps between columns
|
23
|
+
* - you want to lay content out in columns that fill the available space within the parent container
|
24
|
+
* - you need columns of proportionate size to each other (also known as a ratio-based layout)
|
25
|
+
*
|
26
|
+
*
|
62
27
|
* @example
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
*
|
86
|
-
*
|
87
|
-
```tsx
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
*
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
You should use HStack when:
|
152
|
-
|
153
|
-
- you want to lay content out in columns that are sized to their content
|
154
|
-
- you want to add gaps between columns
|
155
|
-
- you want to lay content out in columns that fill the available space within the parent container
|
156
|
-
- you need columns of proportionate size to each other (also known as a ratio-based layout)
|
157
|
-
|
158
|
-
|
159
|
-
#### Columns Sized to Content
|
160
|
-
|
161
|
-
```tsx
|
162
|
-
import { Box, HStack } from "@yahoo/uds"
|
163
|
-
|
164
|
-
export function Demo() {
|
165
|
-
return (
|
166
|
-
<HStack>
|
167
|
-
<Box spacing="6" backgroundColor="secondary">
|
168
|
-
First
|
169
|
-
</Box>
|
170
|
-
<Box spacing="6" backgroundColor="secondary">
|
171
|
-
Second
|
172
|
-
</Box>
|
173
|
-
<Box spacing="6" backgroundColor="secondary">
|
174
|
-
Third
|
175
|
-
</Box>
|
176
|
-
</HStack>
|
177
|
-
)
|
178
|
-
}
|
179
|
-
```
|
180
|
-
|
181
|
-
#### Columns with Gaps
|
182
|
-
|
183
|
-
```tsx
|
184
|
-
import { Box, HStack } from "@yahoo/uds"
|
185
|
-
|
186
|
-
export function Demo() {
|
187
|
-
return (
|
188
|
-
<HStack gap="1">
|
189
|
-
<Box spacing="6" backgroundColor="secondary">
|
190
|
-
First
|
191
|
-
</Box>
|
192
|
-
<Box spacing="6" backgroundColor="secondary">
|
193
|
-
Second
|
194
|
-
</Box>
|
195
|
-
<Box spacing="6" backgroundColor="secondary">
|
196
|
-
Third
|
197
|
-
</Box>
|
198
|
-
</HStack>
|
199
|
-
)
|
200
|
-
}
|
201
|
-
```
|
202
|
-
|
203
|
-
#### Columns that Fill the Available Space
|
204
|
-
|
205
|
-
```tsx
|
206
|
-
import { Box, HStack } from "@yahoo/uds"
|
207
|
-
|
208
|
-
export function Demo() {
|
209
|
-
return (
|
210
|
-
<HStack gap="1">
|
211
|
-
<Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
212
|
-
First
|
213
|
-
</Box>
|
214
|
-
<Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
215
|
-
Second
|
216
|
-
</Box>
|
217
|
-
<Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
218
|
-
Third
|
219
|
-
</Box>
|
220
|
-
</HStack>
|
221
|
-
)
|
222
|
-
```
|
223
|
-
|
224
|
-
#### Columns that Have Proportionate Sizes
|
225
|
-
|
226
|
-
```tsx
|
227
|
-
import { Box, HStack } from "@yahoo/uds"
|
228
|
-
|
229
|
-
export function Demo() {
|
230
|
-
return (
|
231
|
-
<HStack gap="1">
|
232
|
-
<Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
233
|
-
First
|
234
|
-
</Box>
|
235
|
-
<Box spacing="6" flexGrow="2" backgroundColor="secondary">
|
236
|
-
Second
|
237
|
-
</Box>
|
238
|
-
<Box spacing="6" flexGrow="3" backgroundColor="secondary">
|
239
|
-
Third
|
240
|
-
</Box>
|
241
|
-
</HStack>
|
242
|
-
)
|
243
|
-
}
|
244
|
-
```
|
245
|
-
*/
|
28
|
+
* #### Columns Sized to Content
|
29
|
+
*
|
30
|
+
* ```tsx
|
31
|
+
* import { Box, HStack } from "@yahoo/uds"
|
32
|
+
*
|
33
|
+
* export function Demo() {
|
34
|
+
* return (
|
35
|
+
* <HStack>
|
36
|
+
* <Box spacing="6" backgroundColor="secondary">
|
37
|
+
* First
|
38
|
+
* </Box>
|
39
|
+
* <Box spacing="6" backgroundColor="secondary">
|
40
|
+
* Second
|
41
|
+
* </Box>
|
42
|
+
* <Box spacing="6" backgroundColor="secondary">
|
43
|
+
* Third
|
44
|
+
* </Box>
|
45
|
+
* </HStack>
|
46
|
+
* )
|
47
|
+
* }
|
48
|
+
* ```
|
49
|
+
*
|
50
|
+
* #### Columns with Gaps
|
51
|
+
*
|
52
|
+
* ```tsx
|
53
|
+
* import { Box, HStack } from "@yahoo/uds"
|
54
|
+
*
|
55
|
+
* export function Demo() {
|
56
|
+
* return (
|
57
|
+
* <HStack gap="1">
|
58
|
+
* <Box spacing="6" backgroundColor="secondary">
|
59
|
+
* First
|
60
|
+
* </Box>
|
61
|
+
* <Box spacing="6" backgroundColor="secondary">
|
62
|
+
* Second
|
63
|
+
* </Box>
|
64
|
+
* <Box spacing="6" backgroundColor="secondary">
|
65
|
+
* Third
|
66
|
+
* </Box>
|
67
|
+
* </HStack>
|
68
|
+
* )
|
69
|
+
* }
|
70
|
+
* ```
|
71
|
+
*
|
72
|
+
* #### Columns that Fill the Available Space
|
73
|
+
*
|
74
|
+
* ```tsx
|
75
|
+
* import { Box, HStack } from "@yahoo/uds"
|
76
|
+
*
|
77
|
+
* export function Demo() {
|
78
|
+
* return (
|
79
|
+
* <HStack gap="1">
|
80
|
+
* <Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
81
|
+
* First
|
82
|
+
* </Box>
|
83
|
+
* <Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
84
|
+
* Second
|
85
|
+
* </Box>
|
86
|
+
* <Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
87
|
+
* Third
|
88
|
+
* </Box>
|
89
|
+
* </HStack>
|
90
|
+
* )
|
91
|
+
* ```
|
92
|
+
*
|
93
|
+
* #### Columns that Have Proportionate Sizes
|
94
|
+
*
|
95
|
+
* ```tsx
|
96
|
+
* import { Box, HStack } from "@yahoo/uds"
|
97
|
+
*
|
98
|
+
* export function Demo() {
|
99
|
+
* return (
|
100
|
+
* <HStack gap="1">
|
101
|
+
* <Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
102
|
+
* First
|
103
|
+
* </Box>
|
104
|
+
* <Box spacing="6" flexGrow="2" backgroundColor="secondary">
|
105
|
+
* Second
|
106
|
+
* </Box>
|
107
|
+
* <Box spacing="6" flexGrow="3" backgroundColor="secondary">
|
108
|
+
* Third
|
109
|
+
* </Box>
|
110
|
+
* </HStack>
|
111
|
+
* )
|
112
|
+
* }
|
113
|
+
* ```
|
114
|
+
**/
|
246
115
|
declare const HStack: react.ForwardRefExoticComponent<HStackProps & react.RefAttributes<HTMLDivElement>>;
|
247
116
|
|
248
117
|
type HtmlSpanProps = Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'>;
|
249
118
|
interface IconProps extends UniversalIconProps, HtmlSpanProps {
|
250
119
|
}
|
251
120
|
/**
|
252
|
-
*
|
253
|
-
|
254
|
-
|
255
|
-
```tsx
|
256
|
-
import { Icon } from "@yahoo/uds"
|
257
|
-
|
258
|
-
export function Demo() {
|
259
|
-
return <Icon name="academicCap" size="m" />
|
260
|
-
}
|
261
|
-
```
|
262
|
-
*/
|
263
|
-
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
264
|
-
|
265
|
-
interface IconButtonProps extends PressableProps, UniversalIconButtonProps {
|
266
|
-
color?: ForegroundColor;
|
267
|
-
}
|
268
|
-
/**
|
269
|
-
* An icon button element that can be used to trigger an action.
|
121
|
+
* Icon are available in an outline and fill variant. Each variant supports
|
122
|
+
* three different sizes: small, medium, and large.
|
123
|
+
*
|
270
124
|
* @example
|
271
|
-
```tsx
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
<IconButton variant="accent-outline" name="close" onPress={console.log} />
|
277
|
-
)
|
278
|
-
}
|
279
|
-
```
|
125
|
+
* ```tsx
|
126
|
+
* import { Icon } from "@yahoo/uds";
|
127
|
+
*
|
128
|
+
* <Icon name="academicCap" size="m" />
|
129
|
+
* ```
|
280
130
|
*/
|
281
|
-
declare const
|
131
|
+
declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<HTMLSpanElement>>;
|
282
132
|
|
283
133
|
type NativeImageProps = Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'size' | 'color' | 'height' | 'width' | 'alt' | 'src'>;
|
284
134
|
interface ImageProps extends NativeImageProps, UniversalImageProps {
|
285
135
|
}
|
286
136
|
/**
|
287
|
-
*
|
137
|
+
* Wrapper for the image element. In the future, may provide additional
|
138
|
+
* functionality for handling fallbacks, dark mode, lazy loading, shimmers.
|
139
|
+
* @example
|
140
|
+
* ```tsx
|
141
|
+
* import { Image } from '@yahoo/uds';
|
142
|
+
*
|
143
|
+
* <Image src="/images/profile.png" width={580} height={334} />;
|
144
|
+
* ```
|
288
145
|
*/
|
289
146
|
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;
|
290
147
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
interface ModalHeaderProps extends React.PropsWithChildren {
|
295
|
-
handleClose?: () => void;
|
296
|
-
}
|
297
|
-
declare function ModalHeader({ children, handleClose }: ModalHeaderProps): react_jsx_runtime.JSX.Element;
|
298
|
-
declare function Modal({ className, ...props }: ModalProps): react_jsx_runtime.JSX.Element;
|
299
|
-
declare const ModalDismiss: typeof DialogDismiss;
|
300
|
-
|
301
|
-
interface PopoverHeadingProps extends PropsWithChildren {
|
302
|
-
leading?: react__default.ReactNode;
|
303
|
-
trailing?: react__default.ReactNode;
|
304
|
-
}
|
305
|
-
declare function PopoverHeading({ children, leading, trailing }: PopoverHeadingProps): react_jsx_runtime.JSX.Element;
|
306
|
-
declare const Popover: typeof Popover$1;
|
307
|
-
declare const PopoverArrow: typeof PopoverArrow$1;
|
308
|
-
declare const PopoverAnchor: typeof PopoverAnchor$1;
|
309
|
-
declare const PopoverDescription: typeof PopoverDescription$1;
|
310
|
-
declare const PopoverDismiss: typeof PopoverDismiss$1;
|
311
|
-
declare const PopoverProvider: typeof PopoverProvider$1;
|
312
|
-
declare const PopoverDisclosure: typeof PopoverDisclosure$1;
|
313
|
-
declare const PopoverDisclosureArrow: typeof PopoverDisclosureArrow$1;
|
314
|
-
|
315
|
-
type DivProps = React.HTMLAttributes<HTMLDivElement>;
|
316
|
-
interface SpinnerProps extends DivProps {
|
317
|
-
}
|
318
|
-
declare function Spinner({ className, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
319
|
-
|
320
|
-
/**
|
321
|
-
* TableColumn
|
322
|
-
* A TableColumn is a definition of a column in a table.
|
323
|
-
*/
|
324
|
-
type TableColumn<T> = {
|
325
|
-
title?: string;
|
326
|
-
dataIndex: keyof T;
|
327
|
-
render?: (value: T[keyof T], record: T, index: number) => react__default.ReactNode;
|
328
|
-
};
|
329
|
-
interface HTMLTableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'color' | 'height' | 'width'> {
|
330
|
-
}
|
331
|
-
interface TableCellProps extends UniversalTextProps, HTMLTableCellProps {
|
332
|
-
/** asHeaderCell will return a th element instead of a td element.
|
333
|
-
* If asHeaderCell is row, it will return a th element with scope="row"
|
334
|
-
* @default false
|
335
|
-
*/
|
336
|
-
asHeaderCell?: boolean | 'column' | 'row';
|
337
|
-
}
|
338
|
-
/**
|
339
|
-
* Table component props
|
340
|
-
* @template T The type of data in the table.
|
341
|
-
*/
|
342
|
-
type TableProps<T> = {
|
343
|
-
/** An array of data for the table. Each item represents a row in the table.
|
344
|
-
* The keys of each item should match the `dataIndex` of the columns.
|
345
|
-
*/
|
346
|
-
data: T[];
|
347
|
-
/** An array of columns for the table. Each item defines a column in the table.
|
348
|
-
* The `dataIndex` should match the key of the data item.
|
349
|
-
*/
|
350
|
-
columns: TableColumn<T>[];
|
351
|
-
};
|
352
|
-
/**
|
353
|
-
* The Table component renders a table with the given data and columns.
|
354
|
-
* If you want more control over the table, or want to handle virtualization,
|
355
|
-
* drag-n-drop, etc, Please can use the sub-components directly and build your own!
|
356
|
-
*/
|
357
|
-
declare function Table<T>({ data, columns }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
358
|
-
declare namespace Table {
|
359
|
-
var Root: react__default.ForwardRefExoticComponent<react__default.TableHTMLAttributes<HTMLTableElement> & BoxProps & {
|
360
|
-
/** Sets whether an element is treated as a block or inline box and the
|
361
|
-
* layout used for its children, such as flow layout, grid or flex.
|
362
|
-
* @default "table"
|
363
|
-
*/
|
364
|
-
display?: Display | undefined;
|
365
|
-
} & {
|
366
|
-
children?: react__default.ReactNode;
|
367
|
-
} & react__default.RefAttributes<HTMLTableElement>>;
|
368
|
-
var Row: react__default.ForwardRefExoticComponent<react__default.HTMLAttributes<HTMLTableRowElement> & BoxProps & {
|
369
|
-
children?: react__default.ReactNode;
|
370
|
-
} & react__default.RefAttributes<HTMLTableRowElement>>;
|
371
|
-
var Header: react__default.ForwardRefExoticComponent<react__default.HTMLAttributes<HTMLTableSectionElement> & BoxProps & {
|
372
|
-
children?: react__default.ReactNode;
|
373
|
-
} & react__default.RefAttributes<HTMLTableSectionElement>>;
|
374
|
-
var Body: react__default.ForwardRefExoticComponent<react__default.HTMLAttributes<HTMLTableSectionElement> & BoxProps & {
|
375
|
-
children?: react__default.ReactNode;
|
376
|
-
} & react__default.RefAttributes<HTMLTableSectionElement>>;
|
377
|
-
var Cell: react__default.ForwardRefExoticComponent<TableCellProps & {
|
378
|
-
children?: react__default.ReactNode;
|
379
|
-
} & react__default.RefAttributes<HTMLTableCellElement | HTMLTableHeaderCellElement>>;
|
380
|
-
}
|
381
|
-
|
382
|
-
interface TabProps extends React.PropsWithChildren {
|
383
|
-
asChild?: boolean;
|
384
|
-
value: string;
|
385
|
-
label: string;
|
386
|
-
startIcon?: IconName;
|
387
|
-
}
|
388
|
-
declare function Tabs(props: TabProviderProps): react_jsx_runtime.JSX.Element;
|
389
|
-
declare const TabList: react.ForwardRefExoticComponent<Omit<TabListProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
390
|
-
declare const Tab: ({ asChild, label, value, startIcon }: TabProps) => react_jsx_runtime.JSX.Element;
|
391
|
-
declare const TabPanel: react.ForwardRefExoticComponent<Omit<TabPanelProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
392
|
-
|
393
|
-
type TextElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'strong' | 'span' | 'label' | 'li';
|
394
|
-
type TextProps<As extends TextElement = TextElement> = UniversalTextProps & {
|
148
|
+
type TextElementTagName = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'strong' | 'span' | 'label' | 'li';
|
149
|
+
type TextProps<As extends TextElementTagName = TextElementTagName> = UniversalTextProps & {
|
150
|
+
ref?: Ref<HTMLElement>;
|
395
151
|
as?: As;
|
396
152
|
} & Omit<JSX.IntrinsicElements[As], 'color'>;
|
397
153
|
/**
|
@@ -488,85 +244,7 @@ type TextProps<As extends TextElement = TextElement> = UniversalTextProps & {
|
|
488
244
|
}
|
489
245
|
```
|
490
246
|
*/
|
491
|
-
declare const Text: react.ForwardRefExoticComponent<Omit<TextProps<
|
492
|
-
|
493
|
-
type NativeTextInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'height' | 'size' | 'width' | 'color'>;
|
494
|
-
interface TextInputProps extends NativeTextInputProps, UniversalTextInputProps {
|
495
|
-
}
|
496
|
-
declare function TextInput({ className, disabled, backgroundColor, borderColor, borderWidth, borderRadius, color, placeholderColor, spacingVertical, spacingHorizontal, fontSize: textVariant, ...props }: TextInputProps): react_jsx_runtime.JSX.Element;
|
497
|
-
|
498
|
-
interface TextInputGroupProps extends TextInputProps {
|
499
|
-
label?: string;
|
500
|
-
}
|
501
|
-
declare function TextInputGroup({ label, required, ...props }: TextInputGroupProps): react_jsx_runtime.JSX.Element;
|
502
|
-
|
503
|
-
interface TextInputLabelProps extends React.PropsWithChildren {
|
504
|
-
required?: boolean;
|
505
|
-
}
|
506
|
-
declare function TextInputLabel({ children, required }: TextInputLabelProps): react_jsx_runtime.JSX.Element;
|
507
|
-
|
508
|
-
interface ToastProps extends ToastContainerProps {
|
509
|
-
}
|
510
|
-
declare function ToastContainer(props: ToastProps): react_jsx_runtime.JSX.Element;
|
511
|
-
|
512
|
-
type VStackProps = UniversalStackProps & DivProps$1;
|
513
|
-
/**
|
514
|
-
* @example
|
515
|
-
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.
|
516
|
-
|
517
|
-
You should use VStack when:
|
518
|
-
|
519
|
-
- 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)
|
520
|
-
- you want to add gaps between columns
|
521
|
-
- you want to lay content out in columns that fill the available space within the parent container
|
522
|
-
- you need columns of proportionate size to each other (also known as a ratio-based layout)
|
523
|
-
|
524
|
-
#### Rows with Gaps
|
525
|
-
|
526
|
-
```tsx
|
527
|
-
import { Box, VStack } from "@yahoo/uds"
|
528
|
-
|
529
|
-
export function Demo() {
|
530
|
-
return (
|
531
|
-
<VStack gap="6">
|
532
|
-
<Box spacing="6" backgroundColor="secondary">
|
533
|
-
First
|
534
|
-
</Box>
|
535
|
-
<Box spacing="6" backgroundColor="secondary">
|
536
|
-
Second
|
537
|
-
</Box>
|
538
|
-
<Box spacing="6" backgroundColor="secondary">
|
539
|
-
Third
|
540
|
-
</Box>
|
541
|
-
</VStack>
|
542
|
-
)
|
543
|
-
}
|
544
|
-
```
|
545
|
-
|
546
|
-
#### Rows that Have Proportionate Sizes
|
547
|
-
|
548
|
-
```tsx
|
549
|
-
import { Box, VStack } from "@yahoo/uds"
|
550
|
-
|
551
|
-
export function Demo() {
|
552
|
-
return (
|
553
|
-
<VStack gap="6">
|
554
|
-
<Box spacing="6" flexGrow="1" backgroundColor="secondary">
|
555
|
-
First
|
556
|
-
</Box>
|
557
|
-
<Box spacing="6" flexGrow="2" backgroundColor="secondary">
|
558
|
-
Second
|
559
|
-
</Box>
|
560
|
-
<Box spacing="6" flexGrow="3" backgroundColor="secondary">
|
561
|
-
Third
|
562
|
-
</Box>
|
563
|
-
</VStack>
|
564
|
-
)
|
565
|
-
}
|
566
|
-
```
|
567
|
-
|
568
|
-
*/
|
569
|
-
declare const VStack: react.ForwardRefExoticComponent<UniversalStackProps & DivProps$1 & react.RefAttributes<HTMLDivElement>>;
|
247
|
+
declare const Text: react.ForwardRefExoticComponent<Omit<TextProps<TextElementTagName>, "ref"> & react.RefAttributes<HTMLElement>>;
|
570
248
|
|
571
249
|
declare const cx: CX<string>;
|
572
250
|
declare const cva: CVA<string>;
|
@@ -574,12 +252,12 @@ declare const getStyles: (props?: ({
|
|
574
252
|
color?: "transparent" | "accent" | "alert" | "brand" | "positive" | "warning" | "primary" | "secondary" | "tertiary" | "muted" | "on-color" | "white" | "black" | undefined;
|
575
253
|
colorChecked?: "transparent" | "accent" | "alert" | "brand" | "positive" | "warning" | "primary" | "secondary" | "tertiary" | "muted" | "on-color" | "white" | "black" | undefined;
|
576
254
|
placeholderColor?: "transparent" | "accent" | "alert" | "brand" | "positive" | "warning" | "primary" | "secondary" | "tertiary" | "muted" | "on-color" | "white" | "black" | undefined;
|
577
|
-
fontFamily?: "display1" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "icons" | "sans" | "sans-beta" | "sans-condensed" | "serif-text" | "serif-display" | undefined;
|
578
|
-
fontSize?: "display1" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | undefined;
|
579
|
-
fontWeight?: "bold" | "black" | "display1" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "thin" | "extralight" | "light" | "regular" | "medium" | "semibold" | "extrabold" | undefined;
|
580
|
-
lineHeight?: "display1" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | undefined;
|
255
|
+
fontFamily?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "icons" | "sans" | "sans-beta" | "sans-condensed" | "serif-text" | "serif-display" | undefined;
|
256
|
+
fontSize?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | undefined;
|
257
|
+
fontWeight?: "bold" | "black" | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "thin" | "extralight" | "light" | "regular" | "medium" | "semibold" | "extrabold" | undefined;
|
258
|
+
lineHeight?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | undefined;
|
581
259
|
textAlign?: "center" | "justify" | "start" | "end" | undefined;
|
582
|
-
textTransform?: "display1" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "none" | "uppercase" | "lowercase" | "capitalize" | undefined;
|
260
|
+
textTransform?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "caption1" | "caption2" | "legal1" | "none" | "uppercase" | "lowercase" | "capitalize" | undefined;
|
583
261
|
spacing?: "9" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "10" | "11" | "12" | "13" | "14" | "none" | undefined;
|
584
262
|
spacingHorizontal?: "9" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "10" | "11" | "12" | "13" | "14" | "none" | undefined;
|
585
263
|
spacingVertical?: "9" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "10" | "11" | "12" | "13" | "14" | "none" | undefined;
|
@@ -662,4 +340,4 @@ declare const getStyles: (props?: ({
|
|
662
340
|
className?: string | undefined;
|
663
341
|
}) | undefined) => string;
|
664
342
|
|
665
|
-
export {
|
343
|
+
export { HStack, type HStackProps, Icon, type IconProps, Image, type ImageProps, Text, type TextProps, UniversalIconProps, UniversalImageProps, UniversalStackProps, UniversalTextProps, cva, cx, getStyles };
|