@yahoo/uds 3.46.0 → 3.46.1
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/FlattenButtonVariant.mock.tsx +17 -0
- package/dist/{Box-DCfVWPEa.d.cts → Box-BFRDyWaq.d.cts} +1 -1
- package/dist/{Box-DIxPS_Eb.d.cts → Box-CVbnF3KY.d.cts} +1 -1
- package/dist/{Box-BBZ3X-K8.d.ts → Box-KZ1-_3Y1.d.ts} +1 -1
- package/dist/{Box-BiOhwq4x.d.ts → Box-MHJ0-0M3.d.ts} +1 -1
- package/dist/{Pressable-DEJTaCX7.d.ts → Pressable-BCKijzW4.d.ts} +1 -1
- package/dist/{Pressable-01KD6JSM.d.cts → Pressable-DM2L9PzA.d.cts} +1 -1
- package/dist/{Pressable-DcVYn2Mr.d.ts → Pressable-DVLHV--n.d.ts} +1 -1
- package/dist/{Pressable-DDeoEy6N.d.cts → Pressable-GdByxoJg.d.cts} +1 -1
- package/dist/{Text-D8r6CSeV.d.ts → Text-774Va3iq.d.ts} +3 -52
- package/dist/{Text-YXARg6JI.d.ts → Text-Bq5NiVYm.d.cts} +3 -52
- package/dist/{Text-B3RX9wWS.d.cts → Text-C58YvnSu.d.cts} +3 -52
- package/dist/{Text-DHrq15W_.d.cts → Text-IGbWWF7a.d.ts} +3 -52
- package/dist/{VStack-COPzfesz.d.ts → VStack-4KrkGBKP.d.ts} +2 -2
- package/dist/{VStack-C0KNZJ7o.d.cts → VStack-AyF9g6Xi.d.cts} +2 -2
- package/dist/{VStack-M-9LUirX.d.ts → VStack-CppUZHJL.d.ts} +2 -2
- package/dist/{VStack-CB6Togey.d.cts → VStack-UmkAYRN1.d.cts} +2 -2
- package/dist/chunk-53CIH36M.js +1 -0
- package/dist/chunk-H2XDX4D2.cjs +1 -0
- package/dist/chunk-HPXOQ4QK.js +1 -0
- package/dist/chunk-W7AQRGI5.cjs +1 -0
- package/dist/client/Menu.d.cts +4 -4
- package/dist/client/Menu.d.ts +4 -4
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +111 -19
- package/dist/client/index.d.ts +111 -19
- package/dist/client/index.js +1 -1
- package/dist/defaultTokensConfig.d.cts +2 -2
- package/dist/defaultTokensConfig.d.ts +2 -2
- package/dist/experimental/client/SwitchV2.d.cts +1 -1
- package/dist/experimental/client/SwitchV2.d.ts +1 -1
- package/dist/{index-CEO-Oqm3.d.cts → index-BnkxCwiE.d.cts} +1 -1
- package/dist/{index-DMyjlCBk.d.ts → index-BtKE9zn1.d.ts} +1 -1
- package/dist/{index-Dcbgq7R0.d.ts → index-DPrPpHqT.d.ts} +1 -1
- package/dist/{index-BkNyc_q0.d.cts → index-cZ0qEwcJ.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -28
- package/dist/index.d.ts +9 -28
- package/dist/index.js +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/tailwind/plugin.d.cts +1 -1
- package/dist/tailwind/plugin.d.ts +1 -1
- package/dist/tailwind/purger.cjs +1 -1
- package/dist/tailwind/purger.js +1 -1
- package/dist/tailwind/utils.d.cts +1 -1
- package/dist/tailwind/utils.d.ts +1 -1
- package/dist/tokens/automation/configs.d.cts +2 -2
- package/dist/tokens/automation/configs.d.ts +2 -2
- package/dist/tokens/automation/properties.d.cts +2 -2
- package/dist/tokens/automation/properties.d.ts +2 -2
- package/dist/tokens/index.d.cts +4 -4
- package/dist/tokens/index.d.ts +4 -4
- package/dist/tokens/parseTokens.d.cts +1 -1
- package/dist/tokens/parseTokens.d.ts +1 -1
- package/dist/{types-1nwPbFUc.d.cts → types-D6kYghpa.d.cts} +1 -1
- package/dist/{types-1nwPbFUc.d.ts → types-D6kYghpa.d.ts} +1 -1
- package/dist/{types-C5YKqOg3.d.cts → types-Da_DnBJy.d.cts} +1 -1
- package/dist/{types-C5YKqOg3.d.ts → types-Da_DnBJy.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2VXJ6ZXC.js +0 -1
- package/dist/chunk-6KI6LPDE.cjs +0 -1
- package/dist/chunk-I4FBYECY.cjs +0 -1
- package/dist/chunk-YFLJTZBO.js +0 -1
package/dist/client/index.d.cts
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import {
|
3
|
-
import { a as TextProps } from '../Text-
|
4
|
-
export { b as Input, I as InputProps } from '../Text-DHrq15W_.cjs';
|
2
|
+
import { cT as UniversalAvatarIconProps, w as IconPropsWithSVGProps, cW as UniversalAvatarTextProps, cU as UniversalAvatarImageProps, x as ImagePropsWithImgProps, cX as UniversalBadgeProps, cY as UniversalButtonProps, cZ as UniversalCheckboxProps, c_ as UniversalChipBaseProps, d2 as UniversalChipProps, c$ as UniversalChipButtonProps, d0 as UniversalChipDismissibleProps, d1 as UniversalChipLinkProps, d3 as UniversalChipToggleProps, d4 as UniversalIconButtonProps, d8 as UniversalInputProps, d6 as UniversalIconSlot, da as UniversalRadioProps, d9 as UniversalRadioGroupProps, b_ as MotionVariant, b$ as MotionVariantSpeed, c as UniversalSwitchProps } from '../types-Da_DnBJy.cjs';
|
3
|
+
import { a as TextProps } from '../Text-Bq5NiVYm.cjs';
|
5
4
|
import * as react from 'react';
|
6
|
-
import react__default, { ForwardRefExoticComponent } from 'react';
|
5
|
+
import react__default, { ForwardRefExoticComponent, InputHTMLAttributes, PropsWithChildren } from 'react';
|
7
6
|
import { HTMLMotionProps, MotionConfigProps, LazyFeatureBundle } from 'motion/react';
|
8
|
-
|
7
|
+
import { B as BoxProps } from '../Box-BFRDyWaq.cjs';
|
8
|
+
export { a as Pressable, P as PressableProps } from '../Pressable-GdByxoJg.cjs';
|
9
9
|
export { Menu, MenuContentProps, MenuDividerProps, MenuItemCheckboxProps, MenuItemProps, MenuPlacement, MenuProviderProps, MenuTriggerProps } from '@yahoo/uds/client/Menu';
|
10
10
|
import '@yahoo/uds-icons/types';
|
11
11
|
import 'type-fest';
|
12
|
-
import '../Box-DIxPS_Eb.cjs';
|
13
12
|
|
14
|
-
type DataAttributes$
|
13
|
+
type DataAttributes$4 = {
|
15
14
|
[name: `data-${string}`]: string;
|
16
15
|
};
|
17
16
|
interface AvatarIconProps extends UniversalAvatarIconProps {
|
18
17
|
/** Props to be passed into various slots within the component. */
|
19
18
|
slotProps?: {
|
20
|
-
icon?: Partial<IconPropsWithSVGProps & DataAttributes$
|
19
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes$4>;
|
21
20
|
};
|
22
21
|
}
|
23
22
|
/**
|
@@ -33,13 +32,13 @@ declare const AvatarIcon: {
|
|
33
32
|
displayName: string;
|
34
33
|
};
|
35
34
|
|
36
|
-
type DataAttributes$
|
35
|
+
type DataAttributes$3 = {
|
37
36
|
[name: `data-${string}`]: string;
|
38
37
|
};
|
39
38
|
interface AvatarTextProps extends UniversalAvatarTextProps {
|
40
39
|
/** Props to be passed into various slots within the component. */
|
41
40
|
slotProps?: {
|
42
|
-
text?: Partial<TextProps & DataAttributes$
|
41
|
+
text?: Partial<TextProps & DataAttributes$3>;
|
43
42
|
};
|
44
43
|
}
|
45
44
|
/**
|
@@ -55,13 +54,13 @@ declare const AvatarText: {
|
|
55
54
|
displayName: string;
|
56
55
|
};
|
57
56
|
|
58
|
-
type DataAttributes$
|
57
|
+
type DataAttributes$2 = {
|
59
58
|
[name: `data-${string}`]: string;
|
60
59
|
};
|
61
60
|
interface AvatarImageProps extends UniversalAvatarImageProps {
|
62
61
|
/** Props to be passed into various slots within the component. */
|
63
62
|
slotProps?: {
|
64
|
-
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes$
|
63
|
+
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes$2>;
|
65
64
|
} & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
|
66
65
|
}
|
67
66
|
/**
|
@@ -166,8 +165,8 @@ interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
|
|
166
165
|
**/
|
167
166
|
declare const Button: ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
168
167
|
|
169
|
-
type NativeInputProps$
|
170
|
-
interface CheckboxProps extends NativeInputProps$
|
168
|
+
type NativeInputProps$3 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'size' | 'height' | 'width' | 'color'>;
|
169
|
+
interface CheckboxProps extends NativeInputProps$3, UniversalCheckboxProps {
|
171
170
|
layerClassNames?: {
|
172
171
|
root?: string;
|
173
172
|
checkbox?: string;
|
@@ -201,15 +200,15 @@ interface CheckboxProps extends NativeInputProps$2, UniversalCheckboxProps {
|
|
201
200
|
declare const Checkbox: react__default.ForwardRefExoticComponent<CheckboxProps & react__default.RefAttributes<HTMLInputElement>>;
|
202
201
|
|
203
202
|
type HtmlDivProps$4 = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'onToggle' | 'label'>;
|
204
|
-
type DataAttributes = {
|
203
|
+
type DataAttributes$1 = {
|
205
204
|
[name: `data-${string}`]: string;
|
206
205
|
};
|
207
206
|
interface ChipBaseProps extends HtmlDivProps$4, Omit<UniversalChipBaseProps, 'variant'> {
|
208
207
|
/** Props to be passed into various slots within the component. */
|
209
208
|
slotProps?: {
|
210
|
-
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
211
|
-
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
212
|
-
text?: Partial<TextProps & DataAttributes>;
|
209
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes$1>;
|
210
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes$1>;
|
211
|
+
text?: Partial<TextProps & DataAttributes$1>;
|
213
212
|
};
|
214
213
|
}
|
215
214
|
|
@@ -297,6 +296,99 @@ interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
297
296
|
**/
|
298
297
|
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
299
298
|
|
299
|
+
type HtmlInputProps = React.InputHTMLAttributes<HTMLInputElement> & HTMLMotionProps<'input'>;
|
300
|
+
type NativeInputProps$2 = Omit<HtmlInputProps, 'height' | 'size' | 'width' | 'color' | 'required'>;
|
301
|
+
type DataAttributes = {
|
302
|
+
[name: `data-${string}`]: string;
|
303
|
+
};
|
304
|
+
interface InputProps extends NativeInputProps$2, UniversalInputProps {
|
305
|
+
/** The type of the input element. Reduced set of options from the HTML input type attribute.
|
306
|
+
* @default 'text'
|
307
|
+
*/
|
308
|
+
type?: Exclude<NativeInputProps$2['type'], 'button' | 'checkbox' | 'color' | 'file' | 'radio' | 'range' | 'reset' | 'submit' | 'search'>;
|
309
|
+
/** Props to be passed into various slots within the component. */
|
310
|
+
slotProps?: {
|
311
|
+
input?: Partial<InputHTMLAttributes<HTMLInputElement> & DataAttributes>;
|
312
|
+
inputWrapper?: Partial<BoxProps & DataAttributes>;
|
313
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
314
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
315
|
+
};
|
316
|
+
}
|
317
|
+
/**
|
318
|
+
* **📦 An input that allows users to enter text and collect data.**
|
319
|
+
*
|
320
|
+
* @componentType Client component
|
321
|
+
*
|
322
|
+
* @description
|
323
|
+
* An input field is a component that takes text typed into it. It can also serve as a way to display a selection and trigger a dropdown menu. Inputs are interactive elements that users can click, tap, or otherwise engage with to collect data and open dropdowns, or both.
|
324
|
+
*
|
325
|
+
* @see
|
326
|
+
* Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
|
327
|
+
*
|
328
|
+
* @usage
|
329
|
+
* - Forms: For collecting data like names, emails, passwords, etc. (e.g., sign-up, login, or contact forms).
|
330
|
+
* - Search Bars: Allowing users to enter search queries to find content.
|
331
|
+
* - Filters/Settings: When users need to specify preferences, like selecting a date or adjusting a number value.
|
332
|
+
* - Feedback/Comments: Letting users leave reviews, comments, or feedback.
|
333
|
+
*
|
334
|
+
* @example
|
335
|
+
* ```tsx
|
336
|
+
* 'use client';
|
337
|
+
* import { Input } from "@yahoo/uds";
|
338
|
+
*
|
339
|
+
* <Input label="Name" placeholder="Enter your name" required />
|
340
|
+
*```
|
341
|
+
*
|
342
|
+
* @related [Checkbox](https://uds.build/docs/components/checkbox), [Radio](https://uds.build/docs/components/radio).
|
343
|
+
**/
|
344
|
+
declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
345
|
+
|
346
|
+
interface InputHelpTextInternalProps extends PropsWithChildren {
|
347
|
+
/** Icon to render at the start of the content */
|
348
|
+
startIcon?: UniversalIconSlot;
|
349
|
+
/** Icon to render at the end of the content */
|
350
|
+
endIcon?: UniversalIconSlot;
|
351
|
+
/**
|
352
|
+
* Props to pass to the start/end icon. If color is not provided, the icons
|
353
|
+
* will inherit the color from the `color` prop.
|
354
|
+
*/
|
355
|
+
iconProps?: Pick<IconPropsWithSVGProps, 'color' | 'size' | 'variant'>;
|
356
|
+
size?: InputProps['size'];
|
357
|
+
isFilled?: boolean;
|
358
|
+
}
|
359
|
+
|
360
|
+
type InputHelpTextProps = InputHelpTextInternalProps;
|
361
|
+
/**
|
362
|
+
* **📦 A component that displays helper text for input fields.**
|
363
|
+
*
|
364
|
+
* @componentType Client component
|
365
|
+
*
|
366
|
+
* @description
|
367
|
+
* A component that displays helper text for input fields.
|
368
|
+
*
|
369
|
+
* @see
|
370
|
+
* Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
|
371
|
+
*
|
372
|
+
* @usage
|
373
|
+
* - Help text that isn't tied to a specific Input.
|
374
|
+
*
|
375
|
+
* @example
|
376
|
+
* ```tsx
|
377
|
+
* 'use client';
|
378
|
+
* import { InputHelpText } from "@yahoo/uds";
|
379
|
+
*
|
380
|
+
* <InputHelpText>
|
381
|
+
* This is some helper text for the input field.
|
382
|
+
* </InputHelpText>
|
383
|
+
*```
|
384
|
+
*
|
385
|
+
* @related [Input](https://uds.build/docs/components/input).
|
386
|
+
**/
|
387
|
+
declare const InputHelpText: {
|
388
|
+
({ size, isFilled, ...props }: InputHelpTextProps): react_jsx_runtime.JSX.Element;
|
389
|
+
displayName: string;
|
390
|
+
};
|
391
|
+
|
300
392
|
type NativeInputProps$1 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value' | 'size' | 'height' | 'width' | 'color' | 'required'>;
|
301
393
|
interface RadioProps extends NativeInputProps$1, UniversalRadioProps {
|
302
394
|
layerClassNames?: {
|
@@ -436,4 +528,4 @@ interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
436
528
|
**/
|
437
529
|
declare const Switch: react__default.ForwardRefExoticComponent<SwitchProps & react__default.RefAttributes<HTMLInputElement>>;
|
438
530
|
|
439
|
-
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, IconButton, type IconButtonProps, Radio, RadioGroupProvider, type RadioGroupProviderProps, type RadioProps, SpringMotionConfig, type SpringMotionConfigProps, Switch, type SwitchProps };
|
531
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, IconButton, type IconButtonProps, Input, InputHelpText, type InputHelpTextProps, type InputProps, Radio, RadioGroupProvider, type RadioGroupProviderProps, type RadioProps, SpringMotionConfig, type SpringMotionConfigProps, Switch, type SwitchProps };
|
package/dist/client/index.d.ts
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import {
|
3
|
-
import { a as TextProps } from '../Text-
|
4
|
-
export { b as Input, I as InputProps } from '../Text-YXARg6JI.js';
|
2
|
+
import { cT as UniversalAvatarIconProps, w as IconPropsWithSVGProps, cW as UniversalAvatarTextProps, cU as UniversalAvatarImageProps, x as ImagePropsWithImgProps, cX as UniversalBadgeProps, cY as UniversalButtonProps, cZ as UniversalCheckboxProps, c_ as UniversalChipBaseProps, d2 as UniversalChipProps, c$ as UniversalChipButtonProps, d0 as UniversalChipDismissibleProps, d1 as UniversalChipLinkProps, d3 as UniversalChipToggleProps, d4 as UniversalIconButtonProps, d8 as UniversalInputProps, d6 as UniversalIconSlot, da as UniversalRadioProps, d9 as UniversalRadioGroupProps, b_ as MotionVariant, b$ as MotionVariantSpeed, c as UniversalSwitchProps } from '../types-Da_DnBJy.js';
|
3
|
+
import { a as TextProps } from '../Text-IGbWWF7a.js';
|
5
4
|
import * as react from 'react';
|
6
|
-
import react__default, { ForwardRefExoticComponent } from 'react';
|
5
|
+
import react__default, { ForwardRefExoticComponent, InputHTMLAttributes, PropsWithChildren } from 'react';
|
7
6
|
import { HTMLMotionProps, MotionConfigProps, LazyFeatureBundle } from 'motion/react';
|
8
|
-
|
7
|
+
import { B as BoxProps } from '../Box-MHJ0-0M3.js';
|
8
|
+
export { a as Pressable, P as PressableProps } from '../Pressable-DVLHV--n.js';
|
9
9
|
export { Menu, MenuContentProps, MenuDividerProps, MenuItemCheckboxProps, MenuItemProps, MenuPlacement, MenuProviderProps, MenuTriggerProps } from '@yahoo/uds/client/Menu';
|
10
10
|
import '@yahoo/uds-icons/types';
|
11
11
|
import 'type-fest';
|
12
|
-
import '../Box-BiOhwq4x.js';
|
13
12
|
|
14
|
-
type DataAttributes$
|
13
|
+
type DataAttributes$4 = {
|
15
14
|
[name: `data-${string}`]: string;
|
16
15
|
};
|
17
16
|
interface AvatarIconProps extends UniversalAvatarIconProps {
|
18
17
|
/** Props to be passed into various slots within the component. */
|
19
18
|
slotProps?: {
|
20
|
-
icon?: Partial<IconPropsWithSVGProps & DataAttributes$
|
19
|
+
icon?: Partial<IconPropsWithSVGProps & DataAttributes$4>;
|
21
20
|
};
|
22
21
|
}
|
23
22
|
/**
|
@@ -33,13 +32,13 @@ declare const AvatarIcon: {
|
|
33
32
|
displayName: string;
|
34
33
|
};
|
35
34
|
|
36
|
-
type DataAttributes$
|
35
|
+
type DataAttributes$3 = {
|
37
36
|
[name: `data-${string}`]: string;
|
38
37
|
};
|
39
38
|
interface AvatarTextProps extends UniversalAvatarTextProps {
|
40
39
|
/** Props to be passed into various slots within the component. */
|
41
40
|
slotProps?: {
|
42
|
-
text?: Partial<TextProps & DataAttributes$
|
41
|
+
text?: Partial<TextProps & DataAttributes$3>;
|
43
42
|
};
|
44
43
|
}
|
45
44
|
/**
|
@@ -55,13 +54,13 @@ declare const AvatarText: {
|
|
55
54
|
displayName: string;
|
56
55
|
};
|
57
56
|
|
58
|
-
type DataAttributes$
|
57
|
+
type DataAttributes$2 = {
|
59
58
|
[name: `data-${string}`]: string;
|
60
59
|
};
|
61
60
|
interface AvatarImageProps extends UniversalAvatarImageProps {
|
62
61
|
/** Props to be passed into various slots within the component. */
|
63
62
|
slotProps?: {
|
64
|
-
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes$
|
63
|
+
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes$2>;
|
65
64
|
} & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
|
66
65
|
}
|
67
66
|
/**
|
@@ -166,8 +165,8 @@ interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
|
|
166
165
|
**/
|
167
166
|
declare const Button: ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
168
167
|
|
169
|
-
type NativeInputProps$
|
170
|
-
interface CheckboxProps extends NativeInputProps$
|
168
|
+
type NativeInputProps$3 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'size' | 'height' | 'width' | 'color'>;
|
169
|
+
interface CheckboxProps extends NativeInputProps$3, UniversalCheckboxProps {
|
171
170
|
layerClassNames?: {
|
172
171
|
root?: string;
|
173
172
|
checkbox?: string;
|
@@ -201,15 +200,15 @@ interface CheckboxProps extends NativeInputProps$2, UniversalCheckboxProps {
|
|
201
200
|
declare const Checkbox: react__default.ForwardRefExoticComponent<CheckboxProps & react__default.RefAttributes<HTMLInputElement>>;
|
202
201
|
|
203
202
|
type HtmlDivProps$4 = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'onToggle' | 'label'>;
|
204
|
-
type DataAttributes = {
|
203
|
+
type DataAttributes$1 = {
|
205
204
|
[name: `data-${string}`]: string;
|
206
205
|
};
|
207
206
|
interface ChipBaseProps extends HtmlDivProps$4, Omit<UniversalChipBaseProps, 'variant'> {
|
208
207
|
/** Props to be passed into various slots within the component. */
|
209
208
|
slotProps?: {
|
210
|
-
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
211
|
-
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
212
|
-
text?: Partial<TextProps & DataAttributes>;
|
209
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes$1>;
|
210
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes$1>;
|
211
|
+
text?: Partial<TextProps & DataAttributes$1>;
|
213
212
|
};
|
214
213
|
}
|
215
214
|
|
@@ -297,6 +296,99 @@ interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
|
|
297
296
|
**/
|
298
297
|
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
299
298
|
|
299
|
+
type HtmlInputProps = React.InputHTMLAttributes<HTMLInputElement> & HTMLMotionProps<'input'>;
|
300
|
+
type NativeInputProps$2 = Omit<HtmlInputProps, 'height' | 'size' | 'width' | 'color' | 'required'>;
|
301
|
+
type DataAttributes = {
|
302
|
+
[name: `data-${string}`]: string;
|
303
|
+
};
|
304
|
+
interface InputProps extends NativeInputProps$2, UniversalInputProps {
|
305
|
+
/** The type of the input element. Reduced set of options from the HTML input type attribute.
|
306
|
+
* @default 'text'
|
307
|
+
*/
|
308
|
+
type?: Exclude<NativeInputProps$2['type'], 'button' | 'checkbox' | 'color' | 'file' | 'radio' | 'range' | 'reset' | 'submit' | 'search'>;
|
309
|
+
/** Props to be passed into various slots within the component. */
|
310
|
+
slotProps?: {
|
311
|
+
input?: Partial<InputHTMLAttributes<HTMLInputElement> & DataAttributes>;
|
312
|
+
inputWrapper?: Partial<BoxProps & DataAttributes>;
|
313
|
+
startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
314
|
+
endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
315
|
+
};
|
316
|
+
}
|
317
|
+
/**
|
318
|
+
* **📦 An input that allows users to enter text and collect data.**
|
319
|
+
*
|
320
|
+
* @componentType Client component
|
321
|
+
*
|
322
|
+
* @description
|
323
|
+
* An input field is a component that takes text typed into it. It can also serve as a way to display a selection and trigger a dropdown menu. Inputs are interactive elements that users can click, tap, or otherwise engage with to collect data and open dropdowns, or both.
|
324
|
+
*
|
325
|
+
* @see
|
326
|
+
* Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
|
327
|
+
*
|
328
|
+
* @usage
|
329
|
+
* - Forms: For collecting data like names, emails, passwords, etc. (e.g., sign-up, login, or contact forms).
|
330
|
+
* - Search Bars: Allowing users to enter search queries to find content.
|
331
|
+
* - Filters/Settings: When users need to specify preferences, like selecting a date or adjusting a number value.
|
332
|
+
* - Feedback/Comments: Letting users leave reviews, comments, or feedback.
|
333
|
+
*
|
334
|
+
* @example
|
335
|
+
* ```tsx
|
336
|
+
* 'use client';
|
337
|
+
* import { Input } from "@yahoo/uds";
|
338
|
+
*
|
339
|
+
* <Input label="Name" placeholder="Enter your name" required />
|
340
|
+
*```
|
341
|
+
*
|
342
|
+
* @related [Checkbox](https://uds.build/docs/components/checkbox), [Radio](https://uds.build/docs/components/radio).
|
343
|
+
**/
|
344
|
+
declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
345
|
+
|
346
|
+
interface InputHelpTextInternalProps extends PropsWithChildren {
|
347
|
+
/** Icon to render at the start of the content */
|
348
|
+
startIcon?: UniversalIconSlot;
|
349
|
+
/** Icon to render at the end of the content */
|
350
|
+
endIcon?: UniversalIconSlot;
|
351
|
+
/**
|
352
|
+
* Props to pass to the start/end icon. If color is not provided, the icons
|
353
|
+
* will inherit the color from the `color` prop.
|
354
|
+
*/
|
355
|
+
iconProps?: Pick<IconPropsWithSVGProps, 'color' | 'size' | 'variant'>;
|
356
|
+
size?: InputProps['size'];
|
357
|
+
isFilled?: boolean;
|
358
|
+
}
|
359
|
+
|
360
|
+
type InputHelpTextProps = InputHelpTextInternalProps;
|
361
|
+
/**
|
362
|
+
* **📦 A component that displays helper text for input fields.**
|
363
|
+
*
|
364
|
+
* @componentType Client component
|
365
|
+
*
|
366
|
+
* @description
|
367
|
+
* A component that displays helper text for input fields.
|
368
|
+
*
|
369
|
+
* @see
|
370
|
+
* Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
|
371
|
+
*
|
372
|
+
* @usage
|
373
|
+
* - Help text that isn't tied to a specific Input.
|
374
|
+
*
|
375
|
+
* @example
|
376
|
+
* ```tsx
|
377
|
+
* 'use client';
|
378
|
+
* import { InputHelpText } from "@yahoo/uds";
|
379
|
+
*
|
380
|
+
* <InputHelpText>
|
381
|
+
* This is some helper text for the input field.
|
382
|
+
* </InputHelpText>
|
383
|
+
*```
|
384
|
+
*
|
385
|
+
* @related [Input](https://uds.build/docs/components/input).
|
386
|
+
**/
|
387
|
+
declare const InputHelpText: {
|
388
|
+
({ size, isFilled, ...props }: InputHelpTextProps): react_jsx_runtime.JSX.Element;
|
389
|
+
displayName: string;
|
390
|
+
};
|
391
|
+
|
300
392
|
type NativeInputProps$1 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value' | 'size' | 'height' | 'width' | 'color' | 'required'>;
|
301
393
|
interface RadioProps extends NativeInputProps$1, UniversalRadioProps {
|
302
394
|
layerClassNames?: {
|
@@ -436,4 +528,4 @@ interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
|
436
528
|
**/
|
437
529
|
declare const Switch: react__default.ForwardRefExoticComponent<SwitchProps & react__default.RefAttributes<HTMLInputElement>>;
|
438
530
|
|
439
|
-
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, IconButton, type IconButtonProps, Radio, RadioGroupProvider, type RadioGroupProviderProps, type RadioProps, SpringMotionConfig, type SpringMotionConfigProps, Switch, type SwitchProps };
|
531
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, Badge, type BadgeProps, Button, type ButtonProps, Checkbox, type CheckboxProps, Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, IconButton, type IconButtonProps, Input, InputHelpText, type InputHelpTextProps, type InputProps, Radio, RadioGroupProvider, type RadioGroupProviderProps, type RadioProps, SpringMotionConfig, type SpringMotionConfigProps, Switch, type SwitchProps };
|
package/dist/client/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"use client";
|
2
|
-
import{InputHelpTextInternalMemo as e,Image as t}from"../chunk-YFLJTZBO.js";import{o2 as a,Pressable as n,a as i,o,e as r,t as s,e2 as c}from"../chunk-GGW73ECI.js";export{Pressable}from"../chunk-GGW73ECI.js";import{HStack as l,VStack as d}from"../chunk-WFWWC766.js";import{FormLabel as u}from"../chunk-SFRPZXWP.js";import{SpringMotionConfig as p}from"../chunk-EFOWTGKI.js";export{SpringMotionConfig}from"../chunk-EFOWTGKI.js";import{getStyles as h,cx as m,IconSlot as f,createSlot as b,Icon as v,Box as y,Text as g}from"../chunk-PMXAH4FA.js";import{parseDeprecatedButtonPaletteVariant as N}from"../chunk-SLGIK6FM.js";import{require_isFunction as x}from"../chunk-EWIQEL36.js";import{BUTTON_CSS_VAR_MAP as I}from"../chunk-PM4TFP3I.js";import{__toESM as w}from"../chunk-GF4A6TFM.js";import{forwardRef as C,useMemo as k,useRef as V,useImperativeHandle as S,isValidElement as P,cloneElement as z,useId as R,useState as T,useCallback as j,useEffect as O,memo as L,createContext as W,useContext as E}from"react";import{jsxs as M,jsx as F,Fragment as A}from"react/jsx-runtime";import{buttonIconSvgSize as $}from"@yahoo/uds/fixtures";import{m as H,useReducedMotion as G,AnimatePresence as B}from"motion/react";export{Menu}from"@yahoo/uds/client/Menu";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var q=w(x(),1),D={first:e=>e[0]??"",last:e=>e[e.length-1]??"",firstAndLast:e=>1===e.length?e[0]:`${e[0]}${e[e.length-1]}`,firstTwo:e=>e.slice(0,2).join(""),firstThree:e=>e.slice(0,3).join(""),firstOfEach:e=>e.join("")},X=(e,t="firstAndLast")=>{if(!e)return"";if((0,q.default)(t))return t(e);const a=e.trim().split(/\s+/).map(e=>e[0].toUpperCase());return D[t](a)},K=(e="md",t)=>{const{className:a,...n}=t??{};return h({avatarSizeRoot:e,...n,className:m("shrink-0","text-center","inline-flex","justify-center","items-center","overflow-visible","truncate",a)})},Z=e=>{const t=e?{height:e,width:e}:{};return{root:t,contents:{...t,boxSizing:"content-box"}}},J="primary",Q="md",U={primary:c,secondary:s},Y=({size:e=Q,variant:t=J,customSize:a,icon:n,slotProps:i,className:o,...r})=>{const s=k(()=>({root:K(e,{avatarIconVariantRoot:t,overflow:"hidden",className:m("overflow-hidden",o)}),iconContainer:m("w-full","h-full","shrink-0","overflow-hidden","text-center","inline-flex","justify-center","items-center"),icon:h({avatarSizeIcon:e})}),[o,e,t]),c=k(()=>Z(a),[a]),l=n??U[t??"primary"];return F(y,{className:s.root,style:c.root,...r,children:F(y,{className:s.iconContainer,style:c.contents,children:F(f,{icon:l,iconProps:{variant:"fill",color:"current",...i?.icon},className:s.icon})})})};Y.displayName="AvatarIcon";var _=({size:e=Q,variant:t=J,name:a,initials:n,customSize:i,abbreviationStrategy:o,className:r,slotProps:s,...c})=>{const l=k(()=>({root:K(e,{avatarTextVariantRoot:t,className:m("overflow-hidden","truncate",r)}),text:m("w-full","h-full","shrink-0","overflow-hidden","text-center","inline-flex","justify-center","items-center","truncate")}),[r,e,t]),d=k(()=>Z(i),[i]);return F(y,{className:l.root,style:d.root,...c,children:F(g,{color:"inherit",variant:"inherit",className:l.text,style:d.contents,...s?.text,children:n||X(a,o)})})};_.displayName="AvatarText";var ee=({size:e=Q,variant:a=J,src:n,srcSet:i,customSize:o,alt:r,abbreviationStrategy:s,fallback:c,className:l,imageProps:d,slotProps:u,...p})=>{const[h,f]=T("loading");O(()=>{let e=!0;if(n||i){const t=new Image;t.onload=()=>{e&&f("loaded")},t.onerror=()=>{e&&f("error")},n&&(t.src=n),i&&(t.srcset=i)}else f("error");return()=>{e=!1}},[n,i]);const b=k(()=>({root:K(e,{avatarImageVariantRoot:a,className:m("overflow-hidden",l)}),contents:m("w-full","h-full","shrink-0","text-center","inline-flex","justify-center","items-center","object-cover")}),[l,e,a]),v=k(()=>Z(o),[o]);if("loaded"===h)return F(y,{className:b.root,style:v.root,children:F(t,{src:n,srcSet:i,alt:r,className:b.contents,style:v.contents,...d,...u?.image})});const g={...p,size:e,customSize:o,variant:a};return c||r?F(_,{name:r,initials:c,abbreviationStrategy:s,slotProps:{text:u?.text},...g}):F(Y,{...g,slotProps:{icon:u?.icon}})};ee.displayName="AvatarImage";var te=e=>F(ee,{...e});te.displayName="Avatar";var ae=C(function({variant:e="primary",size:t="md",minWidth:a,maxWidth:n=200,startIcon:i,endIcon:o,backgroundColor:r,color:s,iconColor:c,borderColor:d,children:u,className:p,...b},v){const y=h({badgeSizeRoot:t,badgeVariantRoot:e,className:m(["uds-badge","uds-badge-variant","uds-badge-size",p])}),g=h({badgeVariantIcon:e,badgeSizeIcon:t,className:m(["uds-badge-iconSize","uds-badge-iconColor"])}),N=k(()=>({...a?{minWidth:`${a}px`}:{},..."full"===n?{}:{maxWidth:`${n}px`},...r?{backgroundColor:r}:{},...d?{borderColor:d}:{},...s?{color:s}:{}}),[r,d,s,n,a]),x=k(()=>({variant:"fill",style:{...c?{color:c}:{}}}),[c]);return M(l,{ref:v,gap:"2",display:"inline-flex",alignItems:"center",className:y,style:N,...b,children:[i&&F(f,{icon:i,iconProps:x,"data-testid":"start-icon",className:g}),F("span",{className:"flex-1 truncate whitespace-nowrap text-center",children:u}),o&&F(f,{icon:o,iconProps:x,"data-testid":"end-icon",className:g})]})});ae.displayName="Badge";var ne={scale:.7,opacity:0},ie={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},oe={icon:ie,hide:ne,loading:ne},re={loading:ie,hide:ne,icon:ne},se=`var(${I.columnGap})`,ce=`var(${I.iconSize})`,le={rest:{scale:`var(${I.effects.scale.rest})`},hover:{scale:`var(${I.effects.scale.hover})`},pressed:{scale:`var(${I.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:se}},de={hide:{width:"0px",opacity:0,display:"none"},loading:{width:ce,display:"flex",opacity:1},icon:{width:ce,display:"flex",opacity:1}},ue=C(function({variant:e,size:t,startIcon:n,endIcon:i,iconVariant:o,loading:r,disableEffects:s,children:c,asChild:l,type:d="button",className:u,width:y,...g},x){const I=V(null);S(x,()=>I.current);const w=k(()=>b(),[]),C=k(()=>H.create(w),[w]),R=i?"icon":"hide",T=(({startIcon:e,endIcon:t,loading:a})=>e||t||a?"withIcon":"withoutIcon")({startIcon:n,endIcon:i,loading:r}),j=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:r,startIcon:n}),{palette:O,variant:L}=k(()=>N({flatVariant:e}),[e]),W=k(()=>({button:h({width:y,buttonSize:t,buttonVariant:L,buttonPalette:O,className:m("uds-button","uds-ring","uds-hit-target",r&&"uds-button-loading",s&&"uds-button-without-effects","withIcon"===T&&"uds-button-with-gap",u)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"}),[y,t,L,O,u,r,s,T]),E=G()?"smooth":"subtle",q=k(()=>F(H.span,{className:W.iconContainer,initial:!1,variants:de,animate:j,children:M(B,{initial:!1,mode:"popLayout",children:[r&&F(H.span,{variants:re,initial:"hide",animate:"loading",exit:"hide",children:F(v,{size:$,name:a,variant:o,color:"current",className:W.loading})},"loading"),n&&!r&&F(H.span,{variants:oe,initial:"hide",animate:"icon",exit:"hide",children:F(f,{className:W.start,icon:n,iconProps:{size:$,variant:o,color:"current"}})})]})}),[W.iconContainer,W.loading,W.start,j,r,o,n]),D=k(()=>F(H.span,{className:W.iconContainer,initial:!1,variants:de,animate:R,children:F(B,{initial:!1,mode:"popLayout",children:i&&F(H.span,{variants:oe,initial:"hide",animate:"icon",exit:"hide",children:F(f,{className:W.end,icon:i,iconProps:{size:$,variant:o,color:"current"}})})})}),[W.iconContainer,W.end,i,R,o]),X=k(()=>s?{...le,rest:{},hover:{},pressed:{}}:le,[s]);return l&&P(c)?F(p,{layoutSpeed:"3",layoutVariant:E,children:F(C,{type:d,className:W.button,initial:["hide",T],animate:T,variants:X,whileHover:"hover",whileTap:"pressed",...g,children:z(c,c.props,M(A,{children:[q,F("span",{className:W.content,children:c.props.children}),D]}))})}):F(p,{layoutSpeed:"3",layoutVariant:E,children:M(H.button,{ref:I,type:d,className:W.button,initial:["hide",T],animate:T,variants:X,whileHover:"hover",whileTap:"pressed",...g,children:[q,F("span",{className:W.content,children:c}),D]})})}),pe={primary:"alert",secondary:"alert-secondary"},he=e=>"indeterminate"===e,me=e=>he(e)?o:r,fe=H.create(y),be={layoutVariant:"smooth",layoutSpeed:"3"},ve={layoutVariant:"veryBouncy",layoutSpeed:"4"},ye=C(function({id:e,checked:t,defaultChecked:a,onChange:n,label:i,labelPosition:o="start",variant:r="primary",size:s="md",reduceMotion:c,disabled:l,required:d,hasError:f,className:b,layerClassNames:y,...g},N){const x=R(),I=e??`uds-input-${x}`,w=V(null),C=void 0!==t,[S,P]=T(C?t:a),[z,L]=T(!1),[W,E]=T(!1),A=k(()=>f?pe[r]:r,[f,r]),$=!l&&z,B=!l&&W,q=k(()=>B?.9:$?1.1:1,[B,$]),D=k(()=>S?B?"opacity-55":"opacity-100":"opacity-0",[S,B]),X=k(()=>({scale:q}),[q]),K=k(()=>W?ve:be,[W]),Z=j(e=>{n?.(e),C||P(e.target.checked)},[C,n]),J=j(()=>{L(!0)},[]),Q=j(()=>{L(!1)},[]),U=j(()=>{E(!0)},[]),Y=j(()=>{E(!1)},[]),_=e=>{w.current&&(w.current.indeterminate=he(e))},ee=c?"always":"user",te=G()||c?"duration-0":"duration-120";O(()=>{C&&P(t)},[t,C]),O(()=>{_(S)},[S]);const ae=he(S)?"indeterminate":S?"checked":"unchecked",ne={root:h({checkboxSizeRoot:s,checkboxVariantRoot:A,checkboxVariantValueRoot:ae,display:"flex",flexDirection:"start"===o?"row":"row-reverse",alignItems:"center",className:m({"cursor-pointer":!l,"cursor-default":l,"opacity-50":l},b,y?.root)}),checkbox:h({checkboxSizeCheckbox:s,checkboxVariantCheckbox:A,checkboxVariantValueCheckbox:ae,className:m("border","rounded-[4px]","uds-ring","uds-ring-within",te,"transition-[background-color,border-color,box-shadow]",y?.checkbox)}),check:h({checkboxVariantCheckboxIcon:A,checkboxVariantValueCheckboxIcon:ae,className:m("pointer-events-none",D,te,"transition-opacity")}),htmlCheckbox:m("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:m("start"===o?"text-start":"text-end",y?.label)},ie=i?H.label:H.div;return F(p,{reducedMotion:ee,...K,children:M(ie,{className:ne.root,"data-testid":"container",onHoverStart:J,onHoverEnd:Q,onTapStart:U,onTap:Y,onTapCancel:Y,tabIndex:-1,children:[M(fe,{position:"relative",className:ne.checkbox,alignItems:"center",justifyContent:"center",flex:"none",animate:X,children:[F("input",{type:"checkbox",tabIndex:0,...g,ref:e=>{w.current=e,_(S),"function"==typeof N?N(e):null!==N&&(N.current=e)},id:I,disabled:l,required:d,"aria-invalid":f,checked:C?!he(S)&&S:void 0,defaultChecked:C?void 0:a,onChange:Z,className:ne.htmlCheckbox}),F(v,{name:me(S),size:"sm",className:ne.check})]}),i&&F(u,{as:"div",variant:"inherit",color:"inherit",required:d,label:i,className:ne.label})]})})});ye.displayName="Checkbox";var ge=(e,t,a="overwriteOriginal")=>{const n=Array.from(new Set([...Object.keys(e??{}),...Object.keys(t??{})]));return Object.fromEntries(n.map(n=>{const i=e?.[n],o=t?.[n];return i&&!o?[n,i]:o&&!i?[n,o]:"className"===n?[n,m(i,o)]:"keepOriginal"===a?[n,i]:[n,o]}))},Ne=(e,t,a="overwriteOriginal")=>{if(!e)return t;const n=Array.from(new Set([...Object.keys(e),...Object.keys(t)]));return Object.fromEntries(n.map(n=>{const i=e[n],o=t[n];return[n,ge(i,o,a)]}))},xe="primary",Ie=C(function({size:e="md",minWidth:t,maxWidth:a=200,startIcon:n,endIcon:i,as:o="div",reduceMotion:r,disabled:s=!1,className:c,slotProps:d,children:u,...p},b){const v=G()||r?"duration-0":"duration-120",{className:y,...N}=d?.text??{},{className:x,...I}=d?.startIcon??{},{className:w,...C}=d?.endIcon??{},V=k(()=>({root:h({chipSizeRoot:e,className:m({"pointer-events-none":s,"cursor-default":s,"opacity-50":s},"inline-flex","items-center","focus-visible:-outline-offset-2","uds-ring",v,"transition-[background-color,outline-color,box-shadow]",c)}),text:m("truncate","whitespace-nowrap","text-center","flex-1",y),icon:h({chipSizeIcon:e})}),[c,v,s,e,y]),S=k(()=>({root:{maxWidth:`${a}px`,...t?{minWidth:`${t}px`}:{}}}),[a,t]);return F(l,{asChild:!0,ref:b,className:V.root,style:S.root,...p,children:M(o,{disabled:s,children:[n&&F(f,{icon:n,iconProps:{variant:"fill",className:m(V.icon,x),...I}}),F(g,{as:"span",color:"current",variant:"inherit",className:V.text,...N,children:u}),i&&F(f,{icon:i,iconProps:{variant:"fill",className:m(V.icon,w),...C}})]})})});Ie.displayName="ChipBase";var we=C(function({variant:e=xe,slotProps:t,className:a,...n},i){const o=k(()=>({root:h({chipLinkVariantRoot:e,className:a}),icon:h({chipLinkVariantIcon:e})}),[a,e]),r=Ne(t,{startIcon:{className:o.icon},endIcon:{className:o.icon}});return F(Ie,{as:"button",ref:i,tabIndex:0,className:o.root,slotProps:r,...n})});we.displayName="ChipButton";var Ce=C(function({dismissButtonAriaLabel:e,onDismiss:t,dismissIcon:a,variant:o=xe,disabled:r,slotProps:s,className:c,...l},d){const u=k(()=>({root:h({chipDismissibleVariantRoot:o,className:c}),icon:h({chipDismissibleVariantIcon:o}),iconPressable:m("uds-chip-dismissible-button","uds-hit-target")}),[c,o]),p=j(e=>{e.stopPropagation(),t?.()},[t]),b=Ne(s,{startIcon:{className:u.icon},endIcon:{className:u.icon}});return F(Ie,{ref:d,disabled:r,tabIndex:-1,endIcon:t=>F(n,{"aria-label":e,className:u.iconPressable,onClick:p,disabled:r,children:F(f,{icon:a??i,iconProps:t})}),className:u.root,slotProps:b,...l})});Ce.displayName="ChipDismissible";var ke=C(function({variant:e=xe,href:t,disabled:a,slotProps:n,className:i,...o},r){const s=k(()=>({root:h({chipLinkVariantRoot:e,className:i}),icon:h({chipLinkVariantIcon:e})}),[i,e]),c=Ne(n,{startIcon:{className:s.icon},endIcon:{className:s.icon}});return F(Ie,{as:"a",ref:r,disabled:a,className:s.root,slotProps:c,tabIndex:0,...{...o,href:a?void 0:t}})});ke.displayName="ChipLink";var Ve=C(function({isToggled:e=!1,onToggle:t,onClick:a,variant:n=xe,slotProps:i,className:o,...r},s){const c=k(()=>({root:h({chipToggleVariantRoot:n,chipToggleVariantActiveRoot:e?"on":"off",className:o}),icon:h({chipToggleVariantIcon:n})}),[o,e,n]),l=j(n=>{t?.(!e),a?.(n)},[e,a,t]),d=Ne(i,{startIcon:{className:c.icon},endIcon:{className:c.icon}});return F(Ie,{ref:s,as:"button",onClick:l,"aria-pressed":e,className:c.root,slotProps:d,tabIndex:0,...r})});Ve.displayName="ChipToggle";var Se=C(function({onClick:e,href:t,linkProps:a,onDismiss:n,onToggle:i,isToggled:o,slotProps:r,...s},c){const{anchor:l,...d}=r??{};return n?F(Ce,{ref:c,onDismiss:n,slotProps:d,...s}):i?F(Ve,{ref:c,onToggle:i,isToggled:o,slotProps:d,...s}):t?F(ke,{ref:c,href:t,slotProps:d,...s,...a,...l}):F(we,{ref:c,onClick:e,slotProps:d,...s})});Se.displayName="Chip";var Pe=C(function({variant:e,size:t,iconVariant:n,loading:i,disableEffects:o,name:r,type:s="button",htmlName:c,className:l,children:d,...u},f){const b=V(null);S(f,()=>b.current);const{palette:y,variant:g}=N({flatVariant:e}),x=k(()=>({button:h({buttonVariant:g,buttonPalette:y,iconButtonSize:t,className:m("uds-icon-button","uds-button","uds-ring","uds-hit-target",i&&"uds-button-loading",o&&"uds-button-without-effects",l)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"}),[y,g,l,o,t,i]),I=G(),w=k(()=>I?"smooth":"subtle",[I]),C=k(()=>{const{rest:e,hover:t,pressed:a}=le;return o?{rest:{},hover:{},pressed:{}}:{rest:e,hover:t,pressed:a}},[o]);return F(p,{layoutSpeed:"3",layoutVariant:w,reducedMotion:o?"always":"user",children:F(H.button,{ref:b,type:s,className:x.button,initial:"icon",variants:C,whileHover:"hover",whileTap:"pressed",name:c,...u,children:M(B,{initial:!1,mode:"popLayout",children:[i&&F(H.span,{variants:re,initial:"loading",animate:"loading",exit:"hide",children:F(v,{size:$,name:a,variant:n,color:"current",className:x.loading})},"loading"),r&&!i&&F(H.span,{variants:oe,initial:"icon",animate:"icon",exit:"hide",children:d||F(v,{size:$,name:r,variant:n,color:"current",className:x.icon})},r.name)]})})})}),ze=w(x(),1),Re=({children:e,reduceMotion:t,layoutVariant:a})=>{const n=V(null),[i,o]=T("auto");return O(()=>{if(n.current){const e=new ResizeObserver(e=>{o(e[0].contentRect.height)});return e.observe(n.current),()=>{e.disconnect()}}},[]),F(p,{reducedMotion:t,layoutSpeed:"4",layoutVariant:a,children:F(H.div,{className:"overflow-hidden",style:{height:i,opacity:0},animate:{height:i,opacity:1},children:F("div",{ref:n,children:e})})})},Te=L(function({helpText:t,helperTextIcon:a,spacingStart:n,spacingTop:i,size:o,isFilled:r,...s}){return t?F(y,{spacingTop:i,spacingStart:n,...s,children:F(e,{startIcon:a,size:o,isFilled:r,children:(0,ze.default)(t)?t():t})}):null}),je=L(function({icon:e,className:t,iconProps:a}){return e?F(f,{icon:e,iconProps:{variant:"outline",...a},className:t}):null}),Oe=L(function({icon:e,className:t,iconProps:a}){return e?F(f,{icon:e,iconProps:{variant:"outline",...a},className:t}):null}),Le=C(function({id:e,label:t,type:a="text",size:n="md",startIcon:i,endIcon:o,helpText:r,helperTextIcon:s,hasError:c,width:u="full",defaultValue:p,required:f,readOnly:b,disabled:v,reduceMotion:g,onChange:N,slotProps:x,className:I,...w},C){const k=R(),P=e??`uds-input-${k}`,z=`uds-input-${P}-help-text`,{className:O,...L}=x?.input??{},{className:W,...E}=x?.inputWrapper??{},A=V(null);S(C,()=>A.current);const[$,H]=T(p??""),B=j(e=>{H(e.target.value),N?.(e)},[N]),q=G()?"smooth":"bouncy",D=g?"always":"user",X=!b&&!v,K={root:h({inputSizeRoot:n,inputVariantRoot:"default",inputVariantValueRoot:$?"filled":"empty",className:m([I,v?"opacity-50":""])}),inputWrapper:m(h({inputSizeInputWrapper:n,inputVariantInputWrapper:"default",inputVariantValueInputWrapper:$?"filled":"empty"}),"min-w-[200px]",W),input:h({inputSizeInput:n,inputVariantInput:"default",inputVariantValueInput:$?"filled":"empty",inputVariantInputPlaceholder:"default",inputVariantValueInputPlaceholder:$?"filled":"empty",className:m("grow","uds-hit-target","bg-clip-text","focus:outline-none",X?"cursor-text":"cursor-not-allowed",O)}),label:m(h({inputSizeLabel:n,inputVariantLabel:"default",inputVariantValueLabel:$?"filled":"empty"})),labelRequired:h({inputVariantLabelRequired:"default",inputVariantValueLabelRequired:$?"filled":"empty"}),startIcon:h({inputSizeStartIcon:n,inputVariantStartIcon:"default",inputVariantValueStartIcon:$?"filled":"empty"}),endIcon:h({inputSizeEndIcon:n,inputVariantEndIcon:"default",inputVariantValueEndIcon:$?"filled":"empty"})};return M(d,{width:u,className:K.root,children:[t&&M(y,{spacingBottom:"2",columnGap:"0.5",alignItems:"flex-end",className:K.label,children:[F("label",{htmlFor:P,children:(0,ze.default)(t)?t():t}),f&&F("span",{className:K.labelRequired,children:"*"})]}),M(y,{position:"relative",alignItems:"center",...E,className:K.inputWrapper,children:[F(je,{icon:i,className:K.startIcon,iconProps:x?.startIcon}),F("input",{ref:A,id:P,type:a,value:$,required:f,readOnly:b,disabled:v,"aria-describedby":z,"aria-invalid":c,onChange:B,className:K.input,...w,...L}),o&&F(l,{alignItems:"center",gap:"1",children:F(Oe,{icon:o,className:K.endIcon,iconProps:x?.endIcon})})]}),F(Re,{reduceMotion:D,layoutVariant:q,children:F(Te,{id:z,helpText:r,spacingTop:"2",size:n,isFilled:!!$,helperTextIcon:s})})]})});Le.displayName="Input";var We=class e{name;value;activeCount=0;#e=new Set;constructor(e){this.name=e}onChange(e){return this.#e.add(e),()=>{this.#e.delete(e)}}setValue(e){this.value=e,this.#e.forEach(t=>t(e))}static findOrCreate(t,a){let n=t.get(a);return n||(n=new e(a),t.set(a,n)),n}},Ee=W(new Map),Me=e=>{const t=R();return e??`uds-radio-group-${t}`},Fe={primary:"alert",secondary:"alert-secondary"},Ae=H.create(y),$e={layoutVariant:"smooth",layoutSpeed:"3"},He={layoutVariant:"veryBouncy",layoutSpeed:"4"},Ge=C(function({id:e,name:t,label:a,labelPosition:n="start",variant:i="primary",size:o="md",reduceMotion:r,value:s="",checked:c,defaultChecked:l,disabled:d,hasError:f,onChange:b,onFocus:v,onBlur:g,className:N,layerClassNames:x,...I},w){const C=R(),S=e??`uds-radio-${C}`,P=V(null),{name:z,isControlled:L,checked:W,setGroupValue:A}=(({name:e,value:t,checked:a,defaultChecked:n})=>{const i=E(Ee),o=i instanceof We,r=void 0!==a||o,s=Me(e),c=k(()=>o?i:We.findOrCreate(i,s),[i,o,s]),[l,d]=T(c.value),u=c.name??s,p=j(e=>{c.setValue(e),r||d(e)},[r,c]);return O(()=>c.onChange(d),[c]),O(()=>{!0===a&&p(t)},[a,t,p]),O(()=>{if(o)return;const e=We.findOrCreate(i,u);return e.activeCount+=1,i.set(u,e),()=>{const e=i.get(u);e&&(e.activeCount-=1,0===e.activeCount&&i.delete(u))}},[i,o,u]),{name:u,isControlled:r,checked:r&&!o?a:void 0!==l?t===l:n??!1,setGroupValue:p}})({name:t,value:s,checked:c,defaultChecked:l}),[$,B]=T(!1),[q,D]=T(!1),X=k(()=>f?Fe[i]:i,[f,i]),K=k(()=>!d&&$,[d,$]),Z=k(()=>!d&&!W&&q,[W,d,q]),J=k(()=>Z?.9:K?1.1:1,[K,Z]),Q=k(()=>W?Z?"opacity-55":"opacity-100":"opacity-0",[W,Z]),U=k(()=>!d&&(Z&&!W||K&&W),[W,d,K,Z]),Y=k(()=>({scale:J}),[J]),_=k(()=>q?He:$e,[q]),ee=j(e=>{A(e.target.value),b?.(e)},[b,A]),te=j(e=>{v?.(e)},[v]),ae=j(e=>{g?.(e)},[g]),ne=j(()=>{B(!0)},[]),ie=j(()=>{B(!1)},[]),oe=j(()=>{D(!0)},[]),re=j(()=>{D(!1)},[]),se=r?"always":"user",ce=G()||r?"duration-0":"duration-120",le={root:h({radioSizeRoot:o,radioVariantValueRoot:W?"checked":"unchecked",radioVariantRoot:X,display:"flex",flexDirection:"start"===n?"row":"row-reverse",alignItems:"center",className:m([{"cursor-pointer":!d,"cursor-default":d,"opacity-50":d},N,x?.root])}),radio:h({radioSizeRadio:o,radioVariantRadio:X,radioVariantValueRadio:W?"checked":"unchecked",className:m(["border","uds-ring","uds-ring-within",ce,"transition-[background-color,border-color]","transition-shadow",x?.radio])}),radioCircle:h({radioVariantRadioCircle:X,radioVariantValueRadioCircle:W?"checked":"unchecked",className:m(["pointer-events-none","w-[8px]","h-[8px]",Q,ce,"transition-opacity"])}),htmlRadio:m("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:m("start"===n?"text-start":"text-end",x?.label)},de=a?H.label:H.div;return F(p,{reducedMotion:se,..._,children:M(de,{className:le.root,"data-testid":"container",onHoverStart:ne,onHoverEnd:ie,onTapStart:oe,onTap:re,onTapCancel:re,tabIndex:-1,children:[M(Ae,{position:"relative",borderRadius:"full",alignItems:"center",justifyContent:"center",flex:"none",className:le.radio,animate:Y,insetShadow:U?"lg-invert":"none",children:[F("input",{type:"radio",tabIndex:0,...I,ref:e=>{P.current=e,"function"==typeof w?w(e):null!==w&&(w.current=e)},onFocus:te,onBlur:ae,id:S,name:z,value:s,disabled:d,"aria-invalid":f,onChange:ee,...L?{checked:W}:{defaultChecked:l},className:le.htmlRadio}),F(y,{borderRadius:"full",className:le.radioCircle})]}),a&&F(u,{as:"div",variant:"inherit",color:"inherit",label:a,className:le.label})]})})});Ge.displayName="Radio";var Be=b(),qe=class extends We{onChangeCb;isControlled;constructor(e,t){super(e),this.isControlled=t}setValue(e,t=!1){this.isControlled&&!t?this.onChangeCb?.(e):super.setValue(e)}},De=C(function({asChild:e,name:t,value:a,defaultValue:n,onChange:i,...o},r){const s=void 0!==a,c=Me(t),l=k(()=>{const e=new qe(c,s);return e.value=s?a:n,e},[n,s,c,a]);O(()=>{l.onChangeCb=i},[i,l]),O(()=>{s&&l.setValue(a,!0)},[s,l,a]),O(()=>l.onChange(e=>i?.(e)),[i,l]);const d=e?Be:"div";return F(Ee.Provider,{value:l,children:F(d,{role:"radiogroup",ref:r,...o})})});De.displayName="RadioGroupProvider";var Xe={md:{isOnX:20},sm:{isOnX:12}},Ke=H.create(y),Ze={layoutVariant:"bouncy",layoutSpeed:"4"},Je=C(function({id:e,isOn:t,defaultIsOn:a,onChange:n,label:i,labelPosition:o="start",size:r="md",onIcon:s,offIcon:c,reduceMotion:l,disabled:d,required:b,onFocus:v,onBlur:g,className:N,layerClassNames:x,...I},w){const C=R(),S=e??`uds-input-${C}`,P=V(null),z=void 0!==t,[L,W]=T(z?t:a),[E,A]=T(!1),$=k(()=>!d&&E,[d,E]),{isOnX:B}=Xe[r],q=k(()=>({initial:{scale:1,x:L?B:0},animate:{scale:$?1.05:1,x:L?B:0}}),[$,L,B]),D=j(e=>{n?.(e),z||W(e.target.checked)},[z,n]),X=j(e=>{v?.(e)},[v]),K=j(e=>{g?.(e)},[g]),Z=j(()=>{A(!0)},[]),J=j(()=>{A(!1)},[]),Q=l?"always":"user",U=G()||l?"duration-0":"duration-120";O(()=>{z&&W(t)},[t,z]);const Y={root:h({switchSizeRoot:r,switchVariantRoot:"default",switchVariantActiveRoot:L?"on":"off",display:"flex",flexDirection:"start"===o?"row":"row-reverse",alignItems:"center",className:m("group",{"cursor-pointer":!d,"cursor-default":d,"opacity-50":d},x?.root,N)}),switch:h({switchVariantSwitch:"default",switchSizeSwitch:r,switchVariantActiveSwitch:L?"on":"off",borderRadius:"full",position:"relative",alignItems:"center",className:m("uds-ring","uds-ring-within",U,"transition-[background-color,box-shadow]",x?.switch)}),handle:h({switchSizeHandle:r,className:m("relative","pointer-events-none","rounded-full","overflow-hidden",x?.handle)}),handleCircle:h({switchVariantActiveHandle:L?"on":"off",switchVariantHandle:"default",className:m("absolute","top-0","left-0","right-0","bottom-0","opacity-95 group-hover:opacity-100",U,"transition-[background-color,box-shadow,opacity]")}),handleIcon:h({switchSizeHandleIcon:r,switchVariantHandleIcon:"default",switchVariantActiveHandleIcon:L?"on":"off",className:m("absolute","opacity-0","top-1/2","left-1/2","transform","translate-x-[-50%]","translate-y-[-50%]",U,"transition-opacity")}),htmlCheckbox:m("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:m("start"===o?"text-start":"text-end",x?.label)},_=i?H.label:H.div;return F(p,{reducedMotion:Q,...Ze,children:M(_,{className:Y.root,"data-testid":"container",onHoverStart:Z,onHoverEnd:J,tabIndex:-1,children:[M(Ke,{className:Y.switch,children:[F("input",{type:"checkbox",tabIndex:0,...I,ref:e=>{P.current=e,"function"==typeof w?w(e):null!==w&&(w.current=e)},onFocus:X,onBlur:K,id:S,disabled:d,required:b,checked:z?L:void 0,defaultChecked:z?void 0:a,onChange:D,className:Y.htmlCheckbox,style:{}}),M(Ke,{className:Y.handle,...q,children:[F(y,{className:Y.handleCircle}),s&&F(f,{icon:s,iconProps:{variant:"fill",size:"sm"},"data-testid":"on-icon",className:m(Y.handleIcon,L?"opacity-100":"opacity-0")}),c&&F(f,{icon:c,iconProps:{variant:"fill",size:"sm"},"data-testid":"off-icon",className:m(Y.handleIcon,L?"opacity-0":"opacity-100")})]})]}),i&&F(u,{as:"div",variant:"inherit",color:"inherit",required:b,label:i,className:Y.label})]})})});Je.displayName="Switch";export{te as Avatar,Y as AvatarIcon,ee as AvatarImage,_ as AvatarText,ae as Badge,ue as Button,ye as Checkbox,Se as Chip,we as ChipButton,Ce as ChipDismissible,ke as ChipLink,Ve as ChipToggle,Pe as IconButton,Le as Input,Ge as Radio,De as RadioGroupProvider,Je as Switch};
|
2
|
+
import{Image as e}from"../chunk-53CIH36M.js";import{o2 as t,Pressable as a,a as n,o as i,e as o,t as r,e2 as s}from"../chunk-GGW73ECI.js";export{Pressable}from"../chunk-GGW73ECI.js";import{HStack as c,VStack as l}from"../chunk-WFWWC766.js";import{FormLabel as d}from"../chunk-SFRPZXWP.js";import{SpringMotionConfig as u}from"../chunk-EFOWTGKI.js";export{SpringMotionConfig}from"../chunk-EFOWTGKI.js";import{getStyles as p,cx as h,IconSlot as m,createSlot as f,Icon as b,Box as v,Text as y}from"../chunk-PMXAH4FA.js";import{parseDeprecatedButtonPaletteVariant as g}from"../chunk-SLGIK6FM.js";import{require_isFunction as N}from"../chunk-EWIQEL36.js";import{BUTTON_CSS_VAR_MAP as x}from"../chunk-PM4TFP3I.js";import{__toESM as I}from"../chunk-GF4A6TFM.js";import{forwardRef as V,useMemo as w,useRef as C,useImperativeHandle as k,isValidElement as S,cloneElement as z,useId as P,useState as R,useCallback as T,useEffect as j,memo as H,createContext as O,useContext as W}from"react";import{jsxs as L,jsx as E,Fragment as M}from"react/jsx-runtime";import{buttonIconSvgSize as F}from"@yahoo/uds/fixtures";import{m as A,useReducedMotion as $,AnimatePresence as G}from"motion/react";export{Menu}from"@yahoo/uds/client/Menu";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var q=I(N(),1),B={first:e=>e[0]??"",last:e=>e[e.length-1]??"",firstAndLast:e=>1===e.length?e[0]:`${e[0]}${e[e.length-1]}`,firstTwo:e=>e.slice(0,2).join(""),firstThree:e=>e.slice(0,3).join(""),firstOfEach:e=>e.join("")},D=(e,t="firstAndLast")=>{if(!e)return"";if((0,q.default)(t))return t(e);const a=e.trim().split(/\s+/).map(e=>e[0].toUpperCase());return B[t](a)},X=(e="md",t)=>{const{className:a,...n}=t??{};return p({avatarSizeRoot:e,...n,className:h("shrink-0","text-center","inline-flex","justify-center","items-center","overflow-visible","truncate",a)})},K=e=>{const t=e?{height:e,width:e}:{};return{root:t,contents:{...t,boxSizing:"content-box"}}},Q="primary",U="md",Z={primary:s,secondary:r},J=({size:e=U,variant:t=Q,customSize:a,icon:n,slotProps:i,className:o,...r})=>{const s=w(()=>({root:X(e,{avatarIconVariantRoot:t,overflow:"hidden",className:h("overflow-hidden",o)}),iconContainer:h("w-full","h-full","shrink-0","overflow-hidden","text-center","inline-flex","justify-center","items-center"),icon:p({avatarSizeIcon:e})}),[o,e,t]),c=w(()=>K(a),[a]),l=n??Z[t??"primary"];return E(v,{className:s.root,style:c.root,...r,children:E(v,{className:s.iconContainer,style:c.contents,children:E(m,{icon:l,iconProps:{variant:"fill",color:"current",...i?.icon},className:s.icon})})})};J.displayName="AvatarIcon";var Y=({size:e=U,variant:t=Q,name:a,initials:n,customSize:i,abbreviationStrategy:o,className:r,slotProps:s,...c})=>{const l=w(()=>({root:X(e,{avatarTextVariantRoot:t,className:h("overflow-hidden","truncate",r)}),text:h("w-full","h-full","shrink-0","overflow-hidden","text-center","inline-flex","justify-center","items-center","truncate")}),[r,e,t]),d=w(()=>K(i),[i]);return E(v,{className:l.root,style:d.root,...c,children:E(y,{color:"inherit",variant:"inherit",className:l.text,style:d.contents,...s?.text,children:n||D(a,o)})})};Y.displayName="AvatarText";var _=({size:t=U,variant:a=Q,src:n,srcSet:i,customSize:o,alt:r,abbreviationStrategy:s,fallback:c,className:l,imageProps:d,slotProps:u,...p})=>{const[m,f]=R("loading");j(()=>{let e=!0;if(n||i){const t=new Image;t.onload=()=>{e&&f("loaded")},t.onerror=()=>{e&&f("error")},n&&(t.src=n),i&&(t.srcset=i)}else f("error");return()=>{e=!1}},[n,i]);const b=w(()=>({root:X(t,{avatarImageVariantRoot:a,className:h("overflow-hidden",l)}),contents:h("w-full","h-full","shrink-0","text-center","inline-flex","justify-center","items-center","object-cover")}),[l,t,a]),y=w(()=>K(o),[o]);if("loaded"===m)return E(v,{className:b.root,style:y.root,children:E(e,{src:n,srcSet:i,alt:r,className:b.contents,style:y.contents,...d,...u?.image})});const g={...p,size:t,customSize:o,variant:a};return c||r?E(Y,{name:r,initials:c,abbreviationStrategy:s,slotProps:{text:u?.text},...g}):E(J,{...g,slotProps:{icon:u?.icon}})};_.displayName="AvatarImage";var ee=e=>E(_,{...e});ee.displayName="Avatar";var te=V(function({variant:e="primary",size:t="md",minWidth:a,maxWidth:n=200,startIcon:i,endIcon:o,backgroundColor:r,color:s,iconColor:l,borderColor:d,children:u,className:f,...b},v){const y=p({badgeSizeRoot:t,badgeVariantRoot:e,className:h(["uds-badge","uds-badge-variant","uds-badge-size",f])}),g=p({badgeVariantIcon:e,badgeSizeIcon:t,className:h(["uds-badge-iconSize","uds-badge-iconColor"])}),N=w(()=>({...a?{minWidth:`${a}px`}:{},..."full"===n?{}:{maxWidth:`${n}px`},...r?{backgroundColor:r}:{},...d?{borderColor:d}:{},...s?{color:s}:{}}),[r,d,s,n,a]),x=w(()=>({variant:"fill",style:{...l?{color:l}:{}}}),[l]);return L(c,{ref:v,gap:"2",display:"inline-flex",alignItems:"center",className:y,style:N,...b,children:[i&&E(m,{icon:i,iconProps:x,"data-testid":"start-icon",className:g}),E("span",{className:"flex-1 truncate whitespace-nowrap text-center",children:u}),o&&E(m,{icon:o,iconProps:x,"data-testid":"end-icon",className:g})]})});te.displayName="Badge";var ae={scale:.7,opacity:0},ne={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},ie={icon:ne,hide:ae,loading:ae},oe={loading:ne,hide:ae,icon:ae},re=`var(${x.columnGap})`,se=`var(${x.iconSize})`,ce={rest:{scale:`var(${x.effects.scale.rest})`},hover:{scale:`var(${x.effects.scale.hover})`},pressed:{scale:`var(${x.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:re}},le={hide:{width:"0px",opacity:0,display:"none"},loading:{width:se,display:"flex",opacity:1},icon:{width:se,display:"flex",opacity:1}},de=V(function({variant:e,size:a,startIcon:n,endIcon:i,iconVariant:o,loading:r,disableEffects:s,children:c,asChild:l,type:d="button",className:v,width:y,...N},x){const I=C(null);k(x,()=>I.current);const V=w(()=>f(),[]),P=w(()=>A.create(V),[V]),R=i?"icon":"hide",T=(({startIcon:e,endIcon:t,loading:a})=>e||t||a?"withIcon":"withoutIcon")({startIcon:n,endIcon:i,loading:r}),j=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:r,startIcon:n}),{palette:H,variant:O}=w(()=>g({flatVariant:e}),[e]),W=w(()=>({button:p({width:y,buttonSize:a,buttonVariant:O,buttonPalette:H,className:h("uds-button","uds-ring","uds-hit-target",r&&"uds-button-loading",s&&"uds-button-without-effects","withIcon"===T&&"uds-button-with-gap",v)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"}),[y,a,O,H,v,r,s,T]),q=$()?"smooth":"subtle",B=w(()=>E(A.span,{className:W.iconContainer,initial:!1,variants:le,animate:j,children:L(G,{initial:!1,mode:"popLayout",children:[r&&E(A.span,{variants:oe,initial:"hide",animate:"loading",exit:"hide",children:E(b,{size:F,name:t,variant:o,color:"current",className:W.loading})},"loading"),n&&!r&&E(A.span,{variants:ie,initial:"hide",animate:"icon",exit:"hide",children:E(m,{className:W.start,icon:n,iconProps:{size:F,variant:o,color:"current"}})})]})}),[W.iconContainer,W.loading,W.start,j,r,o,n]),D=w(()=>E(A.span,{className:W.iconContainer,initial:!1,variants:le,animate:R,children:E(G,{initial:!1,mode:"popLayout",children:i&&E(A.span,{variants:ie,initial:"hide",animate:"icon",exit:"hide",children:E(m,{className:W.end,icon:i,iconProps:{size:F,variant:o,color:"current"}})})})}),[W.iconContainer,W.end,i,R,o]),X=w(()=>s?{...ce,rest:{},hover:{},pressed:{}}:ce,[s]);return l&&S(c)?E(u,{layoutSpeed:"3",layoutVariant:q,children:E(P,{type:d,className:W.button,initial:["hide",T],animate:T,variants:X,whileHover:"hover",whileTap:"pressed",...N,children:z(c,c.props,L(M,{children:[B,E("span",{className:W.content,children:c.props.children}),D]}))})}):E(u,{layoutSpeed:"3",layoutVariant:q,children:L(A.button,{ref:I,type:d,className:W.button,initial:["hide",T],animate:T,variants:X,whileHover:"hover",whileTap:"pressed",...N,children:[B,E("span",{className:W.content,children:c}),D]})})}),ue={primary:"alert",secondary:"alert-secondary"},pe=e=>"indeterminate"===e,he=e=>pe(e)?i:o,me=A.create(v),fe={layoutVariant:"smooth",layoutSpeed:"3"},be={layoutVariant:"veryBouncy",layoutSpeed:"4"},ve=V(function({id:e,checked:t,defaultChecked:a,onChange:n,label:i,labelPosition:o="start",variant:r="primary",size:s="md",reduceMotion:c,disabled:l,required:m,hasError:f,className:v,layerClassNames:y,...g},N){const x=P(),I=e??`uds-input-${x}`,V=C(null),k=void 0!==t,[S,z]=R(k?t:a),[H,O]=R(!1),[W,M]=R(!1),F=w(()=>f?ue[r]:r,[f,r]),G=!l&&H,q=!l&&W,B=w(()=>q?.9:G?1.1:1,[q,G]),D=w(()=>S?q?"opacity-55":"opacity-100":"opacity-0",[S,q]),X=w(()=>({scale:B}),[B]),K=w(()=>W?be:fe,[W]),Q=T(e=>{n?.(e),k||z(e.target.checked)},[k,n]),U=T(()=>{O(!0)},[]),Z=T(()=>{O(!1)},[]),J=T(()=>{M(!0)},[]),Y=T(()=>{M(!1)},[]),_=e=>{V.current&&(V.current.indeterminate=pe(e))},ee=c?"always":"user",te=$()||c?"duration-0":"duration-120";j(()=>{k&&z(t)},[t,k]),j(()=>{_(S)},[S]);const ae=pe(S)?"indeterminate":S?"checked":"unchecked",ne={root:p({checkboxSizeRoot:s,checkboxVariantRoot:F,checkboxVariantValueRoot:ae,display:"flex",flexDirection:"start"===o?"row":"row-reverse",alignItems:"center",className:h({"cursor-pointer":!l,"cursor-default":l,"opacity-50":l},v,y?.root)}),checkbox:p({checkboxSizeCheckbox:s,checkboxVariantCheckbox:F,checkboxVariantValueCheckbox:ae,className:h("border","rounded-[4px]","uds-ring","uds-ring-within",te,"transition-[background-color,border-color,box-shadow]",y?.checkbox)}),check:p({checkboxVariantCheckboxIcon:F,checkboxVariantValueCheckboxIcon:ae,className:h("pointer-events-none",D,te,"transition-opacity")}),htmlCheckbox:h("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:h("start"===o?"text-start":"text-end",y?.label)},ie=i?A.label:A.div;return E(u,{reducedMotion:ee,...K,children:L(ie,{className:ne.root,"data-testid":"container",onHoverStart:U,onHoverEnd:Z,onTapStart:J,onTap:Y,onTapCancel:Y,tabIndex:-1,children:[L(me,{position:"relative",className:ne.checkbox,alignItems:"center",justifyContent:"center",flex:"none",animate:X,children:[E("input",{type:"checkbox",tabIndex:0,...g,ref:e=>{V.current=e,_(S),"function"==typeof N?N(e):null!==N&&(N.current=e)},id:I,disabled:l,required:m,"aria-invalid":f,checked:k?!pe(S)&&S:void 0,defaultChecked:k?void 0:a,onChange:Q,className:ne.htmlCheckbox}),E(b,{name:he(S),size:"sm",className:ne.check})]}),i&&E(d,{as:"div",variant:"inherit",color:"inherit",required:m,label:i,className:ne.label})]})})});ve.displayName="Checkbox";var ye=(e,t,a="overwriteOriginal")=>{const n=Array.from(new Set([...Object.keys(e??{}),...Object.keys(t??{})]));return Object.fromEntries(n.map(n=>{const i=e?.[n],o=t?.[n];return i&&!o?[n,i]:o&&!i?[n,o]:"className"===n?[n,h(i,o)]:"keepOriginal"===a?[n,i]:[n,o]}))},ge=(e,t,a="overwriteOriginal")=>{if(!e)return t;const n=Array.from(new Set([...Object.keys(e),...Object.keys(t)]));return Object.fromEntries(n.map(n=>{const i=e[n],o=t[n];return[n,ye(i,o,a)]}))},Ne="primary",xe=V(function({size:e="md",minWidth:t,maxWidth:a=200,startIcon:n,endIcon:i,as:o="div",reduceMotion:r,disabled:s=!1,className:l,slotProps:d,children:u,...f},b){const v=$()||r?"duration-0":"duration-120",{className:g,...N}=d?.text??{},{className:x,...I}=d?.startIcon??{},{className:V,...C}=d?.endIcon??{},k=w(()=>({root:p({chipSizeRoot:e,className:h({"pointer-events-none":s,"cursor-default":s,"opacity-50":s},"inline-flex","items-center","focus-visible:-outline-offset-2","uds-ring",v,"transition-[background-color,outline-color,box-shadow]",l)}),text:h("truncate","whitespace-nowrap","text-center","flex-1",g),icon:p({chipSizeIcon:e})}),[l,v,s,e,g]),S=w(()=>({root:{maxWidth:`${a}px`,...t?{minWidth:`${t}px`}:{}}}),[a,t]);return E(c,{asChild:!0,ref:b,className:k.root,style:S.root,...f,children:L(o,{disabled:s,children:[n&&E(m,{icon:n,iconProps:{variant:"fill",className:h(k.icon,x),...I}}),E(y,{as:"span",color:"current",variant:"inherit",className:k.text,...N,children:u}),i&&E(m,{icon:i,iconProps:{variant:"fill",className:h(k.icon,V),...C}})]})})});xe.displayName="ChipBase";var Ie=V(function({variant:e=Ne,slotProps:t,className:a,...n},i){const o=w(()=>({root:p({chipLinkVariantRoot:e,className:a}),icon:p({chipLinkVariantIcon:e})}),[a,e]),r=ge(t,{startIcon:{className:o.icon},endIcon:{className:o.icon}});return E(xe,{as:"button",ref:i,tabIndex:0,className:o.root,slotProps:r,...n})});Ie.displayName="ChipButton";var Ve=V(function({dismissButtonAriaLabel:e,onDismiss:t,dismissIcon:i,variant:o=Ne,disabled:r,slotProps:s,className:c,...l},d){const u=w(()=>({root:p({chipDismissibleVariantRoot:o,className:c}),icon:p({chipDismissibleVariantIcon:o}),iconPressable:h("uds-chip-dismissible-button","uds-hit-target")}),[c,o]),f=T(e=>{e.stopPropagation(),t?.()},[t]),b=ge(s,{startIcon:{className:u.icon},endIcon:{className:u.icon}});return E(xe,{ref:d,disabled:r,tabIndex:-1,endIcon:t=>E(a,{"aria-label":e,className:u.iconPressable,onClick:f,disabled:r,children:E(m,{icon:i??n,iconProps:t})}),className:u.root,slotProps:b,...l})});Ve.displayName="ChipDismissible";var we=V(function({variant:e=Ne,href:t,disabled:a,slotProps:n,className:i,...o},r){const s=w(()=>({root:p({chipLinkVariantRoot:e,className:i}),icon:p({chipLinkVariantIcon:e})}),[i,e]),c=ge(n,{startIcon:{className:s.icon},endIcon:{className:s.icon}});return E(xe,{as:"a",ref:r,disabled:a,className:s.root,slotProps:c,tabIndex:0,...{...o,href:a?void 0:t}})});we.displayName="ChipLink";var Ce=V(function({isToggled:e=!1,onToggle:t,onClick:a,variant:n=Ne,slotProps:i,className:o,...r},s){const c=w(()=>({root:p({chipToggleVariantRoot:n,chipToggleVariantActiveRoot:e?"on":"off",className:o}),icon:p({chipToggleVariantIcon:n})}),[o,e,n]),l=T(n=>{t?.(!e),a?.(n)},[e,a,t]),d=ge(i,{startIcon:{className:c.icon},endIcon:{className:c.icon}});return E(xe,{ref:s,as:"button",onClick:l,"aria-pressed":e,className:c.root,slotProps:d,tabIndex:0,...r})});Ce.displayName="ChipToggle";var ke=V(function({onClick:e,href:t,linkProps:a,onDismiss:n,onToggle:i,isToggled:o,slotProps:r,...s},c){const{anchor:l,...d}=r??{};return n?E(Ve,{ref:c,onDismiss:n,slotProps:d,...s}):i?E(Ce,{ref:c,onToggle:i,isToggled:o,slotProps:d,...s}):t?E(we,{ref:c,href:t,slotProps:d,...s,...a,...l}):E(Ie,{ref:c,onClick:e,slotProps:d,...s})});ke.displayName="Chip";var Se=V(function({variant:e,size:a,iconVariant:n,loading:i,disableEffects:o,name:r,type:s="button",htmlName:c,className:l,children:d,...m},f){const v=C(null);k(f,()=>v.current);const{palette:y,variant:N}=g({flatVariant:e}),x=w(()=>({button:p({buttonVariant:N,buttonPalette:y,iconButtonSize:a,className:h("uds-icon-button","uds-button","uds-ring","uds-hit-target",i&&"uds-button-loading",o&&"uds-button-without-effects",l)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"}),[y,N,l,o,a,i]),I=$(),V=w(()=>I?"smooth":"subtle",[I]),S=w(()=>{const{rest:e,hover:t,pressed:a}=ce;return o?{rest:{},hover:{},pressed:{}}:{rest:e,hover:t,pressed:a}},[o]);return E(u,{layoutSpeed:"3",layoutVariant:V,reducedMotion:o?"always":"user",children:E(A.button,{ref:v,type:s,className:x.button,initial:"icon",variants:S,whileHover:"hover",whileTap:"pressed",name:c,...m,children:L(G,{initial:!1,mode:"popLayout",children:[i&&E(A.span,{variants:oe,initial:"loading",animate:"loading",exit:"hide",children:E(b,{size:F,name:t,variant:n,color:"current",className:x.loading})},"loading"),r&&!i&&E(A.span,{variants:ie,initial:"icon",animate:"icon",exit:"hide",children:d||E(b,{size:F,name:r,variant:n,color:"current",className:x.icon})},r.name)]})})})}),ze=I(N(),1),Pe=({children:e,reduceMotion:t,layoutVariant:a})=>{const n=C(null),[i,o]=R("auto");return j(()=>{if(n.current){const e=new ResizeObserver(e=>{o(e[0].contentRect.height)});return e.observe(n.current),()=>{e.disconnect()}}},[]),E(u,{reducedMotion:t,layoutSpeed:"4",layoutVariant:a,children:E(A.div,{className:"overflow-hidden",style:{height:i,opacity:0},animate:{height:i,opacity:1},children:E("div",{ref:n,children:e})})})};function Re({startIcon:e,endIcon:t,iconProps:a,children:n,size:i,isFilled:o,...r}){const s={helperText:h(p({inputSizeHelperText:i,inputVariantHelperText:"default",inputVariantValueHelperText:o?"filled":"empty"})),helperIcon:p({inputSizeHelperIcon:i,inputVariantHelperIcon:"default",inputVariantValueHelperIcon:o?"filled":"empty"})},l={variant:"outline",...a};return L(c,{gap:"1",alignItems:"center",...r,children:[e&&E(m,{icon:e,...l,iconProps:a,className:s.helperIcon}),E("span",{className:s.helperText,children:n}),t&&E(m,{icon:t,...l,iconProps:a,className:s.helperIcon})]})}Re.displayName="InputHelpTextInternal";var Te=H(Re),je=H(function({helpText:e,helperTextIcon:t,spacingStart:a,spacingTop:n,size:i,isFilled:o,...r}){return e?E(v,{spacingTop:n,spacingStart:a,...r,children:E(Te,{startIcon:t,size:i,isFilled:o,children:(0,ze.default)(e)?e():e})}):null}),He=H(function({icon:e,className:t,iconProps:a}){return e?E(m,{icon:e,iconProps:{variant:"outline",...a},className:t}):null}),Oe=H(function({icon:e,className:t,iconProps:a}){return e?E(m,{icon:e,iconProps:{variant:"outline",...a},className:t}):null}),We=V(function({id:e,label:t,type:a="text",size:n="md",startIcon:i,endIcon:o,helpText:r,helperTextIcon:s,hasError:d,width:u="full",defaultValue:m,required:f,readOnly:b,disabled:y,reduceMotion:g,onChange:N,slotProps:x,className:I,...V},w){const S=P(),z=e??`uds-input-${S}`,j=`uds-input-${z}-help-text`,{className:H,...O}=x?.input??{},{className:W,...M}=x?.inputWrapper??{},F=C(null);k(w,()=>F.current);const[A,G]=R(m??""),q=T(e=>{G(e.target.value),N?.(e)},[N]),B=$()?"smooth":"bouncy",D=g?"always":"user",X=!b&&!y,K={root:p({inputSizeRoot:n,inputVariantRoot:"default",inputVariantValueRoot:A?"filled":"empty",className:h([I,y?"opacity-50":""])}),inputWrapper:h(p({inputSizeInputWrapper:n,inputVariantInputWrapper:"default",inputVariantValueInputWrapper:A?"filled":"empty"}),"min-w-[200px]",W),input:p({inputSizeInput:n,inputVariantInput:"default",inputVariantValueInput:A?"filled":"empty",inputVariantInputPlaceholder:"default",inputVariantValueInputPlaceholder:A?"filled":"empty",className:h("grow","uds-hit-target","bg-clip-text","focus:outline-none",X?"cursor-text":"cursor-not-allowed",H)}),label:h(p({inputSizeLabel:n,inputVariantLabel:"default",inputVariantValueLabel:A?"filled":"empty"})),labelRequired:p({inputVariantLabelRequired:"default",inputVariantValueLabelRequired:A?"filled":"empty"}),startIcon:p({inputSizeStartIcon:n,inputVariantStartIcon:"default",inputVariantValueStartIcon:A?"filled":"empty"}),endIcon:p({inputSizeEndIcon:n,inputVariantEndIcon:"default",inputVariantValueEndIcon:A?"filled":"empty"})};return L(l,{width:u,className:K.root,children:[t&&L(v,{spacingBottom:"2",columnGap:"0.5",alignItems:"flex-end",className:K.label,children:[E("label",{htmlFor:z,children:(0,ze.default)(t)?t():t}),f&&E("span",{className:K.labelRequired,children:"*"})]}),L(v,{position:"relative",alignItems:"center",...M,className:K.inputWrapper,children:[E(He,{icon:i,className:K.startIcon,iconProps:x?.startIcon}),E("input",{ref:F,id:z,type:a,value:A,required:f,readOnly:b,disabled:y,"aria-describedby":j,"aria-invalid":d,onChange:q,className:K.input,...V,...O}),o&&E(c,{alignItems:"center",gap:"1",children:E(Oe,{icon:o,className:K.endIcon,iconProps:x?.endIcon})})]}),E(Pe,{reduceMotion:D,layoutVariant:B,children:E(je,{id:j,helpText:r,spacingTop:"2",size:n,isFilled:!!A,helperTextIcon:s})})]})});We.displayName="Input";var Le=({size:e="md",isFilled:t,...a})=>{const n={root:p({inputSizeRoot:e,inputVariantRoot:"default",inputVariantValueRoot:t?"filled":"empty"})};return E(v,{asChild:!0,spacingTop:"2",className:n.root,children:E(Te,{size:e,isFilled:t,...a})})};Le.displayName="InputHelpText";var Ee=class e{name;value;activeCount=0;#e=new Set;constructor(e){this.name=e}onChange(e){return this.#e.add(e),()=>{this.#e.delete(e)}}setValue(e){this.value=e,this.#e.forEach(t=>t(e))}static findOrCreate(t,a){let n=t.get(a);return n||(n=new e(a),t.set(a,n)),n}},Me=O(new Map),Fe=e=>{const t=P();return e??`uds-radio-group-${t}`},Ae={primary:"alert",secondary:"alert-secondary"},$e=A.create(v),Ge={layoutVariant:"smooth",layoutSpeed:"3"},qe={layoutVariant:"veryBouncy",layoutSpeed:"4"},Be=V(function({id:e,name:t,label:a,labelPosition:n="start",variant:i="primary",size:o="md",reduceMotion:r,value:s="",checked:c,defaultChecked:l,disabled:m,hasError:f,onChange:b,onFocus:y,onBlur:g,className:N,layerClassNames:x,...I},V){const k=P(),S=e??`uds-radio-${k}`,z=C(null),{name:H,isControlled:O,checked:M,setGroupValue:F}=(({name:e,value:t,checked:a,defaultChecked:n})=>{const i=W(Me),o=i instanceof Ee,r=void 0!==a||o,s=Fe(e),c=w(()=>o?i:Ee.findOrCreate(i,s),[i,o,s]),[l,d]=R(c.value),u=c.name??s,p=T(e=>{c.setValue(e),r||d(e)},[r,c]);return j(()=>c.onChange(d),[c]),j(()=>{!0===a&&p(t)},[a,t,p]),j(()=>{if(o)return;const e=Ee.findOrCreate(i,u);return e.activeCount+=1,i.set(u,e),()=>{const e=i.get(u);e&&(e.activeCount-=1,0===e.activeCount&&i.delete(u))}},[i,o,u]),{name:u,isControlled:r,checked:r&&!o?a:void 0!==l?t===l:n??!1,setGroupValue:p}})({name:t,value:s,checked:c,defaultChecked:l}),[G,q]=R(!1),[B,D]=R(!1),X=w(()=>f?Ae[i]:i,[f,i]),K=w(()=>!m&&G,[m,G]),Q=w(()=>!m&&!M&&B,[M,m,B]),U=w(()=>Q?.9:K?1.1:1,[K,Q]),Z=w(()=>M?Q?"opacity-55":"opacity-100":"opacity-0",[M,Q]),J=w(()=>!m&&(Q&&!M||K&&M),[M,m,K,Q]),Y=w(()=>({scale:U}),[U]),_=w(()=>B?qe:Ge,[B]),ee=T(e=>{F(e.target.value),b?.(e)},[b,F]),te=T(e=>{y?.(e)},[y]),ae=T(e=>{g?.(e)},[g]),ne=T(()=>{q(!0)},[]),ie=T(()=>{q(!1)},[]),oe=T(()=>{D(!0)},[]),re=T(()=>{D(!1)},[]),se=r?"always":"user",ce=$()||r?"duration-0":"duration-120",le={root:p({radioSizeRoot:o,radioVariantValueRoot:M?"checked":"unchecked",radioVariantRoot:X,display:"flex",flexDirection:"start"===n?"row":"row-reverse",alignItems:"center",className:h([{"cursor-pointer":!m,"cursor-default":m,"opacity-50":m},N,x?.root])}),radio:p({radioSizeRadio:o,radioVariantRadio:X,radioVariantValueRadio:M?"checked":"unchecked",className:h(["border","uds-ring","uds-ring-within",ce,"transition-[background-color,border-color]","transition-shadow",x?.radio])}),radioCircle:p({radioVariantRadioCircle:X,radioVariantValueRadioCircle:M?"checked":"unchecked",className:h(["pointer-events-none","w-[8px]","h-[8px]",Z,ce,"transition-opacity"])}),htmlRadio:h("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:h("start"===n?"text-start":"text-end",x?.label)},de=a?A.label:A.div;return E(u,{reducedMotion:se,..._,children:L(de,{className:le.root,"data-testid":"container",onHoverStart:ne,onHoverEnd:ie,onTapStart:oe,onTap:re,onTapCancel:re,tabIndex:-1,children:[L($e,{position:"relative",borderRadius:"full",alignItems:"center",justifyContent:"center",flex:"none",className:le.radio,animate:Y,insetShadow:J?"lg-invert":"none",children:[E("input",{type:"radio",tabIndex:0,...I,ref:e=>{z.current=e,"function"==typeof V?V(e):null!==V&&(V.current=e)},onFocus:te,onBlur:ae,id:S,name:H,value:s,disabled:m,"aria-invalid":f,onChange:ee,...O?{checked:M}:{defaultChecked:l},className:le.htmlRadio}),E(v,{borderRadius:"full",className:le.radioCircle})]}),a&&E(d,{as:"div",variant:"inherit",color:"inherit",label:a,className:le.label})]})})});Be.displayName="Radio";var De=f(),Xe=class extends Ee{onChangeCb;isControlled;constructor(e,t){super(e),this.isControlled=t}setValue(e,t=!1){this.isControlled&&!t?this.onChangeCb?.(e):super.setValue(e)}},Ke=V(function({asChild:e,name:t,value:a,defaultValue:n,onChange:i,...o},r){const s=void 0!==a,c=Fe(t),l=w(()=>{const e=new Xe(c,s);return e.value=s?a:n,e},[n,s,c,a]);j(()=>{l.onChangeCb=i},[i,l]),j(()=>{s&&l.setValue(a,!0)},[s,l,a]),j(()=>l.onChange(e=>i?.(e)),[i,l]);const d=e?De:"div";return E(Me.Provider,{value:l,children:E(d,{role:"radiogroup",ref:r,...o})})});Ke.displayName="RadioGroupProvider";var Qe={md:{isOnX:20},sm:{isOnX:12}},Ue=A.create(v),Ze={layoutVariant:"bouncy",layoutSpeed:"4"},Je=V(function({id:e,isOn:t,defaultIsOn:a,onChange:n,label:i,labelPosition:o="start",size:r="md",onIcon:s,offIcon:c,reduceMotion:l,disabled:f,required:b,onFocus:y,onBlur:g,className:N,layerClassNames:x,...I},V){const k=P(),S=e??`uds-input-${k}`,z=C(null),H=void 0!==t,[O,W]=R(H?t:a),[M,F]=R(!1),G=w(()=>!f&&M,[f,M]),{isOnX:q}=Qe[r],B=w(()=>({initial:{scale:1,x:O?q:0},animate:{scale:G?1.05:1,x:O?q:0}}),[G,O,q]),D=T(e=>{n?.(e),H||W(e.target.checked)},[H,n]),X=T(e=>{y?.(e)},[y]),K=T(e=>{g?.(e)},[g]),Q=T(()=>{F(!0)},[]),U=T(()=>{F(!1)},[]),Z=l?"always":"user",J=$()||l?"duration-0":"duration-120";j(()=>{H&&W(t)},[t,H]);const Y={root:p({switchSizeRoot:r,switchVariantRoot:"default",switchVariantActiveRoot:O?"on":"off",display:"flex",flexDirection:"start"===o?"row":"row-reverse",alignItems:"center",className:h("group",{"cursor-pointer":!f,"cursor-default":f,"opacity-50":f},x?.root,N)}),switch:p({switchVariantSwitch:"default",switchSizeSwitch:r,switchVariantActiveSwitch:O?"on":"off",borderRadius:"full",position:"relative",alignItems:"center",className:h("uds-ring","uds-ring-within",J,"transition-[background-color,box-shadow]",x?.switch)}),handle:p({switchSizeHandle:r,className:h("relative","pointer-events-none","rounded-full","overflow-hidden",x?.handle)}),handleCircle:p({switchVariantActiveHandle:O?"on":"off",switchVariantHandle:"default",className:h("absolute","top-0","left-0","right-0","bottom-0","opacity-95 group-hover:opacity-100",J,"transition-[background-color,box-shadow,opacity]")}),handleIcon:p({switchSizeHandleIcon:r,switchVariantHandleIcon:"default",switchVariantActiveHandleIcon:O?"on":"off",className:h("absolute","opacity-0","top-1/2","left-1/2","transform","translate-x-[-50%]","translate-y-[-50%]",J,"transition-opacity")}),htmlCheckbox:h("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:h("start"===o?"text-start":"text-end",x?.label)},_=i?A.label:A.div;return E(u,{reducedMotion:Z,...Ze,children:L(_,{className:Y.root,"data-testid":"container",onHoverStart:Q,onHoverEnd:U,tabIndex:-1,children:[L(Ue,{className:Y.switch,children:[E("input",{type:"checkbox",tabIndex:0,...I,ref:e=>{z.current=e,"function"==typeof V?V(e):null!==V&&(V.current=e)},onFocus:X,onBlur:K,id:S,disabled:f,required:b,checked:H?O:void 0,defaultChecked:H?void 0:a,onChange:D,className:Y.htmlCheckbox,style:{}}),L(Ue,{className:Y.handle,...B,children:[E(v,{className:Y.handleCircle}),s&&E(m,{icon:s,iconProps:{variant:"fill",size:"sm"},"data-testid":"on-icon",className:h(Y.handleIcon,O?"opacity-100":"opacity-0")}),c&&E(m,{icon:c,iconProps:{variant:"fill",size:"sm"},"data-testid":"off-icon",className:h(Y.handleIcon,O?"opacity-0":"opacity-100")})]})]}),i&&E(d,{as:"div",variant:"inherit",color:"inherit",required:b,label:i,className:Y.label})]})})});Je.displayName="Switch";export{ee as Avatar,J as AvatarIcon,_ as AvatarImage,Y as AvatarText,te as Badge,de as Button,ve as Checkbox,ke as Chip,Ie as ChipButton,Ve as ChipDismissible,we as ChipLink,Ce as ChipToggle,Se as IconButton,We as Input,Le as InputHelpText,Be as Radio,Ke as RadioGroupProvider,Je as Switch};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as ColorModeConfig, S as ScaleModeConfig, F as FontConfig, B as ButtonConfig, I as IconButtonConfig, M as MotionConfig,
|
2
|
-
export {
|
1
|
+
import { C as ColorModeConfig, S as ScaleModeConfig, F as FontConfig, B as ButtonConfig, I as IconButtonConfig, M as MotionConfig, d as ShadowConfig, T as TypographyConfig, G as GlobalDefaultsConfig, e as BreakpointsConfig } from './types-Da_DnBJy.cjs';
|
2
|
+
export { f as defaultUniversalTokensConfigAuto } from './types-Da_DnBJy.cjs';
|
3
3
|
import '@yahoo/uds-icons/types';
|
4
4
|
import 'motion/react';
|
5
5
|
import 'react';
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as ColorModeConfig, S as ScaleModeConfig, F as FontConfig, B as ButtonConfig, I as IconButtonConfig, M as MotionConfig,
|
2
|
-
export {
|
1
|
+
import { C as ColorModeConfig, S as ScaleModeConfig, F as FontConfig, B as ButtonConfig, I as IconButtonConfig, M as MotionConfig, d as ShadowConfig, T as TypographyConfig, G as GlobalDefaultsConfig, e as BreakpointsConfig } from './types-Da_DnBJy.js';
|
2
|
+
export { f as defaultUniversalTokensConfigAuto } from './types-Da_DnBJy.js';
|
3
3
|
import '@yahoo/uds-icons/types';
|
4
4
|
import 'motion/react';
|
5
5
|
import 'react';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as properties from '@yahoo/uds/fixtures';
|
2
|
-
import {
|
2
|
+
import { m as ShadowPreset, g as UniversalTokensConfig } from './types-Da_DnBJy.cjs';
|
3
3
|
|
4
4
|
type DispatchContext = {
|
5
5
|
componentName: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as properties from '@yahoo/uds/fixtures';
|
2
|
-
import {
|
2
|
+
import { m as ShadowPreset, g as UniversalTokensConfig } from './types-D6kYghpa.js';
|
3
3
|
|
4
4
|
type DispatchContext = {
|
5
5
|
componentName: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as properties from '@yahoo/uds/fixtures';
|
2
|
-
import {
|
2
|
+
import { m as ShadowPreset, g as UniversalTokensConfig } from './types-Da_DnBJy.js';
|
3
3
|
|
4
4
|
type DispatchContext = {
|
5
5
|
componentName: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as properties from '@yahoo/uds/fixtures';
|
2
|
-
import {
|
2
|
+
import { m as ShadowPreset, g as UniversalTokensConfig } from './types-D6kYghpa.cjs';
|
3
3
|
|
4
4
|
type DispatchContext = {
|
5
5
|
componentName: string;
|