@windmorph/react 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +149 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/app-bar/AppBarItems.js +23 -0
- package/dist/components/app-bar/AppBarItems.js.map +1 -0
- package/dist/components/app-bar/TopAppBar.d.ts +89 -0
- package/dist/components/app-bar/TopAppBar.js +103 -0
- package/dist/components/app-bar/TopAppBar.js.map +1 -0
- package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
- package/dist/components/app-bar/app-bar-styles.js +142 -0
- package/dist/components/app-bar/app-bar-styles.js.map +1 -0
- package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
- package/dist/components/app-bar/app-bar-tokens.js +64 -0
- package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
- package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
- package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
- package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
- package/dist/components/autocomplete/Autocomplete.js +284 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +71 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/badge-styles.d.ts +100 -0
- package/dist/components/badge/badge-styles.js +43 -0
- package/dist/components/badge/badge-styles.js.map +1 -0
- package/dist/components/badge/badge-tokens.d.ts +7 -0
- package/dist/components/badge/badge-tokens.js +40 -0
- package/dist/components/badge/badge-tokens.js.map +1 -0
- package/dist/components/button/Button.d.ts +91 -0
- package/dist/components/button/Button.js +96 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/ButtonContext.d.ts +30 -0
- package/dist/components/button/ButtonContext.js +18 -0
- package/dist/components/button/ButtonContext.js.map +1 -0
- package/dist/components/button/DensityZeroButtons.js +25 -0
- package/dist/components/button/DensityZeroButtons.js.map +1 -0
- package/dist/components/button/button-pending.d.ts +10 -0
- package/dist/components/button/button-pending.js +166 -0
- package/dist/components/button/button-pending.js.map +1 -0
- package/dist/components/button/button-styles.d.ts +216 -0
- package/dist/components/button/button-styles.js +199 -0
- package/dist/components/button/button-styles.js.map +1 -0
- package/dist/components/button/button-tokens.d.ts +10 -0
- package/dist/components/button/button-tokens.js +257 -0
- package/dist/components/button/button-tokens.js.map +1 -0
- package/dist/components/button/connected-shapes.js +152 -0
- package/dist/components/button/connected-shapes.js.map +1 -0
- package/dist/components/card/Card.d.ts +60 -0
- package/dist/components/card/Card.js +69 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/card/card-styles.d.ts +42 -0
- package/dist/components/card/card-styles.js +64 -0
- package/dist/components/card/card-styles.js.map +1 -0
- package/dist/components/card/card-tokens.d.ts +7 -0
- package/dist/components/card/card-tokens.js +84 -0
- package/dist/components/card/card-tokens.js.map +1 -0
- package/dist/components/carousel/Carousel.d.ts +124 -0
- package/dist/components/carousel/Carousel.js +387 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/carousel-keylines.js +486 -0
- package/dist/components/carousel/carousel-keylines.js.map +1 -0
- package/dist/components/carousel/carousel-press-area.js +35 -0
- package/dist/components/carousel/carousel-press-area.js.map +1 -0
- package/dist/components/carousel/carousel-styles.d.ts +188 -0
- package/dist/components/carousel/carousel-styles.js +116 -0
- package/dist/components/carousel/carousel-styles.js.map +1 -0
- package/dist/components/carousel/carousel-tokens.d.ts +7 -0
- package/dist/components/carousel/carousel-tokens.js +18 -0
- package/dist/components/carousel/carousel-tokens.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +78 -0
- package/dist/components/checkbox/Checkbox.js +77 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox-box.js +34 -0
- package/dist/components/checkbox/checkbox-box.js.map +1 -0
- package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
- package/dist/components/checkbox/checkbox-styles.js +54 -0
- package/dist/components/checkbox/checkbox-styles.js.map +1 -0
- package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
- package/dist/components/checkbox/checkbox-tokens.js +41 -0
- package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
- package/dist/components/chip/Chip.d.ts +171 -0
- package/dist/components/chip/Chip.js +348 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipSet.d.ts +70 -0
- package/dist/components/chip/ChipSet.js +198 -0
- package/dist/components/chip/ChipSet.js.map +1 -0
- package/dist/components/chip/chip-styles.d.ts +263 -0
- package/dist/components/chip/chip-styles.js +360 -0
- package/dist/components/chip/chip-styles.js.map +1 -0
- package/dist/components/chip/chip-tokens.d.ts +13 -0
- package/dist/components/chip/chip-tokens.js +185 -0
- package/dist/components/chip/chip-tokens.js.map +1 -0
- package/dist/components/date-picker/CalendarGrid.js +94 -0
- package/dist/components/date-picker/CalendarGrid.js.map +1 -0
- package/dist/components/date-picker/CompactDateDialog.js +63 -0
- package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
- package/dist/components/date-picker/DateField.d.ts +161 -0
- package/dist/components/date-picker/DateField.js +393 -0
- package/dist/components/date-picker/DateField.js.map +1 -0
- package/dist/components/date-picker/DateInput.d.ts +20 -0
- package/dist/components/date-picker/DateInput.js +99 -0
- package/dist/components/date-picker/DateInput.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +165 -0
- package/dist/components/date-picker/DatePicker.js +492 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/PickerDialog.d.ts +121 -0
- package/dist/components/date-picker/PickerDialog.js +161 -0
- package/dist/components/date-picker/PickerDialog.js.map +1 -0
- package/dist/components/date-picker/calendar-parts.js +141 -0
- package/dist/components/date-picker/calendar-parts.js.map +1 -0
- package/dist/components/date-picker/date-format.js +72 -0
- package/dist/components/date-picker/date-format.js.map +1 -0
- package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
- package/dist/components/date-picker/date-picker-styles.js +163 -0
- package/dist/components/date-picker/date-picker-styles.js.map +1 -0
- package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
- package/dist/components/date-picker/date-picker-tokens.js +104 -0
- package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-context.js +8 -0
- package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
- package/dist/components/date-picker/picker-dialog-styles.js +57 -0
- package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
- package/dist/components/date-picker/picker-icons.js +24 -0
- package/dist/components/date-picker/picker-icons.js.map +1 -0
- package/dist/components/date-picker/use-media-query.js +21 -0
- package/dist/components/date-picker/use-media-query.js.map +1 -0
- package/dist/components/date-picker/use-size-transform.js +62 -0
- package/dist/components/date-picker/use-size-transform.js.map +1 -0
- package/dist/components/date-picker/use-view-exit.js +68 -0
- package/dist/components/date-picker/use-view-exit.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +267 -0
- package/dist/components/dialog/Dialog.js +521 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/dialog-styles.d.ts +335 -0
- package/dist/components/dialog/dialog-styles.js +377 -0
- package/dist/components/dialog/dialog-styles.js.map +1 -0
- package/dist/components/dialog/dialog-tokens.d.ts +7 -0
- package/dist/components/dialog/dialog-tokens.js +57 -0
- package/dist/components/dialog/dialog-tokens.js.map +1 -0
- package/dist/components/divider/Divider.d.ts +59 -0
- package/dist/components/divider/Divider.js +53 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/divider-styles.d.ts +90 -0
- package/dist/components/divider/divider-styles.js +66 -0
- package/dist/components/divider/divider-styles.js.map +1 -0
- package/dist/components/divider/divider-tokens.d.ts +7 -0
- package/dist/components/divider/divider-tokens.js +16 -0
- package/dist/components/divider/divider-tokens.js.map +1 -0
- package/dist/components/fab/Fab.d.ts +130 -0
- package/dist/components/fab/Fab.js +137 -0
- package/dist/components/fab/Fab.js.map +1 -0
- package/dist/components/fab/FabTooltip.js +36 -0
- package/dist/components/fab/FabTooltip.js.map +1 -0
- package/dist/components/fab/fab-styles.d.ts +286 -0
- package/dist/components/fab/fab-styles.js +131 -0
- package/dist/components/fab/fab-styles.js.map +1 -0
- package/dist/components/fab/fab-tokens.d.ts +12 -0
- package/dist/components/fab/fab-tokens.js +105 -0
- package/dist/components/fab/fab-tokens.js.map +1 -0
- package/dist/components/fab-menu/FabMenu.d.ts +156 -0
- package/dist/components/fab-menu/FabMenu.js +291 -0
- package/dist/components/fab-menu/FabMenu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
- package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
- package/dist/components/fab-menu/fab-menu-styles.js +107 -0
- package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
- package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
- package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
- package/dist/components/icon-button/IconButton.d.ts +125 -0
- package/dist/components/icon-button/IconButton.js +112 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
- package/dist/components/icon-button/icon-button-styles.js +244 -0
- package/dist/components/icon-button/icon-button-styles.js.map +1 -0
- package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
- package/dist/components/icon-button/icon-button-tokens.js +215 -0
- package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
- package/dist/components/list/List.d.ts +265 -0
- package/dist/components/list/List.js +1386 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/ListMedia.d.ts +88 -0
- package/dist/components/list/ListMedia.js +132 -0
- package/dist/components/list/ListMedia.js.map +1 -0
- package/dist/components/list/list-styles.d.ts +375 -0
- package/dist/components/list/list-styles.js +220 -0
- package/dist/components/list/list-styles.js.map +1 -0
- package/dist/components/list/list-tokens.d.ts +7 -0
- package/dist/components/list/list-tokens.js +92 -0
- package/dist/components/list/list-tokens.js.map +1 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
- package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +215 -0
- package/dist/components/menu/Menu.js +715 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/menu-styles.d.ts +354 -0
- package/dist/components/menu/menu-styles.js +219 -0
- package/dist/components/menu/menu-styles.js.map +1 -0
- package/dist/components/menu/menu-tokens.d.ts +7 -0
- package/dist/components/menu/menu-tokens.js +93 -0
- package/dist/components/menu/menu-tokens.js.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +51 -0
- package/dist/components/menu/menu-trigger.js +100 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/use-reveal-entering.js +42 -0
- package/dist/components/menu/use-reveal-entering.js.map +1 -0
- package/dist/components/navigation/NavItem.d.ts +54 -0
- package/dist/components/navigation/NavItem.js +182 -0
- package/dist/components/navigation/NavItem.js.map +1 -0
- package/dist/components/navigation/NavigationBar.d.ts +64 -0
- package/dist/components/navigation/NavigationBar.js +121 -0
- package/dist/components/navigation/NavigationBar.js.map +1 -0
- package/dist/components/navigation/NavigationRail.d.ts +91 -0
- package/dist/components/navigation/NavigationRail.js +285 -0
- package/dist/components/navigation/NavigationRail.js.map +1 -0
- package/dist/components/navigation/nav-item-styles.d.ts +190 -0
- package/dist/components/navigation/nav-item-styles.js +123 -0
- package/dist/components/navigation/nav-item-styles.js.map +1 -0
- package/dist/components/navigation/navigation-styles.d.ts +239 -0
- package/dist/components/navigation/navigation-styles.js +134 -0
- package/dist/components/navigation/navigation-styles.js.map +1 -0
- package/dist/components/navigation/navigation-tokens.d.ts +9 -0
- package/dist/components/navigation/navigation-tokens.js +114 -0
- package/dist/components/navigation/navigation-tokens.js.map +1 -0
- package/dist/components/navigation/use-hide-on-scroll.js +115 -0
- package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
- package/dist/components/navigation/use-item-arrow-keys.js +37 -0
- package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
- package/dist/components/navigation/use-rail-item-morph.js +61 -0
- package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
- package/dist/components/progress/ProgressIndicator.d.ts +95 -0
- package/dist/components/progress/ProgressIndicator.js +426 -0
- package/dist/components/progress/ProgressIndicator.js.map +1 -0
- package/dist/components/progress/progress-geometry.js +285 -0
- package/dist/components/progress/progress-geometry.js.map +1 -0
- package/dist/components/progress/progress-styles.d.ts +81 -0
- package/dist/components/progress/progress-styles.js +43 -0
- package/dist/components/progress/progress-styles.js.map +1 -0
- package/dist/components/progress/progress-tokens.d.ts +7 -0
- package/dist/components/progress/progress-tokens.js +39 -0
- package/dist/components/progress/progress-tokens.js.map +1 -0
- package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +121 -0
- package/dist/components/radio/RadioGroup.js +163 -0
- package/dist/components/radio/RadioGroup.js.map +1 -0
- package/dist/components/radio/radio-ring.js +21 -0
- package/dist/components/radio/radio-ring.js.map +1 -0
- package/dist/components/radio/radio-styles.d.ts +155 -0
- package/dist/components/radio/radio-styles.js +60 -0
- package/dist/components/radio/radio-styles.js.map +1 -0
- package/dist/components/radio/radio-tokens.d.ts +7 -0
- package/dist/components/radio/radio-tokens.js +31 -0
- package/dist/components/radio/radio-tokens.js.map +1 -0
- package/dist/components/search/SearchAppBar.d.ts +45 -0
- package/dist/components/search/SearchAppBar.js +61 -0
- package/dist/components/search/SearchAppBar.js.map +1 -0
- package/dist/components/search/SearchBar.d.ts +147 -0
- package/dist/components/search/SearchBar.js +412 -0
- package/dist/components/search/SearchBar.js.map +1 -0
- package/dist/components/search/search-styles.d.ts +243 -0
- package/dist/components/search/search-styles.js +143 -0
- package/dist/components/search/search-styles.js.map +1 -0
- package/dist/components/search/search-tokens.d.ts +9 -0
- package/dist/components/search/search-tokens.js +70 -0
- package/dist/components/search/search-tokens.js.map +1 -0
- package/dist/components/select/Select.d.ts +187 -0
- package/dist/components/select/Select.js +319 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/field-shell.d.ts +29 -0
- package/dist/components/select/field-shell.js +135 -0
- package/dist/components/select/field-shell.js.map +1 -0
- package/dist/components/select/option-list.d.ts +81 -0
- package/dist/components/select/option-list.js +291 -0
- package/dist/components/select/option-list.js.map +1 -0
- package/dist/components/select/search-list.js +135 -0
- package/dist/components/select/search-list.js.map +1 -0
- package/dist/components/select/selection-cap.js +30 -0
- package/dist/components/select/selection-cap.js.map +1 -0
- package/dist/components/sheet/BottomSheet.d.ts +154 -0
- package/dist/components/sheet/BottomSheet.js +442 -0
- package/dist/components/sheet/BottomSheet.js.map +1 -0
- package/dist/components/sheet/SheetTrigger.d.ts +25 -0
- package/dist/components/sheet/SheetTrigger.js +46 -0
- package/dist/components/sheet/SheetTrigger.js.map +1 -0
- package/dist/components/sheet/SideSheet.d.ts +139 -0
- package/dist/components/sheet/SideSheet.js +289 -0
- package/dist/components/sheet/SideSheet.js.map +1 -0
- package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
- package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
- package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
- package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
- package/dist/components/sheet/sheet-gesture.js +48 -0
- package/dist/components/sheet/sheet-gesture.js.map +1 -0
- package/dist/components/sheet/sheet-icons.js +31 -0
- package/dist/components/sheet/sheet-icons.js.map +1 -0
- package/dist/components/sheet/sheet-settle.js +58 -0
- package/dist/components/sheet/sheet-settle.js.map +1 -0
- package/dist/components/sheet/sheet-styles.d.ts +312 -0
- package/dist/components/sheet/sheet-styles.js +229 -0
- package/dist/components/sheet/sheet-styles.js.map +1 -0
- package/dist/components/sheet/sheet-tokens.d.ts +12 -0
- package/dist/components/sheet/sheet-tokens.js +115 -0
- package/dist/components/sheet/sheet-tokens.js.map +1 -0
- package/dist/components/sheet/side-swipe-gesture.js +22 -0
- package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
- package/dist/components/sheet/use-peek-inert.js +32 -0
- package/dist/components/sheet/use-peek-inert.js.map +1 -0
- package/dist/components/sheet/use-side-swipe.js +174 -0
- package/dist/components/sheet/use-side-swipe.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +129 -0
- package/dist/components/slider/Slider.js +295 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/slider-geometry.js +138 -0
- package/dist/components/slider/slider-geometry.js.map +1 -0
- package/dist/components/slider/slider-styles.d.ts +133 -0
- package/dist/components/slider/slider-styles.js +97 -0
- package/dist/components/slider/slider-styles.js.map +1 -0
- package/dist/components/slider/slider-tokens.d.ts +7 -0
- package/dist/components/slider/slider-tokens.js +66 -0
- package/dist/components/slider/slider-tokens.js.map +1 -0
- package/dist/components/slider/use-touch-track.js +138 -0
- package/dist/components/slider/use-touch-track.js.map +1 -0
- package/dist/components/snackbar/Snackbar.d.ts +96 -0
- package/dist/components/snackbar/Snackbar.js +253 -0
- package/dist/components/snackbar/Snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar-state.d.ts +58 -0
- package/dist/components/snackbar/snackbar-state.js +73 -0
- package/dist/components/snackbar/snackbar-state.js.map +1 -0
- package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
- package/dist/components/snackbar/snackbar-styles.js +67 -0
- package/dist/components/snackbar/snackbar-styles.js.map +1 -0
- package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
- package/dist/components/snackbar/snackbar-tokens.js +54 -0
- package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +109 -0
- package/dist/components/split-button/SplitButton.js +195 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/split-button-styles.d.ts +214 -0
- package/dist/components/split-button/split-button-styles.js +164 -0
- package/dist/components/split-button/split-button-styles.js.map +1 -0
- package/dist/components/split-button/split-button-tokens.d.ts +7 -0
- package/dist/components/split-button/split-button-tokens.js +36 -0
- package/dist/components/split-button/split-button-tokens.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +82 -0
- package/dist/components/switch/Switch.js +165 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/switch-styles.d.ts +96 -0
- package/dist/components/switch/switch-styles.js +68 -0
- package/dist/components/switch/switch-styles.js.map +1 -0
- package/dist/components/switch/switch-thumb.js +41 -0
- package/dist/components/switch/switch-thumb.js.map +1 -0
- package/dist/components/switch/switch-tokens.d.ts +7 -0
- package/dist/components/switch/switch-tokens.js +78 -0
- package/dist/components/switch/switch-tokens.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +120 -0
- package/dist/components/tabs/Tabs.js +346 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/tabs-styles.d.ts +198 -0
- package/dist/components/tabs/tabs-styles.js +99 -0
- package/dist/components/tabs/tabs-styles.js.map +1 -0
- package/dist/components/tabs/tabs-tokens.d.ts +7 -0
- package/dist/components/tabs/tabs-tokens.js +121 -0
- package/dist/components/tabs/tabs-tokens.js.map +1 -0
- package/dist/components/text-field/TextField.d.ts +175 -0
- package/dist/components/text-field/TextField.js +250 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/text-field-styles.d.ts +252 -0
- package/dist/components/text-field/text-field-styles.js +209 -0
- package/dist/components/text-field/text-field-styles.js.map +1 -0
- package/dist/components/text-field/text-field-tokens.d.ts +7 -0
- package/dist/components/text-field/text-field-tokens.js +177 -0
- package/dist/components/text-field/text-field-tokens.js.map +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +142 -0
- package/dist/components/time-picker/TimePicker.js +700 -0
- package/dist/components/time-picker/TimePicker.js.map +1 -0
- package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
- package/dist/components/time-picker/time-picker-styles.js +112 -0
- package/dist/components/time-picker/time-picker-styles.js.map +1 -0
- package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
- package/dist/components/time-picker/time-picker-tokens.js +86 -0
- package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +209 -0
- package/dist/components/toolbar/Toolbar.js +282 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
- package/dist/components/toolbar/toolbar-styles.js +253 -0
- package/dist/components/toolbar/toolbar-styles.js.map +1 -0
- package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
- package/dist/components/toolbar/toolbar-tokens.js +117 -0
- package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +131 -0
- package/dist/components/tooltip/Tooltip.js +388 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/lazy-tooltip.js +35 -0
- package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
- package/dist/components/tooltip/tooltip-placement.js +14 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
- package/dist/components/tooltip/tooltip-styles.js +81 -0
- package/dist/components/tooltip/tooltip-styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
- package/dist/components/tooltip/tooltip-tokens.js +72 -0
- package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
- package/dist/components/tooltip/tooltip-trigger.js +115 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
- package/dist/composites/button-group/ButtonGroup.js +270 -0
- package/dist/composites/button-group/ButtonGroup.js.map +1 -0
- package/dist/composites/button-group/button-group-styles.d.ts +73 -0
- package/dist/composites/button-group/button-group-styles.js +87 -0
- package/dist/composites/button-group/button-group-styles.js.map +1 -0
- package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
- package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
- package/dist/composites/button-group/overflow-menu-list.js +26 -0
- package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
- package/dist/composites/button-group/use-overflow.js +75 -0
- package/dist/composites/button-group/use-overflow.js.map +1 -0
- package/dist/composites/button-group/use-press-expansion.js +155 -0
- package/dist/composites/button-group/use-press-expansion.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +136 -0
- package/dist/motion/get-m3-spring.d.ts +6 -0
- package/dist/motion/get-m3-spring.js +10 -0
- package/dist/motion/get-m3-spring.js.map +1 -0
- package/dist/motion/reduced-motion.js +19 -0
- package/dist/motion/reduced-motion.js.map +1 -0
- package/dist/motion/use-m3-spring.d.ts +13 -0
- package/dist/motion/use-m3-spring.js +22 -0
- package/dist/motion/use-m3-spring.js.map +1 -0
- package/dist/next/NextRouterProvider.d.ts +13 -0
- package/dist/next/NextRouterProvider.js +26 -0
- package/dist/next/NextRouterProvider.js.map +1 -0
- package/dist/next/get-theme-from-cookies.d.ts +32 -0
- package/dist/next/get-theme-from-cookies.js +27 -0
- package/dist/next/get-theme-from-cookies.js.map +1 -0
- package/dist/next/navigation-guard.d.ts +30 -0
- package/dist/next/navigation-guard.js +68 -0
- package/dist/next/navigation-guard.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.js +5 -0
- package/dist/primitives/ButtonBase.d.ts +115 -0
- package/dist/primitives/ButtonBase.js +231 -0
- package/dist/primitives/ButtonBase.js.map +1 -0
- package/dist/primitives/DomDirectionLocale.d.ts +18 -0
- package/dist/primitives/DomDirectionLocale.js +28 -0
- package/dist/primitives/DomDirectionLocale.js.map +1 -0
- package/dist/primitives/Field.d.ts +50 -0
- package/dist/primitives/Field.js +74 -0
- package/dist/primitives/Field.js.map +1 -0
- package/dist/primitives/IconFaces.js +23 -0
- package/dist/primitives/IconFaces.js.map +1 -0
- package/dist/primitives/Overlay.d.ts +39 -0
- package/dist/primitives/Overlay.js +86 -0
- package/dist/primitives/Overlay.js.map +1 -0
- package/dist/primitives/SelectionControl.d.ts +55 -0
- package/dist/primitives/SelectionControl.js +58 -0
- package/dist/primitives/SelectionControl.js.map +1 -0
- package/dist/primitives/Surface.d.ts +123 -0
- package/dist/primitives/Surface.js +68 -0
- package/dist/primitives/Surface.js.map +1 -0
- package/dist/primitives/ToolbarContext.js +12 -0
- package/dist/primitives/ToolbarContext.js.map +1 -0
- package/dist/primitives/TouchTarget.d.ts +14 -0
- package/dist/primitives/TouchTarget.js +20 -0
- package/dist/primitives/TouchTarget.js.map +1 -0
- package/dist/primitives/TriggerContext.d.ts +34 -0
- package/dist/primitives/TriggerContext.js +24 -0
- package/dist/primitives/TriggerContext.js.map +1 -0
- package/dist/primitives/hidden-input-focus.js +27 -0
- package/dist/primitives/hidden-input-focus.js.map +1 -0
- package/dist/primitives/icon-faces-styles.d.ts +9 -0
- package/dist/primitives/icon-faces-styles.js +45 -0
- package/dist/primitives/icon-faces-styles.js.map +1 -0
- package/dist/primitives/locale-with-direction.d.ts +9 -0
- package/dist/primitives/locale-with-direction.js +17 -0
- package/dist/primitives/locale-with-direction.js.map +1 -0
- package/dist/primitives/morph-path.d.ts +25 -0
- package/dist/primitives/morph-path.js +38 -0
- package/dist/primitives/morph-path.js.map +1 -0
- package/dist/primitives/selection-control-styles.d.ts +54 -0
- package/dist/primitives/selection-control-styles.js +44 -0
- package/dist/primitives/selection-control-styles.js.map +1 -0
- package/dist/primitives/use-m3-interaction.d.ts +51 -0
- package/dist/primitives/use-m3-interaction.js +149 -0
- package/dist/primitives/use-m3-interaction.js.map +1 -0
- package/dist/primitives/use-m3-morph.d.ts +18 -0
- package/dist/primitives/use-m3-morph.js +36 -0
- package/dist/primitives/use-m3-morph.js.map +1 -0
- package/dist/primitives/use-presence.d.ts +19 -0
- package/dist/primitives/use-presence.js +37 -0
- package/dist/primitives/use-presence.js.map +1 -0
- package/dist/primitives.d.ts +36 -0
- package/dist/primitives.js +34 -0
- package/dist/shapes/corner-rounding.d.ts +13 -0
- package/dist/shapes/corner-rounding.js +18 -0
- package/dist/shapes/corner-rounding.js.map +1 -0
- package/dist/shapes/cubic.d.ts +52 -0
- package/dist/shapes/cubic.js +189 -0
- package/dist/shapes/cubic.js.map +1 -0
- package/dist/shapes/feature-mapping.js +80 -0
- package/dist/shapes/feature-mapping.js.map +1 -0
- package/dist/shapes/features.d.ts +23 -0
- package/dist/shapes/features.js +82 -0
- package/dist/shapes/features.js.map +1 -0
- package/dist/shapes/float-mapping.js +65 -0
- package/dist/shapes/float-mapping.js.map +1 -0
- package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
- package/dist/shapes/generated/material-shape-path-record.js +48 -0
- package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
- package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
- package/dist/shapes/generated/material-shape-paths.js +218 -0
- package/dist/shapes/generated/material-shape-paths.js.map +1 -0
- package/dist/shapes/mask.d.ts +14 -0
- package/dist/shapes/mask.js +24 -0
- package/dist/shapes/mask.js.map +1 -0
- package/dist/shapes/material-shapes.d.ts +11 -0
- package/dist/shapes/material-shapes.js +250 -0
- package/dist/shapes/material-shapes.js.map +1 -0
- package/dist/shapes/morph.d.ts +25 -0
- package/dist/shapes/morph.js +97 -0
- package/dist/shapes/morph.js.map +1 -0
- package/dist/shapes/path.d.ts +33 -0
- package/dist/shapes/path.js +47 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/point.d.ts +28 -0
- package/dist/shapes/point.js +103 -0
- package/dist/shapes/point.js.map +1 -0
- package/dist/shapes/polygon-measure.js +140 -0
- package/dist/shapes/polygon-measure.js.map +1 -0
- package/dist/shapes/rounded-polygon.d.ts +44 -0
- package/dist/shapes/rounded-polygon.js +278 -0
- package/dist/shapes/rounded-polygon.js.map +1 -0
- package/dist/shapes/shape-path.d.ts +15 -0
- package/dist/shapes/shapes.d.ts +53 -0
- package/dist/shapes/shapes.js +171 -0
- package/dist/shapes/shapes.js.map +1 -0
- package/dist/styles/generated/components.css +710 -0
- package/dist/styles/generated/theme.css +247 -0
- package/dist/styles/generated/themes.css +3361 -0
- package/dist/styles/generated/tokens.css +284 -0
- package/dist/styles/styles.css +15 -0
- package/dist/styles/utilities.css +283 -0
- package/dist/styles.compiled.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +72 -0
- package/dist/theme/ThemeProvider.js +144 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScope.d.ts +32 -0
- package/dist/theme/ThemeScope.js +67 -0
- package/dist/theme/ThemeScope.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +26 -0
- package/dist/theme/ThemeScript.js +44 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/context.d.ts +32 -0
- package/dist/theme/context.js +47 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/create-theme.d.ts +60 -0
- package/dist/theme/create-theme.js +47 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/css.js +54 -0
- package/dist/theme/css.js.map +1 -0
- package/dist/theme/parse-palettes.js +40 -0
- package/dist/theme/parse-palettes.js.map +1 -0
- package/dist/theme/scheme.d.ts +6 -0
- package/dist/theme/scheme.js +118 -0
- package/dist/theme/scheme.js.map +1 -0
- package/dist/theme/state.d.ts +38 -0
- package/dist/theme/state.js +93 -0
- package/dist/theme/state.js.map +1 -0
- package/dist/theme/storage.js +21 -0
- package/dist/theme/storage.js.map +1 -0
- package/dist/tokens/breakpoints.d.ts +15 -0
- package/dist/tokens/breakpoints.js +16 -0
- package/dist/tokens/breakpoints.js.map +1 -0
- package/dist/tokens/color.d.ts +104 -0
- package/dist/tokens/color.js +147 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/component.d.ts +110 -0
- package/dist/tokens/component.js +67 -0
- package/dist/tokens/component.js.map +1 -0
- package/dist/tokens/density.d.ts +20 -0
- package/dist/tokens/density.js +27 -0
- package/dist/tokens/density.js.map +1 -0
- package/dist/tokens/elevation.d.ts +44 -0
- package/dist/tokens/elevation.js +45 -0
- package/dist/tokens/elevation.js.map +1 -0
- package/dist/tokens/motion.d.ts +79 -0
- package/dist/tokens/motion.js +126 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/shape.d.ts +22 -0
- package/dist/tokens/shape.js +22 -0
- package/dist/tokens/shape.js.map +1 -0
- package/dist/tokens/spring-velocity.d.ts +19 -0
- package/dist/tokens/spring-velocity.js +44 -0
- package/dist/tokens/spring-velocity.js.map +1 -0
- package/dist/tokens/state.d.ts +18 -0
- package/dist/tokens/state.js +19 -0
- package/dist/tokens/state.js.map +1 -0
- package/dist/tokens/typography.d.ts +64 -0
- package/dist/tokens/typography.js +60 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/z-index.d.ts +17 -0
- package/dist/tokens/z-index.js +18 -0
- package/dist/tokens/z-index.js.map +1 -0
- package/dist/utils/announce.js +51 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/assert-collection-children.js +26 -0
- package/dist/utils/assert-collection-children.js.map +1 -0
- package/dist/utils/closed-by.d.ts +9 -0
- package/dist/utils/closed-by.js +12 -0
- package/dist/utils/closed-by.js.map +1 -0
- package/dist/utils/cn.d.ts +31 -0
- package/dist/utils/cn.js +37 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/composite-keys.js +32 -0
- package/dist/utils/composite-keys.js.map +1 -0
- package/dist/utils/focus-visible.js +14 -0
- package/dist/utils/focus-visible.js.map +1 -0
- package/dist/utils/focus.js +51 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/focusable-disabled.js +12 -0
- package/dist/utils/focusable-disabled.js.map +1 -0
- package/dist/utils/keep-pressed-in-place.d.ts +60 -0
- package/dist/utils/keep-pressed-in-place.js +127 -0
- package/dist/utils/keep-pressed-in-place.js.map +1 -0
- package/dist/utils/load-on-demand.js +111 -0
- package/dist/utils/load-on-demand.js.map +1 -0
- package/dist/utils/merge-data-tokens.d.ts +9 -0
- package/dist/utils/merge-data-tokens.js +15 -0
- package/dist/utils/merge-data-tokens.js.map +1 -0
- package/dist/utils/natural-size.js +53 -0
- package/dist/utils/natural-size.js.map +1 -0
- package/dist/utils/nearest-reveal.js +28 -0
- package/dist/utils/nearest-reveal.js.map +1 -0
- package/dist/utils/placement.js +14 -0
- package/dist/utils/placement.js.map +1 -0
- package/dist/utils/radio-group-keys.js +74 -0
- package/dist/utils/radio-group-keys.js.map +1 -0
- package/dist/utils/rendered-description.js +17 -0
- package/dist/utils/rendered-description.js.map +1 -0
- package/dist/utils/root-props.d.ts +103 -0
- package/dist/utils/root-props.js +51 -0
- package/dist/utils/root-props.js.map +1 -0
- package/dist/utils/search.d.ts +11 -0
- package/dist/utils/search.js +18 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/shortcut.js +20 -0
- package/dist/utils/shortcut.js.map +1 -0
- package/dist/utils/split-data-attributes.d.ts +12 -0
- package/dist/utils/split-data-attributes.js +20 -0
- package/dist/utils/split-data-attributes.js.map +1 -0
- package/dist/utils/toolbar-keys.js +28 -0
- package/dist/utils/toolbar-keys.js.map +1 -0
- package/dist/utils/tv.d.ts +7 -0
- package/dist/utils/tv.js +9 -0
- package/dist/utils/tv.js.map +1 -0
- package/dist/utils/typeahead.js +64 -0
- package/dist/utils/typeahead.js.map +1 -0
- package/dist/utils/warn-once.js +30 -0
- package/dist/utils/warn-once.js.map +1 -0
- package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
- package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
- package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
- package/dist/vendor/material-color-utilities/index.js +51 -0
- package/dist/vendor/material-color-utilities/index.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
- package/dist/vendor/material-color-utilities/score/score.js +115 -0
- package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
- package/package.json +114 -3
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TriggerContext, useTriggerProps } from "../../primitives/TriggerContext.js";
|
|
3
|
+
import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
|
|
4
|
+
import { usePresence } from "../../primitives/use-presence.js";
|
|
5
|
+
import { TooltipPlacementContext } from "./tooltip-placement.js";
|
|
6
|
+
import { CLOSE_DELAY, RichContext, TooltipContext, TooltipTrigger, useTouchLongPress } from "./tooltip-trigger.js";
|
|
7
|
+
import { tabbables } from "../../utils/focus.js";
|
|
8
|
+
import { Overlay as Overlay$1 } from "../../primitives/Overlay.js";
|
|
9
|
+
import { toAriaPlacement } from "../../utils/placement.js";
|
|
10
|
+
import { richTooltipStyles, tooltipStyles } from "./tooltip-styles.js";
|
|
11
|
+
import { Children, useContext, useEffect, useId, useRef, useSyncExternalStore } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { mergeProps, useInteractOutside, useObjectRef, useOverlayPosition, useOverlayTrigger, usePopover, useTooltip, useTooltipTrigger } from "react-aria";
|
|
14
|
+
import { useOverlayTriggerState, useTooltipTriggerState } from "react-stately";
|
|
15
|
+
//#region src/components/tooltip/Tooltip.tsx
|
|
16
|
+
/** A caret (8px) sits in the gap between the anchor and the tooltip. */
|
|
17
|
+
const offsetFor = (offset, caret) => offset + (caret ? 8 : 0);
|
|
18
|
+
/** Tooltips move off the screen edge in 8px steps (the spec), so keep 8px from it. */
|
|
19
|
+
const CONTAINER_PADDING = 8;
|
|
20
|
+
const subscribeToNothing = () => () => {};
|
|
21
|
+
/**
|
|
22
|
+
* React Aria resolves `start` / `end` from its locale, not the DOM; read the anchor's laid-out
|
|
23
|
+
* direction and turn them into physical sides.
|
|
24
|
+
*/
|
|
25
|
+
function usePhysicalPlacement(placement, triggerRef) {
|
|
26
|
+
const direction = useSyncExternalStore(subscribeToNothing, () => triggerRef.current ? getComputedStyle(triggerRef.current).direction : "ltr", () => "ltr");
|
|
27
|
+
return toAriaPlacement(placement, direction === "rtl");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The side to reveal from: React Aria's resolved one, or until it has measured (its first
|
|
31
|
+
* render reports none) the requested side, so the element is inserted with a placement and
|
|
32
|
+
* its `@starting-style` clip applies.
|
|
33
|
+
*/
|
|
34
|
+
function revealSide(resolved, requested) {
|
|
35
|
+
return resolved ?? requested.split(" ")[0] ?? requested;
|
|
36
|
+
}
|
|
37
|
+
/** The caret points at the anchor from whichever side the tooltip ended up on. */
|
|
38
|
+
function caretStyle(placement, arrow) {
|
|
39
|
+
const side = placement.split(" ")[0];
|
|
40
|
+
const rotation = {
|
|
41
|
+
top: 0,
|
|
42
|
+
bottom: 180,
|
|
43
|
+
left: -90,
|
|
44
|
+
right: 90
|
|
45
|
+
}[side] ?? 0;
|
|
46
|
+
const style = {
|
|
47
|
+
...arrow.style,
|
|
48
|
+
position: "absolute",
|
|
49
|
+
rotate: `${rotation}deg`
|
|
50
|
+
};
|
|
51
|
+
if (side === "top") style.top = "100%";
|
|
52
|
+
if (side === "bottom") style.bottom = "100%";
|
|
53
|
+
if (side === "left") style.left = "calc(100% - 4px)";
|
|
54
|
+
if (side === "right") style.right = "calc(100% - 4px)";
|
|
55
|
+
if (side === "top" || side === "bottom") style.marginInlineStart = -8;
|
|
56
|
+
else style.marginTop = -4;
|
|
57
|
+
return style;
|
|
58
|
+
}
|
|
59
|
+
/** M3 plain tooltip: a short label in `inverse-surface`, inside a {@link TooltipTrigger}. */
|
|
60
|
+
function Tooltip(props) {
|
|
61
|
+
const context = useContext(TooltipContext);
|
|
62
|
+
if (!context) throw new Error("Tooltip must be rendered inside a TooltipTrigger");
|
|
63
|
+
const { isPresent, isExiting, exitProps } = usePresence(context.state.isOpen);
|
|
64
|
+
if (!isPresent) return null;
|
|
65
|
+
return /* @__PURE__ */ jsx(Overlay$1, {
|
|
66
|
+
exiting: isExiting,
|
|
67
|
+
topLayer: true,
|
|
68
|
+
children: /* @__PURE__ */ jsx(TooltipPopup, {
|
|
69
|
+
...props,
|
|
70
|
+
context,
|
|
71
|
+
isExiting,
|
|
72
|
+
exitProps
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function TooltipPopup({ children, caret = false, className, style, ref, classNames, context, isExiting, exitProps, ...rest }) {
|
|
77
|
+
const overlayRef = useObjectRef(ref);
|
|
78
|
+
const { tooltipProps } = useTooltip(context.tooltipProps, context.state);
|
|
79
|
+
const requested = usePhysicalPlacement(context.placement, context.triggerRef);
|
|
80
|
+
const { overlayProps, arrowProps, placement } = useOverlayPosition({
|
|
81
|
+
targetRef: context.triggerRef,
|
|
82
|
+
overlayRef,
|
|
83
|
+
placement: requested,
|
|
84
|
+
offset: offsetFor(context.offset, caret),
|
|
85
|
+
containerPadding: CONTAINER_PADDING,
|
|
86
|
+
isOpen: true,
|
|
87
|
+
onClose: () => context.state.close(true)
|
|
88
|
+
});
|
|
89
|
+
const side = revealSide(placement, requested);
|
|
90
|
+
const styles = tooltipStyles();
|
|
91
|
+
const { "data-tokens": appTokens, ...dom } = rest;
|
|
92
|
+
return /* @__PURE__ */ jsx("div", {
|
|
93
|
+
...mergeProps(dom, overlayProps),
|
|
94
|
+
style: {
|
|
95
|
+
...style,
|
|
96
|
+
...overlayProps.style
|
|
97
|
+
},
|
|
98
|
+
ref: overlayRef,
|
|
99
|
+
"data-overlay-placement": "",
|
|
100
|
+
className: styles.positioner({ class: className }),
|
|
101
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
...mergeProps(tooltipProps, exitProps),
|
|
103
|
+
"data-tokens": mergeDataTokens("md-comp-plain-tooltip", { "data-tokens": appTokens ?? tooltipProps["data-tokens"] }),
|
|
104
|
+
"data-placement": side,
|
|
105
|
+
"data-exiting": isExiting || void 0,
|
|
106
|
+
className: styles.panel({ class: classNames?.panel }),
|
|
107
|
+
children: [children, caret && /* @__PURE__ */ jsx("span", {
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
style: caretStyle(side, arrowProps),
|
|
110
|
+
className: styles.caret({ class: classNames?.caret })
|
|
111
|
+
})]
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Shows a {@link RichTooltip} for its trigger. Transient by default (hover, keyboard focus or a
|
|
117
|
+
* touch long press; it stays while hovered or focused within and leaves 1.5s later), or
|
|
118
|
+
* `persistent`: opened by a press and kept until the trigger is pressed again, Escape, or a
|
|
119
|
+
* press anywhere outside it. Focus stays on the trigger, and Tab moves on into the tooltip.
|
|
120
|
+
* Use `persistent` when the tooltip holds actions keyboard users must reach.
|
|
121
|
+
*/
|
|
122
|
+
function RichTooltipTrigger({ persistent = false, ...props }) {
|
|
123
|
+
return persistent ? /* @__PURE__ */ jsx(PersistentRichTrigger, { ...props }) : /* @__PURE__ */ jsx(TransientRichTrigger, { ...props });
|
|
124
|
+
}
|
|
125
|
+
function PersistentRichTrigger({ children, placement = "bottom-start", offset = 4, disabled = false, open, defaultOpen, onOpenChange }) {
|
|
126
|
+
const state = useOverlayTriggerState({
|
|
127
|
+
isOpen: open,
|
|
128
|
+
defaultOpen,
|
|
129
|
+
onOpenChange
|
|
130
|
+
});
|
|
131
|
+
const triggerRef = useRef(null);
|
|
132
|
+
const { triggerProps, overlayProps } = useOverlayTrigger({ type: "dialog" }, state, triggerRef);
|
|
133
|
+
const triggerValue = useTriggerProps({
|
|
134
|
+
...disabled ? {} : triggerProps,
|
|
135
|
+
ref: triggerRef
|
|
136
|
+
});
|
|
137
|
+
const [trigger, ...tooltip] = Children.toArray(children);
|
|
138
|
+
return /* @__PURE__ */ jsxs(RichContext, {
|
|
139
|
+
value: {
|
|
140
|
+
persistent: true,
|
|
141
|
+
state,
|
|
142
|
+
triggerRef,
|
|
143
|
+
overlayProps,
|
|
144
|
+
placement,
|
|
145
|
+
offset
|
|
146
|
+
},
|
|
147
|
+
children: [/* @__PURE__ */ jsx(TriggerContext, {
|
|
148
|
+
value: triggerValue,
|
|
149
|
+
children: trigger
|
|
150
|
+
}), tooltip]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function TransientRichTrigger({ children, placement = "bottom-start", offset = 4, delay = 0, closeDelay = CLOSE_DELAY, disabled, open, defaultOpen, onOpenChange }) {
|
|
154
|
+
const options = {
|
|
155
|
+
delay,
|
|
156
|
+
closeDelay,
|
|
157
|
+
isDisabled: disabled,
|
|
158
|
+
isOpen: open,
|
|
159
|
+
defaultOpen,
|
|
160
|
+
onOpenChange
|
|
161
|
+
};
|
|
162
|
+
const state = useTooltipTriggerState(options);
|
|
163
|
+
const triggerRef = useRef(null);
|
|
164
|
+
const { triggerProps, tooltipProps } = useTooltipTrigger(options, state, triggerRef);
|
|
165
|
+
const longPressProps = useTouchLongPress(() => state.open(true), () => state.close(), disabled);
|
|
166
|
+
const triggerValue = useTriggerProps({
|
|
167
|
+
...mergeProps(triggerProps, longPressProps),
|
|
168
|
+
ref: triggerRef
|
|
169
|
+
});
|
|
170
|
+
const [trigger, ...tooltip] = Children.toArray(children);
|
|
171
|
+
return /* @__PURE__ */ jsxs(RichContext, {
|
|
172
|
+
value: {
|
|
173
|
+
persistent: false,
|
|
174
|
+
state,
|
|
175
|
+
triggerRef,
|
|
176
|
+
tooltipProps,
|
|
177
|
+
placement,
|
|
178
|
+
offset
|
|
179
|
+
},
|
|
180
|
+
children: [/* @__PURE__ */ jsx(TriggerContext, {
|
|
181
|
+
value: triggerValue,
|
|
182
|
+
children: trigger
|
|
183
|
+
}), tooltip]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* M3 rich tooltip: a subhead, supporting text and an optional action on
|
|
188
|
+
* `surface-container`, inside a {@link RichTooltipTrigger}. A transient one is a
|
|
189
|
+
* `role="tooltip"` describing its trigger; a persistent one is a non-modal popover dialog.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* <RichTooltipTrigger>
|
|
193
|
+
* <Button variant="text">What's this?</Button>
|
|
194
|
+
* <RichTooltip title="Grouped tabs">Tabs with the same site stay together.</RichTooltip>
|
|
195
|
+
* </RichTooltipTrigger>
|
|
196
|
+
*/
|
|
197
|
+
function RichTooltip(props) {
|
|
198
|
+
const context = useContext(RichContext);
|
|
199
|
+
if (!context) throw new Error("RichTooltip must be rendered inside a RichTooltipTrigger");
|
|
200
|
+
const { isPresent, isExiting, exitProps } = usePresence(context.state.isOpen);
|
|
201
|
+
if (!isPresent) return null;
|
|
202
|
+
const shared = {
|
|
203
|
+
isExiting,
|
|
204
|
+
exitProps
|
|
205
|
+
};
|
|
206
|
+
return /* @__PURE__ */ jsx(Overlay$1, {
|
|
207
|
+
exiting: isExiting,
|
|
208
|
+
topLayer: true,
|
|
209
|
+
disableFocusManagement: context.persistent,
|
|
210
|
+
children: context.persistent ? /* @__PURE__ */ jsx(PersistentRichPopup, {
|
|
211
|
+
...props,
|
|
212
|
+
...shared,
|
|
213
|
+
context
|
|
214
|
+
}) : /* @__PURE__ */ jsx(TransientRichPopup, {
|
|
215
|
+
...props,
|
|
216
|
+
...shared,
|
|
217
|
+
context
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function PersistentRichPopup({ context, isExiting, exitProps, ...props }) {
|
|
222
|
+
const popoverRef = useObjectRef(props.ref);
|
|
223
|
+
const titleId = useId();
|
|
224
|
+
const requested = usePhysicalPlacement(context.placement, context.triggerRef);
|
|
225
|
+
const { state, triggerRef } = context;
|
|
226
|
+
const isOutside = (element) => !triggerRef.current?.contains(element);
|
|
227
|
+
const { popoverProps, arrowProps, placement } = usePopover({
|
|
228
|
+
triggerRef,
|
|
229
|
+
popoverRef,
|
|
230
|
+
placement: requested,
|
|
231
|
+
offset: offsetFor(context.offset, props.caret ?? false),
|
|
232
|
+
containerPadding: CONTAINER_PADDING,
|
|
233
|
+
isNonModal: true,
|
|
234
|
+
isKeyboardDismissDisabled: false,
|
|
235
|
+
shouldCloseOnInteractOutside: isOutside
|
|
236
|
+
}, state);
|
|
237
|
+
useInteractOutside({
|
|
238
|
+
ref: popoverRef,
|
|
239
|
+
isDisabled: isExiting,
|
|
240
|
+
onInteractOutside: (event) => {
|
|
241
|
+
if (isOutside(event.target)) state.close();
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
useTabOrderAfterTrigger(popoverRef, triggerRef, state, isExiting);
|
|
245
|
+
const dialogProps = {
|
|
246
|
+
role: "dialog",
|
|
247
|
+
tabIndex: -1,
|
|
248
|
+
...props.title != null ? { "aria-labelledby": titleId } : { "aria-label": props["aria-label"] }
|
|
249
|
+
};
|
|
250
|
+
return /* @__PURE__ */ jsx(RichBody, {
|
|
251
|
+
...props,
|
|
252
|
+
popupRef: popoverRef,
|
|
253
|
+
titleId,
|
|
254
|
+
positionProps: popoverProps,
|
|
255
|
+
domProps: mergeProps(dialogProps, context.overlayProps, exitProps),
|
|
256
|
+
placement: revealSide(placement, requested),
|
|
257
|
+
arrowProps,
|
|
258
|
+
isExiting
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Puts a persistent rich tooltip next in the Tab order after its trigger, though it's
|
|
263
|
+
* portalled to the end of the document (the spec: focus goes parent element → link → button,
|
|
264
|
+
* and people "move linearly through the rest of the page"). Tab from the trigger enters it,
|
|
265
|
+
* Tab from its last control goes on to whatever follows the trigger, and Shift+Tab reverses
|
|
266
|
+
* both. Escape on the trigger or inside closes it, putting focus back on the trigger.
|
|
267
|
+
*/
|
|
268
|
+
function useTabOrderAfterTrigger(popoverRef, triggerRef, state, isExiting) {
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
if (isExiting) return;
|
|
271
|
+
const onKeyDown = (event) => {
|
|
272
|
+
const popover = popoverRef.current;
|
|
273
|
+
const trigger = triggerRef.current;
|
|
274
|
+
if (event.defaultPrevented || !popover || !trigger) return;
|
|
275
|
+
const active = document.activeElement;
|
|
276
|
+
const onTrigger = active === trigger;
|
|
277
|
+
if (event.key === "Escape" && (onTrigger || popover.contains(active))) {
|
|
278
|
+
event.preventDefault();
|
|
279
|
+
event.stopPropagation();
|
|
280
|
+
state.close();
|
|
281
|
+
trigger.focus();
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (event.key !== "Tab" || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
285
|
+
const inside = tabbables(popover);
|
|
286
|
+
if (inside.length === 0) return;
|
|
287
|
+
const following = () => tabbables(document.body, (el) => popover.contains(el) || trigger.contains(el)).find((el) => trigger.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
288
|
+
let target;
|
|
289
|
+
if (!event.shiftKey) {
|
|
290
|
+
if (onTrigger) target = inside[0];
|
|
291
|
+
else if (active === inside.at(-1)) target = following();
|
|
292
|
+
} else if (active === inside[0]) target = trigger;
|
|
293
|
+
else if (active instanceof HTMLElement && active === following()) target = inside.at(-1);
|
|
294
|
+
if (!target) return;
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
target.focus();
|
|
297
|
+
};
|
|
298
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
299
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
300
|
+
}, [
|
|
301
|
+
popoverRef,
|
|
302
|
+
triggerRef,
|
|
303
|
+
state,
|
|
304
|
+
isExiting
|
|
305
|
+
]);
|
|
306
|
+
}
|
|
307
|
+
function TransientRichPopup({ context, isExiting, exitProps, ...props }) {
|
|
308
|
+
const overlayRef = useObjectRef(props.ref);
|
|
309
|
+
const titleId = useId();
|
|
310
|
+
const { state } = context;
|
|
311
|
+
const { tooltipProps } = useTooltip(context.tooltipProps, state);
|
|
312
|
+
const requested = usePhysicalPlacement(context.placement, context.triggerRef);
|
|
313
|
+
const { overlayProps, arrowProps, placement } = useOverlayPosition({
|
|
314
|
+
targetRef: context.triggerRef,
|
|
315
|
+
overlayRef,
|
|
316
|
+
placement: requested,
|
|
317
|
+
offset: offsetFor(context.offset, props.caret ?? false),
|
|
318
|
+
containerPadding: CONTAINER_PADDING,
|
|
319
|
+
isOpen: true,
|
|
320
|
+
onClose: () => state.close(true)
|
|
321
|
+
});
|
|
322
|
+
const focusProps = {
|
|
323
|
+
onFocus: () => state.open(true),
|
|
324
|
+
onBlur: (event) => {
|
|
325
|
+
if (!event.currentTarget.contains(event.relatedTarget)) state.close();
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
return /* @__PURE__ */ jsx(RichBody, {
|
|
329
|
+
...props,
|
|
330
|
+
popupRef: overlayRef,
|
|
331
|
+
titleId,
|
|
332
|
+
positionProps: overlayProps,
|
|
333
|
+
domProps: mergeProps(tooltipProps, focusProps, exitProps),
|
|
334
|
+
placement: revealSide(placement, requested),
|
|
335
|
+
arrowProps,
|
|
336
|
+
isExiting
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function RichBody({ children, title, action, caret = false, className, style, classNames, popupRef, titleId, positionProps, domProps, placement, arrowProps, isExiting, ...rest }) {
|
|
340
|
+
const styles = richTooltipStyles({
|
|
341
|
+
subhead: title != null,
|
|
342
|
+
action: action != null
|
|
343
|
+
});
|
|
344
|
+
const { "data-tokens": appTokens, "aria-label": _label, ref: _ref, ...dom } = rest;
|
|
345
|
+
return /* @__PURE__ */ jsx("div", {
|
|
346
|
+
...mergeProps(dom, positionProps),
|
|
347
|
+
style: {
|
|
348
|
+
...style,
|
|
349
|
+
...positionProps.style
|
|
350
|
+
},
|
|
351
|
+
ref: popupRef,
|
|
352
|
+
"data-overlay-placement": "",
|
|
353
|
+
className: styles.positioner({ class: className }),
|
|
354
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
355
|
+
...domProps,
|
|
356
|
+
"data-tokens": mergeDataTokens("md-comp-rich-tooltip", { "data-tokens": appTokens ?? domProps["data-tokens"] }),
|
|
357
|
+
"data-placement": placement,
|
|
358
|
+
"data-exiting": isExiting || void 0,
|
|
359
|
+
className: styles.panel({ class: classNames?.panel }),
|
|
360
|
+
children: [
|
|
361
|
+
title != null && /* @__PURE__ */ jsx("div", {
|
|
362
|
+
id: titleId,
|
|
363
|
+
"data-slot": "subhead",
|
|
364
|
+
className: styles.title({ class: classNames?.title }),
|
|
365
|
+
children: title
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ jsx("div", {
|
|
368
|
+
"data-slot": "text",
|
|
369
|
+
className: styles.text({ class: classNames?.text }),
|
|
370
|
+
children
|
|
371
|
+
}),
|
|
372
|
+
action != null && /* @__PURE__ */ jsx("div", {
|
|
373
|
+
className: styles.actions({ class: classNames?.actions }),
|
|
374
|
+
children: action
|
|
375
|
+
}),
|
|
376
|
+
caret && /* @__PURE__ */ jsx("span", {
|
|
377
|
+
"aria-hidden": "true",
|
|
378
|
+
style: caretStyle(placement, arrowProps),
|
|
379
|
+
className: styles.caret({ class: classNames?.caret })
|
|
380
|
+
})
|
|
381
|
+
]
|
|
382
|
+
})
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
386
|
+
export { RichTooltip, RichTooltipTrigger, Tooltip, TooltipPlacementContext, TooltipTrigger };
|
|
387
|
+
|
|
388
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["Overlay"],"sources":["../../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["'use client';\n\nimport {\n Children,\n useContext,\n useEffect,\n useId,\n useRef,\n useSyncExternalStore,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport {\n mergeProps,\n useInteractOutside,\n useObjectRef,\n useOverlayPosition,\n useOverlayTrigger,\n usePopover,\n useTooltip,\n useTooltipTrigger,\n type Placement,\n} from 'react-aria';\nimport {\n useOverlayTriggerState,\n useTooltipTriggerState,\n type OverlayTriggerState,\n} from 'react-stately';\nimport { Overlay } from '../../primitives/Overlay';\nimport {\n TriggerContext,\n useTriggerProps,\n type TriggerContextValue,\n} from '../../primitives/TriggerContext';\nimport { usePresence } from '../../primitives/use-presence';\nimport { toAriaPlacement } from '../../utils/placement';\nimport { tabbables } from '../../utils/focus';\nimport { richTooltipStyles, tooltipStyles } from './tooltip-styles';\nimport { TooltipPlacementContext, type TooltipPlacement } from './tooltip-placement';\nimport {\n CLOSE_DELAY,\n DEFAULT_OFFSET,\n RichContext,\n TooltipContext,\n TooltipTrigger,\n useInTooltipTrigger,\n useTouchLongPress,\n type RichContextValue,\n type TooltipContextValue,\n type TooltipTriggerProps,\n} from './tooltip-trigger';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\nimport type { RootDOMProps } from '../../utils/root-props';\n\nexport {\n TooltipPlacementContext,\n TooltipTrigger,\n useInTooltipTrigger,\n type TooltipPlacement,\n type TooltipTriggerProps,\n};\n\n/** A caret (8px) sits in the gap between the anchor and the tooltip. */\nconst offsetFor = (offset: number, caret: boolean) => offset + (caret ? 8 : 0);\n\n/** Tooltips move off the screen edge in 8px steps (the spec), so keep 8px from it. */\nconst CONTAINER_PADDING = 8;\n\nconst subscribeToNothing = () => () => {};\n\n/**\n * React Aria resolves `start` / `end` from its locale, not the DOM; read the anchor's laid-out\n * direction and turn them into physical sides.\n */\nfunction usePhysicalPlacement(\n placement: TooltipPlacement,\n triggerRef: RefObject<HTMLElement | null>,\n): Placement {\n const direction = useSyncExternalStore(\n subscribeToNothing,\n () => (triggerRef.current ? getComputedStyle(triggerRef.current).direction : 'ltr'),\n () => 'ltr',\n );\n return toAriaPlacement(placement, direction === 'rtl');\n}\n\n/**\n * The side to reveal from: React Aria's resolved one, or until it has measured (its first\n * render reports none) the requested side, so the element is inserted with a placement and\n * its `@starting-style` clip applies.\n */\nfunction revealSide(resolved: string | null | undefined, requested: Placement): string {\n return resolved ?? requested.split(' ')[0] ?? requested;\n}\n\n/** The caret points at the anchor from whichever side the tooltip ended up on. */\nfunction caretStyle(placement: string, arrow: HTMLAttributes<HTMLElement>) {\n const side = placement.split(' ')[0];\n const rotation =\n { top: 0, bottom: 180, left: -90, right: 90 }[side as 'top' | 'bottom' | 'left' | 'right'] ?? 0;\n const style: CSSProperties = {\n ...arrow.style,\n position: 'absolute',\n rotate: `${rotation}deg`,\n };\n if (side === 'top') style.top = '100%';\n if (side === 'bottom') style.bottom = '100%';\n if (side === 'left') style.left = 'calc(100% - 4px)';\n if (side === 'right') style.right = 'calc(100% - 4px)';\n // Centre the 16px caret on the arrow position React Aria computed.\n if (side === 'top' || side === 'bottom') style.marginInlineStart = -8;\n else style.marginTop = -4;\n return style;\n}\n\n/* ------------------------------------------------------------------ Plain */\n\nexport interface TooltipClassNames {\n /** The visible surface: its colour, corners, padding and size. */\n panel?: string;\n /** The caret pointing at the anchor. */\n caret?: string;\n}\n\n/**\n * The outermost element's DOM attributes (`data-*`, `aria-*`, `title`, pointer events). A\n * `data-tokens` value joins the surface's token set instead, where the tokens resolve.\n */\ntype PopupDOMProps = RootDOMProps & {\n [data: `data-${string}`]: string | number | boolean | undefined;\n};\n\nexport interface TooltipProps extends PopupDOMProps {\n /** The label: a few words, with no links or buttons (use a rich tooltip for those). */\n children: ReactNode;\n /** Draw a 16×8px caret pointing at the anchor. @default false */\n caret?: boolean;\n /**\n * Goes on the outermost element, which React Aria places against the anchor; the surface\n * inside keeps its size whatever layout class lands here. Style the surface with\n * `classNames.panel`.\n */\n className?: string;\n /** Inline styles for the outermost element; React Aria's position wins over them. */\n style?: CSSProperties;\n /** Ref to the outermost element. */\n ref?: Ref<HTMLDivElement>;\n /** Classes for each part, by slot. */\n classNames?: TooltipClassNames;\n}\n\n/** M3 plain tooltip: a short label in `inverse-surface`, inside a {@link TooltipTrigger}. */\nexport function Tooltip(props: TooltipProps) {\n const context = useContext(TooltipContext);\n if (!context) throw new Error('Tooltip must be rendered inside a TooltipTrigger');\n const { isPresent, isExiting, exitProps } = usePresence(context.state.isOpen);\n if (!isPresent) return null;\n return (\n <Overlay exiting={isExiting} topLayer>\n <TooltipPopup {...props} context={context} isExiting={isExiting} exitProps={exitProps} />\n </Overlay>\n );\n}\n\nfunction TooltipPopup({\n children,\n caret = false,\n className,\n style,\n ref,\n classNames,\n context,\n isExiting,\n exitProps,\n ...rest\n}: TooltipProps & {\n context: TooltipContextValue;\n isExiting: boolean;\n exitProps: ReturnType<typeof usePresence>['exitProps'];\n}) {\n const overlayRef = useObjectRef(ref);\n const { tooltipProps } = useTooltip(context.tooltipProps, context.state);\n const requested = usePhysicalPlacement(context.placement, context.triggerRef);\n const { overlayProps, arrowProps, placement } = useOverlayPosition({\n targetRef: context.triggerRef,\n overlayRef,\n placement: requested,\n offset: offsetFor(context.offset, caret),\n containerPadding: CONTAINER_PADDING,\n isOpen: true,\n // Without its own `onClose`, React Aria's close on scroll falls back to the close of\n // whatever overlay trigger last registered the same element, so a scroll while a menu\n // trigger's tooltip is shown or leaving closed the menu it had just opened.\n onClose: () => context.state.close(true),\n });\n const side = revealSide(placement, requested);\n const styles = tooltipStyles();\n const { 'data-tokens': appTokens, ...dom } = rest;\n return (\n <div\n {...mergeProps(dom, overlayProps)}\n style={{ ...style, ...overlayProps.style }}\n ref={overlayRef}\n // Only React Aria's insets apply (styles/utilities.css).\n data-overlay-placement=\"\"\n className={styles.positioner({ class: className })}\n >\n <div\n {...mergeProps(tooltipProps, exitProps)}\n // The component tokens' hook (tooltip-tokens.ts).\n data-tokens={mergeDataTokens('md-comp-plain-tooltip', {\n 'data-tokens': appTokens ?? (tooltipProps as { 'data-tokens'?: unknown })['data-tokens'],\n })}\n data-placement={side}\n data-exiting={isExiting || undefined}\n className={styles.panel({ class: classNames?.panel })}\n >\n {children}\n {caret && (\n <span\n aria-hidden=\"true\"\n style={caretStyle(side, arrowProps)}\n className={styles.caret({ class: classNames?.caret })}\n />\n )}\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------- Rich */\n\nexport interface RichTooltipTriggerProps {\n /** The trigger (a library button), then a `<RichTooltip>`. */\n children: ReactNode;\n /**\n * A persistent rich tooltip opens when the trigger is pressed and stays, even after the\n * pointer leaves, until the trigger is pressed again, Escape, or a press anywhere outside it\n * (on another element or on empty space), or focus moving to another element. It's a\n * non-modal dialog: opening it leaves focus on the trigger, and it comes next in the Tab\n * order (trigger → its links and buttons → the rest of the page) without trapping focus.\n * A transient one (the spec's default) works like a plain tooltip: hover, focus\n * or a touch long press opens it, and it leaves 1.5s after the pointer or focus does.\n * @default false\n */\n persistent?: boolean;\n /** Bottom right of the anchor in left-to-right layouts (the spec). @default \"bottom-start\" */\n placement?: TooltipPlacement;\n /** Distance from the anchor in px. @default 4 */\n offset?: number;\n /** Milliseconds of hover before a transient tooltip shows. @default 0 */\n delay?: number;\n /** Milliseconds before a transient tooltip hides after the pointer leaves. @default 1500 */\n closeDelay?: number;\n /**\n * The trigger opens nothing: a transient tooltip ignores hover, focus and long press, and a\n * persistent one's trigger works as a plain button, without `aria-expanded`. @default false\n */\n disabled?: boolean;\n /** Whether the tooltip is shown (controlled). */\n open?: boolean;\n /** Whether the tooltip starts shown when uncontrolled. @default false */\n defaultOpen?: boolean;\n /** Called when the tooltip shows or hides. */\n onOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Shows a {@link RichTooltip} for its trigger. Transient by default (hover, keyboard focus or a\n * touch long press; it stays while hovered or focused within and leaves 1.5s later), or\n * `persistent`: opened by a press and kept until the trigger is pressed again, Escape, or a\n * press anywhere outside it. Focus stays on the trigger, and Tab moves on into the tooltip.\n * Use `persistent` when the tooltip holds actions keyboard users must reach.\n */\nexport function RichTooltipTrigger({ persistent = false, ...props }: RichTooltipTriggerProps) {\n return persistent ? <PersistentRichTrigger {...props} /> : <TransientRichTrigger {...props} />;\n}\n\nfunction PersistentRichTrigger({\n children,\n placement = 'bottom-start',\n offset = DEFAULT_OFFSET,\n disabled = false,\n open,\n defaultOpen,\n onOpenChange,\n}: Omit<RichTooltipTriggerProps, 'persistent'>) {\n const state = useOverlayTriggerState({ isOpen: open, defaultOpen, onOpenChange });\n const triggerRef = useRef<HTMLElement>(null);\n const { triggerProps, overlayProps } = useOverlayTrigger({ type: 'dialog' }, state, triggerRef);\n const triggerValue = useTriggerProps({\n ...(disabled ? {} : (triggerProps as TriggerContextValue)),\n ref: triggerRef,\n });\n const [trigger, ...tooltip] = Children.toArray(children);\n return (\n <RichContext value={{ persistent: true, state, triggerRef, overlayProps, placement, offset }}>\n <TriggerContext value={triggerValue}>{trigger}</TriggerContext>\n {tooltip}\n </RichContext>\n );\n}\n\nfunction TransientRichTrigger({\n children,\n placement = 'bottom-start',\n offset = DEFAULT_OFFSET,\n delay = 0,\n closeDelay = CLOSE_DELAY,\n disabled,\n open,\n defaultOpen,\n onOpenChange,\n}: Omit<RichTooltipTriggerProps, 'persistent'>) {\n const options = {\n delay,\n closeDelay,\n isDisabled: disabled,\n isOpen: open,\n defaultOpen,\n onOpenChange,\n };\n const state = useTooltipTriggerState(options);\n const triggerRef = useRef<HTMLElement>(null);\n const { triggerProps, tooltipProps } = useTooltipTrigger(options, state, triggerRef);\n const longPressProps = useTouchLongPress(\n () => state.open(true),\n () => state.close(),\n disabled,\n );\n const triggerValue = useTriggerProps({\n ...(mergeProps(triggerProps, longPressProps) as TriggerContextValue),\n ref: triggerRef,\n });\n const [trigger, ...tooltip] = Children.toArray(children);\n return (\n <RichContext value={{ persistent: false, state, triggerRef, tooltipProps, placement, offset }}>\n <TriggerContext value={triggerValue}>{trigger}</TriggerContext>\n {tooltip}\n </RichContext>\n );\n}\n\nexport interface RichTooltipClassNames {\n /** The visible surface: its colour, corners, padding, size and shadow. */\n panel?: string;\n /** The subhead. */\n title?: string;\n /** The supporting text. */\n text?: string;\n /** The row holding the action(s). */\n actions?: string;\n /** The caret pointing at the anchor. */\n caret?: string;\n}\n\nexport interface RichTooltipProps extends Omit<PopupDOMProps, 'title'> {\n /** Supporting text. */\n children: ReactNode;\n /** Subhead; it also names a persistent tooltip. */\n title?: ReactNode;\n /** Action(s), usually a text `Button`. */\n action?: ReactNode;\n /** Name of a persistent tooltip when there is no `title`. */\n 'aria-label'?: string;\n /** Draw a 16×8px caret pointing at the anchor. @default false */\n caret?: boolean;\n /**\n * Goes on the outermost element, which React Aria places against the anchor; the surface\n * inside keeps its size whatever layout class lands here. Style the surface with\n * `classNames.panel`.\n */\n className?: string;\n /** Inline styles for the outermost element; React Aria's position wins over them. */\n style?: CSSProperties;\n /** Ref to the outermost element. */\n ref?: Ref<HTMLDivElement>;\n /** Classes for each part, by slot. */\n classNames?: RichTooltipClassNames;\n}\n\n/**\n * M3 rich tooltip: a subhead, supporting text and an optional action on\n * `surface-container`, inside a {@link RichTooltipTrigger}. A transient one is a\n * `role=\"tooltip\"` describing its trigger; a persistent one is a non-modal popover dialog.\n *\n * @example\n * <RichTooltipTrigger>\n * <Button variant=\"text\">What's this?</Button>\n * <RichTooltip title=\"Grouped tabs\">Tabs with the same site stay together.</RichTooltip>\n * </RichTooltipTrigger>\n */\nexport function RichTooltip(props: RichTooltipProps) {\n const context = useContext(RichContext);\n if (!context) throw new Error('RichTooltip must be rendered inside a RichTooltipTrigger');\n const { isPresent, isExiting, exitProps } = usePresence(context.state.isOpen);\n if (!isPresent) return null;\n const shared = { isExiting, exitProps };\n return (\n // A persistent one handles its own Tab order and focus return (`useTabOrderAfterTrigger`):\n // the overlay's restoring focus scope would send Shift+Tab from its first control to\n // whatever precedes the trigger.\n <Overlay exiting={isExiting} topLayer disableFocusManagement={context.persistent}>\n {context.persistent ? (\n <PersistentRichPopup {...props} {...shared} context={context} />\n ) : (\n <TransientRichPopup {...props} {...shared} context={context} />\n )}\n </Overlay>\n );\n}\n\ntype PopupProps<Context> = RichTooltipProps & {\n context: Context;\n isExiting: boolean;\n exitProps: ReturnType<typeof usePresence>['exitProps'];\n};\n\nfunction PersistentRichPopup({\n context,\n isExiting,\n exitProps,\n ...props\n}: PopupProps<Extract<RichContextValue, { persistent: true }>>) {\n const popoverRef = useObjectRef(props.ref);\n const titleId = useId();\n const requested = usePhysicalPlacement(context.placement, context.triggerRef);\n const { state, triggerRef } = context;\n // The trigger toggles it itself: focus or a press moving to it isn't \"outside\".\n const isOutside = (element: Element | null) => !triggerRef.current?.contains(element);\n const { popoverProps, arrowProps, placement } = usePopover(\n {\n triggerRef,\n popoverRef,\n placement: requested,\n offset: offsetFor(context.offset, props.caret ?? false),\n containerPadding: CONTAINER_PADDING,\n isNonModal: true,\n isKeyboardDismissDisabled: false,\n shouldCloseOnInteractOutside: isOutside,\n },\n state,\n );\n // \"They only disappear once a person interacts with another UI element\": a press anywhere\n // else closes it, which a non-modal popover doesn't do on its own.\n useInteractOutside({\n ref: popoverRef,\n isDisabled: isExiting,\n onInteractOutside: (event) => {\n if (isOutside(event.target as Element | null)) state.close();\n },\n });\n useTabOrderAfterTrigger(popoverRef, triggerRef, state, isExiting);\n // A non-modal dialog (no `aria-modal`), named by its subhead. Not React Aria's `useDialog`,\n // which moves focus into it: focus stays on the trigger. `tabIndex={-1}` (not in the Tab\n // order) lets a press on its text take focus, so Escape still closes it then.\n const dialogProps = {\n role: 'dialog',\n tabIndex: -1,\n ...(props.title != null\n ? { 'aria-labelledby': titleId }\n : { 'aria-label': props['aria-label'] }),\n };\n return (\n <RichBody\n {...props}\n popupRef={popoverRef}\n titleId={titleId}\n positionProps={popoverProps}\n domProps={mergeProps(dialogProps, context.overlayProps, exitProps)}\n placement={revealSide(placement, requested)}\n arrowProps={arrowProps}\n isExiting={isExiting}\n />\n );\n}\n\n/**\n * Puts a persistent rich tooltip next in the Tab order after its trigger, though it's\n * portalled to the end of the document (the spec: focus goes parent element → link → button,\n * and people \"move linearly through the rest of the page\"). Tab from the trigger enters it,\n * Tab from its last control goes on to whatever follows the trigger, and Shift+Tab reverses\n * both. Escape on the trigger or inside closes it, putting focus back on the trigger.\n */\nfunction useTabOrderAfterTrigger(\n popoverRef: RefObject<HTMLElement | null>,\n triggerRef: RefObject<HTMLElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean,\n) {\n useEffect(() => {\n if (isExiting) return;\n const onKeyDown = (event: KeyboardEvent) => {\n const popover = popoverRef.current;\n const trigger = triggerRef.current;\n if (event.defaultPrevented || !popover || !trigger) return;\n const active = document.activeElement;\n const onTrigger = active === trigger;\n if (event.key === 'Escape' && (onTrigger || popover.contains(active))) {\n // Before any enclosing overlay (a dialog) sees it: the tooltip is on top.\n event.preventDefault();\n event.stopPropagation();\n state.close();\n trigger.focus();\n return;\n }\n if (event.key !== 'Tab' || event.altKey || event.ctrlKey || event.metaKey) return;\n const inside = tabbables(popover);\n if (inside.length === 0) return;\n // The first tabbable after the trigger in the page, leaving the tooltip out.\n const following = () =>\n tabbables(document.body, (el) => popover.contains(el) || trigger.contains(el)).find(\n (el) => trigger.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING,\n );\n let target: HTMLElement | undefined;\n if (!event.shiftKey) {\n if (onTrigger) target = inside[0];\n else if (active === inside.at(-1)) target = following();\n } else if (active === inside[0]) target = trigger;\n else if (active instanceof HTMLElement && active === following()) target = inside.at(-1);\n if (!target) return;\n event.preventDefault();\n target.focus();\n };\n // Capture: before the trigger's and the popover's own key handling.\n document.addEventListener('keydown', onKeyDown, true);\n return () => document.removeEventListener('keydown', onKeyDown, true);\n }, [popoverRef, triggerRef, state, isExiting]);\n}\n\nfunction TransientRichPopup({\n context,\n isExiting,\n exitProps,\n ...props\n}: PopupProps<Extract<RichContextValue, { persistent: false }>>) {\n const overlayRef = useObjectRef(props.ref);\n const titleId = useId();\n const { state } = context;\n const { tooltipProps } = useTooltip(context.tooltipProps, state);\n const requested = usePhysicalPlacement(context.placement, context.triggerRef);\n const { overlayProps, arrowProps, placement } = useOverlayPosition({\n targetRef: context.triggerRef,\n overlayRef,\n placement: requested,\n offset: offsetFor(context.offset, props.caret ?? false),\n containerPadding: CONTAINER_PADDING,\n isOpen: true,\n // Its own close on scroll, never a menu's sharing the trigger (see `TooltipPopup`).\n onClose: () => state.close(true),\n });\n // It may hold an action: stay open while focus is inside, and leave after focus does.\n const focusProps = {\n onFocus: () => state.open(true),\n onBlur: (event: FocusEvent<HTMLElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) state.close();\n },\n };\n return (\n <RichBody\n {...props}\n popupRef={overlayRef}\n titleId={titleId}\n positionProps={overlayProps}\n domProps={mergeProps(tooltipProps, focusProps, exitProps)}\n placement={revealSide(placement, requested)}\n arrowProps={arrowProps}\n isExiting={isExiting}\n />\n );\n}\n\nfunction RichBody({\n children,\n title,\n action,\n caret = false,\n className,\n style,\n classNames,\n popupRef,\n titleId,\n positionProps,\n domProps,\n placement,\n arrowProps,\n isExiting,\n ...rest\n}: RichTooltipProps & {\n popupRef: RefObject<HTMLDivElement | null>;\n titleId: string;\n /** React Aria's placement, for the outermost element. */\n positionProps: HTMLAttributes<HTMLElement>;\n /** The surface's role, naming, focus and exit props. */\n domProps: HTMLAttributes<HTMLElement>;\n placement: string;\n arrowProps: HTMLAttributes<HTMLElement>;\n isExiting: boolean;\n}) {\n const styles = richTooltipStyles({ subhead: title != null, action: action != null });\n // The ref already reached `popupRef`, and `aria-label` names the dialog through `domProps`.\n const { 'data-tokens': appTokens, 'aria-label': _label, ref: _ref, ...dom } = rest;\n return (\n <div\n {...mergeProps(dom, positionProps)}\n style={{ ...style, ...positionProps.style }}\n ref={popupRef}\n data-overlay-placement=\"\"\n className={styles.positioner({ class: className })}\n >\n <div\n {...domProps}\n // The component tokens' hook (tooltip-tokens.ts).\n data-tokens={mergeDataTokens('md-comp-rich-tooltip', {\n 'data-tokens': appTokens ?? (domProps as { 'data-tokens'?: unknown })['data-tokens'],\n })}\n data-placement={placement}\n data-exiting={isExiting || undefined}\n className={styles.panel({ class: classNames?.panel })}\n >\n {title != null && (\n <div\n id={titleId}\n data-slot=\"subhead\"\n className={styles.title({ class: classNames?.title })}\n >\n {title}\n </div>\n )}\n <div data-slot=\"text\" className={styles.text({ class: classNames?.text })}>\n {children}\n </div>\n {action != null && (\n <div className={styles.actions({ class: classNames?.actions })}>{action}</div>\n )}\n {caret && (\n <span\n aria-hidden=\"true\"\n style={caretStyle(placement, arrowProps)}\n className={styles.caret({ class: classNames?.caret })}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmEA,MAAM,aAAa,QAAgB,UAAmB,UAAU,QAAQ,IAAI;;AAG5E,MAAM,oBAAoB;AAE1B,MAAM,iCAAiC,CAAC;;;;;AAMxC,SAAS,qBACP,WACA,YACW;CACX,MAAM,YAAY,qBAChB,0BACO,WAAW,UAAU,iBAAiB,WAAW,OAAO,CAAC,CAAC,YAAY,aACvE,KACR;CACA,OAAO,gBAAgB,WAAW,cAAc,KAAK;AACvD;;;;;;AAOA,SAAS,WAAW,UAAqC,WAA8B;CACrF,OAAO,YAAY,UAAU,MAAM,GAAG,CAAC,CAAC,MAAM;AAChD;;AAGA,SAAS,WAAW,WAAmB,OAAoC;CACzE,MAAM,OAAO,UAAU,MAAM,GAAG,CAAC,CAAC;CAClC,MAAM,WACJ;EAAE,KAAK;EAAG,QAAQ;EAAK,MAAM;EAAK,OAAO;CAAG,EAAE,SAAgD;CAChG,MAAM,QAAuB;EAC3B,GAAG,MAAM;EACT,UAAU;EACV,QAAQ,GAAG,SAAS;CACtB;CACA,IAAI,SAAS,OAAO,MAAM,MAAM;CAChC,IAAI,SAAS,UAAU,MAAM,SAAS;CACtC,IAAI,SAAS,QAAQ,MAAM,OAAO;CAClC,IAAI,SAAS,SAAS,MAAM,QAAQ;CAEpC,IAAI,SAAS,SAAS,SAAS,UAAU,MAAM,oBAAoB;MAC9D,MAAM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demand.js";
|
|
3
|
+
import { TooltipContext } from "./tooltip-trigger.js";
|
|
4
|
+
import { useContext, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/tooltip/lazy-tooltip.tsx
|
|
7
|
+
const tooltip = onDemand(() => import("./Tooltip.js").then((module) => module.Tooltip));
|
|
8
|
+
tooltip.preload;
|
|
9
|
+
/**
|
|
10
|
+
* A plain `Tooltip` whose module loads on demand, for components that show a tooltip of their
|
|
11
|
+
* own (an icon button's label, a FAB's): it only appears on hover, keyboard focus or a touch
|
|
12
|
+
* long press, so a page of buttons doesn't carry the tooltip's code up front. It goes inside a
|
|
13
|
+
* `TooltipTrigger` from `./tooltip-trigger`, which works as before: the trigger's state,
|
|
14
|
+
* naming and keyboard handling are all there from the first render.
|
|
15
|
+
*
|
|
16
|
+
* The module starts loading when the pointer moves over the trigger or focus enters it, and
|
|
17
|
+
* at the latest when the tooltip opens; once loaded, every tooltip opens at once. Until the
|
|
18
|
+
* tooltip first opens it renders nothing; if it opens before the module arrives it shows once
|
|
19
|
+
* loaded. Once opened it stays mounted, so it can play its exit. Server rendering is
|
|
20
|
+
* unchanged: a tooltip is never open there.
|
|
21
|
+
*/
|
|
22
|
+
function LazyTooltip(props) {
|
|
23
|
+
const context = useContext(TooltipContext);
|
|
24
|
+
if (!context) throw new Error("Tooltip must be rendered inside a TooltipTrigger");
|
|
25
|
+
const isOpen = context.state.isOpen;
|
|
26
|
+
const [opened, setOpened] = useState(isOpen);
|
|
27
|
+
if (isOpen && !opened) setOpened(true);
|
|
28
|
+
usePreloadOnIntent(context.triggerRef, tooltip.preload, !opened);
|
|
29
|
+
if (!opened) return null;
|
|
30
|
+
return /* @__PURE__ */ jsx(tooltip.Component, { ...props });
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { LazyTooltip };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=lazy-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-tooltip.js","names":[],"sources":["../../../src/components/tooltip/lazy-tooltip.tsx"],"sourcesContent":["'use client';\n\nimport { useContext, useState } from 'react';\nimport { onDemand, usePreloadOnIntent } from '../../utils/load-on-demand';\nimport type { TooltipProps } from './Tooltip';\nimport { TooltipContext } from './tooltip-trigger';\n\nconst tooltip = onDemand<TooltipProps>(() => import('./Tooltip').then((module) => module.Tooltip));\n\n/** Starts loading the `Tooltip` module, once; later calls return the same promise. */\nexport const preloadTooltip = tooltip.preload;\n\n/**\n * A plain `Tooltip` whose module loads on demand, for components that show a tooltip of their\n * own (an icon button's label, a FAB's): it only appears on hover, keyboard focus or a touch\n * long press, so a page of buttons doesn't carry the tooltip's code up front. It goes inside a\n * `TooltipTrigger` from `./tooltip-trigger`, which works as before: the trigger's state,\n * naming and keyboard handling are all there from the first render.\n *\n * The module starts loading when the pointer moves over the trigger or focus enters it, and\n * at the latest when the tooltip opens; once loaded, every tooltip opens at once. Until the\n * tooltip first opens it renders nothing; if it opens before the module arrives it shows once\n * loaded. Once opened it stays mounted, so it can play its exit. Server rendering is\n * unchanged: a tooltip is never open there.\n */\nexport function LazyTooltip(props: TooltipProps) {\n const context = useContext(TooltipContext);\n if (!context) throw new Error('Tooltip must be rendered inside a TooltipTrigger');\n const isOpen = context.state.isOpen;\n const [opened, setOpened] = useState(isOpen);\n // Set during render, so the first open renders the tooltip in the same pass.\n if (isOpen && !opened) setOpened(true);\n\n // Until it first opens; after that the module is loading or in.\n usePreloadOnIntent(context.triggerRef, tooltip.preload, !opened);\n\n if (!opened) return null;\n return <tooltip.Component {...props} />;\n}\n"],"mappings":";;;;;;AAOA,MAAM,UAAU,eAA6B,OAAO,eAAY,CAAC,MAAM,WAAW,OAAO,OAAO,CAAC;AAGnE,QAAQ;;;;;;;;;;;;;;AAetC,SAAgB,YAAY,OAAqB;CAC/C,MAAM,UAAU,WAAW,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,kDAAkD;CAChF,MAAM,SAAS,QAAQ,MAAM;CAC7B,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAE3C,IAAI,UAAU,CAAC,QAAQ,UAAU,IAAI;CAGrC,mBAAmB,QAAQ,YAAY,QAAQ,SAAS,CAAC,MAAM;CAE/D,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,oBAAC,QAAQ,WAAT,EAAmB,GAAI,MAAQ,CAAA;AACxC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/tooltip/tooltip-placement.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Where a tooltip sits against its anchor. `start` / `end` follow the text direction; a
|
|
4
|
+
* second part aligns the tooltip with that edge of the anchor (`bottom-start` sits below,
|
|
5
|
+
* extending towards the end). Tooltips flip when there's no room.
|
|
6
|
+
*/
|
|
7
|
+
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
8
|
+
/**
|
|
9
|
+
* The default placement of the plain tooltips inside, where a container calls for one other
|
|
10
|
+
* than `top`. App bars provide `bottom` (the spec: "If the element is in an app bar, the plain
|
|
11
|
+
* tooltip appears below the element"), so their icon buttons' tooltips open below. A
|
|
12
|
+
* trigger's own `placement` wins.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TooltipPlacementContext: import("react").Context<TooltipPlacement | null>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=tooltip-placement.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
//#region src/components/tooltip/tooltip-placement.ts
|
|
4
|
+
/**
|
|
5
|
+
* The default placement of the plain tooltips inside, where a container calls for one other
|
|
6
|
+
* than `top`. App bars provide `bottom` (the spec: "If the element is in an app bar, the plain
|
|
7
|
+
* tooltip appears below the element"), so their icon buttons' tooltips open below. A
|
|
8
|
+
* trigger's own `placement` wins.
|
|
9
|
+
*/
|
|
10
|
+
const TooltipPlacementContext = createContext(null);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TooltipPlacementContext };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=tooltip-placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-placement.js","names":[],"sources":["../../../src/components/tooltip/tooltip-placement.ts"],"sourcesContent":["'use client';\n\nimport { createContext } from 'react';\n\n/**\n * Where a tooltip sits against its anchor. `start` / `end` follow the text direction; a\n * second part aligns the tooltip with that edge of the anchor (`bottom-start` sits below,\n * extending towards the end). Tooltips flip when there's no room.\n */\nexport type TooltipPlacement =\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'start'\n | 'end'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end';\n\n/**\n * The default placement of the plain tooltips inside, where a container calls for one other\n * than `top`. App bars provide `bottom` (the spec: \"If the element is in an app bar, the plain\n * tooltip appears below the element\"), so their icon buttons' tooltips open below. A\n * trigger's own `placement` wins.\n */\nexport const TooltipPlacementContext = createContext<TooltipPlacement | null>(null);\n"],"mappings":";;;;;;;;;AA2BA,MAAa,0BAA0B,cAAuC,IAAI"}
|