@windmorph/react 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +149 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/app-bar/AppBarItems.js +23 -0
- package/dist/components/app-bar/AppBarItems.js.map +1 -0
- package/dist/components/app-bar/TopAppBar.d.ts +89 -0
- package/dist/components/app-bar/TopAppBar.js +103 -0
- package/dist/components/app-bar/TopAppBar.js.map +1 -0
- package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
- package/dist/components/app-bar/app-bar-styles.js +142 -0
- package/dist/components/app-bar/app-bar-styles.js.map +1 -0
- package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
- package/dist/components/app-bar/app-bar-tokens.js +64 -0
- package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
- package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
- package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
- package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
- package/dist/components/autocomplete/Autocomplete.js +284 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +71 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/badge-styles.d.ts +100 -0
- package/dist/components/badge/badge-styles.js +43 -0
- package/dist/components/badge/badge-styles.js.map +1 -0
- package/dist/components/badge/badge-tokens.d.ts +7 -0
- package/dist/components/badge/badge-tokens.js +40 -0
- package/dist/components/badge/badge-tokens.js.map +1 -0
- package/dist/components/button/Button.d.ts +91 -0
- package/dist/components/button/Button.js +96 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/ButtonContext.d.ts +30 -0
- package/dist/components/button/ButtonContext.js +18 -0
- package/dist/components/button/ButtonContext.js.map +1 -0
- package/dist/components/button/DensityZeroButtons.js +25 -0
- package/dist/components/button/DensityZeroButtons.js.map +1 -0
- package/dist/components/button/button-pending.d.ts +10 -0
- package/dist/components/button/button-pending.js +166 -0
- package/dist/components/button/button-pending.js.map +1 -0
- package/dist/components/button/button-styles.d.ts +216 -0
- package/dist/components/button/button-styles.js +199 -0
- package/dist/components/button/button-styles.js.map +1 -0
- package/dist/components/button/button-tokens.d.ts +10 -0
- package/dist/components/button/button-tokens.js +257 -0
- package/dist/components/button/button-tokens.js.map +1 -0
- package/dist/components/button/connected-shapes.js +152 -0
- package/dist/components/button/connected-shapes.js.map +1 -0
- package/dist/components/card/Card.d.ts +60 -0
- package/dist/components/card/Card.js +69 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/card/card-styles.d.ts +42 -0
- package/dist/components/card/card-styles.js +64 -0
- package/dist/components/card/card-styles.js.map +1 -0
- package/dist/components/card/card-tokens.d.ts +7 -0
- package/dist/components/card/card-tokens.js +84 -0
- package/dist/components/card/card-tokens.js.map +1 -0
- package/dist/components/carousel/Carousel.d.ts +124 -0
- package/dist/components/carousel/Carousel.js +387 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/carousel-keylines.js +486 -0
- package/dist/components/carousel/carousel-keylines.js.map +1 -0
- package/dist/components/carousel/carousel-press-area.js +35 -0
- package/dist/components/carousel/carousel-press-area.js.map +1 -0
- package/dist/components/carousel/carousel-styles.d.ts +188 -0
- package/dist/components/carousel/carousel-styles.js +116 -0
- package/dist/components/carousel/carousel-styles.js.map +1 -0
- package/dist/components/carousel/carousel-tokens.d.ts +7 -0
- package/dist/components/carousel/carousel-tokens.js +18 -0
- package/dist/components/carousel/carousel-tokens.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +78 -0
- package/dist/components/checkbox/Checkbox.js +77 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox-box.js +34 -0
- package/dist/components/checkbox/checkbox-box.js.map +1 -0
- package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
- package/dist/components/checkbox/checkbox-styles.js +54 -0
- package/dist/components/checkbox/checkbox-styles.js.map +1 -0
- package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
- package/dist/components/checkbox/checkbox-tokens.js +41 -0
- package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
- package/dist/components/chip/Chip.d.ts +171 -0
- package/dist/components/chip/Chip.js +348 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipSet.d.ts +70 -0
- package/dist/components/chip/ChipSet.js +198 -0
- package/dist/components/chip/ChipSet.js.map +1 -0
- package/dist/components/chip/chip-styles.d.ts +263 -0
- package/dist/components/chip/chip-styles.js +360 -0
- package/dist/components/chip/chip-styles.js.map +1 -0
- package/dist/components/chip/chip-tokens.d.ts +13 -0
- package/dist/components/chip/chip-tokens.js +185 -0
- package/dist/components/chip/chip-tokens.js.map +1 -0
- package/dist/components/date-picker/CalendarGrid.js +94 -0
- package/dist/components/date-picker/CalendarGrid.js.map +1 -0
- package/dist/components/date-picker/CompactDateDialog.js +63 -0
- package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
- package/dist/components/date-picker/DateField.d.ts +161 -0
- package/dist/components/date-picker/DateField.js +393 -0
- package/dist/components/date-picker/DateField.js.map +1 -0
- package/dist/components/date-picker/DateInput.d.ts +20 -0
- package/dist/components/date-picker/DateInput.js +99 -0
- package/dist/components/date-picker/DateInput.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +165 -0
- package/dist/components/date-picker/DatePicker.js +492 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/PickerDialog.d.ts +121 -0
- package/dist/components/date-picker/PickerDialog.js +161 -0
- package/dist/components/date-picker/PickerDialog.js.map +1 -0
- package/dist/components/date-picker/calendar-parts.js +141 -0
- package/dist/components/date-picker/calendar-parts.js.map +1 -0
- package/dist/components/date-picker/date-format.js +72 -0
- package/dist/components/date-picker/date-format.js.map +1 -0
- package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
- package/dist/components/date-picker/date-picker-styles.js +163 -0
- package/dist/components/date-picker/date-picker-styles.js.map +1 -0
- package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
- package/dist/components/date-picker/date-picker-tokens.js +104 -0
- package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-context.js +8 -0
- package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
- package/dist/components/date-picker/picker-dialog-styles.js +57 -0
- package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
- package/dist/components/date-picker/picker-icons.js +24 -0
- package/dist/components/date-picker/picker-icons.js.map +1 -0
- package/dist/components/date-picker/use-media-query.js +21 -0
- package/dist/components/date-picker/use-media-query.js.map +1 -0
- package/dist/components/date-picker/use-size-transform.js +62 -0
- package/dist/components/date-picker/use-size-transform.js.map +1 -0
- package/dist/components/date-picker/use-view-exit.js +68 -0
- package/dist/components/date-picker/use-view-exit.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +267 -0
- package/dist/components/dialog/Dialog.js +521 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/dialog-styles.d.ts +335 -0
- package/dist/components/dialog/dialog-styles.js +377 -0
- package/dist/components/dialog/dialog-styles.js.map +1 -0
- package/dist/components/dialog/dialog-tokens.d.ts +7 -0
- package/dist/components/dialog/dialog-tokens.js +57 -0
- package/dist/components/dialog/dialog-tokens.js.map +1 -0
- package/dist/components/divider/Divider.d.ts +59 -0
- package/dist/components/divider/Divider.js +53 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/divider-styles.d.ts +90 -0
- package/dist/components/divider/divider-styles.js +66 -0
- package/dist/components/divider/divider-styles.js.map +1 -0
- package/dist/components/divider/divider-tokens.d.ts +7 -0
- package/dist/components/divider/divider-tokens.js +16 -0
- package/dist/components/divider/divider-tokens.js.map +1 -0
- package/dist/components/fab/Fab.d.ts +130 -0
- package/dist/components/fab/Fab.js +137 -0
- package/dist/components/fab/Fab.js.map +1 -0
- package/dist/components/fab/FabTooltip.js +36 -0
- package/dist/components/fab/FabTooltip.js.map +1 -0
- package/dist/components/fab/fab-styles.d.ts +286 -0
- package/dist/components/fab/fab-styles.js +131 -0
- package/dist/components/fab/fab-styles.js.map +1 -0
- package/dist/components/fab/fab-tokens.d.ts +12 -0
- package/dist/components/fab/fab-tokens.js +105 -0
- package/dist/components/fab/fab-tokens.js.map +1 -0
- package/dist/components/fab-menu/FabMenu.d.ts +156 -0
- package/dist/components/fab-menu/FabMenu.js +291 -0
- package/dist/components/fab-menu/FabMenu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
- package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
- package/dist/components/fab-menu/fab-menu-styles.js +107 -0
- package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
- package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
- package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
- package/dist/components/icon-button/IconButton.d.ts +125 -0
- package/dist/components/icon-button/IconButton.js +112 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
- package/dist/components/icon-button/icon-button-styles.js +244 -0
- package/dist/components/icon-button/icon-button-styles.js.map +1 -0
- package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
- package/dist/components/icon-button/icon-button-tokens.js +215 -0
- package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
- package/dist/components/list/List.d.ts +265 -0
- package/dist/components/list/List.js +1386 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/ListMedia.d.ts +88 -0
- package/dist/components/list/ListMedia.js +132 -0
- package/dist/components/list/ListMedia.js.map +1 -0
- package/dist/components/list/list-styles.d.ts +375 -0
- package/dist/components/list/list-styles.js +220 -0
- package/dist/components/list/list-styles.js.map +1 -0
- package/dist/components/list/list-tokens.d.ts +7 -0
- package/dist/components/list/list-tokens.js +92 -0
- package/dist/components/list/list-tokens.js.map +1 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
- package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +215 -0
- package/dist/components/menu/Menu.js +715 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/menu-styles.d.ts +354 -0
- package/dist/components/menu/menu-styles.js +219 -0
- package/dist/components/menu/menu-styles.js.map +1 -0
- package/dist/components/menu/menu-tokens.d.ts +7 -0
- package/dist/components/menu/menu-tokens.js +93 -0
- package/dist/components/menu/menu-tokens.js.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +51 -0
- package/dist/components/menu/menu-trigger.js +100 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/use-reveal-entering.js +42 -0
- package/dist/components/menu/use-reveal-entering.js.map +1 -0
- package/dist/components/navigation/NavItem.d.ts +54 -0
- package/dist/components/navigation/NavItem.js +182 -0
- package/dist/components/navigation/NavItem.js.map +1 -0
- package/dist/components/navigation/NavigationBar.d.ts +64 -0
- package/dist/components/navigation/NavigationBar.js +121 -0
- package/dist/components/navigation/NavigationBar.js.map +1 -0
- package/dist/components/navigation/NavigationRail.d.ts +91 -0
- package/dist/components/navigation/NavigationRail.js +285 -0
- package/dist/components/navigation/NavigationRail.js.map +1 -0
- package/dist/components/navigation/nav-item-styles.d.ts +190 -0
- package/dist/components/navigation/nav-item-styles.js +123 -0
- package/dist/components/navigation/nav-item-styles.js.map +1 -0
- package/dist/components/navigation/navigation-styles.d.ts +239 -0
- package/dist/components/navigation/navigation-styles.js +134 -0
- package/dist/components/navigation/navigation-styles.js.map +1 -0
- package/dist/components/navigation/navigation-tokens.d.ts +9 -0
- package/dist/components/navigation/navigation-tokens.js +114 -0
- package/dist/components/navigation/navigation-tokens.js.map +1 -0
- package/dist/components/navigation/use-hide-on-scroll.js +115 -0
- package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
- package/dist/components/navigation/use-item-arrow-keys.js +37 -0
- package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
- package/dist/components/navigation/use-rail-item-morph.js +61 -0
- package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
- package/dist/components/progress/ProgressIndicator.d.ts +95 -0
- package/dist/components/progress/ProgressIndicator.js +426 -0
- package/dist/components/progress/ProgressIndicator.js.map +1 -0
- package/dist/components/progress/progress-geometry.js +285 -0
- package/dist/components/progress/progress-geometry.js.map +1 -0
- package/dist/components/progress/progress-styles.d.ts +81 -0
- package/dist/components/progress/progress-styles.js +43 -0
- package/dist/components/progress/progress-styles.js.map +1 -0
- package/dist/components/progress/progress-tokens.d.ts +7 -0
- package/dist/components/progress/progress-tokens.js +39 -0
- package/dist/components/progress/progress-tokens.js.map +1 -0
- package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +121 -0
- package/dist/components/radio/RadioGroup.js +163 -0
- package/dist/components/radio/RadioGroup.js.map +1 -0
- package/dist/components/radio/radio-ring.js +21 -0
- package/dist/components/radio/radio-ring.js.map +1 -0
- package/dist/components/radio/radio-styles.d.ts +155 -0
- package/dist/components/radio/radio-styles.js +60 -0
- package/dist/components/radio/radio-styles.js.map +1 -0
- package/dist/components/radio/radio-tokens.d.ts +7 -0
- package/dist/components/radio/radio-tokens.js +31 -0
- package/dist/components/radio/radio-tokens.js.map +1 -0
- package/dist/components/search/SearchAppBar.d.ts +45 -0
- package/dist/components/search/SearchAppBar.js +61 -0
- package/dist/components/search/SearchAppBar.js.map +1 -0
- package/dist/components/search/SearchBar.d.ts +147 -0
- package/dist/components/search/SearchBar.js +412 -0
- package/dist/components/search/SearchBar.js.map +1 -0
- package/dist/components/search/search-styles.d.ts +243 -0
- package/dist/components/search/search-styles.js +143 -0
- package/dist/components/search/search-styles.js.map +1 -0
- package/dist/components/search/search-tokens.d.ts +9 -0
- package/dist/components/search/search-tokens.js +70 -0
- package/dist/components/search/search-tokens.js.map +1 -0
- package/dist/components/select/Select.d.ts +187 -0
- package/dist/components/select/Select.js +319 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/field-shell.d.ts +29 -0
- package/dist/components/select/field-shell.js +135 -0
- package/dist/components/select/field-shell.js.map +1 -0
- package/dist/components/select/option-list.d.ts +81 -0
- package/dist/components/select/option-list.js +291 -0
- package/dist/components/select/option-list.js.map +1 -0
- package/dist/components/select/search-list.js +135 -0
- package/dist/components/select/search-list.js.map +1 -0
- package/dist/components/select/selection-cap.js +30 -0
- package/dist/components/select/selection-cap.js.map +1 -0
- package/dist/components/sheet/BottomSheet.d.ts +154 -0
- package/dist/components/sheet/BottomSheet.js +442 -0
- package/dist/components/sheet/BottomSheet.js.map +1 -0
- package/dist/components/sheet/SheetTrigger.d.ts +25 -0
- package/dist/components/sheet/SheetTrigger.js +46 -0
- package/dist/components/sheet/SheetTrigger.js.map +1 -0
- package/dist/components/sheet/SideSheet.d.ts +139 -0
- package/dist/components/sheet/SideSheet.js +289 -0
- package/dist/components/sheet/SideSheet.js.map +1 -0
- package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
- package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
- package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
- package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
- package/dist/components/sheet/sheet-gesture.js +48 -0
- package/dist/components/sheet/sheet-gesture.js.map +1 -0
- package/dist/components/sheet/sheet-icons.js +31 -0
- package/dist/components/sheet/sheet-icons.js.map +1 -0
- package/dist/components/sheet/sheet-settle.js +58 -0
- package/dist/components/sheet/sheet-settle.js.map +1 -0
- package/dist/components/sheet/sheet-styles.d.ts +312 -0
- package/dist/components/sheet/sheet-styles.js +229 -0
- package/dist/components/sheet/sheet-styles.js.map +1 -0
- package/dist/components/sheet/sheet-tokens.d.ts +12 -0
- package/dist/components/sheet/sheet-tokens.js +115 -0
- package/dist/components/sheet/sheet-tokens.js.map +1 -0
- package/dist/components/sheet/side-swipe-gesture.js +22 -0
- package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
- package/dist/components/sheet/use-peek-inert.js +32 -0
- package/dist/components/sheet/use-peek-inert.js.map +1 -0
- package/dist/components/sheet/use-side-swipe.js +174 -0
- package/dist/components/sheet/use-side-swipe.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +129 -0
- package/dist/components/slider/Slider.js +295 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/slider-geometry.js +138 -0
- package/dist/components/slider/slider-geometry.js.map +1 -0
- package/dist/components/slider/slider-styles.d.ts +133 -0
- package/dist/components/slider/slider-styles.js +97 -0
- package/dist/components/slider/slider-styles.js.map +1 -0
- package/dist/components/slider/slider-tokens.d.ts +7 -0
- package/dist/components/slider/slider-tokens.js +66 -0
- package/dist/components/slider/slider-tokens.js.map +1 -0
- package/dist/components/slider/use-touch-track.js +138 -0
- package/dist/components/slider/use-touch-track.js.map +1 -0
- package/dist/components/snackbar/Snackbar.d.ts +96 -0
- package/dist/components/snackbar/Snackbar.js +253 -0
- package/dist/components/snackbar/Snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar-state.d.ts +58 -0
- package/dist/components/snackbar/snackbar-state.js +73 -0
- package/dist/components/snackbar/snackbar-state.js.map +1 -0
- package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
- package/dist/components/snackbar/snackbar-styles.js +67 -0
- package/dist/components/snackbar/snackbar-styles.js.map +1 -0
- package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
- package/dist/components/snackbar/snackbar-tokens.js +54 -0
- package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +109 -0
- package/dist/components/split-button/SplitButton.js +195 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/split-button-styles.d.ts +214 -0
- package/dist/components/split-button/split-button-styles.js +164 -0
- package/dist/components/split-button/split-button-styles.js.map +1 -0
- package/dist/components/split-button/split-button-tokens.d.ts +7 -0
- package/dist/components/split-button/split-button-tokens.js +36 -0
- package/dist/components/split-button/split-button-tokens.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +82 -0
- package/dist/components/switch/Switch.js +165 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/switch-styles.d.ts +96 -0
- package/dist/components/switch/switch-styles.js +68 -0
- package/dist/components/switch/switch-styles.js.map +1 -0
- package/dist/components/switch/switch-thumb.js +41 -0
- package/dist/components/switch/switch-thumb.js.map +1 -0
- package/dist/components/switch/switch-tokens.d.ts +7 -0
- package/dist/components/switch/switch-tokens.js +78 -0
- package/dist/components/switch/switch-tokens.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +120 -0
- package/dist/components/tabs/Tabs.js +346 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/tabs-styles.d.ts +198 -0
- package/dist/components/tabs/tabs-styles.js +99 -0
- package/dist/components/tabs/tabs-styles.js.map +1 -0
- package/dist/components/tabs/tabs-tokens.d.ts +7 -0
- package/dist/components/tabs/tabs-tokens.js +121 -0
- package/dist/components/tabs/tabs-tokens.js.map +1 -0
- package/dist/components/text-field/TextField.d.ts +175 -0
- package/dist/components/text-field/TextField.js +250 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/text-field-styles.d.ts +252 -0
- package/dist/components/text-field/text-field-styles.js +209 -0
- package/dist/components/text-field/text-field-styles.js.map +1 -0
- package/dist/components/text-field/text-field-tokens.d.ts +7 -0
- package/dist/components/text-field/text-field-tokens.js +177 -0
- package/dist/components/text-field/text-field-tokens.js.map +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +142 -0
- package/dist/components/time-picker/TimePicker.js +700 -0
- package/dist/components/time-picker/TimePicker.js.map +1 -0
- package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
- package/dist/components/time-picker/time-picker-styles.js +112 -0
- package/dist/components/time-picker/time-picker-styles.js.map +1 -0
- package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
- package/dist/components/time-picker/time-picker-tokens.js +86 -0
- package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +209 -0
- package/dist/components/toolbar/Toolbar.js +282 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
- package/dist/components/toolbar/toolbar-styles.js +253 -0
- package/dist/components/toolbar/toolbar-styles.js.map +1 -0
- package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
- package/dist/components/toolbar/toolbar-tokens.js +117 -0
- package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +131 -0
- package/dist/components/tooltip/Tooltip.js +388 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/lazy-tooltip.js +35 -0
- package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
- package/dist/components/tooltip/tooltip-placement.js +14 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
- package/dist/components/tooltip/tooltip-styles.js +81 -0
- package/dist/components/tooltip/tooltip-styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
- package/dist/components/tooltip/tooltip-tokens.js +72 -0
- package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
- package/dist/components/tooltip/tooltip-trigger.js +115 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
- package/dist/composites/button-group/ButtonGroup.js +270 -0
- package/dist/composites/button-group/ButtonGroup.js.map +1 -0
- package/dist/composites/button-group/button-group-styles.d.ts +73 -0
- package/dist/composites/button-group/button-group-styles.js +87 -0
- package/dist/composites/button-group/button-group-styles.js.map +1 -0
- package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
- package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
- package/dist/composites/button-group/overflow-menu-list.js +26 -0
- package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
- package/dist/composites/button-group/use-overflow.js +75 -0
- package/dist/composites/button-group/use-overflow.js.map +1 -0
- package/dist/composites/button-group/use-press-expansion.js +155 -0
- package/dist/composites/button-group/use-press-expansion.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +136 -0
- package/dist/motion/get-m3-spring.d.ts +6 -0
- package/dist/motion/get-m3-spring.js +10 -0
- package/dist/motion/get-m3-spring.js.map +1 -0
- package/dist/motion/reduced-motion.js +19 -0
- package/dist/motion/reduced-motion.js.map +1 -0
- package/dist/motion/use-m3-spring.d.ts +13 -0
- package/dist/motion/use-m3-spring.js +22 -0
- package/dist/motion/use-m3-spring.js.map +1 -0
- package/dist/next/NextRouterProvider.d.ts +13 -0
- package/dist/next/NextRouterProvider.js +26 -0
- package/dist/next/NextRouterProvider.js.map +1 -0
- package/dist/next/get-theme-from-cookies.d.ts +32 -0
- package/dist/next/get-theme-from-cookies.js +27 -0
- package/dist/next/get-theme-from-cookies.js.map +1 -0
- package/dist/next/navigation-guard.d.ts +30 -0
- package/dist/next/navigation-guard.js +68 -0
- package/dist/next/navigation-guard.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.js +5 -0
- package/dist/primitives/ButtonBase.d.ts +115 -0
- package/dist/primitives/ButtonBase.js +231 -0
- package/dist/primitives/ButtonBase.js.map +1 -0
- package/dist/primitives/DomDirectionLocale.d.ts +18 -0
- package/dist/primitives/DomDirectionLocale.js +28 -0
- package/dist/primitives/DomDirectionLocale.js.map +1 -0
- package/dist/primitives/Field.d.ts +50 -0
- package/dist/primitives/Field.js +74 -0
- package/dist/primitives/Field.js.map +1 -0
- package/dist/primitives/IconFaces.js +23 -0
- package/dist/primitives/IconFaces.js.map +1 -0
- package/dist/primitives/Overlay.d.ts +39 -0
- package/dist/primitives/Overlay.js +86 -0
- package/dist/primitives/Overlay.js.map +1 -0
- package/dist/primitives/SelectionControl.d.ts +55 -0
- package/dist/primitives/SelectionControl.js +58 -0
- package/dist/primitives/SelectionControl.js.map +1 -0
- package/dist/primitives/Surface.d.ts +123 -0
- package/dist/primitives/Surface.js +68 -0
- package/dist/primitives/Surface.js.map +1 -0
- package/dist/primitives/ToolbarContext.js +12 -0
- package/dist/primitives/ToolbarContext.js.map +1 -0
- package/dist/primitives/TouchTarget.d.ts +14 -0
- package/dist/primitives/TouchTarget.js +20 -0
- package/dist/primitives/TouchTarget.js.map +1 -0
- package/dist/primitives/TriggerContext.d.ts +34 -0
- package/dist/primitives/TriggerContext.js +24 -0
- package/dist/primitives/TriggerContext.js.map +1 -0
- package/dist/primitives/hidden-input-focus.js +27 -0
- package/dist/primitives/hidden-input-focus.js.map +1 -0
- package/dist/primitives/icon-faces-styles.d.ts +9 -0
- package/dist/primitives/icon-faces-styles.js +45 -0
- package/dist/primitives/icon-faces-styles.js.map +1 -0
- package/dist/primitives/locale-with-direction.d.ts +9 -0
- package/dist/primitives/locale-with-direction.js +17 -0
- package/dist/primitives/locale-with-direction.js.map +1 -0
- package/dist/primitives/morph-path.d.ts +25 -0
- package/dist/primitives/morph-path.js +38 -0
- package/dist/primitives/morph-path.js.map +1 -0
- package/dist/primitives/selection-control-styles.d.ts +54 -0
- package/dist/primitives/selection-control-styles.js +44 -0
- package/dist/primitives/selection-control-styles.js.map +1 -0
- package/dist/primitives/use-m3-interaction.d.ts +51 -0
- package/dist/primitives/use-m3-interaction.js +149 -0
- package/dist/primitives/use-m3-interaction.js.map +1 -0
- package/dist/primitives/use-m3-morph.d.ts +18 -0
- package/dist/primitives/use-m3-morph.js +36 -0
- package/dist/primitives/use-m3-morph.js.map +1 -0
- package/dist/primitives/use-presence.d.ts +19 -0
- package/dist/primitives/use-presence.js +37 -0
- package/dist/primitives/use-presence.js.map +1 -0
- package/dist/primitives.d.ts +36 -0
- package/dist/primitives.js +34 -0
- package/dist/shapes/corner-rounding.d.ts +13 -0
- package/dist/shapes/corner-rounding.js +18 -0
- package/dist/shapes/corner-rounding.js.map +1 -0
- package/dist/shapes/cubic.d.ts +52 -0
- package/dist/shapes/cubic.js +189 -0
- package/dist/shapes/cubic.js.map +1 -0
- package/dist/shapes/feature-mapping.js +80 -0
- package/dist/shapes/feature-mapping.js.map +1 -0
- package/dist/shapes/features.d.ts +23 -0
- package/dist/shapes/features.js +82 -0
- package/dist/shapes/features.js.map +1 -0
- package/dist/shapes/float-mapping.js +65 -0
- package/dist/shapes/float-mapping.js.map +1 -0
- package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
- package/dist/shapes/generated/material-shape-path-record.js +48 -0
- package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
- package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
- package/dist/shapes/generated/material-shape-paths.js +218 -0
- package/dist/shapes/generated/material-shape-paths.js.map +1 -0
- package/dist/shapes/mask.d.ts +14 -0
- package/dist/shapes/mask.js +24 -0
- package/dist/shapes/mask.js.map +1 -0
- package/dist/shapes/material-shapes.d.ts +11 -0
- package/dist/shapes/material-shapes.js +250 -0
- package/dist/shapes/material-shapes.js.map +1 -0
- package/dist/shapes/morph.d.ts +25 -0
- package/dist/shapes/morph.js +97 -0
- package/dist/shapes/morph.js.map +1 -0
- package/dist/shapes/path.d.ts +33 -0
- package/dist/shapes/path.js +47 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/point.d.ts +28 -0
- package/dist/shapes/point.js +103 -0
- package/dist/shapes/point.js.map +1 -0
- package/dist/shapes/polygon-measure.js +140 -0
- package/dist/shapes/polygon-measure.js.map +1 -0
- package/dist/shapes/rounded-polygon.d.ts +44 -0
- package/dist/shapes/rounded-polygon.js +278 -0
- package/dist/shapes/rounded-polygon.js.map +1 -0
- package/dist/shapes/shape-path.d.ts +15 -0
- package/dist/shapes/shapes.d.ts +53 -0
- package/dist/shapes/shapes.js +171 -0
- package/dist/shapes/shapes.js.map +1 -0
- package/dist/styles/generated/components.css +710 -0
- package/dist/styles/generated/theme.css +247 -0
- package/dist/styles/generated/themes.css +3361 -0
- package/dist/styles/generated/tokens.css +284 -0
- package/dist/styles/styles.css +15 -0
- package/dist/styles/utilities.css +283 -0
- package/dist/styles.compiled.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +72 -0
- package/dist/theme/ThemeProvider.js +144 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScope.d.ts +32 -0
- package/dist/theme/ThemeScope.js +67 -0
- package/dist/theme/ThemeScope.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +26 -0
- package/dist/theme/ThemeScript.js +44 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/context.d.ts +32 -0
- package/dist/theme/context.js +47 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/create-theme.d.ts +60 -0
- package/dist/theme/create-theme.js +47 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/css.js +54 -0
- package/dist/theme/css.js.map +1 -0
- package/dist/theme/parse-palettes.js +40 -0
- package/dist/theme/parse-palettes.js.map +1 -0
- package/dist/theme/scheme.d.ts +6 -0
- package/dist/theme/scheme.js +118 -0
- package/dist/theme/scheme.js.map +1 -0
- package/dist/theme/state.d.ts +38 -0
- package/dist/theme/state.js +93 -0
- package/dist/theme/state.js.map +1 -0
- package/dist/theme/storage.js +21 -0
- package/dist/theme/storage.js.map +1 -0
- package/dist/tokens/breakpoints.d.ts +15 -0
- package/dist/tokens/breakpoints.js +16 -0
- package/dist/tokens/breakpoints.js.map +1 -0
- package/dist/tokens/color.d.ts +104 -0
- package/dist/tokens/color.js +147 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/component.d.ts +110 -0
- package/dist/tokens/component.js +67 -0
- package/dist/tokens/component.js.map +1 -0
- package/dist/tokens/density.d.ts +20 -0
- package/dist/tokens/density.js +27 -0
- package/dist/tokens/density.js.map +1 -0
- package/dist/tokens/elevation.d.ts +44 -0
- package/dist/tokens/elevation.js +45 -0
- package/dist/tokens/elevation.js.map +1 -0
- package/dist/tokens/motion.d.ts +79 -0
- package/dist/tokens/motion.js +126 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/shape.d.ts +22 -0
- package/dist/tokens/shape.js +22 -0
- package/dist/tokens/shape.js.map +1 -0
- package/dist/tokens/spring-velocity.d.ts +19 -0
- package/dist/tokens/spring-velocity.js +44 -0
- package/dist/tokens/spring-velocity.js.map +1 -0
- package/dist/tokens/state.d.ts +18 -0
- package/dist/tokens/state.js +19 -0
- package/dist/tokens/state.js.map +1 -0
- package/dist/tokens/typography.d.ts +64 -0
- package/dist/tokens/typography.js +60 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/z-index.d.ts +17 -0
- package/dist/tokens/z-index.js +18 -0
- package/dist/tokens/z-index.js.map +1 -0
- package/dist/utils/announce.js +51 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/assert-collection-children.js +26 -0
- package/dist/utils/assert-collection-children.js.map +1 -0
- package/dist/utils/closed-by.d.ts +9 -0
- package/dist/utils/closed-by.js +12 -0
- package/dist/utils/closed-by.js.map +1 -0
- package/dist/utils/cn.d.ts +31 -0
- package/dist/utils/cn.js +37 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/composite-keys.js +32 -0
- package/dist/utils/composite-keys.js.map +1 -0
- package/dist/utils/focus-visible.js +14 -0
- package/dist/utils/focus-visible.js.map +1 -0
- package/dist/utils/focus.js +51 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/focusable-disabled.js +12 -0
- package/dist/utils/focusable-disabled.js.map +1 -0
- package/dist/utils/keep-pressed-in-place.d.ts +60 -0
- package/dist/utils/keep-pressed-in-place.js +127 -0
- package/dist/utils/keep-pressed-in-place.js.map +1 -0
- package/dist/utils/load-on-demand.js +111 -0
- package/dist/utils/load-on-demand.js.map +1 -0
- package/dist/utils/merge-data-tokens.d.ts +9 -0
- package/dist/utils/merge-data-tokens.js +15 -0
- package/dist/utils/merge-data-tokens.js.map +1 -0
- package/dist/utils/natural-size.js +53 -0
- package/dist/utils/natural-size.js.map +1 -0
- package/dist/utils/nearest-reveal.js +28 -0
- package/dist/utils/nearest-reveal.js.map +1 -0
- package/dist/utils/placement.js +14 -0
- package/dist/utils/placement.js.map +1 -0
- package/dist/utils/radio-group-keys.js +74 -0
- package/dist/utils/radio-group-keys.js.map +1 -0
- package/dist/utils/rendered-description.js +17 -0
- package/dist/utils/rendered-description.js.map +1 -0
- package/dist/utils/root-props.d.ts +103 -0
- package/dist/utils/root-props.js +51 -0
- package/dist/utils/root-props.js.map +1 -0
- package/dist/utils/search.d.ts +11 -0
- package/dist/utils/search.js +18 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/shortcut.js +20 -0
- package/dist/utils/shortcut.js.map +1 -0
- package/dist/utils/split-data-attributes.d.ts +12 -0
- package/dist/utils/split-data-attributes.js +20 -0
- package/dist/utils/split-data-attributes.js.map +1 -0
- package/dist/utils/toolbar-keys.js +28 -0
- package/dist/utils/toolbar-keys.js.map +1 -0
- package/dist/utils/tv.d.ts +7 -0
- package/dist/utils/tv.js +9 -0
- package/dist/utils/tv.js.map +1 -0
- package/dist/utils/typeahead.js +64 -0
- package/dist/utils/typeahead.js.map +1 -0
- package/dist/utils/warn-once.js +30 -0
- package/dist/utils/warn-once.js.map +1 -0
- package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
- package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
- package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
- package/dist/vendor/material-color-utilities/index.js +51 -0
- package/dist/vendor/material-color-utilities/index.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
- package/dist/vendor/material-color-utilities/score/score.js +115 -0
- package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
- package/package.json +114 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-bar-scroll.js","names":[],"sources":["../../../src/components/app-bar/use-app-bar-scroll.ts"],"sourcesContent":["'use client';\n\nimport { cubicBezier, useReducedMotion } from 'motion/react';\nimport { useEffect, useState, type RefObject } from 'react';\nimport { hasVisibleFocusWithin } from '../../utils/focus-visible';\n\n/** How a top app bar responds to the content scrolling under it (Compose's scroll behaviours). */\nexport type TopAppBarScrollBehavior = 'pinned' | 'enter-always' | 'exit-until-collapsed';\n\n/** Compose's `TopTitleAlphaEasing` for the collapsed title of a two-row bar. */\nconst topTitleAlpha = cubicBezier(0.8, 0, 0.8, 0.15);\n/** Compose's `FastOutLinearInEasing`, used to blend the container colour. */\nconst fastOutLinearIn = cubicBezier(0.4, 0, 1, 1);\n\ninterface AppBarScrollOptions {\n behavior: TopAppBarScrollBehavior | undefined;\n rootRef: RefObject<HTMLElement | null>;\n /** The part of the bar that collapses: the expanded row, or the whole single-row bar. */\n collapsibleRef: RefObject<HTMLElement | null>;\n scrollRef?: RefObject<HTMLElement | null>;\n twoRows: boolean;\n}\n\nexport interface AppBarScrollState {\n /** Content is scrolled under the bar. */\n scrolled: boolean;\n /** A two-row bar is more than half collapsed (its collapsed title is the one announced). */\n collapsed: boolean;\n}\n\n/**\n * Ports Compose's top app bar scroll behaviours to page scrolling. The bar's offset\n * (Compose's `heightOffset`, 0 down to minus the collapsible height) is written to\n * `--m3-app-bar-offset`, which the sticky bar uses as its `top`, so the bar moves without\n * changing its layout height and the content below never shifts. Colour and title alphas\n * are written as custom properties too, so scrolling causes no React renders.\n *\n * - `pinned`: the bar stays; only its colour responds, switching once content is under it\n * (a two-row bar too, keeping its expanded title).\n * - `enter-always`: scrolling down hides the bar, any scroll up brings it back. A two-row\n * bar first collapses to its top row, which then hides and comes back on scroll up, but\n * stays small until the page is back at the top (M3).\n * - `exit-until-collapsed`: scrolling down collapses it; it expands only near the top.\n *\n * Under reduced motion an `enter-always` bar never leaves the screen, like a navigation bar\n * that hides on scroll (architecture §6): a single-row bar stays put and a two-row bar only\n * collapses with the scroll, as `exit-until-collapsed` does.\n *\n * A bar scrolled fully off screen is `inert`, so Tab skips its hidden controls and screen\n * readers leave them out; it's restored as the bar comes back. While keyboard focus is in\n * the bar it stays on screen (M3: people should \"maintain access to app bar actions when\n * the content is scrolled\"; WCAG 2.4.11 Focus Not Obscured), and focusing a partly hidden\n * bar brings it back.\n */\nexport function useAppBarScroll({\n behavior: requested,\n rootRef,\n collapsibleRef,\n scrollRef,\n twoRows,\n}: AppBarScrollOptions): AppBarScrollState {\n const [state, setState] = useState<AppBarScrollState>({ scrolled: false, collapsed: false });\n const reducedMotion = useReducedMotion() ?? false;\n const behavior: TopAppBarScrollBehavior | undefined =\n requested === 'enter-always' && reducedMotion\n ? twoRows\n ? 'exit-until-collapsed'\n : 'pinned'\n : requested;\n\n useEffect(() => {\n const root = rootRef.current;\n if (!behavior || !root) return;\n const scroller = scrollRef?.current;\n const target: HTMLElement | Window = scroller ?? window;\n const position = () => Math.max(0, scroller ? scroller.scrollTop : window.scrollY);\n\n let last = position();\n let offset = 0;\n /** A two-row `enter-always` bar's top-row offset: 0 (shown) to minus its height. */\n let hide = 0;\n let frame = 0;\n let current: AppBarScrollState = { scrolled: false, collapsed: false };\n let hidden = false;\n\n const update = () => {\n frame = 0;\n const scroll = position();\n const previous = last;\n last = scroll;\n // The collapsible height, measured each time so wrapped titles and resizes count.\n const limit = collapsibleRef.current?.offsetHeight ?? 0;\n const focused = hasVisibleFocusWithin(root);\n let collapse = 0;\n if (behavior === 'pinned') {\n offset = 0;\n } else if (twoRows) {\n // The expanded row collapses with the scroll and expands only near the top.\n collapse = -Math.min(scroll, limit);\n if (behavior === 'enter-always') {\n // Past that, the top row follows each scroll delta: hidden going down, back going up.\n const rowHeight = root.offsetHeight - limit;\n const beyond = Math.max(scroll, limit) - Math.max(previous, limit);\n hide = focused ? 0 : Math.min(0, Math.max(-rowHeight, hide - beyond));\n }\n offset = collapse + hide;\n } else if (behavior === 'enter-always') {\n offset = focused ? 0 : Math.min(0, Math.max(-limit, offset - (scroll - previous)));\n } else {\n // A single-row bar collapses away entirely; a two-row bar keeps its top row.\n offset = focused && !twoRows ? 0 : -Math.min(scroll, limit);\n }\n const fraction = limit > 0 ? -(twoRows ? collapse : offset) / limit : 0;\n\n root.style.setProperty('--m3-app-bar-offset', `${offset}px`);\n // How far the expanded row has slid up under the top row: it's clipped there, as\n // Compose clips the expanded title to the shrinking bar, so it never shows through a\n // see-through top row (`scrolledColor=\"transparent\"`).\n if (twoRows) root.style.setProperty('--m3-app-bar-collapse', `${-collapse}px`);\n const height = root.offsetHeight;\n const offScreen = height > 0 && -offset >= height - 0.5;\n if (offScreen !== hidden) {\n hidden = offScreen;\n root.toggleAttribute('inert', offScreen);\n }\n // A pinned bar never collapses, so a two-row one fills like a single row (M3: app bars\n // \"fill with a contrasting color on scroll\").\n if (twoRows && behavior !== 'pinned') {\n root.style.setProperty('--m3-app-bar-scrolled', `${fastOutLinearIn(fraction) * 100}%`);\n root.style.setProperty('--m3-app-bar-top-alpha', String(topTitleAlpha(fraction)));\n root.style.setProperty('--m3-app-bar-bottom-alpha', String(1 - fraction));\n } else {\n root.style.setProperty('--m3-app-bar-scrolled', scroll > 0 ? '100%' : '0%');\n if (twoRows) {\n root.style.setProperty('--m3-app-bar-top-alpha', '0');\n root.style.setProperty('--m3-app-bar-bottom-alpha', '1');\n }\n }\n const next = { scrolled: scroll > 0, collapsed: twoRows && fraction >= 0.5 };\n if (next.scrolled !== current.scrolled || next.collapsed !== current.collapsed) {\n current = next;\n setState(next);\n }\n };\n const onScroll = () => {\n if (!frame) frame = requestAnimationFrame(update);\n };\n\n update();\n target.addEventListener('scroll', onScroll, { passive: true });\n // Keyboard focus landing in a partly hidden bar brings it back.\n root.addEventListener('focusin', onScroll);\n return () => {\n target.removeEventListener('scroll', onScroll);\n root.removeEventListener('focusin', onScroll);\n cancelAnimationFrame(frame);\n if (hidden) root.removeAttribute('inert');\n for (const name of [\n '--m3-app-bar-offset',\n '--m3-app-bar-collapse',\n '--m3-app-bar-scrolled',\n '--m3-app-bar-top-alpha',\n '--m3-app-bar-bottom-alpha',\n ])\n root.style.removeProperty(name);\n };\n }, [behavior, rootRef, collapsibleRef, scrollRef, twoRows]);\n\n return behavior ? state : { scrolled: false, collapsed: false };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Density } from "../../tokens/density.js";
|
|
2
|
+
import { WrapperRootDOMProps } from "../../utils/root-props.js";
|
|
3
|
+
import { TextFieldVariant } from "../text-field/text-field-styles.js";
|
|
4
|
+
import { FieldShellClassNames } from "../select/field-shell.js";
|
|
5
|
+
import { OptionListClassNames } from "../select/option-list.js";
|
|
6
|
+
import { AriaAttributes, CSSProperties, ReactNode, Ref } from "react";
|
|
7
|
+
import { AriaComboBoxOptions } from "react-aria";
|
|
8
|
+
import { Key as AutocompleteKey } from "react-stately";
|
|
9
|
+
import { ComboBoxProps, SelectionMode } from "react-stately/useComboBoxState";
|
|
10
|
+
//#region src/components/autocomplete/Autocomplete.d.ts
|
|
11
|
+
/** Words the Autocomplete shows or announces; override them for other languages. */
|
|
12
|
+
export interface AutocompleteLabels {
|
|
13
|
+
/** Shown when no option matches what was typed. @default "No results" */
|
|
14
|
+
noResults: string;
|
|
15
|
+
/** The loading indicator's name. @default "Loading options" */
|
|
16
|
+
loading: string;
|
|
17
|
+
/** The arrow button's name. @default "Show options" */
|
|
18
|
+
showOptions: string;
|
|
19
|
+
/** A chip's remove button; the chip's text follows it ("Remove London"). @default "Remove" */
|
|
20
|
+
remove: string;
|
|
21
|
+
/** With `clearable`: the clear button's name. @default "Clear" */
|
|
22
|
+
clear: string;
|
|
23
|
+
/** The error icon's name (M3: "Error"). @default "Error" */
|
|
24
|
+
error: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AutocompleteClassNames extends FieldShellClassNames, OptionListClassNames {
|
|
27
|
+
/** The text `<input>`. */
|
|
28
|
+
input?: string;
|
|
29
|
+
/** With `selectionMode="multiple"`: each chosen option's input chip. */
|
|
30
|
+
chip?: string;
|
|
31
|
+
/** With `clearable`: the clear button. */
|
|
32
|
+
clear?: string;
|
|
33
|
+
}
|
|
34
|
+
/** React Aria props this API names the library's way (`disabled`, `readOnly`…), or leaves out. */
|
|
35
|
+
type RenamedProps = 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'label' | 'description' | 'validationState' | 'allowsCustomValue' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange';
|
|
36
|
+
export type AutocompleteProps<T extends object, M extends SelectionMode = 'single'> = Omit<ComboBoxProps<T, M>, RenamedProps> & Pick<AriaComboBoxOptions<T, M>, 'id' | 'name' | 'form'> & Omit<WrapperRootDOMProps, keyof ComboBoxProps<T, M>> & {
|
|
37
|
+
/** The `<input>`'s id, for a `<label for>` or an error summary's link. */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** The container style, as `TextField`'s: a filled surface or an outline. @default "filled" */
|
|
40
|
+
variant?: TextFieldVariant;
|
|
41
|
+
/**
|
|
42
|
+
* Free text: whatever is typed stays as the field's text when no option matches, instead
|
|
43
|
+
* of returning to the chosen option's. @default false
|
|
44
|
+
*/
|
|
45
|
+
allowCustomValue?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Web density, `0` to `-3`: each step takes 4px off the field (56px at 0, 44px at -3) and
|
|
48
|
+
* off its menu's options (44px at 0, 32px at -3). Left out, it takes the density of the
|
|
49
|
+
* nearest `ThemeProvider` or `ThemeScope`. M3 asks for density to be the reader's choice
|
|
50
|
+
* rather than a default, so prefer setting it there, from a setting.
|
|
51
|
+
* @default 0
|
|
52
|
+
*/
|
|
53
|
+
density?: Density;
|
|
54
|
+
/** The field's label. Give `aria-label` instead when there's no visible label. */
|
|
55
|
+
label?: ReactNode;
|
|
56
|
+
/** Accessible name when there's no visible label. */
|
|
57
|
+
'aria-label'?: string;
|
|
58
|
+
/** Shown in the empty input. With a `label`, it appears once the label floats (on focus). */
|
|
59
|
+
placeholder?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Helper text below the field. Replaced visually by the error when invalid, and shown in
|
|
62
|
+
* the error colour while the field is invalid.
|
|
63
|
+
*/
|
|
64
|
+
supportingText?: ReactNode;
|
|
65
|
+
/** Marks the field invalid (in addition to `validate` and `required`). */
|
|
66
|
+
invalid?: boolean;
|
|
67
|
+
/** A value is required: adds the `*` to the label and validates on submit. */
|
|
68
|
+
required?: boolean;
|
|
69
|
+
/** Disables the field: it can't be focused or edited. @default false */
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/** The value can be read and copied but not changed; the menu doesn't open. @default false */
|
|
72
|
+
readOnly?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Read as `invalid` when that's left out, for a form library that sets the attribute, so
|
|
75
|
+
* the field shows its error state as well as announcing it.
|
|
76
|
+
*/
|
|
77
|
+
'aria-invalid'?: AriaAttributes['aria-invalid'];
|
|
78
|
+
/** Read as `required` when that's left out, for a form library that sets the attribute. */
|
|
79
|
+
'aria-required'?: AriaAttributes['aria-required'];
|
|
80
|
+
/** Read as `readOnly` when that's left out, for a form library that sets the attribute. */
|
|
81
|
+
'aria-readonly'?: AriaAttributes['aria-readonly'];
|
|
82
|
+
/** Decorative icon at the start, in a 48px box. */
|
|
83
|
+
leadingIcon?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* The icon shown before the arrow while the field is invalid (M3 strongly recommends one).
|
|
86
|
+
* Defaults to Material Symbols `error`, named by `labels.error`; `false` turns it off.
|
|
87
|
+
*/
|
|
88
|
+
errorIcon?: ReactNode | false;
|
|
89
|
+
/**
|
|
90
|
+
* A clear button (M3's clear icon) that appears while there's typed text and empties it,
|
|
91
|
+
* and a single choice with it. It's skipped by Tab, since the text can be deleted from
|
|
92
|
+
* the keyboard.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
clearable?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* With `selectionMode="multiple"`, the most options that can be chosen; the rest show as
|
|
98
|
+
* disabled until one is removed.
|
|
99
|
+
*/
|
|
100
|
+
maxSelections?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Shows a loading indicator in the list, e.g. while options load for what was typed.
|
|
103
|
+
* The indicator's code loads when it first shows, and ahead of that when the field is
|
|
104
|
+
* hovered or focused while this prop is set at all, so pass `loading={false}` (rather than
|
|
105
|
+
* leaving it out) on a field that loads options.
|
|
106
|
+
*/
|
|
107
|
+
loading?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Whether an option matches what was typed. Defaults to a match anywhere in its text,
|
|
110
|
+
* ignoring case and accents ("zurich" finds "Zürich"). Not used with controlled `items`.
|
|
111
|
+
*/
|
|
112
|
+
filter?: (textValue: string, inputValue: string) => boolean;
|
|
113
|
+
/** Words the Autocomplete shows or announces, for other languages. */
|
|
114
|
+
labels?: Partial<AutocompleteLabels>;
|
|
115
|
+
/** Classes for the root element, merged with `classNames.root`; consumer classes win. */
|
|
116
|
+
className?: string;
|
|
117
|
+
/** Classes for each part, by slot. */
|
|
118
|
+
classNames?: AutocompleteClassNames;
|
|
119
|
+
/** Inline styles for the root element. */
|
|
120
|
+
style?: CSSProperties;
|
|
121
|
+
/** Ref to the root `<div>` element. Use `inputRef` for the input itself. */
|
|
122
|
+
ref?: Ref<HTMLDivElement>;
|
|
123
|
+
/** Ref to the text `<input>`, e.g. for form libraries. */
|
|
124
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* M3 exposed dropdown menu, editable (Compose's `ExposedDropdownMenuBox` with a
|
|
128
|
+
* `PrimaryEditable` anchor): type in the field and the menu below shows the matching
|
|
129
|
+
* options. Single or multiple selection (chosen options as M3 input chips in the field),
|
|
130
|
+
* accent-insensitive filtering by default, options loaded from a server through `items`,
|
|
131
|
+
* `onInputChange` and `loading`, and free text with `allowCustomValue` (React Aria
|
|
132
|
+
* `useComboBox`).
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* <Autocomplete label="City" defaultItems={cities}>
|
|
136
|
+
* {(city) => <AutocompleteItem key={city.id}>{city.name}</AutocompleteItem>}
|
|
137
|
+
* </Autocomplete>
|
|
138
|
+
*/
|
|
139
|
+
export declare function Autocomplete<T extends object, M extends SelectionMode = 'single'>(props: AutocompleteProps<T, M>): import("react").JSX.Element;
|
|
140
|
+
//#endregion
|
|
141
|
+
export type { AutocompleteKey };
|
|
142
|
+
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { TouchTarget } from "../../primitives/TouchTarget.js";
|
|
4
|
+
import { usePreloadLoadingIndicator } from "../loading-indicator/lazy-loading-indicator.js";
|
|
5
|
+
import { FOCUSABLE_DISABLED_OPTIONS } from "../../utils/focusable-disabled.js";
|
|
6
|
+
import { assertCollectionChildren } from "../../utils/assert-collection-children.js";
|
|
7
|
+
import { ariaFlag, pickDescriptionAria, splitRootProps } from "../../utils/root-props.js";
|
|
8
|
+
import { InputChip } from "../chip/Chip.js";
|
|
9
|
+
import { renderedDescription } from "../../utils/rendered-description.js";
|
|
10
|
+
import { matchesSearch } from "../../utils/search.js";
|
|
11
|
+
import { DropdownArrow, FieldShell, fieldState } from "../select/field-shell.js";
|
|
12
|
+
import { OptionList, OptionPopover } from "../select/option-list.js";
|
|
13
|
+
import { useSelectionCap } from "../select/selection-cap.js";
|
|
14
|
+
import { useMemo, useRef } from "react";
|
|
15
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { ListKeyboardDelegate, mergeProps, useButton, useComboBox, useFocusRing, useHover, useObjectRef } from "react-aria";
|
|
17
|
+
import { useComboBoxState } from "react-stately/useComboBoxState";
|
|
18
|
+
//#region src/components/autocomplete/Autocomplete.tsx
|
|
19
|
+
/** Elements that keep their own presses; a press anywhere else on the field opens it. */
|
|
20
|
+
const INTERACTIVE = "input, textarea, button, a, [role=\"button\"]";
|
|
21
|
+
const DEFAULT_LABELS = {
|
|
22
|
+
noResults: "No results",
|
|
23
|
+
loading: "Loading options",
|
|
24
|
+
showOptions: "Show options",
|
|
25
|
+
remove: "Remove",
|
|
26
|
+
clear: "Clear",
|
|
27
|
+
error: "Error"
|
|
28
|
+
};
|
|
29
|
+
/** Material Symbols `close`. */
|
|
30
|
+
const ClearIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
31
|
+
viewBox: "0 -960 960 960",
|
|
32
|
+
fill: "currentColor",
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
children: /* @__PURE__ */ jsx("path", { d: "m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" })
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* The arrow's press moves focus to the input (React Aria does it on a touch press) without
|
|
38
|
+
* scrolling the page: a press on a field partly off-screen scrolled it into view
|
|
39
|
+
* (2026-10-15). The input's `focus` asks for `preventScroll` only while the press runs.
|
|
40
|
+
*/
|
|
41
|
+
function withFocusInPlace(input, run) {
|
|
42
|
+
if (!input) return run();
|
|
43
|
+
input.focus = (options) => HTMLElement.prototype.focus.call(input, {
|
|
44
|
+
...options,
|
|
45
|
+
preventScroll: true
|
|
46
|
+
});
|
|
47
|
+
try {
|
|
48
|
+
run();
|
|
49
|
+
} finally {
|
|
50
|
+
Reflect.deleteProperty(input, "focus");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* M3 exposed dropdown menu, editable (Compose's `ExposedDropdownMenuBox` with a
|
|
55
|
+
* `PrimaryEditable` anchor): type in the field and the menu below shows the matching
|
|
56
|
+
* options. Single or multiple selection (chosen options as M3 input chips in the field),
|
|
57
|
+
* accent-insensitive filtering by default, options loaded from a server through `items`,
|
|
58
|
+
* `onInputChange` and `loading`, and free text with `allowCustomValue` (React Aria
|
|
59
|
+
* `useComboBox`).
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* <Autocomplete label="City" defaultItems={cities}>
|
|
63
|
+
* {(city) => <AutocompleteItem key={city.id}>{city.name}</AutocompleteItem>}
|
|
64
|
+
* </Autocomplete>
|
|
65
|
+
*/
|
|
66
|
+
function Autocomplete(props) {
|
|
67
|
+
const { variant = "filled", density, label, placeholder, supportingText, invalid: invalidProp, required: requiredProp, disabled = false, readOnly: readOnlyProp, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, "aria-readonly": ariaReadonly, leadingIcon, errorIcon, clearable = false, maxSelections, loading, labels: labelsProp, className, classNames, style, ref, inputRef: inputRefProp, errorMessage, filter, allowCustomValue, ...otherProps } = props;
|
|
68
|
+
if (typeof props.children !== "function") assertCollectionChildren(props.children, "Autocomplete", "AutocompleteItem and AutocompleteSection elements");
|
|
69
|
+
const { root: rootData, rest } = splitRootProps(otherProps, { wrapper: true });
|
|
70
|
+
const invalid = invalidProp ?? ariaFlag(ariaInvalid);
|
|
71
|
+
const required = requiredProp ?? ariaFlag(ariaRequired);
|
|
72
|
+
const readOnly = readOnlyProp ?? ariaFlag(ariaReadonly) ?? false;
|
|
73
|
+
const labels = {
|
|
74
|
+
...DEFAULT_LABELS,
|
|
75
|
+
...labelsProp
|
|
76
|
+
};
|
|
77
|
+
const stately = rest;
|
|
78
|
+
const multiple = stately.selectionMode === "multiple";
|
|
79
|
+
const cap = useSelectionCap({
|
|
80
|
+
multiple,
|
|
81
|
+
maxSelections,
|
|
82
|
+
value: stately.value,
|
|
83
|
+
defaultValue: stately.defaultValue,
|
|
84
|
+
onChange: stately.onChange
|
|
85
|
+
});
|
|
86
|
+
const inputRef = useObjectRef(inputRefProp);
|
|
87
|
+
const buttonRef = useRef(null);
|
|
88
|
+
const listBoxRef = useRef(null);
|
|
89
|
+
const popoverRef = useRef(null);
|
|
90
|
+
const containerRef = useRef(null);
|
|
91
|
+
usePreloadLoadingIndicator(containerRef, loading !== void 0);
|
|
92
|
+
const ariaProps = {
|
|
93
|
+
...stately,
|
|
94
|
+
...cap.valueProps,
|
|
95
|
+
label,
|
|
96
|
+
description: supportingText,
|
|
97
|
+
errorMessage,
|
|
98
|
+
isInvalid: invalid,
|
|
99
|
+
isRequired: required,
|
|
100
|
+
isDisabled: disabled,
|
|
101
|
+
isReadOnly: readOnly,
|
|
102
|
+
allowsCustomValue: allowCustomValue,
|
|
103
|
+
shouldFocusWrap: true,
|
|
104
|
+
placeholder,
|
|
105
|
+
inputRef,
|
|
106
|
+
buttonRef,
|
|
107
|
+
listBoxRef,
|
|
108
|
+
popoverRef
|
|
109
|
+
};
|
|
110
|
+
const state = useComboBoxState({
|
|
111
|
+
...ariaProps,
|
|
112
|
+
...FOCUSABLE_DISABLED_OPTIONS,
|
|
113
|
+
defaultFilter: filter ?? matchesSearch,
|
|
114
|
+
allowsEmptyCollection: true
|
|
115
|
+
});
|
|
116
|
+
const { collection } = state;
|
|
117
|
+
const { disabledKeys } = state.selectionManager;
|
|
118
|
+
const keyboardDelegate = useMemo(() => new ListKeyboardDelegate({
|
|
119
|
+
collection,
|
|
120
|
+
disabledKeys,
|
|
121
|
+
disabledBehavior: "selection",
|
|
122
|
+
ref: listBoxRef
|
|
123
|
+
}), [collection, disabledKeys]);
|
|
124
|
+
const { buttonProps, inputProps, listBoxProps, labelProps, valueProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails } = useComboBox({
|
|
125
|
+
...ariaProps,
|
|
126
|
+
keyboardDelegate
|
|
127
|
+
}, state);
|
|
128
|
+
const arrowPress = buttonProps.onPress;
|
|
129
|
+
const { buttonProps: arrowProps } = useButton({
|
|
130
|
+
...buttonProps,
|
|
131
|
+
onPress: arrowPress && ((event) => withFocusInPlace(inputRef.current, () => arrowPress(event)))
|
|
132
|
+
}, buttonRef);
|
|
133
|
+
const fingerOnArrowRef = useRef(false);
|
|
134
|
+
const { focusProps, isFocused } = useFocusRing({
|
|
135
|
+
within: true,
|
|
136
|
+
isTextInput: true
|
|
137
|
+
});
|
|
138
|
+
const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
|
|
139
|
+
const chips = multiple ? state.selectedItems : [];
|
|
140
|
+
const removeChip = (key) => state.selectionManager.toggleSelection(key);
|
|
141
|
+
const onKeyDown = (event) => {
|
|
142
|
+
const last = chips.at(-1);
|
|
143
|
+
if (event.key === "Backspace" && state.inputValue === "" && last && !readOnly) {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
removeChip(last.key);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const openOnPress = () => {
|
|
149
|
+
if (!state.isOpen && !disabled && !readOnly && ariaProps.menuTrigger !== "manual") state.open(null, "manual");
|
|
150
|
+
};
|
|
151
|
+
const focused = isFocused || state.isOpen;
|
|
152
|
+
const floated = focused || state.inputValue !== "" || chips.length > 0;
|
|
153
|
+
const showClear = clearable && state.inputValue !== "" && !disabled && !readOnly;
|
|
154
|
+
const clear = () => {
|
|
155
|
+
if (!multiple) state.setValue(null);
|
|
156
|
+
state.setInputValue("");
|
|
157
|
+
inputRef.current?.focus({ preventScroll: true });
|
|
158
|
+
};
|
|
159
|
+
const resolvedError = typeof errorMessage === "function" ? errorMessage({
|
|
160
|
+
isInvalid,
|
|
161
|
+
validationErrors,
|
|
162
|
+
validationDetails
|
|
163
|
+
}) : errorMessage ?? validationErrors.join(" ");
|
|
164
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FieldShell, {
|
|
165
|
+
variant,
|
|
166
|
+
density,
|
|
167
|
+
label,
|
|
168
|
+
labelProps,
|
|
169
|
+
required,
|
|
170
|
+
state: fieldState({
|
|
171
|
+
disabled,
|
|
172
|
+
invalid: isInvalid,
|
|
173
|
+
focused,
|
|
174
|
+
hovered: isHovered
|
|
175
|
+
}),
|
|
176
|
+
floated,
|
|
177
|
+
open: state.isOpen,
|
|
178
|
+
leadingIcon,
|
|
179
|
+
errorIcon,
|
|
180
|
+
errorIconLabel: labels.error,
|
|
181
|
+
readOnly,
|
|
182
|
+
trailing: /* @__PURE__ */ jsxs("button", {
|
|
183
|
+
...arrowProps,
|
|
184
|
+
onPointerDown: (event) => {
|
|
185
|
+
fingerOnArrowRef.current = event.pointerType !== "mouse";
|
|
186
|
+
if (!fingerOnArrowRef.current) return arrowProps.onPointerDown?.(event);
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
},
|
|
189
|
+
onPointerCancel: () => {
|
|
190
|
+
fingerOnArrowRef.current = false;
|
|
191
|
+
},
|
|
192
|
+
onClick: (event) => {
|
|
193
|
+
if (!fingerOnArrowRef.current) return arrowProps.onClick?.(event);
|
|
194
|
+
fingerOnArrowRef.current = false;
|
|
195
|
+
inputRef.current?.focus({ preventScroll: true });
|
|
196
|
+
if (!disabled && !readOnly) state.toggle(null, "manual");
|
|
197
|
+
},
|
|
198
|
+
ref: buttonRef,
|
|
199
|
+
"aria-label": labels.showOptions,
|
|
200
|
+
className: "relative flex size-[40px] items-center justify-center rounded-corner-full outline-none state-layer focus-ring [&>svg]:size-[24px]",
|
|
201
|
+
children: [/* @__PURE__ */ jsx(TouchTarget, {}), /* @__PURE__ */ jsx(DropdownArrow, { open: state.isOpen })]
|
|
202
|
+
}),
|
|
203
|
+
trailingAction: showClear ? /* @__PURE__ */ jsxs("button", {
|
|
204
|
+
type: "button",
|
|
205
|
+
tabIndex: -1,
|
|
206
|
+
"aria-label": labels.clear,
|
|
207
|
+
onPointerDown: (event) => event.preventDefault(),
|
|
208
|
+
onClick: clear,
|
|
209
|
+
className: cn("relative flex size-[40px] items-center justify-center rounded-corner-full text-on-surface-variant outline-none state-layer [&>svg]:size-[24px]", classNames?.clear),
|
|
210
|
+
children: [/* @__PURE__ */ jsx(TouchTarget, {}), /* @__PURE__ */ jsx(ClearIcon, {})]
|
|
211
|
+
}) : null,
|
|
212
|
+
supportingText,
|
|
213
|
+
descriptionProps,
|
|
214
|
+
errorText: resolvedError,
|
|
215
|
+
errorMessageProps,
|
|
216
|
+
showError: isInvalid && Boolean(resolvedError),
|
|
217
|
+
containerRef,
|
|
218
|
+
containerProps: mergeProps(hoverProps, focusProps),
|
|
219
|
+
onContainerPointerDown: (event) => {
|
|
220
|
+
const target = event.target;
|
|
221
|
+
if (event.currentTarget.contains(target) && !target.closest(INTERACTIVE) && !disabled) {
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
inputRef.current?.focus({ preventScroll: true });
|
|
224
|
+
openOnPress();
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
rootProps: rootData,
|
|
228
|
+
rootRef: ref,
|
|
229
|
+
className,
|
|
230
|
+
classNames,
|
|
231
|
+
style,
|
|
232
|
+
multiline: multiple,
|
|
233
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
234
|
+
className: cn("flex min-w-0 flex-1 flex-wrap items-center gap-[8px]", multiple && chips.length > 0 && !(variant === "filled" && label !== void 0 && label !== null) && "-my-[4px]"),
|
|
235
|
+
children: [chips.map((item) => /* @__PURE__ */ jsx(InputChip, {
|
|
236
|
+
density: 0,
|
|
237
|
+
onRemove: () => removeChip(item.key),
|
|
238
|
+
labels: { remove: labels.remove },
|
|
239
|
+
disabled: disabled || readOnly,
|
|
240
|
+
className: classNames?.chip,
|
|
241
|
+
children: item.textValue
|
|
242
|
+
}, item.key)), /* @__PURE__ */ jsx("input", {
|
|
243
|
+
...pickDescriptionAria(rest),
|
|
244
|
+
...inputProps,
|
|
245
|
+
"aria-describedby": renderedDescription(inputProps["aria-describedby"], [
|
|
246
|
+
!supportingText && descriptionProps.id,
|
|
247
|
+
!(isInvalid && resolvedError) && errorMessageProps.id,
|
|
248
|
+
valueProps.id
|
|
249
|
+
]),
|
|
250
|
+
onKeyDown: (event) => {
|
|
251
|
+
onKeyDown(event);
|
|
252
|
+
inputProps.onKeyDown?.(event);
|
|
253
|
+
},
|
|
254
|
+
onClick: (event) => {
|
|
255
|
+
inputProps.onClick?.(event);
|
|
256
|
+
openOnPress();
|
|
257
|
+
},
|
|
258
|
+
ref: inputRef,
|
|
259
|
+
className: cn("min-w-[48px] flex-1 bg-transparent p-0 text-body-large outline-none", "text-[color:var(--_md-comp-text-field-input-text-color)]", "caret-[color:var(--_md-comp-text-field-caret-color)]", "placeholder:text-on-surface-variant placeholder:opacity-100", label ? "placeholder:opacity-0 placeholder:transition-opacity group-data-floated/field:placeholder:opacity-100 placeholder:[transition-duration:var(--md-sys-motion-spring-effects-fast-duration)] placeholder:[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing)]" : "", "group-data-invalid/field:caret-error group-data-[field-state=disabled]/field:text-on-surface/38", classNames?.input)
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
}), /* @__PURE__ */ jsx(OptionPopover, {
|
|
263
|
+
state,
|
|
264
|
+
triggerRef: containerRef,
|
|
265
|
+
popoverRef,
|
|
266
|
+
nonModal: true,
|
|
267
|
+
density,
|
|
268
|
+
children: /* @__PURE__ */ jsx(OptionList, {
|
|
269
|
+
animateFiltering: true,
|
|
270
|
+
listBoxProps,
|
|
271
|
+
state,
|
|
272
|
+
listBoxRef,
|
|
273
|
+
emptyLabel: labels.noResults,
|
|
274
|
+
loading,
|
|
275
|
+
loadingLabel: labels.loading,
|
|
276
|
+
isBlocked: cap.isBlocked,
|
|
277
|
+
classNames
|
|
278
|
+
})
|
|
279
|
+
})] });
|
|
280
|
+
}
|
|
281
|
+
//#endregion
|
|
282
|
+
export { Autocomplete };
|
|
283
|
+
|
|
284
|
+
//# sourceMappingURL=Autocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","names":[],"sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"sourcesContent":["'use client';\n\nimport {\n useMemo,\n useRef,\n type AriaAttributes,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n} from 'react';\nimport {\n mergeProps,\n useButton,\n useComboBox,\n useFocusRing,\n useHover,\n useObjectRef,\n ListKeyboardDelegate,\n type AriaComboBoxOptions,\n} from 'react-aria';\nimport {\n useComboBoxState,\n type ComboBoxProps,\n type ComboBoxStateOptions,\n type SelectionMode,\n} from 'react-stately/useComboBoxState';\nimport { TouchTarget } from '../../primitives/TouchTarget';\nimport { assertCollectionChildren } from '../../utils/assert-collection-children';\nimport type { Density } from '../../tokens/density';\nimport { cn } from '../../utils/cn';\nimport { renderedDescription } from '../../utils/rendered-description';\nimport { matchesSearch } from '../../utils/search';\nimport {\n ariaFlag,\n pickDescriptionAria,\n splitRootProps,\n type WrapperRootDOMProps,\n} from '../../utils/root-props';\nimport { usePreloadLoadingIndicator } from '../loading-indicator/lazy-loading-indicator';\nimport { InputChip } from '../chip/Chip';\nimport {\n DropdownArrow,\n FieldShell,\n fieldState,\n type FieldShellClassNames,\n} from '../select/field-shell';\nimport {\n FOCUSABLE_DISABLED_OPTIONS,\n OptionList,\n OptionPopover,\n type OptionListClassNames,\n} from '../select/option-list';\nimport { useSelectionCap } from '../select/selection-cap';\nimport type { TextFieldVariant } from '../text-field/text-field-styles';\n\n/** Words the Autocomplete shows or announces; override them for other languages. */\nexport interface AutocompleteLabels {\n /** Shown when no option matches what was typed. @default \"No results\" */\n noResults: string;\n /** The loading indicator's name. @default \"Loading options\" */\n loading: string;\n /** The arrow button's name. @default \"Show options\" */\n showOptions: string;\n /** A chip's remove button; the chip's text follows it (\"Remove London\"). @default \"Remove\" */\n remove: string;\n /** With `clearable`: the clear button's name. @default \"Clear\" */\n clear: string;\n /** The error icon's name (M3: \"Error\"). @default \"Error\" */\n error: string;\n}\n\n/** Elements that keep their own presses; a press anywhere else on the field opens it. */\nconst INTERACTIVE = 'input, textarea, button, a, [role=\"button\"]';\n\nconst DEFAULT_LABELS: AutocompleteLabels = {\n noResults: 'No results',\n loading: 'Loading options',\n showOptions: 'Show options',\n remove: 'Remove',\n clear: 'Clear',\n error: 'Error',\n};\n\nexport interface AutocompleteClassNames extends FieldShellClassNames, OptionListClassNames {\n /** The text `<input>`. */\n input?: string;\n /** With `selectionMode=\"multiple\"`: each chosen option's input chip. */\n chip?: string;\n /** With `clearable`: the clear button. */\n clear?: string;\n}\n\n/** Material Symbols `close`. */\nconst ClearIcon = () => (\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" />\n </svg>\n);\n\n/** React Aria props this API names the library's way (`disabled`, `readOnly`…), or leaves out. */\ntype RenamedProps =\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'label'\n | 'description'\n | 'validationState'\n | 'allowsCustomValue'\n // React Stately's deprecated single-selection API; `value` / `defaultValue` / `onChange` replace it.\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'onSelectionChange';\n\nexport type AutocompleteProps<T extends object, M extends SelectionMode = 'single'> = Omit<\n ComboBoxProps<T, M>,\n RenamedProps\n> &\n Pick<AriaComboBoxOptions<T, M>, 'id' | 'name' | 'form'> &\n Omit<WrapperRootDOMProps, keyof ComboBoxProps<T, M>> & {\n /** The `<input>`'s id, for a `<label for>` or an error summary's link. */\n id?: string;\n /** The container style, as `TextField`'s: a filled surface or an outline. @default \"filled\" */\n variant?: TextFieldVariant;\n /**\n * Free text: whatever is typed stays as the field's text when no option matches, instead\n * of returning to the chosen option's. @default false\n */\n allowCustomValue?: boolean;\n /**\n * Web density, `0` to `-3`: each step takes 4px off the field (56px at 0, 44px at -3) and\n * off its menu's options (44px at 0, 32px at -3). Left out, it takes the density of the\n * nearest `ThemeProvider` or `ThemeScope`. M3 asks for density to be the reader's choice\n * rather than a default, so prefer setting it there, from a setting.\n * @default 0\n */\n density?: Density;\n /** The field's label. Give `aria-label` instead when there's no visible label. */\n label?: ReactNode;\n /** Accessible name when there's no visible label. */\n 'aria-label'?: string;\n /** Shown in the empty input. With a `label`, it appears once the label floats (on focus). */\n placeholder?: string;\n /**\n * Helper text below the field. Replaced visually by the error when invalid, and shown in\n * the error colour while the field is invalid.\n */\n supportingText?: ReactNode;\n /** Marks the field invalid (in addition to `validate` and `required`). */\n invalid?: boolean;\n /** A value is required: adds the `*` to the label and validates on submit. */\n required?: boolean;\n /** Disables the field: it can't be focused or edited. @default false */\n disabled?: boolean;\n /** The value can be read and copied but not changed; the menu doesn't open. @default false */\n readOnly?: boolean;\n /**\n * Read as `invalid` when that's left out, for a form library that sets the attribute, so\n * the field shows its error state as well as announcing it.\n */\n 'aria-invalid'?: AriaAttributes['aria-invalid'];\n /** Read as `required` when that's left out, for a form library that sets the attribute. */\n 'aria-required'?: AriaAttributes['aria-required'];\n /** Read as `readOnly` when that's left out, for a form library that sets the attribute. */\n 'aria-readonly'?: AriaAttributes['aria-readonly'];\n /** Decorative icon at the start, in a 48px box. */\n leadingIcon?: ReactNode;\n /**\n * The icon shown before the arrow while the field is invalid (M3 strongly recommends one).\n * Defaults to Material Symbols `error`, named by `labels.error`; `false` turns it off.\n */\n errorIcon?: ReactNode | false;\n /**\n * A clear button (M3's clear icon) that appears while there's typed text and empties it,\n * and a single choice with it. It's skipped by Tab, since the text can be deleted from\n * the keyboard.\n * @default false\n */\n clearable?: boolean;\n /**\n * With `selectionMode=\"multiple\"`, the most options that can be chosen; the rest show as\n * disabled until one is removed.\n */\n maxSelections?: number;\n /**\n * Shows a loading indicator in the list, e.g. while options load for what was typed.\n * The indicator's code loads when it first shows, and ahead of that when the field is\n * hovered or focused while this prop is set at all, so pass `loading={false}` (rather than\n * leaving it out) on a field that loads options.\n */\n loading?: boolean;\n /**\n * Whether an option matches what was typed. Defaults to a match anywhere in its text,\n * ignoring case and accents (\"zurich\" finds \"Zürich\"). Not used with controlled `items`.\n */\n filter?: (textValue: string, inputValue: string) => boolean;\n /** Words the Autocomplete shows or announces, for other languages. */\n labels?: Partial<AutocompleteLabels>;\n /** Classes for the root element, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Classes for each part, by slot. */\n classNames?: AutocompleteClassNames;\n /** Inline styles for the root element. */\n style?: CSSProperties;\n /** Ref to the root `<div>` element. Use `inputRef` for the input itself. */\n ref?: Ref<HTMLDivElement>;\n /** Ref to the text `<input>`, e.g. for form libraries. */\n inputRef?: Ref<HTMLInputElement>;\n };\n\n/**\n * The arrow's press moves focus to the input (React Aria does it on a touch press) without\n * scrolling the page: a press on a field partly off-screen scrolled it into view\n * (2026-10-15). The input's `focus` asks for `preventScroll` only while the press runs.\n */\nfunction withFocusInPlace(input: HTMLInputElement | null, run: () => void) {\n if (!input) return run();\n input.focus = (options) =>\n HTMLElement.prototype.focus.call(input, { ...options, preventScroll: true });\n try {\n run();\n } finally {\n Reflect.deleteProperty(input, 'focus');\n }\n}\n\n/**\n * M3 exposed dropdown menu, editable (Compose's `ExposedDropdownMenuBox` with a\n * `PrimaryEditable` anchor): type in the field and the menu below shows the matching\n * options. Single or multiple selection (chosen options as M3 input chips in the field),\n * accent-insensitive filtering by default, options loaded from a server through `items`,\n * `onInputChange` and `loading`, and free text with `allowCustomValue` (React Aria\n * `useComboBox`).\n *\n * @example\n * <Autocomplete label=\"City\" defaultItems={cities}>\n * {(city) => <AutocompleteItem key={city.id}>{city.name}</AutocompleteItem>}\n * </Autocomplete>\n */\nexport function Autocomplete<T extends object, M extends SelectionMode = 'single'>(\n props: AutocompleteProps<T, M>,\n) {\n const {\n variant = 'filled',\n density,\n label,\n placeholder,\n supportingText,\n invalid: invalidProp,\n required: requiredProp,\n disabled = false,\n readOnly: readOnlyProp,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n 'aria-readonly': ariaReadonly,\n leadingIcon,\n errorIcon,\n clearable = false,\n maxSelections,\n loading,\n labels: labelsProp,\n className,\n classNames,\n style,\n ref,\n inputRef: inputRefProp,\n errorMessage,\n filter,\n allowCustomValue,\n ...otherProps\n } = props;\n // Items given as elements (not `items` with a render function) must come from a client.\n if (typeof props.children !== 'function') {\n assertCollectionChildren(\n props.children,\n 'Autocomplete',\n 'AutocompleteItem and AutocompleteSection elements',\n );\n }\n const { root: rootData, rest } = splitRootProps(otherProps, { wrapper: true });\n const invalid = invalidProp ?? ariaFlag(ariaInvalid);\n const required = requiredProp ?? ariaFlag(ariaRequired);\n const readOnly = readOnlyProp ?? ariaFlag(ariaReadonly) ?? false;\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const stately = rest as Omit<ComboBoxProps<T, M>, RenamedProps>;\n const multiple = stately.selectionMode === 'multiple';\n const cap = useSelectionCap({\n multiple,\n maxSelections,\n value: stately.value,\n defaultValue: stately.defaultValue,\n onChange: stately.onChange,\n });\n\n const inputRef = useObjectRef(inputRefProp);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const listBoxRef = useRef<HTMLUListElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n // A field that takes `loading` (it loads options) preloads the indicator on hover or focus.\n usePreloadLoadingIndicator(containerRef, loading !== undefined);\n\n const ariaProps = {\n ...stately,\n ...cap.valueProps,\n label,\n description: supportingText,\n errorMessage,\n isInvalid: invalid,\n isRequired: required,\n isDisabled: disabled,\n isReadOnly: readOnly,\n allowsCustomValue: allowCustomValue,\n // The arrow keys wrap at the ends of the list, as in menus and lists.\n shouldFocusWrap: true,\n placeholder,\n inputRef,\n buttonRef,\n listBoxRef,\n popoverRef,\n } as AriaComboBoxOptions<T, M>;\n\n const state = useComboBoxState<T, M>({\n ...(ariaProps as unknown as ComboBoxStateOptions<T, M>),\n ...FOCUSABLE_DISABLED_OPTIONS,\n defaultFilter: filter ?? matchesSearch,\n allowsEmptyCollection: true,\n });\n const { collection } = state;\n const { disabledKeys } = state.selectionManager;\n const keyboardDelegate = useMemo(\n () =>\n new ListKeyboardDelegate({\n collection,\n disabledKeys,\n disabledBehavior: 'selection',\n ref: listBoxRef,\n }),\n [collection, disabledKeys],\n );\n const {\n buttonProps,\n inputProps,\n listBoxProps,\n labelProps,\n valueProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails,\n } = useComboBox<T, M>(\n {\n ...ariaProps,\n // The input's arrow keys reach disabled options too (M3: they \"can receive focus\").\n keyboardDelegate,\n },\n state,\n );\n const arrowPress = buttonProps.onPress;\n const { buttonProps: arrowProps } = useButton(\n {\n ...buttonProps,\n onPress:\n arrowPress && ((event) => withFocusInPlace(inputRef.current, () => arrowPress(event))),\n },\n buttonRef,\n );\n // A touch on the arrow, opening the list on its click (see the arrow's handlers).\n const fingerOnArrowRef = useRef(false);\n const { focusProps, isFocused } = useFocusRing({ within: true, isTextInput: true });\n const { hoverProps, isHovered } = useHover({ isDisabled: disabled });\n\n const chips = multiple ? state.selectedItems : [];\n const removeChip = (key: string | number) => state.selectionManager.toggleSelection(key);\n // Backspace in an empty input removes the last chip, as in other chip inputs.\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n const last = chips.at(-1);\n if (event.key === 'Backspace' && state.inputValue === '' && last && !readOnly) {\n event.preventDefault();\n removeChip(last.key);\n }\n };\n\n // M3: \"A menu should open when a person … Selects an element, such as … a text field\", as\n // Compose's editable anchor opens on press. A press on the input or the field opens the\n // whole list, as the arrow does; keyboard focus alone doesn't (unless `menuTrigger=\"focus\"`),\n // and `menuTrigger=\"manual\"` leaves opening to the arrow and the arrow keys.\n const openOnPress = () => {\n if (!state.isOpen && !disabled && !readOnly && ariaProps.menuTrigger !== 'manual') {\n state.open(null, 'manual');\n }\n };\n\n const focused = isFocused || state.isOpen;\n const floated = focused || state.inputValue !== '' || chips.length > 0;\n const showClear = clearable && state.inputValue !== '' && !disabled && !readOnly;\n const clear = () => {\n if (!multiple) state.setValue(null);\n state.setInputValue('');\n // Back to the input in the same field, without scrolling the page (2026-10-15).\n inputRef.current?.focus({ preventScroll: true });\n };\n const resolvedError =\n typeof errorMessage === 'function'\n ? errorMessage({ isInvalid, validationErrors, validationDetails })\n : (errorMessage ?? validationErrors.join(' '));\n\n return (\n <>\n <FieldShell\n variant={variant}\n density={density}\n label={label}\n labelProps={labelProps}\n required={required}\n state={fieldState({ disabled, invalid: isInvalid, focused, hovered: isHovered })}\n floated={floated}\n open={state.isOpen}\n leadingIcon={leadingIcon}\n errorIcon={errorIcon}\n errorIconLabel={labels.error}\n readOnly={readOnly}\n trailing={\n <button\n {...arrowProps}\n // A finger opens the list on the click, with focus in the input. React Aria's\n // touch press never ended here in Chrome (the list stayed closed), and the mouse\n // events a tap emulates focused the arrow, out of the Tab order (2026-10-17). So a\n // touch keeps both away from the arrow; the mouse and the keyboard keep React\n // Aria's press, which opens on the press start.\n onPointerDown={(event) => {\n fingerOnArrowRef.current = event.pointerType !== 'mouse';\n if (!fingerOnArrowRef.current) return arrowProps.onPointerDown?.(event);\n event.preventDefault();\n }}\n onPointerCancel={() => {\n fingerOnArrowRef.current = false;\n }}\n onClick={(event) => {\n if (!fingerOnArrowRef.current) return arrowProps.onClick?.(event);\n fingerOnArrowRef.current = false;\n inputRef.current?.focus({ preventScroll: true });\n if (!disabled && !readOnly) state.toggle(null, 'manual');\n }}\n ref={buttonRef}\n aria-label={labels.showOptions}\n className=\"relative flex size-[40px] items-center justify-center rounded-corner-full outline-none state-layer focus-ring [&>svg]:size-[24px]\"\n >\n <TouchTarget />\n <DropdownArrow open={state.isOpen} />\n </button>\n }\n trailingAction={\n showClear ? (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={labels.clear}\n // Keeps focus (and the open menu) in the input.\n onPointerDown={(event) => event.preventDefault()}\n onClick={clear}\n className={cn(\n 'relative flex size-[40px] items-center justify-center rounded-corner-full text-on-surface-variant outline-none state-layer [&>svg]:size-[24px]',\n classNames?.clear,\n )}\n >\n <TouchTarget />\n <ClearIcon />\n </button>\n ) : null\n }\n supportingText={supportingText}\n descriptionProps={descriptionProps}\n errorText={resolvedError}\n errorMessageProps={errorMessageProps}\n showError={isInvalid && Boolean(resolvedError)}\n containerRef={containerRef}\n containerProps={mergeProps(hoverProps, focusProps)}\n onContainerPointerDown={(event) => {\n // A press anywhere on the field (its padding, a chip's label, the space between\n // chips) puts the caret in the input and opens the menu, as TextField and Select\n // react to the whole field. The input opens on its own click, and the buttons (the\n // arrow, clear, a chip's remove) keep their own presses. Presses in the menu reach\n // here through React's tree from its portal, and are left alone.\n const target = event.target as Element;\n if (event.currentTarget.contains(target) && !target.closest(INTERACTIVE) && !disabled) {\n event.preventDefault();\n // The field is where the press landed: the page never scrolls to it (2026-10-15).\n inputRef.current?.focus({ preventScroll: true });\n openOnPress();\n }\n }}\n rootProps={rootData}\n rootRef={ref}\n className={className}\n classNames={classNames}\n style={style}\n multiline={multiple}\n >\n <div\n className={cn(\n 'flex min-w-0 flex-1 flex-wrap items-center gap-[8px]',\n // A row of 32px input chips fits the 56px container (12px above and below), so a\n // first chip doesn't make the field taller and each further row adds 40px. A filled\n // field's floated label takes the top 24px, so there the row stays below it.\n multiple &&\n chips.length > 0 &&\n !(variant === 'filled' && label !== undefined && label !== null) &&\n '-my-[4px]',\n )}\n >\n {chips.map((item) => (\n <InputChip\n key={item.key}\n // The field's own density sets its padding around one 32px row of chips, so the\n // chips keep their size (the field's height is what density changes here).\n density={0}\n onRemove={() => removeChip(item.key)}\n labels={{ remove: labels.remove }}\n disabled={disabled || readOnly}\n className={classNames?.chip}\n >\n {item.textValue}\n </InputChip>\n ))}\n <input\n {...pickDescriptionAria(rest)}\n {...inputProps}\n aria-describedby={renderedDescription(inputProps['aria-describedby'], [\n !supportingText && descriptionProps.id,\n !(isInvalid && resolvedError) && errorMessageProps.id,\n // React Aria's element for the chosen values, which the chips show instead.\n valueProps.id,\n ])}\n onKeyDown={(event) => {\n onKeyDown(event);\n inputProps.onKeyDown?.(event);\n }}\n onClick={(event) => {\n inputProps.onClick?.(event);\n openOnPress();\n }}\n ref={inputRef}\n className={cn(\n // A zero flex basis with a 48px minimum: the input shares the chips' last row\n // while 48px are left there, and wraps to a row of its own only below that.\n 'min-w-[48px] flex-1 bg-transparent p-0 text-body-large outline-none',\n 'text-[color:var(--_md-comp-text-field-input-text-color)]',\n 'caret-[color:var(--_md-comp-text-field-caret-color)]',\n 'placeholder:text-on-surface-variant placeholder:opacity-100',\n label\n ? 'placeholder:opacity-0 placeholder:transition-opacity group-data-floated/field:placeholder:opacity-100 placeholder:[transition-duration:var(--md-sys-motion-spring-effects-fast-duration)] placeholder:[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing)]'\n : '',\n 'group-data-invalid/field:caret-error group-data-[field-state=disabled]/field:text-on-surface/38',\n classNames?.input,\n )}\n />\n </div>\n </FieldShell>\n <OptionPopover\n state={state}\n triggerRef={containerRef}\n popoverRef={popoverRef}\n nonModal\n density={density}\n >\n <OptionList\n animateFiltering\n listBoxProps={listBoxProps}\n state={state}\n listBoxRef={listBoxRef}\n emptyLabel={labels.noResults}\n loading={loading}\n loadingLabel={labels.loading}\n isBlocked={cap.isBlocked}\n classNames={classNames}\n />\n </OptionPopover>\n </>\n );\n}\n\nexport type { Key as AutocompleteKey } from 'react-stately';\n"],"mappings":"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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
2
|
+
//#region src/components/badge/Badge.d.ts
|
|
3
|
+
/** Words a {@link Badge} announces. */
|
|
4
|
+
export interface BadgeLabels {
|
|
5
|
+
/** What a small badge (a dot) announces. @default "New notification" */
|
|
6
|
+
newNotification: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BadgeClassNames {
|
|
9
|
+
/** The badge itself: the dot, or the large badge's container. */
|
|
10
|
+
root?: string;
|
|
11
|
+
/** The large badge's text, which truncates at the badge's maximum width. */
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BadgeProps extends Omit<ComponentPropsWithRef<'span'>, 'children'> {
|
|
15
|
+
/**
|
|
16
|
+
* A count or a short label (large badge); leave it out for the small dot. Numbers are
|
|
17
|
+
* formatted for the locale and capped at `max` ("999+"). M3 allows four characters,
|
|
18
|
+
* including the "+"; text badges stop at 34px wide and truncate longer text.
|
|
19
|
+
*/
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
/** The highest count shown; larger counts show as `max` + "+". @default 999 */
|
|
22
|
+
max?: number;
|
|
23
|
+
/**
|
|
24
|
+
* What assistive tech reads instead of the visible content, e.g. "3 unread messages".
|
|
25
|
+
* Without it, a large badge reads its content and a small one `labels.newNotification`.
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Words the badge announces, with English defaults. */
|
|
29
|
+
labels?: Partial<BadgeLabels>;
|
|
30
|
+
/** Classes for each part, by slot. `classNames.root` is merged with `className`. */
|
|
31
|
+
classNames?: BadgeClassNames;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* M3 badge: a small 6px dot, or a large 16px badge holding a count or a short label, in
|
|
35
|
+
* `error` colours. Place it on an icon with {@link BadgedBox}. It is announced: a count is
|
|
36
|
+
* read, a dot reads "New notification" (`labels`), and `label` replaces either.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <Badge />
|
|
40
|
+
* <Badge>{3}</Badge>
|
|
41
|
+
* <Badge max={99}>{120}</Badge> // "99+"
|
|
42
|
+
*/
|
|
43
|
+
export declare function Badge({ children, max, label, labels, classNames, className, ...rest }: BadgeProps): import("react").JSX.Element;
|
|
44
|
+
export interface BadgedBoxClassNames {
|
|
45
|
+
/** The wrapper that positions the badge over its anchor. */
|
|
46
|
+
root?: string;
|
|
47
|
+
/** The wrapper around the anchor (`children`). */
|
|
48
|
+
anchor?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface BadgedBoxProps extends Omit<ComponentPropsWithRef<'span'>, 'children'> {
|
|
51
|
+
/** The badge, a {@link Badge}. */
|
|
52
|
+
badge: ReactElement<BadgeProps>;
|
|
53
|
+
/** The anchor, usually an icon. */
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
/** Classes for each part, by slot. `classNames.root` is merged with `className`. */
|
|
56
|
+
classNames?: BadgedBoxClassNames;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Places a badge at the top end of its anchor (Compose's `BadgedBox`), e.g. on an icon.
|
|
60
|
+
* The badge's announcement is part of the text around it; an anchor named with its own
|
|
61
|
+
* `aria-label` should say what the badge means.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <IconButton
|
|
65
|
+
* aria-label="Messages, 3 unread"
|
|
66
|
+
* icon={<BadgedBox badge={<Badge>{3}</Badge>}><MailIcon /></BadgedBox>}
|
|
67
|
+
* />
|
|
68
|
+
*/
|
|
69
|
+
export declare function BadgedBox({ badge, children, classNames, className, ...rest }: BadgedBoxProps): import("react").JSX.Element;
|
|
70
|
+
//#endregion
|
|
71
|
+
//# sourceMappingURL=Badge.d.ts.map
|