@windmorph/react 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +149 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/app-bar/AppBarItems.js +23 -0
- package/dist/components/app-bar/AppBarItems.js.map +1 -0
- package/dist/components/app-bar/TopAppBar.d.ts +89 -0
- package/dist/components/app-bar/TopAppBar.js +103 -0
- package/dist/components/app-bar/TopAppBar.js.map +1 -0
- package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
- package/dist/components/app-bar/app-bar-styles.js +142 -0
- package/dist/components/app-bar/app-bar-styles.js.map +1 -0
- package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
- package/dist/components/app-bar/app-bar-tokens.js +64 -0
- package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
- package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
- package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
- package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
- package/dist/components/autocomplete/Autocomplete.js +284 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +71 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/badge-styles.d.ts +100 -0
- package/dist/components/badge/badge-styles.js +43 -0
- package/dist/components/badge/badge-styles.js.map +1 -0
- package/dist/components/badge/badge-tokens.d.ts +7 -0
- package/dist/components/badge/badge-tokens.js +40 -0
- package/dist/components/badge/badge-tokens.js.map +1 -0
- package/dist/components/button/Button.d.ts +91 -0
- package/dist/components/button/Button.js +96 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/ButtonContext.d.ts +30 -0
- package/dist/components/button/ButtonContext.js +18 -0
- package/dist/components/button/ButtonContext.js.map +1 -0
- package/dist/components/button/DensityZeroButtons.js +25 -0
- package/dist/components/button/DensityZeroButtons.js.map +1 -0
- package/dist/components/button/button-pending.d.ts +10 -0
- package/dist/components/button/button-pending.js +166 -0
- package/dist/components/button/button-pending.js.map +1 -0
- package/dist/components/button/button-styles.d.ts +216 -0
- package/dist/components/button/button-styles.js +199 -0
- package/dist/components/button/button-styles.js.map +1 -0
- package/dist/components/button/button-tokens.d.ts +10 -0
- package/dist/components/button/button-tokens.js +257 -0
- package/dist/components/button/button-tokens.js.map +1 -0
- package/dist/components/button/connected-shapes.js +152 -0
- package/dist/components/button/connected-shapes.js.map +1 -0
- package/dist/components/card/Card.d.ts +60 -0
- package/dist/components/card/Card.js +69 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/card/card-styles.d.ts +42 -0
- package/dist/components/card/card-styles.js +64 -0
- package/dist/components/card/card-styles.js.map +1 -0
- package/dist/components/card/card-tokens.d.ts +7 -0
- package/dist/components/card/card-tokens.js +84 -0
- package/dist/components/card/card-tokens.js.map +1 -0
- package/dist/components/carousel/Carousel.d.ts +124 -0
- package/dist/components/carousel/Carousel.js +387 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/carousel-keylines.js +486 -0
- package/dist/components/carousel/carousel-keylines.js.map +1 -0
- package/dist/components/carousel/carousel-press-area.js +35 -0
- package/dist/components/carousel/carousel-press-area.js.map +1 -0
- package/dist/components/carousel/carousel-styles.d.ts +188 -0
- package/dist/components/carousel/carousel-styles.js +116 -0
- package/dist/components/carousel/carousel-styles.js.map +1 -0
- package/dist/components/carousel/carousel-tokens.d.ts +7 -0
- package/dist/components/carousel/carousel-tokens.js +18 -0
- package/dist/components/carousel/carousel-tokens.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +78 -0
- package/dist/components/checkbox/Checkbox.js +77 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox-box.js +34 -0
- package/dist/components/checkbox/checkbox-box.js.map +1 -0
- package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
- package/dist/components/checkbox/checkbox-styles.js +54 -0
- package/dist/components/checkbox/checkbox-styles.js.map +1 -0
- package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
- package/dist/components/checkbox/checkbox-tokens.js +41 -0
- package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
- package/dist/components/chip/Chip.d.ts +171 -0
- package/dist/components/chip/Chip.js +348 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipSet.d.ts +70 -0
- package/dist/components/chip/ChipSet.js +198 -0
- package/dist/components/chip/ChipSet.js.map +1 -0
- package/dist/components/chip/chip-styles.d.ts +263 -0
- package/dist/components/chip/chip-styles.js +360 -0
- package/dist/components/chip/chip-styles.js.map +1 -0
- package/dist/components/chip/chip-tokens.d.ts +13 -0
- package/dist/components/chip/chip-tokens.js +185 -0
- package/dist/components/chip/chip-tokens.js.map +1 -0
- package/dist/components/date-picker/CalendarGrid.js +94 -0
- package/dist/components/date-picker/CalendarGrid.js.map +1 -0
- package/dist/components/date-picker/CompactDateDialog.js +63 -0
- package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
- package/dist/components/date-picker/DateField.d.ts +161 -0
- package/dist/components/date-picker/DateField.js +393 -0
- package/dist/components/date-picker/DateField.js.map +1 -0
- package/dist/components/date-picker/DateInput.d.ts +20 -0
- package/dist/components/date-picker/DateInput.js +99 -0
- package/dist/components/date-picker/DateInput.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +165 -0
- package/dist/components/date-picker/DatePicker.js +492 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/PickerDialog.d.ts +121 -0
- package/dist/components/date-picker/PickerDialog.js +161 -0
- package/dist/components/date-picker/PickerDialog.js.map +1 -0
- package/dist/components/date-picker/calendar-parts.js +141 -0
- package/dist/components/date-picker/calendar-parts.js.map +1 -0
- package/dist/components/date-picker/date-format.js +72 -0
- package/dist/components/date-picker/date-format.js.map +1 -0
- package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
- package/dist/components/date-picker/date-picker-styles.js +163 -0
- package/dist/components/date-picker/date-picker-styles.js.map +1 -0
- package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
- package/dist/components/date-picker/date-picker-tokens.js +104 -0
- package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-context.js +8 -0
- package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
- package/dist/components/date-picker/picker-dialog-styles.js +57 -0
- package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
- package/dist/components/date-picker/picker-icons.js +24 -0
- package/dist/components/date-picker/picker-icons.js.map +1 -0
- package/dist/components/date-picker/use-media-query.js +21 -0
- package/dist/components/date-picker/use-media-query.js.map +1 -0
- package/dist/components/date-picker/use-size-transform.js +62 -0
- package/dist/components/date-picker/use-size-transform.js.map +1 -0
- package/dist/components/date-picker/use-view-exit.js +68 -0
- package/dist/components/date-picker/use-view-exit.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +267 -0
- package/dist/components/dialog/Dialog.js +521 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/dialog-styles.d.ts +335 -0
- package/dist/components/dialog/dialog-styles.js +377 -0
- package/dist/components/dialog/dialog-styles.js.map +1 -0
- package/dist/components/dialog/dialog-tokens.d.ts +7 -0
- package/dist/components/dialog/dialog-tokens.js +57 -0
- package/dist/components/dialog/dialog-tokens.js.map +1 -0
- package/dist/components/divider/Divider.d.ts +59 -0
- package/dist/components/divider/Divider.js +53 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/divider-styles.d.ts +90 -0
- package/dist/components/divider/divider-styles.js +66 -0
- package/dist/components/divider/divider-styles.js.map +1 -0
- package/dist/components/divider/divider-tokens.d.ts +7 -0
- package/dist/components/divider/divider-tokens.js +16 -0
- package/dist/components/divider/divider-tokens.js.map +1 -0
- package/dist/components/fab/Fab.d.ts +130 -0
- package/dist/components/fab/Fab.js +137 -0
- package/dist/components/fab/Fab.js.map +1 -0
- package/dist/components/fab/FabTooltip.js +36 -0
- package/dist/components/fab/FabTooltip.js.map +1 -0
- package/dist/components/fab/fab-styles.d.ts +286 -0
- package/dist/components/fab/fab-styles.js +131 -0
- package/dist/components/fab/fab-styles.js.map +1 -0
- package/dist/components/fab/fab-tokens.d.ts +12 -0
- package/dist/components/fab/fab-tokens.js +105 -0
- package/dist/components/fab/fab-tokens.js.map +1 -0
- package/dist/components/fab-menu/FabMenu.d.ts +156 -0
- package/dist/components/fab-menu/FabMenu.js +291 -0
- package/dist/components/fab-menu/FabMenu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
- package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
- package/dist/components/fab-menu/fab-menu-styles.js +107 -0
- package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
- package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
- package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
- package/dist/components/icon-button/IconButton.d.ts +125 -0
- package/dist/components/icon-button/IconButton.js +112 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
- package/dist/components/icon-button/icon-button-styles.js +244 -0
- package/dist/components/icon-button/icon-button-styles.js.map +1 -0
- package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
- package/dist/components/icon-button/icon-button-tokens.js +215 -0
- package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
- package/dist/components/list/List.d.ts +265 -0
- package/dist/components/list/List.js +1386 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/ListMedia.d.ts +88 -0
- package/dist/components/list/ListMedia.js +132 -0
- package/dist/components/list/ListMedia.js.map +1 -0
- package/dist/components/list/list-styles.d.ts +375 -0
- package/dist/components/list/list-styles.js +220 -0
- package/dist/components/list/list-styles.js.map +1 -0
- package/dist/components/list/list-tokens.d.ts +7 -0
- package/dist/components/list/list-tokens.js +92 -0
- package/dist/components/list/list-tokens.js.map +1 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
- package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +215 -0
- package/dist/components/menu/Menu.js +715 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/menu-styles.d.ts +354 -0
- package/dist/components/menu/menu-styles.js +219 -0
- package/dist/components/menu/menu-styles.js.map +1 -0
- package/dist/components/menu/menu-tokens.d.ts +7 -0
- package/dist/components/menu/menu-tokens.js +93 -0
- package/dist/components/menu/menu-tokens.js.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +51 -0
- package/dist/components/menu/menu-trigger.js +100 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/use-reveal-entering.js +42 -0
- package/dist/components/menu/use-reveal-entering.js.map +1 -0
- package/dist/components/navigation/NavItem.d.ts +54 -0
- package/dist/components/navigation/NavItem.js +182 -0
- package/dist/components/navigation/NavItem.js.map +1 -0
- package/dist/components/navigation/NavigationBar.d.ts +64 -0
- package/dist/components/navigation/NavigationBar.js +121 -0
- package/dist/components/navigation/NavigationBar.js.map +1 -0
- package/dist/components/navigation/NavigationRail.d.ts +91 -0
- package/dist/components/navigation/NavigationRail.js +285 -0
- package/dist/components/navigation/NavigationRail.js.map +1 -0
- package/dist/components/navigation/nav-item-styles.d.ts +190 -0
- package/dist/components/navigation/nav-item-styles.js +123 -0
- package/dist/components/navigation/nav-item-styles.js.map +1 -0
- package/dist/components/navigation/navigation-styles.d.ts +239 -0
- package/dist/components/navigation/navigation-styles.js +134 -0
- package/dist/components/navigation/navigation-styles.js.map +1 -0
- package/dist/components/navigation/navigation-tokens.d.ts +9 -0
- package/dist/components/navigation/navigation-tokens.js +114 -0
- package/dist/components/navigation/navigation-tokens.js.map +1 -0
- package/dist/components/navigation/use-hide-on-scroll.js +115 -0
- package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
- package/dist/components/navigation/use-item-arrow-keys.js +37 -0
- package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
- package/dist/components/navigation/use-rail-item-morph.js +61 -0
- package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
- package/dist/components/progress/ProgressIndicator.d.ts +95 -0
- package/dist/components/progress/ProgressIndicator.js +426 -0
- package/dist/components/progress/ProgressIndicator.js.map +1 -0
- package/dist/components/progress/progress-geometry.js +285 -0
- package/dist/components/progress/progress-geometry.js.map +1 -0
- package/dist/components/progress/progress-styles.d.ts +81 -0
- package/dist/components/progress/progress-styles.js +43 -0
- package/dist/components/progress/progress-styles.js.map +1 -0
- package/dist/components/progress/progress-tokens.d.ts +7 -0
- package/dist/components/progress/progress-tokens.js +39 -0
- package/dist/components/progress/progress-tokens.js.map +1 -0
- package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +121 -0
- package/dist/components/radio/RadioGroup.js +163 -0
- package/dist/components/radio/RadioGroup.js.map +1 -0
- package/dist/components/radio/radio-ring.js +21 -0
- package/dist/components/radio/radio-ring.js.map +1 -0
- package/dist/components/radio/radio-styles.d.ts +155 -0
- package/dist/components/radio/radio-styles.js +60 -0
- package/dist/components/radio/radio-styles.js.map +1 -0
- package/dist/components/radio/radio-tokens.d.ts +7 -0
- package/dist/components/radio/radio-tokens.js +31 -0
- package/dist/components/radio/radio-tokens.js.map +1 -0
- package/dist/components/search/SearchAppBar.d.ts +45 -0
- package/dist/components/search/SearchAppBar.js +61 -0
- package/dist/components/search/SearchAppBar.js.map +1 -0
- package/dist/components/search/SearchBar.d.ts +147 -0
- package/dist/components/search/SearchBar.js +412 -0
- package/dist/components/search/SearchBar.js.map +1 -0
- package/dist/components/search/search-styles.d.ts +243 -0
- package/dist/components/search/search-styles.js +143 -0
- package/dist/components/search/search-styles.js.map +1 -0
- package/dist/components/search/search-tokens.d.ts +9 -0
- package/dist/components/search/search-tokens.js +70 -0
- package/dist/components/search/search-tokens.js.map +1 -0
- package/dist/components/select/Select.d.ts +187 -0
- package/dist/components/select/Select.js +319 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/field-shell.d.ts +29 -0
- package/dist/components/select/field-shell.js +135 -0
- package/dist/components/select/field-shell.js.map +1 -0
- package/dist/components/select/option-list.d.ts +81 -0
- package/dist/components/select/option-list.js +291 -0
- package/dist/components/select/option-list.js.map +1 -0
- package/dist/components/select/search-list.js +135 -0
- package/dist/components/select/search-list.js.map +1 -0
- package/dist/components/select/selection-cap.js +30 -0
- package/dist/components/select/selection-cap.js.map +1 -0
- package/dist/components/sheet/BottomSheet.d.ts +154 -0
- package/dist/components/sheet/BottomSheet.js +442 -0
- package/dist/components/sheet/BottomSheet.js.map +1 -0
- package/dist/components/sheet/SheetTrigger.d.ts +25 -0
- package/dist/components/sheet/SheetTrigger.js +46 -0
- package/dist/components/sheet/SheetTrigger.js.map +1 -0
- package/dist/components/sheet/SideSheet.d.ts +139 -0
- package/dist/components/sheet/SideSheet.js +289 -0
- package/dist/components/sheet/SideSheet.js.map +1 -0
- package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
- package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
- package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
- package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
- package/dist/components/sheet/sheet-gesture.js +48 -0
- package/dist/components/sheet/sheet-gesture.js.map +1 -0
- package/dist/components/sheet/sheet-icons.js +31 -0
- package/dist/components/sheet/sheet-icons.js.map +1 -0
- package/dist/components/sheet/sheet-settle.js +58 -0
- package/dist/components/sheet/sheet-settle.js.map +1 -0
- package/dist/components/sheet/sheet-styles.d.ts +312 -0
- package/dist/components/sheet/sheet-styles.js +229 -0
- package/dist/components/sheet/sheet-styles.js.map +1 -0
- package/dist/components/sheet/sheet-tokens.d.ts +12 -0
- package/dist/components/sheet/sheet-tokens.js +115 -0
- package/dist/components/sheet/sheet-tokens.js.map +1 -0
- package/dist/components/sheet/side-swipe-gesture.js +22 -0
- package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
- package/dist/components/sheet/use-peek-inert.js +32 -0
- package/dist/components/sheet/use-peek-inert.js.map +1 -0
- package/dist/components/sheet/use-side-swipe.js +174 -0
- package/dist/components/sheet/use-side-swipe.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +129 -0
- package/dist/components/slider/Slider.js +295 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/slider-geometry.js +138 -0
- package/dist/components/slider/slider-geometry.js.map +1 -0
- package/dist/components/slider/slider-styles.d.ts +133 -0
- package/dist/components/slider/slider-styles.js +97 -0
- package/dist/components/slider/slider-styles.js.map +1 -0
- package/dist/components/slider/slider-tokens.d.ts +7 -0
- package/dist/components/slider/slider-tokens.js +66 -0
- package/dist/components/slider/slider-tokens.js.map +1 -0
- package/dist/components/slider/use-touch-track.js +138 -0
- package/dist/components/slider/use-touch-track.js.map +1 -0
- package/dist/components/snackbar/Snackbar.d.ts +96 -0
- package/dist/components/snackbar/Snackbar.js +253 -0
- package/dist/components/snackbar/Snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar-state.d.ts +58 -0
- package/dist/components/snackbar/snackbar-state.js +73 -0
- package/dist/components/snackbar/snackbar-state.js.map +1 -0
- package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
- package/dist/components/snackbar/snackbar-styles.js +67 -0
- package/dist/components/snackbar/snackbar-styles.js.map +1 -0
- package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
- package/dist/components/snackbar/snackbar-tokens.js +54 -0
- package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +109 -0
- package/dist/components/split-button/SplitButton.js +195 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/split-button-styles.d.ts +214 -0
- package/dist/components/split-button/split-button-styles.js +164 -0
- package/dist/components/split-button/split-button-styles.js.map +1 -0
- package/dist/components/split-button/split-button-tokens.d.ts +7 -0
- package/dist/components/split-button/split-button-tokens.js +36 -0
- package/dist/components/split-button/split-button-tokens.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +82 -0
- package/dist/components/switch/Switch.js +165 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/switch-styles.d.ts +96 -0
- package/dist/components/switch/switch-styles.js +68 -0
- package/dist/components/switch/switch-styles.js.map +1 -0
- package/dist/components/switch/switch-thumb.js +41 -0
- package/dist/components/switch/switch-thumb.js.map +1 -0
- package/dist/components/switch/switch-tokens.d.ts +7 -0
- package/dist/components/switch/switch-tokens.js +78 -0
- package/dist/components/switch/switch-tokens.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +120 -0
- package/dist/components/tabs/Tabs.js +346 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/tabs-styles.d.ts +198 -0
- package/dist/components/tabs/tabs-styles.js +99 -0
- package/dist/components/tabs/tabs-styles.js.map +1 -0
- package/dist/components/tabs/tabs-tokens.d.ts +7 -0
- package/dist/components/tabs/tabs-tokens.js +121 -0
- package/dist/components/tabs/tabs-tokens.js.map +1 -0
- package/dist/components/text-field/TextField.d.ts +175 -0
- package/dist/components/text-field/TextField.js +250 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/text-field-styles.d.ts +252 -0
- package/dist/components/text-field/text-field-styles.js +209 -0
- package/dist/components/text-field/text-field-styles.js.map +1 -0
- package/dist/components/text-field/text-field-tokens.d.ts +7 -0
- package/dist/components/text-field/text-field-tokens.js +177 -0
- package/dist/components/text-field/text-field-tokens.js.map +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +142 -0
- package/dist/components/time-picker/TimePicker.js +700 -0
- package/dist/components/time-picker/TimePicker.js.map +1 -0
- package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
- package/dist/components/time-picker/time-picker-styles.js +112 -0
- package/dist/components/time-picker/time-picker-styles.js.map +1 -0
- package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
- package/dist/components/time-picker/time-picker-tokens.js +86 -0
- package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +209 -0
- package/dist/components/toolbar/Toolbar.js +282 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
- package/dist/components/toolbar/toolbar-styles.js +253 -0
- package/dist/components/toolbar/toolbar-styles.js.map +1 -0
- package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
- package/dist/components/toolbar/toolbar-tokens.js +117 -0
- package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +131 -0
- package/dist/components/tooltip/Tooltip.js +388 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/lazy-tooltip.js +35 -0
- package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
- package/dist/components/tooltip/tooltip-placement.js +14 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
- package/dist/components/tooltip/tooltip-styles.js +81 -0
- package/dist/components/tooltip/tooltip-styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
- package/dist/components/tooltip/tooltip-tokens.js +72 -0
- package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
- package/dist/components/tooltip/tooltip-trigger.js +115 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
- package/dist/composites/button-group/ButtonGroup.js +270 -0
- package/dist/composites/button-group/ButtonGroup.js.map +1 -0
- package/dist/composites/button-group/button-group-styles.d.ts +73 -0
- package/dist/composites/button-group/button-group-styles.js +87 -0
- package/dist/composites/button-group/button-group-styles.js.map +1 -0
- package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
- package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
- package/dist/composites/button-group/overflow-menu-list.js +26 -0
- package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
- package/dist/composites/button-group/use-overflow.js +75 -0
- package/dist/composites/button-group/use-overflow.js.map +1 -0
- package/dist/composites/button-group/use-press-expansion.js +155 -0
- package/dist/composites/button-group/use-press-expansion.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +136 -0
- package/dist/motion/get-m3-spring.d.ts +6 -0
- package/dist/motion/get-m3-spring.js +10 -0
- package/dist/motion/get-m3-spring.js.map +1 -0
- package/dist/motion/reduced-motion.js +19 -0
- package/dist/motion/reduced-motion.js.map +1 -0
- package/dist/motion/use-m3-spring.d.ts +13 -0
- package/dist/motion/use-m3-spring.js +22 -0
- package/dist/motion/use-m3-spring.js.map +1 -0
- package/dist/next/NextRouterProvider.d.ts +13 -0
- package/dist/next/NextRouterProvider.js +26 -0
- package/dist/next/NextRouterProvider.js.map +1 -0
- package/dist/next/get-theme-from-cookies.d.ts +32 -0
- package/dist/next/get-theme-from-cookies.js +27 -0
- package/dist/next/get-theme-from-cookies.js.map +1 -0
- package/dist/next/navigation-guard.d.ts +30 -0
- package/dist/next/navigation-guard.js +68 -0
- package/dist/next/navigation-guard.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.js +5 -0
- package/dist/primitives/ButtonBase.d.ts +115 -0
- package/dist/primitives/ButtonBase.js +231 -0
- package/dist/primitives/ButtonBase.js.map +1 -0
- package/dist/primitives/DomDirectionLocale.d.ts +18 -0
- package/dist/primitives/DomDirectionLocale.js +28 -0
- package/dist/primitives/DomDirectionLocale.js.map +1 -0
- package/dist/primitives/Field.d.ts +50 -0
- package/dist/primitives/Field.js +74 -0
- package/dist/primitives/Field.js.map +1 -0
- package/dist/primitives/IconFaces.js +23 -0
- package/dist/primitives/IconFaces.js.map +1 -0
- package/dist/primitives/Overlay.d.ts +39 -0
- package/dist/primitives/Overlay.js +86 -0
- package/dist/primitives/Overlay.js.map +1 -0
- package/dist/primitives/SelectionControl.d.ts +55 -0
- package/dist/primitives/SelectionControl.js +58 -0
- package/dist/primitives/SelectionControl.js.map +1 -0
- package/dist/primitives/Surface.d.ts +123 -0
- package/dist/primitives/Surface.js +68 -0
- package/dist/primitives/Surface.js.map +1 -0
- package/dist/primitives/ToolbarContext.js +12 -0
- package/dist/primitives/ToolbarContext.js.map +1 -0
- package/dist/primitives/TouchTarget.d.ts +14 -0
- package/dist/primitives/TouchTarget.js +20 -0
- package/dist/primitives/TouchTarget.js.map +1 -0
- package/dist/primitives/TriggerContext.d.ts +34 -0
- package/dist/primitives/TriggerContext.js +24 -0
- package/dist/primitives/TriggerContext.js.map +1 -0
- package/dist/primitives/hidden-input-focus.js +27 -0
- package/dist/primitives/hidden-input-focus.js.map +1 -0
- package/dist/primitives/icon-faces-styles.d.ts +9 -0
- package/dist/primitives/icon-faces-styles.js +45 -0
- package/dist/primitives/icon-faces-styles.js.map +1 -0
- package/dist/primitives/locale-with-direction.d.ts +9 -0
- package/dist/primitives/locale-with-direction.js +17 -0
- package/dist/primitives/locale-with-direction.js.map +1 -0
- package/dist/primitives/morph-path.d.ts +25 -0
- package/dist/primitives/morph-path.js +38 -0
- package/dist/primitives/morph-path.js.map +1 -0
- package/dist/primitives/selection-control-styles.d.ts +54 -0
- package/dist/primitives/selection-control-styles.js +44 -0
- package/dist/primitives/selection-control-styles.js.map +1 -0
- package/dist/primitives/use-m3-interaction.d.ts +51 -0
- package/dist/primitives/use-m3-interaction.js +149 -0
- package/dist/primitives/use-m3-interaction.js.map +1 -0
- package/dist/primitives/use-m3-morph.d.ts +18 -0
- package/dist/primitives/use-m3-morph.js +36 -0
- package/dist/primitives/use-m3-morph.js.map +1 -0
- package/dist/primitives/use-presence.d.ts +19 -0
- package/dist/primitives/use-presence.js +37 -0
- package/dist/primitives/use-presence.js.map +1 -0
- package/dist/primitives.d.ts +36 -0
- package/dist/primitives.js +34 -0
- package/dist/shapes/corner-rounding.d.ts +13 -0
- package/dist/shapes/corner-rounding.js +18 -0
- package/dist/shapes/corner-rounding.js.map +1 -0
- package/dist/shapes/cubic.d.ts +52 -0
- package/dist/shapes/cubic.js +189 -0
- package/dist/shapes/cubic.js.map +1 -0
- package/dist/shapes/feature-mapping.js +80 -0
- package/dist/shapes/feature-mapping.js.map +1 -0
- package/dist/shapes/features.d.ts +23 -0
- package/dist/shapes/features.js +82 -0
- package/dist/shapes/features.js.map +1 -0
- package/dist/shapes/float-mapping.js +65 -0
- package/dist/shapes/float-mapping.js.map +1 -0
- package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
- package/dist/shapes/generated/material-shape-path-record.js +48 -0
- package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
- package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
- package/dist/shapes/generated/material-shape-paths.js +218 -0
- package/dist/shapes/generated/material-shape-paths.js.map +1 -0
- package/dist/shapes/mask.d.ts +14 -0
- package/dist/shapes/mask.js +24 -0
- package/dist/shapes/mask.js.map +1 -0
- package/dist/shapes/material-shapes.d.ts +11 -0
- package/dist/shapes/material-shapes.js +250 -0
- package/dist/shapes/material-shapes.js.map +1 -0
- package/dist/shapes/morph.d.ts +25 -0
- package/dist/shapes/morph.js +97 -0
- package/dist/shapes/morph.js.map +1 -0
- package/dist/shapes/path.d.ts +33 -0
- package/dist/shapes/path.js +47 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/point.d.ts +28 -0
- package/dist/shapes/point.js +103 -0
- package/dist/shapes/point.js.map +1 -0
- package/dist/shapes/polygon-measure.js +140 -0
- package/dist/shapes/polygon-measure.js.map +1 -0
- package/dist/shapes/rounded-polygon.d.ts +44 -0
- package/dist/shapes/rounded-polygon.js +278 -0
- package/dist/shapes/rounded-polygon.js.map +1 -0
- package/dist/shapes/shape-path.d.ts +15 -0
- package/dist/shapes/shapes.d.ts +53 -0
- package/dist/shapes/shapes.js +171 -0
- package/dist/shapes/shapes.js.map +1 -0
- package/dist/styles/generated/components.css +710 -0
- package/dist/styles/generated/theme.css +247 -0
- package/dist/styles/generated/themes.css +3361 -0
- package/dist/styles/generated/tokens.css +284 -0
- package/dist/styles/styles.css +15 -0
- package/dist/styles/utilities.css +283 -0
- package/dist/styles.compiled.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +72 -0
- package/dist/theme/ThemeProvider.js +144 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScope.d.ts +32 -0
- package/dist/theme/ThemeScope.js +67 -0
- package/dist/theme/ThemeScope.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +26 -0
- package/dist/theme/ThemeScript.js +44 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/context.d.ts +32 -0
- package/dist/theme/context.js +47 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/create-theme.d.ts +60 -0
- package/dist/theme/create-theme.js +47 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/css.js +54 -0
- package/dist/theme/css.js.map +1 -0
- package/dist/theme/parse-palettes.js +40 -0
- package/dist/theme/parse-palettes.js.map +1 -0
- package/dist/theme/scheme.d.ts +6 -0
- package/dist/theme/scheme.js +118 -0
- package/dist/theme/scheme.js.map +1 -0
- package/dist/theme/state.d.ts +38 -0
- package/dist/theme/state.js +93 -0
- package/dist/theme/state.js.map +1 -0
- package/dist/theme/storage.js +21 -0
- package/dist/theme/storage.js.map +1 -0
- package/dist/tokens/breakpoints.d.ts +15 -0
- package/dist/tokens/breakpoints.js +16 -0
- package/dist/tokens/breakpoints.js.map +1 -0
- package/dist/tokens/color.d.ts +104 -0
- package/dist/tokens/color.js +147 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/component.d.ts +110 -0
- package/dist/tokens/component.js +67 -0
- package/dist/tokens/component.js.map +1 -0
- package/dist/tokens/density.d.ts +20 -0
- package/dist/tokens/density.js +27 -0
- package/dist/tokens/density.js.map +1 -0
- package/dist/tokens/elevation.d.ts +44 -0
- package/dist/tokens/elevation.js +45 -0
- package/dist/tokens/elevation.js.map +1 -0
- package/dist/tokens/motion.d.ts +79 -0
- package/dist/tokens/motion.js +126 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/shape.d.ts +22 -0
- package/dist/tokens/shape.js +22 -0
- package/dist/tokens/shape.js.map +1 -0
- package/dist/tokens/spring-velocity.d.ts +19 -0
- package/dist/tokens/spring-velocity.js +44 -0
- package/dist/tokens/spring-velocity.js.map +1 -0
- package/dist/tokens/state.d.ts +18 -0
- package/dist/tokens/state.js +19 -0
- package/dist/tokens/state.js.map +1 -0
- package/dist/tokens/typography.d.ts +64 -0
- package/dist/tokens/typography.js +60 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/z-index.d.ts +17 -0
- package/dist/tokens/z-index.js +18 -0
- package/dist/tokens/z-index.js.map +1 -0
- package/dist/utils/announce.js +51 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/assert-collection-children.js +26 -0
- package/dist/utils/assert-collection-children.js.map +1 -0
- package/dist/utils/closed-by.d.ts +9 -0
- package/dist/utils/closed-by.js +12 -0
- package/dist/utils/closed-by.js.map +1 -0
- package/dist/utils/cn.d.ts +31 -0
- package/dist/utils/cn.js +37 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/composite-keys.js +32 -0
- package/dist/utils/composite-keys.js.map +1 -0
- package/dist/utils/focus-visible.js +14 -0
- package/dist/utils/focus-visible.js.map +1 -0
- package/dist/utils/focus.js +51 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/focusable-disabled.js +12 -0
- package/dist/utils/focusable-disabled.js.map +1 -0
- package/dist/utils/keep-pressed-in-place.d.ts +60 -0
- package/dist/utils/keep-pressed-in-place.js +127 -0
- package/dist/utils/keep-pressed-in-place.js.map +1 -0
- package/dist/utils/load-on-demand.js +111 -0
- package/dist/utils/load-on-demand.js.map +1 -0
- package/dist/utils/merge-data-tokens.d.ts +9 -0
- package/dist/utils/merge-data-tokens.js +15 -0
- package/dist/utils/merge-data-tokens.js.map +1 -0
- package/dist/utils/natural-size.js +53 -0
- package/dist/utils/natural-size.js.map +1 -0
- package/dist/utils/nearest-reveal.js +28 -0
- package/dist/utils/nearest-reveal.js.map +1 -0
- package/dist/utils/placement.js +14 -0
- package/dist/utils/placement.js.map +1 -0
- package/dist/utils/radio-group-keys.js +74 -0
- package/dist/utils/radio-group-keys.js.map +1 -0
- package/dist/utils/rendered-description.js +17 -0
- package/dist/utils/rendered-description.js.map +1 -0
- package/dist/utils/root-props.d.ts +103 -0
- package/dist/utils/root-props.js +51 -0
- package/dist/utils/root-props.js.map +1 -0
- package/dist/utils/search.d.ts +11 -0
- package/dist/utils/search.js +18 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/shortcut.js +20 -0
- package/dist/utils/shortcut.js.map +1 -0
- package/dist/utils/split-data-attributes.d.ts +12 -0
- package/dist/utils/split-data-attributes.js +20 -0
- package/dist/utils/split-data-attributes.js.map +1 -0
- package/dist/utils/toolbar-keys.js +28 -0
- package/dist/utils/toolbar-keys.js.map +1 -0
- package/dist/utils/tv.d.ts +7 -0
- package/dist/utils/tv.js +9 -0
- package/dist/utils/tv.js.map +1 -0
- package/dist/utils/typeahead.js +64 -0
- package/dist/utils/typeahead.js.map +1 -0
- package/dist/utils/warn-once.js +30 -0
- package/dist/utils/warn-once.js.map +1 -0
- package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
- package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
- package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
- package/dist/vendor/material-color-utilities/index.js +51 -0
- package/dist/vendor/material-color-utilities/index.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
- package/dist/vendor/material-color-utilities/score/score.js +115 -0
- package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
- package/package.json +114 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","names":["Overlay"],"sources":["../../../src/components/search/SearchBar.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ComponentProps,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport { useReducedMotion } from 'motion/react';\nimport {\n mergeProps,\n mergeRefs,\n useDialog,\n useFocusRing,\n useModalOverlay,\n useObjectRef,\n} from 'react-aria';\nimport { useOverlayTriggerState, type OverlayTriggerState } from 'react-stately';\nimport { useControlledState } from 'react-stately/useControlledState';\nimport { Overlay } from '../../primitives/Overlay';\nimport { usePresence } from '../../primitives/use-presence';\nimport { cn } from '../../utils/cn';\nimport {\n pickDescriptionAria,\n splitRootProps,\n type WrapperRootDOMProps,\n} from '../../utils/root-props';\nimport { ButtonContext, standardIconButtons } from '../button/ButtonContext';\nimport { COMPACT_WINDOW, useMediaQuery } from '../date-picker/use-media-query';\nimport { searchBarStyles } from './search-styles';\n\n/** Set by `SearchAppBar` for the search bar inside it. */\nexport const SearchAppBarContext = createContext<{ scrolled: boolean } | null>(null);\n\n/** What a search bar's icons can depend on. */\nexport interface SearchBarIconState {\n expanded: boolean;\n /** Collapses the search view, e.g. from a back button. */\n collapse: () => void;\n /**\n * The view in effect (`auto` resolved for the window), so a back button can show in the\n * full-screen view only.\n */\n view: 'docked' | 'full-screen';\n}\n\ntype SearchBarIcon = ReactNode | ((state: SearchBarIconState) => ReactNode);\n\nexport interface SearchBarClassNames {\n /** The outer container, merged with `className`. */\n root?: string;\n /** The pill around the icons and the input (collapsed and expanded). */\n field?: string;\n /** The text input (collapsed and expanded). */\n input?: string;\n /** The leading icon slot. */\n leading?: string;\n /** The trailing icon slot. */\n trailing?: string;\n /** The scrim behind the docked view. */\n scrim?: string;\n /** The expanded view: the docked panel or the full-screen surface. */\n view?: string;\n /** The expanded content: the docked dropdown or the full-screen content area. */\n content?: string;\n}\n\ntype Naming =\n | {\n /** Accessible name for the search bar and its input. Required unless `aria-labelledby` is set. */\n 'aria-label': string;\n }\n | {\n /** The id of the element that names the search bar and its input. Required unless `aria-label` is set. */\n 'aria-labelledby': string;\n };\n\n/**\n * Attributes for the search inputs, e.g. `aria-keyshortcuts`, `aria-describedby`,\n * `enterKeyHint`, `autoComplete`, `spellCheck`, `inputMode` or event handlers. The bar owns\n * its value, name, role and popup state, so those keys are left out; an `id` or `name`\n * would be duplicated, since the bar renders a second input while expanded.\n */\nexport type SearchBarInputProps = Omit<\n ComponentProps<'input'>,\n | 'ref'\n | 'id'\n | 'name'\n | 'type'\n | 'role'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'placeholder'\n | 'className'\n | 'children'\n | 'dangerouslySetInnerHTML'\n | 'inert'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-expanded'\n | 'aria-haspopup'\n | 'aria-controls'\n | 'aria-hidden'\n> & {\n [data: `data-${string}`]: string | number | boolean | undefined;\n};\n\ninterface SearchBarOwnProps extends WrapperRootDOMProps {\n /** The root element's id. */\n id?: string;\n /**\n * The ids of elements that describe the search, for both inputs (the bar's and the open\n * view's), before any `inputProps['aria-describedby']`.\n */\n 'aria-describedby'?: string;\n /** The id of an element with more details about the search, for both inputs. */\n 'aria-details'?: string;\n /** Controlled query. */\n value?: string;\n /** Initial query when uncontrolled. @default \"\" */\n defaultValue?: string;\n /** Called with the query as it changes. */\n onChange?: (value: string) => void;\n /**\n * Called with the query when the user presses Enter (the keyboard's search action) in the\n * open search view. Enter in the collapsed bar opens the view.\n */\n onSubmit?: (value: string) => void;\n /** Controlled expansion of the search view. */\n expanded?: boolean;\n /** Whether the search view starts expanded (uncontrolled). @default false */\n defaultExpanded?: boolean;\n /** Called when the search view expands or collapses. */\n onExpandedChange?: (expanded: boolean) => void;\n /**\n * How the bar expands: `docked`, a dropdown below it over a scrim; `full-screen`, a view\n * that fills the window; `auto`, full screen on compact windows (below 600px wide) and\n * docked on larger ones, as M3 recommends (\"Full-screen layout: Default for compact\n * breakpoints\"; docked is \"Best for medium and expanded windows\"). It follows the window\n * as it resizes.\n * @default \"auto\"\n */\n view?: SearchBarView;\n /** Hint text shown in the empty input, e.g. \"Search mail\". */\n placeholder?: string;\n /** Leading icon, e.g. a search icon, or a back button while expanded. */\n leadingIcon?: SearchBarIcon;\n /**\n * Trailing content: one or two icon buttons (e.g. voice search and a clear button), or an\n * avatar (an `img`, drawn at 30px) with up to one icon button (M3).\n */\n trailingIcon?: SearchBarIcon;\n /**\n * Centre the placeholder and the query while the bar is collapsed (M3's search app bar\n * supports centred text). @default \"start\"\n */\n textAlign?: 'start' | 'center';\n /**\n * What screen readers hear when the suggestions or results change while the view is open\n * (M3: \"the screen reader must announce the change\"), e.g. \"5 results\". Announced\n * politely whenever it changes.\n */\n resultsAnnouncement?: string;\n /**\n * The expanded content: suggestions or results, usually a list. ↓ from the input moves\n * focus into it.\n */\n children?: ReactNode;\n /** The input element (collapsed, or expanded while the view is open). */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * Attributes for both inputs, the collapsed one and the expanded view's. They replace the\n * bar's defaults (`enterKeyHint=\"search\"`, `autoComplete=\"off\"`, `spellCheck={false}`);\n * event handlers run before the bar's own, and the bar's role, name, value and popup state\n * always win.\n */\n inputProps?: SearchBarInputProps;\n /** Ref to the root `<div>` element. */\n ref?: Ref<HTMLDivElement>;\n /** Classes for the root element, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Inline styles for the root element. */\n style?: CSSProperties;\n /** Classes for each part, by slot. */\n classNames?: SearchBarClassNames;\n /** `data-*` attributes, like the other DOM attributes, go to the root. */\n [data: `data-${string}`]: string | number | boolean | undefined;\n}\n\nexport type SearchBarProps = SearchBarOwnProps & Naming;\n\n/** How a {@link SearchBar} expands. */\nexport type SearchBarView = 'auto' | 'docked' | 'full-screen';\n\ninterface BarRect {\n top: number;\n left: number;\n right: number;\n bottom: number;\n width: number;\n height: number;\n rtl: boolean;\n}\n\n/** How far the docked field widens on each side when focused (24dp → 12dp margins). */\nconst FOCUSED_GROWTH = 12;\n/** The search bar's maximum width (M3). */\nconst MAX_WIDTH = 720;\n/** The focused search bar's height (M3: \"Search bar container Height 56dp\"). */\nconst FIELD_HEIGHT = 56;\n\nconst FOCUSABLE =\n 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * M3 Expressive search bar: a 56px pill that expands into a search view, either a dropdown\n * below the bar (docked) or a full-screen view, holding suggestions or results. Pressing\n * the bar, typing into it or ↓ expands it; Escape, a press outside or `collapse()` closes it.\n *\n * @example\n * <SearchBar aria-label=\"Search mail\" placeholder=\"Search mail\" leadingIcon={<SearchIcon />}\n * value={query} onChange={setQuery} onSubmit={search}>\n * <SuggestionList … />\n * </SearchBar>\n */\nexport function SearchBar(props: SearchBarProps) {\n const {\n value,\n defaultValue,\n onChange,\n onSubmit,\n expanded,\n defaultExpanded,\n onExpandedChange,\n view: requestedView = 'auto',\n placeholder,\n leadingIcon,\n trailingIcon,\n textAlign = 'start',\n resultsAnnouncement,\n children,\n inputRef,\n inputProps: consumerInputProps,\n ref,\n className,\n style,\n classNames,\n ...rest\n } = props;\n const { 'aria-label': label, 'aria-labelledby': labelledBy } = props as {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n };\n // The server and the first client render see a docked view, so hydration matches.\n const compact = useMediaQuery(COMPACT_WINDOW);\n const view = requestedView === 'auto' ? (compact ? 'full-screen' : 'docked') : requestedView;\n const [query, setQuery] = useControlledState(value, defaultValue ?? '', onChange);\n const state = useOverlayTriggerState({\n isOpen: expanded,\n defaultOpen: defaultExpanded,\n onOpenChange: onExpandedChange,\n });\n const appBar = useContext(SearchAppBarContext);\n const rootRef = useObjectRef(ref);\n const [rect, setRect] = useState<BarRect | null>(null);\n // The views grow from the bar as `--m3-search-progress` runs; under reduced motion they\n // only fade (the scrim, or the full-screen view).\n const reduceMotion = useReducedMotion();\n const { isPresent, isExiting, exitProps } = usePresence(\n state.isOpen,\n reduceMotion ? 'opacity' : '--m3-search-progress',\n );\n\n // As the view starts leaving, focus goes back at once to what had it when the view opened\n // (WAI-ARIA: a closing dialog returns focus to what opened it), not when the view unmounts\n // ~450ms later: typing meanwhile reaches the bar, which opens the view again (2026-10-17).\n // That's the bar's input when the bar opened it, and whatever had focus when an app's\n // shortcut did (a link stays focused after ⌘K and Escape); the bar's input otherwise.\n const collapsedRef = useRef<HTMLInputElement>(null);\n const collapsedInputRef = useMemo(\n () => mergeRefs(collapsedRef, isPresent ? undefined : inputRef),\n [isPresent, inputRef],\n );\n // Read before the view's input takes focus (a passive effect) and before React Aria's\n // focus scope would restore it on unmount, which this hand-over replaces.\n const restoreRef = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n const doc = collapsedRef.current?.ownerDocument;\n if (!state.isOpen || !doc) return;\n const active = doc.activeElement;\n restoreRef.current = active instanceof HTMLElement && active !== doc.body ? active : null;\n }, [state.isOpen]);\n useEffect(() => {\n const collapsed = collapsedRef.current;\n if (!isExiting || !collapsed) return;\n // Only from inside the leaving view: a press outside that moved focus elsewhere keeps it.\n if (!collapsed.ownerDocument.activeElement?.closest('[data-exiting]')) return;\n const previous = restoreRef.current;\n const target =\n previous?.isConnected && !previous.closest('[data-exiting]') ? previous : collapsed;\n target.focus({ preventScroll: true });\n }, [isExiting]);\n\n // The expanded view starts from the bar's bounds; measure them when it opens.\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!state.isOpen || !root) return;\n const box = root.getBoundingClientRect();\n setRect({\n top: box.top,\n left: box.left,\n right: box.right,\n bottom: box.bottom,\n width: box.width,\n height: box.height,\n rtl: getComputedStyle(root).direction === 'rtl',\n });\n }, [state.isOpen, rootRef]);\n\n const iconState: SearchBarIconState = { expanded: state.isOpen, collapse: state.close, view };\n const leading = typeof leadingIcon === 'function' ? leadingIcon(iconState) : leadingIcon;\n const trailing = typeof trailingIcon === 'function' ? trailingIcon(iconState) : trailingIcon;\n const styles = searchBarStyles({\n inAppBar: appBar != null,\n hasLeading: leading != null,\n hasTrailing: trailing != null,\n });\n const { root: data, rest: own } = splitRootProps(rest, { wrapper: true });\n // The naming attributes describe the inputs, as `aria-label` names them.\n const { 'aria-describedby': describedBy, 'aria-details': details } = own;\n const describedByInput =\n [describedBy, consumerInputProps?.['aria-describedby']].filter(Boolean).join(' ') || undefined;\n // In an app bar the collapsed field is `surface-container`; the expanded view's field\n // keeps the search view's own `surface-container-high`.\n const collapsedTone = appBar ? (appBar.scrolled ? 'scrolled' : 'appBar') : 'default';\n\n const field = (input: ReactNode, tone: 'default' | 'appBar' | 'scrolled') => (\n <SearchField\n className={searchBarStyles({ tone }).field({ class: classNames?.field })}\n leading={\n leading != null && (\n <span data-slot=\"leading\" className={styles.leading({ class: classNames?.leading })}>\n {leading}\n </span>\n )\n }\n trailing={\n trailing != null && (\n <span data-slot=\"trailing\" className={styles.trailing({ class: classNames?.trailing })}>\n {trailing}\n </span>\n )\n }\n >\n {input}\n </SearchField>\n );\n\n // The consumer's attributes replace the defaults; the bar's own keys always win, and\n // `mergeProps` chains event handlers (the consumer's first).\n const sharedInputProps = (handlers: ComponentProps<'input'>): ComponentProps<'input'> => ({\n ...mergeProps(\n {\n enterKeyHint: 'search',\n autoComplete: 'off',\n spellCheck: false,\n 'aria-details': details,\n ...pickDescriptionAria(own),\n },\n consumerInputProps,\n { 'aria-describedby': describedByInput },\n handlers,\n ),\n id: undefined,\n name: undefined,\n role: undefined,\n type: 'search',\n value: query,\n placeholder,\n 'aria-label': label,\n 'aria-labelledby': label == null ? labelledBy : undefined,\n });\n const inputClass = (align: 'start' | 'center') =>\n searchBarStyles({\n hasLeading: leading != null,\n hasTrailing: trailing != null,\n textAlign: align,\n }).input({ class: classNames?.input });\n\n const submitOnEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' && !event.nativeEvent.isComposing) {\n event.preventDefault();\n onSubmit?.(query);\n return true;\n }\n return false;\n };\n\n return (\n <div\n {...data}\n id={(own as { id?: string }).id}\n ref={rootRef}\n style={style}\n data-expanded={state.isOpen || undefined}\n data-view={view}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n {field(\n <input\n {...sharedInputProps({\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n const next = event.target.value;\n // Compose expands the bar as the user types into it.\n if (next.length > query.length) state.open();\n setQuery(next);\n },\n onClick: state.open,\n // Enter and ↓ open the search view, as a click does (Compose expands the bar\n // as its field takes focus); the query is submitted from the open view.\n onKeyDown: (event) => {\n const enter = event.key === 'Enter' && !event.nativeEvent.isComposing;\n if (enter || event.key === 'ArrowDown') {\n event.preventDefault();\n state.open();\n }\n },\n })}\n data-slot=\"input\"\n className={inputClass(textAlign)}\n // The consumer's `inputRef` follows whichever input is live.\n ref={collapsedInputRef}\n // Live again as soon as the view starts leaving: a press or typing on the bar\n // while the view leaves (its parts take no presses) opens it again from where it\n // is, instead of being swallowed for the ~450ms of the exit (2026-10-17).\n inert={state.isOpen}\n aria-hidden={state.isOpen || undefined}\n // A combobox whose popup is the search view's dialog (ARIA 1.2).\n role=\"combobox\"\n aria-expanded={state.isOpen}\n aria-haspopup=\"dialog\"\n />,\n collapsedTone,\n )}\n {isPresent && rect && (\n <Overlay exiting={isExiting}>\n <SearchView\n view={view}\n state={state}\n rect={rect}\n animateHeight={!reduceMotion}\n isExiting={isExiting}\n exitProps={exitProps}\n label={label}\n labelledBy={labelledBy}\n classNames={classNames}\n styles={styles}\n resultsAnnouncement={resultsAnnouncement}\n field={(contentRef) =>\n field(\n <ExpandedInput\n {...sharedInputProps({\n onChange: (event) => setQuery(event.target.value),\n onKeyDown: (event) => {\n // M3: once results are queried, the query stays visible but not\n // focused; focus moves to the results.\n if (submitOnEnter(event)) {\n contentRef.current?.focus();\n return;\n }\n if (event.key === 'ArrowDown') {\n const first = contentRef.current?.querySelector<HTMLElement>(FOCUSABLE);\n if (first) {\n event.preventDefault();\n first.focus();\n }\n }\n },\n })}\n data-slot=\"input\"\n className={inputClass('start')}\n inputRef={inputRef}\n open={state.isOpen}\n />,\n 'default',\n )\n }\n >\n {children}\n </SearchView>\n </Overlay>\n )}\n </div>\n );\n}\n\nfunction SearchField({\n className,\n leading,\n trailing,\n children,\n}: {\n className: string;\n leading: ReactNode;\n trailing: ReactNode;\n children: ReactNode;\n}) {\n // The pill shows the inset focus ring while its input has keyboard focus.\n const { isFocusVisible, focusProps } = useFocusRing({ within: true, isTextInput: true });\n return (\n <div\n {...focusProps}\n data-tokens=\"md-comp-search-bar\"\n data-focus-visible={isFocusVisible || undefined}\n className={className}\n >\n {/* Icon buttons in a search bar are standard (M3), not the filled default. */}\n <ButtonContext value={standardIconButtons}>\n {leading}\n {children}\n {trailing}\n </ButtonContext>\n </div>\n );\n}\n\nfunction ExpandedInput({\n inputRef,\n open,\n ...props\n}: Omit<ComponentProps<'input'>, 'ref'> & {\n inputRef?: Ref<HTMLInputElement>;\n /** The view is open (not leaving): reopened while leaving, the input takes focus again. */\n open: boolean;\n}) {\n const ref = useObjectRef(inputRef);\n // Take focus when the view opens, with the caret after the query.\n useEffect(() => {\n const input = ref.current;\n if (!input || !open) return;\n input.focus({ preventScroll: true });\n input.setSelectionRange(input.value.length, input.value.length);\n }, [ref, open]);\n return <input {...props} ref={ref} />;\n}\n\nfunction SearchView({\n view,\n state,\n rect,\n animateHeight,\n isExiting,\n exitProps,\n label,\n labelledBy,\n classNames,\n styles,\n field,\n resultsAnnouncement,\n children,\n}: {\n view: 'docked' | 'full-screen';\n state: OverlayTriggerState;\n rect: BarRect;\n /** Whether the dropdown's height follows its content on a spring (not under reduced motion). */\n animateHeight: boolean;\n isExiting: boolean;\n exitProps: ReturnType<typeof usePresence>['exitProps'];\n label?: string;\n labelledBy?: string;\n classNames?: SearchBarClassNames;\n styles: ReturnType<typeof searchBarStyles>;\n field: (contentRef: RefObject<HTMLDivElement | null>) => ReactNode;\n resultsAnnouncement?: string;\n children: ReactNode;\n}) {\n const panelRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const contentSizeRef = useRef<HTMLDivElement>(null);\n useContentHeight(\n contentRef,\n contentSizeRef,\n view === 'docked' && animateHeight && children != null,\n );\n const { modalProps, underlayProps } = useModalOverlay(\n { isDismissable: !isExiting },\n state,\n panelRef,\n );\n const { dialogProps } = useDialog(\n { 'aria-label': label, 'aria-labelledby': label == null ? labelledBy : undefined },\n panelRef,\n );\n const exiting = isExiting || undefined;\n const panelProps = mergeProps(modalProps, dialogProps, { tabIndex: -1 });\n\n if (view === 'full-screen') {\n const vars = {\n '--m3-search-top': `${rect.top}px`,\n '--m3-search-left': `${rect.left}px`,\n '--m3-search-right': `${window.innerWidth - rect.right}px`,\n '--m3-search-bottom': `${window.innerHeight - rect.bottom}px`,\n '--m3-search-start': `${rect.rtl ? window.innerWidth - rect.right : rect.left}px`,\n '--m3-search-width': `${rect.width}px`,\n '--m3-search-height': `${rect.height}px`,\n } as CSSProperties;\n return (\n <div\n {...panelProps}\n {...exitProps}\n ref={panelRef}\n style={vars}\n data-tokens=\"md-comp-search-view\"\n data-view=\"full-screen\"\n data-exiting={exiting}\n className={styles.fullScreenPanel({ class: classNames?.view })}\n >\n <div data-exiting={exiting} className={styles.fullScreenHeader()}>\n {field(contentRef)}\n </div>\n <div\n ref={contentRef}\n tabIndex={-1}\n data-exiting={exiting}\n className={styles.fullScreenContent({ class: classNames?.content })}\n >\n {children}\n </div>\n <LiveStatus message={resultsAnnouncement} />\n </div>\n );\n }\n // The docked field widens by 12px on each side (M3 Expressive: margins 24dp → 12dp),\n // staying within the window and, unless the bar is wider already, 720px.\n const width = Math.min(rect.width + 2 * FOCUSED_GROWTH, Math.max(rect.width, MAX_WIDTH));\n const grow = (width - rect.width) / 2;\n const left = Math.max(0, Math.min(rect.left - grow, window.innerWidth - width));\n // The focused field is 56px whatever the collapsed bar's height (a consumer `h-*`),\n // centred on the bar and kept within the window.\n const top = Math.max(0, rect.top + (rect.height - FIELD_HEIGHT) / 2);\n // The panel morphs from the bar's bounds by these deltas (`dockedPanel`).\n const dockedVars = {\n '--m3-search-top': `${rect.top}px`,\n '--m3-search-left': `${rect.left}px`,\n '--m3-search-width': `${rect.width}px`,\n '--m3-search-height': `${rect.height}px`,\n '--m3-search-dx': `${left - rect.left}px`,\n '--m3-search-dy': `${top - rect.top}px`,\n '--m3-search-dw': `${Math.min(width, window.innerWidth) - rect.width}px`,\n '--m3-search-dh': `${FIELD_HEIGHT - rect.height}px`,\n } as CSSProperties;\n\n return (\n <>\n {/* Presence ends on the scrim's fade under reduced motion, else on the panel's motion. */}\n <div\n {...exitProps}\n aria-hidden=\"true\"\n data-exiting={exiting}\n className={styles.scrim({ class: classNames?.scrim })}\n />\n <div {...underlayProps} data-exiting={exiting} className={styles.underlay()}>\n <div\n {...panelProps}\n {...exitProps}\n ref={panelRef}\n style={dockedVars}\n data-exiting={exiting}\n className={styles.dockedPanel({ class: classNames?.view })}\n >\n <div className={styles.dockedHeader()}>{field(contentRef)}</div>\n {children != null && (\n <div\n ref={contentRef}\n tabIndex={-1}\n data-tokens=\"md-comp-search-view\"\n data-view=\"docked\"\n data-exiting={exiting}\n className={styles.dropdown({ class: classNames?.content })}\n >\n {/* Measured, so the dropdown's height can follow it (`useContentHeight`). */}\n <div ref={contentSizeRef} className=\"flow-root\">\n {children}\n </div>\n </div>\n )}\n <LiveStatus message={resultsAnnouncement} />\n </div>\n </div>\n </>\n );\n}\n\n/**\n * Keeps `--m3-search-content-height` on the dropdown at its content's height (plus the\n * dropdown's own padding and borders), so the dropdown's height animates as the results\n * change instead of jumping. While that height animates the dropdown doesn't scroll\n * (`data-resizing`), so a scrollbar never flashes in and rewraps the content.\n */\nfunction useContentHeight(\n dropdownRef: RefObject<HTMLDivElement | null>,\n contentRef: RefObject<HTMLDivElement | null>,\n enabled: boolean,\n) {\n useLayoutEffect(() => {\n const dropdown = dropdownRef.current;\n const content = contentRef.current;\n if (!enabled || !dropdown || !content) return;\n let measured = Number.NaN;\n const measure = () => {\n const style = getComputedStyle(dropdown);\n const frame =\n parseFloat(style.paddingTop) +\n parseFloat(style.paddingBottom) +\n parseFloat(style.borderTopWidth) +\n parseFloat(style.borderBottomWidth);\n const height = content.getBoundingClientRect().height + frame;\n // The content's box shifts by a fraction of a pixel as the panel moves; only a real\n // change of size restarts the height's spring.\n if (Math.abs(height - measured) < 0.5) return;\n measured = height;\n dropdown.style.setProperty('--m3-search-content-height', `${height}px`);\n };\n const resizing = (on: boolean) => (event: TransitionEvent) => {\n if (event.target !== dropdown || event.propertyName !== 'height') return;\n if (on) dropdown.dataset.resizing = '';\n else delete dropdown.dataset.resizing;\n };\n const start = resizing(true);\n const end = resizing(false);\n measure();\n dropdown.addEventListener('transitionrun', start);\n dropdown.addEventListener('transitionend', end);\n dropdown.addEventListener('transitioncancel', end);\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure);\n observer?.observe(content);\n return () => {\n observer?.disconnect();\n dropdown.removeEventListener('transitionrun', start);\n dropdown.removeEventListener('transitionend', end);\n dropdown.removeEventListener('transitioncancel', end);\n dropdown.style.removeProperty('--m3-search-content-height');\n delete dropdown.dataset.resizing;\n };\n }, [dropdownRef, contentRef, enabled]);\n}\n\n/**\n * A polite live region inside the search view. It starts empty and takes the message a\n * moment later, so the first one is announced too, and again whenever it changes.\n */\nfunction LiveStatus({ message }: { message?: string }) {\n const [text, setText] = useState('');\n useEffect(() => {\n const timer = setTimeout(() => setText(message ?? ''), 150);\n return () => clearTimeout(timer);\n }, [message]);\n return (\n <div role=\"status\" className=\"sr-only\">\n {text}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,MAAa,sBAAsB,cAA4C,IAAI;;AAgLnF,MAAM,YAAY;;AAElB,MAAM,eAAe;AAErB,MAAM,YACJ;;;;;;;;;;;;AAaF,SAAgB,UAAU,OAAuB;CAC/C,MAAM,EACJ,OACA,cACA,UACA,UACA,UACA,iBACA,kBACA,MAAM,gBAAgB,QACtB,aACA,aACA,cACA,YAAY,SACZ,qBACA,UACA,UACA,YAAY,oBACZ,KACA,WACA,OACA,YACA,GAAG,SACD;CACJ,MAAM,EAAE,cAAc,OAAO,mBAAmB,eAAe;CAK/D,MAAM,UAAU,cAAc,cAAc;CAC5C,MAAM,OAAO,kBAAkB,SAAU,UAAU,gBAAgB,WAAY;CAC/E,MAAM,CAAC,OAAO,YAAY,mBAAmB,OAAO,gBAAgB,IAAI,QAAQ;CAChF,MAAM,QAAQ,uBAAuB;EACnC,QAAQ;EACR,aAAa;EACb,cAAc;CAChB,CAAC;CACD,MAAM,SAAS,WAAW,mBAAmB;CAC7C,MAAM,UAAU,aAAa,GAAG;CAChC,MAAM,CAAC,MAAM,WAAW,SAAyB,IAAI;CAGrD,MAAM,eAAe,iBAAiB;CACtC,MAAM,EAAE,WAAW,WAAW,cAAc,YAC1C,MAAM,QACN,eAAe,YAAY,sBAC7B;CAOA,MAAM,eAAe,OAAyB,IAAI;CAClD,MAAM,oBAAoB,cAClB,UAAU,cAAc,YAAY,KAAA,IAAY,QAAQ,GAC9D,CAAC,WAAW,QAAQ,CACtB;CAGA,MAAM,aAAa,OAA2B,IAAI;CAClD,sBAAsB;EACpB,MAAM,MAAM,aAAa,SAAS;EAClC,IAAI,CAAC,MAAM,UAAU,CAAC,KAAK;EAC3B,MAAM,SAAS,IAAI;EACnB,WAAW,UAAU,kBAAkB,eAAe,W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AiB,UAA2B;GAC5D,IAAI,MAAM,WAAW,YAAY,MAAM,iBAAiB,UAAU;GAClE,IAAI,IAAI,SAAS,QAAQ,WAAW;QAC/B,OAAO,SAAS,QAAQ;EAC/B;EACA,MAAM,QAAQ,SAAS,IAAI;EAC3B,MAAM,MAAM,SAAS,KAAK;EAC1B,QAAQ;EACR,SAAS,iBAAiB,iBAAiB,KAAK;EAChD,SAAS,iBAAiB,iBAAiB,GAAG;EAC9C,SAAS,iBAAiB,oBAAoB,GAAG;EACjD,MAAM,WAAW,OAAO,mBAAmB,cAAc,OAAO,IAAI,eAAe,OAAO;EAC1F,UAAU,QAAQ,OAAO;EACzB,aAAa;GACX,UAAU,WAAW;GACrB,SAAS,oBAAoB,iBAAiB,KAAK;GACnD,SAAS,oBAAoB,iBAAiB,GAAG;GACjD,SAAS,oBAAoB,oBAAoB,GAAG;GACpD,SAAS,MAAM,eAAe,4BAA4B;GAC1D,OAAO,SAAS,QAAQ;EAC1B;CACF,GAAG;EAAC;EAAa;EAAY;CAAO,CAAC;AACvC;;;;;AAMA,SAAS,WAAW,EAAE,WAAiC;CACrD,MAAM,CAAC,MAAM,WAAW,SAAS,EAAE;CACnC,gBAAgB;EACd,MAAM,QAAQ,iBAAiB,QAAQ,WAAW,EAAE,GAAG,GAAG;EAC1D,aAAa,aAAa,KAAK;CACjC,GAAG,CAAC,OAAO,CAAC;CACZ,OACE,oBAAC,OAAD;EAAK,MAAK;EAAS,WAAU;EAC1B,UAAA;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { VariantProps } from "../../utils/tv.js";
|
|
2
|
+
//#region src/components/search/search-styles.d.ts
|
|
3
|
+
/** Variant definitions for {@link SearchBar}; extend them to add variants. */
|
|
4
|
+
export declare const searchBarStyles: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
/**
|
|
6
|
+
* Inside a search app bar the bar fills the free space up to 312px, then grows to half
|
|
7
|
+
* of it (M3), up to 720px.
|
|
8
|
+
*/
|
|
9
|
+
inAppBar: {
|
|
10
|
+
true: {
|
|
11
|
+
root: string;
|
|
12
|
+
};
|
|
13
|
+
false: {};
|
|
14
|
+
};
|
|
15
|
+
hasLeading: {
|
|
16
|
+
true: {
|
|
17
|
+
input: string;
|
|
18
|
+
};
|
|
19
|
+
false: {
|
|
20
|
+
input: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
hasTrailing: {
|
|
24
|
+
true: {
|
|
25
|
+
input: string;
|
|
26
|
+
};
|
|
27
|
+
false: {
|
|
28
|
+
input: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Container colour: the bar's own; in a search app bar `surface-container`, and one
|
|
33
|
+
* step higher than the bar once content scrolls under it.
|
|
34
|
+
*/
|
|
35
|
+
tone: {
|
|
36
|
+
default: {
|
|
37
|
+
field: string;
|
|
38
|
+
};
|
|
39
|
+
appBar: {
|
|
40
|
+
field: string;
|
|
41
|
+
};
|
|
42
|
+
scrolled: {
|
|
43
|
+
field: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/** Centre the placeholder and the query while the bar is collapsed. */
|
|
47
|
+
textAlign: {
|
|
48
|
+
start: {};
|
|
49
|
+
center: {
|
|
50
|
+
input: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
root: string;
|
|
55
|
+
field: string[];
|
|
56
|
+
leading: string;
|
|
57
|
+
trailing: string[];
|
|
58
|
+
input: string[];
|
|
59
|
+
scrim: string[];
|
|
60
|
+
dockedPanel: string[];
|
|
61
|
+
underlay: string;
|
|
62
|
+
dockedHeader: string;
|
|
63
|
+
dropdown: string[];
|
|
64
|
+
fullScreenPanel: string[];
|
|
65
|
+
fullScreenHeader: string[];
|
|
66
|
+
fullScreenContent: string[];
|
|
67
|
+
}, undefined, {
|
|
68
|
+
/**
|
|
69
|
+
* Inside a search app bar the bar fills the free space up to 312px, then grows to half
|
|
70
|
+
* of it (M3), up to 720px.
|
|
71
|
+
*/
|
|
72
|
+
inAppBar: {
|
|
73
|
+
true: {
|
|
74
|
+
root: string;
|
|
75
|
+
};
|
|
76
|
+
false: {};
|
|
77
|
+
};
|
|
78
|
+
hasLeading: {
|
|
79
|
+
true: {
|
|
80
|
+
input: string;
|
|
81
|
+
};
|
|
82
|
+
false: {
|
|
83
|
+
input: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
hasTrailing: {
|
|
87
|
+
true: {
|
|
88
|
+
input: string;
|
|
89
|
+
};
|
|
90
|
+
false: {
|
|
91
|
+
input: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Container colour: the bar's own; in a search app bar `surface-container`, and one
|
|
96
|
+
* step higher than the bar once content scrolls under it.
|
|
97
|
+
*/
|
|
98
|
+
tone: {
|
|
99
|
+
default: {
|
|
100
|
+
field: string;
|
|
101
|
+
};
|
|
102
|
+
appBar: {
|
|
103
|
+
field: string;
|
|
104
|
+
};
|
|
105
|
+
scrolled: {
|
|
106
|
+
field: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/** Centre the placeholder and the query while the bar is collapsed. */
|
|
110
|
+
textAlign: {
|
|
111
|
+
start: {};
|
|
112
|
+
center: {
|
|
113
|
+
input: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
root: string;
|
|
118
|
+
field: string[];
|
|
119
|
+
leading: string;
|
|
120
|
+
trailing: string[];
|
|
121
|
+
input: string[];
|
|
122
|
+
scrim: string[];
|
|
123
|
+
dockedPanel: string[];
|
|
124
|
+
underlay: string;
|
|
125
|
+
dockedHeader: string;
|
|
126
|
+
dropdown: string[];
|
|
127
|
+
fullScreenPanel: string[];
|
|
128
|
+
fullScreenHeader: string[];
|
|
129
|
+
fullScreenContent: string[];
|
|
130
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
131
|
+
/**
|
|
132
|
+
* Inside a search app bar the bar fills the free space up to 312px, then grows to half
|
|
133
|
+
* of it (M3), up to 720px.
|
|
134
|
+
*/
|
|
135
|
+
inAppBar: {
|
|
136
|
+
true: {
|
|
137
|
+
root: string;
|
|
138
|
+
};
|
|
139
|
+
false: {};
|
|
140
|
+
};
|
|
141
|
+
hasLeading: {
|
|
142
|
+
true: {
|
|
143
|
+
input: string;
|
|
144
|
+
};
|
|
145
|
+
false: {
|
|
146
|
+
input: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
hasTrailing: {
|
|
150
|
+
true: {
|
|
151
|
+
input: string;
|
|
152
|
+
};
|
|
153
|
+
false: {
|
|
154
|
+
input: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Container colour: the bar's own; in a search app bar `surface-container`, and one
|
|
159
|
+
* step higher than the bar once content scrolls under it.
|
|
160
|
+
*/
|
|
161
|
+
tone: {
|
|
162
|
+
default: {
|
|
163
|
+
field: string;
|
|
164
|
+
};
|
|
165
|
+
appBar: {
|
|
166
|
+
field: string;
|
|
167
|
+
};
|
|
168
|
+
scrolled: {
|
|
169
|
+
field: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
/** Centre the placeholder and the query while the bar is collapsed. */
|
|
173
|
+
textAlign: {
|
|
174
|
+
start: {};
|
|
175
|
+
center: {
|
|
176
|
+
input: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
}, {
|
|
180
|
+
root: string;
|
|
181
|
+
field: string[];
|
|
182
|
+
leading: string;
|
|
183
|
+
trailing: string[];
|
|
184
|
+
input: string[];
|
|
185
|
+
scrim: string[];
|
|
186
|
+
dockedPanel: string[];
|
|
187
|
+
underlay: string;
|
|
188
|
+
dockedHeader: string;
|
|
189
|
+
dropdown: string[];
|
|
190
|
+
fullScreenPanel: string[];
|
|
191
|
+
fullScreenHeader: string[];
|
|
192
|
+
fullScreenContent: string[];
|
|
193
|
+
}>>;
|
|
194
|
+
/** Variant definitions for {@link SearchAppBar}. */
|
|
195
|
+
export declare const searchAppBarStyles: import("tailwind-variants").TVReturnType<{
|
|
196
|
+
scrolling: {
|
|
197
|
+
true: {
|
|
198
|
+
root: string;
|
|
199
|
+
};
|
|
200
|
+
false: {};
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
root: string[];
|
|
204
|
+
navigation: string;
|
|
205
|
+
search: string;
|
|
206
|
+
actions: string;
|
|
207
|
+
}, undefined, {
|
|
208
|
+
scrolling: {
|
|
209
|
+
true: {
|
|
210
|
+
root: string;
|
|
211
|
+
};
|
|
212
|
+
false: {};
|
|
213
|
+
};
|
|
214
|
+
}, {
|
|
215
|
+
root: string[];
|
|
216
|
+
navigation: string;
|
|
217
|
+
search: string;
|
|
218
|
+
actions: string;
|
|
219
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
220
|
+
scrolling: {
|
|
221
|
+
true: {
|
|
222
|
+
root: string;
|
|
223
|
+
};
|
|
224
|
+
false: {};
|
|
225
|
+
};
|
|
226
|
+
}, {
|
|
227
|
+
root: string[];
|
|
228
|
+
navigation: string;
|
|
229
|
+
search: string;
|
|
230
|
+
actions: string;
|
|
231
|
+
}>>;
|
|
232
|
+
/**
|
|
233
|
+
* The variants of {@link searchBarStyles}, for building on its styles. They are the recipe's keys, not
|
|
234
|
+
* component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
|
|
235
|
+
*/
|
|
236
|
+
export type SearchBarStyleProps = VariantProps<typeof searchBarStyles>;
|
|
237
|
+
/**
|
|
238
|
+
* The variants of {@link searchAppBarStyles}, for building on its styles. They are the recipe's keys, not
|
|
239
|
+
* component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
|
|
240
|
+
*/
|
|
241
|
+
export type SearchAppBarStyleProps = VariantProps<typeof searchAppBarStyles>;
|
|
242
|
+
//#endregion
|
|
243
|
+
//# sourceMappingURL=search-styles.d.ts.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { tv } from "../../utils/tv.js";
|
|
2
|
+
//#region src/components/search/search-styles.ts
|
|
3
|
+
const contentFade = ["opacity-100 starting:opacity-0 data-exiting:opacity-0", "[transition-delay:0s,50ms] data-exiting:[transition-delay:0s,0s]"];
|
|
4
|
+
/** Variant definitions for {@link SearchBar}; extend them to add variants. */
|
|
5
|
+
const searchBarStyles = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "flex h-[56px] w-[360px] max-w-[min(720px,100%)] shrink-0",
|
|
8
|
+
field: ["focus-ring-inset flex h-full w-full min-w-0 items-center rounded-[var(--_md-comp-search-bar-container-shape)] text-on-surface", "forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]"],
|
|
9
|
+
leading: "ms-[4px] flex size-[48px] shrink-0 items-center justify-center text-[color:var(--_md-comp-search-bar-leading-icon-color)] [--md-comp-icon-button-icon-color:currentColor] [&>svg]:size-[24px]",
|
|
10
|
+
trailing: ["me-[4px] flex h-[48px] min-w-[48px] shrink-0 items-center justify-center gap-[8px] px-[4px] text-[color:var(--_md-comp-search-bar-trailing-icon-color)] [--md-comp-icon-button-icon-color:currentColor]", "[&>svg]:size-[24px] [&>img]:size-[30px] [&>img]:rounded-full"],
|
|
11
|
+
input: [
|
|
12
|
+
"h-full min-w-0 flex-1 bg-transparent text-body-large text-[color:var(--_md-comp-search-bar-input-text-color)] caret-primary outline-none",
|
|
13
|
+
"placeholder:text-on-surface-variant",
|
|
14
|
+
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none"
|
|
15
|
+
],
|
|
16
|
+
scrim: [
|
|
17
|
+
"fixed inset-0 z-(--md-sys-z-scrim) bg-scrim/32 opacity-100 data-exiting:pointer-events-none",
|
|
18
|
+
"[transition-property:opacity]",
|
|
19
|
+
"[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]",
|
|
20
|
+
"[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]",
|
|
21
|
+
"starting:opacity-0 data-exiting:opacity-0"
|
|
22
|
+
],
|
|
23
|
+
dockedPanel: [
|
|
24
|
+
"fixed z-(--md-sys-z-sheet) flex flex-col outline-none data-exiting:pointer-events-none",
|
|
25
|
+
"[--m3-search-progress:1] [--m3-search-p:max(0,var(--m3-search-progress))]",
|
|
26
|
+
"motion-safe:starting:[--m3-search-progress:0] motion-safe:data-exiting:[--m3-search-progress:0]",
|
|
27
|
+
"top-[calc(var(--m3-search-top)_+_var(--m3-search-p)_*_var(--m3-search-dy))]",
|
|
28
|
+
"left-[calc(var(--m3-search-left)_+_var(--m3-search-p)_*_var(--m3-search-dx))]",
|
|
29
|
+
"w-[calc(var(--m3-search-width)_+_var(--m3-search-p)_*_var(--m3-search-dw))]",
|
|
30
|
+
"[transition-property:--m3-search-progress]",
|
|
31
|
+
"[transition-duration:var(--md-sys-motion-spring-spatial-default-duration)]",
|
|
32
|
+
"[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing)]"
|
|
33
|
+
],
|
|
34
|
+
underlay: "fixed inset-0 z-(--md-sys-z-sheet) data-exiting:pointer-events-none",
|
|
35
|
+
dockedHeader: "flex h-[calc(var(--m3-search-height)_+_var(--m3-search-p)_*_var(--m3-search-dh))] shrink-0",
|
|
36
|
+
dropdown: [
|
|
37
|
+
"mt-[2px] overflow-y-auto overscroll-contain data-resizing:overflow-y-hidden data-exiting:pointer-events-none",
|
|
38
|
+
"min-h-[min(182px,calc(66.67dvh-58px))] max-h-[calc(66.67dvh-58px)]",
|
|
39
|
+
"h-[clamp(min(182px,calc(66.67dvh_-_58px)),var(--m3-search-content-height),calc(66.67dvh_-_58px))]",
|
|
40
|
+
"rounded-[var(--_md-comp-search-view-docked-container-shape)] bg-[var(--_md-comp-search-view-container-color)] text-on-surface",
|
|
41
|
+
"forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]",
|
|
42
|
+
"translate-y-0 motion-safe:starting:-translate-y-1/2 motion-safe:data-exiting:-translate-y-1/2",
|
|
43
|
+
"[transition-property:translate,opacity,height]",
|
|
44
|
+
"[transition-duration:var(--md-sys-motion-spring-spatial-default-duration),100ms,var(--md-sys-motion-spring-spatial-default-duration)]",
|
|
45
|
+
"[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing),cubic-bezier(0.3,0,1,1),var(--md-sys-motion-spring-spatial-default-easing)]",
|
|
46
|
+
"data-exiting:[transition-duration:var(--md-sys-motion-spring-spatial-fast-duration),100ms,var(--md-sys-motion-spring-spatial-fast-duration)]",
|
|
47
|
+
"data-exiting:[transition-timing-function:var(--md-sys-motion-spring-spatial-fast-easing),cubic-bezier(0,0,0,1),var(--md-sys-motion-spring-spatial-fast-easing)]",
|
|
48
|
+
...contentFade
|
|
49
|
+
],
|
|
50
|
+
fullScreenPanel: [
|
|
51
|
+
"fixed inset-0 z-(--md-sys-z-sheet) bg-[var(--_md-comp-search-view-container-color)] text-on-surface outline-none data-exiting:pointer-events-none",
|
|
52
|
+
"[--m3-search-progress:1] [--m3-search-p:clamp(0,var(--m3-search-progress),1)]",
|
|
53
|
+
"motion-safe:starting:[--m3-search-progress:0] motion-safe:data-exiting:[--m3-search-progress:0]",
|
|
54
|
+
"[clip-path:inset(calc((1_-_var(--m3-search-p))_*_var(--m3-search-top))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-right))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-bottom))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-left))_round_calc((1_-_var(--m3-search-p))_*_28px))]",
|
|
55
|
+
"motion-safe:[transition-property:--m3-search-progress]",
|
|
56
|
+
"motion-safe:[transition-duration:var(--md-sys-motion-spring-spatial-slow-duration)]",
|
|
57
|
+
"motion-safe:[transition-timing-function:var(--md-sys-motion-spring-spatial-slow-easing)]",
|
|
58
|
+
"motion-safe:data-exiting:[transition-duration:var(--md-sys-motion-spring-spatial-default-duration)]",
|
|
59
|
+
"motion-safe:data-exiting:[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing)]",
|
|
60
|
+
"motion-reduce:starting:opacity-0 motion-reduce:data-exiting:opacity-0",
|
|
61
|
+
"motion-reduce:[transition-property:opacity]",
|
|
62
|
+
"motion-reduce:[transition-duration:var(--md-sys-motion-spring-effects-fast-duration)]",
|
|
63
|
+
"motion-reduce:[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing)]"
|
|
64
|
+
],
|
|
65
|
+
fullScreenHeader: [
|
|
66
|
+
"absolute",
|
|
67
|
+
"start-[calc(var(--m3-search-start)_+_var(--m3-search-p)_*_(16px_-_var(--m3-search-start)))]",
|
|
68
|
+
"top-[calc(var(--m3-search-top)_+_var(--m3-search-p)_*_(8px_-_var(--m3-search-top)))]",
|
|
69
|
+
"w-[calc(var(--m3-search-width)_+_var(--m3-search-p)_*_(100%_-_32px_-_var(--m3-search-width)))]",
|
|
70
|
+
"h-[calc(var(--m3-search-height)_+_var(--m3-search-p)_*_(56px_-_var(--m3-search-height)))]"
|
|
71
|
+
],
|
|
72
|
+
fullScreenContent: [
|
|
73
|
+
"absolute inset-x-0 top-[72px] bottom-0 overflow-y-auto overscroll-contain",
|
|
74
|
+
"[transition-property:opacity] [transition-duration:100ms]",
|
|
75
|
+
"[transition-timing-function:cubic-bezier(0.3,0,1,1)]",
|
|
76
|
+
"data-exiting:[transition-timing-function:cubic-bezier(0,0,0,1)]",
|
|
77
|
+
...contentFade
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
variants: {
|
|
81
|
+
/**
|
|
82
|
+
* Inside a search app bar the bar fills the free space up to 312px, then grows to half
|
|
83
|
+
* of it (M3), up to 720px.
|
|
84
|
+
*/
|
|
85
|
+
inAppBar: {
|
|
86
|
+
true: { root: "w-[max(min(100%,312px),50%)]" },
|
|
87
|
+
false: {}
|
|
88
|
+
},
|
|
89
|
+
hasLeading: {
|
|
90
|
+
true: { input: "ps-[4px]" },
|
|
91
|
+
false: { input: "ps-[16px]" }
|
|
92
|
+
},
|
|
93
|
+
hasTrailing: {
|
|
94
|
+
true: { input: "pe-[4px]" },
|
|
95
|
+
false: { input: "pe-[16px]" }
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Container colour: the bar's own; in a search app bar `surface-container`, and one
|
|
99
|
+
* step higher than the bar once content scrolls under it.
|
|
100
|
+
*/
|
|
101
|
+
tone: {
|
|
102
|
+
default: { field: "bg-[var(--_md-comp-search-bar-container-color)]" },
|
|
103
|
+
appBar: { field: "bg-surface-container" },
|
|
104
|
+
scrolled: { field: "bg-surface-container-highest" }
|
|
105
|
+
},
|
|
106
|
+
/** Centre the placeholder and the query while the bar is collapsed. */
|
|
107
|
+
textAlign: {
|
|
108
|
+
start: {},
|
|
109
|
+
center: { input: "text-center" }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
defaultVariants: {
|
|
113
|
+
inAppBar: false,
|
|
114
|
+
hasLeading: false,
|
|
115
|
+
hasTrailing: false,
|
|
116
|
+
tone: "default",
|
|
117
|
+
textAlign: "start"
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
/** Variant definitions for {@link SearchAppBar}. */
|
|
121
|
+
const searchAppBarStyles = tv({
|
|
122
|
+
slots: {
|
|
123
|
+
root: [
|
|
124
|
+
"flex min-h-[64px] w-full items-center text-on-surface",
|
|
125
|
+
"bg-[var(--_md-comp-app-bar-container-color)] data-scrolled:bg-[var(--_md-comp-app-bar-on-scroll-container-color)]",
|
|
126
|
+
"[transition-property:background-color]",
|
|
127
|
+
"[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]",
|
|
128
|
+
"[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]"
|
|
129
|
+
],
|
|
130
|
+
navigation: "flex shrink-0 items-center ps-[8px] pe-[4px] text-[color:var(--_md-comp-app-bar-leading-icon-color)] [--md-comp-icon-button-icon-color:currentColor]",
|
|
131
|
+
search: "flex min-w-0 flex-1 justify-center ps-[8px] pe-[8px] pt-[4px] pb-[4px]",
|
|
132
|
+
actions: "flex shrink-0 items-center gap-[8px] ps-[4px] pe-[8px] text-[color:var(--_md-comp-app-bar-trailing-icon-color)] [--md-comp-icon-button-icon-color:currentColor]"
|
|
133
|
+
},
|
|
134
|
+
variants: { scrolling: {
|
|
135
|
+
true: { root: "sticky top-(--m3-app-bar-offset) z-(--md-sys-z-sticky)" },
|
|
136
|
+
false: {}
|
|
137
|
+
} },
|
|
138
|
+
defaultVariants: { scrolling: false }
|
|
139
|
+
});
|
|
140
|
+
//#endregion
|
|
141
|
+
export { searchAppBarStyles, searchBarStyles };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=search-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-styles.js","names":[],"sources":["../../../src/components/search/search-styles.ts"],"sourcesContent":["import { tv, type VariantProps } from '../../utils/tv';\n\n/*\n * Values follow Compose Material 3 (SearchBar.kt: SearchBar, AppBarWithSearch,\n * ExpandedDockedSearchBarWithGap, ExpandedFullScreenSearchBar, SearchBarDefaults.InputField;\n * SearchBar / SearchView tokens).\n *\n * Field: 56px, full corners, `surface-container-high`, 360px wide by default and at most\n * 720px. Input and placeholder `body-large`, `on-surface` / `on-surface-variant`. Icons sit\n * in 48px boxes shifted 4px inwards (leading `on-surface`, trailing `on-surface-variant`);\n * the text keeps 4px from the leading and trailing tap targets (the spec's \"Leading icon and\n * label padding (from tap target): 4dp\" and \"Label and trailing icon padding\"; Compose's\n * code leaves none), so it starts 56px in after a leading icon, 16px without one.\n *\n * Docked (with gap): the expanded field, 56px tall whatever the collapsed bar's height\n * (M3's focused search bar container), sits centred over the collapsed one and widens by 12px on\n * each side (M3 Expressive: the margins change from 24dp to 12dp when focused). It morphs from\n * the bar's bounds (position and size) on the default spatial spring and back on the same\n * spring floored at the bar, so it lands on the bar exactly; a dropdown 2px below it (12px corners,\n * `surface-container-high`; with the bar, at least 240px and at most 2/3 of the window\n * tall, per the M3 spec) slides down from half its height on the default spatial spring\n * (fast spatial back) while its content fades in over 100ms after 50ms, and its height follows\n * the results on the default spatial spring; a 32% scrim covers the page.\n *\n * Full screen, in M3 Expressive's contained style: a `surface-container-low` surface grows\n * from the bar's bounds (28px corners) to the whole window on the slow spatial spring\n * (default spatial back), clamped so nothing overshoots; the field keeps its\n * `surface-container-high` pill and moves and grows from the bar to the top, 8px down and\n * 16px from each side, and the content starts 72px down.\n *\n * In a search app bar the field is `surface-container` (`surface-container-highest` once\n * content scrolls under the bar) and fills the free space up to 312px, then half of it,\n * at most 720px (M3 app bar guidelines).\n *\n * The field's colours and corners come from the search bar's component tokens and the\n * views' from the search view's (`search-tokens.ts`, `--md-comp-search-bar-*` and\n * `--md-comp-search-view-*`); the pill, the dropdown and the full-screen view carry\n * `data-tokens`. The search app bar reads the app bar's tokens (`app-bar-tokens.ts`). A\n * consumer class still wins in `cn()`.\n *\n * Every class is written out in full so Tailwind can find it.\n */\n\nconst contentFade = [\n 'opacity-100 starting:opacity-0 data-exiting:opacity-0',\n // Compose: fade in over 100ms after 50ms (standard accelerate), out over 100ms.\n '[transition-delay:0s,50ms] data-exiting:[transition-delay:0s,0s]',\n];\n\n/** Variant definitions for {@link SearchBar}; extend them to add variants. */\nexport const searchBarStyles = tv({\n slots: {\n // The bar's height is set here alone (56px, Compose's); a consumer `h-*` resizes it.\n root: 'flex h-[56px] w-[360px] max-w-[min(720px,100%)] shrink-0',\n // The pill holding the icons and the input fills the bar.\n // Keyboard focus in the input draws Compose's inset focus ring around the pill.\n // Forced colours drop the pill's colour: a system-colour border keeps its edge.\n field: [\n 'focus-ring-inset flex h-full w-full min-w-0 items-center rounded-[var(--_md-comp-search-bar-container-shape)] text-on-surface',\n 'forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]',\n ],\n // Icon buttons in the slots take the slot's colour (and so its icon colour token), as\n // in the app bar's slots: Compose colours the search bar's and view's leading icon\n // `on-surface` and trailing icons `on-surface-variant`, buttons included.\n leading:\n 'ms-[4px] flex size-[48px] shrink-0 items-center justify-center text-[color:var(--_md-comp-search-bar-leading-icon-color)] [--md-comp-icon-button-icon-color:currentColor] [&>svg]:size-[24px]',\n // One or two trailing icon buttons, or an avatar (30px) and an icon button (M3). Two\n // 40px buttons sit 8px apart inside 4px of padding, so their 48px targets meet edge to\n // edge within the slot (a single one is centred in 48px, as before).\n trailing: [\n 'me-[4px] flex h-[48px] min-w-[48px] shrink-0 items-center justify-center gap-[8px] px-[4px] text-[color:var(--_md-comp-search-bar-trailing-icon-color)] [--md-comp-icon-button-icon-color:currentColor]',\n '[&>svg]:size-[24px] [&>img]:size-[30px] [&>img]:rounded-full',\n ],\n input: [\n 'h-full min-w-0 flex-1 bg-transparent text-body-large text-[color:var(--_md-comp-search-bar-input-text-color)] caret-primary outline-none',\n 'placeholder:text-on-surface-variant',\n '[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none',\n ],\n scrim: [\n 'fixed inset-0 z-(--md-sys-z-scrim) bg-scrim/32 opacity-100 data-exiting:pointer-events-none',\n '[transition-property:opacity]',\n '[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]',\n 'starting:opacity-0 data-exiting:opacity-0',\n ],\n /*\n * Docked view: the panel sits over the collapsed bar and morphs from the bar's bounds\n * (`--m3-search-left/top/width/height`) to the focused field's (the `-dx/-dy/-dw/-dh`\n * deltas) as `--m3-search-progress` runs 0 → 1, as Compose lerps the layout with its\n * search bar state's progress. `--m3-search-p` is that progress floored at 0 (Compose's\n * `coerceAtLeast(0f)`): the spring may overshoot past the focused bounds on the way in,\n * but never past the bar's on the way back, so the field lands on the bar exactly.\n * Reduced motion: the progress stays at 1, so the field is at its focused size at once.\n */\n dockedPanel: [\n // Leaving, the view takes no presses: the spring's tail runs on after the field has\n // landed on the bar, and a press there ran a suggestion of the invisible dropdown.\n 'fixed z-(--md-sys-z-sheet) flex flex-col outline-none data-exiting:pointer-events-none',\n '[--m3-search-progress:1] [--m3-search-p:max(0,var(--m3-search-progress))]',\n 'motion-safe:starting:[--m3-search-progress:0] motion-safe:data-exiting:[--m3-search-progress:0]',\n 'top-[calc(var(--m3-search-top)_+_var(--m3-search-p)_*_var(--m3-search-dy))]',\n 'left-[calc(var(--m3-search-left)_+_var(--m3-search-p)_*_var(--m3-search-dx))]',\n 'w-[calc(var(--m3-search-width)_+_var(--m3-search-p)_*_var(--m3-search-dw))]',\n // Both ways on the default spatial spring (Compose's collapse spec).\n '[transition-property:--m3-search-progress]',\n '[transition-duration:var(--md-sys-motion-spring-spatial-default-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing)]',\n ],\n // The focused field is 56px (M3), even when the collapsed bar is resized; it grows from\n // the bar's height with the panel.\n // The full-window layer the docked view sits in (React Aria's underlay).\n underlay: 'fixed inset-0 z-(--md-sys-z-sheet) data-exiting:pointer-events-none',\n dockedHeader:\n 'flex h-[calc(var(--m3-search-height)_+_var(--m3-search-p)_*_var(--m3-search-dh))] shrink-0',\n dropdown: [\n 'mt-[2px] overflow-y-auto overscroll-contain data-resizing:overflow-y-hidden data-exiting:pointer-events-none',\n // 58px is the field and the gap above the dropdown.\n 'min-h-[min(182px,calc(66.67dvh-58px))] max-h-[calc(66.67dvh-58px)]',\n // The height follows the content (`--m3-search-content-height`, measured) within those\n // bounds, so it animates as the results change. Without the measurement (before\n // hydration, or under reduced motion) it's `auto`.\n 'h-[clamp(min(182px,calc(66.67dvh_-_58px)),var(--m3-search-content-height),calc(66.67dvh_-_58px))]',\n 'rounded-[var(--_md-comp-search-view-docked-container-shape)] bg-[var(--_md-comp-search-view-container-color)] text-on-surface',\n 'forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]',\n // Reduced motion: it only fades.\n 'translate-y-0 motion-safe:starting:-translate-y-1/2 motion-safe:data-exiting:-translate-y-1/2',\n // The delays below cycle, so the height (third) starts at once like the slide.\n '[transition-property:translate,opacity,height]',\n '[transition-duration:var(--md-sys-motion-spring-spatial-default-duration),100ms,var(--md-sys-motion-spring-spatial-default-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing),cubic-bezier(0.3,0,1,1),var(--md-sys-motion-spring-spatial-default-easing)]',\n 'data-exiting:[transition-duration:var(--md-sys-motion-spring-spatial-fast-duration),100ms,var(--md-sys-motion-spring-spatial-fast-duration)]',\n 'data-exiting:[transition-timing-function:var(--md-sys-motion-spring-spatial-fast-easing),cubic-bezier(0,0,0,1),var(--md-sys-motion-spring-spatial-fast-easing)]',\n ...contentFade,\n ],\n /*\n * Full-screen view: the surface grows from the bar's bounds to the window as\n * `--m3-search-progress` runs 0 → 1, through a clip (nothing is transformed). Compose\n * clamps the full-screen progress to 0..1 (`coerceIn`), so `--m3-search-p` is clamped too:\n * the clip and the field never overshoot the window's or the bar's bounds.\n */\n fullScreenPanel: [\n 'fixed inset-0 z-(--md-sys-z-sheet) bg-[var(--_md-comp-search-view-container-color)] text-on-surface outline-none data-exiting:pointer-events-none',\n '[--m3-search-progress:1] [--m3-search-p:clamp(0,var(--m3-search-progress),1)]',\n 'motion-safe:starting:[--m3-search-progress:0] motion-safe:data-exiting:[--m3-search-progress:0]',\n '[clip-path:inset(calc((1_-_var(--m3-search-p))_*_var(--m3-search-top))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-right))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-bottom))_calc((1_-_var(--m3-search-p))_*_var(--m3-search-left))_round_calc((1_-_var(--m3-search-p))_*_28px))]',\n 'motion-safe:[transition-property:--m3-search-progress]',\n 'motion-safe:[transition-duration:var(--md-sys-motion-spring-spatial-slow-duration)]',\n 'motion-safe:[transition-timing-function:var(--md-sys-motion-spring-spatial-slow-easing)]',\n 'motion-safe:data-exiting:[transition-duration:var(--md-sys-motion-spring-spatial-default-duration)]',\n 'motion-safe:data-exiting:[transition-timing-function:var(--md-sys-motion-spring-spatial-default-easing)]',\n // Reduced motion: the view fades in and out over the window instead of growing.\n 'motion-reduce:starting:opacity-0 motion-reduce:data-exiting:opacity-0',\n 'motion-reduce:[transition-property:opacity]',\n 'motion-reduce:[transition-duration:var(--md-sys-motion-spring-effects-fast-duration)]',\n 'motion-reduce:[transition-timing-function:var(--md-sys-motion-spring-effects-fast-easing)]',\n ],\n // Compose's full-screen field is 56px whatever the bar's size, 8px down and 16px from each\n // side; it moves and grows there from the bar's bounds with the surface.\n fullScreenHeader: [\n 'absolute',\n 'start-[calc(var(--m3-search-start)_+_var(--m3-search-p)_*_(16px_-_var(--m3-search-start)))]',\n 'top-[calc(var(--m3-search-top)_+_var(--m3-search-p)_*_(8px_-_var(--m3-search-top)))]',\n 'w-[calc(var(--m3-search-width)_+_var(--m3-search-p)_*_(100%_-_32px_-_var(--m3-search-width)))]',\n 'h-[calc(var(--m3-search-height)_+_var(--m3-search-p)_*_(56px_-_var(--m3-search-height)))]',\n ],\n fullScreenContent: [\n 'absolute inset-x-0 top-[72px] bottom-0 overflow-y-auto overscroll-contain',\n '[transition-property:opacity] [transition-duration:100ms]',\n '[transition-timing-function:cubic-bezier(0.3,0,1,1)]',\n 'data-exiting:[transition-timing-function:cubic-bezier(0,0,0,1)]',\n ...contentFade,\n ],\n },\n variants: {\n /**\n * Inside a search app bar the bar fills the free space up to 312px, then grows to half\n * of it (M3), up to 720px.\n */\n inAppBar: { true: { root: 'w-[max(min(100%,312px),50%)]' }, false: {} },\n // 4px from a tap target (M3), else 16px from the pill's edge.\n hasLeading: { true: { input: 'ps-[4px]' }, false: { input: 'ps-[16px]' } },\n hasTrailing: { true: { input: 'pe-[4px]' }, false: { input: 'pe-[16px]' } },\n /**\n * Container colour: the bar's own; in a search app bar `surface-container`, and one\n * step higher than the bar once content scrolls under it.\n */\n tone: {\n default: { field: 'bg-[var(--_md-comp-search-bar-container-color)]' },\n appBar: { field: 'bg-surface-container' },\n scrolled: { field: 'bg-surface-container-highest' },\n },\n /** Centre the placeholder and the query while the bar is collapsed. */\n textAlign: { start: {}, center: { input: 'text-center' } },\n },\n defaultVariants: {\n inAppBar: false,\n hasLeading: false,\n hasTrailing: false,\n tone: 'default',\n textAlign: 'start',\n },\n});\n\n/** Variant definitions for {@link SearchAppBar}. */\nexport const searchAppBarStyles = tv({\n slots: {\n root: [\n 'flex min-h-[64px] w-full items-center text-on-surface',\n 'bg-[var(--_md-comp-app-bar-container-color)] data-scrolled:bg-[var(--_md-comp-app-bar-on-scroll-container-color)]',\n '[transition-property:background-color]',\n '[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]',\n ],\n // Icon buttons take each slot's content colour.\n navigation:\n 'flex shrink-0 items-center ps-[8px] pe-[4px] text-[color:var(--_md-comp-app-bar-leading-icon-color)] [--md-comp-icon-button-icon-color:currentColor]',\n // Centres the search bar in the free space, 8px from its neighbours and 4px vertically.\n search: 'flex min-w-0 flex-1 justify-center ps-[8px] pe-[8px] pt-[4px] pb-[4px]',\n actions:\n 'flex shrink-0 items-center gap-[8px] ps-[4px] pe-[8px] text-[color:var(--_md-comp-app-bar-trailing-icon-color)] [--md-comp-icon-button-icon-color:currentColor]',\n },\n variants: {\n scrolling: {\n true: { root: 'sticky top-(--m3-app-bar-offset) z-(--md-sys-z-sticky)' },\n false: {},\n },\n },\n defaultVariants: { scrolling: false },\n});\n\n/**\n * The variants of {@link searchBarStyles}, for building on its styles. They are the recipe's keys, not\n * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.\n */\nexport type SearchBarStyleProps = VariantProps<typeof searchBarStyles>;\n/**\n * The variants of {@link searchAppBarStyles}, for building on its styles. They are the recipe's keys, not\n * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.\n */\nexport type SearchAppBarStyleProps = VariantProps<typeof searchAppBarStyles>;\n"],"mappings":";;AA2CA,MAAM,cAAc,CAClB,yDAEA,kEACF;;AAGA,MAAa,kBAAkB,GAAG;CAChC,OAAO;EAEL,MAAM;EAIN,OAAO,CACL,iIACA,mFACF;EAIA,SACE;EAIF,UAAU,CACR,2MACA,8DACF;EACA,OAAO;GACL;GACA;GACA;EACF;EACA,OAAO;GACL;GACA;GACA;GACA;GACA;EACF;EAUA,aAAa;GAGX;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GACA;EACF;EAIA,UAAU;EACV,cACE;EACF,UAAU;GACR;GAEA;GAIA;GACA;GACA;GAEA;GAEA;GACA;GACA;GACA;GACA;GACA,GAAG;EACL;EAOA,iBAAiB;GACf;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GACA;GACA;EACF;EAGA,kBAAkB;GAChB;GACA;GACA;GACA;GACA;EACF;EACA,mBAAmB;GACjB;GACA;GACA;GACA;GACA,GAAG;EACL;CACF;CACA,UAAU;;;;;EAKR,UAAU;GAAE,MAAM,EAAE,MAAM,+BAA+B;GAAG,OAAO,CAAC;EAAE;EAEtE,YAAY;GAAE,MAAM,EAAE,OAAO,WAAW;GAAG,OAAO,EAAE,OAAO,YAAY;EAAE;EACzE,aAAa;GAAE,MAAM,EAAE,OAAO,WAAW;GAAG,OAAO,EAAE,OAAO,YAAY;EAAE;;;;;EAK1E,MAAM;GACJ,SAAS,EAAE,OAAO,kDAAkD;GACpE,QAAQ,EAAE,OAAO,uBAAuB;GACxC,UAAU,EAAE,OAAO,+BAA+B;EACpD;;EAEA,WAAW;GAAE,OAAO,CAAC;GAAG,QAAQ,EAAE,OAAO,cAAc;EAAE;CAC3D;CACA,iBAAiB;EACf,UAAU;EACV,YAAY;EACZ,aAAa;EACb,MAAM;EACN,WAAW;CACb;AACF,CAAC;;AAGD,MAAa,qBAAqB,GAAG;CACnC,OAAO;EACL,MAAM;GACJ;GACA;GACA;GACA;GACA;EACF;EAEA,YACE;EAEF,QAAQ;EACR,SACE;CACJ;CACA,UAAU,EACR,WAAW;EACT,MAAM,EAAE,MAAM,yDAAyD;EACvE,OAAO,CAAC;CACV,EACF;CACA,iBAAiB,EAAE,WAAW,MAAM;AACtC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentTokenSet } from "../../tokens/component.js";
|
|
2
|
+
import "../../index.js";
|
|
3
|
+
//#region src/components/search/search-tokens.d.ts
|
|
4
|
+
/** The tokens of {@link SearchBar}'s field: `--md-comp-search-bar-<part>`. */
|
|
5
|
+
export declare const searchBarTokenSet: ComponentTokenSet<"container-color" | "container-shape" | "input-text-color" | "leading-icon-color" | "trailing-icon-color">;
|
|
6
|
+
/** The tokens of {@link SearchBar}'s expanded view: `--md-comp-search-view-<part>`. */
|
|
7
|
+
export declare const searchViewTokenSet: ComponentTokenSet<"container-color" | "docked-container-shape">;
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=search-tokens.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { color, corner, defineComponentTokens } from "../../tokens/component.js";
|
|
2
|
+
//#region src/components/search/search-tokens.ts
|
|
3
|
+
/** The tokens of {@link SearchBar}'s field: `--md-comp-search-bar-<part>`. */
|
|
4
|
+
const searchBarTokenSet = defineComponentTokens({
|
|
5
|
+
name: "md-comp-search-bar",
|
|
6
|
+
tokens: {
|
|
7
|
+
"container-color": {
|
|
8
|
+
value: color("surface-container-high"),
|
|
9
|
+
description: "The field.",
|
|
10
|
+
compose: "SearchBarTokens.ContainerColor",
|
|
11
|
+
paints: { property: "background-color" }
|
|
12
|
+
},
|
|
13
|
+
"container-shape": {
|
|
14
|
+
value: corner("full"),
|
|
15
|
+
description: "The corners.",
|
|
16
|
+
compose: "SearchBarTokens.ContainerShape",
|
|
17
|
+
paints: { property: "border-top-left-radius" }
|
|
18
|
+
},
|
|
19
|
+
"input-text-color": {
|
|
20
|
+
value: color("on-surface"),
|
|
21
|
+
description: "The query.",
|
|
22
|
+
compose: "SearchBarTokens.InputTextColor",
|
|
23
|
+
paints: {
|
|
24
|
+
property: "color",
|
|
25
|
+
slot: "input"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"leading-icon-color": {
|
|
29
|
+
value: color("on-surface"),
|
|
30
|
+
description: "The leading icon.",
|
|
31
|
+
compose: "SearchBarTokens.LeadingIconColor",
|
|
32
|
+
paints: {
|
|
33
|
+
property: "color",
|
|
34
|
+
slot: "leading"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"trailing-icon-color": {
|
|
38
|
+
value: color("on-surface-variant"),
|
|
39
|
+
description: "The trailing icons or avatar.",
|
|
40
|
+
compose: "SearchBarTokens.TrailingIconColor",
|
|
41
|
+
paints: {
|
|
42
|
+
property: "color",
|
|
43
|
+
slot: "trailing"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
/** The tokens of {@link SearchBar}'s expanded view: `--md-comp-search-view-<part>`. */
|
|
49
|
+
const searchViewTokenSet = defineComponentTokens({
|
|
50
|
+
name: "md-comp-search-view",
|
|
51
|
+
tokens: {
|
|
52
|
+
"container-color": {
|
|
53
|
+
value: color("surface-container-high"),
|
|
54
|
+
description: "The view: the docked dropdown (`surface-container-high`) or the full-screen surface (`surface-container-low`).",
|
|
55
|
+
compose: "SearchViewTokens.ContainerColor",
|
|
56
|
+
paints: { property: "background-color" }
|
|
57
|
+
},
|
|
58
|
+
"docked-container-shape": {
|
|
59
|
+
value: corner("medium"),
|
|
60
|
+
description: "The docked dropdown's corners.",
|
|
61
|
+
compose: "SearchViewTokens.DockedContainerShape",
|
|
62
|
+
paints: { property: "border-top-left-radius" }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
states: { view: { "full-screen": { "container-color": color("surface-container-low") } } }
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { searchBarTokenSet, searchViewTokenSet };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=search-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-tokens.js","names":[],"sources":["../../../src/components/search/search-tokens.ts"],"sourcesContent":["import { color, corner, defineComponentTokens } from '../../tokens/component';\n\n/*\n * The search bar's and search view's component tokens, M3's `md.comp.search-bar.*` and\n * `md.comp.search-view.*` names (checked against m3.material.io's token tables, 2026-10-14),\n * with the defaults of `search-styles.ts`.\n *\n * The bar's tokens are resolved on its pill (`data-tokens=\"md-comp-search-bar\"`), which the\n * expanded views and the searchable Select repeat. In a search app bar the pill takes the\n * app bar's colours (`surface-container`, `surface-container-highest` once content scrolls\n * under it), which stay classes. The view's tokens are resolved on the docked view's\n * dropdown and on the full-screen view (`data-view`), which differ in colour.\n */\n\n/** The tokens of {@link SearchBar}'s field: `--md-comp-search-bar-<part>`. */\nexport const searchBarTokenSet = defineComponentTokens({\n name: 'md-comp-search-bar',\n tokens: {\n 'container-color': {\n value: color('surface-container-high'),\n description: 'The field.',\n compose: 'SearchBarTokens.ContainerColor',\n paints: { property: 'background-color' },\n },\n 'container-shape': {\n value: corner('full'),\n description: 'The corners.',\n compose: 'SearchBarTokens.ContainerShape',\n paints: { property: 'border-top-left-radius' },\n },\n 'input-text-color': {\n value: color('on-surface'),\n description: 'The query.',\n compose: 'SearchBarTokens.InputTextColor',\n paints: { property: 'color', slot: 'input' },\n },\n 'leading-icon-color': {\n value: color('on-surface'),\n description: 'The leading icon.',\n compose: 'SearchBarTokens.LeadingIconColor',\n paints: { property: 'color', slot: 'leading' },\n },\n 'trailing-icon-color': {\n value: color('on-surface-variant'),\n description: 'The trailing icons or avatar.',\n compose: 'SearchBarTokens.TrailingIconColor',\n paints: { property: 'color', slot: 'trailing' },\n },\n },\n});\n\n/** The tokens of {@link SearchBar}'s expanded view: `--md-comp-search-view-<part>`. */\nexport const searchViewTokenSet = defineComponentTokens({\n name: 'md-comp-search-view',\n tokens: {\n 'container-color': {\n value: color('surface-container-high'),\n description:\n 'The view: the docked dropdown (`surface-container-high`) or the full-screen surface (`surface-container-low`).',\n compose: 'SearchViewTokens.ContainerColor',\n paints: { property: 'background-color' },\n },\n 'docked-container-shape': {\n value: corner('medium'),\n description: \"The docked dropdown's corners.\",\n compose: 'SearchViewTokens.DockedContainerShape',\n paints: { property: 'border-top-left-radius' },\n },\n },\n states: {\n view: { 'full-screen': { 'container-color': color('surface-container-low') } },\n },\n});\n"],"mappings":";;;AAeA,MAAa,oBAAoB,sBAAsB;CACrD,MAAM;CACN,QAAQ;EACN,mBAAmB;GACjB,OAAO,MAAM,wBAAwB;GACrC,aAAa;GACb,SAAS;GACT,QAAQ,EAAE,UAAU,mBAAmB;EACzC;EACA,mBAAmB;GACjB,OAAO,OAAO,MAAM;GACpB,aAAa;GACb,SAAS;GACT,QAAQ,EAAE,UAAU,yBAAyB;EAC/C;EACA,oBAAoB;GAClB,OAAO,MAAM,YAAY;GACzB,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAS,MAAM;GAAQ;EAC7C;EACA,sBAAsB;GACpB,OAAO,MAAM,YAAY;GACzB,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAS,MAAM;GAAU;EAC/C;EACA,uBAAuB;GACrB,OAAO,MAAM,oBAAoB;GACjC,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAS,MAAM;GAAW;EAChD;CACF;AACF,CAAC;;AAGD,MAAa,qBAAqB,sBAAsB;CACtD,MAAM;CACN,QAAQ;EACN,mBAAmB;GACjB,OAAO,MAAM,wBAAwB;GACrC,aACE;GACF,SAAS;GACT,QAAQ,EAAE,UAAU,mBAAmB;EACzC;EACA,0BAA0B;GACxB,OAAO,OAAO,QAAQ;GACtB,aAAa;GACb,SAAS;GACT,QAAQ,EAAE,UAAU,yBAAyB;EAC/C;CACF;CACA,QAAQ,EACN,MAAM,EAAE,eAAe,EAAE,mBAAmB,MAAM,uBAAuB,EAAE,EAAE,EAC/E;AACF,CAAC"}
|