@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,156 @@
|
|
|
1
|
+
import { ButtonBaseActionProps, ButtonBaseLinkProps } from "../../primitives/ButtonBase.js";
|
|
2
|
+
import { IconTransition } from "../../primitives/icon-faces-styles.js";
|
|
3
|
+
import { FabElevation } from "../fab/fab-styles.js";
|
|
4
|
+
import { FabMenuColor, FabMenuSize } from "./fab-menu-styles.js";
|
|
5
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
6
|
+
//#region src/components/fab-menu/FabMenu.d.ts
|
|
7
|
+
type AccessibleName = {
|
|
8
|
+
/** Accessible name for the button, also its tooltip. Required unless `aria-labelledby` is set. */
|
|
9
|
+
'aria-label': string;
|
|
10
|
+
/** The id of the element that names the button. */
|
|
11
|
+
'aria-labelledby'?: string;
|
|
12
|
+
} | {
|
|
13
|
+
/** Accessible name for the button, also its tooltip. */
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/** The id of the element that names the button. Required unless `aria-label` is set. */
|
|
16
|
+
'aria-labelledby': string;
|
|
17
|
+
};
|
|
18
|
+
export interface FabMenuClassNames {
|
|
19
|
+
/** The outer container, merged with `className`. */
|
|
20
|
+
root?: string;
|
|
21
|
+
/** The box that keeps the FAB's size while the button shrinks inside it. */
|
|
22
|
+
anchor?: string;
|
|
23
|
+
/** The FAB that opens and closes the menu. */
|
|
24
|
+
button?: string;
|
|
25
|
+
/** The button's icon. */
|
|
26
|
+
icon?: string;
|
|
27
|
+
/** The list of items (`presentation="list"`). */
|
|
28
|
+
list?: string;
|
|
29
|
+
/** The menu (`presentation="menu"`). */
|
|
30
|
+
menu?: string;
|
|
31
|
+
/** The built-in plain tooltip shown on the closed button (`tooltip`). */
|
|
32
|
+
tooltip?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `list`: the expressive stack of pills that opens upwards from the button, for compact
|
|
36
|
+
* and medium windows. `menu`: the FAB opens a standard {@link Menu} 4px above it, as M3
|
|
37
|
+
* asks for on the web and in large windows.
|
|
38
|
+
*/
|
|
39
|
+
export type FabMenuPresentation = 'list' | 'menu';
|
|
40
|
+
interface FabMenuOwnProps {
|
|
41
|
+
/** Whether the menu is open (controlled). */
|
|
42
|
+
open?: boolean;
|
|
43
|
+
/** Whether the menu starts open (uncontrolled). @default false */
|
|
44
|
+
defaultOpen?: boolean;
|
|
45
|
+
/** Called when the menu opens or closes. */
|
|
46
|
+
onOpenChange?: (open: boolean) => void;
|
|
47
|
+
/** The button's icon while closed, usually "add". Hidden from assistive tech. */
|
|
48
|
+
icon: ReactElement;
|
|
49
|
+
/** The button's icon while open, usually "close". Defaults to `icon`. */
|
|
50
|
+
openIcon?: ReactElement;
|
|
51
|
+
/**
|
|
52
|
+
* How the button hands over from `icon` to `openIcon`: `swap` halfway through the morph
|
|
53
|
+
* (the M3 spec and Compose), or `rotate`, where the outgoing icon turns 90° and fades
|
|
54
|
+
* out while the incoming one turns in and fades in. `rotate` goes beyond the M3 spec; it
|
|
55
|
+
* matches Google's Expressive showcase motion. It mirrors in RTL, and reduced motion keeps
|
|
56
|
+
* only the crossfade. Only used with `openIcon`. @default "swap"
|
|
57
|
+
*/
|
|
58
|
+
iconTransition?: IconTransition;
|
|
59
|
+
/** The FAB size the button starts at; open, it is always the 56px close button. @default "default" */
|
|
60
|
+
size?: FabMenuSize;
|
|
61
|
+
/** The button's and items' colour scheme, from M3's FAB menu colour sets. @default "primary" */
|
|
62
|
+
color?: FabMenuColor;
|
|
63
|
+
/**
|
|
64
|
+
* The button's and items' elevation, as on `Fab`: level 3 by default (the spec), `lowered`
|
|
65
|
+
* level 1, or `flat` level 0. @default "default"
|
|
66
|
+
*/
|
|
67
|
+
elevation?: FabElevation;
|
|
68
|
+
/**
|
|
69
|
+
* How the items show: `list`, the expressive stack of pills above the button, or `menu`,
|
|
70
|
+
* a standard menu 4px above it (M3's choice for the web and large windows).
|
|
71
|
+
* @default "list"
|
|
72
|
+
*/
|
|
73
|
+
presentation?: FabMenuPresentation;
|
|
74
|
+
/**
|
|
75
|
+
* While closed, shows `aria-label` in a plain tooltip on hover and keyboard focus, as M3
|
|
76
|
+
* asks of FABs on the web. Open, the button is the close button and has no tooltip. It
|
|
77
|
+
* steps aside inside your own `TooltipTrigger`. @default true
|
|
78
|
+
*/
|
|
79
|
+
tooltip?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Shows the button. Hiding it closes the menu, shrinks the button towards its centre and
|
|
82
|
+
* fades it out; showing it expands it back (the FAB's appear / disappear motion). A
|
|
83
|
+
* hidden menu is `inert`. @default true
|
|
84
|
+
*/
|
|
85
|
+
visible?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Plays the appearing animation when the menu mounts. Change its `key` on a page or tab
|
|
88
|
+
* change to replay it. @default false
|
|
89
|
+
*/
|
|
90
|
+
appear?: boolean;
|
|
91
|
+
/** Two to six `FabMenuItem` elements, top to bottom. */
|
|
92
|
+
children: ReactNode;
|
|
93
|
+
/** Classes for each part, by slot. */
|
|
94
|
+
classNames?: FabMenuClassNames;
|
|
95
|
+
}
|
|
96
|
+
export type FabMenuProps = FabMenuOwnProps & AccessibleName & Omit<ComponentPropsWithRef<'div'>, keyof FabMenuOwnProps | 'aria-label' | 'aria-labelledby' | 'color'>;
|
|
97
|
+
/**
|
|
98
|
+
* M3 Expressive FAB menu: a FAB that opens two to six related actions above it. The button
|
|
99
|
+
* shrinks into a 56px close button while the items (`FabMenuItem`) appear one after
|
|
100
|
+
* another from the button upwards, each springing out to its full width; on short windows
|
|
101
|
+
* they scroll behind the close button. Under reduced motion the button changes at once and
|
|
102
|
+
* the items fade in and out together. Position the menu on the window's trailing edge
|
|
103
|
+
* with `className` (`fixed end-4 bottom-4`, and `end-6 bottom-6` in large windows). Keep it
|
|
104
|
+
* out of normal flow: `fixed`, or at the bottom of a box. In flow, the open list pushes the
|
|
105
|
+
* button down and can scroll the page.
|
|
106
|
+
*
|
|
107
|
+
* The button is named by `aria-label`, which it shows in a tooltip while closed, and reports
|
|
108
|
+
* `aria-expanded`. Tab or ↓ moves from the button to the top item; ↑ / ↓ move between
|
|
109
|
+
* items and back to the button. Escape, an outside press, focus leaving the menu or
|
|
110
|
+
* choosing an item closes it. With `presentation="menu"` the
|
|
111
|
+
* button opens a standard `Menu` instead, with menu semantics and keyboard support.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* <FabMenu icon={<AddIcon />} openIcon={<CloseIcon />} aria-label="Create" className="fixed end-4 bottom-4">
|
|
115
|
+
* <FabMenuItem icon={<ReplyIcon />} onPress={reply}>Reply</FabMenuItem>
|
|
116
|
+
* <FabMenuItem icon={<ArchiveIcon />} onPress={archive}>Archive</FabMenuItem>
|
|
117
|
+
* </FabMenu>
|
|
118
|
+
*/
|
|
119
|
+
export declare function FabMenu({ open, defaultOpen, onOpenChange, icon, openIcon, iconTransition, size, color, elevation, presentation, tooltip, visible, appear, children, classNames, className, ref, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...rest }: FabMenuProps): import("react").JSX.Element;
|
|
120
|
+
export interface FabMenuItemClassNames {
|
|
121
|
+
/** The item's button, link or menu item, merged with `className`. */
|
|
122
|
+
root?: string;
|
|
123
|
+
/** The row holding the icon and the label. */
|
|
124
|
+
content?: string;
|
|
125
|
+
/** The icon. */
|
|
126
|
+
icon?: string;
|
|
127
|
+
/** The item's label text. */
|
|
128
|
+
label?: string;
|
|
129
|
+
}
|
|
130
|
+
interface FabMenuItemOwnProps {
|
|
131
|
+
/**
|
|
132
|
+
* The item's icon. Hidden from assistive tech; the label names the item. M3 asks for an
|
|
133
|
+
* icon on every item, since it tells the items apart; leave it out only if necessary.
|
|
134
|
+
*/
|
|
135
|
+
icon?: ReactElement;
|
|
136
|
+
/** The label, which M3 always requires. */
|
|
137
|
+
children: ReactNode;
|
|
138
|
+
/**
|
|
139
|
+
* Runs when the item is chosen, in either presentation. (`onPress` works only in the
|
|
140
|
+
* list, since a menu item has no press event.)
|
|
141
|
+
*/
|
|
142
|
+
onAction?: () => void;
|
|
143
|
+
/** Classes for each part, by slot. */
|
|
144
|
+
classNames?: FabMenuItemClassNames;
|
|
145
|
+
}
|
|
146
|
+
type OmitItem<T> = Omit<T, keyof FabMenuItemOwnProps | 'disabled' | 'toggle'>;
|
|
147
|
+
export type FabMenuItemProps = FabMenuItemOwnProps & (OmitItem<ButtonBaseActionProps> | OmitItem<ButtonBaseLinkProps>);
|
|
148
|
+
/**
|
|
149
|
+
* An action in a {@link FabMenu}: a 56px pill with an icon and a label (or, with
|
|
150
|
+
* `presentation="menu"`, a menu item). Choosing it calls `onAction` (and, in the list,
|
|
151
|
+
* `onPress`), or follows `href`, and closes the menu.
|
|
152
|
+
*/
|
|
153
|
+
export declare function FabMenuItem({ icon, children, classNames, className, style, onPress, onAction, ...rest }: FabMenuItemProps): import("react").JSX.Element;
|
|
154
|
+
//#endregion
|
|
155
|
+
export type { IconTransition };
|
|
156
|
+
//# sourceMappingURL=FabMenu.d.ts.map
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { TriggerContext } from "../../primitives/TriggerContext.js";
|
|
4
|
+
import { ButtonBase } from "../../primitives/ButtonBase.js";
|
|
5
|
+
import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
|
|
6
|
+
import { usePresence } from "../../primitives/use-presence.js";
|
|
7
|
+
import { IconFaces } from "../../primitives/IconFaces.js";
|
|
8
|
+
import { MenuTrigger } from "../menu/menu-trigger.js";
|
|
9
|
+
import { FabTooltip } from "../fab/FabTooltip.js";
|
|
10
|
+
import { Menu, MenuItem } from "../menu/Menu.js";
|
|
11
|
+
import { staggerSteps } from "./fab-menu-stagger.js";
|
|
12
|
+
import { fabMenuStyles } from "./fab-menu-styles.js";
|
|
13
|
+
import { Children, createContext, isValidElement, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
14
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { useReducedMotion } from "motion/react";
|
|
16
|
+
import { mergeProps, useFocusWithin, useInteractOutside, useObjectRef } from "react-aria";
|
|
17
|
+
import { useControlledState } from "react-stately/useControlledState";
|
|
18
|
+
//#region src/components/fab-menu/FabMenu.tsx
|
|
19
|
+
const FabMenuContext = createContext(null);
|
|
20
|
+
const ItemIndexContext = createContext(0);
|
|
21
|
+
const ITEM_SELECTOR = "[data-fab-menu-item]:not([inert])";
|
|
22
|
+
/**
|
|
23
|
+
* M3 Expressive FAB menu: a FAB that opens two to six related actions above it. The button
|
|
24
|
+
* shrinks into a 56px close button while the items (`FabMenuItem`) appear one after
|
|
25
|
+
* another from the button upwards, each springing out to its full width; on short windows
|
|
26
|
+
* they scroll behind the close button. Under reduced motion the button changes at once and
|
|
27
|
+
* the items fade in and out together. Position the menu on the window's trailing edge
|
|
28
|
+
* with `className` (`fixed end-4 bottom-4`, and `end-6 bottom-6` in large windows). Keep it
|
|
29
|
+
* out of normal flow: `fixed`, or at the bottom of a box. In flow, the open list pushes the
|
|
30
|
+
* button down and can scroll the page.
|
|
31
|
+
*
|
|
32
|
+
* The button is named by `aria-label`, which it shows in a tooltip while closed, and reports
|
|
33
|
+
* `aria-expanded`. Tab or ↓ moves from the button to the top item; ↑ / ↓ move between
|
|
34
|
+
* items and back to the button. Escape, an outside press, focus leaving the menu or
|
|
35
|
+
* choosing an item closes it. With `presentation="menu"` the
|
|
36
|
+
* button opens a standard `Menu` instead, with menu semantics and keyboard support.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <FabMenu icon={<AddIcon />} openIcon={<CloseIcon />} aria-label="Create" className="fixed end-4 bottom-4">
|
|
40
|
+
* <FabMenuItem icon={<ReplyIcon />} onPress={reply}>Reply</FabMenuItem>
|
|
41
|
+
* <FabMenuItem icon={<ArchiveIcon />} onPress={archive}>Archive</FabMenuItem>
|
|
42
|
+
* </FabMenu>
|
|
43
|
+
*/
|
|
44
|
+
function FabMenu({ open, defaultOpen = false, onOpenChange, icon, openIcon, iconTransition, size, color, elevation, presentation = "list", tooltip = true, visible = true, appear = false, children, classNames, className, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }) {
|
|
45
|
+
const [isOpenState, setOpen] = useControlledState(open, defaultOpen, onOpenChange);
|
|
46
|
+
const isOpen = isOpenState && visible;
|
|
47
|
+
const items = Children.toArray(children).filter(isValidElement);
|
|
48
|
+
const total = items.length;
|
|
49
|
+
if (process.env.NODE_ENV !== "production" && (total < 2 || total > 6)) console.warn(`[@windmorph/react] A FabMenu holds 2 to 6 items (M3); this one has ${total}. Use a FAB for a single action.`);
|
|
50
|
+
const isMenu = presentation === "menu";
|
|
51
|
+
const styles = fabMenuStyles({
|
|
52
|
+
size,
|
|
53
|
+
color,
|
|
54
|
+
elevation
|
|
55
|
+
});
|
|
56
|
+
const menuColor = color ?? "primary";
|
|
57
|
+
const listId = useId();
|
|
58
|
+
const rootRef = useObjectRef(ref);
|
|
59
|
+
const buttonRef = useRef(null);
|
|
60
|
+
const listRef = useRef(null);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!visible && isOpenState) setOpen(false);
|
|
63
|
+
}, [
|
|
64
|
+
visible,
|
|
65
|
+
isOpenState,
|
|
66
|
+
setOpen
|
|
67
|
+
]);
|
|
68
|
+
const reducedMotion = useReducedMotion() ?? false;
|
|
69
|
+
const target = isOpen ? total : 0;
|
|
70
|
+
const [staggered, setStaggered] = useState(target);
|
|
71
|
+
const count = reducedMotion ? target : staggered;
|
|
72
|
+
const countRef = useRef(count);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (reducedMotion) {
|
|
75
|
+
countRef.current = target;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const timers = staggerSteps(countRef.current, target).map(({ at, count: next }) => setTimeout(() => {
|
|
79
|
+
countRef.current = next;
|
|
80
|
+
setStaggered(next);
|
|
81
|
+
}, at));
|
|
82
|
+
return () => timers.forEach(clearTimeout);
|
|
83
|
+
}, [target, reducedMotion]);
|
|
84
|
+
const { isPresent, exitProps } = usePresence(isOpen || count > 0);
|
|
85
|
+
const close = () => {
|
|
86
|
+
if (listRef.current?.contains(document.activeElement)) buttonRef.current?.focus();
|
|
87
|
+
setOpen(false);
|
|
88
|
+
};
|
|
89
|
+
useInteractOutside({
|
|
90
|
+
ref: rootRef,
|
|
91
|
+
onInteractOutside: close,
|
|
92
|
+
isDisabled: !isOpen || isMenu
|
|
93
|
+
});
|
|
94
|
+
const { focusWithinProps } = useFocusWithin({ onBlurWithin: (event) => {
|
|
95
|
+
if (!isOpen || isMenu) return;
|
|
96
|
+
const next = event.relatedTarget;
|
|
97
|
+
if (next instanceof Node && !rootRef.current?.contains(next)) setOpen(false);
|
|
98
|
+
} });
|
|
99
|
+
useLayoutEffect(() => {
|
|
100
|
+
const list = listRef.current;
|
|
101
|
+
if (isOpen && list) list.scrollTop = list.scrollHeight;
|
|
102
|
+
}, [isOpen]);
|
|
103
|
+
const focusItem = (from, step) => {
|
|
104
|
+
const all = [...listRef.current?.querySelectorAll(ITEM_SELECTOR) ?? []];
|
|
105
|
+
const index = all.indexOf(from);
|
|
106
|
+
((index === -1 ? all[0] : all[index + step]) ?? buttonRef.current)?.focus();
|
|
107
|
+
};
|
|
108
|
+
const onKeyDown = (event) => {
|
|
109
|
+
if (!isOpen || isMenu) return;
|
|
110
|
+
const onButton = event.target === buttonRef.current;
|
|
111
|
+
if (event.key === "Escape") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
buttonRef.current?.focus();
|
|
114
|
+
setOpen(false);
|
|
115
|
+
} else if (event.key === "ArrowDown") {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
focusItem(event.target, 1);
|
|
118
|
+
} else if (event.key === "ArrowUp" && !onButton) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
focusItem(event.target, -1);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const context = {
|
|
124
|
+
styles,
|
|
125
|
+
firstVisible: total - count,
|
|
126
|
+
count: total,
|
|
127
|
+
close,
|
|
128
|
+
onLastExit: exitProps.onTransitionEnd
|
|
129
|
+
};
|
|
130
|
+
const toggle = /* @__PURE__ */ jsx(ButtonBase, {
|
|
131
|
+
ref: buttonRef,
|
|
132
|
+
"aria-label": ariaLabel,
|
|
133
|
+
"aria-labelledby": ariaLabelledBy,
|
|
134
|
+
...isMenu ? {} : {
|
|
135
|
+
"aria-expanded": isOpen,
|
|
136
|
+
"aria-controls": isPresent ? listId : void 0,
|
|
137
|
+
onPress: () => setOpen(!isOpen)
|
|
138
|
+
},
|
|
139
|
+
"data-open": isOpen && !isMenu || void 0,
|
|
140
|
+
"data-slot": "button",
|
|
141
|
+
"data-tokens": "md-comp-fab",
|
|
142
|
+
"data-color": `${menuColor}-container`,
|
|
143
|
+
className: styles.button({ class: classNames?.button }),
|
|
144
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
145
|
+
"aria-hidden": "true",
|
|
146
|
+
className: styles.icon({ class: classNames?.icon }),
|
|
147
|
+
children: openIcon ? /* @__PURE__ */ jsx(IconFaces, {
|
|
148
|
+
icon,
|
|
149
|
+
alternateIcon: openIcon,
|
|
150
|
+
alternate: isOpen && !isMenu,
|
|
151
|
+
transition: iconTransition
|
|
152
|
+
}) : icon
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
const button = /* @__PURE__ */ jsx("span", {
|
|
156
|
+
"data-hidden": visible ? void 0 : true,
|
|
157
|
+
"data-appear": appear || void 0,
|
|
158
|
+
className: styles.anchor({ class: classNames?.anchor }),
|
|
159
|
+
children: tooltip && ariaLabel ? /* @__PURE__ */ jsx(FabTooltip, {
|
|
160
|
+
available: !isOpen,
|
|
161
|
+
label: ariaLabel,
|
|
162
|
+
className: classNames?.tooltip,
|
|
163
|
+
children: toggle
|
|
164
|
+
}) : toggle
|
|
165
|
+
});
|
|
166
|
+
return /* @__PURE__ */ jsx("div", {
|
|
167
|
+
...mergeProps(rest, focusWithinProps),
|
|
168
|
+
ref: rootRef,
|
|
169
|
+
inert: !visible || void 0,
|
|
170
|
+
"data-tokens": mergeDataTokens("md-comp-fab-menu", rest),
|
|
171
|
+
"data-color": menuColor,
|
|
172
|
+
"data-item-color": `${menuColor}-container`,
|
|
173
|
+
"data-open": isOpen || void 0,
|
|
174
|
+
"data-presentation": presentation,
|
|
175
|
+
className: styles.root({ class: cn(classNames?.root, className) }),
|
|
176
|
+
onKeyDown: (event) => {
|
|
177
|
+
rest.onKeyDown?.(event);
|
|
178
|
+
onKeyDown(event);
|
|
179
|
+
},
|
|
180
|
+
children: isMenu ? /* @__PURE__ */ jsxs(MenuTrigger, {
|
|
181
|
+
open: isOpen,
|
|
182
|
+
onOpenChange: setOpen,
|
|
183
|
+
children: [button, /* @__PURE__ */ jsx(Menu, {
|
|
184
|
+
placement: "top-end",
|
|
185
|
+
offset: 4,
|
|
186
|
+
"aria-label": ariaLabel,
|
|
187
|
+
"aria-labelledby": ariaLabelledBy,
|
|
188
|
+
classNames: { panel: styles.menu({ class: classNames?.menu }) },
|
|
189
|
+
children: items.map((item) => /* @__PURE__ */ jsx(MenuItem, {
|
|
190
|
+
leadingIcon: item.props.icon,
|
|
191
|
+
...menuItemAction(item.props),
|
|
192
|
+
className: item.props.className,
|
|
193
|
+
children: item.props.children
|
|
194
|
+
}, item.key ?? void 0))
|
|
195
|
+
})]
|
|
196
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [button, /* @__PURE__ */ jsx("div", {
|
|
197
|
+
ref: listRef,
|
|
198
|
+
id: listId,
|
|
199
|
+
hidden: !isPresent,
|
|
200
|
+
className: styles.list({ class: classNames?.list }),
|
|
201
|
+
children: /* @__PURE__ */ jsx(TriggerContext, {
|
|
202
|
+
value: null,
|
|
203
|
+
children: /* @__PURE__ */ jsx(FabMenuContext, {
|
|
204
|
+
value: context,
|
|
205
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx(ItemIndexContext, {
|
|
206
|
+
value: index,
|
|
207
|
+
children: item
|
|
208
|
+
}, item.key))
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
})] })
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A `FabMenuItem`'s action for a `MenuItem`. Menu items are React Stately collection items,
|
|
216
|
+
* which keep any prop; React Aria's `useMenuItem` runs an item's `onAction` and opens its
|
|
217
|
+
* `href` through the router.
|
|
218
|
+
*/
|
|
219
|
+
function menuItemAction({ onAction, href }) {
|
|
220
|
+
return {
|
|
221
|
+
onAction,
|
|
222
|
+
href
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* An action in a {@link FabMenu}: a 56px pill with an icon and a label (or, with
|
|
227
|
+
* `presentation="menu"`, a menu item). Choosing it calls `onAction` (and, in the list,
|
|
228
|
+
* `onPress`), or follows `href`, and closes the menu.
|
|
229
|
+
*/
|
|
230
|
+
function FabMenuItem({ icon, children, classNames, className, style, onPress, onAction, ...rest }) {
|
|
231
|
+
const menu = useContext(FabMenuContext);
|
|
232
|
+
if (!menu) throw new Error("FabMenuItem must be rendered inside a FabMenu");
|
|
233
|
+
const index = useContext(ItemIndexContext);
|
|
234
|
+
const visible = index >= menu.firstVisible;
|
|
235
|
+
const isLast = index === menu.count - 1;
|
|
236
|
+
const { styles } = menu;
|
|
237
|
+
const contentRef = useRef(null);
|
|
238
|
+
const [width, setWidth] = useState(0);
|
|
239
|
+
useLayoutEffect(() => {
|
|
240
|
+
const content = contentRef.current;
|
|
241
|
+
if (!content) return;
|
|
242
|
+
const measure = () => setWidth(content.offsetWidth);
|
|
243
|
+
measure();
|
|
244
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
245
|
+
const observer = new ResizeObserver(measure);
|
|
246
|
+
observer.observe(content);
|
|
247
|
+
return () => observer.disconnect();
|
|
248
|
+
}, []);
|
|
249
|
+
useLayoutEffect(() => {
|
|
250
|
+
const content = contentRef.current;
|
|
251
|
+
if (visible && content) setWidth(content.offsetWidth);
|
|
252
|
+
}, [visible]);
|
|
253
|
+
const props = {
|
|
254
|
+
...rest,
|
|
255
|
+
inert: !visible,
|
|
256
|
+
"data-visible": visible || void 0,
|
|
257
|
+
"data-fab-menu-item": "",
|
|
258
|
+
"data-slot": "item",
|
|
259
|
+
style: {
|
|
260
|
+
...style,
|
|
261
|
+
width: visible ? width : 0
|
|
262
|
+
},
|
|
263
|
+
className: styles.item({ class: cn(classNames?.root, className) }),
|
|
264
|
+
onPress: (event) => {
|
|
265
|
+
onPress?.(event);
|
|
266
|
+
onAction?.();
|
|
267
|
+
menu.close();
|
|
268
|
+
},
|
|
269
|
+
onTransitionEnd: isLast ? menu.onLastExit : void 0
|
|
270
|
+
};
|
|
271
|
+
return /* @__PURE__ */ jsx(ButtonBase, {
|
|
272
|
+
...props,
|
|
273
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
274
|
+
ref: contentRef,
|
|
275
|
+
className: styles.itemContent({ class: classNames?.content }),
|
|
276
|
+
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
277
|
+
"aria-hidden": "true",
|
|
278
|
+
"data-slot": "item-icon",
|
|
279
|
+
className: styles.itemIcon({ class: classNames?.icon }),
|
|
280
|
+
children: icon
|
|
281
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
282
|
+
className: classNames?.label,
|
|
283
|
+
children
|
|
284
|
+
})]
|
|
285
|
+
})
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
export { FabMenu, FabMenuItem };
|
|
290
|
+
|
|
291
|
+
//# sourceMappingURL=FabMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FabMenu.js","names":[],"sources":["../../../src/components/fab-menu/FabMenu.tsx"],"sourcesContent":["'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type TransitionEvent,\n} from 'react';\nimport { useReducedMotion } from 'motion/react';\nimport { mergeProps, useFocusWithin, useInteractOutside, useObjectRef } from 'react-aria';\nimport { useControlledState } from 'react-stately/useControlledState';\nimport {\n ButtonBase,\n type ButtonBaseActionProps,\n type ButtonBaseLinkProps,\n} from '../../primitives/ButtonBase';\nimport { IconFaces } from '../../primitives/IconFaces';\nimport type { IconTransition } from '../../primitives/icon-faces-styles';\nimport { TriggerContext } from '../../primitives/TriggerContext';\nimport { usePresence } from '../../primitives/use-presence';\nimport { cn } from '../../utils/cn';\nimport { Menu, MenuItem, MenuTrigger, type MenuItemProps } from '../menu/Menu';\nimport type { FabElevation } from '../fab/fab-styles';\nimport { FabTooltip } from '../fab/FabTooltip';\nimport { staggerSteps } from './fab-menu-stagger';\nimport { fabMenuStyles, type FabMenuColor, type FabMenuSize } from './fab-menu-styles';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\n\ntype Styles = ReturnType<typeof fabMenuStyles>;\n\ninterface FabMenuContextValue {\n styles: Styles;\n /** Items at or below this index (counted from the top) are shown. */\n firstVisible: number;\n count: number;\n close: () => void;\n onLastExit: (event: TransitionEvent<HTMLElement>) => void;\n}\n\nexport type { IconTransition };\n\nconst FabMenuContext = createContext<FabMenuContextValue | null>(null);\nconst ItemIndexContext = createContext(0);\n\ntype AccessibleName =\n | {\n /** Accessible name for the button, also its tooltip. Required unless `aria-labelledby` is set. */\n 'aria-label': string;\n /** The id of the element that names the button. */\n 'aria-labelledby'?: string;\n }\n | {\n /** Accessible name for the button, also its tooltip. */\n 'aria-label'?: string;\n /** The id of the element that names the button. Required unless `aria-label` is set. */\n 'aria-labelledby': string;\n };\n\nexport interface FabMenuClassNames {\n /** The outer container, merged with `className`. */\n root?: string;\n /** The box that keeps the FAB's size while the button shrinks inside it. */\n anchor?: string;\n /** The FAB that opens and closes the menu. */\n button?: string;\n /** The button's icon. */\n icon?: string;\n /** The list of items (`presentation=\"list\"`). */\n list?: string;\n /** The menu (`presentation=\"menu\"`). */\n menu?: string;\n /** The built-in plain tooltip shown on the closed button (`tooltip`). */\n tooltip?: string;\n}\n\n/**\n * `list`: the expressive stack of pills that opens upwards from the button, for compact\n * and medium windows. `menu`: the FAB opens a standard {@link Menu} 4px above it, as M3\n * asks for on the web and in large windows.\n */\nexport type FabMenuPresentation = 'list' | 'menu';\n\ninterface FabMenuOwnProps {\n /** Whether the menu is open (controlled). */\n open?: boolean;\n /** Whether the menu starts open (uncontrolled). @default false */\n defaultOpen?: boolean;\n /** Called when the menu opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** The button's icon while closed, usually \"add\". Hidden from assistive tech. */\n icon: ReactElement;\n /** The button's icon while open, usually \"close\". Defaults to `icon`. */\n openIcon?: ReactElement;\n /**\n * How the button hands over from `icon` to `openIcon`: `swap` halfway through the morph\n * (the M3 spec and Compose), or `rotate`, where the outgoing icon turns 90° and fades\n * out while the incoming one turns in and fades in. `rotate` goes beyond the M3 spec; it\n * matches Google's Expressive showcase motion. It mirrors in RTL, and reduced motion keeps\n * only the crossfade. Only used with `openIcon`. @default \"swap\"\n */\n iconTransition?: IconTransition;\n /** The FAB size the button starts at; open, it is always the 56px close button. @default \"default\" */\n size?: FabMenuSize;\n /** The button's and items' colour scheme, from M3's FAB menu colour sets. @default \"primary\" */\n color?: FabMenuColor;\n /**\n * The button's and items' elevation, as on `Fab`: level 3 by default (the spec), `lowered`\n * level 1, or `flat` level 0. @default \"default\"\n */\n elevation?: FabElevation;\n /**\n * How the items show: `list`, the expressive stack of pills above the button, or `menu`,\n * a standard menu 4px above it (M3's choice for the web and large windows).\n * @default \"list\"\n */\n presentation?: FabMenuPresentation;\n /**\n * While closed, shows `aria-label` in a plain tooltip on hover and keyboard focus, as M3\n * asks of FABs on the web. Open, the button is the close button and has no tooltip. It\n * steps aside inside your own `TooltipTrigger`. @default true\n */\n tooltip?: boolean;\n /**\n * Shows the button. Hiding it closes the menu, shrinks the button towards its centre and\n * fades it out; showing it expands it back (the FAB's appear / disappear motion). A\n * hidden menu is `inert`. @default true\n */\n visible?: boolean;\n /**\n * Plays the appearing animation when the menu mounts. Change its `key` on a page or tab\n * change to replay it. @default false\n */\n appear?: boolean;\n /** Two to six `FabMenuItem` elements, top to bottom. */\n children: ReactNode;\n /** Classes for each part, by slot. */\n classNames?: FabMenuClassNames;\n}\n\nexport type FabMenuProps = FabMenuOwnProps &\n AccessibleName &\n Omit<\n ComponentPropsWithRef<'div'>,\n keyof FabMenuOwnProps | 'aria-label' | 'aria-labelledby' | 'color'\n >;\n\nconst ITEM_SELECTOR = '[data-fab-menu-item]:not([inert])';\n\n/**\n * M3 Expressive FAB menu: a FAB that opens two to six related actions above it. The button\n * shrinks into a 56px close button while the items (`FabMenuItem`) appear one after\n * another from the button upwards, each springing out to its full width; on short windows\n * they scroll behind the close button. Under reduced motion the button changes at once and\n * the items fade in and out together. Position the menu on the window's trailing edge\n * with `className` (`fixed end-4 bottom-4`, and `end-6 bottom-6` in large windows). Keep it\n * out of normal flow: `fixed`, or at the bottom of a box. In flow, the open list pushes the\n * button down and can scroll the page.\n *\n * The button is named by `aria-label`, which it shows in a tooltip while closed, and reports\n * `aria-expanded`. Tab or ↓ moves from the button to the top item; ↑ / ↓ move between\n * items and back to the button. Escape, an outside press, focus leaving the menu or\n * choosing an item closes it. With `presentation=\"menu\"` the\n * button opens a standard `Menu` instead, with menu semantics and keyboard support.\n *\n * @example\n * <FabMenu icon={<AddIcon />} openIcon={<CloseIcon />} aria-label=\"Create\" className=\"fixed end-4 bottom-4\">\n * <FabMenuItem icon={<ReplyIcon />} onPress={reply}>Reply</FabMenuItem>\n * <FabMenuItem icon={<ArchiveIcon />} onPress={archive}>Archive</FabMenuItem>\n * </FabMenu>\n */\nexport function FabMenu({\n open,\n defaultOpen = false,\n onOpenChange,\n icon,\n openIcon,\n iconTransition,\n size,\n color,\n elevation,\n presentation = 'list',\n tooltip = true,\n visible = true,\n appear = false,\n children,\n classNames,\n className,\n ref,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n}: FabMenuProps) {\n const [isOpenState, setOpen] = useControlledState(open, defaultOpen, onOpenChange);\n const isOpen = isOpenState && visible;\n const items = Children.toArray(children).filter(isValidElement<FabMenuItemProps>);\n const total = items.length;\n if (process.env.NODE_ENV !== 'production' && (total < 2 || total > 6)) {\n console.warn(\n `[@windmorph/react] A FabMenu holds 2 to 6 items (M3); this one has ${total}. Use a FAB for a single action.`,\n );\n }\n const isMenu = presentation === 'menu';\n const styles = fabMenuStyles({ size, color, elevation });\n const menuColor = color ?? 'primary';\n const listId = useId();\n const rootRef = useObjectRef(ref);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n // Hiding the button closes the menu.\n useEffect(() => {\n if (!visible && isOpenState) setOpen(false);\n }, [visible, isOpenState, setOpen]);\n\n // The visible item count steps through Compose's stagger spring (fab-menu-stagger.ts);\n // under reduced motion every item shows and hides with the menu, in the same render.\n const reducedMotion = useReducedMotion() ?? false;\n const target = isOpen ? total : 0;\n const [staggered, setStaggered] = useState(target);\n const count = reducedMotion ? target : staggered;\n const countRef = useRef(count);\n useEffect(() => {\n if (reducedMotion) {\n countRef.current = target;\n return;\n }\n const steps = staggerSteps(countRef.current, target);\n const timers = steps.map(({ at, count: next }) =>\n setTimeout(() => {\n countRef.current = next;\n setStaggered(next);\n }, at),\n );\n return () => timers.forEach(clearTimeout);\n }, [target, reducedMotion]);\n\n // The list stays laid out until the last item has faded.\n const { isPresent, exitProps } = usePresence(isOpen || count > 0);\n\n const close = () => {\n if (listRef.current?.contains(document.activeElement)) buttonRef.current?.focus();\n setOpen(false);\n };\n\n useInteractOutside({ ref: rootRef, onInteractOutside: close, isDisabled: !isOpen || isMenu });\n\n // Tabbing out of the open menu closes it, as an outside press does, so the open list never\n // covers what takes focus next (M3: don't obscure the focus indicator; 2026-10-15). Focus\n // leaving the window (no new target) keeps it open. Always tracked, so focus that came in\n // while it was closed (the button, then Enter) closes it too as it leaves (2026-10-17).\n const { focusWithinProps } = useFocusWithin({\n onBlurWithin: (event) => {\n if (!isOpen || isMenu) return;\n const next = event.relatedTarget;\n if (next instanceof Node && !rootRef.current?.contains(next)) setOpen(false);\n },\n });\n\n // A list taller than the window scrolls; it opens showing the items nearest the button.\n useLayoutEffect(() => {\n const list = listRef.current;\n if (isOpen && list) list.scrollTop = list.scrollHeight;\n }, [isOpen]);\n\n const focusItem = (from: Element, step: 1 | -1) => {\n const all = [...(listRef.current?.querySelectorAll<HTMLElement>(ITEM_SELECTOR) ?? [])];\n const index = all.indexOf(from as HTMLElement);\n const next = index === -1 ? all[0] : all[index + step];\n (next ?? buttonRef.current)?.focus();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (!isOpen || isMenu) return;\n const onButton = event.target === buttonRef.current;\n if (event.key === 'Escape') {\n event.preventDefault();\n buttonRef.current?.focus();\n setOpen(false);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n focusItem(event.target as Element, 1);\n } else if (event.key === 'ArrowUp' && !onButton) {\n event.preventDefault();\n focusItem(event.target as Element, -1);\n }\n };\n\n const context: FabMenuContextValue = {\n styles,\n firstVisible: total - count,\n count: total,\n close,\n onLastExit: exitProps.onTransitionEnd,\n };\n\n const toggle = (\n <ButtonBase\n ref={buttonRef}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...(isMenu\n ? {}\n : {\n 'aria-expanded': isOpen,\n 'aria-controls': isPresent ? listId : undefined,\n onPress: () => setOpen(!isOpen),\n })}\n data-open={(isOpen && !isMenu) || undefined}\n data-slot=\"button\"\n // Closed, the button is a FAB of the menu's container colour, painted by its tokens.\n data-tokens=\"md-comp-fab\"\n data-color={`${menuColor}-container`}\n className={styles.button({ class: classNames?.button })}\n >\n <span aria-hidden=\"true\" className={styles.icon({ class: classNames?.icon })}>\n {openIcon ? (\n <IconFaces\n icon={icon}\n alternateIcon={openIcon}\n alternate={isOpen && !isMenu}\n transition={iconTransition}\n />\n ) : (\n icon\n )}\n </span>\n </ButtonBase>\n );\n\n const button = (\n <span\n data-hidden={visible ? undefined : true}\n data-appear={appear || undefined}\n className={styles.anchor({ class: classNames?.anchor })}\n >\n {tooltip && ariaLabel ? (\n <FabTooltip available={!isOpen} label={ariaLabel} className={classNames?.tooltip}>\n {toggle}\n </FabTooltip>\n ) : (\n toggle\n )}\n </span>\n );\n\n return (\n <div\n {...mergeProps(rest, focusWithinProps)}\n ref={rootRef}\n inert={!visible || undefined}\n // The component tokens' hook (fab-menu-tokens.ts).\n data-tokens={mergeDataTokens('md-comp-fab-menu', rest)}\n data-color={menuColor}\n data-item-color={`${menuColor}-container`}\n data-open={isOpen || undefined}\n data-presentation={presentation}\n className={styles.root({ class: cn(classNames?.root, className) })}\n // The app's own handler runs first, then the menu's keys.\n onKeyDown={(event) => {\n rest.onKeyDown?.(event);\n onKeyDown(event);\n }}\n >\n {isMenu ? (\n <MenuTrigger open={isOpen} onOpenChange={setOpen}>\n {button}\n <Menu\n placement=\"top-end\"\n offset={4}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n classNames={{ panel: styles.menu({ class: classNames?.menu }) }}\n >\n {items.map((item) => (\n <MenuItem\n key={item.key ?? undefined}\n leadingIcon={item.props.icon}\n {...menuItemAction(item.props)}\n className={item.props.className}\n >\n {item.props.children}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n ) : (\n <>\n {button}\n <div\n ref={listRef}\n id={listId}\n hidden={!isPresent}\n className={styles.list({ class: classNames?.list })}\n >\n {/* An enclosing trigger (e.g. a TooltipTrigger) is for the button, not the items. */}\n <TriggerContext value={null}>\n <FabMenuContext value={context}>\n {items.map((item, index) => (\n <ItemIndexContext key={item.key} value={index}>\n {item}\n </ItemIndexContext>\n ))}\n </FabMenuContext>\n </TriggerContext>\n </div>\n </>\n )}\n </div>\n );\n}\n\n/**\n * A `FabMenuItem`'s action for a `MenuItem`. Menu items are React Stately collection items,\n * which keep any prop; React Aria's `useMenuItem` runs an item's `onAction` and opens its\n * `href` through the router.\n */\nfunction menuItemAction({ onAction, href }: FabMenuItemProps): Partial<MenuItemProps> {\n return { onAction, href } as Partial<MenuItemProps>;\n}\n\nexport interface FabMenuItemClassNames {\n /** The item's button, link or menu item, merged with `className`. */\n root?: string;\n /** The row holding the icon and the label. */\n content?: string;\n /** The icon. */\n icon?: string;\n /** The item's label text. */\n label?: string;\n}\n\ninterface FabMenuItemOwnProps {\n /**\n * The item's icon. Hidden from assistive tech; the label names the item. M3 asks for an\n * icon on every item, since it tells the items apart; leave it out only if necessary.\n */\n icon?: ReactElement;\n /** The label, which M3 always requires. */\n children: ReactNode;\n /**\n * Runs when the item is chosen, in either presentation. (`onPress` works only in the\n * list, since a menu item has no press event.)\n */\n onAction?: () => void;\n /** Classes for each part, by slot. */\n classNames?: FabMenuItemClassNames;\n}\n\ntype OmitItem<T> = Omit<T, keyof FabMenuItemOwnProps | 'disabled' | 'toggle'>;\n\nexport type FabMenuItemProps = FabMenuItemOwnProps &\n (OmitItem<ButtonBaseActionProps> | OmitItem<ButtonBaseLinkProps>);\n\n/**\n * An action in a {@link FabMenu}: a 56px pill with an icon and a label (or, with\n * `presentation=\"menu\"`, a menu item). Choosing it calls `onAction` (and, in the list,\n * `onPress`), or follows `href`, and closes the menu.\n */\nexport function FabMenuItem({\n icon,\n children,\n classNames,\n className,\n style,\n onPress,\n onAction,\n ...rest\n}: FabMenuItemProps) {\n const menu = useContext(FabMenuContext);\n if (!menu) throw new Error('FabMenuItem must be rendered inside a FabMenu');\n const index = useContext(ItemIndexContext);\n const visible = index >= menu.firstVisible;\n const isLast = index === menu.count - 1;\n const { styles } = menu;\n\n // The item's width springs between 0 and its content's natural width.\n const contentRef = useRef<HTMLSpanElement>(null);\n const [width, setWidth] = useState(0);\n useLayoutEffect(() => {\n const content = contentRef.current;\n if (!content) return;\n const measure = () => setWidth(content.offsetWidth);\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(content);\n return () => observer.disconnect();\n }, []);\n // The list is hidden while the menu is closed, where the content measures 0; measure it\n // again as the item shows, before paint, so it never shows a frame at width 0.\n useLayoutEffect(() => {\n const content = contentRef.current;\n if (visible && content) setWidth(content.offsetWidth);\n }, [visible]);\n\n const props = {\n ...rest,\n inert: !visible,\n 'data-visible': visible || undefined,\n 'data-fab-menu-item': '',\n 'data-slot': 'item',\n style: { ...style, width: visible ? width : 0 },\n className: styles.item({ class: cn(classNames?.root, className) }),\n onPress: (event: Parameters<NonNullable<ButtonBaseActionProps['onPress']>>[0]) => {\n onPress?.(event);\n onAction?.();\n menu.close();\n },\n onTransitionEnd: isLast ? menu.onLastExit : undefined,\n };\n\n return (\n <ButtonBase {...(props as ButtonBaseActionProps)}>\n <span ref={contentRef} className={styles.itemContent({ class: classNames?.content })}>\n {icon && (\n <span\n aria-hidden=\"true\"\n data-slot=\"item-icon\"\n className={styles.itemIcon({ class: classNames?.icon })}\n >\n {icon}\n </span>\n )}\n <span className={classNames?.label}>{children}</span>\n </span>\n </ButtonBase>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { SPRINGS } from "../../tokens/motion.js";
|
|
2
|
+
//#region src/components/fab-menu/fab-menu-stagger.ts
|
|
3
|
+
const STAGGER_SPRING = SPRINGS.expressive.effects.slow;
|
|
4
|
+
/** Normalised step response (0 → 1, starting at rest) of a spring at `seconds`. */
|
|
5
|
+
function springStep({ dampingRatio, stiffness }, seconds) {
|
|
6
|
+
const omega = Math.sqrt(stiffness);
|
|
7
|
+
if (dampingRatio >= 1) return 1 - (1 + omega * seconds) * Math.exp(-omega * seconds);
|
|
8
|
+
const decay = dampingRatio * omega;
|
|
9
|
+
const omegaD = omega * Math.sqrt(1 - dampingRatio * dampingRatio);
|
|
10
|
+
return 1 - Math.exp(-decay * seconds) * (Math.cos(omegaD * seconds) + decay / omegaD * Math.sin(omegaD * seconds));
|
|
11
|
+
}
|
|
12
|
+
/** Milliseconds until the (monotonic) step response first reaches `fraction`. */
|
|
13
|
+
function timeToReach(fraction, spring) {
|
|
14
|
+
if (fraction <= 0) return 0;
|
|
15
|
+
let lo = 0;
|
|
16
|
+
let hi = .05;
|
|
17
|
+
while (springStep(spring, hi) < fraction) hi *= 2;
|
|
18
|
+
for (let i = 0; i < 50; i++) {
|
|
19
|
+
const mid = (lo + hi) / 2;
|
|
20
|
+
if (springStep(spring, mid) < fraction) lo = mid;
|
|
21
|
+
else hi = mid;
|
|
22
|
+
}
|
|
23
|
+
return Math.round(hi * 1e3);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* When the visible count steps while springing from `from` to `to` items, starting at rest.
|
|
27
|
+
* Opening shows the item nearest the button first; closing hides the farthest first.
|
|
28
|
+
*/
|
|
29
|
+
function staggerSteps(from, to, spring = STAGGER_SPRING) {
|
|
30
|
+
const steps = [];
|
|
31
|
+
const span = Math.abs(to - from);
|
|
32
|
+
if (span === 0) return steps;
|
|
33
|
+
const end = timeToReach((span - 1) / span, spring);
|
|
34
|
+
if (to > from) for (let m = from + 1; m < to; m++) steps.push({
|
|
35
|
+
at: timeToReach((m - from) / span, spring),
|
|
36
|
+
count: m
|
|
37
|
+
});
|
|
38
|
+
else for (let m = from; m > to + 1; m--) steps.push({
|
|
39
|
+
at: timeToReach((from - m) / span, spring),
|
|
40
|
+
count: m - 1
|
|
41
|
+
});
|
|
42
|
+
steps.push({
|
|
43
|
+
at: end,
|
|
44
|
+
count: to
|
|
45
|
+
});
|
|
46
|
+
return steps;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { springStep, staggerSteps };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=fab-menu-stagger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab-menu-stagger.js","names":[],"sources":["../../../src/components/fab-menu/fab-menu-stagger.ts"],"sourcesContent":["import { SPRINGS, type SpringToken } from '../../tokens/motion';\n\n/*\n * Compose's FloatingActionButtonMenu animates the number of visible items as an Int on the\n * slow effects spring (identical in both motion schemes) with a visibility threshold of 1\n * item. The Int is the truncated spring value, and the spring ends (snapping to its\n * target) once it is within one item of it. Each item then animates its own width and\n * opacity. These functions give the times at which the visible count steps.\n */\n\nconst STAGGER_SPRING = SPRINGS.expressive.effects.slow;\n\n/** Normalised step response (0 → 1, starting at rest) of a spring at `seconds`. */\nexport function springStep({ dampingRatio, stiffness }: SpringToken, seconds: number): number {\n const omega = Math.sqrt(stiffness);\n if (dampingRatio >= 1) {\n // Critically damped (effects springs): 1 − (1 + ωt)e^(−ωt).\n return 1 - (1 + omega * seconds) * Math.exp(-omega * seconds);\n }\n const decay = dampingRatio * omega;\n const omegaD = omega * Math.sqrt(1 - dampingRatio * dampingRatio);\n return (\n 1 -\n Math.exp(-decay * seconds) *\n (Math.cos(omegaD * seconds) + (decay / omegaD) * Math.sin(omegaD * seconds))\n );\n}\n\n/** Milliseconds until the (monotonic) step response first reaches `fraction`. */\nfunction timeToReach(fraction: number, spring: SpringToken): number {\n if (fraction <= 0) return 0;\n let lo = 0;\n let hi = 0.05;\n while (springStep(spring, hi) < fraction) hi *= 2;\n for (let i = 0; i < 50; i++) {\n const mid = (lo + hi) / 2;\n if (springStep(spring, mid) < fraction) lo = mid;\n else hi = mid;\n }\n return Math.round(hi * 1000);\n}\n\nexport interface StaggerStep {\n /** Milliseconds after the change. */\n at: number;\n /** Visible items (counted from the button upwards) from this time on. */\n count: number;\n}\n\n/**\n * When the visible count steps while springing from `from` to `to` items, starting at rest.\n * Opening shows the item nearest the button first; closing hides the farthest first.\n */\nexport function staggerSteps(from: number, to: number, spring = STAGGER_SPRING): StaggerStep[] {\n const steps: StaggerStep[] = [];\n const span = Math.abs(to - from);\n if (span === 0) return steps;\n // The spring ends within one item of the target, then snaps to it.\n const end = timeToReach((span - 1) / span, spring);\n if (to > from) {\n // The truncated value reaches m when from + span·s ≥ m.\n for (let m = from + 1; m < to; m++) {\n steps.push({ at: timeToReach((m - from) / span, spring), count: m });\n }\n } else {\n // The truncated value drops below m (to m − 1) once from − span·s < m.\n for (let m = from; m > to + 1; m--) {\n steps.push({ at: timeToReach((from - m) / span, spring), count: m - 1 });\n }\n }\n steps.push({ at: end, count: to });\n return steps;\n}\n"],"mappings":";;AAUA,MAAM,iBAAiB,QAAQ,WAAW,QAAQ;;AAGlD,SAAgB,WAAW,EAAE,cAAc,aAA0B,SAAyB;CAC5F,MAAM,QAAQ,KAAK,KAAK,SAAS;CACjC,IAAI,gBAAgB,GAElB,OAAO,KAAK,IAAI,QAAQ,WAAW,KAAK,IAAI,CAAC,QAAQ,OAAO;CAE9D,MAAM,QAAQ,eAAe;CAC7B,MAAM,SAAS,QAAQ,KAAK,KAAK,IAAI,eAAe,YAAY;CAChE,OACE,IACA,KAAK,IAAI,CAAC,QAAQ,OAAO,KACtB,KAAK,IAAI,SAAS,OAAO,IAAK,QAAQ,SAAU,KAAK,IAAI,SAAS,OAAO;AAEhF;;AAGA,SAAS,YAAY,UAAkB,QAA6B;CAClE,IAAI,YAAY,GAAG,OAAO;CAC1B,IAAI,KAAK;CACT,IAAI,KAAK;CACT,OAAO,WAAW,QAAQ,EAAE,IAAI,UAAU,MAAM;CAChD,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;EAC3B,MAAM,OAAO,KAAK,MAAM;EACxB,IAAI,WAAW,QAAQ,GAAG,IAAI,UAAU,KAAK;OACxC,KAAK;CACZ;CACA,OAAO,KAAK,MAAM,KAAK,GAAI;AAC7B;;;;;AAaA,SAAgB,aAAa,MAAc,IAAY,SAAS,gBAA+B;CAC7F,MAAM,QAAuB,CAAC;CAC9B,MAAM,OAAO,KAAK,IAAI,KAAK,IAAI;CAC/B,IAAI,SAAS,GAAG,OAAO;CAEvB,MAAM,MAAM,aAAa,OAAO,KAAK,MAAM,MAAM;CACjD,IAAI,KAAK,MAEP,KAAK,IAAI,IAAI,OAAO,GAAG,IAAI,IAAI,KAC7B,MAAM,KAAK;EAAE,IAAI,aAAa,IAAI,QAAQ,MAAM,MAAM;EAAG,OAAO;CAAE,CAAC;MAIrE,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,GAAG,KAC7B,MAAM,KAAK;EAAE,IAAI,aAAa,OAAO,KAAK,MAAM,MAAM;EAAG,OAAO,IAAI;CAAE,CAAC;CAG3E,MAAM,KAAK;EAAE,IAAI;EAAK,OAAO;CAAG,CAAC;CACjC,OAAO;AACT"}
|