@regardio/react 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +133 -0
- package/dist/components/background-slideshow.d.ts +22 -0
- package/dist/components/background-slideshow.d.ts.map +1 -0
- package/dist/components/background-slideshow.js +76 -0
- package/dist/components/blurry-gradient.d.ts +9 -0
- package/dist/components/blurry-gradient.d.ts.map +1 -0
- package/dist/components/blurry-gradient.js +6 -0
- package/dist/components/box.d.ts +17 -0
- package/dist/components/box.d.ts.map +1 -0
- package/dist/components/box.js +25 -0
- package/dist/components/carousel.d.ts +26 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +87 -0
- package/dist/components/countdown.d.ts +2 -0
- package/dist/components/countdown.d.ts.map +1 -0
- package/dist/components/countdown.js +48 -0
- package/dist/components/definition-list.d.ts +40 -0
- package/dist/components/definition-list.d.ts.map +1 -0
- package/dist/components/definition-list.js +57 -0
- package/dist/components/generic-error.d.ts +23 -0
- package/dist/components/generic-error.d.ts.map +1 -0
- package/dist/components/generic-error.js +39 -0
- package/dist/components/heading.d.ts +24 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +29 -0
- package/dist/components/highlight.d.ts +16 -0
- package/dist/components/highlight.d.ts.map +1 -0
- package/dist/components/highlight.js +19 -0
- package/dist/components/icon-button.d.ts +6 -0
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +6 -0
- package/dist/components/if.d.ts +8 -0
- package/dist/components/if.d.ts.map +1 -0
- package/dist/components/if.js +16 -0
- package/dist/components/iframe.d.ts +8 -0
- package/dist/components/iframe.d.ts.map +1 -0
- package/dist/components/iframe.js +3 -0
- package/dist/components/item.d.ts +67 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +309 -0
- package/dist/components/leaflet-map.d.ts +33 -0
- package/dist/components/leaflet-map.d.ts.map +1 -0
- package/dist/components/leaflet-map.js +195 -0
- package/dist/components/link.d.ts +41 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +111 -0
- package/dist/components/link.test.d.ts +2 -0
- package/dist/components/link.test.d.ts.map +1 -0
- package/dist/components/link.test.js +204 -0
- package/dist/components/list-item.d.ts +16 -0
- package/dist/components/list-item.d.ts.map +1 -0
- package/dist/components/list-item.js +19 -0
- package/dist/components/maptiler-map.d.ts +26 -0
- package/dist/components/maptiler-map.d.ts.map +1 -0
- package/dist/components/maptiler-map.js +116 -0
- package/dist/components/markdown-container.d.ts +20 -0
- package/dist/components/markdown-container.d.ts.map +1 -0
- package/dist/components/markdown-container.js +93 -0
- package/dist/components/password-input.d.ts +9 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +13 -0
- package/dist/components/picture.d.ts +26 -0
- package/dist/components/picture.d.ts.map +1 -0
- package/dist/components/picture.js +36 -0
- package/dist/components/protected-email.d.ts +9 -0
- package/dist/components/protected-email.d.ts.map +1 -0
- package/dist/components/protected-email.js +16 -0
- package/dist/components/text.d.ts +17 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/text.js +27 -0
- package/dist/components/unordered-list.d.ts +16 -0
- package/dist/components/unordered-list.d.ts.map +1 -0
- package/dist/components/unordered-list.js +21 -0
- package/dist/hooks/use-current-route-data.d.ts +2 -0
- package/dist/hooks/use-current-route-data.d.ts.map +1 -0
- package/dist/hooks/use-current-route-data.js +12 -0
- package/dist/hooks/use-focus-search.d.ts +3 -0
- package/dist/hooks/use-focus-search.d.ts.map +1 -0
- package/dist/hooks/use-focus-search.js +15 -0
- package/dist/hooks/use-matches-data.d.ts +2 -0
- package/dist/hooks/use-matches-data.d.ts.map +1 -0
- package/dist/hooks/use-matches-data.js +11 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +16 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/hooks/use-nonce.d.ts +5 -0
- package/dist/hooks/use-nonce.d.ts.map +1 -0
- package/dist/hooks/use-nonce.js +9 -0
- package/dist/hooks/use-nonce.test.d.ts +2 -0
- package/dist/hooks/use-nonce.test.d.ts.map +1 -0
- package/dist/hooks/use-nonce.test.js +27 -0
- package/dist/hooks/use-orientation.d.ts +3 -0
- package/dist/hooks/use-orientation.d.ts.map +1 -0
- package/dist/hooks/use-orientation.js +25 -0
- package/dist/hooks/use-user.d.ts +15 -0
- package/dist/hooks/use-user.d.ts.map +1 -0
- package/dist/hooks/use-user.js +17 -0
- package/dist/shadcn/accordion.d.ts +25 -0
- package/dist/shadcn/accordion.d.ts.map +1 -0
- package/dist/shadcn/accordion.js +45 -0
- package/dist/shadcn/alert-dialog.d.ts +73 -0
- package/dist/shadcn/alert-dialog.d.ts.map +1 -0
- package/dist/shadcn/alert-dialog.js +93 -0
- package/dist/shadcn/alert.d.ts +34 -0
- package/dist/shadcn/alert.d.ts.map +1 -0
- package/dist/shadcn/alert.js +42 -0
- package/dist/shadcn/aspect-ratio.d.ts +6 -0
- package/dist/shadcn/aspect-ratio.d.ts.map +1 -0
- package/dist/shadcn/aspect-ratio.js +7 -0
- package/dist/shadcn/avatar.d.ts +16 -0
- package/dist/shadcn/avatar.d.ts.map +1 -0
- package/dist/shadcn/avatar.js +27 -0
- package/dist/shadcn/badge.d.ts +29 -0
- package/dist/shadcn/badge.d.ts.map +1 -0
- package/dist/shadcn/badge.js +29 -0
- package/dist/shadcn/breadcrumb.d.ts +42 -0
- package/dist/shadcn/breadcrumb.d.ts.map +1 -0
- package/dist/shadcn/breadcrumb.js +74 -0
- package/dist/shadcn/button.d.ts +38 -0
- package/dist/shadcn/button.d.ts.map +1 -0
- package/dist/shadcn/button.js +38 -0
- package/dist/shadcn/calendar.d.ts +23 -0
- package/dist/shadcn/calendar.d.ts.map +1 -0
- package/dist/shadcn/calendar.js +163 -0
- package/dist/shadcn/card.d.ts +31 -0
- package/dist/shadcn/card.d.ts.map +1 -0
- package/dist/shadcn/card.js +55 -0
- package/dist/shadcn/carousel.d.ts +51 -0
- package/dist/shadcn/carousel.d.ts.map +1 -0
- package/dist/shadcn/carousel.js +161 -0
- package/dist/shadcn/chart.d.ts +103 -0
- package/dist/shadcn/chart.d.ts.map +1 -0
- package/dist/shadcn/chart.js +248 -0
- package/dist/shadcn/checkbox.d.ts +8 -0
- package/dist/shadcn/checkbox.d.ts.map +1 -0
- package/dist/shadcn/checkbox.js +22 -0
- package/dist/shadcn/collapsible.d.ts +16 -0
- package/dist/shadcn/collapsible.d.ts.map +1 -0
- package/dist/shadcn/collapsible.js +19 -0
- package/dist/shadcn/command.d.ts +61 -0
- package/dist/shadcn/command.d.ts.map +1 -0
- package/dist/shadcn/command.js +123 -0
- package/dist/shadcn/context-menu.d.ts +107 -0
- package/dist/shadcn/context-menu.d.ts.map +1 -0
- package/dist/shadcn/context-menu.js +151 -0
- package/dist/shadcn/dialog.d.ts +57 -0
- package/dist/shadcn/dialog.d.ts.map +1 -0
- package/dist/shadcn/dialog.js +96 -0
- package/dist/shadcn/drawer.d.ts +54 -0
- package/dist/shadcn/drawer.d.ts.map +1 -0
- package/dist/shadcn/drawer.js +96 -0
- package/dist/shadcn/dropdown-menu.d.ts +110 -0
- package/dist/shadcn/dropdown-menu.d.ts.map +1 -0
- package/dist/shadcn/dropdown-menu.js +152 -0
- package/dist/shadcn/form.d.ts +59 -0
- package/dist/shadcn/form.d.ts.map +1 -0
- package/dist/shadcn/form.js +99 -0
- package/dist/shadcn/hover-card.d.ts +20 -0
- package/dist/shadcn/hover-card.d.ts.map +1 -0
- package/dist/shadcn/hover-card.js +26 -0
- package/dist/shadcn/input-otp.d.ts +25 -0
- package/dist/shadcn/input-otp.d.ts.map +1 -0
- package/dist/shadcn/input-otp.js +54 -0
- package/dist/shadcn/input.d.ts +14 -0
- package/dist/shadcn/input.d.ts.map +1 -0
- package/dist/shadcn/input.js +48 -0
- package/dist/shadcn/label.d.ts +8 -0
- package/dist/shadcn/label.d.ts.map +1 -0
- package/dist/shadcn/label.js +16 -0
- package/dist/shadcn/menubar.d.ts +108 -0
- package/dist/shadcn/menubar.d.ts.map +1 -0
- package/dist/shadcn/menubar.js +174 -0
- package/dist/shadcn/navigation-menu.d.ts +79 -0
- package/dist/shadcn/navigation-menu.d.ts.map +1 -0
- package/dist/shadcn/navigation-menu.js +108 -0
- package/dist/shadcn/pagination.d.ts +45 -0
- package/dist/shadcn/pagination.d.ts.map +1 -0
- package/dist/shadcn/pagination.js +83 -0
- package/dist/shadcn/popover.d.ts +19 -0
- package/dist/shadcn/popover.d.ts.map +1 -0
- package/dist/shadcn/popover.js +29 -0
- package/dist/shadcn/progress.d.ts +9 -0
- package/dist/shadcn/progress.d.ts.map +1 -0
- package/dist/shadcn/progress.js +17 -0
- package/dist/shadcn/radio-group.d.ts +12 -0
- package/dist/shadcn/radio-group.d.ts.map +1 -0
- package/dist/shadcn/radio-group.js +32 -0
- package/dist/shadcn/resizable.d.ts +20 -0
- package/dist/shadcn/resizable.d.ts.map +1 -0
- package/dist/shadcn/resizable.js +32 -0
- package/dist/shadcn/scroll-area.d.ts +16 -0
- package/dist/shadcn/scroll-area.d.ts.map +1 -0
- package/dist/shadcn/scroll-area.js +40 -0
- package/dist/shadcn/select.d.ts +63 -0
- package/dist/shadcn/select.d.ts.map +1 -0
- package/dist/shadcn/select.js +120 -0
- package/dist/shadcn/separator.d.ts +10 -0
- package/dist/shadcn/separator.d.ts.map +1 -0
- package/dist/shadcn/separator.js +18 -0
- package/dist/shadcn/sheet.d.ts +48 -0
- package/dist/shadcn/sheet.d.ts.map +1 -0
- package/dist/shadcn/sheet.js +99 -0
- package/dist/shadcn/sidebar.d.ts +200 -0
- package/dist/shadcn/sidebar.d.ts.map +1 -0
- package/dist/shadcn/sidebar.js +528 -0
- package/dist/shadcn/skeleton.d.ts +6 -0
- package/dist/shadcn/skeleton.d.ts.map +1 -0
- package/dist/shadcn/skeleton.js +11 -0
- package/dist/shadcn/slider.d.ts +12 -0
- package/dist/shadcn/slider.d.ts.map +1 -0
- package/dist/shadcn/slider.js +50 -0
- package/dist/shadcn/sonner.d.ts +7 -0
- package/dist/shadcn/sonner.d.ts.map +1 -0
- package/dist/shadcn/sonner.js +20 -0
- package/dist/shadcn/switch.d.ts +8 -0
- package/dist/shadcn/switch.d.ts.map +1 -0
- package/dist/shadcn/switch.js +22 -0
- package/dist/shadcn/table.d.ts +35 -0
- package/dist/shadcn/table.d.ts.map +1 -0
- package/dist/shadcn/table.js +73 -0
- package/dist/shadcn/tabs.d.ts +20 -0
- package/dist/shadcn/tabs.d.ts.map +1 -0
- package/dist/shadcn/tabs.js +40 -0
- package/dist/shadcn/textarea.d.ts +7 -0
- package/dist/shadcn/textarea.d.ts.map +1 -0
- package/dist/shadcn/textarea.js +14 -0
- package/dist/shadcn/toggle-group.d.ts +22 -0
- package/dist/shadcn/toggle-group.d.ts.map +1 -0
- package/dist/shadcn/toggle-group.js +43 -0
- package/dist/shadcn/toggle.d.ts +29 -0
- package/dist/shadcn/toggle.d.ts.map +1 -0
- package/dist/shadcn/toggle.js +31 -0
- package/dist/shadcn/tooltip.d.ts +20 -0
- package/dist/shadcn/tooltip.d.ts.map +1 -0
- package/dist/shadcn/tooltip.js +40 -0
- package/dist/stories/BackgroundSlideshow.stories.d.ts +9 -0
- package/dist/stories/BackgroundSlideshow.stories.d.ts.map +1 -0
- package/dist/stories/BackgroundSlideshow.stories.js +60 -0
- package/dist/stories/BlurryGradient.stories.d.ts +11 -0
- package/dist/stories/BlurryGradient.stories.d.ts.map +1 -0
- package/dist/stories/BlurryGradient.stories.js +53 -0
- package/dist/stories/Box.stories.d.ts +13 -0
- package/dist/stories/Box.stories.d.ts.map +1 -0
- package/dist/stories/Box.stories.js +50 -0
- package/dist/stories/Carousel.stories.d.ts +9 -0
- package/dist/stories/Carousel.stories.d.ts.map +1 -0
- package/dist/stories/Carousel.stories.js +30 -0
- package/dist/stories/Countdown.stories.d.ts +7 -0
- package/dist/stories/Countdown.stories.d.ts.map +1 -0
- package/dist/stories/Countdown.stories.js +11 -0
- package/dist/stories/DefinitionList.stories.d.ts +9 -0
- package/dist/stories/DefinitionList.stories.d.ts.map +1 -0
- package/dist/stories/DefinitionList.stories.js +20 -0
- package/dist/stories/GenericError.stories.d.ts +9 -0
- package/dist/stories/GenericError.stories.d.ts.map +1 -0
- package/dist/stories/GenericError.stories.js +39 -0
- package/dist/stories/Heading.stories.d.ts +15 -0
- package/dist/stories/Heading.stories.d.ts.map +1 -0
- package/dist/stories/Heading.stories.js +61 -0
- package/dist/stories/Highlight.stories.d.ts +8 -0
- package/dist/stories/Highlight.stories.d.ts.map +1 -0
- package/dist/stories/Highlight.stories.js +19 -0
- package/dist/stories/IconButton.stories.d.ts +10 -0
- package/dist/stories/IconButton.stories.d.ts.map +1 -0
- package/dist/stories/IconButton.stories.js +32 -0
- package/dist/stories/If.stories.d.ts +13 -0
- package/dist/stories/If.stories.d.ts.map +1 -0
- package/dist/stories/If.stories.js +54 -0
- package/dist/stories/Iframe.stories.d.ts +8 -0
- package/dist/stories/Iframe.stories.d.ts.map +1 -0
- package/dist/stories/Iframe.stories.js +23 -0
- package/dist/stories/Item.stories.d.ts +10 -0
- package/dist/stories/Item.stories.d.ts.map +1 -0
- package/dist/stories/Item.stories.js +32 -0
- package/dist/stories/Link.stories.d.ts +10 -0
- package/dist/stories/Link.stories.d.ts.map +1 -0
- package/dist/stories/Link.stories.js +36 -0
- package/dist/stories/ListItem.stories.d.ts +9 -0
- package/dist/stories/ListItem.stories.d.ts.map +1 -0
- package/dist/stories/ListItem.stories.js +25 -0
- package/dist/stories/MarkdownContainer.stories.d.ts +11 -0
- package/dist/stories/MarkdownContainer.stories.d.ts.map +1 -0
- package/dist/stories/MarkdownContainer.stories.js +66 -0
- package/dist/stories/PasswordInput.stories.d.ts +9 -0
- package/dist/stories/PasswordInput.stories.d.ts.map +1 -0
- package/dist/stories/PasswordInput.stories.js +27 -0
- package/dist/stories/Picture.stories.d.ts +10 -0
- package/dist/stories/Picture.stories.d.ts.map +1 -0
- package/dist/stories/Picture.stories.js +46 -0
- package/dist/stories/ProtectedEmail.stories.d.ts +10 -0
- package/dist/stories/ProtectedEmail.stories.d.ts.map +1 -0
- package/dist/stories/ProtectedEmail.stories.js +34 -0
- package/dist/stories/Text.stories.d.ts +10 -0
- package/dist/stories/Text.stories.d.ts.map +1 -0
- package/dist/stories/Text.stories.js +31 -0
- package/dist/stories/UnorderedList.stories.d.ts +10 -0
- package/dist/stories/UnorderedList.stories.d.ts.map +1 -0
- package/dist/stories/UnorderedList.stories.js +24 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +1 -0
- package/dist/utils/author.d.ts +9 -0
- package/dist/utils/author.d.ts.map +1 -0
- package/dist/utils/author.js +37 -0
- package/dist/utils/author.test.d.ts +2 -0
- package/dist/utils/author.test.d.ts.map +1 -0
- package/dist/utils/author.test.js +46 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +10 -0
- package/dist/utils/cn.test.d.ts +2 -0
- package/dist/utils/cn.test.d.ts.map +1 -0
- package/dist/utils/cn.test.js +33 -0
- package/dist/utils/is-route-active.d.ts +3 -0
- package/dist/utils/is-route-active.d.ts.map +1 -0
- package/dist/utils/is-route-active.js +54 -0
- package/dist/utils/is-route-active.test.d.ts +2 -0
- package/dist/utils/is-route-active.test.d.ts.map +1 -0
- package/dist/utils/is-route-active.test.js +61 -0
- package/dist/utils/locale.d.ts +22 -0
- package/dist/utils/locale.d.ts.map +1 -0
- package/dist/utils/locale.js +25 -0
- package/dist/utils/locale.test.d.ts +2 -0
- package/dist/utils/locale.test.d.ts.map +1 -0
- package/dist/utils/locale.test.js +99 -0
- package/dist/utils/text.d.ts +7 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +102 -0
- package/dist/utils/text.test.d.ts +2 -0
- package/dist/utils/text.test.d.ts.map +1 -0
- package/dist/utils/text.test.js +122 -0
- package/package.json +117 -0
- package/src/components/background-slideshow.tsx +172 -0
- package/src/components/blurry-gradient.tsx +97 -0
- package/src/components/box.tsx +45 -0
- package/src/components/carousel.tsx +197 -0
- package/src/components/countdown.tsx +82 -0
- package/src/components/definition-list.tsx +90 -0
- package/src/components/generic-error.tsx +104 -0
- package/src/components/heading.tsx +60 -0
- package/src/components/highlight.tsx +53 -0
- package/src/components/icon-button.tsx +20 -0
- package/src/components/if.tsx +29 -0
- package/src/components/iframe.tsx +19 -0
- package/src/components/item.tsx +340 -0
- package/src/components/leaflet-map.tsx +294 -0
- package/src/components/link.test.tsx +387 -0
- package/src/components/link.tsx +206 -0
- package/src/components/list-item.tsx +30 -0
- package/src/components/maptiler-map.tsx +181 -0
- package/src/components/markdown-container.tsx +153 -0
- package/src/components/password-input.tsx +49 -0
- package/src/components/picture.tsx +107 -0
- package/src/components/protected-email.tsx +49 -0
- package/src/components/text.tsx +38 -0
- package/src/components/unordered-list.tsx +32 -0
- package/src/hooks/use-current-route-data.ts +18 -0
- package/src/hooks/use-focus-search.ts +20 -0
- package/src/hooks/use-matches-data.ts +19 -0
- package/src/hooks/use-media-query.ts +33 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-nonce.test.ts +35 -0
- package/src/hooks/use-nonce.ts +20 -0
- package/src/hooks/use-orientation.ts +48 -0
- package/src/hooks/use-user.tsx +72 -0
- package/src/stories/BackgroundSlideshow.stories.tsx +68 -0
- package/src/stories/BlurryGradient.stories.tsx +62 -0
- package/src/stories/Box.stories.tsx +83 -0
- package/src/stories/Carousel.stories.tsx +95 -0
- package/src/stories/Countdown.stories.tsx +16 -0
- package/src/stories/DefinitionList.stories.tsx +51 -0
- package/src/stories/GenericError.stories.tsx +58 -0
- package/src/stories/Heading.stories.tsx +82 -0
- package/src/stories/Highlight.stories.tsx +28 -0
- package/src/stories/IconButton.stories.tsx +90 -0
- package/src/stories/If.stories.tsx +72 -0
- package/src/stories/Iframe.stories.tsx +29 -0
- package/src/stories/Item.stories.tsx +79 -0
- package/src/stories/Link.stories.tsx +58 -0
- package/src/stories/ListItem.stories.tsx +37 -0
- package/src/stories/MarkdownContainer.stories.tsx +76 -0
- package/src/stories/PasswordInput.stories.tsx +34 -0
- package/src/stories/Picture.stories.tsx +54 -0
- package/src/stories/ProtectedEmail.stories.tsx +57 -0
- package/src/stories/Text.stories.tsx +44 -0
- package/src/stories/UnorderedList.stories.tsx +73 -0
- package/src/styles/storybook.css +1 -0
- package/src/styles/tailwind.css +7 -0
- package/src/test-setup.ts +1 -0
- package/src/utils/author.test.ts +54 -0
- package/src/utils/author.tsx +73 -0
- package/src/utils/cn.test.ts +48 -0
- package/src/utils/cn.ts +14 -0
- package/src/utils/is-route-active.test.ts +80 -0
- package/src/utils/is-route-active.ts +100 -0
- package/src/utils/locale.test.ts +148 -0
- package/src/utils/locale.ts +127 -0
- package/src/utils/text.test.ts +152 -0
- package/src/utils/text.tsx +209 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type VariantProps } from '../utils/cn';
|
|
3
|
+
declare const buttonVariants: (
|
|
4
|
+
props?:
|
|
5
|
+
| ({
|
|
6
|
+
size?: 'default' | 'icon' | 'lg' | 'sm' | undefined;
|
|
7
|
+
variant?:
|
|
8
|
+
| 'link'
|
|
9
|
+
| 'default'
|
|
10
|
+
| 'destructive'
|
|
11
|
+
| 'ghost'
|
|
12
|
+
| 'outline'
|
|
13
|
+
| 'secondary'
|
|
14
|
+
| undefined;
|
|
15
|
+
} & (
|
|
16
|
+
| {
|
|
17
|
+
class?: import('cva').ClassValue;
|
|
18
|
+
className?: never;
|
|
19
|
+
}
|
|
20
|
+
| {
|
|
21
|
+
class?: never;
|
|
22
|
+
className?: import('cva').ClassValue;
|
|
23
|
+
}
|
|
24
|
+
))
|
|
25
|
+
| undefined,
|
|
26
|
+
) => string;
|
|
27
|
+
declare function Button({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
asChild,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<'button'> &
|
|
34
|
+
VariantProps<typeof buttonVariants> & {
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
37
|
+
export { Button, buttonVariants };
|
|
38
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/shadcn/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,QAAA,MAAM,cAAc;;;;;;;;;0BAwBlB,CAAC;AAEH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAUF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { jsx as _jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cn, cva } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
const buttonVariants = cva({
|
|
6
|
+
base: 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*="size-"])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
size: 'default',
|
|
9
|
+
variant: 'default',
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
14
|
+
icon: 'size-9',
|
|
15
|
+
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
16
|
+
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
|
|
20
|
+
destructive:
|
|
21
|
+
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
|
22
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
|
23
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
24
|
+
outline:
|
|
25
|
+
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
|
26
|
+
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
function Button({ className, variant, size, asChild = false, ...props }) {
|
|
31
|
+
const Comp = asChild ? Slot : 'button';
|
|
32
|
+
return _jsx(Comp, {
|
|
33
|
+
className: cn(buttonVariants({ className, size, variant })),
|
|
34
|
+
'data-slot': 'button',
|
|
35
|
+
...props,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type DayButton, DayPicker } from 'react-day-picker';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
declare function Calendar({
|
|
5
|
+
className,
|
|
6
|
+
classNames,
|
|
7
|
+
showOutsideDays,
|
|
8
|
+
captionLayout,
|
|
9
|
+
buttonVariant,
|
|
10
|
+
formatters,
|
|
11
|
+
components,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
14
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
15
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
16
|
+
declare function CalendarDayButton({
|
|
17
|
+
className,
|
|
18
|
+
day,
|
|
19
|
+
modifiers,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof DayButton>): import('react/jsx-runtime').JSX.Element;
|
|
22
|
+
export { Calendar, CalendarDayButton };
|
|
23
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/shadcn/calendar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAwB,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AA6ElD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAChE,2CAgGA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,2CA+BxC;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx as _jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
|
+
import { Button, buttonVariants } from './button';
|
|
7
|
+
|
|
8
|
+
function CalendarChevron({ className, orientation, ...props }) {
|
|
9
|
+
if (orientation === 'left') {
|
|
10
|
+
return _jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props });
|
|
11
|
+
}
|
|
12
|
+
if (orientation === 'right') {
|
|
13
|
+
return _jsx(ChevronRightIcon, { className: cn('size-4', className), ...props });
|
|
14
|
+
}
|
|
15
|
+
if (orientation === 'up') {
|
|
16
|
+
return _jsx(ChevronLeftIcon, { className: cn('size-4 rotate-90', className), ...props });
|
|
17
|
+
}
|
|
18
|
+
return _jsx(ChevronDownIcon, { className: cn('size-4', className), ...props });
|
|
19
|
+
}
|
|
20
|
+
function CalendarRoot({ rootRef, ...props }) {
|
|
21
|
+
const { className, ...rest } = props;
|
|
22
|
+
return _jsx('div', { className: cn(className), 'data-slot': 'calendar', ref: rootRef, ...rest });
|
|
23
|
+
}
|
|
24
|
+
function CalendarWeekNumber({ children, ...props }) {
|
|
25
|
+
return _jsx('td', {
|
|
26
|
+
...props,
|
|
27
|
+
children: _jsx('div', {
|
|
28
|
+
children: children,
|
|
29
|
+
className: 'flex size-(--cell-size) items-center justify-center text-center',
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function Calendar({
|
|
34
|
+
className,
|
|
35
|
+
classNames,
|
|
36
|
+
showOutsideDays = true,
|
|
37
|
+
captionLayout = 'label',
|
|
38
|
+
buttonVariant = 'ghost',
|
|
39
|
+
formatters,
|
|
40
|
+
components,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
const defaultClassNames = getDefaultClassNames();
|
|
44
|
+
return _jsx(DayPicker, {
|
|
45
|
+
captionLayout: captionLayout,
|
|
46
|
+
className: cn(
|
|
47
|
+
'bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
|
48
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
49
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
50
|
+
className,
|
|
51
|
+
),
|
|
52
|
+
classNames: {
|
|
53
|
+
button_next: cn(
|
|
54
|
+
buttonVariants({ variant: buttonVariant }),
|
|
55
|
+
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
|
56
|
+
defaultClassNames.button_next,
|
|
57
|
+
),
|
|
58
|
+
button_previous: cn(
|
|
59
|
+
buttonVariants({ variant: buttonVariant }),
|
|
60
|
+
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
|
61
|
+
defaultClassNames.button_previous,
|
|
62
|
+
),
|
|
63
|
+
caption_label: cn(
|
|
64
|
+
'select-none font-medium',
|
|
65
|
+
captionLayout === 'label'
|
|
66
|
+
? 'text-sm'
|
|
67
|
+
: 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5',
|
|
68
|
+
defaultClassNames.caption_label,
|
|
69
|
+
),
|
|
70
|
+
day: cn(
|
|
71
|
+
'relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none',
|
|
72
|
+
defaultClassNames.day,
|
|
73
|
+
),
|
|
74
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
75
|
+
dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
76
|
+
dropdown_root: cn(
|
|
77
|
+
'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',
|
|
78
|
+
defaultClassNames.dropdown_root,
|
|
79
|
+
),
|
|
80
|
+
dropdowns: cn(
|
|
81
|
+
'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5',
|
|
82
|
+
defaultClassNames.dropdowns,
|
|
83
|
+
),
|
|
84
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
85
|
+
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
86
|
+
month_caption: cn(
|
|
87
|
+
'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)',
|
|
88
|
+
defaultClassNames.month_caption,
|
|
89
|
+
),
|
|
90
|
+
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
91
|
+
nav: cn(
|
|
92
|
+
'flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between',
|
|
93
|
+
defaultClassNames.nav,
|
|
94
|
+
),
|
|
95
|
+
outside: cn(
|
|
96
|
+
'text-muted-foreground aria-selected:text-muted-foreground',
|
|
97
|
+
defaultClassNames.outside,
|
|
98
|
+
),
|
|
99
|
+
range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
|
|
100
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
101
|
+
range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
|
|
102
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
103
|
+
table: 'w-full border-collapse',
|
|
104
|
+
today: cn(
|
|
105
|
+
'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',
|
|
106
|
+
defaultClassNames.today,
|
|
107
|
+
),
|
|
108
|
+
week: cn('flex w-full mt-2', defaultClassNames.week),
|
|
109
|
+
week_number: cn(
|
|
110
|
+
'text-[0.8rem] select-none text-muted-foreground',
|
|
111
|
+
defaultClassNames.week_number,
|
|
112
|
+
),
|
|
113
|
+
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
114
|
+
weekday: cn(
|
|
115
|
+
'text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none',
|
|
116
|
+
defaultClassNames.weekday,
|
|
117
|
+
),
|
|
118
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
119
|
+
...classNames,
|
|
120
|
+
},
|
|
121
|
+
components: {
|
|
122
|
+
Chevron: CalendarChevron,
|
|
123
|
+
DayButton: CalendarDayButton,
|
|
124
|
+
Root: CalendarRoot,
|
|
125
|
+
WeekNumber: CalendarWeekNumber,
|
|
126
|
+
...components,
|
|
127
|
+
},
|
|
128
|
+
formatters: {
|
|
129
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
130
|
+
...formatters,
|
|
131
|
+
},
|
|
132
|
+
showOutsideDays: showOutsideDays,
|
|
133
|
+
...props,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
137
|
+
const defaultClassNames = getDefaultClassNames();
|
|
138
|
+
const ref = React.useRef(null);
|
|
139
|
+
React.useEffect(() => {
|
|
140
|
+
if (modifiers.focused) ref.current?.focus();
|
|
141
|
+
}, [modifiers.focused]);
|
|
142
|
+
return _jsx(Button, {
|
|
143
|
+
className: cn(
|
|
144
|
+
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70',
|
|
145
|
+
defaultClassNames.day,
|
|
146
|
+
className,
|
|
147
|
+
),
|
|
148
|
+
'data-day': day.date.toLocaleDateString(),
|
|
149
|
+
'data-range-end': modifiers.range_end,
|
|
150
|
+
'data-range-middle': modifiers.range_middle,
|
|
151
|
+
'data-range-start': modifiers.range_start,
|
|
152
|
+
'data-selected-single':
|
|
153
|
+
modifiers.selected &&
|
|
154
|
+
!modifiers.range_start &&
|
|
155
|
+
!modifiers.range_end &&
|
|
156
|
+
!modifiers.range_middle,
|
|
157
|
+
ref: ref,
|
|
158
|
+
size: 'icon',
|
|
159
|
+
variant: 'ghost',
|
|
160
|
+
...props,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
declare function Card({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
6
|
+
declare function CardHeader({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
10
|
+
declare function CardTitle({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
14
|
+
declare function CardDescription({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
18
|
+
declare function CardAction({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
22
|
+
declare function CardContent({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
26
|
+
declare function CardFooter({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
30
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
31
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/shadcn/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWjE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ5E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
|
|
4
|
+
function Card({ className, ...props }) {
|
|
5
|
+
return _jsx('div', {
|
|
6
|
+
className: cn(
|
|
7
|
+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
|
8
|
+
className,
|
|
9
|
+
),
|
|
10
|
+
'data-slot': 'card',
|
|
11
|
+
...props,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function CardHeader({ className, ...props }) {
|
|
15
|
+
return _jsx('div', {
|
|
16
|
+
className: cn(
|
|
17
|
+
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
|
18
|
+
className,
|
|
19
|
+
),
|
|
20
|
+
'data-slot': 'card-header',
|
|
21
|
+
...props,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CardTitle({ className, ...props }) {
|
|
25
|
+
return _jsx('div', {
|
|
26
|
+
className: cn('leading-none font-semibold', className),
|
|
27
|
+
'data-slot': 'card-title',
|
|
28
|
+
...props,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function CardDescription({ className, ...props }) {
|
|
32
|
+
return _jsx('div', {
|
|
33
|
+
className: cn('text-muted-foreground text-sm', className),
|
|
34
|
+
'data-slot': 'card-description',
|
|
35
|
+
...props,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CardAction({ className, ...props }) {
|
|
39
|
+
return _jsx('div', {
|
|
40
|
+
className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className),
|
|
41
|
+
'data-slot': 'card-action',
|
|
42
|
+
...props,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function CardContent({ className, ...props }) {
|
|
46
|
+
return _jsx('div', { className: cn('px-6', className), 'data-slot': 'card-content', ...props });
|
|
47
|
+
}
|
|
48
|
+
function CardFooter({ className, ...props }) {
|
|
49
|
+
return _jsx('div', {
|
|
50
|
+
className: cn('flex items-center px-6 [.border-t]:pt-6', className),
|
|
51
|
+
'data-slot': 'card-footer',
|
|
52
|
+
...props,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
7
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
8
|
+
type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugin;
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
setApi?: (api: CarouselApi) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function Carousel({
|
|
15
|
+
orientation,
|
|
16
|
+
opts,
|
|
17
|
+
setApi,
|
|
18
|
+
plugins,
|
|
19
|
+
className,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<'div'> & CarouselProps): import('react/jsx-runtime').JSX.Element;
|
|
23
|
+
declare function CarouselContent({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
27
|
+
declare function CarouselItem({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<'div'>): import('react/jsx-runtime').JSX.Element;
|
|
31
|
+
declare function CarouselPrevious({
|
|
32
|
+
className,
|
|
33
|
+
variant,
|
|
34
|
+
size,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof Button>): import('react/jsx-runtime').JSX.Element;
|
|
37
|
+
declare function CarouselNext({
|
|
38
|
+
className,
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof Button>): import('react/jsx-runtime').JSX.Element;
|
|
43
|
+
export {
|
|
44
|
+
type CarouselApi,
|
|
45
|
+
Carousel,
|
|
46
|
+
CarouselContent,
|
|
47
|
+
CarouselItem,
|
|
48
|
+
CarouselPrevious,
|
|
49
|
+
CarouselNext,
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../src/shadcn/carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,EAAE,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,KAAK,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAChD,KAAK,cAAc,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE/C,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CACrC,CAAC;AAuBF,iBAAS,QAAQ,CAAC,EAChB,WAA0B,EAC1B,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,aAAa,2CAgF7C;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAe5E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAczE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,OAAmB,EACnB,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAuBrC;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,OAAmB,EACnB,IAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,2CAuBrC;AAED,OAAO,EACL,KAAK,WAAW,EAChB,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
3
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { cn } from '../utils/cn';
|
|
7
|
+
import { Button } from './button';
|
|
8
|
+
|
|
9
|
+
const CarouselContext = React.createContext(null);
|
|
10
|
+
function useCarousel() {
|
|
11
|
+
const context = React.useContext(CarouselContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error('useCarousel must be used within a <Carousel />');
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
function Carousel({
|
|
18
|
+
orientation = 'horizontal',
|
|
19
|
+
opts,
|
|
20
|
+
setApi,
|
|
21
|
+
plugins,
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
27
|
+
{
|
|
28
|
+
...opts,
|
|
29
|
+
axis: orientation === 'horizontal' ? 'x' : 'y',
|
|
30
|
+
},
|
|
31
|
+
plugins,
|
|
32
|
+
);
|
|
33
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
34
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
35
|
+
const onSelect = React.useCallback((api) => {
|
|
36
|
+
if (!api) return;
|
|
37
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
38
|
+
setCanScrollNext(api.canScrollNext());
|
|
39
|
+
}, []);
|
|
40
|
+
const scrollPrev = React.useCallback(() => {
|
|
41
|
+
api?.scrollPrev();
|
|
42
|
+
}, [api]);
|
|
43
|
+
const scrollNext = React.useCallback(() => {
|
|
44
|
+
api?.scrollNext();
|
|
45
|
+
}, [api]);
|
|
46
|
+
const handleKeyDown = React.useCallback(
|
|
47
|
+
(event) => {
|
|
48
|
+
if (event.key === 'ArrowLeft') {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
scrollPrev();
|
|
51
|
+
} else if (event.key === 'ArrowRight') {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
scrollNext();
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[scrollPrev, scrollNext],
|
|
57
|
+
);
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
if (!api || !setApi) return;
|
|
60
|
+
setApi(api);
|
|
61
|
+
}, [api, setApi]);
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
if (!api) return;
|
|
64
|
+
onSelect(api);
|
|
65
|
+
api.on('reInit', onSelect);
|
|
66
|
+
api.on('select', onSelect);
|
|
67
|
+
return () => {
|
|
68
|
+
api?.off('select', onSelect);
|
|
69
|
+
};
|
|
70
|
+
}, [api, onSelect]);
|
|
71
|
+
return _jsx(CarouselContext.Provider, {
|
|
72
|
+
children: _jsx('section', {
|
|
73
|
+
'aria-roledescription': 'carousel',
|
|
74
|
+
className: cn('relative', className),
|
|
75
|
+
'data-slot': 'carousel',
|
|
76
|
+
onKeyDownCapture: handleKeyDown,
|
|
77
|
+
role: 'region',
|
|
78
|
+
...props,
|
|
79
|
+
children: children,
|
|
80
|
+
}),
|
|
81
|
+
value: {
|
|
82
|
+
api: api,
|
|
83
|
+
canScrollNext,
|
|
84
|
+
canScrollPrev,
|
|
85
|
+
carouselRef,
|
|
86
|
+
opts,
|
|
87
|
+
orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
|
88
|
+
scrollNext,
|
|
89
|
+
scrollPrev,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function CarouselContent({ className, ...props }) {
|
|
94
|
+
const { carouselRef, orientation } = useCarousel();
|
|
95
|
+
return _jsx('div', {
|
|
96
|
+
children: _jsx('div', {
|
|
97
|
+
className: cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className),
|
|
98
|
+
...props,
|
|
99
|
+
}),
|
|
100
|
+
className: 'overflow-hidden',
|
|
101
|
+
'data-slot': 'carousel-content',
|
|
102
|
+
ref: carouselRef,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function CarouselItem({ className, ...props }) {
|
|
106
|
+
const { orientation } = useCarousel();
|
|
107
|
+
return _jsx('div', {
|
|
108
|
+
className: cn(
|
|
109
|
+
'min-w-0 shrink-0 grow-0 basis-full',
|
|
110
|
+
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
111
|
+
className,
|
|
112
|
+
),
|
|
113
|
+
'data-slot': 'carousel-item',
|
|
114
|
+
...props,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function CarouselPrevious({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
118
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
119
|
+
return _jsxs(Button, {
|
|
120
|
+
className: cn(
|
|
121
|
+
'absolute size-8 rounded-full',
|
|
122
|
+
orientation === 'horizontal'
|
|
123
|
+
? 'top-1/2 -left-12 -translate-y-1/2'
|
|
124
|
+
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
125
|
+
className,
|
|
126
|
+
),
|
|
127
|
+
'data-slot': 'carousel-previous',
|
|
128
|
+
disabled: !canScrollPrev,
|
|
129
|
+
onClick: scrollPrev,
|
|
130
|
+
size: size,
|
|
131
|
+
variant: variant,
|
|
132
|
+
...props,
|
|
133
|
+
children: [
|
|
134
|
+
_jsx(ArrowLeft, {}),
|
|
135
|
+
_jsx('span', { children: 'Previous slide', className: 'sr-only' }),
|
|
136
|
+
],
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function CarouselNext({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
140
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
141
|
+
return _jsxs(Button, {
|
|
142
|
+
className: cn(
|
|
143
|
+
'absolute size-8 rounded-full',
|
|
144
|
+
orientation === 'horizontal'
|
|
145
|
+
? 'top-1/2 -right-12 -translate-y-1/2'
|
|
146
|
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
147
|
+
className,
|
|
148
|
+
),
|
|
149
|
+
'data-slot': 'carousel-next',
|
|
150
|
+
disabled: !canScrollNext,
|
|
151
|
+
onClick: scrollNext,
|
|
152
|
+
size: size,
|
|
153
|
+
variant: variant,
|
|
154
|
+
...props,
|
|
155
|
+
children: [
|
|
156
|
+
_jsx(ArrowRight, {}),
|
|
157
|
+
_jsx('span', { children: 'Next slide', className: 'sr-only' }),
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
import type { LegendPayload } from 'recharts/types/component/DefaultLegendContent';
|
|
4
|
+
import type { NameType, Payload, ValueType } from 'recharts/types/component/DefaultTooltipContent';
|
|
5
|
+
import type { Props as LegendProps } from 'recharts/types/component/Legend';
|
|
6
|
+
import type { TooltipContentProps } from 'recharts/types/component/Tooltip';
|
|
7
|
+
declare const THEMES: {
|
|
8
|
+
readonly dark: '.dark';
|
|
9
|
+
readonly light: '';
|
|
10
|
+
};
|
|
11
|
+
export type ChartConfig = {
|
|
12
|
+
[k in string]: {
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
icon?: React.ComponentType;
|
|
15
|
+
} & (
|
|
16
|
+
| {
|
|
17
|
+
color?: string;
|
|
18
|
+
theme?: never;
|
|
19
|
+
}
|
|
20
|
+
| {
|
|
21
|
+
color?: never;
|
|
22
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
declare function ChartContainer({
|
|
27
|
+
id,
|
|
28
|
+
className,
|
|
29
|
+
children,
|
|
30
|
+
config,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<'div'> & {
|
|
33
|
+
config: ChartConfig;
|
|
34
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
35
|
+
}): import('react/jsx-runtime').JSX.Element;
|
|
36
|
+
declare const ChartStyle: ({
|
|
37
|
+
id,
|
|
38
|
+
config,
|
|
39
|
+
}: {
|
|
40
|
+
id: string;
|
|
41
|
+
config: ChartConfig;
|
|
42
|
+
}) => import('react/jsx-runtime').JSX.Element | null;
|
|
43
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
44
|
+
type CustomTooltipProps = TooltipContentProps<ValueType, NameType> & {
|
|
45
|
+
className?: string;
|
|
46
|
+
hideLabel?: boolean;
|
|
47
|
+
hideIndicator?: boolean;
|
|
48
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
49
|
+
nameKey?: string;
|
|
50
|
+
labelKey?: string;
|
|
51
|
+
labelFormatter?: (
|
|
52
|
+
label: TooltipContentProps<number, string>['label'],
|
|
53
|
+
payload: TooltipContentProps<number, string>['payload'],
|
|
54
|
+
) => React.ReactNode;
|
|
55
|
+
formatter?: (
|
|
56
|
+
value: number | string,
|
|
57
|
+
name: string,
|
|
58
|
+
item: Payload<number | string, string>,
|
|
59
|
+
index: number,
|
|
60
|
+
payload: ReadonlyArray<Payload<number | string, string>>,
|
|
61
|
+
) => React.ReactNode;
|
|
62
|
+
labelClassName?: string;
|
|
63
|
+
color?: string;
|
|
64
|
+
};
|
|
65
|
+
declare function ChartTooltipContent({
|
|
66
|
+
active,
|
|
67
|
+
payload,
|
|
68
|
+
label,
|
|
69
|
+
className,
|
|
70
|
+
indicator,
|
|
71
|
+
hideLabel,
|
|
72
|
+
hideIndicator,
|
|
73
|
+
labelFormatter,
|
|
74
|
+
formatter,
|
|
75
|
+
labelClassName,
|
|
76
|
+
color,
|
|
77
|
+
nameKey,
|
|
78
|
+
labelKey,
|
|
79
|
+
}: CustomTooltipProps): import('react/jsx-runtime').JSX.Element | null;
|
|
80
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
81
|
+
type ChartLegendContentProps = {
|
|
82
|
+
className?: string;
|
|
83
|
+
hideIcon?: boolean;
|
|
84
|
+
verticalAlign?: LegendProps['verticalAlign'];
|
|
85
|
+
payload?: LegendPayload[];
|
|
86
|
+
nameKey?: string;
|
|
87
|
+
};
|
|
88
|
+
declare function ChartLegendContent({
|
|
89
|
+
className,
|
|
90
|
+
hideIcon,
|
|
91
|
+
payload,
|
|
92
|
+
verticalAlign,
|
|
93
|
+
nameKey,
|
|
94
|
+
}: ChartLegendContentProps): import('react/jsx-runtime').JSX.Element | null;
|
|
95
|
+
export {
|
|
96
|
+
ChartContainer,
|
|
97
|
+
ChartTooltip,
|
|
98
|
+
ChartTooltipContent,
|
|
99
|
+
ChartLegend,
|
|
100
|
+
ChartLegendContent,
|
|
101
|
+
ChartStyle,
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=chart.d.ts.map
|