@windmorph/react 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +149 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/app-bar/AppBarItems.js +23 -0
- package/dist/components/app-bar/AppBarItems.js.map +1 -0
- package/dist/components/app-bar/TopAppBar.d.ts +89 -0
- package/dist/components/app-bar/TopAppBar.js +103 -0
- package/dist/components/app-bar/TopAppBar.js.map +1 -0
- package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
- package/dist/components/app-bar/app-bar-styles.js +142 -0
- package/dist/components/app-bar/app-bar-styles.js.map +1 -0
- package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
- package/dist/components/app-bar/app-bar-tokens.js +64 -0
- package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
- package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
- package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
- package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
- package/dist/components/autocomplete/Autocomplete.js +284 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +71 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/badge-styles.d.ts +100 -0
- package/dist/components/badge/badge-styles.js +43 -0
- package/dist/components/badge/badge-styles.js.map +1 -0
- package/dist/components/badge/badge-tokens.d.ts +7 -0
- package/dist/components/badge/badge-tokens.js +40 -0
- package/dist/components/badge/badge-tokens.js.map +1 -0
- package/dist/components/button/Button.d.ts +91 -0
- package/dist/components/button/Button.js +96 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/ButtonContext.d.ts +30 -0
- package/dist/components/button/ButtonContext.js +18 -0
- package/dist/components/button/ButtonContext.js.map +1 -0
- package/dist/components/button/DensityZeroButtons.js +25 -0
- package/dist/components/button/DensityZeroButtons.js.map +1 -0
- package/dist/components/button/button-pending.d.ts +10 -0
- package/dist/components/button/button-pending.js +166 -0
- package/dist/components/button/button-pending.js.map +1 -0
- package/dist/components/button/button-styles.d.ts +216 -0
- package/dist/components/button/button-styles.js +199 -0
- package/dist/components/button/button-styles.js.map +1 -0
- package/dist/components/button/button-tokens.d.ts +10 -0
- package/dist/components/button/button-tokens.js +257 -0
- package/dist/components/button/button-tokens.js.map +1 -0
- package/dist/components/button/connected-shapes.js +152 -0
- package/dist/components/button/connected-shapes.js.map +1 -0
- package/dist/components/card/Card.d.ts +60 -0
- package/dist/components/card/Card.js +69 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/card/card-styles.d.ts +42 -0
- package/dist/components/card/card-styles.js +64 -0
- package/dist/components/card/card-styles.js.map +1 -0
- package/dist/components/card/card-tokens.d.ts +7 -0
- package/dist/components/card/card-tokens.js +84 -0
- package/dist/components/card/card-tokens.js.map +1 -0
- package/dist/components/carousel/Carousel.d.ts +124 -0
- package/dist/components/carousel/Carousel.js +387 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/carousel-keylines.js +486 -0
- package/dist/components/carousel/carousel-keylines.js.map +1 -0
- package/dist/components/carousel/carousel-press-area.js +35 -0
- package/dist/components/carousel/carousel-press-area.js.map +1 -0
- package/dist/components/carousel/carousel-styles.d.ts +188 -0
- package/dist/components/carousel/carousel-styles.js +116 -0
- package/dist/components/carousel/carousel-styles.js.map +1 -0
- package/dist/components/carousel/carousel-tokens.d.ts +7 -0
- package/dist/components/carousel/carousel-tokens.js +18 -0
- package/dist/components/carousel/carousel-tokens.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +78 -0
- package/dist/components/checkbox/Checkbox.js +77 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox-box.js +34 -0
- package/dist/components/checkbox/checkbox-box.js.map +1 -0
- package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
- package/dist/components/checkbox/checkbox-styles.js +54 -0
- package/dist/components/checkbox/checkbox-styles.js.map +1 -0
- package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
- package/dist/components/checkbox/checkbox-tokens.js +41 -0
- package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
- package/dist/components/chip/Chip.d.ts +171 -0
- package/dist/components/chip/Chip.js +348 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipSet.d.ts +70 -0
- package/dist/components/chip/ChipSet.js +198 -0
- package/dist/components/chip/ChipSet.js.map +1 -0
- package/dist/components/chip/chip-styles.d.ts +263 -0
- package/dist/components/chip/chip-styles.js +360 -0
- package/dist/components/chip/chip-styles.js.map +1 -0
- package/dist/components/chip/chip-tokens.d.ts +13 -0
- package/dist/components/chip/chip-tokens.js +185 -0
- package/dist/components/chip/chip-tokens.js.map +1 -0
- package/dist/components/date-picker/CalendarGrid.js +94 -0
- package/dist/components/date-picker/CalendarGrid.js.map +1 -0
- package/dist/components/date-picker/CompactDateDialog.js +63 -0
- package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
- package/dist/components/date-picker/DateField.d.ts +161 -0
- package/dist/components/date-picker/DateField.js +393 -0
- package/dist/components/date-picker/DateField.js.map +1 -0
- package/dist/components/date-picker/DateInput.d.ts +20 -0
- package/dist/components/date-picker/DateInput.js +99 -0
- package/dist/components/date-picker/DateInput.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +165 -0
- package/dist/components/date-picker/DatePicker.js +492 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/PickerDialog.d.ts +121 -0
- package/dist/components/date-picker/PickerDialog.js +161 -0
- package/dist/components/date-picker/PickerDialog.js.map +1 -0
- package/dist/components/date-picker/calendar-parts.js +141 -0
- package/dist/components/date-picker/calendar-parts.js.map +1 -0
- package/dist/components/date-picker/date-format.js +72 -0
- package/dist/components/date-picker/date-format.js.map +1 -0
- package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
- package/dist/components/date-picker/date-picker-styles.js +163 -0
- package/dist/components/date-picker/date-picker-styles.js.map +1 -0
- package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
- package/dist/components/date-picker/date-picker-tokens.js +104 -0
- package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-context.js +8 -0
- package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
- package/dist/components/date-picker/picker-dialog-styles.js +57 -0
- package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
- package/dist/components/date-picker/picker-icons.js +24 -0
- package/dist/components/date-picker/picker-icons.js.map +1 -0
- package/dist/components/date-picker/use-media-query.js +21 -0
- package/dist/components/date-picker/use-media-query.js.map +1 -0
- package/dist/components/date-picker/use-size-transform.js +62 -0
- package/dist/components/date-picker/use-size-transform.js.map +1 -0
- package/dist/components/date-picker/use-view-exit.js +68 -0
- package/dist/components/date-picker/use-view-exit.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +267 -0
- package/dist/components/dialog/Dialog.js +521 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/dialog-styles.d.ts +335 -0
- package/dist/components/dialog/dialog-styles.js +377 -0
- package/dist/components/dialog/dialog-styles.js.map +1 -0
- package/dist/components/dialog/dialog-tokens.d.ts +7 -0
- package/dist/components/dialog/dialog-tokens.js +57 -0
- package/dist/components/dialog/dialog-tokens.js.map +1 -0
- package/dist/components/divider/Divider.d.ts +59 -0
- package/dist/components/divider/Divider.js +53 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/divider-styles.d.ts +90 -0
- package/dist/components/divider/divider-styles.js +66 -0
- package/dist/components/divider/divider-styles.js.map +1 -0
- package/dist/components/divider/divider-tokens.d.ts +7 -0
- package/dist/components/divider/divider-tokens.js +16 -0
- package/dist/components/divider/divider-tokens.js.map +1 -0
- package/dist/components/fab/Fab.d.ts +130 -0
- package/dist/components/fab/Fab.js +137 -0
- package/dist/components/fab/Fab.js.map +1 -0
- package/dist/components/fab/FabTooltip.js +36 -0
- package/dist/components/fab/FabTooltip.js.map +1 -0
- package/dist/components/fab/fab-styles.d.ts +286 -0
- package/dist/components/fab/fab-styles.js +131 -0
- package/dist/components/fab/fab-styles.js.map +1 -0
- package/dist/components/fab/fab-tokens.d.ts +12 -0
- package/dist/components/fab/fab-tokens.js +105 -0
- package/dist/components/fab/fab-tokens.js.map +1 -0
- package/dist/components/fab-menu/FabMenu.d.ts +156 -0
- package/dist/components/fab-menu/FabMenu.js +291 -0
- package/dist/components/fab-menu/FabMenu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
- package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
- package/dist/components/fab-menu/fab-menu-styles.js +107 -0
- package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
- package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
- package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
- package/dist/components/icon-button/IconButton.d.ts +125 -0
- package/dist/components/icon-button/IconButton.js +112 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
- package/dist/components/icon-button/icon-button-styles.js +244 -0
- package/dist/components/icon-button/icon-button-styles.js.map +1 -0
- package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
- package/dist/components/icon-button/icon-button-tokens.js +215 -0
- package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
- package/dist/components/list/List.d.ts +265 -0
- package/dist/components/list/List.js +1386 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/ListMedia.d.ts +88 -0
- package/dist/components/list/ListMedia.js +132 -0
- package/dist/components/list/ListMedia.js.map +1 -0
- package/dist/components/list/list-styles.d.ts +375 -0
- package/dist/components/list/list-styles.js +220 -0
- package/dist/components/list/list-styles.js.map +1 -0
- package/dist/components/list/list-tokens.d.ts +7 -0
- package/dist/components/list/list-tokens.js +92 -0
- package/dist/components/list/list-tokens.js.map +1 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
- package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +215 -0
- package/dist/components/menu/Menu.js +715 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/menu-styles.d.ts +354 -0
- package/dist/components/menu/menu-styles.js +219 -0
- package/dist/components/menu/menu-styles.js.map +1 -0
- package/dist/components/menu/menu-tokens.d.ts +7 -0
- package/dist/components/menu/menu-tokens.js +93 -0
- package/dist/components/menu/menu-tokens.js.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +51 -0
- package/dist/components/menu/menu-trigger.js +100 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/use-reveal-entering.js +42 -0
- package/dist/components/menu/use-reveal-entering.js.map +1 -0
- package/dist/components/navigation/NavItem.d.ts +54 -0
- package/dist/components/navigation/NavItem.js +182 -0
- package/dist/components/navigation/NavItem.js.map +1 -0
- package/dist/components/navigation/NavigationBar.d.ts +64 -0
- package/dist/components/navigation/NavigationBar.js +121 -0
- package/dist/components/navigation/NavigationBar.js.map +1 -0
- package/dist/components/navigation/NavigationRail.d.ts +91 -0
- package/dist/components/navigation/NavigationRail.js +285 -0
- package/dist/components/navigation/NavigationRail.js.map +1 -0
- package/dist/components/navigation/nav-item-styles.d.ts +190 -0
- package/dist/components/navigation/nav-item-styles.js +123 -0
- package/dist/components/navigation/nav-item-styles.js.map +1 -0
- package/dist/components/navigation/navigation-styles.d.ts +239 -0
- package/dist/components/navigation/navigation-styles.js +134 -0
- package/dist/components/navigation/navigation-styles.js.map +1 -0
- package/dist/components/navigation/navigation-tokens.d.ts +9 -0
- package/dist/components/navigation/navigation-tokens.js +114 -0
- package/dist/components/navigation/navigation-tokens.js.map +1 -0
- package/dist/components/navigation/use-hide-on-scroll.js +115 -0
- package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
- package/dist/components/navigation/use-item-arrow-keys.js +37 -0
- package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
- package/dist/components/navigation/use-rail-item-morph.js +61 -0
- package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
- package/dist/components/progress/ProgressIndicator.d.ts +95 -0
- package/dist/components/progress/ProgressIndicator.js +426 -0
- package/dist/components/progress/ProgressIndicator.js.map +1 -0
- package/dist/components/progress/progress-geometry.js +285 -0
- package/dist/components/progress/progress-geometry.js.map +1 -0
- package/dist/components/progress/progress-styles.d.ts +81 -0
- package/dist/components/progress/progress-styles.js +43 -0
- package/dist/components/progress/progress-styles.js.map +1 -0
- package/dist/components/progress/progress-tokens.d.ts +7 -0
- package/dist/components/progress/progress-tokens.js +39 -0
- package/dist/components/progress/progress-tokens.js.map +1 -0
- package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +121 -0
- package/dist/components/radio/RadioGroup.js +163 -0
- package/dist/components/radio/RadioGroup.js.map +1 -0
- package/dist/components/radio/radio-ring.js +21 -0
- package/dist/components/radio/radio-ring.js.map +1 -0
- package/dist/components/radio/radio-styles.d.ts +155 -0
- package/dist/components/radio/radio-styles.js +60 -0
- package/dist/components/radio/radio-styles.js.map +1 -0
- package/dist/components/radio/radio-tokens.d.ts +7 -0
- package/dist/components/radio/radio-tokens.js +31 -0
- package/dist/components/radio/radio-tokens.js.map +1 -0
- package/dist/components/search/SearchAppBar.d.ts +45 -0
- package/dist/components/search/SearchAppBar.js +61 -0
- package/dist/components/search/SearchAppBar.js.map +1 -0
- package/dist/components/search/SearchBar.d.ts +147 -0
- package/dist/components/search/SearchBar.js +412 -0
- package/dist/components/search/SearchBar.js.map +1 -0
- package/dist/components/search/search-styles.d.ts +243 -0
- package/dist/components/search/search-styles.js +143 -0
- package/dist/components/search/search-styles.js.map +1 -0
- package/dist/components/search/search-tokens.d.ts +9 -0
- package/dist/components/search/search-tokens.js +70 -0
- package/dist/components/search/search-tokens.js.map +1 -0
- package/dist/components/select/Select.d.ts +187 -0
- package/dist/components/select/Select.js +319 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/field-shell.d.ts +29 -0
- package/dist/components/select/field-shell.js +135 -0
- package/dist/components/select/field-shell.js.map +1 -0
- package/dist/components/select/option-list.d.ts +81 -0
- package/dist/components/select/option-list.js +291 -0
- package/dist/components/select/option-list.js.map +1 -0
- package/dist/components/select/search-list.js +135 -0
- package/dist/components/select/search-list.js.map +1 -0
- package/dist/components/select/selection-cap.js +30 -0
- package/dist/components/select/selection-cap.js.map +1 -0
- package/dist/components/sheet/BottomSheet.d.ts +154 -0
- package/dist/components/sheet/BottomSheet.js +442 -0
- package/dist/components/sheet/BottomSheet.js.map +1 -0
- package/dist/components/sheet/SheetTrigger.d.ts +25 -0
- package/dist/components/sheet/SheetTrigger.js +46 -0
- package/dist/components/sheet/SheetTrigger.js.map +1 -0
- package/dist/components/sheet/SideSheet.d.ts +139 -0
- package/dist/components/sheet/SideSheet.js +289 -0
- package/dist/components/sheet/SideSheet.js.map +1 -0
- package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
- package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
- package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
- package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
- package/dist/components/sheet/sheet-gesture.js +48 -0
- package/dist/components/sheet/sheet-gesture.js.map +1 -0
- package/dist/components/sheet/sheet-icons.js +31 -0
- package/dist/components/sheet/sheet-icons.js.map +1 -0
- package/dist/components/sheet/sheet-settle.js +58 -0
- package/dist/components/sheet/sheet-settle.js.map +1 -0
- package/dist/components/sheet/sheet-styles.d.ts +312 -0
- package/dist/components/sheet/sheet-styles.js +229 -0
- package/dist/components/sheet/sheet-styles.js.map +1 -0
- package/dist/components/sheet/sheet-tokens.d.ts +12 -0
- package/dist/components/sheet/sheet-tokens.js +115 -0
- package/dist/components/sheet/sheet-tokens.js.map +1 -0
- package/dist/components/sheet/side-swipe-gesture.js +22 -0
- package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
- package/dist/components/sheet/use-peek-inert.js +32 -0
- package/dist/components/sheet/use-peek-inert.js.map +1 -0
- package/dist/components/sheet/use-side-swipe.js +174 -0
- package/dist/components/sheet/use-side-swipe.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +129 -0
- package/dist/components/slider/Slider.js +295 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/slider-geometry.js +138 -0
- package/dist/components/slider/slider-geometry.js.map +1 -0
- package/dist/components/slider/slider-styles.d.ts +133 -0
- package/dist/components/slider/slider-styles.js +97 -0
- package/dist/components/slider/slider-styles.js.map +1 -0
- package/dist/components/slider/slider-tokens.d.ts +7 -0
- package/dist/components/slider/slider-tokens.js +66 -0
- package/dist/components/slider/slider-tokens.js.map +1 -0
- package/dist/components/slider/use-touch-track.js +138 -0
- package/dist/components/slider/use-touch-track.js.map +1 -0
- package/dist/components/snackbar/Snackbar.d.ts +96 -0
- package/dist/components/snackbar/Snackbar.js +253 -0
- package/dist/components/snackbar/Snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar-state.d.ts +58 -0
- package/dist/components/snackbar/snackbar-state.js +73 -0
- package/dist/components/snackbar/snackbar-state.js.map +1 -0
- package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
- package/dist/components/snackbar/snackbar-styles.js +67 -0
- package/dist/components/snackbar/snackbar-styles.js.map +1 -0
- package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
- package/dist/components/snackbar/snackbar-tokens.js +54 -0
- package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +109 -0
- package/dist/components/split-button/SplitButton.js +195 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/split-button-styles.d.ts +214 -0
- package/dist/components/split-button/split-button-styles.js +164 -0
- package/dist/components/split-button/split-button-styles.js.map +1 -0
- package/dist/components/split-button/split-button-tokens.d.ts +7 -0
- package/dist/components/split-button/split-button-tokens.js +36 -0
- package/dist/components/split-button/split-button-tokens.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +82 -0
- package/dist/components/switch/Switch.js +165 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/switch-styles.d.ts +96 -0
- package/dist/components/switch/switch-styles.js +68 -0
- package/dist/components/switch/switch-styles.js.map +1 -0
- package/dist/components/switch/switch-thumb.js +41 -0
- package/dist/components/switch/switch-thumb.js.map +1 -0
- package/dist/components/switch/switch-tokens.d.ts +7 -0
- package/dist/components/switch/switch-tokens.js +78 -0
- package/dist/components/switch/switch-tokens.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +120 -0
- package/dist/components/tabs/Tabs.js +346 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/tabs-styles.d.ts +198 -0
- package/dist/components/tabs/tabs-styles.js +99 -0
- package/dist/components/tabs/tabs-styles.js.map +1 -0
- package/dist/components/tabs/tabs-tokens.d.ts +7 -0
- package/dist/components/tabs/tabs-tokens.js +121 -0
- package/dist/components/tabs/tabs-tokens.js.map +1 -0
- package/dist/components/text-field/TextField.d.ts +175 -0
- package/dist/components/text-field/TextField.js +250 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/text-field-styles.d.ts +252 -0
- package/dist/components/text-field/text-field-styles.js +209 -0
- package/dist/components/text-field/text-field-styles.js.map +1 -0
- package/dist/components/text-field/text-field-tokens.d.ts +7 -0
- package/dist/components/text-field/text-field-tokens.js +177 -0
- package/dist/components/text-field/text-field-tokens.js.map +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +142 -0
- package/dist/components/time-picker/TimePicker.js +700 -0
- package/dist/components/time-picker/TimePicker.js.map +1 -0
- package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
- package/dist/components/time-picker/time-picker-styles.js +112 -0
- package/dist/components/time-picker/time-picker-styles.js.map +1 -0
- package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
- package/dist/components/time-picker/time-picker-tokens.js +86 -0
- package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +209 -0
- package/dist/components/toolbar/Toolbar.js +282 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
- package/dist/components/toolbar/toolbar-styles.js +253 -0
- package/dist/components/toolbar/toolbar-styles.js.map +1 -0
- package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
- package/dist/components/toolbar/toolbar-tokens.js +117 -0
- package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +131 -0
- package/dist/components/tooltip/Tooltip.js +388 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/lazy-tooltip.js +35 -0
- package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
- package/dist/components/tooltip/tooltip-placement.js +14 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
- package/dist/components/tooltip/tooltip-styles.js +81 -0
- package/dist/components/tooltip/tooltip-styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
- package/dist/components/tooltip/tooltip-tokens.js +72 -0
- package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
- package/dist/components/tooltip/tooltip-trigger.js +115 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
- package/dist/composites/button-group/ButtonGroup.js +270 -0
- package/dist/composites/button-group/ButtonGroup.js.map +1 -0
- package/dist/composites/button-group/button-group-styles.d.ts +73 -0
- package/dist/composites/button-group/button-group-styles.js +87 -0
- package/dist/composites/button-group/button-group-styles.js.map +1 -0
- package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
- package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
- package/dist/composites/button-group/overflow-menu-list.js +26 -0
- package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
- package/dist/composites/button-group/use-overflow.js +75 -0
- package/dist/composites/button-group/use-overflow.js.map +1 -0
- package/dist/composites/button-group/use-press-expansion.js +155 -0
- package/dist/composites/button-group/use-press-expansion.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +136 -0
- package/dist/motion/get-m3-spring.d.ts +6 -0
- package/dist/motion/get-m3-spring.js +10 -0
- package/dist/motion/get-m3-spring.js.map +1 -0
- package/dist/motion/reduced-motion.js +19 -0
- package/dist/motion/reduced-motion.js.map +1 -0
- package/dist/motion/use-m3-spring.d.ts +13 -0
- package/dist/motion/use-m3-spring.js +22 -0
- package/dist/motion/use-m3-spring.js.map +1 -0
- package/dist/next/NextRouterProvider.d.ts +13 -0
- package/dist/next/NextRouterProvider.js +26 -0
- package/dist/next/NextRouterProvider.js.map +1 -0
- package/dist/next/get-theme-from-cookies.d.ts +32 -0
- package/dist/next/get-theme-from-cookies.js +27 -0
- package/dist/next/get-theme-from-cookies.js.map +1 -0
- package/dist/next/navigation-guard.d.ts +30 -0
- package/dist/next/navigation-guard.js +68 -0
- package/dist/next/navigation-guard.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.js +5 -0
- package/dist/primitives/ButtonBase.d.ts +115 -0
- package/dist/primitives/ButtonBase.js +231 -0
- package/dist/primitives/ButtonBase.js.map +1 -0
- package/dist/primitives/DomDirectionLocale.d.ts +18 -0
- package/dist/primitives/DomDirectionLocale.js +28 -0
- package/dist/primitives/DomDirectionLocale.js.map +1 -0
- package/dist/primitives/Field.d.ts +50 -0
- package/dist/primitives/Field.js +74 -0
- package/dist/primitives/Field.js.map +1 -0
- package/dist/primitives/IconFaces.js +23 -0
- package/dist/primitives/IconFaces.js.map +1 -0
- package/dist/primitives/Overlay.d.ts +39 -0
- package/dist/primitives/Overlay.js +86 -0
- package/dist/primitives/Overlay.js.map +1 -0
- package/dist/primitives/SelectionControl.d.ts +55 -0
- package/dist/primitives/SelectionControl.js +58 -0
- package/dist/primitives/SelectionControl.js.map +1 -0
- package/dist/primitives/Surface.d.ts +123 -0
- package/dist/primitives/Surface.js +68 -0
- package/dist/primitives/Surface.js.map +1 -0
- package/dist/primitives/ToolbarContext.js +12 -0
- package/dist/primitives/ToolbarContext.js.map +1 -0
- package/dist/primitives/TouchTarget.d.ts +14 -0
- package/dist/primitives/TouchTarget.js +20 -0
- package/dist/primitives/TouchTarget.js.map +1 -0
- package/dist/primitives/TriggerContext.d.ts +34 -0
- package/dist/primitives/TriggerContext.js +24 -0
- package/dist/primitives/TriggerContext.js.map +1 -0
- package/dist/primitives/hidden-input-focus.js +27 -0
- package/dist/primitives/hidden-input-focus.js.map +1 -0
- package/dist/primitives/icon-faces-styles.d.ts +9 -0
- package/dist/primitives/icon-faces-styles.js +45 -0
- package/dist/primitives/icon-faces-styles.js.map +1 -0
- package/dist/primitives/locale-with-direction.d.ts +9 -0
- package/dist/primitives/locale-with-direction.js +17 -0
- package/dist/primitives/locale-with-direction.js.map +1 -0
- package/dist/primitives/morph-path.d.ts +25 -0
- package/dist/primitives/morph-path.js +38 -0
- package/dist/primitives/morph-path.js.map +1 -0
- package/dist/primitives/selection-control-styles.d.ts +54 -0
- package/dist/primitives/selection-control-styles.js +44 -0
- package/dist/primitives/selection-control-styles.js.map +1 -0
- package/dist/primitives/use-m3-interaction.d.ts +51 -0
- package/dist/primitives/use-m3-interaction.js +149 -0
- package/dist/primitives/use-m3-interaction.js.map +1 -0
- package/dist/primitives/use-m3-morph.d.ts +18 -0
- package/dist/primitives/use-m3-morph.js +36 -0
- package/dist/primitives/use-m3-morph.js.map +1 -0
- package/dist/primitives/use-presence.d.ts +19 -0
- package/dist/primitives/use-presence.js +37 -0
- package/dist/primitives/use-presence.js.map +1 -0
- package/dist/primitives.d.ts +36 -0
- package/dist/primitives.js +34 -0
- package/dist/shapes/corner-rounding.d.ts +13 -0
- package/dist/shapes/corner-rounding.js +18 -0
- package/dist/shapes/corner-rounding.js.map +1 -0
- package/dist/shapes/cubic.d.ts +52 -0
- package/dist/shapes/cubic.js +189 -0
- package/dist/shapes/cubic.js.map +1 -0
- package/dist/shapes/feature-mapping.js +80 -0
- package/dist/shapes/feature-mapping.js.map +1 -0
- package/dist/shapes/features.d.ts +23 -0
- package/dist/shapes/features.js +82 -0
- package/dist/shapes/features.js.map +1 -0
- package/dist/shapes/float-mapping.js +65 -0
- package/dist/shapes/float-mapping.js.map +1 -0
- package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
- package/dist/shapes/generated/material-shape-path-record.js +48 -0
- package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
- package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
- package/dist/shapes/generated/material-shape-paths.js +218 -0
- package/dist/shapes/generated/material-shape-paths.js.map +1 -0
- package/dist/shapes/mask.d.ts +14 -0
- package/dist/shapes/mask.js +24 -0
- package/dist/shapes/mask.js.map +1 -0
- package/dist/shapes/material-shapes.d.ts +11 -0
- package/dist/shapes/material-shapes.js +250 -0
- package/dist/shapes/material-shapes.js.map +1 -0
- package/dist/shapes/morph.d.ts +25 -0
- package/dist/shapes/morph.js +97 -0
- package/dist/shapes/morph.js.map +1 -0
- package/dist/shapes/path.d.ts +33 -0
- package/dist/shapes/path.js +47 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/point.d.ts +28 -0
- package/dist/shapes/point.js +103 -0
- package/dist/shapes/point.js.map +1 -0
- package/dist/shapes/polygon-measure.js +140 -0
- package/dist/shapes/polygon-measure.js.map +1 -0
- package/dist/shapes/rounded-polygon.d.ts +44 -0
- package/dist/shapes/rounded-polygon.js +278 -0
- package/dist/shapes/rounded-polygon.js.map +1 -0
- package/dist/shapes/shape-path.d.ts +15 -0
- package/dist/shapes/shapes.d.ts +53 -0
- package/dist/shapes/shapes.js +171 -0
- package/dist/shapes/shapes.js.map +1 -0
- package/dist/styles/generated/components.css +710 -0
- package/dist/styles/generated/theme.css +247 -0
- package/dist/styles/generated/themes.css +3361 -0
- package/dist/styles/generated/tokens.css +284 -0
- package/dist/styles/styles.css +15 -0
- package/dist/styles/utilities.css +283 -0
- package/dist/styles.compiled.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +72 -0
- package/dist/theme/ThemeProvider.js +144 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScope.d.ts +32 -0
- package/dist/theme/ThemeScope.js +67 -0
- package/dist/theme/ThemeScope.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +26 -0
- package/dist/theme/ThemeScript.js +44 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/context.d.ts +32 -0
- package/dist/theme/context.js +47 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/create-theme.d.ts +60 -0
- package/dist/theme/create-theme.js +47 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/css.js +54 -0
- package/dist/theme/css.js.map +1 -0
- package/dist/theme/parse-palettes.js +40 -0
- package/dist/theme/parse-palettes.js.map +1 -0
- package/dist/theme/scheme.d.ts +6 -0
- package/dist/theme/scheme.js +118 -0
- package/dist/theme/scheme.js.map +1 -0
- package/dist/theme/state.d.ts +38 -0
- package/dist/theme/state.js +93 -0
- package/dist/theme/state.js.map +1 -0
- package/dist/theme/storage.js +21 -0
- package/dist/theme/storage.js.map +1 -0
- package/dist/tokens/breakpoints.d.ts +15 -0
- package/dist/tokens/breakpoints.js +16 -0
- package/dist/tokens/breakpoints.js.map +1 -0
- package/dist/tokens/color.d.ts +104 -0
- package/dist/tokens/color.js +147 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/component.d.ts +110 -0
- package/dist/tokens/component.js +67 -0
- package/dist/tokens/component.js.map +1 -0
- package/dist/tokens/density.d.ts +20 -0
- package/dist/tokens/density.js +27 -0
- package/dist/tokens/density.js.map +1 -0
- package/dist/tokens/elevation.d.ts +44 -0
- package/dist/tokens/elevation.js +45 -0
- package/dist/tokens/elevation.js.map +1 -0
- package/dist/tokens/motion.d.ts +79 -0
- package/dist/tokens/motion.js +126 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/shape.d.ts +22 -0
- package/dist/tokens/shape.js +22 -0
- package/dist/tokens/shape.js.map +1 -0
- package/dist/tokens/spring-velocity.d.ts +19 -0
- package/dist/tokens/spring-velocity.js +44 -0
- package/dist/tokens/spring-velocity.js.map +1 -0
- package/dist/tokens/state.d.ts +18 -0
- package/dist/tokens/state.js +19 -0
- package/dist/tokens/state.js.map +1 -0
- package/dist/tokens/typography.d.ts +64 -0
- package/dist/tokens/typography.js +60 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/z-index.d.ts +17 -0
- package/dist/tokens/z-index.js +18 -0
- package/dist/tokens/z-index.js.map +1 -0
- package/dist/utils/announce.js +51 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/assert-collection-children.js +26 -0
- package/dist/utils/assert-collection-children.js.map +1 -0
- package/dist/utils/closed-by.d.ts +9 -0
- package/dist/utils/closed-by.js +12 -0
- package/dist/utils/closed-by.js.map +1 -0
- package/dist/utils/cn.d.ts +31 -0
- package/dist/utils/cn.js +37 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/composite-keys.js +32 -0
- package/dist/utils/composite-keys.js.map +1 -0
- package/dist/utils/focus-visible.js +14 -0
- package/dist/utils/focus-visible.js.map +1 -0
- package/dist/utils/focus.js +51 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/focusable-disabled.js +12 -0
- package/dist/utils/focusable-disabled.js.map +1 -0
- package/dist/utils/keep-pressed-in-place.d.ts +60 -0
- package/dist/utils/keep-pressed-in-place.js +127 -0
- package/dist/utils/keep-pressed-in-place.js.map +1 -0
- package/dist/utils/load-on-demand.js +111 -0
- package/dist/utils/load-on-demand.js.map +1 -0
- package/dist/utils/merge-data-tokens.d.ts +9 -0
- package/dist/utils/merge-data-tokens.js +15 -0
- package/dist/utils/merge-data-tokens.js.map +1 -0
- package/dist/utils/natural-size.js +53 -0
- package/dist/utils/natural-size.js.map +1 -0
- package/dist/utils/nearest-reveal.js +28 -0
- package/dist/utils/nearest-reveal.js.map +1 -0
- package/dist/utils/placement.js +14 -0
- package/dist/utils/placement.js.map +1 -0
- package/dist/utils/radio-group-keys.js +74 -0
- package/dist/utils/radio-group-keys.js.map +1 -0
- package/dist/utils/rendered-description.js +17 -0
- package/dist/utils/rendered-description.js.map +1 -0
- package/dist/utils/root-props.d.ts +103 -0
- package/dist/utils/root-props.js +51 -0
- package/dist/utils/root-props.js.map +1 -0
- package/dist/utils/search.d.ts +11 -0
- package/dist/utils/search.js +18 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/shortcut.js +20 -0
- package/dist/utils/shortcut.js.map +1 -0
- package/dist/utils/split-data-attributes.d.ts +12 -0
- package/dist/utils/split-data-attributes.js +20 -0
- package/dist/utils/split-data-attributes.js.map +1 -0
- package/dist/utils/toolbar-keys.js +28 -0
- package/dist/utils/toolbar-keys.js.map +1 -0
- package/dist/utils/tv.d.ts +7 -0
- package/dist/utils/tv.js +9 -0
- package/dist/utils/tv.js.map +1 -0
- package/dist/utils/typeahead.js +64 -0
- package/dist/utils/typeahead.js.map +1 -0
- package/dist/utils/warn-once.js +30 -0
- package/dist/utils/warn-once.js.map +1 -0
- package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
- package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
- package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
- package/dist/vendor/material-color-utilities/index.js +51 -0
- package/dist/vendor/material-color-utilities/index.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
- package/dist/vendor/material-color-utilities/score/score.js +115 -0
- package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
- package/package.json +114 -3
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { useM3Spring } from "../../motion/use-m3-spring.js";
|
|
4
|
+
import { usePreloadWhenIdle } from "../../utils/load-on-demand.js";
|
|
5
|
+
import { LazyLoadingIndicator, preloadLoadingIndicator } from "../loading-indicator/lazy-loading-indicator.js";
|
|
6
|
+
import { distanceFraction, overshootRotation, passesThreshold } from "./pull-to-refresh-math.js";
|
|
7
|
+
import { pullToRefreshStyles } from "./pull-to-refresh-styles.js";
|
|
8
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { animate, useMotionValue, useMotionValueEvent, useReducedMotion } from "motion/react";
|
|
11
|
+
import { useObjectRef } from "react-aria";
|
|
12
|
+
//#region src/components/pull-to-refresh/PullToRefresh.tsx
|
|
13
|
+
const DEFAULT_LABELS = {
|
|
14
|
+
pull: "Pull to refresh",
|
|
15
|
+
refreshing: "Refreshing",
|
|
16
|
+
refreshed: "Refreshed"
|
|
17
|
+
};
|
|
18
|
+
/** How far a gesture moves before it's a pull or the browser's, px. */
|
|
19
|
+
const POINTER_SLOP = 4;
|
|
20
|
+
const isScrollContainer = (element) => /^(auto|scroll|overlay)$/.test(getComputedStyle(element).overflowY);
|
|
21
|
+
/**
|
|
22
|
+
* Whether every scroll container from `target` up to the area's (the area itself if it
|
|
23
|
+
* scrolls, else the nearest one above it, or the page) is scrolled to its top, so a downward
|
|
24
|
+
* drag can't scroll anything and pulls instead.
|
|
25
|
+
*/
|
|
26
|
+
function isAtTop(target, root) {
|
|
27
|
+
let passedRoot = false;
|
|
28
|
+
for (let node = target instanceof Element ? target : root; node; node = node.parentElement) {
|
|
29
|
+
if (node.scrollTop >= 1) return false;
|
|
30
|
+
if (node === root) {
|
|
31
|
+
if (isScrollContainer(node)) return true;
|
|
32
|
+
passedRoot = true;
|
|
33
|
+
} else if (passedRoot && isScrollContainer(node)) return true;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether something between `target` and the area handles vertical drags itself (its
|
|
39
|
+
* `touch-action` doesn't allow vertical panning: a vertical slider, a drawing surface), so
|
|
40
|
+
* the gesture is left to it.
|
|
41
|
+
*/
|
|
42
|
+
function ownsVerticalDrag(target, root) {
|
|
43
|
+
for (let node = target instanceof Element ? target : null; node && node !== root; node = node.parentElement) {
|
|
44
|
+
const touchAction = getComputedStyle(node).touchAction;
|
|
45
|
+
if (touchAction === "none") return true;
|
|
46
|
+
if (/pan-x/.test(touchAction) && !/pan-y|pan-up|pan-down/.test(touchAction)) return true;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const isThenable = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
|
|
51
|
+
/**
|
|
52
|
+
* M3 pull to refresh: at the top of its content, a downward drag (touch, mouse or pen) pulls
|
|
53
|
+
* a contained loading indicator in from the top edge, morphing with the pull. Releasing past
|
|
54
|
+
* the threshold calls `onRefresh`; the indicator then rests at the threshold, as an
|
|
55
|
+
* indeterminate loading indicator, until `refreshing` turns `false`. Releasing short of the
|
|
56
|
+
* threshold, or pushing back up, cancels.
|
|
57
|
+
*
|
|
58
|
+
* Wrap a scroll container (give the root `overflow-y-auto` and a height, or put the scrolling
|
|
59
|
+
* element inside it) or a whole page. Scrolling is untouched: the gesture only pulls when the
|
|
60
|
+
* content is at its top and the drag goes down.
|
|
61
|
+
*
|
|
62
|
+
* A `gap-*` on a flex root or `space-y-*` on a block root spaces the content exactly. On a
|
|
63
|
+
* grid root, every in-flow child is a grid item, so the indicator's sticky layer takes a
|
|
64
|
+
* zero-height row of its own and one `row-gap` opens above the content (removing it would
|
|
65
|
+
* mean positioning the layer, which layout safety rules out). Put the grid on an element
|
|
66
|
+
* inside: `<PullToRefresh><div className="grid gap-4">…</div></PullToRefresh>`.
|
|
67
|
+
*
|
|
68
|
+
* Pulling isn't available to everyone, so also offer a refresh button that sets `refreshing`,
|
|
69
|
+
* in an app bar, a menu or next to the content (the spec's accessibility guidance).
|
|
70
|
+
*
|
|
71
|
+
* The motion and sizes follow Compose's `PullToRefreshBox` with
|
|
72
|
+
* `PullToRefreshDefaults.LoadingIndicator`: an 80px threshold, the indicator moving at half
|
|
73
|
+
* the finger's speed and meeting resistance past the threshold, a 48px `primary-container`
|
|
74
|
+
* circle at elevation 0, and a crossfade to the indeterminate indicator while refreshing.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* <PullToRefresh refreshing={loading} onRefresh={reload} className="h-dvh overflow-y-auto">
|
|
78
|
+
* <List aria-label="Messages">…</List>
|
|
79
|
+
* </PullToRefresh>
|
|
80
|
+
*/
|
|
81
|
+
function PullToRefresh({ refreshing: refreshingProp, onRefresh, threshold = 80, disabled = false, labels: labelsProp, children, classNames, className, ref, ...rest }) {
|
|
82
|
+
const labels = {
|
|
83
|
+
...DEFAULT_LABELS,
|
|
84
|
+
...labelsProp
|
|
85
|
+
};
|
|
86
|
+
const [pendingRefresh, setPendingRefresh] = useState(false);
|
|
87
|
+
const refreshing = refreshingProp ?? pendingRefresh;
|
|
88
|
+
const fraction = useMotionValue(refreshing ? 1 : 0);
|
|
89
|
+
const spring = useM3Spring("effects", "default");
|
|
90
|
+
const settle = useReducedMotion() ? { duration: 0 } : spring;
|
|
91
|
+
const [pulling, setPulling] = useState(false);
|
|
92
|
+
const [announcement, setAnnouncement] = useState("");
|
|
93
|
+
usePreloadWhenIdle(preloadLoadingIndicator, !disabled);
|
|
94
|
+
const rootRef = useObjectRef(ref);
|
|
95
|
+
const animationRef = useRef(null);
|
|
96
|
+
const animatingRef = useRef(false);
|
|
97
|
+
const mountedRef = useRef(true);
|
|
98
|
+
const latest = useRef({
|
|
99
|
+
refreshing,
|
|
100
|
+
disabled,
|
|
101
|
+
threshold,
|
|
102
|
+
onRefresh,
|
|
103
|
+
refreshingProp,
|
|
104
|
+
settle
|
|
105
|
+
});
|
|
106
|
+
useLayoutEffect(() => {
|
|
107
|
+
latest.current = {
|
|
108
|
+
refreshing,
|
|
109
|
+
disabled,
|
|
110
|
+
threshold,
|
|
111
|
+
onRefresh,
|
|
112
|
+
refreshingProp,
|
|
113
|
+
settle
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
const layerRef = useRef(null);
|
|
117
|
+
useLayoutEffect(() => {
|
|
118
|
+
if (rootRef.current && layerRef.current) cancelRootGap(rootRef.current, layerRef.current);
|
|
119
|
+
});
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const root = rootRef.current;
|
|
122
|
+
if (!root || typeof ResizeObserver === "undefined") return;
|
|
123
|
+
const observer = new ResizeObserver(() => {
|
|
124
|
+
if (layerRef.current) cancelRootGap(root, layerRef.current);
|
|
125
|
+
});
|
|
126
|
+
observer.observe(root);
|
|
127
|
+
return () => observer.disconnect();
|
|
128
|
+
}, [rootRef]);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
mountedRef.current = true;
|
|
131
|
+
return () => {
|
|
132
|
+
mountedRef.current = false;
|
|
133
|
+
animationRef.current?.stop();
|
|
134
|
+
};
|
|
135
|
+
}, []);
|
|
136
|
+
/** Springs the indicator to `target` (Compose's `animateToThreshold` / `animateToHidden`). */
|
|
137
|
+
const settleRef = useRef((target) => {
|
|
138
|
+
animationRef.current?.stop();
|
|
139
|
+
animatingRef.current = true;
|
|
140
|
+
const controls = animate(fraction, target, latest.current.settle);
|
|
141
|
+
animationRef.current = controls;
|
|
142
|
+
controls.then(() => {
|
|
143
|
+
if (animationRef.current === controls) animatingRef.current = false;
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
const previousRefreshing = useRef(refreshing);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (previousRefreshing.current === refreshing) return;
|
|
149
|
+
previousRefreshing.current = refreshing;
|
|
150
|
+
settleRef.current(refreshing ? 1 : 0);
|
|
151
|
+
setAnnouncement(refreshing ? labels.refreshing : labels.refreshed);
|
|
152
|
+
}, [
|
|
153
|
+
refreshing,
|
|
154
|
+
labels.refreshing,
|
|
155
|
+
labels.refreshed
|
|
156
|
+
]);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
const root = rootRef.current;
|
|
159
|
+
if (!root) return;
|
|
160
|
+
let gesture = null;
|
|
161
|
+
let suppressClick = false;
|
|
162
|
+
const begin = (source, id, x, y, target) => {
|
|
163
|
+
const { disabled: off } = latest.current;
|
|
164
|
+
gesture = off || ownsVerticalDrag(target, root) ? null : {
|
|
165
|
+
id,
|
|
166
|
+
source,
|
|
167
|
+
startX: x,
|
|
168
|
+
startY: y,
|
|
169
|
+
lastY: y,
|
|
170
|
+
phase: "tracking",
|
|
171
|
+
atTop: isAtTop(target, root),
|
|
172
|
+
pulled: 0
|
|
173
|
+
};
|
|
174
|
+
if (gesture?.atTop) preloadLoadingIndicator().catch(() => void 0);
|
|
175
|
+
};
|
|
176
|
+
/** Moves the gesture to `y`; returns whether the area took the movement. */
|
|
177
|
+
const move = (x, y, cancelable) => {
|
|
178
|
+
const current = gesture;
|
|
179
|
+
if (!current || current.phase === "native") return false;
|
|
180
|
+
const dy = y - current.lastY;
|
|
181
|
+
current.lastY = y;
|
|
182
|
+
if (current.phase === "tracking") {
|
|
183
|
+
const totalX = x - current.startX;
|
|
184
|
+
const totalY = y - current.startY;
|
|
185
|
+
const distance = Math.max(Math.abs(totalX), Math.abs(totalY));
|
|
186
|
+
if (current.source === "pointer" && distance <= POINTER_SLOP) return false;
|
|
187
|
+
if (!(totalY > 0 && totalY >= Math.abs(totalX) && current.atTop) || !cancelable) {
|
|
188
|
+
if (!cancelable || distance > POINTER_SLOP) current.phase = "native";
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
const { refreshing: busy } = latest.current;
|
|
192
|
+
if (busy || animatingRef.current) {
|
|
193
|
+
current.phase = "inert";
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
current.phase = "pulling";
|
|
197
|
+
current.pulled = Math.max(0, totalY - (current.source === "pointer" ? POINTER_SLOP : 0));
|
|
198
|
+
setPulling(true);
|
|
199
|
+
fraction.set(distanceFraction(current.pulled, latest.current.threshold));
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
if (current.phase === "inert") return true;
|
|
203
|
+
current.pulled = Math.max(0, current.pulled + dy);
|
|
204
|
+
fraction.set(distanceFraction(current.pulled, latest.current.threshold));
|
|
205
|
+
if (current.pulled === 0) {
|
|
206
|
+
current.phase = "tracking";
|
|
207
|
+
current.startX = x;
|
|
208
|
+
current.startY = y;
|
|
209
|
+
current.atTop = true;
|
|
210
|
+
setPulling(false);
|
|
211
|
+
}
|
|
212
|
+
return true;
|
|
213
|
+
};
|
|
214
|
+
/** Ends the gesture (Compose's `onRelease`); `cancel` never refreshes. */
|
|
215
|
+
const end = (cancel) => {
|
|
216
|
+
const current = gesture;
|
|
217
|
+
gesture = null;
|
|
218
|
+
if (!current || current.phase !== "pulling") return;
|
|
219
|
+
setPulling(false);
|
|
220
|
+
if (current.source === "pointer") {
|
|
221
|
+
suppressClick = true;
|
|
222
|
+
setTimeout(() => {
|
|
223
|
+
suppressClick = false;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
const { threshold: limit, refreshingProp: controlled } = latest.current;
|
|
227
|
+
if (!cancel && passesThreshold(current.pulled, limit)) {
|
|
228
|
+
const result = latest.current.onRefresh();
|
|
229
|
+
if (controlled === void 0 && isThenable(result)) {
|
|
230
|
+
setPendingRefresh(true);
|
|
231
|
+
const done = () => {
|
|
232
|
+
if (mountedRef.current) setPendingRefresh(false);
|
|
233
|
+
};
|
|
234
|
+
result.then(done, done);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
settleRef.current(0);
|
|
238
|
+
};
|
|
239
|
+
const touchOf = (event) => gesture === null ? void 0 : [...event.changedTouches].find((touch) => touch.identifier === gesture?.id);
|
|
240
|
+
const onTouchStart = (event) => {
|
|
241
|
+
if (event.touches.length > 1) {
|
|
242
|
+
end(true);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const touch = event.changedTouches[0];
|
|
246
|
+
if (touch) begin("touch", touch.identifier, touch.clientX, touch.clientY, event.target);
|
|
247
|
+
};
|
|
248
|
+
const onTouchMove = (event) => {
|
|
249
|
+
const touch = touchOf(event);
|
|
250
|
+
if (!touch || event.defaultPrevented) return;
|
|
251
|
+
if (move(touch.clientX, touch.clientY, event.cancelable) && event.cancelable) event.preventDefault();
|
|
252
|
+
};
|
|
253
|
+
const onTouchEnd = (event) => {
|
|
254
|
+
if (touchOf(event)) end(event.type === "touchcancel");
|
|
255
|
+
};
|
|
256
|
+
const onPointerDown = (event) => {
|
|
257
|
+
if (event.pointerType === "touch" || event.button !== 0 || !event.isPrimary) return;
|
|
258
|
+
begin("pointer", event.pointerId, event.clientX, event.clientY, event.target);
|
|
259
|
+
};
|
|
260
|
+
const onPointerMove = (event) => {
|
|
261
|
+
if (gesture?.source !== "pointer" || event.pointerId !== gesture.id) return;
|
|
262
|
+
const wasPulling = gesture.phase === "pulling";
|
|
263
|
+
if (!move(event.clientX, event.clientY, true)) return;
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
if (!wasPulling && gesture?.phase === "pulling") {
|
|
266
|
+
root.setPointerCapture?.(event.pointerId);
|
|
267
|
+
window.getSelection()?.removeAllRanges();
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const onPointerEnd = (event) => {
|
|
271
|
+
if (gesture?.source !== "pointer" || event.pointerId !== gesture.id) return;
|
|
272
|
+
end(event.type === "pointercancel");
|
|
273
|
+
};
|
|
274
|
+
const onClick = (event) => {
|
|
275
|
+
if (!suppressClick) return;
|
|
276
|
+
suppressClick = false;
|
|
277
|
+
event.preventDefault();
|
|
278
|
+
event.stopPropagation();
|
|
279
|
+
};
|
|
280
|
+
const options = { passive: false };
|
|
281
|
+
root.addEventListener("touchstart", onTouchStart, { passive: true });
|
|
282
|
+
root.addEventListener("touchmove", onTouchMove, options);
|
|
283
|
+
root.addEventListener("touchend", onTouchEnd);
|
|
284
|
+
root.addEventListener("touchcancel", onTouchEnd);
|
|
285
|
+
root.addEventListener("pointerdown", onPointerDown);
|
|
286
|
+
root.addEventListener("pointermove", onPointerMove);
|
|
287
|
+
root.addEventListener("pointerup", onPointerEnd);
|
|
288
|
+
root.addEventListener("pointercancel", onPointerEnd);
|
|
289
|
+
root.addEventListener("click", onClick, { capture: true });
|
|
290
|
+
return () => {
|
|
291
|
+
root.removeEventListener("touchstart", onTouchStart);
|
|
292
|
+
root.removeEventListener("touchmove", onTouchMove);
|
|
293
|
+
root.removeEventListener("touchend", onTouchEnd);
|
|
294
|
+
root.removeEventListener("touchcancel", onTouchEnd);
|
|
295
|
+
root.removeEventListener("pointerdown", onPointerDown);
|
|
296
|
+
root.removeEventListener("pointermove", onPointerMove);
|
|
297
|
+
root.removeEventListener("pointerup", onPointerEnd);
|
|
298
|
+
root.removeEventListener("pointercancel", onPointerEnd);
|
|
299
|
+
root.removeEventListener("click", onClick, { capture: true });
|
|
300
|
+
};
|
|
301
|
+
}, [fraction, rootRef]);
|
|
302
|
+
const styles = pullToRefreshStyles();
|
|
303
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
304
|
+
...rest,
|
|
305
|
+
ref: rootRef,
|
|
306
|
+
"data-pulling": pulling || void 0,
|
|
307
|
+
"data-refreshing": refreshing || void 0,
|
|
308
|
+
"data-disabled": disabled || void 0,
|
|
309
|
+
className: styles.root({ class: cn(classNames?.root, className) }),
|
|
310
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
311
|
+
ref: layerRef,
|
|
312
|
+
className: styles.layer({ class: classNames?.layer }),
|
|
313
|
+
style: { "--m3-pull-to-refresh-threshold": `${threshold}px` },
|
|
314
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
315
|
+
className: styles.clip(),
|
|
316
|
+
children: /* @__PURE__ */ jsx(PullIndicator, {
|
|
317
|
+
fraction,
|
|
318
|
+
refreshing,
|
|
319
|
+
threshold,
|
|
320
|
+
labels,
|
|
321
|
+
className: styles.indicator({ class: classNames?.indicator }),
|
|
322
|
+
faceClassName: styles.face()
|
|
323
|
+
})
|
|
324
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
325
|
+
role: "status",
|
|
326
|
+
className: "sr-only",
|
|
327
|
+
children: announcement
|
|
328
|
+
})]
|
|
329
|
+
}), children]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Keeps the root's own spacing from opening below the zero-height layer. Its margins are the
|
|
334
|
+
* library's: zero, so a `space-y-*` root doesn't push the content down, and in a flex root a
|
|
335
|
+
* negative margin as large as the gap along the main axis. In a grid root it moves to an
|
|
336
|
+
* implicit row of its own before the first one, across every column, so the content keeps its
|
|
337
|
+
* rows and columns; a grid row's size can't go below zero, so one row gap stays above the
|
|
338
|
+
* content (documented: put the grid on an element inside the root).
|
|
339
|
+
*/
|
|
340
|
+
function cancelRootGap(root, layer) {
|
|
341
|
+
const style = getComputedStyle(root);
|
|
342
|
+
const grid = style.display.endsWith("grid");
|
|
343
|
+
const flex = style.display.endsWith("flex");
|
|
344
|
+
const row = flex && style.flexDirection.startsWith("row");
|
|
345
|
+
const reverse = flex && style.flexDirection.endsWith("reverse");
|
|
346
|
+
const gap = Number.parseFloat(row ? style.columnGap : style.rowGap);
|
|
347
|
+
for (const side of [
|
|
348
|
+
"BlockStart",
|
|
349
|
+
"BlockEnd",
|
|
350
|
+
"InlineStart",
|
|
351
|
+
"InlineEnd"
|
|
352
|
+
]) layer.style[`margin${side}`] = "0px";
|
|
353
|
+
if (flex && gap > 0) layer.style[`margin${row ? "Inline" : "Block"}${reverse ? "Start" : "End"}`] = `${-gap}px`;
|
|
354
|
+
layer.style.gridRow = grid ? "span 1 / 1" : "";
|
|
355
|
+
layer.style.gridColumn = grid ? "1 / -1" : "";
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* The indicator, subscribed to the pull on its own so a pull re-renders only it, never the
|
|
359
|
+
* content. Hidden at rest; while pulled it is a determinate loading indicator following the
|
|
360
|
+
* pull, and while refreshing an indeterminate one, crossfading between them.
|
|
361
|
+
*/
|
|
362
|
+
function PullIndicator({ fraction, refreshing, threshold, labels, className, faceClassName }) {
|
|
363
|
+
const [value, setValue] = useState(() => fraction.get());
|
|
364
|
+
useMotionValueEvent(fraction, "change", setValue);
|
|
365
|
+
if (value <= 0 && !refreshing) return null;
|
|
366
|
+
const rotation = overshootRotation(value);
|
|
367
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
368
|
+
"data-indicator": "",
|
|
369
|
+
className,
|
|
370
|
+
style: { transform: `translateY(calc(${value * threshold}px - 100%))` },
|
|
371
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
372
|
+
"data-active": !refreshing,
|
|
373
|
+
"aria-hidden": refreshing || void 0,
|
|
374
|
+
className: faceClassName,
|
|
375
|
+
style: rotation === 0 ? void 0 : { transform: `rotate(${rotation}deg)` },
|
|
376
|
+
children: /* @__PURE__ */ jsx(LazyLoadingIndicator, {
|
|
377
|
+
variant: "contained",
|
|
378
|
+
value: Math.min(Math.max(value, 0), 1),
|
|
379
|
+
"aria-label": labels.pull
|
|
380
|
+
})
|
|
381
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
382
|
+
"data-active": refreshing,
|
|
383
|
+
"aria-hidden": !refreshing || void 0,
|
|
384
|
+
className: faceClassName,
|
|
385
|
+
children: /* @__PURE__ */ jsx(LazyLoadingIndicator, {
|
|
386
|
+
variant: "contained",
|
|
387
|
+
"aria-label": labels.refreshing
|
|
388
|
+
})
|
|
389
|
+
})]
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
export { PullToRefresh };
|
|
394
|
+
|
|
395
|
+
//# sourceMappingURL=PullToRefresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PullToRefresh.js","names":[],"sources":["../../../src/components/pull-to-refresh/PullToRefresh.tsx"],"sourcesContent":["'use client';\n\nimport {\n animate,\n useMotionValue,\n useMotionValueEvent,\n useReducedMotion,\n type MotionValue,\n} from 'motion/react';\nimport {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithRef,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport { useObjectRef } from 'react-aria';\nimport { useM3Spring } from '../../motion/use-m3-spring';\nimport { cn } from '../../utils/cn';\nimport { usePreloadWhenIdle } from '../../utils/load-on-demand';\nimport {\n LazyLoadingIndicator,\n preloadLoadingIndicator,\n} from '../loading-indicator/lazy-loading-indicator';\nimport {\n POSITIONAL_THRESHOLD,\n distanceFraction,\n overshootRotation,\n passesThreshold,\n} from './pull-to-refresh-math';\nimport { pullToRefreshStyles } from './pull-to-refresh-styles';\n\nexport interface PullToRefreshClassNames {\n /** The outer element, around the content. */\n root?: string;\n /**\n * The zero-height sticky layer the indicator hangs from, at the top of the area. Give it a\n * `top-*` class when a sticky app bar covers the top of a scrolling page. Its margins are\n * the library's, so a flex root's `gap-*` or a block root's `space-y-*` never moves the\n * content. In a grid root it is a grid item, so one row gap opens above the content.\n */\n layer?: string;\n /** The 48px circle holding the loading indicator. */\n indicator?: string;\n}\n\n/** Words the pull to refresh announces. */\nexport interface PullToRefreshLabels {\n /** The indicator's name while it follows a pull. @default \"Pull to refresh\" */\n pull: string;\n /**\n * The indicator's name while refreshing, also announced when a refresh starts.\n * @default \"Refreshing\"\n */\n refreshing: string;\n /** Announced when a refresh completes. @default \"Refreshed\" */\n refreshed: string;\n}\n\nconst DEFAULT_LABELS: PullToRefreshLabels = {\n pull: 'Pull to refresh',\n refreshing: 'Refreshing',\n refreshed: 'Refreshed',\n};\n\n/** How far a gesture moves before it's a pull or the browser's, px. */\nconst POINTER_SLOP = 4;\n\ninterface PullToRefreshOwnProps {\n /**\n * Whether a refresh is running. While it is, the indicator rests at the threshold as an\n * indeterminate loading indicator; when it turns `false` the indicator leaves. Set it `true`\n * from a refresh button too, and the indicator comes in the same way. Leave it out to let a\n * promise returned by `onRefresh` drive it.\n */\n refreshing?: boolean;\n /**\n * Called when a pull is released past the threshold. Start the refresh and set\n * `refreshing`, or return a promise: without `refreshing`, the indicator stays until it\n * settles.\n */\n onRefresh: () => void | Promise<unknown>;\n /** How far the indicator travels before a release refreshes, px. @default 80 */\n threshold?: number;\n /** Turns the gesture off. A running refresh still shows its indicator. @default false */\n disabled?: boolean;\n /**\n * Words the pull to refresh announces, with English defaults; name them for what refreshes\n * (\"Refreshing messages\").\n */\n labels?: Partial<PullToRefreshLabels>;\n /**\n * The content: a scrolling list, grid or card collection, or a whole page. On a grid root\n * (`grid` on `className`) the indicator's layer is a grid item, so one row gap opens above\n * the content; put the grid on an element inside instead. Flex, block and `space-y-*` roots\n * are exact.\n */\n children?: ReactNode;\n /** Classes for the parts: `root`, `layer` (the sticky layer at the top) and `indicator`. */\n classNames?: PullToRefreshClassNames;\n}\n\nexport type PullToRefreshProps = PullToRefreshOwnProps &\n Omit<ComponentPropsWithRef<'div'>, keyof PullToRefreshOwnProps>;\n\n/** A pointer or touch gesture over the area. */\ninterface Gesture {\n /** The touch's identifier, or the pointer's id. */\n id: number;\n /** `touch` for touch events, otherwise the pointer type (mouse or pen). */\n source: 'touch' | 'pointer';\n startX: number;\n startY: number;\n lastY: number;\n /**\n * `tracking`: not pulling (yet). `pulling`: the indicator follows the gesture. `inert`: the\n * area claims the gesture (so the browser doesn't overscroll) but it does nothing, because a\n * refresh or a settle animation is running. `native`: the browser scrolls; hands off.\n */\n phase: 'tracking' | 'pulling' | 'inert' | 'native';\n /** Every scroll container between the gesture's target and the area is at its top. */\n atTop: boolean;\n /** How far the gesture has pulled, px (Compose's `distancePulled`). */\n pulled: number;\n}\n\nconst isScrollContainer = (element: Element) =>\n /^(auto|scroll|overlay)$/.test(getComputedStyle(element).overflowY);\n\n/**\n * Whether every scroll container from `target` up to the area's (the area itself if it\n * scrolls, else the nearest one above it, or the page) is scrolled to its top, so a downward\n * drag can't scroll anything and pulls instead.\n */\nfunction isAtTop(target: EventTarget | null, root: HTMLElement): boolean {\n let passedRoot = false;\n for (\n let node: Element | null = target instanceof Element ? target : root;\n node;\n node = node.parentElement\n ) {\n if (node.scrollTop >= 1) return false;\n if (node === root) {\n if (isScrollContainer(node)) return true;\n passedRoot = true;\n } else if (passedRoot && isScrollContainer(node)) {\n return true;\n }\n }\n return true;\n}\n\n/**\n * Whether something between `target` and the area handles vertical drags itself (its\n * `touch-action` doesn't allow vertical panning: a vertical slider, a drawing surface), so\n * the gesture is left to it.\n */\nfunction ownsVerticalDrag(target: EventTarget | null, root: HTMLElement): boolean {\n for (\n let node = target instanceof Element ? target : null;\n node && node !== root;\n node = node.parentElement\n ) {\n const touchAction = getComputedStyle(node).touchAction;\n if (touchAction === 'none') return true;\n if (/pan-x/.test(touchAction) && !/pan-y|pan-up|pan-down/.test(touchAction)) return true;\n }\n return false;\n}\n\nconst isThenable = (value: unknown): value is PromiseLike<unknown> =>\n typeof value === 'object' &&\n value !== null &&\n typeof (value as { then?: unknown }).then === 'function';\n\n/**\n * M3 pull to refresh: at the top of its content, a downward drag (touch, mouse or pen) pulls\n * a contained loading indicator in from the top edge, morphing with the pull. Releasing past\n * the threshold calls `onRefresh`; the indicator then rests at the threshold, as an\n * indeterminate loading indicator, until `refreshing` turns `false`. Releasing short of the\n * threshold, or pushing back up, cancels.\n *\n * Wrap a scroll container (give the root `overflow-y-auto` and a height, or put the scrolling\n * element inside it) or a whole page. Scrolling is untouched: the gesture only pulls when the\n * content is at its top and the drag goes down.\n *\n * A `gap-*` on a flex root or `space-y-*` on a block root spaces the content exactly. On a\n * grid root, every in-flow child is a grid item, so the indicator's sticky layer takes a\n * zero-height row of its own and one `row-gap` opens above the content (removing it would\n * mean positioning the layer, which layout safety rules out). Put the grid on an element\n * inside: `<PullToRefresh><div className=\"grid gap-4\">…</div></PullToRefresh>`.\n *\n * Pulling isn't available to everyone, so also offer a refresh button that sets `refreshing`,\n * in an app bar, a menu or next to the content (the spec's accessibility guidance).\n *\n * The motion and sizes follow Compose's `PullToRefreshBox` with\n * `PullToRefreshDefaults.LoadingIndicator`: an 80px threshold, the indicator moving at half\n * the finger's speed and meeting resistance past the threshold, a 48px `primary-container`\n * circle at elevation 0, and a crossfade to the indeterminate indicator while refreshing.\n *\n * @example\n * <PullToRefresh refreshing={loading} onRefresh={reload} className=\"h-dvh overflow-y-auto\">\n * <List aria-label=\"Messages\">…</List>\n * </PullToRefresh>\n */\nexport function PullToRefresh({\n refreshing: refreshingProp,\n onRefresh,\n threshold = POSITIONAL_THRESHOLD,\n disabled = false,\n labels: labelsProp,\n children,\n classNames,\n className,\n ref,\n ...rest\n}: PullToRefreshProps) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const [pendingRefresh, setPendingRefresh] = useState(false);\n const refreshing = refreshingProp ?? pendingRefresh;\n const fraction = useMotionValue(refreshing ? 1 : 0);\n // Settling to the threshold or away never bounces: Compose animates it with\n // `Animatable.animateTo`'s default, non-bouncing spring, which the default effects spring\n // matches (2026-10-15; the fast spatial one dipped 3px under the threshold and back).\n const spring = useM3Spring('effects', 'default');\n // Under reduced motion the indicator jumps to the threshold or away; a pull still moves it.\n const settle = useReducedMotion() ? { duration: 0 } : spring;\n const [pulling, setPulling] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n // The indicator's code (its shapes and morphing) loads on demand: when the browser is first\n // idle, or when a pull starts, whichever comes first.\n usePreloadWhenIdle(preloadLoadingIndicator, !disabled);\n\n const rootRef = useObjectRef(ref);\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const animatingRef = useRef(false);\n const mountedRef = useRef(true);\n // The latest props and helpers, for the native listeners added once.\n const latest = useRef({ refreshing, disabled, threshold, onRefresh, refreshingProp, settle });\n useLayoutEffect(() => {\n latest.current = { refreshing, disabled, threshold, onRefresh, refreshingProp, settle };\n });\n\n // The layer is the root's first child, so a consumer `gap-*` on a flex root would open a gap\n // below it and push the content down. It's cancelled after every render and whenever the\n // root resizes (a responsive class may change the gap).\n const layerRef = useRef<HTMLDivElement>(null);\n useLayoutEffect(() => {\n if (rootRef.current && layerRef.current) cancelRootGap(rootRef.current, layerRef.current);\n });\n useEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => {\n if (layerRef.current) cancelRootGap(root, layerRef.current);\n });\n observer.observe(root);\n return () => observer.disconnect();\n }, [rootRef]);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n animationRef.current?.stop();\n };\n }, []);\n\n /** Springs the indicator to `target` (Compose's `animateToThreshold` / `animateToHidden`). */\n const settleRef = useRef((target: number) => {\n animationRef.current?.stop();\n animatingRef.current = true;\n const controls = animate(fraction, target, latest.current.settle);\n animationRef.current = controls;\n void controls.then(() => {\n if (animationRef.current === controls) animatingRef.current = false;\n });\n });\n\n // A refresh starting or ending moves the indicator to the threshold or away, and is\n // announced. The first render places it without either (Compose's `onAttach`).\n const previousRefreshing = useRef(refreshing);\n useEffect(() => {\n if (previousRefreshing.current === refreshing) return;\n previousRefreshing.current = refreshing;\n settleRef.current(refreshing ? 1 : 0);\n setAnnouncement(refreshing ? labels.refreshing : labels.refreshed);\n }, [refreshing, labels.refreshing, labels.refreshed]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n let gesture: Gesture | null = null;\n let suppressClick = false;\n\n const begin = (\n source: Gesture['source'],\n id: number,\n x: number,\n y: number,\n target: EventTarget | null,\n ) => {\n const { disabled: off } = latest.current;\n gesture =\n off || ownsVerticalDrag(target, root)\n ? null\n : {\n id,\n source,\n startX: x,\n startY: y,\n lastY: y,\n phase: 'tracking',\n atTop: isAtTop(target, root),\n pulled: 0,\n };\n // A pull may start: the indicator's code loads now (if the idle preload hasn't loaded it\n // yet), well before the gesture passes the slop and the indicator shows. A failed load is\n // tried again by the indicator itself.\n if (gesture?.atTop) void preloadLoadingIndicator().catch(() => undefined);\n };\n\n /** Moves the gesture to `y`; returns whether the area took the movement. */\n const move = (x: number, y: number, cancelable: boolean): boolean => {\n const current = gesture;\n if (!current || current.phase === 'native') return false;\n const dy = y - current.lastY;\n current.lastY = y;\n if (current.phase === 'tracking') {\n const totalX = x - current.startX;\n const totalY = y - current.startY;\n const distance = Math.max(Math.abs(totalX), Math.abs(totalY));\n // A mouse or pen must move past the slop first, so a click stays a click.\n if (current.source === 'pointer' && distance <= POINTER_SLOP) return false;\n const downward = totalY > 0 && totalY >= Math.abs(totalX) && current.atTop;\n if (!downward || !cancelable) {\n // Sideways, upward or mid-scroll: the browser's for the rest of the gesture. A\n // touch gets the same slop before it's decided, against a finger's jitter.\n if (!cancelable || distance > POINTER_SLOP) current.phase = 'native';\n return false;\n }\n const { refreshing: busy } = latest.current;\n if (busy || animatingRef.current) {\n current.phase = 'inert';\n return true;\n }\n current.phase = 'pulling';\n // A mouse or pen pull starts at the slop, so the indicator doesn't jump.\n current.pulled = Math.max(0, totalY - (current.source === 'pointer' ? POINTER_SLOP : 0));\n setPulling(true);\n fraction.set(distanceFraction(current.pulled, latest.current.threshold));\n return true;\n }\n if (current.phase === 'inert') return true;\n // Pulling: up and down both move the indicator (Compose's pre- and post-scroll).\n current.pulled = Math.max(0, current.pulled + dy);\n fraction.set(distanceFraction(current.pulled, latest.current.threshold));\n if (current.pulled === 0) {\n // Pushed all the way back: the gesture may scroll the content again.\n current.phase = 'tracking';\n current.startX = x;\n current.startY = y;\n current.atTop = true;\n setPulling(false);\n }\n return true;\n };\n\n /** Ends the gesture (Compose's `onRelease`); `cancel` never refreshes. */\n const end = (cancel: boolean) => {\n const current = gesture;\n gesture = null;\n if (!current || current.phase !== 'pulling') return;\n setPulling(false);\n if (current.source === 'pointer') {\n // A mouse pull ends with a click on whatever is under the pointer; it isn't one. The\n // click comes before any timer.\n suppressClick = true;\n setTimeout(() => {\n suppressClick = false;\n });\n }\n const { threshold: limit, refreshingProp: controlled } = latest.current;\n if (!cancel && passesThreshold(current.pulled, limit)) {\n const result = latest.current.onRefresh();\n if (controlled === undefined && isThenable(result)) {\n setPendingRefresh(true);\n const done = () => {\n if (mountedRef.current) setPendingRefresh(false);\n };\n result.then(done, done);\n }\n }\n // Compose hides the indicator here; a refresh that starts moves it to the threshold.\n settleRef.current(0);\n };\n\n const touchOf = (event: TouchEvent) =>\n gesture === null\n ? undefined\n : [...event.changedTouches].find((touch) => touch.identifier === gesture?.id);\n\n const onTouchStart = (event: TouchEvent) => {\n if (event.touches.length > 1) {\n // A second finger (pinch to zoom) ends the pull without refreshing.\n end(true);\n return;\n }\n const touch = event.changedTouches[0];\n if (touch) begin('touch', touch.identifier, touch.clientX, touch.clientY, event.target);\n };\n const onTouchMove = (event: TouchEvent) => {\n const touch = touchOf(event);\n if (!touch || event.defaultPrevented) return;\n if (move(touch.clientX, touch.clientY, event.cancelable) && event.cancelable) {\n event.preventDefault();\n }\n };\n const onTouchEnd = (event: TouchEvent) => {\n if (touchOf(event)) end(event.type === 'touchcancel');\n };\n\n const onPointerDown = (event: PointerEvent) => {\n if (event.pointerType === 'touch' || event.button !== 0 || !event.isPrimary) return;\n begin('pointer', event.pointerId, event.clientX, event.clientY, event.target);\n };\n const onPointerMove = (event: PointerEvent) => {\n if (gesture?.source !== 'pointer' || event.pointerId !== gesture.id) return;\n const wasPulling = gesture.phase === 'pulling';\n if (!move(event.clientX, event.clientY, true)) return;\n event.preventDefault();\n if (!wasPulling && gesture?.phase === 'pulling') {\n root.setPointerCapture?.(event.pointerId);\n // A mouse drag would otherwise select the text it passes.\n window.getSelection()?.removeAllRanges();\n }\n };\n const onPointerEnd = (event: PointerEvent) => {\n if (gesture?.source !== 'pointer' || event.pointerId !== gesture.id) return;\n end(event.type === 'pointercancel');\n };\n const onClick = (event: MouseEvent) => {\n if (!suppressClick) return;\n suppressClick = false;\n event.preventDefault();\n event.stopPropagation();\n };\n\n const options = { passive: false } as const;\n root.addEventListener('touchstart', onTouchStart, { passive: true });\n root.addEventListener('touchmove', onTouchMove, options);\n root.addEventListener('touchend', onTouchEnd);\n root.addEventListener('touchcancel', onTouchEnd);\n root.addEventListener('pointerdown', onPointerDown);\n root.addEventListener('pointermove', onPointerMove);\n root.addEventListener('pointerup', onPointerEnd);\n root.addEventListener('pointercancel', onPointerEnd);\n root.addEventListener('click', onClick, { capture: true });\n return () => {\n root.removeEventListener('touchstart', onTouchStart);\n root.removeEventListener('touchmove', onTouchMove);\n root.removeEventListener('touchend', onTouchEnd);\n root.removeEventListener('touchcancel', onTouchEnd);\n root.removeEventListener('pointerdown', onPointerDown);\n root.removeEventListener('pointermove', onPointerMove);\n root.removeEventListener('pointerup', onPointerEnd);\n root.removeEventListener('pointercancel', onPointerEnd);\n root.removeEventListener('click', onClick, { capture: true });\n };\n }, [fraction, rootRef]);\n\n const styles = pullToRefreshStyles();\n\n return (\n <div\n {...rest}\n ref={rootRef}\n data-pulling={pulling || undefined}\n data-refreshing={refreshing || undefined}\n data-disabled={disabled || undefined}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <div\n ref={layerRef}\n className={styles.layer({ class: classNames?.layer })}\n style={{ '--m3-pull-to-refresh-threshold': `${threshold}px` } as CSSProperties}\n >\n <div className={styles.clip()}>\n <PullIndicator\n fraction={fraction}\n refreshing={refreshing}\n threshold={threshold}\n labels={labels}\n className={styles.indicator({ class: classNames?.indicator })}\n faceClassName={styles.face()}\n />\n </div>\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n {children}\n </div>\n );\n}\n\n/**\n * Keeps the root's own spacing from opening below the zero-height layer. Its margins are the\n * library's: zero, so a `space-y-*` root doesn't push the content down, and in a flex root a\n * negative margin as large as the gap along the main axis. In a grid root it moves to an\n * implicit row of its own before the first one, across every column, so the content keeps its\n * rows and columns; a grid row's size can't go below zero, so one row gap stays above the\n * content (documented: put the grid on an element inside the root).\n */\nfunction cancelRootGap(root: HTMLElement, layer: HTMLElement) {\n const style = getComputedStyle(root);\n const grid = style.display.endsWith('grid');\n const flex = style.display.endsWith('flex');\n const row = flex && style.flexDirection.startsWith('row');\n const reverse = flex && style.flexDirection.endsWith('reverse');\n const gap = Number.parseFloat(row ? style.columnGap : style.rowGap);\n for (const side of ['BlockStart', 'BlockEnd', 'InlineStart', 'InlineEnd'] as const) {\n layer.style[`margin${side}`] = '0px';\n }\n if (flex && gap > 0) {\n layer.style[`margin${row ? 'Inline' : 'Block'}${reverse ? 'Start' : 'End'}`] = `${-gap}px`;\n }\n layer.style.gridRow = grid ? 'span 1 / 1' : '';\n layer.style.gridColumn = grid ? '1 / -1' : '';\n}\n\n/**\n * The indicator, subscribed to the pull on its own so a pull re-renders only it, never the\n * content. Hidden at rest; while pulled it is a determinate loading indicator following the\n * pull, and while refreshing an indeterminate one, crossfading between them.\n */\nfunction PullIndicator({\n fraction,\n refreshing,\n threshold,\n labels,\n className,\n faceClassName,\n}: {\n fraction: MotionValue<number>;\n refreshing: boolean;\n threshold: number;\n labels: PullToRefreshLabels;\n className: string;\n faceClassName: string;\n}) {\n const [value, setValue] = useState(() => fraction.get());\n useMotionValueEvent(fraction, 'change', setValue);\n if (value <= 0 && !refreshing) return null;\n const rotation = overshootRotation(value);\n return (\n <div\n data-indicator=\"\"\n className={className}\n // Compose's `translationY = distanceFraction × maxDistance − height`.\n style={{ transform: `translateY(calc(${value * threshold}px - 100%))` }}\n >\n <div\n data-active={!refreshing}\n aria-hidden={refreshing || undefined}\n className={faceClassName}\n style={rotation === 0 ? undefined : { transform: `rotate(${rotation}deg)` }}\n >\n <LazyLoadingIndicator\n variant=\"contained\"\n value={Math.min(Math.max(value, 0), 1)}\n aria-label={labels.pull}\n />\n </div>\n <div\n data-active={refreshing}\n aria-hidden={!refreshing || undefined}\n className={faceClassName}\n >\n <LazyLoadingIndicator variant=\"contained\" aria-label={labels.refreshing} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA6DA,MAAM,iBAAsC;CAC1C,MAAM;CACN,YAAY;CACZ,WAAW;AACb;;AAGA,MAAM,eAAe;AA4DrB,MAAM,qBAAqB,YACzB,0BAA0B,KAAK,iBAAiB,OAAO,CAAC,CAAC,SAAS;;;;;;AAOpE,SAAS,QAAQ,QAA4B,MAA4B;CACvE,IAAI,aAAa;CACjB,KACE,IAAI,OAAuB,kBAAkB,UAAU,SAAS,MAChE,MACA,OAAO,KAAK,eACZ;EACA,IAAI,KAAK,aAAa,GAAG,OAAO;EAChC,IAAI,SAAS,MAAM;GACjB,IAAI,kBAAkB,IAAI,GAAG,OAAO;GACpC,aAAa;EACf,OAAO,IAAI,cAAc,kBAAkB,IAAI,GAC7C,OAAO;CAEX;CACA,OAAO;AACT;;;;;;AAOA,SAAS,iBAAiB,QAA4B,MAA4B;CAChF,KACE,IAAI,OAAO,kBAAkB,UAAU,SAAS,MAChD,QAAQ,SAAS,MACjB,OAAO,KAAK,eACZ;EACA,MAAM,cAAc,iBAAiB,IAAI,CAAC,CAAC;EAC3C,IAAI,gBAAgB,QAAQ,OAAO;EACnC,IAAI,QAAQ,KAAK,WAAW,KAAK,CAAC,wBAAwB,KAAK,WAAW,GAAG,OAAO;CACtF;CACA,OAAO;AACT;AAEA,MAAM,cAAc,UAClB,OAAO,UAAU,YACjB,UAAU,QACV,OAAQ,MAA6B,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgChD,SAAgB,cAAc,EAC5B,YAAY,gBACZ,WACA,YAAA,IACA,WAAW,OACX,QAAQ,YACR,UACA,YACA,WACA,KACA,GAAG,QACkB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AW,mBAAmB,QAAQ,UAAU,aAAa;EAJxE,UAAA,CAME,oBAAC,OAAD;GACE,eAAa,CAAC;GACd,eAAa,cAAc,KAAA;GAC3B,WAAW;GACX,OAAO,aAAa,IAAI,KAAA,IAAY,EAAE,WAAW,UAAU,SAAS,MAAM;GAE1E,UAAA,oBAAC,sBAAD;IACE,SAAQ;IACR,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC;IACrC,cAAY,OAAO;GACpB,CAAA;EACE,CAAA,GACL,oBAAC,OAAD;GACE,eAAa;GACb,eAAa,CAAC,cAAc,KAAA;GAC5B,WAAW;GAEX,UAAA,oBAAC,sBAAD;IAAsB,SAAQ;IAAY,cAAY,OAAO;GAAa,CAAA;EACvE,CAAA,CACF;;AAET"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/components/pull-to-refresh/pull-to-refresh-math.ts
|
|
2
|
+
/** Compose's `DragMultiplier`: the indicator moves half as far as the finger. */
|
|
3
|
+
const DRAG_MULTIPLIER = .5;
|
|
4
|
+
/**
|
|
5
|
+
* The indicator's offset, px, for a pull of `distancePulled` px (Compose's
|
|
6
|
+
* `calculateVerticalOffset`). Below the threshold it follows the finger at half speed; past it
|
|
7
|
+
* the extra pull meets growing resistance, up to one more threshold at three times the pull.
|
|
8
|
+
*/
|
|
9
|
+
function verticalOffset(distancePulled, threshold) {
|
|
10
|
+
const adjusted = Math.max(0, distancePulled) * DRAG_MULTIPLIER;
|
|
11
|
+
if (adjusted <= threshold) return adjusted;
|
|
12
|
+
const linearTension = Math.min(Math.max(adjusted / threshold - 1, 0), 2);
|
|
13
|
+
return threshold + threshold * (linearTension - linearTension ** 2 / 4);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Compose's `PullToRefreshState.distanceFraction` while pulling: the offset over the
|
|
17
|
+
* threshold. 1 is the threshold; it reaches 2 at most.
|
|
18
|
+
*/
|
|
19
|
+
function distanceFraction(distancePulled, threshold) {
|
|
20
|
+
return threshold > 0 ? verticalOffset(distancePulled, threshold) / threshold : 0;
|
|
21
|
+
}
|
|
22
|
+
/** Whether releasing a pull of `distancePulled` px refreshes (Compose's `onRelease`). */
|
|
23
|
+
function passesThreshold(distancePulled, threshold) {
|
|
24
|
+
return distancePulled * DRAG_MULTIPLIER > threshold;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The extra turn, in degrees, of the determinate indicator pulled past the threshold:
|
|
28
|
+
* Compose's `PullToRefreshDefaults.LoadingIndicator` turns it back half a turn per threshold
|
|
29
|
+
* of overshoot, starting at the threshold so the shape doesn't jump.
|
|
30
|
+
*/
|
|
31
|
+
function overshootRotation(fraction) {
|
|
32
|
+
return fraction > 1 ? -(fraction - 1) * 180 : 0;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { DRAG_MULTIPLIER, distanceFraction, overshootRotation, passesThreshold, verticalOffset };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=pull-to-refresh-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull-to-refresh-math.js","names":[],"sources":["../../../src/components/pull-to-refresh/pull-to-refresh-math.ts"],"sourcesContent":["/*\n * The pull's arithmetic, ported from Compose Material 3's `PullToRefreshModifierNode`\n * (androidx `compose/material3/pulltorefresh/PullToRefresh.kt`). Pure functions, so they're\n * unit-tested against Compose's numbers.\n */\n\n/** Compose's `PullToRefreshDefaults.PositionalThreshold`, px: how far the indicator travels. */\nexport const POSITIONAL_THRESHOLD = 80;\n\n/** Compose's `DragMultiplier`: the indicator moves half as far as the finger. */\nexport const DRAG_MULTIPLIER = 0.5;\n\n/**\n * The indicator's offset, px, for a pull of `distancePulled` px (Compose's\n * `calculateVerticalOffset`). Below the threshold it follows the finger at half speed; past it\n * the extra pull meets growing resistance, up to one more threshold at three times the pull.\n */\nexport function verticalOffset(distancePulled: number, threshold: number): number {\n const adjusted = Math.max(0, distancePulled) * DRAG_MULTIPLIER;\n if (adjusted <= threshold) return adjusted;\n // How far beyond the threshold the pull has gone, as a fraction of the threshold, limited\n // to 200%; the tension grows with it at a decreasing rate.\n const linearTension = Math.min(Math.max(adjusted / threshold - 1, 0), 2);\n const tension = linearTension - linearTension ** 2 / 4;\n return threshold + threshold * tension;\n}\n\n/**\n * Compose's `PullToRefreshState.distanceFraction` while pulling: the offset over the\n * threshold. 1 is the threshold; it reaches 2 at most.\n */\nexport function distanceFraction(distancePulled: number, threshold: number): number {\n return threshold > 0 ? verticalOffset(distancePulled, threshold) / threshold : 0;\n}\n\n/** Whether releasing a pull of `distancePulled` px refreshes (Compose's `onRelease`). */\nexport function passesThreshold(distancePulled: number, threshold: number): boolean {\n return distancePulled * DRAG_MULTIPLIER > threshold;\n}\n\n/**\n * The extra turn, in degrees, of the determinate indicator pulled past the threshold:\n * Compose's `PullToRefreshDefaults.LoadingIndicator` turns it back half a turn per threshold\n * of overshoot, starting at the threshold so the shape doesn't jump.\n */\nexport function overshootRotation(fraction: number): number {\n return fraction > 1 ? -(fraction - 1) * 180 : 0;\n}\n"],"mappings":";;AAUA,MAAa,kBAAkB;;;;;;AAO/B,SAAgB,eAAe,gBAAwB,WAA2B;CAChF,MAAM,WAAW,KAAK,IAAI,GAAG,cAAc,IAAI;CAC/C,IAAI,YAAY,WAAW,OAAO;CAGlC,MAAM,gBAAgB,KAAK,IAAI,KAAK,IAAI,WAAW,YAAY,GAAG,CAAC,GAAG,CAAC;CAEvE,OAAO,YAAY,aADH,gBAAgB,iBAAiB,IAAI;AAEvD;;;;;AAMA,SAAgB,iBAAiB,gBAAwB,WAA2B;CAClF,OAAO,YAAY,IAAI,eAAe,gBAAgB,SAAS,IAAI,YAAY;AACjF;;AAGA,SAAgB,gBAAgB,gBAAwB,WAA4B;CAClF,OAAO,iBAAiB,kBAAkB;AAC5C;;;;;;AAOA,SAAgB,kBAAkB,UAA0B;CAC1D,OAAO,WAAW,IAAI,EAAE,WAAW,KAAK,MAAM;AAChD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/components/pull-to-refresh/pull-to-refresh-styles.d.ts
|
|
2
|
+
/** Variant definitions for {@link PullToRefresh}; extend them to add variants. */
|
|
3
|
+
export declare const pullToRefreshStyles: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
6
|
+
root?: import("tailwind-variants").ClassValue;
|
|
7
|
+
indicator?: import("tailwind-variants").ClassValue;
|
|
8
|
+
layer?: import("tailwind-variants").ClassValue;
|
|
9
|
+
clip?: import("tailwind-variants").ClassValue;
|
|
10
|
+
face?: import("tailwind-variants").ClassValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
16
|
+
root?: import("tailwind-variants").ClassValue;
|
|
17
|
+
indicator?: import("tailwind-variants").ClassValue;
|
|
18
|
+
layer?: import("tailwind-variants").ClassValue;
|
|
19
|
+
clip?: import("tailwind-variants").ClassValue;
|
|
20
|
+
face?: import("tailwind-variants").ClassValue;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
} | {}, {
|
|
24
|
+
root: string;
|
|
25
|
+
layer: string;
|
|
26
|
+
clip: string;
|
|
27
|
+
indicator: string;
|
|
28
|
+
face: string;
|
|
29
|
+
}, undefined, {
|
|
30
|
+
[key: string]: {
|
|
31
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
32
|
+
root?: import("tailwind-variants").ClassValue;
|
|
33
|
+
indicator?: import("tailwind-variants").ClassValue;
|
|
34
|
+
layer?: import("tailwind-variants").ClassValue;
|
|
35
|
+
clip?: import("tailwind-variants").ClassValue;
|
|
36
|
+
face?: import("tailwind-variants").ClassValue;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
} | {}, {
|
|
40
|
+
root: string;
|
|
41
|
+
layer: string;
|
|
42
|
+
clip: string;
|
|
43
|
+
indicator: string;
|
|
44
|
+
face: string;
|
|
45
|
+
}, import("tailwind-variants").TVReturnTypeLike<unknown, {
|
|
46
|
+
root: string;
|
|
47
|
+
layer: string;
|
|
48
|
+
clip: string;
|
|
49
|
+
indicator: string;
|
|
50
|
+
face: string;
|
|
51
|
+
}>>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//# sourceMappingURL=pull-to-refresh-styles.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { tv } from "../../utils/tv.js";
|
|
2
|
+
//#region src/components/pull-to-refresh/pull-to-refresh-styles.ts
|
|
3
|
+
/** Variant definitions for {@link PullToRefresh}; extend them to add variants. */
|
|
4
|
+
const pullToRefreshStyles = tv({ slots: {
|
|
5
|
+
root: "overscroll-y-contain data-pulling:select-none",
|
|
6
|
+
layer: "pointer-events-none sticky top-0 z-(--md-sys-z-sticky) h-0",
|
|
7
|
+
clip: "flex h-[calc(var(--m3-pull-to-refresh-threshold)*2)] justify-center overflow-hidden",
|
|
8
|
+
indicator: "grid size-[48px] shrink-0 place-items-center overflow-hidden rounded-corner-full bg-primary-container",
|
|
9
|
+
face: "[grid-area:1/1] transition-opacity duration-m3-effects-default ease-m3-effects-default data-[active=false]:opacity-0"
|
|
10
|
+
} });
|
|
11
|
+
//#endregion
|
|
12
|
+
export { pullToRefreshStyles };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=pull-to-refresh-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pull-to-refresh-styles.js","names":[],"sources":["../../../src/components/pull-to-refresh/pull-to-refresh-styles.ts"],"sourcesContent":["import { tv } from '../../utils/tv';\n\n/*\n * Values follow Compose Material 3 (`PullToRefreshDefaults.LoadingIndicator` and\n * `IndicatorBox`): a 48px circle on `primary-container`, elevation level 0, holding a\n * contained loading indicator, clipped at the top of the pull area. The determinate and\n * indeterminate indicators crossfade on the default effects spring, as Compose's `Crossfade`\n * does. Every class is written out in full so Tailwind can find it.\n */\n\n/** Variant definitions for {@link PullToRefresh}; extend them to add variants. */\nexport const pullToRefreshStyles = tv({\n slots: {\n // No layout of its own: the consumer's classes make it the scroll container (or not).\n // `overscroll-y-contain` keeps a scrolling root from chaining into the page or starting\n // the browser's own pull to refresh.\n root: 'overscroll-y-contain data-pulling:select-none',\n // A zero-height sticky layer at the top of the area, so the indicator stays in view while\n // the content scrolls (\"Don't scroll the loading indicator off-screen\").\n layer: 'pointer-events-none sticky top-0 z-(--md-sys-z-sticky) h-0',\n // Clips the indicator at the top of the area (Compose's `clipRect(top = 0f)`), with room\n // for the longest pull: twice the threshold. In flow but overflowing the zero-height layer,\n // so it covers the content without moving it, and nothing inside is positioned.\n clip: 'flex h-[calc(var(--m3-pull-to-refresh-threshold)*2)] justify-center overflow-hidden',\n indicator:\n 'grid size-[48px] shrink-0 place-items-center overflow-hidden rounded-corner-full bg-primary-container',\n face: '[grid-area:1/1] transition-opacity duration-m3-effects-default ease-m3-effects-default data-[active=false]:opacity-0',\n },\n});\n"],"mappings":";;;AAWA,MAAa,sBAAsB,GAAG,EACpC,OAAO;CAIL,MAAM;CAGN,OAAO;CAIP,MAAM;CACN,WACE;CACF,MAAM;AACR,EACF,CAAC"}
|