@nextlyhq/ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +93 -0
- package/dist/index.cjs +2404 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2319 -0
- package/dist/index.d.ts +2319 -0
- package/dist/index.mjs +2230 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +104 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2319 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ButtonHTMLAttributes, ComponentProps, TextareaHTMLAttributes, HTMLAttributes, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
4
|
+
import * as class_variance_authority from 'class-variance-authority';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import { Root } from '@radix-ui/react-label';
|
|
8
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
9
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
10
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
11
|
+
import { Root as Root$1 } from '@radix-ui/react-switch';
|
|
12
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
13
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
14
|
+
import { Content, Item, Root as Root$2, Trigger } from '@radix-ui/react-accordion';
|
|
15
|
+
import * as _radix_ui_react_tabs from '@radix-ui/react-tabs';
|
|
16
|
+
import { Content as Content$1, List, Root as Root$3, Trigger as Trigger$1 } from '@radix-ui/react-tabs';
|
|
17
|
+
import * as _radix_ui_react_tooltip from '@radix-ui/react-tooltip';
|
|
18
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
19
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
20
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
21
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
22
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
23
|
+
import { Command as Command$1 } from 'cmdk';
|
|
24
|
+
import { LucideProps } from 'lucide-react';
|
|
25
|
+
import { ToasterProps } from 'sonner';
|
|
26
|
+
export { ToasterProps, toast } from 'sonner';
|
|
27
|
+
import { ClassValue } from 'clsx';
|
|
28
|
+
|
|
29
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Button Component - Design System Specification
|
|
35
|
+
*
|
|
36
|
+
* Interactive button element for user actions. Supports multiple variants,
|
|
37
|
+
* sizes, and the asChild pattern for composition.
|
|
38
|
+
*
|
|
39
|
+
* Variants:
|
|
40
|
+
* - default/primary: Primary action button (blue background, white text)
|
|
41
|
+
* - secondary: Secondary action button (gray background)
|
|
42
|
+
* - destructive: Destructive action button (red background)
|
|
43
|
+
* - outline: Outlined button (transparent background, border)
|
|
44
|
+
* - ghost: Minimal button (transparent, no border)
|
|
45
|
+
* - link: Link-style button (underlined text)
|
|
46
|
+
*
|
|
47
|
+
* Note: 'primary' is a semantic alias for 'default' variant for better code readability
|
|
48
|
+
*/
|
|
49
|
+
declare const buttonVariants: (props?: ({
|
|
50
|
+
variant?: "default" | "primary" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
51
|
+
size?: "default" | "sm" | "md" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
52
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
53
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Input Component - Design System Specification
|
|
57
|
+
*
|
|
58
|
+
* Text input fields for collecting user data. Supports various types (text,
|
|
59
|
+
* email, password, number) and three size variants.
|
|
60
|
+
*
|
|
61
|
+
* Accessibility:
|
|
62
|
+
* - Full keyboard navigation support
|
|
63
|
+
* - Proper focus indicators (2px ring with offset)
|
|
64
|
+
* - Error state support via aria-invalid
|
|
65
|
+
* - Label association via htmlFor/id
|
|
66
|
+
* - Placeholder text for guidance (not a replacement for labels)
|
|
67
|
+
*
|
|
68
|
+
* Design Specs:
|
|
69
|
+
* - Height: sm=32px, default=40px, lg=44px
|
|
70
|
+
* - Padding: Horizontal varies by size (sm=10px, default=12px, lg=16px)
|
|
71
|
+
* - Border radius: 0px (rounded-none)
|
|
72
|
+
* - Border: 1px solid, changes on focus/error
|
|
73
|
+
* - Transition: 150ms (consistent with design system)
|
|
74
|
+
* - Font size: sm/default=14px (text-sm), lg=16px (text-base)
|
|
75
|
+
*
|
|
76
|
+
* Size Variants:
|
|
77
|
+
* - sm: Height 32px (h-8) - Compact forms, filters
|
|
78
|
+
* - default: Height 40px (h-10) - Standard forms
|
|
79
|
+
* - lg: Height 44px (h-11) - Prominent inputs, marketing forms
|
|
80
|
+
*
|
|
81
|
+
* Supported Types:
|
|
82
|
+
* - text: General text input
|
|
83
|
+
* - email: Email validation
|
|
84
|
+
* - password: Hidden text input
|
|
85
|
+
* - number: Numeric input with steppers
|
|
86
|
+
* - tel: Phone number input
|
|
87
|
+
* - url: URL validation
|
|
88
|
+
* - search: Search input with clear button
|
|
89
|
+
*/
|
|
90
|
+
declare const inputVariants: (props?: ({
|
|
91
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
92
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
93
|
+
interface InputProps extends Omit<ComponentProps<"input">, "size">, VariantProps<typeof inputVariants> {
|
|
94
|
+
}
|
|
95
|
+
declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
96
|
+
|
|
97
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
98
|
+
|
|
99
|
+
declare function Label({ className, ...props }: ComponentProps<typeof Root>): react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Badge Component - Design System Specification
|
|
103
|
+
*
|
|
104
|
+
* Badges are non-interactive elements used to highlight important information,
|
|
105
|
+
* such as status indicators, counts, or labels. They should not be focusable
|
|
106
|
+
* or interactive.
|
|
107
|
+
*
|
|
108
|
+
* Accessibility:
|
|
109
|
+
* - Badges are non-interactive (no keyboard focus or click handlers)
|
|
110
|
+
* - Color is not the only indicator - text conveys meaning
|
|
111
|
+
* - Use aria-label for icon-only badges to provide context
|
|
112
|
+
* - Provide contextual information in surrounding UI
|
|
113
|
+
*
|
|
114
|
+
* Design Specs:
|
|
115
|
+
* - Height: 22px
|
|
116
|
+
* - Padding: 2px 10px (vertical × horizontal)
|
|
117
|
+
* - Border radius: Full (pill shape)
|
|
118
|
+
* - Font: 12px (text-xs), medium weight (500)
|
|
119
|
+
* - Colors: Light backgrounds with dark text for visibility in both light/dark modes
|
|
120
|
+
*
|
|
121
|
+
* Variants (6 total per design spec):
|
|
122
|
+
* - default: Light gray background
|
|
123
|
+
* - primary: Light blue background
|
|
124
|
+
* - success: Light green background
|
|
125
|
+
* - warning: Light amber background
|
|
126
|
+
* - destructive: Light red background
|
|
127
|
+
* - outline: Transparent background with border border-primary/5
|
|
128
|
+
*/
|
|
129
|
+
declare const badgeVariants: (props?: ({
|
|
130
|
+
variant?: "default" | "primary" | "destructive" | "outline" | "success" | "warning" | null | undefined;
|
|
131
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
132
|
+
interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
133
|
+
}
|
|
134
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Card Component - Design System Specification
|
|
138
|
+
*
|
|
139
|
+
* A container component for grouping related content with clear visual separation.
|
|
140
|
+
* Cards provide a structured layout with header, content, and footer sections.
|
|
141
|
+
*
|
|
142
|
+
* Design Specs:
|
|
143
|
+
* - Border radius: 0px (rounded-none)
|
|
144
|
+
* - Padding: 24px (p-6) for header/content, 16px 24px for footer
|
|
145
|
+
* - Shadow: sm (default), md (hover/elevated)
|
|
146
|
+
* - Border: 1px solid border border-primary/5 color
|
|
147
|
+
*
|
|
148
|
+
* Variants:
|
|
149
|
+
* - default: Standard card with subtle shadow
|
|
150
|
+
* - interactive: Hover effects for clickable cards (border border-primary/5 highlight, shadow increase)
|
|
151
|
+
* ⚠️ IMPORTANT: When using the interactive variant, you MUST add appropriate
|
|
152
|
+
* accessibility attributes:
|
|
153
|
+
* - Add role="button" or use an actual <button> wrapper
|
|
154
|
+
* - Add tabIndex={0} to make it keyboard accessible
|
|
155
|
+
* - Add onClick handler for mouse/touch interaction
|
|
156
|
+
* - Add onKeyDown handler to support Enter/Space keys
|
|
157
|
+
* - Add aria-label or aria-labelledby to describe the action
|
|
158
|
+
* Example:
|
|
159
|
+
* <Card
|
|
160
|
+
* variant="interactive"
|
|
161
|
+
* role="button"
|
|
162
|
+
* tabIndex={0}
|
|
163
|
+
* onClick={handleClick}
|
|
164
|
+
* onKeyDown={(e) => e.key === 'Enter' && handleClick()}
|
|
165
|
+
* aria-label="View user details"
|
|
166
|
+
* >
|
|
167
|
+
* - elevated: More prominent shadow for emphasis
|
|
168
|
+
*
|
|
169
|
+
* Structure:
|
|
170
|
+
* <Card>
|
|
171
|
+
* <CardHeader>
|
|
172
|
+
* <CardTitle>Title</CardTitle>
|
|
173
|
+
* <CardDescription>Description</CardDescription>
|
|
174
|
+
* <CardAction>Action buttons</CardAction>
|
|
175
|
+
* </CardHeader>
|
|
176
|
+
* <CardContent>Main content</CardContent>
|
|
177
|
+
* <CardFooter>Footer actions</CardFooter>
|
|
178
|
+
* </Card>
|
|
179
|
+
*
|
|
180
|
+
* Accessibility:
|
|
181
|
+
* - Semantic HTML structure supports screen readers
|
|
182
|
+
* - Interactive cards MUST have role, tabIndex, and keyboard handlers (see above)
|
|
183
|
+
* - Ensure sufficient color contrast for all text (WCAG 2.2 AA minimum)
|
|
184
|
+
* - Use aria-label or aria-labelledby for cards without visible text labels
|
|
185
|
+
*/
|
|
186
|
+
declare const cardVariants: (props?: ({
|
|
187
|
+
variant?: "default" | "interactive" | "elevated" | null | undefined;
|
|
188
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
189
|
+
type CardProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardVariants>;
|
|
190
|
+
declare const Card: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
191
|
+
variant?: "default" | "interactive" | "elevated" | null | undefined;
|
|
192
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
193
|
+
interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
194
|
+
/**
|
|
195
|
+
* Whether to hide the bottom border border-primary/5 separator between header and content.
|
|
196
|
+
* Default: false (border border-primary/5 is shown per design spec)
|
|
197
|
+
*/
|
|
198
|
+
noBorder?: boolean;
|
|
199
|
+
}
|
|
200
|
+
declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
201
|
+
type CardTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
202
|
+
declare const CardTitle: react.ForwardRefExoticComponent<CardTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
203
|
+
type CardDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
204
|
+
declare const CardDescription: react.ForwardRefExoticComponent<CardDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
205
|
+
type CardActionProps = HTMLAttributes<HTMLDivElement>;
|
|
206
|
+
declare const CardAction: react.ForwardRefExoticComponent<CardActionProps & react.RefAttributes<HTMLDivElement>>;
|
|
207
|
+
type CardContentProps = HTMLAttributes<HTMLDivElement>;
|
|
208
|
+
declare const CardContent: react.ForwardRefExoticComponent<CardContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
209
|
+
type CardFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
210
|
+
declare const CardFooter: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Alert Component - Design System Specification
|
|
214
|
+
*
|
|
215
|
+
* Alerts display important messages that require user attention or awareness.
|
|
216
|
+
* They are non-interactive callouts used for inline notifications and feedback.
|
|
217
|
+
*
|
|
218
|
+
* Design Specs:
|
|
219
|
+
* - Padding: 16px (p-4)
|
|
220
|
+
* - Border radius: 0px (rounded-none) - intentionally smaller than Card (12px)
|
|
221
|
+
* for inline/flow content vs. larger container components
|
|
222
|
+
* - Border: 1px solid matching variant color
|
|
223
|
+
* - Shadow: sm (subtle elevation)
|
|
224
|
+
* - Font: 14px (text-sm)
|
|
225
|
+
* - Layout: Flex with gap-3 for icon/content spacing
|
|
226
|
+
* - Colors: Light backgrounds with dark text for WCAG 2.2 AA compliance
|
|
227
|
+
*
|
|
228
|
+
* Variants (4 total):
|
|
229
|
+
* - info (default): Blue - informational messages, neutral announcements
|
|
230
|
+
* - success: Green - successful operations, confirmations
|
|
231
|
+
* - warning: Amber - cautions, warnings that need attention
|
|
232
|
+
* - destructive: Red - errors, critical issues, failures
|
|
233
|
+
*
|
|
234
|
+
* Structure:
|
|
235
|
+
* <Alert variant="info">
|
|
236
|
+
* <InfoIcon className="h-4 w-4" />
|
|
237
|
+
* <div>
|
|
238
|
+
* <AlertTitle>Optional Title</AlertTitle>
|
|
239
|
+
* <AlertDescription>Alert message content</AlertDescription>
|
|
240
|
+
* </div>
|
|
241
|
+
* </Alert>
|
|
242
|
+
*
|
|
243
|
+
* Accessibility:
|
|
244
|
+
* - Defaults to role="alert" for assertive screen reader announcements
|
|
245
|
+
* - Override with role="status" for non-urgent updates (polite announcements)
|
|
246
|
+
* - Override with role={undefined} to remove ARIA role if needed
|
|
247
|
+
* - Color is not the only indicator - icons and text convey meaning
|
|
248
|
+
* - Supports rich content (links, lists) within AlertDescription
|
|
249
|
+
* - WCAG 2.2 AA compliant color contrast (4.5:1 minimum)
|
|
250
|
+
*
|
|
251
|
+
* Usage Examples:
|
|
252
|
+
*
|
|
253
|
+
* // Simple alert with icon and description (default role="alert")
|
|
254
|
+
* <Alert variant="success">
|
|
255
|
+
* <CheckCircle2 className="h-4 w-4" />
|
|
256
|
+
* <AlertDescription>User created successfully!</AlertDescription>
|
|
257
|
+
* </Alert>
|
|
258
|
+
*
|
|
259
|
+
* // Alert with title and description
|
|
260
|
+
* <Alert variant="warning">
|
|
261
|
+
* <AlertTriangle className="h-4 w-4" />
|
|
262
|
+
* <div>
|
|
263
|
+
* <AlertTitle>Warning</AlertTitle>
|
|
264
|
+
* <AlertDescription>This action cannot be undone.</AlertDescription>
|
|
265
|
+
* </div>
|
|
266
|
+
* </Alert>
|
|
267
|
+
*
|
|
268
|
+
* // Non-urgent informational update
|
|
269
|
+
* <Alert variant="info" role="status">
|
|
270
|
+
* <AlertCircle className="h-4 w-4" />
|
|
271
|
+
* <AlertDescription>New features are now available.</AlertDescription>
|
|
272
|
+
* </Alert>
|
|
273
|
+
*
|
|
274
|
+
* Icons (from lucide-react):
|
|
275
|
+
* - Info: <AlertCircle className="h-4 w-4" />
|
|
276
|
+
* - Success: <CheckCircle2 className="h-4 w-4" />
|
|
277
|
+
* - Warning: <AlertTriangle className="h-4 w-4" />
|
|
278
|
+
* - Destructive: <XCircle className="h-4 w-4" />
|
|
279
|
+
*/
|
|
280
|
+
declare const alertVariants: (props?: ({
|
|
281
|
+
variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
282
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
283
|
+
type AlertProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>;
|
|
284
|
+
/**
|
|
285
|
+
* Alert - Root container for alert messages
|
|
286
|
+
*
|
|
287
|
+
* Defaults to role="alert" for screen reader announcements. Override with
|
|
288
|
+
* role="status" for non-urgent updates or role={undefined} to remove.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* <Alert variant="success">
|
|
292
|
+
* <CheckCircle2 className="h-4 w-4" />
|
|
293
|
+
* <AlertDescription>Operation completed successfully</AlertDescription>
|
|
294
|
+
* </Alert>
|
|
295
|
+
*/
|
|
296
|
+
declare const Alert: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
297
|
+
variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
298
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
299
|
+
type AlertTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
300
|
+
/**
|
|
301
|
+
* AlertTitle - Heading text for alert message
|
|
302
|
+
*
|
|
303
|
+
* Renders as <h5> for semantic HTML structure. Use for brief, scannable
|
|
304
|
+
* alert headings that summarize the message (e.g., "Success", "Warning").
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* <AlertTitle>Payment Successful</AlertTitle>
|
|
308
|
+
*/
|
|
309
|
+
declare const AlertTitle: react.ForwardRefExoticComponent<AlertTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
310
|
+
type AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
311
|
+
/**
|
|
312
|
+
* AlertDescription - Supporting detail text for alert message
|
|
313
|
+
*
|
|
314
|
+
* Renders as <div> to support rich content (links, lists, formatting).
|
|
315
|
+
* Use for detailed explanations, instructions, or contextual information.
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* <AlertDescription>
|
|
319
|
+
* Your changes have been saved. <a href="/view">View details</a>
|
|
320
|
+
* </AlertDescription>
|
|
321
|
+
*/
|
|
322
|
+
declare const AlertDescription: react.ForwardRefExoticComponent<AlertDescriptionProps & react.RefAttributes<HTMLDivElement>>;
|
|
323
|
+
|
|
324
|
+
declare function Separator({ className, orientation, decorative, ...props }: react.ComponentProps<typeof SeparatorPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Skeleton Loading Component
|
|
328
|
+
*
|
|
329
|
+
* A flexible loading placeholder component that provides visual feedback while content is loading.
|
|
330
|
+
* Uses a subtle pulse animation to indicate ongoing loading state.
|
|
331
|
+
*
|
|
332
|
+
* @design_specs
|
|
333
|
+
* - Background: bg-accent (slate-100 in light mode, slate-800 in dark mode)
|
|
334
|
+
* - Animation: animate-pulse with motion-reduce:animate-none (respects prefers-reduced-motion)
|
|
335
|
+
* - Border-radius: 0px (rounded-none)
|
|
336
|
+
* - Contrast: 3:1 minimum for WCAG 1.4.11 (Non-text Contrast) compliance
|
|
337
|
+
*
|
|
338
|
+
* @accessibility
|
|
339
|
+
* - Uses aria-hidden="true" to hide from screen readers (visual indicator only)
|
|
340
|
+
* - Skeleton should be purely decorative - actual loading state must be conveyed via:
|
|
341
|
+
* 1. aria-busy="true" on the parent content container
|
|
342
|
+
* 2. Visually hidden loading text for screen readers
|
|
343
|
+
* - Animation automatically disabled when user prefers reduced motion
|
|
344
|
+
* - Reference: https://adrianroselli.com/2020/11/more-accessible-skeletons.html
|
|
345
|
+
*
|
|
346
|
+
* @usage_patterns
|
|
347
|
+
*
|
|
348
|
+
* **Text Line Skeleton:**
|
|
349
|
+
* ```tsx
|
|
350
|
+
* <Skeleton className="h-4 w-[250px]" />
|
|
351
|
+
* ```
|
|
352
|
+
*
|
|
353
|
+
* **Avatar Skeleton:**
|
|
354
|
+
* ```tsx
|
|
355
|
+
* <Skeleton className="h-12 w-12 rounded-none" />
|
|
356
|
+
* ```
|
|
357
|
+
*
|
|
358
|
+
* **Card Skeleton:**
|
|
359
|
+
* ```tsx
|
|
360
|
+
* <div className="space-y-3">
|
|
361
|
+
* <Skeleton className="h-[125px] w-[250px] rounded-none" />
|
|
362
|
+
* <div className="space-y-2">
|
|
363
|
+
* <Skeleton className="h-4 w-[250px]" />
|
|
364
|
+
* <Skeleton className="h-4 w-[200px]" />
|
|
365
|
+
* </div>
|
|
366
|
+
* </div>
|
|
367
|
+
* ```
|
|
368
|
+
*
|
|
369
|
+
* **Proper Accessible Loading Pattern:**
|
|
370
|
+
* ```tsx
|
|
371
|
+
* <div aria-busy={isLoading} aria-label="User profile">
|
|
372
|
+
* {isLoading ? (
|
|
373
|
+
* <>
|
|
374
|
+
* <span className="sr-only">Loading user profile...</span>
|
|
375
|
+
* <Skeleton className="h-12 w-12 rounded-none" />
|
|
376
|
+
* <Skeleton className="h-4 w-[200px]" />
|
|
377
|
+
* </>
|
|
378
|
+
* ) : (
|
|
379
|
+
* <UserProfile data={userData} />
|
|
380
|
+
* )}
|
|
381
|
+
* </div>
|
|
382
|
+
* ```
|
|
383
|
+
*
|
|
384
|
+
* @important
|
|
385
|
+
* - DO: Use aria-busy="true" on the parent container while loading
|
|
386
|
+
* - DO: Provide visually hidden loading text for screen readers
|
|
387
|
+
* - DO: Control dimensions via className (h-* w-* utilities)
|
|
388
|
+
* - DON'T: Use aria-live, role="alert", or role="progressbar" on skeleton
|
|
389
|
+
* - DON'T: Use skeleton without aria-busy on parent container
|
|
390
|
+
*
|
|
391
|
+
* @wcag_compliance WCAG 2.2 Level AA
|
|
392
|
+
* - 1.4.11 Non-text Contrast: ✅ 3:1 minimum contrast ratio
|
|
393
|
+
* - 2.3.3 Animation from Interactions: ✅ Respects prefers-reduced-motion
|
|
394
|
+
* - 4.1.3 Status Messages: ✅ When used with aria-busy on parent
|
|
395
|
+
*
|
|
396
|
+
* @see {@link https://ui.shadcn.com/docs/components/skeleton shadcn/ui Skeleton}
|
|
397
|
+
* @see {@link https://adrianroselli.com/2020/11/more-accessible-skeletons.html More Accessible Skeletons}
|
|
398
|
+
*/
|
|
399
|
+
declare const Skeleton: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
400
|
+
type SkeletonProps = react.ComponentProps<"div">;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Progress variants using CVA
|
|
404
|
+
*
|
|
405
|
+
* Defines color variants for different progress states.
|
|
406
|
+
*/
|
|
407
|
+
declare const progressVariants: (props?: ({
|
|
408
|
+
variant?: "default" | "success" | "error" | null | undefined;
|
|
409
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
410
|
+
/**
|
|
411
|
+
* Progress component props
|
|
412
|
+
*/
|
|
413
|
+
type ProgressProps = {
|
|
414
|
+
/**
|
|
415
|
+
* Current progress value (0-100)
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* <Progress value={45} /> // 45% progress
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
value: number;
|
|
423
|
+
/**
|
|
424
|
+
* Maximum value (default: 100)
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* ```tsx
|
|
428
|
+
* <Progress value={30} max={50} /> // 60% progress (30/50)
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
max?: number;
|
|
432
|
+
/**
|
|
433
|
+
* Visual variant for different states
|
|
434
|
+
*
|
|
435
|
+
* - `default`: Primary blue (bg-primary-500)
|
|
436
|
+
* - `success`: Green (bg-green-500)
|
|
437
|
+
* - `error`: Red (bg-destructive)
|
|
438
|
+
*
|
|
439
|
+
* @default "default"
|
|
440
|
+
*/
|
|
441
|
+
variant?: VariantProps<typeof progressVariants>["variant"];
|
|
442
|
+
/**
|
|
443
|
+
* Optional CSS class name for custom styling
|
|
444
|
+
*/
|
|
445
|
+
className?: string;
|
|
446
|
+
/**
|
|
447
|
+
* Optional ARIA label for screen readers
|
|
448
|
+
*
|
|
449
|
+
* If not provided, defaults to "Progress: X%"
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```tsx
|
|
453
|
+
* <Progress value={45} aria-label="Uploading image.jpg: 45%" />
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
"aria-label"?: string;
|
|
457
|
+
} & react.HTMLAttributes<HTMLDivElement>;
|
|
458
|
+
/**
|
|
459
|
+
* Progress component
|
|
460
|
+
*
|
|
461
|
+
* Displays a horizontal progress bar with smooth animations and variant support.
|
|
462
|
+
*
|
|
463
|
+
* @param props - Progress component props
|
|
464
|
+
* @returns Progress bar component
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```tsx
|
|
468
|
+
* function FileUpload() {
|
|
469
|
+
* const [progress, setProgress] = React.useState(0);
|
|
470
|
+
*
|
|
471
|
+
* return (
|
|
472
|
+
* <div>
|
|
473
|
+
* <p>Uploading file...</p>
|
|
474
|
+
* <Progress value={progress} aria-label={`Upload progress: ${progress}%`} />
|
|
475
|
+
* </div>
|
|
476
|
+
* );
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
declare const Progress: react.ForwardRefExoticComponent<{
|
|
481
|
+
/**
|
|
482
|
+
* Current progress value (0-100)
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```tsx
|
|
486
|
+
* <Progress value={45} /> // 45% progress
|
|
487
|
+
* ```
|
|
488
|
+
*/
|
|
489
|
+
value: number;
|
|
490
|
+
/**
|
|
491
|
+
* Maximum value (default: 100)
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
* ```tsx
|
|
495
|
+
* <Progress value={30} max={50} /> // 60% progress (30/50)
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
max?: number;
|
|
499
|
+
/**
|
|
500
|
+
* Visual variant for different states
|
|
501
|
+
*
|
|
502
|
+
* - `default`: Primary blue (bg-primary-500)
|
|
503
|
+
* - `success`: Green (bg-green-500)
|
|
504
|
+
* - `error`: Red (bg-destructive)
|
|
505
|
+
*
|
|
506
|
+
* @default "default"
|
|
507
|
+
*/
|
|
508
|
+
variant?: VariantProps<typeof progressVariants>["variant"];
|
|
509
|
+
/**
|
|
510
|
+
* Optional CSS class name for custom styling
|
|
511
|
+
*/
|
|
512
|
+
className?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Optional ARIA label for screen readers
|
|
515
|
+
*
|
|
516
|
+
* If not provided, defaults to "Progress: X%"
|
|
517
|
+
*
|
|
518
|
+
* @example
|
|
519
|
+
* ```tsx
|
|
520
|
+
* <Progress value={45} aria-label="Uploading image.jpg: 45%" />
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
"aria-label"?: string;
|
|
524
|
+
} & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
525
|
+
|
|
526
|
+
declare const Checkbox: react.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
527
|
+
indeterminate?: boolean;
|
|
528
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* RadioGroup Component - Design System Specification
|
|
532
|
+
*
|
|
533
|
+
* Radio buttons allow users to select a single option from a set of mutually
|
|
534
|
+
* exclusive options. They should be used when only one selection is allowed.
|
|
535
|
+
*
|
|
536
|
+
* Accessibility:
|
|
537
|
+
* - Full keyboard navigation support (Arrow keys, Tab, Space)
|
|
538
|
+
* - Proper ARIA attributes provided by Radix UI
|
|
539
|
+
* - Focus indicators for keyboard users
|
|
540
|
+
* - Disabled state support
|
|
541
|
+
*
|
|
542
|
+
* Design Specs:
|
|
543
|
+
* - Size: 16px (h-4 w-4) - Fixed size matching Checkbox
|
|
544
|
+
* - Border: 1px solid, expands to 5px when checked (visual indicator)
|
|
545
|
+
* - Border radius: Full (rounded-none)
|
|
546
|
+
* - Transition: 150ms (consistent with design system)
|
|
547
|
+
* - Focus ring: 2px ring with 2px offset
|
|
548
|
+
*
|
|
549
|
+
* Implementation Notes:
|
|
550
|
+
* - Uses Radix UI primitives for robust accessibility
|
|
551
|
+
* - Visual "checked" state achieved via border border-primary/5 expansion (border-[5px])
|
|
552
|
+
* - No inner indicator needed - border border-primary/5 expansion provides clear visual feedback
|
|
553
|
+
* - Hover state changes border border-primary/5 color for better interactivity
|
|
554
|
+
*/
|
|
555
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
556
|
+
declare const RadioGroupItem: react.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
557
|
+
|
|
558
|
+
declare function Switch({ className, ...props }: ComponentProps<typeof Root$1>): react_jsx_runtime.JSX.Element;
|
|
559
|
+
|
|
560
|
+
declare const Collapsible: react.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & react.RefAttributes<HTMLDivElement>>;
|
|
561
|
+
declare const CollapsibleTrigger: react.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
562
|
+
declare const CollapsibleContent: react.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Props for the Accordion root component
|
|
566
|
+
* @see https://www.radix-ui.com/primitives/docs/components/accordion
|
|
567
|
+
*/
|
|
568
|
+
type AccordionProps = ComponentPropsWithoutRef<typeof Root$2>;
|
|
569
|
+
/**
|
|
570
|
+
* Props for the AccordionItem component (container for trigger and content)
|
|
571
|
+
*/
|
|
572
|
+
type AccordionItemProps = ComponentPropsWithoutRef<typeof Item>;
|
|
573
|
+
/**
|
|
574
|
+
* Props for the AccordionTrigger component (clickable header button)
|
|
575
|
+
*/
|
|
576
|
+
type AccordionTriggerProps = ComponentPropsWithoutRef<typeof Trigger>;
|
|
577
|
+
/**
|
|
578
|
+
* Props for the AccordionContent component (collapsible content panel)
|
|
579
|
+
*/
|
|
580
|
+
type AccordionContentProps = ComponentPropsWithoutRef<typeof Content>;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Accordion Component - Design System Specification
|
|
584
|
+
*
|
|
585
|
+
* A vertically stacked set of interactive headings that each reveal a section of content.
|
|
586
|
+
* Built on Radix UI primitives with WAI-ARIA compliance.
|
|
587
|
+
*
|
|
588
|
+
* Design Specs:
|
|
589
|
+
* - AccordionItem border: 1px bottom border border-primary/5 (border-b)
|
|
590
|
+
* - AccordionTrigger padding: 16px vertical (py-4)
|
|
591
|
+
* - AccordionTrigger font: font-medium (500 weight)
|
|
592
|
+
* - AccordionContent padding: 16px bottom, 0 top (pb-4 pt-0)
|
|
593
|
+
* - Icon size: 16×16px (h-4 w-4)
|
|
594
|
+
* - Icon rotation: 180° when expanded
|
|
595
|
+
* - Transition duration: 150ms (design system standard)
|
|
596
|
+
*
|
|
597
|
+
* Structure:
|
|
598
|
+
* <Accordion type="single" collapsible>
|
|
599
|
+
* <AccordionItem value="item-1">
|
|
600
|
+
* <AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
601
|
+
* <AccordionContent>
|
|
602
|
+
* Yes. It adheres to the WAI-ARIA design pattern.
|
|
603
|
+
* </AccordionContent>
|
|
604
|
+
* </AccordionItem>
|
|
605
|
+
* </Accordion>
|
|
606
|
+
*
|
|
607
|
+
* Accessibility:
|
|
608
|
+
* - Full keyboard navigation (Arrow keys, Home, End, Space, Enter)
|
|
609
|
+
* - ARIA attributes automatically applied by Radix UI
|
|
610
|
+
* - aria-expanded indicates open/closed state
|
|
611
|
+
* - aria-controls associates trigger with content
|
|
612
|
+
* - aria-labelledby provides context to assistive technologies
|
|
613
|
+
* - role="region" on content panels
|
|
614
|
+
* - Focus indicators visible (Tailwind default focus-visible)
|
|
615
|
+
*
|
|
616
|
+
* Features:
|
|
617
|
+
* - Single mode: Only one item can be open at a time (type="single")
|
|
618
|
+
* - Multiple mode: Multiple items can be open (type="multiple")
|
|
619
|
+
* - Collapsible: Items can be collapsed when clicked again (collapsible prop)
|
|
620
|
+
* - Disabled state support (disabled prop on items)
|
|
621
|
+
* - Controlled/uncontrolled modes (value/defaultValue)
|
|
622
|
+
* - Smooth height animations (data-state animations)
|
|
623
|
+
*
|
|
624
|
+
* Usage Examples:
|
|
625
|
+
*
|
|
626
|
+
* Basic accordion (single mode):
|
|
627
|
+
* ```tsx
|
|
628
|
+
* <Accordion type="single" collapsible>
|
|
629
|
+
* <AccordionItem value="item-1">
|
|
630
|
+
* <AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
631
|
+
* <AccordionContent>
|
|
632
|
+
* Yes. It adheres to the WAI-ARIA design pattern.
|
|
633
|
+
* </AccordionContent>
|
|
634
|
+
* </AccordionItem>
|
|
635
|
+
* <AccordionItem value="item-2">
|
|
636
|
+
* <AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
637
|
+
* <AccordionContent>
|
|
638
|
+
* Yes. It comes with default styles that match the design system.
|
|
639
|
+
* </AccordionContent>
|
|
640
|
+
* </AccordionItem>
|
|
641
|
+
* </Accordion>
|
|
642
|
+
* ```
|
|
643
|
+
*
|
|
644
|
+
* Multiple items open (multiple mode):
|
|
645
|
+
* ```tsx
|
|
646
|
+
* <Accordion type="multiple">
|
|
647
|
+
* <AccordionItem value="item-1">
|
|
648
|
+
* <AccordionTrigger>Section 1</AccordionTrigger>
|
|
649
|
+
* <AccordionContent>Content 1</AccordionContent>
|
|
650
|
+
* </AccordionItem>
|
|
651
|
+
* <AccordionItem value="item-2">
|
|
652
|
+
* <AccordionTrigger>Section 2</AccordionTrigger>
|
|
653
|
+
* <AccordionContent>Content 2</AccordionContent>
|
|
654
|
+
* </AccordionItem>
|
|
655
|
+
* </Accordion>
|
|
656
|
+
* ```
|
|
657
|
+
*
|
|
658
|
+
* Controlled accordion:
|
|
659
|
+
* ```tsx
|
|
660
|
+
* const [value, setValue] = useState("item-1");
|
|
661
|
+
* <Accordion type="single" value={value} onValueChange={setValue}>
|
|
662
|
+
* <AccordionItem value="item-1">
|
|
663
|
+
* <AccordionTrigger>Item 1</AccordionTrigger>
|
|
664
|
+
* <AccordionContent>Content 1</AccordionContent>
|
|
665
|
+
* </AccordionItem>
|
|
666
|
+
* <AccordionItem value="item-2">
|
|
667
|
+
* <AccordionTrigger>Item 2</AccordionTrigger>
|
|
668
|
+
* <AccordionContent>Content 2</AccordionContent>
|
|
669
|
+
* </AccordionItem>
|
|
670
|
+
* </Accordion>
|
|
671
|
+
* ```
|
|
672
|
+
*
|
|
673
|
+
* @see https://www.radix-ui.com/primitives/docs/components/accordion
|
|
674
|
+
*/
|
|
675
|
+
declare const Accordion: react.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & react.RefAttributes<HTMLDivElement>>;
|
|
676
|
+
/**
|
|
677
|
+
* AccordionItem - Container for trigger and content
|
|
678
|
+
*
|
|
679
|
+
* Design Specs:
|
|
680
|
+
* - Border: 1px bottom border border-primary/5 (border-b) for visual separation
|
|
681
|
+
* - Each item represents a collapsible section
|
|
682
|
+
*
|
|
683
|
+
* Accessibility:
|
|
684
|
+
* - Each item requires a unique value prop for identification
|
|
685
|
+
* - Disabled state can be set via disabled prop
|
|
686
|
+
*/
|
|
687
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
688
|
+
/**
|
|
689
|
+
* AccordionTrigger - Clickable header button that toggles content visibility
|
|
690
|
+
*
|
|
691
|
+
* Design Specs:
|
|
692
|
+
* - Padding: 16px vertical (py-4) for adequate touch target
|
|
693
|
+
* - Font: font-medium (500 weight) for emphasis
|
|
694
|
+
* - Hover: underline text on hover for better feedback
|
|
695
|
+
* - Icon: ChevronDown (16×16px) with 180° rotation when expanded
|
|
696
|
+
* - Transition: 150ms (design system standard)
|
|
697
|
+
* - Layout: flex with space-between for trigger text and icon
|
|
698
|
+
*
|
|
699
|
+
* Accessibility:
|
|
700
|
+
* - Button element with proper ARIA attributes
|
|
701
|
+
* - aria-expanded indicates open/closed state
|
|
702
|
+
* - aria-controls associates trigger with content panel
|
|
703
|
+
* - Keyboard: Space/Enter to toggle, Arrow keys to navigate
|
|
704
|
+
* - Focus indicator visible via default focus-visible styles
|
|
705
|
+
*
|
|
706
|
+
* Note:
|
|
707
|
+
* - The ChevronDown icon is included by default
|
|
708
|
+
* - Icon rotates 180° when item is expanded ([data-state=open])
|
|
709
|
+
* - Trigger includes AccordionPrimitive.Header wrapper for proper semantics
|
|
710
|
+
*/
|
|
711
|
+
declare const AccordionTrigger: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
712
|
+
/**
|
|
713
|
+
* AccordionContent - Collapsible content panel
|
|
714
|
+
*
|
|
715
|
+
* Design Specs:
|
|
716
|
+
* - Padding: 16px bottom, 0 top (pb-4 pt-0) for proper spacing
|
|
717
|
+
* - Font: text-sm (14px) for body content
|
|
718
|
+
* - Animation: Smooth height transition via data-state animations
|
|
719
|
+
* - Overflow: hidden during animation for smooth reveal
|
|
720
|
+
*
|
|
721
|
+
* Accessibility:
|
|
722
|
+
* - role="region" for screen reader context
|
|
723
|
+
* - aria-labelledby associates content with trigger
|
|
724
|
+
* - Only visible when item is expanded (data-state="open")
|
|
725
|
+
* - Content is hidden but still in DOM when collapsed
|
|
726
|
+
*
|
|
727
|
+
* Animations:
|
|
728
|
+
* - data-state="open": animate-accordion-down (Tailwind built-in)
|
|
729
|
+
* - data-state="closed": animate-accordion-up (Tailwind built-in)
|
|
730
|
+
* - Height transitions smoothly from 0 to auto
|
|
731
|
+
*/
|
|
732
|
+
declare const AccordionContent: react.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Avatar Component - Design System Specification
|
|
736
|
+
*
|
|
737
|
+
* Displays user avatars with image and fallback support. Built on Radix UI
|
|
738
|
+
* primitives for robust image loading and fallback handling.
|
|
739
|
+
*
|
|
740
|
+
* **Component Structure**:
|
|
741
|
+
* - `Avatar`: Root container with size variants
|
|
742
|
+
* - `AvatarImage`: Image element with src/alt attributes
|
|
743
|
+
* - `AvatarFallback`: Fallback content (typically initials) when image fails
|
|
744
|
+
*
|
|
745
|
+
* **Sizes**:
|
|
746
|
+
* - sm: 32px (h-8 w-8) - For compact layouts, table rows, lists
|
|
747
|
+
* - md: 40px (h-10 w-10) - Default size, general use
|
|
748
|
+
* - lg: 48px (h-12 w-12) - For prominent displays, profile pages
|
|
749
|
+
* - xl: 64px (h-16 w-16) - For large profile displays, user panels
|
|
750
|
+
* - 2xl: 80px (h-20 w-20) - For profile headers, large avatars
|
|
751
|
+
*
|
|
752
|
+
* **Design Specs**:
|
|
753
|
+
* - Border radius: rounded-none (circular)
|
|
754
|
+
* - Background: bg-accent (slate-100 light, slate-800 dark)
|
|
755
|
+
* - Text color: text-accent-foreground (slate-900 light, slate-100 dark)
|
|
756
|
+
* - Fallback text scales with avatar size (text-xs to text-2xl)
|
|
757
|
+
*
|
|
758
|
+
* **Accessibility**:
|
|
759
|
+
* - Always provide `alt` text on AvatarImage for screen readers
|
|
760
|
+
* - Use meaningful fallback text (user initials, not decorative)
|
|
761
|
+
* - Built on Radix UI with WAI-ARIA compliance
|
|
762
|
+
* - Image loading handled gracefully with fallback
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* // With image
|
|
766
|
+
* <Avatar size="md">
|
|
767
|
+
* <AvatarImage src="/user.jpg" alt="John Doe" />
|
|
768
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
769
|
+
* </Avatar>
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* // Fallback only (no image)
|
|
773
|
+
* <Avatar size="lg">
|
|
774
|
+
* <AvatarFallback>AB</AvatarFallback>
|
|
775
|
+
* </Avatar>
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* // Small size for lists
|
|
779
|
+
* <Avatar size="sm">
|
|
780
|
+
* <AvatarImage src="/avatar.jpg" alt="User" />
|
|
781
|
+
* <AvatarFallback>U</AvatarFallback>
|
|
782
|
+
* </Avatar>
|
|
783
|
+
*
|
|
784
|
+
* @example
|
|
785
|
+
* // Extra large for profile headers
|
|
786
|
+
* <Avatar size="2xl">
|
|
787
|
+
* <AvatarImage src="/profile.jpg" alt="User Name" />
|
|
788
|
+
* <AvatarFallback>UN</AvatarFallback>
|
|
789
|
+
* </Avatar>
|
|
790
|
+
*
|
|
791
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/avatar Radix UI Avatar}
|
|
792
|
+
* @see {@link https://github.com/nextlyhq/nextly/blob/main/ui-revamp/04-design-system-specification.md Design System Specification}
|
|
793
|
+
*/
|
|
794
|
+
declare const avatarVariants: (props?: ({
|
|
795
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
796
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
797
|
+
/**
|
|
798
|
+
* Avatar root component
|
|
799
|
+
*
|
|
800
|
+
* Container element for avatar image and fallback. Provides consistent sizing
|
|
801
|
+
* and styling across the application. Uses React Context to pass size to
|
|
802
|
+
* AvatarFallback for reliable text scaling.
|
|
803
|
+
*/
|
|
804
|
+
declare const Avatar: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & class_variance_authority.VariantProps<(props?: ({
|
|
805
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
806
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
807
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
808
|
+
} & react.RefAttributes<HTMLSpanElement>>;
|
|
809
|
+
/**
|
|
810
|
+
* AvatarImage component
|
|
811
|
+
*
|
|
812
|
+
* Displays the user's profile image. Falls back to AvatarFallback if image
|
|
813
|
+
* fails to load or src is not provided.
|
|
814
|
+
*
|
|
815
|
+
* **Best Practices**:
|
|
816
|
+
* - Always provide meaningful `alt` text (user's name, not "avatar" or "profile picture")
|
|
817
|
+
* - Use optimized images (WebP, AVIF) for better performance
|
|
818
|
+
* - Consider lazy loading for images below the fold
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* <AvatarImage src="/users/john-doe.jpg" alt="John Doe" />
|
|
822
|
+
*/
|
|
823
|
+
declare const AvatarImage: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
|
824
|
+
/**
|
|
825
|
+
* AvatarFallback component
|
|
826
|
+
*
|
|
827
|
+
* Displays fallback content when image is not available or fails to load.
|
|
828
|
+
* Typically shows user initials (1-2 characters). Text size automatically
|
|
829
|
+
* scales based on the Avatar size using React Context.
|
|
830
|
+
*
|
|
831
|
+
* **Best Practices**:
|
|
832
|
+
* - Use 1-2 uppercase characters (user initials: "JD", "AB")
|
|
833
|
+
* - Keep text concise and meaningful
|
|
834
|
+
* - Don't use decorative text ("?", "NA") - use initials or icon instead
|
|
835
|
+
*
|
|
836
|
+
* **Text Sizing** (scales with avatar size via Context):
|
|
837
|
+
* - sm (32px): text-xs (12px)
|
|
838
|
+
* - md (40px): text-sm (14px)
|
|
839
|
+
* - lg (48px): text-base (16px)
|
|
840
|
+
* - xl (64px): text-lg (18px)
|
|
841
|
+
* - 2xl (80px): text-2xl (24px)
|
|
842
|
+
*
|
|
843
|
+
* @example
|
|
844
|
+
* // User initials
|
|
845
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
846
|
+
*
|
|
847
|
+
* @example
|
|
848
|
+
* // Single character for compact layouts
|
|
849
|
+
* <AvatarFallback>J</AvatarFallback>
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
* // Custom delay before showing fallback
|
|
853
|
+
* <AvatarFallback delayMs={300}>AB</AvatarFallback>
|
|
854
|
+
*/
|
|
855
|
+
declare const AvatarFallback: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
856
|
+
delayMs?: number;
|
|
857
|
+
} & react.RefAttributes<HTMLSpanElement>>;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Avatar component props
|
|
861
|
+
*
|
|
862
|
+
* Root container for displaying user avatars with image and fallback support.
|
|
863
|
+
* Extends Radix UI Avatar.Root props with size variants.
|
|
864
|
+
*/
|
|
865
|
+
type AvatarProps = ComponentPropsWithoutRef<"span"> & VariantProps<typeof avatarVariants> & {
|
|
866
|
+
/**
|
|
867
|
+
* Size variant
|
|
868
|
+
* - sm: 32px (h-8 w-8) - For compact layouts, lists
|
|
869
|
+
* - md: 40px (h-10 w-10) - Default size, general use
|
|
870
|
+
* - lg: 48px (h-12 w-12) - For prominent displays, profiles
|
|
871
|
+
* - xl: 64px (h-16 w-16) - For large profile displays, user panels
|
|
872
|
+
* - 2xl: 80px (h-20 w-20) - For profile headers, large avatars
|
|
873
|
+
* @default "md"
|
|
874
|
+
*/
|
|
875
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* AvatarImage component props
|
|
879
|
+
*
|
|
880
|
+
* Displays the avatar image with proper fallback handling.
|
|
881
|
+
* Extends standard img element props.
|
|
882
|
+
*
|
|
883
|
+
* Note: Both src and alt are optional to support dynamic loading scenarios.
|
|
884
|
+
* When src is undefined/empty, the AvatarFallback will be displayed instead.
|
|
885
|
+
*/
|
|
886
|
+
type AvatarImageProps = ComponentPropsWithoutRef<"img">;
|
|
887
|
+
/**
|
|
888
|
+
* AvatarFallback component props
|
|
889
|
+
*
|
|
890
|
+
* Displays fallback content (typically user initials) when image fails to load.
|
|
891
|
+
* Extends Radix UI Avatar.Fallback props.
|
|
892
|
+
*/
|
|
893
|
+
type AvatarFallbackProps = ComponentPropsWithoutRef<"span"> & {
|
|
894
|
+
/**
|
|
895
|
+
* Delay in milliseconds before showing fallback
|
|
896
|
+
* @default 600
|
|
897
|
+
*/
|
|
898
|
+
delayMs?: number;
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Props for the Tabs root component
|
|
903
|
+
* @see https://www.radix-ui.com/primitives/docs/components/tabs
|
|
904
|
+
*/
|
|
905
|
+
type TabsProps = ComponentPropsWithoutRef<typeof Root$3>;
|
|
906
|
+
/**
|
|
907
|
+
* Props for the TabsList component (container for tab triggers)
|
|
908
|
+
*/
|
|
909
|
+
type TabsListProps = ComponentPropsWithoutRef<typeof List>;
|
|
910
|
+
/**
|
|
911
|
+
* Props for the TabsTrigger component (clickable tab button)
|
|
912
|
+
*/
|
|
913
|
+
type TabsTriggerProps = ComponentPropsWithoutRef<typeof Trigger$1>;
|
|
914
|
+
/**
|
|
915
|
+
* Props for the TabsContent component (content panel for each tab)
|
|
916
|
+
*/
|
|
917
|
+
type TabsContentProps = ComponentPropsWithoutRef<typeof Content$1>;
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Tabs Component - Design System Specification
|
|
921
|
+
*
|
|
922
|
+
* A set of layered sections of content—known as tab panels—that are displayed one at a time.
|
|
923
|
+
* Built on Radix UI primitives with WAI-ARIA compliance.
|
|
924
|
+
*
|
|
925
|
+
* Design Specs:
|
|
926
|
+
* - TabsList border-radius: 0px (rounded-none)
|
|
927
|
+
* - TabsTrigger border-radius: 0px (rounded-none)
|
|
928
|
+
* - TabsList height: 40px (h-10)
|
|
929
|
+
* - TabsTrigger padding: 12px 24px (px-3 py-1.5)
|
|
930
|
+
* - Transition duration: 150ms (design system standard)
|
|
931
|
+
* - Active state: bg-background with subtle shadow
|
|
932
|
+
*
|
|
933
|
+
* Structure:
|
|
934
|
+
* <Tabs defaultValue="tab1">
|
|
935
|
+
* <TabsList>
|
|
936
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
937
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
938
|
+
* </TabsList>
|
|
939
|
+
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
940
|
+
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
941
|
+
* </Tabs>
|
|
942
|
+
*
|
|
943
|
+
* Accessibility:
|
|
944
|
+
* - Full keyboard navigation (Arrow keys, Home, End, Tab)
|
|
945
|
+
* - ARIA attributes automatically applied by Radix UI
|
|
946
|
+
* - Focus indicators with 2px ring (WCAG 2.2 compliant)
|
|
947
|
+
* - Disabled state support
|
|
948
|
+
*
|
|
949
|
+
* Features:
|
|
950
|
+
* - Controlled/uncontrolled modes (value/defaultValue)
|
|
951
|
+
* - Horizontal/vertical orientation support
|
|
952
|
+
* - Automatic/manual activation modes
|
|
953
|
+
* - Keyboard navigation built-in
|
|
954
|
+
*
|
|
955
|
+
* Usage Examples:
|
|
956
|
+
*
|
|
957
|
+
* Basic tabs:
|
|
958
|
+
* ```tsx
|
|
959
|
+
* <Tabs defaultValue="overview">
|
|
960
|
+
* <TabsList>
|
|
961
|
+
* <TabsTrigger value="overview">Overview</TabsTrigger>
|
|
962
|
+
* <TabsTrigger value="details">Details</TabsTrigger>
|
|
963
|
+
* </TabsList>
|
|
964
|
+
* <TabsContent value="overview">Overview content</TabsContent>
|
|
965
|
+
* <TabsContent value="details">Details content</TabsContent>
|
|
966
|
+
* </Tabs>
|
|
967
|
+
* ```
|
|
968
|
+
*
|
|
969
|
+
* Controlled tabs:
|
|
970
|
+
* ```tsx
|
|
971
|
+
* const [activeTab, setActiveTab] = useState("tab1");
|
|
972
|
+
* <Tabs value={activeTab} onValueChange={setActiveTab}>
|
|
973
|
+
* <TabsList>
|
|
974
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
975
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
976
|
+
* </TabsList>
|
|
977
|
+
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
978
|
+
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
979
|
+
* </Tabs>
|
|
980
|
+
* ```
|
|
981
|
+
*
|
|
982
|
+
* Vertical tabs:
|
|
983
|
+
* ```tsx
|
|
984
|
+
* <Tabs defaultValue="tab1" orientation="vertical">
|
|
985
|
+
* <TabsList>
|
|
986
|
+
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
987
|
+
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
988
|
+
* </TabsList>
|
|
989
|
+
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
990
|
+
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
991
|
+
* </Tabs>
|
|
992
|
+
* ```
|
|
993
|
+
*
|
|
994
|
+
* @see https://www.radix-ui.com/primitives/docs/components/tabs
|
|
995
|
+
*/
|
|
996
|
+
declare const Tabs: react.ForwardRefExoticComponent<_radix_ui_react_tabs.TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
997
|
+
/**
|
|
998
|
+
* TabsList - Container for tab triggers
|
|
999
|
+
*
|
|
1000
|
+
* Design Specs:
|
|
1001
|
+
* - Height: 40px (h-10)
|
|
1002
|
+
* - Border-radius: none (for underline style)
|
|
1003
|
+
* - Background: transparent
|
|
1004
|
+
* - Layout: inline-flex (horizontal by default, use orientation="vertical" on Tabs root for vertical)
|
|
1005
|
+
*/
|
|
1006
|
+
declare const TabsList: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1007
|
+
/**
|
|
1008
|
+
* TabsTrigger - Clickable tab button
|
|
1009
|
+
*
|
|
1010
|
+
* Design Specs:
|
|
1011
|
+
* - Border-radius: none (Gmail-style underline tabs)
|
|
1012
|
+
* - Padding: 6px 16px (px-4 py-2)
|
|
1013
|
+
* - Font: text-sm (14px), font-medium (500)
|
|
1014
|
+
* - Transition: 150ms (design system standard)
|
|
1015
|
+
* - Active state: blue text with blue bottom border border-primary/5 (2px)
|
|
1016
|
+
* - Hover: blue text with blue bottom border border-primary/5
|
|
1017
|
+
* - Gmail-inspired clean underline style
|
|
1018
|
+
*
|
|
1019
|
+
* Accessibility:
|
|
1020
|
+
* - Keyboard navigation: Arrow keys, Home, End
|
|
1021
|
+
* - Focus ring: 2px with offset (WCAG 2.2 compliant)
|
|
1022
|
+
* - Disabled state: pointer-events-none, opacity-50
|
|
1023
|
+
* - Data attributes: [data-state="active|inactive"], [data-disabled]
|
|
1024
|
+
*/
|
|
1025
|
+
declare const TabsTrigger: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1026
|
+
/**
|
|
1027
|
+
* TabsContent - Content panel for each tab
|
|
1028
|
+
*
|
|
1029
|
+
* Design Specs:
|
|
1030
|
+
* - Margin top: 8px (mt-2) to separate from TabsList
|
|
1031
|
+
* - Focus ring: 2px with offset (for keyboard navigation)
|
|
1032
|
+
*
|
|
1033
|
+
* Accessibility:
|
|
1034
|
+
* - Focus indicator when navigating with Tab key
|
|
1035
|
+
* - Data attributes: [data-state="active|inactive"], [data-orientation]
|
|
1036
|
+
* - Only active content is visible, inactive content is hidden
|
|
1037
|
+
*/
|
|
1038
|
+
declare const TabsContent: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tabs.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1039
|
+
|
|
1040
|
+
declare const TooltipProvider: react.FC<_radix_ui_react_tooltip.TooltipProviderProps>;
|
|
1041
|
+
declare const Tooltip: react.FC<_radix_ui_react_tooltip.TooltipProps>;
|
|
1042
|
+
declare const TooltipTrigger: react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1043
|
+
declare const TooltipContent: react.ForwardRefExoticComponent<Omit<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1044
|
+
|
|
1045
|
+
declare const Popover: react.FC<PopoverPrimitive.PopoverProps>;
|
|
1046
|
+
declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1047
|
+
declare const PopoverAnchor: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & react.RefAttributes<HTMLDivElement>>;
|
|
1048
|
+
declare const PopoverContent: react.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Dialog (Modal) Component
|
|
1052
|
+
*
|
|
1053
|
+
* A composable dialog component built on Radix UI primitives for creating modal windows.
|
|
1054
|
+
* Supports keyboard navigation, focus trapping, and WCAG 2.2 AA accessibility.
|
|
1055
|
+
*
|
|
1056
|
+
* @example
|
|
1057
|
+
* ```tsx
|
|
1058
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
1059
|
+
* <DialogTrigger asChild>
|
|
1060
|
+
* <Button>Open Dialog</Button>
|
|
1061
|
+
* </DialogTrigger>
|
|
1062
|
+
* <DialogContent size="md">
|
|
1063
|
+
* <DialogHeader>
|
|
1064
|
+
* <DialogTitle>Edit Profile</DialogTitle>
|
|
1065
|
+
* <DialogDescription>
|
|
1066
|
+
* Make changes to your profile here. Click save when you're done.
|
|
1067
|
+
* </DialogDescription>
|
|
1068
|
+
* </DialogHeader>
|
|
1069
|
+
* <div className="space-y-4">
|
|
1070
|
+
* Your content here
|
|
1071
|
+
* </div>
|
|
1072
|
+
* <DialogFooter>
|
|
1073
|
+
* <Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
|
|
1074
|
+
* <Button type="submit">Save Changes</Button>
|
|
1075
|
+
* </DialogFooter>
|
|
1076
|
+
* </DialogContent>
|
|
1077
|
+
* </Dialog>
|
|
1078
|
+
* ```
|
|
1079
|
+
*
|
|
1080
|
+
* @design-spec
|
|
1081
|
+
* - Border-radius: 0px (rounded-none) per design system spec
|
|
1082
|
+
* - Max-width: 512px (default), responsive sizes available
|
|
1083
|
+
* - Backdrop: black/80 with blur effect
|
|
1084
|
+
* - Padding: 24px (p-6)
|
|
1085
|
+
* - Shadow: xl for prominence (elevation level 4)
|
|
1086
|
+
* - Transition: 150ms per design system
|
|
1087
|
+
* - Z-index: Overlay at z-50, Content at z-51 (ensures content above overlay)
|
|
1088
|
+
*
|
|
1089
|
+
* @accessibility
|
|
1090
|
+
* - Focus is trapped inside dialog when open
|
|
1091
|
+
* - Pressing Escape closes the dialog
|
|
1092
|
+
* - Focus returns to trigger element on close
|
|
1093
|
+
* - Includes ARIA labels and descriptions
|
|
1094
|
+
* - Screen reader announcements via role="dialog"
|
|
1095
|
+
* - Close button has sr-only text for screen readers
|
|
1096
|
+
*/
|
|
1097
|
+
declare const Dialog: react.FC<DialogPrimitive.DialogProps>;
|
|
1098
|
+
declare const DialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1099
|
+
declare const DialogPortal: react.FC<DialogPrimitive.DialogPortalProps>;
|
|
1100
|
+
declare const DialogClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1101
|
+
type DialogOverlayProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1102
|
+
/**
|
|
1103
|
+
* DialogOverlay - The backdrop overlay behind the dialog content.
|
|
1104
|
+
* Renders with black/80 opacity and blur effect per design spec.
|
|
1105
|
+
*/
|
|
1106
|
+
declare const DialogOverlay: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1107
|
+
/**
|
|
1108
|
+
* Dialog content size variants using CVA.
|
|
1109
|
+
*
|
|
1110
|
+
* @variant sm - Small dialog (384px / max-w-sm) - confirmations, alerts
|
|
1111
|
+
* @variant md - Medium dialog (512px / max-w-lg) - default, standard forms
|
|
1112
|
+
* @variant lg - Large dialog (672px / max-w-2xl) - complex forms, data tables
|
|
1113
|
+
* @variant xl - Extra large dialog (896px / max-w-4xl) - content editors, media galleries
|
|
1114
|
+
* @variant full - Full width with margin (responsive) - fullscreen on mobile
|
|
1115
|
+
*/
|
|
1116
|
+
declare const dialogContentVariants: (props?: ({
|
|
1117
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
1118
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1119
|
+
type DialogContentProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & VariantProps<typeof dialogContentVariants>;
|
|
1120
|
+
/**
|
|
1121
|
+
* DialogContent - The main dialog content container.
|
|
1122
|
+
*
|
|
1123
|
+
* @param size - Size variant (sm, md, lg, xl, full). Default: md (512px)
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* ```tsx
|
|
1127
|
+
* <DialogContent size="lg">
|
|
1128
|
+
* Your content here
|
|
1129
|
+
* </DialogContent>
|
|
1130
|
+
* ```
|
|
1131
|
+
*/
|
|
1132
|
+
declare const DialogContent: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
|
|
1133
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
1134
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
1135
|
+
type DialogHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1136
|
+
/**
|
|
1137
|
+
* DialogHeader - Container for dialog title and description.
|
|
1138
|
+
* Provides consistent spacing and alignment (centered on mobile, left-aligned on desktop).
|
|
1139
|
+
*/
|
|
1140
|
+
declare const DialogHeader: react.ForwardRefExoticComponent<DialogHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
1141
|
+
type DialogFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
1142
|
+
/**
|
|
1143
|
+
* DialogFooter - Container for dialog action buttons.
|
|
1144
|
+
* Provides consistent spacing and alignment (vertical on mobile, horizontal on desktop).
|
|
1145
|
+
*
|
|
1146
|
+
* @example
|
|
1147
|
+
* ```tsx
|
|
1148
|
+
* <DialogFooter>
|
|
1149
|
+
* <Button variant="outline" onClick={onCancel}>Cancel</Button>
|
|
1150
|
+
* <Button type="submit">Save Changes</Button>
|
|
1151
|
+
* </DialogFooter>
|
|
1152
|
+
* ```
|
|
1153
|
+
*/
|
|
1154
|
+
declare const DialogFooter: react.ForwardRefExoticComponent<DialogFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
1155
|
+
type DialogTitleProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1156
|
+
/**
|
|
1157
|
+
* DialogTitle - The title of the dialog.
|
|
1158
|
+
* Uses text-lg (18px) with semibold weight per design system.
|
|
1159
|
+
*
|
|
1160
|
+
* @accessibility Required for screen readers. Always include a DialogTitle.
|
|
1161
|
+
*/
|
|
1162
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
1163
|
+
type DialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1164
|
+
/**
|
|
1165
|
+
* DialogDescription - The description text of the dialog.
|
|
1166
|
+
* Uses text-sm (14px) with muted color per design system.
|
|
1167
|
+
*
|
|
1168
|
+
* @accessibility Provides additional context for screen readers.
|
|
1169
|
+
* If not needed visually, you can use sr-only class.
|
|
1170
|
+
*/
|
|
1171
|
+
declare const DialogDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
1172
|
+
|
|
1173
|
+
declare const AlertDialog: react.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
1174
|
+
declare const AlertDialogTrigger: react.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1175
|
+
declare const AlertDialogPortal: react.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
1176
|
+
type AlertDialogOverlayProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>;
|
|
1177
|
+
/**
|
|
1178
|
+
* AlertDialogOverlay - The backdrop overlay behind the dialog content.
|
|
1179
|
+
*/
|
|
1180
|
+
declare const AlertDialogOverlay: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1181
|
+
type AlertDialogContentProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>;
|
|
1182
|
+
/**
|
|
1183
|
+
* AlertDialogContent - The main dialog content container.
|
|
1184
|
+
*/
|
|
1185
|
+
declare const AlertDialogContent: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1186
|
+
type AlertDialogHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
1187
|
+
/**
|
|
1188
|
+
* AlertDialogHeader - Container for dialog title and description.
|
|
1189
|
+
*/
|
|
1190
|
+
declare const AlertDialogHeader: react.ForwardRefExoticComponent<AlertDialogHeaderProps & react.RefAttributes<HTMLDivElement>>;
|
|
1191
|
+
type AlertDialogFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
1192
|
+
/**
|
|
1193
|
+
* AlertDialogFooter - Container for dialog action buttons.
|
|
1194
|
+
*/
|
|
1195
|
+
declare const AlertDialogFooter: react.ForwardRefExoticComponent<AlertDialogFooterProps & react.RefAttributes<HTMLDivElement>>;
|
|
1196
|
+
type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>;
|
|
1197
|
+
/**
|
|
1198
|
+
* AlertDialogTitle - The title of the alert dialog.
|
|
1199
|
+
*/
|
|
1200
|
+
declare const AlertDialogTitle: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
1201
|
+
type AlertDialogDescriptionProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>;
|
|
1202
|
+
/**
|
|
1203
|
+
* AlertDialogDescription - The description text of the alert dialog.
|
|
1204
|
+
*/
|
|
1205
|
+
declare const AlertDialogDescription: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
1206
|
+
type AlertDialogActionProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>;
|
|
1207
|
+
/**
|
|
1208
|
+
* AlertDialogAction - The primary action button (e.g., "Delete", "Confirm").
|
|
1209
|
+
* Styled as destructive by default.
|
|
1210
|
+
*/
|
|
1211
|
+
declare const AlertDialogAction: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1212
|
+
type AlertDialogCancelProps = ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
|
1213
|
+
/**
|
|
1214
|
+
* AlertDialogCancel - The cancel button.
|
|
1215
|
+
* Styled as outline variant.
|
|
1216
|
+
*/
|
|
1217
|
+
declare const AlertDialogCancel: react.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* DropdownMenu Component
|
|
1221
|
+
*
|
|
1222
|
+
* A composable dropdown menu component built on Radix UI primitives.
|
|
1223
|
+
* Provides context menus, action menus, and navigation menus with full keyboard support.
|
|
1224
|
+
*
|
|
1225
|
+
* **Design Specifications**:
|
|
1226
|
+
* - Border-radius: 0px (rounded-none) - consistent with Dialog, Select
|
|
1227
|
+
* - Padding: 4px (p-1) - compact spacing for menu items
|
|
1228
|
+
* - Shadow: shadow-md - floating element elevation
|
|
1229
|
+
* - Z-index: z-50 - above most content, below modals
|
|
1230
|
+
* - Min-width: 8rem (128px) - prevents cramped menus
|
|
1231
|
+
* - Item padding: 8px horizontal, 6px vertical (px-2 py-1.5)
|
|
1232
|
+
* - Font-size: 14px (text-sm)
|
|
1233
|
+
* - Transition: Tailwind animate utilities (fade, zoom, slide)
|
|
1234
|
+
*
|
|
1235
|
+
* **Accessibility**:
|
|
1236
|
+
* - Full keyboard navigation (Arrow keys, Enter, Escape, Tab)
|
|
1237
|
+
* - ARIA roles and attributes (menu, menuitem, menuitemcheckbox, menuitemradio)
|
|
1238
|
+
* - Focus management (focus trap, auto-focus first item)
|
|
1239
|
+
* - Screen reader support (labels, descriptions, indicators)
|
|
1240
|
+
* - WCAG 2.2 Level AA compliant
|
|
1241
|
+
*
|
|
1242
|
+
* **Features**:
|
|
1243
|
+
* - Portal rendering via PortalProvider for proper z-index stacking
|
|
1244
|
+
* - Checkbox and Radio item variants
|
|
1245
|
+
* - Sub-menu support (nested menus)
|
|
1246
|
+
* - Keyboard shortcuts display
|
|
1247
|
+
* - Customizable positioning (side, align, sideOffset)
|
|
1248
|
+
* - Disabled state support
|
|
1249
|
+
* - Inset support (for items with icons)
|
|
1250
|
+
*
|
|
1251
|
+
* @example
|
|
1252
|
+
* ```tsx
|
|
1253
|
+
* // Basic usage
|
|
1254
|
+
* <DropdownMenu>
|
|
1255
|
+
* <DropdownMenuTrigger asChild>
|
|
1256
|
+
* <Button variant="outline">Open Menu</Button>
|
|
1257
|
+
* </DropdownMenuTrigger>
|
|
1258
|
+
* <DropdownMenuContent>
|
|
1259
|
+
* <DropdownMenuItem>Profile</DropdownMenuItem>
|
|
1260
|
+
* <DropdownMenuItem>Settings</DropdownMenuItem>
|
|
1261
|
+
* <DropdownMenuSeparator />
|
|
1262
|
+
* <DropdownMenuItem>Logout</DropdownMenuItem>
|
|
1263
|
+
* </DropdownMenuContent>
|
|
1264
|
+
* </DropdownMenu>
|
|
1265
|
+
* ```
|
|
1266
|
+
*
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```tsx
|
|
1269
|
+
* // With icons and shortcuts
|
|
1270
|
+
* <DropdownMenu>
|
|
1271
|
+
* <DropdownMenuTrigger asChild>
|
|
1272
|
+
* <Button variant="ghost" size="icon">
|
|
1273
|
+
* <MoreHorizontal className="h-4 w-4" />
|
|
1274
|
+
* </Button>
|
|
1275
|
+
* </DropdownMenuTrigger>
|
|
1276
|
+
* <DropdownMenuContent align="end">
|
|
1277
|
+
* <DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
1278
|
+
* <DropdownMenuItem>
|
|
1279
|
+
* <Edit className="h-4 w-4" />
|
|
1280
|
+
* Edit
|
|
1281
|
+
* <DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
|
|
1282
|
+
* </DropdownMenuItem>
|
|
1283
|
+
* <DropdownMenuItem>
|
|
1284
|
+
* <Trash2 className="h-4 w-4" />
|
|
1285
|
+
* Delete
|
|
1286
|
+
* <DropdownMenuShortcut>⌘⌫</DropdownMenuShortcut>
|
|
1287
|
+
* </DropdownMenuItem>
|
|
1288
|
+
* </DropdownMenuContent>
|
|
1289
|
+
* </DropdownMenu>
|
|
1290
|
+
* ```
|
|
1291
|
+
*
|
|
1292
|
+
* @example
|
|
1293
|
+
* ```tsx
|
|
1294
|
+
* // With checkbox items
|
|
1295
|
+
* <DropdownMenu>
|
|
1296
|
+
* <DropdownMenuTrigger asChild>
|
|
1297
|
+
* <Button variant="outline">View Options</Button>
|
|
1298
|
+
* </DropdownMenuTrigger>
|
|
1299
|
+
* <DropdownMenuContent>
|
|
1300
|
+
* <DropdownMenuLabel>Display</DropdownMenuLabel>
|
|
1301
|
+
* <DropdownMenuSeparator />
|
|
1302
|
+
* <DropdownMenuCheckboxItem checked={showPanel} onCheckedChange={setShowPanel}>
|
|
1303
|
+
* Show Panel
|
|
1304
|
+
* </DropdownMenuCheckboxItem>
|
|
1305
|
+
* <DropdownMenuCheckboxItem checked={showToolbar} onCheckedChange={setShowToolbar}>
|
|
1306
|
+
* Show Toolbar
|
|
1307
|
+
* </DropdownMenuCheckboxItem>
|
|
1308
|
+
* </DropdownMenuContent>
|
|
1309
|
+
* </DropdownMenu>
|
|
1310
|
+
* ```
|
|
1311
|
+
*
|
|
1312
|
+
* @see https://www.radix-ui.com/docs/primitives/components/dropdown-menu - Radix UI DropdownMenu
|
|
1313
|
+
*/
|
|
1314
|
+
|
|
1315
|
+
declare const DropdownMenu: react.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
1316
|
+
declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1317
|
+
declare const DropdownMenuGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1318
|
+
declare const DropdownMenuPortal: react.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
1319
|
+
declare const DropdownMenuSub: react.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
1320
|
+
declare const DropdownMenuRadioGroup: react.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
1321
|
+
declare const DropdownMenuSubTrigger: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1322
|
+
inset?: boolean;
|
|
1323
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1324
|
+
declare const DropdownMenuSubContent: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1325
|
+
declare const DropdownMenuContent: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1326
|
+
declare const DropdownMenuItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1327
|
+
inset?: boolean;
|
|
1328
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1329
|
+
declare const DropdownMenuCheckboxItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1330
|
+
declare const DropdownMenuRadioItem: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1331
|
+
declare const DropdownMenuLabel: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
1332
|
+
inset?: boolean;
|
|
1333
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1334
|
+
declare const DropdownMenuSeparator: react.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1335
|
+
declare const DropdownMenuShortcut: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Props for the DropdownMenuSubTrigger component
|
|
1339
|
+
*/
|
|
1340
|
+
type DropdownMenuSubTriggerProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
1341
|
+
/**
|
|
1342
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1343
|
+
*/
|
|
1344
|
+
inset?: boolean;
|
|
1345
|
+
};
|
|
1346
|
+
/**
|
|
1347
|
+
* Props for the DropdownMenuSubContent component
|
|
1348
|
+
*/
|
|
1349
|
+
type DropdownMenuSubContentProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>;
|
|
1350
|
+
/**
|
|
1351
|
+
* Props for the DropdownMenuContent component
|
|
1352
|
+
*/
|
|
1353
|
+
type DropdownMenuContentProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>;
|
|
1354
|
+
/**
|
|
1355
|
+
* Props for the DropdownMenuItem component
|
|
1356
|
+
*/
|
|
1357
|
+
type DropdownMenuItemProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
1358
|
+
/**
|
|
1359
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1360
|
+
*/
|
|
1361
|
+
inset?: boolean;
|
|
1362
|
+
};
|
|
1363
|
+
/**
|
|
1364
|
+
* Props for the DropdownMenuCheckboxItem component
|
|
1365
|
+
*/
|
|
1366
|
+
type DropdownMenuCheckboxItemProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Props for the DropdownMenuRadioItem component
|
|
1369
|
+
*/
|
|
1370
|
+
type DropdownMenuRadioItemProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>;
|
|
1371
|
+
/**
|
|
1372
|
+
* Props for the DropdownMenuLabel component
|
|
1373
|
+
*/
|
|
1374
|
+
type DropdownMenuLabelProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
1375
|
+
/**
|
|
1376
|
+
* Whether to add left padding (for alignment with items that have icons)
|
|
1377
|
+
*/
|
|
1378
|
+
inset?: boolean;
|
|
1379
|
+
};
|
|
1380
|
+
/**
|
|
1381
|
+
* Props for the DropdownMenuSeparator component
|
|
1382
|
+
*/
|
|
1383
|
+
type DropdownMenuSeparatorProps = react.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Props for the DropdownMenuShortcut component
|
|
1386
|
+
*/
|
|
1387
|
+
type DropdownMenuShortcutProps = react.HTMLAttributes<HTMLSpanElement>;
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* Select Component - Design System Specification
|
|
1391
|
+
*
|
|
1392
|
+
* Dropdown selection component for choosing from a list of options. Built on
|
|
1393
|
+
* Radix UI for robust accessibility and portal rendering.
|
|
1394
|
+
*
|
|
1395
|
+
* Accessibility:
|
|
1396
|
+
* - Full keyboard navigation (Arrow keys, Enter, Escape, Type-ahead)
|
|
1397
|
+
* - Proper ARIA attributes provided by Radix UI
|
|
1398
|
+
* - Screen reader announcements for selected value
|
|
1399
|
+
* - Focus management and keyboard shortcuts
|
|
1400
|
+
* - Disabled state support
|
|
1401
|
+
*
|
|
1402
|
+
* Design Specs:
|
|
1403
|
+
* - Height: sm=32px, default=40px, lg=44px (matches Input component)
|
|
1404
|
+
* - Padding: Horizontal 12px, vertical varies by size
|
|
1405
|
+
* - Border radius: 0px (rounded-none)
|
|
1406
|
+
* - Border: 1px solid, changes on focus/error
|
|
1407
|
+
* - Transition: 150ms (consistent with design system)
|
|
1408
|
+
* - Font size: sm/default=14px (text-sm), lg=16px (text-base)
|
|
1409
|
+
*
|
|
1410
|
+
* Size Variants:
|
|
1411
|
+
* - sm: Height 32px (h-8) - Compact forms, filters
|
|
1412
|
+
* - default: Height 40px (h-10) - Standard forms
|
|
1413
|
+
* - lg: Height 44px (h-11) - Prominent selects
|
|
1414
|
+
*
|
|
1415
|
+
* Features:
|
|
1416
|
+
* - Portal rendering via PortalProvider (avoids overflow issues)
|
|
1417
|
+
* - CheckIcon indicator for selected items
|
|
1418
|
+
* - Keyboard type-ahead search
|
|
1419
|
+
* - Grouping support with labels
|
|
1420
|
+
* - Placeholder text support
|
|
1421
|
+
* - Error state via aria-invalid
|
|
1422
|
+
*/
|
|
1423
|
+
declare function Select({ ...props }: ComponentProps<typeof SelectPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
1424
|
+
declare function SelectGroup({ ...props }: ComponentProps<typeof SelectPrimitive.Group>): react_jsx_runtime.JSX.Element;
|
|
1425
|
+
declare function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive.Value>): react_jsx_runtime.JSX.Element;
|
|
1426
|
+
declare const selectTriggerVariants: (props?: ({
|
|
1427
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
1428
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1429
|
+
interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger>, VariantProps<typeof selectTriggerVariants> {
|
|
1430
|
+
}
|
|
1431
|
+
declare const SelectTrigger: react.ForwardRefExoticComponent<Omit<SelectTriggerProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1432
|
+
declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
1433
|
+
declare function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>): react_jsx_runtime.JSX.Element;
|
|
1434
|
+
declare function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>): react_jsx_runtime.JSX.Element;
|
|
1435
|
+
declare function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>): react_jsx_runtime.JSX.Element;
|
|
1436
|
+
declare function SelectScrollUpButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollUpButton>): react_jsx_runtime.JSX.Element;
|
|
1437
|
+
declare function SelectScrollDownButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollDownButton>): react_jsx_runtime.JSX.Element;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* Sheet Component
|
|
1441
|
+
*
|
|
1442
|
+
* A dialog variant that slides in from the edges of the screen. Used for mobile
|
|
1443
|
+
* navigation drawers, side panels, and contextual overlays.
|
|
1444
|
+
*
|
|
1445
|
+
* Built on Radix UI Dialog with slide-in animations and overlay backdrop.
|
|
1446
|
+
*
|
|
1447
|
+
* ## Design Specifications
|
|
1448
|
+
*
|
|
1449
|
+
* - **Width**: 320px (sm), 400px (default), 512px (lg), 672px (xl), 100% (full)
|
|
1450
|
+
* - **Animation**: Slide-in from side (150ms duration)
|
|
1451
|
+
* - **Backdrop**: Semi-transparent overlay (50% opacity with backdrop blur)
|
|
1452
|
+
* - **z-index**: 50 (both overlay and content - content renders on top via DOM order)
|
|
1453
|
+
* - **Border-radius**: 0 (full-screen edges)
|
|
1454
|
+
*
|
|
1455
|
+
* ## Accessibility
|
|
1456
|
+
*
|
|
1457
|
+
* - **Focus Trapping**: Focus is trapped within the sheet when open
|
|
1458
|
+
* - **Escape Key**: Closes sheet on Escape key press
|
|
1459
|
+
* - **Overlay Click**: Closes sheet when clicking outside
|
|
1460
|
+
* - **ARIA**: Proper dialog role and ARIA attributes
|
|
1461
|
+
* - **Keyboard Navigation**: Tab/Shift+Tab to navigate, Enter to activate
|
|
1462
|
+
*
|
|
1463
|
+
* ## Usage Examples
|
|
1464
|
+
*
|
|
1465
|
+
* ### Basic Mobile Navigation Drawer
|
|
1466
|
+
*
|
|
1467
|
+
* ```tsx
|
|
1468
|
+
* import { Sheet, SheetContent, SheetTrigger } from '@nextlyhq/ui';
|
|
1469
|
+
* import { Menu } from 'lucide-react';
|
|
1470
|
+
*
|
|
1471
|
+
* function MobileNav() {
|
|
1472
|
+
* return (
|
|
1473
|
+
* <Sheet>
|
|
1474
|
+
* <SheetTrigger asChild>
|
|
1475
|
+
* <button className="h-11 w-11 md:hidden">
|
|
1476
|
+
* <Menu />
|
|
1477
|
+
* </button>
|
|
1478
|
+
* </SheetTrigger>
|
|
1479
|
+
* <SheetContent side="left" className="w-72">
|
|
1480
|
+
* <nav>
|
|
1481
|
+
* <a href="/dashboard">Dashboard</a>
|
|
1482
|
+
* <a href="/users">Users</a>
|
|
1483
|
+
* </nav>
|
|
1484
|
+
* </SheetContent>
|
|
1485
|
+
* </Sheet>
|
|
1486
|
+
* );
|
|
1487
|
+
* }
|
|
1488
|
+
* ```
|
|
1489
|
+
*
|
|
1490
|
+
* @see https://www.radix-ui.com/primitives/docs/components/dialog
|
|
1491
|
+
*/
|
|
1492
|
+
declare const Sheet: react.FC<DialogPrimitive.DialogProps>;
|
|
1493
|
+
declare const SheetTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1494
|
+
declare const SheetClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1495
|
+
declare const SheetPortal: react.FC<DialogPrimitive.DialogPortalProps>;
|
|
1496
|
+
/**
|
|
1497
|
+
* SheetOverlay
|
|
1498
|
+
*
|
|
1499
|
+
* Semi-transparent backdrop that appears behind the sheet.
|
|
1500
|
+
*
|
|
1501
|
+
* - **Background**: Black with 50% opacity + backdrop blur
|
|
1502
|
+
* - **Animation**: Fade in/out (150ms)
|
|
1503
|
+
* - **z-index**: 50
|
|
1504
|
+
*/
|
|
1505
|
+
declare const SheetOverlay: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Sheet Content Variants
|
|
1508
|
+
*
|
|
1509
|
+
* Defines slide-in animations for each side and size options.
|
|
1510
|
+
*/
|
|
1511
|
+
declare const sheetVariants: (props?: ({
|
|
1512
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
1513
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1514
|
+
interface SheetContentProps extends react.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* SheetContent
|
|
1518
|
+
*
|
|
1519
|
+
* Main content container for the sheet.
|
|
1520
|
+
*
|
|
1521
|
+
* - **Position**: Fixed to screen edge (side prop)
|
|
1522
|
+
* - **Width**: Responsive (w-3/4 on mobile, max-w-sm on sm+)
|
|
1523
|
+
* - **Padding**: 24px (p-6)
|
|
1524
|
+
* - **Border**: On appropriate edge based on side
|
|
1525
|
+
* - **Close Button**: Positioned in top-right corner (16px from edges)
|
|
1526
|
+
*
|
|
1527
|
+
* @param side - Which edge to slide in from: "left", "right", "top", "bottom"
|
|
1528
|
+
*/
|
|
1529
|
+
declare const SheetContent: react.ForwardRefExoticComponent<SheetContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1530
|
+
/**
|
|
1531
|
+
* SheetHeader
|
|
1532
|
+
*
|
|
1533
|
+
* Header section for sheet title and description.
|
|
1534
|
+
*
|
|
1535
|
+
* - **Layout**: Flex column with 6px gap
|
|
1536
|
+
* - **Text Alignment**: Left (default) or center
|
|
1537
|
+
*/
|
|
1538
|
+
declare const SheetHeader: {
|
|
1539
|
+
({ className, ...props }: react.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1540
|
+
displayName: string;
|
|
1541
|
+
};
|
|
1542
|
+
/**
|
|
1543
|
+
* SheetFooter
|
|
1544
|
+
*
|
|
1545
|
+
* Footer section for sheet actions (buttons, etc.).
|
|
1546
|
+
*
|
|
1547
|
+
* - **Layout**: Flex row on desktop, column on mobile
|
|
1548
|
+
* - **Alignment**: Right-aligned on desktop, stretched on mobile
|
|
1549
|
+
*/
|
|
1550
|
+
declare const SheetFooter: {
|
|
1551
|
+
({ className, ...props }: react.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1552
|
+
displayName: string;
|
|
1553
|
+
};
|
|
1554
|
+
/**
|
|
1555
|
+
* SheetTitle
|
|
1556
|
+
*
|
|
1557
|
+
* Title heading for the sheet (h2).
|
|
1558
|
+
*
|
|
1559
|
+
* - **Font**: text-lg font-semibold
|
|
1560
|
+
* - **Color**: text-foreground
|
|
1561
|
+
* - **Required**: For accessibility (screen readers)
|
|
1562
|
+
*/
|
|
1563
|
+
declare const SheetTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
1564
|
+
/**
|
|
1565
|
+
* SheetDescription
|
|
1566
|
+
*
|
|
1567
|
+
* Description text for the sheet.
|
|
1568
|
+
*
|
|
1569
|
+
* - **Font**: text-sm
|
|
1570
|
+
* - **Color**: text-muted-foreground
|
|
1571
|
+
* - **Purpose**: Provide context for screen readers
|
|
1572
|
+
*/
|
|
1573
|
+
declare const SheetDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* Sheet Component Types
|
|
1577
|
+
*
|
|
1578
|
+
* TypeScript type definitions for the Sheet component (Dialog variant).
|
|
1579
|
+
*/
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Sheet root component props
|
|
1583
|
+
* Extends Radix UI Dialog.Root props
|
|
1584
|
+
*/
|
|
1585
|
+
type SheetProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Sheet trigger component props
|
|
1588
|
+
* Extends Radix UI Dialog.Trigger props
|
|
1589
|
+
*/
|
|
1590
|
+
type SheetTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
|
1591
|
+
/**
|
|
1592
|
+
* Sheet close component props
|
|
1593
|
+
* Extends Radix UI Dialog.Close props
|
|
1594
|
+
*/
|
|
1595
|
+
type SheetCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Sheet overlay component props
|
|
1598
|
+
* Extends Radix UI Dialog.Overlay props
|
|
1599
|
+
*/
|
|
1600
|
+
type SheetOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
1601
|
+
/**
|
|
1602
|
+
* Sheet header component props
|
|
1603
|
+
* Standard div props
|
|
1604
|
+
*/
|
|
1605
|
+
type SheetHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Sheet footer component props
|
|
1608
|
+
* Standard div props
|
|
1609
|
+
*/
|
|
1610
|
+
type SheetFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1611
|
+
/**
|
|
1612
|
+
* Sheet title component props
|
|
1613
|
+
* Extends Radix UI Dialog.Title props
|
|
1614
|
+
*/
|
|
1615
|
+
type SheetTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
1616
|
+
/**
|
|
1617
|
+
* Sheet description component props
|
|
1618
|
+
* Extends Radix UI Dialog.Description props
|
|
1619
|
+
*/
|
|
1620
|
+
type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
1621
|
+
/**
|
|
1622
|
+
* Sheet component refs
|
|
1623
|
+
*/
|
|
1624
|
+
type SheetOverlayRef = React.ElementRef<typeof DialogPrimitive.Overlay>;
|
|
1625
|
+
type SheetContentRef = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
1626
|
+
type SheetTitleRef = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
1627
|
+
type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Command Component
|
|
1631
|
+
*
|
|
1632
|
+
* A command palette component built on cmdk for fast, keyboard-driven navigation and actions.
|
|
1633
|
+
* Supports fuzzy search, keyboard navigation, and WCAG 2.2 AA accessibility.
|
|
1634
|
+
*
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```tsx
|
|
1637
|
+
* <Command>
|
|
1638
|
+
* <CommandInput placeholder="Type a command or search..." />
|
|
1639
|
+
* <CommandList>
|
|
1640
|
+
* <CommandEmpty>No results found.</CommandEmpty>
|
|
1641
|
+
* <CommandGroup heading="Navigation">
|
|
1642
|
+
* <CommandItem>
|
|
1643
|
+
* <Home className="mr-2 h-4 w-4" />
|
|
1644
|
+
* Dashboard
|
|
1645
|
+
* </CommandItem>
|
|
1646
|
+
* </CommandGroup>
|
|
1647
|
+
* </CommandList>
|
|
1648
|
+
* </Command>
|
|
1649
|
+
* ```
|
|
1650
|
+
*
|
|
1651
|
+
* @design-spec
|
|
1652
|
+
* - Input height: 48px (h-12) - larger for prominence
|
|
1653
|
+
* - Item height: 36px (h-9) desktop, 44px (h-11) mobile for touch
|
|
1654
|
+
* - Border radius: 0px (rounded-none) for items
|
|
1655
|
+
* - Max list height: 400px (max-h-[400px])
|
|
1656
|
+
* - Transition: 150ms per design system
|
|
1657
|
+
*
|
|
1658
|
+
* @accessibility
|
|
1659
|
+
* - Full keyboard navigation (Arrow keys, Enter, Escape, Home, End)
|
|
1660
|
+
* - ARIA attributes (role="combobox", role="listbox", role="option")
|
|
1661
|
+
* - Screen reader announcements for results
|
|
1662
|
+
* - Focus management and visual focus indicators
|
|
1663
|
+
* - WCAG 2.2 AA compliant (verified contrast ratios)
|
|
1664
|
+
*/
|
|
1665
|
+
type CommandProps = ComponentPropsWithoutRef<typeof Command$1>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Command - Root container for the command palette.
|
|
1668
|
+
* Handles filtering, keyboard navigation, and accessibility.
|
|
1669
|
+
*/
|
|
1670
|
+
declare const Command: react.ForwardRefExoticComponent<Omit<{
|
|
1671
|
+
children?: React.ReactNode;
|
|
1672
|
+
} & Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1673
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1674
|
+
} & {
|
|
1675
|
+
asChild?: boolean;
|
|
1676
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1677
|
+
label?: string;
|
|
1678
|
+
shouldFilter?: boolean;
|
|
1679
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
1680
|
+
defaultValue?: string;
|
|
1681
|
+
value?: string;
|
|
1682
|
+
onValueChange?: (value: string) => void;
|
|
1683
|
+
loop?: boolean;
|
|
1684
|
+
disablePointerSelection?: boolean;
|
|
1685
|
+
vimBindings?: boolean;
|
|
1686
|
+
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1687
|
+
type CommandDialogProps = DialogPrimitive.DialogProps;
|
|
1688
|
+
/**
|
|
1689
|
+
* CommandDialog - Command palette in a modal dialog.
|
|
1690
|
+
* Use this variant for Cmd+K keyboard shortcut pattern.
|
|
1691
|
+
*
|
|
1692
|
+
* @example
|
|
1693
|
+
* ```tsx
|
|
1694
|
+
* const [open, setOpen] = useState(false)
|
|
1695
|
+
*
|
|
1696
|
+
* useEffect(() => {
|
|
1697
|
+
* const down = (e: KeyboardEvent) => {
|
|
1698
|
+
* if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
1699
|
+
* e.preventDefault()
|
|
1700
|
+
* setOpen((open) => !open)
|
|
1701
|
+
* }
|
|
1702
|
+
* }
|
|
1703
|
+
* document.addEventListener("keydown", down)
|
|
1704
|
+
* return () => document.removeEventListener("keydown", down)
|
|
1705
|
+
* }, [])
|
|
1706
|
+
*
|
|
1707
|
+
* return (
|
|
1708
|
+
* <CommandDialog open={open} onOpenChange={setOpen}>
|
|
1709
|
+
* <CommandInput placeholder="Type a command..." />
|
|
1710
|
+
* <CommandList>...</CommandList>
|
|
1711
|
+
* </CommandDialog>
|
|
1712
|
+
* )
|
|
1713
|
+
* ```
|
|
1714
|
+
*/
|
|
1715
|
+
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
|
|
1716
|
+
type CommandInputProps = ComponentPropsWithoutRef<typeof Command$1.Input>;
|
|
1717
|
+
/**
|
|
1718
|
+
* CommandInput - Search input field for filtering commands.
|
|
1719
|
+
* Includes search icon and styled per design system.
|
|
1720
|
+
*/
|
|
1721
|
+
declare const CommandInput: react.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof react.InputHTMLAttributes<HTMLInputElement>> & {
|
|
1722
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
1723
|
+
} & {
|
|
1724
|
+
asChild?: boolean;
|
|
1725
|
+
}, "asChild" | "key" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
1726
|
+
value?: string;
|
|
1727
|
+
onValueChange?: (search: string) => void;
|
|
1728
|
+
} & react.RefAttributes<HTMLInputElement>, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
1729
|
+
type CommandListProps = ComponentPropsWithoutRef<typeof Command$1.List>;
|
|
1730
|
+
/**
|
|
1731
|
+
* CommandList - Scrollable container for command results.
|
|
1732
|
+
* Max height 400px per design spec to prevent tall dialogs.
|
|
1733
|
+
*/
|
|
1734
|
+
declare const CommandList: react.ForwardRefExoticComponent<Omit<{
|
|
1735
|
+
children?: React.ReactNode;
|
|
1736
|
+
} & Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1737
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1738
|
+
} & {
|
|
1739
|
+
asChild?: boolean;
|
|
1740
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1741
|
+
label?: string;
|
|
1742
|
+
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1743
|
+
type CommandEmptyProps = ComponentPropsWithoutRef<typeof Command$1.Empty>;
|
|
1744
|
+
/**
|
|
1745
|
+
* CommandEmpty - Empty state message when no results found.
|
|
1746
|
+
* Centered text with muted color per design spec.
|
|
1747
|
+
*/
|
|
1748
|
+
declare const CommandEmpty: react.ForwardRefExoticComponent<Omit<{
|
|
1749
|
+
children?: React.ReactNode;
|
|
1750
|
+
} & Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1751
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1752
|
+
} & {
|
|
1753
|
+
asChild?: boolean;
|
|
1754
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1755
|
+
type CommandGroupProps = ComponentPropsWithoutRef<typeof Command$1.Group>;
|
|
1756
|
+
/**
|
|
1757
|
+
* CommandGroup - Grouped section of commands with optional heading.
|
|
1758
|
+
* Heading styled as uppercase, small, semibold per design spec.
|
|
1759
|
+
*/
|
|
1760
|
+
declare const CommandGroup: react.ForwardRefExoticComponent<Omit<{
|
|
1761
|
+
children?: React.ReactNode;
|
|
1762
|
+
} & Omit<Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1763
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1764
|
+
} & {
|
|
1765
|
+
asChild?: boolean;
|
|
1766
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
1767
|
+
heading?: React.ReactNode;
|
|
1768
|
+
value?: string;
|
|
1769
|
+
forceMount?: boolean;
|
|
1770
|
+
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1771
|
+
type CommandSeparatorProps = ComponentPropsWithoutRef<typeof Command$1.Separator>;
|
|
1772
|
+
/**
|
|
1773
|
+
* CommandSeparator - Visual divider between command groups.
|
|
1774
|
+
* 1px line with border border-primary/5 color, 8px margin top/bottom.
|
|
1775
|
+
*/
|
|
1776
|
+
declare const CommandSeparator: react.ForwardRefExoticComponent<Omit<Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1777
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1778
|
+
} & {
|
|
1779
|
+
asChild?: boolean;
|
|
1780
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1781
|
+
alwaysRender?: boolean;
|
|
1782
|
+
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1783
|
+
type CommandItemProps = ComponentPropsWithoutRef<typeof Command$1.Item>;
|
|
1784
|
+
/**
|
|
1785
|
+
* CommandItem - Individual selectable command item.
|
|
1786
|
+
* Height: 36px desktop, 44px mobile per design spec.
|
|
1787
|
+
* Includes hover, focus, and selected states.
|
|
1788
|
+
*/
|
|
1789
|
+
declare const CommandItem: react.ForwardRefExoticComponent<Omit<{
|
|
1790
|
+
children?: React.ReactNode;
|
|
1791
|
+
} & Omit<Pick<Pick<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<HTMLDivElement>> & {
|
|
1792
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1793
|
+
} & {
|
|
1794
|
+
asChild?: boolean;
|
|
1795
|
+
}, "asChild" | "key" | keyof HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
|
|
1796
|
+
disabled?: boolean;
|
|
1797
|
+
onSelect?: (value: string) => void;
|
|
1798
|
+
value?: string;
|
|
1799
|
+
keywords?: string[];
|
|
1800
|
+
forceMount?: boolean;
|
|
1801
|
+
} & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1802
|
+
type CommandShortcutProps = HTMLAttributes<HTMLSpanElement>;
|
|
1803
|
+
/**
|
|
1804
|
+
* CommandShortcut - Keyboard shortcut display (e.g., "⌘K", "↵ Enter").
|
|
1805
|
+
* Monospace font, subtle background, right-aligned per design spec.
|
|
1806
|
+
*/
|
|
1807
|
+
declare const CommandShortcut: react.ForwardRefExoticComponent<CommandShortcutProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Spinner Component - Design System Specification
|
|
1811
|
+
*
|
|
1812
|
+
* Loading indicator for short wait times (300ms - 1s). Uses the Loader2 icon from
|
|
1813
|
+
* lucide-react with a smooth rotation animation.
|
|
1814
|
+
*
|
|
1815
|
+
* **Usage Guidelines** (from UX Strategy):
|
|
1816
|
+
* - ✅ Use for buttons and small components (loading states)
|
|
1817
|
+
* - ✅ Use for short waits (300ms - 1s)
|
|
1818
|
+
* - ❌ Don't use for page content (use Skeleton instead)
|
|
1819
|
+
* - ❌ Don't use for waits > 3s (use Progress bar instead)
|
|
1820
|
+
*
|
|
1821
|
+
* **Sizes**:
|
|
1822
|
+
* - sm: 16px (h-4 w-4) - For small buttons, inline text
|
|
1823
|
+
* - md: 20px (h-5 w-5) - Default size, for regular buttons
|
|
1824
|
+
* - lg: 24px (h-6 w-6) - For large buttons, prominent loading states
|
|
1825
|
+
*
|
|
1826
|
+
* **Accessibility**:
|
|
1827
|
+
* - Uses `role="status"` for screen reader announcements
|
|
1828
|
+
* - Uses `aria-label="Loading"` for accessible name
|
|
1829
|
+
* - Respects `prefers-reduced-motion` (animation stops automatically via Tailwind)
|
|
1830
|
+
* - Non-focusable (not interactive)
|
|
1831
|
+
*
|
|
1832
|
+
* **Animation**:
|
|
1833
|
+
* - Uses Tailwind's `animate-spin` utility (1s linear infinite)
|
|
1834
|
+
* - Automatically respects user's motion preferences (WCAG 2.3.3)
|
|
1835
|
+
*
|
|
1836
|
+
* @example
|
|
1837
|
+
* // Button loading state
|
|
1838
|
+
* <Button disabled>
|
|
1839
|
+
* <Spinner size="sm" className="mr-2" />
|
|
1840
|
+
* Saving...
|
|
1841
|
+
* </Button>
|
|
1842
|
+
*
|
|
1843
|
+
* @example
|
|
1844
|
+
* // Standalone loading indicator
|
|
1845
|
+
* <div className="flex items-center justify-center p-8">
|
|
1846
|
+
* <Spinner size="lg" />
|
|
1847
|
+
* </div>
|
|
1848
|
+
*
|
|
1849
|
+
* @example
|
|
1850
|
+
* // Custom color
|
|
1851
|
+
* <Spinner className="text-primary" />
|
|
1852
|
+
*/
|
|
1853
|
+
declare const spinnerVariants: (props?: ({
|
|
1854
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1855
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1856
|
+
/**
|
|
1857
|
+
* Spinner component props
|
|
1858
|
+
*
|
|
1859
|
+
* Extends LucideProps to support all standard SVG attributes (data-*, id, etc.)
|
|
1860
|
+
* while providing size variants and accessibility features.
|
|
1861
|
+
*/
|
|
1862
|
+
type SpinnerProps = Omit<LucideProps, "size"> & VariantProps<typeof spinnerVariants> & {
|
|
1863
|
+
/**
|
|
1864
|
+
* Accessible label for screen readers
|
|
1865
|
+
* @default "Loading"
|
|
1866
|
+
*/
|
|
1867
|
+
"aria-label"?: string;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Spinner component for loading states
|
|
1871
|
+
*/
|
|
1872
|
+
declare const Spinner: react.ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Toaster Component - Toast Notification System
|
|
1876
|
+
*
|
|
1877
|
+
* A wrapper around Sonner (opinionated toast component for React) with
|
|
1878
|
+
* custom icons. Provides a consistent notification system across the application.
|
|
1879
|
+
*
|
|
1880
|
+
* Features:
|
|
1881
|
+
* - Theme support via `theme` prop (light/dark/system)
|
|
1882
|
+
* - Custom icons from lucide-react matching design system
|
|
1883
|
+
* - 6 toast types: default, success, info, warning, error, loading (promise-based)
|
|
1884
|
+
* - Action button support (Undo, Retry, etc.)
|
|
1885
|
+
* - Configurable positioning (default: bottom-right)
|
|
1886
|
+
* - Automatic stacking and dismissal
|
|
1887
|
+
* - WCAG 2.2 AA compliant colors via CSS variables
|
|
1888
|
+
*
|
|
1889
|
+
* Setup:
|
|
1890
|
+
* 1. Add <Toaster /> to your root layout (once per app)
|
|
1891
|
+
* 2. Import toast from '@nextlyhq/ui' to trigger notifications
|
|
1892
|
+
*
|
|
1893
|
+
* Usage Examples:
|
|
1894
|
+
*
|
|
1895
|
+
* // Default toast
|
|
1896
|
+
* import { toast } from '@nextlyhq/ui';
|
|
1897
|
+
* toast("Event has been created");
|
|
1898
|
+
*
|
|
1899
|
+
* // Success toast
|
|
1900
|
+
* toast.success("User created successfully!");
|
|
1901
|
+
*
|
|
1902
|
+
* // Error toast
|
|
1903
|
+
* toast.error("Failed to save changes. Please try again.");
|
|
1904
|
+
*
|
|
1905
|
+
* // Warning toast
|
|
1906
|
+
* toast.warning("This action cannot be undone.");
|
|
1907
|
+
*
|
|
1908
|
+
* // Info toast
|
|
1909
|
+
* toast.info("Be at the area 10 minutes before the event time");
|
|
1910
|
+
*
|
|
1911
|
+
* // Toast with action button
|
|
1912
|
+
* toast("Event deleted", {
|
|
1913
|
+
* description: "You can undo this action",
|
|
1914
|
+
* action: {
|
|
1915
|
+
* label: "Undo",
|
|
1916
|
+
* onClick: () => console.log("Undo clicked"),
|
|
1917
|
+
* },
|
|
1918
|
+
* });
|
|
1919
|
+
*
|
|
1920
|
+
* // Promise-based toast (loading → success/error)
|
|
1921
|
+
* toast.promise(
|
|
1922
|
+
* fetchData(),
|
|
1923
|
+
* {
|
|
1924
|
+
* loading: "Loading...",
|
|
1925
|
+
* success: (data) => `${data.name} has been created`,
|
|
1926
|
+
* error: "Failed to load data",
|
|
1927
|
+
* }
|
|
1928
|
+
* );
|
|
1929
|
+
*
|
|
1930
|
+
* Positioning Options:
|
|
1931
|
+
* <Toaster position="top-right" />
|
|
1932
|
+
* <Toaster position="top-center" />
|
|
1933
|
+
* <Toaster position="bottom-left" />
|
|
1934
|
+
* <Toaster position="bottom-center" />
|
|
1935
|
+
* <Toaster position="bottom-right" /> (default)
|
|
1936
|
+
*
|
|
1937
|
+
* Customization:
|
|
1938
|
+
* All styling uses CSS variables from the design system:
|
|
1939
|
+
* - --normal-bg: Background color (uses --popover with fallback)
|
|
1940
|
+
* - --normal-text: Text color (uses --popover-foreground with fallback)
|
|
1941
|
+
* - --normal-border: Border color (uses --border with fallback)
|
|
1942
|
+
* - --border-radius: Border radius (uses --radius with fallback)
|
|
1943
|
+
*
|
|
1944
|
+
* Security:
|
|
1945
|
+
* ⚠️ IMPORTANT: Toast content is not automatically sanitized. When displaying
|
|
1946
|
+
* user-generated content or data from external sources, ensure you sanitize
|
|
1947
|
+
* the content to prevent XSS attacks. Use plain text strings when possible,
|
|
1948
|
+
* or sanitize HTML/JSX content before passing to toast functions.
|
|
1949
|
+
*
|
|
1950
|
+
* Safe: toast.success(`User ${username} created`) // Template literals with plain text
|
|
1951
|
+
* Unsafe: toast.success(<div dangerouslySetInnerHTML={{__html: userInput}} />) // XSS risk
|
|
1952
|
+
* Safe: toast.success(<div>{sanitizeHtml(userInput)}</div>) // Sanitized content
|
|
1953
|
+
*
|
|
1954
|
+
* Accessibility:
|
|
1955
|
+
* - Screen reader announcements for all toast types
|
|
1956
|
+
* - Keyboard dismissible (Escape key)
|
|
1957
|
+
* - Focus management for action buttons
|
|
1958
|
+
* - ARIA labels automatically applied
|
|
1959
|
+
* - WCAG 2.2 AA color contrast
|
|
1960
|
+
*
|
|
1961
|
+
* @see https://sonner.emilkowal.ski/ - Sonner documentation
|
|
1962
|
+
* @see https://ui.shadcn.com/docs/components/sonner - shadcn/ui integration guide
|
|
1963
|
+
*/
|
|
1964
|
+
declare function Toaster({ theme, ...props }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
1965
|
+
|
|
1966
|
+
declare const Table: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableElement> & react.RefAttributes<HTMLTableElement>>;
|
|
1967
|
+
declare const TableHeader: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
1968
|
+
declare const TableBody: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
1969
|
+
declare const TableFooter: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
1970
|
+
declare const TableRow: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableRowElement> & react.RefAttributes<HTMLTableRowElement>>;
|
|
1971
|
+
declare const TableHead: react.ForwardRefExoticComponent<react.ThHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
1972
|
+
declare const TableCell: react.ForwardRefExoticComponent<react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
1973
|
+
declare const TableCaption: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableCaptionElement> & react.RefAttributes<HTMLTableCaptionElement>>;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Props for TableSearch component
|
|
1977
|
+
*/
|
|
1978
|
+
interface TableSearchProps {
|
|
1979
|
+
/** Current search value */
|
|
1980
|
+
value: string;
|
|
1981
|
+
/** Callback when search value changes */
|
|
1982
|
+
onChange: (value: string) => void;
|
|
1983
|
+
/** Callback when clear button is clicked */
|
|
1984
|
+
onClear: () => void;
|
|
1985
|
+
/** Placeholder text for search input */
|
|
1986
|
+
placeholder?: string;
|
|
1987
|
+
/** Whether data is currently loading */
|
|
1988
|
+
isLoading?: boolean;
|
|
1989
|
+
/** Ref to the input element */
|
|
1990
|
+
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Search input component for tables
|
|
1994
|
+
*
|
|
1995
|
+
* Features:
|
|
1996
|
+
* - Search icon
|
|
1997
|
+
* - Clear button (when value is present)
|
|
1998
|
+
* - Loading spinner (when isLoading is true)
|
|
1999
|
+
* - Accessible with aria-busy attribute
|
|
2000
|
+
*
|
|
2001
|
+
* @example
|
|
2002
|
+
* ```tsx
|
|
2003
|
+
* <TableSearch
|
|
2004
|
+
* value={searchInput}
|
|
2005
|
+
* onChange={handleSearchChange}
|
|
2006
|
+
* onClear={handleClearSearch}
|
|
2007
|
+
* placeholder="Search users..."
|
|
2008
|
+
* isLoading={loading}
|
|
2009
|
+
* />
|
|
2010
|
+
* ```
|
|
2011
|
+
*/
|
|
2012
|
+
declare function TableSearch({ value, onChange, onClear, placeholder, isLoading, inputRef, }: TableSearchProps): react_jsx_runtime.JSX.Element;
|
|
2013
|
+
|
|
2014
|
+
/**
|
|
2015
|
+
* Props for TableError component
|
|
2016
|
+
*/
|
|
2017
|
+
interface TableErrorProps {
|
|
2018
|
+
/** Error message to display */
|
|
2019
|
+
message?: string;
|
|
2020
|
+
}
|
|
2021
|
+
/**
|
|
2022
|
+
* Error state component for tables
|
|
2023
|
+
*/
|
|
2024
|
+
declare function TableError({ message, }: TableErrorProps): react_jsx_runtime.JSX.Element;
|
|
2025
|
+
/**
|
|
2026
|
+
* Loading state component for tables
|
|
2027
|
+
*/
|
|
2028
|
+
declare function TableLoading(): react_jsx_runtime.JSX.Element;
|
|
2029
|
+
/**
|
|
2030
|
+
* Props for TableEmpty component
|
|
2031
|
+
*/
|
|
2032
|
+
interface TableEmptyProps {
|
|
2033
|
+
/** Custom message to display when no data */
|
|
2034
|
+
message?: string;
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Empty state component for tables
|
|
2038
|
+
*/
|
|
2039
|
+
declare function TableEmpty({ message }: TableEmptyProps): react_jsx_runtime.JSX.Element;
|
|
2040
|
+
|
|
2041
|
+
interface PaginationMeta {
|
|
2042
|
+
total: number;
|
|
2043
|
+
page: number;
|
|
2044
|
+
limit: number;
|
|
2045
|
+
totalPages: number;
|
|
2046
|
+
hasNext: boolean;
|
|
2047
|
+
hasPrev: boolean;
|
|
2048
|
+
}
|
|
2049
|
+
interface SortInfo {
|
|
2050
|
+
field: string;
|
|
2051
|
+
direction: "asc" | "desc";
|
|
2052
|
+
}
|
|
2053
|
+
interface FilterInfo {
|
|
2054
|
+
search?: string;
|
|
2055
|
+
filters?: Record<string, unknown>;
|
|
2056
|
+
}
|
|
2057
|
+
interface TableParams {
|
|
2058
|
+
pagination: {
|
|
2059
|
+
page: number;
|
|
2060
|
+
pageSize: number;
|
|
2061
|
+
};
|
|
2062
|
+
sorting?: SortInfo[];
|
|
2063
|
+
filters?: FilterInfo;
|
|
2064
|
+
}
|
|
2065
|
+
interface ListResponse<TData> {
|
|
2066
|
+
items: TData[];
|
|
2067
|
+
meta: PaginationMeta;
|
|
2068
|
+
}
|
|
2069
|
+
interface PaginationConfig {
|
|
2070
|
+
pageSize?: number;
|
|
2071
|
+
pageSizeOptions?: number[];
|
|
2072
|
+
showPageSizeSelector?: boolean;
|
|
2073
|
+
maxVisiblePages?: number;
|
|
2074
|
+
}
|
|
2075
|
+
interface ActionCallbacks<TData = unknown> {
|
|
2076
|
+
onEdit?: (item: TData) => void;
|
|
2077
|
+
onDelete?: (item: TData) => void;
|
|
2078
|
+
onView?: (item: TData) => void;
|
|
2079
|
+
}
|
|
2080
|
+
type DataFetcher<TData> = (params: TableParams) => Promise<ListResponse<TData>>;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Props for TablePagination component
|
|
2084
|
+
*/
|
|
2085
|
+
interface TablePaginationProps {
|
|
2086
|
+
/** Pagination metadata from server */
|
|
2087
|
+
meta: PaginationMeta;
|
|
2088
|
+
/** Callback when page changes */
|
|
2089
|
+
onPageChange: (page: number) => void;
|
|
2090
|
+
/** Callback when page size changes */
|
|
2091
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
2092
|
+
/** Pagination configuration */
|
|
2093
|
+
config?: Required<PaginationConfig>;
|
|
2094
|
+
/** Whether data is currently loading */
|
|
2095
|
+
isLoading?: boolean;
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Pagination controls for tables
|
|
2099
|
+
*/
|
|
2100
|
+
declare function TablePagination({ meta, onPageChange, onPageSizeChange, config, isLoading, }: TablePaginationProps): react_jsx_runtime.JSX.Element;
|
|
2101
|
+
|
|
2102
|
+
/**
|
|
2103
|
+
* TableSkeleton Component
|
|
2104
|
+
*
|
|
2105
|
+
* Generic loading skeleton for data tables.
|
|
2106
|
+
* Renders header, body, and footer skeleton bars inside a card.
|
|
2107
|
+
* Unified with EntryTable skeleton pattern for consistency across all tables.
|
|
2108
|
+
*/
|
|
2109
|
+
|
|
2110
|
+
interface TableSkeletonProps {
|
|
2111
|
+
columns?: number;
|
|
2112
|
+
rowCount?: number;
|
|
2113
|
+
hideWrapper?: boolean;
|
|
2114
|
+
hideFooter?: boolean;
|
|
2115
|
+
}
|
|
2116
|
+
declare const TableSkeleton: react.FC<TableSkeletonProps>;
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* Column definition for ResponsiveTable
|
|
2120
|
+
*
|
|
2121
|
+
* Provides type-safe column definitions with proper type narrowing for render functions.
|
|
2122
|
+
*
|
|
2123
|
+
* @template T - The data type of items in the table
|
|
2124
|
+
* @template K - The specific key from T (defaults to any key of T)
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```tsx
|
|
2128
|
+
* interface User {
|
|
2129
|
+
* id: string;
|
|
2130
|
+
* name: string;
|
|
2131
|
+
* age: number;
|
|
2132
|
+
* }
|
|
2133
|
+
*
|
|
2134
|
+
* // Type-safe column definition with proper inference
|
|
2135
|
+
* const columns: Column<User>[] = [
|
|
2136
|
+
* {
|
|
2137
|
+
* key: "name",
|
|
2138
|
+
* label: "Name",
|
|
2139
|
+
* // value is inferred as string, not string | number
|
|
2140
|
+
* render: (value, user) => <strong>{value}</strong>
|
|
2141
|
+
* },
|
|
2142
|
+
* {
|
|
2143
|
+
* key: "age",
|
|
2144
|
+
* label: "Age",
|
|
2145
|
+
* // value is inferred as number, not string | number
|
|
2146
|
+
* render: (value) => `${value} years old`
|
|
2147
|
+
* }
|
|
2148
|
+
* ];
|
|
2149
|
+
* ```
|
|
2150
|
+
*/
|
|
2151
|
+
type Column<T, K extends keyof T = keyof T> = {
|
|
2152
|
+
/** Unique key for the column (must match a property in T) */
|
|
2153
|
+
key: K;
|
|
2154
|
+
/** Display label for the column header */
|
|
2155
|
+
label: react.ReactNode;
|
|
2156
|
+
/** Optional custom renderer for cell content with type-safe value */
|
|
2157
|
+
render?: (value: T[K], item: T) => react.ReactNode;
|
|
2158
|
+
/** Hide column on mobile card view (optional, default: false) */
|
|
2159
|
+
hideOnMobile?: boolean;
|
|
2160
|
+
/** Hide the label on mobile card view (optional, default: false) */
|
|
2161
|
+
hideLabelOnMobile?: boolean;
|
|
2162
|
+
/** Optional custom className for the table header cell */
|
|
2163
|
+
headerClassName?: string;
|
|
2164
|
+
/** Optional custom className for the table body cell */
|
|
2165
|
+
cellClassName?: string;
|
|
2166
|
+
};
|
|
2167
|
+
/**
|
|
2168
|
+
* Props for ResponsiveTable component
|
|
2169
|
+
*
|
|
2170
|
+
* @template T - The data type of items in the table, must have an 'id' property
|
|
2171
|
+
*/
|
|
2172
|
+
type ResponsiveTableProps<T extends {
|
|
2173
|
+
id: string;
|
|
2174
|
+
}> = {
|
|
2175
|
+
/** Array of data items to display */
|
|
2176
|
+
data: T[];
|
|
2177
|
+
/** Array of column definitions */
|
|
2178
|
+
columns: Column<T>[];
|
|
2179
|
+
/** Optional callback when a row/card is clicked */
|
|
2180
|
+
onRowClick?: (item: T) => void;
|
|
2181
|
+
/** Optional custom renderer for mobile card view */
|
|
2182
|
+
renderMobileCard?: (item: T, columns: Column<T>[]) => react.ReactNode;
|
|
2183
|
+
/** Optional custom className for the container */
|
|
2184
|
+
className?: string;
|
|
2185
|
+
/** Optional empty state message */
|
|
2186
|
+
emptyMessage?: string;
|
|
2187
|
+
/** Optional ARIA label for the table (improves screen reader experience) */
|
|
2188
|
+
ariaLabel?: string;
|
|
2189
|
+
/** Optional custom className for the internal desktop table wrapper */
|
|
2190
|
+
tableWrapperClassName?: string;
|
|
2191
|
+
/** Optional footer content rendered inside the table card (e.g. Pagination) */
|
|
2192
|
+
footer?: react.ReactNode;
|
|
2193
|
+
};
|
|
2194
|
+
/**
|
|
2195
|
+
* Ref type for ResponsiveTable component
|
|
2196
|
+
*/
|
|
2197
|
+
type ResponsiveTableRef = HTMLDivElement;
|
|
2198
|
+
|
|
2199
|
+
declare const ResponsiveTable: <T extends {
|
|
2200
|
+
id: string;
|
|
2201
|
+
}>(props: ResponsiveTableProps<T> & {
|
|
2202
|
+
ref?: react.ForwardedRef<HTMLDivElement>;
|
|
2203
|
+
}) => react.ReactElement;
|
|
2204
|
+
|
|
2205
|
+
interface PortalProviderProps {
|
|
2206
|
+
/** The DOM element to portal overlay content into. Defaults to document.body (Radix default). */
|
|
2207
|
+
container: HTMLElement | null;
|
|
2208
|
+
children: ReactNode;
|
|
2209
|
+
}
|
|
2210
|
+
declare function PortalProvider({ container, children }: PortalProviderProps): react_jsx_runtime.JSX.Element;
|
|
2211
|
+
declare function usePortalContainer(): HTMLElement | undefined;
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* Utility function to merge class names with Tailwind CSS support.
|
|
2215
|
+
*
|
|
2216
|
+
* Combines clsx for conditional class names with tailwind-merge
|
|
2217
|
+
* to properly handle Tailwind CSS class conflicts.
|
|
2218
|
+
*
|
|
2219
|
+
* @example
|
|
2220
|
+
* ```typescript
|
|
2221
|
+
* cn('px-2 py-1', 'px-4') // => 'py-1 px-4'
|
|
2222
|
+
* cn('text-red-500', condition && 'text-blue-500')
|
|
2223
|
+
* ```
|
|
2224
|
+
*/
|
|
2225
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* Tailwind CSS preset for @nextlyhq/ui components.
|
|
2229
|
+
*
|
|
2230
|
+
* Defines the CSS custom property contract that all UI components expect.
|
|
2231
|
+
* Consumers must provide the actual CSS variable values in their stylesheets.
|
|
2232
|
+
*
|
|
2233
|
+
* Usage (Tailwind v3):
|
|
2234
|
+
* // tailwind.config.ts
|
|
2235
|
+
* import uiPreset from "@nextlyhq/ui/tailwind-preset";
|
|
2236
|
+
* export default { presets: [uiPreset], ... };
|
|
2237
|
+
*
|
|
2238
|
+
* Usage (Tailwind v4 with @config):
|
|
2239
|
+
* Consumers define the equivalent @theme tokens in their CSS.
|
|
2240
|
+
* This file serves as the reference contract.
|
|
2241
|
+
*/
|
|
2242
|
+
declare const uiPreset: {
|
|
2243
|
+
theme: {
|
|
2244
|
+
extend: {
|
|
2245
|
+
colors: {
|
|
2246
|
+
border: string;
|
|
2247
|
+
input: string;
|
|
2248
|
+
ring: string;
|
|
2249
|
+
background: string;
|
|
2250
|
+
foreground: string;
|
|
2251
|
+
primary: {
|
|
2252
|
+
DEFAULT: string;
|
|
2253
|
+
foreground: string;
|
|
2254
|
+
};
|
|
2255
|
+
secondary: {
|
|
2256
|
+
DEFAULT: string;
|
|
2257
|
+
foreground: string;
|
|
2258
|
+
};
|
|
2259
|
+
destructive: {
|
|
2260
|
+
DEFAULT: string;
|
|
2261
|
+
foreground: string;
|
|
2262
|
+
};
|
|
2263
|
+
success: {
|
|
2264
|
+
DEFAULT: string;
|
|
2265
|
+
foreground: string;
|
|
2266
|
+
};
|
|
2267
|
+
warning: {
|
|
2268
|
+
DEFAULT: string;
|
|
2269
|
+
foreground: string;
|
|
2270
|
+
};
|
|
2271
|
+
muted: {
|
|
2272
|
+
DEFAULT: string;
|
|
2273
|
+
foreground: string;
|
|
2274
|
+
};
|
|
2275
|
+
accent: {
|
|
2276
|
+
DEFAULT: string;
|
|
2277
|
+
foreground: string;
|
|
2278
|
+
};
|
|
2279
|
+
popover: {
|
|
2280
|
+
DEFAULT: string;
|
|
2281
|
+
foreground: string;
|
|
2282
|
+
};
|
|
2283
|
+
card: {
|
|
2284
|
+
DEFAULT: string;
|
|
2285
|
+
foreground: string;
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
borderRadius: {
|
|
2289
|
+
lg: string;
|
|
2290
|
+
md: string;
|
|
2291
|
+
sm: string;
|
|
2292
|
+
};
|
|
2293
|
+
keyframes: {
|
|
2294
|
+
"accordion-down": {
|
|
2295
|
+
from: {
|
|
2296
|
+
height: string;
|
|
2297
|
+
};
|
|
2298
|
+
to: {
|
|
2299
|
+
height: string;
|
|
2300
|
+
};
|
|
2301
|
+
};
|
|
2302
|
+
"accordion-up": {
|
|
2303
|
+
from: {
|
|
2304
|
+
height: string;
|
|
2305
|
+
};
|
|
2306
|
+
to: {
|
|
2307
|
+
height: string;
|
|
2308
|
+
};
|
|
2309
|
+
};
|
|
2310
|
+
};
|
|
2311
|
+
animation: {
|
|
2312
|
+
"accordion-down": string;
|
|
2313
|
+
"accordion-up": string;
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
|
|
2319
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, type ActionCallbacks, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogOverlay, type AlertDialogOverlayProps, AlertDialogPortal, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, Command, CommandDialog, type CommandDialogProps, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandInput, type CommandInputProps, CommandItem, type CommandItemProps, CommandList, type CommandListProps, type CommandProps, CommandSeparator, type CommandSeparatorProps, CommandShortcut, type CommandShortcutProps, type DataFetcher, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, type DialogTitleProps, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type FilterInfo, Input, type InputProps, Label, type ListResponse, type PaginationConfig, type PaginationMeta, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PortalProvider, Progress, type ProgressProps, RadioGroup, RadioGroupItem, ResponsiveTable, type ResponsiveTableProps, type ResponsiveTableRef, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, type SheetContentRef, SheetDescription, type SheetDescriptionProps, type SheetDescriptionRef, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, SheetOverlay, type SheetOverlayProps, type SheetOverlayRef, SheetPortal, type SheetProps, SheetTitle, type SheetTitleProps, type SheetTitleRef, SheetTrigger, type SheetTriggerProps, Skeleton, type SkeletonProps, type SortInfo, Spinner, type SpinnerProps, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, type TableEmptyProps, TableError, type TableErrorProps, TableFooter, TableHead, TableHeader, TableLoading, TablePagination, type TablePaginationProps, type TableParams, TableRow, TableSearch, type TableSearchProps, TableSkeleton, type TableSkeletonProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, avatarVariants, badgeVariants, buttonVariants, cardVariants, cn, dialogContentVariants, inputVariants, progressVariants, selectTriggerVariants, sheetVariants, spinnerVariants, uiPreset, usePortalContainer };
|