@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,700 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { densityAttribute } from "../../tokens/density.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useM3Spring } from "../../motion/use-m3-spring.js";
|
|
5
|
+
import { useM3Interaction } from "../../primitives/use-m3-interaction.js";
|
|
6
|
+
import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
|
|
7
|
+
import { IconButton } from "../icon-button/IconButton.js";
|
|
8
|
+
import { splitRootProps } from "../../utils/root-props.js";
|
|
9
|
+
import { useMediaQuery } from "../date-picker/use-media-query.js";
|
|
10
|
+
import { KeyboardIcon, ScheduleIcon } from "../date-picker/picker-icons.js";
|
|
11
|
+
import { timePickerStyles } from "./time-picker-styles.js";
|
|
12
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { animate, useReducedMotion } from "motion/react";
|
|
15
|
+
import { mergeProps, mergeRefs, useFocusRing, useFocusVisible, useHover, useLocale, useNumberFormatter } from "react-aria";
|
|
16
|
+
import { useControlledState } from "react-stately/useControlledState";
|
|
17
|
+
import { Time } from "@internationalized/date";
|
|
18
|
+
//#region src/components/time-picker/TimePicker.tsx
|
|
19
|
+
/** Compose's clock geometry (TimePicker.kt), in px on the 256px dial. */
|
|
20
|
+
const DIAL = 256;
|
|
21
|
+
const CENTER = DIAL / 2;
|
|
22
|
+
const OUTER_RADIUS = 101;
|
|
23
|
+
const INNER_RADIUS = 69;
|
|
24
|
+
const HANDLE = 48;
|
|
25
|
+
/** A press nearer the centre than this picks the inner 24-hour ring (Compose's `MaxDistance`). */
|
|
26
|
+
const INNER_RING_MAX_DISTANCE = 74;
|
|
27
|
+
/** Each number on the dial is a 48px target (M3: "Targets for dial selectors should be 48x48dp"). */
|
|
28
|
+
const TARGET = 48;
|
|
29
|
+
const SHORT_WINDOW = "(max-height: 567.98px)";
|
|
30
|
+
const NO_ROOM_FOR_DIAL = "(max-height: 451.98px), (max-height: 567.98px) and (max-width: 639.98px)";
|
|
31
|
+
/** Where an `auto` time picker's dial fits: `vertical`, `horizontal` or `none`. */
|
|
32
|
+
function useTimePickerRoom() {
|
|
33
|
+
const short = useMediaQuery(SHORT_WINDOW);
|
|
34
|
+
return useMediaQuery(NO_ROOM_FOR_DIAL) ? "none" : short ? "horizontal" : "vertical";
|
|
35
|
+
}
|
|
36
|
+
function localeHourCycle(locale) {
|
|
37
|
+
const cycle = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;
|
|
38
|
+
return cycle === "h11" || cycle === "h12" ? 12 : 24;
|
|
39
|
+
}
|
|
40
|
+
const defaultDialValue = (value, total, unit) => `${value} ${unit} of ${total}`;
|
|
41
|
+
/**
|
|
42
|
+
* M3 time picker (Compose's `TimePicker` and `TimeInput`): hour and minute selectors you
|
|
43
|
+
* can type in, with an AM / PM selector, and a clock dial whose numbers are buttons (press,
|
|
44
|
+
* drag, or Tab to one and press Enter; the hour moves on to the minutes); or typed fields
|
|
45
|
+
* in input mode. It turns to a horizontal layout, or the input mode, when the window has
|
|
46
|
+
* no room for the dial. Put it in a {@link PickerDialog} for the modal form, with a
|
|
47
|
+
* {@link TimePickerModeToggle}.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <TimePicker value={time} onChange={setTime} />
|
|
51
|
+
*/
|
|
52
|
+
function TimePicker({ value, defaultValue, onChange, hourCycle: hourCycleProp, mode: modeProp, defaultMode = "dial", onModeChange, layout = "auto", labels = {}, density, id, ref, className, style, classNames, ...rest }) {
|
|
53
|
+
const { root: data } = splitRootProps(rest, { wrapper: true });
|
|
54
|
+
const { locale } = useLocale();
|
|
55
|
+
const hourCycle = hourCycleProp ?? localeHourCycle(locale);
|
|
56
|
+
const [time, setTime] = useControlledState(value, defaultValue ?? new Time(12, 0), onChange);
|
|
57
|
+
const [chosenMode] = useControlledState(modeProp, defaultMode, onModeChange);
|
|
58
|
+
const room = useTimePickerRoom();
|
|
59
|
+
const fits = layout === "auto" ? room : layout;
|
|
60
|
+
const mode = fits === "none" ? "input" : chosenMode;
|
|
61
|
+
const resolvedLayout = mode === "input" || fits === "none" ? "vertical" : fits;
|
|
62
|
+
const [selection, setSelection] = useState("hour");
|
|
63
|
+
const styles = timePickerStyles({
|
|
64
|
+
hourCycle,
|
|
65
|
+
mode,
|
|
66
|
+
layout: resolvedLayout
|
|
67
|
+
});
|
|
68
|
+
const pad = useNumberFormatter({
|
|
69
|
+
minimumIntegerDigits: 2,
|
|
70
|
+
useGrouping: false
|
|
71
|
+
});
|
|
72
|
+
const plain = useNumberFormatter({ useGrouping: false });
|
|
73
|
+
const isPm = time.hour >= 12;
|
|
74
|
+
const displayHour = hourCycle === 24 ? time.hour : time.hour % 12 || 12;
|
|
75
|
+
const formatHour = (n) => pad.format(n);
|
|
76
|
+
const setPeriod = (pm) => {
|
|
77
|
+
if (pm !== isPm) setTime(time.set({ hour: (time.hour + 12) % 24 }));
|
|
78
|
+
};
|
|
79
|
+
const commitHour = (hour) => setTime(time.set({ hour: hourCycle === 24 ? hour : hour % 12 + (isPm ? 12 : 0) }));
|
|
80
|
+
const hourLabel = labels.hour ?? "Hour";
|
|
81
|
+
const minuteLabel = labels.minute ?? "Minute";
|
|
82
|
+
const minuteRef = useRef(null);
|
|
83
|
+
const [domDirection, setDomDirection] = useState(void 0);
|
|
84
|
+
const directionRef = useCallback((element) => {
|
|
85
|
+
if (element) setDomDirection(getComputedStyle(element).direction === "rtl" ? "rtl" : "ltr");
|
|
86
|
+
}, []);
|
|
87
|
+
const rootRef = useMemo(() => mergeRefs(ref, directionRef), [ref, directionRef]);
|
|
88
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
89
|
+
...data,
|
|
90
|
+
id,
|
|
91
|
+
ref: rootRef,
|
|
92
|
+
style,
|
|
93
|
+
"data-tokens": mergeDataTokens("md-comp-time-picker", data),
|
|
94
|
+
"data-mode": mode,
|
|
95
|
+
"data-layout": resolvedLayout,
|
|
96
|
+
...densityAttribute(density),
|
|
97
|
+
className: styles.root({ class: cn(classNames?.root, className) }),
|
|
98
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
99
|
+
dir: "ltr",
|
|
100
|
+
className: styles.display(),
|
|
101
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: styles.time(),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(NumberField, {
|
|
105
|
+
label: hourLabel,
|
|
106
|
+
value: displayHour,
|
|
107
|
+
min: hourCycle === 24 ? 0 : 1,
|
|
108
|
+
max: hourCycle === 24 ? 23 : 12,
|
|
109
|
+
format: formatHour,
|
|
110
|
+
onCommit: commitHour,
|
|
111
|
+
onComplete: mode === "input" ? () => minuteRef.current?.focus() : void 0,
|
|
112
|
+
selector: mode === "dial",
|
|
113
|
+
selected: selection === "hour",
|
|
114
|
+
onFocus: () => setSelection("hour"),
|
|
115
|
+
styles,
|
|
116
|
+
classNames
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ jsx("span", {
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
className: styles.separator({ class: classNames?.separator }),
|
|
121
|
+
children: ":"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx(NumberField, {
|
|
124
|
+
label: minuteLabel,
|
|
125
|
+
value: time.minute,
|
|
126
|
+
min: 0,
|
|
127
|
+
max: 59,
|
|
128
|
+
format: (n) => pad.format(n),
|
|
129
|
+
onCommit: (minute) => setTime(time.set({ minute })),
|
|
130
|
+
inputRef: minuteRef,
|
|
131
|
+
selector: mode === "dial",
|
|
132
|
+
selected: selection === "minute",
|
|
133
|
+
onFocus: () => setSelection("minute"),
|
|
134
|
+
styles,
|
|
135
|
+
classNames
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
}), hourCycle === 12 && /* @__PURE__ */ jsx(PeriodGroup, {
|
|
139
|
+
label: labels.period ?? "AM or PM",
|
|
140
|
+
am: labels.am ?? "AM",
|
|
141
|
+
pm: labels.pm ?? "PM",
|
|
142
|
+
isPm,
|
|
143
|
+
onChange: setPeriod,
|
|
144
|
+
direction: domDirection,
|
|
145
|
+
styles,
|
|
146
|
+
classNames
|
|
147
|
+
})]
|
|
148
|
+
}), mode === "dial" && /* @__PURE__ */ jsx(Dial, {
|
|
149
|
+
time,
|
|
150
|
+
setTime,
|
|
151
|
+
selection,
|
|
152
|
+
onHourPicked: () => setSelection("minute"),
|
|
153
|
+
hourCycle,
|
|
154
|
+
label: labels.dial ?? "Clock",
|
|
155
|
+
valueLabel: labels.dialValue ?? defaultDialValue,
|
|
156
|
+
format: (n, minutes) => minutes || hourCycle === 24 ? pad.format(n) : plain.format(n),
|
|
157
|
+
plain: (n) => plain.format(n),
|
|
158
|
+
styles,
|
|
159
|
+
className: classNames?.dial
|
|
160
|
+
})]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The time picker's keyboard / clock icon button (M3: "The input selector should be
|
|
165
|
+
* accessible from the dial selector via the keyboard icon"), for `PickerDialog`'s
|
|
166
|
+
* `modeToggleButton`. Hidden when the window has no room for the dial, where an `auto`
|
|
167
|
+
* time picker shows only the input.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* <PickerDialog variant="time" modeToggleButton={<TimePickerModeToggle mode={mode} onModeChange={setMode} />} …>
|
|
171
|
+
* <TimePicker mode={mode} onModeChange={setMode} />
|
|
172
|
+
* </PickerDialog>
|
|
173
|
+
*/
|
|
174
|
+
function TimePickerModeToggle({ mode, onModeChange, labels = {}, keyboardIcon, clockIcon, className, style, id, ref, ...dom }) {
|
|
175
|
+
if (useTimePickerRoom() === "none") return null;
|
|
176
|
+
const own = {
|
|
177
|
+
...dom,
|
|
178
|
+
className,
|
|
179
|
+
style,
|
|
180
|
+
id,
|
|
181
|
+
ref
|
|
182
|
+
};
|
|
183
|
+
return mode === "dial" ? /* @__PURE__ */ jsx(IconButton, {
|
|
184
|
+
variant: "standard",
|
|
185
|
+
density: 0,
|
|
186
|
+
icon: keyboardIcon ?? /* @__PURE__ */ jsx(KeyboardIcon, {}),
|
|
187
|
+
"aria-label": labels.inputMode ?? "Toggle input picker",
|
|
188
|
+
onPress: () => onModeChange("input"),
|
|
189
|
+
...own
|
|
190
|
+
}) : /* @__PURE__ */ jsx(IconButton, {
|
|
191
|
+
variant: "standard",
|
|
192
|
+
density: 0,
|
|
193
|
+
icon: clockIcon ?? /* @__PURE__ */ jsx(ScheduleIcon, {}),
|
|
194
|
+
"aria-label": labels.dialMode ?? "Toggle dial picker",
|
|
195
|
+
onPress: () => onModeChange("dial"),
|
|
196
|
+
...own
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The AM / PM selector: a radio group (M3: "Radio button (in list)"), so it is one Tab stop
|
|
201
|
+
* on the checked option and the arrow keys move the choice, as WAI-ARIA's radio group.
|
|
202
|
+
*/
|
|
203
|
+
function PeriodGroup({ label, am, pm, isPm, onChange, direction: domDirection, styles, classNames }) {
|
|
204
|
+
const { direction: localeDirection } = useLocale();
|
|
205
|
+
const direction = domDirection ?? localeDirection;
|
|
206
|
+
const refs = useRef([]);
|
|
207
|
+
const onKeyDown = (event) => {
|
|
208
|
+
const forward = direction === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
209
|
+
const backward = direction === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
210
|
+
if ((event.key === "ArrowDown" || event.key === forward ? 1 : event.key === "ArrowUp" || event.key === backward ? -1 : 0) === 0) return;
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
const next = !isPm;
|
|
213
|
+
onChange(next);
|
|
214
|
+
refs.current[next ? 1 : 0]?.focus();
|
|
215
|
+
};
|
|
216
|
+
return /* @__PURE__ */ jsx("div", {
|
|
217
|
+
role: "radiogroup",
|
|
218
|
+
"aria-label": label,
|
|
219
|
+
dir: direction,
|
|
220
|
+
onKeyDown,
|
|
221
|
+
"data-slot": "period-selector",
|
|
222
|
+
className: styles.period({ class: classNames?.period }),
|
|
223
|
+
children: [false, true].map((option) => /* @__PURE__ */ jsx(PeriodOption, {
|
|
224
|
+
ref: (element) => {
|
|
225
|
+
refs.current[option ? 1 : 0] = element;
|
|
226
|
+
},
|
|
227
|
+
label: option ? pm : am,
|
|
228
|
+
selected: isPm === option,
|
|
229
|
+
onSelect: () => onChange(option),
|
|
230
|
+
className: styles.periodOption({ class: classNames?.periodOption })
|
|
231
|
+
}, String(option)))
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function PeriodOption({ label, selected, onSelect, className, ref: refProp }) {
|
|
235
|
+
const ref = useRef(null);
|
|
236
|
+
const { interactionProps, dataAttributes } = useM3Interaction({}, ref);
|
|
237
|
+
return /* @__PURE__ */ jsx("button", {
|
|
238
|
+
...mergeProps(interactionProps, { onClick: onSelect }),
|
|
239
|
+
...dataAttributes,
|
|
240
|
+
ref: (element) => {
|
|
241
|
+
ref.current = element;
|
|
242
|
+
refProp(element);
|
|
243
|
+
},
|
|
244
|
+
type: "button",
|
|
245
|
+
role: "radio",
|
|
246
|
+
"aria-checked": selected,
|
|
247
|
+
tabIndex: selected ? 0 : -1,
|
|
248
|
+
"data-slot": "period-selector-option",
|
|
249
|
+
"data-selected": selected || void 0,
|
|
250
|
+
className,
|
|
251
|
+
children: label
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* A typed hour or minute: the input mode's 96 × 72px field with its label below, or in
|
|
256
|
+
* dial mode the 96 × 80px selector, which picks the dial's face when focused and takes
|
|
257
|
+
* digits too (M3: "The dial time picker supports both manual and dial input").
|
|
258
|
+
*/
|
|
259
|
+
function NumberField({ label, value, min, max, format, onCommit, onComplete, inputRef, selector, selected, onFocus, styles, classNames }) {
|
|
260
|
+
const [draft, setDraft] = useState(null);
|
|
261
|
+
const { focusProps, isFocusVisible } = useFocusRing();
|
|
262
|
+
const { hoverProps, isHovered } = useHover({ isDisabled: !selector });
|
|
263
|
+
const [pressed, setPressed] = useState(false);
|
|
264
|
+
const release = () => setPressed(false);
|
|
265
|
+
const parsed = draft === null ? value : Number(draft);
|
|
266
|
+
const invalid = draft !== null && (draft === "" || Number.isNaN(parsed) || parsed < min || parsed > max);
|
|
267
|
+
const input = /* @__PURE__ */ jsx("input", {
|
|
268
|
+
...mergeProps(focusProps, hoverProps, { onFocus: (event) => {
|
|
269
|
+
event.currentTarget.select();
|
|
270
|
+
onFocus();
|
|
271
|
+
} }),
|
|
272
|
+
ref: inputRef,
|
|
273
|
+
onPointerDown: () => selector && setPressed(true),
|
|
274
|
+
onPointerUp: release,
|
|
275
|
+
onPointerLeave: release,
|
|
276
|
+
onPointerCancel: release,
|
|
277
|
+
inputMode: "numeric",
|
|
278
|
+
"aria-label": label,
|
|
279
|
+
"aria-invalid": invalid || void 0,
|
|
280
|
+
maxLength: 2,
|
|
281
|
+
value: draft ?? format(value),
|
|
282
|
+
"data-slot": selector ? "time-selector" : void 0,
|
|
283
|
+
"data-selected": selector && selected || void 0,
|
|
284
|
+
"data-focus-visible": selector && isFocusVisible || void 0,
|
|
285
|
+
"data-hovered": selector && isHovered || void 0,
|
|
286
|
+
"data-pressed": selector && pressed || void 0,
|
|
287
|
+
onChange: (event) => {
|
|
288
|
+
const text = event.target.value.replace(/\D/g, "");
|
|
289
|
+
setDraft(text);
|
|
290
|
+
const next = Number(text);
|
|
291
|
+
if (text === "" || next < min || next > max) return;
|
|
292
|
+
onCommit(next);
|
|
293
|
+
if (text.length === 2 || next * 10 > max) onComplete?.();
|
|
294
|
+
},
|
|
295
|
+
onBlur: () => setDraft(null),
|
|
296
|
+
onKeyDown: (event) => {
|
|
297
|
+
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return;
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
const step = event.key === "ArrowUp" ? 1 : -1;
|
|
300
|
+
const next = value + step > max ? min : value + step < min ? max : value + step;
|
|
301
|
+
setDraft(null);
|
|
302
|
+
onCommit(next);
|
|
303
|
+
},
|
|
304
|
+
className: selector ? styles.selector({ class: classNames?.field }) : styles.field({ class: classNames?.field })
|
|
305
|
+
});
|
|
306
|
+
if (selector) return input;
|
|
307
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
308
|
+
className: styles.fieldColumn(),
|
|
309
|
+
children: [input, /* @__PURE__ */ jsx("span", {
|
|
310
|
+
"aria-hidden": "true",
|
|
311
|
+
className: styles.fieldLabel({ class: classNames?.fieldLabel }),
|
|
312
|
+
children: label
|
|
313
|
+
})]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/** Angle of a dial position (0 at 12 o'clock, clockwise), in turns. */
|
|
317
|
+
const turnOf = (x, y) => (Math.atan2(x - CENTER, CENTER - y) / (2 * Math.PI) + 1) % 1;
|
|
318
|
+
const pointOf = (turn, radius) => ({
|
|
319
|
+
x: CENTER + radius * Math.sin(turn * 2 * Math.PI),
|
|
320
|
+
y: CENTER - radius * Math.cos(turn * 2 * Math.PI)
|
|
321
|
+
});
|
|
322
|
+
/** The numbers on the face: minutes in fives, hours 12 / 1–11, plus 12–23 inside for 24 hours. */
|
|
323
|
+
function dialNumbers(minutes, hourCycle) {
|
|
324
|
+
const ring = (radius, valueAt) => Array.from({ length: 12 }, (_, i) => ({
|
|
325
|
+
value: valueAt(i),
|
|
326
|
+
turn: i / 12,
|
|
327
|
+
radius
|
|
328
|
+
}));
|
|
329
|
+
if (minutes) return ring(OUTER_RADIUS, (i) => i * 5);
|
|
330
|
+
if (hourCycle === 12) return ring(OUTER_RADIUS, (i) => i || 12);
|
|
331
|
+
return [...ring(OUTER_RADIUS, (i) => i), ...ring(INNER_RADIUS, (i) => i + 12)];
|
|
332
|
+
}
|
|
333
|
+
/** The shortest signed way round the dial from one turn to another, in turns (−½ to ½). */
|
|
334
|
+
const shortestTurn = (from, to) => ((to - from) % 1 + 1.5) % 1 - .5;
|
|
335
|
+
/**
|
|
336
|
+
* How close the hand is to its value when it counts as there: Compose's turn ends at the
|
|
337
|
+
* spring's visibility threshold of 0.01 rad (about 0.6°), and here within 1px of the radius
|
|
338
|
+
* too, while the last fraction of the spring still plays out.
|
|
339
|
+
*/
|
|
340
|
+
const ARRIVED_TURN = .01 / (2 * Math.PI);
|
|
341
|
+
const ARRIVED_RADIUS = 1;
|
|
342
|
+
/** Runs and clears the callbacks waiting in `queue`. */
|
|
343
|
+
const flush = (queue) => {
|
|
344
|
+
const callbacks = queue.current;
|
|
345
|
+
queue.current = [];
|
|
346
|
+
for (const callback of callbacks) callback();
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* The hand's track, handle and the clip of the `on-primary` numbers follow the drawn angle,
|
|
350
|
+
* set as attributes from an animation (no React render per frame). It turns to a new value
|
|
351
|
+
* on the default spatial spring along the shortest arc (M3: "Spatial springs apply to …
|
|
352
|
+
* rotation"; Compose animates the selector on hour ↔ minute and taps), follows a drag
|
|
353
|
+
* directly, and jumps under reduced motion. Returns `whenSettled`, which runs a callback
|
|
354
|
+
* once the hand rests on its value.
|
|
355
|
+
*/
|
|
356
|
+
function useDialHand(turn, radius, follow, parts) {
|
|
357
|
+
const spring = useM3Spring("spatial", "default");
|
|
358
|
+
const reducedMotion = useReducedMotion() ?? false;
|
|
359
|
+
const drawn = useRef({
|
|
360
|
+
turn,
|
|
361
|
+
radius
|
|
362
|
+
});
|
|
363
|
+
const animation = useRef(null);
|
|
364
|
+
const settled = useRef([]);
|
|
365
|
+
const arrived = useRef(true);
|
|
366
|
+
useLayoutEffect(() => {
|
|
367
|
+
const draw = (nextTurn, nextRadius) => {
|
|
368
|
+
drawn.current = {
|
|
369
|
+
turn: nextTurn,
|
|
370
|
+
radius: nextRadius
|
|
371
|
+
};
|
|
372
|
+
const point = pointOf(nextTurn, nextRadius);
|
|
373
|
+
const { track, handle, clip } = parts.current;
|
|
374
|
+
track?.setAttribute("x2", String(point.x));
|
|
375
|
+
track?.setAttribute("y2", String(point.y));
|
|
376
|
+
for (const circle of [handle, clip]) {
|
|
377
|
+
circle?.setAttribute("cx", String(point.x));
|
|
378
|
+
circle?.setAttribute("cy", String(point.y));
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
const from = drawn.current;
|
|
382
|
+
const delta = shortestTurn(from.turn, turn);
|
|
383
|
+
animation.current?.stop();
|
|
384
|
+
animation.current = null;
|
|
385
|
+
if (follow.current || reducedMotion || delta === 0 && from.radius === radius) {
|
|
386
|
+
draw(turn, radius);
|
|
387
|
+
arrived.current = true;
|
|
388
|
+
flush(settled);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
draw(from.turn, from.radius);
|
|
392
|
+
arrived.current = false;
|
|
393
|
+
let near = false;
|
|
394
|
+
animation.current = animate(0, 1, {
|
|
395
|
+
...spring,
|
|
396
|
+
onUpdate: (progress) => {
|
|
397
|
+
draw(from.turn + delta * progress, from.radius + (radius - from.radius) * progress);
|
|
398
|
+
const close = Math.abs(delta * (1 - progress)) <= ARRIVED_TURN && Math.abs((radius - from.radius) * (1 - progress)) <= ARRIVED_RADIUS;
|
|
399
|
+
if (close && near && !arrived.current) {
|
|
400
|
+
arrived.current = true;
|
|
401
|
+
flush(settled);
|
|
402
|
+
}
|
|
403
|
+
near = close;
|
|
404
|
+
},
|
|
405
|
+
onComplete: () => {
|
|
406
|
+
draw(turn, radius);
|
|
407
|
+
animation.current = null;
|
|
408
|
+
arrived.current = true;
|
|
409
|
+
flush(settled);
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}, [
|
|
413
|
+
turn,
|
|
414
|
+
radius,
|
|
415
|
+
follow,
|
|
416
|
+
parts,
|
|
417
|
+
reducedMotion,
|
|
418
|
+
spring
|
|
419
|
+
]);
|
|
420
|
+
useEffect(() => () => {
|
|
421
|
+
animation.current?.stop();
|
|
422
|
+
settled.current = [];
|
|
423
|
+
}, []);
|
|
424
|
+
/** Runs `callback` once the hand has arrived at its value (at once if it already has). */
|
|
425
|
+
return (callback) => {
|
|
426
|
+
if (animation.current && !arrived.current) settled.current.push(callback);
|
|
427
|
+
else callback();
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Which faces to draw: the current one, and the one it replaced while that fades out
|
|
432
|
+
* (Compose crossfades the hour and minute faces).
|
|
433
|
+
*/
|
|
434
|
+
function useFaces(minutes) {
|
|
435
|
+
const [faces, setFaces] = useState({
|
|
436
|
+
current: minutes,
|
|
437
|
+
leaving: null
|
|
438
|
+
});
|
|
439
|
+
if (faces.current !== minutes) setFaces({
|
|
440
|
+
current: minutes,
|
|
441
|
+
leaving: faces.current
|
|
442
|
+
});
|
|
443
|
+
const clearLeaving = () => setFaces((previous) => ({
|
|
444
|
+
...previous,
|
|
445
|
+
leaving: null
|
|
446
|
+
}));
|
|
447
|
+
return {
|
|
448
|
+
leaving: faces.leaving,
|
|
449
|
+
clearLeaving
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
function Dial({ time, setTime, selection, onHourPicked, hourCycle, label, valueLabel, format, plain, styles, className }) {
|
|
453
|
+
const svgRef = useRef(null);
|
|
454
|
+
const numberRefs = useRef([]);
|
|
455
|
+
const hand = useRef({
|
|
456
|
+
track: null,
|
|
457
|
+
handle: null,
|
|
458
|
+
clip: null
|
|
459
|
+
});
|
|
460
|
+
const pressing = useRef(false);
|
|
461
|
+
const dragging = useRef(false);
|
|
462
|
+
const pendingFocus = useRef(null);
|
|
463
|
+
const [focused, setFocused] = useState(null);
|
|
464
|
+
const { isFocusVisible } = useFocusVisible();
|
|
465
|
+
const clipId = useId();
|
|
466
|
+
const minutes = selection === "minute";
|
|
467
|
+
const { leaving, clearLeaving } = useFaces(minutes);
|
|
468
|
+
const isPm = time.hour >= 12;
|
|
469
|
+
const numbers = dialNumbers(minutes, hourCycle);
|
|
470
|
+
const selectedTurn = minutes ? time.minute / 60 : time.hour % 12 / 12;
|
|
471
|
+
const selectedRadius = !minutes && hourCycle === 24 && time.hour >= 12 ? INNER_RADIUS : OUTER_RADIUS;
|
|
472
|
+
const handle = pointOf(selectedTurn, selectedRadius);
|
|
473
|
+
const whenSettled = useDialHand(selectedTurn, selectedRadius, dragging, hand);
|
|
474
|
+
const switchTimer = useRef(void 0);
|
|
475
|
+
const cancelSwitch = () => {
|
|
476
|
+
window.clearTimeout(switchTimer.current);
|
|
477
|
+
switchTimer.current = void 0;
|
|
478
|
+
};
|
|
479
|
+
useEffect(() => cancelSwitch, [minutes]);
|
|
480
|
+
const selectedValue = minutes ? time.minute : hourCycle === 24 ? time.hour : time.hour % 12 || 12;
|
|
481
|
+
const tabStop = numbers.findIndex(({ value }) => minutes ? value === Math.round(time.minute / 5) * 5 % 60 : value === selectedValue);
|
|
482
|
+
useEffect(() => {
|
|
483
|
+
if (pendingFocus.current === null) return;
|
|
484
|
+
numberRefs.current[pendingFocus.current]?.focus();
|
|
485
|
+
pendingFocus.current = null;
|
|
486
|
+
});
|
|
487
|
+
useEffect(() => {
|
|
488
|
+
if (leaving === null) return;
|
|
489
|
+
const timeout = window.setTimeout(clearLeaving, 1e3);
|
|
490
|
+
return () => window.clearTimeout(timeout);
|
|
491
|
+
}, [leaving, clearLeaving]);
|
|
492
|
+
const toTime = (value) => minutes ? time.set({ minute: value }) : time.set({ hour: hourCycle === 24 ? value : value % 12 + (isPm ? 12 : 0) });
|
|
493
|
+
const switchToMinutes = () => {
|
|
494
|
+
if (svgRef.current?.contains(document.activeElement)) pendingFocus.current = Math.round(time.minute / 5) % 12;
|
|
495
|
+
onHourPicked();
|
|
496
|
+
};
|
|
497
|
+
const activate = (value) => {
|
|
498
|
+
setTime(toTime(value));
|
|
499
|
+
if (!minutes) {
|
|
500
|
+
pendingFocus.current = Math.round(time.minute / 5) % 12;
|
|
501
|
+
onHourPicked();
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const pick = (event) => {
|
|
505
|
+
const box = svgRef.current.getBoundingClientRect();
|
|
506
|
+
const x = (event.clientX - box.left) / box.width * DIAL;
|
|
507
|
+
const y = (event.clientY - box.top) / box.height * DIAL;
|
|
508
|
+
const step = Math.round(turnOf(x, y) * 12) % 12;
|
|
509
|
+
if (minutes) {
|
|
510
|
+
setTime(time.set({ minute: step * 5 }));
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const innerRing = hourCycle === 24 && Math.hypot(x - CENTER, y - CENTER) < INNER_RING_MAX_DISTANCE;
|
|
514
|
+
const hour = hourCycle === 24 ? step + (innerRing ? 12 : 0) : step + (isPm ? 12 : 0);
|
|
515
|
+
setTime(time.set({ hour }));
|
|
516
|
+
};
|
|
517
|
+
const onNumberKeyDown = (event, index) => {
|
|
518
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
519
|
+
event.preventDefault();
|
|
520
|
+
activate(numbers[index].value);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
const step = {
|
|
524
|
+
ArrowUp: 1,
|
|
525
|
+
ArrowRight: 1,
|
|
526
|
+
ArrowDown: -1,
|
|
527
|
+
ArrowLeft: -1
|
|
528
|
+
}[event.key];
|
|
529
|
+
if (step === void 0) return;
|
|
530
|
+
event.preventDefault();
|
|
531
|
+
const next = (index + step + numbers.length) % numbers.length;
|
|
532
|
+
setFocused(next);
|
|
533
|
+
numberRefs.current[next]?.focus();
|
|
534
|
+
};
|
|
535
|
+
const total = minutes ? 60 : hourCycle;
|
|
536
|
+
const unit = minutes ? "minutes" : "hours";
|
|
537
|
+
const endPress = () => {
|
|
538
|
+
pressing.current = false;
|
|
539
|
+
dragging.current = false;
|
|
540
|
+
};
|
|
541
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
542
|
+
ref: svgRef,
|
|
543
|
+
viewBox: `0 0 ${DIAL} ${DIAL}`,
|
|
544
|
+
role: "group",
|
|
545
|
+
"aria-label": label,
|
|
546
|
+
onPointerDown: (event) => {
|
|
547
|
+
cancelSwitch();
|
|
548
|
+
pressing.current = true;
|
|
549
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
550
|
+
pick(event);
|
|
551
|
+
},
|
|
552
|
+
onPointerMove: (event) => {
|
|
553
|
+
if (!pressing.current) return;
|
|
554
|
+
dragging.current = true;
|
|
555
|
+
pick(event);
|
|
556
|
+
},
|
|
557
|
+
onPointerUp: () => {
|
|
558
|
+
if (pressing.current && !minutes) {
|
|
559
|
+
if (dragging.current) switchToMinutes();
|
|
560
|
+
else whenSettled(() => {
|
|
561
|
+
switchTimer.current = window.setTimeout(switchToMinutes, 100);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
endPress();
|
|
565
|
+
},
|
|
566
|
+
onPointerCancel: endPress,
|
|
567
|
+
className: cn(styles.dial(), className),
|
|
568
|
+
children: [
|
|
569
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", {
|
|
570
|
+
id: clipId,
|
|
571
|
+
children: /* @__PURE__ */ jsx("circle", {
|
|
572
|
+
ref: (element) => {
|
|
573
|
+
hand.current.clip = element;
|
|
574
|
+
},
|
|
575
|
+
cx: handle.x,
|
|
576
|
+
cy: handle.y,
|
|
577
|
+
r: HANDLE / 2
|
|
578
|
+
})
|
|
579
|
+
}) }),
|
|
580
|
+
/* @__PURE__ */ jsx("circle", {
|
|
581
|
+
cx: CENTER,
|
|
582
|
+
cy: CENTER,
|
|
583
|
+
r: CENTER,
|
|
584
|
+
"data-slot": "clock-dial",
|
|
585
|
+
className: styles.dialFace()
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ jsx("line", {
|
|
588
|
+
ref: (element) => {
|
|
589
|
+
hand.current.track = element;
|
|
590
|
+
},
|
|
591
|
+
x1: CENTER,
|
|
592
|
+
y1: CENTER,
|
|
593
|
+
x2: handle.x,
|
|
594
|
+
y2: handle.y,
|
|
595
|
+
strokeWidth: 2,
|
|
596
|
+
className: styles.dialTrack()
|
|
597
|
+
}),
|
|
598
|
+
/* @__PURE__ */ jsx("circle", {
|
|
599
|
+
cx: CENTER,
|
|
600
|
+
cy: CENTER,
|
|
601
|
+
r: 4,
|
|
602
|
+
className: styles.dialHandle()
|
|
603
|
+
}),
|
|
604
|
+
/* @__PURE__ */ jsx("circle", {
|
|
605
|
+
ref: (element) => {
|
|
606
|
+
hand.current.handle = element;
|
|
607
|
+
},
|
|
608
|
+
cx: handle.x,
|
|
609
|
+
cy: handle.y,
|
|
610
|
+
r: HANDLE / 2,
|
|
611
|
+
"data-slot": "clock-dial-selector-handle",
|
|
612
|
+
className: styles.dialHandle()
|
|
613
|
+
}),
|
|
614
|
+
leaving !== null && /* @__PURE__ */ jsx("g", {
|
|
615
|
+
"aria-hidden": "true",
|
|
616
|
+
onTransitionEnd: clearLeaving,
|
|
617
|
+
className: styles.dialFaceLeaving(),
|
|
618
|
+
children: dialNumbers(leaving, hourCycle).map(({ value, turn, radius }, index) => {
|
|
619
|
+
const point = pointOf(turn, radius);
|
|
620
|
+
return /* @__PURE__ */ jsx("text", {
|
|
621
|
+
x: point.x,
|
|
622
|
+
y: point.y,
|
|
623
|
+
textAnchor: "middle",
|
|
624
|
+
dominantBaseline: "central",
|
|
625
|
+
className: styles.dialNumberText(),
|
|
626
|
+
children: format(value, leaving)
|
|
627
|
+
}, index);
|
|
628
|
+
})
|
|
629
|
+
}, `leaving-${String(leaving)}`),
|
|
630
|
+
/* @__PURE__ */ jsxs("g", {
|
|
631
|
+
className: leaving === null ? void 0 : styles.dialFaceEntering(),
|
|
632
|
+
children: [numbers.map(({ value, turn, radius }, index) => {
|
|
633
|
+
const point = pointOf(turn, radius);
|
|
634
|
+
const selected = value === selectedValue && (minutes ? time.minute % 5 === 0 : true);
|
|
635
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
636
|
+
ref: (element) => {
|
|
637
|
+
numberRefs.current[index] = element;
|
|
638
|
+
},
|
|
639
|
+
role: "button",
|
|
640
|
+
tabIndex: index === (focused ?? tabStop) ? 0 : -1,
|
|
641
|
+
"aria-label": valueLabel(plain(value), total, unit),
|
|
642
|
+
"aria-pressed": selected,
|
|
643
|
+
"data-selected": selected || void 0,
|
|
644
|
+
onFocus: () => setFocused(index),
|
|
645
|
+
onBlur: () => setFocused(null),
|
|
646
|
+
onKeyDown: (event) => onNumberKeyDown(event, index),
|
|
647
|
+
onClick: (event) => {
|
|
648
|
+
if (event.detail === 0) activate(value);
|
|
649
|
+
},
|
|
650
|
+
className: styles.dialNumber(),
|
|
651
|
+
children: [
|
|
652
|
+
/* @__PURE__ */ jsx("circle", {
|
|
653
|
+
cx: point.x,
|
|
654
|
+
cy: point.y,
|
|
655
|
+
r: TARGET / 2,
|
|
656
|
+
className: styles.dialNumberHit()
|
|
657
|
+
}),
|
|
658
|
+
focused === index && isFocusVisible && /* @__PURE__ */ jsx("circle", {
|
|
659
|
+
cx: point.x,
|
|
660
|
+
cy: point.y,
|
|
661
|
+
r: TARGET / 2 - 1,
|
|
662
|
+
strokeWidth: 3,
|
|
663
|
+
className: styles.dialFocus()
|
|
664
|
+
}),
|
|
665
|
+
/* @__PURE__ */ jsx("text", {
|
|
666
|
+
x: point.x,
|
|
667
|
+
y: point.y,
|
|
668
|
+
textAnchor: "middle",
|
|
669
|
+
dominantBaseline: "central",
|
|
670
|
+
"aria-hidden": "true",
|
|
671
|
+
"data-selected": selected || void 0,
|
|
672
|
+
className: styles.dialNumberText(),
|
|
673
|
+
children: format(value, minutes)
|
|
674
|
+
})
|
|
675
|
+
]
|
|
676
|
+
}, index);
|
|
677
|
+
}), /* @__PURE__ */ jsx("g", {
|
|
678
|
+
"aria-hidden": "true",
|
|
679
|
+
clipPath: `url(#${clipId})`,
|
|
680
|
+
className: "pointer-events-none",
|
|
681
|
+
children: numbers.map(({ value, turn, radius }, index) => {
|
|
682
|
+
const point = pointOf(turn, radius);
|
|
683
|
+
return /* @__PURE__ */ jsx("text", {
|
|
684
|
+
x: point.x,
|
|
685
|
+
y: point.y,
|
|
686
|
+
textAnchor: "middle",
|
|
687
|
+
dominantBaseline: "central",
|
|
688
|
+
className: styles.dialNumberOnHandle(),
|
|
689
|
+
children: format(value, minutes)
|
|
690
|
+
}, index);
|
|
691
|
+
})
|
|
692
|
+
})]
|
|
693
|
+
}, `face-${String(minutes)}`)
|
|
694
|
+
]
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
//#endregion
|
|
698
|
+
export { TimePicker, TimePickerModeToggle, useTimePickerRoom };
|
|
699
|
+
|
|
700
|
+
//# sourceMappingURL=TimePicker.js.map
|