@yahoo/uds 2.11.0 → 3.0.0-beta.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/bin/uds-darwin-arm64-baseline +0 -0
- package/cli/bin/uds-linux-arm64 +0 -0
- package/cli/bin/uds-linux-x64-baseline +0 -0
- package/cli/cli.ts +1 -1
- package/cli/codemods/addCommentAboveComponents.ts +1 -1
- package/cli/codemods/flattenButtonVariant.ts +143 -0
- package/cli/codemods/utils/index.ts +1 -1
- package/cli/commands/codemod/flattenButtonVariant.ts +16 -0
- package/cli/tailwindcss.d.ts +2 -0
- package/cli/tsconfig.json +30 -8
- package/cli/utils/configWorker.ts +1 -1
- package/cli/utils/purgeCSS.ts +3 -3
- package/cli/utils/sortKeys.ts +5 -0
- package/dist/{Text-UCDorZDD.d.cts → Text-DC5H-ljU.d.cts} +29 -68
- package/dist/{Text-UCDorZDD.d.ts → Text-DC5H-ljU.d.ts} +29 -68
- package/dist/VStack-dsjTgotn.d.ts +145 -0
- package/dist/VStack-lZcVQtuR.d.cts +145 -0
- package/dist/analytics/server.js +1 -1
- package/dist/chunk-3R4CMTF2.js +2 -0
- package/dist/chunk-COT7GQ26.js +2 -0
- package/dist/chunk-DIZ6AEFQ.cjs +3 -0
- package/dist/chunk-GWUSJOIP.js +2 -0
- package/dist/chunk-GXWRHF26.cjs +1 -0
- package/dist/chunk-H35WDIEH.cjs +1 -0
- package/dist/chunk-IGRY2O2E.js +2 -0
- package/dist/chunk-IQXT3UML.cjs +2 -0
- package/dist/chunk-PLVCO2Q2.cjs +1 -0
- package/dist/chunk-RCTE4OK2.cjs +1 -0
- package/dist/chunk-ROCVTVD4.js +2 -0
- package/dist/chunk-SWTZ62RF.js +3 -0
- package/dist/chunk-TYCIDVTR.js +2 -0
- package/dist/chunk-UWAIMWW7.cjs +1 -0
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.d.cts +913 -21
- package/dist/client/index.d.ts +913 -21
- package/dist/client/index.js +3 -3
- package/dist/experimental/client/index.cjs +2 -2
- package/dist/experimental/client/index.d.cts +14 -49
- package/dist/experimental/client/index.d.ts +14 -49
- package/dist/experimental/client/index.js +2 -2
- package/dist/experimental/index.cjs +2 -2
- package/dist/experimental/index.d.cts +4 -55
- package/dist/experimental/index.d.ts +4 -55
- package/dist/experimental/index.js +1 -1
- package/dist/fixtures.cjs +1544 -54
- package/dist/fixtures.d.cts +33 -14
- package/dist/fixtures.d.ts +33 -14
- package/dist/fixtures.js +1517 -48
- package/dist/flags.cjs +1 -1
- package/dist/flags.js +1 -1
- package/dist/index-B1ZHRmSN.d.ts +202 -0
- package/dist/index-By9VJ9yq.d.cts +202 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +245 -128
- package/dist/index.d.ts +245 -128
- package/dist/index.js +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/tailwind/plugin.cjs +1 -2
- package/dist/tailwind/plugin.d.cts +14 -5
- package/dist/tailwind/plugin.d.ts +14 -5
- package/dist/tailwind/plugin.js +2 -2
- package/dist/tailwind/purger.cjs +2 -2
- package/dist/tailwind/purger.js +3 -3
- package/dist/tailwind/tsMorph.cjs +1 -1
- package/dist/tailwind/tsMorph.js +1 -1
- package/dist/tailwind/utils.cjs +1 -1
- package/dist/tailwind/utils.d.cts +80 -28
- package/dist/tailwind/utils.d.ts +80 -28
- package/dist/tailwind/utils.js +1 -1
- package/dist/tokens/automation/configs.cjs +1 -0
- package/dist/tokens/automation/configs.d.cts +110 -0
- package/dist/tokens/automation/configs.d.ts +110 -0
- package/dist/tokens/automation/configs.js +1 -0
- package/dist/tokens/automation/properties.cjs +1 -0
- package/dist/tokens/automation/properties.d.cts +7 -0
- package/dist/tokens/automation/properties.d.ts +7 -0
- package/dist/tokens/automation/properties.js +1 -0
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +9355 -15
- package/dist/tokens/index.d.ts +9355 -15
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/parseTokens.cjs +1 -1
- package/dist/tokens/parseTokens.d.cts +7 -23
- package/dist/tokens/parseTokens.d.ts +7 -23
- package/dist/tokens/parseTokens.js +1 -1
- package/dist/types-oxQ-ciqn.d.cts +10237 -0
- package/dist/types-oxQ-ciqn.d.ts +10237 -0
- package/package.json +15 -2
- package/dist/chunk-3G7IRLGN.js +0 -2
- package/dist/chunk-5WBROFT5.cjs +0 -1
- package/dist/chunk-6453EQCC.cjs +0 -1
- package/dist/chunk-7QHJ6LHA.js +0 -1
- package/dist/chunk-EYFQOFYW.cjs +0 -1
- package/dist/chunk-FWF2C6TL.cjs +0 -1
- package/dist/chunk-FYVGDNGL.js +0 -2
- package/dist/chunk-GIJ2FHY5.cjs +0 -1
- package/dist/chunk-GL5JI7EX.cjs +0 -2
- package/dist/chunk-MOUM7BAW.js +0 -2
- package/dist/chunk-PE2P7J44.js +0 -2
- package/dist/chunk-RXSJCGB3.cjs +0 -1
- package/dist/chunk-SUASN3GG.js +0 -2
- package/dist/chunk-U2K4DT7E.js +0 -3
- package/dist/chunk-VPR62GYQ.js +0 -2
- package/dist/chunk-WJ55DEUW.cjs +0 -2
- package/dist/chunk-X6F5UEQ5.js +0 -2
- package/dist/chunk-XZCEFUNX.cjs +0 -2
- package/dist/types-DPT0rst4.d.cts +0 -991
- package/dist/types-DPT0rst4.d.ts +0 -991
- /package/dist/{motionFeatures-PRT45UQH.js → motionFeatures-25DAPVNO.js} +0 -0
- /package/dist/{motionFeatures-HQUM526D.cjs → motionFeatures-II2BNXF5.cjs} +0 -0
package/dist/client/index.d.cts
CHANGED
@@ -1,22 +1,121 @@
|
|
1
|
-
import { e as UniversalButtonProps, f as UniversalIconButtonProps, g as UniversalPressableProps, M as MotionVariant, h as MotionVariantSpeed } from '../types-DPT0rst4.cjs';
|
2
|
-
import { HTMLMotionProps, MotionConfigProps } from 'motion/react';
|
3
|
-
import * as react from 'react';
|
4
|
-
import react__default from 'react';
|
5
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
+
import { cC as UniversalAvatarProps, cA as UniversalAvatarIconProps, cB as UniversalAvatarImageProps, cD as UniversalAvatarTextProps, cE as UniversalBadgeProps, cF as UniversalButtonProps, cG as UniversalCheckboxProps, cL as UniversalChipProps, cI as UniversalChipButtonProps, cJ as UniversalChipDismissibleProps, cK as UniversalChipLinkProps, cM as UniversalChipToggleProps, cN as UniversalIconButtonProps, ci as SpacingAlias, cR as UniversalPressableProps, cQ as UniversalMenuItemProps, cT as UniversalRadioProps, cS as UniversalRadioGroupProps, M as MotionVariant, n as MotionVariantSpeed, cU as UniversalSwitchProps } from '../types-oxQ-ciqn.cjs';
|
3
|
+
import * as react from 'react';
|
4
|
+
import react__default, { AriaRole, HTMLAttributes, PropsWithChildren } from 'react';
|
5
|
+
import { HTMLMotionProps, MotionConfigProps } from 'motion/react';
|
6
|
+
import { d as VStackProps, c as DividerProps, a as BoxProps } from '../VStack-lZcVQtuR.cjs';
|
7
|
+
export { e as Input, I as InputProps } from '../VStack-lZcVQtuR.cjs';
|
8
|
+
import { MenuProps, MenuItemProps as MenuItemProps$1, MenuItemCheckboxProps as MenuItemCheckboxProps$1, MenuProviderProps as MenuProviderProps$1, MenuButtonProps, useMenuContext, useMenuStore } from '@ariakit/react/menu';
|
9
|
+
import { useStoreState } from '@ariakit/react';
|
6
10
|
import '@yahoo/uds-icons/types';
|
11
|
+
import 'type-fest';
|
12
|
+
|
13
|
+
type AvatarProps = UniversalAvatarProps;
|
14
|
+
/**
|
15
|
+
* **👤 Avatar Component**
|
16
|
+
*
|
17
|
+
* @description The avatar component visually represents a person or an organization within an interface. It helps users quickly identify individuals or entities through images, icons, or text. Commonly used in user profiles, comments, and activity feeds, avatars create a recognizable and consistent visual identity across the system. With standardized sizes, variants, and configurable options, the component ensures flexibility while maintaining design cohesion and accessibility.
|
18
|
+
* @usage The Avatar component should be used whenever you need to visually represent a user's identity in your application. This includes places like profile headers, user lists, chat messages, and comment sections. It's ideal for providing a consistent visual cue for users, whether by displaying a profile image, generating initials from a name, or falling back to a default icon when no image is available.
|
19
|
+
* @param props - Combined Avatar props.
|
20
|
+
* @returns The Avatar element.
|
21
|
+
* @componentType Client component
|
22
|
+
* @example ```tsx
|
23
|
+
* import { Avatar } from '@yahoo/uds';
|
24
|
+
*
|
25
|
+
* <Avatar
|
26
|
+
* src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400"
|
27
|
+
* alt="Jane Doe"
|
28
|
+
* fallback="J"
|
29
|
+
* />
|
30
|
+
* ```
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
declare const Avatar: {
|
34
|
+
(props: AvatarProps): react_jsx_runtime.JSX.Element;
|
35
|
+
displayName: string;
|
36
|
+
};
|
37
|
+
|
38
|
+
type AvatarIconProps = UniversalAvatarIconProps;
|
39
|
+
/**
|
40
|
+
* **AvatarIcon Component**
|
41
|
+
*
|
42
|
+
* Renders an Avatar with an icon representation.
|
43
|
+
*
|
44
|
+
* @param props - Props for icon variant.
|
45
|
+
* @returns The AvatarIcon element.
|
46
|
+
*/
|
47
|
+
declare const AvatarIcon: {
|
48
|
+
({ size, variant, customSize, icon, className }: AvatarIconProps): react_jsx_runtime.JSX.Element;
|
49
|
+
displayName: string;
|
50
|
+
};
|
7
51
|
|
8
|
-
type
|
9
|
-
|
52
|
+
type AvatarImageProps = UniversalAvatarImageProps;
|
53
|
+
/**
|
54
|
+
* **AvatarImage Component**
|
55
|
+
*
|
56
|
+
* Renders an Avatar with an image. If the image fails to load, it falls back first to
|
57
|
+
* a text representation (if a name or initials are provided) and then to an icon.
|
58
|
+
*
|
59
|
+
* @param props - Props for image variant.
|
60
|
+
* @returns The AvatarImage element.
|
61
|
+
*/
|
62
|
+
declare const AvatarImage: {
|
63
|
+
({ size, variant, src, srcSet, customSize, alt, imageProps, abbreviationStrategy, fallback, className, }: AvatarImageProps): react_jsx_runtime.JSX.Element;
|
64
|
+
displayName: string;
|
65
|
+
};
|
66
|
+
|
67
|
+
type AvatarTextProps = UniversalAvatarTextProps;
|
68
|
+
/**
|
69
|
+
* **AvatarText Component**
|
70
|
+
*
|
71
|
+
* Renders an Avatar with text (initials) representation.
|
72
|
+
*
|
73
|
+
* @param props - Props for text variant.
|
74
|
+
* @returns The AvatarText element.
|
75
|
+
*/
|
76
|
+
declare const AvatarText: {
|
77
|
+
({ variant, size, name, initials, customSize, abbreviationStrategy, className, }: AvatarTextProps): react_jsx_runtime.JSX.Element;
|
78
|
+
displayName: string;
|
79
|
+
};
|
80
|
+
|
81
|
+
type HtmlDivProps$4 = react__default.HTMLAttributes<HTMLDivElement>;
|
82
|
+
interface BadgeProps extends HtmlDivProps$4, UniversalBadgeProps {
|
10
83
|
}
|
11
84
|
/**
|
12
|
-
*
|
85
|
+
* **⚙️️ A badge.
|
13
86
|
*
|
14
87
|
* @componentType Client component
|
15
88
|
*
|
16
89
|
* @description
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
90
|
+
* Badges show notifications, counts, or status information on navigation items and icons.
|
91
|
+
*
|
92
|
+
* @see
|
93
|
+
* Check out the {@link https://uds.build/docs/components/badge Badge Docs} for more info
|
94
|
+
*
|
95
|
+
* @usage
|
96
|
+
* - ???
|
97
|
+
*
|
98
|
+
* @example
|
99
|
+
* ```tsx
|
100
|
+
* 'use client';
|
101
|
+
* import { Badge } from "@yahoo/uds";
|
102
|
+
*
|
103
|
+
* <Badge>Label</Badge>
|
104
|
+
*```
|
105
|
+
*
|
106
|
+
* @related [Chip](https://uds.build/docs/components/chip).
|
107
|
+
**/
|
108
|
+
declare const Badge: react__default.ForwardRefExoticComponent<BadgeProps & react__default.RefAttributes<HTMLDivElement>>;
|
109
|
+
|
110
|
+
type HtmlButtonProps$3 = Omit<HTMLMotionProps<'button'>, 'color' | 'name'> & Omit<react__default.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
|
111
|
+
interface ButtonProps extends HtmlButtonProps$3, UniversalButtonProps {
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* **🖲️ A button element that can be used to trigger an action**
|
115
|
+
*
|
116
|
+
* @componentType Client component
|
117
|
+
*
|
118
|
+
* @description A button is a fundamental component used to trigger an action or event. Buttons are interactive elements that users can click, tap, or otherwise engage with to submit forms, open dialogues, or perform any other interaction within an application or website. Consider an IconButton for buttons that only contain an icon.
|
20
119
|
*
|
21
120
|
* @see The {@link https://uds.build/docs/components/button Button Docs} for more info
|
22
121
|
*
|
@@ -42,19 +141,93 @@ interface ButtonProps extends HtmlButtonProps$2, UniversalButtonProps {
|
|
42
141
|
**/
|
43
142
|
declare const Button: react__default.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
44
143
|
|
45
|
-
type
|
46
|
-
interface
|
144
|
+
type NativeInputProps$2 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'size' | 'height' | 'width' | 'color'>;
|
145
|
+
interface CheckboxProps extends NativeInputProps$2, UniversalCheckboxProps {
|
47
146
|
}
|
48
147
|
/**
|
49
|
-
* **⚙️️ An
|
148
|
+
* **⚙️️ An checkbox.
|
149
|
+
*
|
150
|
+
* @componentType Client component
|
151
|
+
*
|
152
|
+
* @description
|
153
|
+
* A checkbox component allows users to select one or multiple options from a set. It represents a binary state, typically as checked or unchecked, and optionally includes a third "indeterminate" state to indicate partial selection.
|
154
|
+
*
|
155
|
+
* @see
|
156
|
+
* Check out the {@link https://uds.build/docs/components/checkbox Checkbox Docs} for more info
|
157
|
+
*
|
158
|
+
* @usage
|
159
|
+
* - Forms: checkbox
|
160
|
+
*
|
161
|
+
* @example
|
162
|
+
* ```tsx
|
163
|
+
* 'use client';
|
164
|
+
* import { Checkbox } from "@yahoo/uds";
|
165
|
+
*
|
166
|
+
* <Checkbox label="Name" required />
|
167
|
+
*```
|
168
|
+
*
|
169
|
+
* @related [Radio](https://uds.build/docs/components/radio), [Switch](https://uds.build/docs/components/switch), [Input](https://uds.build/docs/components/input).
|
170
|
+
**/
|
171
|
+
declare const Checkbox: react__default.ForwardRefExoticComponent<CheckboxProps & react__default.RefAttributes<HTMLInputElement>>;
|
172
|
+
|
173
|
+
type HtmlDivProps$3 = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'onToggle'>;
|
174
|
+
interface ChipProps extends UniversalChipProps, HtmlDivProps$3 {
|
175
|
+
}
|
176
|
+
/**
|
177
|
+
* **⚙️️ A chip.
|
50
178
|
*
|
51
179
|
* @componentType Client component
|
52
180
|
*
|
53
181
|
* @description
|
54
|
-
*
|
55
|
-
*
|
56
|
-
*
|
57
|
-
*
|
182
|
+
* Chips help people make selections, filter content, link out to other spaces or trigger actions. These actions are contextually driven and are not persistent across the product experiences differing them from buttons.
|
183
|
+
*
|
184
|
+
* @see
|
185
|
+
* Check out the {@link https://uds.build/docs/components/chip Chip Docs} for more info
|
186
|
+
*
|
187
|
+
* @usage
|
188
|
+
* - ???
|
189
|
+
*
|
190
|
+
* @example
|
191
|
+
* ```tsx
|
192
|
+
* 'use client';
|
193
|
+
* import { Chip } from "@yahoo/uds";
|
194
|
+
*
|
195
|
+
* <Chip>Label</Chip>
|
196
|
+
*```
|
197
|
+
*
|
198
|
+
* @related [Badge](https://uds.build/docs/components/badge), [Link](https://uds.build/docs/components/link).
|
199
|
+
**/
|
200
|
+
declare const Chip: react__default.ForwardRefExoticComponent<ChipProps & react__default.RefAttributes<HTMLDivElement>>;
|
201
|
+
|
202
|
+
type HtmlDivProps$2 = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'label'>;
|
203
|
+
interface ChipButtonProps extends HtmlDivProps$2, Omit<UniversalChipButtonProps, 'type'> {
|
204
|
+
}
|
205
|
+
declare const ChipButton: react__default.ForwardRefExoticComponent<ChipButtonProps & react__default.RefAttributes<HTMLDivElement>>;
|
206
|
+
|
207
|
+
type HtmlDivProps$1 = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'label'>;
|
208
|
+
interface ChipDismissibleProps extends HtmlDivProps$1, Omit<UniversalChipDismissibleProps, 'type'> {
|
209
|
+
}
|
210
|
+
declare const ChipDismissible: react__default.ForwardRefExoticComponent<ChipDismissibleProps & react__default.RefAttributes<HTMLDivElement>>;
|
211
|
+
|
212
|
+
type HtmlAnchorProps = Omit<react__default.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'type'>;
|
213
|
+
interface ChipLinkProps extends HtmlAnchorProps, Omit<UniversalChipLinkProps, 'type'> {
|
214
|
+
}
|
215
|
+
declare const ChipLink: react__default.ForwardRefExoticComponent<ChipLinkProps & react__default.RefAttributes<HTMLAnchorElement>>;
|
216
|
+
|
217
|
+
type HtmlDivProps = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'children' | 'label' | 'onToggle'>;
|
218
|
+
interface ChipToggleProps extends UniversalChipToggleProps, HtmlDivProps {
|
219
|
+
}
|
220
|
+
declare const ChipToggle: react__default.ForwardRefExoticComponent<ChipToggleProps & react__default.RefAttributes<HTMLDivElement>>;
|
221
|
+
|
222
|
+
type HtmlButtonProps$2 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
|
223
|
+
interface IconButtonProps extends HtmlButtonProps$2, UniversalIconButtonProps {
|
224
|
+
}
|
225
|
+
/**
|
226
|
+
* **⚙️️ An icon button element that can be used to trigger an action**
|
227
|
+
*
|
228
|
+
* @componentType Client component
|
229
|
+
*
|
230
|
+
* @description An icon button is essentially an interactive icon. They should be used to display an icon which, when clicked, allows the user to trigger an action. Icon buttons provide additional features such hover states, focus states, and pressable functionality.
|
58
231
|
*
|
59
232
|
* @see
|
60
233
|
* Check out the {@link https://uds.build/docs/components/icon-button IconButton Docs} for more info
|
@@ -69,7 +242,7 @@ interface IconButtonProps extends HtmlButtonProps$1, UniversalIconButtonProps {
|
|
69
242
|
* import { IconButton } from "@yahoo/uds";
|
70
243
|
* import { AddFolder } from "@yahoo/uds-icons";
|
71
244
|
*
|
72
|
-
* <IconButton name={AddFolder}
|
245
|
+
* <IconButton name={AddFolder} variant="primary" />
|
73
246
|
* ```
|
74
247
|
*
|
75
248
|
* @related [Icon](https://uds.build/docs/components/icon), [Button](https://uds.build/docs/components/button), and [Pressable](https://uds.build/docs/components/pressable)
|
@@ -77,8 +250,261 @@ interface IconButtonProps extends HtmlButtonProps$1, UniversalIconButtonProps {
|
|
77
250
|
**/
|
78
251
|
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
79
252
|
|
80
|
-
|
81
|
-
|
253
|
+
interface MenuContentProps extends Omit<VStackProps, 'asChild'> {
|
254
|
+
gutter?: SpacingAlias;
|
255
|
+
/** UDS handles nested border radius for the first and last item for you to prevent clipping and visual jank.
|
256
|
+
* If you need to disable this, set this prop to true.
|
257
|
+
*
|
258
|
+
* @link https://github.com/yahoo-uds/uds/blob/main/packages/uds/src/hooks/useNestedBorderRadius.ts
|
259
|
+
**/
|
260
|
+
disableAutoBorderRadius?: boolean;
|
261
|
+
/**
|
262
|
+
* `portalRef` is similar to `ref` but is scoped to the portal node. It's
|
263
|
+
* useful when you need to be informed when the portal element is appended to
|
264
|
+
* the DOM or removed from the DOM.
|
265
|
+
*
|
266
|
+
* Live examples:
|
267
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
268
|
+
* @example
|
269
|
+
* ```jsx
|
270
|
+
* const [portalElement, setPortalElement] = useState(null);
|
271
|
+
*
|
272
|
+
* <Portal portalRef={setPortalElement} />
|
273
|
+
* ```
|
274
|
+
*/
|
275
|
+
portalRef?: MenuProps['portalRef'];
|
276
|
+
/**
|
277
|
+
* Determines whether the element should be rendered as a React Portal.
|
278
|
+
*
|
279
|
+
* Live examples:
|
280
|
+
* - [Combobox with integrated
|
281
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
282
|
+
* - [Dialog with Menu](https://ariakit.org/examples/dialog-menu)
|
283
|
+
* - [Hovercard with keyboard
|
284
|
+
* support](https://ariakit.org/examples/hovercard-disclosure)
|
285
|
+
* - [Menubar](https://ariakit.org/components/menubar)
|
286
|
+
* - [Standalone Popover](https://ariakit.org/examples/popover-standalone)
|
287
|
+
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
288
|
+
* @default true
|
289
|
+
*/
|
290
|
+
portal?: boolean;
|
291
|
+
/**
|
292
|
+
* An HTML element or a memoized callback function that returns an HTML
|
293
|
+
* element to be used as the portal element. By default, the portal element
|
294
|
+
* will be a `div` element appended to the `document.body`.
|
295
|
+
*
|
296
|
+
* Live examples:
|
297
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
298
|
+
* @example
|
299
|
+
* ```jsx
|
300
|
+
* const [portal, setPortal] = useState(null);
|
301
|
+
*
|
302
|
+
* <Portal portalElement={portal} />
|
303
|
+
* <div ref={setPortal} />
|
304
|
+
* ```
|
305
|
+
* @example
|
306
|
+
* ```jsx
|
307
|
+
* const getPortalElement = useCallback(() => {
|
308
|
+
* const div = document.createElement("div");
|
309
|
+
* const portalRoot = document.getElementById("portal-root");
|
310
|
+
* portalRoot.appendChild(div);
|
311
|
+
* return div;
|
312
|
+
* }, []);
|
313
|
+
*
|
314
|
+
* <Portal portalElement={getPortalElement} />
|
315
|
+
* ```
|
316
|
+
*/
|
317
|
+
portalElement?: MenuProps['portalElement'];
|
318
|
+
/**
|
319
|
+
* Determines whether the popover should hide when the mouse leaves the
|
320
|
+
* popover or the anchor element and there's no _hover intent_, meaning, the
|
321
|
+
* mouse isn't moving toward the popover.
|
322
|
+
*
|
323
|
+
* This can be either a boolean or a callback receiving the mouse move event
|
324
|
+
* that initiated the behavior. The callback should return a boolean.
|
325
|
+
*
|
326
|
+
* **Note**: This behavior won't be triggered when the popover or any of its
|
327
|
+
* descendants are in focus.
|
328
|
+
* @default true
|
329
|
+
*/
|
330
|
+
hideOnHoverOutside?: MenuProps['hideOnHoverOutside'];
|
331
|
+
/**
|
332
|
+
* Determines if the dialog will hide when the user presses the Escape key.
|
333
|
+
*
|
334
|
+
* This prop can be either a boolean or a function that accepts an event as an
|
335
|
+
* argument and returns a boolean. The event object represents the keydown
|
336
|
+
* event that initiated the hide action, which could be either a native
|
337
|
+
* keyboard event or a React synthetic event.
|
338
|
+
*
|
339
|
+
* **Note**: When placing Ariakit dialogs inside third-party dialogs, using
|
340
|
+
* `event.stopPropagation()` within this function will stop the event from
|
341
|
+
* reaching the third-party dialog, closing only the Ariakit dialog.
|
342
|
+
* @default true
|
343
|
+
*/
|
344
|
+
hideOnEscape?: MenuProps['hideOnEscape'];
|
345
|
+
/**
|
346
|
+
* Determines if the dialog should hide when the user clicks or focuses on an
|
347
|
+
* element outside the dialog.
|
348
|
+
*
|
349
|
+
* This prop can be either a boolean or a function that takes an event as an
|
350
|
+
* argument and returns a boolean. The event object represents the event that
|
351
|
+
* triggered the action, which could be a native event or a React synthetic
|
352
|
+
* event of various types.
|
353
|
+
*
|
354
|
+
* Live examples:
|
355
|
+
* - [Selection Popover](https://ariakit.org/examples/popover-selection)
|
356
|
+
* @default true
|
357
|
+
*/
|
358
|
+
hideOnInteractOutside?: MenuProps['hideOnInteractOutside'];
|
359
|
+
/**
|
360
|
+
* Determines if the pointer events outside of the popover and its anchor
|
361
|
+
* element should be disabled during _hover intent_, that is, when the mouse
|
362
|
+
* is moving toward the popover.
|
363
|
+
*
|
364
|
+
* This is required as these external events may trigger focus on other
|
365
|
+
* elements and close the popover while the user is attempting to hover over
|
366
|
+
* it.
|
367
|
+
*
|
368
|
+
* This can be either a boolean or a callback receiving the mouse event
|
369
|
+
* happening during hover intent. The callback should return a boolean.
|
370
|
+
* @default true
|
371
|
+
*/
|
372
|
+
disablePointerEventsOnApproach?: MenuProps['disablePointerEventsOnApproach'];
|
373
|
+
/**
|
374
|
+
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
375
|
+
* If not provided, the closest [`Menu.Content`](https://uds.build/docs/components/menu#menu-content) or
|
376
|
+
* [`Menu.Provider`](https://uds.build/docs/components/menu#menu-provider) context will be used.
|
377
|
+
*/
|
378
|
+
store?: MenuProps['store'];
|
379
|
+
/**
|
380
|
+
* Whether the popover should have the same width as the anchor element. This
|
381
|
+
* will be exposed to CSS as
|
382
|
+
* [`--popover-anchor-width`](https://ariakit.org/guide/styling#--popover-anchor-width).
|
383
|
+
* @default false
|
384
|
+
*/
|
385
|
+
sameWidth?: MenuProps['sameWidth'];
|
386
|
+
/**
|
387
|
+
* @see https://ariakit.org/reference/focusable
|
388
|
+
* @default true
|
389
|
+
*/
|
390
|
+
focusable?: MenuProps['focusable'];
|
391
|
+
/**
|
392
|
+
* This is an event handler prop triggered when the dialog's `close` event is
|
393
|
+
* dispatched. The `close` event is similar to the native dialog
|
394
|
+
* [`close`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event)
|
395
|
+
* event. The only difference is that this event can be canceled with
|
396
|
+
* `event.preventDefault()`, which will prevent the dialog from hiding.
|
397
|
+
*
|
398
|
+
* It's important to note that this event only fires when the dialog store's
|
399
|
+
* [`open`](https://ariakit.org/reference/use-dialog-store#open) state is set
|
400
|
+
* to `false`. If the controlled
|
401
|
+
* [`open`](https://ariakit.org/reference/dialog#open) prop value changes, or
|
402
|
+
* if the dialog's visibility is altered in any other way (such as unmounting
|
403
|
+
* the dialog without adjusting the open state), this event won't be
|
404
|
+
* triggered.
|
405
|
+
*
|
406
|
+
* Live examples:
|
407
|
+
* - [Dialog with scrollable
|
408
|
+
* backdrop](https://ariakit.org/examples/dialog-backdrop-scrollable)
|
409
|
+
* - [Dialog with details &
|
410
|
+
* summary](https://ariakit.org/examples/dialog-details)
|
411
|
+
* - [Warning on Dialog
|
412
|
+
* hide](https://ariakit.org/examples/dialog-hide-warning)
|
413
|
+
* - [Dialog with Menu](https://ariakit.org/examples/dialog-menu)
|
414
|
+
*/
|
415
|
+
onClose?: MenuProps['onClose'];
|
416
|
+
}
|
417
|
+
/**
|
418
|
+
* **📦 A Menu Content component**
|
419
|
+
*
|
420
|
+
* @componentType Client component
|
421
|
+
*
|
422
|
+
* @description
|
423
|
+
* A content component for the menu, which is used to provide the menu context to the menu items.
|
424
|
+
*
|
425
|
+
* @see The {@link https://uds.build/docs/components/menu-content Menu.Content Docs} for more info
|
426
|
+
*
|
427
|
+
* @example
|
428
|
+
* ```tsx
|
429
|
+
* 'use client'; // Next.js client component
|
430
|
+
*
|
431
|
+
* import { Menu, Button } from "@yahoo/uds";
|
432
|
+
* import { Calendar, Clipboard } from "@yahoo/uds-icons";
|
433
|
+
*
|
434
|
+
* export function MenuProviderExample() {
|
435
|
+
* return (
|
436
|
+
* <Menu.Provider>
|
437
|
+
* <Menu.Trigger asChild>
|
438
|
+
* <Button>Menu Options</Button>
|
439
|
+
* </Menu.Trigger>
|
440
|
+
* <Menu.Content>
|
441
|
+
* <Menu.Item startIcon={Calendar}>Calendar</Menu.Item>
|
442
|
+
* <Menu.Item startIcon={Clipboard} endIcon={DiagonalRightUp}>
|
443
|
+
* Clipboard
|
444
|
+
* </Menu.Item>
|
445
|
+
* <Menu.Item active>Active Item</Menu.Item>
|
446
|
+
* </Menu.Content>
|
447
|
+
* </Menu.Provider>
|
448
|
+
* )
|
449
|
+
* }
|
450
|
+
* ```
|
451
|
+
*
|
452
|
+
* @usage
|
453
|
+
* Using Menu.Content is required to use Menu.Item and Menu.ItemCheckbox. It acts as the actual menu container.
|
454
|
+
*
|
455
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
456
|
+
**/
|
457
|
+
declare const MenuContent: react.ForwardRefExoticComponent<MenuContentProps & react.RefAttributes<HTMLDivElement>>;
|
458
|
+
|
459
|
+
interface MenuDividerProps extends Omit<DividerProps, 'variant'> {
|
460
|
+
/**
|
461
|
+
* The role of the divider.
|
462
|
+
* @default 'separator'
|
463
|
+
*/
|
464
|
+
role?: AriaRole;
|
465
|
+
}
|
466
|
+
/**
|
467
|
+
* **〰️ A Menu Divider component**
|
468
|
+
*
|
469
|
+
* @componentType Client component
|
470
|
+
*
|
471
|
+
* @description
|
472
|
+
* A divider component for the menu.
|
473
|
+
*
|
474
|
+
* @see The {@link https://uds.build/docs/components/menu-divider Menu.Divider Docs} for more info
|
475
|
+
*
|
476
|
+
* @example
|
477
|
+
* ```tsx
|
478
|
+
* 'use client'; // Next.js client component
|
479
|
+
*
|
480
|
+
* import { Menu, Button } from "@yahoo/uds";
|
481
|
+
*
|
482
|
+
* export function DividerExample() {
|
483
|
+
* return (
|
484
|
+
* <Menu>
|
485
|
+
* <Menu.Trigger asChild>
|
486
|
+
* <Button>Menu Options</Button>
|
487
|
+
* </Menu.Trigger>
|
488
|
+
* <Menu.Content>
|
489
|
+
* <Menu.Item>Calendar</Menu.Item>
|
490
|
+
* <Menu.Divider>Other actions</Menu.Divider>
|
491
|
+
* <Menu.Item>Clipboard</Menu.Item>
|
492
|
+
* <Menu.Item active>Active Item</Menu.Item>
|
493
|
+
* </Menu.Content>
|
494
|
+
* </Menu>
|
495
|
+
* )
|
496
|
+
* }
|
497
|
+
* ```
|
498
|
+
*
|
499
|
+
* @usage
|
500
|
+
* Use MenuDivider to separate groups of menu items.
|
501
|
+
*
|
502
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item), [Divider](https://uds.build/docs/components/divider)
|
503
|
+
**/
|
504
|
+
declare const MenuDivider: react.ForwardRefExoticComponent<MenuDividerProps & react.RefAttributes<HTMLDivElement>>;
|
505
|
+
|
506
|
+
type HtmlButtonProps$1 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
|
507
|
+
interface PressableProps extends UniversalPressableProps, HtmlButtonProps$1 {
|
82
508
|
}
|
83
509
|
/**
|
84
510
|
* **🖲️ A primitive component for creating button interactions with accessibility support**
|
@@ -117,10 +543,447 @@ interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
|
|
117
543
|
*/
|
118
544
|
declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
|
119
545
|
|
546
|
+
interface MenuItemProps extends PressableProps, Omit<UniversalMenuItemProps, 'name'> {
|
547
|
+
/**
|
548
|
+
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
549
|
+
* If not provided, the closest [`Menu.Content`](https://uds.build/docs/components/menu#menu-content) or
|
550
|
+
* [`Menu.Provider`](https://uds.build/docs/components/menu#menu-provider) context will be used.
|
551
|
+
*/
|
552
|
+
store?: MenuItemProps$1['store'];
|
553
|
+
/**
|
554
|
+
* Determines if the menu should hide when this item is clicked.
|
555
|
+
*
|
556
|
+
* **Note**: This behavior isn't triggered if this menu item is rendered as a
|
557
|
+
* link and modifier keys are used to either open the link in a new tab or
|
558
|
+
* download it.
|
559
|
+
*
|
560
|
+
* @default true
|
561
|
+
*/
|
562
|
+
hideOnClick?: MenuItemProps$1['hideOnClick'];
|
563
|
+
/**
|
564
|
+
* The role of the menu item.
|
565
|
+
*
|
566
|
+
* @default 'menuitem'
|
567
|
+
*/
|
568
|
+
role?: AriaRole;
|
569
|
+
/** Internal overrides for downstream components. */
|
570
|
+
layerClassNames?: {
|
571
|
+
root?: string;
|
572
|
+
startIcon?: string;
|
573
|
+
endIcon?: string;
|
574
|
+
};
|
575
|
+
}
|
576
|
+
/**
|
577
|
+
* **📋 A Menu Item component for navigation and actions**
|
578
|
+
*
|
579
|
+
* @componentType Client component
|
580
|
+
*
|
581
|
+
* @description
|
582
|
+
* A standard menu item that can be used for navigation, actions, or displaying options in a menu.
|
583
|
+
* Menu items can be styled with active states, icons, and can trigger callbacks when clicked.
|
584
|
+
* They support both visual and functional customization.
|
585
|
+
*
|
586
|
+
* @see The {@link https://uds.build/docs/components/menu-item Menu.Item Docs} for more info
|
587
|
+
*
|
588
|
+
* @example
|
589
|
+
* ```tsx
|
590
|
+
* 'use client'; // Next.js client component
|
591
|
+
*
|
592
|
+
* import { Menu, Button } from "@yahoo/uds";
|
593
|
+
* import { Calendar, Clipboard } from "@yahoo/uds-icons";
|
594
|
+
*
|
595
|
+
* export function MenuItemExample() {
|
596
|
+
* return (
|
597
|
+
* <Menu.Provider>
|
598
|
+
* <Menu.Trigger asChild>
|
599
|
+
* <Button>Menu Options</Button>
|
600
|
+
* </Menu.Trigger>
|
601
|
+
* <Menu.Content>
|
602
|
+
* <Menu.Item startIcon={Calendar}>Calendar</Menu.Item>
|
603
|
+
* <Menu.Item startIcon={Clipboard} endIcon={DiagonalRightUp}>
|
604
|
+
* Clipboard
|
605
|
+
* </Menu.Item>
|
606
|
+
* <Menu.Item active>Active Item</Menu.Item>
|
607
|
+
* </Menu.Content>
|
608
|
+
* </Menu>
|
609
|
+
* )
|
610
|
+
* }
|
611
|
+
* ```
|
612
|
+
*
|
613
|
+
* @usage
|
614
|
+
* Use MenuItem for standard menu options that trigger actions or navigate to other parts of the application.
|
615
|
+
* The active prop can be used to highlight the currently selected item.
|
616
|
+
*
|
617
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
618
|
+
**/
|
619
|
+
declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLButtonElement>>;
|
620
|
+
|
621
|
+
type HtmlButtonProps = HTMLAttributes<HTMLButtonElement>;
|
622
|
+
interface MenuItemCheckboxProps extends PressableProps, HtmlButtonProps, UniversalMenuItemProps {
|
623
|
+
/**
|
624
|
+
* The name of the field in the
|
625
|
+
* [`values`](https://ariakit.org/reference/menu-provider#values) state.
|
626
|
+
*
|
627
|
+
* Live examples at [MenuItemCheckbox](https://ariakit.org/examples/menu-item-checkbox)
|
628
|
+
*/
|
629
|
+
name: string;
|
630
|
+
/**
|
631
|
+
* The controlled checked state of the element. It will set the menu
|
632
|
+
* [`values`](https://ariakit.org/reference/menu-provider#values) state if
|
633
|
+
* provided.
|
634
|
+
*/
|
635
|
+
checked?: boolean;
|
636
|
+
/**
|
637
|
+
* The default checked state of the element. It will set the default value in
|
638
|
+
* the menu [`values`](https://ariakit.org/reference/menu-provider#values)
|
639
|
+
* state if provided.
|
640
|
+
*/
|
641
|
+
defaultChecked?: boolean;
|
642
|
+
/**
|
643
|
+
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
644
|
+
* If not provided, the closest [`Menu.Content`](https://uds.build/docs/components/menu#menu-content) or
|
645
|
+
* [`Menu.Provider`](https://uds.build/docs/components/menu#menu-provider) context will be used.
|
646
|
+
*/
|
647
|
+
store?: MenuItemCheckboxProps$1['store'];
|
648
|
+
/**
|
649
|
+
* Determines if the menu should hide when this item is clicked.
|
650
|
+
*
|
651
|
+
* **Note**: This behavior isn't triggered if this menu item is rendered as a
|
652
|
+
* link and modifier keys are used to either open the link in a new tab or
|
653
|
+
* download it.
|
654
|
+
*
|
655
|
+
* @default undefined
|
656
|
+
*/
|
657
|
+
hideOnClick?: MenuItemCheckboxProps$1['hideOnClick'];
|
658
|
+
}
|
659
|
+
/**
|
660
|
+
* **✅ A Menu Item Checkbox component**
|
661
|
+
*
|
662
|
+
* @componentType Client component
|
663
|
+
*
|
664
|
+
* @description
|
665
|
+
* A checkable menu item that toggles between selected and unselected states. Menu item checkboxes
|
666
|
+
* allow users to select multiple options from a menu, displaying a checkmark when active. They maintain
|
667
|
+
* their state even when the menu is closed and reopened.
|
668
|
+
*
|
669
|
+
* @see The {@link https://uds.build/docs/components/menu-item-checkbox Menu.ItemCheckbox Docs} for more info
|
670
|
+
*
|
671
|
+
* @example
|
672
|
+
* ```tsx
|
673
|
+
* 'use client'; // Next.js client component
|
674
|
+
*
|
675
|
+
* import { Menu, Button } from "@yahoo/uds";
|
676
|
+
*
|
677
|
+
* export function MenuItemCheckboxExample() {
|
678
|
+
* return (
|
679
|
+
* <Menu.Provider>
|
680
|
+
* <Menu.Trigger asChild>
|
681
|
+
* <Button>Filter Options</Button>
|
682
|
+
* </Menu.Trigger>
|
683
|
+
* <Menu.Content>
|
684
|
+
* <Menu.ItemCheckbox name="showArchived" defaultChecked={false}>
|
685
|
+
* Show Archived
|
686
|
+
* </Menu.ItemCheckbox>
|
687
|
+
* <Menu.ItemCheckbox name="includeComments" defaultChecked={true}>
|
688
|
+
* Include Comments
|
689
|
+
* </Menu.ItemCheckbox>
|
690
|
+
* </Menu.Content>
|
691
|
+
* </Menu.Provider>
|
692
|
+
* )
|
693
|
+
* }
|
694
|
+
* ```
|
695
|
+
*
|
696
|
+
* @usage
|
697
|
+
* Use MenuItemCheckbox when you need to provide users with multiple selectable options within a menu.
|
698
|
+
* Unlike radio options, checkboxes allow for multiple simultaneous selections.
|
699
|
+
*
|
700
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
701
|
+
**/
|
702
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "active" | "as" | "hideEndIcon" | "rootProps"> & react.RefAttributes<HTMLButtonElement>>;
|
703
|
+
|
704
|
+
/** Valid vertical placement values for the menu */
|
705
|
+
type VerticalPlacement = 'top' | 'bottom';
|
706
|
+
/** Valid horizontal placement values for the menu */
|
707
|
+
type HorizontalPlacement = 'start' | 'end';
|
708
|
+
/** Combined placement values for menu positioning */
|
709
|
+
type MenuPlacement = VerticalPlacement | HorizontalPlacement | `${VerticalPlacement}-${HorizontalPlacement}` | `${HorizontalPlacement}-${VerticalPlacement}`;
|
710
|
+
type MenuProviderProps = PropsWithChildren<{
|
711
|
+
/**
|
712
|
+
* A callback that gets called when the
|
713
|
+
* [`values`](https://ariakit.org/reference/menu-provider#values) state
|
714
|
+
* changes.
|
715
|
+
*
|
716
|
+
* Live examples:
|
717
|
+
* - [`MenuItemCheckbox`](https://uds.build/docs/components/menu-item-checkbox).
|
718
|
+
*/
|
719
|
+
setValues?: (values: Record<string, boolean>) => void | MenuProviderProps$1['setValues'];
|
720
|
+
/**
|
721
|
+
* A map of names and values that will be used by the
|
722
|
+
* [`MenuItemCheckbox`](https://uds.build/docs/components/menu-item-checkbox).
|
723
|
+
*
|
724
|
+
* Live examples:
|
725
|
+
* - [MenuItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
726
|
+
*/
|
727
|
+
values?: MenuProviderProps$1['values'];
|
728
|
+
/**
|
729
|
+
* The placement of the Menu.Content.
|
730
|
+
*
|
731
|
+
* @default 'bottom'
|
732
|
+
*/
|
733
|
+
placement?: MenuPlacement;
|
734
|
+
/**
|
735
|
+
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
736
|
+
* If not provided, the closest [`Menu.Content`](https://uds.build/docs/components/menu#menu-content) or
|
737
|
+
* [`Menu.Provider`](https://uds.build/docs/components/menu#menu-provider) context will be used.
|
738
|
+
*/
|
739
|
+
store?: MenuProviderProps$1['store'];
|
740
|
+
/**
|
741
|
+
* Whether the menu should be rendered in RTL direction.
|
742
|
+
*
|
743
|
+
* This only affects the some component behavior behavior. You still need to set
|
744
|
+
* `dir="rtl"` on HTML/CSS.
|
745
|
+
* @default false
|
746
|
+
*/
|
747
|
+
rtl?: MenuProviderProps$1['rtl'];
|
748
|
+
/**
|
749
|
+
* Whether the content is visible.
|
750
|
+
* @default false
|
751
|
+
*/
|
752
|
+
open?: MenuProviderProps$1['open'];
|
753
|
+
/**
|
754
|
+
* A callback that gets called when the
|
755
|
+
* [`open`](https://ariakit.org/reference/disclosure-provider#open) state
|
756
|
+
* changes.
|
757
|
+
* @example
|
758
|
+
* const [open, setOpen] = useState(false);
|
759
|
+
* const disclosure = useDisclosureStore({ open, setOpen });
|
760
|
+
*/
|
761
|
+
setOpen?: MenuProviderProps$1['setOpen'];
|
762
|
+
/**
|
763
|
+
* Whether the content should be visible by default.
|
764
|
+
* @default false
|
765
|
+
*/
|
766
|
+
defaultOpen?: MenuProviderProps$1['defaultOpen'];
|
767
|
+
/**
|
768
|
+
* Determines how the focus behaves when the user reaches the end of the
|
769
|
+
* composite widget.
|
770
|
+
*
|
771
|
+
* Live examples:
|
772
|
+
* - [Command Menu](https://uds.build/docs/components/menu)
|
773
|
+
* @default false
|
774
|
+
*/
|
775
|
+
focusLoop?: MenuProviderProps$1['focusLoop'];
|
776
|
+
/**
|
777
|
+
* If enabled, moving to the next item from the last one in a row or column
|
778
|
+
* will focus on the first item in the next row or column and vice-versa.
|
779
|
+
* `true` wraps between rows and columns, `horizontal` wraps only between rows, and `vertical` wraps only between columns.
|
780
|
+
*
|
781
|
+
* @default false
|
782
|
+
*/
|
783
|
+
focusWrap?: MenuProviderProps$1['focusWrap'];
|
784
|
+
}>;
|
785
|
+
/**
|
786
|
+
* **🏗️ A Menu Provider component**
|
787
|
+
*
|
788
|
+
* @componentType Server component
|
789
|
+
*
|
790
|
+
* @description
|
791
|
+
* A provider component for the menu, which is used to provide the menu context to the menu items.
|
792
|
+
*
|
793
|
+
* @see The {@link https://uds.build/docs/components/menu-provider Menu.Provider Docs} for more info
|
794
|
+
*
|
795
|
+
* @example
|
796
|
+
* ```tsx
|
797
|
+
* 'use client'; // Next.js client component
|
798
|
+
*
|
799
|
+
* import { Menu, Button } from "@yahoo/uds";
|
800
|
+
* import { Calendar, Clipboard } from "@yahoo/uds-icons";
|
801
|
+
*
|
802
|
+
* export function MenuProviderExample() {
|
803
|
+
* return (
|
804
|
+
* <Menu.Provider>
|
805
|
+
* <Menu.Trigger asChild>
|
806
|
+
* <Button>Menu Options</Button>
|
807
|
+
* </Menu.Trigger>
|
808
|
+
* <Menu.Content>
|
809
|
+
* <Menu.Item startIcon={Calendar}>Calendar</Menu.Item>
|
810
|
+
* <Menu.Item startIcon={Clipboard} endIcon={DiagonalRightUp}>
|
811
|
+
* Clipboard
|
812
|
+
* </Menu.Item>
|
813
|
+
* <Menu.Item active>Active Item</Menu.Item>
|
814
|
+
* </Menu.Content>
|
815
|
+
* </Menu.Provider>
|
816
|
+
* )
|
817
|
+
* }
|
818
|
+
* ```
|
819
|
+
*
|
820
|
+
* @usage
|
821
|
+
* Use MenuItem for standard menu options that trigger actions or navigate to other parts of the application.
|
822
|
+
* The active prop can be used to highlight the currently selected item.
|
823
|
+
*
|
824
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
825
|
+
**/
|
826
|
+
declare const MenuProvider: ({ placement, rtl: explicitRtl, ...props }: MenuProviderProps) => react_jsx_runtime.JSX.Element;
|
827
|
+
|
828
|
+
interface MenuTriggerProps extends PressableProps {
|
829
|
+
/**
|
830
|
+
* When asChild is set to true, the component's child will be cloned and passed
|
831
|
+
* the props and behavior required to make it functional.
|
832
|
+
*/
|
833
|
+
asChild?: BoxProps['asChild'];
|
834
|
+
/**
|
835
|
+
* Object returned by the [`useMenuStore`](https://ariakit.org/reference/use-menu-store) hook.
|
836
|
+
* If not provided, the closest [`Menu.Content`](https://uds.build/docs/components/menu#menu-content) or
|
837
|
+
* [`Menu.Provider`](https://uds.build/docs/components/menu#menu-provider) context will be used.
|
838
|
+
*/
|
839
|
+
store?: MenuButtonProps['store'];
|
840
|
+
/**
|
841
|
+
* Determines if [Focusable](https://ariakit.org/components/focusable)
|
842
|
+
* features should be active on non-native focusable elements.
|
843
|
+
*
|
844
|
+
* **Note**: This prop only turns off the additional features provided by the
|
845
|
+
* [`Focusable`](https://ariakit.org/reference/focusable) component.
|
846
|
+
* Non-native focusable elements will lose their focusability entirely.
|
847
|
+
* However, native focusable elements will retain their inherent focusability,
|
848
|
+
* but without added features such as improved
|
849
|
+
* [`autoFocus`](https://ariakit.org/reference/focusable#autofocus),
|
850
|
+
* [`accessibleWhenDisabled`](https://ariakit.org/reference/focusable#accessiblewhendisabled),
|
851
|
+
* [`onFocusVisible`](https://ariakit.org/reference/focusable#onfocusvisible),
|
852
|
+
* etc.
|
853
|
+
* @default true
|
854
|
+
*/
|
855
|
+
focusable?: MenuButtonProps['focusable'];
|
856
|
+
}
|
857
|
+
/**
|
858
|
+
* **⚡ A Menu Trigger component**
|
859
|
+
*
|
860
|
+
* @componentType Server component
|
861
|
+
*
|
862
|
+
* @description
|
863
|
+
* A trigger component for the menu, which is used to toggle the menus open state.
|
864
|
+
*
|
865
|
+
* @see The {@link https://uds.build/docs/components/menu-trigger Menu.Trigger Docs} for more info
|
866
|
+
*
|
867
|
+
* @example
|
868
|
+
* ```tsx
|
869
|
+
* 'use client'; // Next.js client component
|
870
|
+
*
|
871
|
+
* import { Menu, Button } from "@yahoo/uds";
|
872
|
+
* import { Calendar, Clipboard } from "@yahoo/uds-icons";
|
873
|
+
*
|
874
|
+
* export function MenuProviderExample() {
|
875
|
+
* return (
|
876
|
+
* <Menu.Provider>
|
877
|
+
* <Menu.Trigger asChild>
|
878
|
+
* <Button>Menu Options</Button>
|
879
|
+
* </Menu.Trigger>
|
880
|
+
* <Menu.Content>
|
881
|
+
* <Menu.Item startIcon={Calendar}>Calendar</Menu.Item>
|
882
|
+
* <Menu.Item startIcon={Clipboard} endIcon={DiagonalRightUp}>
|
883
|
+
* Clipboard
|
884
|
+
* </Menu.Item>
|
885
|
+
* <Menu.Item active>Active Item</Menu.Item>
|
886
|
+
* </Menu.Content>
|
887
|
+
* </Menu.Provider>
|
888
|
+
* )
|
889
|
+
* }
|
890
|
+
* ```
|
891
|
+
*
|
892
|
+
* @usage
|
893
|
+
* Use MenuTrigger to toggle the open state of a menu.
|
894
|
+
*
|
895
|
+
* @related [Menu](https://uds.build/docs/components/menu), [Menu.ItemCheckbox](https://uds.build/docs/components/menu-item-checkbox)
|
896
|
+
**/
|
897
|
+
declare const MenuTrigger: react.ForwardRefExoticComponent<MenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
898
|
+
|
899
|
+
declare const Menu_index_useMenuContext: typeof useMenuContext;
|
900
|
+
declare const Menu_index_useMenuStore: typeof useMenuStore;
|
901
|
+
declare const Menu_index_useStoreState: typeof useStoreState;
|
902
|
+
declare namespace Menu_index {
|
903
|
+
export { MenuContent as Content, MenuDivider as Divider, MenuItem as Item, MenuItemCheckbox as ItemCheckbox, MenuProvider as Provider, MenuTrigger as Trigger, Menu_index_useMenuContext as useMenuContext, Menu_index_useMenuStore as useMenuStore, Menu_index_useStoreState as useStoreState };
|
904
|
+
}
|
905
|
+
|
906
|
+
type NativeInputProps$1 = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'value' | 'size' | 'height' | 'width' | 'color' | 'required'>;
|
907
|
+
interface RadioProps extends NativeInputProps$1, UniversalRadioProps {
|
908
|
+
}
|
909
|
+
/**
|
910
|
+
* **⚙️️ A Radio.
|
911
|
+
*
|
912
|
+
* @componentType Client component
|
913
|
+
*
|
914
|
+
* @description
|
915
|
+
* A radio component allows users to select one or multiple options from a set. Unlike checkbox, radio buttons cannot have multiple selected in a form, allowing only 1 selection in a group. It represents a binary state, typically as selected or unselected.
|
916
|
+
*
|
917
|
+
* @see
|
918
|
+
* Check out the {@link https://uds.build/docs/components/radio Radio Docs} for more info
|
919
|
+
*
|
920
|
+
* @usage
|
921
|
+
* - Forms: Radio
|
922
|
+
*
|
923
|
+
* @example
|
924
|
+
* ```tsx
|
925
|
+
* 'use client';
|
926
|
+
* import { Radio } from "@yahoo/uds";
|
927
|
+
*
|
928
|
+
* <Radio label="Name" />
|
929
|
+
*```
|
930
|
+
*
|
931
|
+
* @related [Radio](https://uds.build/docs/components/Radio).
|
932
|
+
**/
|
933
|
+
declare const Radio: react__default.ForwardRefExoticComponent<RadioProps & react__default.RefAttributes<HTMLInputElement>>;
|
934
|
+
|
935
|
+
type NativeDivProps = Omit<react__default.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>;
|
936
|
+
interface RadioGroupProviderProps extends UniversalRadioGroupProps, NativeDivProps {
|
937
|
+
}
|
938
|
+
/**
|
939
|
+
* **⚙️️ A RadioGroup that improves accessibility and provides a central component for state manangement.
|
940
|
+
*
|
941
|
+
* @componentType Client component
|
942
|
+
*
|
943
|
+
* @description
|
944
|
+
* Provides a radio group
|
945
|
+
*
|
946
|
+
* @see
|
947
|
+
* Check out the {@link https://uds.build/docs/components/radio Radio Docs} for more info
|
948
|
+
*
|
949
|
+
* @usage
|
950
|
+
* - Forms: RadioGroup
|
951
|
+
*
|
952
|
+
* @example
|
953
|
+
* ```tsx
|
954
|
+
* 'use client';
|
955
|
+
* import { RadioGroup } from "@yahoo/uds";
|
956
|
+
*
|
957
|
+
* <RadioGroup name="items" value="1">
|
958
|
+
* <Radio value="1" label="One" />
|
959
|
+
* <Radio value="2" label="Two" />
|
960
|
+
* </RadioGroup>
|
961
|
+
*```
|
962
|
+
*
|
963
|
+
* @related [Radio](https://uds.build/docs/components/radio).
|
964
|
+
**/
|
965
|
+
declare const RadioGroupProvider: react__default.ForwardRefExoticComponent<RadioGroupProviderProps & react__default.RefAttributes<HTMLDivElement>>;
|
966
|
+
|
120
967
|
interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | 'reducedMotion'> {
|
968
|
+
/**
|
969
|
+
* The layout variant to use for the motion config.
|
970
|
+
* @default 'subtle'
|
971
|
+
*/
|
121
972
|
layoutVariant?: MotionVariant;
|
973
|
+
/**
|
974
|
+
* The layout speed to use for the motion config.
|
975
|
+
* @default '3'
|
976
|
+
*/
|
122
977
|
layoutSpeed?: MotionVariantSpeed;
|
978
|
+
/**
|
979
|
+
* The color variant to use for the motion config.
|
980
|
+
* @default 'smooth'
|
981
|
+
*/
|
123
982
|
colorVariant?: MotionVariant;
|
983
|
+
/**
|
984
|
+
* The color speed to use for the motion config.
|
985
|
+
* @default '3'
|
986
|
+
*/
|
124
987
|
colorSpeed?: MotionVariantSpeed;
|
125
988
|
}
|
126
989
|
/**
|
@@ -134,4 +997,33 @@ interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | '
|
|
134
997
|
*/
|
135
998
|
declare function SpringMotionConfig({ reducedMotion, children, layoutVariant, layoutSpeed, colorVariant, colorSpeed, }: SpringMotionConfigProps): react_jsx_runtime.JSX.Element;
|
136
999
|
|
137
|
-
|
1000
|
+
type NativeInputProps = Omit<react__default.InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'size' | 'height' | 'width' | 'color' | 'defaultChecked' | 'children'>;
|
1001
|
+
interface SwitchProps extends NativeInputProps, UniversalSwitchProps {
|
1002
|
+
}
|
1003
|
+
/**
|
1004
|
+
* **⚙️️ An switch.
|
1005
|
+
*
|
1006
|
+
* @componentType Client component
|
1007
|
+
*
|
1008
|
+
* @description
|
1009
|
+
* A switch (also called a toggle) is a binary on/off input control. It is clickable or touchable on mobile devices allowing users to pick between two clearly opposite choices.
|
1010
|
+
*
|
1011
|
+
* @see
|
1012
|
+
* Check out the {@link https://uds.build/docs/components/switch Switch Docs} for more info
|
1013
|
+
*
|
1014
|
+
* @usage
|
1015
|
+
* - Forms: switch
|
1016
|
+
*
|
1017
|
+
* @example
|
1018
|
+
* ```tsx
|
1019
|
+
* 'use client';
|
1020
|
+
* import { Switch } from "@yahoo/uds";
|
1021
|
+
*
|
1022
|
+
* <Switch label="Name" required />
|
1023
|
+
*```
|
1024
|
+
*
|
1025
|
+
* @related [Checkbox](https://uds.build/docs/components/checkbox).
|
1026
|
+
**/
|
1027
|
+
declare const Switch: react__default.ForwardRefExoticComponent<SwitchProps & react__default.RefAttributes<HTMLInputElement>>;
|
1028
|
+
|
1029
|
+
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, Menu_index as Menu, type MenuContentProps, type MenuDividerProps, type MenuItemCheckboxProps, type MenuItemProps, type MenuPlacement, type MenuProviderProps, type MenuTriggerProps, Pressable, type PressableProps, Radio, RadioGroupProvider, type RadioGroupProviderProps, type RadioProps, SpringMotionConfig, type SpringMotionConfigProps, Switch, type SwitchProps };
|