@windmorph/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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":"natural-size.js","names":[],"sources":["../../src/utils/natural-size.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useLayoutEffect, useRef, useState } from 'react';\n\n/**\n * Measures an element's natural length on one axis (its used `width` or `height`, in\n * fractional px and untouched by transforms, as a scaled-down hidden FAB is), again whenever\n * it resizes, so a wrapper can animate its own width or height between 0 and that length.\n * A length in px lets a spring's overshoot show, which a `0fr ↔ 1fr` grid track can't (it\n * never passes its content's size). The element must keep its natural size while the\n * wrapper is closed (`w-max` / `h-max`, or `shrink-0`). The size is `undefined` until\n * measured (and on the server), so the wrapper can fall back to its natural size.\n *\n * `resized` is true for one frame after the content itself changed size (a web font\n * arriving, new text): the wrapper should follow it at once (`data-resized`, no\n * transition), as a grid track would, instead of springing to it.\n */\nexport function useNaturalSize<T extends HTMLElement = HTMLElement>(\n axis: 'width' | 'height' = 'width',\n enabled = true,\n) {\n const ref = useRef<T>(null);\n const [size, setSize] = useState<number>();\n const [resized, setResized] = useState(false);\n useLayoutEffect(() => {\n const element = ref.current;\n if (!enabled || !element) return;\n let measured: number | undefined;\n const measure = () => {\n const used = parseFloat(getComputedStyle(element)[axis]);\n const next = Number.isNaN(used) ? undefined : used;\n if (next === measured) return;\n if (measured !== undefined) setResized(true);\n measured = next;\n setSize(next);\n };\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [axis, enabled]);\n useEffect(() => {\n if (!resized) return;\n const frame = requestAnimationFrame(() => setResized(false));\n return () => cancelAnimationFrame(frame);\n }, [resized, size]);\n return [ref, size, resized] as const;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAAgB,eACd,OAA2B,SAC3B,UAAU,MACV;CACA,MAAM,MAAM,OAAU,IAAI;CAC1B,MAAM,CAAC,MAAM,WAAW,SAAiB;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,sBAAsB;EACpB,MAAM,UAAU,IAAI;EACpB,IAAI,CAAC,WAAW,CAAC,SAAS;EAC1B,IAAI;EACJ,MAAM,gBAAgB;GACpB,MAAM,OAAO,WAAW,iBAAiB,OAAO,CAAC,CAAC,KAAK;GACvD,MAAM,OAAO,OAAO,MAAM,IAAI,IAAI,KAAA,IAAY;GAC9C,IAAI,SAAS,UAAU;GACvB,IAAI,aAAa,KAAA,GAAW,WAAW,IAAI;GAC3C,WAAW;GACX,QAAQ,IAAI;EACd;EACA,QAAQ;EACR,IAAI,OAAO,mBAAmB,aAAa;EAC3C,MAAM,WAAW,IAAI,eAAe,OAAO;EAC3C,SAAS,QAAQ,OAAO;EACxB,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,MAAM,OAAO,CAAC;CAClB,gBAAgB;EACd,IAAI,CAAC,SAAS;EACd,MAAM,QAAQ,4BAA4B,WAAW,KAAK,CAAC;EAC3D,aAAa,qBAAqB,KAAK;CACzC,GAAG,CAAC,SAAS,IAAI,CAAC;CAClB,OAAO;EAAC;EAAK;EAAM;CAAO;AAC5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
//#region src/utils/nearest-reveal.ts
|
|
3
|
+
/**
|
|
4
|
+
* Arrow keys must not jump the page. When keyboard focus moves to an item, React Aria
|
|
5
|
+
* reveals it by calling `scrollIntoView({ block: 'center', inline: 'center' })` on the
|
|
6
|
+
* collection's root whenever the root isn't wholly on screen, which scrolls every ancestor,
|
|
7
|
+
* the window included, to centre the root (176px for a tab row, 200px for a list taller
|
|
8
|
+
* than the window), and then reveals the item. The root's own `scrollIntoView` asks for the
|
|
9
|
+
* nearest position instead, so the page moves only as far as the item needs (2026-10-15).
|
|
10
|
+
*/
|
|
11
|
+
function useNearestReveal(rootRef) {
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
const root = rootRef.current;
|
|
14
|
+
if (!root) return;
|
|
15
|
+
root.scrollIntoView = (arg) => Element.prototype.scrollIntoView?.call(root, typeof arg === "object" ? {
|
|
16
|
+
...arg,
|
|
17
|
+
block: "nearest",
|
|
18
|
+
inline: "nearest"
|
|
19
|
+
} : arg);
|
|
20
|
+
return () => {
|
|
21
|
+
Reflect.deleteProperty(root, "scrollIntoView");
|
|
22
|
+
};
|
|
23
|
+
}, [rootRef]);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useNearestReveal };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=nearest-reveal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nearest-reveal.js","names":[],"sources":["../../src/utils/nearest-reveal.ts"],"sourcesContent":["import { useLayoutEffect, type RefObject } from 'react';\n\n/**\n * Arrow keys must not jump the page. When keyboard focus moves to an item, React Aria\n * reveals it by calling `scrollIntoView({ block: 'center', inline: 'center' })` on the\n * collection's root whenever the root isn't wholly on screen, which scrolls every ancestor,\n * the window included, to centre the root (176px for a tab row, 200px for a list taller\n * than the window), and then reveals the item. The root's own `scrollIntoView` asks for the\n * nearest position instead, so the page moves only as far as the item needs (2026-10-15).\n */\nexport function useNearestReveal(rootRef: RefObject<HTMLElement | null>) {\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n root.scrollIntoView = (arg?: boolean | ScrollIntoViewOptions) =>\n Element.prototype.scrollIntoView?.call(\n root,\n typeof arg === 'object' ? { ...arg, block: 'nearest', inline: 'nearest' } : arg,\n );\n return () => {\n Reflect.deleteProperty(root, 'scrollIntoView');\n };\n }, [rootRef]);\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAgB,iBAAiB,SAAwC;CACvE,sBAAsB;EACpB,MAAM,OAAO,QAAQ;EACrB,IAAI,CAAC,MAAM;EACX,KAAK,kBAAkB,QACrB,QAAQ,UAAU,gBAAgB,KAChC,MACA,OAAO,QAAQ,WAAW;GAAE,GAAG;GAAK,OAAO;GAAW,QAAQ;EAAU,IAAI,GAC9E;EACF,aAAa;GACX,QAAQ,eAAe,MAAM,gBAAgB;EAC/C;CACF,GAAG,CAAC,OAAO,CAAC;AACd"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/placement.ts
|
|
2
|
+
/**
|
|
3
|
+
* React Aria's placement for one of ours: a hyphenated, logical value (`'bottom-start'`, as
|
|
4
|
+
* Floating UI and most libraries write it) becomes its spaced, physical form (`'bottom left'`),
|
|
5
|
+
* resolving `start` / `end` from the laid-out direction, since React Aria reads its locale
|
|
6
|
+
* rather than the DOM's `dir`.
|
|
7
|
+
*/
|
|
8
|
+
function toAriaPlacement(placement, rtl) {
|
|
9
|
+
return placement.replace("-", " ").replace("start", rtl ? "right" : "left").replace("end", rtl ? "left" : "right");
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { toAriaPlacement };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.js","names":[],"sources":["../../src/utils/placement.ts"],"sourcesContent":["import type { Placement } from 'react-aria';\n\n/**\n * React Aria's placement for one of ours: a hyphenated, logical value (`'bottom-start'`, as\n * Floating UI and most libraries write it) becomes its spaced, physical form (`'bottom left'`),\n * resolving `start` / `end` from the laid-out direction, since React Aria reads its locale\n * rather than the DOM's `dir`.\n */\nexport function toAriaPlacement(placement: string, rtl: boolean): Placement {\n return placement\n .replace('-', ' ')\n .replace('start', rtl ? 'right' : 'left')\n .replace('end', rtl ? 'left' : 'right') as Placement;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,gBAAgB,WAAmB,KAAyB;CAC1E,OAAO,UACJ,QAAQ,KAAK,GAAG,CAAC,CACjB,QAAQ,SAAS,MAAM,UAAU,MAAM,CAAC,CACxC,QAAQ,OAAO,MAAM,SAAS,OAAO;AAC1C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { hasModifier, isRtl, moveFor, target } from "./composite-keys.js";
|
|
2
|
+
import { tabbables } from "./focus.js";
|
|
3
|
+
//#region src/utils/radio-group-keys.ts
|
|
4
|
+
/** A group's radios that can be checked, in order. */
|
|
5
|
+
function radios(root) {
|
|
6
|
+
return [...root.querySelectorAll("[role=\"radio\"]")].filter((radio) => !radio.matches(":disabled, [aria-disabled=\"true\"]") && !radio.closest("[hidden], [inert]") && (!("checkVisibility" in radio) || radio.checkVisibility()));
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The WAI-ARIA APG radio group keys, for a single-selection group of toggle buttons with
|
|
10
|
+
* `role="radio"`: every arrow key moves to the next or previous radio and checks it,
|
|
11
|
+
* wrapping at the ends (left and right follow the laid-out direction), and Home and End
|
|
12
|
+
* check the first and last. The radio is checked with a click, as a native radio's arrow
|
|
13
|
+
* keys do, so its press handlers run. Other controls in the group (a button group's overflow
|
|
14
|
+
* button) stay on the arrow keys' path without being checked, as in the APG toolbar that
|
|
15
|
+
* holds a radio group. Returns whether the key was handled.
|
|
16
|
+
*/
|
|
17
|
+
function radioGroupKeyDown(event) {
|
|
18
|
+
const root = event.currentTarget;
|
|
19
|
+
const from = event.target;
|
|
20
|
+
if (hasModifier(event) || from.matches("textarea, [contenteditable]:not([contenteditable=\"false\"]), input:not([type=\"button\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"submit\"], [type=\"reset\"], [type=\"image\"], [type=\"range\"], [type=\"color\"], [type=\"file\"])")) return false;
|
|
21
|
+
const move = moveFor(event.key, "both", isRtl(root));
|
|
22
|
+
if (move === null) return false;
|
|
23
|
+
const choices = radios(root);
|
|
24
|
+
const items = [.../* @__PURE__ */ new Set([...tabbables(root), ...choices])].sort((a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
25
|
+
const current = items.findIndex((item) => item === from || item.contains(from));
|
|
26
|
+
if (current < 0) return false;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
const next = target(items, current, move);
|
|
30
|
+
if (!next || next === items[current]) return true;
|
|
31
|
+
next.focus();
|
|
32
|
+
if (choices.includes(next) && next.getAttribute("aria-checked") !== "true") next.click();
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
/** Groups a pointer is pressing in: focus there comes from the press, not from Tab. */
|
|
36
|
+
const pressed = /* @__PURE__ */ new WeakSet();
|
|
37
|
+
/**
|
|
38
|
+
* For a radio group's `onPointerDownCapture`: marks the group as pressed until the pointer
|
|
39
|
+
* lifts, so `focusCheckedRadio` leaves the focus the press gives where it lands.
|
|
40
|
+
*/
|
|
41
|
+
function notePointerDown(event) {
|
|
42
|
+
const root = event.currentTarget;
|
|
43
|
+
pressed.add(root);
|
|
44
|
+
const release = () => {
|
|
45
|
+
setTimeout(() => pressed.delete(root));
|
|
46
|
+
};
|
|
47
|
+
for (const type of ["pointerup", "pointercancel"]) root.ownerDocument.addEventListener(type, release, {
|
|
48
|
+
once: true,
|
|
49
|
+
capture: true
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Tab into a radio group lands on its checked radio (WAI-ARIA APG), for the group's
|
|
54
|
+
* `onFocus`: when keyboard focus arrives from outside on another radio, it moves to the
|
|
55
|
+
* checked one. A pointer press keeps focus on the radio it lands on (the group's
|
|
56
|
+
* `onPointerDownCapture` calls `notePointerDown`): moving it would select one radio while
|
|
57
|
+
* focusing another, and scroll the page to the checked one (2026-10-15).
|
|
58
|
+
* Returns whether the group has a checked radio (so the caller's own focus restoring
|
|
59
|
+
* applies only when it hasn't).
|
|
60
|
+
*/
|
|
61
|
+
function focusCheckedRadio(event) {
|
|
62
|
+
const root = event.currentTarget;
|
|
63
|
+
const from = event.relatedTarget;
|
|
64
|
+
if (from && root.contains(from)) return false;
|
|
65
|
+
const checked = radios(root).find((radio) => radio.getAttribute("aria-checked") === "true");
|
|
66
|
+
if (!checked) return false;
|
|
67
|
+
if (pressed.has(root)) return true;
|
|
68
|
+
if (checked !== event.target && event.target.matches("[role=\"radio\"]")) checked.focus();
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { focusCheckedRadio, notePointerDown, radioGroupKeyDown };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=radio-group-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group-keys.js","names":[],"sources":["../../src/utils/radio-group-keys.ts"],"sourcesContent":["import type { FocusEvent, KeyboardEvent, PointerEvent } from 'react';\nimport { hasModifier, isRtl, moveFor, target, TEXT_ENTRY } from './composite-keys';\nimport { tabbables } from './focus';\n\n/** A group's radios that can be checked, in order. */\nfunction radios(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>('[role=\"radio\"]')].filter(\n (radio) =>\n !radio.matches(':disabled, [aria-disabled=\"true\"]') &&\n !radio.closest('[hidden], [inert]') &&\n (!('checkVisibility' in radio) || radio.checkVisibility()),\n );\n}\n\n/**\n * The WAI-ARIA APG radio group keys, for a single-selection group of toggle buttons with\n * `role=\"radio\"`: every arrow key moves to the next or previous radio and checks it,\n * wrapping at the ends (left and right follow the laid-out direction), and Home and End\n * check the first and last. The radio is checked with a click, as a native radio's arrow\n * keys do, so its press handlers run. Other controls in the group (a button group's overflow\n * button) stay on the arrow keys' path without being checked, as in the APG toolbar that\n * holds a radio group. Returns whether the key was handled.\n */\nexport function radioGroupKeyDown(event: KeyboardEvent<HTMLElement>) {\n const root = event.currentTarget;\n const from = event.target as HTMLElement;\n if (hasModifier(event) || from.matches(TEXT_ENTRY)) return false;\n const move = moveFor(event.key, 'both', isRtl(root));\n if (move === null) return false;\n const choices = radios(root);\n const items = [...new Set([...tabbables(root), ...choices])].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1,\n );\n const current = items.findIndex((item) => item === from || item.contains(from));\n if (current < 0) return false;\n event.preventDefault();\n event.stopPropagation();\n const next = target(items, current, move);\n if (!next || next === items[current]) return true;\n next.focus();\n if (choices.includes(next) && next.getAttribute('aria-checked') !== 'true') next.click();\n return true;\n}\n\n/** Groups a pointer is pressing in: focus there comes from the press, not from Tab. */\nconst pressed = new WeakSet<HTMLElement>();\n\n/**\n * For a radio group's `onPointerDownCapture`: marks the group as pressed until the pointer\n * lifts, so `focusCheckedRadio` leaves the focus the press gives where it lands.\n */\nexport function notePointerDown(event: PointerEvent<HTMLElement>) {\n const root = event.currentTarget;\n pressed.add(root);\n const release = () => {\n // After the press's own focus and click handlers.\n setTimeout(() => pressed.delete(root));\n };\n for (const type of ['pointerup', 'pointercancel'] as const) {\n root.ownerDocument.addEventListener(type, release, { once: true, capture: true });\n }\n}\n\n/**\n * Tab into a radio group lands on its checked radio (WAI-ARIA APG), for the group's\n * `onFocus`: when keyboard focus arrives from outside on another radio, it moves to the\n * checked one. A pointer press keeps focus on the radio it lands on (the group's\n * `onPointerDownCapture` calls `notePointerDown`): moving it would select one radio while\n * focusing another, and scroll the page to the checked one (2026-10-15).\n * Returns whether the group has a checked radio (so the caller's own focus restoring\n * applies only when it hasn't).\n */\nexport function focusCheckedRadio(event: FocusEvent<HTMLElement>): boolean {\n const root = event.currentTarget;\n const from = event.relatedTarget as Node | null;\n if (from && root.contains(from)) return false;\n const checked = radios(root).find((radio) => radio.getAttribute('aria-checked') === 'true');\n if (!checked) return false;\n if (pressed.has(root)) return true;\n if (checked !== event.target && (event.target as Element).matches('[role=\"radio\"]'))\n checked.focus();\n return true;\n}\n"],"mappings":";;;;AAKA,SAAS,OAAO,MAAkC;CAChD,OAAO,CAAC,GAAG,KAAK,iBAA8B,kBAAgB,CAAC,CAAC,CAAC,QAC9D,UACC,CAAC,MAAM,QAAQ,qCAAmC,KAClD,CAAC,MAAM,QAAQ,mBAAmB,MACjC,EAAE,qBAAqB,UAAU,MAAM,gBAAgB,EAC5D;AACF;;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAmC;CACnE,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM;CACnB,IAAI,YAAY,KAAK,KAAK,KAAK,QAAA,+OAAkB,GAAG,OAAO;CAC3D,MAAM,OAAO,QAAQ,MAAM,KAAK,QAAQ,MAAM,IAAI,CAAC;CACnD,IAAI,SAAS,MAAM,OAAO;CAC1B,MAAM,UAAU,OAAO,IAAI;CAC3B,MAAM,QAAQ,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,IAAI,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MACpE,EAAE,wBAAwB,CAAC,IAAI,KAAK,8BAA8B,KAAK,CACzE;CACA,MAAM,UAAU,MAAM,WAAW,SAAS,SAAS,QAAQ,KAAK,SAAS,IAAI,CAAC;CAC9E,IAAI,UAAU,GAAG,OAAO;CACxB,MAAM,eAAe;CACrB,MAAM,gBAAgB;CACtB,MAAM,OAAO,OAAO,OAAO,SAAS,IAAI;CACxC,IAAI,CAAC,QAAQ,SAAS,MAAM,UAAU,OAAO;CAC7C,KAAK,MAAM;CACX,IAAI,QAAQ,SAAS,IAAI,KAAK,KAAK,aAAa,cAAc,MAAM,QAAQ,KAAK,MAAM;CACvF,OAAO;AACT;;AAGA,MAAM,0BAAU,IAAI,QAAqB;;;;;AAMzC,SAAgB,gBAAgB,OAAkC;CAChE,MAAM,OAAO,MAAM;CACnB,QAAQ,IAAI,IAAI;CAChB,MAAM,gBAAgB;EAEpB,iBAAiB,QAAQ,OAAO,IAAI,CAAC;CACvC;CACA,KAAK,MAAM,QAAQ,CAAC,aAAa,eAAe,GAC9C,KAAK,cAAc,iBAAiB,MAAM,SAAS;EAAE,MAAM;EAAM,SAAS;CAAK,CAAC;AAEpF;;;;;;;;;;AAWA,SAAgB,kBAAkB,OAAyC;CACzE,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM;CACnB,IAAI,QAAQ,KAAK,SAAS,IAAI,GAAG,OAAO;CACxC,MAAM,UAAU,OAAO,IAAI,CAAC,CAAC,MAAM,UAAU,MAAM,aAAa,cAAc,MAAM,MAAM;CAC1F,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI,QAAQ,IAAI,IAAI,GAAG,OAAO;CAC9B,IAAI,YAAY,MAAM,UAAW,MAAM,OAAmB,QAAQ,kBAAgB,GAChF,QAAQ,MAAM;CAChB,OAAO;AACT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/utils/rendered-description.ts
|
|
2
|
+
/**
|
|
3
|
+
* A field's `aria-describedby` without the ids of the parts it doesn't render (2026-10-24).
|
|
4
|
+
* React Aria's field hooks name the description and error ids through `useSlotId`, which drops
|
|
5
|
+
* an id whose element isn't in the page only after it mounts: on the server it can't tell, so
|
|
6
|
+
* the server's HTML pointed at a supporting text or error that wasn't there until hydration.
|
|
7
|
+
* `unrendered` lists the ids of the parts this render leaves out (falsy entries are ignored).
|
|
8
|
+
*/
|
|
9
|
+
function renderedDescription(describedBy, unrendered) {
|
|
10
|
+
if (!describedBy) return void 0;
|
|
11
|
+
const missing = new Set(unrendered.filter(Boolean));
|
|
12
|
+
return describedBy.split(/\s+/).filter((id) => id && !missing.has(id)).join(" ") || void 0;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { renderedDescription };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=rendered-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendered-description.js","names":[],"sources":["../../src/utils/rendered-description.ts"],"sourcesContent":["/**\n * A field's `aria-describedby` without the ids of the parts it doesn't render (2026-10-24).\n * React Aria's field hooks name the description and error ids through `useSlotId`, which drops\n * an id whose element isn't in the page only after it mounts: on the server it can't tell, so\n * the server's HTML pointed at a supporting text or error that wasn't there until hydration.\n * `unrendered` lists the ids of the parts this render leaves out (falsy entries are ignored).\n */\nexport function renderedDescription(\n describedBy: string | undefined,\n unrendered: readonly (string | false | null | undefined)[],\n): string | undefined {\n if (!describedBy) return undefined;\n const missing = new Set(unrendered.filter(Boolean));\n return (\n describedBy\n .split(/\\s+/)\n .filter((id) => id && !missing.has(id))\n .join(' ') || undefined\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,oBACd,aACA,YACoB;CACpB,IAAI,CAAC,aAAa,OAAO,KAAA;CACzB,MAAM,UAAU,IAAI,IAAI,WAAW,OAAO,OAAO,CAAC;CAClD,OACE,YACG,MAAM,KAAK,CAAC,CACZ,QAAQ,OAAO,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CACtC,KAAK,GAAG,KAAK,KAAA;AAEpB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AriaAttributes, DOMAttributes, HTMLAttributes } from "react";
|
|
2
|
+
//#region src/utils/root-props.d.ts
|
|
3
|
+
/** The naming attributes React Aria puts on the element it labels (a field's input, a tablist). */
|
|
4
|
+
type Labelling = 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-details' | 'aria-errormessage';
|
|
5
|
+
/**
|
|
6
|
+
* The attributes that describe a widget's own state and relations (2026-10-17): what it controls
|
|
7
|
+
* and whether it opens a popup, its autocompletion and active descendant, whether it is
|
|
8
|
+
* expanded, required, invalid or read-only, and a text box's `aria-multiline` and
|
|
9
|
+
* `aria-placeholder`. They belong on the widget, never on a wrapper (ARIA doesn't allow them on
|
|
10
|
+
* a generic `div` or a `label`).
|
|
11
|
+
*/
|
|
12
|
+
export type WidgetAria = 'aria-controls' | 'aria-haspopup' | 'aria-autocomplete' | 'aria-activedescendant' | 'aria-expanded' | 'aria-required' | 'aria-invalid' | 'aria-readonly' | 'aria-multiline' | 'aria-placeholder';
|
|
13
|
+
/**
|
|
14
|
+
* The naming and description attributes React Aria's hooks don't forward (2026-10-24): a plain
|
|
15
|
+
* text description, a role description and the braille label and role description. Like the
|
|
16
|
+
* naming attributes, they belong on the element React Aria labels: ARIA prohibits
|
|
17
|
+
* `aria-roledescription` and the braille attributes on a generic `div`, and a description there
|
|
18
|
+
* describes nothing. A component takes them in its props, as {@link RootDOMProps} does; where
|
|
19
|
+
* the root wraps the labelled element, {@link splitRootProps} keeps them in `rest` and
|
|
20
|
+
* {@link pickWidgetAria} hands them over.
|
|
21
|
+
*/
|
|
22
|
+
export type DescriptionAria = 'aria-description' | 'aria-roledescription' | 'aria-braillelabel' | 'aria-brailleroledescription';
|
|
23
|
+
/** Events about the whole component: pointer, mouse, touch, drag, wheel, scroll, animation. */
|
|
24
|
+
export type RootEvent = 'onClick' | 'onAuxClick' | 'onContextMenu' | 'onDoubleClick' | `onMouse${'Down' | 'Enter' | 'Leave' | 'Move' | 'Out' | 'Over' | 'Up'}` | `onPointer${'Down' | 'Move' | 'Up' | 'Cancel' | 'Enter' | 'Leave' | 'Over' | 'Out'}` | 'onGotPointerCapture' | 'onLostPointerCapture' | `onTouch${'Start' | 'Move' | 'End' | 'Cancel'}` | `onDrag${'' | 'End' | 'Enter' | 'Exit' | 'Leave' | 'Over' | 'Start'}` | 'onDrop' | 'onWheel' | 'onScroll' | `onAnimation${'Start' | 'End' | 'Iteration'}` | `onTransition${'Start' | 'Run' | 'End' | 'Cancel'}`;
|
|
25
|
+
/** Global HTML attributes about the whole component. */
|
|
26
|
+
type Global = 'title' | 'lang' | 'dir' | 'hidden' | 'inert' | 'translate' | 'draggable';
|
|
27
|
+
/**
|
|
28
|
+
* The DOM attributes a component passes to its root when its other props go to a React Aria
|
|
29
|
+
* hook (2026-10-17): `data-*`, `aria-*` but the naming ones, global attributes and
|
|
30
|
+
* {@link RootEvent}s. The {@link DescriptionAria} attributes are among them, for a root that is
|
|
31
|
+
* the labelled element; a wrapper hands them to that element instead. The naming attributes, focus, key and input events (which would fire twice
|
|
32
|
+
* as they bubble from the element the hook manages) and React Aria's callbacks stay with the hook.
|
|
33
|
+
*/
|
|
34
|
+
export type RootDOMProps<E extends Element = HTMLDivElement> = Pick<DOMAttributes<E>, Extract<keyof DOMAttributes<E>, RootEvent | `${RootEvent}Capture`>> & Omit<AriaAttributes, Labelling> & Pick<HTMLAttributes<E>, Global>;
|
|
35
|
+
/**
|
|
36
|
+
* {@link RootDOMProps} for a component whose root wraps the element React Aria labels (a
|
|
37
|
+
* field's input, a checkbox's input, a select's trigger, a tab list): without the
|
|
38
|
+
* {@link WidgetAria} attributes, which describe that element. A component that lets the app set
|
|
39
|
+
* them takes them in its own props and puts them on that element. The {@link DescriptionAria}
|
|
40
|
+
* attributes stay in the type: they reach that element through {@link pickWidgetAria}.
|
|
41
|
+
*/
|
|
42
|
+
export type WrapperRootDOMProps<E extends Element = HTMLDivElement> = Omit<RootDOMProps<E>, WidgetAria>;
|
|
43
|
+
/** Options for {@link splitRootProps}. */
|
|
44
|
+
export interface SplitRootPropsOptions {
|
|
45
|
+
/**
|
|
46
|
+
* The root wraps the element React Aria labels (see {@link WrapperRootDOMProps}), so the
|
|
47
|
+
* {@link WidgetAria} and {@link DescriptionAria} attributes stay in `rest`, for that element,
|
|
48
|
+
* instead of going to the root.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
wrapper?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** What {@link splitRootProps} returns. */
|
|
54
|
+
export interface SplitRootProps<Rest> {
|
|
55
|
+
/**
|
|
56
|
+
* `data-*`, `aria-*` but the naming ones (and, for a wrapper, the {@link WidgetAria} and
|
|
57
|
+
* {@link DescriptionAria} ones), global attributes and root events.
|
|
58
|
+
*/
|
|
59
|
+
root: Record<string, unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* Everything else, for the hook. Its type leaves out what went to `root`: for a wrapper, the
|
|
62
|
+
* widget and description attributes stay in it.
|
|
63
|
+
*/
|
|
64
|
+
rest: Rest;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Splits a component's {@link RootDOMProps} (and every `data-*` attribute) from the props for its
|
|
68
|
+
* React Aria hook, for a component whose hook forwards only the attributes it knows. Spread
|
|
69
|
+
* `root` on the root element (merging its handlers with the hook's, React Aria's `mergeProps`)
|
|
70
|
+
* and pass `rest` to the hook. A component whose hook labels the root itself (a radio group, a
|
|
71
|
+
* slider's group) merges both there. One whose root wraps the labelled element passes
|
|
72
|
+
* `{ wrapper: true }`, so the attributes that describe that element (`aria-controls`,
|
|
73
|
+
* `aria-expanded`, `aria-invalid` …, {@link WidgetAria}, and `aria-description` …,
|
|
74
|
+
* {@link DescriptionAria}) stay with it; React Aria's hooks forward only some of them, so
|
|
75
|
+
* {@link pickWidgetAria} hands over the rest.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const { root, rest } = splitRootProps(props, { wrapper: true });
|
|
79
|
+
* const { labelProps, inputProps } = useTextField(rest, inputRef);
|
|
80
|
+
* return (
|
|
81
|
+
* <div {...root}>
|
|
82
|
+
* <input {...mergeProps(inputProps, pickWidgetAria(rest))} />
|
|
83
|
+
* </div>
|
|
84
|
+
* );
|
|
85
|
+
*/
|
|
86
|
+
export declare function splitRootProps<T extends object>(props: T, options: SplitRootPropsOptions & {
|
|
87
|
+
wrapper: true;
|
|
88
|
+
}): SplitRootProps<Omit<T, Exclude<keyof WrapperRootDOMProps, DescriptionAria> | `data-${string}`>>;
|
|
89
|
+
export declare function splitRootProps<T extends object>(props: T, options?: SplitRootPropsOptions): SplitRootProps<Omit<T, keyof RootDOMProps | `data-${string}`>>;
|
|
90
|
+
/**
|
|
91
|
+
* The {@link WidgetAria} and {@link DescriptionAria} attributes among `props`, for the element
|
|
92
|
+
* React Aria labels: a hook forwards only those it knows (a text field's `aria-controls`, but not
|
|
93
|
+
* its `aria-expanded` or `aria-description`), so a wrapper component merges these with the
|
|
94
|
+
* hook's own props.
|
|
95
|
+
*/
|
|
96
|
+
export declare function pickWidgetAria(props: object): Pick<AriaAttributes, WidgetAria | DescriptionAria>;
|
|
97
|
+
/**
|
|
98
|
+
* The {@link DescriptionAria} attributes among `props`, for a wrapper that sets every
|
|
99
|
+
* {@link WidgetAria} attribute of its labelled element itself (a select's trigger, a tab list).
|
|
100
|
+
*/
|
|
101
|
+
export declare function pickDescriptionAria(props: object): Pick<AriaAttributes, DescriptionAria>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//# sourceMappingURL=root-props.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/utils/root-props.ts
|
|
2
|
+
/** {@link RootEvent} and its capture form, at run time. */
|
|
3
|
+
const ROOT_EVENT = /^on(?:Click|AuxClick|ContextMenu|DoubleClick|Mouse(?:Down|Enter|Leave|Move|Out|Over|Up)|Pointer(?:Down|Move|Up|Cancel|Enter|Leave|Over|Out)|(?:Got|Lost)PointerCapture|Touch(?:Start|Move|End|Cancel)|Drag(?:End|Enter|Exit|Leave|Over|Start)?|Drop|Wheel|Scroll|Animation(?:Start|End|Iteration)|Transition(?:Start|Run|End|Cancel))(?:Capture)?$/;
|
|
4
|
+
const LABELLING = /^aria-(?:label|labelledby|describedby|details|errormessage)$/;
|
|
5
|
+
const WIDGET_ARIA = /^aria-(?:controls|haspopup|autocomplete|activedescendant|expanded|required|invalid|readonly|multiline|placeholder)$/;
|
|
6
|
+
const DESCRIPTION_ARIA = /^aria-(?:description|roledescription|braillelabel|brailleroledescription)$/;
|
|
7
|
+
const GLOBAL = /^(?:title|lang|dir|hidden|inert|translate|draggable)$/;
|
|
8
|
+
function splitRootProps(props, options = {}) {
|
|
9
|
+
const root = {};
|
|
10
|
+
const rest = {};
|
|
11
|
+
for (const [key, value] of Object.entries(props)) if (key.startsWith("data-") || key.startsWith("aria-") && !LABELLING.test(key) && !(options.wrapper && (WIDGET_ARIA.test(key) || DESCRIPTION_ARIA.test(key))) || GLOBAL.test(key) || ROOT_EVENT.test(key)) root[key] = value;
|
|
12
|
+
else rest[key] = value;
|
|
13
|
+
return {
|
|
14
|
+
root,
|
|
15
|
+
rest
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The {@link WidgetAria} and {@link DescriptionAria} attributes among `props`, for the element
|
|
20
|
+
* React Aria labels: a hook forwards only those it knows (a text field's `aria-controls`, but not
|
|
21
|
+
* its `aria-expanded` or `aria-description`), so a wrapper component merges these with the
|
|
22
|
+
* hook's own props.
|
|
23
|
+
*/
|
|
24
|
+
function pickWidgetAria(props) {
|
|
25
|
+
const picked = {};
|
|
26
|
+
for (const [key, value] of Object.entries(props)) if ((WIDGET_ARIA.test(key) || DESCRIPTION_ARIA.test(key)) && value !== void 0) picked[key] = value;
|
|
27
|
+
return picked;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The {@link DescriptionAria} attributes among `props`, for a wrapper that sets every
|
|
31
|
+
* {@link WidgetAria} attribute of its labelled element itself (a select's trigger, a tab list).
|
|
32
|
+
*/
|
|
33
|
+
function pickDescriptionAria(props) {
|
|
34
|
+
const picked = {};
|
|
35
|
+
for (const [key, value] of Object.entries(props)) if (DESCRIPTION_ARIA.test(key) && value !== void 0) picked[key] = value;
|
|
36
|
+
return picked;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* An `aria-invalid`, `aria-required` or `aria-readonly` value as a field's own boolean state, for
|
|
40
|
+
* a field that sets these attributes itself and reads an app's (a form library's) as its
|
|
41
|
+
* `invalid`, `required` or `readOnly`: `undefined` when left out, `false` for `false` or
|
|
42
|
+
* `"false"`, and `true` for anything else (`aria-invalid="grammar"` too).
|
|
43
|
+
*/
|
|
44
|
+
function ariaFlag(value) {
|
|
45
|
+
if (value === void 0) return void 0;
|
|
46
|
+
return value !== false && value !== "false";
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ariaFlag, pickDescriptionAria, pickWidgetAria, splitRootProps };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=root-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-props.js","names":[],"sources":["../../src/utils/root-props.ts"],"sourcesContent":["import type { AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';\n\n/** The naming attributes React Aria puts on the element it labels (a field's input, a tablist). */\ntype Labelling =\n 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-details' | 'aria-errormessage';\n\n/**\n * The attributes that describe a widget's own state and relations (2026-10-17): what it controls\n * and whether it opens a popup, its autocompletion and active descendant, whether it is\n * expanded, required, invalid or read-only, and a text box's `aria-multiline` and\n * `aria-placeholder`. They belong on the widget, never on a wrapper (ARIA doesn't allow them on\n * a generic `div` or a `label`).\n */\nexport type WidgetAria =\n | 'aria-controls'\n | 'aria-haspopup'\n | 'aria-autocomplete'\n | 'aria-activedescendant'\n | 'aria-expanded'\n | 'aria-required'\n | 'aria-invalid'\n | 'aria-readonly'\n | 'aria-multiline'\n | 'aria-placeholder';\n\n/**\n * The naming and description attributes React Aria's hooks don't forward (2026-10-24): a plain\n * text description, a role description and the braille label and role description. Like the\n * naming attributes, they belong on the element React Aria labels: ARIA prohibits\n * `aria-roledescription` and the braille attributes on a generic `div`, and a description there\n * describes nothing. A component takes them in its props, as {@link RootDOMProps} does; where\n * the root wraps the labelled element, {@link splitRootProps} keeps them in `rest` and\n * {@link pickWidgetAria} hands them over.\n */\nexport type DescriptionAria =\n 'aria-description' | 'aria-roledescription' | 'aria-braillelabel' | 'aria-brailleroledescription';\n\n/** Events about the whole component: pointer, mouse, touch, drag, wheel, scroll, animation. */\nexport type RootEvent =\n | 'onClick'\n | 'onAuxClick'\n | 'onContextMenu'\n | 'onDoubleClick'\n | `onMouse${'Down' | 'Enter' | 'Leave' | 'Move' | 'Out' | 'Over' | 'Up'}`\n | `onPointer${'Down' | 'Move' | 'Up' | 'Cancel' | 'Enter' | 'Leave' | 'Over' | 'Out'}`\n | 'onGotPointerCapture'\n | 'onLostPointerCapture'\n | `onTouch${'Start' | 'Move' | 'End' | 'Cancel'}`\n | `onDrag${'' | 'End' | 'Enter' | 'Exit' | 'Leave' | 'Over' | 'Start'}`\n | 'onDrop'\n | 'onWheel'\n | 'onScroll'\n | `onAnimation${'Start' | 'End' | 'Iteration'}`\n | `onTransition${'Start' | 'Run' | 'End' | 'Cancel'}`;\n\n/** Global HTML attributes about the whole component. */\ntype Global = 'title' | 'lang' | 'dir' | 'hidden' | 'inert' | 'translate' | 'draggable';\n\n/** {@link RootEvent} and its capture form, at run time. */\nconst ROOT_EVENT =\n /^on(?:Click|AuxClick|ContextMenu|DoubleClick|Mouse(?:Down|Enter|Leave|Move|Out|Over|Up)|Pointer(?:Down|Move|Up|Cancel|Enter|Leave|Over|Out)|(?:Got|Lost)PointerCapture|Touch(?:Start|Move|End|Cancel)|Drag(?:End|Enter|Exit|Leave|Over|Start)?|Drop|Wheel|Scroll|Animation(?:Start|End|Iteration)|Transition(?:Start|Run|End|Cancel))(?:Capture)?$/;\nconst LABELLING = /^aria-(?:label|labelledby|describedby|details|errormessage)$/;\nconst WIDGET_ARIA =\n /^aria-(?:controls|haspopup|autocomplete|activedescendant|expanded|required|invalid|readonly|multiline|placeholder)$/;\nconst DESCRIPTION_ARIA =\n /^aria-(?:description|roledescription|braillelabel|brailleroledescription)$/;\nconst GLOBAL = /^(?:title|lang|dir|hidden|inert|translate|draggable)$/;\n\n/**\n * The DOM attributes a component passes to its root when its other props go to a React Aria\n * hook (2026-10-17): `data-*`, `aria-*` but the naming ones, global attributes and\n * {@link RootEvent}s. The {@link DescriptionAria} attributes are among them, for a root that is\n * the labelled element; a wrapper hands them to that element instead. The naming attributes, focus, key and input events (which would fire twice\n * as they bubble from the element the hook manages) and React Aria's callbacks stay with the hook.\n */\nexport type RootDOMProps<E extends Element = HTMLDivElement> = Pick<\n DOMAttributes<E>,\n Extract<keyof DOMAttributes<E>, RootEvent | `${RootEvent}Capture`>\n> &\n Omit<AriaAttributes, Labelling> &\n Pick<HTMLAttributes<E>, Global>;\n\n/**\n * {@link RootDOMProps} for a component whose root wraps the element React Aria labels (a\n * field's input, a checkbox's input, a select's trigger, a tab list): without the\n * {@link WidgetAria} attributes, which describe that element. A component that lets the app set\n * them takes them in its own props and puts them on that element. The {@link DescriptionAria}\n * attributes stay in the type: they reach that element through {@link pickWidgetAria}.\n */\nexport type WrapperRootDOMProps<E extends Element = HTMLDivElement> = Omit<\n RootDOMProps<E>,\n WidgetAria\n>;\n\n/** Options for {@link splitRootProps}. */\nexport interface SplitRootPropsOptions {\n /**\n * The root wraps the element React Aria labels (see {@link WrapperRootDOMProps}), so the\n * {@link WidgetAria} and {@link DescriptionAria} attributes stay in `rest`, for that element,\n * instead of going to the root.\n * @default false\n */\n wrapper?: boolean;\n}\n\n/** What {@link splitRootProps} returns. */\nexport interface SplitRootProps<Rest> {\n /**\n * `data-*`, `aria-*` but the naming ones (and, for a wrapper, the {@link WidgetAria} and\n * {@link DescriptionAria} ones), global attributes and root events.\n */\n root: Record<string, unknown>;\n /**\n * Everything else, for the hook. Its type leaves out what went to `root`: for a wrapper, the\n * widget and description attributes stay in it.\n */\n rest: Rest;\n}\n\n/**\n * Splits a component's {@link RootDOMProps} (and every `data-*` attribute) from the props for its\n * React Aria hook, for a component whose hook forwards only the attributes it knows. Spread\n * `root` on the root element (merging its handlers with the hook's, React Aria's `mergeProps`)\n * and pass `rest` to the hook. A component whose hook labels the root itself (a radio group, a\n * slider's group) merges both there. One whose root wraps the labelled element passes\n * `{ wrapper: true }`, so the attributes that describe that element (`aria-controls`,\n * `aria-expanded`, `aria-invalid` …, {@link WidgetAria}, and `aria-description` …,\n * {@link DescriptionAria}) stay with it; React Aria's hooks forward only some of them, so\n * {@link pickWidgetAria} hands over the rest.\n *\n * @example\n * const { root, rest } = splitRootProps(props, { wrapper: true });\n * const { labelProps, inputProps } = useTextField(rest, inputRef);\n * return (\n * <div {...root}>\n * <input {...mergeProps(inputProps, pickWidgetAria(rest))} />\n * </div>\n * );\n */\nexport function splitRootProps<T extends object>(\n props: T,\n options: SplitRootPropsOptions & { wrapper: true },\n): SplitRootProps<Omit<T, Exclude<keyof WrapperRootDOMProps, DescriptionAria> | `data-${string}`>>;\nexport function splitRootProps<T extends object>(\n props: T,\n options?: SplitRootPropsOptions,\n): SplitRootProps<Omit<T, keyof RootDOMProps | `data-${string}`>>;\nexport function splitRootProps<T extends object>(\n props: T,\n options: SplitRootPropsOptions = {},\n): SplitRootProps<Partial<T>> {\n const root: Record<string, unknown> = {};\n const rest: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n const toRoot =\n key.startsWith('data-') ||\n (key.startsWith('aria-') &&\n !LABELLING.test(key) &&\n !(options.wrapper && (WIDGET_ARIA.test(key) || DESCRIPTION_ARIA.test(key)))) ||\n GLOBAL.test(key) ||\n ROOT_EVENT.test(key);\n if (toRoot) root[key] = value;\n else rest[key] = value;\n }\n return { root, rest: rest as Partial<T> };\n}\n\n/**\n * The {@link WidgetAria} and {@link DescriptionAria} attributes among `props`, for the element\n * React Aria labels: a hook forwards only those it knows (a text field's `aria-controls`, but not\n * its `aria-expanded` or `aria-description`), so a wrapper component merges these with the\n * hook's own props.\n */\nexport function pickWidgetAria(props: object): Pick<AriaAttributes, WidgetAria | DescriptionAria> {\n const picked: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n if ((WIDGET_ARIA.test(key) || DESCRIPTION_ARIA.test(key)) && value !== undefined) {\n picked[key] = value;\n }\n }\n return picked as Pick<AriaAttributes, WidgetAria | DescriptionAria>;\n}\n\n/**\n * The {@link DescriptionAria} attributes among `props`, for a wrapper that sets every\n * {@link WidgetAria} attribute of its labelled element itself (a select's trigger, a tab list).\n */\nexport function pickDescriptionAria(props: object): Pick<AriaAttributes, DescriptionAria> {\n const picked: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n if (DESCRIPTION_ARIA.test(key) && value !== undefined) picked[key] = value;\n }\n return picked as Pick<AriaAttributes, DescriptionAria>;\n}\n\n/**\n * An `aria-invalid`, `aria-required` or `aria-readonly` value as a field's own boolean state, for\n * a field that sets these attributes itself and reads an app's (a form library's) as its\n * `invalid`, `required` or `readOnly`: `undefined` when left out, `false` for `false` or\n * `\"false\"`, and `true` for anything else (`aria-invalid=\"grammar\"` too).\n */\nexport function ariaFlag(value: AriaAttributes['aria-invalid']): boolean | undefined {\n if (value === undefined) return undefined;\n return value !== false && value !== 'false';\n}\n"],"mappings":";;AA2DA,MAAM,aACJ;AACF,MAAM,YAAY;AAClB,MAAM,cACJ;AACF,MAAM,mBACJ;AACF,MAAM,SAAS;AAiFf,SAAgB,eACd,OACA,UAAiC,CAAC,GACN;CAC5B,MAAM,OAAgC,CAAC;CACvC,MAAM,OAAgC,CAAC;CACvC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAQ7C,IANE,IAAI,WAAW,OAAO,KACrB,IAAI,WAAW,OAAO,KACrB,CAAC,UAAU,KAAK,GAAG,KACnB,EAAE,QAAQ,YAAY,YAAY,KAAK,GAAG,KAAK,iBAAiB,KAAK,GAAG,OAC1E,OAAO,KAAK,GAAG,KACf,WAAW,KAAK,GAAG,GACT,KAAK,OAAO;MACnB,KAAK,OAAO;CAEnB,OAAO;EAAE;EAAY;CAAmB;AAC1C;;;;;;;AAQA,SAAgB,eAAe,OAAmE;CAChG,MAAM,SAAkC,CAAC;CACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,KAAK,YAAY,KAAK,GAAG,KAAK,iBAAiB,KAAK,GAAG,MAAM,UAAU,KAAA,GACrE,OAAO,OAAO;CAGlB,OAAO;AACT;;;;;AAMA,SAAgB,oBAAoB,OAAsD;CACxF,MAAM,SAAkC,CAAC;CACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,IAAI,iBAAiB,KAAK,GAAG,KAAK,UAAU,KAAA,GAAW,OAAO,OAAO;CAEvE,OAAO;AACT;;;;;;;AAQA,SAAgB,SAAS,OAA4D;CACnF,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,OAAO,UAAU,SAAS,UAAU;AACtC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/utils/search.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lower case without accents, so a search for "zurich" finds "Zürich" and "cote" finds
|
|
4
|
+
* "Côte d'Ivoire". `đ` (a letter of its own in Croatian, not a d with an
|
|
5
|
+
* accent) is folded to `d` too, so "dakovo" finds "Đakovo".
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeSearch(text: string): string;
|
|
8
|
+
/** Whether `text` contains `query`, ignoring case and accents. An empty query matches all. */
|
|
9
|
+
export declare function matchesSearch(text: string, query: string): boolean;
|
|
10
|
+
//#endregion
|
|
11
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/utils/search.ts
|
|
2
|
+
/**
|
|
3
|
+
* Lower case without accents, so a search for "zurich" finds "Zürich" and "cote" finds
|
|
4
|
+
* "Côte d'Ivoire". `đ` (a letter of its own in Croatian, not a d with an
|
|
5
|
+
* accent) is folded to `d` too, so "dakovo" finds "Đakovo".
|
|
6
|
+
*/
|
|
7
|
+
function normalizeSearch(text) {
|
|
8
|
+
return text.normalize("NFD").replace(/\p{M}/gu, "").replace(/đ/gi, "d").toLowerCase().trim();
|
|
9
|
+
}
|
|
10
|
+
/** Whether `text` contains `query`, ignoring case and accents. An empty query matches all. */
|
|
11
|
+
function matchesSearch(text, query) {
|
|
12
|
+
const search = normalizeSearch(query);
|
|
13
|
+
return search === "" || normalizeSearch(text).includes(search);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { matchesSearch, normalizeSearch };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","names":[],"sources":["../../src/utils/search.ts"],"sourcesContent":["/**\n * Lower case without accents, so a search for \"zurich\" finds \"Zürich\" and \"cote\" finds\n * \"Côte d'Ivoire\". `đ` (a letter of its own in Croatian, not a d with an\n * accent) is folded to `d` too, so \"dakovo\" finds \"Đakovo\".\n */\nexport function normalizeSearch(text: string): string {\n return text.normalize('NFD').replace(/\\p{M}/gu, '').replace(/đ/gi, 'd').toLowerCase().trim();\n}\n\n/** Whether `text` contains `query`, ignoring case and accents. An empty query matches all. */\nexport function matchesSearch(text: string, query: string): boolean {\n const search = normalizeSearch(query);\n return search === '' || normalizeSearch(text).includes(search);\n}\n"],"mappings":";;;;;;AAKA,SAAgB,gBAAgB,MAAsB;CACpD,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK;AAC7F;;AAGA,SAAgB,cAAc,MAAc,OAAwB;CAClE,MAAM,SAAS,gBAAgB,KAAK;CACpC,OAAO,WAAW,MAAM,gBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM;AAC/D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/utils/shortcut.ts
|
|
2
|
+
/** A key combination such as `"Alt+G"` or `"Control+Shift+K"`, matched against an event. */
|
|
3
|
+
function matchesShortcut(event, shortcut) {
|
|
4
|
+
const parts = shortcut.split("+").map((part) => part.trim().toLowerCase());
|
|
5
|
+
const key = parts.pop();
|
|
6
|
+
if (!key) return false;
|
|
7
|
+
const wants = (name) => parts.includes(name);
|
|
8
|
+
if (event.altKey !== wants("alt")) return false;
|
|
9
|
+
if (event.ctrlKey !== (wants("control") || wants("ctrl"))) return false;
|
|
10
|
+
if (event.shiftKey !== wants("shift")) return false;
|
|
11
|
+
if (event.metaKey !== (wants("meta") || wants("cmd"))) return false;
|
|
12
|
+
if (event.key.toLowerCase() === key) return true;
|
|
13
|
+
if (/^[a-z]$/.test(key)) return event.code === `Key${key.toUpperCase()}`;
|
|
14
|
+
if (/^[0-9]$/.test(key)) return event.code === `Digit${key}`;
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { matchesShortcut };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcut.js","names":[],"sources":["../../src/utils/shortcut.ts"],"sourcesContent":["/** A key combination such as `\"Alt+G\"` or `\"Control+Shift+K\"`, matched against an event. */\nexport function matchesShortcut(event: KeyboardEvent, shortcut: string): boolean {\n const parts = shortcut.split('+').map((part) => part.trim().toLowerCase());\n const key = parts.pop();\n if (!key) return false;\n const wants = (name: string) => parts.includes(name);\n if (event.altKey !== wants('alt')) return false;\n if (event.ctrlKey !== (wants('control') || wants('ctrl'))) return false;\n if (event.shiftKey !== wants('shift')) return false;\n if (event.metaKey !== (wants('meta') || wants('cmd'))) return false;\n // Alt changes the character on some layouts (Alt+G types \"©\" on a Mac), so letters and\n // digits match the physical key too.\n if (event.key.toLowerCase() === key) return true;\n if (/^[a-z]$/.test(key)) return event.code === `Key${key.toUpperCase()}`;\n if (/^[0-9]$/.test(key)) return event.code === `Digit${key}`;\n return false;\n}\n"],"mappings":";;AACA,SAAgB,gBAAgB,OAAsB,UAA2B;CAC/E,MAAM,QAAQ,SAAS,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,YAAY,CAAC;CACzE,MAAM,MAAM,MAAM,IAAI;CACtB,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,SAAS,SAAiB,MAAM,SAAS,IAAI;CACnD,IAAI,MAAM,WAAW,MAAM,KAAK,GAAG,OAAO;CAC1C,IAAI,MAAM,aAAa,MAAM,SAAS,KAAK,MAAM,MAAM,IAAI,OAAO;CAClE,IAAI,MAAM,aAAa,MAAM,OAAO,GAAG,OAAO;CAC9C,IAAI,MAAM,aAAa,MAAM,MAAM,KAAK,MAAM,KAAK,IAAI,OAAO;CAG9D,IAAI,MAAM,IAAI,YAAY,MAAM,KAAK,OAAO;CAC5C,IAAI,UAAU,KAAK,GAAG,GAAG,OAAO,MAAM,SAAS,MAAM,IAAI,YAAY;CACrE,IAAI,UAAU,KAAK,GAAG,GAAG,OAAO,MAAM,SAAS,QAAQ;CACvD,OAAO;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/utils/split-data-attributes.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Splits `data-*` attributes from the rest of a component's props. Components that
|
|
4
|
+
* pass their remaining props to a React Aria hook (which forwards only what it knows to
|
|
5
|
+
* the input) use this to put `data-*` attributes on their root, next to `className`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function splitDataAttributes<T extends object>(props: T): {
|
|
8
|
+
data: Record<`data-${string}`, unknown>;
|
|
9
|
+
rest: Omit<T, `data-${string}`>;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=split-data-attributes.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/utils/split-data-attributes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Splits `data-*` attributes from the rest of a component's props. Components that
|
|
4
|
+
* pass their remaining props to a React Aria hook (which forwards only what it knows to
|
|
5
|
+
* the input) use this to put `data-*` attributes on their root, next to `className`.
|
|
6
|
+
*/
|
|
7
|
+
function splitDataAttributes(props) {
|
|
8
|
+
const data = {};
|
|
9
|
+
const rest = {};
|
|
10
|
+
for (const [key, value] of Object.entries(props)) if (key.startsWith("data-")) data[key] = value;
|
|
11
|
+
else rest[key] = value;
|
|
12
|
+
return {
|
|
13
|
+
data,
|
|
14
|
+
rest
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { splitDataAttributes };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=split-data-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-data-attributes.js","names":[],"sources":["../../src/utils/split-data-attributes.ts"],"sourcesContent":["/**\n * Splits `data-*` attributes from the rest of a component's props. Components that\n * pass their remaining props to a React Aria hook (which forwards only what it knows to\n * the input) use this to put `data-*` attributes on their root, next to `className`.\n */\nexport function splitDataAttributes<T extends object>(props: T) {\n const data: Record<`data-${string}`, unknown> = {};\n const rest: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n if (key.startsWith('data-')) data[key as `data-${string}`] = value;\n else rest[key] = value;\n }\n return { data, rest: rest as Omit<T, `data-${string}`> };\n}\n"],"mappings":";;;;;;AAKA,SAAgB,oBAAsC,OAAU;CAC9D,MAAM,OAA0C,CAAC;CACjD,MAAM,OAAgC,CAAC;CACvC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,IAAI,IAAI,WAAW,OAAO,GAAG,KAAK,OAA2B;MACxD,KAAK,OAAO;CAEnB,OAAO;EAAE;EAAY;CAAkC;AACzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { hasModifier, isRtl, moveFor, target } from "./composite-keys.js";
|
|
2
|
+
import { tabbables } from "./focus.js";
|
|
3
|
+
//#region src/utils/toolbar-keys.ts
|
|
4
|
+
/**
|
|
5
|
+
* The WAI-ARIA APG toolbar keys, for a toolbar's `onKeyDownCapture`: the arrow keys along
|
|
6
|
+
* its orientation move focus to the next or previous control, wrapping at the ends, and
|
|
7
|
+
* Home and End move to the first and last (left and right follow the laid-out direction).
|
|
8
|
+
* A text field keeps these keys for its caret. Handled keys stop here, so a group nested
|
|
9
|
+
* in the toolbar doesn't move focus too. Returns whether the key was handled.
|
|
10
|
+
*/
|
|
11
|
+
function toolbarKeyDown(event, orientation) {
|
|
12
|
+
const root = event.currentTarget;
|
|
13
|
+
const from = event.target;
|
|
14
|
+
if (hasModifier(event) || from.matches("textarea, [contenteditable]:not([contenteditable=\"false\"]), input:not([type=\"button\"], [type=\"checkbox\"], [type=\"radio\"], [type=\"submit\"], [type=\"reset\"], [type=\"image\"], [type=\"range\"], [type=\"color\"], [type=\"file\"])")) return false;
|
|
15
|
+
const move = moveFor(event.key, orientation, isRtl(root));
|
|
16
|
+
if (move === null) return false;
|
|
17
|
+
const items = tabbables(root);
|
|
18
|
+
const current = items.findIndex((item) => item === from || item.contains(from));
|
|
19
|
+
if (current < 0) return false;
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
target(items, current, move)?.focus();
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { toolbarKeyDown };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=toolbar-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-keys.js","names":[],"sources":["../../src/utils/toolbar-keys.ts"],"sourcesContent":["import type { KeyboardEvent } from 'react';\nimport {\n hasModifier,\n isRtl,\n moveFor,\n target,\n TEXT_ENTRY,\n type KeyOrientation,\n} from './composite-keys';\nimport { tabbables } from './focus';\n\n/**\n * The WAI-ARIA APG toolbar keys, for a toolbar's `onKeyDownCapture`: the arrow keys along\n * its orientation move focus to the next or previous control, wrapping at the ends, and\n * Home and End move to the first and last (left and right follow the laid-out direction).\n * A text field keeps these keys for its caret. Handled keys stop here, so a group nested\n * in the toolbar doesn't move focus too. Returns whether the key was handled.\n */\nexport function toolbarKeyDown(event: KeyboardEvent<HTMLElement>, orientation: KeyOrientation) {\n const root = event.currentTarget;\n const from = event.target as HTMLElement;\n if (hasModifier(event) || from.matches(TEXT_ENTRY)) return false;\n const move = moveFor(event.key, orientation, isRtl(root));\n if (move === null) return false;\n const items = tabbables(root);\n const current = items.findIndex((item) => item === from || item.contains(from));\n if (current < 0) return false;\n event.preventDefault();\n event.stopPropagation();\n target(items, current, move)?.focus();\n return true;\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAgB,eAAe,OAAmC,aAA6B;CAC7F,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM;CACnB,IAAI,YAAY,KAAK,KAAK,KAAK,QAAA,+OAAkB,GAAG,OAAO;CAC3D,MAAM,OAAO,QAAQ,MAAM,KAAK,aAAa,MAAM,IAAI,CAAC;CACxD,IAAI,SAAS,MAAM,OAAO;CAC1B,MAAM,QAAQ,UAAU,IAAI;CAC5B,MAAM,UAAU,MAAM,WAAW,SAAS,SAAS,QAAQ,KAAK,SAAS,IAAI,CAAC;CAC9E,IAAI,UAAU,GAAG,OAAO;CACxB,MAAM,eAAe;CACrB,MAAM,gBAAgB;CACtB,OAAO,OAAO,SAAS,IAAI,CAAC,EAAE,MAAM;CACpC,OAAO;AACT"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VariantProps } from "tailwind-variants";
|
|
2
|
+
//#region src/utils/tv.d.ts
|
|
3
|
+
/** tailwind-variants configured with the same merge rules as {@link cn}. */
|
|
4
|
+
export declare const tv: import("tailwind-variants").TV;
|
|
5
|
+
//#endregion
|
|
6
|
+
export type { VariantProps };
|
|
7
|
+
//# sourceMappingURL=tv.d.ts.map
|
package/dist/utils/tv.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { twMergeConfig } from "./cn.js";
|
|
2
|
+
import { createTV } from "tailwind-variants";
|
|
3
|
+
//#region src/utils/tv.ts
|
|
4
|
+
/** tailwind-variants configured with the same merge rules as {@link cn}. */
|
|
5
|
+
const tv = createTV({ twMergeConfig });
|
|
6
|
+
//#endregion
|
|
7
|
+
export { tv };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=tv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tv.js","names":[],"sources":["../../src/utils/tv.ts"],"sourcesContent":["import { createTV } from 'tailwind-variants';\nimport { twMergeConfig } from './cn';\n\n/** tailwind-variants configured with the same merge rules as {@link cn}. */\nexport const tv = createTV({ twMergeConfig });\n\nexport type { VariantProps } from 'tailwind-variants';\n"],"mappings":";;;;AAIA,MAAa,KAAK,SAAS,EAAE,cAAc,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { ListKeyboardDelegate, useCollator } from "react-aria";
|
|
3
|
+
//#region src/utils/typeahead.ts
|
|
4
|
+
/** One character typed once or several times over ("p", "ppp"). */
|
|
5
|
+
function repeatedCharacter(search) {
|
|
6
|
+
const [first, ...rest] = Array.from(search);
|
|
7
|
+
return first !== void 0 && rest.every((character) => character === first) ? first : null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A list keyboard delegate whose typeahead follows the M3 menu keyboard table: "Letters —
|
|
11
|
+
* Focus moves to the next menu item starting with letter". React Aria's search starts *at*
|
|
12
|
+
* the focused item, so pressing a letter again stayed put. A single character (or the same
|
|
13
|
+
* one repeated, as WAI-ARIA's typeahead cycles) now searches from the item after the focused
|
|
14
|
+
* one (or after `currentKey`, a closed `Select`'s chosen option, when nothing has focus),
|
|
15
|
+
* wrapping to the top. A longer search still starts at the focused item, so typing on
|
|
16
|
+
* refines the match.
|
|
17
|
+
*/
|
|
18
|
+
var TypeaheadKeyboardDelegate = class extends ListKeyboardDelegate {
|
|
19
|
+
currentKey;
|
|
20
|
+
constructor(options, currentKey = null) {
|
|
21
|
+
super(options);
|
|
22
|
+
this.currentKey = currentKey;
|
|
23
|
+
}
|
|
24
|
+
getKeyForSearch(search, fromKey) {
|
|
25
|
+
const character = repeatedCharacter(search);
|
|
26
|
+
if (character === null) return super.getKeyForSearch(search, fromKey ?? void 0);
|
|
27
|
+
const start = fromKey ?? this.currentKey;
|
|
28
|
+
const next = start == null ? null : this.getNextKey(start);
|
|
29
|
+
return (next == null ? null : super.getKeyForSearch(character, next)) ?? super.getKeyForSearch(character);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The {@link TypeaheadKeyboardDelegate} for a collection, built as React Aria builds its
|
|
34
|
+
* default list delegate (a base-sensitivity search collator, the state's disabled keys and
|
|
35
|
+
* behaviour), for `useListBox`, `useMenu` or `useSelect`'s `keyboardDelegate`.
|
|
36
|
+
* `disabledBehavior` overrides the state's (a closed `Select`'s typeahead skips disabled
|
|
37
|
+
* options even when its list lets them take focus); `currentKey` is where a search starts
|
|
38
|
+
* when nothing has focus.
|
|
39
|
+
*/
|
|
40
|
+
function useTypeaheadDelegate(state, ref, { disabledBehavior = state.selectionManager.disabledBehavior, currentKey = null } = {}) {
|
|
41
|
+
const collator = useCollator({
|
|
42
|
+
usage: "search",
|
|
43
|
+
sensitivity: "base"
|
|
44
|
+
});
|
|
45
|
+
const { collection, disabledKeys } = state;
|
|
46
|
+
return useMemo(() => new TypeaheadKeyboardDelegate({
|
|
47
|
+
collection,
|
|
48
|
+
disabledKeys,
|
|
49
|
+
disabledBehavior,
|
|
50
|
+
ref,
|
|
51
|
+
collator
|
|
52
|
+
}, currentKey), [
|
|
53
|
+
collection,
|
|
54
|
+
disabledKeys,
|
|
55
|
+
disabledBehavior,
|
|
56
|
+
ref,
|
|
57
|
+
collator,
|
|
58
|
+
currentKey
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { TypeaheadKeyboardDelegate, useTypeaheadDelegate };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=typeahead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeahead.js","names":[],"sources":["../../src/utils/typeahead.ts"],"sourcesContent":["import { useMemo, type RefObject } from 'react';\nimport { ListKeyboardDelegate, useCollator } from 'react-aria';\nimport type { Collection, DisabledBehavior, Key, Node } from 'react-stately';\n\n/** One character typed once or several times over (\"p\", \"ppp\"). */\nfunction repeatedCharacter(search: string): string | null {\n const [first, ...rest] = Array.from(search);\n return first !== undefined && rest.every((character) => character === first) ? first : null;\n}\n\n/**\n * A list keyboard delegate whose typeahead follows the M3 menu keyboard table: \"Letters —\n * Focus moves to the next menu item starting with letter\". React Aria's search starts *at*\n * the focused item, so pressing a letter again stayed put. A single character (or the same\n * one repeated, as WAI-ARIA's typeahead cycles) now searches from the item after the focused\n * one (or after `currentKey`, a closed `Select`'s chosen option, when nothing has focus),\n * wrapping to the top. A longer search still starts at the focused item, so typing on\n * refines the match.\n */\nexport class TypeaheadKeyboardDelegate<T> extends ListKeyboardDelegate<T> {\n private readonly currentKey: Key | null;\n\n constructor(\n options: ConstructorParameters<typeof ListKeyboardDelegate<T>>[0],\n currentKey: Key | null = null,\n ) {\n super(options);\n this.currentKey = currentKey;\n }\n\n override getKeyForSearch(search: string, fromKey?: Key | null): Key | null {\n const character = repeatedCharacter(search);\n if (character === null) return super.getKeyForSearch(search, fromKey ?? undefined);\n const start = fromKey ?? this.currentKey;\n const next = start == null ? null : this.getNextKey(start);\n return (\n (next == null ? null : super.getKeyForSearch(character, next)) ??\n super.getKeyForSearch(character)\n );\n }\n}\n\n/** What {@link useTypeaheadDelegate} reads from a list or tree state. */\ninterface TypeaheadState<T> {\n collection: Collection<Node<T>>;\n disabledKeys: Set<Key>;\n selectionManager: { disabledBehavior: DisabledBehavior };\n}\n\n/**\n * The {@link TypeaheadKeyboardDelegate} for a collection, built as React Aria builds its\n * default list delegate (a base-sensitivity search collator, the state's disabled keys and\n * behaviour), for `useListBox`, `useMenu` or `useSelect`'s `keyboardDelegate`.\n * `disabledBehavior` overrides the state's (a closed `Select`'s typeahead skips disabled\n * options even when its list lets them take focus); `currentKey` is where a search starts\n * when nothing has focus.\n */\nexport function useTypeaheadDelegate<T>(\n state: TypeaheadState<T>,\n ref: RefObject<HTMLElement | null>,\n {\n disabledBehavior = state.selectionManager.disabledBehavior,\n currentKey = null,\n }: { disabledBehavior?: DisabledBehavior; currentKey?: Key | null } = {},\n): TypeaheadKeyboardDelegate<T> {\n const collator = useCollator({ usage: 'search', sensitivity: 'base' });\n const { collection, disabledKeys } = state;\n return useMemo(\n () =>\n new TypeaheadKeyboardDelegate<T>(\n { collection, disabledKeys, disabledBehavior, ref, collator },\n currentKey,\n ),\n [collection, disabledKeys, disabledBehavior, ref, collator, currentKey],\n );\n}\n"],"mappings":";;;;AAKA,SAAS,kBAAkB,QAA+B;CACxD,MAAM,CAAC,OAAO,GAAG,QAAQ,MAAM,KAAK,MAAM;CAC1C,OAAO,UAAU,KAAA,KAAa,KAAK,OAAO,cAAc,cAAc,KAAK,IAAI,QAAQ;AACzF;;;;;;;;;;AAWA,IAAa,4BAAb,cAAkD,qBAAwB;CACxE;CAEA,YACE,SACA,aAAyB,MACzB;EACA,MAAM,OAAO;EACb,KAAK,aAAa;CACpB;CAEA,gBAAyB,QAAgB,SAAkC;EACzE,MAAM,YAAY,kBAAkB,MAAM;EAC1C,IAAI,cAAc,MAAM,OAAO,MAAM,gBAAgB,QAAQ,WAAW,KAAA,CAAS;EACjF,MAAM,QAAQ,WAAW,KAAK;EAC9B,MAAM,OAAO,SAAS,OAAO,OAAO,KAAK,WAAW,KAAK;EACzD,QACG,QAAQ,OAAO,OAAO,MAAM,gBAAgB,WAAW,IAAI,MAC5D,MAAM,gBAAgB,SAAS;CAEnC;AACF;;;;;;;;;AAiBA,SAAgB,qBACd,OACA,KACA,EACE,mBAAmB,MAAM,iBAAiB,kBAC1C,aAAa,SACuD,CAAC,GACzC;CAC9B,MAAM,WAAW,YAAY;EAAE,OAAO;EAAU,aAAa;CAAO,CAAC;CACrE,MAAM,EAAE,YAAY,iBAAiB;CACrC,OAAO,cAEH,IAAI,0BACF;EAAE;EAAY;EAAc;EAAkB;EAAK;CAAS,GAC5D,UACF,GACF;EAAC;EAAY;EAAc;EAAkB;EAAK;EAAU;CAAU,CACxE;AACF"}
|