@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
@@ -8,82 +8,185 @@ import { Calendar } from "./calendar";
8
8
  import { Popover, PopoverContent, PopoverTrigger } from "./popover";
9
9
 
10
10
  /**
11
- * Properties for the DatePicker component
11
+ * Props for DatePicker component (Documentation only - NOT used in component implementation)
12
12
  *
13
- * @type DatePickerProps
14
- * @since 1.0.0
13
+ * These types are for documentation generation and should not replace Calendar/Popover inferred types.
14
+ * Combines date selection functionality with popover positioning and calendar configuration.
15
+ * All props support both controlled and uncontrolled usage patterns for flexible integration
16
+ * with forms, state management, and validation systems.
17
+ *
18
+ * Extends the base date picker functionality with comprehensive prop documentation.
19
+ * This component is built on Radix UI Popover and Calendar primitives, inheriting
20
+ * their accessibility features while providing a simplified, opinionated interface
21
+ * for common date selection use cases.
22
+ *
23
+ * **Inherited Behavior:**
24
+ * - Popover positioning and collision detection from Radix UI Popover
25
+ * - Calendar navigation and accessibility from shadcn/ui Calendar
26
+ * - Button styling and interaction states from shadcn/ui Button
27
+ * - Portal rendering for proper z-index layering
28
+ * - Keyboard navigation and ARIA support
29
+ * - Automatic focus management and restoration
30
+ *
31
+ * **Key Features:**
32
+ * - Controlled and uncontrolled usage patterns
33
+ * - Automatic date formatting with internationalization
34
+ * - Form library integration support
35
+ * - Responsive design with customizable width
36
+ * - Touch-friendly mobile interface
37
+ * - High contrast accessibility compliance
15
38
  */
16
- type DatePickerProps = {
39
+ // eslint-disable-next-line unused-imports/no-unused-vars
40
+ type DatePickerDocsProps = {
17
41
  /**
18
- * The currently selected date value. When undefined, no date is selected.
42
+ * The currently selected date value
43
+ *
44
+ * Controls the date selection state. When undefined, no date is selected and
45
+ * the placeholder text is displayed. Pass a Date object to show a selected date.
46
+ * For controlled usage, combine with onDateChange callback.
19
47
  *
20
48
  * @example
21
49
  * ```tsx
50
+ * // Controlled usage
22
51
  * const [selectedDate, setSelectedDate] = useState<Date>();
23
52
  * <DatePicker date={selectedDate} onDateChange={setSelectedDate} />
53
+ *
54
+ * // Uncontrolled with default
55
+ * <DatePicker date={new Date()} /> // Shows today
56
+ *
57
+ * // No selection
58
+ * <DatePicker /> // Shows placeholder
24
59
  * ```
25
60
  */
26
61
  date?: Date;
27
62
 
28
63
  /**
29
- * Callback function invoked when the user selects or clears a date.
30
- * Receives the selected date or undefined when cleared.
64
+ * Event handler called when the date selection changes
65
+ *
66
+ * Invoked whenever the user selects a new date from the calendar or clears
67
+ * the current selection. Receives the new date or undefined if cleared.
68
+ * Essential for controlled usage and form integration.
31
69
  *
32
- * @param date - The newly selected date or undefined if cleared
70
+ * @param date - The newly selected date, or undefined if selection was cleared
33
71
  *
34
72
  * @example
35
73
  * ```tsx
36
- * <DatePicker onDateChange={(date) => console.log('Selected:', date)} />
74
+ * // Basic usage with state
75
+ * <DatePicker onDateChange={(date) => {
76
+ * console.log('Selected:', date);
77
+ * setFormData(prev => ({ ...prev, selectedDate: date }));
78
+ * }} />
79
+ *
80
+ * // Form integration
81
+ * <DatePicker onDateChange={(date) => {
82
+ * setValue('birthDate', date); // React Hook Form
83
+ * validateField('birthDate'); // Validation
84
+ * }} />
85
+ *
86
+ * // Analytics tracking
87
+ * <DatePicker onDateChange={(date) => {
88
+ * if (date) {
89
+ * analytics.track('date_selected', { date: date.toISOString() });
90
+ * }
91
+ * }} />
37
92
  * ```
38
93
  */
39
94
  onDateChange?: (date: Date | undefined) => void;
40
95
 
41
96
  /**
42
- * Placeholder text displayed in the trigger button when no date is selected.
43
- * Provides context about what kind of date selection is expected.
97
+ * Placeholder text displayed when no date is selected
98
+ *
99
+ * Shows in the trigger button as a prompt to guide users about the expected
100
+ * date selection. Should be descriptive and context-appropriate to help users
101
+ * understand what kind of date they should choose.
44
102
  *
45
103
  * @default "Pick a date"
46
104
  *
47
105
  * @example
48
106
  * ```tsx
107
+ * // Contextual placeholders
49
108
  * <DatePicker placeholder="Select your birthday" />
109
+ * <DatePicker placeholder="Choose departure date" />
110
+ * <DatePicker placeholder="Pick appointment time" />
111
+ * <DatePicker placeholder="Select due date" />
112
+ *
113
+ * // With internationalization
114
+ * <DatePicker placeholder={t('datePicker.placeholder')} />
50
115
  * ```
51
116
  */
52
117
  placeholder?: string;
53
118
 
54
119
  /**
55
- * When true, disables the date picker preventing user interaction.
56
- * The trigger button will appear disabled and the popover cannot be opened.
120
+ * Disables the entire date picker component
121
+ *
122
+ * When true, prevents all user interaction including clicking the trigger button,
123
+ * opening the calendar popover, and keyboard navigation. The component will appear
124
+ * visually disabled with reduced opacity and appropriate cursor states.
57
125
  *
58
126
  * @default false
59
127
  *
60
128
  * @example
61
129
  * ```tsx
62
- * <DatePicker disabled={true} placeholder="Date locked" />
130
+ * // Form field disabling
131
+ * <DatePicker disabled={isSubmitting} placeholder="Loading..." />
132
+ *
133
+ * // Conditional disabling based on permissions
134
+ * <DatePicker disabled={!canEditDates} placeholder="Date locked" />
135
+ *
136
+ * // Loading state
137
+ * <DatePicker disabled={isLoadingData} placeholder="Loading available dates..." />
138
+ *
139
+ * // Past date selection disabled
140
+ * <DatePicker
141
+ * disabled={selectedDate && selectedDate < new Date()}
142
+ * placeholder="Future dates only"
143
+ * />
63
144
  * ```
64
145
  */
65
146
  disabled?: boolean;
66
147
 
67
148
  /**
68
- * Additional CSS classes to apply to the trigger button.
69
- * Useful for customizing width, spacing, or other styling.
149
+ * Additional CSS classes for the trigger button
150
+ *
151
+ * Applies custom styling to the date picker's trigger button. Commonly used
152
+ * for width adjustments, spacing, alignment, or integration with form layouts.
153
+ * Classes are merged with the default button styling.
70
154
  *
71
155
  * @example
72
156
  * ```tsx
157
+ * // Width customization
73
158
  * <DatePicker className="w-full" /> // Full width
74
159
  * <DatePicker className="w-[300px]" /> // Fixed width
160
+ * <DatePicker className="min-w-[200px]" /> // Minimum width
161
+ *
162
+ * // Form integration
163
+ * <DatePicker className="flex-1" /> // Flexible within flex container
164
+ * <DatePicker className="col-span-2" /> // Grid column spanning
165
+ *
166
+ * // Spacing and alignment
167
+ * <DatePicker className="ml-auto" /> // Right-aligned
168
+ * <DatePicker className="mx-auto" /> // Center-aligned
169
+ * <DatePicker className="mb-4" /> // Bottom margin
170
+ *
171
+ * // Custom styling
172
+ * <DatePicker className="border-2 border-blue-500 focus:border-blue-600" />
75
173
  * ```
76
174
  */
77
175
  className?: string;
78
176
  };
79
177
 
80
178
  /**
81
- * A comprehensive date selection component that combines an accessible button trigger
82
- * with a full-featured calendar popover for intuitive date picking.
179
+ * DatePicker - A comprehensive date selection component with popover calendar interface
83
180
  *
84
- * Built on shadcn/ui design principles, this component provides a polished interface
85
- * for date selection with proper accessibility, keyboard navigation, and visual feedback.
86
- * The selected date is displayed using date-fns formatting for consistent presentation.
181
+ * A polished date selection component that combines an accessible trigger button with a
182
+ * full-featured calendar popover. Built on Radix UI Popover and Calendar primitives with
183
+ * shadcn/ui styling, providing intuitive date selection with proper accessibility,
184
+ * keyboard navigation, automatic positioning, and internationalization support.
185
+ *
186
+ * The component handles both controlled and uncontrolled usage patterns, integrates
187
+ * seamlessly with forms and validation systems, and provides consistent date formatting
188
+ * using date-fns. The popover automatically positions itself to stay within viewport
189
+ * bounds and includes smooth animations for a polished user experience.
87
190
  *
88
191
  * @component
89
192
  * @example
@@ -133,24 +236,105 @@ type DatePickerProps = {
133
236
  * ```
134
237
  *
135
238
  * @accessibility
136
- * - **Keyboard Navigation**: Full keyboard support with Tab, Enter, Escape, and arrow keys
137
- * - **Screen Reader Support**: Proper ARIA labels and live announcements for date changes
138
- * - **Focus Management**: Focus returns to trigger button when popover closes
139
- * - **Visual Indicators**: Clear visual states for disabled, selected, and focused elements
140
- * - **Date Formatting**: Consistent date presentation using localized formatting
239
+ * - **Keyboard Navigation**:
240
+ * - Tab to focus the trigger button
241
+ * - Enter/Space to open calendar popover
242
+ * - Arrow keys for date navigation within calendar
243
+ * - Escape to close popover and return focus to trigger
244
+ * - Page Up/Down for month navigation
245
+ * - Home/End for week start/end navigation
246
+ * - **Screen Reader Support**:
247
+ * - Proper ARIA labels describing the date picker purpose
248
+ * - Live region announcements for date selection changes
249
+ * - Calendar grid structure announced correctly
250
+ * - Selected date clearly announced with full formatting
251
+ * - **Focus Management**:
252
+ * - Visible focus indicators with 3px ring on trigger button
253
+ * - Focus trapped within calendar when popover is open
254
+ * - Focus returns to trigger button when popover closes
255
+ * - Initial focus on today's date or selected date when opening
256
+ * - **Visual Indicators**:
257
+ * - Clear visual states for disabled, selected, and focused elements
258
+ * - High contrast borders and backgrounds meeting WCAG 2.1 AA standards
259
+ * - Consistent color coding for different date states
260
+ * - Reduced opacity for disabled state with appropriate cursor
261
+ * - **Date Formatting**:
262
+ * - Consistent date presentation using date-fns localized formatting
263
+ * - Full date format (e.g., "Wednesday, January 15, 2025") for clarity
264
+ * - Placeholder text provides clear guidance about expected input
141
265
  *
142
266
  * @features
143
- * - Single date selection with visual confirmation
144
- * - Popover-based calendar that doesn't interfere with page layout
145
- * - Automatic popover positioning and collision detection
146
- * - Internal state management with optional external control
147
- * - Customizable trigger button styling and width
148
- * - Date formatting using date-fns for internationalization support
149
- *
150
- * @see {@link https://ui.shadcn.com/docs/components/date-picker} shadcn/ui Date Picker patterns
151
- * @see {@link Calendar} - The underlying calendar component
152
- * @see {@link Popover} - The popover container component
153
- * @see {@link Button} - The trigger button component
267
+ * - **Date Selection**: Single date selection with immediate visual confirmation
268
+ * - **Popover Interface**: Non-modal calendar popover that doesn't disrupt page layout
269
+ * - **Smart Positioning**: Automatic positioning with collision detection and boundary awareness
270
+ * - **State Management**: Flexible controlled/uncontrolled patterns with internal state fallback
271
+ * - **Customizable Styling**: Full control over trigger button appearance, width, and spacing
272
+ * - **Internationalization**: Date formatting with date-fns supporting multiple locales
273
+ * - **Form Integration**: Seamless integration with form libraries and validation systems
274
+ * - **Performance**: Optimized rendering with minimal re-renders and efficient state updates
275
+ * - **Animation**: Smooth open/close animations with proper state transitions
276
+ * - **Mobile Support**: Touch-friendly interface with appropriate sizing and spacing
277
+ *
278
+ * @implementation
279
+ * The DatePicker component is implemented as a composition of:
280
+ * - **Popover**: Radix UI primitive providing positioning, portal rendering, and focus management
281
+ * - **PopoverTrigger**: Button element that opens the calendar (uses asChild pattern)
282
+ * - **PopoverContent**: Container for the calendar with auto-positioning
283
+ * - **Calendar**: Full-featured calendar component with keyboard navigation
284
+ * - **Button**: Styled trigger with outline variant and calendar icon
285
+ *
286
+ * State is managed internally with React.useState hooks and synchronized with external
287
+ * props through React.useEffect. The component automatically handles date formatting
288
+ * using date-fns format function with "PPP" pattern for readable date display.
289
+ *
290
+ * @usage-patterns
291
+ * **Controlled Pattern** (Recommended):
292
+ * ```tsx
293
+ * const [date, setDate] = useState<Date>();
294
+ * <DatePicker date={date} onDateChange={setDate} />
295
+ * ```
296
+ *
297
+ * **Form Library Integration**:
298
+ * ```tsx
299
+ * // React Hook Form
300
+ * <Controller render={({ field }) =>
301
+ * <DatePicker date={field.value} onDateChange={field.onChange} />
302
+ * } />
303
+ *
304
+ * // Formik
305
+ * <Field name="date">
306
+ * {({ field, form }) => (
307
+ * <DatePicker
308
+ * date={field.value}
309
+ * onDateChange={(date) => form.setFieldValue('date', date)}
310
+ * />
311
+ * )}
312
+ * </Field>
313
+ * ```
314
+ *
315
+ * **Validation Integration**:
316
+ * ```tsx
317
+ * const handleDateChange = (date: Date | undefined) => {
318
+ * // Validate date before setting
319
+ * if (date && isValidDate(date)) {
320
+ * setDate(date);
321
+ * clearError();
322
+ * } else {
323
+ * setError('Please select a valid date');
324
+ * }
325
+ * };
326
+ * ```
327
+ *
328
+ * @see {@link Calendar} The underlying calendar component with full date navigation
329
+ * @see {@link Popover} The popover container component for positioning and portal rendering
330
+ * @see {@link PopoverTrigger} Trigger element that opens the calendar popover
331
+ * @see {@link PopoverContent} Content container for the calendar with auto-positioning
332
+ * @see {@link Button} The styled trigger button with variant support
333
+ * @see {@link https://ui.shadcn.com/docs/components/date-picker} shadcn/ui Date Picker documentation
334
+ * @see {@link https://ui.shadcn.com/docs/components/calendar} shadcn/ui Calendar component
335
+ * @see {@link https://ui.shadcn.com/docs/components/popover} shadcn/ui Popover component
336
+ * @see {@link https://date-fns.org/docs/format} date-fns formatting documentation
337
+ * @see {@link https://www.radix-ui.com/primitives/docs/components/popover} Radix UI Popover primitives
154
338
  *
155
339
  * @since 1.0.0
156
340
  */
@@ -160,7 +344,13 @@ function DatePicker({
160
344
  placeholder = "Pick a date",
161
345
  disabled = false,
162
346
  className,
163
- }: DatePickerProps) {
347
+ }: {
348
+ date?: Date;
349
+ onDateChange?: (date: Date | undefined) => void;
350
+ placeholder?: string;
351
+ disabled?: boolean;
352
+ className?: string;
353
+ }) {
164
354
  // Internal state for uncontrolled usage and popover open/close
165
355
  const [internalDate, setInternalDate] = React.useState<Date | undefined>(
166
356
  date,