@codefast/ui 1.0.0-canary.6 → 1.0.0-canary.7
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/CHANGELOG.md +9 -0
- package/README.md +59 -355
- package/dist/components/accordion.d.ts +37 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +33 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +102 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +38 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +32 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +13 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +13 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/{attachment.d.mts → attachment.d.ts} +21 -55
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +65 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/avatar.d.ts +55 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +44 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +15 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +62 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/bubble.d.ts +50 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +34 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button-group.d.ts +32 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +18 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +27 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +96 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +62 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +49 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/{carousel.d.mts → carousel.d.ts} +25 -52
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +137 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +101 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +217 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox-cards.d.ts +23 -0
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +22 -0
- package/dist/components/checkbox-cards.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +21 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +21 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +15 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +29 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +91 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +71 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +136 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +99 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.d.ts +86 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +64 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.d.ts +19 -0
- package/dist/components/direction.d.ts.map +1 -0
- package/dist/components/direction.js +17 -0
- package/dist/components/direction.js.map +1 -0
- package/dist/components/drawer.d.ts +74 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +57 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +136 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +99 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +53 -0
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +44 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +95 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +86 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/{form.d.mts → form.d.ts} +15 -33
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +97 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.d.ts +37 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +32 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +56 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +56 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-number.d.ts +15 -0
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +31 -0
- package/dist/components/input-number.js.map +1 -0
- package/dist/components/input-otp.d.ts +40 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +41 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input-password.d.ts +13 -0
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +19 -0
- package/dist/components/input-password.js.map +1 -0
- package/dist/components/input-search.d.ts +17 -0
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +24 -0
- package/dist/components/input-search.js.map +1 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +88 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +71 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +20 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +13 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +14 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/{marker.d.mts → marker.d.ts} +9 -21
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/menubar.d.ts +144 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +105 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/message-scroller.d.ts +67 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +46 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/{message.d.mts → message.d.ts} +11 -31
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +43 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/native-select.d.ts +30 -0
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +26 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +71 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +58 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +70 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +51 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +69 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +56 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress-circle.d.ts +72 -0
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +58 -0
- package/dist/components/progress-circle.js.map +1 -0
- package/dist/components/progress.d.ts +13 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +16 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-cards.d.ts +21 -0
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +21 -0
- package/dist/components/radio-cards.js.map +1 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +20 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/radio.d.ts +14 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +14 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/resizable.d.ts +31 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +26 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +27 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +29 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +87 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +70 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +23 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +21 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +88 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +69 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +231 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +279 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +12 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +13 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +13 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +21 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +14 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +32 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +30 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +14 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +68 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +55 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +38 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +33 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +12 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +13 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +30 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +42 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +15 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +14 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +45 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/{use-animated-value.d.mts → use-animated-value.d.ts} +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +73 -0
- package/dist/hooks/use-animated-value.js.map +1 -0
- package/dist/hooks/{use-copy-to-clipboard.d.mts → use-copy-to-clipboard.d.ts} +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +48 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/{use-is-mobile.d.mts → use-is-mobile.d.ts} +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +25 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/hooks/{use-media-query.d.mts → use-media-query.d.ts} +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +55 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-message-scroller-commands.d.ts +22 -0
- package/dist/hooks/use-message-scroller-commands.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-commands.js +190 -0
- package/dist/hooks/use-message-scroller-commands.js.map +1 -0
- package/dist/hooks/use-message-scroller-controller.d.ts +12 -0
- package/dist/hooks/use-message-scroller-controller.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-controller.js +471 -0
- package/dist/hooks/use-message-scroller-controller.js.map +1 -0
- package/dist/hooks/use-message-scroller-refs.d.ts +54 -0
- package/dist/hooks/use-message-scroller-refs.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-refs.js +88 -0
- package/dist/hooks/use-message-scroller-refs.js.map +1 -0
- package/dist/hooks/{use-mutation-observer.d.mts → use-mutation-observer.d.ts} +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +42 -0
- package/dist/hooks/use-mutation-observer.js.map +1 -0
- package/dist/hooks/{use-pagination.d.mts → use-pagination.d.ts} +21 -28
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +117 -0
- package/dist/hooks/use-pagination.js.map +1 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/message-scroller/{geometry.d.mts → geometry.d.ts} +40 -73
- package/dist/lib/message-scroller/geometry.d.ts.map +1 -0
- package/dist/lib/message-scroller/geometry.js +246 -0
- package/dist/lib/message-scroller/geometry.js.map +1 -0
- package/dist/lib/message-scroller/{stores.d.mts → stores.d.ts} +3 -5
- package/dist/lib/message-scroller/stores.d.ts.map +1 -0
- package/dist/lib/message-scroller/stores.js +64 -0
- package/dist/lib/message-scroller/stores.js.map +1 -0
- package/dist/lib/message-scroller/types.d.ts +170 -0
- package/dist/lib/message-scroller/types.d.ts.map +1 -0
- package/dist/lib/message-scroller/types.js +66 -0
- package/dist/lib/message-scroller/types.js.map +1 -0
- package/dist/lib/message-scroller/{utils.d.mts → utils.d.ts} +2 -3
- package/dist/lib/message-scroller/utils.d.ts.map +1 -0
- package/dist/lib/message-scroller/utils.js +11 -0
- package/dist/lib/message-scroller/utils.js.map +1 -0
- package/dist/lib/{use-render.d.mts → use-render.d.ts} +14 -19
- package/dist/lib/use-render.d.ts.map +1 -0
- package/dist/lib/use-render.js +119 -0
- package/dist/lib/use-render.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/{utils.mjs → utils.js} +1 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/primitives/checkbox-group.d.ts +135 -0
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +120 -0
- package/dist/primitives/checkbox-group.js.map +1 -0
- package/dist/primitives/input-number.d.ts +109 -0
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +479 -0
- package/dist/primitives/input-number.js.map +1 -0
- package/dist/primitives/input.d.ts +77 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +83 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/message-scroller.d.ts +43 -0
- package/dist/primitives/message-scroller.d.ts.map +1 -0
- package/dist/primitives/message-scroller.js +210 -0
- package/dist/primitives/message-scroller.js.map +1 -0
- package/dist/primitives/progress-circle.d.ts +166 -0
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +171 -0
- package/dist/primitives/progress-circle.js.map +1 -0
- package/dist/variants/{alert.d.mts → alert.d.ts} +8 -9
- package/dist/variants/alert.d.ts.map +1 -0
- package/dist/variants/alert.js +24 -0
- package/dist/variants/alert.js.map +1 -0
- package/dist/variants/{attachment.d.mts → attachment.d.ts} +17 -18
- package/dist/variants/attachment.d.ts.map +1 -0
- package/dist/variants/attachment.js +54 -0
- package/dist/variants/attachment.js.map +1 -0
- package/dist/variants/badge.d.ts +21 -0
- package/dist/variants/badge.d.ts.map +1 -0
- package/dist/variants/badge.js +28 -0
- package/dist/variants/badge.js.map +1 -0
- package/dist/variants/{bubble.d.mts → bubble.d.ts} +21 -22
- package/dist/variants/bubble.d.ts.map +1 -0
- package/dist/variants/bubble.js +57 -0
- package/dist/variants/bubble.js.map +1 -0
- package/dist/variants/{button-group.d.mts → button-group.d.ts} +8 -9
- package/dist/variants/button-group.d.ts.map +1 -0
- package/dist/variants/button-group.js +24 -0
- package/dist/variants/button-group.js.map +1 -0
- package/dist/variants/button.d.ts +31 -0
- package/dist/variants/button.d.ts.map +1 -0
- package/dist/variants/button.js +39 -0
- package/dist/variants/button.js.map +1 -0
- package/dist/variants/{empty.d.mts → empty.d.ts} +8 -9
- package/dist/variants/empty.d.ts.map +1 -0
- package/dist/variants/empty.js +24 -0
- package/dist/variants/empty.js.map +1 -0
- package/dist/variants/field.d.ts +18 -0
- package/dist/variants/field.d.ts.map +1 -0
- package/dist/variants/field.js +25 -0
- package/dist/variants/field.js.map +1 -0
- package/dist/variants/{input-group.d.mts → input-group.d.ts} +16 -17
- package/dist/variants/input-group.d.ts.map +1 -0
- package/dist/variants/input-group.js +55 -0
- package/dist/variants/input-group.js.map +1 -0
- package/dist/variants/input-number.d.ts +44 -0
- package/dist/variants/input-number.d.ts.map +1 -0
- package/dist/variants/input-number.js +51 -0
- package/dist/variants/input-number.js.map +1 -0
- package/dist/variants/{item.d.mts → item.d.ts} +19 -20
- package/dist/variants/item.d.ts.map +1 -0
- package/dist/variants/item.js +50 -0
- package/dist/variants/item.js.map +1 -0
- package/dist/variants/{marker.d.mts → marker.d.ts} +9 -10
- package/dist/variants/marker.d.ts.map +1 -0
- package/dist/variants/marker.js +27 -0
- package/dist/variants/marker.js.map +1 -0
- package/dist/variants/{navigation-menu.d.mts → navigation-menu.d.ts} +4 -5
- package/dist/variants/navigation-menu.d.ts.map +1 -0
- package/dist/variants/navigation-menu.js +15 -0
- package/dist/variants/navigation-menu.js.map +1 -0
- package/dist/variants/progress-circle.d.ts +51 -0
- package/dist/variants/progress-circle.d.ts.map +1 -0
- package/dist/variants/progress-circle.js +36 -0
- package/dist/variants/progress-circle.js.map +1 -0
- package/dist/variants/scroll-area.d.ts +23 -0
- package/dist/variants/scroll-area.d.ts.map +1 -0
- package/dist/variants/scroll-area.js +63 -0
- package/dist/variants/scroll-area.js.map +1 -0
- package/dist/variants/separator.d.ts +22 -0
- package/dist/variants/separator.d.ts.map +1 -0
- package/dist/variants/separator.js +30 -0
- package/dist/variants/separator.js.map +1 -0
- package/dist/variants/sheet.d.ts +19 -0
- package/dist/variants/sheet.d.ts.map +1 -0
- package/dist/variants/sheet.js +26 -0
- package/dist/variants/sheet.js.map +1 -0
- package/dist/variants/sidebar.d.ts +22 -0
- package/dist/variants/sidebar.d.ts.map +1 -0
- package/dist/variants/sidebar.js +30 -0
- package/dist/variants/sidebar.js.map +1 -0
- package/dist/variants/{tabs.d.mts → tabs.d.ts} +8 -9
- package/dist/variants/tabs.d.ts.map +1 -0
- package/dist/variants/tabs.js +24 -0
- package/dist/variants/tabs.js.map +1 -0
- package/dist/variants/toggle.d.ts +22 -0
- package/dist/variants/toggle.d.ts.map +1 -0
- package/dist/variants/toggle.js +30 -0
- package/dist/variants/toggle.js.map +1 -0
- package/package.json +257 -260
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +1 -1
- package/src/components/aspect-ratio.tsx +1 -1
- package/src/components/attachment.tsx +1 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/bubble.tsx +1 -1
- package/src/components/button-group.tsx +1 -1
- package/src/components/button.tsx +1 -1
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.tsx +1 -1
- package/src/components/context-menu.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/direction.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/form.tsx +2 -2
- package/src/components/hover-card.tsx +1 -1
- package/src/components/item.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/marker.tsx +1 -1
- package/src/components/menubar.tsx +1 -1
- package/src/components/navigation-menu.tsx +1 -1
- package/src/components/popover.tsx +1 -1
- package/src/components/progress.tsx +1 -1
- package/src/components/radio-cards.tsx +1 -1
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/select.tsx +1 -1
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +1 -1
- package/src/components/sidebar.tsx +9 -2
- package/src/components/slider.tsx +1 -1
- package/src/components/spinner.tsx +1 -1
- package/src/components/switch.tsx +1 -1
- package/src/components/tabs.tsx +1 -1
- package/src/components/toggle-group.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/lib/message-scroller/geometry.ts +6 -2
- package/src/lib/message-scroller/stores.ts +2 -2
- package/src/primitives/checkbox-group.tsx +5 -6
- package/dist/components/accordion.d.mts +0 -52
- package/dist/components/accordion.mjs +0 -65
- package/dist/components/alert-dialog.d.mts +0 -135
- package/dist/components/alert-dialog.mjs +0 -130
- package/dist/components/alert.d.mts +0 -51
- package/dist/components/alert.mjs +0 -50
- package/dist/components/aspect-ratio.d.mts +0 -16
- package/dist/components/aspect-ratio.mjs +0 -14
- package/dist/components/attachment.mjs +0 -112
- package/dist/components/avatar.d.mts +0 -75
- package/dist/components/avatar.mjs +0 -67
- package/dist/components/badge.d.mts +0 -21
- package/dist/components/badge.mjs +0 -20
- package/dist/components/breadcrumb.d.mts +0 -85
- package/dist/components/breadcrumb.mjs +0 -89
- package/dist/components/bubble.d.mts +0 -67
- package/dist/components/bubble.mjs +0 -58
- package/dist/components/button-group.d.mts +0 -45
- package/dist/components/button-group.mjs +0 -43
- package/dist/components/button.d.mts +0 -24
- package/dist/components/button.mjs +0 -35
- package/dist/components/calendar.d.mts +0 -43
- package/dist/components/calendar.mjs +0 -117
- package/dist/components/card.d.mts +0 -85
- package/dist/components/card.mjs +0 -76
- package/dist/components/carousel.mjs +0 -172
- package/dist/components/chart.d.mts +0 -135
- package/dist/components/chart.mjs +0 -214
- package/dist/components/checkbox-cards.d.mts +0 -29
- package/dist/components/checkbox-cards.mjs +0 -36
- package/dist/components/checkbox-group.d.mts +0 -28
- package/dist/components/checkbox-group.mjs +0 -32
- package/dist/components/checkbox.d.mts +0 -17
- package/dist/components/checkbox.mjs +0 -22
- package/dist/components/collapsible.d.mts +0 -36
- package/dist/components/collapsible.mjs +0 -32
- package/dist/components/command.d.mts +0 -127
- package/dist/components/command.mjs +0 -125
- package/dist/components/context-menu.d.mts +0 -188
- package/dist/components/context-menu.mjs +0 -172
- package/dist/components/dialog.d.mts +0 -115
- package/dist/components/dialog.mjs +0 -121
- package/dist/components/direction.d.mts +0 -24
- package/dist/components/direction.mjs +0 -18
- package/dist/components/drawer.d.mts +0 -101
- package/dist/components/drawer.mjs +0 -97
- package/dist/components/dropdown-menu.d.mts +0 -189
- package/dist/components/dropdown-menu.mjs +0 -178
- package/dist/components/empty.d.mts +0 -73
- package/dist/components/empty.mjs +0 -70
- package/dist/components/field.d.mts +0 -131
- package/dist/components/field.mjs +0 -135
- package/dist/components/form.mjs +0 -113
- package/dist/components/hover-card.d.mts +0 -50
- package/dist/components/hover-card.mjs +0 -49
- package/dist/components/input-group.d.mts +0 -79
- package/dist/components/input-group.mjs +0 -87
- package/dist/components/input-number.d.mts +0 -36
- package/dist/components/input-number.mjs +0 -86
- package/dist/components/input-otp.d.mts +0 -53
- package/dist/components/input-otp.mjs +0 -62
- package/dist/components/input-password.d.mts +0 -19
- package/dist/components/input-password.mjs +0 -38
- package/dist/components/input-search.d.mts +0 -26
- package/dist/components/input-search.mjs +0 -51
- package/dist/components/input.d.mts +0 -17
- package/dist/components/input.mjs +0 -16
- package/dist/components/item.d.mts +0 -123
- package/dist/components/item.mjs +0 -120
- package/dist/components/kbd.d.mts +0 -27
- package/dist/components/kbd.mjs +0 -25
- package/dist/components/label.d.mts +0 -17
- package/dist/components/label.mjs +0 -16
- package/dist/components/marker.mjs +0 -42
- package/dist/components/menubar.d.mts +0 -202
- package/dist/components/menubar.mjs +0 -188
- package/dist/components/message-scroller.d.mts +0 -89
- package/dist/components/message-scroller.mjs +0 -77
- package/dist/components/message.mjs +0 -66
- package/dist/components/native-select.d.mts +0 -41
- package/dist/components/native-select.mjs +0 -46
- package/dist/components/navigation-menu.d.mts +0 -100
- package/dist/components/navigation-menu.mjs +0 -103
- package/dist/components/pagination.d.mts +0 -94
- package/dist/components/pagination.mjs +0 -107
- package/dist/components/popover.d.mts +0 -93
- package/dist/components/popover.mjs +0 -88
- package/dist/components/progress-circle.d.mts +0 -89
- package/dist/components/progress-circle.mjs +0 -80
- package/dist/components/progress.d.mts +0 -18
- package/dist/components/progress.mjs +0 -21
- package/dist/components/radio-cards.d.mts +0 -26
- package/dist/components/radio-cards.mjs +0 -35
- package/dist/components/radio-group.d.mts +0 -28
- package/dist/components/radio-group.mjs +0 -31
- package/dist/components/radio.d.mts +0 -20
- package/dist/components/radio.mjs +0 -18
- package/dist/components/resizable.d.mts +0 -41
- package/dist/components/resizable.mjs +0 -36
- package/dist/components/scroll-area.d.mts +0 -39
- package/dist/components/scroll-area.mjs +0 -56
- package/dist/components/select.d.mts +0 -122
- package/dist/components/select.mjs +0 -131
- package/dist/components/separator.d.mts +0 -32
- package/dist/components/separator.mjs +0 -33
- package/dist/components/sheet.d.mts +0 -119
- package/dist/components/sheet.mjs +0 -123
- package/dist/components/sidebar.d.mts +0 -320
- package/dist/components/sidebar.mjs +0 -414
- package/dist/components/skeleton.d.mts +0 -16
- package/dist/components/skeleton.mjs +0 -15
- package/dist/components/slider.d.mts +0 -21
- package/dist/components/slider.mjs +0 -41
- package/dist/components/sonner.d.mts +0 -16
- package/dist/components/sonner.mjs +0 -32
- package/dist/components/spinner.d.mts +0 -20
- package/dist/components/spinner.mjs +0 -42
- package/dist/components/switch.d.mts +0 -20
- package/dist/components/switch.mjs +0 -21
- package/dist/components/table.d.mts +0 -93
- package/dist/components/table.mjs +0 -89
- package/dist/components/tabs.d.mts +0 -53
- package/dist/components/tabs.mjs +0 -53
- package/dist/components/textarea.d.mts +0 -16
- package/dist/components/textarea.mjs +0 -15
- package/dist/components/toggle-group.d.mts +0 -46
- package/dist/components/toggle-group.mjs +0 -58
- package/dist/components/toggle.d.mts +0 -20
- package/dist/components/toggle.mjs +0 -20
- package/dist/components/tooltip.d.mts +0 -61
- package/dist/components/tooltip.mjs +0 -59
- package/dist/hooks/use-animated-value.mjs +0 -65
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -44
- package/dist/hooks/use-is-mobile.mjs +0 -27
- package/dist/hooks/use-media-query.mjs +0 -51
- package/dist/hooks/use-message-scroller-commands.d.mts +0 -39
- package/dist/hooks/use-message-scroller-commands.mjs +0 -165
- package/dist/hooks/use-message-scroller-controller.d.mts +0 -19
- package/dist/hooks/use-message-scroller-controller.mjs +0 -382
- package/dist/hooks/use-message-scroller-refs.d.mts +0 -60
- package/dist/hooks/use-message-scroller-refs.mjs +0 -77
- package/dist/hooks/use-mutation-observer.mjs +0 -42
- package/dist/hooks/use-pagination.mjs +0 -122
- package/dist/index.d.mts +0 -96
- package/dist/index.mjs +0 -95
- package/dist/lib/message-scroller/geometry.mjs +0 -199
- package/dist/lib/message-scroller/stores.mjs +0 -52
- package/dist/lib/message-scroller/types.d.mts +0 -171
- package/dist/lib/message-scroller/types.mjs +0 -53
- package/dist/lib/message-scroller/utils.mjs +0 -12
- package/dist/lib/use-render.mjs +0 -84
- package/dist/lib/utils.d.mts +0 -2
- package/dist/primitives/checkbox-group.d.mts +0 -154
- package/dist/primitives/checkbox-group.mjs +0 -137
- package/dist/primitives/input-number.d.mts +0 -119
- package/dist/primitives/input-number.mjs +0 -532
- package/dist/primitives/input.d.mts +0 -81
- package/dist/primitives/input.mjs +0 -80
- package/dist/primitives/message-scroller.d.mts +0 -88
- package/dist/primitives/message-scroller.mjs +0 -240
- package/dist/primitives/progress-circle.d.mts +0 -195
- package/dist/primitives/progress-circle.mjs +0 -189
- package/dist/variants/alert.mjs +0 -15
- package/dist/variants/attachment.mjs +0 -42
- package/dist/variants/badge.d.mts +0 -22
- package/dist/variants/badge.mjs +0 -19
- package/dist/variants/bubble.mjs +0 -45
- package/dist/variants/button-group.mjs +0 -15
- package/dist/variants/button.d.mts +0 -32
- package/dist/variants/button.mjs +0 -34
- package/dist/variants/empty.mjs +0 -15
- package/dist/variants/field.d.mts +0 -19
- package/dist/variants/field.mjs +0 -16
- package/dist/variants/input-group.mjs +0 -34
- package/dist/variants/input-number.d.mts +0 -45
- package/dist/variants/input-number.mjs +0 -40
- package/dist/variants/item.mjs +0 -38
- package/dist/variants/marker.mjs +0 -18
- package/dist/variants/navigation-menu.mjs +0 -8
- package/dist/variants/progress-circle.d.mts +0 -52
- package/dist/variants/progress-circle.mjs +0 -45
- package/dist/variants/scroll-area.d.mts +0 -24
- package/dist/variants/scroll-area.mjs +0 -58
- package/dist/variants/separator.d.mts +0 -23
- package/dist/variants/separator.mjs +0 -25
- package/dist/variants/sheet.d.mts +0 -20
- package/dist/variants/sheet.mjs +0 -17
- package/dist/variants/sidebar.d.mts +0 -23
- package/dist/variants/sidebar.mjs +0 -25
- package/dist/variants/tabs.mjs +0 -15
- package/dist/variants/toggle.d.mts +0 -23
- package/dist/variants/toggle.mjs +0 -25
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.mjs";
|
|
2
|
-
import { Button } from "./button.mjs";
|
|
3
|
-
import { useDirection } from "./direction.mjs";
|
|
4
|
-
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useCallback, useEffect, useState } from "react";
|
|
7
|
-
import useEmblaCarousel from "embla-carousel-react";
|
|
8
|
-
import { Context } from "radix-ui/internal";
|
|
9
|
-
//#region src/components/carousel.tsx
|
|
10
|
-
const CAROUSEL_NAME = "Carousel";
|
|
11
|
-
const [createCarouselContext, createCarouselScope] = Context.createContextScope(CAROUSEL_NAME);
|
|
12
|
-
const [CarouselContextProvider, useCarouselContext] = createCarouselContext(CAROUSEL_NAME);
|
|
13
|
-
/**
|
|
14
|
-
* @since 0.3.16-canary.0
|
|
15
|
-
*/
|
|
16
|
-
function Carousel({ __scopeCarousel, children, className, opts, orientation, plugins, setApi, ...props }) {
|
|
17
|
-
const direction = useDirection();
|
|
18
|
-
const [carouselRef, api] = useEmblaCarousel({
|
|
19
|
-
direction,
|
|
20
|
-
...opts,
|
|
21
|
-
axis: orientation === "vertical" ? "y" : "x"
|
|
22
|
-
}, plugins);
|
|
23
|
-
const [canScrollPrevious, setCanScrollPrevious] = useState(false);
|
|
24
|
-
const [canScrollNext, setCanScrollNext] = useState(false);
|
|
25
|
-
const onSelect = useCallback((carouselApi) => {
|
|
26
|
-
if (!carouselApi) return;
|
|
27
|
-
setCanScrollPrevious(carouselApi.canScrollPrev());
|
|
28
|
-
setCanScrollNext(carouselApi.canScrollNext());
|
|
29
|
-
}, []);
|
|
30
|
-
const scrollPrevious = useCallback(() => {
|
|
31
|
-
api?.scrollPrev();
|
|
32
|
-
}, [api]);
|
|
33
|
-
const scrollNext = useCallback(() => {
|
|
34
|
-
api?.scrollNext();
|
|
35
|
-
}, [api]);
|
|
36
|
-
const handleKeyDown = useCallback((event) => {
|
|
37
|
-
const previousKey = direction === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
38
|
-
const nextKey = direction === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
39
|
-
if (event.key === previousKey) {
|
|
40
|
-
event.preventDefault();
|
|
41
|
-
scrollPrevious();
|
|
42
|
-
} else if (event.key === nextKey) {
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
scrollNext();
|
|
45
|
-
}
|
|
46
|
-
}, [
|
|
47
|
-
direction,
|
|
48
|
-
scrollPrevious,
|
|
49
|
-
scrollNext
|
|
50
|
-
]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!api || !setApi) return;
|
|
53
|
-
setApi(api);
|
|
54
|
-
}, [api, setApi]);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (!api) return;
|
|
57
|
-
queueMicrotask(() => {
|
|
58
|
-
onSelect(api);
|
|
59
|
-
});
|
|
60
|
-
api.on("reInit", onSelect);
|
|
61
|
-
api.on("select", onSelect);
|
|
62
|
-
return () => {
|
|
63
|
-
api.off("select", onSelect);
|
|
64
|
-
};
|
|
65
|
-
}, [api, onSelect]);
|
|
66
|
-
return /* @__PURE__ */ jsx(CarouselContextProvider, {
|
|
67
|
-
api,
|
|
68
|
-
canScrollNext,
|
|
69
|
-
canScrollPrev: canScrollPrevious,
|
|
70
|
-
carouselRef,
|
|
71
|
-
opts,
|
|
72
|
-
orientation: orientation ?? (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
73
|
-
scope: __scopeCarousel,
|
|
74
|
-
scrollNext,
|
|
75
|
-
scrollPrev: scrollPrevious,
|
|
76
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
77
|
-
"aria-roledescription": "carousel",
|
|
78
|
-
className: cn("relative", className),
|
|
79
|
-
"data-slot": "carousel",
|
|
80
|
-
role: "region",
|
|
81
|
-
onKeyDownCapture: handleKeyDown,
|
|
82
|
-
...props,
|
|
83
|
-
children
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
const CAROUSEL_CONTENT_NAME = "CarouselContent";
|
|
88
|
-
/**
|
|
89
|
-
* The scroll viewport requires `overflow-hidden` (Embla hides off-screen slides
|
|
90
|
-
* with it), so any ring/shadow on slide content that sits OUTSIDE the slide's
|
|
91
|
-
* border-box is clipped where the slide meets the viewport edge. This is
|
|
92
|
-
* inherent to every Embla-based carousel — the active slide is flush with both
|
|
93
|
-
* scroll-axis edges, so left/right rings (horizontal) cannot show without
|
|
94
|
-
* revealing the neighbouring slide.
|
|
95
|
-
*
|
|
96
|
-
* To give content shadows/rings breathing room on the CROSS axis (top/bottom
|
|
97
|
-
* for horizontal carousels), add a negative-margin + matching padding via
|
|
98
|
-
* `classNames.wrapper`, e.g. `classNames={{ wrapper: "-my-2 py-2" }}`. This
|
|
99
|
-
* shifts no layout but lets the clip happen `n`px further out.
|
|
100
|
-
*
|
|
101
|
-
* @since 0.3.16-canary.0
|
|
102
|
-
*/
|
|
103
|
-
function CarouselContent({ __scopeCarousel, className, classNames, ...props }) {
|
|
104
|
-
const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);
|
|
105
|
-
return /* @__PURE__ */ jsx("div", {
|
|
106
|
-
ref: carouselRef,
|
|
107
|
-
className: cn("overflow-hidden", classNames?.wrapper),
|
|
108
|
-
"data-slot": "carousel-content",
|
|
109
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
110
|
-
className: cn("flex", orientation === "horizontal" ? "-ms-4" : "-mt-4 h-full flex-col", classNames?.content, className),
|
|
111
|
-
...props
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
const CAROUSEL_ITEM_NAME = "CarouselItem";
|
|
116
|
-
/**
|
|
117
|
-
* @since 0.3.16-canary.0
|
|
118
|
-
*/
|
|
119
|
-
function CarouselItem({ __scopeCarousel, className, ...props }) {
|
|
120
|
-
const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);
|
|
121
|
-
return /* @__PURE__ */ jsx("div", {
|
|
122
|
-
"aria-roledescription": "slide",
|
|
123
|
-
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "ps-4" : "pt-4", className),
|
|
124
|
-
"data-slot": "carousel-item",
|
|
125
|
-
role: "group",
|
|
126
|
-
...props
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
const CAROUSEL_PREVIOUS_NAME = "CarouselPrevious";
|
|
130
|
-
/**
|
|
131
|
-
* @since 0.3.16-canary.0
|
|
132
|
-
*/
|
|
133
|
-
function CarouselPrevious({ __scopeCarousel, className, size = "icon-sm", variant = "outline", ...props }) {
|
|
134
|
-
const { canScrollPrev, orientation, scrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);
|
|
135
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
136
|
-
"aria-label": "Previous slide",
|
|
137
|
-
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "-inset-s-12 top-1/2 -translate-y-1/2 active:not-aria-[haspopup]:translate-y-[calc(-50%+1px)]" : "inset-s-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", className),
|
|
138
|
-
"data-slot": "carousel-previous",
|
|
139
|
-
disabled: !canScrollPrev,
|
|
140
|
-
size,
|
|
141
|
-
variant,
|
|
142
|
-
onClick: scrollPrev,
|
|
143
|
-
...props,
|
|
144
|
-
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { className: "rtl:rotate-180" }), /* @__PURE__ */ jsx("span", {
|
|
145
|
-
className: "sr-only",
|
|
146
|
-
children: "Previous slide"
|
|
147
|
-
})]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const CAROUSEL_NEXT_NAME = "CarouselNext";
|
|
151
|
-
/**
|
|
152
|
-
* @since 0.3.16-canary.0
|
|
153
|
-
*/
|
|
154
|
-
function CarouselNext({ __scopeCarousel, className, size = "icon-sm", variant = "outline", ...props }) {
|
|
155
|
-
const { canScrollNext, orientation, scrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);
|
|
156
|
-
return /* @__PURE__ */ jsxs(Button, {
|
|
157
|
-
"aria-label": "Next slide",
|
|
158
|
-
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "-inset-e-12 top-1/2 -translate-y-1/2 active:not-aria-[haspopup]:translate-y-[calc(-50%+1px)]" : "inset-s-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2", className),
|
|
159
|
-
"data-slot": "carousel-next",
|
|
160
|
-
disabled: !canScrollNext,
|
|
161
|
-
size,
|
|
162
|
-
variant,
|
|
163
|
-
onClick: scrollNext,
|
|
164
|
-
...props,
|
|
165
|
-
children: [/* @__PURE__ */ jsx(ChevronRightIcon, { className: "rtl:rotate-180" }), /* @__PURE__ */ jsx("span", {
|
|
166
|
-
className: "sr-only",
|
|
167
|
-
children: "Next slide"
|
|
168
|
-
})]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
|
-
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, createCarouselScope };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";
|
|
2
|
-
import { Context } from "radix-ui/internal";
|
|
3
|
-
import * as RechartsPrimitive from "recharts";
|
|
4
|
-
import { TooltipContentProps, TooltipProps } from "recharts";
|
|
5
|
-
import { NameType, Payload, ValueType } from "recharts/types/component/DefaultTooltipContent";
|
|
6
|
-
|
|
7
|
-
//#region src/components/chart.d.ts
|
|
8
|
-
type ExtractProps<T> = T extends ((props: infer P) => ReactNode) ? P : never;
|
|
9
|
-
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
10
|
-
declare const THEMES: {
|
|
11
|
-
readonly dark: ".dark";
|
|
12
|
-
readonly light: "";
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @since 0.3.16-canary.0
|
|
16
|
-
*/
|
|
17
|
-
type ChartConfig = Record<string, {
|
|
18
|
-
label?: ReactNode;
|
|
19
|
-
icon?: ComponentType;
|
|
20
|
-
} & ({
|
|
21
|
-
color?: never;
|
|
22
|
-
theme: Record<keyof typeof THEMES, string>;
|
|
23
|
-
} | {
|
|
24
|
-
color?: string;
|
|
25
|
-
theme?: never;
|
|
26
|
-
})>;
|
|
27
|
-
type ScopedProps<P> = P & {
|
|
28
|
-
__scopeChart?: Context.Scope;
|
|
29
|
-
};
|
|
30
|
-
declare const createChartScope: Context.CreateScope;
|
|
31
|
-
/**
|
|
32
|
-
* @since 0.3.16-canary.0
|
|
33
|
-
*/
|
|
34
|
-
interface ChartContainerProps extends ComponentProps<"div"> {
|
|
35
|
-
children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
36
|
-
config: ChartConfig;
|
|
37
|
-
initialDimension?: {
|
|
38
|
-
height: number;
|
|
39
|
-
width: number;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @since 0.3.16-canary.0
|
|
44
|
-
*/
|
|
45
|
-
declare function ChartContainer({
|
|
46
|
-
__scopeChart,
|
|
47
|
-
children,
|
|
48
|
-
className,
|
|
49
|
-
config,
|
|
50
|
-
id,
|
|
51
|
-
initialDimension,
|
|
52
|
-
...props
|
|
53
|
-
}: ScopedProps<ChartContainerProps>): JSX.Element;
|
|
54
|
-
/**
|
|
55
|
-
* @since 0.3.16-canary.0
|
|
56
|
-
*/
|
|
57
|
-
interface ChartStyleProps {
|
|
58
|
-
config: ChartConfig;
|
|
59
|
-
id: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @since 0.3.16-canary.0
|
|
63
|
-
*/
|
|
64
|
-
declare function ChartStyle({
|
|
65
|
-
config,
|
|
66
|
-
id
|
|
67
|
-
}: ChartStyleProps): ReactNode;
|
|
68
|
-
/**
|
|
69
|
-
* @since 0.3.16-canary.0
|
|
70
|
-
*/
|
|
71
|
-
type ChartTooltipProps<TValue extends ValueType, TName extends NameType> = TooltipProps<TValue, TName>;
|
|
72
|
-
/**
|
|
73
|
-
* @since 0.3.16-canary.0
|
|
74
|
-
*/
|
|
75
|
-
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
76
|
-
/**
|
|
77
|
-
* @since 0.3.16-canary.0
|
|
78
|
-
*/
|
|
79
|
-
type ChartTooltipContentProps<TValue extends ValueType, TName extends NameType> = Omit<MakeOptional<TooltipContentProps<TValue, TName>, "accessibilityLayer" | "active" | "activeIndex" | "coordinate" | "payload">, "payload"> & {
|
|
80
|
-
hideIndicator?: boolean;
|
|
81
|
-
hideLabel?: boolean;
|
|
82
|
-
indicator?: "dashed" | "dot" | "line";
|
|
83
|
-
labelKey?: string;
|
|
84
|
-
nameKey?: string;
|
|
85
|
-
color?: string | undefined;
|
|
86
|
-
className?: string | undefined;
|
|
87
|
-
payload?: Array<Payload<TValue, TName>>;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* @since 0.3.16-canary.0
|
|
91
|
-
*/
|
|
92
|
-
declare function ChartTooltipContent<TValue extends ValueType, TName extends NameType>({
|
|
93
|
-
__scopeChart,
|
|
94
|
-
active,
|
|
95
|
-
className,
|
|
96
|
-
color,
|
|
97
|
-
formatter,
|
|
98
|
-
hideIndicator,
|
|
99
|
-
hideLabel,
|
|
100
|
-
indicator,
|
|
101
|
-
label,
|
|
102
|
-
labelClassName,
|
|
103
|
-
labelFormatter,
|
|
104
|
-
labelKey,
|
|
105
|
-
nameKey,
|
|
106
|
-
payload
|
|
107
|
-
}: ScopedProps<ChartTooltipContentProps<TValue, TName>>): ReactNode;
|
|
108
|
-
/**
|
|
109
|
-
* @since 0.3.16-canary.0
|
|
110
|
-
*/
|
|
111
|
-
type ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;
|
|
112
|
-
/**
|
|
113
|
-
* @since 0.3.16-canary.0
|
|
114
|
-
*/
|
|
115
|
-
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
116
|
-
/**
|
|
117
|
-
* @since 0.3.16-canary.0
|
|
118
|
-
*/
|
|
119
|
-
type ChartLegendContentProps = ComponentProps<"div"> & ExtractProps<RechartsPrimitive.LegendProps["content"]> & {
|
|
120
|
-
hideIcon?: boolean;
|
|
121
|
-
nameKey?: string;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* @since 0.3.16-canary.0
|
|
125
|
-
*/
|
|
126
|
-
declare function ChartLegendContent({
|
|
127
|
-
__scopeChart,
|
|
128
|
-
className,
|
|
129
|
-
hideIcon,
|
|
130
|
-
nameKey,
|
|
131
|
-
payload,
|
|
132
|
-
verticalAlign
|
|
133
|
-
}: ScopedProps<ChartLegendContentProps>): ReactNode;
|
|
134
|
-
//#endregion
|
|
135
|
-
export { type ChartConfig, ChartContainer, type ChartContainerProps, ChartLegend, ChartLegendContent, type ChartLegendContentProps, type ChartLegendProps, ChartStyle, type ChartStyleProps, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, type ChartTooltipProps, createChartScope };
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.mjs";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useId, useMemo } from "react";
|
|
4
|
-
import { Context } from "radix-ui/internal";
|
|
5
|
-
import * as RechartsPrimitive from "recharts";
|
|
6
|
-
//#region src/components/chart.tsx
|
|
7
|
-
const THEMES = {
|
|
8
|
-
dark: ".dark",
|
|
9
|
-
light: ""
|
|
10
|
-
};
|
|
11
|
-
const INITIAL_DIMENSION = {
|
|
12
|
-
height: 200,
|
|
13
|
-
width: 320
|
|
14
|
-
};
|
|
15
|
-
const CHART_PROVIDER_NAME = "ChartProvider";
|
|
16
|
-
const [createChartContext, createChartScope] = Context.createContextScope(CHART_PROVIDER_NAME);
|
|
17
|
-
const [ChartContextProvider, useChartContext] = createChartContext(CHART_PROVIDER_NAME);
|
|
18
|
-
/**
|
|
19
|
-
* @since 0.3.16-canary.0
|
|
20
|
-
*/
|
|
21
|
-
function ChartContainer({ __scopeChart, children, className, config, id, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
22
|
-
const uniqueId = useId();
|
|
23
|
-
const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
|
|
24
|
-
return /* @__PURE__ */ jsx(ChartContextProvider, {
|
|
25
|
-
config,
|
|
26
|
-
scope: __scopeChart,
|
|
27
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
28
|
-
className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
29
|
-
"data-chart": chartId,
|
|
30
|
-
"data-slot": "chart",
|
|
31
|
-
...props,
|
|
32
|
-
children: [/* @__PURE__ */ jsx(ChartStyle, {
|
|
33
|
-
config,
|
|
34
|
-
id: chartId
|
|
35
|
-
}), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, {
|
|
36
|
-
initialDimension,
|
|
37
|
-
children
|
|
38
|
-
})]
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @since 0.3.16-canary.0
|
|
44
|
-
*/
|
|
45
|
-
function ChartStyle({ config, id }) {
|
|
46
|
-
const colorConfig = Object.entries(config).filter(([, itemConfig]) => itemConfig.theme ?? itemConfig.color);
|
|
47
|
-
if (colorConfig.length === 0) return null;
|
|
48
|
-
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: generateChartStyles(id, colorConfig) } });
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @since 0.3.16-canary.0
|
|
52
|
-
*/
|
|
53
|
-
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
54
|
-
const CHART_TOOLTIP_CONTENT_NAME = "ChartTooltipContent";
|
|
55
|
-
/**
|
|
56
|
-
* @since 0.3.16-canary.0
|
|
57
|
-
*/
|
|
58
|
-
function ChartTooltipContent({ __scopeChart, active, className, color, formatter, hideIndicator = false, hideLabel = false, indicator = "dot", label, labelClassName, labelFormatter, labelKey, nameKey, payload = [] }) {
|
|
59
|
-
const { config } = useChartContext(CHART_TOOLTIP_CONTENT_NAME, __scopeChart);
|
|
60
|
-
const tooltipLabel = useMemo(() => {
|
|
61
|
-
if (hideLabel || payload.length === 0) return null;
|
|
62
|
-
const item = payload[0];
|
|
63
|
-
if (item === void 0) return null;
|
|
64
|
-
const key = safeToString(labelKey ?? item.dataKey ?? item.name ?? "value");
|
|
65
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
66
|
-
const configEntry = typeof label === "string" && label in config ? config[label] : void 0;
|
|
67
|
-
const value = !labelKey && typeof label === "string" ? configEntry !== void 0 ? configEntry.label ?? label : label : itemConfig?.label;
|
|
68
|
-
if (labelFormatter) return /* @__PURE__ */ jsx("div", {
|
|
69
|
-
className: cn("font-medium", labelClassName),
|
|
70
|
-
children: labelFormatter(value, payload)
|
|
71
|
-
});
|
|
72
|
-
if (!value) return null;
|
|
73
|
-
return /* @__PURE__ */ jsx("div", {
|
|
74
|
-
className: cn("font-medium", labelClassName),
|
|
75
|
-
children: value
|
|
76
|
-
});
|
|
77
|
-
}, [
|
|
78
|
-
label,
|
|
79
|
-
labelFormatter,
|
|
80
|
-
payload,
|
|
81
|
-
hideLabel,
|
|
82
|
-
labelClassName,
|
|
83
|
-
config,
|
|
84
|
-
labelKey
|
|
85
|
-
]);
|
|
86
|
-
if (!active || payload.length === 0) return null;
|
|
87
|
-
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
88
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
89
|
-
className: cn("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
90
|
-
children: [nestLabel ? null : tooltipLabel, /* @__PURE__ */ jsx("div", {
|
|
91
|
-
className: "grid gap-1.5",
|
|
92
|
-
children: payload.map((item, index) => {
|
|
93
|
-
const key = safeToString(nameKey ?? item.name ?? item.dataKey ?? "value");
|
|
94
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
95
|
-
const indicatorColor = color ?? (isRecord(item.payload) && "fill" in item.payload && typeof item.payload.fill === "string" ? item.payload.fill : void 0) ?? item.color;
|
|
96
|
-
return /* @__PURE__ */ jsx("div", {
|
|
97
|
-
className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"),
|
|
98
|
-
children: formatter && item.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, [item]) : /* @__PURE__ */ jsxs(Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
|
|
99
|
-
className: cn("shrink-0 rounded-xs border-(--color-border) bg-(--color-bg)", {
|
|
100
|
-
"h-2.5 w-2.5": indicator === "dot",
|
|
101
|
-
"my-0.5": nestLabel && indicator === "dashed",
|
|
102
|
-
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
103
|
-
"w-1": indicator === "line"
|
|
104
|
-
}),
|
|
105
|
-
style: {
|
|
106
|
-
"--color-bg": indicatorColor,
|
|
107
|
-
"--color-border": indicatorColor
|
|
108
|
-
}
|
|
109
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
110
|
-
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
111
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
112
|
-
className: "grid gap-1.5",
|
|
113
|
-
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
|
|
114
|
-
className: "text-muted-foreground",
|
|
115
|
-
children: itemConfig?.label ?? item.name
|
|
116
|
-
})]
|
|
117
|
-
}), item.value != null && /* @__PURE__ */ jsx("span", {
|
|
118
|
-
className: "font-mono font-medium text-foreground tabular-nums",
|
|
119
|
-
children: typeof item.value === "number" ? item.value.toLocaleString() : safeToString(item.value)
|
|
120
|
-
})]
|
|
121
|
-
})] })
|
|
122
|
-
}, key);
|
|
123
|
-
})
|
|
124
|
-
})]
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @since 0.3.16-canary.0
|
|
129
|
-
*/
|
|
130
|
-
const ChartLegend = RechartsPrimitive.Legend;
|
|
131
|
-
const CHART_LEGEND_CONTENT_NAME = "ChartLegendContent";
|
|
132
|
-
/**
|
|
133
|
-
* @since 0.3.16-canary.0
|
|
134
|
-
*/
|
|
135
|
-
function ChartLegendContent({ __scopeChart, className, hideIcon = false, nameKey, payload, verticalAlign = "bottom" }) {
|
|
136
|
-
const { config } = useChartContext(CHART_LEGEND_CONTENT_NAME, __scopeChart);
|
|
137
|
-
if (!payload?.length) return null;
|
|
138
|
-
return /* @__PURE__ */ jsx("div", {
|
|
139
|
-
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
140
|
-
children: payload.map((item) => {
|
|
141
|
-
let key = "value";
|
|
142
|
-
if (nameKey) key = nameKey;
|
|
143
|
-
else if (item.dataKey != null) key = safeToString(item.dataKey);
|
|
144
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
145
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
146
|
-
className: "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground",
|
|
147
|
-
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
|
|
148
|
-
className: "h-2 w-2 shrink-0 rounded-xs",
|
|
149
|
-
style: { backgroundColor: item.color }
|
|
150
|
-
}), itemConfig?.label]
|
|
151
|
-
}, nameKey ? safeToString(itemConfig?.color ?? "") : safeToString(item.value ?? ""));
|
|
152
|
-
})
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Type guard to check if an unknown value is a record with string keys
|
|
157
|
-
*/
|
|
158
|
-
function isRecord(value) {
|
|
159
|
-
return typeof value === "object" && value !== null;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Safely gets a string value from a record by key
|
|
163
|
-
*/
|
|
164
|
-
function getStringValue(record, key) {
|
|
165
|
-
if (key in record) {
|
|
166
|
-
const value = record[key];
|
|
167
|
-
return typeof value === "string" ? value : void 0;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Safely converts a value to string without type coercion
|
|
172
|
-
*/
|
|
173
|
-
function safeToString(value) {
|
|
174
|
-
if (typeof value === "string") return value;
|
|
175
|
-
if (typeof value === "number") return value.toString();
|
|
176
|
-
if (value === null || value === void 0) return "";
|
|
177
|
-
if (typeof value === "boolean") return value.toString();
|
|
178
|
-
if (typeof value === "bigint") return value.toString();
|
|
179
|
-
if (typeof value === "symbol") return value.toString();
|
|
180
|
-
return "";
|
|
181
|
-
}
|
|
182
|
-
function getPayloadConfigFromPayload(config, payload, key) {
|
|
183
|
-
if (!isRecord(payload)) return;
|
|
184
|
-
const payloadPayload = isRecord(payload.payload) ? payload.payload : void 0;
|
|
185
|
-
let configLabelKey = key;
|
|
186
|
-
const payloadValue = getStringValue(payload, key);
|
|
187
|
-
if (payloadValue) configLabelKey = payloadValue;
|
|
188
|
-
else if (payloadPayload) {
|
|
189
|
-
const nestedValue = getStringValue(payloadPayload, key);
|
|
190
|
-
if (nestedValue) configLabelKey = nestedValue;
|
|
191
|
-
}
|
|
192
|
-
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Generates CSS custom property for a specific theme and config item
|
|
196
|
-
*/
|
|
197
|
-
function generateCssVariable(key, itemConfig, theme) {
|
|
198
|
-
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
199
|
-
return color ? ` --color-${key}: ${color};` : null;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Generates CSS rules for a specific theme
|
|
203
|
-
*/
|
|
204
|
-
function generateThemeStyles(theme, prefix, id, colorConfig) {
|
|
205
|
-
return `${prefix} [data-chart=${id}] {\n${colorConfig.map(([key, itemConfig]) => generateCssVariable(key, itemConfig, theme)).filter(Boolean).join("\n")}\n}`;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Generates complete CSS styles for all themes
|
|
209
|
-
*/
|
|
210
|
-
function generateChartStyles(id, colorConfig) {
|
|
211
|
-
return Object.entries(THEMES).map(([theme, prefix]) => generateThemeStyles(theme, prefix, id, colorConfig)).join("\n\n");
|
|
212
|
-
}
|
|
213
|
-
//#endregion
|
|
214
|
-
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, createChartScope };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { CheckboxGroup, CheckboxGroupItem } from "../primitives/checkbox-group.mjs";
|
|
2
|
-
import { ComponentProps, JSX } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/checkbox-cards.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
type CheckboxCardsProps = ComponentProps<typeof CheckboxGroup>;
|
|
9
|
-
/**
|
|
10
|
-
* @since 0.3.16-canary.0
|
|
11
|
-
*/
|
|
12
|
-
declare function CheckboxCards(props: CheckboxCardsProps): JSX.Element;
|
|
13
|
-
/**
|
|
14
|
-
* @since 0.3.16-canary.0
|
|
15
|
-
*/
|
|
16
|
-
interface CheckboxCardsItemProps extends ComponentProps<typeof CheckboxGroupItem> {
|
|
17
|
-
checkboxClassName?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @since 0.3.16-canary.0
|
|
21
|
-
*/
|
|
22
|
-
declare function CheckboxCardsItem({
|
|
23
|
-
checkboxClassName,
|
|
24
|
-
children,
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
}: CheckboxCardsItemProps): JSX.Element;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { CheckboxCards, CheckboxCardsItem, type CheckboxCardsItemProps, type CheckboxCardsProps };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.mjs";
|
|
2
|
-
import { Label } from "./label.mjs";
|
|
3
|
-
import { CheckboxGroup, CheckboxGroupIndicator, CheckboxGroupItem } from "../primitives/checkbox-group.mjs";
|
|
4
|
-
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/checkbox-cards.tsx
|
|
7
|
-
/**
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
function CheckboxCards(props) {
|
|
11
|
-
return /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
12
|
-
"data-slot": "checkbox-cards",
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @since 0.3.16-canary.0
|
|
18
|
-
*/
|
|
19
|
-
function CheckboxCardsItem({ checkboxClassName, children, className, ...props }) {
|
|
20
|
-
return /* @__PURE__ */ jsxs(Label, {
|
|
21
|
-
className: cn("flex items-start gap-3 rounded-md border border-input p-3 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-data-indeterminate:border-primary/30 has-data-indeterminate:bg-primary/5", className),
|
|
22
|
-
"data-slot": "checkbox-card",
|
|
23
|
-
children: [/* @__PURE__ */ jsx(CheckboxGroupItem, {
|
|
24
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary", checkboxClassName),
|
|
25
|
-
"data-slot": "checkbox-card-item",
|
|
26
|
-
...props,
|
|
27
|
-
children: /* @__PURE__ */ jsxs(CheckboxGroupIndicator, {
|
|
28
|
-
className: "group/checkbox-card-indicator grid animate-in place-content-center text-current duration-control-indicator ease-spring zoom-in-50 [&>svg]:size-3.5",
|
|
29
|
-
"data-slot": "checkbox-card-indicator",
|
|
30
|
-
children: [/* @__PURE__ */ jsx(CheckIcon, { className: "group-data-indeterminate/checkbox-card-indicator:hidden" }), /* @__PURE__ */ jsx(MinusIcon, { className: "hidden group-data-indeterminate/checkbox-card-indicator:block" })]
|
|
31
|
-
})
|
|
32
|
-
}), children]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { CheckboxCards, CheckboxCardsItem };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { CheckboxGroup as CheckboxGroup$1, CheckboxGroupItem as CheckboxGroupItem$1 } from "../primitives/checkbox-group.mjs";
|
|
2
|
-
import { ComponentProps, JSX } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/checkbox-group.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
type CheckboxGroupProps = ComponentProps<typeof CheckboxGroup$1>;
|
|
9
|
-
/**
|
|
10
|
-
* @since 0.3.16-canary.0
|
|
11
|
-
*/
|
|
12
|
-
declare function CheckboxGroup({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}: CheckboxGroupProps): JSX.Element;
|
|
16
|
-
/**
|
|
17
|
-
* @since 0.3.16-canary.0
|
|
18
|
-
*/
|
|
19
|
-
type CheckboxGroupItemProps = ComponentProps<typeof CheckboxGroupItem$1>;
|
|
20
|
-
/**
|
|
21
|
-
* @since 0.3.16-canary.0
|
|
22
|
-
*/
|
|
23
|
-
declare function CheckboxGroupItem({
|
|
24
|
-
className,
|
|
25
|
-
...props
|
|
26
|
-
}: CheckboxGroupItemProps): JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { CheckboxGroup, CheckboxGroupItem, type CheckboxGroupItemProps, type CheckboxGroupProps };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils.mjs";
|
|
2
|
-
import { CheckboxGroup as CheckboxGroup$1, CheckboxGroupIndicator, CheckboxGroupItem as CheckboxGroupItem$1 } from "../primitives/checkbox-group.mjs";
|
|
3
|
-
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/checkbox-group.tsx
|
|
6
|
-
/**
|
|
7
|
-
* @since 0.3.16-canary.0
|
|
8
|
-
*/
|
|
9
|
-
function CheckboxGroup({ className, ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(CheckboxGroup$1, {
|
|
11
|
-
className: cn("grid gap-2", className),
|
|
12
|
-
"data-slot": "checkbox-group",
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @since 0.3.16-canary.0
|
|
18
|
-
*/
|
|
19
|
-
function CheckboxGroupItem({ className, ...props }) {
|
|
20
|
-
return /* @__PURE__ */ jsx(CheckboxGroupItem$1, {
|
|
21
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary", className),
|
|
22
|
-
"data-slot": "checkbox-group-item",
|
|
23
|
-
...props,
|
|
24
|
-
children: /* @__PURE__ */ jsxs(CheckboxGroupIndicator, {
|
|
25
|
-
className: "group/checkbox-group-indicator grid animate-in place-content-center text-current duration-control-indicator ease-spring zoom-in-50 [&>svg]:size-3.5",
|
|
26
|
-
"data-slot": "checkbox-group-indicator",
|
|
27
|
-
children: [/* @__PURE__ */ jsx(CheckIcon, { className: "group-data-indeterminate/checkbox-group-indicator:hidden" }), /* @__PURE__ */ jsx(MinusIcon, { className: "hidden group-data-indeterminate/checkbox-group-indicator:block" })]
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { CheckboxGroup, CheckboxGroupItem };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
2
|
-
import { ComponentProps, JSX } from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/checkbox.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
type CheckboxProps = ComponentProps<typeof Checkbox$1.Root>;
|
|
9
|
-
/**
|
|
10
|
-
* @since 0.3.16-canary.0
|
|
11
|
-
*/
|
|
12
|
-
declare function Checkbox({
|
|
13
|
-
className,
|
|
14
|
-
...props
|
|
15
|
-
}: CheckboxProps): JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { Checkbox, type CheckboxProps };
|