@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
|
@@ -9,7 +9,7 @@ import { Input, inputVariants } from '../input'
|
|
|
9
9
|
import { Popover, PopoverContent, PopoverTrigger, type PopoverContentProps } from '../popover/popover'
|
|
10
10
|
import { buttonVariants } from '../button/button-variants'
|
|
11
11
|
import { useFieldRootContext } from '@base-ui/react/internals/field-root-context'
|
|
12
|
-
import { cn } from '../../utils'
|
|
12
|
+
import { cn } from '../../internal/utils'
|
|
13
13
|
|
|
14
14
|
type DatePickerSize = 'sm' | 'md' | 'lg'
|
|
15
15
|
type DatePickerVariant = 'outline' | 'soft'
|
|
@@ -32,32 +32,117 @@ type CalendarPassthrough = DistributiveOmit<
|
|
|
32
32
|
>
|
|
33
33
|
|
|
34
34
|
type DatePickerBase = CalendarPassthrough & {
|
|
35
|
+
/**
|
|
36
|
+
* Height, padding, and calendar cell scale.
|
|
37
|
+
* @default 'md'
|
|
38
|
+
*/
|
|
35
39
|
size?: DatePickerSize
|
|
40
|
+
/**
|
|
41
|
+
* Field appearance - bordered or filled.
|
|
42
|
+
* @default 'outline'
|
|
43
|
+
*/
|
|
36
44
|
variant?: DatePickerVariant
|
|
45
|
+
/**
|
|
46
|
+
* date-fns format for the date field(s).
|
|
47
|
+
* @default 'MM/dd/yyyy'
|
|
48
|
+
*/
|
|
37
49
|
dateFormat?: string
|
|
50
|
+
/**
|
|
51
|
+
* date-fns format for the time field(s).
|
|
52
|
+
* @default 'HH:mm:ss'
|
|
53
|
+
*/
|
|
38
54
|
timeFormat?: string
|
|
55
|
+
/**
|
|
56
|
+
* Show a clear button (multiple mode).
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
39
59
|
clearable?: boolean
|
|
60
|
+
/** Content pinned to the start edge. */
|
|
40
61
|
startSlot?: React.ReactNode
|
|
62
|
+
/** Content pinned to the end edge. */
|
|
41
63
|
endSlot?: React.ReactNode
|
|
64
|
+
/**
|
|
65
|
+
* Disable the whole control.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
42
68
|
disabled?: boolean
|
|
69
|
+
/** Dates that can't be selected in the calendar. */
|
|
43
70
|
disabledDates?: Matcher | Matcher[]
|
|
71
|
+
/**
|
|
72
|
+
* Make the typeable fields read-only.
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
44
75
|
readOnly?: boolean
|
|
76
|
+
/**
|
|
77
|
+
* Mark the form field as required.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
45
80
|
required?: boolean
|
|
81
|
+
/**
|
|
82
|
+
* Hidden input name for form submission. `range` mode emits `name[from]` / `name[to]`; with `showTime` the value is a
|
|
83
|
+
* full datetime.
|
|
84
|
+
*/
|
|
46
85
|
name?: string
|
|
86
|
+
/** Flag the field invalid - sets `data-invalid` for styling + conveys it to assistive tech. */
|
|
47
87
|
'aria-invalid'?: boolean
|
|
88
|
+
/** Classes on the root wrapper - use for footprint/layout (e.g. `max-w-60`). Merged via `tailwind-merge`. */
|
|
48
89
|
className?: string
|
|
90
|
+
/**
|
|
91
|
+
* Classes on the inner field box - use to override field styling (border, radius, background). Merged via
|
|
92
|
+
* `tailwind-merge`.
|
|
93
|
+
*/
|
|
49
94
|
inputClassName?: string
|
|
95
|
+
/**
|
|
96
|
+
* Separator between the range's two fields.
|
|
97
|
+
* @default '–'
|
|
98
|
+
*/
|
|
50
99
|
rangeSeparator?: React.ReactNode
|
|
100
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
51
101
|
open?: boolean
|
|
102
|
+
/**
|
|
103
|
+
* Uncontrolled initial open state.
|
|
104
|
+
* @default false
|
|
105
|
+
*/
|
|
52
106
|
defaultOpen?: boolean
|
|
107
|
+
/** Fires when the popover opens or closes. */
|
|
53
108
|
onOpenChange?: (open: boolean) => void
|
|
109
|
+
/**
|
|
110
|
+
* Preferred popover side.
|
|
111
|
+
* @default 'bottom'
|
|
112
|
+
*/
|
|
54
113
|
side?: 'top' | 'bottom' | 'left' | 'right'
|
|
114
|
+
/**
|
|
115
|
+
* Popover alignment.
|
|
116
|
+
* @default 'end'
|
|
117
|
+
*/
|
|
55
118
|
align?: 'start' | 'center' | 'end'
|
|
119
|
+
/**
|
|
120
|
+
* Gap between the field and the popover.
|
|
121
|
+
* @default 6
|
|
122
|
+
*/
|
|
56
123
|
sideOffset?: number
|
|
124
|
+
/** Escape hatch forwarded to the inner `PopoverContent` (collision props, `className`, …). */
|
|
57
125
|
popoverProps?: Partial<PopoverContentProps>
|
|
126
|
+
/**
|
|
127
|
+
* Override auto-close. By default only single mode closes on pick; range and multiple stay open (dismiss on
|
|
128
|
+
* outside-click/Escape).
|
|
129
|
+
* @default auto
|
|
130
|
+
*/
|
|
58
131
|
closeOnSelect?: boolean
|
|
132
|
+
/**
|
|
133
|
+
* Add a `TimeField` (single/range modes).
|
|
134
|
+
* @default false
|
|
135
|
+
*/
|
|
59
136
|
showTime?: boolean
|
|
137
|
+
/**
|
|
138
|
+
* Icon for the popover trigger button.
|
|
139
|
+
* @default calendar icon
|
|
140
|
+
*/
|
|
60
141
|
triggerIcon?: React.ReactNode
|
|
142
|
+
/**
|
|
143
|
+
* Accessible label for the trigger button.
|
|
144
|
+
* @default 'Open calendar'
|
|
145
|
+
*/
|
|
61
146
|
triggerAriaLabel?: string
|
|
62
147
|
}
|
|
63
148
|
|
|
@@ -75,11 +160,20 @@ type DatePickerProps =
|
|
|
75
160
|
onValueChange?: (v: DateRange | undefined) => void
|
|
76
161
|
})
|
|
77
162
|
| (DatePickerBase & {
|
|
163
|
+
/**
|
|
164
|
+
* Selection behavior; determines the `value` shape.
|
|
165
|
+
* @default 'single'
|
|
166
|
+
*/
|
|
78
167
|
mode: 'multiple'
|
|
168
|
+
/** Controlled value; shape matches `mode`. Pair with `onValueChange`. */
|
|
79
169
|
value?: Date[] | undefined
|
|
170
|
+
/** Uncontrolled initial value. */
|
|
80
171
|
defaultValue?: Date[] | undefined
|
|
172
|
+
/** Fires when the selection changes; the argument shape matches `mode`. */
|
|
81
173
|
onValueChange?: (v: Date[] | undefined) => void
|
|
174
|
+
/** Placeholder for the multiple-mode summary field. */
|
|
82
175
|
placeholder?: string
|
|
176
|
+
/** Customize the multiple-mode summary text. */
|
|
83
177
|
formatValue?: (value: Date[] | undefined) => string
|
|
84
178
|
})
|
|
85
179
|
|
|
@@ -20,12 +20,14 @@ function renderDialog({
|
|
|
20
20
|
description = 'Make changes to your account.',
|
|
21
21
|
closeButton,
|
|
22
22
|
backdrop,
|
|
23
|
+
frame,
|
|
23
24
|
contentClassName,
|
|
24
25
|
}: {
|
|
25
26
|
title?: string
|
|
26
27
|
description?: string
|
|
27
28
|
closeButton?: boolean
|
|
28
29
|
backdrop?: boolean
|
|
30
|
+
frame?: boolean
|
|
29
31
|
contentClassName?: string
|
|
30
32
|
} = {}) {
|
|
31
33
|
return render(
|
|
@@ -35,6 +37,7 @@ function renderDialog({
|
|
|
35
37
|
className={contentClassName}
|
|
36
38
|
{...(closeButton !== undefined ? { closeButton } : {})}
|
|
37
39
|
{...(backdrop !== undefined ? { backdrop } : {})}
|
|
40
|
+
{...(frame !== undefined ? { frame } : {})}
|
|
38
41
|
>
|
|
39
42
|
<DialogHeader>
|
|
40
43
|
<DialogTitle>{title}</DialogTitle>
|
|
@@ -61,7 +64,7 @@ describe('Dialog', () => {
|
|
|
61
64
|
expect(screen.queryByText('Body content')).toBeNull()
|
|
62
65
|
})
|
|
63
66
|
|
|
64
|
-
it('opens on trigger click and exposes a
|
|
67
|
+
it('opens on trigger click and exposes a labeled dialog', async () => {
|
|
65
68
|
const user = userEvent.setup()
|
|
66
69
|
renderDialog()
|
|
67
70
|
|
|
@@ -159,6 +162,32 @@ describe('Dialog', () => {
|
|
|
159
162
|
expect(document.querySelector('[data-slot="dialog-backdrop"]')).toBeNull()
|
|
160
163
|
})
|
|
161
164
|
|
|
165
|
+
it('frames the popup by default and drops the frame when frame is false', async () => {
|
|
166
|
+
const user = userEvent.setup()
|
|
167
|
+
const { unmount } = renderDialog()
|
|
168
|
+
|
|
169
|
+
await user.click(screen.getByRole('button', { name: 'Open dialog' }))
|
|
170
|
+
await screen.findByRole('dialog')
|
|
171
|
+
expect(document.querySelector('[data-slot="dialog-popup"]')).toHaveAttribute('data-frame')
|
|
172
|
+
|
|
173
|
+
unmount()
|
|
174
|
+
renderDialog({ frame: false })
|
|
175
|
+
|
|
176
|
+
await user.click(screen.getByRole('button', { name: 'Open dialog' }))
|
|
177
|
+
await screen.findByRole('dialog')
|
|
178
|
+
expect(document.querySelector('[data-slot="dialog-popup"]')).not.toHaveAttribute('data-frame')
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
it('drops the frame when the backdrop is off, even if frame is set', async () => {
|
|
182
|
+
const user = userEvent.setup()
|
|
183
|
+
renderDialog({ backdrop: false, frame: true })
|
|
184
|
+
|
|
185
|
+
await user.click(screen.getByRole('button', { name: 'Open dialog' }))
|
|
186
|
+
await screen.findByRole('dialog')
|
|
187
|
+
|
|
188
|
+
expect(document.querySelector('[data-slot="dialog-popup"]')).not.toHaveAttribute('data-frame')
|
|
189
|
+
})
|
|
190
|
+
|
|
162
191
|
it('has no accessibility violations when open', async () => {
|
|
163
192
|
const user = userEvent.setup()
|
|
164
193
|
renderDialog()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { Dialog as BaseDialog } from '@base-ui/react/dialog'
|
|
3
|
-
import { cn } from '../../utils'
|
|
4
|
-
import { type ModalContentProps, splitModalProps } from '../../modal'
|
|
3
|
+
import { cn } from '../../internal/utils'
|
|
4
|
+
import { type ModalContentProps, splitModalProps } from '../../internal/modal'
|
|
5
5
|
import { buttonVariants } from '../button/button-variants'
|
|
6
6
|
|
|
7
7
|
type DialogProps = React.ComponentProps<typeof BaseDialog.Root>
|
|
@@ -25,9 +25,27 @@ type DialogContentProps = ModalContentProps<
|
|
|
25
25
|
React.ComponentProps<typeof BaseDialog.Backdrop>,
|
|
26
26
|
React.ComponentProps<typeof BaseDialog.Viewport>
|
|
27
27
|
> & {
|
|
28
|
+
/**
|
|
29
|
+
* Render the × button in the corner.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
28
32
|
closeButton?: boolean
|
|
33
|
+
/**
|
|
34
|
+
* Accessible label for the close button.
|
|
35
|
+
* @default 'Close'
|
|
36
|
+
*/
|
|
29
37
|
closeLabel?: string
|
|
38
|
+
/**
|
|
39
|
+
* Render the dimmed, blurred backdrop behind the popup.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
30
42
|
backdrop?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Wrap the popup in a translucent glass frame. Needs `backdrop`: without one the popup
|
|
45
|
+
* is always a plain solid card.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
frame?: boolean
|
|
31
49
|
}
|
|
32
50
|
|
|
33
51
|
function DialogContent({
|
|
@@ -36,10 +54,14 @@ function DialogContent({
|
|
|
36
54
|
closeButton = true,
|
|
37
55
|
closeLabel = 'Close',
|
|
38
56
|
backdrop = true,
|
|
57
|
+
frame = true,
|
|
39
58
|
backdropProps,
|
|
40
59
|
viewportProps,
|
|
41
60
|
...props
|
|
42
61
|
}: DialogContentProps) {
|
|
62
|
+
// The frame is a rim of blurred page around the popup, so it only reads against the
|
|
63
|
+
// backdrop. Without one it collapses to a plain solid card.
|
|
64
|
+
const showFrame = frame && backdrop
|
|
43
65
|
const { portal, popup } = splitModalProps(props)
|
|
44
66
|
return (
|
|
45
67
|
<BaseDialog.Portal {...portal}>
|
|
@@ -65,12 +87,12 @@ function DialogContent({
|
|
|
65
87
|
>
|
|
66
88
|
<BaseDialog.Popup
|
|
67
89
|
data-slot="dialog-popup"
|
|
90
|
+
{...(showFrame ? { 'data-frame': '' } : {})}
|
|
68
91
|
className={cn(
|
|
69
92
|
'group/dialog-popup relative flex max-h-full min-h-0 w-150 max-w-full flex-col',
|
|
70
93
|
'rounded-2xl border',
|
|
71
|
-
backdrop
|
|
72
|
-
|
|
73
|
-
: 'bg-background border-border-overlay shadow-2xl',
|
|
94
|
+
showFrame ? 'border-white/15 bg-white/10 p-1.5 backdrop-blur-sm' : 'bg-background border-border-overlay',
|
|
95
|
+
!showFrame && 'shadow-2xl',
|
|
74
96
|
'isolate transform-gpu outline-none',
|
|
75
97
|
'motion-safe:transition-[opacity,scale] motion-safe:duration-250 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]',
|
|
76
98
|
'data-starting-style:motion-safe:scale-95 data-starting-style:motion-safe:opacity-0',
|
|
@@ -84,7 +106,7 @@ function DialogContent({
|
|
|
84
106
|
data-slot="dialog-content"
|
|
85
107
|
className={cn(
|
|
86
108
|
'relative flex min-h-0 flex-col overflow-hidden not-has-[>[data-slot=dialog-footer]]:pb-6 not-has-[>[data-slot=dialog-header]]:pt-6 [&>[data-slot=dialog-header]+[data-slot=dialog-footer]]:pt-0',
|
|
87
|
-
|
|
109
|
+
showFrame && 'bg-background rounded-[calc(var(--radius-2xl)*5/6)]',
|
|
88
110
|
)}
|
|
89
111
|
>
|
|
90
112
|
{children}
|
|
@@ -21,6 +21,7 @@ function renderDrawer({
|
|
|
21
21
|
description = 'Update your details below.',
|
|
22
22
|
closeButton,
|
|
23
23
|
backdrop,
|
|
24
|
+
frame,
|
|
24
25
|
contentClassName,
|
|
25
26
|
}: {
|
|
26
27
|
side?: 'top' | 'bottom' | 'left' | 'right'
|
|
@@ -28,6 +29,7 @@ function renderDrawer({
|
|
|
28
29
|
description?: string
|
|
29
30
|
closeButton?: boolean
|
|
30
31
|
backdrop?: boolean
|
|
32
|
+
frame?: boolean
|
|
31
33
|
contentClassName?: string
|
|
32
34
|
} = {}) {
|
|
33
35
|
return render(
|
|
@@ -37,6 +39,7 @@ function renderDrawer({
|
|
|
37
39
|
className={contentClassName}
|
|
38
40
|
{...(closeButton !== undefined ? { closeButton } : {})}
|
|
39
41
|
{...(backdrop !== undefined ? { backdrop } : {})}
|
|
42
|
+
{...(frame !== undefined ? { frame } : {})}
|
|
40
43
|
>
|
|
41
44
|
<DrawerHeader>
|
|
42
45
|
<DrawerTitle>{title}</DrawerTitle>
|
|
@@ -63,7 +66,7 @@ describe('Drawer', () => {
|
|
|
63
66
|
expect(screen.queryByText('Body content')).toBeNull()
|
|
64
67
|
})
|
|
65
68
|
|
|
66
|
-
it('opens on trigger click and exposes a
|
|
69
|
+
it('opens on trigger click and exposes a labeled dialog', async () => {
|
|
67
70
|
const user = userEvent.setup()
|
|
68
71
|
renderDrawer()
|
|
69
72
|
|
|
@@ -165,6 +168,34 @@ describe('Drawer', () => {
|
|
|
165
168
|
|
|
166
169
|
// Outermost drawer keeps its backdrop; the nested one auto-omits it.
|
|
167
170
|
expect(document.querySelectorAll('[data-slot="drawer-backdrop"]')).toHaveLength(1)
|
|
171
|
+
// The frame needs a backdrop, so only the outermost drawer is framed.
|
|
172
|
+
expect(document.querySelectorAll('[data-slot="drawer-popup"][data-frame]')).toHaveLength(1)
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
it('frames the popup by default and drops the frame when frame is false', async () => {
|
|
176
|
+
const user = userEvent.setup()
|
|
177
|
+
const { unmount } = renderDrawer()
|
|
178
|
+
|
|
179
|
+
await user.click(screen.getByRole('button', { name: 'Open drawer' }))
|
|
180
|
+
await screen.findByRole('dialog')
|
|
181
|
+
expect(document.querySelector('[data-slot="drawer-popup"]')).toHaveAttribute('data-frame')
|
|
182
|
+
|
|
183
|
+
unmount()
|
|
184
|
+
renderDrawer({ frame: false })
|
|
185
|
+
|
|
186
|
+
await user.click(screen.getByRole('button', { name: 'Open drawer' }))
|
|
187
|
+
await screen.findByRole('dialog')
|
|
188
|
+
expect(document.querySelector('[data-slot="drawer-popup"]')).not.toHaveAttribute('data-frame')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it('drops the frame when the backdrop is off, even if frame is set', async () => {
|
|
192
|
+
const user = userEvent.setup()
|
|
193
|
+
renderDrawer({ backdrop: false, frame: true })
|
|
194
|
+
|
|
195
|
+
await user.click(screen.getByRole('button', { name: 'Open drawer' }))
|
|
196
|
+
await screen.findByRole('dialog')
|
|
197
|
+
|
|
198
|
+
expect(document.querySelector('[data-slot="drawer-popup"]')).not.toHaveAttribute('data-frame')
|
|
168
199
|
})
|
|
169
200
|
|
|
170
201
|
it('positions on the requested side', async () => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Drawer as BaseDrawer } from '@base-ui/react/drawer'
|
|
5
|
-
import { cn } from '../../utils'
|
|
6
|
-
import { type ModalContentProps, splitModalProps } from '../../modal'
|
|
5
|
+
import { cn } from '../../internal/utils'
|
|
6
|
+
import { type ModalContentProps, splitModalProps } from '../../internal/modal'
|
|
7
7
|
import { buttonVariants } from '../button/button-variants'
|
|
8
8
|
|
|
9
9
|
type DrawerSide = 'top' | 'bottom' | 'left' | 'right'
|
|
@@ -20,6 +20,10 @@ const DrawerDepthContext = React.createContext(0)
|
|
|
20
20
|
const DrawerSnapContext = React.createContext(false)
|
|
21
21
|
|
|
22
22
|
interface DrawerProps extends Omit<React.ComponentProps<typeof BaseDrawer.Root>, 'swipeDirection'> {
|
|
23
|
+
/**
|
|
24
|
+
* The edge the drawer slides in from.
|
|
25
|
+
* @default 'bottom'
|
|
26
|
+
*/
|
|
23
27
|
side?: DrawerSide
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -164,9 +168,25 @@ type DrawerContentProps = ModalContentProps<
|
|
|
164
168
|
React.ComponentProps<typeof BaseDrawer.Backdrop>,
|
|
165
169
|
React.ComponentProps<typeof BaseDrawer.Viewport>
|
|
166
170
|
> & {
|
|
171
|
+
/**
|
|
172
|
+
* Render the × button in the corner.
|
|
173
|
+
* @default true
|
|
174
|
+
*/
|
|
167
175
|
closeButton?: boolean
|
|
176
|
+
/**
|
|
177
|
+
* Accessible label for the close button.
|
|
178
|
+
* @default 'Close'
|
|
179
|
+
*/
|
|
168
180
|
closeLabel?: string
|
|
181
|
+
/** Render the dimmed backdrop. Defaults to `true` at the top level, off when nested. */
|
|
169
182
|
backdrop?: boolean
|
|
183
|
+
/**
|
|
184
|
+
* Wrap the panel in a translucent glass frame. Turned off, the drawer is a plain solid
|
|
185
|
+
* card and the handle sits inside it, the way a nested drawer looks. Needs `backdrop`:
|
|
186
|
+
* without one the panel is always solid.
|
|
187
|
+
* @default true
|
|
188
|
+
*/
|
|
189
|
+
frame?: boolean
|
|
170
190
|
}
|
|
171
191
|
|
|
172
192
|
function DrawerContent({
|
|
@@ -175,6 +195,7 @@ function DrawerContent({
|
|
|
175
195
|
closeButton = true,
|
|
176
196
|
closeLabel = 'Close',
|
|
177
197
|
backdrop,
|
|
198
|
+
frame = true,
|
|
178
199
|
backdropProps,
|
|
179
200
|
viewportProps,
|
|
180
201
|
...props
|
|
@@ -184,6 +205,10 @@ function DrawerContent({
|
|
|
184
205
|
const hasSnap = React.useContext(DrawerSnapContext)
|
|
185
206
|
const forceBackdrop = backdropProps?.forceRender === true
|
|
186
207
|
const showBackdrop = forceBackdrop || (backdrop ?? depth <= 1)
|
|
208
|
+
// The frame is a rim of blurred page around the panel, so it only reads against the
|
|
209
|
+
// backdrop. Without one - a nested drawer, or `backdrop={false}` - it collapses to a
|
|
210
|
+
// plain solid card with the handle inside.
|
|
211
|
+
const showFrame = frame && showBackdrop
|
|
187
212
|
const snapSide = hasSnap && (side === 'bottom' || side === 'top') ? side : null
|
|
188
213
|
const { portal, popup } = splitModalProps(props)
|
|
189
214
|
|
|
@@ -214,18 +239,23 @@ function DrawerContent({
|
|
|
214
239
|
>
|
|
215
240
|
<BaseDrawer.Popup
|
|
216
241
|
data-slot="drawer-popup"
|
|
242
|
+
{...(showFrame ? { 'data-frame': '' } : {})}
|
|
217
243
|
className={cn(
|
|
218
244
|
'relative flex min-h-0 flex-col rounded-2xl border',
|
|
219
245
|
snapSide
|
|
220
246
|
? cn(
|
|
221
|
-
'bg-background border-border-overlay before:bg-background-strong
|
|
222
|
-
|
|
247
|
+
'bg-background border-border-overlay before:bg-background-strong',
|
|
248
|
+
showFrame &&
|
|
249
|
+
cn(
|
|
250
|
+
'data-expanded:before:bg-background data-expanded:border-white/15 data-expanded:p-1.5',
|
|
251
|
+
'data-expanded:bg-white/10 data-expanded:shadow-none data-expanded:backdrop-blur-sm',
|
|
252
|
+
),
|
|
223
253
|
)
|
|
224
|
-
:
|
|
254
|
+
: showFrame
|
|
225
255
|
? 'before:bg-background border-white/15 bg-white/10 p-1.5 backdrop-blur-sm'
|
|
226
256
|
: 'bg-background border-border-overlay before:bg-background-strong',
|
|
227
257
|
'isolate outline-none',
|
|
228
|
-
(hasSnap || !
|
|
258
|
+
(hasSnap || !showFrame) && SHADOW_SIDE[side],
|
|
229
259
|
FRAME_PAD_SIDE[side],
|
|
230
260
|
HANDLE_SIDE[side],
|
|
231
261
|
'motion-safe:transition-[transform,height] motion-safe:duration-400 motion-safe:ease-[cubic-bezier(0.32,1.2,0.4,1)]',
|
|
@@ -250,7 +280,7 @@ function DrawerContent({
|
|
|
250
280
|
data-slot="drawer-content"
|
|
251
281
|
className={cn(
|
|
252
282
|
'relative flex min-h-0 flex-col not-has-[>[data-slot=drawer-footer]]:pb-6 not-has-[>[data-slot=drawer-header]]:pt-6 [&>[data-slot=drawer-header]+[data-slot=drawer-footer]]:pt-0',
|
|
253
|
-
|
|
283
|
+
showFrame || snapSide
|
|
254
284
|
? 'bg-background rounded-[calc(var(--radius-2xl)*5/6)]'
|
|
255
285
|
: CONTENT_RECLAIM_SIDE[side],
|
|
256
286
|
snapSide ? 'h-[calc(100dvh-1.5rem-var(--snap-offset,0))]' : 'flex-1',
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Menu as BaseMenu } from '@base-ui/react/menu'
|
|
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 { navigationLinkVariants } from '../navigation/navigation-link-variants'
|
|
9
9
|
|
|
10
10
|
type DropdownMenuSize = 'sm' | 'md' | 'lg'
|
|
@@ -27,6 +27,10 @@ function useDropdownMenuContext() {
|
|
|
27
27
|
type BaseRootProps = React.ComponentProps<typeof BaseMenu.Root>
|
|
28
28
|
|
|
29
29
|
interface DropdownMenuProps extends BaseRootProps {
|
|
30
|
+
/**
|
|
31
|
+
* Scales the popup radius, item padding, and icon size.
|
|
32
|
+
* @default 'md'
|
|
33
|
+
*/
|
|
30
34
|
size?: DropdownMenuSize
|
|
31
35
|
}
|
|
32
36
|
|
|
@@ -60,7 +64,7 @@ const ICON_SIZE: Record<DropdownMenuSize, string> = {
|
|
|
60
64
|
|
|
61
65
|
function popupClassName(size: DropdownMenuSize, className?: string) {
|
|
62
66
|
return cn(
|
|
63
|
-
'max-h-(--available-height) w-(--anchor-width) bg-background border-border-overlay flex flex-col border shadow-2xl outline-none
|
|
67
|
+
'max-h-(--available-height) w-(--anchor-width) bg-background border-border-overlay flex flex-col border shadow-2xl outline-none',
|
|
64
68
|
POPUP_SIZE[size],
|
|
65
69
|
'origin-(--transform-origin)',
|
|
66
70
|
'motion-safe:transition-[opacity,scale] motion-safe:duration-200 motion-safe:ease-[cubic-bezier(0.175,0.885,0.32,1.5)]',
|
|
@@ -77,6 +81,7 @@ type DropdownMenuFloatingProps = FloatingContentProps<
|
|
|
77
81
|
|
|
78
82
|
type DropdownMenuContentProps = Omit<React.ComponentProps<typeof BaseMenu.Popup>, 'className'> &
|
|
79
83
|
DropdownMenuFloatingProps & {
|
|
84
|
+
/** Extra classes on the popup. */
|
|
80
85
|
className?: string
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -92,7 +97,7 @@ function DropdownMenuContent({ className, children, ...props }: DropdownMenuCont
|
|
|
92
97
|
className={cn('isolate z-50', positioner.className as string | undefined)}
|
|
93
98
|
>
|
|
94
99
|
<BaseMenu.Popup data-slot="dropdown-menu-content" className={popupClassName(size, className)} {...popup}>
|
|
95
|
-
<div className="flex flex-col gap-0.5 overflow-x-hidden overflow-y-auto
|
|
100
|
+
<div className="flex flex-col gap-0.5 overflow-x-hidden overflow-y-auto p-2">{children}</div>
|
|
96
101
|
</BaseMenu.Popup>
|
|
97
102
|
</BaseMenu.Positioner>
|
|
98
103
|
</BaseMenu.Portal>
|
|
@@ -245,6 +250,7 @@ function DropdownMenuSubTrigger({ className, children, ...props }: DropdownMenuS
|
|
|
245
250
|
|
|
246
251
|
type DropdownMenuSubContentProps = Omit<React.ComponentProps<typeof BaseMenu.Popup>, 'className'> &
|
|
247
252
|
DropdownMenuFloatingProps & {
|
|
253
|
+
/** Extra classes on the submenu popup. */
|
|
248
254
|
className?: string
|
|
249
255
|
}
|
|
250
256
|
|
|
@@ -261,7 +267,7 @@ function DropdownMenuSubContent({ className, children, ...props }: DropdownMenuS
|
|
|
261
267
|
className={cn('isolate z-50', positioner.className as string | undefined)}
|
|
262
268
|
>
|
|
263
269
|
<BaseMenu.Popup data-slot="dropdown-menu-sub-content" className={popupClassName(size, className)} {...popup}>
|
|
264
|
-
<div className="flex flex-col gap-0.5 overflow-x-hidden overflow-y-auto
|
|
270
|
+
<div className="flex flex-col gap-0.5 overflow-x-hidden overflow-y-auto p-2">{children}</div>
|
|
265
271
|
</BaseMenu.Popup>
|
|
266
272
|
</BaseMenu.Positioner>
|
|
267
273
|
</BaseMenu.Portal>
|
|
@@ -4,7 +4,7 @@ import { axe } from 'vitest-axe'
|
|
|
4
4
|
import { GradientGlow } from './gradient-glow'
|
|
5
5
|
|
|
6
6
|
describe('GradientGlow', () => {
|
|
7
|
-
it('renders its children inside a
|
|
7
|
+
it('renders its children inside a labeled wrapper', () => {
|
|
8
8
|
render(
|
|
9
9
|
<GradientGlow>
|
|
10
10
|
<span>Content</span>
|
|
@@ -1,21 +1,66 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { cn } from '../../utils'
|
|
2
|
+
import { cn } from '../../internal/utils'
|
|
3
3
|
|
|
4
4
|
type GradientGlowBlur = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'
|
|
5
5
|
type GradientGlowTrigger = 'hover' | 'press'
|
|
6
6
|
|
|
7
7
|
interface GradientGlowProps extends React.ComponentProps<'div'> {
|
|
8
|
+
/**
|
|
9
|
+
* First gradient stop.
|
|
10
|
+
* @default '#8EC5FF'
|
|
11
|
+
*/
|
|
8
12
|
from?: string
|
|
13
|
+
/**
|
|
14
|
+
* Middle gradient stop.
|
|
15
|
+
* @default '#EFADF7'
|
|
16
|
+
*/
|
|
9
17
|
via?: string
|
|
18
|
+
/**
|
|
19
|
+
* Last gradient stop.
|
|
20
|
+
* @default '#FFD69B'
|
|
21
|
+
*/
|
|
10
22
|
to?: string
|
|
23
|
+
/**
|
|
24
|
+
* Resting gradient direction in degrees; the animation rotates a full turn around it.
|
|
25
|
+
* @default 95
|
|
26
|
+
*/
|
|
11
27
|
angle?: number
|
|
28
|
+
/**
|
|
29
|
+
* Softness of the glow, mapped to a Tailwind `blur-*` utility.
|
|
30
|
+
* @default 'lg'
|
|
31
|
+
*/
|
|
12
32
|
blur?: GradientGlowBlur
|
|
33
|
+
/**
|
|
34
|
+
* Add a 1px stroke that follows the same animated gradient.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
13
37
|
border?: boolean
|
|
38
|
+
/**
|
|
39
|
+
* Stroke thickness in px when `border` is on.
|
|
40
|
+
* @default 1
|
|
41
|
+
*/
|
|
14
42
|
borderWidth?: number
|
|
43
|
+
/**
|
|
44
|
+
* Seconds for one full rotation (and one breath) of the gradient.
|
|
45
|
+
* @default 4
|
|
46
|
+
*/
|
|
15
47
|
speed?: number
|
|
48
|
+
/**
|
|
49
|
+
* Reveal only on interaction. `'hover'` is pointer-only; `'press'` works on touch. Combine via an array. Omit for
|
|
50
|
+
* always-on.
|
|
51
|
+
*/
|
|
16
52
|
revealOn?: GradientGlowTrigger | GradientGlowTrigger[]
|
|
53
|
+
/** Controlled visibility for programmatic states (loading, etc.); OR-ed with `revealOn`. */
|
|
17
54
|
reveal?: boolean
|
|
55
|
+
/**
|
|
56
|
+
* With `revealOn="hover"`, keep the glow visible on touch devices (which have no hover) instead of hidden.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
18
59
|
showOnTouch?: boolean
|
|
60
|
+
/**
|
|
61
|
+
* Scale the glow down while pressed, to track a child `Button`'s own active-press scale.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
19
64
|
pressScale?: boolean
|
|
20
65
|
}
|
|
21
66
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority'
|
|
2
|
-
import { cn } from '../../utils'
|
|
2
|
+
import { cn } from '../../internal/utils'
|
|
3
3
|
|
|
4
4
|
const inputVariants = cva(
|
|
5
5
|
'w-full border text-foreground outline-none transition-[background-color,border-color,box-shadow] duration-200 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0',
|