@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,115 @@
|
|
|
1
|
+
import { color, corner, defineComponentTokens, elevation } from "../../tokens/component.js";
|
|
2
|
+
//#region src/components/sheet/sheet-tokens.ts
|
|
3
|
+
const paintsContainer = { property: "background-color" };
|
|
4
|
+
const paintsElevation = { property: "box-shadow" };
|
|
5
|
+
/** The tokens of {@link BottomSheet}: `--md-comp-sheet-bottom-docked-[<variant>-]<part>`. */
|
|
6
|
+
const bottomSheetTokenSet = defineComponentTokens({
|
|
7
|
+
name: "md-comp-sheet-bottom-docked",
|
|
8
|
+
tokens: {
|
|
9
|
+
"container-color": {
|
|
10
|
+
value: color("surface-container-low"),
|
|
11
|
+
description: "The sheet.",
|
|
12
|
+
compose: "SheetBottomTokens.DockedContainerColor",
|
|
13
|
+
paints: paintsContainer
|
|
14
|
+
},
|
|
15
|
+
"container-shape": {
|
|
16
|
+
value: corner("extra-large"),
|
|
17
|
+
description: "The sheet's top corners.",
|
|
18
|
+
compose: "SheetBottomTokens.DockedContainerShape",
|
|
19
|
+
paints: { property: "border-top-left-radius" }
|
|
20
|
+
},
|
|
21
|
+
"drag-handle-color": {
|
|
22
|
+
value: color("on-surface-variant"),
|
|
23
|
+
description: "The drag handle.",
|
|
24
|
+
compose: "SheetBottomTokens.DockedDragHandleColor",
|
|
25
|
+
paints: {
|
|
26
|
+
property: "background-color",
|
|
27
|
+
slot: "drag-handle"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
scopes: { variant: {
|
|
32
|
+
modal: {
|
|
33
|
+
prefix: "md-comp-sheet-bottom-docked-modal",
|
|
34
|
+
tokens: { "container-elevation": {
|
|
35
|
+
value: elevation(1),
|
|
36
|
+
description: "The shadow of a modal sheet.",
|
|
37
|
+
compose: "SheetBottomTokens.DockedModalContainerElevation",
|
|
38
|
+
paints: paintsElevation
|
|
39
|
+
} }
|
|
40
|
+
},
|
|
41
|
+
standard: {
|
|
42
|
+
prefix: "md-comp-sheet-bottom-docked-standard",
|
|
43
|
+
tokens: { "container-elevation": {
|
|
44
|
+
value: elevation(1),
|
|
45
|
+
description: "The shadow of a standard sheet.",
|
|
46
|
+
compose: "SheetBottomTokens.DockedStandardContainerElevation",
|
|
47
|
+
paints: paintsElevation
|
|
48
|
+
} }
|
|
49
|
+
}
|
|
50
|
+
} }
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* The tokens of {@link SideSheet}: `--md-comp-sheet-side-docked-<variant>-<part>`, and
|
|
54
|
+
* `--md-comp-sheet-side-detached-container-shape` for a detached sheet.
|
|
55
|
+
*/
|
|
56
|
+
const sideSheetTokenSet = defineComponentTokens({
|
|
57
|
+
name: "md-comp-sheet-side",
|
|
58
|
+
tokens: {},
|
|
59
|
+
scopes: {
|
|
60
|
+
variant: {
|
|
61
|
+
modal: {
|
|
62
|
+
prefix: "md-comp-sheet-side-docked-modal",
|
|
63
|
+
tokens: {
|
|
64
|
+
"container-color": {
|
|
65
|
+
value: color("surface-container-low"),
|
|
66
|
+
description: "A modal sheet.",
|
|
67
|
+
compose: "m3_comp_sheet_side_docked_modal_container_color",
|
|
68
|
+
paints: paintsContainer
|
|
69
|
+
},
|
|
70
|
+
"container-elevation": {
|
|
71
|
+
value: elevation(1),
|
|
72
|
+
description: "The shadow of a modal sheet.",
|
|
73
|
+
compose: "m3_comp_sheet_side_docked_modal_container_elevation",
|
|
74
|
+
paints: paintsElevation
|
|
75
|
+
},
|
|
76
|
+
"container-shape": {
|
|
77
|
+
value: corner("large"),
|
|
78
|
+
description: "A docked modal sheet's corners on its free edge.",
|
|
79
|
+
compose: "m3_comp_sheet_side_docked_modal_container_shape",
|
|
80
|
+
paints: { property: "border-top-left-radius" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
standard: {
|
|
85
|
+
prefix: "md-comp-sheet-side-docked-standard",
|
|
86
|
+
tokens: { "container-color": {
|
|
87
|
+
value: color("surface"),
|
|
88
|
+
description: "A standard sheet, beside the content.",
|
|
89
|
+
compose: "m3_comp_sheet_side_docked_standard_container_color",
|
|
90
|
+
paints: {
|
|
91
|
+
property: "background-color",
|
|
92
|
+
slot: "panel"
|
|
93
|
+
}
|
|
94
|
+
} },
|
|
95
|
+
fixed: {
|
|
96
|
+
"container-elevation": elevation(0),
|
|
97
|
+
"container-shape": "0px"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
detached: { true: {
|
|
102
|
+
prefix: "md-comp-sheet-side-detached",
|
|
103
|
+
tokens: { "container-shape": {
|
|
104
|
+
value: corner("large"),
|
|
105
|
+
description: "A detached sheet's corners, all round.",
|
|
106
|
+
compose: "m3_comp_sheet_side_detached_container_shape",
|
|
107
|
+
paints: { property: "border-top-left-radius" }
|
|
108
|
+
} }
|
|
109
|
+
} }
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
//#endregion
|
|
113
|
+
export { bottomSheetTokenSet, sideSheetTokenSet };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=sheet-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-tokens.js","names":[],"sources":["../../../src/components/sheet/sheet-tokens.ts"],"sourcesContent":["import { color, corner, defineComponentTokens, elevation } from '../../tokens/component';\n\n/*\n * The sheets' component tokens, M3's `md.comp.sheet.bottom.*` and `md.comp.sheet.side.*`\n * names (checked against m3.material.io's token tables, 2026-10-14), with Compose's\n * SheetBottomTokens defaults and Material Components Android's `m3_comp_sheet_side_*` values\n * (side sheets aren't in Compose). Each sheet's root carries its set's `data-tokens` and\n * `data-variant` (and a detached side sheet `data-detached`), and `sheet-styles.ts` reads one\n * private variable per part. No scrim token: M3 has none, so scrims stay on\n * `--md-sys-color-scrim`. Sizes, margins and dividers stay classes.\n */\n\nconst paintsContainer = { property: 'background-color' } as const;\nconst paintsElevation = { property: 'box-shadow' } as const;\n\n/** The tokens of {@link BottomSheet}: `--md-comp-sheet-bottom-docked-[<variant>-]<part>`. */\nexport const bottomSheetTokenSet = defineComponentTokens({\n name: 'md-comp-sheet-bottom-docked',\n tokens: {\n 'container-color': {\n value: color('surface-container-low'),\n description: 'The sheet.',\n compose: 'SheetBottomTokens.DockedContainerColor',\n paints: paintsContainer,\n },\n 'container-shape': {\n value: corner('extra-large'),\n description: \"The sheet's top corners.\",\n compose: 'SheetBottomTokens.DockedContainerShape',\n paints: { property: 'border-top-left-radius' },\n },\n 'drag-handle-color': {\n value: color('on-surface-variant'),\n description: 'The drag handle.',\n compose: 'SheetBottomTokens.DockedDragHandleColor',\n paints: { property: 'background-color', slot: 'drag-handle' },\n },\n },\n scopes: {\n variant: {\n modal: {\n prefix: 'md-comp-sheet-bottom-docked-modal',\n tokens: {\n 'container-elevation': {\n value: elevation(1),\n description: 'The shadow of a modal sheet.',\n compose: 'SheetBottomTokens.DockedModalContainerElevation',\n paints: paintsElevation,\n },\n },\n },\n standard: {\n prefix: 'md-comp-sheet-bottom-docked-standard',\n tokens: {\n 'container-elevation': {\n value: elevation(1),\n description: 'The shadow of a standard sheet.',\n compose: 'SheetBottomTokens.DockedStandardContainerElevation',\n paints: paintsElevation,\n },\n },\n },\n },\n },\n});\n\n/**\n * The tokens of {@link SideSheet}: `--md-comp-sheet-side-docked-<variant>-<part>`, and\n * `--md-comp-sheet-side-detached-container-shape` for a detached sheet.\n */\nexport const sideSheetTokenSet = defineComponentTokens({\n name: 'md-comp-sheet-side',\n tokens: {},\n scopes: {\n variant: {\n modal: {\n prefix: 'md-comp-sheet-side-docked-modal',\n tokens: {\n 'container-color': {\n value: color('surface-container-low'),\n description: 'A modal sheet.',\n compose: 'm3_comp_sheet_side_docked_modal_container_color',\n paints: paintsContainer,\n },\n 'container-elevation': {\n value: elevation(1),\n description: 'The shadow of a modal sheet.',\n compose: 'm3_comp_sheet_side_docked_modal_container_elevation',\n paints: paintsElevation,\n },\n 'container-shape': {\n value: corner('large'),\n description: \"A docked modal sheet's corners on its free edge.\",\n compose: 'm3_comp_sheet_side_docked_modal_container_shape',\n paints: { property: 'border-top-left-radius' },\n },\n },\n },\n standard: {\n prefix: 'md-comp-sheet-side-docked-standard',\n tokens: {\n 'container-color': {\n value: color('surface'),\n description: 'A standard sheet, beside the content.',\n compose: 'm3_comp_sheet_side_docked_standard_container_color',\n paints: { property: 'background-color', slot: 'panel' },\n },\n },\n fixed: { 'container-elevation': elevation(0), 'container-shape': '0px' },\n },\n },\n // After `variant`, so a detached sheet's corners win over the docked ones.\n detached: {\n true: {\n prefix: 'md-comp-sheet-side-detached',\n tokens: {\n 'container-shape': {\n value: corner('large'),\n description: \"A detached sheet's corners, all round.\",\n compose: 'm3_comp_sheet_side_detached_container_shape',\n paints: { property: 'border-top-left-radius' },\n },\n },\n },\n },\n },\n});\n"],"mappings":";;AAYA,MAAM,kBAAkB,EAAE,UAAU,mBAAmB;AACvD,MAAM,kBAAkB,EAAE,UAAU,aAAa;;AAGjD,MAAa,sBAAsB,sBAAsB;CACvD,MAAM;CACN,QAAQ;EACN,mBAAmB;GACjB,OAAO,MAAM,uBAAuB;GACpC,aAAa;GACb,SAAS;GACT,QAAQ;EACV;EACA,mBAAmB;GACjB,OAAO,OAAO,aAAa;GAC3B,aAAa;GACb,SAAS;GACT,QAAQ,EAAE,UAAU,yBAAyB;EAC/C;EACA,qBAAqB;GACnB,OAAO,MAAM,oBAAoB;GACjC,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAoB,MAAM;GAAc;EAC9D;CACF;CACA,QAAQ,EACN,SAAS;EACP,OAAO;GACL,QAAQ;GACR,QAAQ,EACN,uBAAuB;IACrB,OAAO,UAAU,CAAC;IAClB,aAAa;IACb,SAAS;IACT,QAAQ;GACV,EACF;EACF;EACA,UAAU;GACR,QAAQ;GACR,QAAQ,EACN,uBAAuB;IACrB,OAAO,UAAU,CAAC;IAClB,aAAa;IACb,SAAS;IACT,QAAQ;GACV,EACF;EACF;CACF,EACF;AACF,CAAC;;;;;AAMD,MAAa,oBAAoB,sBAAsB;CACrD,MAAM;CACN,QAAQ,CAAC;CACT,QAAQ;EACN,SAAS;GACP,OAAO;IACL,QAAQ;IACR,QAAQ;KACN,mBAAmB;MACjB,OAAO,MAAM,uBAAuB;MACpC,aAAa;MACb,SAAS;MACT,QAAQ;KACV;KACA,uBAAuB;MACrB,OAAO,UAAU,CAAC;MAClB,aAAa;MACb,SAAS;MACT,QAAQ;KACV;KACA,mBAAmB;MACjB,OAAO,OAAO,OAAO;MACrB,aAAa;MACb,SAAS;MACT,QAAQ,EAAE,UAAU,yBAAyB;KAC/C;IACF;GACF;GACA,UAAU;IACR,QAAQ;IACR,QAAQ,EACN,mBAAmB;KACjB,OAAO,MAAM,SAAS;KACtB,aAAa;KACb,SAAS;KACT,QAAQ;MAAE,UAAU;MAAoB,MAAM;KAAQ;IACxD,EACF;IACA,OAAO;KAAE,uBAAuB,UAAU,CAAC;KAAG,mBAAmB;IAAM;GACzE;EACF;EAEA,UAAU,EACR,MAAM;GACJ,QAAQ;GACR,QAAQ,EACN,mBAAmB;IACjB,OAAO,OAAO,OAAO;IACrB,aAAa;IACb,SAAS;IACT,QAAQ,EAAE,UAAU,yBAAyB;GAC/C,EACF;EACF,EACF;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/sheet/side-swipe-gesture.ts
|
|
2
|
+
/**
|
|
3
|
+
* Decides what a touch on a modal side sheet does, from how far it has moved (`dx`, `dy`,
|
|
4
|
+
* px; `dx` positive rightwards), the sheet's `edge` and the layout `direction`. Until it
|
|
5
|
+
* moves past {@link DRAG_SLOP} it is undecided; then a move more vertical than sideways is
|
|
6
|
+
* the browser's (`scroll`: the content scrolls natively), a sideways move toward the sheet's
|
|
7
|
+
* edge drags the sheet, and one away from it is ignored. The end edge is the right in LTR
|
|
8
|
+
* and the left in RTL. Callers keep the first decision until the pointer lifts.
|
|
9
|
+
*/
|
|
10
|
+
function sideSwipeGesture(dx, dy, edge, direction) {
|
|
11
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) <= 4) return "undecided";
|
|
12
|
+
if (Math.abs(dy) > Math.abs(dx)) return "scroll";
|
|
13
|
+
return Math.sign(dx) === edgeSign(edge, direction) ? "drag" : "ignore";
|
|
14
|
+
}
|
|
15
|
+
/** The physical sign (+1 right, -1 left) of the way toward a side sheet's `edge`. */
|
|
16
|
+
function edgeSign(edge, direction) {
|
|
17
|
+
return edge === "end" === (direction === "ltr") ? 1 : -1;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { edgeSign, sideSwipeGesture };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=side-swipe-gesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-swipe-gesture.js","names":[],"sources":["../../../src/components/sheet/side-swipe-gesture.ts"],"sourcesContent":["import { DRAG_SLOP } from './sheet-gesture';\n\n/** What a touch on a modal side sheet does once it moves. */\nexport type SwipeGesture = 'undecided' | 'drag' | 'scroll' | 'ignore';\n\n/**\n * Decides what a touch on a modal side sheet does, from how far it has moved (`dx`, `dy`,\n * px; `dx` positive rightwards), the sheet's `edge` and the layout `direction`. Until it\n * moves past {@link DRAG_SLOP} it is undecided; then a move more vertical than sideways is\n * the browser's (`scroll`: the content scrolls natively), a sideways move toward the sheet's\n * edge drags the sheet, and one away from it is ignored. The end edge is the right in LTR\n * and the left in RTL. Callers keep the first decision until the pointer lifts.\n */\nexport function sideSwipeGesture(\n dx: number,\n dy: number,\n edge: 'start' | 'end',\n direction: 'ltr' | 'rtl',\n): SwipeGesture {\n if (Math.max(Math.abs(dx), Math.abs(dy)) <= DRAG_SLOP) return 'undecided';\n if (Math.abs(dy) > Math.abs(dx)) return 'scroll';\n return Math.sign(dx) === edgeSign(edge, direction) ? 'drag' : 'ignore';\n}\n\n/** The physical sign (+1 right, -1 left) of the way toward a side sheet's `edge`. */\nexport function edgeSign(edge: 'start' | 'end', direction: 'ltr' | 'rtl'): 1 | -1 {\n return (edge === 'end') === (direction === 'ltr') ? 1 : -1;\n}\n"],"mappings":";;;;;;;;;AAaA,SAAgB,iBACd,IACA,IACA,MACA,WACc;CACd,IAAI,KAAK,IAAI,KAAK,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC,KAAA,GAAgB,OAAO;CAC9D,IAAI,KAAK,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,GAAG,OAAO;CACxC,OAAO,KAAK,KAAK,EAAE,MAAM,SAAS,MAAM,SAAS,IAAI,SAAS;AAChE;;AAGA,SAAgB,SAAS,MAAuB,WAAkC;CAChF,OAAQ,SAAS,WAAY,cAAc,SAAS,IAAI;AAC1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
//#region src/components/sheet/use-peek-inert.ts
|
|
4
|
+
/**
|
|
5
|
+
* Makes the parts of a collapsed standard bottom sheet that lie below its peek `inert`, so
|
|
6
|
+
* Tab and screen readers reach only what's on screen (WCAG 2.4.11 Focus Not Obscured). The
|
|
7
|
+
* content's top-level children are measured against the panel's top: one that doesn't fit
|
|
8
|
+
* entirely within `peekHeight` is inert until the sheet expands. With the default 56px peek
|
|
9
|
+
* that's all the content, leaving the drag handle, which expands the sheet; a taller peek
|
|
10
|
+
* keeps a summary row that fits in it reachable. `collapsed` comes from the panel's
|
|
11
|
+
* `data-detent`. If focus is in a part that becomes inert (Escape collapsed the sheet),
|
|
12
|
+
* it moves to `fallback` (the handle, or the panel) instead of falling to the page.
|
|
13
|
+
*/
|
|
14
|
+
function usePeekInert(panelRef, contentRef, collapsed, peekHeight, fallback) {
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
const panel = panelRef.current;
|
|
17
|
+
const content = contentRef.current;
|
|
18
|
+
if (!collapsed || !panel || !content) return;
|
|
19
|
+
const top = panel.getBoundingClientRect().top;
|
|
20
|
+
const active = panel.ownerDocument.activeElement;
|
|
21
|
+
const hidden = [...content.children].filter((child) => !child.hasAttribute("inert") && child.getBoundingClientRect().bottom - top > peekHeight + .5);
|
|
22
|
+
for (const child of hidden) child.setAttribute("inert", "");
|
|
23
|
+
if (active && hidden.some((child) => child.contains(active))) fallback()?.focus();
|
|
24
|
+
return () => {
|
|
25
|
+
for (const child of hidden) child.removeAttribute("inert");
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { usePeekInert };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=use-peek-inert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-peek-inert.js","names":[],"sources":["../../../src/components/sheet/use-peek-inert.ts"],"sourcesContent":["'use client';\n\nimport { useLayoutEffect, type RefObject } from 'react';\n\n/**\n * Makes the parts of a collapsed standard bottom sheet that lie below its peek `inert`, so\n * Tab and screen readers reach only what's on screen (WCAG 2.4.11 Focus Not Obscured). The\n * content's top-level children are measured against the panel's top: one that doesn't fit\n * entirely within `peekHeight` is inert until the sheet expands. With the default 56px peek\n * that's all the content, leaving the drag handle, which expands the sheet; a taller peek\n * keeps a summary row that fits in it reachable. `collapsed` comes from the panel's\n * `data-detent`. If focus is in a part that becomes inert (Escape collapsed the sheet),\n * it moves to `fallback` (the handle, or the panel) instead of falling to the page.\n */\nexport function usePeekInert(\n panelRef: RefObject<HTMLElement | null>,\n contentRef: RefObject<HTMLElement | null>,\n collapsed: boolean,\n peekHeight: number,\n fallback: () => HTMLElement | null,\n) {\n useLayoutEffect(() => {\n const panel = panelRef.current;\n const content = contentRef.current;\n if (!collapsed || !panel || !content) return;\n const top = panel.getBoundingClientRect().top;\n const active = panel.ownerDocument.activeElement;\n // Children the consumer made inert themselves are left alone.\n const hidden = [...content.children].filter(\n (child) =>\n !child.hasAttribute('inert') &&\n child.getBoundingClientRect().bottom - top > peekHeight + 0.5,\n );\n for (const child of hidden) child.setAttribute('inert', '');\n if (active && hidden.some((child) => child.contains(active))) fallback()?.focus();\n return () => {\n for (const child of hidden) child.removeAttribute('inert');\n };\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,aACd,UACA,YACA,WACA,YACA,UACA;CACA,sBAAsB;EACpB,MAAM,QAAQ,SAAS;EACvB,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS;EACtC,MAAM,MAAM,MAAM,sBAAsB,CAAC,CAAC;EAC1C,MAAM,SAAS,MAAM,cAAc;EAEnC,MAAM,SAAS,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,QAClC,UACC,CAAC,MAAM,aAAa,OAAO,KAC3B,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,aAAa,EAC9D;EACA,KAAK,MAAM,SAAS,QAAQ,MAAM,aAAa,SAAS,EAAE;EAC1D,IAAI,UAAU,OAAO,MAAM,UAAU,MAAM,SAAS,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,MAAM;EAChF,aAAa;GACX,KAAK,MAAM,SAAS,QAAQ,MAAM,gBAAgB,OAAO;EAC3D;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useThemeScope } from "../../theme/context.js";
|
|
3
|
+
import { ownsGesture } from "./sheet-gesture.js";
|
|
4
|
+
import { EXIT_DISTANCE, releaseMotion, releaseVelocity, settleTarget } from "./sheet-settle.js";
|
|
5
|
+
import { edgeSign, sideSwipeGesture } from "./side-swipe-gesture.js";
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
//#region src/components/sheet/use-side-swipe.ts
|
|
8
|
+
/** The share of the sheet's width a slow swipe must pass to close it (Compose's rail). */
|
|
9
|
+
const POSITIONAL_SHARE = .5;
|
|
10
|
+
/**
|
|
11
|
+
* Swipe to dismiss for a modal side sheet (touch and pen only; a mouse drag selects text).
|
|
12
|
+
* A touch on the panel is decided past the 4px slop (`sideSwipeGesture`): a vertical move is
|
|
13
|
+
* left to the browser, which scrolls the content; a sideways move away from the edge is
|
|
14
|
+
* ignored; one toward it drags the sheet, unless the content under it owns that drag (a
|
|
15
|
+
* field, a horizontal slider, a scroller that can still scroll that way). The sheet follows
|
|
16
|
+
* the finger with no transition, clamped at its open position, and on release settles as
|
|
17
|
+
* Compose's anchored drag does: a fling over 125px/s toward the edge or a drag past half its
|
|
18
|
+
* width closes it, anything else springs back, both continuing at the release speed. A
|
|
19
|
+
* close the app refuses (a controlled `open` left `true`) springs back too.
|
|
20
|
+
*
|
|
21
|
+
* Returns the panel's capture-phase pointer handlers, and the moving layer's attributes.
|
|
22
|
+
*/
|
|
23
|
+
function useSideSwipe({ enabled, edge, isOpen, close, panelRef, motionRef, contentRef }) {
|
|
24
|
+
const { motion: scheme } = useThemeScope();
|
|
25
|
+
const [offset, setOffset] = useState(0);
|
|
26
|
+
const [sign, setSign] = useState(1);
|
|
27
|
+
const [dragging, setDragging] = useState(false);
|
|
28
|
+
const [settleMotion, setSettleMotion] = useState(null);
|
|
29
|
+
const [closing, setClosing] = useState(false);
|
|
30
|
+
const pointer = useRef({
|
|
31
|
+
pending: false,
|
|
32
|
+
gesture: "undecided",
|
|
33
|
+
id: 0,
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
sign: 1,
|
|
37
|
+
direction: "ltr",
|
|
38
|
+
width: 0,
|
|
39
|
+
offset: 0,
|
|
40
|
+
target: null,
|
|
41
|
+
root: null,
|
|
42
|
+
samples: []
|
|
43
|
+
});
|
|
44
|
+
if (closing && isOpen) {
|
|
45
|
+
setClosing(false);
|
|
46
|
+
setSettleMotion(null);
|
|
47
|
+
setOffset(0);
|
|
48
|
+
}
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const panel = panelRef.current;
|
|
51
|
+
if (!panel || !enabled) return;
|
|
52
|
+
const onTouchMove = (event) => {
|
|
53
|
+
const current = pointer.current;
|
|
54
|
+
if (current.pending && current.gesture === "drag" && event.cancelable) event.preventDefault();
|
|
55
|
+
};
|
|
56
|
+
panel.addEventListener("touchmove", onTouchMove, { passive: false });
|
|
57
|
+
return () => panel.removeEventListener("touchmove", onTouchMove);
|
|
58
|
+
}, [enabled, panelRef]);
|
|
59
|
+
const settle = (velocity) => {
|
|
60
|
+
const current = pointer.current;
|
|
61
|
+
const { width } = current;
|
|
62
|
+
const target = settleTarget([0, width], 0, current.offset, velocity, width * POSITIONAL_SHARE);
|
|
63
|
+
const closes = width > 0 && target >= width - .5;
|
|
64
|
+
const end = closes ? width * EXIT_DISTANCE : 0;
|
|
65
|
+
setDragging(false);
|
|
66
|
+
setSettleMotion(releaseMotion(scheme, closes, velocity, end - current.offset));
|
|
67
|
+
if (closes) {
|
|
68
|
+
setClosing(true);
|
|
69
|
+
close();
|
|
70
|
+
} else setOffset(0);
|
|
71
|
+
};
|
|
72
|
+
const reset = () => {
|
|
73
|
+
pointer.current.pending = false;
|
|
74
|
+
setDragging(false);
|
|
75
|
+
setSettleMotion(null);
|
|
76
|
+
setOffset(0);
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
panelHandlers: {
|
|
80
|
+
onPointerDownCapture: (event) => {
|
|
81
|
+
const panel = panelRef.current;
|
|
82
|
+
const target = event.target;
|
|
83
|
+
if (!enabled || event.button !== 0 || event.pointerType === "mouse") return;
|
|
84
|
+
if (!panel?.contains(target)) return;
|
|
85
|
+
const content = contentRef.current;
|
|
86
|
+
const root = content?.contains(target) ? content : panel;
|
|
87
|
+
if (ownsGesture(target, root, "x")) return;
|
|
88
|
+
const direction = getComputedStyle(panel).direction === "rtl" ? "rtl" : "ltr";
|
|
89
|
+
setSettleMotion(null);
|
|
90
|
+
pointer.current = {
|
|
91
|
+
pending: true,
|
|
92
|
+
gesture: "undecided",
|
|
93
|
+
id: event.pointerId,
|
|
94
|
+
x: event.clientX,
|
|
95
|
+
y: event.clientY,
|
|
96
|
+
sign: edgeSign(edge, direction),
|
|
97
|
+
direction,
|
|
98
|
+
width: motionRef.current?.offsetWidth ?? 0,
|
|
99
|
+
offset: 0,
|
|
100
|
+
target,
|
|
101
|
+
root,
|
|
102
|
+
samples: [{
|
|
103
|
+
position: 0,
|
|
104
|
+
time: event.timeStamp
|
|
105
|
+
}]
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
onPointerMoveCapture: (event) => {
|
|
109
|
+
const current = pointer.current;
|
|
110
|
+
if (!current.pending || event.pointerId !== current.id) return;
|
|
111
|
+
const dx = event.clientX - current.x;
|
|
112
|
+
if (current.gesture === "undecided") {
|
|
113
|
+
let gesture = sideSwipeGesture(dx, event.clientY - current.y, edge, current.direction);
|
|
114
|
+
if (gesture === "undecided") return;
|
|
115
|
+
if (gesture === "drag" && current.target && current.root) {
|
|
116
|
+
if (ownsGesture(current.target, current.root, "x", dx)) gesture = "ignore";
|
|
117
|
+
}
|
|
118
|
+
current.gesture = gesture;
|
|
119
|
+
if (gesture !== "drag") {
|
|
120
|
+
current.pending = false;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
panelRef.current?.setPointerCapture?.(current.id);
|
|
124
|
+
setSign(current.sign);
|
|
125
|
+
setDragging(true);
|
|
126
|
+
}
|
|
127
|
+
const travelled = dx * current.sign;
|
|
128
|
+
current.samples = [...current.samples, {
|
|
129
|
+
position: travelled,
|
|
130
|
+
time: event.timeStamp
|
|
131
|
+
}];
|
|
132
|
+
current.offset = Math.min(current.width, Math.max(0, travelled));
|
|
133
|
+
setOffset(current.offset);
|
|
134
|
+
},
|
|
135
|
+
onPointerUpCapture: (event) => {
|
|
136
|
+
const current = pointer.current;
|
|
137
|
+
if (!current.pending || event.pointerId !== current.id) return;
|
|
138
|
+
current.pending = false;
|
|
139
|
+
if (current.gesture !== "drag") return;
|
|
140
|
+
const travelled = (event.clientX - current.x) * current.sign;
|
|
141
|
+
current.offset = Math.min(current.width, Math.max(0, travelled));
|
|
142
|
+
settle(releaseVelocity([...current.samples, {
|
|
143
|
+
position: travelled,
|
|
144
|
+
time: event.timeStamp
|
|
145
|
+
}]));
|
|
146
|
+
},
|
|
147
|
+
onPointerCancelCapture: (event) => {
|
|
148
|
+
const current = pointer.current;
|
|
149
|
+
if (!current.pending || event.pointerId !== current.id) return;
|
|
150
|
+
if (current.gesture === "drag") reset();
|
|
151
|
+
else current.pending = false;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
motionProps: {
|
|
155
|
+
"data-dragging": dragging || void 0,
|
|
156
|
+
"data-settling": settleMotion ? "" : void 0,
|
|
157
|
+
style: {
|
|
158
|
+
"--m3-side-sheet-offset": `${offset * sign}px`,
|
|
159
|
+
...settleMotion && {
|
|
160
|
+
transitionDuration: `${settleMotion.duration}ms`,
|
|
161
|
+
transitionTimingFunction: settleMotion.easing
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
onTransitionEnd: (event) => {
|
|
165
|
+
if (event.target === event.currentTarget && event.propertyName === "translate") setSettleMotion(null);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
dragging
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { useSideSwipe };
|
|
173
|
+
|
|
174
|
+
//# sourceMappingURL=use-side-swipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-side-swipe.js","names":[],"sources":["../../../src/components/sheet/use-side-swipe.ts"],"sourcesContent":["'use client';\n\nimport {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type PointerEvent,\n type RefObject,\n type TransitionEvent,\n} from 'react';\nimport { useThemeScope } from '../../theme/context';\nimport { ownsGesture } from './sheet-gesture';\nimport {\n EXIT_DISTANCE,\n releaseMotion,\n releaseVelocity,\n settleTarget,\n type DragSample,\n type ReleaseMotion,\n} from './sheet-settle';\nimport { edgeSign, sideSwipeGesture, type SwipeGesture } from './side-swipe-gesture';\n\ninterface SideSwipeOptions {\n /** Whether a swipe may close the sheet (`swipeable`, and `closedBy` isn't `none`). */\n enabled: boolean;\n edge: 'start' | 'end';\n /** Whether the sheet is open; a close the app refuses leaves it `true`. */\n isOpen: boolean;\n close: () => void;\n /** The panel, which takes the pointer once a swipe drags it. */\n panelRef: RefObject<HTMLElement | null>;\n /** The layer that moves, whose width is the distance to closed. */\n motionRef: RefObject<HTMLElement | null>;\n /** The scrolling content, whose own `touch-action` isn't the content's. */\n contentRef: RefObject<HTMLElement | null>;\n}\n\n/** The share of the sheet's width a slow swipe must pass to close it (Compose's rail). */\nconst POSITIONAL_SHARE = 0.5;\n\n/**\n * Swipe to dismiss for a modal side sheet (touch and pen only; a mouse drag selects text).\n * A touch on the panel is decided past the 4px slop (`sideSwipeGesture`): a vertical move is\n * left to the browser, which scrolls the content; a sideways move away from the edge is\n * ignored; one toward it drags the sheet, unless the content under it owns that drag (a\n * field, a horizontal slider, a scroller that can still scroll that way). The sheet follows\n * the finger with no transition, clamped at its open position, and on release settles as\n * Compose's anchored drag does: a fling over 125px/s toward the edge or a drag past half its\n * width closes it, anything else springs back, both continuing at the release speed. A\n * close the app refuses (a controlled `open` left `true`) springs back too.\n *\n * Returns the panel's capture-phase pointer handlers, and the moving layer's attributes.\n */\nexport function useSideSwipe({\n enabled,\n edge,\n isOpen,\n close,\n panelRef,\n motionRef,\n contentRef,\n}: SideSwipeOptions) {\n const { motion: scheme } = useThemeScope();\n // How far the sheet has moved toward its edge (px, 0 = open) and that way's physical sign.\n const [offset, setOffset] = useState(0);\n const [sign, setSign] = useState<1 | -1>(1);\n const [dragging, setDragging] = useState(false);\n // A settle continues at the release speed: a spring with that velocity as a `linear()`\n // easing and duration, on the moving layer until its move ends (as the bottom sheet's).\n const [settleMotion, setSettleMotion] = useState<ReleaseMotion | null>(null);\n // A swipe asked to close; if the sheet is still open after that render, the app refused.\n const [closing, setClosing] = useState(false);\n const pointer = useRef({\n pending: false,\n gesture: 'undecided' as SwipeGesture,\n id: 0,\n x: 0,\n y: 0,\n sign: 1 as 1 | -1,\n direction: 'ltr' as 'ltr' | 'rtl',\n width: 0,\n offset: 0,\n target: null as Element | null,\n root: null as Element | null,\n samples: [] as DragSample[],\n });\n\n if (closing && isOpen) {\n // Refused (adjusted while rendering, before it paints): back to the open position on the\n // default spatial spring (instant under reduced motion), from where the swipe let go.\n setClosing(false);\n setSettleMotion(null);\n setOffset(0);\n }\n\n // Browsers that ignore `touch-action: pan-y` for a gesture already moving (and scrollers\n // inside, which give panning back to their content) are stopped from panning once the\n // swipe drags the sheet.\n useEffect(() => {\n const panel = panelRef.current;\n if (!panel || !enabled) return;\n const onTouchMove = (event: TouchEvent) => {\n const current = pointer.current;\n if (current.pending && current.gesture === 'drag' && event.cancelable) event.preventDefault();\n };\n panel.addEventListener('touchmove', onTouchMove, { passive: false });\n return () => panel.removeEventListener('touchmove', onTouchMove);\n }, [enabled, panelRef]);\n\n const settle = (velocity: number) => {\n const current = pointer.current;\n const { width } = current;\n const target = settleTarget([0, width], 0, current.offset, velocity, width * POSITIONAL_SHARE);\n const closes = width > 0 && target >= width - 0.5;\n const end = closes ? width * EXIT_DISTANCE : 0;\n setDragging(false);\n setSettleMotion(releaseMotion(scheme, closes, velocity, end - current.offset));\n if (closes) {\n // The offset stays: the exit leaves from it (and, under reduced motion, fades there).\n setClosing(true);\n close();\n } else {\n setOffset(0);\n }\n };\n\n const reset = () => {\n pointer.current.pending = false;\n setDragging(false);\n setSettleMotion(null);\n setOffset(0);\n };\n\n const panelHandlers = {\n onPointerDownCapture: (event: PointerEvent<HTMLElement>) => {\n const panel = panelRef.current;\n const target = event.target as Element;\n if (!enabled || event.button !== 0 || event.pointerType === 'mouse') return;\n if (!panel?.contains(target)) return;\n // The content scrolls and sets its own `touch-action`, so it's the root of a touch on it.\n const content = contentRef.current;\n const root = content?.contains(target) ? content : panel;\n if (ownsGesture(target, root, 'x')) return;\n const direction = getComputedStyle(panel).direction === 'rtl' ? 'rtl' : 'ltr';\n setSettleMotion(null);\n pointer.current = {\n pending: true,\n gesture: 'undecided',\n id: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n sign: edgeSign(edge, direction),\n direction,\n width: motionRef.current?.offsetWidth ?? 0,\n offset: 0,\n target,\n root,\n samples: [{ position: 0, time: event.timeStamp }],\n };\n },\n onPointerMoveCapture: (event: PointerEvent<HTMLElement>) => {\n const current = pointer.current;\n if (!current.pending || event.pointerId !== current.id) return;\n const dx = event.clientX - current.x;\n if (current.gesture === 'undecided') {\n let gesture = sideSwipeGesture(dx, event.clientY - current.y, edge, current.direction);\n if (gesture === 'undecided') return;\n if (gesture === 'drag' && current.target && current.root) {\n if (ownsGesture(current.target, current.root, 'x', dx)) gesture = 'ignore';\n }\n current.gesture = gesture;\n if (gesture !== 'drag') {\n current.pending = false;\n return;\n }\n // Taking the pointer cancels the press underneath, so a swipe that starts on a\n // button never activates it.\n panelRef.current?.setPointerCapture?.(current.id);\n setSign(current.sign);\n setDragging(true);\n }\n const travelled = dx * current.sign;\n current.samples = [...current.samples, { position: travelled, time: event.timeStamp }];\n current.offset = Math.min(current.width, Math.max(0, travelled));\n setOffset(current.offset);\n },\n onPointerUpCapture: (event: PointerEvent<HTMLElement>) => {\n const current = pointer.current;\n if (!current.pending || event.pointerId !== current.id) return;\n current.pending = false;\n if (current.gesture !== 'drag') return;\n const travelled = (event.clientX - current.x) * current.sign;\n current.offset = Math.min(current.width, Math.max(0, travelled));\n settle(releaseVelocity([...current.samples, { position: travelled, time: event.timeStamp }]));\n },\n onPointerCancelCapture: (event: PointerEvent<HTMLElement>) => {\n const current = pointer.current;\n if (!current.pending || event.pointerId !== current.id) return;\n if (current.gesture === 'drag') reset();\n else current.pending = false;\n },\n };\n\n const motionProps = {\n 'data-dragging': dragging || undefined,\n 'data-settling': settleMotion ? '' : undefined,\n style: {\n '--m3-side-sheet-offset': `${offset * sign}px`,\n ...(settleMotion && {\n transitionDuration: `${settleMotion.duration}ms`,\n transitionTimingFunction: settleMotion.easing,\n }),\n } as CSSProperties,\n onTransitionEnd: (event: TransitionEvent<HTMLElement>) => {\n if (event.target === event.currentTarget && event.propertyName === 'translate')\n setSettleMotion(null);\n },\n };\n\n return { panelHandlers, motionProps, dragging };\n}\n"],"mappings":";;;;;;;;AAuCA,MAAM,mBAAmB;;;;;;;;;;;;;;AAezB,SAAgB,aAAa,EAC3B,SACA,MACA,QACA,OACA,UACA,WACA,cACmB;CACnB,MAAM,EAAE,QAAQ,WAAW,cAAc;CAEzC,MAAM,CAAC,QAAQ,aAAa,SAAS,CAAC;CACtC,MAAM,CAAC,MAAM,WAAW,SAAiB,CAAC;CAC1C,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAG9C,MAAM,CAAC,cAAc,mBAAmB,SAA+B,IAAI;CAE3E,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,UAAU,OAAO;EACrB,SAAS;EACT,SAAS;EACT,IAAI;EACJ,GAAG;EACH,GAAG;EACH,MAAM;EACN,WAAW;EACX,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,SAAS,CAAC;CACZ,CAAC;CAED,IAAI,WAAW,QAAQ;EAGrB,WAAW,KAAK;EAChB,gBAAgB,IAAI;EACpB,UAAU,CAAC;CACb;CAKA,gBAAgB;EACd,MAAM,QAAQ,SAAS;EACvB,IAAI,CAAC,SAAS,CAAC,SAAS;EACxB,MAAM,eAAe,UAAsB;GACzC,MAAM,UAAU,QAAQ;GACxB,IAAI,QAAQ,WAAW,QAAQ,YAAY,UAAU,MAAM,YAAY,MAAM,eAAe;EAC9F;EACA,MAAM,iBAAiB,aAAa,aAAa,EAAE,SAAS,MAAM,CAAC;EACnE,aAAa,MAAM,oBAAoB,aAAa,WAAW;CACjE,GAAG,CAAC,SAAS,QAAQ,CAAC;CAEtB,MAAM,UAAU,aAAqB;EACnC,MAAM,UAAU,QAAQ;EACxB,MAAM,EAAE,UAAU;EAClB,MAAM,SAAS,aAAa,CAAC,GAAG,KAAK,GAAG,GAAG,QAAQ,QAAQ,UAAU,QAAQ,gBAAgB;EAC7F,MAAM,SAAS,QAAQ,KAAK,UAAU,QAAQ;EAC9C,MAAM,MAAM,SAAS,QAAQ,gBAAgB;EAC7C,YAAY,KAAK;EACjB,gBAAgB,cAAc,QAAQ,QAAQ,UAAU,MAAM,QAAQ,MAAM,CAAC;EAC7E,IAAI,QAAQ;GAEV,WAAW,IAAI;GACf,MAAM;EACR,OACE,UAAU,CAAC;CAEf;CAEA,MAAM,cAAc;EAClB,QAAQ,QAAQ,UAAU;EAC1B,YAAY,KAAK;EACjB,gBAAgB,IAAI;EACpB,UAAU,CAAC;CACb;CAwFA,OAAO;EAAE,eAAA;GArFP,uBAAuB,UAAqC;IAC1D,MAAM,QAAQ,SAAS;IACvB,MAAM,SAAS,MAAM;IACrB,IAAI,CAAC,WAAW,MAAM,WAAW,KAAK,MAAM,gBAAgB,SAAS;IACrE,IAAI,CAAC,OAAO,SAAS,MAAM,GAAG;IAE9B,MAAM,UAAU,WAAW;IAC3B,MAAM,OAAO,SAAS,SAAS,MAAM,IAAI,UAAU;IACnD,IAAI,YAAY,QAAQ,MAAM,GAAG,GAAG;IACpC,MAAM,YAAY,iBAAiB,KAAK,CAAC,CAAC,cAAc,QAAQ,QAAQ;IACxE,gBAAgB,IAAI;IACpB,QAAQ,UAAU;KAChB,SAAS;KACT,SAAS;KACT,IAAI,MAAM;KACV,GAAG,MAAM;KACT,GAAG,MAAM;KACT,MAAM,SAAS,MAAM,SAAS;KAC9B;KACA,OAAO,UAAU,SAAS,eAAe;KACzC,QAAQ;KACR;KACA;KACA,SAAS,CAAC;MAAE,UAAU;MAAG,MAAM,MAAM;KAAU,CAAC;IAClD;GACF;GACA,uBAAuB,UAAqC;IAC1D,MAAM,UAAU,QAAQ;IACxB,IAAI,CAAC,QAAQ,WAAW,MAAM,cAAc,QAAQ,IAAI;IACxD,MAAM,KAAK,MAAM,UAAU,QAAQ;IACnC,IAAI,QAAQ,YAAY,aAAa;KACnC,IAAI,UAAU,iBAAiB,IAAI,MAAM,UAAU,QAAQ,GAAG,MAAM,QAAQ,SAAS;KACrF,IAAI,YAAY,aAAa;KAC7B,IAAI,YAAY,UAAU,QAAQ,UAAU,QAAQ,MAC9C;UAAA,YAAY,QAAQ,QAAQ,QAAQ,MAAM,KAAK,EAAE,GAAG,UAAU;KAAA;KAEpE,QAAQ,UAAU;KAClB,IAAI,YAAY,QAAQ;MACtB,QAAQ,UAAU;MAClB;KACF;KAGA,SAAS,SAAS,oBAAoB,QAAQ,EAAE;KAChD,QAAQ,QAAQ,IAAI;KACpB,YAAY,IAAI;IAClB;IACA,MAAM,YAAY,KAAK,QAAQ;IAC/B,QAAQ,UAAU,CAAC,GAAG,QAAQ,SAAS;KAAE,UAAU;KAAW,MAAM,MAAM;IAAU,CAAC;IACrF,QAAQ,SAAS,KAAK,IAAI,QAAQ,OAAO,KAAK,IAAI,GAAG,SAAS,CAAC;IAC/D,UAAU,QAAQ,MAAM;GAC1B;GACA,qBAAqB,UAAqC;IACxD,MAAM,UAAU,QAAQ;IACxB,IAAI,CAAC,QAAQ,WAAW,MAAM,cAAc,QAAQ,IAAI;IACxD,QAAQ,UAAU;IAClB,IAAI,QAAQ,YAAY,QAAQ;IAChC,MAAM,aAAa,MAAM,UAAU,QAAQ,KAAK,QAAQ;IACxD,QAAQ,SAAS,KAAK,IAAI,QAAQ,OAAO,KAAK,IAAI,GAAG,SAAS,CAAC;IAC/D,OAAO,gBAAgB,CAAC,GAAG,QAAQ,SAAS;KAAE,UAAU;KAAW,MAAM,MAAM;IAAU,CAAC,CAAC,CAAC;GAC9F;GACA,yBAAyB,UAAqC;IAC5D,MAAM,UAAU,QAAQ;IACxB,IAAI,CAAC,QAAQ,WAAW,MAAM,cAAc,QAAQ,IAAI;IACxD,IAAI,QAAQ,YAAY,QAAQ,MAAM;SACjC,QAAQ,UAAU;GACzB;EAmBmB;EAAG,aAAA;GAftB,iBAAiB,YAAY,KAAA;GAC7B,iBAAiB,eAAe,KAAK,KAAA;GACrC,OAAO;IACL,0BAA0B,GAAG,SAAS,KAAK;IAC3C,GAAI,gBAAgB;KAClB,oBAAoB,GAAG,aAAa,SAAS;KAC7C,0BAA0B,aAAa;IACzC;GACF;GACA,kBAAkB,UAAwC;IACxD,IAAI,MAAM,WAAW,MAAM,iBAAiB,MAAM,iBAAiB,aACjE,gBAAgB,IAAI;GACxB;EAGgC;EAAG;CAAS;AAChD"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { RootDOMProps } from "../../utils/root-props.js";
|
|
2
|
+
import { SliderOrientation, SliderSize } from "./slider-styles.js";
|
|
3
|
+
import { CSSProperties, ReactNode, Ref } from "react";
|
|
4
|
+
//#region src/components/slider/Slider.d.ts
|
|
5
|
+
export interface SliderClassNames {
|
|
6
|
+
/** The outer element. */
|
|
7
|
+
root?: string;
|
|
8
|
+
/** The track, holding the active and inactive segments and the stop indicators. */
|
|
9
|
+
track?: string;
|
|
10
|
+
/** Each active track segment (the filled part, from the start or the centre). */
|
|
11
|
+
activeTrack?: string;
|
|
12
|
+
/** Each inactive track segment. */
|
|
13
|
+
inactiveTrack?: string;
|
|
14
|
+
/** The stop indicators: at the track's ends, and at every step with `ticks`. */
|
|
15
|
+
stop?: string;
|
|
16
|
+
/** The inset icons (`leadingIcon`, `trailingIcon`). */
|
|
17
|
+
icon?: string;
|
|
18
|
+
/** Each thumb, the pressable area around its handle. */
|
|
19
|
+
thumb?: string;
|
|
20
|
+
/** The handle bar drawn inside each thumb. */
|
|
21
|
+
handle?: string;
|
|
22
|
+
/** The value indicator above a thumb (`valueLabel`). */
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
25
|
+
/** A slider needs a name: `aria-label`, or `aria-labelledby` pointing at a visible label. */
|
|
26
|
+
type Naming = {
|
|
27
|
+
/** Accessible name when there's no visible label. */
|
|
28
|
+
'aria-label': string;
|
|
29
|
+
} | {
|
|
30
|
+
/** The id of the visible label that names the slider. */
|
|
31
|
+
'aria-labelledby': string;
|
|
32
|
+
};
|
|
33
|
+
interface SliderCommonProps extends RootDOMProps {
|
|
34
|
+
/** The track's thickness, from XS (a 16px track) to XL. @default "xs" */
|
|
35
|
+
size?: SliderSize;
|
|
36
|
+
/**
|
|
37
|
+
* The direction the slider runs. Vertical sliders run bottom to top and default to 240px
|
|
38
|
+
* tall. @default "horizontal"
|
|
39
|
+
*/
|
|
40
|
+
orientation?: SliderOrientation;
|
|
41
|
+
/** The lowest value. @default 0 */
|
|
42
|
+
min?: number;
|
|
43
|
+
/** The highest value. @default 100 */
|
|
44
|
+
max?: number;
|
|
45
|
+
/** The amount the value changes by in one step. @default 1 */
|
|
46
|
+
step?: number;
|
|
47
|
+
/** Discrete: show a stop indicator at every step (use a coarse `step`). @default false */
|
|
48
|
+
ticks?: boolean;
|
|
49
|
+
/** Turns the slider off: it can't be moved or focused. @default false */
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/** Show the value above the thumb while it is dragged or keyboard-focused. @default false */
|
|
52
|
+
valueLabel?: boolean;
|
|
53
|
+
/** Formats the value for the value indicator and assistive tech. */
|
|
54
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
55
|
+
/** Form field name (one hidden input per thumb). */
|
|
56
|
+
name?: string;
|
|
57
|
+
/** The id of the slider's root, its `group` (an error summary can link to it). */
|
|
58
|
+
id?: string;
|
|
59
|
+
/** Ref to the root `<div>` element. */
|
|
60
|
+
ref?: Ref<HTMLDivElement>;
|
|
61
|
+
/** Classes for the root element, merged with `classNames.root`; consumer classes win. */
|
|
62
|
+
className?: string;
|
|
63
|
+
/** Inline styles for the root element. */
|
|
64
|
+
style?: CSSProperties;
|
|
65
|
+
/** Classes for each part, by slot. `classNames.root` is merged with `className`. */
|
|
66
|
+
classNames?: SliderClassNames;
|
|
67
|
+
/** `data-*` attributes, like the other DOM attributes, go to the root. */
|
|
68
|
+
[data: `data-${string}`]: string | number | boolean | undefined;
|
|
69
|
+
}
|
|
70
|
+
export type SliderProps = SliderCommonProps & Naming & {
|
|
71
|
+
/** The value (controlled). */
|
|
72
|
+
value?: number;
|
|
73
|
+
/** The initial value when uncontrolled. @default min */
|
|
74
|
+
defaultValue?: number;
|
|
75
|
+
/** Called as the value changes, while dragging too. */
|
|
76
|
+
onChange?: (value: number) => void;
|
|
77
|
+
/** Called when the user stops dragging or releases a key. */
|
|
78
|
+
onChangeEnd?: (value: number) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Fill the track from its centre (for values around a midpoint). M3 doesn't use inset
|
|
81
|
+
* icons on centred sliders, so `leadingIcon` and `trailingIcon` are ignored. @default false
|
|
82
|
+
*/
|
|
83
|
+
centered?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* An icon inside the active track at its start (sizes md and up; ignored, with a dev
|
|
86
|
+
* warning, on xs and sm). When the active track is too short for it, it moves to the
|
|
87
|
+
* start of the inactive track.
|
|
88
|
+
*/
|
|
89
|
+
leadingIcon?: ReactNode;
|
|
90
|
+
/** An icon inside the inactive track at its end (sizes md and up; ignored on xs and sm). */
|
|
91
|
+
trailingIcon?: ReactNode;
|
|
92
|
+
};
|
|
93
|
+
export interface RangeSliderLabels {
|
|
94
|
+
/** Name of the start thumb. @default "Minimum" */
|
|
95
|
+
start: string;
|
|
96
|
+
/** Name of the end thumb. @default "Maximum" */
|
|
97
|
+
end: string;
|
|
98
|
+
}
|
|
99
|
+
export type RangeSliderProps = SliderCommonProps & Naming & {
|
|
100
|
+
/** The range, as `[start, end]` (controlled). */
|
|
101
|
+
value?: [number, number];
|
|
102
|
+
/** The initial range when uncontrolled. @default [min, max] */
|
|
103
|
+
defaultValue?: [number, number];
|
|
104
|
+
/** Called as the range changes, while dragging too. */
|
|
105
|
+
onChange?: (value: [number, number]) => void;
|
|
106
|
+
/** Called when the user stops dragging or releases a key. */
|
|
107
|
+
onChangeEnd?: (value: [number, number]) => void;
|
|
108
|
+
/** Words the range slider announces (its thumbs' names), with English defaults. */
|
|
109
|
+
labels?: Partial<RangeSliderLabels>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* M3 Expressive slider: XS–XL sizes, horizontal or vertical, continuous or discrete with
|
|
113
|
+
* stop indicators, optionally centred, with inset icons and a value indicator. Arrow keys,
|
|
114
|
+
* Page Up / Down and Home / End adjust it (mirrored in RTL).
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* <Slider aria-label="Volume" size="md" leadingIcon={<VolumeIcon />} defaultValue={40} />
|
|
118
|
+
*/
|
|
119
|
+
export declare function Slider(props: SliderProps): import("react").JSX.Element;
|
|
120
|
+
/**
|
|
121
|
+
* M3 Expressive range slider: two thumbs selecting a range, with the same sizes,
|
|
122
|
+
* orientations and discrete stops as {@link Slider}.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* <RangeSlider aria-label="Price" defaultValue={[20, 80]} />
|
|
126
|
+
*/
|
|
127
|
+
export declare function RangeSlider(props: RangeSliderProps): import("react").JSX.Element;
|
|
128
|
+
//#endregion
|
|
129
|
+
//# sourceMappingURL=Slider.d.ts.map
|