@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.
Files changed (173) hide show
  1. package/dist/components/ui/accordion.d.ts +1 -25
  2. package/dist/components/ui/accordion.d.ts.map +1 -1
  3. package/dist/components/ui/alert-dialog.d.ts +240 -46
  4. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  5. package/dist/components/ui/alert.d.ts +73 -11
  6. package/dist/components/ui/alert.d.ts.map +1 -1
  7. package/dist/components/ui/aspect-ratio.d.ts +44 -10
  8. package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
  9. package/dist/components/ui/avatar.d.ts +117 -33
  10. package/dist/components/ui/avatar.d.ts.map +1 -1
  11. package/dist/components/ui/badge.d.ts +50 -71
  12. package/dist/components/ui/badge.d.ts.map +1 -1
  13. package/dist/components/ui/breadcrumb.d.ts +231 -49
  14. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  15. package/dist/components/ui/button.d.ts +189 -71
  16. package/dist/components/ui/button.d.ts.map +1 -1
  17. package/dist/components/ui/calendar.d.ts +197 -40
  18. package/dist/components/ui/calendar.d.ts.map +1 -1
  19. package/dist/components/ui/card.d.ts +7 -22
  20. package/dist/components/ui/card.d.ts.map +1 -1
  21. package/dist/components/ui/carousel.d.ts +369 -99
  22. package/dist/components/ui/carousel.d.ts.map +1 -1
  23. package/dist/components/ui/chart.d.ts.map +1 -1
  24. package/dist/components/ui/checkbox.d.ts +110 -38
  25. package/dist/components/ui/checkbox.d.ts.map +1 -1
  26. package/dist/components/ui/collapsible.d.ts +246 -61
  27. package/dist/components/ui/collapsible.d.ts.map +1 -1
  28. package/dist/components/ui/combobox.d.ts +207 -159
  29. package/dist/components/ui/combobox.d.ts.map +1 -1
  30. package/dist/components/ui/command.d.ts +336 -67
  31. package/dist/components/ui/command.d.ts.map +1 -1
  32. package/dist/components/ui/container.d.ts +159 -64
  33. package/dist/components/ui/container.d.ts.map +1 -1
  34. package/dist/components/ui/context-menu.d.ts +321 -39
  35. package/dist/components/ui/context-menu.d.ts.map +1 -1
  36. package/dist/components/ui/date-picker.d.ts +113 -86
  37. package/dist/components/ui/date-picker.d.ts.map +1 -1
  38. package/dist/components/ui/dialog.d.ts +106 -25
  39. package/dist/components/ui/dialog.d.ts.map +1 -1
  40. package/dist/components/ui/drawer.d.ts +388 -59
  41. package/dist/components/ui/drawer.d.ts.map +1 -1
  42. package/dist/components/ui/dropdown-menu.d.ts +521 -74
  43. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  44. package/dist/components/ui/empty-state.d.ts +148 -76
  45. package/dist/components/ui/empty-state.d.ts.map +1 -1
  46. package/dist/components/ui/hover-card.d.ts +253 -34
  47. package/dist/components/ui/hover-card.d.ts.map +1 -1
  48. package/dist/components/ui/input.d.ts +143 -44
  49. package/dist/components/ui/input.d.ts.map +1 -1
  50. package/dist/components/ui/label.d.ts +0 -8
  51. package/dist/components/ui/label.d.ts.map +1 -1
  52. package/dist/components/ui/menubar.d.ts +288 -46
  53. package/dist/components/ui/menubar.d.ts.map +1 -1
  54. package/dist/components/ui/navigation-menu.d.ts +444 -127
  55. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  56. package/dist/components/ui/pagination.d.ts +342 -66
  57. package/dist/components/ui/pagination.d.ts.map +1 -1
  58. package/dist/components/ui/popover.d.ts +0 -8
  59. package/dist/components/ui/popover.d.ts.map +1 -1
  60. package/dist/components/ui/progress.d.ts +88 -30
  61. package/dist/components/ui/progress.d.ts.map +1 -1
  62. package/dist/components/ui/radio-group.d.ts +189 -45
  63. package/dist/components/ui/radio-group.d.ts.map +1 -1
  64. package/dist/components/ui/resizable.d.ts +178 -62
  65. package/dist/components/ui/resizable.d.ts.map +1 -1
  66. package/dist/components/ui/scroll-area.d.ts +180 -21
  67. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  68. package/dist/components/ui/select.d.ts +382 -60
  69. package/dist/components/ui/select.d.ts.map +1 -1
  70. package/dist/components/ui/separator.d.ts +52 -39
  71. package/dist/components/ui/separator.d.ts.map +1 -1
  72. package/dist/components/ui/sheet.d.ts +144 -27
  73. package/dist/components/ui/sheet.d.ts.map +1 -1
  74. package/dist/components/ui/sidebar.d.ts +81 -31
  75. package/dist/components/ui/sidebar.d.ts.map +1 -1
  76. package/dist/components/ui/skeleton.d.ts +94 -32
  77. package/dist/components/ui/skeleton.d.ts.map +1 -1
  78. package/dist/components/ui/slider.d.ts +37 -31
  79. package/dist/components/ui/slider.d.ts.map +1 -1
  80. package/dist/components/ui/sonner.d.ts +280 -46
  81. package/dist/components/ui/sonner.d.ts.map +1 -1
  82. package/dist/components/ui/stack.d.ts +289 -148
  83. package/dist/components/ui/stack.d.ts.map +1 -1
  84. package/dist/components/ui/stories/aspect-ratio.stories.d.ts +1 -2
  85. package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
  86. package/dist/components/ui/stories/container.stories.d.ts +2 -3
  87. package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
  88. package/dist/components/ui/stories/empty-state.stories.d.ts +2 -2
  89. package/dist/components/ui/stories/scroll-area.stories.d.ts +1 -2
  90. package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
  91. package/dist/components/ui/stories/stack.stories.d.ts +1 -1
  92. package/dist/components/ui/stories/text-field.stories.d.ts +7 -1
  93. package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
  94. package/dist/components/ui/switch.d.ts +44 -38
  95. package/dist/components/ui/switch.d.ts.map +1 -1
  96. package/dist/components/ui/table.d.ts +33 -0
  97. package/dist/components/ui/table.d.ts.map +1 -1
  98. package/dist/components/ui/tabs.d.ts +4 -22
  99. package/dist/components/ui/tabs.d.ts.map +1 -1
  100. package/dist/components/ui/text-field.d.ts +170 -84
  101. package/dist/components/ui/text-field.d.ts.map +1 -1
  102. package/dist/components/ui/textarea.d.ts +106 -29
  103. package/dist/components/ui/textarea.d.ts.map +1 -1
  104. package/dist/components/ui/theme-toggle.d.ts +190 -65
  105. package/dist/components/ui/theme-toggle.d.ts.map +1 -1
  106. package/dist/components/ui/theme.d.ts +107 -23
  107. package/dist/components/ui/theme.d.ts.map +1 -1
  108. package/dist/components/ui/toggle-group.d.ts +143 -67
  109. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  110. package/dist/components/ui/toggle.d.ts +118 -30
  111. package/dist/components/ui/toggle.d.ts.map +1 -1
  112. package/dist/components/ui/tooltip.d.ts +152 -28
  113. package/dist/components/ui/tooltip.d.ts.map +1 -1
  114. package/dist/components/ui/typography.d.ts +452 -134
  115. package/dist/components/ui/typography.d.ts.map +1 -1
  116. package/dist/index.js +9388 -8281
  117. package/dist/index.js.map +1 -1
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/llms.txt +173 -3
  120. package/package.json +5 -2
  121. package/src/components/ui/accordion.tsx +112 -27
  122. package/src/components/ui/alert-dialog.tsx +401 -46
  123. package/src/components/ui/alert.tsx +114 -11
  124. package/src/components/ui/aspect-ratio.tsx +69 -14
  125. package/src/components/ui/avatar.tsx +179 -33
  126. package/src/components/ui/badge.tsx +74 -75
  127. package/src/components/ui/breadcrumb.tsx +335 -50
  128. package/src/components/ui/button.tsx +198 -90
  129. package/src/components/ui/calendar.tsx +867 -43
  130. package/src/components/ui/card.tsx +140 -33
  131. package/src/components/ui/carousel.tsx +529 -98
  132. package/src/components/ui/chart.tsx +222 -1
  133. package/src/components/ui/checkbox.tsx +176 -38
  134. package/src/components/ui/collapsible.tsx +321 -67
  135. package/src/components/ui/combobox.tsx +284 -83
  136. package/src/components/ui/command.tsx +527 -67
  137. package/src/components/ui/container.tsx +217 -65
  138. package/src/components/ui/context-menu.tsx +716 -51
  139. package/src/components/ui/date-picker.tsx +228 -38
  140. package/src/components/ui/dialog.tsx +270 -33
  141. package/src/components/ui/drawer.tsx +546 -67
  142. package/src/components/ui/dropdown-menu.tsx +657 -74
  143. package/src/components/ui/empty-state.tsx +241 -82
  144. package/src/components/ui/hover-card.tsx +328 -39
  145. package/src/components/ui/input.tsx +207 -44
  146. package/src/components/ui/label.tsx +98 -8
  147. package/src/components/ui/menubar.tsx +587 -54
  148. package/src/components/ui/navigation-menu.tsx +557 -128
  149. package/src/components/ui/pagination.tsx +561 -79
  150. package/src/components/ui/popover.tsx +119 -8
  151. package/src/components/ui/progress.tsx +131 -29
  152. package/src/components/ui/radio-group.tsx +260 -51
  153. package/src/components/ui/resizable.tsx +289 -63
  154. package/src/components/ui/scroll-area.tsx +377 -66
  155. package/src/components/ui/select.tsx +545 -60
  156. package/src/components/ui/separator.tsx +146 -40
  157. package/src/components/ui/sheet.tsx +348 -31
  158. package/src/components/ui/sidebar.tsx +471 -29
  159. package/src/components/ui/skeleton.tsx +114 -32
  160. package/src/components/ui/slider.tsx +77 -31
  161. package/src/components/ui/sonner.tsx +574 -46
  162. package/src/components/ui/stack.tsx +423 -101
  163. package/src/components/ui/switch.tsx +78 -39
  164. package/src/components/ui/table.tsx +170 -4
  165. package/src/components/ui/tabs.tsx +108 -22
  166. package/src/components/ui/text-field.tsx +226 -81
  167. package/src/components/ui/textarea.tsx +180 -29
  168. package/src/components/ui/theme-toggle.tsx +313 -65
  169. package/src/components/ui/theme.tsx +117 -23
  170. package/src/components/ui/toggle-group.tsx +280 -69
  171. package/src/components/ui/toggle.tsx +124 -35
  172. package/src/components/ui/tooltip.tsx +239 -29
  173. package/src/components/ui/typography.tsx +1115 -165
@@ -1,76 +1,108 @@
1
1
  import * as React from "react";
2
2
  import * as ResizablePrimitive from "react-resizable-panels";
3
3
  /**
4
- * Container for creating resizable panel groups with keyboard accessibility
4
+ * Container for creating resizable panel groups with full keyboard accessibility
5
5
  *
6
- * ResizablePanelGroup provides a flexible container for organizing multiple resizable panels.
7
- * Panels can be resized by dragging handles between them, with full keyboard support.
8
- * Built on top of react-resizable-panels with enhanced styling and accessibility features.
6
+ * ResizablePanelGroup provides a flexible container for organizing multiple resizable panels
7
+ * that can be resized by dragging handles between them or using keyboard navigation.
8
+ * Built on react-resizable-panels with enhanced styling, accessibility, and persistence features.
9
+ * Supports both horizontal and vertical layouts with automatic layout saving and restoration.
9
10
  *
10
11
  * @example
11
12
  * ```tsx
12
13
  * // Basic horizontal layout
13
14
  * <ResizablePanelGroup direction="horizontal" className="h-full">
14
15
  * <ResizablePanel defaultSize={50}>
15
- * <div className="p-4">Left panel</div>
16
+ * <div className="p-4">Left panel content</div>
16
17
  * </ResizablePanel>
17
18
  * <ResizableHandle />
18
19
  * <ResizablePanel defaultSize={50}>
19
- * <div className="p-4">Right panel</div>
20
+ * <div className="p-4">Right panel content</div>
20
21
  * </ResizablePanel>
21
22
  * </ResizablePanelGroup>
22
23
  * ```
23
24
  *
24
25
  * @example
25
26
  * ```tsx
26
- * // Vertical layout with handle
27
+ * // Vertical layout with visual handles
27
28
  * <ResizablePanelGroup direction="vertical" className="min-h-[400px]">
28
29
  * <ResizablePanel defaultSize={30}>
29
- * <header>Header content</header>
30
+ * <header className="p-4">Header content</header>
30
31
  * </ResizablePanel>
31
32
  * <ResizableHandle withHandle />
32
33
  * <ResizablePanel defaultSize={70}>
33
- * <main>Main content</main>
34
+ * <main className="p-4">Main content area</main>
34
35
  * </ResizablePanel>
35
36
  * </ResizablePanelGroup>
36
37
  * ```
37
38
  *
38
39
  * @example
39
40
  * ```tsx
40
- * // Complex layout with size constraints
41
- * <ResizablePanelGroup direction="horizontal">
41
+ * // Persistent layout with auto-save
42
+ * <ResizablePanelGroup
43
+ * direction="horizontal"
44
+ * autoSaveId="main-layout"
45
+ * onLayout={(sizes) => console.log('Layout changed:', sizes)}
46
+ * >
42
47
  * <ResizablePanel defaultSize={25} minSize={20} maxSize={40}>
43
48
  * <nav>Sidebar (20-40%)</nav>
44
49
  * </ResizablePanel>
45
50
  * <ResizableHandle withHandle />
46
51
  * <ResizablePanel defaultSize={75} minSize={60}>
47
- * <main>Content (min 60%)</main>
52
+ * <main>Content area (min 60%)</main>
53
+ * </ResizablePanel>
54
+ * </ResizablePanelGroup>
55
+ * ```
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * // Custom keyboard resize increment
60
+ * <ResizablePanelGroup
61
+ * direction="horizontal"
62
+ * keyboardResizeBy={5}
63
+ * dir="ltr"
64
+ * >
65
+ * <ResizablePanel defaultSize={50} id="left-panel">
66
+ * <div>Panel content</div>
67
+ * </ResizablePanel>
68
+ * <ResizableHandle />
69
+ * <ResizablePanel defaultSize={50} id="right-panel">
70
+ * <div>Panel content</div>
48
71
  * </ResizablePanel>
49
72
  * </ResizablePanelGroup>
50
73
  * ```
51
74
  *
52
- * @param direction - Layout direction: "horizontal" or "vertical"
53
- * @param className - Additional CSS classes
75
+ * @param direction - Layout direction: "horizontal" for side-by-side, "vertical" for top-to-bottom
76
+ * @param autoSaveId - Unique identifier for automatically saving/restoring panel layouts
77
+ * @param onLayout - Callback fired when panel sizes change, receives array of percentages
78
+ * @param keyboardResizeBy - Increment in percentage points for keyboard-based resizing
79
+ * @param storage - Custom storage implementation for layout persistence (defaults to localStorage)
80
+ * @param dir - Text direction for RTL/LTR layout support
81
+ * @param className - Additional CSS classes for custom styling
54
82
  * @param children - ResizablePanel and ResizableHandle components
55
83
  *
56
84
  * @accessibility
57
- * - Full keyboard navigation with arrow keys when handles are focused
58
- * - Screen reader support with proper ARIA labels
59
- * - Respects prefers-reduced-motion for users with motion sensitivity
60
- * - Maintains focus management during resize operations
85
+ * - Full keyboard navigation: Arrow keys resize panels when handles are focused
86
+ * - Screen reader announcements for panel size changes and resize operations
87
+ * - Respects prefers-reduced-motion to disable animations for motion-sensitive users
88
+ * - Maintains logical focus order and proper tab navigation
89
+ * - Provides ARIA labels and roles for assistive technology
90
+ * - Keyboard shortcuts: Home/End keys jump to min/max sizes
61
91
  *
62
- * @see {@link https://ui.shadcn.com/docs/components/resizable} for design patterns
92
+ * @see {@link https://react-resizable-panels.vercel.app/} Official react-resizable-panels documentation
93
+ * @see {@link https://ui.shadcn.com/docs/components/resizable} Design patterns and examples
94
+ * @see {@link ResizablePanel} Individual panel configuration options
95
+ * @see {@link ResizableHandle} Handle customization and interaction options
63
96
  * @since 1.0.0
64
- * @see {@link ResizablePanel} for individual panel configuration
65
- * @see {@link ResizableHandle} for handle customization options
66
97
  */
67
98
  declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
68
99
  /**
69
- * Individual resizable panel within a panel group
100
+ * Individual resizable panel within a panel group with size constraints and callbacks
70
101
  *
71
- * ResizablePanel represents a single section that can be resized within a ResizablePanelGroup.
72
- * Supports size constraints, default sizing, and programmatic control. Each panel automatically
73
- * handles overflow and maintains content accessibility during resize operations.
102
+ * ResizablePanel represents a single resizable section within a ResizablePanelGroup.
103
+ * Supports flexible sizing constraints, collapse/expand behavior, and programmatic control
104
+ * through imperative API. Each panel automatically handles content overflow and maintains
105
+ * accessibility during resize operations with proper focus and scroll management.
74
106
  *
75
107
  * @example
76
108
  * ```tsx
@@ -82,43 +114,91 @@ declare function ResizablePanelGroup({ className, ...props }: React.ComponentPro
82
114
  *
83
115
  * @example
84
116
  * ```tsx
85
- * // Panel with size constraints
117
+ * // Panel with size constraints and callbacks
86
118
  * <ResizablePanel
119
+ * id="sidebar"
87
120
  * defaultSize={30}
88
121
  * minSize={20}
89
122
  * maxSize={60}
90
123
  * collapsible
124
+ * onCollapse={() => console.log('Sidebar collapsed')}
125
+ * onExpand={() => console.log('Sidebar expanded')}
126
+ * onResize={(size, prevSize) => console.log(`Resized from ${prevSize}% to ${size}%`)}
91
127
  * >
92
- * <aside>Collapsible sidebar</aside>
128
+ * <aside className="p-4">Collapsible sidebar content</aside>
93
129
  * </ResizablePanel>
94
130
  * ```
95
131
  *
96
- * @param defaultSize - Initial size as percentage (0-100)
97
- * @param minSize - Minimum size as percentage
98
- * @param maxSize - Maximum size as percentage
99
- * @param collapsible - Whether panel can be collapsed to zero size
100
- * @param order - Display order within the group
101
- * @param id - Unique identifier for programmatic control
102
- * @param onCollapse - Callback when panel is collapsed
103
- * @param onExpand - Callback when panel is expanded
104
- * @param onResize - Callback when panel size changes
132
+ * @example
133
+ * ```tsx
134
+ * // Panel with conditional rendering support
135
+ * <ResizablePanel
136
+ * id="dynamic-panel"
137
+ * order={1}
138
+ * defaultSize={40}
139
+ * collapsible
140
+ * collapsedSize={5}
141
+ * >
142
+ * {isExpanded ? <FullContent /> : <CollapsedView />}
143
+ * </ResizablePanel>
144
+ * ```
145
+ *
146
+ * @example
147
+ * ```tsx
148
+ * // Panel with imperative control via ref
149
+ * function PanelWithControl() {
150
+ * const panelRef = useRef<ImperativePanelHandle>(null);
151
+ *
152
+ * return (
153
+ * <>
154
+ * <button onClick={() => panelRef.current?.collapse()}>
155
+ * Collapse Panel
156
+ * </button>
157
+ * <ResizablePanel ref={panelRef} defaultSize={50} collapsible>
158
+ * <div>Controlled panel content</div>
159
+ * </ResizablePanel>
160
+ * </>
161
+ * );
162
+ * }
163
+ * ```
164
+ *
165
+ * @param id - Unique identifier for programmatic control and conditional rendering
166
+ * @param order - Display order within group, important when panels are conditionally rendered
167
+ * @param defaultSize - Initial size as percentage (0-100) when panel first mounts
168
+ * @param minSize - Minimum size constraint as percentage (0-100)
169
+ * @param maxSize - Maximum size constraint as percentage (0-100)
170
+ * @param collapsible - Whether panel can collapse beyond minSize to collapsedSize
171
+ * @param collapsedSize - Size when fully collapsed, must be between 0 and minSize
172
+ * @param onCollapse - Callback fired when panel collapses to minimum size
173
+ * @param onExpand - Callback fired when panel expands from collapsed state
174
+ * @param onResize - Callback fired during resize with current and previous sizes
175
+ * @param className - Additional CSS classes for custom styling
176
+ * @param children - Panel content elements
105
177
  *
106
178
  * @accessibility
107
- * - Maintains focus within panel during resize
108
- * - Preserves scroll position when possible
109
- * - Announces size changes to screen readers when significant
179
+ * - Preserves focus within panel content during resize operations
180
+ * - Maintains scroll position when panel dimensions change
181
+ * - Announces significant size changes to screen readers
182
+ * - Supports keyboard navigation when combined with ResizableHandle
183
+ * - Respects reduced motion preferences for smooth resize animations
184
+ *
185
+ * @see {@link https://react-resizable-panels.vercel.app/} API documentation and examples
186
+ * @see {@link ResizablePanelGroup} Container component for panel organization
187
+ * @see {@link ResizableHandle} Interactive handles for resizing panels
188
+ * @since 1.0.0
110
189
  */
111
190
  declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
112
191
  /**
113
- * Draggable handle for resizing panels with optional visual indicator
192
+ * Interactive handle for resizing panels with full keyboard and pointer support
114
193
  *
115
- * ResizableHandle provides the interactive area between panels that allows users to
116
- * resize them via mouse, touch, or keyboard. The handle can display an optional
117
- * visual grip indicator for improved usability and accessibility.
194
+ * ResizableHandle provides the draggable area between panels that allows users to
195
+ * resize them via mouse, touch, or keyboard interaction. Supports optional visual
196
+ * grip indicators, custom hit areas, and comprehensive event callbacks for advanced
197
+ * interaction patterns. Automatically adapts styling based on panel group direction.
118
198
  *
119
199
  * @example
120
200
  * ```tsx
121
- * // Basic invisible handle
201
+ * // Basic invisible handle (common for clean designs)
122
202
  * <ResizableHandle />
123
203
  * ```
124
204
  *
@@ -130,35 +210,71 @@ declare function ResizablePanel({ ...props }: React.ComponentProps<typeof Resiza
130
210
  *
131
211
  * @example
132
212
  * ```tsx
133
- * // Custom styled handle
213
+ * // Custom styled handle with interaction callbacks
134
214
  * <ResizableHandle
135
215
  * withHandle
136
- * className="bg-blue-200 hover:bg-blue-300"
216
+ * className="bg-blue-200 hover:bg-blue-300 transition-colors"
217
+ * onDragging={(isDragging) => {
218
+ * console.log(isDragging ? 'Started dragging' : 'Stopped dragging');
219
+ * }}
220
+ * hitAreaMargins={{ coarse: 20, fine: 10 }}
221
+ * />
222
+ * ```
223
+ *
224
+ * @example
225
+ * ```tsx
226
+ * // Disabled handle for non-interactive layouts
227
+ * <ResizableHandle
228
+ * disabled
229
+ * className="opacity-50 cursor-not-allowed"
137
230
  * />
138
231
  * ```
139
232
  *
140
- * @param withHandle - Whether to display visual grip indicator
141
- * @param className - Additional CSS classes for styling
142
- * @param disabled - Whether the handle is disabled
143
- * @param hitAreaMargins - Margins around the hit area for easier interaction
144
- * @param onDragging - Callback during drag operations
233
+ * @example
234
+ * ```tsx
235
+ * // Custom handle with event handling
236
+ * <ResizableHandle
237
+ * id="main-handle"
238
+ * onFocus={() => console.log('Handle focused')}
239
+ * onBlur={() => console.log('Handle blurred')}
240
+ * onClick={() => console.log('Handle clicked')}
241
+ * tabIndex={0}
242
+ * >
243
+ * <CustomGripIcon />
244
+ * </ResizableHandle>
245
+ * ```
246
+ *
247
+ * @param withHandle - Whether to display built-in visual grip indicator
248
+ * @param id - Unique identifier for the resize handle
249
+ * @param disabled - Whether handle is disabled and non-interactive
250
+ * @param hitAreaMargins - Custom hit area margins for easier grabbing (coarse: touch devices, fine: mouse)
251
+ * @param onDragging - Callback fired when drag state changes with boolean indicating if currently dragging
252
+ * @param onFocus - Callback fired when handle receives keyboard focus
253
+ * @param onBlur - Callback fired when handle loses keyboard focus
254
+ * @param onClick - Callback fired when handle is clicked
255
+ * @param onPointerDown - Callback fired when pointer/touch starts on handle
256
+ * @param onPointerUp - Callback fired when pointer/touch ends on handle
257
+ * @param tabIndex - Tab order for keyboard navigation (0 makes it focusable)
258
+ * @param className - Additional CSS classes for custom styling
259
+ * @param children - Custom handle content (overrides withHandle prop)
145
260
  *
146
261
  * @accessibility
147
- * - Keyboard resizable using arrow keys when focused
262
+ * - Full keyboard support: Arrow keys resize panels when handle is focused
148
263
  * - Proper ARIA roles and labels for screen readers
149
- * - Focus indicators that meet WCAG contrast requirements
150
- * - Touch-friendly hit area of at least 44x44px
151
- * - Announces resize actions and current sizes to assistive technology
264
+ * - High contrast focus indicators that meet WCAG AAA requirements
265
+ * - Touch-friendly hit area with minimum 44x44px interactive zone
266
+ * - Announces resize actions and panel sizes to assistive technology
267
+ * - Supports reduced motion preferences for drag animations
268
+ * - Maintains logical tab order within panel layouts
152
269
  *
153
- * @see {@link https://ui.shadcn.com/docs/components/resizable} for usage examples
270
+ * @see {@link https://react-resizable-panels.vercel.app/} Interactive demos and API reference
271
+ * @see {@link https://ui.shadcn.com/docs/components/resizable} Design patterns and styling examples
272
+ * @see {@link ResizablePanelGroup} Container component for handle placement
273
+ * @see {@link ResizablePanel} Panels that handles resize between
154
274
  * @since 1.0.0
155
275
  */
156
- declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
157
- /**
158
- * Whether to show a visual grip handle
159
- * @default false
160
- */
276
+ declare function ResizableHandle({ withHandle, className, ...props }: {
161
277
  withHandle?: boolean;
162
- }): import("react/jsx-runtime").JSX.Element;
278
+ } & React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle>): import("react/jsx-runtime").JSX.Element;
163
279
  export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
164
280
  //# sourceMappingURL=resizable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../src/components/ui/resizable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAI7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,2CAW5D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,iBAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,2CAEvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,iBAAS,eAAe,CAAC,EACvB,UA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AE,cAAc,EAAE,eAAe,EAAE,CAAC"}
@@ -1,12 +1,16 @@
1
1
  import * as React from "react";
2
2
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
3
  /**
4
- * ScrollArea component provides cross-browser custom scrollbar styling
4
+ * ScrollArea - Custom scrollable area with cross-browser styling
5
5
  *
6
6
  * Augments native scroll functionality for custom, cross-browser styling with enhanced
7
7
  * scrolling experience. Built on Radix UI's ScrollArea primitive for accessibility
8
8
  * and keyboard navigation support. Provides consistent scrollbar appearance across
9
- * different browsers while maintaining native scroll behavior.
9
+ * different browsers while maintaining native scroll behavior and performance.
10
+ *
11
+ * The component automatically handles vertical scrolling and can be extended with
12
+ * horizontal scrolling using the ScrollBar component. Supports programmatic control
13
+ * via refs and maintains all native scrolling behaviors including touch gestures.
10
14
  *
11
15
  * @example
12
16
  * ```tsx
@@ -39,44 +43,199 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
39
43
  *
40
44
  * @example
41
45
  * ```tsx
42
- * // Both scrollbars for large content
43
- * <ScrollArea className="h-96 w-80 rounded-md border">
46
+ * // Both scrollbars for large content with always-visible scrollbars
47
+ * <ScrollArea className="h-96 w-80 rounded-md border" type="always">
44
48
  * <div className="w-[600px] p-4">
45
- * // Wide content with vertical overflow
49
+ * <div className="space-y-4">
50
+ * {largeDataSet.map((item) => (
51
+ * <div key={item.id} className="min-w-max">
52
+ * {item.wideContent}
53
+ * </div>
54
+ * ))}
55
+ * </div>
46
56
  * </div>
47
57
  * <ScrollBar orientation="horizontal" />
48
58
  * </ScrollArea>
49
59
  * ```
50
60
  *
51
- * @param className - Additional CSS classes for styling
52
- * @param children - Content to be rendered inside the scrollable area
61
+ * @example
62
+ * ```tsx
63
+ * // Programmatic scrolling with ref
64
+ * function ProgrammaticScroll() {
65
+ * const viewportRef = useRef<HTMLDivElement>(null);
66
+ *
67
+ * const scrollToTop = () => {
68
+ * viewportRef.current?.scrollTo({ top: 0, behavior: 'smooth' });
69
+ * };
70
+ *
71
+ * return (
72
+ * <ScrollArea className="h-72 w-96">
73
+ * <ScrollAreaViewport ref={viewportRef}>
74
+ * <div className="p-4">
75
+ * // Long content here
76
+ * <button onClick={scrollToTop}>Scroll to top</button>
77
+ * </div>
78
+ * </ScrollAreaViewport>
79
+ * </ScrollArea>
80
+ * );
81
+ * }
82
+ * ```
83
+ *
84
+ * @accessibility
85
+ * - Maintains native keyboard scrolling (Arrow keys, Page Up/Down, Home/End)
86
+ * - Preserves focus management and tab order within scrollable content
87
+ * - Screen readers can navigate content naturally using standard commands
88
+ * - Supports touch gestures and momentum scrolling on mobile devices
89
+ * - Scrollbars automatically receive appropriate ARIA attributes
90
+ * - Respects user preferences for reduced motion
53
91
  *
54
- * @see {@link https://ui.shadcn.com/docs/components/scroll-area} - shadcn/ui ScrollArea documentation
92
+ * @see {@link ScrollBar} Companion scrollbar component for explicit horizontal scrolling
93
+ * @see {@link https://www.radix-ui.com/primitives/docs/components/scroll-area} Radix UI ScrollArea Primitive
94
+ * @see {@link https://ui.shadcn.com/docs/components/scroll-area} shadcn/ui ScrollArea Documentation
55
95
  * @since 1.0.0
56
- * @see {@link ScrollBar} - Companion scrollbar component for horizontal scrolling
57
96
  */
58
- declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
97
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
59
98
  /**
60
- * ScrollBar component for custom scrollbar styling
99
+ * ScrollBar - Custom styled scrollbar for ScrollArea
61
100
  *
62
101
  * Companion component to ScrollArea that renders styled scrollbars with
63
- * support for both vertical and horizontal orientations. Usually used
64
- * when explicit horizontal scrolling is needed.
102
+ * support for both vertical and horizontal orientations. The vertical
103
+ * scrollbar is automatically included in ScrollArea, but horizontal
104
+ * scrollbars must be explicitly added when needed.
65
105
  *
66
- * @param className - Additional CSS classes for scrollbar styling
67
- * @param orientation - Scrollbar orientation, defaults to "vertical"
106
+ * The scrollbar automatically shows/hides based on content overflow and
107
+ * user interaction. Supports touch interactions and provides visual
108
+ * feedback during scroll operations.
68
109
  *
69
110
  * @example
70
111
  * ```tsx
71
- * // Horizontal scrollbar (vertical is automatic)
72
- * <ScrollArea className="w-full">
73
- * <div className="flex gap-4 p-4">
74
- * // Wide content
112
+ * // Explicit horizontal scrollbar for wide content
113
+ * <ScrollArea className="w-full max-w-md">
114
+ * <div className="flex gap-4 p-4 min-w-max">
115
+ * {items.map((item) => (
116
+ * <div key={item.id} className="w-48 flex-none">
117
+ * {item.content}
118
+ * </div>
119
+ * ))}
120
+ * </div>
121
+ * <ScrollBar orientation="horizontal" />
122
+ * </ScrollArea>
123
+ * ```
124
+ *
125
+ * @example
126
+ * ```tsx
127
+ * // Both scrollbars with custom styling
128
+ * <ScrollArea className="h-64 w-64 border">
129
+ * <div className="w-96 h-96 p-4">
130
+ * Large content that overflows both axes
131
+ * </div>
132
+ * <ScrollBar orientation="vertical" className="bg-slate-100" />
133
+ * <ScrollBar orientation="horizontal" className="bg-slate-100" />
134
+ * </ScrollArea>
135
+ * ```
136
+ *
137
+ * @example
138
+ * ```tsx
139
+ * // Force-mounted scrollbar that always shows
140
+ * <ScrollArea className="h-48 w-full">
141
+ * <div className="p-4">
142
+ * Content that may or may not overflow
143
+ * </div>
144
+ * <ScrollBar orientation="horizontal" forceMount />
145
+ * </ScrollArea>
146
+ * ```
147
+ *
148
+ * @accessibility
149
+ * - Scrollbar thumb responds to keyboard interactions when focused
150
+ * - Supports drag operations for precise scrolling control
151
+ * - Automatically receives appropriate ARIA attributes for orientation
152
+ * - Visual feedback during hover and active states
153
+ * - Respects user preferences for scrollbar width and behavior
154
+ *
155
+ * @see {@link ScrollArea} Main scrollable container component
156
+ * @since 1.0.0
157
+ */
158
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
159
+ /**
160
+ * ScrollAreaViewport - The viewport area of the scroll area
161
+ *
162
+ * Contains the scrollable content and handles the actual scrolling behavior.
163
+ * This is the element that receives focus and handles keyboard navigation.
164
+ * Use refs on this component for programmatic scrolling control.
165
+ *
166
+ * @example
167
+ * ```tsx
168
+ * // Accessing viewport for programmatic scrolling
169
+ * const ScrollWithButton = () => {
170
+ * const viewportRef = useRef<HTMLDivElement>(null);
171
+ *
172
+ * const scrollToBottom = () => {
173
+ * const viewport = viewportRef.current;
174
+ * if (viewport) {
175
+ * viewport.scrollTop = viewport.scrollHeight;
176
+ * }
177
+ * };
178
+ *
179
+ * return (
180
+ * <ScrollArea className="h-64 w-96">
181
+ * <ScrollAreaViewport ref={viewportRef}>
182
+ * <div className="p-4">
183
+ * // Content here
184
+ * <button onClick={scrollToBottom}>Scroll to bottom</button>
185
+ * </div>
186
+ * </ScrollAreaViewport>
187
+ * </ScrollArea>
188
+ * );
189
+ * };
190
+ * ```
191
+ *
192
+ * @see {@link ScrollArea} Main scrollable container component
193
+ * @since 1.0.0
194
+ */
195
+ declare const ScrollAreaViewport: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
196
+ /**
197
+ * ScrollAreaThumb - The draggable thumb element within the scrollbar
198
+ *
199
+ * Represents the current scroll position and can be dragged to scroll content.
200
+ * Usually styled automatically as part of the ScrollBar component, but can
201
+ * be customized for specific design requirements.
202
+ *
203
+ * @example
204
+ * ```tsx
205
+ * // Custom scrollbar with styled thumb
206
+ * const CustomScrollbar = ({ orientation = "vertical" }) => (
207
+ * <ScrollAreaPrimitive.ScrollAreaScrollbar orientation={orientation}>
208
+ * <ScrollAreaThumb className="bg-blue-500 hover:bg-blue-600 active:bg-blue-700" />
209
+ * </ScrollAreaPrimitive.ScrollAreaScrollbar>
210
+ * );
211
+ * ```
212
+ *
213
+ * @see {@link ScrollBar} Parent scrollbar component
214
+ * @since 1.0.0
215
+ */
216
+ declare const ScrollAreaThumb: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaThumbProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
217
+ /**
218
+ * ScrollAreaCorner - The corner element where horizontal and vertical scrollbars meet
219
+ *
220
+ * Appears when both horizontal and vertical scrollbars are present. Usually
221
+ * handled automatically by the ScrollArea component but can be customized
222
+ * for specific layout requirements.
223
+ *
224
+ * @example
225
+ * ```tsx
226
+ * // Custom corner styling
227
+ * <ScrollArea className="h-64 w-64">
228
+ * <div className="w-96 h-96 p-4">
229
+ * Content that overflows both axes
75
230
  * </div>
76
231
  * <ScrollBar orientation="horizontal" />
232
+ * <ScrollAreaCorner className="bg-gray-100" />
77
233
  * </ScrollArea>
78
234
  * ```
235
+ *
236
+ * @see {@link ScrollArea} Main scrollable container component
237
+ * @since 1.0.0
79
238
  */
80
- declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
81
- export { ScrollArea, ScrollBar };
239
+ declare const ScrollAreaCorner: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaCornerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
240
+ export { ScrollArea, ScrollBar, ScrollAreaViewport, ScrollAreaThumb, ScrollAreaCorner, };
82
241
  //# sourceMappingURL=scroll-area.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAInE;;;;;;;;;;;;;;;;;;;;;;;;;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