@health-samurai/react-components 0.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bundle.css +5525 -0
- package/dist/src/components/code-editor/index.d.ts +5 -0
- package/dist/src/components/code-editor/index.d.ts.map +1 -0
- package/dist/src/components/code-editor/index.js +109 -0
- package/dist/src/components/code-editor/index.js.map +1 -0
- package/dist/src/components/code-editor.stories.d.ts +7 -0
- package/dist/src/components/code-editor.stories.d.ts.map +1 -0
- package/dist/src/components/code-editor.stories.js +23 -0
- package/dist/src/components/code-editor.stories.js.map +1 -0
- package/dist/src/components/copy-icon.d.ts +6 -0
- package/dist/src/components/copy-icon.d.ts.map +1 -0
- package/dist/src/components/copy-icon.js +21 -0
- package/dist/src/components/copy-icon.js.map +1 -0
- package/dist/src/components/request-line-editor.d.ts +38 -0
- package/dist/src/components/request-line-editor.d.ts.map +1 -0
- package/dist/src/components/request-line-editor.js +40 -0
- package/dist/src/components/request-line-editor.js.map +1 -0
- package/dist/src/components/request-line-editor.stories.d.ts +11 -0
- package/dist/src/components/request-line-editor.stories.d.ts.map +1 -0
- package/dist/src/components/request-line-editor.stories.js +67 -0
- package/dist/src/components/request-line-editor.stories.js.map +1 -0
- package/dist/src/deps.css +3 -0
- package/dist/src/full.css +2 -0
- package/dist/src/index.css +98 -0
- package/dist/src/index.d.ts +51 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +53 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.stories.d.ts +14 -0
- package/dist/src/index.stories.d.ts.map +1 -0
- package/dist/src/index.stories.js +16 -0
- package/dist/src/index.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/accordion.d.ts +8 -0
- package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/accordion.js +18 -0
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -0
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/accordion.stories.js +10 -0
- package/dist/src/shadcn/components/ui/accordion.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts +15 -0
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/alert-dialog.js +39 -0
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -0
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js +11 -0
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/alert.d.ts +10 -0
- package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/alert.js +25 -0
- package/dist/src/shadcn/components/ui/alert.js.map +1 -0
- package/dist/src/shadcn/components/ui/alert.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/alert.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/alert.stories.js +11 -0
- package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.js +7 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js +10 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/avatar.d.ts +7 -0
- package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/avatar.js +14 -0
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -0
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/avatar.stories.js +10 -0
- package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/badge.d.ts +10 -0
- package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/badge.js +23 -0
- package/dist/src/shadcn/components/ui/badge.js.map +1 -0
- package/dist/src/shadcn/components/ui/badge.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/badge.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/badge.stories.js +11 -0
- package/dist/src/shadcn/components/ui/badge.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts +12 -0
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/breadcrumb.js +31 -0
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -0
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js +11 -0
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/button.d.ts +13 -0
- package/dist/src/shadcn/components/ui/button.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/button.js +55 -0
- package/dist/src/shadcn/components/ui/button.js.map +1 -0
- package/dist/src/shadcn/components/ui/button.stories.d.ts +23 -0
- package/dist/src/shadcn/components/ui/button.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/button.stories.js +26 -0
- package/dist/src/shadcn/components/ui/button.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/calendar.d.ts +9 -0
- package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/calendar.js +74 -0
- package/dist/src/shadcn/components/ui/calendar.js.map +1 -0
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/calendar.stories.js +14 -0
- package/dist/src/shadcn/components/ui/calendar.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/card.d.ts +10 -0
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/card.js +25 -0
- package/dist/src/shadcn/components/ui/card.js.map +1 -0
- package/dist/src/shadcn/components/ui/card.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/card.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/card.stories.js +13 -0
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/carousel.d.ts +20 -0
- package/dist/src/shadcn/components/ui/carousel.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/carousel.js +93 -0
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -0
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/carousel.stories.js +13 -0
- package/dist/src/shadcn/components/ui/carousel.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/chart.d.ts +41 -0
- package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/chart.js +130 -0
- package/dist/src/shadcn/components/ui/chart.js.map +1 -0
- package/dist/src/shadcn/components/ui/chart.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/chart.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/chart.stories.js +29 -0
- package/dist/src/shadcn/components/ui/chart.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/checkbox.d.ts +5 -0
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/checkbox.js +9 -0
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -0
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/checkbox.stories.js +11 -0
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/collapsible.d.ts +6 -0
- package/dist/src/shadcn/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/collapsible.js +13 -0
- package/dist/src/shadcn/components/ui/collapsible.js.map +1 -0
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/collapsible.stories.js +16 -0
- package/dist/src/shadcn/components/ui/collapsible.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.d.ts +19 -0
- package/dist/src/shadcn/components/ui/command.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/command.js +34 -0
- package/dist/src/shadcn/components/ui/command.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/command.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/command.stories.js +11 -0
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/context-menu.d.ts +26 -0
- package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/context-menu.js +51 -0
- package/dist/src/shadcn/components/ui/context-menu.js.map +1 -0
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/context-menu.stories.js +10 -0
- package/dist/src/shadcn/components/ui/context-menu.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/dialog.d.ts +16 -0
- package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/dialog.js +36 -0
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -0
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/dialog.stories.js +13 -0
- package/dist/src/shadcn/components/ui/dialog.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/drawer.d.ts +14 -0
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/drawer.js +35 -0
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -0
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/drawer.stories.js +38 -0
- package/dist/src/shadcn/components/ui/drawer.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.js +51 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +11 -0
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/form.d.ts +25 -0
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/form.js +59 -0
- package/dist/src/shadcn/components/ui/form.js.map +1 -0
- package/dist/src/shadcn/components/ui/form.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/form.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/form.stories.js +31 -0
- package/dist/src/shadcn/components/ui/form.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/hover-card.d.ts +7 -0
- package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/hover-card.js +14 -0
- package/dist/src/shadcn/components/ui/hover-card.js.map +1 -0
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/hover-card.stories.js +12 -0
- package/dist/src/shadcn/components/ui/hover-card.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/input-otp.d.ts +12 -0
- package/dist/src/shadcn/components/ui/input-otp.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/input-otp.js +25 -0
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -0
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/input-otp.stories.js +10 -0
- package/dist/src/shadcn/components/ui/input-otp.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/input.d.ts +18 -0
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/input.js +79 -0
- package/dist/src/shadcn/components/ui/input.js.map +1 -0
- package/dist/src/shadcn/components/ui/input.stories.d.ts +18 -0
- package/dist/src/shadcn/components/ui/input.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/input.stories.js +39 -0
- package/dist/src/shadcn/components/ui/input.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/label.d.ts +5 -0
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/label.js +8 -0
- package/dist/src/shadcn/components/ui/label.js.map +1 -0
- package/dist/src/shadcn/components/ui/label.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/label.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/label.stories.js +11 -0
- package/dist/src/shadcn/components/ui/label.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/menubar.d.ts +27 -0
- package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/menubar.js +54 -0
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -0
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/menubar.stories.js +10 -0
- package/dist/src/shadcn/components/ui/menubar.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/navigation-menu.d.ts +15 -0
- package/dist/src/shadcn/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/navigation-menu.js +32 -0
- package/dist/src/shadcn/components/ui/navigation-menu.js.map +1 -0
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js +46 -0
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/pagination.d.ts +14 -0
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/pagination.js +34 -0
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -0
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/pagination.stories.js +10 -0
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/popover.d.ts +8 -0
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/popover.js +17 -0
- package/dist/src/shadcn/components/ui/popover.js.map +1 -0
- package/dist/src/shadcn/components/ui/popover.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/popover.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/popover.stories.js +13 -0
- package/dist/src/shadcn/components/ui/popover.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/progress.d.ts +5 -0
- package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/progress.js +8 -0
- package/dist/src/shadcn/components/ui/progress.js.map +1 -0
- package/dist/src/shadcn/components/ui/progress.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/progress.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/progress.stories.js +18 -0
- package/dist/src/shadcn/components/ui/progress.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.d.ts +6 -0
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.js +12 -0
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.stories.js +11 -0
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/resizable.d.ts +9 -0
- package/dist/src/shadcn/components/ui/resizable.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/resizable.js +15 -0
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -0
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/resizable.stories.js +10 -0
- package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/scroll-area.d.ts +6 -0
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/scroll-area.js +13 -0
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -0
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/scroll-area.stories.js +13 -0
- package/dist/src/shadcn/components/ui/scroll-area.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/select.d.ts +19 -0
- package/dist/src/shadcn/components/ui/select.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/select.js +55 -0
- package/dist/src/shadcn/components/ui/select.js.map +1 -0
- package/dist/src/shadcn/components/ui/select.stories.d.ts +11 -0
- package/dist/src/shadcn/components/ui/select.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/select.stories.js +14 -0
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/separator.d.ts +5 -0
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/separator.js +8 -0
- package/dist/src/shadcn/components/ui/separator.js.map +1 -0
- package/dist/src/shadcn/components/ui/separator.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/separator.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/separator.stories.js +10 -0
- package/dist/src/shadcn/components/ui/separator.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/sheet.d.ts +14 -0
- package/dist/src/shadcn/components/ui/sheet.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sheet.js +40 -0
- package/dist/src/shadcn/components/ui/sheet.js.map +1 -0
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sheet.stories.js +13 -0
- package/dist/src/shadcn/components/ui/sheet.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/sidebar.d.ts +70 -0
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sidebar.js +215 -0
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -0
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts +11 -0
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sidebar.stories.js +178 -0
- package/dist/src/shadcn/components/ui/sidebar.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/skeleton.d.ts +3 -0
- package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/skeleton.js +7 -0
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -0
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/skeleton.stories.js +10 -0
- package/dist/src/shadcn/components/ui/skeleton.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/slider.d.ts +5 -0
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/slider.js +14 -0
- package/dist/src/shadcn/components/ui/slider.js.map +1 -0
- package/dist/src/shadcn/components/ui/slider.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/slider.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/slider.stories.js +10 -0
- package/dist/src/shadcn/components/ui/slider.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/sonner.d.ts +4 -0
- package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sonner.js +13 -0
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -0
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/sonner.stories.js +17 -0
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/switch.d.ts +5 -0
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/switch.js +8 -0
- package/dist/src/shadcn/components/ui/switch.js.map +1 -0
- package/dist/src/shadcn/components/ui/switch.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/switch.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/switch.stories.js +11 -0
- package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/table.d.ts +11 -0
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/table.js +28 -0
- package/dist/src/shadcn/components/ui/table.js.map +1 -0
- package/dist/src/shadcn/components/ui/table.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/table.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/table.stories.js +54 -0
- package/dist/src/shadcn/components/ui/table.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/tabs.d.ts +12 -0
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tabs.js +29 -0
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -0
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts +26 -0
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tabs.stories.js +20 -0
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/textarea.d.ts +4 -0
- package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/textarea.js +7 -0
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -0
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/textarea.stories.js +10 -0
- package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/toggle-group.d.ts +8 -0
- package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/toggle-group.js +21 -0
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -0
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/toggle-group.stories.js +11 -0
- package/dist/src/shadcn/components/ui/toggle-group.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/toggle.d.ts +10 -0
- package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/toggle.js +26 -0
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -0
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/toggle.stories.js +11 -0
- package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/tooltip.d.ts +8 -0
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tooltip.js +17 -0
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -0
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts +8 -0
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tooltip.stories.js +11 -0
- package/dist/src/shadcn/components/ui/tooltip.stories.js.map +1 -0
- package/dist/src/shadcn/hooks/use-mobile.d.ts +2 -0
- package/dist/src/shadcn/hooks/use-mobile.d.ts.map +1 -0
- package/dist/src/shadcn/hooks/use-mobile.js +16 -0
- package/dist/src/shadcn/hooks/use-mobile.js.map +1 -0
- package/dist/src/shadcn/lib/utils.d.ts +3 -0
- package/dist/src/shadcn/lib/utils.d.ts.map +1 -0
- package/dist/src/shadcn/lib/utils.js +6 -0
- package/dist/src/shadcn/lib/utils.js.map +1 -0
- package/dist/src/shadcn/shadcn.css +122 -0
- package/dist/src/tokens.css +179 -0
- package/dist/src/typography.css +98 -0
- package/package.json +109 -0
- package/src/components/code-editor/index.tsx +143 -0
- package/src/components/code-editor.stories.tsx +34 -0
- package/src/components/copy-icon.tsx +30 -0
- package/src/components/request-line-editor.stories.tsx +90 -0
- package/src/components/request-line-editor.tsx +103 -0
- package/src/deps.css +3 -0
- package/src/full.css +2 -0
- package/src/global.d.ts +1 -0
- package/src/index.css +98 -0
- package/src/index.stories.tsx +21 -0
- package/src/index.tsx +54 -0
- package/src/shadcn/components/ui/accordion.stories.tsx +69 -0
- package/src/shadcn/components/ui/accordion.tsx +64 -0
- package/src/shadcn/components/ui/alert-dialog.stories.tsx +43 -0
- package/src/shadcn/components/ui/alert-dialog.tsx +154 -0
- package/src/shadcn/components/ui/alert.stories.tsx +46 -0
- package/src/shadcn/components/ui/alert.tsx +66 -0
- package/src/shadcn/components/ui/aspect-ratio.stories.tsx +21 -0
- package/src/shadcn/components/ui/aspect-ratio.tsx +9 -0
- package/src/shadcn/components/ui/avatar.stories.tsx +48 -0
- package/src/shadcn/components/ui/avatar.tsx +51 -0
- package/src/shadcn/components/ui/badge.stories.tsx +47 -0
- package/src/shadcn/components/ui/badge.tsx +46 -0
- package/src/shadcn/components/ui/breadcrumb.stories.tsx +62 -0
- package/src/shadcn/components/ui/breadcrumb.tsx +119 -0
- package/src/shadcn/components/ui/button.stories.tsx +125 -0
- package/src/shadcn/components/ui/button.tsx +92 -0
- package/src/shadcn/components/ui/calendar.stories.tsx +26 -0
- package/src/shadcn/components/ui/calendar.tsx +214 -0
- package/src/shadcn/components/ui/card.stories.tsx +67 -0
- package/src/shadcn/components/ui/card.tsx +92 -0
- package/src/shadcn/components/ui/carousel.stories.tsx +39 -0
- package/src/shadcn/components/ui/carousel.tsx +240 -0
- package/src/shadcn/components/ui/chart.stories.tsx +58 -0
- package/src/shadcn/components/ui/chart.tsx +352 -0
- package/src/shadcn/components/ui/checkbox.stories.tsx +49 -0
- package/src/shadcn/components/ui/checkbox.tsx +30 -0
- package/src/shadcn/components/ui/collapsible.stories.tsx +53 -0
- package/src/shadcn/components/ui/collapsible.tsx +31 -0
- package/src/shadcn/components/ui/command.stories.tsx +69 -0
- package/src/shadcn/components/ui/command.tsx +185 -0
- package/src/shadcn/components/ui/context-menu.stories.tsx +72 -0
- package/src/shadcn/components/ui/context-menu.tsx +248 -0
- package/src/shadcn/components/ui/dialog.stories.tsx +58 -0
- package/src/shadcn/components/ui/dialog.tsx +141 -0
- package/src/shadcn/components/ui/drawer.stories.tsx +119 -0
- package/src/shadcn/components/ui/drawer.tsx +133 -0
- package/src/shadcn/components/ui/dropdown-menu.stories.tsx +82 -0
- package/src/shadcn/components/ui/dropdown-menu.tsx +281 -0
- package/src/shadcn/components/ui/form.stories.tsx +67 -0
- package/src/shadcn/components/ui/form.tsx +165 -0
- package/src/shadcn/components/ui/hover-card.stories.tsx +46 -0
- package/src/shadcn/components/ui/hover-card.tsx +42 -0
- package/src/shadcn/components/ui/input-otp.stories.tsx +32 -0
- package/src/shadcn/components/ui/input-otp.tsx +78 -0
- package/src/shadcn/components/ui/input.stories.tsx +393 -0
- package/src/shadcn/components/ui/input.tsx +173 -0
- package/src/shadcn/components/ui/label.stories.tsx +21 -0
- package/src/shadcn/components/ui/label.tsx +22 -0
- package/src/shadcn/components/ui/menubar.stories.tsx +115 -0
- package/src/shadcn/components/ui/menubar.tsx +272 -0
- package/src/shadcn/components/ui/navigation-menu.stories.tsx +217 -0
- package/src/shadcn/components/ui/navigation-menu.tsx +168 -0
- package/src/shadcn/components/ui/pagination.stories.tsx +47 -0
- package/src/shadcn/components/ui/pagination.tsx +134 -0
- package/src/shadcn/components/ui/popover.stories.tsx +70 -0
- package/src/shadcn/components/ui/popover.tsx +46 -0
- package/src/shadcn/components/ui/progress.stories.tsx +23 -0
- package/src/shadcn/components/ui/progress.tsx +29 -0
- package/src/shadcn/components/ui/radio-group.stories.tsx +29 -0
- package/src/shadcn/components/ui/radio-group.tsx +43 -0
- package/src/shadcn/components/ui/resizable.stories.tsx +44 -0
- package/src/shadcn/components/ui/resizable.tsx +54 -0
- package/src/shadcn/components/ui/scroll-area.stories.tsx +31 -0
- package/src/shadcn/components/ui/scroll-area.tsx +56 -0
- package/src/shadcn/components/ui/select.stories.tsx +61 -0
- package/src/shadcn/components/ui/select.tsx +208 -0
- package/src/shadcn/components/ui/separator.stories.tsx +30 -0
- package/src/shadcn/components/ui/separator.tsx +27 -0
- package/src/shadcn/components/ui/sheet.stories.tsx +55 -0
- package/src/shadcn/components/ui/sheet.tsx +137 -0
- package/src/shadcn/components/ui/sidebar.stories.tsx +384 -0
- package/src/shadcn/components/ui/sidebar.tsx +737 -0
- package/src/shadcn/components/ui/skeleton.stories.tsx +21 -0
- package/src/shadcn/components/ui/skeleton.tsx +13 -0
- package/src/shadcn/components/ui/slider.stories.tsx +15 -0
- package/src/shadcn/components/ui/slider.tsx +62 -0
- package/src/shadcn/components/ui/sonner.stories.tsx +29 -0
- package/src/shadcn/components/ui/sonner.tsx +23 -0
- package/src/shadcn/components/ui/switch.stories.tsx +19 -0
- package/src/shadcn/components/ui/switch.tsx +29 -0
- package/src/shadcn/components/ui/table.stories.tsx +95 -0
- package/src/shadcn/components/ui/table.tsx +114 -0
- package/src/shadcn/components/ui/tabs.stories.tsx +92 -0
- package/src/shadcn/components/ui/tabs.tsx +84 -0
- package/src/shadcn/components/ui/textarea.stories.tsx +13 -0
- package/src/shadcn/components/ui/textarea.tsx +18 -0
- package/src/shadcn/components/ui/toggle-group.stories.tsx +29 -0
- package/src/shadcn/components/ui/toggle-group.tsx +70 -0
- package/src/shadcn/components/ui/toggle.stories.tsx +18 -0
- package/src/shadcn/components/ui/toggle.tsx +45 -0
- package/src/shadcn/components/ui/tooltip.stories.tsx +27 -0
- package/src/shadcn/components/ui/tooltip.tsx +62 -0
- package/src/shadcn/hooks/use-mobile.ts +21 -0
- package/src/shadcn/lib/utils.ts +6 -0
- package/src/shadcn/shadcn.css +122 -0
- package/src/tokens.css +179 -0
- package/src/typography.css +98 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Calendar } from "#shadcn/components/ui/calendar";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Component/Calendar",
|
|
7
|
+
} satisfies Meta;
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
|
|
12
|
+
export const Demo = {
|
|
13
|
+
render: () => {
|
|
14
|
+
const [date, setDate] = React.useState<Date | undefined>(new Date());
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Calendar
|
|
18
|
+
mode="single"
|
|
19
|
+
selected={date}
|
|
20
|
+
onSelect={setDate}
|
|
21
|
+
className="rounded-md border shadow-sm"
|
|
22
|
+
captionLayout="dropdown"
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
} satisfies Story;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChevronDownIcon,
|
|
3
|
+
ChevronLeftIcon,
|
|
4
|
+
ChevronRightIcon,
|
|
5
|
+
} from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import {
|
|
8
|
+
type DayButton,
|
|
9
|
+
DayPicker,
|
|
10
|
+
getDefaultClassNames,
|
|
11
|
+
} from "react-day-picker";
|
|
12
|
+
import { Button, buttonVariants } from "#shadcn/components/ui/button";
|
|
13
|
+
import { cn } from "#shadcn/lib/utils";
|
|
14
|
+
|
|
15
|
+
function Calendar({
|
|
16
|
+
className,
|
|
17
|
+
classNames,
|
|
18
|
+
showOutsideDays = true,
|
|
19
|
+
captionLayout = "label",
|
|
20
|
+
buttonVariant = "ghost",
|
|
21
|
+
formatters,
|
|
22
|
+
components,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
25
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
26
|
+
}) {
|
|
27
|
+
const defaultClassNames = getDefaultClassNames();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<DayPicker
|
|
31
|
+
showOutsideDays={showOutsideDays}
|
|
32
|
+
className={cn(
|
|
33
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
34
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
35
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
captionLayout={captionLayout}
|
|
39
|
+
formatters={{
|
|
40
|
+
formatMonthDropdown: (date) =>
|
|
41
|
+
date.toLocaleString("default", { month: "short" }),
|
|
42
|
+
...formatters,
|
|
43
|
+
}}
|
|
44
|
+
classNames={{
|
|
45
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
46
|
+
months: cn(
|
|
47
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
48
|
+
defaultClassNames.months,
|
|
49
|
+
),
|
|
50
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
51
|
+
nav: cn(
|
|
52
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
53
|
+
defaultClassNames.nav,
|
|
54
|
+
),
|
|
55
|
+
button_previous: cn(
|
|
56
|
+
buttonVariants({ variant: buttonVariant }),
|
|
57
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
58
|
+
defaultClassNames.button_previous,
|
|
59
|
+
),
|
|
60
|
+
button_next: cn(
|
|
61
|
+
buttonVariants({ variant: buttonVariant }),
|
|
62
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
63
|
+
defaultClassNames.button_next,
|
|
64
|
+
),
|
|
65
|
+
month_caption: cn(
|
|
66
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
67
|
+
defaultClassNames.month_caption,
|
|
68
|
+
),
|
|
69
|
+
dropdowns: cn(
|
|
70
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
71
|
+
defaultClassNames.dropdowns,
|
|
72
|
+
),
|
|
73
|
+
dropdown_root: cn(
|
|
74
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
75
|
+
defaultClassNames.dropdown_root,
|
|
76
|
+
),
|
|
77
|
+
dropdown: cn(
|
|
78
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
79
|
+
defaultClassNames.dropdown,
|
|
80
|
+
),
|
|
81
|
+
caption_label: cn(
|
|
82
|
+
"select-none font-medium",
|
|
83
|
+
captionLayout === "label"
|
|
84
|
+
? "text-sm"
|
|
85
|
+
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
86
|
+
defaultClassNames.caption_label,
|
|
87
|
+
),
|
|
88
|
+
table: "w-full border-collapse",
|
|
89
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
90
|
+
weekday: cn(
|
|
91
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
92
|
+
defaultClassNames.weekday,
|
|
93
|
+
),
|
|
94
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
95
|
+
week_number_header: cn(
|
|
96
|
+
"select-none w-(--cell-size)",
|
|
97
|
+
defaultClassNames.week_number_header,
|
|
98
|
+
),
|
|
99
|
+
week_number: cn(
|
|
100
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
101
|
+
defaultClassNames.week_number,
|
|
102
|
+
),
|
|
103
|
+
day: cn(
|
|
104
|
+
"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
105
|
+
defaultClassNames.day,
|
|
106
|
+
),
|
|
107
|
+
range_start: cn(
|
|
108
|
+
"rounded-l-md bg-accent",
|
|
109
|
+
defaultClassNames.range_start,
|
|
110
|
+
),
|
|
111
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
112
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
113
|
+
today: cn(
|
|
114
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
115
|
+
defaultClassNames.today,
|
|
116
|
+
),
|
|
117
|
+
outside: cn(
|
|
118
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
119
|
+
defaultClassNames.outside,
|
|
120
|
+
),
|
|
121
|
+
disabled: cn(
|
|
122
|
+
"text-muted-foreground opacity-50",
|
|
123
|
+
defaultClassNames.disabled,
|
|
124
|
+
),
|
|
125
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
126
|
+
...classNames,
|
|
127
|
+
}}
|
|
128
|
+
components={{
|
|
129
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
130
|
+
return (
|
|
131
|
+
<div
|
|
132
|
+
data-slot="calendar"
|
|
133
|
+
ref={rootRef}
|
|
134
|
+
className={cn(className)}
|
|
135
|
+
{...props}
|
|
136
|
+
/>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
140
|
+
if (orientation === "left") {
|
|
141
|
+
return (
|
|
142
|
+
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (orientation === "right") {
|
|
147
|
+
return (
|
|
148
|
+
<ChevronRightIcon
|
|
149
|
+
className={cn("size-4", className)}
|
|
150
|
+
{...props}
|
|
151
|
+
/>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
DayButton: CalendarDayButton,
|
|
160
|
+
WeekNumber: ({ children, ...props }) => {
|
|
161
|
+
return (
|
|
162
|
+
<td {...props}>
|
|
163
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
164
|
+
{children}
|
|
165
|
+
</div>
|
|
166
|
+
</td>
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
...components,
|
|
170
|
+
}}
|
|
171
|
+
{...props}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function CalendarDayButton({
|
|
177
|
+
className,
|
|
178
|
+
day,
|
|
179
|
+
modifiers,
|
|
180
|
+
...props
|
|
181
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
182
|
+
const defaultClassNames = getDefaultClassNames();
|
|
183
|
+
|
|
184
|
+
const ref = React.useRef<HTMLButtonElement>(null);
|
|
185
|
+
React.useEffect(() => {
|
|
186
|
+
if (modifiers.focused) ref.current?.focus();
|
|
187
|
+
}, [modifiers.focused]);
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<Button
|
|
191
|
+
ref={ref}
|
|
192
|
+
variant="ghost"
|
|
193
|
+
size="small"
|
|
194
|
+
data-day={day.date.toLocaleDateString()}
|
|
195
|
+
data-selected-single={
|
|
196
|
+
modifiers.selected &&
|
|
197
|
+
!modifiers.range_start &&
|
|
198
|
+
!modifiers.range_end &&
|
|
199
|
+
!modifiers.range_middle
|
|
200
|
+
}
|
|
201
|
+
data-range-start={modifiers.range_start}
|
|
202
|
+
data-range-end={modifiers.range_end}
|
|
203
|
+
data-range-middle={modifiers.range_middle}
|
|
204
|
+
className={cn(
|
|
205
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
206
|
+
defaultClassNames.day,
|
|
207
|
+
className,
|
|
208
|
+
)}
|
|
209
|
+
{...props}
|
|
210
|
+
/>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// biome-ignore-all lint/a11y/useValidAnchor: Useless in stories
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Button } from "#shadcn/components/ui/button";
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardAction,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardFooter,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "#shadcn/components/ui/card";
|
|
13
|
+
import { Input } from "#shadcn/components/ui/input";
|
|
14
|
+
import { Label } from "#shadcn/components/ui/label";
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Component/Card",
|
|
18
|
+
} satisfies Meta;
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Demo = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<Card className="w-full max-w-sm">
|
|
26
|
+
<CardHeader>
|
|
27
|
+
<CardTitle>Login to your account</CardTitle>
|
|
28
|
+
<CardDescription>
|
|
29
|
+
Enter your email below to login to your account
|
|
30
|
+
</CardDescription>
|
|
31
|
+
<CardAction>
|
|
32
|
+
<Button variant="link">Sign Up</Button>
|
|
33
|
+
</CardAction>
|
|
34
|
+
</CardHeader>
|
|
35
|
+
<CardContent>
|
|
36
|
+
<form>
|
|
37
|
+
<div className="flex flex-col gap-6">
|
|
38
|
+
<div className="grid gap-2">
|
|
39
|
+
<Label htmlFor="login">Login</Label>
|
|
40
|
+
<Input id="login" type="text" placeholder="user" required />
|
|
41
|
+
</div>
|
|
42
|
+
<div className="grid gap-2">
|
|
43
|
+
<div className="flex items-center">
|
|
44
|
+
<Label htmlFor="password">Password</Label>
|
|
45
|
+
<a
|
|
46
|
+
href="#"
|
|
47
|
+
className="ml-auto inline-block text-sm underline-offset-4 hover:underline"
|
|
48
|
+
>
|
|
49
|
+
Forgot your password?
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
<Input id="password" type="password" required />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</form>
|
|
56
|
+
</CardContent>
|
|
57
|
+
<CardFooter className="flex-col gap-2">
|
|
58
|
+
<Button type="submit" className="w-full">
|
|
59
|
+
Login
|
|
60
|
+
</Button>
|
|
61
|
+
<Button variant="secondary" className="w-full">
|
|
62
|
+
Login with Google
|
|
63
|
+
</Button>
|
|
64
|
+
</CardFooter>
|
|
65
|
+
</Card>
|
|
66
|
+
),
|
|
67
|
+
} satisfies Story;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "#shadcn/lib/utils";
|
|
4
|
+
|
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="card"
|
|
9
|
+
className={cn(
|
|
10
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="card-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="card-title"
|
|
35
|
+
className={cn("leading-none font-semibold", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
data-slot="card-description"
|
|
45
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-slot="card-action"
|
|
55
|
+
className={cn(
|
|
56
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
data-slot="card-content"
|
|
68
|
+
className={cn("px-6", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
data-slot="card-footer"
|
|
78
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
Card,
|
|
86
|
+
CardHeader,
|
|
87
|
+
CardFooter,
|
|
88
|
+
CardTitle,
|
|
89
|
+
CardAction,
|
|
90
|
+
CardDescription,
|
|
91
|
+
CardContent,
|
|
92
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Card, CardContent } from "#shadcn/components/ui/card";
|
|
3
|
+
import {
|
|
4
|
+
Carousel,
|
|
5
|
+
CarouselContent,
|
|
6
|
+
CarouselItem,
|
|
7
|
+
CarouselNext,
|
|
8
|
+
CarouselPrevious,
|
|
9
|
+
} from "#shadcn/components/ui/carousel";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Component/Carousel",
|
|
13
|
+
} satisfies Meta;
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Demo = {
|
|
19
|
+
render: () => (
|
|
20
|
+
<Carousel className="w-full max-w-xs">
|
|
21
|
+
<CarouselContent>
|
|
22
|
+
{Array.from({ length: 5 }).map((_, index) => (
|
|
23
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: taken from shadcn demo
|
|
24
|
+
<CarouselItem key={index}>
|
|
25
|
+
<div className="p-1">
|
|
26
|
+
<Card>
|
|
27
|
+
<CardContent className="flex aspect-square items-center justify-center p-6">
|
|
28
|
+
<span className="text-4xl font-semibold">{index + 1}</span>
|
|
29
|
+
</CardContent>
|
|
30
|
+
</Card>
|
|
31
|
+
</div>
|
|
32
|
+
</CarouselItem>
|
|
33
|
+
))}
|
|
34
|
+
</CarouselContent>
|
|
35
|
+
<CarouselPrevious />
|
|
36
|
+
<CarouselNext />
|
|
37
|
+
</Carousel>
|
|
38
|
+
),
|
|
39
|
+
} satisfies Story;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import useEmblaCarousel, {
|
|
2
|
+
type UseEmblaCarouselType,
|
|
3
|
+
} from "embla-carousel-react";
|
|
4
|
+
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Button } from "#shadcn/components/ui/button";
|
|
7
|
+
import { cn } from "#shadcn/lib/utils";
|
|
8
|
+
|
|
9
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
10
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
11
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
12
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
13
|
+
|
|
14
|
+
type CarouselProps = {
|
|
15
|
+
opts?: CarouselOptions;
|
|
16
|
+
plugins?: CarouselPlugin;
|
|
17
|
+
orientation?: "horizontal" | "vertical";
|
|
18
|
+
setApi?: (api: CarouselApi) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type CarouselContextProps = {
|
|
22
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
23
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
24
|
+
scrollPrev: () => void;
|
|
25
|
+
scrollNext: () => void;
|
|
26
|
+
canScrollPrev: boolean;
|
|
27
|
+
canScrollNext: boolean;
|
|
28
|
+
} & CarouselProps;
|
|
29
|
+
|
|
30
|
+
const CarouselContext = React.createContext<CarouselContextProps | null>(null);
|
|
31
|
+
|
|
32
|
+
function useCarousel() {
|
|
33
|
+
const context = React.useContext(CarouselContext);
|
|
34
|
+
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return context;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function Carousel({
|
|
43
|
+
orientation = "horizontal",
|
|
44
|
+
opts,
|
|
45
|
+
setApi,
|
|
46
|
+
plugins,
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<"div"> & CarouselProps) {
|
|
51
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
52
|
+
{
|
|
53
|
+
...opts,
|
|
54
|
+
axis: orientation === "horizontal" ? "x" : "y",
|
|
55
|
+
},
|
|
56
|
+
plugins,
|
|
57
|
+
);
|
|
58
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
59
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
60
|
+
|
|
61
|
+
const onSelect = React.useCallback((api: CarouselApi) => {
|
|
62
|
+
if (!api) return;
|
|
63
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
64
|
+
setCanScrollNext(api.canScrollNext());
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
const scrollPrev = React.useCallback(() => {
|
|
68
|
+
api?.scrollPrev();
|
|
69
|
+
}, [api]);
|
|
70
|
+
|
|
71
|
+
const scrollNext = React.useCallback(() => {
|
|
72
|
+
api?.scrollNext();
|
|
73
|
+
}, [api]);
|
|
74
|
+
|
|
75
|
+
const handleKeyDown = React.useCallback(
|
|
76
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
77
|
+
if (event.key === "ArrowLeft") {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
scrollPrev();
|
|
80
|
+
} else if (event.key === "ArrowRight") {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
scrollNext();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
[scrollPrev, scrollNext],
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (!api || !setApi) return;
|
|
90
|
+
setApi(api);
|
|
91
|
+
}, [api, setApi]);
|
|
92
|
+
|
|
93
|
+
React.useEffect(() => {
|
|
94
|
+
if (!api) return;
|
|
95
|
+
onSelect(api);
|
|
96
|
+
api.on("reInit", onSelect);
|
|
97
|
+
api.on("select", onSelect);
|
|
98
|
+
|
|
99
|
+
return () => {
|
|
100
|
+
api?.off("select", onSelect);
|
|
101
|
+
};
|
|
102
|
+
}, [api, onSelect]);
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<CarouselContext.Provider
|
|
106
|
+
value={{
|
|
107
|
+
carouselRef,
|
|
108
|
+
api: api,
|
|
109
|
+
opts,
|
|
110
|
+
orientation:
|
|
111
|
+
orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
112
|
+
scrollPrev,
|
|
113
|
+
scrollNext,
|
|
114
|
+
canScrollPrev,
|
|
115
|
+
canScrollNext,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{/* biome-ignore lint: FIXME: unchanged shadcn */}
|
|
119
|
+
<div
|
|
120
|
+
onKeyDownCapture={handleKeyDown}
|
|
121
|
+
className={cn("relative", className)}
|
|
122
|
+
role="region"
|
|
123
|
+
aria-roledescription="carousel"
|
|
124
|
+
data-slot="carousel"
|
|
125
|
+
{...props}
|
|
126
|
+
>
|
|
127
|
+
{children}
|
|
128
|
+
</div>
|
|
129
|
+
</CarouselContext.Provider>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
134
|
+
const { carouselRef, orientation } = useCarousel();
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
ref={carouselRef}
|
|
139
|
+
className="overflow-hidden"
|
|
140
|
+
data-slot="carousel-content"
|
|
141
|
+
>
|
|
142
|
+
<div
|
|
143
|
+
className={cn(
|
|
144
|
+
"flex",
|
|
145
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
146
|
+
className,
|
|
147
|
+
)}
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
|
|
155
|
+
const { orientation } = useCarousel();
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
// biome-ignore lint/a11y/useSemanticElements: FIXME: unchanged shadcn
|
|
159
|
+
<div
|
|
160
|
+
role="group"
|
|
161
|
+
aria-roledescription="slide"
|
|
162
|
+
data-slot="carousel-item"
|
|
163
|
+
className={cn(
|
|
164
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
165
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
166
|
+
className,
|
|
167
|
+
)}
|
|
168
|
+
{...props}
|
|
169
|
+
/>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function CarouselPrevious({
|
|
174
|
+
className,
|
|
175
|
+
variant = "secondary",
|
|
176
|
+
size = "small",
|
|
177
|
+
...props
|
|
178
|
+
}: React.ComponentProps<typeof Button>) {
|
|
179
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<Button
|
|
183
|
+
data-slot="carousel-previous"
|
|
184
|
+
variant={variant}
|
|
185
|
+
size={size}
|
|
186
|
+
className={cn(
|
|
187
|
+
"absolute size-8 rounded-full",
|
|
188
|
+
orientation === "horizontal"
|
|
189
|
+
? "top-1/2 -left-12 -translate-y-1/2"
|
|
190
|
+
: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
191
|
+
className,
|
|
192
|
+
)}
|
|
193
|
+
disabled={!canScrollPrev}
|
|
194
|
+
onClick={scrollPrev}
|
|
195
|
+
{...props}
|
|
196
|
+
>
|
|
197
|
+
<ArrowLeft />
|
|
198
|
+
<span className="sr-only">Previous slide</span>
|
|
199
|
+
</Button>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function CarouselNext({
|
|
204
|
+
className,
|
|
205
|
+
variant = "secondary",
|
|
206
|
+
size = "small",
|
|
207
|
+
...props
|
|
208
|
+
}: React.ComponentProps<typeof Button>) {
|
|
209
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<Button
|
|
213
|
+
data-slot="carousel-next"
|
|
214
|
+
variant={variant}
|
|
215
|
+
size={size}
|
|
216
|
+
className={cn(
|
|
217
|
+
"absolute size-8 rounded-full",
|
|
218
|
+
orientation === "horizontal"
|
|
219
|
+
? "top-1/2 -right-12 -translate-y-1/2"
|
|
220
|
+
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
221
|
+
className,
|
|
222
|
+
)}
|
|
223
|
+
disabled={!canScrollNext}
|
|
224
|
+
onClick={scrollNext}
|
|
225
|
+
{...props}
|
|
226
|
+
>
|
|
227
|
+
<ArrowRight />
|
|
228
|
+
<span className="sr-only">Next slide</span>
|
|
229
|
+
</Button>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
type CarouselApi,
|
|
235
|
+
Carousel,
|
|
236
|
+
CarouselContent,
|
|
237
|
+
CarouselItem,
|
|
238
|
+
CarouselPrevious,
|
|
239
|
+
CarouselNext,
|
|
240
|
+
};
|