@arolariu/components 0.0.37 → 0.0.39
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 +94 -0
- package/CONTRIBUTING.md +371 -0
- package/DEBUGGING.md +401 -0
- package/EXAMPLES.md +1035 -0
- package/LICENSE +21 -21
- package/README.md +627 -0
- package/dist/cjs/components/ui/accordion.cjs +2 -2
- package/dist/cjs/components/ui/accordion.cjs.map +1 -1
- package/dist/cjs/components/ui/alert-dialog.cjs +7 -7
- package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/alert.cjs +2 -2
- package/dist/cjs/components/ui/alert.cjs.map +1 -1
- package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/ui/avatar.cjs +2 -2
- package/dist/cjs/components/ui/avatar.cjs.map +1 -1
- package/dist/cjs/components/ui/background-beams.cjs +1 -11
- package/dist/cjs/components/ui/background-beams.cjs.map +1 -1
- package/dist/cjs/components/ui/badge.cjs +2 -2
- package/dist/cjs/components/ui/badge.cjs.map +1 -1
- package/dist/cjs/components/ui/breadcrumb.cjs +5 -5
- package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/ui/bubble-background.cjs.map +1 -1
- package/dist/cjs/components/ui/button.cjs.map +1 -1
- package/dist/cjs/components/ui/calendar.cjs +89 -35
- package/dist/cjs/components/ui/calendar.cjs.map +1 -1
- package/dist/cjs/components/ui/card.cjs +5 -5
- package/dist/cjs/components/ui/card.cjs.map +1 -1
- package/dist/cjs/components/ui/carousel.cjs +3 -3
- package/dist/cjs/components/ui/carousel.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs +14 -14
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
- package/dist/cjs/components/ui/collapsible.cjs +2 -2
- package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
- package/dist/cjs/components/ui/command.cjs +8 -7
- package/dist/cjs/components/ui/command.cjs.map +1 -1
- package/dist/cjs/components/ui/context-menu.cjs +9 -9
- package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/counting-number.cjs.map +1 -1
- package/dist/cjs/components/ui/dialog.cjs +8 -7
- package/dist/cjs/components/ui/dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/dot-background.cjs.map +1 -1
- package/dist/cjs/components/ui/drawer.cjs +6 -6
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs +10 -10
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdrawer.cjs +627 -0
- package/dist/cjs/components/ui/dropdrawer.cjs.map +1 -0
- package/dist/cjs/components/ui/fireworks-background.cjs.map +1 -1
- package/dist/cjs/components/ui/flip-button.cjs.map +1 -1
- package/dist/cjs/components/ui/form.cjs +5 -5
- package/dist/cjs/components/ui/form.cjs.map +1 -1
- package/dist/cjs/components/ui/gradient-background.cjs.map +1 -1
- package/dist/cjs/components/ui/gradient-text.cjs.map +1 -1
- package/dist/cjs/components/ui/highlight-text.cjs.map +1 -1
- package/dist/cjs/components/ui/hole-background.cjs.map +1 -1
- package/dist/cjs/components/ui/hover-card.cjs +2 -2
- package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
- package/dist/cjs/components/ui/input-otp.cjs +3 -3
- package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
- package/dist/cjs/components/ui/input.cjs.map +1 -1
- package/dist/cjs/components/ui/label.cjs.map +1 -1
- package/dist/cjs/components/ui/menubar.cjs +9 -9
- package/dist/cjs/components/ui/menubar.cjs.map +1 -1
- package/dist/cjs/components/ui/navigation-menu.cjs +4 -4
- package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/pagination.cjs +3 -3
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/components/ui/popover.cjs.map +1 -1
- package/dist/cjs/components/ui/progress.cjs.map +1 -1
- package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
- package/dist/cjs/components/ui/resizable.cjs +1 -1
- package/dist/cjs/components/ui/resizable.cjs.map +1 -1
- package/dist/cjs/components/ui/ripple-button.cjs.map +1 -1
- package/dist/cjs/components/ui/scratcher.cjs.map +1 -1
- package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
- package/dist/cjs/components/ui/select.cjs +5 -5
- package/dist/cjs/components/ui/select.cjs.map +1 -1
- package/dist/cjs/components/ui/separator.cjs +1 -1
- package/dist/cjs/components/ui/separator.cjs.map +1 -1
- package/dist/cjs/components/ui/sheet.cjs +5 -5
- package/dist/cjs/components/ui/sheet.cjs.map +1 -1
- package/dist/cjs/components/ui/sidebar.cjs +19 -19
- package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
- package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
- package/dist/cjs/components/ui/slider.cjs.map +1 -1
- package/dist/cjs/components/ui/sonner.cjs.map +1 -1
- package/dist/cjs/components/ui/switch.cjs.map +1 -1
- package/dist/cjs/components/ui/table.cjs +6 -6
- package/dist/cjs/components/ui/table.cjs.map +1 -1
- package/dist/cjs/components/ui/tabs.cjs +2 -2
- package/dist/cjs/components/ui/tabs.cjs.map +1 -1
- package/dist/cjs/components/ui/textarea.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle-group.cjs +2 -2
- package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle.cjs +2 -2
- package/dist/cjs/components/ui/toggle.cjs.map +1 -1
- package/dist/cjs/components/ui/tooltip.cjs +2 -2
- package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
- package/dist/cjs/hooks/use-mobile.cjs.map +1 -1
- package/dist/cjs/index.cjs +268 -232
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.css +2558 -193
- package/dist/cjs/index.css.map +1 -0
- package/dist/cjs/lib/utils.cjs.map +1 -1
- package/dist/esm/components/ui/accordion.js +14 -14
- package/dist/esm/components/ui/accordion.js.map +1 -1
- package/dist/esm/components/ui/alert-dialog.js +25 -25
- package/dist/esm/components/ui/alert-dialog.js.map +1 -1
- package/dist/esm/components/ui/alert.js +10 -10
- package/dist/esm/components/ui/alert.js.map +1 -1
- package/dist/esm/components/ui/aspect-ratio.js +3 -3
- package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
- package/dist/esm/components/ui/avatar.js +9 -9
- package/dist/esm/components/ui/avatar.js.map +1 -1
- package/dist/esm/components/ui/background-beams.js +20 -20
- package/dist/esm/components/ui/background-beams.js.map +1 -1
- package/dist/esm/components/ui/badge.js +8 -8
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/breadcrumb.js +21 -21
- package/dist/esm/components/ui/breadcrumb.js.map +1 -1
- package/dist/esm/components/ui/bubble-background.js +31 -31
- package/dist/esm/components/ui/bubble-background.js.map +1 -1
- package/dist/esm/components/ui/button.js +8 -8
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/calendar.js +93 -42
- package/dist/esm/components/ui/calendar.js.map +1 -1
- package/dist/esm/components/ui/card.js +16 -16
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/carousel.js +33 -33
- package/dist/esm/components/ui/carousel.js.map +1 -1
- package/dist/esm/components/ui/chart.js +45 -45
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/checkbox.js +8 -8
- package/dist/esm/components/ui/checkbox.js.map +1 -1
- package/dist/esm/components/ui/collapsible.js +8 -8
- package/dist/esm/components/ui/collapsible.js.map +1 -1
- package/dist/esm/components/ui/command.js +33 -32
- package/dist/esm/components/ui/command.js.map +1 -1
- package/dist/esm/components/ui/context-menu.js +36 -36
- package/dist/esm/components/ui/context-menu.js.map +1 -1
- package/dist/esm/components/ui/counting-number.js +12 -12
- package/dist/esm/components/ui/counting-number.js.map +1 -1
- package/dist/esm/components/ui/dialog.js +27 -26
- package/dist/esm/components/ui/dialog.js.map +1 -1
- package/dist/esm/components/ui/dot-background.js +15 -15
- package/dist/esm/components/ui/dot-background.js.map +1 -1
- package/dist/esm/components/ui/drawer.js +24 -24
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js +36 -36
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/dropdrawer.js +563 -0
- package/dist/esm/components/ui/dropdrawer.js.map +1 -0
- package/dist/esm/components/ui/fireworks-background.js +12 -12
- package/dist/esm/components/ui/fireworks-background.js.map +1 -1
- package/dist/esm/components/ui/flip-button.js +12 -12
- package/dist/esm/components/ui/flip-button.js.map +1 -1
- package/dist/esm/components/ui/form.js +26 -26
- package/dist/esm/components/ui/form.js.map +1 -1
- package/dist/esm/components/ui/gradient-background.js +7 -7
- package/dist/esm/components/ui/gradient-background.js.map +1 -1
- package/dist/esm/components/ui/gradient-text.js +9 -9
- package/dist/esm/components/ui/gradient-text.js.map +1 -1
- package/dist/esm/components/ui/highlight-text.js +10 -10
- package/dist/esm/components/ui/highlight-text.js.map +1 -1
- package/dist/esm/components/ui/hole-background.js +30 -30
- package/dist/esm/components/ui/hole-background.js.map +1 -1
- package/dist/esm/components/ui/hover-card.js +8 -8
- package/dist/esm/components/ui/hover-card.js.map +1 -1
- package/dist/esm/components/ui/input-otp.js +17 -17
- package/dist/esm/components/ui/input-otp.js.map +1 -1
- package/dist/esm/components/ui/input.js +4 -4
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/label.js +5 -5
- package/dist/esm/components/ui/label.js.map +1 -1
- package/dist/esm/components/ui/menubar.js +39 -39
- package/dist/esm/components/ui/menubar.js.map +1 -1
- package/dist/esm/components/ui/navigation-menu.js +27 -27
- package/dist/esm/components/ui/navigation-menu.js.map +1 -1
- package/dist/esm/components/ui/pagination.js +23 -23
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/components/ui/popover.js +9 -9
- package/dist/esm/components/ui/popover.js.map +1 -1
- package/dist/esm/components/ui/progress.js +6 -6
- package/dist/esm/components/ui/progress.js.map +1 -1
- package/dist/esm/components/ui/radio-group.js +10 -10
- package/dist/esm/components/ui/radio-group.js.map +1 -1
- package/dist/esm/components/ui/resizable.js +11 -11
- package/dist/esm/components/ui/resizable.js.map +1 -1
- package/dist/esm/components/ui/ripple-button.js +14 -14
- package/dist/esm/components/ui/ripple-button.js.map +1 -1
- package/dist/esm/components/ui/scratcher.js +13 -13
- package/dist/esm/components/ui/scratcher.js.map +1 -1
- package/dist/esm/components/ui/scroll-area.js +11 -11
- package/dist/esm/components/ui/scroll-area.js.map +1 -1
- package/dist/esm/components/ui/select.js +34 -34
- package/dist/esm/components/ui/select.js.map +1 -1
- package/dist/esm/components/ui/separator.js +6 -6
- package/dist/esm/components/ui/separator.js.map +1 -1
- package/dist/esm/components/ui/sheet.js +25 -25
- package/dist/esm/components/ui/sheet.js.map +1 -1
- package/dist/esm/components/ui/sidebar.js +96 -96
- package/dist/esm/components/ui/sidebar.js.map +1 -1
- package/dist/esm/components/ui/skeleton.js +4 -4
- package/dist/esm/components/ui/skeleton.js.map +1 -1
- package/dist/esm/components/ui/slider.js +12 -12
- package/dist/esm/components/ui/slider.js.map +1 -1
- package/dist/esm/components/ui/sonner.js +7 -8
- package/dist/esm/components/ui/sonner.js.map +1 -1
- package/dist/esm/components/ui/switch.js +7 -7
- package/dist/esm/components/ui/switch.js.map +1 -1
- package/dist/esm/components/ui/table.js +19 -19
- package/dist/esm/components/ui/table.js.map +1 -1
- package/dist/esm/components/ui/tabs.js +11 -11
- package/dist/esm/components/ui/tabs.js.map +1 -1
- package/dist/esm/components/ui/textarea.js +4 -4
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/components/ui/toggle-group.js +12 -12
- package/dist/esm/components/ui/toggle-group.js.map +1 -1
- package/dist/esm/components/ui/toggle.js +7 -7
- package/dist/esm/components/ui/toggle.js.map +1 -1
- package/dist/esm/components/ui/tooltip.js +11 -11
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/hooks/use-mobile.js +3 -3
- package/dist/esm/hooks/use-mobile.js.map +1 -1
- package/dist/esm/index.css +2558 -193
- package/dist/esm/index.css.map +1 -0
- package/dist/esm/index.js +62 -320
- package/dist/esm/lib/utils.js +3 -3
- package/dist/esm/lib/utils.js.map +1 -1
- package/dist/index.css +2558 -193
- package/dist/index.js +62 -320
- package/dist/types/components/ui/accordion.d.ts +1 -0
- package/dist/types/components/ui/accordion.d.ts.map +1 -0
- package/dist/types/components/ui/alert-dialog.d.ts +1 -0
- package/dist/types/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/types/components/ui/alert.d.ts +1 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +1 -0
- package/dist/types/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/types/components/ui/avatar.d.ts +1 -0
- package/dist/types/components/ui/avatar.d.ts.map +1 -0
- package/dist/types/components/ui/background-beams.d.ts +2 -1
- package/dist/types/components/ui/background-beams.d.ts.map +1 -0
- package/dist/types/components/ui/badge.d.ts +1 -0
- package/dist/types/components/ui/badge.d.ts.map +1 -0
- package/dist/types/components/ui/breadcrumb.d.ts +1 -0
- package/dist/types/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/types/components/ui/bubble-background.d.ts +1 -0
- package/dist/types/components/ui/bubble-background.d.ts.map +1 -0
- package/dist/types/components/ui/button.d.ts +1 -0
- package/dist/types/components/ui/button.d.ts.map +1 -0
- package/dist/types/components/ui/calendar.d.ts +8 -3
- package/dist/types/components/ui/calendar.d.ts.map +1 -0
- package/dist/types/components/ui/card.d.ts +1 -0
- package/dist/types/components/ui/card.d.ts.map +1 -0
- package/dist/types/components/ui/carousel.d.ts +1 -0
- package/dist/types/components/ui/carousel.d.ts.map +1 -0
- package/dist/types/components/ui/chart.d.ts +19 -4
- package/dist/types/components/ui/chart.d.ts.map +1 -0
- package/dist/types/components/ui/checkbox.d.ts +1 -0
- package/dist/types/components/ui/checkbox.d.ts.map +1 -0
- package/dist/types/components/ui/collapsible.d.ts +1 -0
- package/dist/types/components/ui/collapsible.d.ts.map +1 -0
- package/dist/types/components/ui/command.d.ts +4 -1
- package/dist/types/components/ui/command.d.ts.map +1 -0
- package/dist/types/components/ui/context-menu.d.ts +1 -0
- package/dist/types/components/ui/context-menu.d.ts.map +1 -0
- package/dist/types/components/ui/counting-number.d.ts +1 -0
- package/dist/types/components/ui/counting-number.d.ts.map +1 -0
- package/dist/types/components/ui/dialog.d.ts +4 -1
- package/dist/types/components/ui/dialog.d.ts.map +1 -0
- package/dist/types/components/ui/dot-background.d.ts +1 -0
- package/dist/types/components/ui/dot-background.d.ts.map +1 -0
- package/dist/types/components/ui/drawer.d.ts +1 -0
- package/dist/types/components/ui/drawer.d.ts.map +1 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +1 -0
- package/dist/types/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/types/components/ui/dropdrawer.d.ts +24 -0
- package/dist/types/components/ui/dropdrawer.d.ts.map +1 -0
- package/dist/types/components/ui/fireworks-background.d.ts +1 -0
- package/dist/types/components/ui/fireworks-background.d.ts.map +1 -0
- package/dist/types/components/ui/flip-button.d.ts +1 -0
- package/dist/types/components/ui/flip-button.d.ts.map +1 -0
- package/dist/types/components/ui/form.d.ts +1 -0
- package/dist/types/components/ui/form.d.ts.map +1 -0
- package/dist/types/components/ui/gradient-background.d.ts +1 -0
- package/dist/types/components/ui/gradient-background.d.ts.map +1 -0
- package/dist/types/components/ui/gradient-text.d.ts +1 -0
- package/dist/types/components/ui/gradient-text.d.ts.map +1 -0
- package/dist/types/components/ui/highlight-text.d.ts +1 -0
- package/dist/types/components/ui/highlight-text.d.ts.map +1 -0
- package/dist/types/components/ui/hole-background.d.ts +1 -0
- package/dist/types/components/ui/hole-background.d.ts.map +1 -0
- package/dist/types/components/ui/hover-card.d.ts +1 -0
- package/dist/types/components/ui/hover-card.d.ts.map +1 -0
- package/dist/types/components/ui/input-otp.d.ts +1 -0
- package/dist/types/components/ui/input-otp.d.ts.map +1 -0
- package/dist/types/components/ui/input.d.ts +1 -0
- package/dist/types/components/ui/input.d.ts.map +1 -0
- package/dist/types/components/ui/label.d.ts +1 -0
- package/dist/types/components/ui/label.d.ts.map +1 -0
- package/dist/types/components/ui/menubar.d.ts +1 -0
- package/dist/types/components/ui/menubar.d.ts.map +1 -0
- package/dist/types/components/ui/navigation-menu.d.ts +1 -0
- package/dist/types/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/types/components/ui/pagination.d.ts +1 -0
- package/dist/types/components/ui/pagination.d.ts.map +1 -0
- package/dist/types/components/ui/popover.d.ts +1 -0
- package/dist/types/components/ui/popover.d.ts.map +1 -0
- package/dist/types/components/ui/progress.d.ts +1 -0
- package/dist/types/components/ui/progress.d.ts.map +1 -0
- package/dist/types/components/ui/radio-group.d.ts +1 -0
- package/dist/types/components/ui/radio-group.d.ts.map +1 -0
- package/dist/types/components/ui/resizable.d.ts +1 -0
- package/dist/types/components/ui/resizable.d.ts.map +1 -0
- package/dist/types/components/ui/ripple-button.d.ts +1 -0
- package/dist/types/components/ui/ripple-button.d.ts.map +1 -0
- package/dist/types/components/ui/scratcher.d.ts +1 -0
- package/dist/types/components/ui/scratcher.d.ts.map +1 -0
- package/dist/types/components/ui/scroll-area.d.ts +1 -0
- package/dist/types/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/types/components/ui/select.d.ts +1 -0
- package/dist/types/components/ui/select.d.ts.map +1 -0
- package/dist/types/components/ui/separator.d.ts +1 -0
- package/dist/types/components/ui/separator.d.ts.map +1 -0
- package/dist/types/components/ui/sheet.d.ts +1 -0
- package/dist/types/components/ui/sheet.d.ts.map +1 -0
- package/dist/types/components/ui/sidebar.d.ts +1 -0
- package/dist/types/components/ui/sidebar.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton.d.ts +1 -0
- package/dist/types/components/ui/skeleton.d.ts.map +1 -0
- package/dist/types/components/ui/slider.d.ts +1 -0
- package/dist/types/components/ui/slider.d.ts.map +1 -0
- package/dist/types/components/ui/sonner.d.ts +1 -0
- package/dist/types/components/ui/sonner.d.ts.map +1 -0
- package/dist/types/components/ui/switch.d.ts +1 -0
- package/dist/types/components/ui/switch.d.ts.map +1 -0
- package/dist/types/components/ui/table.d.ts +1 -0
- package/dist/types/components/ui/table.d.ts.map +1 -0
- package/dist/types/components/ui/tabs.d.ts +1 -0
- package/dist/types/components/ui/tabs.d.ts.map +1 -0
- package/dist/types/components/ui/textarea.d.ts +1 -0
- package/dist/types/components/ui/textarea.d.ts.map +1 -0
- package/dist/types/components/ui/toggle-group.d.ts +1 -0
- package/dist/types/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/types/components/ui/toggle.d.ts +1 -0
- package/dist/types/components/ui/toggle.d.ts.map +1 -0
- package/dist/types/components/ui/tooltip.d.ts +1 -0
- package/dist/types/components/ui/tooltip.d.ts.map +1 -0
- package/dist/types/hooks/use-mobile.d.ts +24 -0
- package/dist/types/hooks/use-mobile.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +1 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/package.json +103 -71
- package/src/components/ui/accordion.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +4 -4
- package/src/components/ui/alert.tsx +3 -3
- package/src/components/ui/avatar.tsx +2 -2
- package/src/components/ui/background-beams.tsx +3 -3
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/bubble-background.tsx +4 -4
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/calendar.tsx +213 -75
- package/src/components/ui/card.tsx +4 -4
- package/src/components/ui/carousel.tsx +6 -6
- package/src/components/ui/chart.tsx +66 -39
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/command.tsx +14 -7
- package/src/components/ui/context-menu.tsx +9 -9
- package/src/components/ui/counting-number.tsx +4 -4
- package/src/components/ui/dialog.tsx +17 -9
- package/src/components/ui/dot-background.tsx +2 -2
- package/src/components/ui/drawer.tsx +8 -5
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/dropdrawer.tsx +973 -0
- package/src/components/ui/fireworks-background.tsx +12 -12
- package/src/components/ui/flip-button.tsx +6 -6
- package/src/components/ui/form.tsx +6 -6
- package/src/components/ui/gradient-background.tsx +3 -3
- package/src/components/ui/gradient-text.tsx +2 -2
- package/src/components/ui/highlight-text.tsx +3 -3
- package/src/components/ui/hole-background.tsx +9 -9
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-otp.tsx +2 -2
- package/src/components/ui/input.tsx +5 -6
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +11 -11
- package/src/components/ui/navigation-menu.tsx +8 -8
- package/src/components/ui/pagination.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/radio-group.tsx +1 -1
- package/src/components/ui/resizable.tsx +3 -3
- package/src/components/ui/ripple-button.tsx +7 -7
- package/src/components/ui/scratcher.tsx +1 -1
- package/src/components/ui/scroll-area.tsx +1 -1
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/separator.tsx +2 -2
- package/src/components/ui/sheet.tsx +4 -4
- package/src/components/ui/sidebar.tsx +18 -18
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +6 -6
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +5 -5
- package/src/components/ui/tabs.tsx +2 -2
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +2 -2
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/hooks/use-mobile.tsx +44 -19
- package/src/index.css +68 -68
- package/src/index.ts +400 -385
- package/src/lib/utils.ts +10 -10
- package/tailwind.config.mjs +65 -65
- package/tsconfig.json +58 -50
- package/changelog.md +0 -38
- package/readme.md +0 -214
|
@@ -1,75 +1,213 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
ChevronDownIcon,
|
|
6
|
+
ChevronLeftIcon,
|
|
7
|
+
ChevronRightIcon,
|
|
8
|
+
} from "lucide-react";
|
|
9
|
+
import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
10
|
+
|
|
11
|
+
import { cn } from "@/lib/utils";
|
|
12
|
+
import { Button, buttonVariants } from "@/components/ui/button";
|
|
13
|
+
|
|
14
|
+
function Calendar({
|
|
15
|
+
className,
|
|
16
|
+
classNames,
|
|
17
|
+
showOutsideDays = true,
|
|
18
|
+
captionLayout = "label",
|
|
19
|
+
buttonVariant = "ghost",
|
|
20
|
+
formatters,
|
|
21
|
+
components,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
24
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
25
|
+
}) {
|
|
26
|
+
const defaultClassNames = getDefaultClassNames();
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<DayPicker
|
|
30
|
+
showOutsideDays={showOutsideDays}
|
|
31
|
+
className={cn(
|
|
32
|
+
"bg-white group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent dark:bg-neutral-950",
|
|
33
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
34
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
35
|
+
className,
|
|
36
|
+
)}
|
|
37
|
+
captionLayout={captionLayout}
|
|
38
|
+
formatters={{
|
|
39
|
+
formatMonthDropdown: (date) =>
|
|
40
|
+
date.toLocaleString("default", { month: "short" }),
|
|
41
|
+
...formatters,
|
|
42
|
+
}}
|
|
43
|
+
classNames={{
|
|
44
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
45
|
+
months: cn(
|
|
46
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
47
|
+
defaultClassNames.months,
|
|
48
|
+
),
|
|
49
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
50
|
+
nav: cn(
|
|
51
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
52
|
+
defaultClassNames.nav,
|
|
53
|
+
),
|
|
54
|
+
button_previous: cn(
|
|
55
|
+
buttonVariants({ variant: buttonVariant }),
|
|
56
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
57
|
+
defaultClassNames.button_previous,
|
|
58
|
+
),
|
|
59
|
+
button_next: cn(
|
|
60
|
+
buttonVariants({ variant: buttonVariant }),
|
|
61
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
62
|
+
defaultClassNames.button_next,
|
|
63
|
+
),
|
|
64
|
+
month_caption: cn(
|
|
65
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
66
|
+
defaultClassNames.month_caption,
|
|
67
|
+
),
|
|
68
|
+
dropdowns: cn(
|
|
69
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
70
|
+
defaultClassNames.dropdowns,
|
|
71
|
+
),
|
|
72
|
+
dropdown_root: cn(
|
|
73
|
+
"relative has-focus:border-neutral-950 border border-neutral-200 shadow-xs has-focus:ring-neutral-950/50 has-focus:ring-[3px] rounded-md dark:has-focus:border-neutral-300 dark:border-neutral-800 dark:has-focus:ring-neutral-300/50",
|
|
74
|
+
defaultClassNames.dropdown_root,
|
|
75
|
+
),
|
|
76
|
+
dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
|
77
|
+
caption_label: cn(
|
|
78
|
+
"select-none font-medium",
|
|
79
|
+
captionLayout === "label"
|
|
80
|
+
? "text-sm"
|
|
81
|
+
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-neutral-500 [&>svg]:size-3.5 dark:[&>svg]:text-neutral-400",
|
|
82
|
+
defaultClassNames.caption_label,
|
|
83
|
+
),
|
|
84
|
+
table: "w-full border-collapse",
|
|
85
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
86
|
+
weekday: cn(
|
|
87
|
+
"text-neutral-500 rounded-md flex-1 font-normal text-[0.8rem] select-none dark:text-neutral-400",
|
|
88
|
+
defaultClassNames.weekday,
|
|
89
|
+
),
|
|
90
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
91
|
+
week_number_header: cn(
|
|
92
|
+
"select-none w-(--cell-size)",
|
|
93
|
+
defaultClassNames.week_number_header,
|
|
94
|
+
),
|
|
95
|
+
week_number: cn(
|
|
96
|
+
"text-[0.8rem] select-none text-neutral-500 dark:text-neutral-400",
|
|
97
|
+
defaultClassNames.week_number,
|
|
98
|
+
),
|
|
99
|
+
day: cn(
|
|
100
|
+
"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",
|
|
101
|
+
defaultClassNames.day,
|
|
102
|
+
),
|
|
103
|
+
range_start: cn(
|
|
104
|
+
"rounded-l-md bg-neutral-100 dark:bg-neutral-800",
|
|
105
|
+
defaultClassNames.range_start,
|
|
106
|
+
),
|
|
107
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
108
|
+
range_end: cn(
|
|
109
|
+
"rounded-r-md bg-neutral-100 dark:bg-neutral-800",
|
|
110
|
+
defaultClassNames.range_end,
|
|
111
|
+
),
|
|
112
|
+
today: cn(
|
|
113
|
+
"bg-neutral-100 text-neutral-900 rounded-md data-[selected=true]:rounded-none dark:bg-neutral-800 dark:text-neutral-50",
|
|
114
|
+
defaultClassNames.today,
|
|
115
|
+
),
|
|
116
|
+
outside: cn(
|
|
117
|
+
"text-neutral-500 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:text-neutral-400",
|
|
118
|
+
defaultClassNames.outside,
|
|
119
|
+
),
|
|
120
|
+
disabled: cn(
|
|
121
|
+
"text-neutral-500 opacity-50 dark:text-neutral-400",
|
|
122
|
+
defaultClassNames.disabled,
|
|
123
|
+
),
|
|
124
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
125
|
+
...classNames,
|
|
126
|
+
}}
|
|
127
|
+
components={{
|
|
128
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
129
|
+
return (
|
|
130
|
+
<div
|
|
131
|
+
data-slot="calendar"
|
|
132
|
+
ref={rootRef}
|
|
133
|
+
className={cn(className)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
139
|
+
if (orientation === "left") {
|
|
140
|
+
return (
|
|
141
|
+
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (orientation === "right") {
|
|
146
|
+
return (
|
|
147
|
+
<ChevronRightIcon
|
|
148
|
+
className={cn("size-4", className)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
156
|
+
);
|
|
157
|
+
},
|
|
158
|
+
DayButton: CalendarDayButton,
|
|
159
|
+
WeekNumber: ({ children, ...props }) => {
|
|
160
|
+
return (
|
|
161
|
+
<td {...props}>
|
|
162
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
163
|
+
{children}
|
|
164
|
+
</div>
|
|
165
|
+
</td>
|
|
166
|
+
);
|
|
167
|
+
},
|
|
168
|
+
...components,
|
|
169
|
+
}}
|
|
170
|
+
{...props}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function CalendarDayButton({
|
|
176
|
+
className,
|
|
177
|
+
day,
|
|
178
|
+
modifiers,
|
|
179
|
+
...props
|
|
180
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
181
|
+
const defaultClassNames = getDefaultClassNames();
|
|
182
|
+
|
|
183
|
+
const ref = React.useRef<HTMLButtonElement>(null);
|
|
184
|
+
React.useEffect(() => {
|
|
185
|
+
if (modifiers["focused"]) ref.current?.focus();
|
|
186
|
+
}, [modifiers["focused"]]);
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Button
|
|
190
|
+
ref={ref}
|
|
191
|
+
variant="ghost"
|
|
192
|
+
size="icon"
|
|
193
|
+
data-day={day.date.toLocaleDateString()}
|
|
194
|
+
data-selected-single={
|
|
195
|
+
modifiers["selected"] &&
|
|
196
|
+
!modifiers["range_start"] &&
|
|
197
|
+
!modifiers["range_end"] &&
|
|
198
|
+
!modifiers["range_middle"]
|
|
199
|
+
}
|
|
200
|
+
data-range-start={modifiers["range_start"]}
|
|
201
|
+
data-range-end={modifiers["range_end"]}
|
|
202
|
+
data-range-middle={modifiers["range_middle"]}
|
|
203
|
+
className={cn(
|
|
204
|
+
"data-[selected-single=true]:bg-neutral-900 data-[selected-single=true]:text-neutral-50 data-[range-middle=true]:bg-neutral-100 data-[range-middle=true]:text-neutral-900 data-[range-start=true]:bg-neutral-900 data-[range-start=true]:text-neutral-50 data-[range-end=true]:bg-neutral-900 data-[range-end=true]:text-neutral-50 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-neutral-900 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 dark:data-[selected-single=true]:bg-neutral-50 dark:data-[selected-single=true]:text-neutral-900 dark:data-[range-middle=true]:bg-neutral-800 dark:data-[range-middle=true]:text-neutral-50 dark:data-[range-start=true]:bg-neutral-50 dark:data-[range-start=true]:text-neutral-900 dark:data-[range-end=true]:bg-neutral-50 dark:data-[range-end=true]:text-neutral-900 dark:dark:hover:text-neutral-50",
|
|
205
|
+
defaultClassNames.day,
|
|
206
|
+
className,
|
|
207
|
+
)}
|
|
208
|
+
{...props}
|
|
209
|
+
/>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -10,7 +10,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
10
10
|
data-slot="card"
|
|
11
11
|
className={cn(
|
|
12
12
|
"bg-white text-neutral-950 flex flex-col gap-6 rounded-xl border border-neutral-200 py-6 shadow-sm dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
13
|
-
className
|
|
13
|
+
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
@@ -23,7 +23,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
23
23
|
data-slot="card-header"
|
|
24
24
|
className={cn(
|
|
25
25
|
"@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",
|
|
26
|
-
className
|
|
26
|
+
className,
|
|
27
27
|
)}
|
|
28
28
|
{...props}
|
|
29
29
|
/>
|
|
@@ -46,7 +46,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
46
46
|
data-slot="card-description"
|
|
47
47
|
className={cn(
|
|
48
48
|
"text-neutral-500 text-sm dark:text-neutral-400",
|
|
49
|
-
className
|
|
49
|
+
className,
|
|
50
50
|
)}
|
|
51
51
|
{...props}
|
|
52
52
|
/>
|
|
@@ -59,7 +59,7 @@ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
59
59
|
data-slot="card-action"
|
|
60
60
|
className={cn(
|
|
61
61
|
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
62
|
-
className
|
|
62
|
+
className,
|
|
63
63
|
)}
|
|
64
64
|
{...props}
|
|
65
65
|
/>
|
|
@@ -56,7 +56,7 @@ function Carousel({
|
|
|
56
56
|
...opts,
|
|
57
57
|
axis: orientation === "horizontal" ? "x" : "y",
|
|
58
58
|
},
|
|
59
|
-
plugins
|
|
59
|
+
plugins,
|
|
60
60
|
);
|
|
61
61
|
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
62
62
|
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
@@ -85,7 +85,7 @@ function Carousel({
|
|
|
85
85
|
scrollNext();
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
[scrollPrev, scrollNext]
|
|
88
|
+
[scrollPrev, scrollNext],
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
React.useEffect(() => {
|
|
@@ -145,7 +145,7 @@ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
145
145
|
className={cn(
|
|
146
146
|
"flex",
|
|
147
147
|
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
148
|
-
className
|
|
148
|
+
className,
|
|
149
149
|
)}
|
|
150
150
|
{...props}
|
|
151
151
|
/>
|
|
@@ -164,7 +164,7 @@ function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
164
164
|
className={cn(
|
|
165
165
|
"min-w-0 shrink-0 grow-0 basis-full",
|
|
166
166
|
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
167
|
-
className
|
|
167
|
+
className,
|
|
168
168
|
)}
|
|
169
169
|
{...props}
|
|
170
170
|
/>
|
|
@@ -189,7 +189,7 @@ function CarouselPrevious({
|
|
|
189
189
|
orientation === "horizontal"
|
|
190
190
|
? "top-1/2 -left-12 -translate-y-1/2"
|
|
191
191
|
: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
192
|
-
className
|
|
192
|
+
className,
|
|
193
193
|
)}
|
|
194
194
|
disabled={!canScrollPrev}
|
|
195
195
|
onClick={scrollPrev}
|
|
@@ -219,7 +219,7 @@ function CarouselNext({
|
|
|
219
219
|
orientation === "horizontal"
|
|
220
220
|
? "top-1/2 -right-12 -translate-y-1/2"
|
|
221
221
|
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
222
|
-
className
|
|
222
|
+
className,
|
|
223
223
|
)}
|
|
224
224
|
disabled={!canScrollNext}
|
|
225
225
|
onClick={scrollNext}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as RechartsPrimitive from "recharts";
|
|
5
|
+
import type { LegendPayload } from "recharts/types/component/DefaultLegendContent";
|
|
6
|
+
import {
|
|
7
|
+
NameType,
|
|
8
|
+
Payload,
|
|
9
|
+
ValueType,
|
|
10
|
+
} from "recharts/types/component/DefaultTooltipContent";
|
|
11
|
+
import type { Props as LegendProps } from "recharts/types/component/Legend";
|
|
12
|
+
import { TooltipContentProps } from "recharts/types/component/Tooltip";
|
|
5
13
|
|
|
6
14
|
import { cn } from "@/lib/utils";
|
|
7
15
|
|
|
@@ -56,7 +64,7 @@ function ChartContainer({
|
|
|
56
64
|
data-chart={chartId}
|
|
57
65
|
className={cn(
|
|
58
66
|
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
59
|
-
className
|
|
67
|
+
className,
|
|
60
68
|
)}
|
|
61
69
|
{...props}
|
|
62
70
|
>
|
|
@@ -71,7 +79,7 @@ function ChartContainer({
|
|
|
71
79
|
|
|
72
80
|
const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
73
81
|
const colorConfig = Object.entries(config).filter(
|
|
74
|
-
([, config]) => config.theme || config.color
|
|
82
|
+
([, config]) => config.theme || config.color,
|
|
75
83
|
);
|
|
76
84
|
|
|
77
85
|
if (!colorConfig.length) {
|
|
@@ -84,17 +92,17 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|
|
84
92
|
__html: Object.entries(THEMES)
|
|
85
93
|
.map(
|
|
86
94
|
([theme, prefix]) => `
|
|
87
|
-
${prefix} [data-chart=${id}] {
|
|
88
|
-
${colorConfig
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
95
|
+
${prefix} [data-chart=${id}] {
|
|
96
|
+
${colorConfig
|
|
97
|
+
.map(([key, itemConfig]) => {
|
|
98
|
+
const color =
|
|
99
|
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
|
100
|
+
itemConfig.color;
|
|
101
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
102
|
+
})
|
|
103
|
+
.join("\n")}
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
98
106
|
)
|
|
99
107
|
.join("\n"),
|
|
100
108
|
}}
|
|
@@ -104,28 +112,43 @@ ${colorConfig
|
|
|
104
112
|
|
|
105
113
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
106
114
|
|
|
115
|
+
type CustomTooltipProps = TooltipContentProps<ValueType, NameType> & {
|
|
116
|
+
className?: string;
|
|
117
|
+
hideLabel?: boolean;
|
|
118
|
+
hideIndicator?: boolean;
|
|
119
|
+
indicator?: "line" | "dot" | "dashed";
|
|
120
|
+
nameKey?: string;
|
|
121
|
+
labelKey?: string;
|
|
122
|
+
labelFormatter?: (
|
|
123
|
+
label: TooltipContentProps<number, string>["label"],
|
|
124
|
+
payload: TooltipContentProps<number, string>["payload"],
|
|
125
|
+
) => React.ReactNode;
|
|
126
|
+
formatter?: (
|
|
127
|
+
value: number | string,
|
|
128
|
+
name: string,
|
|
129
|
+
item: Payload<number | string, string>,
|
|
130
|
+
index: number,
|
|
131
|
+
payload: ReadonlyArray<Payload<number | string, string>>,
|
|
132
|
+
) => React.ReactNode;
|
|
133
|
+
labelClassName?: string;
|
|
134
|
+
color?: string;
|
|
135
|
+
};
|
|
136
|
+
|
|
107
137
|
function ChartTooltipContent({
|
|
108
138
|
active,
|
|
109
139
|
payload,
|
|
140
|
+
label,
|
|
110
141
|
className,
|
|
111
142
|
indicator = "dot",
|
|
112
143
|
hideLabel = false,
|
|
113
144
|
hideIndicator = false,
|
|
114
|
-
label,
|
|
115
145
|
labelFormatter,
|
|
116
|
-
labelClassName,
|
|
117
146
|
formatter,
|
|
147
|
+
labelClassName,
|
|
118
148
|
color,
|
|
119
149
|
nameKey,
|
|
120
150
|
labelKey,
|
|
121
|
-
}:
|
|
122
|
-
React.ComponentProps<"div"> & {
|
|
123
|
-
hideLabel?: boolean;
|
|
124
|
-
hideIndicator?: boolean;
|
|
125
|
-
indicator?: "line" | "dot" | "dashed";
|
|
126
|
-
nameKey?: string;
|
|
127
|
-
labelKey?: string;
|
|
128
|
-
}) {
|
|
151
|
+
}: CustomTooltipProps) {
|
|
129
152
|
const { config } = useChart();
|
|
130
153
|
|
|
131
154
|
const tooltipLabel = React.useMemo(() => {
|
|
@@ -173,8 +196,8 @@ function ChartTooltipContent({
|
|
|
173
196
|
return (
|
|
174
197
|
<div
|
|
175
198
|
className={cn(
|
|
176
|
-
"border-
|
|
177
|
-
className
|
|
199
|
+
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
|
|
200
|
+
className,
|
|
178
201
|
)}
|
|
179
202
|
>
|
|
180
203
|
{!nestLabel ? tooltipLabel : null}
|
|
@@ -188,8 +211,8 @@ function ChartTooltipContent({
|
|
|
188
211
|
<div
|
|
189
212
|
key={item.dataKey}
|
|
190
213
|
className={cn(
|
|
191
|
-
"[&>svg]:text-
|
|
192
|
-
indicator === "dot" && "items-center"
|
|
214
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
215
|
+
indicator === "dot" && "items-center",
|
|
193
216
|
)}
|
|
194
217
|
>
|
|
195
218
|
{formatter && item?.value !== undefined && item.name ? (
|
|
@@ -209,7 +232,7 @@ function ChartTooltipContent({
|
|
|
209
232
|
"w-0 border-[1.5px] border-dashed bg-transparent":
|
|
210
233
|
indicator === "dashed",
|
|
211
234
|
"my-0.5": nestLabel && indicator === "dashed",
|
|
212
|
-
}
|
|
235
|
+
},
|
|
213
236
|
)}
|
|
214
237
|
style={
|
|
215
238
|
{
|
|
@@ -223,17 +246,17 @@ function ChartTooltipContent({
|
|
|
223
246
|
<div
|
|
224
247
|
className={cn(
|
|
225
248
|
"flex flex-1 justify-between leading-none",
|
|
226
|
-
nestLabel ? "items-end" : "items-center"
|
|
249
|
+
nestLabel ? "items-end" : "items-center",
|
|
227
250
|
)}
|
|
228
251
|
>
|
|
229
252
|
<div className="grid gap-1.5">
|
|
230
253
|
{nestLabel ? tooltipLabel : null}
|
|
231
|
-
<span className="text-
|
|
254
|
+
<span className="text-muted-foreground">
|
|
232
255
|
{itemConfig?.label || item.name}
|
|
233
256
|
</span>
|
|
234
257
|
</div>
|
|
235
258
|
{item.value && (
|
|
236
|
-
<span className="text-
|
|
259
|
+
<span className="text-foreground font-mono font-medium tabular-nums">
|
|
237
260
|
{item.value.toLocaleString()}
|
|
238
261
|
</span>
|
|
239
262
|
)}
|
|
@@ -250,17 +273,21 @@ function ChartTooltipContent({
|
|
|
250
273
|
|
|
251
274
|
const ChartLegend = RechartsPrimitive.Legend;
|
|
252
275
|
|
|
276
|
+
type ChartLegendContentProps = {
|
|
277
|
+
className?: string;
|
|
278
|
+
hideIcon?: boolean;
|
|
279
|
+
verticalAlign?: LegendProps["verticalAlign"];
|
|
280
|
+
payload?: LegendPayload[];
|
|
281
|
+
nameKey?: string;
|
|
282
|
+
};
|
|
283
|
+
|
|
253
284
|
function ChartLegendContent({
|
|
254
285
|
className,
|
|
255
286
|
hideIcon = false,
|
|
256
287
|
payload,
|
|
257
288
|
verticalAlign = "bottom",
|
|
258
289
|
nameKey,
|
|
259
|
-
}:
|
|
260
|
-
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
261
|
-
hideIcon?: boolean;
|
|
262
|
-
nameKey?: string;
|
|
263
|
-
}) {
|
|
290
|
+
}: ChartLegendContentProps) {
|
|
264
291
|
const { config } = useChart();
|
|
265
292
|
|
|
266
293
|
if (!payload?.length) {
|
|
@@ -272,7 +299,7 @@ function ChartLegendContent({
|
|
|
272
299
|
className={cn(
|
|
273
300
|
"flex items-center justify-center gap-4",
|
|
274
301
|
verticalAlign === "top" ? "pb-3" : "pt-3",
|
|
275
|
-
className
|
|
302
|
+
className,
|
|
276
303
|
)}
|
|
277
304
|
>
|
|
278
305
|
{payload.map((item) => {
|
|
@@ -283,7 +310,7 @@ function ChartLegendContent({
|
|
|
283
310
|
<div
|
|
284
311
|
key={item.value}
|
|
285
312
|
className={cn(
|
|
286
|
-
"[&>svg]:text-
|
|
313
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3",
|
|
287
314
|
)}
|
|
288
315
|
>
|
|
289
316
|
{itemConfig?.icon && !hideIcon ? (
|
|
@@ -308,7 +335,7 @@ function ChartLegendContent({
|
|
|
308
335
|
function getPayloadConfigFromPayload(
|
|
309
336
|
config: ChartConfig,
|
|
310
337
|
payload: unknown,
|
|
311
|
-
key: string
|
|
338
|
+
key: string,
|
|
312
339
|
) {
|
|
313
340
|
if (typeof payload !== "object" || payload === null) {
|
|
314
341
|
return undefined;
|
|
@@ -15,7 +15,7 @@ function Checkbox({
|
|
|
15
15
|
data-slot="checkbox"
|
|
16
16
|
className={cn(
|
|
17
17
|
"peer border-neutral-200 dark:bg-neutral-200/30 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 dark:data-[state=checked]:bg-neutral-900 data-[state=checked]:border-neutral-900 focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:dark:bg-neutral-800/30 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900 dark:dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:border-neutral-50 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
|
|
18
|
-
className
|
|
18
|
+
className,
|
|
19
19
|
)}
|
|
20
20
|
{...props}
|
|
21
21
|
>
|