@appica/ui-react 1.0.0 → 1.1.0
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 +46 -0
- package/README.md +47 -5
- package/agent-rules.md +41 -0
- package/appica.css +7 -0
- package/dist/components/accordion/accordion.d.ts +24 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +1 -1
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert/alert.d.ts +29 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts +12 -2
- package/dist/components/alert-dialog/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +9 -5
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts +21 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +2 -2
- package/dist/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +16 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/background-pattern/background-pattern-interactive.js +1 -1
- package/dist/components/background-pattern/background-pattern-interactive.js.map +1 -1
- package/dist/components/background-pattern/background-pattern-shared.js +1 -1
- package/dist/components/background-pattern/background-pattern-shared.js.map +1 -1
- package/dist/components/background-pattern/background-pattern.d.ts +13 -5
- package/dist/components/background-pattern/background-pattern.d.ts.map +1 -1
- package/dist/components/background-pattern/background-pattern.js +1 -1
- package/dist/components/background-pattern/background-pattern.js.map +1 -1
- package/dist/components/badge/badge.d.ts +11 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/border-beam/border-beam.d.ts +52 -0
- package/dist/components/border-beam/border-beam.d.ts.map +1 -0
- package/dist/components/border-beam/border-beam.js +67 -0
- package/dist/components/border-beam/border-beam.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +8 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button-variants.js +1 -1
- package/dist/components/button/button-variants.js.map +1 -1
- package/dist/components/button/button.d.ts +11 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.d.ts +10 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/button-group.js +1 -1
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/calendar/calendar.d.ts +5 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/card/card.d.ts +43 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +103 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/carousel/carousel.d.ts +105 -5
- package/dist/components/carousel/carousel.d.ts.map +1 -1
- package/dist/components/carousel/carousel.js +157 -5
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +4 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/chip/chip.d.ts +32 -0
- package/dist/components/chip/chip.d.ts.map +1 -1
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/chip.js.map +1 -1
- package/dist/components/collapsible/collapsible.js +1 -1
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-area/color-area.d.ts +53 -0
- package/dist/components/color-area/color-area.d.ts.map +1 -0
- package/dist/components/color-area/color-area.js +245 -0
- package/dist/components/color-area/color-area.js.map +1 -0
- package/dist/components/color-picker/color-picker.d.ts +152 -0
- package/dist/components/color-picker/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.js +327 -0
- package/dist/components/color-picker/color-picker.js.map +1 -0
- package/dist/components/color-slider/color-slider.d.ts +48 -0
- package/dist/components/color-slider/color-slider.d.ts.map +1 -0
- package/dist/components/color-slider/color-slider.js +216 -0
- package/dist/components/color-slider/color-slider.js.map +1 -0
- package/dist/components/color-swatch/color-swatch.d.ts +47 -0
- package/dist/components/color-swatch/color-swatch.d.ts.map +1 -0
- package/dist/components/color-swatch/color-swatch.js +66 -0
- package/dist/components/color-swatch/color-swatch.js.map +1 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts +62 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts.map +1 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.js +202 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +25 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +2 -2
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/context-menu/context-menu.d.ts +7 -1
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +5 -5
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/copy-button/copy-button.d.ts +15 -0
- package/dist/components/copy-button/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button/copy-button.js +1 -1
- package/dist/components/copy-button/copy-button.js.map +1 -1
- package/dist/components/countdown/countdown.d.ts +14 -0
- package/dist/components/countdown/countdown.d.ts.map +1 -1
- package/dist/components/countdown/countdown.js +1 -1
- package/dist/components/countdown/countdown.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts +35 -0
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +1 -1
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +94 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +20 -2
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +8 -4
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +22 -2
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +13 -7
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +7 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +5 -5
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field.js +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/fieldset/fieldset.js.map +1 -1
- package/dist/components/gradient-glow/gradient-glow.d.ts +45 -0
- package/dist/components/gradient-glow/gradient-glow.d.ts.map +1 -1
- package/dist/components/gradient-glow/gradient-glow.js +1 -1
- package/dist/components/gradient-glow/gradient-glow.js.map +1 -1
- package/dist/components/input/input-variants.js +1 -1
- package/dist/components/input/input-variants.js.map +1 -1
- package/dist/components/input/input.d.ts +21 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/input/input.js +3 -3
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts +8 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/kbd/kbd.js +1 -1
- package/dist/components/kbd/kbd.js.map +1 -1
- package/dist/components/loader/loader.d.ts +8 -0
- package/dist/components/loader/loader.d.ts.map +1 -1
- package/dist/components/loader/loader.js +1 -1
- package/dist/components/loader/loader.js.map +1 -1
- package/dist/components/menubar/menubar.d.ts +8 -0
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +1 -1
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/meter/meter.d.ts +4 -0
- package/dist/components/meter/meter.d.ts.map +1 -1
- package/dist/components/meter/meter.js +1 -1
- package/dist/components/meter/meter.js.map +1 -1
- package/dist/components/navigation/navigation-link-variants.d.ts +1 -1
- package/dist/components/navigation/navigation-link-variants.js +1 -1
- package/dist/components/navigation/navigation-link-variants.js.map +1 -1
- package/dist/components/navigation/navigation-link.d.ts +22 -0
- package/dist/components/navigation/navigation-link.d.ts.map +1 -1
- package/dist/components/navigation/navigation-link.js +1 -1
- package/dist/components/navigation/navigation-link.js.map +1 -1
- package/dist/components/navigation/navigation.d.ts +12 -0
- package/dist/components/navigation/navigation.d.ts.map +1 -1
- package/dist/components/navigation/navigation.js +1 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +33 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/number-field/number-field.d.ts +14 -0
- package/dist/components/number-field/number-field.d.ts.map +1 -1
- package/dist/components/number-field/number-field.js +1 -1
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/otp-field/otp-field.d.ts +9 -0
- package/dist/components/otp-field/otp-field.d.ts.map +1 -1
- package/dist/components/otp-field/otp-field.js +1 -1
- package/dist/components/otp-field/otp-field.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts +16 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/popover/popover.d.ts +5 -1
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/preview-card/preview-card.d.ts +5 -1
- package/dist/components/preview-card/preview-card.d.ts.map +1 -1
- package/dist/components/preview-card/preview-card.js +2 -2
- package/dist/components/preview-card/preview-card.js.map +1 -1
- package/dist/components/progress/progress.d.ts +17 -0
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +1 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +4 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/rating/rating.d.ts +79 -0
- package/dist/components/rating/rating.d.ts.map +1 -0
- package/dist/components/rating/rating.js +301 -0
- package/dist/components/rating/rating.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +1 -1
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/select/select.d.ts +20 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +2 -2
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.d.ts +4 -0
- package/dist/components/separator/separator.d.ts.map +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slider/slider.d.ts +5 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/sparkline/sparkline.d.ts +44 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -1
- package/dist/components/sparkline/sparkline.js +1 -1
- package/dist/components/sparkline/sparkline.js.map +1 -1
- package/dist/components/spinner/spinner.d.ts +8 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/switch/switch.d.ts +4 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table.d.ts +28 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +31 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/text-animate/text-animate.d.ts +31 -0
- package/dist/components/text-animate/text-animate.d.ts.map +1 -1
- package/dist/components/text-animate/text-animate.js +26 -9
- package/dist/components/text-animate/text-animate.js.map +1 -1
- package/dist/components/textarea/textarea.d.ts +15 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/thumbnail/thumbnail.d.ts +20 -0
- package/dist/components/thumbnail/thumbnail.d.ts.map +1 -1
- package/dist/components/thumbnail/thumbnail.js +1 -1
- package/dist/components/thumbnail/thumbnail.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts +35 -0
- package/dist/components/time-field/time-field.d.ts.map +1 -1
- package/dist/components/time-field/time-field.js +1 -1
- package/dist/components/time-field/time-field.js.map +1 -1
- package/dist/components/toast/toast.d.ts +18 -0
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toc/toc.d.ts +10 -0
- package/dist/components/toc/toc.d.ts.map +1 -1
- package/dist/components/toc/toc.js +1 -1
- package/dist/components/toc/toc.js.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +1 -1
- package/dist/components/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/toolbar/toolbar.js +1 -1
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +5 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +2 -2
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/hooks/use-dismissible.d.ts +4 -0
- package/dist/hooks/use-dismissible.d.ts.map +1 -1
- package/dist/hooks/use-dismissible.js.map +1 -1
- package/dist/hooks/use-local-storage.js.map +1 -1
- package/dist/hooks/use-reduced-motion.d.ts +1 -1
- package/dist/hooks/use-reduced-motion.js.map +1 -1
- package/dist/hooks/use-theme.d.ts +1 -1
- package/dist/hooks/use-theme.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/color-control.d.ts +75 -0
- package/dist/internal/color-control.d.ts.map +1 -0
- package/dist/internal/color-control.js +78 -0
- package/dist/internal/color-control.js.map +1 -0
- package/dist/internal/color-math.d.ts +9 -0
- package/dist/internal/color-math.d.ts.map +1 -0
- package/dist/internal/color-math.js +34 -0
- package/dist/internal/color-math.js.map +1 -0
- package/dist/internal/color-picker-context.d.ts +34 -0
- package/dist/internal/color-picker-context.d.ts.map +1 -0
- package/dist/internal/color-picker-context.js +41 -0
- package/dist/internal/color-picker-context.js.map +1 -0
- package/dist/{floating.d.ts → internal/floating.d.ts} +1 -1
- package/dist/internal/floating.d.ts.map +1 -0
- package/dist/internal/floating.js.map +1 -0
- package/dist/{modal.d.ts → internal/modal.d.ts} +1 -1
- package/dist/internal/modal.d.ts.map +1 -0
- package/dist/internal/modal.js.map +1 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/dist/internal/utils.js.map +1 -0
- package/dist/lib/color.d.ts +95 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/color.js +328 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/providers/direction-provider.d.ts +4 -4
- package/dist/providers/direction-provider.d.ts.map +1 -1
- package/dist/providers/direction-provider.js.map +1 -1
- package/dist/providers/reduced-motion-provider.d.ts +4 -8
- package/dist/providers/reduced-motion-provider.d.ts.map +1 -1
- package/dist/providers/reduced-motion-provider.js.map +1 -1
- package/dist/providers/theme-provider/theme-provider.d.ts +28 -12
- package/dist/providers/theme-provider/theme-provider.d.ts.map +1 -1
- package/dist/providers/theme-provider/theme-provider.js.map +1 -1
- package/dist/providers/theme-provider/theme-script.js.map +1 -1
- package/package.json +75 -17
- package/src/components/accordion/accordion.tsx +25 -1
- package/src/components/alert/alert.tsx +30 -2
- package/src/components/alert-dialog/alert-dialog.test.tsx +34 -2
- package/src/components/alert-dialog/alert-dialog.tsx +21 -5
- package/src/components/autocomplete/autocomplete.test.tsx +1 -1
- package/src/components/autocomplete/autocomplete.tsx +22 -2
- package/src/components/avatar/avatar.test.tsx +2 -2
- package/src/components/avatar/avatar.tsx +17 -1
- package/src/components/background-pattern/background-pattern-interactive.tsx +1 -1
- package/src/components/background-pattern/background-pattern-shared.tsx +1 -1
- package/src/components/background-pattern/background-pattern.test.tsx +1 -1
- package/src/components/background-pattern/background-pattern.tsx +14 -6
- package/src/components/badge/badge.tsx +14 -2
- package/src/components/border-beam/border-beam.test.tsx +91 -0
- package/src/components/border-beam/border-beam.tsx +131 -0
- package/src/components/breadcrumb/breadcrumb.tsx +9 -1
- package/src/components/button/button-variants.ts +1 -1
- package/src/components/button/button.tsx +13 -2
- package/src/components/button-group/button-group.tsx +11 -1
- package/src/components/calendar/calendar.tsx +6 -1
- package/src/components/card/card.test.tsx +98 -0
- package/src/components/card/card.tsx +154 -0
- package/src/components/carousel/carousel.test.tsx +155 -0
- package/src/components/carousel/carousel.tsx +305 -5
- package/src/components/checkbox/checkbox.test.tsx +2 -2
- package/src/components/checkbox/checkbox.tsx +1 -1
- package/src/components/checkbox-group/checkbox-group.tsx +5 -1
- package/src/components/chip/chip.tsx +33 -1
- package/src/components/collapsible/collapsible.tsx +1 -1
- package/src/components/color-area/color-area.test.tsx +242 -0
- package/src/components/color-area/color-area.tsx +356 -0
- package/src/components/color-picker/color-picker.test.tsx +286 -0
- package/src/components/color-picker/color-picker.tsx +546 -0
- package/src/components/color-slider/color-slider.test.tsx +222 -0
- package/src/components/color-slider/color-slider.tsx +330 -0
- package/src/components/color-swatch/color-swatch.test.tsx +117 -0
- package/src/components/color-swatch/color-swatch.tsx +119 -0
- package/src/components/color-swatch-picker/color-swatch-picker.test.tsx +287 -0
- package/src/components/color-swatch-picker/color-swatch-picker.tsx +327 -0
- package/src/components/combobox/combobox.test.tsx +1 -1
- package/src/components/combobox/combobox.tsx +26 -2
- package/src/components/context-menu/context-menu.tsx +11 -5
- package/src/components/copy-button/copy-button.test.tsx +1 -1
- package/src/components/copy-button/copy-button.tsx +16 -1
- package/src/components/countdown/countdown.tsx +15 -1
- package/src/components/date-field/date-field.tsx +36 -1
- package/src/components/date-picker/date-picker.test.tsx +1 -1
- package/src/components/date-picker/date-picker.tsx +95 -1
- package/src/components/dialog/dialog.test.tsx +30 -1
- package/src/components/dialog/dialog.tsx +28 -6
- package/src/components/drawer/drawer.test.tsx +32 -1
- package/src/components/drawer/drawer.tsx +37 -7
- package/src/components/dropdown-menu/dropdown-menu.tsx +11 -5
- package/src/components/field/field.tsx +1 -1
- package/src/components/fieldset/fieldset.tsx +1 -1
- package/src/components/gradient-glow/gradient-glow.test.tsx +1 -1
- package/src/components/gradient-glow/gradient-glow.tsx +46 -1
- package/src/components/input/input-variants.ts +1 -1
- package/src/components/input/input.tsx +24 -4
- package/src/components/kbd/kbd.tsx +9 -1
- package/src/components/loader/loader.tsx +9 -1
- package/src/components/menubar/menubar.tsx +9 -1
- package/src/components/meter/meter.tsx +5 -1
- package/src/components/navigation/navigation-link-variants.ts +1 -1
- package/src/components/navigation/navigation-link.tsx +23 -1
- package/src/components/navigation/navigation.tsx +23 -3
- package/src/components/navigation-menu/navigation-menu.tsx +34 -1
- package/src/components/number-field/number-field.tsx +15 -1
- package/src/components/otp-field/otp-field.tsx +10 -1
- package/src/components/pagination/pagination.tsx +17 -1
- package/src/components/popover/popover.test.tsx +1 -1
- package/src/components/popover/popover.tsx +6 -2
- package/src/components/preview-card/preview-card.tsx +6 -2
- package/src/components/progress/progress.tsx +18 -1
- package/src/components/radio/radio.test.tsx +1 -1
- package/src/components/radio/radio.tsx +1 -1
- package/src/components/radio-group/radio-group.test.tsx +1 -1
- package/src/components/radio-group/radio-group.tsx +5 -1
- package/src/components/rating/rating.test.tsx +246 -0
- package/src/components/rating/rating.tsx +457 -0
- package/src/components/scroll-area/scroll-area.test.tsx +1 -1
- package/src/components/scroll-area/scroll-area.tsx +14 -1
- package/src/components/select/select.tsx +21 -2
- package/src/components/separator/separator.tsx +5 -1
- package/src/components/skeleton/skeleton.tsx +5 -1
- package/src/components/slider/slider.test.tsx +1 -1
- package/src/components/slider/slider.tsx +6 -1
- package/src/components/sparkline/sparkline.test.tsx +1 -1
- package/src/components/sparkline/sparkline.tsx +45 -1
- package/src/components/spinner/spinner.tsx +9 -1
- package/src/components/switch/switch.test.tsx +1 -1
- package/src/components/switch/switch.tsx +5 -1
- package/src/components/table/table.tsx +29 -1
- package/src/components/tabs/tabs.test.tsx +1 -1
- package/src/components/tabs/tabs.tsx +33 -2
- package/src/components/text-animate/text-animate.test.tsx +62 -0
- package/src/components/text-animate/text-animate.tsx +77 -9
- package/src/components/textarea/textarea.tsx +16 -1
- package/src/components/thumbnail/thumbnail.test.tsx +1 -1
- package/src/components/thumbnail/thumbnail.tsx +21 -1
- package/src/components/time-field/time-field.tsx +36 -1
- package/src/components/toast/toast.test.tsx +1 -1
- package/src/components/toast/toast.tsx +19 -1
- package/src/components/toc/toc.tsx +11 -1
- package/src/components/toggle/toggle.test.tsx +1 -1
- package/src/components/toggle-group/toggle-group.tsx +1 -1
- package/src/components/toolbar/toolbar.tsx +1 -1
- package/src/components/tooltip/tooltip.test.tsx +1 -1
- package/src/components/tooltip/tooltip.tsx +6 -2
- package/src/hooks/use-dismissible.ts +4 -0
- package/src/hooks/use-local-storage.ts +3 -3
- package/src/hooks/use-reduced-motion.ts +1 -1
- package/src/hooks/use-theme.ts +1 -1
- package/src/index.ts +11 -2
- package/src/internal/color-control.ts +178 -0
- package/src/internal/color-math.ts +44 -0
- package/src/internal/color-picker-context.ts +80 -0
- package/src/{floating.ts → internal/floating.ts} +3 -3
- package/src/{modal.ts → internal/modal.ts} +3 -3
- package/src/lib/color.test.ts +178 -0
- package/src/lib/color.ts +471 -0
- package/src/providers/direction-provider.tsx +4 -4
- package/src/providers/reduced-motion-provider.tsx +4 -8
- package/src/providers/theme-provider/theme-provider.tsx +28 -12
- package/src/providers/theme-provider/theme-script.tsx +2 -2
- package/src/test/setup.ts +1 -1
- package/styles.css +28 -4
- package/dist/floating.d.ts.map +0 -1
- package/dist/floating.js.map +0 -1
- package/dist/modal.d.ts.map +0 -1
- package/dist/modal.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
- /package/dist/{floating.js → internal/floating.js} +0 -0
- /package/dist/{modal.js → internal/modal.js} +0 -0
- /package/dist/{utils.d.ts → internal/utils.d.ts} +0 -0
- /package/dist/{utils.js → internal/utils.js} +0 -0
- /package/src/{floating.test.ts → internal/floating.test.ts} +0 -0
- /package/src/{modal.test.ts → internal/modal.test.ts} +0 -0
- /package/src/{utils.test.tsx → internal/utils.test.tsx} +0 -0
- /package/src/{utils.ts → internal/utils.ts} +0 -0
|
@@ -12,7 +12,7 @@ import ClassNames, { type ClassNamesOptionsType } from 'embla-carousel-class-nam
|
|
|
12
12
|
import Fade, { type FadeOptionsType } from 'embla-carousel-fade'
|
|
13
13
|
import { WheelGesturesPlugin, type WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures'
|
|
14
14
|
import type { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel'
|
|
15
|
-
import { cn } from '../../utils'
|
|
15
|
+
import { cn } from '../../internal/utils'
|
|
16
16
|
import { useDirection } from '../../hooks/use-direction'
|
|
17
17
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
18
18
|
|
|
@@ -68,30 +68,85 @@ function useCarousel(): CarouselContextValue {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
interface CarouselProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onSelect' | 'onScroll' | 'children'> {
|
|
71
|
+
/**
|
|
72
|
+
* Scroll axis. Maps to Embla's `axis`; exposed as `data-orientation`.
|
|
73
|
+
* @default 'horizontal'
|
|
74
|
+
*/
|
|
71
75
|
orientation?: CarouselOrientation
|
|
76
|
+
/**
|
|
77
|
+
* Wrap around from the last slide to the first.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
72
80
|
loop?: boolean
|
|
81
|
+
/**
|
|
82
|
+
* Where slides settle within the viewport.
|
|
83
|
+
* @default 'start'
|
|
84
|
+
*/
|
|
73
85
|
align?: 'start' | 'center' | 'end'
|
|
86
|
+
/**
|
|
87
|
+
* How many slides advance per step. `'auto'` groups by how many fit the viewport.
|
|
88
|
+
* @default 1
|
|
89
|
+
*/
|
|
74
90
|
slidesToScroll?: number | 'auto'
|
|
91
|
+
/**
|
|
92
|
+
* Clamp scrolling so there's no empty space at the edges. `false` disables containment.
|
|
93
|
+
* @default 'trimSnaps'
|
|
94
|
+
*/
|
|
75
95
|
containScroll?: false | 'trimSnaps' | 'keepSnaps'
|
|
96
|
+
/** Release snap points; glide to a momentum stop. */
|
|
76
97
|
dragFree?: boolean
|
|
98
|
+
/** Index of the slide to start on. */
|
|
77
99
|
startSnap?: number
|
|
100
|
+
/**
|
|
101
|
+
* When `false`, the engine is inert (no drag/snap) - e.g. to disable at a breakpoint.
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
78
104
|
active?: boolean
|
|
105
|
+
/**
|
|
106
|
+
* Whether pointer dragging is enabled (Embla's `watchDrag`).
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
79
109
|
draggable?: boolean
|
|
110
|
+
/** Scroll animation duration (Embla's ease). Forced to `0` under reduced motion. */
|
|
80
111
|
duration?: number
|
|
112
|
+
/** Escape hatch: a raw Embla options object, merged last so it wins over the flat props. */
|
|
81
113
|
options?: CarouselOptions
|
|
114
|
+
/** Enable the Autoplay plugin. `resumeAfter` (ms) restarts the timer after user interaction. */
|
|
82
115
|
autoplay?: boolean | CarouselAutoplayOptions
|
|
116
|
+
/** Enable continuous Auto Scroll. Mutually exclusive with `autoplay`; paused under reduced motion. */
|
|
83
117
|
autoScroll?: boolean | CarouselAutoScrollOptions
|
|
118
|
+
/** Enable the Auto Height plugin; animates the viewport to each slide's height. */
|
|
84
119
|
autoHeight?: boolean | CarouselAutoHeightOptions
|
|
120
|
+
/** Enable the Fade plugin (cross-fade instead of slide). Best with one slide per view. */
|
|
85
121
|
fade?: boolean | CarouselFadeOptions
|
|
122
|
+
/** Enable the Class Names plugin, which toggles `snapped` / `inView` classes on slides. */
|
|
86
123
|
classNames?: boolean | CarouselClassNamesOptions
|
|
124
|
+
/**
|
|
125
|
+
* Keyboard/ARIA plugin for the viewport. Set `false` to opt out.
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
87
128
|
accessibility?: boolean | CarouselAccessibilityOptions
|
|
129
|
+
/**
|
|
130
|
+
* Enable trackpad / mouse-wheel scrolling.
|
|
131
|
+
* @default false
|
|
132
|
+
*/
|
|
88
133
|
wheelGestures?: boolean | CarouselWheelGesturesOptions
|
|
134
|
+
/** Additional Embla plugins to append. */
|
|
89
135
|
plugins?: CarouselPlugin[]
|
|
136
|
+
/** Receives the Embla instance once initialized - for imperative control. */
|
|
90
137
|
setApi?: (api: CarouselApi) => void
|
|
138
|
+
/** Fires on init and whenever the engine re-initializes. */
|
|
91
139
|
onReInit?: (api: CarouselApi) => void
|
|
140
|
+
/** Fires when the selected snap changes. */
|
|
92
141
|
onSelect?: (api: CarouselApi) => void
|
|
142
|
+
/** Fires continuously while scrolling. */
|
|
93
143
|
onScroll?: (api: CarouselApi) => void
|
|
144
|
+
/**
|
|
145
|
+
* Hint stored in context for light-on-dark surfaces; read via `useCarousel()`.
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
94
148
|
light?: boolean
|
|
149
|
+
/** The content. */
|
|
95
150
|
children: React.ReactNode
|
|
96
151
|
}
|
|
97
152
|
|
|
@@ -141,7 +196,7 @@ function Carousel({
|
|
|
141
196
|
) {
|
|
142
197
|
warnedMutualExclusive.current = true
|
|
143
198
|
// eslint-disable-next-line no-console
|
|
144
|
-
console.warn('[Carousel] `autoplay` and `autoScroll` are mutually exclusive
|
|
199
|
+
console.warn('[Carousel] `autoplay` and `autoScroll` are mutually exclusive - preferring `autoplay`.')
|
|
145
200
|
}
|
|
146
201
|
}, [autoplayEnabled, autoScrollEnabled])
|
|
147
202
|
|
|
@@ -470,12 +525,16 @@ function Carousel({
|
|
|
470
525
|
)
|
|
471
526
|
}
|
|
472
527
|
|
|
473
|
-
|
|
528
|
+
interface CarouselContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
529
|
+
/** Props for the scroll viewport, the element that clips the track. */
|
|
530
|
+
viewportProps?: React.ComponentPropsWithoutRef<'div'>
|
|
531
|
+
}
|
|
474
532
|
|
|
475
|
-
function CarouselContent({ className, children, ...rest }: CarouselContentProps) {
|
|
533
|
+
function CarouselContent({ className, children, viewportProps, ...rest }: CarouselContentProps) {
|
|
476
534
|
const { viewportRef, orientation, autoHeight } = useCarousel()
|
|
477
535
|
return (
|
|
478
536
|
<div
|
|
537
|
+
{...viewportProps}
|
|
479
538
|
ref={viewportRef}
|
|
480
539
|
data-slot="carousel-viewport"
|
|
481
540
|
data-orientation={orientation}
|
|
@@ -483,6 +542,7 @@ function CarouselContent({ className, children, ...rest }: CarouselContentProps)
|
|
|
483
542
|
className={cn(
|
|
484
543
|
'overflow-hidden',
|
|
485
544
|
autoHeight && 'motion-safe:transition-[height] motion-safe:duration-300 motion-safe:ease-out',
|
|
545
|
+
viewportProps?.className,
|
|
486
546
|
)}
|
|
487
547
|
>
|
|
488
548
|
<div
|
|
@@ -523,6 +583,218 @@ function CarouselSlide({ className, ...rest }: CarouselSlideProps) {
|
|
|
523
583
|
)
|
|
524
584
|
}
|
|
525
585
|
|
|
586
|
+
interface CarouselThumbBox {
|
|
587
|
+
x: number
|
|
588
|
+
y: number
|
|
589
|
+
width: number
|
|
590
|
+
height: number
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function sameThumbBox(a: CarouselThumbBox | null, b: CarouselThumbBox) {
|
|
594
|
+
return a !== null && a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
interface CarouselThumbsContextValue {
|
|
598
|
+
selectedIndex: number
|
|
599
|
+
select: (index: number) => void
|
|
600
|
+
light: boolean
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
const CarouselThumbsContext = React.createContext<CarouselThumbsContextValue | null>(null)
|
|
604
|
+
const CarouselThumbIndexContext = React.createContext(0)
|
|
605
|
+
|
|
606
|
+
function useCarouselThumbs(): CarouselThumbsContextValue {
|
|
607
|
+
const ctx = React.useContext(CarouselThumbsContext)
|
|
608
|
+
if (!ctx) {
|
|
609
|
+
throw new Error('<CarouselThumb> must be rendered inside <CarouselThumbs>')
|
|
610
|
+
}
|
|
611
|
+
return ctx
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// Naming the slides keeps the indicator, which is a child of the track too, out
|
|
615
|
+
// of the snap count.
|
|
616
|
+
const CAROUSEL_THUMB_OPTIONS: CarouselOptions = { slides: ':scope > [data-slot=carousel-thumb]' }
|
|
617
|
+
|
|
618
|
+
const CAROUSEL_THUMB_TRANSITION = cn(
|
|
619
|
+
'transition-[opacity,translate,scale] motion-reduce:transition-none',
|
|
620
|
+
'duration-[300ms,250ms,250ms]',
|
|
621
|
+
'ease-[ease-out,cubic-bezier(0.175,0.885,0.32,1.5),cubic-bezier(0.175,0.885,0.32,1.5)]',
|
|
622
|
+
'active:duration-[300ms,100ms,100ms] active:ease-[ease-out,ease-in-out,ease-in-out]',
|
|
623
|
+
)
|
|
624
|
+
|
|
625
|
+
interface CarouselThumbsProps extends Omit<
|
|
626
|
+
React.ComponentPropsWithoutRef<'div'>,
|
|
627
|
+
'draggable' | 'onSelect' | 'onScroll'
|
|
628
|
+
> {
|
|
629
|
+
/**
|
|
630
|
+
* Lay the thumbnails out in a row or a column. Independent of the carousel's own axis.
|
|
631
|
+
* @default 'horizontal'
|
|
632
|
+
*/
|
|
633
|
+
orientation?: CarouselOrientation
|
|
634
|
+
/**
|
|
635
|
+
* Light-on-dark styling for use over imagery.
|
|
636
|
+
* @default false
|
|
637
|
+
*/
|
|
638
|
+
light?: boolean
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
function CarouselThumbs({
|
|
642
|
+
orientation = 'horizontal',
|
|
643
|
+
light: lightProp,
|
|
644
|
+
className,
|
|
645
|
+
children,
|
|
646
|
+
...rest
|
|
647
|
+
}: CarouselThumbsProps) {
|
|
648
|
+
const { selectedIndex, scrollTo, light: ctxLight } = useCarousel()
|
|
649
|
+
const light = lightProp ?? ctxLight
|
|
650
|
+
const [api, setApi] = React.useState<CarouselApi>()
|
|
651
|
+
const [box, setBox] = React.useState<CarouselThumbBox | null>(null)
|
|
652
|
+
const vertical = orientation === 'vertical'
|
|
653
|
+
|
|
654
|
+
// No dependency list: any render can add, remove or resize a thumbnail. Offsets
|
|
655
|
+
// are relative to the track, which is what Embla translates, so scrolling the
|
|
656
|
+
// rail carries the indicator along without a re-measure.
|
|
657
|
+
React.useEffect(() => {
|
|
658
|
+
const thumb = api?.slideNodes()[selectedIndex]
|
|
659
|
+
const track = api?.containerNode()
|
|
660
|
+
|
|
661
|
+
const measure = () => {
|
|
662
|
+
if (!thumb || !track) return setBox(null)
|
|
663
|
+
// Layout offsets, never rects: the thumbnail scales and shifts under the
|
|
664
|
+
// press, and a rect would catch it mid-animation. The track's transform
|
|
665
|
+
// makes it the offset parent in most engines; where it doesn't, the
|
|
666
|
+
// thumbnail is measured from further up and the track's own offset comes
|
|
667
|
+
// back off.
|
|
668
|
+
const nested = thumb.offsetParent === track
|
|
669
|
+
const next = {
|
|
670
|
+
x: thumb.offsetLeft - (nested ? 0 : track.offsetLeft),
|
|
671
|
+
y: thumb.offsetTop - (nested ? 0 : track.offsetTop),
|
|
672
|
+
width: thumb.offsetWidth,
|
|
673
|
+
height: thumb.offsetHeight,
|
|
674
|
+
}
|
|
675
|
+
setBox((previous) => (sameThumbBox(previous, next) ? previous : next))
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
measure()
|
|
679
|
+
if (!thumb || !track || typeof ResizeObserver === 'undefined') return
|
|
680
|
+
const observer = new ResizeObserver(measure)
|
|
681
|
+
observer.observe(thumb)
|
|
682
|
+
return () => observer.disconnect()
|
|
683
|
+
})
|
|
684
|
+
|
|
685
|
+
React.useEffect(() => {
|
|
686
|
+
const thumb = api?.slideNodes()[selectedIndex]
|
|
687
|
+
const viewport = api?.rootNode()
|
|
688
|
+
if (!thumb || !viewport) return
|
|
689
|
+
const slide = thumb.getBoundingClientRect()
|
|
690
|
+
const frame = viewport.getBoundingClientRect()
|
|
691
|
+
const visible = vertical
|
|
692
|
+
? slide.top >= frame.top - 1 && slide.bottom <= frame.bottom + 1
|
|
693
|
+
: slide.left >= frame.left - 1 && slide.right <= frame.right + 1
|
|
694
|
+
if (!visible) api?.goTo(selectedIndex)
|
|
695
|
+
}, [api, selectedIndex, vertical])
|
|
696
|
+
|
|
697
|
+
const context = React.useMemo<CarouselThumbsContextValue>(
|
|
698
|
+
() => ({ selectedIndex, select: scrollTo, light }),
|
|
699
|
+
[selectedIndex, scrollTo, light],
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
return (
|
|
703
|
+
<CarouselThumbsContext.Provider value={context}>
|
|
704
|
+
<Carousel
|
|
705
|
+
orientation={orientation}
|
|
706
|
+
align="start"
|
|
707
|
+
// One snap per thumbnail even when several share a view, so a snap index
|
|
708
|
+
// means the same thing on both carousels.
|
|
709
|
+
containScroll="keepSnaps"
|
|
710
|
+
options={CAROUSEL_THUMB_OPTIONS}
|
|
711
|
+
setApi={setApi}
|
|
712
|
+
light={light}
|
|
713
|
+
role="group"
|
|
714
|
+
aria-roledescription={undefined}
|
|
715
|
+
aria-label="Choose slide to display"
|
|
716
|
+
data-slot="carousel-thumbs"
|
|
717
|
+
className={cn(vertical ? 'shrink-0' : 'w-full', className)}
|
|
718
|
+
{...rest}
|
|
719
|
+
>
|
|
720
|
+
<CarouselContent
|
|
721
|
+
viewportProps={{
|
|
722
|
+
// Bleed, given back as padding, so focus rings aren't clipped.
|
|
723
|
+
className: cn('-m-0.5 p-0.5', vertical && 'h-[calc(100%+(--spacing(1)))]'),
|
|
724
|
+
}}
|
|
725
|
+
// The track must stay unpositioned: Embla measures it and its slides
|
|
726
|
+
// with `offsetLeft`, so they have to share an offset parent.
|
|
727
|
+
className={cn('gap-2', vertical ? 'mt-0' : 'ms-0')}
|
|
728
|
+
>
|
|
729
|
+
{React.Children.map(children, (child, index) => (
|
|
730
|
+
<CarouselThumbIndexContext.Provider value={index}>{child}</CarouselThumbIndexContext.Provider>
|
|
731
|
+
))}
|
|
732
|
+
|
|
733
|
+
{box ? (
|
|
734
|
+
<span
|
|
735
|
+
aria-hidden="true"
|
|
736
|
+
data-slot="carousel-thumbs-indicator"
|
|
737
|
+
className={cn(
|
|
738
|
+
// Anchored to the track by its transform, so it rides the scroll.
|
|
739
|
+
'pointer-events-none absolute top-0 left-0 rounded-lg border',
|
|
740
|
+
light ? 'border-white' : 'border-border-inverse',
|
|
741
|
+
'motion-safe:transition-[translate,width,height] motion-safe:duration-250',
|
|
742
|
+
)}
|
|
743
|
+
style={{ translate: `${box.x}px ${box.y}px`, width: box.width, height: box.height }}
|
|
744
|
+
/>
|
|
745
|
+
) : null}
|
|
746
|
+
</CarouselContent>
|
|
747
|
+
</Carousel>
|
|
748
|
+
</CarouselThumbsContext.Provider>
|
|
749
|
+
)
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
interface CarouselThumbProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
753
|
+
/** Slide this thumbnail selects. Defaults to its position among the thumbnails. */
|
|
754
|
+
index?: number
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
function CarouselThumb({ index: indexProp, className, children, onClick, ...rest }: CarouselThumbProps) {
|
|
758
|
+
const { selectedIndex, select, light } = useCarouselThumbs()
|
|
759
|
+
const position = React.useContext(CarouselThumbIndexContext)
|
|
760
|
+
const index = indexProp ?? position
|
|
761
|
+
const active = index === selectedIndex
|
|
762
|
+
|
|
763
|
+
return (
|
|
764
|
+
<button
|
|
765
|
+
type="button"
|
|
766
|
+
aria-label={`Go to slide ${index + 1}`}
|
|
767
|
+
{...rest}
|
|
768
|
+
data-slot="carousel-thumb"
|
|
769
|
+
data-active={active || undefined}
|
|
770
|
+
aria-current={active ? 'true' : undefined}
|
|
771
|
+
onClick={(event) => {
|
|
772
|
+
onClick?.(event)
|
|
773
|
+
if (!event.defaultPrevented) select(index)
|
|
774
|
+
}}
|
|
775
|
+
className={cn(
|
|
776
|
+
'block w-18 shrink-0 grow-0 transform-gpu cursor-pointer rounded-lg border p-1',
|
|
777
|
+
light ? 'outline-ring-light border-white/25 bg-white/10 backdrop-blur-md' : 'bg-background outline-ring',
|
|
778
|
+
'focus-visible:outline-2',
|
|
779
|
+
CAROUSEL_THUMB_TRANSITION,
|
|
780
|
+
'active:translate-y-px active:scale-[0.97]',
|
|
781
|
+
!active && 'opacity-65 hover:opacity-100',
|
|
782
|
+
className,
|
|
783
|
+
)}
|
|
784
|
+
>
|
|
785
|
+
<span
|
|
786
|
+
data-slot="carousel-thumb-media"
|
|
787
|
+
className={cn(
|
|
788
|
+
'relative block aspect-square w-full overflow-hidden rounded-md',
|
|
789
|
+
light ? 'bg-white/10' : 'bg-background-muted',
|
|
790
|
+
)}
|
|
791
|
+
>
|
|
792
|
+
{children}
|
|
793
|
+
</span>
|
|
794
|
+
</button>
|
|
795
|
+
)
|
|
796
|
+
}
|
|
797
|
+
|
|
526
798
|
type CarouselButtonState = { disabled: boolean; direction: 'prev' | 'next' }
|
|
527
799
|
|
|
528
800
|
type CarouselNavPosition = 'inside' | 'outside' | 'outside-half' | 'none'
|
|
@@ -648,7 +920,15 @@ function CarouselNext({ className, position = 'inside', disabled: disabledProp,
|
|
|
648
920
|
}
|
|
649
921
|
|
|
650
922
|
interface CarouselPaginationProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
923
|
+
/**
|
|
924
|
+
* Lay the bullets out in a row or a column.
|
|
925
|
+
* @default 'horizontal'
|
|
926
|
+
*/
|
|
651
927
|
orientation?: CarouselOrientation
|
|
928
|
+
/**
|
|
929
|
+
* Light-on-dark styling for use over imagery.
|
|
930
|
+
* @default false
|
|
931
|
+
*/
|
|
652
932
|
light?: boolean
|
|
653
933
|
}
|
|
654
934
|
|
|
@@ -764,9 +1044,25 @@ function CarouselAutoplayIndicator({ delay, isPlaying, light, orientation }: Car
|
|
|
764
1044
|
}
|
|
765
1045
|
|
|
766
1046
|
interface CarouselProgressProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
1047
|
+
/**
|
|
1048
|
+
* What drives the fill. `'auto'` counts down autoplay while it plays, otherwise tracks scroll position.
|
|
1049
|
+
* @default 'auto'
|
|
1050
|
+
*/
|
|
767
1051
|
source?: 'auto' | 'autoplay' | 'scroll'
|
|
1052
|
+
/**
|
|
1053
|
+
* Straight bar or circular ring.
|
|
1054
|
+
* @default 'bar'
|
|
1055
|
+
*/
|
|
768
1056
|
variant?: 'bar' | 'circular'
|
|
1057
|
+
/**
|
|
1058
|
+
* Fill direction for the bar variant.
|
|
1059
|
+
* @default 'horizontal'
|
|
1060
|
+
*/
|
|
769
1061
|
orientation?: CarouselOrientation
|
|
1062
|
+
/**
|
|
1063
|
+
* Light-on-dark styling for use over imagery.
|
|
1064
|
+
* @default false
|
|
1065
|
+
*/
|
|
770
1066
|
light?: boolean
|
|
771
1067
|
}
|
|
772
1068
|
|
|
@@ -939,7 +1235,7 @@ function CarouselAutoplayCircularIndicator({
|
|
|
939
1235
|
}
|
|
940
1236
|
|
|
941
1237
|
/**
|
|
942
|
-
* Bidirectionally sync the selected snap between two carousels
|
|
1238
|
+
* Bidirectionally sync the selected snap between two carousels - the classic
|
|
943
1239
|
* "main + thumbnails" pattern. Wires `select` on each so navigating either
|
|
944
1240
|
* one drives the other. Both apis can be undefined initially (e.g. waiting on
|
|
945
1241
|
* `setApi`); the effect re-runs once both resolve.
|
|
@@ -975,6 +1271,8 @@ export {
|
|
|
975
1271
|
Carousel,
|
|
976
1272
|
CarouselContent,
|
|
977
1273
|
CarouselSlide,
|
|
1274
|
+
CarouselThumbs,
|
|
1275
|
+
CarouselThumb,
|
|
978
1276
|
CarouselPrev,
|
|
979
1277
|
CarouselNext,
|
|
980
1278
|
CarouselPagination,
|
|
@@ -986,6 +1284,8 @@ export type {
|
|
|
986
1284
|
CarouselProps,
|
|
987
1285
|
CarouselContentProps,
|
|
988
1286
|
CarouselSlideProps,
|
|
1287
|
+
CarouselThumbsProps,
|
|
1288
|
+
CarouselThumbProps,
|
|
989
1289
|
CarouselPrevProps,
|
|
990
1290
|
CarouselNextProps,
|
|
991
1291
|
CarouselPaginationProps,
|
|
@@ -71,13 +71,13 @@ describe('Checkbox', () => {
|
|
|
71
71
|
expect(onCheckedChange).not.toHaveBeenCalled()
|
|
72
72
|
})
|
|
73
73
|
|
|
74
|
-
it('
|
|
74
|
+
it('honors indeterminate prop', () => {
|
|
75
75
|
render(<Checkbox indeterminate aria-label="Mixed" />)
|
|
76
76
|
const cb = screen.getByRole('checkbox')
|
|
77
77
|
expect(cb).toHaveAttribute('aria-checked', 'mixed')
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
it('
|
|
80
|
+
it('honors controlled checked prop', async () => {
|
|
81
81
|
const user = userEvent.setup()
|
|
82
82
|
const onCheckedChange = vi.fn()
|
|
83
83
|
render(<Checkbox checked={false} aria-label="Controlled" onCheckedChange={onCheckedChange} />)
|
|
@@ -4,7 +4,7 @@ import * as React from 'react'
|
|
|
4
4
|
import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'
|
|
5
5
|
import { LazyMotion, domAnimation, m, useAnimate } from 'motion/react'
|
|
6
6
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
7
|
-
import { cn, useComposedRefs } from '../../utils'
|
|
7
|
+
import { cn, useComposedRefs } from '../../internal/utils'
|
|
8
8
|
|
|
9
9
|
const SQUISH_TRANSITION = {
|
|
10
10
|
duration: 0.3,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group'
|
|
3
|
-
import { cn } from '../../utils'
|
|
3
|
+
import { cn } from '../../internal/utils'
|
|
4
4
|
|
|
5
5
|
interface CheckboxGroupProps extends React.ComponentProps<typeof BaseCheckboxGroup> {
|
|
6
|
+
/**
|
|
7
|
+
* Stack the boxes in a column, or wrap them into a row.
|
|
8
|
+
* @default 'vertical'
|
|
9
|
+
*/
|
|
6
10
|
orientation?: 'horizontal' | 'vertical'
|
|
7
11
|
}
|
|
8
12
|
|
|
@@ -5,7 +5,7 @@ import { mergeProps } from '@base-ui/react/merge-props'
|
|
|
5
5
|
import { useRender } from '@base-ui/react/use-render'
|
|
6
6
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
7
7
|
import { AnimatePresence, LazyMotion, domAnimation, m } from 'motion/react'
|
|
8
|
-
import { cn, focusableProps } from '../../utils'
|
|
8
|
+
import { cn, focusableProps } from '../../internal/utils'
|
|
9
9
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
10
10
|
import { buttonVariants } from '../button/button-variants'
|
|
11
11
|
|
|
@@ -38,13 +38,42 @@ interface ChipGroupContextValue {
|
|
|
38
38
|
const ChipGroupContext = React.createContext<ChipGroupContextValue | null>(null)
|
|
39
39
|
|
|
40
40
|
interface ChipProps extends Omit<useRender.ComponentProps<'button', ChipState>, 'render'> {
|
|
41
|
+
/**
|
|
42
|
+
* Visual style, from the shared [`Button`](/ui/components/react/button) palette. Inherited from `ChipGroup`.
|
|
43
|
+
* @default 'soft'
|
|
44
|
+
*/
|
|
41
45
|
variant?: ChipVariant
|
|
46
|
+
/**
|
|
47
|
+
* Height, padding, text, and icon size. Inherited from `ChipGroup`.
|
|
48
|
+
* @default 'md'
|
|
49
|
+
*/
|
|
42
50
|
size?: ChipSize
|
|
51
|
+
/** Replace the underlying element (e.g. an `<a>`), or compose it with another component. */
|
|
43
52
|
render?: useRender.ComponentProps<'button', ChipState>['render']
|
|
53
|
+
/**
|
|
54
|
+
* Render a close button; clicking the chip dismisses it with an exit animation.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
44
57
|
dismissible?: boolean
|
|
58
|
+
/**
|
|
59
|
+
* Controlled visibility for a **dismissible** chip - pair with `onOpenChange` to own dismissal in your own state.
|
|
60
|
+
* (For a non-dismissible chip, render it conditionally instead.)
|
|
61
|
+
*/
|
|
45
62
|
open?: boolean
|
|
63
|
+
/**
|
|
64
|
+
* The **intent** signal - fires with `false` the moment a dismiss is requested. Use it with `open` for controlled
|
|
65
|
+
* mode: update your state here.
|
|
66
|
+
*/
|
|
46
67
|
onOpenChange?: (open: boolean) => void
|
|
68
|
+
/**
|
|
69
|
+
* The **completion** signal - fires once the exit animation finishes. Use it in uncontrolled mode to drop the chip
|
|
70
|
+
* from state after it's animated out.
|
|
71
|
+
*/
|
|
47
72
|
onDismiss?: () => void
|
|
73
|
+
/**
|
|
74
|
+
* Accessible label for the dismiss action (rendered as `sr-only` text).
|
|
75
|
+
* @default 'Dismiss'
|
|
76
|
+
*/
|
|
48
77
|
closeLabel?: string
|
|
49
78
|
}
|
|
50
79
|
|
|
@@ -186,8 +215,11 @@ interface ChipGroupHandle {
|
|
|
186
215
|
}
|
|
187
216
|
|
|
188
217
|
interface ChipGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
218
|
+
/** Exposes `clearAll()`, which dismisses every `dismissible` child. */
|
|
189
219
|
ref?: React.Ref<ChipGroupHandle>
|
|
220
|
+
/** Default `variant` for every child chip; a chip may override it. */
|
|
190
221
|
variant?: ChipVariant
|
|
222
|
+
/** Default `size` for every child chip; a chip may override it. */
|
|
191
223
|
size?: ChipSize
|
|
192
224
|
}
|
|
193
225
|
|