@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,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
|
|
3
|
+
import {
|
|
4
|
+
type ChartConfig,
|
|
5
|
+
ChartContainer,
|
|
6
|
+
ChartLegend,
|
|
7
|
+
ChartLegendContent,
|
|
8
|
+
ChartTooltip,
|
|
9
|
+
ChartTooltipContent,
|
|
10
|
+
} from "#shadcn/components/ui/chart";
|
|
11
|
+
|
|
12
|
+
const chartData = [
|
|
13
|
+
{ month: "January", desktop: 186, mobile: 80 },
|
|
14
|
+
{ month: "February", desktop: 305, mobile: 200 },
|
|
15
|
+
{ month: "March", desktop: 237, mobile: 120 },
|
|
16
|
+
{ month: "April", desktop: 73, mobile: 190 },
|
|
17
|
+
{ month: "May", desktop: 209, mobile: 130 },
|
|
18
|
+
{ month: "June", desktop: 214, mobile: 140 },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const chartConfig = {
|
|
22
|
+
desktop: {
|
|
23
|
+
label: "Desktop",
|
|
24
|
+
color: "#2563eb",
|
|
25
|
+
},
|
|
26
|
+
mobile: {
|
|
27
|
+
label: "Mobile",
|
|
28
|
+
color: "#60a5fa",
|
|
29
|
+
},
|
|
30
|
+
} satisfies ChartConfig;
|
|
31
|
+
|
|
32
|
+
const meta = {
|
|
33
|
+
title: "Component/Chart",
|
|
34
|
+
} satisfies Meta;
|
|
35
|
+
export default meta;
|
|
36
|
+
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
38
|
+
|
|
39
|
+
export const Demo = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<ChartContainer config={chartConfig} className="min-h-[200px] w-full">
|
|
42
|
+
<BarChart accessibilityLayer data={chartData}>
|
|
43
|
+
<CartesianGrid vertical={false} />
|
|
44
|
+
<XAxis
|
|
45
|
+
dataKey="month"
|
|
46
|
+
tickLine={false}
|
|
47
|
+
tickMargin={10}
|
|
48
|
+
axisLine={false}
|
|
49
|
+
tickFormatter={(value) => value.slice(0, 3)}
|
|
50
|
+
/>
|
|
51
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
52
|
+
<ChartLegend content={<ChartLegendContent />} />
|
|
53
|
+
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
|
|
54
|
+
<Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
|
|
55
|
+
</BarChart>
|
|
56
|
+
</ChartContainer>
|
|
57
|
+
),
|
|
58
|
+
} satisfies Story;
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
|
|
4
|
+
import { cn } from "#shadcn/lib/utils";
|
|
5
|
+
|
|
6
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
+
const THEMES = { light: "", dark: ".dark" } as const;
|
|
8
|
+
|
|
9
|
+
export type ChartConfig = {
|
|
10
|
+
[k in string]: {
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
icon?: React.ComponentType;
|
|
13
|
+
} & (
|
|
14
|
+
| { color?: string; theme?: never }
|
|
15
|
+
| { color?: never; theme: Record<keyof typeof THEMES, string> }
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type ChartContextProps = {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const ChartContext = React.createContext<ChartContextProps | null>(null);
|
|
24
|
+
|
|
25
|
+
function useChart() {
|
|
26
|
+
const context = React.useContext(ChartContext);
|
|
27
|
+
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function ChartContainer({
|
|
36
|
+
id,
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
config,
|
|
40
|
+
...props
|
|
41
|
+
}: React.ComponentProps<"div"> & {
|
|
42
|
+
config: ChartConfig;
|
|
43
|
+
children: React.ComponentProps<
|
|
44
|
+
typeof RechartsPrimitive.ResponsiveContainer
|
|
45
|
+
>["children"];
|
|
46
|
+
}) {
|
|
47
|
+
const uniqueId = React.useId();
|
|
48
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<ChartContext.Provider value={{ config }}>
|
|
52
|
+
<div
|
|
53
|
+
data-slot="chart"
|
|
54
|
+
data-chart={chartId}
|
|
55
|
+
className={cn(
|
|
56
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
<ChartStyle id={chartId} config={config} />
|
|
62
|
+
<RechartsPrimitive.ResponsiveContainer>
|
|
63
|
+
{children}
|
|
64
|
+
</RechartsPrimitive.ResponsiveContainer>
|
|
65
|
+
</div>
|
|
66
|
+
</ChartContext.Provider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
71
|
+
const colorConfig = Object.entries(config).filter(
|
|
72
|
+
([, config]) => config.theme || config.color,
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
if (!colorConfig.length) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<style
|
|
81
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: FIXME: unchanged shadcn
|
|
82
|
+
dangerouslySetInnerHTML={{
|
|
83
|
+
__html: Object.entries(THEMES)
|
|
84
|
+
.map(
|
|
85
|
+
([theme, prefix]) => `
|
|
86
|
+
${prefix} [data-chart=${id}] {
|
|
87
|
+
${colorConfig
|
|
88
|
+
.map(([key, itemConfig]) => {
|
|
89
|
+
const color =
|
|
90
|
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
91
|
+
itemConfig.color;
|
|
92
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
93
|
+
})
|
|
94
|
+
.join("\n")}
|
|
95
|
+
}
|
|
96
|
+
`,
|
|
97
|
+
)
|
|
98
|
+
.join("\n"),
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
105
|
+
|
|
106
|
+
function ChartTooltipContent({
|
|
107
|
+
active,
|
|
108
|
+
payload,
|
|
109
|
+
className,
|
|
110
|
+
indicator = "dot",
|
|
111
|
+
hideLabel = false,
|
|
112
|
+
hideIndicator = false,
|
|
113
|
+
label,
|
|
114
|
+
labelFormatter,
|
|
115
|
+
labelClassName,
|
|
116
|
+
formatter,
|
|
117
|
+
color,
|
|
118
|
+
nameKey,
|
|
119
|
+
labelKey,
|
|
120
|
+
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
|
121
|
+
React.ComponentProps<"div"> & {
|
|
122
|
+
hideLabel?: boolean;
|
|
123
|
+
hideIndicator?: boolean;
|
|
124
|
+
indicator?: "line" | "dot" | "dashed";
|
|
125
|
+
nameKey?: string;
|
|
126
|
+
labelKey?: string;
|
|
127
|
+
}) {
|
|
128
|
+
const { config } = useChart();
|
|
129
|
+
|
|
130
|
+
const tooltipLabel = React.useMemo(() => {
|
|
131
|
+
if (hideLabel || !payload?.length) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const [item] = payload;
|
|
136
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
137
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
138
|
+
const value =
|
|
139
|
+
!labelKey && typeof label === "string"
|
|
140
|
+
? config[label as keyof typeof config]?.label || label
|
|
141
|
+
: itemConfig?.label;
|
|
142
|
+
|
|
143
|
+
if (labelFormatter) {
|
|
144
|
+
return (
|
|
145
|
+
<div className={cn("font-medium", labelClassName)}>
|
|
146
|
+
{labelFormatter(value, payload)}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!value) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return <div className={cn("font-medium", labelClassName)}>{value}</div>;
|
|
156
|
+
}, [
|
|
157
|
+
label,
|
|
158
|
+
labelFormatter,
|
|
159
|
+
payload,
|
|
160
|
+
hideLabel,
|
|
161
|
+
labelClassName,
|
|
162
|
+
config,
|
|
163
|
+
labelKey,
|
|
164
|
+
]);
|
|
165
|
+
|
|
166
|
+
if (!active || !payload?.length) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<div
|
|
174
|
+
className={cn(
|
|
175
|
+
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
176
|
+
className,
|
|
177
|
+
)}
|
|
178
|
+
>
|
|
179
|
+
{!nestLabel ? tooltipLabel : null}
|
|
180
|
+
<div className="grid gap-1.5">
|
|
181
|
+
{payload.map((item, index) => {
|
|
182
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
183
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
184
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<div
|
|
188
|
+
key={item.dataKey}
|
|
189
|
+
className={cn(
|
|
190
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
191
|
+
indicator === "dot" && "items-center",
|
|
192
|
+
)}
|
|
193
|
+
>
|
|
194
|
+
{formatter && item?.value !== undefined && item.name ? (
|
|
195
|
+
formatter(item.value, item.name, item, index, item.payload)
|
|
196
|
+
) : (
|
|
197
|
+
<>
|
|
198
|
+
{itemConfig?.icon ? (
|
|
199
|
+
<itemConfig.icon />
|
|
200
|
+
) : (
|
|
201
|
+
!hideIndicator && (
|
|
202
|
+
<div
|
|
203
|
+
className={cn(
|
|
204
|
+
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
|
|
205
|
+
{
|
|
206
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
207
|
+
"w-1": indicator === "line",
|
|
208
|
+
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
209
|
+
indicator === "dashed",
|
|
210
|
+
"my-0.5": nestLabel && indicator === "dashed",
|
|
211
|
+
},
|
|
212
|
+
)}
|
|
213
|
+
style={
|
|
214
|
+
{
|
|
215
|
+
"--color-bg": indicatorColor,
|
|
216
|
+
"--color-border": indicatorColor,
|
|
217
|
+
} as React.CSSProperties
|
|
218
|
+
}
|
|
219
|
+
/>
|
|
220
|
+
)
|
|
221
|
+
)}
|
|
222
|
+
<div
|
|
223
|
+
className={cn(
|
|
224
|
+
"flex flex-1 justify-between leading-none",
|
|
225
|
+
nestLabel ? "items-end" : "items-center",
|
|
226
|
+
)}
|
|
227
|
+
>
|
|
228
|
+
<div className="grid gap-1.5">
|
|
229
|
+
{nestLabel ? tooltipLabel : null}
|
|
230
|
+
<span className="text-muted-foreground">
|
|
231
|
+
{itemConfig?.label || item.name}
|
|
232
|
+
</span>
|
|
233
|
+
</div>
|
|
234
|
+
{item.value && (
|
|
235
|
+
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
236
|
+
{item.value.toLocaleString()}
|
|
237
|
+
</span>
|
|
238
|
+
)}
|
|
239
|
+
</div>
|
|
240
|
+
</>
|
|
241
|
+
)}
|
|
242
|
+
</div>
|
|
243
|
+
);
|
|
244
|
+
})}
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
251
|
+
|
|
252
|
+
function ChartLegendContent({
|
|
253
|
+
className,
|
|
254
|
+
hideIcon = false,
|
|
255
|
+
payload,
|
|
256
|
+
verticalAlign = "bottom",
|
|
257
|
+
nameKey,
|
|
258
|
+
}: React.ComponentProps<"div"> &
|
|
259
|
+
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
260
|
+
hideIcon?: boolean;
|
|
261
|
+
nameKey?: string;
|
|
262
|
+
}) {
|
|
263
|
+
const { config } = useChart();
|
|
264
|
+
|
|
265
|
+
if (!payload?.length) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return (
|
|
270
|
+
<div
|
|
271
|
+
className={cn(
|
|
272
|
+
"flex items-center justify-center gap-4",
|
|
273
|
+
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
274
|
+
className,
|
|
275
|
+
)}
|
|
276
|
+
>
|
|
277
|
+
{payload.map((item) => {
|
|
278
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
279
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
280
|
+
|
|
281
|
+
return (
|
|
282
|
+
<div
|
|
283
|
+
key={item.value}
|
|
284
|
+
className={cn(
|
|
285
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3",
|
|
286
|
+
)}
|
|
287
|
+
>
|
|
288
|
+
{itemConfig?.icon && !hideIcon ? (
|
|
289
|
+
<itemConfig.icon />
|
|
290
|
+
) : (
|
|
291
|
+
<div
|
|
292
|
+
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
293
|
+
style={{
|
|
294
|
+
backgroundColor: item.color,
|
|
295
|
+
}}
|
|
296
|
+
/>
|
|
297
|
+
)}
|
|
298
|
+
{itemConfig?.label}
|
|
299
|
+
</div>
|
|
300
|
+
);
|
|
301
|
+
})}
|
|
302
|
+
</div>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Helper to extract item config from a payload.
|
|
307
|
+
function getPayloadConfigFromPayload(
|
|
308
|
+
config: ChartConfig,
|
|
309
|
+
payload: unknown,
|
|
310
|
+
key: string,
|
|
311
|
+
) {
|
|
312
|
+
if (typeof payload !== "object" || payload === null) {
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const payloadPayload =
|
|
317
|
+
"payload" in payload &&
|
|
318
|
+
typeof payload.payload === "object" &&
|
|
319
|
+
payload.payload !== null
|
|
320
|
+
? payload.payload
|
|
321
|
+
: undefined;
|
|
322
|
+
|
|
323
|
+
let configLabelKey: string = key;
|
|
324
|
+
|
|
325
|
+
if (
|
|
326
|
+
key in payload &&
|
|
327
|
+
typeof payload[key as keyof typeof payload] === "string"
|
|
328
|
+
) {
|
|
329
|
+
configLabelKey = payload[key as keyof typeof payload] as string;
|
|
330
|
+
} else if (
|
|
331
|
+
payloadPayload &&
|
|
332
|
+
key in payloadPayload &&
|
|
333
|
+
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
|
|
334
|
+
) {
|
|
335
|
+
configLabelKey = payloadPayload[
|
|
336
|
+
key as keyof typeof payloadPayload
|
|
337
|
+
] as string;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return configLabelKey in config
|
|
341
|
+
? config[configLabelKey]
|
|
342
|
+
: config[key as keyof typeof config];
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export {
|
|
346
|
+
ChartContainer,
|
|
347
|
+
ChartTooltip,
|
|
348
|
+
ChartTooltipContent,
|
|
349
|
+
ChartLegend,
|
|
350
|
+
ChartLegendContent,
|
|
351
|
+
ChartStyle,
|
|
352
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Checkbox } from "#shadcn/components/ui/checkbox";
|
|
3
|
+
import { Label } from "#shadcn/components/ui/label";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Component/Checkbox",
|
|
7
|
+
} satisfies Meta;
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
|
|
12
|
+
export const Demo = {
|
|
13
|
+
render: () => (
|
|
14
|
+
<div className="flex flex-col gap-6">
|
|
15
|
+
<div className="flex items-center gap-3">
|
|
16
|
+
<Checkbox id="terms" />
|
|
17
|
+
<Label htmlFor="terms">Accept terms and conditions</Label>
|
|
18
|
+
</div>
|
|
19
|
+
<div className="flex items-start gap-3">
|
|
20
|
+
<Checkbox id="terms-2" defaultChecked />
|
|
21
|
+
<div className="grid gap-2">
|
|
22
|
+
<Label htmlFor="terms-2">Accept terms and conditions</Label>
|
|
23
|
+
<p className="text-muted-foreground text-sm">
|
|
24
|
+
By clicking this checkbox, you agree to the terms and conditions.
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div className="flex items-start gap-3">
|
|
29
|
+
<Checkbox id="toggle" disabled />
|
|
30
|
+
<Label htmlFor="toggle">Enable notifications</Label>
|
|
31
|
+
</div>
|
|
32
|
+
<Label className="hover:bg-accent/50 flex items-start gap-3 rounded-lg border p-3 has-[[aria-checked=true]]:border-blue-600 has-[[aria-checked=true]]:bg-blue-50 dark:has-[[aria-checked=true]]:border-blue-900 dark:has-[[aria-checked=true]]:bg-blue-950">
|
|
33
|
+
<Checkbox
|
|
34
|
+
id="toggle-2"
|
|
35
|
+
defaultChecked
|
|
36
|
+
className="data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 data-[state=checked]:text-white dark:data-[state=checked]:border-blue-700 dark:data-[state=checked]:bg-blue-700"
|
|
37
|
+
/>
|
|
38
|
+
<div className="grid gap-1.5 font-normal">
|
|
39
|
+
<p className="text-sm leading-none font-medium">
|
|
40
|
+
Enable notifications
|
|
41
|
+
</p>
|
|
42
|
+
<p className="text-muted-foreground text-sm">
|
|
43
|
+
You can enable or disable notifications at any time.
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
</Label>
|
|
47
|
+
</div>
|
|
48
|
+
),
|
|
49
|
+
} satisfies Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import { CheckIcon } from "lucide-react";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "#shadcn/lib/utils";
|
|
6
|
+
|
|
7
|
+
function Checkbox({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
11
|
+
return (
|
|
12
|
+
<CheckboxPrimitive.Root
|
|
13
|
+
data-slot="checkbox"
|
|
14
|
+
className={cn(
|
|
15
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator
|
|
21
|
+
data-slot="checkbox-indicator"
|
|
22
|
+
className="flex items-center justify-center text-current transition-none"
|
|
23
|
+
>
|
|
24
|
+
<CheckIcon className="size-3.5" />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
26
|
+
</CheckboxPrimitive.Root>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Checkbox };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "#shadcn/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Collapsible,
|
|
7
|
+
CollapsibleContent,
|
|
8
|
+
CollapsibleTrigger,
|
|
9
|
+
} from "#shadcn/components/ui/collapsible";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Component/Collapsible",
|
|
13
|
+
} satisfies Meta;
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Demo = {
|
|
19
|
+
render: () => {
|
|
20
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Collapsible
|
|
24
|
+
open={isOpen}
|
|
25
|
+
onOpenChange={setIsOpen}
|
|
26
|
+
className="flex w-[350px] flex-col gap-2"
|
|
27
|
+
>
|
|
28
|
+
<div className="flex items-center justify-between gap-4 px-4">
|
|
29
|
+
<h4 className="text-sm font-semibold">
|
|
30
|
+
@peduarte starred 3 repositories
|
|
31
|
+
</h4>
|
|
32
|
+
<CollapsibleTrigger asChild>
|
|
33
|
+
<Button variant="ghost" size="small" className="size-8">
|
|
34
|
+
<ChevronsUpDown />
|
|
35
|
+
<span className="sr-only">Toggle</span>
|
|
36
|
+
</Button>
|
|
37
|
+
</CollapsibleTrigger>
|
|
38
|
+
</div>
|
|
39
|
+
<div className="rounded-md border px-4 py-2 font-mono text-sm">
|
|
40
|
+
@radix-ui/primitives
|
|
41
|
+
</div>
|
|
42
|
+
<CollapsibleContent className="flex flex-col gap-2">
|
|
43
|
+
<div className="rounded-md border px-4 py-2 font-mono text-sm">
|
|
44
|
+
@radix-ui/colors
|
|
45
|
+
</div>
|
|
46
|
+
<div className="rounded-md border px-4 py-2 font-mono text-sm">
|
|
47
|
+
@stitches/react
|
|
48
|
+
</div>
|
|
49
|
+
</CollapsibleContent>
|
|
50
|
+
</Collapsible>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
} satisfies Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
|
|
3
|
+
function Collapsible({
|
|
4
|
+
...props
|
|
5
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
6
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function CollapsibleTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
12
|
+
return (
|
|
13
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
14
|
+
data-slot="collapsible-trigger"
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function CollapsibleContent({
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
23
|
+
return (
|
|
24
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
25
|
+
data-slot="collapsible-content"
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import {
|
|
3
|
+
Calculator,
|
|
4
|
+
Calendar,
|
|
5
|
+
CreditCard,
|
|
6
|
+
Settings,
|
|
7
|
+
Smile,
|
|
8
|
+
User,
|
|
9
|
+
} from "lucide-react";
|
|
10
|
+
import {
|
|
11
|
+
Command,
|
|
12
|
+
CommandEmpty,
|
|
13
|
+
CommandGroup,
|
|
14
|
+
CommandInput,
|
|
15
|
+
CommandItem,
|
|
16
|
+
CommandList,
|
|
17
|
+
CommandSeparator,
|
|
18
|
+
CommandShortcut,
|
|
19
|
+
} from "#shadcn/components/ui/command";
|
|
20
|
+
|
|
21
|
+
const meta = {
|
|
22
|
+
title: "Component/Command",
|
|
23
|
+
} satisfies Meta;
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Demo = {
|
|
29
|
+
render: () => (
|
|
30
|
+
<Command className="rounded-lg border shadow-md md:min-w-[450px]">
|
|
31
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
32
|
+
<CommandList>
|
|
33
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
34
|
+
<CommandGroup heading="Suggestions">
|
|
35
|
+
<CommandItem>
|
|
36
|
+
<Calendar />
|
|
37
|
+
<span>Calendar</span>
|
|
38
|
+
</CommandItem>
|
|
39
|
+
<CommandItem>
|
|
40
|
+
<Smile />
|
|
41
|
+
<span>Search Emoji</span>
|
|
42
|
+
</CommandItem>
|
|
43
|
+
<CommandItem disabled>
|
|
44
|
+
<Calculator />
|
|
45
|
+
<span>Calculator</span>
|
|
46
|
+
</CommandItem>
|
|
47
|
+
</CommandGroup>
|
|
48
|
+
<CommandSeparator />
|
|
49
|
+
<CommandGroup heading="Settings">
|
|
50
|
+
<CommandItem>
|
|
51
|
+
<User />
|
|
52
|
+
<span>Profile</span>
|
|
53
|
+
<CommandShortcut>⌘P</CommandShortcut>
|
|
54
|
+
</CommandItem>
|
|
55
|
+
<CommandItem>
|
|
56
|
+
<CreditCard />
|
|
57
|
+
<span>Billing</span>
|
|
58
|
+
<CommandShortcut>⌘B</CommandShortcut>
|
|
59
|
+
</CommandItem>
|
|
60
|
+
<CommandItem>
|
|
61
|
+
<Settings />
|
|
62
|
+
<span>Settings</span>
|
|
63
|
+
<CommandShortcut>⌘S</CommandShortcut>
|
|
64
|
+
</CommandItem>
|
|
65
|
+
</CommandGroup>
|
|
66
|
+
</CommandList>
|
|
67
|
+
</Command>
|
|
68
|
+
),
|
|
69
|
+
} satisfies Story;
|