@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,185 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
2
|
+
import { SearchIcon } from "lucide-react";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
} from "#shadcn/components/ui/dialog";
|
|
11
|
+
import { cn } from "#shadcn/lib/utils";
|
|
12
|
+
|
|
13
|
+
function Command({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
17
|
+
return (
|
|
18
|
+
<CommandPrimitive
|
|
19
|
+
data-slot="command"
|
|
20
|
+
className={cn(
|
|
21
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
22
|
+
className,
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function CommandDialog({
|
|
30
|
+
title = "Command Palette",
|
|
31
|
+
description = "Search for a command to run...",
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
showCloseButton = true,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
showCloseButton?: boolean;
|
|
41
|
+
}) {
|
|
42
|
+
return (
|
|
43
|
+
<Dialog {...props}>
|
|
44
|
+
<DialogHeader className="sr-only">
|
|
45
|
+
<DialogTitle>{title}</DialogTitle>
|
|
46
|
+
<DialogDescription>{description}</DialogDescription>
|
|
47
|
+
</DialogHeader>
|
|
48
|
+
<DialogContent
|
|
49
|
+
className={cn("overflow-hidden p-0", className)}
|
|
50
|
+
showCloseButton={showCloseButton}
|
|
51
|
+
>
|
|
52
|
+
<Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
53
|
+
{children}
|
|
54
|
+
</Command>
|
|
55
|
+
</DialogContent>
|
|
56
|
+
</Dialog>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function CommandInput({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
data-slot="command-input-wrapper"
|
|
67
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
68
|
+
>
|
|
69
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
70
|
+
<CommandPrimitive.Input
|
|
71
|
+
data-slot="command-input"
|
|
72
|
+
className={cn(
|
|
73
|
+
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
74
|
+
className,
|
|
75
|
+
)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function CommandList({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
86
|
+
return (
|
|
87
|
+
<CommandPrimitive.List
|
|
88
|
+
data-slot="command-list"
|
|
89
|
+
className={cn(
|
|
90
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function CommandEmpty({
|
|
99
|
+
...props
|
|
100
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
101
|
+
return (
|
|
102
|
+
<CommandPrimitive.Empty
|
|
103
|
+
data-slot="command-empty"
|
|
104
|
+
className="py-6 text-center text-sm"
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function CommandGroup({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
114
|
+
return (
|
|
115
|
+
<CommandPrimitive.Group
|
|
116
|
+
data-slot="command-group"
|
|
117
|
+
className={cn(
|
|
118
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
119
|
+
className,
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function CommandSeparator({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
130
|
+
return (
|
|
131
|
+
<CommandPrimitive.Separator
|
|
132
|
+
data-slot="command-separator"
|
|
133
|
+
className={cn("bg-border -mx-1 h-px", className)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function CommandItem({
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
143
|
+
return (
|
|
144
|
+
<CommandPrimitive.Item
|
|
145
|
+
data-slot="command-item"
|
|
146
|
+
className={cn(
|
|
147
|
+
"data-[selected=true]:bg-(--color-surface-1) text-(--color-elements-assistive)",
|
|
148
|
+
"data-[selected=true]:text-(--color-elements-readable) [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
149
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none",
|
|
150
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none",
|
|
151
|
+
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
152
|
+
className,
|
|
153
|
+
)}
|
|
154
|
+
{...props}
|
|
155
|
+
/>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function CommandShortcut({
|
|
160
|
+
className,
|
|
161
|
+
...props
|
|
162
|
+
}: React.ComponentProps<"span">) {
|
|
163
|
+
return (
|
|
164
|
+
<span
|
|
165
|
+
data-slot="command-shortcut"
|
|
166
|
+
className={cn(
|
|
167
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
168
|
+
className,
|
|
169
|
+
)}
|
|
170
|
+
{...props}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export {
|
|
176
|
+
Command,
|
|
177
|
+
CommandDialog,
|
|
178
|
+
CommandInput,
|
|
179
|
+
CommandList,
|
|
180
|
+
CommandEmpty,
|
|
181
|
+
CommandGroup,
|
|
182
|
+
CommandItem,
|
|
183
|
+
CommandShortcut,
|
|
184
|
+
CommandSeparator,
|
|
185
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import {
|
|
3
|
+
ContextMenu,
|
|
4
|
+
ContextMenuCheckboxItem,
|
|
5
|
+
ContextMenuContent,
|
|
6
|
+
ContextMenuItem,
|
|
7
|
+
ContextMenuLabel,
|
|
8
|
+
ContextMenuRadioGroup,
|
|
9
|
+
ContextMenuRadioItem,
|
|
10
|
+
ContextMenuSeparator,
|
|
11
|
+
ContextMenuShortcut,
|
|
12
|
+
ContextMenuSub,
|
|
13
|
+
ContextMenuSubContent,
|
|
14
|
+
ContextMenuSubTrigger,
|
|
15
|
+
ContextMenuTrigger,
|
|
16
|
+
} from "#shadcn/components/ui/context-menu";
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
19
|
+
title: "Component/Context menu",
|
|
20
|
+
} satisfies Meta;
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Demo = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<ContextMenu>
|
|
28
|
+
<ContextMenuTrigger className="flex h-[150px] w-[300px] items-center justify-center rounded-md border border-dashed text-sm">
|
|
29
|
+
Right click here
|
|
30
|
+
</ContextMenuTrigger>
|
|
31
|
+
<ContextMenuContent className="w-52">
|
|
32
|
+
<ContextMenuItem inset>
|
|
33
|
+
Back
|
|
34
|
+
<ContextMenuShortcut>⌘[</ContextMenuShortcut>
|
|
35
|
+
</ContextMenuItem>
|
|
36
|
+
<ContextMenuItem inset disabled>
|
|
37
|
+
Forward
|
|
38
|
+
<ContextMenuShortcut>⌘]</ContextMenuShortcut>
|
|
39
|
+
</ContextMenuItem>
|
|
40
|
+
<ContextMenuItem inset>
|
|
41
|
+
Reload
|
|
42
|
+
<ContextMenuShortcut>⌘R</ContextMenuShortcut>
|
|
43
|
+
</ContextMenuItem>
|
|
44
|
+
<ContextMenuSub>
|
|
45
|
+
<ContextMenuSubTrigger inset>More Tools</ContextMenuSubTrigger>
|
|
46
|
+
<ContextMenuSubContent className="w-44">
|
|
47
|
+
<ContextMenuItem>Save Page...</ContextMenuItem>
|
|
48
|
+
<ContextMenuItem>Create Shortcut...</ContextMenuItem>
|
|
49
|
+
<ContextMenuItem>Name Window...</ContextMenuItem>
|
|
50
|
+
<ContextMenuSeparator />
|
|
51
|
+
<ContextMenuItem>Developer Tools</ContextMenuItem>
|
|
52
|
+
<ContextMenuSeparator />
|
|
53
|
+
<ContextMenuItem variant="destructive">Delete</ContextMenuItem>
|
|
54
|
+
</ContextMenuSubContent>
|
|
55
|
+
</ContextMenuSub>
|
|
56
|
+
<ContextMenuSeparator />
|
|
57
|
+
<ContextMenuCheckboxItem checked>
|
|
58
|
+
Show Bookmarks
|
|
59
|
+
</ContextMenuCheckboxItem>
|
|
60
|
+
<ContextMenuCheckboxItem>Show Full URLs</ContextMenuCheckboxItem>
|
|
61
|
+
<ContextMenuSeparator />
|
|
62
|
+
<ContextMenuRadioGroup value="pedro">
|
|
63
|
+
<ContextMenuLabel inset>People</ContextMenuLabel>
|
|
64
|
+
<ContextMenuRadioItem value="pedro">
|
|
65
|
+
Pedro Duarte
|
|
66
|
+
</ContextMenuRadioItem>
|
|
67
|
+
<ContextMenuRadioItem value="colm">Colm Tuite</ContextMenuRadioItem>
|
|
68
|
+
</ContextMenuRadioGroup>
|
|
69
|
+
</ContextMenuContent>
|
|
70
|
+
</ContextMenu>
|
|
71
|
+
),
|
|
72
|
+
} satisfies Story;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
2
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "#shadcn/lib/utils";
|
|
6
|
+
|
|
7
|
+
function ContextMenu({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
10
|
+
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function ContextMenuTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
16
|
+
return (
|
|
17
|
+
<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function ContextMenuGroup({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
24
|
+
return (
|
|
25
|
+
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function ContextMenuPortal({
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
32
|
+
return (
|
|
33
|
+
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function ContextMenuSub({
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
40
|
+
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function ContextMenuRadioGroup({
|
|
44
|
+
...props
|
|
45
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
46
|
+
return (
|
|
47
|
+
<ContextMenuPrimitive.RadioGroup
|
|
48
|
+
data-slot="context-menu-radio-group"
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ContextMenuSubTrigger({
|
|
55
|
+
className,
|
|
56
|
+
inset,
|
|
57
|
+
children,
|
|
58
|
+
...props
|
|
59
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
60
|
+
inset?: boolean;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<ContextMenuPrimitive.SubTrigger
|
|
64
|
+
data-slot="context-menu-sub-trigger"
|
|
65
|
+
data-inset={inset}
|
|
66
|
+
className={cn(
|
|
67
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
68
|
+
className,
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
<ChevronRightIcon className="ml-auto" />
|
|
74
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function ContextMenuSubContent({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
82
|
+
return (
|
|
83
|
+
<ContextMenuPrimitive.SubContent
|
|
84
|
+
data-slot="context-menu-sub-content"
|
|
85
|
+
className={cn(
|
|
86
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function ContextMenuContent({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
98
|
+
return (
|
|
99
|
+
<ContextMenuPrimitive.Portal>
|
|
100
|
+
<ContextMenuPrimitive.Content
|
|
101
|
+
data-slot="context-menu-content"
|
|
102
|
+
className={cn(
|
|
103
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
104
|
+
className,
|
|
105
|
+
)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
</ContextMenuPrimitive.Portal>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function ContextMenuItem({
|
|
113
|
+
className,
|
|
114
|
+
inset,
|
|
115
|
+
variant = "default",
|
|
116
|
+
...props
|
|
117
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
118
|
+
inset?: boolean;
|
|
119
|
+
variant?: "default" | "destructive";
|
|
120
|
+
}) {
|
|
121
|
+
return (
|
|
122
|
+
<ContextMenuPrimitive.Item
|
|
123
|
+
data-slot="context-menu-item"
|
|
124
|
+
data-inset={inset}
|
|
125
|
+
data-variant={variant}
|
|
126
|
+
className={cn(
|
|
127
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
128
|
+
className,
|
|
129
|
+
)}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function ContextMenuCheckboxItem({
|
|
136
|
+
className,
|
|
137
|
+
children,
|
|
138
|
+
...props
|
|
139
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
140
|
+
return (
|
|
141
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
142
|
+
data-slot="context-menu-checkbox-item"
|
|
143
|
+
className={cn(
|
|
144
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
145
|
+
className,
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
>
|
|
149
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
150
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
151
|
+
<CheckIcon className="size-4" />
|
|
152
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
153
|
+
</span>
|
|
154
|
+
{children}
|
|
155
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function ContextMenuRadioItem({
|
|
160
|
+
className,
|
|
161
|
+
children,
|
|
162
|
+
...props
|
|
163
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
164
|
+
return (
|
|
165
|
+
<ContextMenuPrimitive.RadioItem
|
|
166
|
+
data-slot="context-menu-radio-item"
|
|
167
|
+
className={cn(
|
|
168
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
+
className,
|
|
170
|
+
)}
|
|
171
|
+
{...props}
|
|
172
|
+
>
|
|
173
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
174
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
175
|
+
<CircleIcon className="size-2 fill-current" />
|
|
176
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
177
|
+
</span>
|
|
178
|
+
{children}
|
|
179
|
+
</ContextMenuPrimitive.RadioItem>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function ContextMenuLabel({
|
|
184
|
+
className,
|
|
185
|
+
inset,
|
|
186
|
+
...props
|
|
187
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
188
|
+
inset?: boolean;
|
|
189
|
+
}) {
|
|
190
|
+
return (
|
|
191
|
+
<ContextMenuPrimitive.Label
|
|
192
|
+
data-slot="context-menu-label"
|
|
193
|
+
data-inset={inset}
|
|
194
|
+
className={cn(
|
|
195
|
+
"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
196
|
+
className,
|
|
197
|
+
)}
|
|
198
|
+
{...props}
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function ContextMenuSeparator({
|
|
204
|
+
className,
|
|
205
|
+
...props
|
|
206
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
207
|
+
return (
|
|
208
|
+
<ContextMenuPrimitive.Separator
|
|
209
|
+
data-slot="context-menu-separator"
|
|
210
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
211
|
+
{...props}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function ContextMenuShortcut({
|
|
217
|
+
className,
|
|
218
|
+
...props
|
|
219
|
+
}: React.ComponentProps<"span">) {
|
|
220
|
+
return (
|
|
221
|
+
<span
|
|
222
|
+
data-slot="context-menu-shortcut"
|
|
223
|
+
className={cn(
|
|
224
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
225
|
+
className,
|
|
226
|
+
)}
|
|
227
|
+
{...props}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export {
|
|
233
|
+
ContextMenu,
|
|
234
|
+
ContextMenuTrigger,
|
|
235
|
+
ContextMenuContent,
|
|
236
|
+
ContextMenuItem,
|
|
237
|
+
ContextMenuCheckboxItem,
|
|
238
|
+
ContextMenuRadioItem,
|
|
239
|
+
ContextMenuLabel,
|
|
240
|
+
ContextMenuSeparator,
|
|
241
|
+
ContextMenuShortcut,
|
|
242
|
+
ContextMenuGroup,
|
|
243
|
+
ContextMenuPortal,
|
|
244
|
+
ContextMenuSub,
|
|
245
|
+
ContextMenuSubContent,
|
|
246
|
+
ContextMenuSubTrigger,
|
|
247
|
+
ContextMenuRadioGroup,
|
|
248
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Button } from "#shadcn/components/ui/button";
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogClose,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
DialogTrigger,
|
|
12
|
+
} from "#shadcn/components/ui/dialog";
|
|
13
|
+
import { Input } from "#shadcn/components/ui/input";
|
|
14
|
+
import { Label } from "#shadcn/components/ui/label";
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Component/Dialog",
|
|
18
|
+
} satisfies Meta;
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Demo = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<Dialog>
|
|
26
|
+
<form>
|
|
27
|
+
<DialogTrigger asChild>
|
|
28
|
+
<Button variant="secondary">Open Dialog</Button>
|
|
29
|
+
</DialogTrigger>
|
|
30
|
+
<DialogContent className="sm:max-w-[425px]">
|
|
31
|
+
<DialogHeader>
|
|
32
|
+
<DialogTitle>Edit profile</DialogTitle>
|
|
33
|
+
<DialogDescription>
|
|
34
|
+
Make changes to your profile here. Click save when you're
|
|
35
|
+
done.
|
|
36
|
+
</DialogDescription>
|
|
37
|
+
</DialogHeader>
|
|
38
|
+
<div className="grid gap-4">
|
|
39
|
+
<div className="grid gap-3">
|
|
40
|
+
<Label htmlFor="name-1">Name</Label>
|
|
41
|
+
<Input id="name-1" name="name" defaultValue="Pedro Duarte" />
|
|
42
|
+
</div>
|
|
43
|
+
<div className="grid gap-3">
|
|
44
|
+
<Label htmlFor="username-1">Username</Label>
|
|
45
|
+
<Input id="username-1" name="username" defaultValue="@peduarte" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<DialogFooter>
|
|
49
|
+
<DialogClose asChild>
|
|
50
|
+
<Button variant="secondary">Cancel</Button>
|
|
51
|
+
</DialogClose>
|
|
52
|
+
<Button type="submit">Save changes</Button>
|
|
53
|
+
</DialogFooter>
|
|
54
|
+
</DialogContent>
|
|
55
|
+
</form>
|
|
56
|
+
</Dialog>
|
|
57
|
+
),
|
|
58
|
+
} satisfies Story;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import { XIcon } from "lucide-react";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "#shadcn/lib/utils";
|
|
6
|
+
|
|
7
|
+
function Dialog({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
10
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DialogTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
16
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function DialogPortal({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
22
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function DialogClose({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
28
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function DialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<DialogPrimitive.Overlay
|
|
37
|
+
data-slot="dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function DialogContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
showCloseButton = true,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
53
|
+
showCloseButton?: boolean;
|
|
54
|
+
}) {
|
|
55
|
+
return (
|
|
56
|
+
<DialogPortal data-slot="dialog-portal">
|
|
57
|
+
<DialogOverlay />
|
|
58
|
+
<DialogPrimitive.Content
|
|
59
|
+
data-slot="dialog-content"
|
|
60
|
+
className={cn(
|
|
61
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
{showCloseButton && (
|
|
68
|
+
<DialogPrimitive.Close
|
|
69
|
+
data-slot="dialog-close"
|
|
70
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
71
|
+
>
|
|
72
|
+
<XIcon />
|
|
73
|
+
<span className="sr-only">Close</span>
|
|
74
|
+
</DialogPrimitive.Close>
|
|
75
|
+
)}
|
|
76
|
+
</DialogPrimitive.Content>
|
|
77
|
+
</DialogPortal>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
data-slot="dialog-header"
|
|
85
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
86
|
+
{...props}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
data-slot="dialog-footer"
|
|
95
|
+
className={cn(
|
|
96
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
97
|
+
className,
|
|
98
|
+
)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function DialogTitle({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
108
|
+
return (
|
|
109
|
+
<DialogPrimitive.Title
|
|
110
|
+
data-slot="dialog-title"
|
|
111
|
+
className={cn("text-lg leading-none font-semibold", className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function DialogDescription({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
121
|
+
return (
|
|
122
|
+
<DialogPrimitive.Description
|
|
123
|
+
data-slot="dialog-description"
|
|
124
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
Dialog,
|
|
132
|
+
DialogClose,
|
|
133
|
+
DialogContent,
|
|
134
|
+
DialogDescription,
|
|
135
|
+
DialogFooter,
|
|
136
|
+
DialogHeader,
|
|
137
|
+
DialogOverlay,
|
|
138
|
+
DialogPortal,
|
|
139
|
+
DialogTitle,
|
|
140
|
+
DialogTrigger,
|
|
141
|
+
};
|