@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
|
@@ -107,7 +107,7 @@ describe('ScrollArea', () => {
|
|
|
107
107
|
)
|
|
108
108
|
expect(container.querySelector('[data-slot="scroll-area-scrollbar"]')).toBeNull()
|
|
109
109
|
expect(container.querySelector('[data-slot="scroll-area-corner"]')).toBeNull()
|
|
110
|
-
// Viewport stays scrollable
|
|
110
|
+
// Viewport stays scrollable - it's still in the DOM.
|
|
111
111
|
expect(container.querySelector('[data-slot="scroll-area-viewport"]')).not.toBeNull()
|
|
112
112
|
})
|
|
113
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area'
|
|
3
|
-
import { cn } from '../../utils'
|
|
3
|
+
import { cn } from '../../internal/utils'
|
|
4
4
|
|
|
5
5
|
type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both'
|
|
6
6
|
type ScrollbarVisibility = 'always' | 'auto' | 'never'
|
|
@@ -18,9 +18,22 @@ const SCROLLBAR_AUTO_CLASSES = cn(
|
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
interface ScrollAreaProps extends React.ComponentProps<typeof BaseScrollArea.Root> {
|
|
21
|
+
/**
|
|
22
|
+
* Which axis (or axes) gets a scrollbar. `both` also renders the corner.
|
|
23
|
+
* @default 'vertical'
|
|
24
|
+
*/
|
|
21
25
|
orientation?: ScrollAreaOrientation
|
|
26
|
+
/**
|
|
27
|
+
* Fade the content at scrollable edges via a CSS mask.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
22
30
|
scrollShadow?: boolean
|
|
31
|
+
/**
|
|
32
|
+
* `auto` reveals the bar on hover/scroll; `never` hides it while keeping content scrollable.
|
|
33
|
+
* @default 'always'
|
|
34
|
+
*/
|
|
23
35
|
scrollbarVisibility?: ScrollbarVisibility
|
|
36
|
+
/** Props forwarded to the inner scroll viewport - `ref`, `onScroll`, `className`, etc. */
|
|
24
37
|
viewportProps?: Omit<React.ComponentProps<typeof BaseScrollArea.Viewport>, 'children'>
|
|
25
38
|
}
|
|
26
39
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Select as BaseSelect } from '@base-ui/react/select'
|
|
5
5
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
6
|
-
import { cn } from '../../utils'
|
|
7
|
-
import { type FloatingContentProps, splitFloatingProps } from '../../floating'
|
|
6
|
+
import { cn } from '../../internal/utils'
|
|
7
|
+
import { type FloatingContentProps, splitFloatingProps } from '../../internal/floating'
|
|
8
8
|
import { inputVariants } from '../input/input-variants'
|
|
9
9
|
|
|
10
10
|
type SelectSize = 'sm' | 'md' | 'lg'
|
|
@@ -33,8 +33,20 @@ function useSelectContext() {
|
|
|
33
33
|
type BaseSelectRootProps = React.ComponentProps<typeof BaseSelect.Root>
|
|
34
34
|
|
|
35
35
|
interface SelectProps extends BaseSelectRootProps {
|
|
36
|
+
/**
|
|
37
|
+
* Trigger height, popup radius, and item sizing.
|
|
38
|
+
* @default 'md'
|
|
39
|
+
*/
|
|
36
40
|
size?: SelectSize
|
|
41
|
+
/**
|
|
42
|
+
* Trigger appearance - bordered or filled.
|
|
43
|
+
* @default 'outline'
|
|
44
|
+
*/
|
|
37
45
|
variant?: SelectVariant
|
|
46
|
+
/**
|
|
47
|
+
* Overlay the selected item over the trigger on open. **Set `false` when using a `startSlot`.**
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
38
50
|
alignItemWithTrigger?: boolean
|
|
39
51
|
}
|
|
40
52
|
|
|
@@ -106,8 +118,14 @@ const ICON_SIZE: Record<SelectSize, string> = {
|
|
|
106
118
|
}
|
|
107
119
|
|
|
108
120
|
interface SelectTriggerProps extends React.ComponentProps<typeof BaseSelect.Trigger> {
|
|
121
|
+
/**
|
|
122
|
+
* Render a clear button inside the trigger when a value is present.
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
109
125
|
clearable?: boolean
|
|
126
|
+
/** Adornment before the value. Pair with `alignItemWithTrigger={false}`. */
|
|
110
127
|
startSlot?: React.ReactNode
|
|
128
|
+
/** Adornment after the value, before the chevron. */
|
|
111
129
|
endSlot?: React.ReactNode
|
|
112
130
|
}
|
|
113
131
|
|
|
@@ -221,6 +239,7 @@ type SelectContentProps = React.ComponentProps<typeof BaseSelect.Popup> &
|
|
|
221
239
|
React.ComponentProps<typeof BaseSelect.Positioner>,
|
|
222
240
|
React.ComponentProps<typeof BaseSelect.Portal>
|
|
223
241
|
> & {
|
|
242
|
+
/** Per-popup override of the root's alignment setting. */
|
|
224
243
|
alignItemWithTrigger?: boolean
|
|
225
244
|
}
|
|
226
245
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { Separator as BaseSeparator } from '@base-ui/react/separator'
|
|
3
|
-
import { cn } from '../../utils'
|
|
3
|
+
import { cn } from '../../internal/utils'
|
|
4
4
|
|
|
5
5
|
type SeparatorVariant = 'solid' | 'dashed' | 'dotted' | 'double' | 'gradient' | 'wave' | 'zigzag'
|
|
6
6
|
|
|
@@ -69,6 +69,10 @@ function DecorativePattern({ variant, horizontal }: { variant: SeparatorVariant;
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
type SeparatorProps = React.ComponentProps<typeof BaseSeparator> & {
|
|
72
|
+
/**
|
|
73
|
+
* Line style. `gradient`, `wave`, `zigzag`, and `dotted` are decorative.
|
|
74
|
+
* @default 'solid'
|
|
75
|
+
*/
|
|
72
76
|
variant?: SeparatorVariant
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { cn } from '../../utils'
|
|
2
|
+
import { cn } from '../../internal/utils'
|
|
3
3
|
|
|
4
4
|
type SkeletonEffect = 'shimmer' | 'pulse' | 'none'
|
|
5
5
|
|
|
6
6
|
interface SkeletonProps extends React.ComponentProps<'div'> {
|
|
7
|
+
/**
|
|
8
|
+
* Animation played while the placeholder is visible. All effects honor `prefers-reduced-motion`.
|
|
9
|
+
* @default 'shimmer'
|
|
10
|
+
*/
|
|
7
11
|
effect?: SkeletonEffect
|
|
8
12
|
}
|
|
9
13
|
|
|
@@ -70,7 +70,7 @@ describe('Slider', () => {
|
|
|
70
70
|
await user.keyboard('{ArrowRight}')
|
|
71
71
|
|
|
72
72
|
expect(onValueChange).toHaveBeenCalled()
|
|
73
|
-
// Parent never updates
|
|
73
|
+
// Parent never updates - value stays at 30.
|
|
74
74
|
expect(thumb).toHaveAttribute('aria-valuenow', '30')
|
|
75
75
|
})
|
|
76
76
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Slider as BaseSlider } from '@base-ui/react/slider'
|
|
5
5
|
import { AnimatePresence, LazyMotion, domAnimation, m, useAnimate } from 'motion/react'
|
|
6
|
-
import { cn } from '../../utils'
|
|
6
|
+
import { cn } from '../../internal/utils'
|
|
7
7
|
import { useDirection } from '../../hooks/use-direction'
|
|
8
8
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
9
9
|
|
|
@@ -165,7 +165,12 @@ const indicatorClasses =
|
|
|
165
165
|
'bg-primary select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'
|
|
166
166
|
|
|
167
167
|
interface SliderProps extends Omit<BaseSlider.Root.Props, 'children'> {
|
|
168
|
+
/**
|
|
169
|
+
* When the value tooltip shows - on interaction, always, or never.
|
|
170
|
+
* @default 'auto'
|
|
171
|
+
*/
|
|
168
172
|
tooltipVisibility?: SliderTooltipVisibility
|
|
173
|
+
/** Accessible name for each thumb. Use a function to name range ends. */
|
|
169
174
|
thumbAriaLabel?: string | ((index: number) => string)
|
|
170
175
|
}
|
|
171
176
|
|
|
@@ -179,7 +179,7 @@ describe('Sparkline', () => {
|
|
|
179
179
|
const chart = screen.getByRole('img')
|
|
180
180
|
stubRect(chart, 100)
|
|
181
181
|
|
|
182
|
-
// A touch tap fires pointerdown without a preceding move
|
|
182
|
+
// A touch tap fires pointerdown without a preceding move - it must activate immediately.
|
|
183
183
|
fireEvent.pointerDown(chart, { clientX: 100, pointerType: 'touch' })
|
|
184
184
|
expect(onActiveChange).toHaveBeenLastCalledWith({ index: 5, value: 12, label: undefined })
|
|
185
185
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
-
import { cn } from '../../utils'
|
|
4
|
+
import { cn } from '../../internal/utils'
|
|
5
5
|
import { useDirection } from '../../hooks/use-direction'
|
|
6
6
|
|
|
7
7
|
type SparklineVariant = 'line' | 'area' | 'column'
|
|
@@ -32,11 +32,20 @@ function useSparkline(): SparklineContextValue {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
interface SparklineProps extends Omit<React.ComponentProps<'div'>, 'onChange'> {
|
|
35
|
+
/** **Required.** The series to plot. */
|
|
35
36
|
data: number[]
|
|
37
|
+
/** Per-point labels (e.g. dates), surfaced in the tooltip and to `SparklineLabel`. */
|
|
36
38
|
labels?: string[]
|
|
39
|
+
/**
|
|
40
|
+
* Accent for the line, fill, indicator, and tooltip swatch. Any CSS color.
|
|
41
|
+
* @default var(--primary)
|
|
42
|
+
*/
|
|
37
43
|
color?: string
|
|
44
|
+
/** Formatting for displayed values (`SparklineValue`, tooltip). */
|
|
38
45
|
format?: Intl.NumberFormatOptions
|
|
46
|
+
/** Locale used by `Intl.NumberFormat`. */
|
|
39
47
|
locale?: Intl.LocalesArgument
|
|
48
|
+
/** Fires when the hovered point changes; `null` on pointer leave. */
|
|
40
49
|
onActiveChange?: (point: SparklinePoint | null) => void
|
|
41
50
|
}
|
|
42
51
|
|
|
@@ -95,14 +104,47 @@ function Sparkline({
|
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
interface SparklineChartProps extends Omit<React.ComponentProps<'div'>, 'children'> {
|
|
107
|
+
/**
|
|
108
|
+
* The layout.
|
|
109
|
+
* @default 'line'
|
|
110
|
+
*/
|
|
98
111
|
variant?: SparklineVariant
|
|
112
|
+
/**
|
|
113
|
+
* Line smoothing from `0` (straight) to `1` (fully rounded). Line/area only.
|
|
114
|
+
* @default 0.5
|
|
115
|
+
*/
|
|
99
116
|
curve?: number
|
|
117
|
+
/**
|
|
118
|
+
* **`line` only.** Add a gradient fill from the line to the bottom edge. Area is always filled.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
100
121
|
fill?: boolean
|
|
122
|
+
/**
|
|
123
|
+
* The pivot the fill/bars grow from; values below it render below. Area and column.
|
|
124
|
+
* @default 0
|
|
125
|
+
*/
|
|
101
126
|
baseline?: number
|
|
127
|
+
/**
|
|
128
|
+
* Chart height, in pixels.
|
|
129
|
+
* @default 48
|
|
130
|
+
*/
|
|
102
131
|
height?: number
|
|
132
|
+
/**
|
|
133
|
+
* Line thickness, in pixels. Line/area only.
|
|
134
|
+
* @default 2
|
|
135
|
+
*/
|
|
103
136
|
strokeWidth?: number
|
|
137
|
+
/**
|
|
138
|
+
* Show the hover indicator (dot + guide, or the active-column highlight).
|
|
139
|
+
* @default true
|
|
140
|
+
*/
|
|
104
141
|
indicator?: boolean
|
|
142
|
+
/**
|
|
143
|
+
* Float a tooltip at the hovered point.
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
105
146
|
tooltip?: boolean
|
|
147
|
+
/** Render custom tooltip content instead of the default swatch + value. Implies `tooltip`. */
|
|
106
148
|
renderTooltip?: (point: SparklinePoint) => React.ReactNode
|
|
107
149
|
}
|
|
108
150
|
|
|
@@ -352,6 +394,7 @@ function SparklineChart({
|
|
|
352
394
|
}
|
|
353
395
|
|
|
354
396
|
type SparklineValueProps = Omit<React.ComponentProps<'span'>, 'children'> & {
|
|
397
|
+
/** Render function to fully customize the displayed text. Omit for the number. */
|
|
355
398
|
children?: (formatted: string, value: number) => React.ReactNode
|
|
356
399
|
}
|
|
357
400
|
|
|
@@ -372,6 +415,7 @@ function SparklineValue({ className, children, ...props }: SparklineValueProps)
|
|
|
372
415
|
}
|
|
373
416
|
|
|
374
417
|
type SparklineLabelProps = Omit<React.ComponentProps<'span'>, 'children'> & {
|
|
418
|
+
/** Render function to customize the displayed text. Omit for the raw label. */
|
|
375
419
|
children?: (label: string, point: SparklinePoint) => React.ReactNode
|
|
376
420
|
}
|
|
377
421
|
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { animate, LazyMotion, domAnimation, m, useMotionValue, useTransform } from 'motion/react'
|
|
5
5
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
6
|
-
import { cn } from '../../utils'
|
|
6
|
+
import { cn } from '../../internal/utils'
|
|
7
7
|
|
|
8
8
|
type SpinnerVariant = 'circular' | 'dots' | 'sparkle'
|
|
9
9
|
|
|
10
10
|
interface SpinnerProps extends Omit<React.ComponentProps<'span'>, 'children'> {
|
|
11
|
+
/**
|
|
12
|
+
* The animated shape.
|
|
13
|
+
* @default 'circular'
|
|
14
|
+
*/
|
|
11
15
|
variant?: SpinnerVariant
|
|
16
|
+
/**
|
|
17
|
+
* Inherit the surrounding text color (`currentColor`) instead of the primary accent.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
12
20
|
currentColor?: boolean
|
|
13
21
|
}
|
|
14
22
|
|
|
@@ -71,7 +71,7 @@ describe('Switch', () => {
|
|
|
71
71
|
expect(onCheckedChange).not.toHaveBeenCalled()
|
|
72
72
|
})
|
|
73
73
|
|
|
74
|
-
it('
|
|
74
|
+
it('honors controlled checked prop', async () => {
|
|
75
75
|
const user = userEvent.setup()
|
|
76
76
|
const onCheckedChange = vi.fn()
|
|
77
77
|
render(<Switch checked={false} aria-label="Controlled" onCheckedChange={onCheckedChange} />)
|
|
@@ -5,7 +5,7 @@ import { Switch as BaseSwitch } from '@base-ui/react/switch'
|
|
|
5
5
|
import { LazyMotion, domAnimation, m, useAnimate } from 'motion/react'
|
|
6
6
|
import { useDirection } from '../../hooks/use-direction'
|
|
7
7
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
8
|
-
import { cn, useComposedRefs } from '../../utils'
|
|
8
|
+
import { cn, useComposedRefs } from '../../internal/utils'
|
|
9
9
|
|
|
10
10
|
const switchSizes = {
|
|
11
11
|
sm: {
|
|
@@ -112,6 +112,10 @@ function SwitchThumb({
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
interface SwitchProps extends React.ComponentProps<typeof BaseSwitch.Root> {
|
|
115
|
+
/**
|
|
116
|
+
* Scales the track and thumb together.
|
|
117
|
+
* @default 'md'
|
|
118
|
+
*/
|
|
115
119
|
size?: SwitchSize
|
|
116
120
|
}
|
|
117
121
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { cn } from '../../utils'
|
|
2
|
+
import { cn } from '../../internal/utils'
|
|
3
3
|
|
|
4
4
|
type TableSize = 'sm' | 'md' | 'lg'
|
|
5
5
|
type TableBorderStyle = 'solid' | 'dashed' | 'none'
|
|
@@ -58,10 +58,30 @@ const rowHoverClasses =
|
|
|
58
58
|
'[&>tbody>tr]:transition-colors [&>tbody>tr]:duration-200 motion-reduce:[&>tbody>tr]:transition-none [&>tbody>tr:hover]:bg-background-subtle'
|
|
59
59
|
|
|
60
60
|
interface TableProps extends React.ComponentPropsWithoutRef<'table'> {
|
|
61
|
+
/**
|
|
62
|
+
* Cell padding, corner radius, and text scale.
|
|
63
|
+
* @default 'md'
|
|
64
|
+
*/
|
|
61
65
|
size?: TableSize
|
|
66
|
+
/**
|
|
67
|
+
* Style of the cell separators.
|
|
68
|
+
* @default 'solid'
|
|
69
|
+
*/
|
|
62
70
|
borderStyle?: TableBorderStyle
|
|
71
|
+
/**
|
|
72
|
+
* Tint alternating rows.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
63
75
|
stripedRows?: boolean
|
|
76
|
+
/**
|
|
77
|
+
* Tint alternating columns.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
64
80
|
stripedColumns?: boolean
|
|
81
|
+
/**
|
|
82
|
+
* Tint a row on pointer hover.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
65
85
|
hoverableRows?: boolean
|
|
66
86
|
}
|
|
67
87
|
|
|
@@ -96,6 +116,10 @@ function Table({
|
|
|
96
116
|
}
|
|
97
117
|
|
|
98
118
|
interface TableCaptionProps extends React.ComponentPropsWithoutRef<'caption'> {
|
|
119
|
+
/**
|
|
120
|
+
* Render the caption above or below the table.
|
|
121
|
+
* @default 'bottom'
|
|
122
|
+
*/
|
|
99
123
|
position?: 'top' | 'bottom'
|
|
100
124
|
}
|
|
101
125
|
|
|
@@ -126,6 +150,10 @@ function TableBody({ className, ...props }: TableBodyProps) {
|
|
|
126
150
|
}
|
|
127
151
|
|
|
128
152
|
interface TableRowProps extends React.ComponentPropsWithoutRef<'tr'> {
|
|
153
|
+
/**
|
|
154
|
+
* Apply the persistent highlight background (`data-highlighted`).
|
|
155
|
+
* @default false
|
|
156
|
+
*/
|
|
129
157
|
highlighted?: boolean
|
|
130
158
|
}
|
|
131
159
|
|
|
@@ -77,7 +77,7 @@ describe('Tabs', () => {
|
|
|
77
77
|
expect(screen.getByText('Panel Two')).toBeVisible()
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
it('
|
|
80
|
+
it('honors defaultValue', () => {
|
|
81
81
|
render(<Demo defaultValue="three" />)
|
|
82
82
|
expect(screen.getByRole('tab', { name: 'Three' })).toHaveAttribute('aria-selected', 'true')
|
|
83
83
|
expect(screen.getByText('Panel Three')).toBeVisible()
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Tabs as BaseTabs } from '@base-ui/react/tabs'
|
|
5
5
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
6
|
-
import { cn } from '../../utils'
|
|
6
|
+
import { cn } from '../../internal/utils'
|
|
7
7
|
|
|
8
8
|
type TabsVariant = 'pill' | 'line'
|
|
9
9
|
type TabsSize = 'sm' | 'md' | 'lg'
|
|
@@ -163,8 +163,20 @@ const tabsContentClasses =
|
|
|
163
163
|
type BaseTabsRootProps = React.ComponentProps<typeof BaseTabs.Root>
|
|
164
164
|
|
|
165
165
|
interface TabsProps extends BaseTabsRootProps {
|
|
166
|
+
/**
|
|
167
|
+
* Visual style, shared with the list and triggers via context.
|
|
168
|
+
* @default 'pill'
|
|
169
|
+
*/
|
|
166
170
|
variant?: TabsVariant
|
|
171
|
+
/**
|
|
172
|
+
* Trigger sizing, shared via context.
|
|
173
|
+
* @default 'md'
|
|
174
|
+
*/
|
|
167
175
|
size?: TabsSize
|
|
176
|
+
/**
|
|
177
|
+
* Layout axis and the direction arrow keys move focus. Exposed as `data-orientation`.
|
|
178
|
+
* @default 'horizontal'
|
|
179
|
+
*/
|
|
168
180
|
orientation?: TabsOrientation
|
|
169
181
|
}
|
|
170
182
|
|
|
@@ -185,7 +197,18 @@ function Tabs({ variant = 'pill', size = 'md', orientation = 'horizontal', class
|
|
|
185
197
|
|
|
186
198
|
type BaseTabsListProps = React.ComponentProps<typeof BaseTabs.List>
|
|
187
199
|
|
|
188
|
-
interface TabsListProps extends BaseTabsListProps, VariantProps<typeof tabsListVariants> {
|
|
200
|
+
interface TabsListProps extends BaseTabsListProps, Omit<VariantProps<typeof tabsListVariants>, 'variant' | 'size'> {
|
|
201
|
+
/**
|
|
202
|
+
* Override the root's variant for this list.
|
|
203
|
+
* @default context
|
|
204
|
+
*/
|
|
205
|
+
variant?: VariantProps<typeof tabsListVariants>['variant']
|
|
206
|
+
/**
|
|
207
|
+
* Override the root's size for this list.
|
|
208
|
+
* @default context
|
|
209
|
+
*/
|
|
210
|
+
size?: VariantProps<typeof tabsListVariants>['size']
|
|
211
|
+
}
|
|
189
212
|
|
|
190
213
|
function TabsList({ variant: variantProp, size: sizeProp, className, children, ...rest }: TabsListProps) {
|
|
191
214
|
const ctx = useTabsContext()
|
|
@@ -212,7 +235,15 @@ function TabsList({ variant: variantProp, size: sizeProp, className, children, .
|
|
|
212
235
|
type BaseTabsTabProps = React.ComponentProps<typeof BaseTabs.Tab>
|
|
213
236
|
|
|
214
237
|
interface TabsTriggerProps extends BaseTabsTabProps {
|
|
238
|
+
/**
|
|
239
|
+
* Override the variant for this trigger.
|
|
240
|
+
* @default context
|
|
241
|
+
*/
|
|
215
242
|
variant?: TabsVariant
|
|
243
|
+
/**
|
|
244
|
+
* Override the size; `icon-*` makes a square, label-less trigger.
|
|
245
|
+
* @default context
|
|
246
|
+
*/
|
|
216
247
|
size?: TabsTriggerSize
|
|
217
248
|
}
|
|
218
249
|
|
|
@@ -42,6 +42,68 @@ describe('TextAnimate', () => {
|
|
|
42
42
|
expect(units[2]).toHaveTextContent('three')
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
+
it('sweeps the shimmer glare across the whole string and returns to the same frame at both ends of the loop', () => {
|
|
46
|
+
const { container, rerender } = render(
|
|
47
|
+
<TextAnimate effect="shimmer" progress={0}>
|
|
48
|
+
Generating response
|
|
49
|
+
</TextAnimate>,
|
|
50
|
+
)
|
|
51
|
+
const visual = () => container.querySelector('[aria-hidden="true"]') as HTMLElement
|
|
52
|
+
|
|
53
|
+
// The gradient paints one band over the whole string, so it lives on the wrapper, not the units.
|
|
54
|
+
expect(visual().style.backgroundClip).toBe('text')
|
|
55
|
+
expect(visual().style.backgroundImage).toContain('linear-gradient')
|
|
56
|
+
// Band parked off the leading edge.
|
|
57
|
+
expect(visual().style.backgroundPosition).toBe('100% 0px')
|
|
58
|
+
|
|
59
|
+
rerender(
|
|
60
|
+
<TextAnimate effect="shimmer" progress={0.5}>
|
|
61
|
+
Generating response
|
|
62
|
+
</TextAnimate>,
|
|
63
|
+
)
|
|
64
|
+
expect(visual().style.backgroundPosition).toBe('50% 0px')
|
|
65
|
+
|
|
66
|
+
// Parked off the trailing edge, which paints identically to progress 0.
|
|
67
|
+
rerender(
|
|
68
|
+
<TextAnimate effect="shimmer" progress={1}>
|
|
69
|
+
Generating response
|
|
70
|
+
</TextAnimate>,
|
|
71
|
+
)
|
|
72
|
+
expect(visual().style.backgroundPosition).toBe('0% 0px')
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('keeps the shimmer glare identical however the text is split, so `by` stays orthogonal', () => {
|
|
76
|
+
const positions = (['line', 'word', 'char'] as const).map((by) => {
|
|
77
|
+
const { container, unmount } = render(
|
|
78
|
+
<TextAnimate effect="shimmer" by={by} progress={0.4}>
|
|
79
|
+
Generating a response
|
|
80
|
+
</TextAnimate>,
|
|
81
|
+
)
|
|
82
|
+
const visual = container.querySelector('[aria-hidden="true"]') as HTMLElement
|
|
83
|
+
const units = container.querySelectorAll('[data-slot="text-animate-unit"]').length
|
|
84
|
+
const result = { by, units, position: visual.style.backgroundPosition, image: visual.style.backgroundImage }
|
|
85
|
+
unmount()
|
|
86
|
+
return result
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// Splitting finer must change the unit count without touching the glare.
|
|
90
|
+
expect(positions.map((p) => p.units)).toEqual([1, 3, 19])
|
|
91
|
+
expect(new Set(positions.map((p) => p.position)).size).toBe(1)
|
|
92
|
+
expect(new Set(positions.map((p) => p.image)).size).toBe(1)
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('drops the shimmer gradient under reduced motion so the text keeps its own color', () => {
|
|
96
|
+
const { container } = render(
|
|
97
|
+
<ReducedMotionProvider disableAnimations>
|
|
98
|
+
<TextAnimate effect="shimmer">Generating response</TextAnimate>
|
|
99
|
+
</ReducedMotionProvider>,
|
|
100
|
+
)
|
|
101
|
+
const visual = container.querySelector('[aria-hidden="true"]') as HTMLElement
|
|
102
|
+
expect(visual.style.backgroundImage).toBe('')
|
|
103
|
+
expect(visual.style.webkitTextFillColor).toBe('')
|
|
104
|
+
expect(visual).toHaveTextContent('Generating response')
|
|
105
|
+
})
|
|
106
|
+
|
|
45
107
|
it('drives the animation from a controlled progress value', () => {
|
|
46
108
|
const { container, rerender } = render(
|
|
47
109
|
<TextAnimate effect="typewriter" progress={0}>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { useReducedMotion } from '../../hooks/use-reduced-motion'
|
|
5
|
-
import { cn } from '../../utils'
|
|
5
|
+
import { cn } from '../../internal/utils'
|
|
6
6
|
|
|
7
7
|
type TextAnimateSegment = 'char' | 'word' | 'line'
|
|
8
8
|
|
|
@@ -26,16 +26,41 @@ type TextAnimateEffect = (
|
|
|
26
26
|
content?: React.ReactNode
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
type TextAnimateContainerEffect = (
|
|
30
|
+
progress: number,
|
|
31
|
+
ctx: { reduced: boolean },
|
|
32
|
+
) => {
|
|
33
|
+
style?: React.CSSProperties
|
|
34
|
+
className?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
interface PresetConfig {
|
|
30
38
|
fn: TextAnimateEffect
|
|
31
39
|
by: TextAnimateSegment
|
|
32
40
|
stagger: number
|
|
33
41
|
continuous: boolean
|
|
42
|
+
/**
|
|
43
|
+
* Styles the wrapper around every unit rather than the units themselves, for effects that span the
|
|
44
|
+
* whole string. Lets `by` stay orthogonal: the units can be split any way and the effect is unchanged.
|
|
45
|
+
*/
|
|
46
|
+
container?: TextAnimateContainerEffect
|
|
34
47
|
}
|
|
35
48
|
|
|
36
49
|
const SCRAMBLE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#%&@$?/<>*'
|
|
37
50
|
const SCRAMBLE_STEPS = 10
|
|
38
51
|
|
|
52
|
+
const SHIMMER_SPREAD = 'var(--text-shimmer-spread, calc(3ch + 40px))'
|
|
53
|
+
const SHIMMER_BASE = 'var(--text-shimmer-base, color-mix(in oklab, currentColor 38%, transparent))'
|
|
54
|
+
const SHIMMER_GLARE = 'var(--text-shimmer-glare, currentColor)'
|
|
55
|
+
const SHIMMER_MID = `color-mix(in oklab, ${SHIMMER_GLARE}, ${SHIMMER_BASE} 50%)`
|
|
56
|
+
const SHIMMER_GRADIENT =
|
|
57
|
+
`linear-gradient(calc(90deg + var(--text-shimmer-angle, 20deg)),` +
|
|
58
|
+
` ${SHIMMER_BASE} calc(50% - ${SHIMMER_SPREAD}),` +
|
|
59
|
+
` ${SHIMMER_MID} calc(50% - ${SHIMMER_SPREAD} * 0.5),` +
|
|
60
|
+
` ${SHIMMER_GLARE} 50%,` +
|
|
61
|
+
` ${SHIMMER_MID} calc(50% + ${SHIMMER_SPREAD} * 0.5),` +
|
|
62
|
+
` ${SHIMMER_BASE} calc(50% + ${SHIMMER_SPREAD}))`
|
|
63
|
+
|
|
39
64
|
const presets: Record<TextAnimateEffectName, PresetConfig> = {
|
|
40
65
|
typewriter: {
|
|
41
66
|
by: 'char',
|
|
@@ -143,15 +168,26 @@ const presets: Record<TextAnimateEffectName, PresetConfig> = {
|
|
|
143
168
|
},
|
|
144
169
|
|
|
145
170
|
shimmer: {
|
|
146
|
-
by: '
|
|
171
|
+
by: 'line',
|
|
147
172
|
stagger: 0,
|
|
148
173
|
continuous: true,
|
|
149
|
-
fn: (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
174
|
+
fn: () => ({}),
|
|
175
|
+
container: (p, { reduced }) => {
|
|
176
|
+
if (reduced) return {}
|
|
177
|
+
return {
|
|
178
|
+
style: {
|
|
179
|
+
display: 'inline-block',
|
|
180
|
+
backgroundImage: SHIMMER_GRADIENT,
|
|
181
|
+
backgroundRepeat: 'no-repeat',
|
|
182
|
+
// Wider than the box by a full band on each side, so both ends of the sweep park the
|
|
183
|
+
// glare off-screen and wrapping the driver from 1 back to 0 is invisible.
|
|
184
|
+
backgroundSize: `calc(200% + ${SHIMMER_SPREAD} * 2) 100%`,
|
|
185
|
+
backgroundPosition: `${((1 - p) * 100).toFixed(3)}% 0`,
|
|
186
|
+
backgroundClip: 'text',
|
|
187
|
+
WebkitBackgroundClip: 'text',
|
|
188
|
+
WebkitTextFillColor: 'transparent',
|
|
189
|
+
},
|
|
190
|
+
}
|
|
155
191
|
},
|
|
156
192
|
},
|
|
157
193
|
}
|
|
@@ -221,14 +257,45 @@ function Unit({ text, index, total, by, stagger, globalProgress, reduced, effect
|
|
|
221
257
|
}
|
|
222
258
|
|
|
223
259
|
interface TextAnimateProps extends Omit<React.ComponentProps<'span'>, 'children'> {
|
|
260
|
+
/** The text to animate. Use `\n` for explicit line breaks. */
|
|
224
261
|
children: string
|
|
262
|
+
/**
|
|
263
|
+
* A preset name (`typewriter`, `scramble`, `rise`, `highlight`, `wave`, `flip`, `shimmer`) or a custom `(progress,
|
|
264
|
+
* ctx) => {…}`.
|
|
265
|
+
* @default 'typewriter'
|
|
266
|
+
*/
|
|
225
267
|
effect?: TextAnimateEffectName | TextAnimateEffect
|
|
268
|
+
/**
|
|
269
|
+
* Segmentation level. Defaults to the preset's natural level (e.g. `word` for `highlight`).
|
|
270
|
+
* @default preset's level
|
|
271
|
+
*/
|
|
226
272
|
by?: TextAnimateSegment
|
|
273
|
+
/** Controlled driver value (`0 → 1`). When set, the internal clock is disabled and you own the timeline. */
|
|
227
274
|
progress?: number
|
|
275
|
+
/**
|
|
276
|
+
* Run the built-in clock when `progress` is not provided.
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
228
279
|
autoPlay?: boolean
|
|
280
|
+
/**
|
|
281
|
+
* Loop the built-in clock. Continuous presets (`wave`, `shimmer`) default to `true`.
|
|
282
|
+
* @default preset's value
|
|
283
|
+
*/
|
|
229
284
|
loop?: boolean
|
|
285
|
+
/**
|
|
286
|
+
* Built-in clock length in **seconds**.
|
|
287
|
+
* @default 1.6
|
|
288
|
+
*/
|
|
230
289
|
duration?: number
|
|
290
|
+
/**
|
|
291
|
+
* Built-in clock start delay in **seconds**.
|
|
292
|
+
* @default 0
|
|
293
|
+
*/
|
|
231
294
|
delay?: number
|
|
295
|
+
/**
|
|
296
|
+
* How offset each unit's window is from its neighbor's, `0 → 1`. `0` = all together; `1` = fully sequential.
|
|
297
|
+
* @default preset's value
|
|
298
|
+
*/
|
|
232
299
|
stagger?: number
|
|
233
300
|
}
|
|
234
301
|
|
|
@@ -301,11 +368,12 @@ function TextAnimate({
|
|
|
301
368
|
|
|
302
369
|
const unitProps = { total, by: segment, stagger: resolvedStagger, globalProgress, reduced, effect: effectFn }
|
|
303
370
|
const multiline = lines.length > 1
|
|
371
|
+
const container = preset?.container?.(globalProgress, { reduced })
|
|
304
372
|
|
|
305
373
|
return (
|
|
306
374
|
<span ref={containerRef} data-slot="text-animate" className={cn('inline-block', className)} {...props}>
|
|
307
375
|
<span className="sr-only">{text}</span>
|
|
308
|
-
<span aria-hidden="true" suppressHydrationWarning>
|
|
376
|
+
<span aria-hidden="true" suppressHydrationWarning className={container?.className} style={container?.style}>
|
|
309
377
|
{lines.map((line, li) => {
|
|
310
378
|
const lineStyle = multiline ? ({ display: 'block' } as const) : undefined
|
|
311
379
|
|