@neynar/ui 0.1.1 → 0.1.3
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/llm-docs/a.llm.md +145 -0
- package/llm-docs/accordion-content.llm.md +67 -0
- package/llm-docs/accordion-item.llm.md +61 -0
- package/llm-docs/accordion-trigger.llm.md +69 -0
- package/llm-docs/accordion.llm.md +88 -0
- package/llm-docs/alert-description.llm.md +78 -0
- package/llm-docs/alert-dialog-action.llm.md +51 -0
- package/llm-docs/alert-dialog-cancel.llm.md +48 -0
- package/llm-docs/alert-dialog-content.llm.md +88 -0
- package/llm-docs/alert-dialog-description.llm.md +53 -0
- package/llm-docs/alert-dialog-footer.llm.md +41 -0
- package/llm-docs/alert-dialog-header.llm.md +39 -0
- package/llm-docs/alert-dialog-overlay.llm.md +44 -0
- package/llm-docs/alert-dialog-portal.llm.md +41 -0
- package/llm-docs/alert-dialog-title.llm.md +46 -0
- package/llm-docs/alert-dialog-trigger.llm.md +40 -0
- package/llm-docs/alert-dialog.llm.md +80 -0
- package/llm-docs/alert-title.llm.md +48 -0
- package/llm-docs/alert.llm.md +92 -0
- package/llm-docs/aspect-ratio.llm.md +41 -0
- package/llm-docs/avatar-fallback.llm.md +41 -0
- package/llm-docs/avatar-image.llm.md +48 -0
- package/llm-docs/avatar.llm.md +35 -0
- package/llm-docs/badge.llm.md +108 -0
- package/llm-docs/blockquote.llm.md +122 -0
- package/llm-docs/breadcrumb-ellipsis.llm.md +73 -0
- package/llm-docs/breadcrumb-item.llm.md +53 -0
- package/llm-docs/breadcrumb-link.llm.md +84 -0
- package/llm-docs/breadcrumb-list.llm.md +54 -0
- package/llm-docs/breadcrumb-page.llm.md +52 -0
- package/llm-docs/breadcrumb-separator.llm.md +60 -0
- package/llm-docs/breadcrumb.llm.md +110 -0
- package/llm-docs/button.llm.md +281 -0
- package/llm-docs/calendar-day-button.llm.md +57 -0
- package/llm-docs/calendar.llm.md +340 -0
- package/llm-docs/card-action.llm.md +64 -0
- package/llm-docs/card-content.llm.md +48 -0
- package/llm-docs/card-description.llm.md +46 -0
- package/llm-docs/card-footer.llm.md +56 -0
- package/llm-docs/card-header.llm.md +53 -0
- package/llm-docs/card-title.llm.md +43 -0
- package/llm-docs/card.llm.md +100 -0
- package/llm-docs/carousel-content.llm.md +77 -0
- package/llm-docs/carousel-item.llm.md +96 -0
- package/llm-docs/carousel-next.llm.md +95 -0
- package/llm-docs/carousel-previous.llm.md +95 -0
- package/llm-docs/carousel.llm.md +211 -0
- package/llm-docs/chart-config.llm.md +71 -0
- package/llm-docs/chart-container.llm.md +148 -0
- package/llm-docs/chart-legend-content.llm.md +85 -0
- package/llm-docs/chart-legend.llm.md +144 -0
- package/llm-docs/chart-style.llm.md +28 -0
- package/llm-docs/chart-tooltip-content.llm.md +149 -0
- package/llm-docs/chart-tooltip.llm.md +184 -0
- package/llm-docs/checkbox.llm.md +100 -0
- package/llm-docs/cn.llm.md +46 -0
- package/llm-docs/code.llm.md +108 -0
- package/llm-docs/collapsible-content.llm.md +109 -0
- package/llm-docs/collapsible-trigger.llm.md +75 -0
- package/llm-docs/collapsible.llm.md +109 -0
- package/llm-docs/combobox-option.llm.md +53 -0
- package/llm-docs/combobox.llm.md +208 -0
- package/llm-docs/command-dialog.llm.md +112 -0
- package/llm-docs/command-empty.llm.md +63 -0
- package/llm-docs/command-group.llm.md +83 -0
- package/llm-docs/command-input.llm.md +82 -0
- package/llm-docs/command-item.llm.md +97 -0
- package/llm-docs/command-list.llm.md +53 -0
- package/llm-docs/command-loading.llm.md +48 -0
- package/llm-docs/command-separator.llm.md +44 -0
- package/llm-docs/command-shortcut.llm.md +63 -0
- package/llm-docs/command.llm.md +147 -0
- package/llm-docs/container.llm.md +236 -0
- package/llm-docs/context-menu-checkbox-item.llm.md +97 -0
- package/llm-docs/context-menu-content.llm.md +91 -0
- package/llm-docs/context-menu-group.llm.md +61 -0
- package/llm-docs/context-menu-item.llm.md +94 -0
- package/llm-docs/context-menu-label.llm.md +60 -0
- package/llm-docs/context-menu-portal.llm.md +49 -0
- package/llm-docs/context-menu-radio-group.llm.md +66 -0
- package/llm-docs/context-menu-radio-item.llm.md +76 -0
- package/llm-docs/context-menu-separator.llm.md +51 -0
- package/llm-docs/context-menu-shortcut.llm.md +57 -0
- package/llm-docs/context-menu-sub-content.llm.md +90 -0
- package/llm-docs/context-menu-sub-trigger.llm.md +73 -0
- package/llm-docs/context-menu-sub.llm.md +61 -0
- package/llm-docs/context-menu-trigger.llm.md +53 -0
- package/llm-docs/context-menu.llm.md +103 -0
- package/llm-docs/date-picker.llm.md +90 -0
- package/llm-docs/dialog-close.llm.md +61 -0
- package/llm-docs/dialog-content.llm.md +128 -0
- package/llm-docs/dialog-description.llm.md +44 -0
- package/llm-docs/dialog-footer.llm.md +38 -0
- package/llm-docs/dialog-header.llm.md +40 -0
- package/llm-docs/dialog-overlay.llm.md +57 -0
- package/llm-docs/dialog-portal.llm.md +47 -0
- package/llm-docs/dialog-title.llm.md +41 -0
- package/llm-docs/dialog-trigger.llm.md +51 -0
- package/llm-docs/dialog.llm.md +113 -0
- package/llm-docs/drawer-close.llm.md +53 -0
- package/llm-docs/drawer-content.llm.md +58 -0
- package/llm-docs/drawer-description.llm.md +54 -0
- package/llm-docs/drawer-footer.llm.md +67 -0
- package/llm-docs/drawer-header.llm.md +60 -0
- package/llm-docs/drawer-overlay.llm.md +40 -0
- package/llm-docs/drawer-portal.llm.md +42 -0
- package/llm-docs/drawer-title.llm.md +51 -0
- package/llm-docs/drawer-trigger.llm.md +44 -0
- package/llm-docs/drawer.llm.md +194 -0
- package/llm-docs/dropdown-menu-checkbox-item.llm.md +111 -0
- package/llm-docs/dropdown-menu-content.llm.md +109 -0
- package/llm-docs/dropdown-menu-group.llm.md +38 -0
- package/llm-docs/dropdown-menu-item.llm.md +94 -0
- package/llm-docs/dropdown-menu-label.llm.md +66 -0
- package/llm-docs/dropdown-menu-portal.llm.md +32 -0
- package/llm-docs/dropdown-menu-radio-group.llm.md +73 -0
- package/llm-docs/dropdown-menu-radio-item.llm.md +92 -0
- package/llm-docs/dropdown-menu-separator.llm.md +55 -0
- package/llm-docs/dropdown-menu-shortcut.llm.md +74 -0
- package/llm-docs/dropdown-menu-sub-content.llm.md +80 -0
- package/llm-docs/dropdown-menu-sub-trigger.llm.md +84 -0
- package/llm-docs/dropdown-menu-sub.llm.md +74 -0
- package/llm-docs/dropdown-menu-trigger.llm.md +48 -0
- package/llm-docs/dropdown-menu.llm.md +120 -0
- package/llm-docs/empty-state.llm.md +174 -0
- package/llm-docs/h1.llm.md +113 -0
- package/llm-docs/h2.llm.md +113 -0
- package/llm-docs/h3.llm.md +111 -0
- package/llm-docs/h4.llm.md +109 -0
- package/llm-docs/h5.llm.md +110 -0
- package/llm-docs/h6.llm.md +110 -0
- package/llm-docs/hover-card-content.llm.md +167 -0
- package/llm-docs/hover-card-trigger.llm.md +65 -0
- package/llm-docs/hover-card.llm.md +121 -0
- package/llm-docs/input.llm.md +319 -0
- package/llm-docs/label.llm.md +145 -0
- package/llm-docs/lead.llm.md +119 -0
- package/llm-docs/menubar-checkbox-item.llm.md +66 -0
- package/llm-docs/menubar-content.llm.md +128 -0
- package/llm-docs/menubar-group.llm.md +40 -0
- package/llm-docs/menubar-item.llm.md +62 -0
- package/llm-docs/menubar-label.llm.md +40 -0
- package/llm-docs/menubar-menu.llm.md +32 -0
- package/llm-docs/menubar-portal.llm.md +38 -0
- package/llm-docs/menubar-radio-group.llm.md +39 -0
- package/llm-docs/menubar-radio-item.llm.md +59 -0
- package/llm-docs/menubar-separator.llm.md +35 -0
- package/llm-docs/menubar-shortcut.llm.md +37 -0
- package/llm-docs/menubar-sub-content.llm.md +127 -0
- package/llm-docs/menubar-sub-trigger.llm.md +51 -0
- package/llm-docs/menubar-sub.llm.md +53 -0
- package/llm-docs/menubar-trigger.llm.md +37 -0
- package/llm-docs/menubar.llm.md +115 -0
- package/llm-docs/navigation-menu-content.llm.md +116 -0
- package/llm-docs/navigation-menu-indicator.llm.md +68 -0
- package/llm-docs/navigation-menu-item.llm.md +62 -0
- package/llm-docs/navigation-menu-link.llm.md +109 -0
- package/llm-docs/navigation-menu-list.llm.md +52 -0
- package/llm-docs/navigation-menu-trigger-style.llm.md +22 -0
- package/llm-docs/navigation-menu-trigger.llm.md +57 -0
- package/llm-docs/navigation-menu-viewport.llm.md +51 -0
- package/llm-docs/navigation-menu.llm.md +184 -0
- package/llm-docs/p.llm.md +115 -0
- package/llm-docs/pagination-content.llm.md +60 -0
- package/llm-docs/pagination-ellipsis.llm.md +107 -0
- package/llm-docs/pagination-item.llm.md +59 -0
- package/llm-docs/pagination-link.llm.md +150 -0
- package/llm-docs/pagination-next.llm.md +115 -0
- package/llm-docs/pagination-previous.llm.md +115 -0
- package/llm-docs/pagination.llm.md +190 -0
- package/llm-docs/popover-anchor.llm.md +53 -0
- package/llm-docs/popover-content.llm.md +109 -0
- package/llm-docs/popover-trigger.llm.md +54 -0
- package/llm-docs/popover.llm.md +116 -0
- package/llm-docs/progress.llm.md +76 -0
- package/llm-docs/radio-group-indicator.llm.md +28 -0
- package/llm-docs/radio-group-item.llm.md +40 -0
- package/llm-docs/radio-group.llm.md +76 -0
- package/llm-docs/resizable-handle.llm.md +156 -0
- package/llm-docs/resizable-panel-group.llm.md +149 -0
- package/llm-docs/resizable-panel.llm.md +157 -0
- package/llm-docs/scroll-area-corner.llm.md +41 -0
- package/llm-docs/scroll-area-thumb.llm.md +39 -0
- package/llm-docs/scroll-area-viewport.llm.md +60 -0
- package/llm-docs/scroll-area.llm.md +125 -0
- package/llm-docs/scroll-bar.llm.md +78 -0
- package/llm-docs/sdk-items-registry.json +2638 -0
- package/llm-docs/select-content.llm.md +139 -0
- package/llm-docs/select-group.llm.md +60 -0
- package/llm-docs/select-item.llm.md +75 -0
- package/llm-docs/select-label.llm.md +62 -0
- package/llm-docs/select-scroll-down-button.llm.md +45 -0
- package/llm-docs/select-scroll-up-button.llm.md +45 -0
- package/llm-docs/select-separator.llm.md +59 -0
- package/llm-docs/select-trigger.llm.md +66 -0
- package/llm-docs/select-value.llm.md +67 -0
- package/llm-docs/select.llm.md +159 -0
- package/llm-docs/separator.llm.md +129 -0
- package/llm-docs/sheet-close.llm.md +49 -0
- package/llm-docs/sheet-content.llm.md +115 -0
- package/llm-docs/sheet-description.llm.md +62 -0
- package/llm-docs/sheet-footer.llm.md +64 -0
- package/llm-docs/sheet-header.llm.md +52 -0
- package/llm-docs/sheet-title.llm.md +53 -0
- package/llm-docs/sheet-trigger.llm.md +46 -0
- package/llm-docs/sheet.llm.md +126 -0
- package/llm-docs/sidebar-content.llm.md +63 -0
- package/llm-docs/sidebar-footer.llm.md +50 -0
- package/llm-docs/sidebar-group-action.llm.md +60 -0
- package/llm-docs/sidebar-group-content.llm.md +64 -0
- package/llm-docs/sidebar-group-label.llm.md +53 -0
- package/llm-docs/sidebar-group.llm.md +56 -0
- package/llm-docs/sidebar-header.llm.md +67 -0
- package/llm-docs/sidebar-input.llm.md +50 -0
- package/llm-docs/sidebar-inset.llm.md +52 -0
- package/llm-docs/sidebar-menu-action.llm.md +84 -0
- package/llm-docs/sidebar-menu-badge.llm.md +60 -0
- package/llm-docs/sidebar-menu-button.llm.md +103 -0
- package/llm-docs/sidebar-menu-item.llm.md +75 -0
- package/llm-docs/sidebar-menu-skeleton.llm.md +76 -0
- package/llm-docs/sidebar-menu-sub-button.llm.md +85 -0
- package/llm-docs/sidebar-menu-sub-item.llm.md +54 -0
- package/llm-docs/sidebar-menu-sub.llm.md +74 -0
- package/llm-docs/sidebar-menu.llm.md +65 -0
- package/llm-docs/sidebar-provider.llm.md +79 -0
- package/llm-docs/sidebar-rail.llm.md +34 -0
- package/llm-docs/sidebar-separator.llm.md +57 -0
- package/llm-docs/sidebar-trigger.llm.md +49 -0
- package/llm-docs/sidebar.llm.md +129 -0
- package/llm-docs/skeleton.llm.md +134 -0
- package/llm-docs/slider.llm.md +173 -0
- package/llm-docs/small.llm.md +115 -0
- package/llm-docs/span.llm.md +132 -0
- package/llm-docs/stack.llm.md +28 -0
- package/llm-docs/strong.llm.md +115 -0
- package/llm-docs/switch.llm.md +76 -0
- package/llm-docs/table-body.llm.md +36 -0
- package/llm-docs/table-caption.llm.md +48 -0
- package/llm-docs/table-cell.llm.md +53 -0
- package/llm-docs/table-footer.llm.md +41 -0
- package/llm-docs/table-head.llm.md +69 -0
- package/llm-docs/table-header.llm.md +41 -0
- package/llm-docs/table-row.llm.md +42 -0
- package/llm-docs/table.llm.md +123 -0
- package/llm-docs/tabs-content.llm.md +47 -0
- package/llm-docs/tabs-list.llm.md +41 -0
- package/llm-docs/tabs-trigger.llm.md +47 -0
- package/llm-docs/tabs.llm.md +71 -0
- package/llm-docs/text-field.llm.md +327 -0
- package/llm-docs/textarea.llm.md +311 -0
- package/llm-docs/theme-preference.llm.md +25 -0
- package/llm-docs/theme-toggle.llm.md +57 -0
- package/llm-docs/theme.llm.md +14 -0
- package/llm-docs/toast.llm.md +32 -0
- package/llm-docs/toaster.llm.md +193 -0
- package/llm-docs/toggle-group-item.llm.md +59 -0
- package/llm-docs/toggle-group.llm.md +101 -0
- package/llm-docs/toggle.llm.md +40 -0
- package/llm-docs/tooltip-content.llm.md +185 -0
- package/llm-docs/tooltip-provider.llm.md +68 -0
- package/llm-docs/tooltip-trigger.llm.md +70 -0
- package/llm-docs/tooltip.llm.md +129 -0
- package/llm-docs/typography.llm.md +175 -0
- package/llm-docs/use-carousel.llm.md +55 -0
- package/llm-docs/use-command-state.llm.md +32 -0
- package/llm-docs/use-is-mobile.llm.md +73 -0
- package/llm-docs/use-sidebar.llm.md +61 -0
- package/llms.txt +173 -3
- package/package.json +7 -3
- 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,11 +4,671 @@ import {
|
|
|
4
4
|
ChevronLeftIcon,
|
|
5
5
|
ChevronRightIcon,
|
|
6
6
|
} from "lucide-react";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
DayButton,
|
|
9
|
+
DayPicker,
|
|
10
|
+
getDefaultClassNames,
|
|
11
|
+
type DateRange,
|
|
12
|
+
type Matcher,
|
|
13
|
+
} from "react-day-picker";
|
|
14
|
+
import type { Locale } from "date-fns";
|
|
8
15
|
|
|
9
16
|
import { cn } from "@/lib/utils";
|
|
10
17
|
import { Button, buttonVariants } from "@/components/ui/button";
|
|
11
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Props for Calendar component (Documentation only - NOT used in component implementation)
|
|
21
|
+
*
|
|
22
|
+
* These types are for documentation generation and should not replace react-day-picker inferred types.
|
|
23
|
+
* Extends react-day-picker's DayPicker props with additional customization options.
|
|
24
|
+
* Provides comprehensive type safety and documentation for all available props.
|
|
25
|
+
*/
|
|
26
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
27
|
+
type CalendarDocsProps = {
|
|
28
|
+
/**
|
|
29
|
+
* Selection mode that determines how dates can be selected
|
|
30
|
+
*
|
|
31
|
+
* @default "none"
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Single date selection
|
|
35
|
+
* <Calendar mode="single" selected={date} onSelect={setDate} />
|
|
36
|
+
*
|
|
37
|
+
* // Date range selection
|
|
38
|
+
* <Calendar mode="range" selected={range} onSelect={setRange} />
|
|
39
|
+
*
|
|
40
|
+
* // Multiple dates selection
|
|
41
|
+
* <Calendar mode="multiple" selected={dates} onSelect={setDates} />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
mode?: "single" | "multiple" | "range" | "none";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The selected date(s) - type varies based on selection mode
|
|
48
|
+
*
|
|
49
|
+
* - Single mode: `Date | undefined`
|
|
50
|
+
* - Multiple mode: `Date[] | undefined`
|
|
51
|
+
* - Range mode: `DateRange | undefined`
|
|
52
|
+
* - None mode: Not applicable
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const [date, setDate] = useState<Date>()
|
|
57
|
+
* <Calendar mode="single" selected={date} />
|
|
58
|
+
*
|
|
59
|
+
* const [dates, setDates] = useState<Date[]>()
|
|
60
|
+
* <Calendar mode="multiple" selected={dates} />
|
|
61
|
+
*
|
|
62
|
+
* const [range, setRange] = useState<DateRange>()
|
|
63
|
+
* <Calendar mode="range" selected={range} />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
selected?: Date | Date[] | DateRange | undefined;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Event handler called when date selection changes
|
|
70
|
+
*
|
|
71
|
+
* The handler signature varies based on the selection mode:
|
|
72
|
+
* - Single: `(date: Date | undefined) => void`
|
|
73
|
+
* - Multiple: `(dates: Date[] | undefined) => void`
|
|
74
|
+
* - Range: `(range: DateRange | undefined) => void`
|
|
75
|
+
*
|
|
76
|
+
* @param value - The new selected value(s)
|
|
77
|
+
*/
|
|
78
|
+
onSelect?: (value: Date | Date[] | DateRange | undefined) => void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Button variant for navigation arrows and interactive elements
|
|
82
|
+
*
|
|
83
|
+
* Controls the visual style of the previous/next month navigation buttons.
|
|
84
|
+
* Choose from shadcn/ui button variants to match your design system.
|
|
85
|
+
*
|
|
86
|
+
* @default "ghost"
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* // Outline style navigation buttons
|
|
90
|
+
* <Calendar buttonVariant="outline" />
|
|
91
|
+
*
|
|
92
|
+
* // Secondary style for subtle navigation
|
|
93
|
+
* <Calendar buttonVariant="secondary" />
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
buttonVariant?:
|
|
97
|
+
| "default"
|
|
98
|
+
| "destructive"
|
|
99
|
+
| "outline"
|
|
100
|
+
| "secondary"
|
|
101
|
+
| "ghost"
|
|
102
|
+
| "link";
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Layout style for the month caption area
|
|
106
|
+
*
|
|
107
|
+
* - `"buttons"`: Navigation buttons on either side of the month/year label
|
|
108
|
+
* - `"dropdown"`: Interactive dropdowns for month and year selection
|
|
109
|
+
* - `"dropdown-buttons"`: Combines dropdowns with navigation buttons
|
|
110
|
+
*
|
|
111
|
+
* @default "buttons"
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* // Enable month/year dropdowns
|
|
115
|
+
* <Calendar captionLayout="dropdown" fromYear={2020} toYear={2030} />
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
captionLayout?: "buttons" | "dropdown" | "dropdown-buttons";
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Whether to show days from adjacent months (outside days)
|
|
122
|
+
*
|
|
123
|
+
* When true, displays grayed-out days from the previous and next months
|
|
124
|
+
* to fill the calendar grid. Useful for maintaining consistent layout.
|
|
125
|
+
*
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
128
|
+
showOutsideDays?: boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The number of months to display simultaneously
|
|
132
|
+
*
|
|
133
|
+
* Useful for date range selection or providing more calendar context.
|
|
134
|
+
* Months are displayed side by side on larger screens.
|
|
135
|
+
*
|
|
136
|
+
* @default 1
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* // Show two months for range selection
|
|
140
|
+
* <Calendar numberOfMonths={2} mode="range" />
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
numberOfMonths?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Whether to display a column showing week numbers
|
|
147
|
+
*
|
|
148
|
+
* Week numbers are calculated according to the locale settings.
|
|
149
|
+
* Use `ISOWeek` prop for ISO 8601 week numbering.
|
|
150
|
+
*
|
|
151
|
+
* @default false
|
|
152
|
+
* @see {@link ISOWeek} For ISO week date format
|
|
153
|
+
* @see {@link firstWeekContainsDate} For first week configuration
|
|
154
|
+
*/
|
|
155
|
+
showWeekNumber?: boolean;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Use ISO 8601 week dates instead of locale-based week numbering
|
|
159
|
+
*
|
|
160
|
+
* When true, weeks start on Monday and the first week contains January 4th.
|
|
161
|
+
* This standardizes week numbering across different locales.
|
|
162
|
+
*
|
|
163
|
+
* @default false
|
|
164
|
+
* @see {@link showWeekNumber} To display week numbers
|
|
165
|
+
*/
|
|
166
|
+
ISOWeek?: boolean;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Always display exactly 6 weeks per month
|
|
170
|
+
*
|
|
171
|
+
* Prevents calendar height changes during navigation by ensuring
|
|
172
|
+
* a consistent 6-week grid. Empty cells are filled with outside days.
|
|
173
|
+
*
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
fixedWeeks?: boolean;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Dates or date ranges that cannot be selected
|
|
180
|
+
*
|
|
181
|
+
* Accepts various matcher formats:
|
|
182
|
+
* - Single date: `new Date(2024, 0, 15)`
|
|
183
|
+
* - Date range: `{ from: new Date(2024, 0, 1), to: new Date(2024, 0, 31) }`
|
|
184
|
+
* - Days of week: `{ dayOfWeek: [0, 6] }` (Sunday, Saturday)
|
|
185
|
+
* - Before/after: `{ before: new Date() }`, `{ after: new Date(2024, 11, 31) }`
|
|
186
|
+
* - Array of matchers: `[date1, { dayOfWeek: [0] }, { before: new Date() }]`
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <Calendar disabled={[
|
|
191
|
+
* { before: new Date() }, // Past dates
|
|
192
|
+
* { dayOfWeek: [0, 6] }, // Weekends
|
|
193
|
+
* new Date(2024, 11, 25), // Christmas
|
|
194
|
+
* { from: new Date(2024, 6, 1), to: new Date(2024, 6, 7) } // Vacation week
|
|
195
|
+
* ]} />
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
disabled?: Matcher | Matcher[];
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Dates or date ranges to visually highlight with special styling
|
|
202
|
+
*
|
|
203
|
+
* Similar to disabled prop but for positive highlighting.
|
|
204
|
+
* Useful for marking holidays, events, or available dates.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <Calendar highlighted={[
|
|
209
|
+
* new Date(2024, 11, 25), // Christmas
|
|
210
|
+
* { from: new Date(2024, 5, 1), to: new Date(2024, 5, 7) } // Special week
|
|
211
|
+
* ]} />
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
highlighted?: Matcher | Matcher[];
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The initially displayed month when the calendar first renders
|
|
218
|
+
*
|
|
219
|
+
* Useful for starting the calendar on a specific month rather than
|
|
220
|
+
* the current month or selected date.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```tsx
|
|
224
|
+
* // Start calendar in June 2024
|
|
225
|
+
* <Calendar defaultMonth={new Date(2024, 5)} />
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
defaultMonth?: Date;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Controlled month display (use with onMonthChange)
|
|
232
|
+
*
|
|
233
|
+
* When provided, the calendar will display this specific month.
|
|
234
|
+
* Use with onMonthChange for programmatic month control.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```tsx
|
|
238
|
+
* const [month, setMonth] = useState(new Date(2024, 5))
|
|
239
|
+
* <Calendar month={month} onMonthChange={setMonth} />
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
month?: Date;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Event handler called when the displayed month changes
|
|
246
|
+
*
|
|
247
|
+
* Called when user navigates to a different month via buttons,
|
|
248
|
+
* dropdowns, or keyboard navigation.
|
|
249
|
+
*
|
|
250
|
+
* @param month - The new month being displayed
|
|
251
|
+
*/
|
|
252
|
+
onMonthChange?: (month: Date) => void;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Earliest month that can be navigated to
|
|
256
|
+
*
|
|
257
|
+
* Restricts backward navigation beyond this month.
|
|
258
|
+
* Navigation buttons are disabled when reaching this limit.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```tsx
|
|
262
|
+
* // Don't allow navigation before January 2024
|
|
263
|
+
* <Calendar startMonth={new Date(2024, 0)} />
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
startMonth?: Date;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Latest month that can be navigated to
|
|
270
|
+
*
|
|
271
|
+
* Restricts forward navigation beyond this month.
|
|
272
|
+
* Navigation buttons are disabled when reaching this limit.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```tsx
|
|
276
|
+
* // Don't allow navigation past December 2025
|
|
277
|
+
* <Calendar endMonth={new Date(2025, 11)} />
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
endMonth?: Date;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Earliest year for dropdown navigation (when using captionLayout="dropdown")
|
|
284
|
+
*
|
|
285
|
+
* Only relevant when using dropdown caption layout.
|
|
286
|
+
* Limits the earliest selectable year in the year dropdown.
|
|
287
|
+
*
|
|
288
|
+
* @default Current year - 100
|
|
289
|
+
*/
|
|
290
|
+
fromYear?: number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Latest year for dropdown navigation (when using captionLayout="dropdown")
|
|
294
|
+
*
|
|
295
|
+
* Only relevant when using dropdown caption layout.
|
|
296
|
+
* Limits the latest selectable year in the year dropdown.
|
|
297
|
+
*
|
|
298
|
+
* @default Current year + 100
|
|
299
|
+
*/
|
|
300
|
+
toYear?: number;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Completely disable all month navigation
|
|
304
|
+
*
|
|
305
|
+
* When true, removes navigation buttons and prevents month changes.
|
|
306
|
+
* Useful for static calendar displays.
|
|
307
|
+
*
|
|
308
|
+
* @default false
|
|
309
|
+
*/
|
|
310
|
+
disableNavigation?: boolean;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Hide the navigation buttons while keeping programmatic navigation possible
|
|
314
|
+
*
|
|
315
|
+
* Unlike disableNavigation, this only hides the UI buttons but allows
|
|
316
|
+
* navigation via onMonthChange and other programmatic methods.
|
|
317
|
+
*
|
|
318
|
+
* @default false
|
|
319
|
+
*/
|
|
320
|
+
hideNavigation?: boolean;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Enable smooth month transition animations
|
|
324
|
+
*
|
|
325
|
+
* Adds CSS transitions when navigating between months.
|
|
326
|
+
* Customize animation duration and timing with CSS variables.
|
|
327
|
+
*
|
|
328
|
+
* @default false
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* // Enable with custom animation
|
|
332
|
+
* <Calendar
|
|
333
|
+
* animate
|
|
334
|
+
* className="[--rdp-animation_duration:0.3s] [--rdp-animation_timing:ease-in-out]"
|
|
335
|
+
* />
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
animate?: boolean;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The first day of the week (0 = Sunday, 1 = Monday, etc.)
|
|
342
|
+
*
|
|
343
|
+
* Overrides the locale's default first day of week setting.
|
|
344
|
+
* Affects both the weekday header display and week calculations.
|
|
345
|
+
*
|
|
346
|
+
* @default Locale default
|
|
347
|
+
* @example
|
|
348
|
+
* ```tsx
|
|
349
|
+
* // Start weeks on Monday
|
|
350
|
+
* <Calendar weekStartsOn={1} />
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Configuration for the first week of the year
|
|
357
|
+
*
|
|
358
|
+
* - `1`: First week contains January 1st
|
|
359
|
+
* - `4`: First week contains January 4th (ISO 8601 standard)
|
|
360
|
+
*
|
|
361
|
+
* Affects week number calculations when showWeekNumber is enabled.
|
|
362
|
+
*
|
|
363
|
+
* @default 1
|
|
364
|
+
* @see {@link showWeekNumber}
|
|
365
|
+
* @see {@link ISOWeek}
|
|
366
|
+
*/
|
|
367
|
+
firstWeekContainsDate?: 1 | 4;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Locale for date formatting and localization
|
|
371
|
+
*
|
|
372
|
+
* Uses date-fns locale objects for internationalization.
|
|
373
|
+
* Affects month names, weekday names, and date formatting.
|
|
374
|
+
*
|
|
375
|
+
* @default date-fns English locale
|
|
376
|
+
* @example
|
|
377
|
+
* ```tsx
|
|
378
|
+
* import { es } from 'date-fns/locale'
|
|
379
|
+
* <Calendar locale={es} />
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
locale?: Locale;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Text direction for right-to-left languages
|
|
386
|
+
*
|
|
387
|
+
* @default "ltr"
|
|
388
|
+
* @example
|
|
389
|
+
* ```tsx
|
|
390
|
+
* // For Arabic or Hebrew
|
|
391
|
+
* <Calendar dir="rtl" />
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
dir?: "ltr" | "rtl";
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Event handler for day click events
|
|
398
|
+
*
|
|
399
|
+
* Called when any day is clicked, regardless of selection mode.
|
|
400
|
+
* Provides the clicked date and any active modifiers.
|
|
401
|
+
*
|
|
402
|
+
* @param day - The clicked date
|
|
403
|
+
* @param modifiers - Object containing modifier states (selected, disabled, etc.)
|
|
404
|
+
*/
|
|
405
|
+
onDayClick?: (day: Date, modifiers: Record<string, boolean>) => void;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Event handler for day hover events
|
|
409
|
+
*
|
|
410
|
+
* Called when the mouse enters a day cell.
|
|
411
|
+
*
|
|
412
|
+
* @param day - The hovered date
|
|
413
|
+
* @param modifiers - Object containing modifier states
|
|
414
|
+
*/
|
|
415
|
+
onDayMouseEnter?: (day: Date, modifiers: Record<string, boolean>) => void;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Event handler for day hover leave events
|
|
419
|
+
*
|
|
420
|
+
* Called when the mouse leaves a day cell.
|
|
421
|
+
*
|
|
422
|
+
* @param day - The unhovered date
|
|
423
|
+
* @param modifiers - Object containing modifier states
|
|
424
|
+
*/
|
|
425
|
+
onDayMouseLeave?: (day: Date, modifiers: Record<string, boolean>) => void;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Event handler for day keyboard events
|
|
429
|
+
*
|
|
430
|
+
* Called when a key is pressed while a day has focus.
|
|
431
|
+
* Useful for custom keyboard shortcuts or interactions.
|
|
432
|
+
*
|
|
433
|
+
* @param day - The focused date
|
|
434
|
+
* @param key - The pressed key
|
|
435
|
+
* @param modifiers - Object containing modifier states
|
|
436
|
+
*/
|
|
437
|
+
onDayKeyDown?: (
|
|
438
|
+
day: Date,
|
|
439
|
+
key: string,
|
|
440
|
+
modifiers: Record<string, boolean>,
|
|
441
|
+
) => void;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Event handler for week number clicks
|
|
445
|
+
*
|
|
446
|
+
* Called when a week number is clicked (when showWeekNumber is true).
|
|
447
|
+
* Useful for selecting entire weeks or custom week-based interactions.
|
|
448
|
+
*
|
|
449
|
+
* @param weekNumber - The clicked week number
|
|
450
|
+
* @param dates - Array of all dates in that week
|
|
451
|
+
*/
|
|
452
|
+
onWeekNumberClick?: (weekNumber: number, dates: Date[]) => void;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Custom formatters for date display
|
|
456
|
+
*
|
|
457
|
+
* Override default formatting for various calendar elements.
|
|
458
|
+
* All formatters receive the date and locale options.
|
|
459
|
+
*
|
|
460
|
+
* @example
|
|
461
|
+
* ```tsx
|
|
462
|
+
* <Calendar formatters={{
|
|
463
|
+
* formatDay: (date) => date.getDate().toString(),
|
|
464
|
+
* formatMonthCaption: (date) => date.toLocaleDateString('en', { month: 'long', year: 'numeric' }),
|
|
465
|
+
* formatWeekNumber: (weekNumber) => `W${weekNumber}`
|
|
466
|
+
* }} />
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
formatters?: {
|
|
470
|
+
/** Format individual day numbers */
|
|
471
|
+
formatDay?: (date: Date) => string;
|
|
472
|
+
/** Format month caption (header) */
|
|
473
|
+
formatMonthCaption?: (date: Date) => string;
|
|
474
|
+
/** Format week numbers */
|
|
475
|
+
formatWeekNumber?: (weekNumber: number) => string;
|
|
476
|
+
/** Format weekday names in header */
|
|
477
|
+
formatWeekdayName?: (date: Date) => string;
|
|
478
|
+
/** Format year in dropdown */
|
|
479
|
+
formatYearDropdown?: (date: Date) => string;
|
|
480
|
+
/** Format month in dropdown */
|
|
481
|
+
formatMonthDropdown?: (date: Date) => string;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Custom class names for calendar elements
|
|
486
|
+
*
|
|
487
|
+
* Override default styling for specific parts of the calendar.
|
|
488
|
+
* Useful for theming or custom styling without affecting the entire component.
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```tsx
|
|
492
|
+
* <Calendar classNames={{
|
|
493
|
+
* day: "hover:bg-blue-100",
|
|
494
|
+
* selected: "bg-blue-500 text-white",
|
|
495
|
+
* disabled: "opacity-30",
|
|
496
|
+
* range_middle: "bg-blue-100"
|
|
497
|
+
* }} />
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
classNames?: {
|
|
501
|
+
/** Root calendar container */
|
|
502
|
+
root?: string;
|
|
503
|
+
/** Months container */
|
|
504
|
+
months?: string;
|
|
505
|
+
/** Individual month container */
|
|
506
|
+
month?: string;
|
|
507
|
+
/** Month caption/header */
|
|
508
|
+
month_caption?: string;
|
|
509
|
+
/** Navigation container */
|
|
510
|
+
nav?: string;
|
|
511
|
+
/** Previous month button */
|
|
512
|
+
button_previous?: string;
|
|
513
|
+
/** Next month button */
|
|
514
|
+
button_next?: string;
|
|
515
|
+
/** Month/year dropdowns container */
|
|
516
|
+
dropdowns?: string;
|
|
517
|
+
/** Individual dropdown */
|
|
518
|
+
dropdown?: string;
|
|
519
|
+
/** Weekdays header row */
|
|
520
|
+
weekdays?: string;
|
|
521
|
+
/** Individual weekday header */
|
|
522
|
+
weekday?: string;
|
|
523
|
+
/** Week row container */
|
|
524
|
+
week?: string;
|
|
525
|
+
/** Week number cell */
|
|
526
|
+
week_number?: string;
|
|
527
|
+
/** Individual day cell */
|
|
528
|
+
day?: string;
|
|
529
|
+
/** Selected day(s) */
|
|
530
|
+
selected?: string;
|
|
531
|
+
/** Today's date */
|
|
532
|
+
today?: string;
|
|
533
|
+
/** Disabled days */
|
|
534
|
+
disabled?: string;
|
|
535
|
+
/** Days outside current month */
|
|
536
|
+
outside?: string;
|
|
537
|
+
/** Range start day */
|
|
538
|
+
range_start?: string;
|
|
539
|
+
/** Range end day */
|
|
540
|
+
range_end?: string;
|
|
541
|
+
/** Days in middle of range */
|
|
542
|
+
range_middle?: string;
|
|
543
|
+
/** Hidden days */
|
|
544
|
+
hidden?: string;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Custom React components to replace default calendar parts
|
|
549
|
+
*
|
|
550
|
+
* Allows complete customization of calendar rendering by replacing
|
|
551
|
+
* internal components with your own implementations.
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```tsx
|
|
555
|
+
* <Calendar components={{
|
|
556
|
+
* DayContent: ({ date }) => (
|
|
557
|
+
* <span>{date.getDate()}{date.getDate() === 1 && '🎉'}</span>
|
|
558
|
+
* ),
|
|
559
|
+
* MonthCaption: ({ displayMonth }) => (
|
|
560
|
+
* <h2 className="text-lg font-bold">{displayMonth.toLocaleDateString()}</h2>
|
|
561
|
+
* )
|
|
562
|
+
* }} />
|
|
563
|
+
* ```
|
|
564
|
+
*/
|
|
565
|
+
components?: {
|
|
566
|
+
/** Root calendar container component */
|
|
567
|
+
Root?: React.ComponentType<
|
|
568
|
+
React.ComponentProps<"div"> & { rootRef?: React.Ref<HTMLDivElement> }
|
|
569
|
+
>;
|
|
570
|
+
/** Month caption component */
|
|
571
|
+
MonthCaption?: React.ComponentType<{ displayMonth: Date }>;
|
|
572
|
+
/** Navigation chevron icons */
|
|
573
|
+
Chevron?: React.ComponentType<
|
|
574
|
+
React.ComponentProps<"svg"> & {
|
|
575
|
+
orientation?: "left" | "right" | "up" | "down";
|
|
576
|
+
}
|
|
577
|
+
>;
|
|
578
|
+
/** Individual day button */
|
|
579
|
+
DayButton?: React.ComponentType<React.ComponentProps<typeof DayButton>>;
|
|
580
|
+
/** Day content (number/text inside day) */
|
|
581
|
+
DayContent?: React.ComponentType<{ date: Date }>;
|
|
582
|
+
/** Dropdown select components */
|
|
583
|
+
Dropdown?: React.ComponentType<React.ComponentProps<"select">>;
|
|
584
|
+
/** Week number component */
|
|
585
|
+
WeekNumber?: React.ComponentType<
|
|
586
|
+
React.ComponentProps<"td"> & { children: React.ReactNode }
|
|
587
|
+
>;
|
|
588
|
+
/** Footer component */
|
|
589
|
+
Footer?: React.ComponentType<{ children: React.ReactNode }>;
|
|
590
|
+
/** Weekdays header */
|
|
591
|
+
Weekdays?: React.ComponentType<React.ComponentProps<"tr">>;
|
|
592
|
+
/** Week row component */
|
|
593
|
+
Week?: React.ComponentType<React.ComponentProps<"tr">>;
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Footer content displayed below the calendar
|
|
598
|
+
*
|
|
599
|
+
* Can be any React node - text, components, or complex elements.
|
|
600
|
+
* Commonly used to show selected date(s) or provide additional context.
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ```tsx
|
|
604
|
+
* <Calendar footer={
|
|
605
|
+
* selected ? (
|
|
606
|
+
* <p>Selected: {selected.toLocaleDateString()}</p>
|
|
607
|
+
* ) : (
|
|
608
|
+
* <p>Please select a date</p>
|
|
609
|
+
* )
|
|
610
|
+
* } />
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
footer?: React.ReactNode;
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Custom modifiers for advanced styling and behavior
|
|
617
|
+
*
|
|
618
|
+
* Define custom rules for styling or highlighting specific dates.
|
|
619
|
+
* Each modifier can be a date, date range, or function that returns boolean.
|
|
620
|
+
*
|
|
621
|
+
* @example
|
|
622
|
+
* ```tsx
|
|
623
|
+
* <Calendar modifiers={{
|
|
624
|
+
* weekend: { dayOfWeek: [0, 6] },
|
|
625
|
+
* holiday: [new Date(2024, 11, 25), new Date(2024, 0, 1)],
|
|
626
|
+
* booked: (date) => bookedDates.includes(date.toDateString())
|
|
627
|
+
* }} />
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
modifiers?: Record<string, Matcher | Matcher[]>;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Additional CSS classes to apply to the calendar root
|
|
634
|
+
*
|
|
635
|
+
* Standard className prop for styling the entire calendar container.
|
|
636
|
+
*/
|
|
637
|
+
className?: string;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Inline styles for the calendar root
|
|
641
|
+
*
|
|
642
|
+
* React CSSProperties object for inline styling.
|
|
643
|
+
*/
|
|
644
|
+
style?: React.CSSProperties;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* HTML data attributes and other props
|
|
648
|
+
*
|
|
649
|
+
* Any additional HTML attributes will be forwarded to the root element.
|
|
650
|
+
*/
|
|
651
|
+
[key: string]: unknown;
|
|
652
|
+
} & Omit<React.ComponentProps<typeof DayPicker>, "buttonVariant">;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Actual props type used by the Calendar component implementation
|
|
656
|
+
* Uses react-day-picker's inferred types for perfect compatibility
|
|
657
|
+
*/
|
|
658
|
+
type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
659
|
+
/**
|
|
660
|
+
* Button variant for navigation arrows and interactive elements
|
|
661
|
+
* @default "ghost"
|
|
662
|
+
*/
|
|
663
|
+
buttonVariant?:
|
|
664
|
+
| "default"
|
|
665
|
+
| "destructive"
|
|
666
|
+
| "outline"
|
|
667
|
+
| "secondary"
|
|
668
|
+
| "ghost"
|
|
669
|
+
| "link";
|
|
670
|
+
};
|
|
671
|
+
|
|
12
672
|
/**
|
|
13
673
|
* Calendar - A comprehensive date selection calendar component
|
|
14
674
|
*
|
|
@@ -16,6 +676,10 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
16
676
|
* date selection with extensive customization options. Supports single dates, date ranges,
|
|
17
677
|
* multiple dates, and custom validation rules with built-in accessibility features.
|
|
18
678
|
*
|
|
679
|
+
* Built on the powerful react-day-picker library, this component provides a complete
|
|
680
|
+
* calendar interface with advanced features like custom formatters, modifiers, disabled
|
|
681
|
+
* dates, localization, and extensive styling options.
|
|
682
|
+
*
|
|
19
683
|
* @component
|
|
20
684
|
*
|
|
21
685
|
* @example Basic single date selection
|
|
@@ -43,7 +707,7 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
43
707
|
* />
|
|
44
708
|
* ```
|
|
45
709
|
*
|
|
46
|
-
* @example Multiple date selection
|
|
710
|
+
* @example Multiple date selection with limits
|
|
47
711
|
* ```tsx
|
|
48
712
|
* const [dates, setDates] = useState<Date[] | undefined>()
|
|
49
713
|
*
|
|
@@ -51,6 +715,8 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
51
715
|
* mode="multiple"
|
|
52
716
|
* selected={dates}
|
|
53
717
|
* onSelect={setDates}
|
|
718
|
+
* min={2} // Minimum 2 dates required
|
|
719
|
+
* max={5} // Maximum 5 dates allowed
|
|
54
720
|
* className="rounded-md border"
|
|
55
721
|
* />
|
|
56
722
|
* ```
|
|
@@ -70,7 +736,7 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
70
736
|
* />
|
|
71
737
|
* ```
|
|
72
738
|
*
|
|
73
|
-
* @example Calendar with month/year dropdowns
|
|
739
|
+
* @example Calendar with month/year dropdowns and navigation limits
|
|
74
740
|
* ```tsx
|
|
75
741
|
* <Calendar
|
|
76
742
|
* mode="single"
|
|
@@ -79,36 +745,194 @@ import { Button, buttonVariants } from "@/components/ui/button";
|
|
|
79
745
|
* onSelect={setDate}
|
|
80
746
|
* fromYear={2020}
|
|
81
747
|
* toYear={2030}
|
|
748
|
+
* startMonth={new Date(2023, 0)} // Don't go before Jan 2023
|
|
749
|
+
* endMonth={new Date(2025, 11)} // Don't go past Dec 2025
|
|
82
750
|
* className="rounded-md border"
|
|
83
751
|
* />
|
|
84
752
|
* ```
|
|
85
753
|
*
|
|
754
|
+
* @example International calendar with custom locale
|
|
755
|
+
* ```tsx
|
|
756
|
+
* import { es } from 'date-fns/locale'
|
|
757
|
+
*
|
|
758
|
+
* <Calendar
|
|
759
|
+
* mode="single"
|
|
760
|
+
* selected={date}
|
|
761
|
+
* onSelect={setDate}
|
|
762
|
+
* locale={es} // Spanish locale
|
|
763
|
+
* weekStartsOn={1} // Start weeks on Monday
|
|
764
|
+
* dir="ltr"
|
|
765
|
+
* className="rounded-md border"
|
|
766
|
+
* />
|
|
767
|
+
* ```
|
|
768
|
+
*
|
|
769
|
+
* @example Calendar with custom formatters and styling
|
|
770
|
+
* ```tsx
|
|
771
|
+
* <Calendar
|
|
772
|
+
* mode="single"
|
|
773
|
+
* showWeekNumber
|
|
774
|
+
* formatters={{
|
|
775
|
+
* formatDay: (date) => date.getDate().toString(),
|
|
776
|
+
* formatWeekNumber: (weekNumber) => `W${weekNumber}`,
|
|
777
|
+
* formatMonthCaption: (date) =>
|
|
778
|
+
* date.toLocaleDateString('en', { month: 'long', year: 'numeric' })
|
|
779
|
+
* }}
|
|
780
|
+
* classNames={{
|
|
781
|
+
* day: "hover:bg-blue-100 transition-colors",
|
|
782
|
+
* selected: "bg-blue-500 text-white font-semibold",
|
|
783
|
+
* today: "bg-blue-100 font-bold"
|
|
784
|
+
* }}
|
|
785
|
+
* className="rounded-lg border-2 shadow-lg"
|
|
786
|
+
* />
|
|
787
|
+
* ```
|
|
788
|
+
*
|
|
789
|
+
* @example Calendar with custom modifiers and event handling
|
|
790
|
+
* ```tsx
|
|
791
|
+
* const holidays = [new Date(2024, 11, 25), new Date(2024, 0, 1)]
|
|
792
|
+
* const weekends = { dayOfWeek: [0, 6] }
|
|
793
|
+
*
|
|
794
|
+
* <Calendar
|
|
795
|
+
* mode="single"
|
|
796
|
+
* modifiers={{
|
|
797
|
+
* holiday: holidays,
|
|
798
|
+
* weekend: weekends,
|
|
799
|
+
* available: (date) => availableDates.includes(date.toDateString())
|
|
800
|
+
* }}
|
|
801
|
+
* onDayClick={(day, modifiers) => {
|
|
802
|
+
* if (modifiers.holiday) {
|
|
803
|
+
* alert('Holiday selected!')
|
|
804
|
+
* }
|
|
805
|
+
* }}
|
|
806
|
+
* onWeekNumberClick={(weekNumber, dates) => {
|
|
807
|
+
* console.log(`Week ${weekNumber} contains:`, dates)
|
|
808
|
+
* }}
|
|
809
|
+
* classNames={{
|
|
810
|
+
* holiday: "bg-red-100 text-red-800",
|
|
811
|
+
* weekend: "bg-gray-100 text-gray-600",
|
|
812
|
+
* available: "bg-green-100 text-green-800"
|
|
813
|
+
* }}
|
|
814
|
+
* />
|
|
815
|
+
* ```
|
|
816
|
+
*
|
|
817
|
+
* @example Calendar with custom components
|
|
818
|
+
* ```tsx
|
|
819
|
+
* <Calendar
|
|
820
|
+
* mode="single"
|
|
821
|
+
* components={{
|
|
822
|
+
* DayContent: ({ date }) => (
|
|
823
|
+
* <div className="relative">
|
|
824
|
+
* {date.getDate()}
|
|
825
|
+
* {date.getDate() === 1 && (
|
|
826
|
+
* <span className="absolute -top-1 -right-1 text-xs">🎉</span>
|
|
827
|
+
* )}
|
|
828
|
+
* </div>
|
|
829
|
+
* ),
|
|
830
|
+
* MonthCaption: ({ displayMonth }) => (
|
|
831
|
+
* <div className="flex items-center justify-center py-2">
|
|
832
|
+
* <h2 className="text-lg font-bold text-blue-600">
|
|
833
|
+
* {displayMonth.toLocaleDateString('en', {
|
|
834
|
+
* month: 'long',
|
|
835
|
+
* year: 'numeric'
|
|
836
|
+
* })}
|
|
837
|
+
* </h2>
|
|
838
|
+
* </div>
|
|
839
|
+
* )
|
|
840
|
+
* }}
|
|
841
|
+
* />
|
|
842
|
+
* ```
|
|
843
|
+
*
|
|
844
|
+
* @example Advanced range selection with custom styling
|
|
845
|
+
* ```tsx
|
|
846
|
+
* const [dateRange, setDateRange] = useState<DateRange>()
|
|
847
|
+
*
|
|
848
|
+
* <Calendar
|
|
849
|
+
* mode="range"
|
|
850
|
+
* selected={dateRange}
|
|
851
|
+
* onSelect={setDateRange}
|
|
852
|
+
* numberOfMonths={2}
|
|
853
|
+
* showOutsideDays={false}
|
|
854
|
+
* fixedWeeks
|
|
855
|
+
* classNames={{
|
|
856
|
+
* range_start: "bg-blue-500 text-white rounded-l-md",
|
|
857
|
+
* range_end: "bg-blue-500 text-white rounded-r-md",
|
|
858
|
+
* range_middle: "bg-blue-100 text-blue-900",
|
|
859
|
+
* selected: "bg-blue-500 text-white"
|
|
860
|
+
* }}
|
|
861
|
+
* footer={dateRange && (
|
|
862
|
+
* <div className="p-3 border-t">
|
|
863
|
+
* <p className="text-sm text-gray-600">
|
|
864
|
+
* {dateRange.from && `From: ${dateRange.from.toLocaleDateString()}`}
|
|
865
|
+
* {dateRange.to && ` • To: ${dateRange.to.toLocaleDateString()}`}
|
|
866
|
+
* {dateRange.from && dateRange.to && (
|
|
867
|
+
* ` • ${Math.ceil((dateRange.to.getTime() - dateRange.from.getTime()) / (1000 * 60 * 60 * 24) + 1)} days`
|
|
868
|
+
* )}
|
|
869
|
+
* </p>
|
|
870
|
+
* </div>
|
|
871
|
+
* )}
|
|
872
|
+
* />
|
|
873
|
+
* ```
|
|
874
|
+
*
|
|
86
875
|
* @features
|
|
87
|
-
* - **Selection
|
|
88
|
-
* - **Navigation**: Month/year navigation with keyboard support
|
|
89
|
-
* - **Validation**: Flexible date disabling
|
|
90
|
-
* - **Customization**:
|
|
91
|
-
* - **Internationalization**:
|
|
92
|
-
* - **Accessibility**:
|
|
876
|
+
* - **Selection Modes**: Single date, date ranges, multiple dates, or no selection
|
|
877
|
+
* - **Navigation**: Month/year navigation with buttons or dropdowns, keyboard support
|
|
878
|
+
* - **Validation**: Flexible date disabling, custom matchers, min/max constraints
|
|
879
|
+
* - **Customization**: Custom formatters, modifiers, components, styling
|
|
880
|
+
* - **Internationalization**: Full locale support, RTL languages, custom week start
|
|
881
|
+
* - **Accessibility**: WCAG 2.1 AA compliant, screen reader support, keyboard navigation
|
|
882
|
+
* - **Performance**: Optimized rendering, minimal re-renders, efficient DOM updates
|
|
93
883
|
*
|
|
94
884
|
* @accessibility
|
|
95
|
-
* - **Keyboard Navigation**:
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
885
|
+
* - **Keyboard Navigation**:
|
|
886
|
+
* - Arrow keys navigate between dates
|
|
887
|
+
* - Page Up/Down navigate months
|
|
888
|
+
* - Home/End navigate to start/end of week
|
|
889
|
+
* - Ctrl+Page Up/Down navigate years
|
|
890
|
+
* - Enter/Space select dates
|
|
891
|
+
* - Escape closes popover/dropdown states
|
|
892
|
+
* - **Screen Reader Support**:
|
|
893
|
+
* - Comprehensive ARIA labels and descriptions
|
|
894
|
+
* - Live region announcements for month changes
|
|
895
|
+
* - Proper role and state management
|
|
896
|
+
* - Selected dates and ranges announced clearly
|
|
897
|
+
* - **Focus Management**:
|
|
898
|
+
* - Visible focus indicators with 3px ring
|
|
899
|
+
* - Focus restoration after month navigation
|
|
900
|
+
* - Logical tab order through interactive elements
|
|
901
|
+
* - Trapped focus in dropdown modes
|
|
902
|
+
* - **Standards Compliance**:
|
|
903
|
+
* - WCAG 2.1 AA color contrast requirements
|
|
904
|
+
* - Proper heading structure and landmarks
|
|
905
|
+
* - Compatible with screen readers and assistive technology
|
|
906
|
+
* - **RTL Support**:
|
|
907
|
+
* - Right-to-left text direction support
|
|
908
|
+
* - Mirrored navigation button orientation
|
|
909
|
+
* - Locale-aware date formatting
|
|
100
910
|
*
|
|
101
911
|
* @performance
|
|
102
|
-
*
|
|
103
|
-
*
|
|
912
|
+
* - **Optimized Rendering**: Minimal re-renders through memoization and efficient state management
|
|
913
|
+
* - **Large Date Ranges**: Efficiently handles calendars spanning multiple months and years
|
|
914
|
+
* - **Event Handling**: Debounced and optimized event handlers for smooth interactions
|
|
915
|
+
* - **Memory Management**: Proper cleanup and garbage collection for long-running applications
|
|
916
|
+
* - **Bundle Size**: Tree-shakeable with minimal runtime overhead
|
|
104
917
|
*
|
|
105
918
|
* @styling
|
|
106
|
-
*
|
|
107
|
-
*
|
|
919
|
+
* - **Design System Integration**: Built with shadcn/ui design tokens and Tailwind CSS
|
|
920
|
+
* - **CSS Custom Properties**: Supports `--cell-size` and other CSS variables for sizing
|
|
921
|
+
* - **Theming**: Dark mode support and custom theme integration
|
|
922
|
+
* - **Responsive**: Mobile-friendly with touch interactions and responsive layouts
|
|
923
|
+
* - **Customizable**: Override any visual aspect through classNames, components, or CSS
|
|
924
|
+
*
|
|
925
|
+
* @browser-support
|
|
926
|
+
* - **Modern Browsers**: Chrome 91+, Firefox 90+, Safari 15+, Edge 91+
|
|
927
|
+
* - **Mobile**: iOS Safari 15+, Android Chrome 91+
|
|
928
|
+
* - **Accessibility**: Compatible with NVDA, JAWS, VoiceOver screen readers
|
|
108
929
|
*
|
|
109
|
-
* @see {@link CalendarDayButton} Individual day button component
|
|
110
|
-
* @see
|
|
111
|
-
* @see {@link https://
|
|
930
|
+
* @see {@link CalendarDayButton} Individual day button component with custom styling
|
|
931
|
+
* @see {@link CalendarProps} Complete props interface with TypeScript definitions
|
|
932
|
+
* @see {@link https://react-day-picker.js.org/} react-day-picker documentation for advanced configuration
|
|
933
|
+
* @see {@link https://ui.shadcn.com/docs/components/calendar} shadcn/ui Calendar documentation
|
|
934
|
+
* @see {@link https://date-fns.org/docs/I18n} date-fns internationalization guide
|
|
935
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/} WAI-ARIA Authoring Practices Guide
|
|
112
936
|
* @since 1.0.0
|
|
113
937
|
*/
|
|
114
938
|
function Calendar({
|
|
@@ -120,25 +944,7 @@ function Calendar({
|
|
|
120
944
|
formatters,
|
|
121
945
|
components,
|
|
122
946
|
...props
|
|
123
|
-
}:
|
|
124
|
-
/**
|
|
125
|
-
* Button variant for navigation arrows and interactive elements
|
|
126
|
-
*
|
|
127
|
-
* Controls the visual style of the previous/next month navigation buttons.
|
|
128
|
-
* Choose from shadcn/ui button variants to match your design system.
|
|
129
|
-
*
|
|
130
|
-
* @default "ghost"
|
|
131
|
-
* @example
|
|
132
|
-
* ```tsx
|
|
133
|
-
* // Outline style navigation buttons
|
|
134
|
-
* <Calendar buttonVariant="outline" />
|
|
135
|
-
*
|
|
136
|
-
* // Secondary style for subtle navigation
|
|
137
|
-
* <Calendar buttonVariant="secondary" />
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
141
|
-
}) {
|
|
947
|
+
}: CalendarProps) {
|
|
142
948
|
const defaultClassNames = getDefaultClassNames();
|
|
143
949
|
|
|
144
950
|
return (
|
|
@@ -241,7 +1047,14 @@ function Calendar({
|
|
|
241
1047
|
...classNames,
|
|
242
1048
|
}}
|
|
243
1049
|
components={{
|
|
244
|
-
Root: ({
|
|
1050
|
+
Root: ({
|
|
1051
|
+
className,
|
|
1052
|
+
rootRef,
|
|
1053
|
+
...props
|
|
1054
|
+
}: {
|
|
1055
|
+
className?: string;
|
|
1056
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
|
1057
|
+
} & React.ComponentProps<"div">) => {
|
|
245
1058
|
return (
|
|
246
1059
|
<div
|
|
247
1060
|
data-slot="calendar"
|
|
@@ -251,7 +1064,14 @@ function Calendar({
|
|
|
251
1064
|
/>
|
|
252
1065
|
);
|
|
253
1066
|
},
|
|
254
|
-
Chevron: ({
|
|
1067
|
+
Chevron: ({
|
|
1068
|
+
className,
|
|
1069
|
+
orientation,
|
|
1070
|
+
...props
|
|
1071
|
+
}: {
|
|
1072
|
+
className?: string;
|
|
1073
|
+
orientation?: "left" | "right" | "up" | "down";
|
|
1074
|
+
} & React.ComponentProps<"svg">) => {
|
|
255
1075
|
if (orientation === "left") {
|
|
256
1076
|
return (
|
|
257
1077
|
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
@@ -272,7 +1092,10 @@ function Calendar({
|
|
|
272
1092
|
);
|
|
273
1093
|
},
|
|
274
1094
|
DayButton: CalendarDayButton,
|
|
275
|
-
WeekNumber: ({
|
|
1095
|
+
WeekNumber: ({
|
|
1096
|
+
children,
|
|
1097
|
+
...props
|
|
1098
|
+
}: React.ComponentProps<"td"> & { children?: React.ReactNode }) => {
|
|
276
1099
|
return (
|
|
277
1100
|
<td {...props}>
|
|
278
1101
|
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
@@ -369,3 +1192,4 @@ function CalendarDayButton({
|
|
|
369
1192
|
}
|
|
370
1193
|
|
|
371
1194
|
export { Calendar, CalendarDayButton };
|
|
1195
|
+
export type { CalendarProps };
|