@work-rjkashyap/unified-ui 0.1.0
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/CHANGELOG.md +152 -0
- package/README.md +365 -0
- package/dist/chunk-2JFREULQ.cjs +29 -0
- package/dist/chunk-2RGLRX6K.cjs +279 -0
- package/dist/chunk-3HHJAYQI.cjs +469 -0
- package/dist/chunk-5S5DMH5G.cjs +5983 -0
- package/dist/chunk-BIW2RPDU.cjs +73 -0
- package/dist/chunk-CWETOWRM.mjs +456 -0
- package/dist/chunk-ECIGDEAH.cjs +140 -0
- package/dist/chunk-EO4WROWH.mjs +432 -0
- package/dist/chunk-EZ2L3XPS.mjs +83 -0
- package/dist/chunk-I74E52C5.mjs +271 -0
- package/dist/chunk-ITBG42M5.mjs +133 -0
- package/dist/chunk-IWJ5VMZ7.mjs +323 -0
- package/dist/chunk-KHON2AEM.cjs +342 -0
- package/dist/chunk-LSNKPQP7.cjs +58 -0
- package/dist/chunk-M2LNQWOB.mjs +63 -0
- package/dist/chunk-NMPHV6ZD.mjs +27 -0
- package/dist/chunk-QXR4VY7Q.cjs +268 -0
- package/dist/chunk-SSGN5QDC.mjs +248 -0
- package/dist/chunk-X2WCY4VB.mjs +5836 -0
- package/dist/chunk-XCKK6P46.cjs +91 -0
- package/dist/chunk-ZBN26FLO.mjs +46 -0
- package/dist/chunk-ZPIPKY2J.cjs +478 -0
- package/dist/components.cjs +477 -0
- package/dist/components.d.cts +3077 -0
- package/dist/components.d.ts +3077 -0
- package/dist/components.mjs +4 -0
- package/dist/index.cjs +1027 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.mjs +17 -0
- package/dist/motion-D9wQbcKL.d.cts +80 -0
- package/dist/motion-D9wQbcKL.d.ts +80 -0
- package/dist/motion.cjs +216 -0
- package/dist/motion.d.cts +104 -0
- package/dist/motion.d.ts +104 -0
- package/dist/motion.mjs +3 -0
- package/dist/primitives.cjs +57 -0
- package/dist/primitives.d.cts +390 -0
- package/dist/primitives.d.ts +390 -0
- package/dist/primitives.mjs +4 -0
- package/dist/theme.cjs +38 -0
- package/dist/theme.d.cts +117 -0
- package/dist/theme.d.ts +117 -0
- package/dist/theme.mjs +5 -0
- package/dist/tokens.cjs +137 -0
- package/dist/tokens.d.cts +30 -0
- package/dist/tokens.d.ts +30 -0
- package/dist/tokens.mjs +4 -0
- package/dist/typography-DlvVjEdE.d.cts +146 -0
- package/dist/typography-DlvVjEdE.d.ts +146 -0
- package/dist/utils.cjs +164 -0
- package/dist/utils.d.cts +521 -0
- package/dist/utils.d.ts +521 -0
- package/dist/utils.mjs +3 -0
- package/dist/z-index-B_nTQ3qo.d.cts +422 -0
- package/dist/z-index-B_nTQ3qo.d.ts +422 -0
- package/package.json +183 -0
- package/styles.css +500 -0
|
@@ -0,0 +1,3077 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode, ElementType, HTMLAttributes } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
10
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
11
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
12
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
13
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
14
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
15
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
+
|
|
17
|
+
declare const accordionRootVariants: (props?: ({
|
|
18
|
+
variant?: "bordered" | "borderless" | null | undefined;
|
|
19
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
|
+
declare const accordionTriggerVariants: (props?: ({
|
|
21
|
+
size?: "sm" | "md" | null | undefined;
|
|
22
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
23
|
+
type AccordionVariant = "bordered" | "borderless";
|
|
24
|
+
type AccordionSize = "sm" | "md";
|
|
25
|
+
/**
|
|
26
|
+
* Props for a single-mode accordion (only one item open at a time).
|
|
27
|
+
*/
|
|
28
|
+
interface AccordionSingleProps extends Omit<ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>, "type" | "asChild">, VariantProps<typeof accordionRootVariants> {
|
|
29
|
+
type: "single";
|
|
30
|
+
/** Visual variant of the accordion. @default "bordered" */
|
|
31
|
+
variant?: AccordionVariant;
|
|
32
|
+
/** Size of the accordion items. @default "md" */
|
|
33
|
+
size?: AccordionSize;
|
|
34
|
+
/** Additional CSS classes. */
|
|
35
|
+
className?: string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Props for a multiple-mode accordion (multiple items can be open).
|
|
40
|
+
*/
|
|
41
|
+
interface AccordionMultipleProps extends Omit<ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>, "type" | "asChild">, VariantProps<typeof accordionRootVariants> {
|
|
42
|
+
type: "multiple";
|
|
43
|
+
/** Visual variant of the accordion. @default "bordered" */
|
|
44
|
+
variant?: AccordionVariant;
|
|
45
|
+
/** Size of the accordion items. @default "md" */
|
|
46
|
+
size?: AccordionSize;
|
|
47
|
+
/** Additional CSS classes. */
|
|
48
|
+
className?: string;
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
}
|
|
51
|
+
type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
52
|
+
interface AccordionItemProps extends ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
|
|
53
|
+
/** Additional CSS classes. */
|
|
54
|
+
className?: string;
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
interface AccordionTriggerProps extends ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> {
|
|
58
|
+
/** Additional CSS classes. */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Whether to hide the chevron icon. @default false */
|
|
61
|
+
hideChevron?: boolean;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
interface AccordionContentProps extends ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
|
|
65
|
+
/** Additional CSS classes. */
|
|
66
|
+
className?: string;
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Accordion — a vertically stacked set of interactive headings that each
|
|
71
|
+
* reveal a section of content.
|
|
72
|
+
*
|
|
73
|
+
* Built on Radix UI's Accordion primitive for full keyboard navigation
|
|
74
|
+
* and ARIA compliance. All colors, radii, and transitions come from CSS
|
|
75
|
+
* custom properties defined in design-system.css.
|
|
76
|
+
*
|
|
77
|
+
* Accessibility:
|
|
78
|
+
* - Radix handles `aria-expanded`, `aria-controls`, arrow key navigation
|
|
79
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
80
|
+
* - Disabled items are skipped in keyboard navigation
|
|
81
|
+
* - Supports both single and multiple expand modes
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* // Single mode (only one open at a time)
|
|
86
|
+
* <Accordion type="single" collapsible>
|
|
87
|
+
* <AccordionItem value="faq-1">
|
|
88
|
+
* <AccordionTrigger>What is Unified UI?</AccordionTrigger>
|
|
89
|
+
* <AccordionContent>
|
|
90
|
+
* A token-driven design system for React applications.
|
|
91
|
+
* </AccordionContent>
|
|
92
|
+
* </AccordionItem>
|
|
93
|
+
* </Accordion>
|
|
94
|
+
*
|
|
95
|
+
* // Multiple mode
|
|
96
|
+
* <Accordion type="multiple" variant="borderless" size="sm">
|
|
97
|
+
* <AccordionItem value="a">
|
|
98
|
+
* <AccordionTrigger>Section A</AccordionTrigger>
|
|
99
|
+
* <AccordionContent>Content A</AccordionContent>
|
|
100
|
+
* </AccordionItem>
|
|
101
|
+
* <AccordionItem value="b">
|
|
102
|
+
* <AccordionTrigger>Section B</AccordionTrigger>
|
|
103
|
+
* <AccordionContent>Content B</AccordionContent>
|
|
104
|
+
* </AccordionItem>
|
|
105
|
+
* </Accordion>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
109
|
+
/**
|
|
110
|
+
* AccordionItem — a single collapsible section within the Accordion.
|
|
111
|
+
*
|
|
112
|
+
* Must be used as a direct child of `Accordion`.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <AccordionItem value="unique-value">
|
|
117
|
+
* <AccordionTrigger>Click to expand</AccordionTrigger>
|
|
118
|
+
* <AccordionContent>Expanded content here</AccordionContent>
|
|
119
|
+
* </AccordionItem>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<AccordionItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
123
|
+
/**
|
|
124
|
+
* AccordionTrigger — the clickable heading that toggles an AccordionItem.
|
|
125
|
+
*
|
|
126
|
+
* Must be used inside an `AccordionItem`. Renders as a button within a
|
|
127
|
+
* heading element for proper accessibility semantics.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <AccordionTrigger>Frequently asked question?</AccordionTrigger>
|
|
132
|
+
* <AccordionTrigger hideChevron>No arrow here</AccordionTrigger>
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
declare const AccordionTrigger: react.ForwardRefExoticComponent<AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
136
|
+
/**
|
|
137
|
+
* AccordionContent — the collapsible content area of an AccordionItem.
|
|
138
|
+
*
|
|
139
|
+
* Uses CSS `animate-accordion-down` / `animate-accordion-up` keyframes
|
|
140
|
+
* for smooth expand/collapse animation. This relies on the Radix
|
|
141
|
+
* `--radix-accordion-content-height` CSS variable.
|
|
142
|
+
*
|
|
143
|
+
* Note: You must define the following keyframes and animation utilities
|
|
144
|
+
* in your Tailwind / CSS configuration for the animations to work:
|
|
145
|
+
*
|
|
146
|
+
* @keyframes accordion-down {
|
|
147
|
+
* from { height: 0; }
|
|
148
|
+
* to { height: var(--radix-accordion-content-height); }
|
|
149
|
+
* }
|
|
150
|
+
* @keyframes accordion-up {
|
|
151
|
+
* from { height: var(--radix-accordion-content-height); }
|
|
152
|
+
* to { height: 0; }
|
|
153
|
+
* }
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <AccordionContent>
|
|
158
|
+
* <p>This content expands and collapses smoothly.</p>
|
|
159
|
+
* </AccordionContent>
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
declare const AccordionContent: react.ForwardRefExoticComponent<AccordionContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
163
|
+
|
|
164
|
+
declare const alertVariants: (props?: ({
|
|
165
|
+
variant?: "info" | "success" | "warning" | "danger" | null | undefined;
|
|
166
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
167
|
+
type AlertVariant = "info" | "success" | "warning" | "danger";
|
|
168
|
+
interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof alertVariants> {
|
|
169
|
+
/**
|
|
170
|
+
* Semantic variant of the alert.
|
|
171
|
+
* Determines background color, text color, border, and default icon.
|
|
172
|
+
* @default "info"
|
|
173
|
+
*/
|
|
174
|
+
variant?: AlertVariant;
|
|
175
|
+
/**
|
|
176
|
+
* Title text displayed prominently at the top of the alert.
|
|
177
|
+
* When provided, the alert renders a two-line layout (title + description).
|
|
178
|
+
* When omitted, the alert renders a single-line layout (description only).
|
|
179
|
+
*/
|
|
180
|
+
title?: ReactNode;
|
|
181
|
+
/**
|
|
182
|
+
* Custom icon to display instead of the default variant icon.
|
|
183
|
+
* Pass `null` to hide the icon entirely.
|
|
184
|
+
* The icon is sized to match the alert's text and colored to match the variant.
|
|
185
|
+
*/
|
|
186
|
+
icon?: ReactNode | null;
|
|
187
|
+
/**
|
|
188
|
+
* Whether the alert can be dismissed/closed.
|
|
189
|
+
* When true, a close button (×) is rendered in the top-right corner.
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
dismissible?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Callback fired when the dismiss (close) button is clicked.
|
|
195
|
+
* Only relevant when `dismissible` is true.
|
|
196
|
+
* If not provided when `dismissible` is true, the alert manages its
|
|
197
|
+
* own visibility internally.
|
|
198
|
+
*/
|
|
199
|
+
onDismiss?: () => void;
|
|
200
|
+
/**
|
|
201
|
+
* Accessible label for the dismiss button.
|
|
202
|
+
* @default "Dismiss alert"
|
|
203
|
+
*/
|
|
204
|
+
dismissLabel?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The ARIA role for the alert element.
|
|
207
|
+
* - `"alert"` — for important messages that require immediate attention
|
|
208
|
+
* (assertive live region). Use for errors and critical warnings.
|
|
209
|
+
* - `"status"` — for informational messages that don't require immediate
|
|
210
|
+
* attention (polite live region). Use for success/info messages.
|
|
211
|
+
*
|
|
212
|
+
* @default "alert" for danger/warning, "status" for info/success
|
|
213
|
+
*/
|
|
214
|
+
role?: "alert" | "status";
|
|
215
|
+
/** Description content. Rendered as the alert body text. */
|
|
216
|
+
children?: ReactNode;
|
|
217
|
+
/** Additional CSS classes to merge on the root element. */
|
|
218
|
+
className?: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Alert — a static notification component for contextual feedback.
|
|
222
|
+
*
|
|
223
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
224
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
225
|
+
* defined in design-system.css.
|
|
226
|
+
*
|
|
227
|
+
* Alerts are non-interactive by default. They communicate important
|
|
228
|
+
* information to the user within the normal page flow (unlike Toast, which
|
|
229
|
+
* appears as an overlay). Use alerts for inline validation feedback, system
|
|
230
|
+
* status messages, and contextual tips.
|
|
231
|
+
*
|
|
232
|
+
* Accessibility:
|
|
233
|
+
* - Danger/warning alerts use `role="alert"` (assertive live region)
|
|
234
|
+
* - Info/success alerts use `role="status"` (polite live region)
|
|
235
|
+
* - Icon is decorative (`aria-hidden`) — variant meaning conveyed by text
|
|
236
|
+
* - Dismiss button has configurable `aria-label`
|
|
237
|
+
* - Color is never the sole indicator of meaning — icons + text provide
|
|
238
|
+
* redundant signaling
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```tsx
|
|
242
|
+
* // Info alert (default)
|
|
243
|
+
* <Alert title="Tip">
|
|
244
|
+
* You can press Ctrl+S to save your work at any time.
|
|
245
|
+
* </Alert>
|
|
246
|
+
*
|
|
247
|
+
* // Success alert
|
|
248
|
+
* <Alert variant="success" title="Payment received">
|
|
249
|
+
* Your order #12345 has been confirmed and is being processed.
|
|
250
|
+
* </Alert>
|
|
251
|
+
*
|
|
252
|
+
* // Warning alert
|
|
253
|
+
* <Alert variant="warning">
|
|
254
|
+
* Your session will expire in 5 minutes. Save your work.
|
|
255
|
+
* </Alert>
|
|
256
|
+
*
|
|
257
|
+
* // Danger alert (dismissible)
|
|
258
|
+
* <Alert
|
|
259
|
+
* variant="danger"
|
|
260
|
+
* title="Connection failed"
|
|
261
|
+
* dismissible
|
|
262
|
+
* onDismiss={() => setShowError(false)}
|
|
263
|
+
* >
|
|
264
|
+
* Unable to reach the server. Check your network connection and try again.
|
|
265
|
+
* </Alert>
|
|
266
|
+
*
|
|
267
|
+
* // Without title (single-line)
|
|
268
|
+
* <Alert variant="info">
|
|
269
|
+
* This feature is currently in beta.
|
|
270
|
+
* </Alert>
|
|
271
|
+
*
|
|
272
|
+
* // Custom icon
|
|
273
|
+
* <Alert variant="success" icon={<RocketIcon className="size-4" />}>
|
|
274
|
+
* Your app has been deployed successfully!
|
|
275
|
+
* </Alert>
|
|
276
|
+
*
|
|
277
|
+
* // No icon
|
|
278
|
+
* <Alert variant="warning" icon={null}>
|
|
279
|
+
* Maintenance scheduled for tomorrow at 3:00 AM UTC.
|
|
280
|
+
* </Alert>
|
|
281
|
+
*
|
|
282
|
+
* // Self-managed dismissible (no onDismiss callback)
|
|
283
|
+
* <Alert variant="info" dismissible>
|
|
284
|
+
* This alert will hide itself when dismissed.
|
|
285
|
+
* </Alert>
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
|
|
289
|
+
|
|
290
|
+
declare const avatarVariants: (props?: ({
|
|
291
|
+
size?: "sm" | "md" | "xs" | "lg" | "xl" | null | undefined;
|
|
292
|
+
shape?: "circle" | "square" | null | undefined;
|
|
293
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
294
|
+
type AvatarStatus = "online" | "offline" | "busy" | "away";
|
|
295
|
+
type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
296
|
+
type AvatarShape = "circle" | "square";
|
|
297
|
+
interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof avatarVariants> {
|
|
298
|
+
/**
|
|
299
|
+
* Image source URL for the avatar.
|
|
300
|
+
* When provided, the component renders an `<img>` element.
|
|
301
|
+
* If the image fails to load, it falls back to initials or icon.
|
|
302
|
+
*/
|
|
303
|
+
src?: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* Alt text for the avatar image.
|
|
306
|
+
* Required for accessibility when `src` is provided.
|
|
307
|
+
* Also used as tooltip/title text.
|
|
308
|
+
*/
|
|
309
|
+
alt?: string;
|
|
310
|
+
/**
|
|
311
|
+
* Full name of the user. Used to:
|
|
312
|
+
* 1. Generate initials for the fallback display
|
|
313
|
+
* 2. Provide alt text if `alt` is not explicitly set
|
|
314
|
+
*
|
|
315
|
+
* Initials are derived from the first letter of the first and last
|
|
316
|
+
* name segments (e.g. "Jane Doe" → "JD", "Alice" → "A").
|
|
317
|
+
*/
|
|
318
|
+
name?: string;
|
|
319
|
+
/**
|
|
320
|
+
* Size of the avatar.
|
|
321
|
+
* @default "md"
|
|
322
|
+
*/
|
|
323
|
+
size?: AvatarSize;
|
|
324
|
+
/**
|
|
325
|
+
* Shape of the avatar.
|
|
326
|
+
* @default "circle"
|
|
327
|
+
*/
|
|
328
|
+
shape?: AvatarShape;
|
|
329
|
+
/**
|
|
330
|
+
* Status indicator displayed as a colored dot on the avatar.
|
|
331
|
+
* Position is automatically adjusted based on the avatar size.
|
|
332
|
+
*/
|
|
333
|
+
status?: AvatarStatus;
|
|
334
|
+
/**
|
|
335
|
+
* Custom accessible label for the status indicator.
|
|
336
|
+
* Overrides the default label derived from the status value.
|
|
337
|
+
*/
|
|
338
|
+
statusLabel?: string;
|
|
339
|
+
/**
|
|
340
|
+
* Custom fallback icon to display when no `src` or `name` is provided.
|
|
341
|
+
* Defaults to a generic user silhouette SVG.
|
|
342
|
+
*/
|
|
343
|
+
fallbackIcon?: ReactNode;
|
|
344
|
+
/**
|
|
345
|
+
* Custom background color class for the fallback state.
|
|
346
|
+
* Useful for generating unique colors per user.
|
|
347
|
+
*
|
|
348
|
+
* @example "bg-indigo-100 text-indigo-700"
|
|
349
|
+
*/
|
|
350
|
+
fallbackClassName?: string;
|
|
351
|
+
/** Additional CSS classes to merge on the root element. */
|
|
352
|
+
className?: string;
|
|
353
|
+
/** Content to render inside the avatar (overrides all fallback logic). */
|
|
354
|
+
children?: ReactNode;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Avatar — displays a user's profile image, initials, or a fallback icon.
|
|
358
|
+
*
|
|
359
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
360
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
361
|
+
* defined in design-system.css.
|
|
362
|
+
*
|
|
363
|
+
* The component automatically handles image loading and gracefully falls
|
|
364
|
+
* back to initials (derived from `name`) or a default user icon.
|
|
365
|
+
*
|
|
366
|
+
* Accessibility:
|
|
367
|
+
* - Images include `alt` text (falls back to `name` if not provided)
|
|
368
|
+
* - Fallback initials container has `role="img"` and `aria-label`
|
|
369
|
+
* - Status dot has `role="status"` and descriptive `aria-label`
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```tsx
|
|
373
|
+
* // With image
|
|
374
|
+
* <Avatar src="/photo.jpg" alt="Jane Doe" />
|
|
375
|
+
*
|
|
376
|
+
* // Initials fallback
|
|
377
|
+
* <Avatar name="Jane Doe" />
|
|
378
|
+
* <Avatar name="Jane Doe" size="lg" />
|
|
379
|
+
*
|
|
380
|
+
* // With status indicator
|
|
381
|
+
* <Avatar src="/photo.jpg" alt="Jane" status="online" />
|
|
382
|
+
* <Avatar name="Bob" status="busy" />
|
|
383
|
+
* <Avatar name="Charlie" status="away" size="sm" />
|
|
384
|
+
*
|
|
385
|
+
* // Square shape (for orgs/apps)
|
|
386
|
+
* <Avatar src="/logo.png" alt="Acme Inc" shape="square" />
|
|
387
|
+
*
|
|
388
|
+
* // All sizes
|
|
389
|
+
* <Avatar name="A" size="xs" />
|
|
390
|
+
* <Avatar name="A" size="sm" />
|
|
391
|
+
* <Avatar name="A" size="md" />
|
|
392
|
+
* <Avatar name="A" size="lg" />
|
|
393
|
+
* <Avatar name="A" size="xl" />
|
|
394
|
+
*
|
|
395
|
+
* // Custom fallback styling
|
|
396
|
+
* <Avatar name="Jane" fallbackClassName="bg-indigo-100 text-indigo-700" />
|
|
397
|
+
*
|
|
398
|
+
* // Custom fallback icon
|
|
399
|
+
* <Avatar fallbackIcon={<BotIcon className="size-[60%]" />} />
|
|
400
|
+
*
|
|
401
|
+
* // Custom children (overrides all fallback logic)
|
|
402
|
+
* <Avatar>
|
|
403
|
+
* <span>🎉</span>
|
|
404
|
+
* </Avatar>
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
|
|
408
|
+
interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
409
|
+
/**
|
|
410
|
+
* Maximum number of avatars to display before showing the "+N" overflow.
|
|
411
|
+
* Set to `0` or `Infinity` to disable truncation.
|
|
412
|
+
* @default 5
|
|
413
|
+
*/
|
|
414
|
+
max?: number;
|
|
415
|
+
/**
|
|
416
|
+
* Size applied to all child avatars and the overflow indicator.
|
|
417
|
+
* Overrides the `size` prop on individual Avatar children.
|
|
418
|
+
* @default "md"
|
|
419
|
+
*/
|
|
420
|
+
size?: AvatarSize;
|
|
421
|
+
/**
|
|
422
|
+
* Shape applied to all child avatars and the overflow indicator.
|
|
423
|
+
* Overrides the `shape` prop on individual Avatar children.
|
|
424
|
+
* @default "circle"
|
|
425
|
+
*/
|
|
426
|
+
shape?: AvatarShape;
|
|
427
|
+
/**
|
|
428
|
+
* Spacing between overlapping avatars (as a negative margin).
|
|
429
|
+
* @default "default" — uses size-appropriate overlap
|
|
430
|
+
*/
|
|
431
|
+
spacing?: "tight" | "default" | "loose";
|
|
432
|
+
/** Content — should be Avatar components. */
|
|
433
|
+
children?: ReactNode;
|
|
434
|
+
/** Additional CSS classes to merge on the wrapper. */
|
|
435
|
+
className?: string;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* AvatarGroup — stacks multiple avatars with overlap and "+N" overflow.
|
|
439
|
+
*
|
|
440
|
+
* Renders child Avatar components in a horizontal stack with negative
|
|
441
|
+
* margins for overlap. When the number of children exceeds `max`, the
|
|
442
|
+
* excess avatars are hidden and a "+N" overflow indicator is shown.
|
|
443
|
+
*
|
|
444
|
+
* The group enforces consistent `size` and `shape` across all children
|
|
445
|
+
* by cloning them with the group's props.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```tsx
|
|
449
|
+
* // Basic group
|
|
450
|
+
* <AvatarGroup>
|
|
451
|
+
* <Avatar src="/a.jpg" alt="Alice" />
|
|
452
|
+
* <Avatar src="/b.jpg" alt="Bob" />
|
|
453
|
+
* <Avatar name="Charlie" />
|
|
454
|
+
* </AvatarGroup>
|
|
455
|
+
*
|
|
456
|
+
* // With max and overflow
|
|
457
|
+
* <AvatarGroup max={3}>
|
|
458
|
+
* <Avatar name="Alice" />
|
|
459
|
+
* <Avatar name="Bob" />
|
|
460
|
+
* <Avatar name="Charlie" />
|
|
461
|
+
* <Avatar name="Diana" />
|
|
462
|
+
* <Avatar name="Eve" />
|
|
463
|
+
* </AvatarGroup>
|
|
464
|
+
* // Renders: [Alice] [Bob] [Charlie] [+2]
|
|
465
|
+
*
|
|
466
|
+
* // Custom size and spacing
|
|
467
|
+
* <AvatarGroup size="lg" spacing="tight">
|
|
468
|
+
* <Avatar name="A" />
|
|
469
|
+
* <Avatar name="B" />
|
|
470
|
+
* <Avatar name="C" />
|
|
471
|
+
* </AvatarGroup>
|
|
472
|
+
*
|
|
473
|
+
* // Square group (for org logos)
|
|
474
|
+
* <AvatarGroup shape="square" size="sm">
|
|
475
|
+
* <Avatar src="/logo1.png" alt="Org 1" />
|
|
476
|
+
* <Avatar src="/logo2.png" alt="Org 2" />
|
|
477
|
+
* </AvatarGroup>
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
declare const AvatarGroup: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
481
|
+
|
|
482
|
+
declare const badgeVariants: (props?: ({
|
|
483
|
+
variant?: "info" | "success" | "warning" | "danger" | "default" | "primary" | "outline" | null | undefined;
|
|
484
|
+
size?: "sm" | "md" | null | undefined;
|
|
485
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
486
|
+
type BadgeVariant = "default" | "primary" | "success" | "warning" | "danger" | "info" | "outline";
|
|
487
|
+
type BadgeSize = "sm" | "md";
|
|
488
|
+
interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof badgeVariants> {
|
|
489
|
+
/**
|
|
490
|
+
* Visual variant of the badge.
|
|
491
|
+
* @default "default"
|
|
492
|
+
*/
|
|
493
|
+
variant?: BadgeVariant;
|
|
494
|
+
/**
|
|
495
|
+
* Size of the badge.
|
|
496
|
+
* @default "md"
|
|
497
|
+
*/
|
|
498
|
+
size?: BadgeSize;
|
|
499
|
+
/**
|
|
500
|
+
* Whether to show a colored dot indicator before the text.
|
|
501
|
+
* Useful for status indicators (online/offline, active/inactive).
|
|
502
|
+
* The dot color automatically matches the badge variant.
|
|
503
|
+
* @default false
|
|
504
|
+
*/
|
|
505
|
+
dot?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Whether the badge can be dismissed/removed.
|
|
508
|
+
* When true, a small "×" button is rendered after the text.
|
|
509
|
+
* @default false
|
|
510
|
+
*/
|
|
511
|
+
removable?: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* Callback fired when the remove (×) button is clicked.
|
|
514
|
+
* Only relevant when `removable` is true.
|
|
515
|
+
*/
|
|
516
|
+
onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
517
|
+
/**
|
|
518
|
+
* Accessible label for the remove button.
|
|
519
|
+
* Screen readers will announce this when the remove button is focused.
|
|
520
|
+
* @default "Remove"
|
|
521
|
+
*/
|
|
522
|
+
removeLabel?: string;
|
|
523
|
+
/**
|
|
524
|
+
* The HTML element or component to render as.
|
|
525
|
+
* @default "span"
|
|
526
|
+
*/
|
|
527
|
+
as?: ElementType;
|
|
528
|
+
/**
|
|
529
|
+
* Icon to display before the text (after the dot if both are present).
|
|
530
|
+
* Typically a small Lucide icon.
|
|
531
|
+
*/
|
|
532
|
+
icon?: ReactNode;
|
|
533
|
+
/** Content to render inside the badge. */
|
|
534
|
+
children?: ReactNode;
|
|
535
|
+
/** Additional CSS classes to merge. */
|
|
536
|
+
className?: string;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Badge — a compact inline label for categorization, status, and metadata.
|
|
540
|
+
*
|
|
541
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
542
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
543
|
+
* defined in design-system.css.
|
|
544
|
+
*
|
|
545
|
+
* Badges are non-interactive by default (rendered as `<span>`). For
|
|
546
|
+
* clickable badges, use `as="button"` or `as="a"` and add appropriate
|
|
547
|
+
* event handlers.
|
|
548
|
+
*
|
|
549
|
+
* Accessibility:
|
|
550
|
+
* - Color is never the sole means of conveying information — use text labels
|
|
551
|
+
* - Dot indicators are decorative (`aria-hidden`)
|
|
552
|
+
* - Remove button has a configurable `aria-label` (defaults to "Remove")
|
|
553
|
+
* - Semantic colors meet WCAG AA contrast on their muted backgrounds
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* ```tsx
|
|
557
|
+
* // Basic variants
|
|
558
|
+
* <Badge>Default</Badge>
|
|
559
|
+
* <Badge variant="primary">Primary</Badge>
|
|
560
|
+
* <Badge variant="success">Active</Badge>
|
|
561
|
+
* <Badge variant="warning">Pending</Badge>
|
|
562
|
+
* <Badge variant="danger">Critical</Badge>
|
|
563
|
+
* <Badge variant="info">New</Badge>
|
|
564
|
+
* <Badge variant="outline">Draft</Badge>
|
|
565
|
+
*
|
|
566
|
+
* // Sizes
|
|
567
|
+
* <Badge size="sm">Small</Badge>
|
|
568
|
+
* <Badge size="md">Medium</Badge>
|
|
569
|
+
*
|
|
570
|
+
* // Dot indicator (status badges)
|
|
571
|
+
* <Badge variant="success" dot>Online</Badge>
|
|
572
|
+
* <Badge variant="danger" dot>Offline</Badge>
|
|
573
|
+
* <Badge variant="warning" dot>Away</Badge>
|
|
574
|
+
*
|
|
575
|
+
* // With icon
|
|
576
|
+
* <Badge variant="info" icon={<StarIcon className="size-3" />}>
|
|
577
|
+
* Featured
|
|
578
|
+
* </Badge>
|
|
579
|
+
*
|
|
580
|
+
* // Removable
|
|
581
|
+
* <Badge variant="primary" removable onRemove={handleRemove}>
|
|
582
|
+
* Tag Name
|
|
583
|
+
* </Badge>
|
|
584
|
+
*
|
|
585
|
+
* // Custom remove label for accessibility
|
|
586
|
+
* <Badge
|
|
587
|
+
* variant="danger"
|
|
588
|
+
* removable
|
|
589
|
+
* onRemove={handleRemove}
|
|
590
|
+
* removeLabel="Remove critical alert"
|
|
591
|
+
* >
|
|
592
|
+
* Alert
|
|
593
|
+
* </Badge>
|
|
594
|
+
*
|
|
595
|
+
* // As a link
|
|
596
|
+
* <Badge as="a" href="/category/react" variant="primary">
|
|
597
|
+
* React
|
|
598
|
+
* </Badge>
|
|
599
|
+
*
|
|
600
|
+
* // As a button
|
|
601
|
+
* <Badge as="button" variant="outline" onClick={handleClick}>
|
|
602
|
+
* Filter
|
|
603
|
+
* </Badge>
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
607
|
+
|
|
608
|
+
interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
609
|
+
/**
|
|
610
|
+
* Custom separator to render between items.
|
|
611
|
+
* Defaults to a chevron-right icon.
|
|
612
|
+
*/
|
|
613
|
+
separator?: ReactNode;
|
|
614
|
+
/**
|
|
615
|
+
* Accessible label for the breadcrumb navigation landmark.
|
|
616
|
+
* @default "Breadcrumb"
|
|
617
|
+
*/
|
|
618
|
+
"aria-label"?: string;
|
|
619
|
+
/** Additional CSS classes. */
|
|
620
|
+
className?: string;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Breadcrumb — the root `<nav>` container for breadcrumb navigation.
|
|
624
|
+
*
|
|
625
|
+
* Wraps children in a semantic navigation landmark. Use with
|
|
626
|
+
* `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, etc.
|
|
627
|
+
*/
|
|
628
|
+
declare const Breadcrumb: react.ForwardRefExoticComponent<BreadcrumbProps & react.RefAttributes<HTMLElement>>;
|
|
629
|
+
interface BreadcrumbListProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
630
|
+
/** Additional CSS classes. */
|
|
631
|
+
className?: string;
|
|
632
|
+
/** List children. */
|
|
633
|
+
children?: ReactNode;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* BreadcrumbList — an ordered list containing breadcrumb items.
|
|
637
|
+
*/
|
|
638
|
+
declare const BreadcrumbList: react.ForwardRefExoticComponent<BreadcrumbListProps & react.RefAttributes<HTMLOListElement>>;
|
|
639
|
+
interface BreadcrumbItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
640
|
+
/** Additional CSS classes. */
|
|
641
|
+
className?: string;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* BreadcrumbItem — a single item in the breadcrumb trail.
|
|
645
|
+
*/
|
|
646
|
+
declare const BreadcrumbItem: react.ForwardRefExoticComponent<BreadcrumbItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
647
|
+
interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
648
|
+
/** Additional CSS classes. */
|
|
649
|
+
className?: string;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* BreadcrumbLink — a navigable link within a breadcrumb item.
|
|
653
|
+
*
|
|
654
|
+
* Renders as an `<a>` element. For framework-specific link components
|
|
655
|
+
* (e.g. Next.js `Link`), wrap the framework component or pass it via
|
|
656
|
+
* composition:
|
|
657
|
+
*
|
|
658
|
+
* ```tsx
|
|
659
|
+
* <BreadcrumbItem>
|
|
660
|
+
* <Link href="/docs" className="...breadcrumb link styles...">Docs</Link>
|
|
661
|
+
* </BreadcrumbItem>
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
declare const BreadcrumbLink: react.ForwardRefExoticComponent<BreadcrumbLinkProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
665
|
+
interface BreadcrumbPageProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
666
|
+
/** Additional CSS classes. */
|
|
667
|
+
className?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* BreadcrumbPage — the current (non-linked) page in the breadcrumb trail.
|
|
671
|
+
*
|
|
672
|
+
* Rendered with `aria-current="page"` and a distinct foreground color
|
|
673
|
+
* to indicate the user's current location.
|
|
674
|
+
*/
|
|
675
|
+
declare const BreadcrumbPage: react.ForwardRefExoticComponent<BreadcrumbPageProps & react.RefAttributes<HTMLSpanElement>>;
|
|
676
|
+
interface BreadcrumbSeparatorProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
677
|
+
/** Custom separator content. Defaults to a chevron-right icon. */
|
|
678
|
+
children?: ReactNode;
|
|
679
|
+
/** Additional CSS classes. */
|
|
680
|
+
className?: string;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* BreadcrumbSeparator — visual divider between breadcrumb items.
|
|
684
|
+
*
|
|
685
|
+
* Defaults to a chevron-right icon. Pass custom children (string or
|
|
686
|
+
* ReactNode) to use a different separator.
|
|
687
|
+
*/
|
|
688
|
+
declare const BreadcrumbSeparator: react.ForwardRefExoticComponent<BreadcrumbSeparatorProps & react.RefAttributes<HTMLLIElement>>;
|
|
689
|
+
interface BreadcrumbEllipsisProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
690
|
+
/** Additional CSS classes. */
|
|
691
|
+
className?: string;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* BreadcrumbEllipsis — a "…" placeholder indicating truncated items.
|
|
695
|
+
*
|
|
696
|
+
* Used by `BreadcrumbNav` when items exceed `maxItems`. Can also be
|
|
697
|
+
* used manually in the composable API.
|
|
698
|
+
*/
|
|
699
|
+
declare const BreadcrumbEllipsis: react.ForwardRefExoticComponent<BreadcrumbEllipsisProps & react.RefAttributes<HTMLSpanElement>>;
|
|
700
|
+
interface BreadcrumbNavItem {
|
|
701
|
+
/** Display label for the breadcrumb segment. */
|
|
702
|
+
label: ReactNode;
|
|
703
|
+
/**
|
|
704
|
+
* URL to navigate to. When omitted, the item is rendered as the
|
|
705
|
+
* current page (non-linked, last item).
|
|
706
|
+
*/
|
|
707
|
+
href?: string;
|
|
708
|
+
}
|
|
709
|
+
interface BreadcrumbNavProps extends Omit<BreadcrumbProps, "children"> {
|
|
710
|
+
/** Breadcrumb items in order from root to current page. */
|
|
711
|
+
items: BreadcrumbNavItem[];
|
|
712
|
+
/**
|
|
713
|
+
* Maximum number of items to show before collapsing middle items
|
|
714
|
+
* into an ellipsis. Set to 0 or Infinity to disable truncation.
|
|
715
|
+
*
|
|
716
|
+
* When truncating, the first item and the last `maxItems - 2` items
|
|
717
|
+
* are always visible, with an ellipsis in between.
|
|
718
|
+
*
|
|
719
|
+
* @default Infinity (no truncation)
|
|
720
|
+
*/
|
|
721
|
+
maxItems?: number;
|
|
722
|
+
/**
|
|
723
|
+
* Custom separator to use between items.
|
|
724
|
+
* @default <ChevronRightIcon /> (via BreadcrumbSeparator)
|
|
725
|
+
*/
|
|
726
|
+
separator?: ReactNode;
|
|
727
|
+
/** Additional CSS classes on the root nav. */
|
|
728
|
+
className?: string;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* BreadcrumbNav — a composed breadcrumb component that renders a full
|
|
732
|
+
* breadcrumb trail from an array of items.
|
|
733
|
+
*
|
|
734
|
+
* Handles separator insertion, truncation with ellipsis, and
|
|
735
|
+
* current-page detection automatically.
|
|
736
|
+
*
|
|
737
|
+
* @example
|
|
738
|
+
* ```tsx
|
|
739
|
+
* <BreadcrumbNav
|
|
740
|
+
* items={[
|
|
741
|
+
* { label: "Home", href: "/" },
|
|
742
|
+
* { label: "Products", href: "/products" },
|
|
743
|
+
* { label: "Electronics", href: "/products/electronics" },
|
|
744
|
+
* { label: "Laptops", href: "/products/electronics/laptops" },
|
|
745
|
+
* { label: "MacBook Pro" },
|
|
746
|
+
* ]}
|
|
747
|
+
* maxItems={4}
|
|
748
|
+
* />
|
|
749
|
+
* // Renders: Home > … > Laptops > MacBook Pro
|
|
750
|
+
*
|
|
751
|
+
* <BreadcrumbNav
|
|
752
|
+
* items={[
|
|
753
|
+
* { label: "Home", href: "/" },
|
|
754
|
+
* { label: "Docs", href: "/docs" },
|
|
755
|
+
* { label: "Getting Started" },
|
|
756
|
+
* ]}
|
|
757
|
+
* />
|
|
758
|
+
* // Renders: Home > Docs > Getting Started
|
|
759
|
+
* ```
|
|
760
|
+
*/
|
|
761
|
+
declare const BreadcrumbNav: react.ForwardRefExoticComponent<BreadcrumbNavProps & react.RefAttributes<HTMLElement>>;
|
|
762
|
+
|
|
763
|
+
declare const buttonVariants: (props?: ({
|
|
764
|
+
variant?: "danger" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
765
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
766
|
+
fullWidth?: boolean | null | undefined;
|
|
767
|
+
iconOnly?: boolean | null | undefined;
|
|
768
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
769
|
+
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
770
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
771
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "disabled">, VariantProps<typeof buttonVariants> {
|
|
772
|
+
/**
|
|
773
|
+
* Visual variant of the button.
|
|
774
|
+
* @default "primary"
|
|
775
|
+
*/
|
|
776
|
+
variant?: ButtonVariant;
|
|
777
|
+
/**
|
|
778
|
+
* Size of the button.
|
|
779
|
+
* @default "md"
|
|
780
|
+
*/
|
|
781
|
+
size?: ButtonSize;
|
|
782
|
+
/**
|
|
783
|
+
* Whether the button stretches to fill its container.
|
|
784
|
+
* @default false
|
|
785
|
+
*/
|
|
786
|
+
fullWidth?: boolean;
|
|
787
|
+
/**
|
|
788
|
+
* Whether the button is in a loading state.
|
|
789
|
+
* When true, the button is disabled and shows a spinner.
|
|
790
|
+
* @default false
|
|
791
|
+
*/
|
|
792
|
+
loading?: boolean;
|
|
793
|
+
/**
|
|
794
|
+
* Text to display alongside the spinner during loading.
|
|
795
|
+
* If not provided, the original children are hidden and only
|
|
796
|
+
* the spinner is shown.
|
|
797
|
+
*/
|
|
798
|
+
loadingText?: string;
|
|
799
|
+
/**
|
|
800
|
+
* Icon to display before the button label.
|
|
801
|
+
*/
|
|
802
|
+
iconLeft?: ReactNode;
|
|
803
|
+
/**
|
|
804
|
+
* Icon to display after the button label.
|
|
805
|
+
*/
|
|
806
|
+
iconRight?: ReactNode;
|
|
807
|
+
/**
|
|
808
|
+
* Whether this is an icon-only button (no text label).
|
|
809
|
+
* Ensures the button is square and properly sized.
|
|
810
|
+
* When true, you MUST provide an `aria-label` for accessibility.
|
|
811
|
+
* @default false
|
|
812
|
+
*/
|
|
813
|
+
iconOnly?: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* Whether the button is disabled.
|
|
816
|
+
* @default false
|
|
817
|
+
*/
|
|
818
|
+
disabled?: boolean;
|
|
819
|
+
/**
|
|
820
|
+
* The HTML element or component to render as.
|
|
821
|
+
* Useful for rendering as an anchor (<a>) or Next.js <Link>.
|
|
822
|
+
* @default "button"
|
|
823
|
+
*/
|
|
824
|
+
as?: ElementType;
|
|
825
|
+
/** Content to render inside the button. */
|
|
826
|
+
children?: ReactNode;
|
|
827
|
+
/** Additional CSS classes to merge. */
|
|
828
|
+
className?: string;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Button — the primary interactive element for triggering actions.
|
|
832
|
+
*
|
|
833
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
834
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
835
|
+
* defined in design-system.css.
|
|
836
|
+
*
|
|
837
|
+
* Accessibility:
|
|
838
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
839
|
+
* - Disabled state uses both `disabled` attribute and `aria-disabled`
|
|
840
|
+
* - Loading state sets `aria-busy="true"` and disables interaction
|
|
841
|
+
* - Icon-only buttons require `aria-label`
|
|
842
|
+
*
|
|
843
|
+
* @example
|
|
844
|
+
* ```tsx
|
|
845
|
+
* // Primary action
|
|
846
|
+
* <Button variant="primary" onClick={handleSave}>
|
|
847
|
+
* Save Changes
|
|
848
|
+
* </Button>
|
|
849
|
+
*
|
|
850
|
+
* // Secondary with icon
|
|
851
|
+
* <Button variant="secondary" iconLeft={<PlusIcon className="size-4" />}>
|
|
852
|
+
* Add Item
|
|
853
|
+
* </Button>
|
|
854
|
+
*
|
|
855
|
+
* // Loading state
|
|
856
|
+
* <Button variant="primary" loading loadingText="Saving...">
|
|
857
|
+
* Save
|
|
858
|
+
* </Button>
|
|
859
|
+
*
|
|
860
|
+
* // Icon-only
|
|
861
|
+
* <Button variant="ghost" iconOnly aria-label="Close">
|
|
862
|
+
* <XIcon className="size-4" />
|
|
863
|
+
* </Button>
|
|
864
|
+
*
|
|
865
|
+
* // Danger / destructive
|
|
866
|
+
* <Button variant="danger" onClick={handleDelete}>
|
|
867
|
+
* Delete Account
|
|
868
|
+
* </Button>
|
|
869
|
+
*
|
|
870
|
+
* // Rendered as anchor
|
|
871
|
+
* <Button as="a" href="/login" variant="secondary">
|
|
872
|
+
* Log In
|
|
873
|
+
* </Button>
|
|
874
|
+
*
|
|
875
|
+
* // Full-width
|
|
876
|
+
* <Button variant="primary" fullWidth>
|
|
877
|
+
* Continue
|
|
878
|
+
* </Button>
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
882
|
+
|
|
883
|
+
type CardPadding = "compact" | "comfortable";
|
|
884
|
+
declare const cardVariants: (props?: ({
|
|
885
|
+
variant?: "default" | "outlined" | "elevated" | "interactive" | null | undefined;
|
|
886
|
+
fullWidth?: boolean | null | undefined;
|
|
887
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
888
|
+
type CardVariant = "default" | "outlined" | "elevated" | "interactive";
|
|
889
|
+
interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof cardVariants> {
|
|
890
|
+
/**
|
|
891
|
+
* Visual variant of the card.
|
|
892
|
+
* @default "default"
|
|
893
|
+
*/
|
|
894
|
+
variant?: CardVariant;
|
|
895
|
+
/**
|
|
896
|
+
* Padding scale applied to slot sub-components.
|
|
897
|
+
* - `"compact"` → p-4 (16px) — good for dense UIs and smaller cards
|
|
898
|
+
* - `"comfortable"` → p-6 (24px) — good for prominent content cards
|
|
899
|
+
*
|
|
900
|
+
* This does NOT apply padding to the card root itself (to allow
|
|
901
|
+
* edge-to-edge images/content). Padding is applied to CardHeader,
|
|
902
|
+
* CardBody, and CardFooter sub-components.
|
|
903
|
+
*
|
|
904
|
+
* @default "compact"
|
|
905
|
+
*/
|
|
906
|
+
padding?: CardPadding;
|
|
907
|
+
/**
|
|
908
|
+
* Whether the card stretches to fill its container width.
|
|
909
|
+
* @default false
|
|
910
|
+
*/
|
|
911
|
+
fullWidth?: boolean;
|
|
912
|
+
/**
|
|
913
|
+
* The HTML element or component to render as.
|
|
914
|
+
* Use `"a"` or a Link component for interactive cards.
|
|
915
|
+
* @default "div"
|
|
916
|
+
*/
|
|
917
|
+
as?: ElementType;
|
|
918
|
+
/** Content to render inside the card. */
|
|
919
|
+
children?: ReactNode;
|
|
920
|
+
/** Additional CSS classes to merge. */
|
|
921
|
+
className?: string;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Card — a versatile container for grouping related content and actions.
|
|
925
|
+
*
|
|
926
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
927
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
928
|
+
* defined in design-system.css.
|
|
929
|
+
*
|
|
930
|
+
* The card uses a slot-based pattern with `CardHeader`, `CardBody`, and
|
|
931
|
+
* `CardFooter` sub-components. Padding flows from the root `padding` prop
|
|
932
|
+
* to all slot children via context.
|
|
933
|
+
*
|
|
934
|
+
* Accessibility:
|
|
935
|
+
* - Interactive variant has focus ring on keyboard navigation
|
|
936
|
+
* - When used as a link (`as="a"`), supports standard link semantics
|
|
937
|
+
* - Content within cards should maintain proper heading hierarchy
|
|
938
|
+
*
|
|
939
|
+
* @example
|
|
940
|
+
* ```tsx
|
|
941
|
+
* // Basic card with all slots
|
|
942
|
+
* <Card>
|
|
943
|
+
* <CardHeader>
|
|
944
|
+
* <h3>Card Title</h3>
|
|
945
|
+
* </CardHeader>
|
|
946
|
+
* <CardBody>
|
|
947
|
+
* <p>Card content goes here.</p>
|
|
948
|
+
* </CardBody>
|
|
949
|
+
* <CardFooter>
|
|
950
|
+
* <Button variant="primary" size="sm">Action</Button>
|
|
951
|
+
* </CardFooter>
|
|
952
|
+
* </Card>
|
|
953
|
+
*
|
|
954
|
+
* // Elevated card with comfortable padding
|
|
955
|
+
* <Card variant="elevated" padding="comfortable">
|
|
956
|
+
* <CardBody>
|
|
957
|
+
* <p>More spacious card content.</p>
|
|
958
|
+
* </CardBody>
|
|
959
|
+
* </Card>
|
|
960
|
+
*
|
|
961
|
+
* // Interactive card (clickable)
|
|
962
|
+
* <Card variant="interactive" as="a" href="/details">
|
|
963
|
+
* <CardBody>
|
|
964
|
+
* <p>Click to view details</p>
|
|
965
|
+
* </CardBody>
|
|
966
|
+
* </Card>
|
|
967
|
+
*
|
|
968
|
+
* // Outlined card, full width
|
|
969
|
+
* <Card variant="outlined" fullWidth>
|
|
970
|
+
* <CardBody>Full-width outlined card</CardBody>
|
|
971
|
+
* </Card>
|
|
972
|
+
* ```
|
|
973
|
+
*/
|
|
974
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
975
|
+
interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
976
|
+
/**
|
|
977
|
+
* Whether to show a bottom border separator.
|
|
978
|
+
* @default true
|
|
979
|
+
*/
|
|
980
|
+
bordered?: boolean;
|
|
981
|
+
/** Additional CSS classes to merge. */
|
|
982
|
+
className?: string;
|
|
983
|
+
/** Content to render inside the card header. */
|
|
984
|
+
children?: ReactNode;
|
|
985
|
+
}
|
|
986
|
+
interface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
987
|
+
/** Additional CSS classes to merge. */
|
|
988
|
+
className?: string;
|
|
989
|
+
/** Content to render inside the card body. */
|
|
990
|
+
children?: ReactNode;
|
|
991
|
+
}
|
|
992
|
+
interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
993
|
+
/**
|
|
994
|
+
* Whether to show a top border separator.
|
|
995
|
+
* @default true
|
|
996
|
+
*/
|
|
997
|
+
bordered?: boolean;
|
|
998
|
+
/**
|
|
999
|
+
* Horizontal alignment of footer content.
|
|
1000
|
+
* @default "end"
|
|
1001
|
+
*/
|
|
1002
|
+
align?: "start" | "center" | "end" | "between";
|
|
1003
|
+
/** Additional CSS classes to merge. */
|
|
1004
|
+
className?: string;
|
|
1005
|
+
/** Content to render inside the card footer. */
|
|
1006
|
+
children?: ReactNode;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* CardHeader — the top section of a Card, typically for titles and actions.
|
|
1010
|
+
*
|
|
1011
|
+
* Inherits padding from the parent Card's `padding` prop via context.
|
|
1012
|
+
* Renders a bottom border by default to separate from the body.
|
|
1013
|
+
*
|
|
1014
|
+
* @example
|
|
1015
|
+
* ```tsx
|
|
1016
|
+
* <CardHeader>
|
|
1017
|
+
* <h3 className="text-base font-semibold">Card Title</h3>
|
|
1018
|
+
* <p className="text-ds-muted-foreground text-sm">Subtitle text</p>
|
|
1019
|
+
* </CardHeader>
|
|
1020
|
+
*
|
|
1021
|
+
* <CardHeader bordered={false}>
|
|
1022
|
+
* <h3>No border header</h3>
|
|
1023
|
+
* </CardHeader>
|
|
1024
|
+
* ```
|
|
1025
|
+
*/
|
|
1026
|
+
declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
1027
|
+
/**
|
|
1028
|
+
* CardBody — the main content area of a Card.
|
|
1029
|
+
*
|
|
1030
|
+
* Inherits padding from the parent Card's `padding` prop via context.
|
|
1031
|
+
* This is the primary slot where card content should be placed.
|
|
1032
|
+
*
|
|
1033
|
+
* @example
|
|
1034
|
+
* ```tsx
|
|
1035
|
+
* <CardBody>
|
|
1036
|
+
* <p>This is the main content of the card.</p>
|
|
1037
|
+
* </CardBody>
|
|
1038
|
+
* ```
|
|
1039
|
+
*/
|
|
1040
|
+
declare const CardBody: react.ForwardRefExoticComponent<CardBodyProps & react.RefAttributes<HTMLDivElement>>;
|
|
1041
|
+
/**
|
|
1042
|
+
* CardFooter — the bottom section of a Card, typically for actions/buttons.
|
|
1043
|
+
*
|
|
1044
|
+
* Inherits padding from the parent Card's `padding` prop via context.
|
|
1045
|
+
* Renders a top border by default to separate from the body.
|
|
1046
|
+
* Footer content is right-aligned by default (common pattern for action buttons).
|
|
1047
|
+
*
|
|
1048
|
+
* @example
|
|
1049
|
+
* ```tsx
|
|
1050
|
+
* <CardFooter>
|
|
1051
|
+
* <Button variant="ghost" size="sm">Cancel</Button>
|
|
1052
|
+
* <Button variant="primary" size="sm">Save</Button>
|
|
1053
|
+
* </CardFooter>
|
|
1054
|
+
*
|
|
1055
|
+
* <CardFooter align="between">
|
|
1056
|
+
* <span className="text-sm text-ds-muted-foreground">Step 2 of 4</span>
|
|
1057
|
+
* <Button variant="primary" size="sm">Next</Button>
|
|
1058
|
+
* </CardFooter>
|
|
1059
|
+
*
|
|
1060
|
+
* <CardFooter bordered={false} align="start">
|
|
1061
|
+
* <Button variant="ghost" size="sm">Learn more</Button>
|
|
1062
|
+
* </CardFooter>
|
|
1063
|
+
* ```
|
|
1064
|
+
*/
|
|
1065
|
+
declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
1066
|
+
|
|
1067
|
+
declare const checkboxVariants: (props?: ({
|
|
1068
|
+
size?: "sm" | "md" | null | undefined;
|
|
1069
|
+
error?: boolean | null | undefined;
|
|
1070
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1071
|
+
type CheckboxSize = "sm" | "md";
|
|
1072
|
+
interface CheckboxProps extends Omit<CheckboxPrimitive.CheckboxProps, "children" | "asChild" | "defaultChecked">, VariantProps<typeof checkboxVariants> {
|
|
1073
|
+
/**
|
|
1074
|
+
* Size of the checkbox.
|
|
1075
|
+
* @default "md"
|
|
1076
|
+
*/
|
|
1077
|
+
size?: CheckboxSize;
|
|
1078
|
+
/**
|
|
1079
|
+
* Whether the checkbox is in an error state.
|
|
1080
|
+
* @default false
|
|
1081
|
+
*/
|
|
1082
|
+
error?: boolean;
|
|
1083
|
+
/**
|
|
1084
|
+
* Label text displayed next to the checkbox.
|
|
1085
|
+
* Clicking the label toggles the checkbox.
|
|
1086
|
+
*/
|
|
1087
|
+
label?: ReactNode;
|
|
1088
|
+
/**
|
|
1089
|
+
* Optional description text displayed below the label.
|
|
1090
|
+
* Useful for providing additional context about the option.
|
|
1091
|
+
*/
|
|
1092
|
+
description?: ReactNode;
|
|
1093
|
+
/**
|
|
1094
|
+
* Additional CSS classes for the root wrapper element.
|
|
1095
|
+
*/
|
|
1096
|
+
wrapperClassName?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Additional CSS classes for the label element.
|
|
1099
|
+
*/
|
|
1100
|
+
labelClassName?: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Additional CSS classes for the checkbox element.
|
|
1103
|
+
*/
|
|
1104
|
+
className?: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* The value of the checkbox when used within a CheckboxGroup.
|
|
1107
|
+
*/
|
|
1108
|
+
value?: string;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Checkbox — a toggle control for binary or indeterminate selections.
|
|
1112
|
+
*
|
|
1113
|
+
* Built on Radix UI's checkbox primitive for full accessibility support,
|
|
1114
|
+
* including keyboard navigation (Space to toggle), focus management,
|
|
1115
|
+
* and proper ARIA attributes.
|
|
1116
|
+
*
|
|
1117
|
+
* Accessibility:
|
|
1118
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
1119
|
+
* - Disabled state uses both native disabled and visual cues
|
|
1120
|
+
* - Error state applies `aria-invalid="true"`
|
|
1121
|
+
* - Label is properly associated via `htmlFor`/`id`
|
|
1122
|
+
* - Supports indeterminate state with proper ARIA
|
|
1123
|
+
* - Space key toggles the checkbox
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* ```tsx
|
|
1127
|
+
* // Basic usage
|
|
1128
|
+
* <Checkbox label="Accept terms and conditions" />
|
|
1129
|
+
*
|
|
1130
|
+
* // Controlled
|
|
1131
|
+
* <Checkbox
|
|
1132
|
+
* checked={isChecked}
|
|
1133
|
+
* onCheckedChange={setIsChecked}
|
|
1134
|
+
* label="Enable notifications"
|
|
1135
|
+
* />
|
|
1136
|
+
*
|
|
1137
|
+
* // Indeterminate
|
|
1138
|
+
* <Checkbox checked="indeterminate" label="Select all" />
|
|
1139
|
+
*
|
|
1140
|
+
* // With description
|
|
1141
|
+
* <Checkbox
|
|
1142
|
+
* label="Marketing emails"
|
|
1143
|
+
* description="Receive emails about new products and features."
|
|
1144
|
+
* />
|
|
1145
|
+
*
|
|
1146
|
+
* // Sizes
|
|
1147
|
+
* <Checkbox size="sm" label="Small checkbox" />
|
|
1148
|
+
* <Checkbox size="md" label="Medium checkbox" />
|
|
1149
|
+
*
|
|
1150
|
+
* // Error state
|
|
1151
|
+
* <Checkbox error label="You must accept the terms" />
|
|
1152
|
+
*
|
|
1153
|
+
* // Disabled
|
|
1154
|
+
* <Checkbox disabled label="Cannot change this" />
|
|
1155
|
+
* <Checkbox disabled checked label="Locked selection" />
|
|
1156
|
+
* ```
|
|
1157
|
+
*/
|
|
1158
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1159
|
+
interface CheckboxGroupContextValue {
|
|
1160
|
+
/** Size to apply to all child checkboxes. */
|
|
1161
|
+
size?: CheckboxSize;
|
|
1162
|
+
/** Whether all children are disabled. */
|
|
1163
|
+
disabled?: boolean;
|
|
1164
|
+
/** Whether all children are in error state. */
|
|
1165
|
+
error?: boolean;
|
|
1166
|
+
}
|
|
1167
|
+
/** Hook to access CheckboxGroup context from child Checkbox components. */
|
|
1168
|
+
declare function useCheckboxGroupContext(): CheckboxGroupContextValue;
|
|
1169
|
+
type CheckboxGroupOrientation = "horizontal" | "vertical";
|
|
1170
|
+
interface CheckboxGroupProps {
|
|
1171
|
+
/**
|
|
1172
|
+
* Group label displayed above the checkboxes.
|
|
1173
|
+
* Required for accessibility.
|
|
1174
|
+
*/
|
|
1175
|
+
label?: ReactNode;
|
|
1176
|
+
/**
|
|
1177
|
+
* Optional description below the group label.
|
|
1178
|
+
*/
|
|
1179
|
+
description?: ReactNode;
|
|
1180
|
+
/**
|
|
1181
|
+
* Layout orientation of the checkboxes.
|
|
1182
|
+
* @default "vertical"
|
|
1183
|
+
*/
|
|
1184
|
+
orientation?: CheckboxGroupOrientation;
|
|
1185
|
+
/**
|
|
1186
|
+
* Size to apply to all child checkboxes.
|
|
1187
|
+
* Individual checkbox size props will override this.
|
|
1188
|
+
*/
|
|
1189
|
+
size?: CheckboxSize;
|
|
1190
|
+
/**
|
|
1191
|
+
* Whether all checkboxes in the group are disabled.
|
|
1192
|
+
* @default false
|
|
1193
|
+
*/
|
|
1194
|
+
disabled?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Whether the group is in an error state.
|
|
1197
|
+
* @default false
|
|
1198
|
+
*/
|
|
1199
|
+
error?: boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* Error message displayed below the group.
|
|
1202
|
+
*/
|
|
1203
|
+
errorMessage?: ReactNode;
|
|
1204
|
+
/** Checkbox children. */
|
|
1205
|
+
children: ReactNode;
|
|
1206
|
+
/** Additional CSS classes for the group container. */
|
|
1207
|
+
className?: string;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* CheckboxGroup — groups related checkboxes with accessible semantics.
|
|
1211
|
+
*
|
|
1212
|
+
* Uses `role="group"` with `aria-labelledby` for proper screen reader
|
|
1213
|
+
* announcement. Provides consistent spacing and optional orientation.
|
|
1214
|
+
*
|
|
1215
|
+
* @example
|
|
1216
|
+
* ```tsx
|
|
1217
|
+
* <CheckboxGroup label="Notification preferences" orientation="vertical">
|
|
1218
|
+
* <Checkbox value="email" label="Email notifications" />
|
|
1219
|
+
* <Checkbox value="sms" label="SMS notifications" />
|
|
1220
|
+
* <Checkbox value="push" label="Push notifications" />
|
|
1221
|
+
* </CheckboxGroup>
|
|
1222
|
+
*
|
|
1223
|
+
* // Horizontal layout
|
|
1224
|
+
* <CheckboxGroup label="Options" orientation="horizontal">
|
|
1225
|
+
* <Checkbox value="a" label="Option A" />
|
|
1226
|
+
* <Checkbox value="b" label="Option B" />
|
|
1227
|
+
* </CheckboxGroup>
|
|
1228
|
+
*
|
|
1229
|
+
* // With error
|
|
1230
|
+
* <CheckboxGroup label="Required" error errorMessage="Please select at least one.">
|
|
1231
|
+
* <Checkbox value="a" label="Option A" />
|
|
1232
|
+
* <Checkbox value="b" label="Option B" />
|
|
1233
|
+
* </CheckboxGroup>
|
|
1234
|
+
* ```
|
|
1235
|
+
*/
|
|
1236
|
+
declare function CheckboxGroup({ label, description, orientation, size, disabled, error, errorMessage, children, className, }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
1237
|
+
declare namespace CheckboxGroup {
|
|
1238
|
+
var displayName: string;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
declare const dialogContentVariants: (props?: ({
|
|
1242
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
1243
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1244
|
+
type DialogSize = "sm" | "md" | "lg" | "full";
|
|
1245
|
+
interface DialogProps extends DialogPrimitive.DialogProps {
|
|
1246
|
+
children: ReactNode;
|
|
1247
|
+
}
|
|
1248
|
+
interface DialogTriggerProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger> {
|
|
1249
|
+
className?: string;
|
|
1250
|
+
}
|
|
1251
|
+
interface DialogContentProps extends Omit<ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, "asChild"> {
|
|
1252
|
+
size?: DialogSize;
|
|
1253
|
+
showClose?: boolean;
|
|
1254
|
+
overlayClassName?: string;
|
|
1255
|
+
className?: string;
|
|
1256
|
+
children: ReactNode;
|
|
1257
|
+
}
|
|
1258
|
+
interface DialogHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
1259
|
+
className?: string;
|
|
1260
|
+
children: ReactNode;
|
|
1261
|
+
}
|
|
1262
|
+
interface DialogBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
1263
|
+
className?: string;
|
|
1264
|
+
children: ReactNode;
|
|
1265
|
+
}
|
|
1266
|
+
interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
1267
|
+
className?: string;
|
|
1268
|
+
children: ReactNode;
|
|
1269
|
+
}
|
|
1270
|
+
interface DialogTitleProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Title> {
|
|
1271
|
+
className?: string;
|
|
1272
|
+
children: ReactNode;
|
|
1273
|
+
}
|
|
1274
|
+
interface DialogDescriptionProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Description> {
|
|
1275
|
+
className?: string;
|
|
1276
|
+
children: ReactNode;
|
|
1277
|
+
}
|
|
1278
|
+
interface DialogCloseProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {
|
|
1279
|
+
className?: string;
|
|
1280
|
+
}
|
|
1281
|
+
declare function Dialog({ children, ...rest }: DialogProps): react_jsx_runtime.JSX.Element;
|
|
1282
|
+
declare namespace Dialog {
|
|
1283
|
+
var displayName: string;
|
|
1284
|
+
}
|
|
1285
|
+
declare const DialogTrigger: react.ForwardRefExoticComponent<DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1286
|
+
declare const DialogContent: react.ForwardRefExoticComponent<DialogContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1287
|
+
declare function DialogHeader({ className, children, ...rest }: DialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1288
|
+
declare namespace DialogHeader {
|
|
1289
|
+
var displayName: string;
|
|
1290
|
+
}
|
|
1291
|
+
declare function DialogBody({ className, children, ...rest }: DialogBodyProps): react_jsx_runtime.JSX.Element;
|
|
1292
|
+
declare namespace DialogBody {
|
|
1293
|
+
var displayName: string;
|
|
1294
|
+
}
|
|
1295
|
+
declare function DialogFooter({ className, children, ...rest }: DialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
1296
|
+
declare namespace DialogFooter {
|
|
1297
|
+
var displayName: string;
|
|
1298
|
+
}
|
|
1299
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<DialogTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
1300
|
+
declare const DialogDescription: react.ForwardRefExoticComponent<DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
1301
|
+
declare const DialogClose: react.ForwardRefExoticComponent<DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1302
|
+
|
|
1303
|
+
interface DropdownMenuProps extends DropdownMenuPrimitive.DropdownMenuProps {
|
|
1304
|
+
children: ReactNode;
|
|
1305
|
+
}
|
|
1306
|
+
interface DropdownMenuTriggerProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger> {
|
|
1307
|
+
className?: string;
|
|
1308
|
+
}
|
|
1309
|
+
interface DropdownMenuContentProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {
|
|
1310
|
+
className?: string;
|
|
1311
|
+
children: ReactNode;
|
|
1312
|
+
}
|
|
1313
|
+
type DropdownMenuItemVariant = "default" | "danger";
|
|
1314
|
+
interface DropdownMenuItemProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
|
|
1315
|
+
className?: string;
|
|
1316
|
+
/** Visual variant. @default "default" */
|
|
1317
|
+
variant?: DropdownMenuItemVariant;
|
|
1318
|
+
/** Optional icon displayed before the label. */
|
|
1319
|
+
icon?: ReactNode;
|
|
1320
|
+
/** Optional keyboard shortcut displayed on the right. */
|
|
1321
|
+
shortcut?: string;
|
|
1322
|
+
children: ReactNode;
|
|
1323
|
+
}
|
|
1324
|
+
interface DropdownMenuCheckboxItemProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> {
|
|
1325
|
+
className?: string;
|
|
1326
|
+
children: ReactNode;
|
|
1327
|
+
}
|
|
1328
|
+
interface DropdownMenuRadioGroupProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup> {
|
|
1329
|
+
className?: string;
|
|
1330
|
+
children: ReactNode;
|
|
1331
|
+
}
|
|
1332
|
+
interface DropdownMenuRadioItemProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> {
|
|
1333
|
+
className?: string;
|
|
1334
|
+
children: ReactNode;
|
|
1335
|
+
}
|
|
1336
|
+
interface DropdownMenuLabelProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
|
|
1337
|
+
className?: string;
|
|
1338
|
+
/** Whether the label is inset (aligned with items that have icons). */
|
|
1339
|
+
inset?: boolean;
|
|
1340
|
+
children: ReactNode;
|
|
1341
|
+
}
|
|
1342
|
+
interface DropdownMenuSeparatorProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> {
|
|
1343
|
+
className?: string;
|
|
1344
|
+
}
|
|
1345
|
+
interface DropdownMenuGroupProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group> {
|
|
1346
|
+
className?: string;
|
|
1347
|
+
children: ReactNode;
|
|
1348
|
+
}
|
|
1349
|
+
interface DropdownMenuSubProps extends DropdownMenuPrimitive.DropdownMenuSubProps {
|
|
1350
|
+
children: ReactNode;
|
|
1351
|
+
}
|
|
1352
|
+
interface DropdownMenuSubTriggerProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
|
|
1353
|
+
className?: string;
|
|
1354
|
+
/** Whether the sub-trigger is inset (aligned with items that have icons). */
|
|
1355
|
+
inset?: boolean;
|
|
1356
|
+
/** Optional icon displayed before the label. */
|
|
1357
|
+
icon?: ReactNode;
|
|
1358
|
+
children: ReactNode;
|
|
1359
|
+
}
|
|
1360
|
+
interface DropdownMenuSubContentProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> {
|
|
1361
|
+
className?: string;
|
|
1362
|
+
children: ReactNode;
|
|
1363
|
+
}
|
|
1364
|
+
interface DropdownMenuShortcutProps {
|
|
1365
|
+
className?: string;
|
|
1366
|
+
children: ReactNode;
|
|
1367
|
+
}
|
|
1368
|
+
declare function DropdownMenu({ children, ...rest }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
1369
|
+
declare namespace DropdownMenu {
|
|
1370
|
+
var displayName: string;
|
|
1371
|
+
}
|
|
1372
|
+
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1373
|
+
declare const DropdownMenuContent: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1374
|
+
declare const DropdownMenuItem: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1375
|
+
declare const DropdownMenuCheckboxItem: react.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1376
|
+
declare const DropdownMenuRadioGroup: react.ForwardRefExoticComponent<DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1377
|
+
declare const DropdownMenuRadioItem: react.ForwardRefExoticComponent<DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1378
|
+
declare const DropdownMenuLabel: react.ForwardRefExoticComponent<DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>>;
|
|
1379
|
+
declare const DropdownMenuSeparator: react.ForwardRefExoticComponent<DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
1380
|
+
declare const DropdownMenuGroup: react.ForwardRefExoticComponent<DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1381
|
+
declare function DropdownMenuSub({ children, ...rest }: DropdownMenuSubProps): react_jsx_runtime.JSX.Element;
|
|
1382
|
+
declare namespace DropdownMenuSub {
|
|
1383
|
+
var displayName: string;
|
|
1384
|
+
}
|
|
1385
|
+
declare const DropdownMenuSubTrigger: react.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1386
|
+
declare const DropdownMenuSubContent: react.ForwardRefExoticComponent<DropdownMenuSubContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1387
|
+
declare function DropdownMenuShortcut({ className, children, }: DropdownMenuShortcutProps): react_jsx_runtime.JSX.Element;
|
|
1388
|
+
declare namespace DropdownMenuShortcut {
|
|
1389
|
+
var displayName: string;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
declare const inputVariants: (props?: ({
|
|
1393
|
+
variant?: "success" | "error" | "default" | null | undefined;
|
|
1394
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1395
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1396
|
+
type InputVariant = "default" | "error" | "success";
|
|
1397
|
+
type InputSize = "sm" | "md" | "lg";
|
|
1398
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
1399
|
+
/**
|
|
1400
|
+
* Visual variant of the input.
|
|
1401
|
+
* @default "default"
|
|
1402
|
+
*/
|
|
1403
|
+
variant?: InputVariant;
|
|
1404
|
+
/**
|
|
1405
|
+
* Size of the input.
|
|
1406
|
+
* @default "md"
|
|
1407
|
+
*/
|
|
1408
|
+
size?: InputSize;
|
|
1409
|
+
/**
|
|
1410
|
+
* Icon to display on the left side of the input.
|
|
1411
|
+
* Typically a Lucide icon component rendered at the appropriate size.
|
|
1412
|
+
*/
|
|
1413
|
+
iconLeft?: ReactNode;
|
|
1414
|
+
/**
|
|
1415
|
+
* Icon to display on the right side of the input.
|
|
1416
|
+
* If `clearable` is true and there is a value, the clear button
|
|
1417
|
+
* takes precedence over `iconRight`.
|
|
1418
|
+
*/
|
|
1419
|
+
iconRight?: ReactNode;
|
|
1420
|
+
/**
|
|
1421
|
+
* Whether to show a clear button when the input has a value.
|
|
1422
|
+
* @default false
|
|
1423
|
+
*/
|
|
1424
|
+
clearable?: boolean;
|
|
1425
|
+
/**
|
|
1426
|
+
* Callback fired when the clear button is clicked.
|
|
1427
|
+
* If not provided, the input will dispatch a native change event
|
|
1428
|
+
* with an empty string value.
|
|
1429
|
+
*/
|
|
1430
|
+
onClear?: () => void;
|
|
1431
|
+
/**
|
|
1432
|
+
* Additional CSS classes for the outer wrapper element.
|
|
1433
|
+
* Use this when you need to control the width/margin of the input group.
|
|
1434
|
+
*/
|
|
1435
|
+
wrapperClassName?: string;
|
|
1436
|
+
/** Additional CSS classes to merge on the input element. */
|
|
1437
|
+
className?: string;
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Input — a text input for capturing user data.
|
|
1441
|
+
*
|
|
1442
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
1443
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
1444
|
+
* defined in design-system.css.
|
|
1445
|
+
*
|
|
1446
|
+
* Accessibility:
|
|
1447
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
1448
|
+
* - Disabled state uses both `disabled` attribute and `aria-disabled`
|
|
1449
|
+
* - Error variant sets `aria-invalid="true"` automatically
|
|
1450
|
+
* - Supports `aria-describedby` for linking to error/helper messages
|
|
1451
|
+
* - Clear button has `aria-label` and is excluded from tab order
|
|
1452
|
+
*
|
|
1453
|
+
* @example
|
|
1454
|
+
* ```tsx
|
|
1455
|
+
* // Basic usage
|
|
1456
|
+
* <Input placeholder="Enter your name" />
|
|
1457
|
+
*
|
|
1458
|
+
* // With variant
|
|
1459
|
+
* <Input variant="error" aria-describedby="email-error" />
|
|
1460
|
+
*
|
|
1461
|
+
* // With icons
|
|
1462
|
+
* <Input iconLeft={<SearchIcon />} placeholder="Search..." />
|
|
1463
|
+
* <Input iconRight={<MailIcon />} placeholder="Email" />
|
|
1464
|
+
*
|
|
1465
|
+
* // Clearable
|
|
1466
|
+
* <Input
|
|
1467
|
+
* clearable
|
|
1468
|
+
* value={value}
|
|
1469
|
+
* onChange={(e) => setValue(e.target.value)}
|
|
1470
|
+
* onClear={() => setValue("")}
|
|
1471
|
+
* />
|
|
1472
|
+
*
|
|
1473
|
+
* // Sizes
|
|
1474
|
+
* <Input size="sm" placeholder="Small" />
|
|
1475
|
+
* <Input size="md" placeholder="Medium" />
|
|
1476
|
+
* <Input size="lg" placeholder="Large" />
|
|
1477
|
+
*
|
|
1478
|
+
* // Disabled / Read-only
|
|
1479
|
+
* <Input disabled placeholder="Disabled" />
|
|
1480
|
+
* <Input readOnly value="Read-only value" />
|
|
1481
|
+
* ```
|
|
1482
|
+
*/
|
|
1483
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1484
|
+
|
|
1485
|
+
type PaginationSize = "sm" | "md";
|
|
1486
|
+
type PaginationVariant = "default" | "compact";
|
|
1487
|
+
declare const paginationButtonVariants: (props?: ({
|
|
1488
|
+
size?: "sm" | "md" | null | undefined;
|
|
1489
|
+
active?: boolean | null | undefined;
|
|
1490
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1491
|
+
interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
1492
|
+
/**
|
|
1493
|
+
* Total number of pages.
|
|
1494
|
+
*/
|
|
1495
|
+
totalPages: number;
|
|
1496
|
+
/**
|
|
1497
|
+
* Current page (1-indexed). When provided, the component is controlled.
|
|
1498
|
+
* When omitted, the component manages its own state starting at page 1.
|
|
1499
|
+
*/
|
|
1500
|
+
page?: number;
|
|
1501
|
+
/**
|
|
1502
|
+
* Callback fired when the page changes.
|
|
1503
|
+
*/
|
|
1504
|
+
onPageChange?: (page: number) => void;
|
|
1505
|
+
/**
|
|
1506
|
+
* Display variant.
|
|
1507
|
+
* - `"default"` — full page numbers with ellipsis
|
|
1508
|
+
* - `"compact"` — "Page X of Y" with prev/next only
|
|
1509
|
+
* @default "default"
|
|
1510
|
+
*/
|
|
1511
|
+
variant?: PaginationVariant;
|
|
1512
|
+
/**
|
|
1513
|
+
* Size of the pagination buttons.
|
|
1514
|
+
* @default "md"
|
|
1515
|
+
*/
|
|
1516
|
+
size?: PaginationSize;
|
|
1517
|
+
/**
|
|
1518
|
+
* Number of sibling pages to show on each side of the current page.
|
|
1519
|
+
* @default 1
|
|
1520
|
+
*/
|
|
1521
|
+
siblings?: number;
|
|
1522
|
+
/**
|
|
1523
|
+
* Number of boundary pages to always show at the start and end.
|
|
1524
|
+
* @default 1
|
|
1525
|
+
*/
|
|
1526
|
+
boundary?: number;
|
|
1527
|
+
/**
|
|
1528
|
+
* Whether to show previous/next buttons.
|
|
1529
|
+
* @default true
|
|
1530
|
+
*/
|
|
1531
|
+
showPrevNext?: boolean;
|
|
1532
|
+
/**
|
|
1533
|
+
* Label for the previous button.
|
|
1534
|
+
* @default "Previous"
|
|
1535
|
+
*/
|
|
1536
|
+
prevLabel?: string;
|
|
1537
|
+
/**
|
|
1538
|
+
* Label for the next button.
|
|
1539
|
+
* @default "Next"
|
|
1540
|
+
*/
|
|
1541
|
+
nextLabel?: string;
|
|
1542
|
+
/**
|
|
1543
|
+
* Accessible label for the nav element.
|
|
1544
|
+
* @default "Pagination"
|
|
1545
|
+
*/
|
|
1546
|
+
"aria-label"?: string;
|
|
1547
|
+
/** Additional CSS classes for the root nav element. */
|
|
1548
|
+
className?: string;
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Pagination — a page navigation component for paged data sets.
|
|
1552
|
+
*
|
|
1553
|
+
* Renders page number buttons with smart ellipsis truncation, or a compact
|
|
1554
|
+
* "Page X of Y" indicator. Supports controlled and uncontrolled modes.
|
|
1555
|
+
*
|
|
1556
|
+
* Accessibility:
|
|
1557
|
+
* - Wrapped in `<nav>` landmark with `aria-label`
|
|
1558
|
+
* - Current page indicated with `aria-current="page"`
|
|
1559
|
+
* - Prev/next buttons disabled at boundaries
|
|
1560
|
+
* - Focus ring on all interactive elements
|
|
1561
|
+
* - Keyboard navigable (Tab + Enter/Space)
|
|
1562
|
+
*
|
|
1563
|
+
* @example
|
|
1564
|
+
* ```tsx
|
|
1565
|
+
* // Full page numbers
|
|
1566
|
+
* <Pagination
|
|
1567
|
+
* page={currentPage}
|
|
1568
|
+
* totalPages={20}
|
|
1569
|
+
* onPageChange={setCurrentPage}
|
|
1570
|
+
* />
|
|
1571
|
+
*
|
|
1572
|
+
* // Compact variant
|
|
1573
|
+
* <Pagination
|
|
1574
|
+
* page={3}
|
|
1575
|
+
* totalPages={10}
|
|
1576
|
+
* variant="compact"
|
|
1577
|
+
* onPageChange={setPage}
|
|
1578
|
+
* />
|
|
1579
|
+
*
|
|
1580
|
+
* // Uncontrolled with small size
|
|
1581
|
+
* <Pagination totalPages={50} size="sm" />
|
|
1582
|
+
*
|
|
1583
|
+
* // No prev/next buttons, more siblings
|
|
1584
|
+
* <Pagination
|
|
1585
|
+
* totalPages={100}
|
|
1586
|
+
* siblings={2}
|
|
1587
|
+
* boundary={2}
|
|
1588
|
+
* showPrevNext={false}
|
|
1589
|
+
* />
|
|
1590
|
+
* ```
|
|
1591
|
+
*/
|
|
1592
|
+
declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
|
|
1593
|
+
|
|
1594
|
+
interface PopoverProps extends PopoverPrimitive.PopoverProps {
|
|
1595
|
+
/** The popover children (trigger + content). */
|
|
1596
|
+
children: ReactNode;
|
|
1597
|
+
}
|
|
1598
|
+
interface PopoverTriggerProps extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> {
|
|
1599
|
+
/** Additional CSS classes. */
|
|
1600
|
+
className?: string;
|
|
1601
|
+
}
|
|
1602
|
+
interface PopoverContentProps extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
|
|
1603
|
+
/** Additional CSS classes for the content element. */
|
|
1604
|
+
className?: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* Whether to show a close button in the top-right corner.
|
|
1607
|
+
* @default false
|
|
1608
|
+
*/
|
|
1609
|
+
showClose?: boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Whether to render an arrow pointing to the trigger.
|
|
1612
|
+
* @default false
|
|
1613
|
+
*/
|
|
1614
|
+
arrow?: boolean;
|
|
1615
|
+
/**
|
|
1616
|
+
* Additional CSS classes for the arrow element.
|
|
1617
|
+
*/
|
|
1618
|
+
arrowClassName?: string;
|
|
1619
|
+
/** The popover body content. */
|
|
1620
|
+
children: ReactNode;
|
|
1621
|
+
}
|
|
1622
|
+
interface PopoverCloseProps extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Close> {
|
|
1623
|
+
/** Additional CSS classes. */
|
|
1624
|
+
className?: string;
|
|
1625
|
+
}
|
|
1626
|
+
interface PopoverArrowProps extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Arrow> {
|
|
1627
|
+
/** Additional CSS classes. */
|
|
1628
|
+
className?: string;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* Popover — root component that manages open/closed state.
|
|
1632
|
+
*
|
|
1633
|
+
* This is a thin wrapper around Radix UI's Popover.Root.
|
|
1634
|
+
*
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```tsx
|
|
1637
|
+
* <Popover>
|
|
1638
|
+
* <PopoverTrigger>Open</PopoverTrigger>
|
|
1639
|
+
* <PopoverContent>Content here</PopoverContent>
|
|
1640
|
+
* </Popover>
|
|
1641
|
+
* ```
|
|
1642
|
+
*/
|
|
1643
|
+
declare function Popover({ children, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
1644
|
+
declare namespace Popover {
|
|
1645
|
+
var displayName: string;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* PopoverTrigger — the element that toggles the popover.
|
|
1649
|
+
*
|
|
1650
|
+
* Use `asChild` to compose with your own button/element.
|
|
1651
|
+
*
|
|
1652
|
+
* @example
|
|
1653
|
+
* ```tsx
|
|
1654
|
+
* <PopoverTrigger asChild>
|
|
1655
|
+
* <Button variant="secondary">Open Popover</Button>
|
|
1656
|
+
* </PopoverTrigger>
|
|
1657
|
+
* ```
|
|
1658
|
+
*/
|
|
1659
|
+
declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1660
|
+
/**
|
|
1661
|
+
* PopoverContent — the floating content panel of the popover.
|
|
1662
|
+
*
|
|
1663
|
+
* Built on Radix UI Popover.Content with the design system's token layer.
|
|
1664
|
+
* All colors, radii, spacing, shadows, and z-index come from CSS custom
|
|
1665
|
+
* properties defined in design-system.css.
|
|
1666
|
+
*
|
|
1667
|
+
* Accessibility:
|
|
1668
|
+
* - Radix manages focus trap and restoration
|
|
1669
|
+
* - Escape key closes the popover
|
|
1670
|
+
* - Outside click dismisses (configurable via Radix props)
|
|
1671
|
+
* - Proper ARIA attributes applied by Radix
|
|
1672
|
+
*
|
|
1673
|
+
* @example
|
|
1674
|
+
* ```tsx
|
|
1675
|
+
* // Basic content
|
|
1676
|
+
* <PopoverContent>
|
|
1677
|
+
* <p>Hello world</p>
|
|
1678
|
+
* </PopoverContent>
|
|
1679
|
+
*
|
|
1680
|
+
* // With close button and arrow
|
|
1681
|
+
* <PopoverContent showClose arrow side="top" align="center">
|
|
1682
|
+
* <h3>Settings</h3>
|
|
1683
|
+
* <p>Adjust your preferences here.</p>
|
|
1684
|
+
* </PopoverContent>
|
|
1685
|
+
*
|
|
1686
|
+
* // Custom side and alignment
|
|
1687
|
+
* <PopoverContent side="right" align="start" sideOffset={8}>
|
|
1688
|
+
* <p>Right-aligned popover</p>
|
|
1689
|
+
* </PopoverContent>
|
|
1690
|
+
* ```
|
|
1691
|
+
*/
|
|
1692
|
+
declare const PopoverContent: react.ForwardRefExoticComponent<PopoverContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1693
|
+
declare const PopoverClose: react.ForwardRefExoticComponent<PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1694
|
+
declare const PopoverArrow: react.ForwardRefExoticComponent<PopoverArrowProps & react.RefAttributes<SVGSVGElement>>;
|
|
1695
|
+
|
|
1696
|
+
declare const radioGroupVariants: (props?: ({
|
|
1697
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
1698
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1699
|
+
declare const radioIndicatorVariants: (props?: ({
|
|
1700
|
+
size?: "sm" | "md" | null | undefined;
|
|
1701
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1702
|
+
declare const radioCardVariants: (props?: ({
|
|
1703
|
+
size?: "sm" | "md" | null | undefined;
|
|
1704
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1705
|
+
type RadioSize = "sm" | "md";
|
|
1706
|
+
type RadioOrientation = "vertical" | "horizontal";
|
|
1707
|
+
interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, "orientation" | "asChild">, VariantProps<typeof radioGroupVariants> {
|
|
1708
|
+
/**
|
|
1709
|
+
* Layout direction of the radio group.
|
|
1710
|
+
* @default "vertical"
|
|
1711
|
+
*/
|
|
1712
|
+
orientation?: RadioOrientation;
|
|
1713
|
+
/**
|
|
1714
|
+
* Size of all radio items in the group.
|
|
1715
|
+
* @default "md"
|
|
1716
|
+
*/
|
|
1717
|
+
size?: RadioSize;
|
|
1718
|
+
/** Additional CSS classes to merge on the root element. */
|
|
1719
|
+
className?: string;
|
|
1720
|
+
/** The radio group items. */
|
|
1721
|
+
children?: ReactNode;
|
|
1722
|
+
}
|
|
1723
|
+
interface RadioGroupItemProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, "asChild"> {
|
|
1724
|
+
/**
|
|
1725
|
+
* The value of this radio item.
|
|
1726
|
+
*/
|
|
1727
|
+
value: string;
|
|
1728
|
+
/**
|
|
1729
|
+
* Label text displayed next to the radio indicator.
|
|
1730
|
+
*/
|
|
1731
|
+
label?: ReactNode;
|
|
1732
|
+
/**
|
|
1733
|
+
* Optional description displayed below the label.
|
|
1734
|
+
*/
|
|
1735
|
+
description?: ReactNode;
|
|
1736
|
+
/**
|
|
1737
|
+
* Override the group-level size for this specific item.
|
|
1738
|
+
*/
|
|
1739
|
+
size?: RadioSize;
|
|
1740
|
+
/** Additional CSS classes to merge on the wrapper element. */
|
|
1741
|
+
className?: string;
|
|
1742
|
+
}
|
|
1743
|
+
interface RadioCardProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, "asChild"> {
|
|
1744
|
+
/**
|
|
1745
|
+
* The value of this radio card.
|
|
1746
|
+
*/
|
|
1747
|
+
value: string;
|
|
1748
|
+
/**
|
|
1749
|
+
* Label text for the card.
|
|
1750
|
+
*/
|
|
1751
|
+
label?: ReactNode;
|
|
1752
|
+
/**
|
|
1753
|
+
* Description text displayed below the label.
|
|
1754
|
+
*/
|
|
1755
|
+
description?: ReactNode;
|
|
1756
|
+
/**
|
|
1757
|
+
* Override the group-level size for this specific card.
|
|
1758
|
+
*/
|
|
1759
|
+
size?: RadioSize;
|
|
1760
|
+
/** Additional CSS classes to merge on the card wrapper. */
|
|
1761
|
+
className?: string;
|
|
1762
|
+
/** Additional content to render inside the card. */
|
|
1763
|
+
children?: ReactNode;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* RadioGroup — a group of radio buttons for selecting a single value.
|
|
1767
|
+
*
|
|
1768
|
+
* Built on Radix UI's RadioGroup primitive for full keyboard navigation
|
|
1769
|
+
* and ARIA compliance. All colors, radii, and transitions come from CSS
|
|
1770
|
+
* custom properties defined in design-system.css.
|
|
1771
|
+
*
|
|
1772
|
+
* Accessibility:
|
|
1773
|
+
* - Radix UI provides `role="radiogroup"` and manages `aria-checked`
|
|
1774
|
+
* - Arrow key navigation between items
|
|
1775
|
+
* - Supports `aria-label` and `aria-labelledby`
|
|
1776
|
+
* - Disabled state propagated to all children
|
|
1777
|
+
*
|
|
1778
|
+
* @example
|
|
1779
|
+
* ```tsx
|
|
1780
|
+
* <RadioGroup value={value} onValueChange={setValue}>
|
|
1781
|
+
* <RadioGroupItem value="option-1" label="Option 1" />
|
|
1782
|
+
* <RadioGroupItem value="option-2" label="Option 2" />
|
|
1783
|
+
* <RadioGroupItem value="option-3" label="Option 3" disabled />
|
|
1784
|
+
* </RadioGroup>
|
|
1785
|
+
*
|
|
1786
|
+
* // Horizontal layout
|
|
1787
|
+
* <RadioGroup orientation="horizontal" size="sm">
|
|
1788
|
+
* <RadioGroupItem value="a" label="A" />
|
|
1789
|
+
* <RadioGroupItem value="b" label="B" />
|
|
1790
|
+
* </RadioGroup>
|
|
1791
|
+
* ```
|
|
1792
|
+
*/
|
|
1793
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1794
|
+
/**
|
|
1795
|
+
* RadioGroupItem — a single radio button with optional label and description.
|
|
1796
|
+
*
|
|
1797
|
+
* Must be used as a child of `RadioGroup`.
|
|
1798
|
+
*
|
|
1799
|
+
* @example
|
|
1800
|
+
* ```tsx
|
|
1801
|
+
* <RadioGroupItem value="newsletter" label="Subscribe to newsletter" />
|
|
1802
|
+
* <RadioGroupItem
|
|
1803
|
+
* value="updates"
|
|
1804
|
+
* label="Product updates"
|
|
1805
|
+
* description="Get notified about new features and improvements"
|
|
1806
|
+
* />
|
|
1807
|
+
* ```
|
|
1808
|
+
*/
|
|
1809
|
+
declare const RadioGroupItem: react.ForwardRefExoticComponent<RadioGroupItemProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1810
|
+
/**
|
|
1811
|
+
* RadioCard — a card-style radio button where the entire card is clickable.
|
|
1812
|
+
*
|
|
1813
|
+
* Must be used as a child of `RadioGroup`. Provides a richer visual
|
|
1814
|
+
* treatment for radio options, useful for plan selectors, theme pickers, etc.
|
|
1815
|
+
*
|
|
1816
|
+
* @example
|
|
1817
|
+
* ```tsx
|
|
1818
|
+
* <RadioGroup value={plan} onValueChange={setPlan}>
|
|
1819
|
+
* <RadioCard
|
|
1820
|
+
* value="free"
|
|
1821
|
+
* label="Free Plan"
|
|
1822
|
+
* description="Basic features, limited storage"
|
|
1823
|
+
* />
|
|
1824
|
+
* <RadioCard
|
|
1825
|
+
* value="pro"
|
|
1826
|
+
* label="Pro Plan"
|
|
1827
|
+
* description="All features, unlimited storage"
|
|
1828
|
+
* />
|
|
1829
|
+
* </RadioGroup>
|
|
1830
|
+
* ```
|
|
1831
|
+
*/
|
|
1832
|
+
declare const RadioCard: react.ForwardRefExoticComponent<RadioCardProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1833
|
+
|
|
1834
|
+
declare const selectTriggerVariants: (props?: ({
|
|
1835
|
+
variant?: "success" | "error" | "default" | null | undefined;
|
|
1836
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1837
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1838
|
+
type SelectVariant = "default" | "error" | "success";
|
|
1839
|
+
type SelectSize = "sm" | "md" | "lg";
|
|
1840
|
+
interface SelectProps extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, "children"> {
|
|
1841
|
+
variant?: SelectVariant;
|
|
1842
|
+
size?: SelectSize;
|
|
1843
|
+
placeholder?: string;
|
|
1844
|
+
triggerClassName?: string;
|
|
1845
|
+
contentClassName?: string;
|
|
1846
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
1847
|
+
"aria-describedby"?: string;
|
|
1848
|
+
children: ReactNode;
|
|
1849
|
+
}
|
|
1850
|
+
interface SelectItemProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
1851
|
+
className?: string;
|
|
1852
|
+
children: ReactNode;
|
|
1853
|
+
}
|
|
1854
|
+
interface SelectGroupProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {
|
|
1855
|
+
className?: string;
|
|
1856
|
+
children: ReactNode;
|
|
1857
|
+
}
|
|
1858
|
+
interface SelectLabelProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Label> {
|
|
1859
|
+
className?: string;
|
|
1860
|
+
children: ReactNode;
|
|
1861
|
+
}
|
|
1862
|
+
interface SelectSeparatorProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Separator> {
|
|
1863
|
+
className?: string;
|
|
1864
|
+
}
|
|
1865
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1866
|
+
declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1867
|
+
declare const SelectGroup: react.ForwardRefExoticComponent<SelectGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1868
|
+
declare const SelectLabel: react.ForwardRefExoticComponent<SelectLabelProps & react.RefAttributes<HTMLDivElement>>;
|
|
1869
|
+
declare const SelectSeparator: react.ForwardRefExoticComponent<SelectSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
1870
|
+
|
|
1871
|
+
declare const sheetContentVariants: (props?: ({
|
|
1872
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
1873
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1874
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1875
|
+
type SheetSide = "left" | "right" | "top" | "bottom";
|
|
1876
|
+
type SheetSize = "sm" | "md" | "lg";
|
|
1877
|
+
interface SheetProps extends DialogPrimitive.DialogProps {
|
|
1878
|
+
/** Sheet children (trigger + content). */
|
|
1879
|
+
children: ReactNode;
|
|
1880
|
+
}
|
|
1881
|
+
interface SheetTriggerProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger> {
|
|
1882
|
+
/** Additional CSS classes. */
|
|
1883
|
+
className?: string;
|
|
1884
|
+
}
|
|
1885
|
+
interface SheetContentProps extends Omit<ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, "asChild">, VariantProps<typeof sheetContentVariants> {
|
|
1886
|
+
/**
|
|
1887
|
+
* The side the sheet slides in from.
|
|
1888
|
+
* @default "right"
|
|
1889
|
+
*/
|
|
1890
|
+
side?: SheetSide;
|
|
1891
|
+
/**
|
|
1892
|
+
* The width/height of the sheet panel.
|
|
1893
|
+
* @default "md"
|
|
1894
|
+
*/
|
|
1895
|
+
size?: SheetSize;
|
|
1896
|
+
/**
|
|
1897
|
+
* Whether to show the default close button (X) in the top-right.
|
|
1898
|
+
* @default true
|
|
1899
|
+
*/
|
|
1900
|
+
showClose?: boolean;
|
|
1901
|
+
/**
|
|
1902
|
+
* Additional CSS classes for the overlay backdrop.
|
|
1903
|
+
*/
|
|
1904
|
+
overlayClassName?: string;
|
|
1905
|
+
/** Additional CSS classes for the content panel. */
|
|
1906
|
+
className?: string;
|
|
1907
|
+
/** The sheet body content. */
|
|
1908
|
+
children: ReactNode;
|
|
1909
|
+
}
|
|
1910
|
+
interface SheetHeaderProps {
|
|
1911
|
+
/** Additional CSS classes. */
|
|
1912
|
+
className?: string;
|
|
1913
|
+
children: ReactNode;
|
|
1914
|
+
}
|
|
1915
|
+
interface SheetFooterProps {
|
|
1916
|
+
/** Additional CSS classes. */
|
|
1917
|
+
className?: string;
|
|
1918
|
+
children: ReactNode;
|
|
1919
|
+
}
|
|
1920
|
+
interface SheetTitleProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Title> {
|
|
1921
|
+
/** Additional CSS classes. */
|
|
1922
|
+
className?: string;
|
|
1923
|
+
children: ReactNode;
|
|
1924
|
+
}
|
|
1925
|
+
interface SheetDescriptionProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Description> {
|
|
1926
|
+
/** Additional CSS classes. */
|
|
1927
|
+
className?: string;
|
|
1928
|
+
children: ReactNode;
|
|
1929
|
+
}
|
|
1930
|
+
interface SheetCloseProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {
|
|
1931
|
+
/** Additional CSS classes. */
|
|
1932
|
+
className?: string;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Sheet — a slide-in panel overlaying the main content.
|
|
1936
|
+
*
|
|
1937
|
+
* This is a thin wrapper around Radix UI's Dialog.Root.
|
|
1938
|
+
*
|
|
1939
|
+
* @example
|
|
1940
|
+
* ```tsx
|
|
1941
|
+
* <Sheet>
|
|
1942
|
+
* <SheetTrigger asChild>
|
|
1943
|
+
* <Button>Open</Button>
|
|
1944
|
+
* </SheetTrigger>
|
|
1945
|
+
* <SheetContent>Panel content</SheetContent>
|
|
1946
|
+
* </Sheet>
|
|
1947
|
+
* ```
|
|
1948
|
+
*/
|
|
1949
|
+
declare function Sheet({ children, ...rest }: SheetProps): react_jsx_runtime.JSX.Element;
|
|
1950
|
+
declare namespace Sheet {
|
|
1951
|
+
var displayName: string;
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* SheetTrigger — the element that opens the sheet.
|
|
1955
|
+
*
|
|
1956
|
+
* Use `asChild` to compose with your own button/element.
|
|
1957
|
+
*
|
|
1958
|
+
* @example
|
|
1959
|
+
* ```tsx
|
|
1960
|
+
* <SheetTrigger asChild>
|
|
1961
|
+
* <Button variant="secondary">Open Panel</Button>
|
|
1962
|
+
* </SheetTrigger>
|
|
1963
|
+
* ```
|
|
1964
|
+
*/
|
|
1965
|
+
declare const SheetTrigger: react.ForwardRefExoticComponent<SheetTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1966
|
+
/**
|
|
1967
|
+
* SheetContent — the sliding panel that appears over the page.
|
|
1968
|
+
*
|
|
1969
|
+
* Built on Radix UI Dialog.Content with the design system's token layer.
|
|
1970
|
+
* All colors, radii, spacing, shadows, and z-index come from CSS custom
|
|
1971
|
+
* properties defined in design-system.css.
|
|
1972
|
+
*
|
|
1973
|
+
* Accessibility:
|
|
1974
|
+
* - Radix manages focus trap and restoration
|
|
1975
|
+
* - Escape key closes the sheet
|
|
1976
|
+
* - Overlay click closes the sheet
|
|
1977
|
+
* - Proper ARIA attributes (dialog role)
|
|
1978
|
+
* - Scroll lock on body while open
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* ```tsx
|
|
1982
|
+
* // Right-side sheet (default)
|
|
1983
|
+
* <SheetContent>
|
|
1984
|
+
* <SheetHeader>
|
|
1985
|
+
* <SheetTitle>Settings</SheetTitle>
|
|
1986
|
+
* <SheetDescription>Manage your preferences.</SheetDescription>
|
|
1987
|
+
* </SheetHeader>
|
|
1988
|
+
* <div className="flex-1 overflow-y-auto py-4">
|
|
1989
|
+
* Content here
|
|
1990
|
+
* </div>
|
|
1991
|
+
* <SheetFooter>
|
|
1992
|
+
* <Button>Save Changes</Button>
|
|
1993
|
+
* </SheetFooter>
|
|
1994
|
+
* </SheetContent>
|
|
1995
|
+
*
|
|
1996
|
+
* // Left-side navigation
|
|
1997
|
+
* <SheetContent side="left" size="sm">
|
|
1998
|
+
* <nav>Navigation items</nav>
|
|
1999
|
+
* </SheetContent>
|
|
2000
|
+
*
|
|
2001
|
+
* // Bottom drawer
|
|
2002
|
+
* <SheetContent side="bottom" size="sm">
|
|
2003
|
+
* <p>Bottom sheet content</p>
|
|
2004
|
+
* </SheetContent>
|
|
2005
|
+
* ```
|
|
2006
|
+
*/
|
|
2007
|
+
declare const SheetContent: react.ForwardRefExoticComponent<SheetContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
2008
|
+
/**
|
|
2009
|
+
* SheetHeader — layout component for the sheet title and description.
|
|
2010
|
+
*
|
|
2011
|
+
* @example
|
|
2012
|
+
* ```tsx
|
|
2013
|
+
* <SheetHeader>
|
|
2014
|
+
* <SheetTitle>Edit Profile</SheetTitle>
|
|
2015
|
+
* <SheetDescription>Make changes to your profile.</SheetDescription>
|
|
2016
|
+
* </SheetHeader>
|
|
2017
|
+
* ```
|
|
2018
|
+
*/
|
|
2019
|
+
declare function SheetHeader({ className, children }: SheetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2020
|
+
declare namespace SheetHeader {
|
|
2021
|
+
var displayName: string;
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* SheetFooter — layout component for the sheet action buttons.
|
|
2025
|
+
*
|
|
2026
|
+
* @example
|
|
2027
|
+
* ```tsx
|
|
2028
|
+
* <SheetFooter>
|
|
2029
|
+
* <SheetClose asChild>
|
|
2030
|
+
* <Button variant="secondary">Cancel</Button>
|
|
2031
|
+
* </SheetClose>
|
|
2032
|
+
* <Button>Save</Button>
|
|
2033
|
+
* </SheetFooter>
|
|
2034
|
+
* ```
|
|
2035
|
+
*/
|
|
2036
|
+
declare function SheetFooter({ className, children }: SheetFooterProps): react_jsx_runtime.JSX.Element;
|
|
2037
|
+
declare namespace SheetFooter {
|
|
2038
|
+
var displayName: string;
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* SheetTitle — the title text of the sheet.
|
|
2042
|
+
*
|
|
2043
|
+
* Renders a Radix Dialog.Title for proper accessibility.
|
|
2044
|
+
*
|
|
2045
|
+
* @example
|
|
2046
|
+
* ```tsx
|
|
2047
|
+
* <SheetTitle>Edit Profile</SheetTitle>
|
|
2048
|
+
* ```
|
|
2049
|
+
*/
|
|
2050
|
+
declare const SheetTitle: react.ForwardRefExoticComponent<SheetTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
2051
|
+
/**
|
|
2052
|
+
* SheetDescription — the description text below the sheet title.
|
|
2053
|
+
*
|
|
2054
|
+
* Renders a Radix Dialog.Description for proper accessibility.
|
|
2055
|
+
*
|
|
2056
|
+
* @example
|
|
2057
|
+
* ```tsx
|
|
2058
|
+
* <SheetDescription>
|
|
2059
|
+
* Make changes to your profile here. Click save when you're done.
|
|
2060
|
+
* </SheetDescription>
|
|
2061
|
+
* ```
|
|
2062
|
+
*/
|
|
2063
|
+
declare const SheetDescription: react.ForwardRefExoticComponent<SheetDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
2064
|
+
/**
|
|
2065
|
+
* SheetClose — a button that closes the sheet.
|
|
2066
|
+
*
|
|
2067
|
+
* Use `asChild` to compose with your own button component.
|
|
2068
|
+
*
|
|
2069
|
+
* @example
|
|
2070
|
+
* ```tsx
|
|
2071
|
+
* // As a standalone close button
|
|
2072
|
+
* <SheetClose>Close</SheetClose>
|
|
2073
|
+
*
|
|
2074
|
+
* // Composed with Button
|
|
2075
|
+
* <SheetClose asChild>
|
|
2076
|
+
* <Button variant="secondary">Cancel</Button>
|
|
2077
|
+
* </SheetClose>
|
|
2078
|
+
* ```
|
|
2079
|
+
*/
|
|
2080
|
+
declare const SheetClose: react.ForwardRefExoticComponent<SheetCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
2081
|
+
|
|
2082
|
+
declare const skeletonVariants: (props?: ({
|
|
2083
|
+
shape?: "circle" | "rect" | "text" | null | undefined;
|
|
2084
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2085
|
+
type SkeletonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2086
|
+
type SkeletonTextSize = "xs" | "sm" | "md" | "lg";
|
|
2087
|
+
interface SkeletonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof skeletonVariants> {
|
|
2088
|
+
/**
|
|
2089
|
+
* Shape of the skeleton placeholder.
|
|
2090
|
+
* @default "text"
|
|
2091
|
+
*/
|
|
2092
|
+
shape?: "text" | "circle" | "rect";
|
|
2093
|
+
/**
|
|
2094
|
+
* Width of the skeleton. Accepts CSS values (number → px, string → raw).
|
|
2095
|
+
* For `circle` shape, use `size` prop instead.
|
|
2096
|
+
* @default "100%" for text/rect shapes
|
|
2097
|
+
*/
|
|
2098
|
+
width?: number | string;
|
|
2099
|
+
/**
|
|
2100
|
+
* Height of the skeleton. Accepts CSS values (number → px, string → raw).
|
|
2101
|
+
* For `circle` shape, use `size` prop instead.
|
|
2102
|
+
* For `text` shape, defaults to the text height based on `textSize`.
|
|
2103
|
+
*/
|
|
2104
|
+
height?: number | string;
|
|
2105
|
+
/**
|
|
2106
|
+
* Predefined size for circle shapes. Maps to standard avatar sizes.
|
|
2107
|
+
* Only applies when `shape="circle"`.
|
|
2108
|
+
* @default "md"
|
|
2109
|
+
*/
|
|
2110
|
+
size?: SkeletonSize;
|
|
2111
|
+
/**
|
|
2112
|
+
* Text height preset for text shapes. Matches typography size scale.
|
|
2113
|
+
* Only applies when `shape="text"`.
|
|
2114
|
+
* @default "md"
|
|
2115
|
+
*/
|
|
2116
|
+
textSize?: SkeletonTextSize;
|
|
2117
|
+
/**
|
|
2118
|
+
* Whether the pulse animation is active.
|
|
2119
|
+
* Set to false to show a static skeleton (e.g., when paused).
|
|
2120
|
+
* @default true
|
|
2121
|
+
*/
|
|
2122
|
+
animate?: boolean;
|
|
2123
|
+
/** Additional CSS classes to merge. */
|
|
2124
|
+
className?: string;
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* Skeleton — a loading placeholder that mimics the shape of content.
|
|
2128
|
+
*
|
|
2129
|
+
* Built on the design system's token layer. Uses the muted background
|
|
2130
|
+
* color and a CSS `animate-pulse` animation to indicate loading state.
|
|
2131
|
+
* The animation is automatically disabled when the user prefers reduced
|
|
2132
|
+
* motion.
|
|
2133
|
+
*
|
|
2134
|
+
* Accessibility:
|
|
2135
|
+
* - `aria-hidden="true"` — skeletons are decorative, not content
|
|
2136
|
+
* - `role="presentation"` — excluded from accessibility tree
|
|
2137
|
+
* - Reduced motion respected via global CSS in design-system.css
|
|
2138
|
+
*
|
|
2139
|
+
* @example
|
|
2140
|
+
* ```tsx
|
|
2141
|
+
* // Text line placeholder
|
|
2142
|
+
* <Skeleton shape="text" />
|
|
2143
|
+
* <Skeleton shape="text" width="60%" />
|
|
2144
|
+
* <Skeleton shape="text" textSize="lg" />
|
|
2145
|
+
*
|
|
2146
|
+
* // Circle placeholder (avatars)
|
|
2147
|
+
* <Skeleton shape="circle" size="md" />
|
|
2148
|
+
* <Skeleton shape="circle" size="lg" />
|
|
2149
|
+
*
|
|
2150
|
+
* // Rectangle placeholder (images, cards)
|
|
2151
|
+
* <Skeleton shape="rect" width={300} height={200} />
|
|
2152
|
+
* <Skeleton shape="rect" width="100%" height={160} />
|
|
2153
|
+
*
|
|
2154
|
+
* // Static (no animation)
|
|
2155
|
+
* <Skeleton shape="text" animate={false} />
|
|
2156
|
+
*
|
|
2157
|
+
* // Custom dimensions
|
|
2158
|
+
* <Skeleton shape="rect" width="100%" height="8rem" className="rounded-ds-lg" />
|
|
2159
|
+
* ```
|
|
2160
|
+
*/
|
|
2161
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLDivElement>>;
|
|
2162
|
+
interface SkeletonTextProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2163
|
+
/**
|
|
2164
|
+
* Number of text lines to render.
|
|
2165
|
+
* @default 3
|
|
2166
|
+
*/
|
|
2167
|
+
lines?: number;
|
|
2168
|
+
/**
|
|
2169
|
+
* Text height preset for each line.
|
|
2170
|
+
* @default "md"
|
|
2171
|
+
*/
|
|
2172
|
+
textSize?: SkeletonTextSize;
|
|
2173
|
+
/**
|
|
2174
|
+
* Width of the last line (as CSS value).
|
|
2175
|
+
* Creates a more natural appearance since real text rarely fills
|
|
2176
|
+
* the full width on the last line.
|
|
2177
|
+
* @default "60%"
|
|
2178
|
+
*/
|
|
2179
|
+
lastLineWidth?: number | string;
|
|
2180
|
+
/**
|
|
2181
|
+
* Gap between lines.
|
|
2182
|
+
* @default "gap-2.5"
|
|
2183
|
+
*/
|
|
2184
|
+
gap?: string;
|
|
2185
|
+
/**
|
|
2186
|
+
* Whether the pulse animation is active.
|
|
2187
|
+
* @default true
|
|
2188
|
+
*/
|
|
2189
|
+
animate?: boolean;
|
|
2190
|
+
/** Additional CSS classes to merge on the wrapper. */
|
|
2191
|
+
className?: string;
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* SkeletonText — renders multiple skeleton text lines.
|
|
2195
|
+
*
|
|
2196
|
+
* A convenience wrapper around `Skeleton` that renders multiple text-shaped
|
|
2197
|
+
* lines with automatic width variation on the last line.
|
|
2198
|
+
*
|
|
2199
|
+
* @example
|
|
2200
|
+
* ```tsx
|
|
2201
|
+
* // Default (3 lines)
|
|
2202
|
+
* <SkeletonText />
|
|
2203
|
+
*
|
|
2204
|
+
* // Custom line count
|
|
2205
|
+
* <SkeletonText lines={5} />
|
|
2206
|
+
*
|
|
2207
|
+
* // Custom last line width
|
|
2208
|
+
* <SkeletonText lines={4} lastLineWidth="40%" />
|
|
2209
|
+
*
|
|
2210
|
+
* // Larger text size
|
|
2211
|
+
* <SkeletonText textSize="lg" lines={2} />
|
|
2212
|
+
*
|
|
2213
|
+
* // With custom gap
|
|
2214
|
+
* <SkeletonText lines={3} gap="gap-3" />
|
|
2215
|
+
* ```
|
|
2216
|
+
*/
|
|
2217
|
+
declare const SkeletonText: react.ForwardRefExoticComponent<SkeletonTextProps & react.RefAttributes<HTMLDivElement>>;
|
|
2218
|
+
interface SkeletonCircleProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2219
|
+
/**
|
|
2220
|
+
* Predefined size. Maps to standard avatar sizes.
|
|
2221
|
+
* @default "md"
|
|
2222
|
+
*/
|
|
2223
|
+
size?: SkeletonSize;
|
|
2224
|
+
/**
|
|
2225
|
+
* Whether the pulse animation is active.
|
|
2226
|
+
* @default true
|
|
2227
|
+
*/
|
|
2228
|
+
animate?: boolean;
|
|
2229
|
+
/** Additional CSS classes to merge. */
|
|
2230
|
+
className?: string;
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* SkeletonCircle — a circle-shaped skeleton placeholder.
|
|
2234
|
+
*
|
|
2235
|
+
* Shorthand for `<Skeleton shape="circle" />` with a cleaner API.
|
|
2236
|
+
*
|
|
2237
|
+
* @example
|
|
2238
|
+
* ```tsx
|
|
2239
|
+
* <SkeletonCircle size="sm" />
|
|
2240
|
+
* <SkeletonCircle size="md" />
|
|
2241
|
+
* <SkeletonCircle size="lg" />
|
|
2242
|
+
* ```
|
|
2243
|
+
*/
|
|
2244
|
+
declare const SkeletonCircle: react.ForwardRefExoticComponent<SkeletonCircleProps & react.RefAttributes<HTMLDivElement>>;
|
|
2245
|
+
interface SkeletonRectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2246
|
+
/**
|
|
2247
|
+
* Width of the rectangle. Accepts CSS values.
|
|
2248
|
+
* @default "100%"
|
|
2249
|
+
*/
|
|
2250
|
+
width?: number | string;
|
|
2251
|
+
/**
|
|
2252
|
+
* Height of the rectangle. Accepts CSS values.
|
|
2253
|
+
* @default 120
|
|
2254
|
+
*/
|
|
2255
|
+
height?: number | string;
|
|
2256
|
+
/**
|
|
2257
|
+
* Whether the pulse animation is active.
|
|
2258
|
+
* @default true
|
|
2259
|
+
*/
|
|
2260
|
+
animate?: boolean;
|
|
2261
|
+
/** Additional CSS classes to merge. */
|
|
2262
|
+
className?: string;
|
|
2263
|
+
}
|
|
2264
|
+
/**
|
|
2265
|
+
* SkeletonRect — a rectangle-shaped skeleton placeholder.
|
|
2266
|
+
*
|
|
2267
|
+
* Shorthand for `<Skeleton shape="rect" />` with sensible defaults.
|
|
2268
|
+
* Useful for image placeholders, card thumbnails, and media areas.
|
|
2269
|
+
*
|
|
2270
|
+
* @example
|
|
2271
|
+
* ```tsx
|
|
2272
|
+
* <SkeletonRect width={300} height={200} />
|
|
2273
|
+
* <SkeletonRect width="100%" height={160} />
|
|
2274
|
+
* <SkeletonRect height="12rem" />
|
|
2275
|
+
* ```
|
|
2276
|
+
*/
|
|
2277
|
+
declare const SkeletonRect: react.ForwardRefExoticComponent<SkeletonRectProps & react.RefAttributes<HTMLDivElement>>;
|
|
2278
|
+
|
|
2279
|
+
declare const switchTrackVariants: (props?: ({
|
|
2280
|
+
size?: "sm" | "md" | null | undefined;
|
|
2281
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2282
|
+
declare const switchThumbVariants: (props?: ({
|
|
2283
|
+
size?: "sm" | "md" | null | undefined;
|
|
2284
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2285
|
+
type SwitchSize = "sm" | "md";
|
|
2286
|
+
type SwitchLabelPosition = "left" | "right";
|
|
2287
|
+
interface SwitchProps extends Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, "asChild">, VariantProps<typeof switchTrackVariants> {
|
|
2288
|
+
/**
|
|
2289
|
+
* Size of the switch.
|
|
2290
|
+
* @default "md"
|
|
2291
|
+
*/
|
|
2292
|
+
size?: SwitchSize;
|
|
2293
|
+
/**
|
|
2294
|
+
* Text label for the switch.
|
|
2295
|
+
*/
|
|
2296
|
+
label?: ReactNode;
|
|
2297
|
+
/**
|
|
2298
|
+
* Description text displayed below the label.
|
|
2299
|
+
*/
|
|
2300
|
+
description?: ReactNode;
|
|
2301
|
+
/**
|
|
2302
|
+
* Position of the label relative to the switch.
|
|
2303
|
+
* @default "right"
|
|
2304
|
+
*/
|
|
2305
|
+
labelPosition?: SwitchLabelPosition;
|
|
2306
|
+
/**
|
|
2307
|
+
* Additional CSS classes for the outer wrapper element.
|
|
2308
|
+
*/
|
|
2309
|
+
wrapperClassName?: string;
|
|
2310
|
+
/**
|
|
2311
|
+
* Additional CSS classes for the label element.
|
|
2312
|
+
*/
|
|
2313
|
+
labelClassName?: string;
|
|
2314
|
+
/**
|
|
2315
|
+
* Additional CSS classes for the description element.
|
|
2316
|
+
*/
|
|
2317
|
+
descriptionClassName?: string;
|
|
2318
|
+
/** Additional CSS classes to merge on the switch track element. */
|
|
2319
|
+
className?: string;
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Switch — a toggle control for binary on/off states.
|
|
2323
|
+
*
|
|
2324
|
+
* Built on Radix UI's Switch primitive for accessibility and the design
|
|
2325
|
+
* system's token layer for styling. The thumb uses a Framer Motion spring
|
|
2326
|
+
* animation for a tactile, snappy feel.
|
|
2327
|
+
*
|
|
2328
|
+
* Accessibility:
|
|
2329
|
+
* - Radix handles `role="switch"`, `aria-checked`, keyboard toggle (Space)
|
|
2330
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
2331
|
+
* - Disabled state uses both `disabled` attribute and `aria-disabled`
|
|
2332
|
+
* - Label is associated via `htmlFor` / `id` linkage
|
|
2333
|
+
* - Description linked via `aria-describedby`
|
|
2334
|
+
*
|
|
2335
|
+
* @example
|
|
2336
|
+
* ```tsx
|
|
2337
|
+
* // Basic usage
|
|
2338
|
+
* <Switch label="Dark mode" />
|
|
2339
|
+
*
|
|
2340
|
+
* // Controlled
|
|
2341
|
+
* <Switch
|
|
2342
|
+
* checked={enabled}
|
|
2343
|
+
* onCheckedChange={setEnabled}
|
|
2344
|
+
* label="Notifications"
|
|
2345
|
+
* />
|
|
2346
|
+
*
|
|
2347
|
+
* // Small with left label
|
|
2348
|
+
* <Switch size="sm" label="Auto-save" labelPosition="left" />
|
|
2349
|
+
*
|
|
2350
|
+
* // With description
|
|
2351
|
+
* <Switch
|
|
2352
|
+
* label="Marketing emails"
|
|
2353
|
+
* description="Receive emails about new features and updates"
|
|
2354
|
+
* />
|
|
2355
|
+
*
|
|
2356
|
+
* // Disabled
|
|
2357
|
+
* <Switch disabled label="Feature locked" />
|
|
2358
|
+
* ```
|
|
2359
|
+
*/
|
|
2360
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
2361
|
+
|
|
2362
|
+
type TableDensity = "compact" | "comfortable";
|
|
2363
|
+
type TableSortDirection = "asc" | "desc";
|
|
2364
|
+
type TableAlign = "left" | "center" | "right";
|
|
2365
|
+
declare const tableRootVariants: (props?: ({
|
|
2366
|
+
density?: "compact" | "comfortable" | null | undefined;
|
|
2367
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2368
|
+
interface TableProps extends React.HTMLAttributes<HTMLTableElement>, VariantProps<typeof tableRootVariants> {
|
|
2369
|
+
/**
|
|
2370
|
+
* Row height density.
|
|
2371
|
+
* @default "comfortable"
|
|
2372
|
+
*/
|
|
2373
|
+
density?: TableDensity;
|
|
2374
|
+
/**
|
|
2375
|
+
* Alternate row background color for readability.
|
|
2376
|
+
* @default false
|
|
2377
|
+
*/
|
|
2378
|
+
striped?: boolean;
|
|
2379
|
+
/**
|
|
2380
|
+
* Highlight rows on hover.
|
|
2381
|
+
* @default false
|
|
2382
|
+
*/
|
|
2383
|
+
hoverable?: boolean;
|
|
2384
|
+
/**
|
|
2385
|
+
* Add borders between cells.
|
|
2386
|
+
* @default false
|
|
2387
|
+
*/
|
|
2388
|
+
bordered?: boolean;
|
|
2389
|
+
/**
|
|
2390
|
+
* Wrap the table in a horizontally-scrollable container
|
|
2391
|
+
* so it doesn't overflow on small screens.
|
|
2392
|
+
* @default true
|
|
2393
|
+
*/
|
|
2394
|
+
responsive?: boolean;
|
|
2395
|
+
/** Additional CSS classes for the wrapper (when responsive). */
|
|
2396
|
+
wrapperClassName?: string;
|
|
2397
|
+
/** Additional CSS classes for the table element. */
|
|
2398
|
+
className?: string;
|
|
2399
|
+
}
|
|
2400
|
+
/**
|
|
2401
|
+
* Table — semantic `<table>` element with design-system tokens.
|
|
2402
|
+
*
|
|
2403
|
+
* Provides context for density, striping, hovering, and borders to all
|
|
2404
|
+
* sub-components.
|
|
2405
|
+
*
|
|
2406
|
+
* @example
|
|
2407
|
+
* ```tsx
|
|
2408
|
+
* <Table striped hoverable density="compact" bordered>
|
|
2409
|
+
* <TableHeader>
|
|
2410
|
+
* <TableRow>
|
|
2411
|
+
* <TableHead>Name</TableHead>
|
|
2412
|
+
* <TableHead align="right">Amount</TableHead>
|
|
2413
|
+
* </TableRow>
|
|
2414
|
+
* </TableHeader>
|
|
2415
|
+
* <TableBody>
|
|
2416
|
+
* <TableRow>
|
|
2417
|
+
* <TableCell>Alice</TableCell>
|
|
2418
|
+
* <TableCell align="right">$1,200</TableCell>
|
|
2419
|
+
* </TableRow>
|
|
2420
|
+
* </TableBody>
|
|
2421
|
+
* </Table>
|
|
2422
|
+
* ```
|
|
2423
|
+
*/
|
|
2424
|
+
declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
|
|
2425
|
+
interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
2426
|
+
/** Additional CSS classes. */
|
|
2427
|
+
className?: string;
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* TableHeader — wraps `<thead>` with design-system styles.
|
|
2431
|
+
*/
|
|
2432
|
+
declare const TableHeader: react.ForwardRefExoticComponent<TableHeaderProps & react.RefAttributes<HTMLTableSectionElement>>;
|
|
2433
|
+
interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
2434
|
+
/** Additional CSS classes. */
|
|
2435
|
+
className?: string;
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* TableBody — wraps `<tbody>` with design-system styles.
|
|
2439
|
+
*/
|
|
2440
|
+
declare const TableBody: react.ForwardRefExoticComponent<TableBodyProps & react.RefAttributes<HTMLTableSectionElement>>;
|
|
2441
|
+
interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
2442
|
+
/** Additional CSS classes. */
|
|
2443
|
+
className?: string;
|
|
2444
|
+
}
|
|
2445
|
+
/**
|
|
2446
|
+
* TableFooter — wraps `<tfoot>` with design-system styles.
|
|
2447
|
+
*/
|
|
2448
|
+
declare const TableFooter: react.ForwardRefExoticComponent<TableFooterProps & react.RefAttributes<HTMLTableSectionElement>>;
|
|
2449
|
+
interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
2450
|
+
/**
|
|
2451
|
+
* Whether this row is selected / highlighted.
|
|
2452
|
+
* @default false
|
|
2453
|
+
*/
|
|
2454
|
+
selected?: boolean;
|
|
2455
|
+
/** Additional CSS classes. */
|
|
2456
|
+
className?: string;
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* TableRow — wraps `<tr>` with design-system styles.
|
|
2460
|
+
*/
|
|
2461
|
+
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
2462
|
+
interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
2463
|
+
/**
|
|
2464
|
+
* Text alignment within the cell.
|
|
2465
|
+
* @default "left"
|
|
2466
|
+
*/
|
|
2467
|
+
align?: TableAlign;
|
|
2468
|
+
/**
|
|
2469
|
+
* Whether this column is sortable.
|
|
2470
|
+
* When true, renders a sort indicator and makes the header clickable.
|
|
2471
|
+
* @default false
|
|
2472
|
+
*/
|
|
2473
|
+
sortable?: boolean;
|
|
2474
|
+
/**
|
|
2475
|
+
* Current sort direction. Only relevant when `sortable` is true.
|
|
2476
|
+
* - `"asc"` — ascending (renders up chevron)
|
|
2477
|
+
* - `"desc"` — descending (renders down chevron)
|
|
2478
|
+
* - `undefined` — not currently sorted (renders neutral indicator)
|
|
2479
|
+
*/
|
|
2480
|
+
sorted?: TableSortDirection;
|
|
2481
|
+
/**
|
|
2482
|
+
* Callback fired when the sortable header is clicked.
|
|
2483
|
+
* Only relevant when `sortable` is true.
|
|
2484
|
+
*/
|
|
2485
|
+
onSort?: () => void;
|
|
2486
|
+
/**
|
|
2487
|
+
* Whether the header should stick to the top of the scroll container.
|
|
2488
|
+
* @default false
|
|
2489
|
+
*/
|
|
2490
|
+
sticky?: boolean;
|
|
2491
|
+
/** Additional CSS classes. */
|
|
2492
|
+
className?: string;
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* TableHead — wraps `<th>` with design-system styles.
|
|
2496
|
+
*
|
|
2497
|
+
* Supports sort indicators for sortable columns. The sort logic is
|
|
2498
|
+
* consumer-owned — this component only provides the visual indicator
|
|
2499
|
+
* and click handler.
|
|
2500
|
+
*
|
|
2501
|
+
* @example
|
|
2502
|
+
* ```tsx
|
|
2503
|
+
* <TableHead
|
|
2504
|
+
* sortable
|
|
2505
|
+
* sorted="asc"
|
|
2506
|
+
* onSort={() => toggleSort("name")}
|
|
2507
|
+
* >
|
|
2508
|
+
* Name
|
|
2509
|
+
* </TableHead>
|
|
2510
|
+
* ```
|
|
2511
|
+
*/
|
|
2512
|
+
declare const TableHead: react.ForwardRefExoticComponent<TableHeadProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
2513
|
+
interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
2514
|
+
/**
|
|
2515
|
+
* Text alignment within the cell.
|
|
2516
|
+
* @default "left"
|
|
2517
|
+
*/
|
|
2518
|
+
align?: TableAlign;
|
|
2519
|
+
/** Additional CSS classes. */
|
|
2520
|
+
className?: string;
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* TableCell — wraps `<td>` with design-system styles.
|
|
2524
|
+
*/
|
|
2525
|
+
declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
2526
|
+
interface TableCaptionProps extends React.HTMLAttributes<HTMLTableCaptionElement> {
|
|
2527
|
+
/** Additional CSS classes. */
|
|
2528
|
+
className?: string;
|
|
2529
|
+
}
|
|
2530
|
+
/**
|
|
2531
|
+
* TableCaption — wraps `<caption>` with design-system styles.
|
|
2532
|
+
*
|
|
2533
|
+
* Renders at the bottom of the table by default (via `caption-bottom`
|
|
2534
|
+
* on the root `<table>`).
|
|
2535
|
+
*/
|
|
2536
|
+
declare const TableCaption: react.ForwardRefExoticComponent<TableCaptionProps & react.RefAttributes<HTMLTableCaptionElement>>;
|
|
2537
|
+
|
|
2538
|
+
declare const tabsListVariants: (props?: ({
|
|
2539
|
+
variant?: "underline" | "pills" | "enclosed" | null | undefined;
|
|
2540
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
2541
|
+
fullWidth?: boolean | null | undefined;
|
|
2542
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2543
|
+
declare const tabsTriggerVariants: (props?: ({
|
|
2544
|
+
variant?: "underline" | "pills" | "enclosed" | null | undefined;
|
|
2545
|
+
size?: "sm" | "md" | null | undefined;
|
|
2546
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2547
|
+
type TabsVariant = "underline" | "pills" | "enclosed";
|
|
2548
|
+
type TabsSize = "sm" | "md";
|
|
2549
|
+
type TabsOrientation = "horizontal" | "vertical";
|
|
2550
|
+
interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "orientation"> {
|
|
2551
|
+
/** Visual variant of the tab list. @default "underline" */
|
|
2552
|
+
variant?: TabsVariant;
|
|
2553
|
+
/** Size of the tab triggers. @default "md" */
|
|
2554
|
+
size?: TabsSize;
|
|
2555
|
+
/** Layout orientation. @default "horizontal" */
|
|
2556
|
+
orientation?: TabsOrientation;
|
|
2557
|
+
/** Additional CSS classes. */
|
|
2558
|
+
className?: string;
|
|
2559
|
+
/** Tab content. */
|
|
2560
|
+
children?: ReactNode;
|
|
2561
|
+
}
|
|
2562
|
+
interface TabsListProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
2563
|
+
/** Whether tabs stretch to fill the available width. @default false */
|
|
2564
|
+
fullWidth?: boolean;
|
|
2565
|
+
/** Additional CSS classes. */
|
|
2566
|
+
className?: string;
|
|
2567
|
+
/** Tab triggers. */
|
|
2568
|
+
children?: ReactNode;
|
|
2569
|
+
}
|
|
2570
|
+
interface TabsTriggerProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> {
|
|
2571
|
+
/** Additional CSS classes. */
|
|
2572
|
+
className?: string;
|
|
2573
|
+
/** Optional icon to display before the label. */
|
|
2574
|
+
icon?: ReactNode;
|
|
2575
|
+
/** The trigger label. */
|
|
2576
|
+
children?: ReactNode;
|
|
2577
|
+
}
|
|
2578
|
+
interface TabsContentProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
|
|
2579
|
+
/** Additional CSS classes. */
|
|
2580
|
+
className?: string;
|
|
2581
|
+
/** The panel content. */
|
|
2582
|
+
children?: ReactNode;
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* Tabs — a tabbed interface for organizing content into panels.
|
|
2586
|
+
*
|
|
2587
|
+
* Built on Radix UI's Tabs primitive for full keyboard navigation
|
|
2588
|
+
* and ARIA compliance. Supports three visual variants with an animated
|
|
2589
|
+
* active indicator powered by Framer Motion layoutId.
|
|
2590
|
+
*
|
|
2591
|
+
* Accessibility:
|
|
2592
|
+
* - Radix provides `role="tablist"`, `role="tab"`, `role="tabpanel"`
|
|
2593
|
+
* - Arrow key navigation between triggers
|
|
2594
|
+
* - Automatic `aria-selected`, `aria-controls`, `aria-labelledby`
|
|
2595
|
+
* - Focus management follows WAI-ARIA Tabs pattern
|
|
2596
|
+
*
|
|
2597
|
+
* @example
|
|
2598
|
+
* ```tsx
|
|
2599
|
+
* // Basic underline tabs
|
|
2600
|
+
* <Tabs defaultValue="overview">
|
|
2601
|
+
* <TabsList>
|
|
2602
|
+
* <TabsTrigger value="overview">Overview</TabsTrigger>
|
|
2603
|
+
* <TabsTrigger value="analytics">Analytics</TabsTrigger>
|
|
2604
|
+
* <TabsTrigger value="settings">Settings</TabsTrigger>
|
|
2605
|
+
* </TabsList>
|
|
2606
|
+
* <TabsContent value="overview">Overview content</TabsContent>
|
|
2607
|
+
* <TabsContent value="analytics">Analytics content</TabsContent>
|
|
2608
|
+
* <TabsContent value="settings">Settings content</TabsContent>
|
|
2609
|
+
* </Tabs>
|
|
2610
|
+
*
|
|
2611
|
+
* // Pills variant, small size
|
|
2612
|
+
* <Tabs variant="pills" size="sm" defaultValue="tab1">
|
|
2613
|
+
* <TabsList>
|
|
2614
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
2615
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
2616
|
+
* </TabsList>
|
|
2617
|
+
* ...
|
|
2618
|
+
* </Tabs>
|
|
2619
|
+
*
|
|
2620
|
+
* // Full-width tabs
|
|
2621
|
+
* <Tabs defaultValue="tab1">
|
|
2622
|
+
* <TabsList fullWidth>
|
|
2623
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
2624
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
2625
|
+
* </TabsList>
|
|
2626
|
+
* ...
|
|
2627
|
+
* </Tabs>
|
|
2628
|
+
*
|
|
2629
|
+
* // Vertical orientation
|
|
2630
|
+
* <Tabs orientation="vertical" defaultValue="tab1">
|
|
2631
|
+
* <TabsList>
|
|
2632
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
2633
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
2634
|
+
* </TabsList>
|
|
2635
|
+
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
2636
|
+
* </Tabs>
|
|
2637
|
+
* ```
|
|
2638
|
+
*/
|
|
2639
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
2640
|
+
/**
|
|
2641
|
+
* TabsList — the container for tab triggers (the tab bar).
|
|
2642
|
+
*
|
|
2643
|
+
* @example
|
|
2644
|
+
* ```tsx
|
|
2645
|
+
* <TabsList>
|
|
2646
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
2647
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
2648
|
+
* </TabsList>
|
|
2649
|
+
*
|
|
2650
|
+
* // Full-width stretch
|
|
2651
|
+
* <TabsList fullWidth>
|
|
2652
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
2653
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
2654
|
+
* </TabsList>
|
|
2655
|
+
* ```
|
|
2656
|
+
*/
|
|
2657
|
+
declare const TabsList: react.ForwardRefExoticComponent<TabsListProps & react.RefAttributes<HTMLDivElement>>;
|
|
2658
|
+
/**
|
|
2659
|
+
* TabsTrigger — an individual tab button within the TabsList.
|
|
2660
|
+
*
|
|
2661
|
+
* Renders a Framer Motion active indicator when the tab is selected,
|
|
2662
|
+
* creating a smooth sliding animation between active tabs.
|
|
2663
|
+
*
|
|
2664
|
+
* @example
|
|
2665
|
+
* ```tsx
|
|
2666
|
+
* <TabsTrigger value="overview">Overview</TabsTrigger>
|
|
2667
|
+
* <TabsTrigger value="analytics" icon={<BarChartIcon />}>Analytics</TabsTrigger>
|
|
2668
|
+
* <TabsTrigger value="locked" disabled>Locked</TabsTrigger>
|
|
2669
|
+
* ```
|
|
2670
|
+
*/
|
|
2671
|
+
declare const TabsTrigger: react.ForwardRefExoticComponent<TabsTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
2672
|
+
/**
|
|
2673
|
+
* TabsContent — the content panel associated with a tab trigger.
|
|
2674
|
+
*
|
|
2675
|
+
* @example
|
|
2676
|
+
* ```tsx
|
|
2677
|
+
* <TabsContent value="overview">
|
|
2678
|
+
* <p>Overview content goes here.</p>
|
|
2679
|
+
* </TabsContent>
|
|
2680
|
+
* ```
|
|
2681
|
+
*/
|
|
2682
|
+
declare const TabsContent: react.ForwardRefExoticComponent<TabsContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
2683
|
+
|
|
2684
|
+
declare const textareaVariants: (props?: ({
|
|
2685
|
+
variant?: "success" | "error" | "default" | null | undefined;
|
|
2686
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
2687
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2688
|
+
type TextareaVariant = "default" | "error" | "success";
|
|
2689
|
+
type TextareaSize = "sm" | "md" | "lg";
|
|
2690
|
+
interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, VariantProps<typeof textareaVariants> {
|
|
2691
|
+
/**
|
|
2692
|
+
* Visual variant of the textarea.
|
|
2693
|
+
* @default "default"
|
|
2694
|
+
*/
|
|
2695
|
+
variant?: TextareaVariant;
|
|
2696
|
+
/**
|
|
2697
|
+
* Size of the textarea.
|
|
2698
|
+
* @default "md"
|
|
2699
|
+
*/
|
|
2700
|
+
size?: TextareaSize;
|
|
2701
|
+
/**
|
|
2702
|
+
* Whether the textarea should automatically resize to fit its content.
|
|
2703
|
+
* When enabled, the native resize handle is hidden and the textarea
|
|
2704
|
+
* grows vertically as the user types.
|
|
2705
|
+
* @default false
|
|
2706
|
+
*/
|
|
2707
|
+
autoResize?: boolean;
|
|
2708
|
+
/**
|
|
2709
|
+
* Maximum height (in pixels) for the textarea when `autoResize` is enabled.
|
|
2710
|
+
* After reaching this height, the textarea will scroll instead of growing.
|
|
2711
|
+
* Only applies when `autoResize` is true.
|
|
2712
|
+
* @default undefined (no max height constraint)
|
|
2713
|
+
*/
|
|
2714
|
+
maxHeight?: number;
|
|
2715
|
+
/**
|
|
2716
|
+
* Minimum number of rows to display.
|
|
2717
|
+
* This sets the initial height of the textarea.
|
|
2718
|
+
* @default 3
|
|
2719
|
+
*/
|
|
2720
|
+
minRows?: number;
|
|
2721
|
+
/**
|
|
2722
|
+
* Whether to show the character count below the textarea.
|
|
2723
|
+
* When `maxLength` is also set, displays "current / max".
|
|
2724
|
+
* Otherwise, displays just the current count.
|
|
2725
|
+
* @default false
|
|
2726
|
+
*/
|
|
2727
|
+
showCount?: boolean;
|
|
2728
|
+
/**
|
|
2729
|
+
* Additional CSS classes for the outer wrapper element.
|
|
2730
|
+
* Use this when you need to control the width/margin of the textarea group.
|
|
2731
|
+
*/
|
|
2732
|
+
wrapperClassName?: string;
|
|
2733
|
+
/**
|
|
2734
|
+
* Additional CSS classes for the character count text.
|
|
2735
|
+
*/
|
|
2736
|
+
countClassName?: string;
|
|
2737
|
+
/** Additional CSS classes to merge on the textarea element. */
|
|
2738
|
+
className?: string;
|
|
2739
|
+
}
|
|
2740
|
+
/**
|
|
2741
|
+
* Textarea — a multi-line text input for capturing longer user content.
|
|
2742
|
+
*
|
|
2743
|
+
* Built on the design system's token layer with CVA for variant composition.
|
|
2744
|
+
* Shares the same visual language as the Input component for consistency.
|
|
2745
|
+
* All colors, radii, spacing, and transitions come from CSS custom properties
|
|
2746
|
+
* defined in design-system.css.
|
|
2747
|
+
*
|
|
2748
|
+
* Accessibility:
|
|
2749
|
+
* - Focus ring visible on keyboard navigation (focus-visible)
|
|
2750
|
+
* - Disabled state uses both `disabled` attribute and `aria-disabled`
|
|
2751
|
+
* - Error variant sets `aria-invalid="true"` automatically
|
|
2752
|
+
* - Supports `aria-describedby` for linking to error/helper messages
|
|
2753
|
+
* - Character count uses `aria-live="polite"` for screen reader updates
|
|
2754
|
+
*
|
|
2755
|
+
* @example
|
|
2756
|
+
* ```tsx
|
|
2757
|
+
* // Basic usage
|
|
2758
|
+
* <Textarea placeholder="Write something..." />
|
|
2759
|
+
*
|
|
2760
|
+
* // With variant
|
|
2761
|
+
* <Textarea variant="error" aria-describedby="desc-error" />
|
|
2762
|
+
* <Textarea variant="success" />
|
|
2763
|
+
*
|
|
2764
|
+
* // Auto-resize
|
|
2765
|
+
* <Textarea autoResize placeholder="This will grow as you type..." />
|
|
2766
|
+
* <Textarea autoResize maxHeight={200} placeholder="Grows up to 200px" />
|
|
2767
|
+
*
|
|
2768
|
+
* // Character count
|
|
2769
|
+
* <Textarea showCount placeholder="With counter" />
|
|
2770
|
+
* <Textarea showCount maxLength={500} placeholder="Max 500 chars" />
|
|
2771
|
+
*
|
|
2772
|
+
* // Sizes
|
|
2773
|
+
* <Textarea size="sm" placeholder="Small" />
|
|
2774
|
+
* <Textarea size="md" placeholder="Medium" />
|
|
2775
|
+
* <Textarea size="lg" placeholder="Large" />
|
|
2776
|
+
*
|
|
2777
|
+
* // Controlled with min rows
|
|
2778
|
+
* <Textarea
|
|
2779
|
+
* minRows={5}
|
|
2780
|
+
* value={text}
|
|
2781
|
+
* onChange={(e) => setText(e.target.value)}
|
|
2782
|
+
* />
|
|
2783
|
+
*
|
|
2784
|
+
* // Disabled / Read-only
|
|
2785
|
+
* <Textarea disabled placeholder="Disabled" />
|
|
2786
|
+
* <Textarea readOnly value="Read-only value" />
|
|
2787
|
+
* ```
|
|
2788
|
+
*/
|
|
2789
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
2790
|
+
|
|
2791
|
+
type ToastVariant = "default" | "success" | "warning" | "danger" | "info";
|
|
2792
|
+
type ToastPosition = "top-right" | "top-left" | "top-center" | "bottom-right" | "bottom-left" | "bottom-center";
|
|
2793
|
+
interface ToastAction {
|
|
2794
|
+
/** Label text for the action button. */
|
|
2795
|
+
label: string;
|
|
2796
|
+
/** Callback fired when the action button is clicked. */
|
|
2797
|
+
onClick: () => void;
|
|
2798
|
+
}
|
|
2799
|
+
interface ToastData {
|
|
2800
|
+
/** Unique ID for the toast instance. Auto-generated if not provided. */
|
|
2801
|
+
id: string;
|
|
2802
|
+
/** Semantic variant controlling color and icon. */
|
|
2803
|
+
variant: ToastVariant;
|
|
2804
|
+
/** Title text (short, bold). */
|
|
2805
|
+
title?: ReactNode;
|
|
2806
|
+
/** Description / body text. */
|
|
2807
|
+
description?: ReactNode;
|
|
2808
|
+
/** Auto-dismiss duration in milliseconds. 0 = no auto-dismiss. */
|
|
2809
|
+
duration: number;
|
|
2810
|
+
/** Optional action button. */
|
|
2811
|
+
action?: ToastAction;
|
|
2812
|
+
/** Timestamp when the toast was created. */
|
|
2813
|
+
createdAt: number;
|
|
2814
|
+
}
|
|
2815
|
+
interface ToastOptions {
|
|
2816
|
+
/** Title text. */
|
|
2817
|
+
title?: ReactNode;
|
|
2818
|
+
/** Description / body text. */
|
|
2819
|
+
description?: ReactNode;
|
|
2820
|
+
/** Auto-dismiss duration in milliseconds. @default 5000 */
|
|
2821
|
+
duration?: number;
|
|
2822
|
+
/** Optional action button. */
|
|
2823
|
+
action?: ToastAction;
|
|
2824
|
+
/** Custom toast ID (for deduplication). */
|
|
2825
|
+
id?: string;
|
|
2826
|
+
}
|
|
2827
|
+
interface ToastAPI {
|
|
2828
|
+
/** Show a default-styled toast. */
|
|
2829
|
+
toast: (messageOrOptions: string | ToastOptions) => string;
|
|
2830
|
+
/** Show a success toast. */
|
|
2831
|
+
success: (messageOrOptions: string | ToastOptions) => string;
|
|
2832
|
+
/** Show a warning toast. */
|
|
2833
|
+
warning: (messageOrOptions: string | ToastOptions) => string;
|
|
2834
|
+
/** Show a danger/error toast. */
|
|
2835
|
+
danger: (messageOrOptions: string | ToastOptions) => string;
|
|
2836
|
+
/** Show an info toast. */
|
|
2837
|
+
info: (messageOrOptions: string | ToastOptions) => string;
|
|
2838
|
+
/** Programmatically dismiss a specific toast by ID. */
|
|
2839
|
+
dismiss: (id: string) => void;
|
|
2840
|
+
/** Dismiss all toasts. */
|
|
2841
|
+
dismissAll: () => void;
|
|
2842
|
+
}
|
|
2843
|
+
interface ToastProviderProps {
|
|
2844
|
+
children: ReactNode;
|
|
2845
|
+
/**
|
|
2846
|
+
* Position of the toast container on screen.
|
|
2847
|
+
* @default "top-right"
|
|
2848
|
+
*/
|
|
2849
|
+
position?: ToastPosition;
|
|
2850
|
+
/**
|
|
2851
|
+
* Maximum number of visible toasts. Excess toasts are queued.
|
|
2852
|
+
* @default 5
|
|
2853
|
+
*/
|
|
2854
|
+
maxVisible?: number;
|
|
2855
|
+
/**
|
|
2856
|
+
* Default auto-dismiss duration in milliseconds.
|
|
2857
|
+
* Individual toasts can override this.
|
|
2858
|
+
* @default 5000
|
|
2859
|
+
*/
|
|
2860
|
+
defaultDuration?: number;
|
|
2861
|
+
/**
|
|
2862
|
+
* Gap between toasts in pixels.
|
|
2863
|
+
* @default 8
|
|
2864
|
+
*/
|
|
2865
|
+
gap?: number;
|
|
2866
|
+
}
|
|
2867
|
+
interface ToastItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2868
|
+
/** The toast data to render. */
|
|
2869
|
+
toast: ToastData;
|
|
2870
|
+
/** Callback to dismiss this toast. */
|
|
2871
|
+
onDismiss: (id: string) => void;
|
|
2872
|
+
/** Whether the toast container is in a bottom position. */
|
|
2873
|
+
isBottom: boolean;
|
|
2874
|
+
}
|
|
2875
|
+
declare const toastVariants: (props?: ({
|
|
2876
|
+
variant?: "info" | "success" | "warning" | "danger" | "default" | null | undefined;
|
|
2877
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2878
|
+
/**
|
|
2879
|
+
* ToastItem — a single toast notification.
|
|
2880
|
+
*
|
|
2881
|
+
* Handles auto-dismiss timing, pause-on-hover, close button, and
|
|
2882
|
+
* action button rendering.
|
|
2883
|
+
*/
|
|
2884
|
+
declare const ToastItem: react.ForwardRefExoticComponent<ToastItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
2885
|
+
/**
|
|
2886
|
+
* ToastProvider — wraps your application and provides the toast context.
|
|
2887
|
+
*
|
|
2888
|
+
* Renders a portal-mounted toast container at the specified viewport
|
|
2889
|
+
* position. Child components access the toast API via `useToast()`.
|
|
2890
|
+
*
|
|
2891
|
+
* @example
|
|
2892
|
+
* ```tsx
|
|
2893
|
+
* // In your root layout or providers
|
|
2894
|
+
* <ToastProvider position="top-right" maxVisible={5}>
|
|
2895
|
+
* <App />
|
|
2896
|
+
* </ToastProvider>
|
|
2897
|
+
*
|
|
2898
|
+
* // In any child component
|
|
2899
|
+
* function MyComponent() {
|
|
2900
|
+
* const toast = useToast();
|
|
2901
|
+
*
|
|
2902
|
+
* return (
|
|
2903
|
+
* <button onClick={() => toast.success("Saved!")}>
|
|
2904
|
+
* Save
|
|
2905
|
+
* </button>
|
|
2906
|
+
* );
|
|
2907
|
+
* }
|
|
2908
|
+
* ```
|
|
2909
|
+
*/
|
|
2910
|
+
declare function ToastProvider({ children, position, maxVisible, defaultDuration, gap, }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
2911
|
+
declare namespace ToastProvider {
|
|
2912
|
+
var displayName: string;
|
|
2913
|
+
}
|
|
2914
|
+
/**
|
|
2915
|
+
* useToast — imperative hook for showing toast notifications.
|
|
2916
|
+
*
|
|
2917
|
+
* Must be used within a `<ToastProvider>`.
|
|
2918
|
+
*
|
|
2919
|
+
* @example
|
|
2920
|
+
* ```tsx
|
|
2921
|
+
* const toast = useToast();
|
|
2922
|
+
*
|
|
2923
|
+
* // Simple string message
|
|
2924
|
+
* toast.success("File uploaded");
|
|
2925
|
+
* toast.danger("Upload failed");
|
|
2926
|
+
* toast.info("Processing...");
|
|
2927
|
+
* toast.warning("Disk space low");
|
|
2928
|
+
*
|
|
2929
|
+
* // With options
|
|
2930
|
+
* toast.success({
|
|
2931
|
+
* title: "Payment received",
|
|
2932
|
+
* description: "Order #12345 has been confirmed.",
|
|
2933
|
+
* duration: 8000,
|
|
2934
|
+
* });
|
|
2935
|
+
*
|
|
2936
|
+
* // With action button
|
|
2937
|
+
* toast.info({
|
|
2938
|
+
* title: "New version available",
|
|
2939
|
+
* description: "v2.1.0 is ready to install.",
|
|
2940
|
+
* action: { label: "Update now", onClick: () => doUpdate() },
|
|
2941
|
+
* });
|
|
2942
|
+
*
|
|
2943
|
+
* // Dismiss programmatically
|
|
2944
|
+
* const id = toast.info("Uploading...", { duration: 0 });
|
|
2945
|
+
* // ...later
|
|
2946
|
+
* toast.dismiss(id);
|
|
2947
|
+
*
|
|
2948
|
+
* // Dismiss all
|
|
2949
|
+
* toast.dismissAll();
|
|
2950
|
+
* ```
|
|
2951
|
+
*/
|
|
2952
|
+
declare function useToast(): ToastAPI;
|
|
2953
|
+
|
|
2954
|
+
type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
2955
|
+
type TooltipAlign = "start" | "center" | "end";
|
|
2956
|
+
interface TooltipProps {
|
|
2957
|
+
/**
|
|
2958
|
+
* The tooltip content. Can be a string or ReactNode.
|
|
2959
|
+
*/
|
|
2960
|
+
content: ReactNode;
|
|
2961
|
+
/**
|
|
2962
|
+
* The trigger element. Must be a single React element that accepts a ref.
|
|
2963
|
+
*/
|
|
2964
|
+
children: ReactNode;
|
|
2965
|
+
/**
|
|
2966
|
+
* The preferred side of the trigger to render the tooltip.
|
|
2967
|
+
* @default "top"
|
|
2968
|
+
*/
|
|
2969
|
+
side?: TooltipSide;
|
|
2970
|
+
/**
|
|
2971
|
+
* Alignment of the tooltip relative to the trigger.
|
|
2972
|
+
* @default "center"
|
|
2973
|
+
*/
|
|
2974
|
+
align?: TooltipAlign;
|
|
2975
|
+
/**
|
|
2976
|
+
* The distance in pixels from the trigger.
|
|
2977
|
+
* @default 6
|
|
2978
|
+
*/
|
|
2979
|
+
sideOffset?: number;
|
|
2980
|
+
/**
|
|
2981
|
+
* Whether to show an arrow pointing to the trigger.
|
|
2982
|
+
* @default true
|
|
2983
|
+
*/
|
|
2984
|
+
arrow?: boolean;
|
|
2985
|
+
/**
|
|
2986
|
+
* Maximum width of the tooltip content.
|
|
2987
|
+
* @default 220
|
|
2988
|
+
*/
|
|
2989
|
+
maxWidth?: number;
|
|
2990
|
+
/**
|
|
2991
|
+
* Delay in ms before the tooltip opens.
|
|
2992
|
+
* @default 300
|
|
2993
|
+
*/
|
|
2994
|
+
delayDuration?: number;
|
|
2995
|
+
/**
|
|
2996
|
+
* Delay in ms before the tooltip closes after leaving.
|
|
2997
|
+
* @default 0
|
|
2998
|
+
*/
|
|
2999
|
+
skipDelayDuration?: number;
|
|
3000
|
+
/**
|
|
3001
|
+
* Whether the tooltip is open (controlled).
|
|
3002
|
+
*/
|
|
3003
|
+
open?: boolean;
|
|
3004
|
+
/**
|
|
3005
|
+
* Callback when the open state changes.
|
|
3006
|
+
*/
|
|
3007
|
+
onOpenChange?: (open: boolean) => void;
|
|
3008
|
+
/**
|
|
3009
|
+
* Additional CSS classes for the tooltip content element.
|
|
3010
|
+
*/
|
|
3011
|
+
contentClassName?: string;
|
|
3012
|
+
}
|
|
3013
|
+
interface TooltipProviderProps extends ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider> {
|
|
3014
|
+
children: ReactNode;
|
|
3015
|
+
}
|
|
3016
|
+
/**
|
|
3017
|
+
* TooltipProvider — wraps your application (or a subtree) to configure
|
|
3018
|
+
* shared tooltip behavior like delay duration.
|
|
3019
|
+
*
|
|
3020
|
+
* Should be placed near the root of your app, or around any section
|
|
3021
|
+
* that uses tooltips.
|
|
3022
|
+
*
|
|
3023
|
+
* @example
|
|
3024
|
+
* ```tsx
|
|
3025
|
+
* <TooltipProvider delayDuration={200}>
|
|
3026
|
+
* <App />
|
|
3027
|
+
* </TooltipProvider>
|
|
3028
|
+
* ```
|
|
3029
|
+
*/
|
|
3030
|
+
declare function TooltipProvider({ children, delayDuration, skipDelayDuration, ...rest }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
3031
|
+
declare namespace TooltipProvider {
|
|
3032
|
+
var displayName: string;
|
|
3033
|
+
}
|
|
3034
|
+
/**
|
|
3035
|
+
* Tooltip — a small popup that displays informative text when hovering
|
|
3036
|
+
* or focusing on a trigger element.
|
|
3037
|
+
*
|
|
3038
|
+
* Built on Radix UI's Tooltip primitive for full accessibility. The tooltip
|
|
3039
|
+
* appears after a configurable delay and supports keyboard access.
|
|
3040
|
+
*
|
|
3041
|
+
* Accessibility:
|
|
3042
|
+
* - Radix handles `role="tooltip"` and `aria-describedby` automatically
|
|
3043
|
+
* - Opens on hover and focus, closes on blur and Escape
|
|
3044
|
+
* - Keyboard accessible: focusable triggers show the tooltip
|
|
3045
|
+
* - Content is announced by screen readers
|
|
3046
|
+
*
|
|
3047
|
+
* @example
|
|
3048
|
+
* ```tsx
|
|
3049
|
+
* // Basic usage (wrap app in TooltipProvider first)
|
|
3050
|
+
* <Tooltip content="Save your changes">
|
|
3051
|
+
* <button>Save</button>
|
|
3052
|
+
* </Tooltip>
|
|
3053
|
+
*
|
|
3054
|
+
* // With side placement
|
|
3055
|
+
* <Tooltip content="More options" side="right">
|
|
3056
|
+
* <button>⋮</button>
|
|
3057
|
+
* </Tooltip>
|
|
3058
|
+
*
|
|
3059
|
+
* // Without arrow
|
|
3060
|
+
* <Tooltip content="Delete" arrow={false}>
|
|
3061
|
+
* <button>🗑️</button>
|
|
3062
|
+
* </Tooltip>
|
|
3063
|
+
*
|
|
3064
|
+
* // Custom max width
|
|
3065
|
+
* <Tooltip content="This is a longer tooltip that needs more space" maxWidth={300}>
|
|
3066
|
+
* <span>Hover me</span>
|
|
3067
|
+
* </Tooltip>
|
|
3068
|
+
*
|
|
3069
|
+
* // Controlled
|
|
3070
|
+
* <Tooltip content="Info" open={isOpen} onOpenChange={setIsOpen}>
|
|
3071
|
+
* <button>i</button>
|
|
3072
|
+
* </Tooltip>
|
|
3073
|
+
* ```
|
|
3074
|
+
*/
|
|
3075
|
+
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3076
|
+
|
|
3077
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionProps, type AccordionSingleProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, Alert, type AlertProps, type AlertVariant, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, type BreadcrumbListProps, BreadcrumbNav, type BreadcrumbNavItem, type BreadcrumbNavProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, type CardVariant, Checkbox, CheckboxGroup, type CheckboxGroupOrientation, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, Dialog, DialogBody, type DialogBodyProps, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, Input, type InputProps, type InputSize, type InputVariant, Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, Popover, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, RadioCard, type RadioCardProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RadioOrientation, type RadioSize, Select, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, type SelectVariant, Sheet, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, type SheetSize, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, Skeleton, SkeletonCircle, type SkeletonCircleProps, type SkeletonProps, SkeletonRect, type SkeletonRectProps, type SkeletonSize, SkeletonText, type SkeletonTextProps, type SkeletonTextSize, Switch, type SwitchLabelPosition, type SwitchProps, type SwitchSize, Table, type TableAlign, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, type TableDensity, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, type TableSortDirection, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsOrientation, type TabsProps, type TabsSize, TabsTrigger, type TabsTriggerProps, type TabsVariant, Textarea, type TextareaProps, type TextareaSize, type TextareaVariant, type ToastAPI, type ToastAction, type ToastData, ToastItem, type ToastItemProps, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipAlign, type TooltipProps, TooltipProvider, type TooltipProviderProps, type TooltipSide, accordionRootVariants, accordionTriggerVariants, alertVariants, avatarVariants, badgeVariants, buttonVariants, cardVariants, checkboxVariants, dialogContentVariants, inputVariants, paginationButtonVariants, radioCardVariants, radioGroupVariants, radioIndicatorVariants, selectTriggerVariants, sheetContentVariants, skeletonVariants, switchThumbVariants, switchTrackVariants, tableRootVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, toastVariants, useCheckboxGroupContext, useToast };
|