@neynar/ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +1 -25
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +240 -46
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert.d.ts +73 -11
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +44 -10
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +117 -33
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +50 -71
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +231 -49
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +189 -71
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +197 -40
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +7 -22
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/carousel.d.ts +369 -99
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +110 -38
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +246 -61
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/combobox.d.ts +207 -159
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts +336 -67
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/container.d.ts +159 -64
- package/dist/components/ui/container.d.ts.map +1 -1
- package/dist/components/ui/context-menu.d.ts +321 -39
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts +113 -86
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +106 -25
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +388 -59
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +521 -74
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/empty-state.d.ts +148 -76
- package/dist/components/ui/empty-state.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts +253 -34
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +143 -44
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +0 -8
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts +288 -46
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +444 -127
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +342 -66
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +0 -8
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +88 -30
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +189 -45
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +178 -62
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +180 -21
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +382 -60
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +52 -39
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +144 -27
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +81 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts +94 -32
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +37 -31
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +280 -46
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/stack.d.ts +289 -148
- package/dist/components/ui/stack.d.ts.map +1 -1
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts +1 -2
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/container.stories.d.ts +2 -3
- package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/empty-state.stories.d.ts +2 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts +1 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/stack.stories.d.ts +1 -1
- package/dist/components/ui/stories/text-field.stories.d.ts +7 -1
- package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +44 -38
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +33 -0
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -22
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/text-field.d.ts +170 -84
- package/dist/components/ui/text-field.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +106 -29
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.d.ts +190 -65
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme.d.ts +107 -23
- package/dist/components/ui/theme.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +143 -67
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +118 -30
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +152 -28
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +452 -134
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/index.js +9388 -8281
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +173 -3
- package/package.json +5 -2
- package/src/components/ui/accordion.tsx +112 -27
- package/src/components/ui/alert-dialog.tsx +401 -46
- package/src/components/ui/alert.tsx +114 -11
- package/src/components/ui/aspect-ratio.tsx +69 -14
- package/src/components/ui/avatar.tsx +179 -33
- package/src/components/ui/badge.tsx +74 -75
- package/src/components/ui/breadcrumb.tsx +335 -50
- package/src/components/ui/button.tsx +198 -90
- package/src/components/ui/calendar.tsx +867 -43
- package/src/components/ui/card.tsx +140 -33
- package/src/components/ui/carousel.tsx +529 -98
- package/src/components/ui/chart.tsx +222 -1
- package/src/components/ui/checkbox.tsx +176 -38
- package/src/components/ui/collapsible.tsx +321 -67
- package/src/components/ui/combobox.tsx +284 -83
- package/src/components/ui/command.tsx +527 -67
- package/src/components/ui/container.tsx +217 -65
- package/src/components/ui/context-menu.tsx +716 -51
- package/src/components/ui/date-picker.tsx +228 -38
- package/src/components/ui/dialog.tsx +270 -33
- package/src/components/ui/drawer.tsx +546 -67
- package/src/components/ui/dropdown-menu.tsx +657 -74
- package/src/components/ui/empty-state.tsx +241 -82
- package/src/components/ui/hover-card.tsx +328 -39
- package/src/components/ui/input.tsx +207 -44
- package/src/components/ui/label.tsx +98 -8
- package/src/components/ui/menubar.tsx +587 -54
- package/src/components/ui/navigation-menu.tsx +557 -128
- package/src/components/ui/pagination.tsx +561 -79
- package/src/components/ui/popover.tsx +119 -8
- package/src/components/ui/progress.tsx +131 -29
- package/src/components/ui/radio-group.tsx +260 -51
- package/src/components/ui/resizable.tsx +289 -63
- package/src/components/ui/scroll-area.tsx +377 -66
- package/src/components/ui/select.tsx +545 -60
- package/src/components/ui/separator.tsx +146 -40
- package/src/components/ui/sheet.tsx +348 -31
- package/src/components/ui/sidebar.tsx +471 -29
- package/src/components/ui/skeleton.tsx +114 -32
- package/src/components/ui/slider.tsx +77 -31
- package/src/components/ui/sonner.tsx +574 -46
- package/src/components/ui/stack.tsx +423 -101
- package/src/components/ui/switch.tsx +78 -39
- package/src/components/ui/table.tsx +170 -4
- package/src/components/ui/tabs.tsx +108 -22
- package/src/components/ui/text-field.tsx +226 -81
- package/src/components/ui/textarea.tsx +180 -29
- package/src/components/ui/theme-toggle.tsx +313 -65
- package/src/components/ui/theme.tsx +117 -23
- package/src/components/ui/toggle-group.tsx +280 -69
- package/src/components/ui/toggle.tsx +124 -35
- package/src/components/ui/tooltip.tsx +239 -29
- package/src/components/ui/typography.tsx +1115 -165
|
@@ -4,6 +4,160 @@ import { XIcon } from "lucide-react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Props for Sheet component (Documentation only - NOT used in component implementation)
|
|
9
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
12
|
+
type SheetDocsProps = {
|
|
13
|
+
/** Controls the open state of the sheet. Use with onOpenChange for controlled behavior */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/** Callback fired when the open state changes. Use with open for controlled behavior */
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** Initial open state for uncontrolled usage @default false */
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/** Whether the sheet should be modal (blocking interaction with content behind) @default true */
|
|
20
|
+
modal?: boolean;
|
|
21
|
+
/** Child elements that make up the sheet (trigger, content, etc.) */
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Props for SheetTrigger component (Documentation only - NOT used in component implementation)
|
|
27
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
28
|
+
*/
|
|
29
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
30
|
+
type SheetTriggerDocsProps = {
|
|
31
|
+
/** When true, merges props with child element instead of rendering a button @default false */
|
|
32
|
+
asChild?: boolean;
|
|
33
|
+
/** Child element to render as the trigger. Required when asChild is true */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Props for SheetClose component (Documentation only - NOT used in component implementation)
|
|
39
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
40
|
+
*/
|
|
41
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
42
|
+
type SheetCloseDocsProps = {
|
|
43
|
+
/** When true, merges props with child element instead of rendering a button @default false */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
/** Child element to render as the close button. Required when asChild is true */
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Props for SheetPortal component (Documentation only - NOT used in component implementation)
|
|
51
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
52
|
+
*/
|
|
53
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
54
|
+
type SheetPortalDocsProps = {
|
|
55
|
+
/** Forces mounting when true. Useful for controlling animations with external state */
|
|
56
|
+
forceMount?: boolean;
|
|
57
|
+
/** Container element to portal the sheet into @default document.body */
|
|
58
|
+
container?: HTMLElement | null;
|
|
59
|
+
/** Child elements to render in the portal */
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Props for SheetOverlay component (Documentation only - NOT used in component implementation)
|
|
65
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
66
|
+
*/
|
|
67
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
68
|
+
type SheetOverlayDocsProps = {
|
|
69
|
+
/** When true, merges props with child element instead of rendering a div @default false */
|
|
70
|
+
asChild?: boolean;
|
|
71
|
+
/** Forces mounting when true. Useful for controlling animations with external state */
|
|
72
|
+
forceMount?: boolean;
|
|
73
|
+
/** Additional CSS classes for styling customization */
|
|
74
|
+
className?: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Props for SheetContent component (Documentation only - NOT used in component implementation)
|
|
79
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
80
|
+
*/
|
|
81
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
82
|
+
type SheetContentDocsProps = {
|
|
83
|
+
/** When true, merges props with child element instead of rendering a div @default false */
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
/** Forces mounting when true. Useful for controlling animations with external state */
|
|
86
|
+
forceMount?: boolean;
|
|
87
|
+
/** Event handler called when focus moves to the trigger after closing */
|
|
88
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
89
|
+
/** Event handler called when focus moves into the component after opening */
|
|
90
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
91
|
+
/** Event handler called when the escape key is down */
|
|
92
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
93
|
+
/** Event handler called when a pointer down event happens outside the bounds of the component */
|
|
94
|
+
onPointerDownOutside?: (
|
|
95
|
+
event: CustomEvent<{ originalEvent: PointerEvent }>,
|
|
96
|
+
) => void;
|
|
97
|
+
/** Event handler called when an interaction (pointer or focus) happens outside the bounds of the component */
|
|
98
|
+
onInteractOutside?: (
|
|
99
|
+
event: CustomEvent<{ originalEvent: PointerEvent | FocusEvent }>,
|
|
100
|
+
) => void;
|
|
101
|
+
/** Which side of the screen the sheet slides in from @default "right" */
|
|
102
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
103
|
+
/** Additional CSS classes for styling customization */
|
|
104
|
+
className?: string;
|
|
105
|
+
/** Content to display inside the sheet */
|
|
106
|
+
children?: React.ReactNode;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Props for SheetHeader component (Documentation only - NOT used in component implementation)
|
|
111
|
+
* These types are for documentation generation and should not replace HTML element types
|
|
112
|
+
*/
|
|
113
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
114
|
+
type SheetHeaderDocsProps = {
|
|
115
|
+
/** Additional CSS classes for styling customization */
|
|
116
|
+
className?: string;
|
|
117
|
+
/** Header content (typically SheetTitle and SheetDescription) */
|
|
118
|
+
children?: React.ReactNode;
|
|
119
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Props for SheetFooter component (Documentation only - NOT used in component implementation)
|
|
123
|
+
* These types are for documentation generation and should not replace HTML element types
|
|
124
|
+
*/
|
|
125
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
126
|
+
type SheetFooterDocsProps = {
|
|
127
|
+
/** Additional CSS classes for styling customization */
|
|
128
|
+
className?: string;
|
|
129
|
+
/** Footer content (typically action buttons) */
|
|
130
|
+
children?: React.ReactNode;
|
|
131
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Props for SheetTitle component (Documentation only - NOT used in component implementation)
|
|
135
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
136
|
+
*/
|
|
137
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
138
|
+
type SheetTitleDocsProps = {
|
|
139
|
+
/** When true, merges props with child element instead of rendering an h2 @default false */
|
|
140
|
+
asChild?: boolean;
|
|
141
|
+
/** Additional CSS classes for styling customization */
|
|
142
|
+
className?: string;
|
|
143
|
+
/** Title text content */
|
|
144
|
+
children?: React.ReactNode;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Props for SheetDescription component (Documentation only - NOT used in component implementation)
|
|
149
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
150
|
+
*/
|
|
151
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
152
|
+
type SheetDescriptionDocsProps = {
|
|
153
|
+
/** When true, merges props with child element instead of rendering a p element @default false */
|
|
154
|
+
asChild?: boolean;
|
|
155
|
+
/** Additional CSS classes for styling customization */
|
|
156
|
+
className?: string;
|
|
157
|
+
/** Description text content */
|
|
158
|
+
children?: React.ReactNode;
|
|
159
|
+
};
|
|
160
|
+
|
|
7
161
|
/**
|
|
8
162
|
* Sheet - A slide-out panel that displays supplementary content
|
|
9
163
|
*
|
|
@@ -120,7 +274,8 @@ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
|
120
274
|
*
|
|
121
275
|
* The trigger element that users interact with to open the sheet.
|
|
122
276
|
* Use the `asChild` prop to render as a different element while
|
|
123
|
-
* maintaining the trigger functionality.
|
|
277
|
+
* maintaining the trigger functionality. When clicked, opens the
|
|
278
|
+
* sheet and manages focus appropriately.
|
|
124
279
|
*
|
|
125
280
|
* @component
|
|
126
281
|
* @example
|
|
@@ -141,7 +296,16 @@ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
|
141
296
|
* </SheetTrigger>
|
|
142
297
|
* ```
|
|
143
298
|
*
|
|
144
|
-
* @param asChild - When true, merges props with
|
|
299
|
+
* @param asChild - When true, merges props with child element instead of rendering a button @default false
|
|
300
|
+
* @param children - Child element to render as the trigger. Required when asChild is true
|
|
301
|
+
*
|
|
302
|
+
* @accessibility
|
|
303
|
+
* - Automatically receives appropriate ARIA attributes
|
|
304
|
+
* - Manages focus when sheet opens and closes
|
|
305
|
+
* - Supports keyboard activation (Space and Enter)
|
|
306
|
+
*
|
|
307
|
+
* @see {@link SheetContent} For the content that this trigger opens
|
|
308
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#trigger} Radix UI Dialog Trigger
|
|
145
309
|
*/
|
|
146
310
|
function SheetTrigger({
|
|
147
311
|
...props
|
|
@@ -155,6 +319,7 @@ function SheetTrigger({
|
|
|
155
319
|
* A button that closes the sheet when clicked. Can be placed anywhere
|
|
156
320
|
* within the sheet content. Use the `asChild` prop to render as a
|
|
157
321
|
* different element while maintaining the close functionality.
|
|
322
|
+
* Multiple close buttons can be used throughout the sheet content.
|
|
158
323
|
*
|
|
159
324
|
* @component
|
|
160
325
|
* @example
|
|
@@ -178,7 +343,16 @@ function SheetTrigger({
|
|
|
178
343
|
* </SheetClose>
|
|
179
344
|
* ```
|
|
180
345
|
*
|
|
181
|
-
* @param asChild - When true, merges props with
|
|
346
|
+
* @param asChild - When true, merges props with child element instead of rendering a button @default false
|
|
347
|
+
* @param children - Child element to render as the close button. Required when asChild is true
|
|
348
|
+
*
|
|
349
|
+
* @accessibility
|
|
350
|
+
* - Automatically receives appropriate ARIA attributes
|
|
351
|
+
* - Supports keyboard activation (Space and Enter)
|
|
352
|
+
* - Focus returns to trigger element after closing
|
|
353
|
+
*
|
|
354
|
+
* @see {@link SheetTrigger} For the element that opens the sheet
|
|
355
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#close} Radix UI Dialog Close
|
|
182
356
|
*/
|
|
183
357
|
function SheetClose({
|
|
184
358
|
...props
|
|
@@ -192,9 +366,38 @@ function SheetClose({
|
|
|
192
366
|
* Renders the sheet content in a portal at the end of the document body.
|
|
193
367
|
* This ensures the sheet appears above other content with proper z-index.
|
|
194
368
|
* Usually not used directly - SheetContent handles this automatically.
|
|
369
|
+
* Essential for proper layering and focus management.
|
|
195
370
|
*
|
|
196
371
|
* @component
|
|
197
|
-
* @
|
|
372
|
+
* @example
|
|
373
|
+
* ```tsx
|
|
374
|
+
* // Custom portal container
|
|
375
|
+
* <SheetPortal container={customContainer}>
|
|
376
|
+
* <SheetOverlay />
|
|
377
|
+
* <SheetPrimitive.Content>
|
|
378
|
+
* Sheet content here
|
|
379
|
+
* </SheetPrimitive.Content>
|
|
380
|
+
* </SheetPortal>
|
|
381
|
+
*
|
|
382
|
+
* // Force mounted portal for animation control
|
|
383
|
+
* <SheetPortal forceMount={shouldShow}>
|
|
384
|
+
* <SheetOverlay />
|
|
385
|
+
* <SheetPrimitive.Content>
|
|
386
|
+
* Content with custom mounting logic
|
|
387
|
+
* </SheetPrimitive.Content>
|
|
388
|
+
* </SheetPortal>
|
|
389
|
+
* ```
|
|
390
|
+
*
|
|
391
|
+
* @param forceMount - Forces mounting when true. Useful for controlling animations with external state
|
|
392
|
+
* @param container - Container element to portal the sheet into @default document.body
|
|
393
|
+
* @param children - Child elements to render in the portal (overlay and content)
|
|
394
|
+
*
|
|
395
|
+
* @accessibility
|
|
396
|
+
* - Ensures sheet content is properly layered for screen readers
|
|
397
|
+
* - Maintains proper document flow for accessibility tree
|
|
398
|
+
*
|
|
399
|
+
* @see {@link SheetContent} For the main content component that uses this portal
|
|
400
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#portal} Radix UI Dialog Portal
|
|
198
401
|
*/
|
|
199
402
|
function SheetPortal({
|
|
200
403
|
...props
|
|
@@ -206,17 +409,34 @@ function SheetPortal({
|
|
|
206
409
|
* SheetOverlay - Background overlay behind the sheet
|
|
207
410
|
*
|
|
208
411
|
* A semi-transparent overlay that covers the entire viewport behind the sheet.
|
|
209
|
-
* Clicking the overlay closes the sheet. Includes smooth
|
|
412
|
+
* Clicking the overlay closes the sheet (when modal is true). Includes smooth
|
|
413
|
+
* fade animations and prevents interaction with content behind the sheet.
|
|
210
414
|
* Usually not used directly - SheetContent handles this automatically.
|
|
211
415
|
*
|
|
212
416
|
* @component
|
|
213
|
-
* @param className - Additional CSS classes for styling customization
|
|
214
|
-
*
|
|
215
417
|
* @example
|
|
216
418
|
* ```tsx
|
|
217
419
|
* // Custom overlay with different opacity
|
|
218
420
|
* <SheetOverlay className="bg-black/30" />
|
|
421
|
+
*
|
|
422
|
+
* // Overlay with custom animation timing
|
|
423
|
+
* <SheetOverlay className="bg-black/60 duration-200" />
|
|
424
|
+
*
|
|
425
|
+
* // Force mounted overlay for external animation control
|
|
426
|
+
* <SheetOverlay forceMount={isAnimating} />
|
|
219
427
|
* ```
|
|
428
|
+
*
|
|
429
|
+
* @param asChild - When true, merges props with child element instead of rendering a div @default false
|
|
430
|
+
* @param forceMount - Forces mounting when true. Useful for controlling animations with external state
|
|
431
|
+
* @param className - Additional CSS classes for styling customization
|
|
432
|
+
*
|
|
433
|
+
* @accessibility
|
|
434
|
+
* - Prevents interaction with content behind the sheet
|
|
435
|
+
* - Clicking overlay closes the sheet (respects modal behavior)
|
|
436
|
+
* - Proper z-index layering for screen readers
|
|
437
|
+
*
|
|
438
|
+
* @see {@link SheetContent} For the content component that uses this overlay
|
|
439
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#overlay} Radix UI Dialog Overlay
|
|
220
440
|
*/
|
|
221
441
|
function SheetOverlay({
|
|
222
442
|
className,
|
|
@@ -239,13 +459,13 @@ function SheetOverlay({
|
|
|
239
459
|
*
|
|
240
460
|
* The primary content area of the sheet that slides in from the specified side.
|
|
241
461
|
* Includes automatic overlay, portal rendering, and close button. Contains smooth
|
|
242
|
-
* slide animations
|
|
462
|
+
* slide animations with responsive sizing and proper focus management.
|
|
243
463
|
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @param children - Content to display inside the sheet
|
|
464
|
+
* Features automatic positioning based on the side prop:
|
|
465
|
+
* - Right/Left: Full height, responsive width (3/4 on mobile, max 384px on desktop)
|
|
466
|
+
* - Top/Bottom: Full width, auto height based on content
|
|
248
467
|
*
|
|
468
|
+
* @component
|
|
249
469
|
* @example
|
|
250
470
|
* ```tsx
|
|
251
471
|
* // Default right-side sheet
|
|
@@ -282,10 +502,28 @@ function SheetOverlay({
|
|
|
282
502
|
* </SheetContent>
|
|
283
503
|
* ```
|
|
284
504
|
*
|
|
505
|
+
* @param asChild - When true, merges props with child element instead of rendering a div @default false
|
|
506
|
+
* @param forceMount - Forces mounting when true. Useful for controlling animations with external state
|
|
507
|
+
* @param onCloseAutoFocus - Event handler called when focus moves to the trigger after closing
|
|
508
|
+
* @param onOpenAutoFocus - Event handler called when focus moves into the component after opening
|
|
509
|
+
* @param onEscapeKeyDown - Event handler called when the escape key is down. Can prevent default to disable escape key closing
|
|
510
|
+
* @param onPointerDownOutside - Event handler called when a pointer down event happens outside the component bounds
|
|
511
|
+
* @param onInteractOutside - Event handler called when an interaction happens outside the component bounds
|
|
512
|
+
* @param side - Which side of the screen the sheet slides in from @default "right"
|
|
513
|
+
* @param className - Additional CSS classes for styling customization
|
|
514
|
+
* @param children - Content to display inside the sheet
|
|
515
|
+
*
|
|
285
516
|
* @accessibility
|
|
286
|
-
* - Includes built-in close button with proper ARIA labels
|
|
287
|
-
* - Focus trapped within content when open
|
|
288
|
-
* -
|
|
517
|
+
* - Includes built-in close button with proper ARIA labels and screen reader text
|
|
518
|
+
* - Focus automatically trapped within content when open
|
|
519
|
+
* - Escape key closes the sheet (can be prevented with onEscapeKeyDown)
|
|
520
|
+
* - Background overlay prevents interaction with page content
|
|
521
|
+
* - Focus returns to trigger element when closed
|
|
522
|
+
* - Supports all standard keyboard interactions
|
|
523
|
+
*
|
|
524
|
+
* @see {@link SheetHeader} For structured header content
|
|
525
|
+
* @see {@link SheetFooter} For action buttons
|
|
526
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#content} Radix UI Dialog Content
|
|
289
527
|
*/
|
|
290
528
|
function SheetContent({
|
|
291
529
|
className,
|
|
@@ -329,12 +567,13 @@ function SheetContent({
|
|
|
329
567
|
*
|
|
330
568
|
* A container for the sheet's title and description, positioned at the top
|
|
331
569
|
* of the sheet content. Provides consistent spacing and layout for sheet headers.
|
|
570
|
+
* Should contain SheetTitle and optionally SheetDescription for proper
|
|
571
|
+
* accessibility and semantic structure.
|
|
332
572
|
*
|
|
333
573
|
* @component
|
|
334
|
-
* @param className - Additional CSS classes for styling customization
|
|
335
|
-
*
|
|
336
574
|
* @example
|
|
337
575
|
* ```tsx
|
|
576
|
+
* // Complete header with title and description
|
|
338
577
|
* <SheetHeader>
|
|
339
578
|
* <SheetTitle>Edit Profile</SheetTitle>
|
|
340
579
|
* <SheetDescription>
|
|
@@ -342,11 +581,30 @@ function SheetContent({
|
|
|
342
581
|
* </SheetDescription>
|
|
343
582
|
* </SheetHeader>
|
|
344
583
|
*
|
|
345
|
-
* //
|
|
346
|
-
* <SheetHeader
|
|
347
|
-
* <SheetTitle>
|
|
584
|
+
* // Header with title only
|
|
585
|
+
* <SheetHeader>
|
|
586
|
+
* <SheetTitle>Quick Actions</SheetTitle>
|
|
587
|
+
* </SheetHeader>
|
|
588
|
+
*
|
|
589
|
+
* // With custom styling and border
|
|
590
|
+
* <SheetHeader className="border-b pb-4 mb-4">
|
|
591
|
+
* <SheetTitle>Advanced Settings</SheetTitle>
|
|
592
|
+
* <SheetDescription>
|
|
593
|
+
* Configure advanced options for your account.
|
|
594
|
+
* </SheetDescription>
|
|
348
595
|
* </SheetHeader>
|
|
349
596
|
* ```
|
|
597
|
+
*
|
|
598
|
+
* @param className - Additional CSS classes for styling customization
|
|
599
|
+
* @param children - Header content (typically SheetTitle and SheetDescription)
|
|
600
|
+
*
|
|
601
|
+
* @accessibility
|
|
602
|
+
* - Provides semantic structure for sheet content
|
|
603
|
+
* - Works with SheetTitle to properly label the sheet
|
|
604
|
+
* - Maintains proper heading hierarchy
|
|
605
|
+
*
|
|
606
|
+
* @see {@link SheetTitle} For the main sheet heading
|
|
607
|
+
* @see {@link SheetDescription} For additional context text
|
|
350
608
|
*/
|
|
351
609
|
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
352
610
|
return (
|
|
@@ -363,12 +621,12 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
363
621
|
*
|
|
364
622
|
* A container for action buttons positioned at the bottom of the sheet content.
|
|
365
623
|
* Uses `mt-auto` to stick to the bottom and provides consistent spacing for buttons.
|
|
624
|
+
* Ideal for primary and secondary actions like Save/Cancel button pairs.
|
|
366
625
|
*
|
|
367
626
|
* @component
|
|
368
|
-
* @param className - Additional CSS classes for styling customization
|
|
369
|
-
*
|
|
370
627
|
* @example
|
|
371
628
|
* ```tsx
|
|
629
|
+
* // Standard save/cancel footer
|
|
372
630
|
* <SheetFooter>
|
|
373
631
|
* <SheetClose asChild>
|
|
374
632
|
* <Button variant="outline">Cancel</Button>
|
|
@@ -383,7 +641,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
383
641
|
* </SheetClose>
|
|
384
642
|
* </SheetFooter>
|
|
385
643
|
*
|
|
386
|
-
* // Custom layout
|
|
644
|
+
* // Custom layout with multiple action groups
|
|
387
645
|
* <SheetFooter className="flex-row justify-between">
|
|
388
646
|
* <Button variant="ghost">Reset</Button>
|
|
389
647
|
* <div className="flex gap-2">
|
|
@@ -393,7 +651,25 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
393
651
|
* <Button>Save</Button>
|
|
394
652
|
* </div>
|
|
395
653
|
* </SheetFooter>
|
|
654
|
+
*
|
|
655
|
+
* // Footer with destructive action
|
|
656
|
+
* <SheetFooter>
|
|
657
|
+
* <Button variant="destructive">Delete Account</Button>
|
|
658
|
+
* <SheetClose asChild>
|
|
659
|
+
* <Button variant="outline">Keep Account</Button>
|
|
660
|
+
* </SheetClose>
|
|
661
|
+
* </SheetFooter>
|
|
396
662
|
* ```
|
|
663
|
+
*
|
|
664
|
+
* @param className - Additional CSS classes for styling customization
|
|
665
|
+
* @param children - Footer content (typically action buttons)
|
|
666
|
+
*
|
|
667
|
+
* @accessibility
|
|
668
|
+
* - Provides semantic footer structure
|
|
669
|
+
* - Supports proper tab order for action buttons
|
|
670
|
+
* - Works with form submission patterns
|
|
671
|
+
*
|
|
672
|
+
* @see {@link SheetClose} For buttons that close the sheet
|
|
397
673
|
*/
|
|
398
674
|
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
399
675
|
return (
|
|
@@ -410,12 +686,12 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
410
686
|
*
|
|
411
687
|
* The main heading for the sheet content. Provides proper semantic heading
|
|
412
688
|
* and accessibility labeling for screen readers. Should be used within SheetHeader.
|
|
689
|
+
* This component is required for proper accessibility - every sheet must have a title.
|
|
413
690
|
*
|
|
414
691
|
* @component
|
|
415
|
-
* @param className - Additional CSS classes for styling customization
|
|
416
|
-
*
|
|
417
692
|
* @example
|
|
418
693
|
* ```tsx
|
|
694
|
+
* // Standard usage in header
|
|
419
695
|
* <SheetHeader>
|
|
420
696
|
* <SheetTitle>Edit Profile</SheetTitle>
|
|
421
697
|
* <SheetDescription>Update your profile information.</SheetDescription>
|
|
@@ -423,11 +699,29 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
423
699
|
*
|
|
424
700
|
* // With custom styling
|
|
425
701
|
* <SheetTitle className="text-lg text-blue-600">Settings</SheetTitle>
|
|
702
|
+
*
|
|
703
|
+
* // As a custom heading level
|
|
704
|
+
* <SheetTitle asChild>
|
|
705
|
+
* <h1 className="text-2xl font-bold">Important Notice</h1>
|
|
706
|
+
* </SheetTitle>
|
|
707
|
+
*
|
|
708
|
+
* // Dynamic title content
|
|
709
|
+
* <SheetTitle>Edit {selectedUser?.name || 'User'}</SheetTitle>
|
|
426
710
|
* ```
|
|
427
711
|
*
|
|
712
|
+
* @param asChild - When true, merges props with child element instead of rendering an h2 @default false
|
|
713
|
+
* @param className - Additional CSS classes for styling customization
|
|
714
|
+
* @param children - Title text content
|
|
715
|
+
*
|
|
428
716
|
* @accessibility
|
|
429
|
-
* -
|
|
430
|
-
* -
|
|
717
|
+
* - Required for proper sheet accessibility
|
|
718
|
+
* - Automatically provides ARIA labeling for the entire sheet
|
|
719
|
+
* - Renders as semantic heading element (h2 by default)
|
|
720
|
+
* - Screen readers announce this title when sheet opens
|
|
721
|
+
*
|
|
722
|
+
* @see {@link SheetHeader} For proper title placement
|
|
723
|
+
* @see {@link SheetDescription} For additional context
|
|
724
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#title} Radix UI Dialog Title
|
|
431
725
|
*/
|
|
432
726
|
function SheetTitle({
|
|
433
727
|
className,
|
|
@@ -447,12 +741,12 @@ function SheetTitle({
|
|
|
447
741
|
*
|
|
448
742
|
* Provides additional context about the sheet's purpose or instructions.
|
|
449
743
|
* Appears below the title with muted styling. Should be used within SheetHeader.
|
|
744
|
+
* While optional, it's recommended for better accessibility and user understanding.
|
|
450
745
|
*
|
|
451
746
|
* @component
|
|
452
|
-
* @param className - Additional CSS classes for styling customization
|
|
453
|
-
*
|
|
454
747
|
* @example
|
|
455
748
|
* ```tsx
|
|
749
|
+
* // Standard usage with instructional text
|
|
456
750
|
* <SheetHeader>
|
|
457
751
|
* <SheetTitle>Edit Profile</SheetTitle>
|
|
458
752
|
* <SheetDescription>
|
|
@@ -460,15 +754,38 @@ function SheetTitle({
|
|
|
460
754
|
* </SheetDescription>
|
|
461
755
|
* </SheetHeader>
|
|
462
756
|
*
|
|
463
|
-
* //
|
|
757
|
+
* // Warning or important information
|
|
464
758
|
* <SheetDescription className="text-orange-600">
|
|
465
759
|
* This action cannot be undone.
|
|
466
760
|
* </SheetDescription>
|
|
761
|
+
*
|
|
762
|
+
* // Custom styled description
|
|
763
|
+
* <SheetDescription asChild>
|
|
764
|
+
* <p className="text-sm text-gray-600 italic">
|
|
765
|
+
* Changes will be saved automatically.
|
|
766
|
+
* </p>
|
|
767
|
+
* </SheetDescription>
|
|
768
|
+
*
|
|
769
|
+
* // Contextual help description
|
|
770
|
+
* <SheetDescription>
|
|
771
|
+
* Use this form to update your notification preferences.
|
|
772
|
+
* Changes take effect immediately.
|
|
773
|
+
* </SheetDescription>
|
|
467
774
|
* ```
|
|
468
775
|
*
|
|
776
|
+
* @param asChild - When true, merges props with child element instead of rendering a p element @default false
|
|
777
|
+
* @param className - Additional CSS classes for styling customization
|
|
778
|
+
* @param children - Description text content
|
|
779
|
+
*
|
|
469
780
|
* @accessibility
|
|
470
781
|
* - Provides additional context for screen readers
|
|
471
|
-
* -
|
|
782
|
+
* - Automatically linked to the sheet via ARIA attributes
|
|
783
|
+
* - Announced by screen readers when sheet opens
|
|
784
|
+
* - Helps users understand the sheet's purpose
|
|
785
|
+
*
|
|
786
|
+
* @see {@link SheetTitle} For the main sheet heading
|
|
787
|
+
* @see {@link SheetHeader} For proper description placement
|
|
788
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/dialog#description} Radix UI Dialog Description
|
|
472
789
|
*/
|
|
473
790
|
function SheetDescription({
|
|
474
791
|
className,
|