@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":"Chip.js","names":[],"sources":["../../../src/components/chip/Chip.tsx"],"sourcesContent":["'use client';\n\nimport {\n useContext,\n useId,\n type CSSProperties,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { VisuallyHidden } from 'react-aria';\nimport { useToggleState } from 'react-stately';\nimport {\n ButtonBase,\n ToggleGroupStateContext,\n type ButtonBaseActionProps,\n type ButtonBaseLinkProps,\n type ButtonBaseToggleProps,\n} from '../../primitives/ButtonBase';\nimport { TouchTarget } from '../../primitives/TouchTarget';\nimport { densityAttribute, type Density } from '../../tokens/density';\nimport { cn } from '../../utils/cn';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\nimport { chipStyles, type ChipOutline } from './chip-styles';\n\n/** Material Symbols \"check\" and \"close\" (Apache-2.0). */\nfunction CheckIcon() {\n return (\n <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\">\n <path d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\n </svg>\n );\n}\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\n <path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\" />\n </svg>\n );\n}\n\nexport interface ChipClassNames {\n /** The chip's container, merged with `className`. */\n root?: string;\n /** The row holding the leading icon, label and trailing icon. */\n content?: string;\n /** The leading icon or avatar slot. */\n leading?: string;\n /** The label text. */\n label?: string;\n /** The trailing icon slot. */\n trailing?: string;\n}\n\nexport interface ChipLabels {\n /** First word of the remove button's name, which ends with the label. @default \"Remove\" */\n remove: string;\n /**\n * Announces a selected `InputChip` that has no `onPress` (with one, its action carries\n * `aria-pressed`): the remove button's description, or hidden text on a static chip.\n * @default \"Selected\"\n */\n selected: string;\n}\n\nconst DEFAULT_LABELS: ChipLabels = { remove: 'Remove', selected: 'Selected' };\n\ninterface ChipCommonProps {\n /** The label. */\n children: ReactNode;\n /** Icon before the label (18px). Hidden from assistive tech. */\n leadingIcon?: ReactElement;\n /**\n * The flat chip's border: `outline-variant`, or `strong` (`outline`) for 3:1 contrast\n * where nothing else shows the chip is interactive. @default \"standard\"\n */\n outline?: ChipOutline;\n /**\n * Web density, `0` to `-3`: each step takes 4px off the chip's height (32px at 0, 24px at -2\n * and -3); its touch target stays 48px. Left out, the chip takes the density of the nearest\n * `ChipSet`, `ThemeProvider` or `ThemeScope`. M3 asks for density to be the reader's choice\n * rather than a default, so prefer setting it there, from a setting.\n * @default 0\n */\n density?: Density;\n /** Classes for each part, by slot. */\n classNames?: ChipClassNames;\n}\n\ntype Styles = ReturnType<typeof chipStyles>;\n\nfunction ChipContent({\n styles,\n classNames,\n leading,\n children,\n trailing,\n labelId,\n}: {\n styles: Styles;\n classNames?: ChipClassNames;\n leading?: ReactNode;\n children: ReactNode;\n trailing?: ReactNode;\n labelId?: string;\n}) {\n return (\n <span className={styles.content({ class: classNames?.content })}>\n <TouchTarget />\n {leading}\n <span id={labelId} className={styles.label({ class: classNames?.label })}>\n {children}\n </span>\n {trailing}\n </span>\n );\n}\n\n/**\n * The component tokens' hooks (chip-tokens.ts): each kind's set, followed by any set the app\n * passed on the same element (`props`), and whether the chip is elevated, which picks its\n * elevated container token; and the chip's own density, if set.\n */\nconst tokenAttributes = (\n kind: 'assist' | 'suggestion' | 'filter' | 'input',\n elevated: boolean | undefined,\n density: Density | undefined,\n props?: object,\n) => ({\n 'data-tokens': mergeDataTokens(`md-comp-${kind}-chip`, props),\n 'data-elevated': elevated || undefined,\n ...densityAttribute(density),\n});\n\nconst leadingIconOf = (styles: Styles, icon: ReactElement | undefined, className?: string) =>\n icon && (\n <span aria-hidden=\"true\" data-slot=\"leading\" className={styles.leading({ class: className })}>\n {icon}\n </span>\n );\n\nconst trailingIconOf = (styles: Styles, icon: ReactElement | undefined, className?: string) =>\n icon && (\n <span aria-hidden=\"true\" className={styles.trailing({ class: className })}>\n {icon}\n </span>\n );\n\n/** Backspace or Delete on a removable chip removes it (M3 chips, keyboard navigation). */\nconst removeKeys =\n (onRemove: (() => void) | undefined, disabled: boolean | undefined) =>\n (event: KeyboardEvent<HTMLElement>) => {\n if (onRemove && !disabled && (event.key === 'Backspace' || event.key === 'Delete')) {\n event.preventDefault();\n onRemove();\n }\n };\n\n/** The remove button: named \"Remove\" + the chip's label, with a 48px target. */\nfunction RemoveButton({\n styles,\n className,\n labelId,\n labels,\n onRemove,\n disabled,\n describedBy,\n}: {\n styles: Styles;\n className?: string;\n labelId: string;\n labels?: Partial<ChipLabels>;\n onRemove: () => void;\n disabled?: boolean;\n /** An element describing the chip's state (a selected input chip without an action). */\n describedBy?: string;\n}) {\n const removeId = useId();\n const { remove } = { ...DEFAULT_LABELS, ...labels };\n return (\n <ButtonBase\n disabled={disabled}\n onPress={onRemove}\n onKeyDown={removeKeys(onRemove, disabled)}\n aria-labelledby={`${removeId} ${labelId}`}\n aria-describedby={describedBy}\n data-chip-remove=\"\"\n className={styles.remove({ class: className })}\n >\n <TouchTarget />\n <span id={removeId} hidden>\n {remove}\n </span>\n <CloseIcon />\n </ButtonBase>\n );\n}\n\n/* ------------------------------------------------------------------ Assist */\n\ninterface AssistChipOwnProps extends ChipCommonProps {\n /** `surface-container-low` at level 1 instead of an outline. @default false */\n elevated?: boolean;\n}\n\ntype OmitChip<T> = Omit<T, keyof AssistChipOwnProps | 'toggle'>;\n\nexport type AssistChipProps = AssistChipOwnProps &\n (OmitChip<ButtonBaseActionProps> | OmitChip<ButtonBaseLinkProps>);\n\n/**\n * M3 assist chip: a smart or automated action that can span apps, such as opening a calendar\n * event. A button, or a link with `href`. Assist chips have no trailing icon.\n *\n * @example\n * <AssistChip leadingIcon={<EventIcon />} onPress={addToCalendar}>Add to calendar</AssistChip>\n */\nexport function AssistChip({\n children,\n leadingIcon,\n elevated,\n outline,\n density,\n classNames,\n className,\n ...base\n}: AssistChipProps) {\n const styles = chipStyles({\n kind: 'assist',\n elevated,\n outline,\n leading: leadingIcon ? 'icon' : 'none',\n });\n return (\n <ButtonBase\n {...(base as ButtonBaseActionProps)}\n {...tokenAttributes('assist', elevated, density, base)}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <ChipContent\n styles={styles}\n classNames={classNames}\n leading={leadingIconOf(styles, leadingIcon, classNames?.leading)}\n >\n {children}\n </ChipContent>\n </ButtonBase>\n );\n}\n\n/* -------------------------------------------------------------- Suggestion */\n\ninterface SuggestionChipOwnProps extends ChipCommonProps {\n /** `surface-container-low` at level 1 instead of an outline. @default false */\n elevated?: boolean;\n}\n\nexport type SuggestionChipProps = SuggestionChipOwnProps &\n Omit<ButtonBaseActionProps, keyof SuggestionChipOwnProps | 'toggle'>;\n\n/**\n * M3 suggestion chip: a dynamically generated suggestion, such as a reply. Use an icon\n * sparingly.\n *\n * @example\n * <SuggestionChip onPress={() => reply('Sounds good')}>Sounds good</SuggestionChip>\n */\nexport function SuggestionChip({\n children,\n leadingIcon,\n elevated,\n outline,\n density,\n classNames,\n className,\n ...base\n}: SuggestionChipProps) {\n const styles = chipStyles({\n kind: 'suggestion',\n elevated,\n outline,\n leading: leadingIcon ? 'icon' : 'none',\n });\n return (\n <ButtonBase\n {...base}\n {...tokenAttributes('suggestion', elevated, density, base)}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <ChipContent\n styles={styles}\n classNames={classNames}\n leading={leadingIconOf(styles, leadingIcon, classNames?.leading)}\n >\n {children}\n </ChipContent>\n </ButtonBase>\n );\n}\n\n/* ------------------------------------------------------------------ Filter */\n\nexport interface FilterChipClassNames extends ChipClassNames {\n /** The toggle of a chip with a remove button. */\n primary?: string;\n /** The remove button after the label. */\n remove?: string;\n}\n\ninterface FilterChipOwnProps extends Omit<ChipCommonProps, 'classNames'> {\n /**\n * Icon after the label, e.g. a dropdown arrow when the chip opens a menu. Hidden from\n * assistive tech; the whole chip is the control. Not with `onRemove`.\n */\n trailingIcon?: ReactElement;\n /**\n * Adds a remove button after the label, a second focus stop named \"Remove\" + the label\n * (M3: for medium and expanded windows). Backspace or Delete on the chip also calls it.\n */\n onRemove?: () => void;\n /** Words the chip announces, with English defaults. */\n labels?: Partial<ChipLabels>;\n /** `surface-container-low` at level 1 instead of an outline. @default false */\n elevated?: boolean;\n /** Classes for each part, by slot. */\n classNames?: FilterChipClassNames;\n}\n\nexport type FilterChipProps = FilterChipOwnProps &\n Omit<ButtonBaseToggleProps, keyof FilterChipOwnProps | 'toggle'>;\n\n/**\n * M3 filter chip: a toggle (`aria-pressed`, or a radio in a single-select `ChipSet`) for\n * filtering content. Without a `leadingIcon` a check grows in when selected. Controlled\n * with `selected` / `onSelectedChange`, uncontrolled with `defaultSelected`, or through a\n * `ChipSet`'s selection with a `value`.\n *\n * @example\n * <FilterChip selected={vegan} onSelectedChange={setVegan}>Vegan</FilterChip>\n */\nexport function FilterChip(props: FilterChipProps) {\n const { onRemove } = props;\n return onRemove ? (\n <RemovableFilterChip {...props} onRemove={onRemove} />\n ) : (\n <SimpleFilterChip {...props} />\n );\n}\n\nfunction filterLeading(styles: Styles, leadingIcon: ReactElement | undefined, className?: string) {\n if (leadingIcon) return leadingIconOf(styles, leadingIcon, className);\n return (\n <span aria-hidden=\"true\" className={styles.check()}>\n <span className={styles.checkInner()}>\n <span className={styles.checkIcon({ class: className })}>\n <CheckIcon />\n </span>\n </span>\n </span>\n );\n}\n\nfunction SimpleFilterChip({\n children,\n leadingIcon,\n trailingIcon,\n elevated,\n outline,\n density,\n classNames,\n className,\n onRemove: _onRemove,\n labels: _labels,\n ...base\n}: FilterChipProps) {\n const styles = chipStyles({\n kind: 'filter',\n elevated,\n outline,\n leading: leadingIcon ? 'icon' : 'none',\n trailing: Boolean(trailingIcon),\n });\n return (\n <ButtonBase\n {...base}\n {...tokenAttributes('filter', elevated, density, base)}\n toggle\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <ChipContent\n styles={styles}\n classNames={classNames}\n leading={filterLeading(styles, leadingIcon, classNames?.leading)}\n trailing={trailingIconOf(styles, trailingIcon, classNames?.trailing)}\n >\n {children}\n </ChipContent>\n </ButtonBase>\n );\n}\n\n/** A filter chip with a remove button: a container of the toggle and the remove button. */\nfunction RemovableFilterChip({\n children,\n leadingIcon,\n trailingIcon: _trailingIcon,\n elevated,\n outline,\n density,\n classNames,\n className,\n style,\n onRemove,\n labels,\n selected,\n defaultSelected,\n onSelectedChange,\n value,\n disabled,\n onKeyDown,\n ...base\n}: FilterChipProps & { onRemove: () => void }) {\n const labelId = useId();\n const groupState = useContext(ToggleGroupStateContext);\n const inGroup = groupState != null && value !== undefined;\n const ownState = useToggleState({\n isSelected: selected,\n defaultSelected,\n onChange: onSelectedChange,\n });\n const isSelected = inGroup ? groupState.selectedKeys.has(value) : ownState.isSelected;\n const isDisabled = Boolean(disabled || (inGroup && groupState.isDisabled));\n const styles = chipStyles({\n kind: 'filter',\n split: 'two',\n elevated,\n outline,\n leading: leadingIcon ? 'icon' : 'none',\n trailing: true,\n });\n const toggleProps = inGroup\n ? { value }\n : { value, selected: ownState.isSelected, onSelectedChange: ownState.setSelected };\n return (\n <div\n {...tokenAttributes('filter', elevated, density)}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n style={style}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n <ButtonBase\n {...base}\n {...toggleProps}\n toggle\n disabled={disabled}\n onKeyDown={(event) => {\n removeKeys(onRemove, isDisabled)(event);\n onKeyDown?.(event);\n }}\n data-chip-primary=\"\"\n className={styles.primary({ class: classNames?.primary })}\n >\n <ChipContent\n styles={styles}\n classNames={classNames}\n labelId={labelId}\n leading={filterLeading(styles, leadingIcon, classNames?.leading)}\n >\n {children}\n </ChipContent>\n </ButtonBase>\n <RemoveButton\n styles={styles}\n className={classNames?.remove}\n labelId={labelId}\n labels={labels}\n onRemove={onRemove}\n disabled={isDisabled}\n />\n </div>\n );\n}\n\n/* ------------------------------------------------------------------- Input */\n\nexport interface InputChipClassNames extends ChipClassNames {\n /** The chip's action (a button with `onPress`), or its label part. */\n primary?: string;\n /** The avatar image before the label. */\n avatar?: string;\n /** The remove button after the label. */\n remove?: string;\n}\n\ninterface InputChipOwnProps {\n /** The label. */\n children: ReactNode;\n /** Icon before the label (18px). Hidden from assistive tech. */\n leadingIcon?: ReactElement;\n /** A 24px image before the label, with 12px corners (takes precedence over `leadingIcon`). */\n avatar?: ReactElement;\n /** Shows the chip as selected (`aria-pressed` on its action). */\n selected?: boolean;\n /** The chip's action, e.g. editing the entry. Makes the chip's label part a button. */\n onPress?: ButtonBaseActionProps['onPress'];\n /** Shows a remove button; also called on Backspace or Delete. */\n onRemove?: () => void;\n /** Words the chip announces, with English defaults. */\n labels?: Partial<ChipLabels>;\n /** The flat chip's border. @default \"standard\" */\n outline?: ChipOutline;\n /**\n * Web density, `0` to `-3`: each step takes 4px off the chip's height (32px at 0, 24px at -2\n * and -3); its touch target stays 48px. Left out, the chip takes the density of the nearest\n * `ChipSet`, `ThemeProvider` or `ThemeScope`. M3 asks for density to be the reader's choice\n * rather than a default, so prefer setting it there, from a setting.\n * @default 0\n */\n density?: Density;\n /** Disables the chip's action and its remove button. @default false */\n disabled?: boolean;\n /** Classes for each part, by slot. */\n classNames?: InputChipClassNames;\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}\n\nexport type InputChipProps = InputChipOwnProps &\n Omit<React.ComponentPropsWithRef<'div'>, keyof InputChipOwnProps>;\n\n/**\n * M3 input chip: a discrete piece of information the user entered, such as a recipient.\n * M3 expects input chips to be removable: give it `onRemove` unless the entry is fixed.\n *\n * With `onPress` and `onRemove`, the chip's action and its remove button are two focus\n * stops. With only `onRemove`, the chip is one focus stop (the remove button, named\n * \"Remove\" + the label), as M3 asks. Backspace or Delete on the chip removes it. A chip\n * with a remove button is at least 88px wide, so the button's 48px target never covers\n * the label.\n *\n * @example\n * <InputChip avatar={<img src={photo} alt=\"\" />} onRemove={() => remove(id)}>\n * Alex\n * </InputChip>\n */\nexport function InputChip({\n children,\n leadingIcon,\n avatar,\n selected,\n onPress,\n onRemove,\n labels,\n outline,\n density,\n disabled,\n classNames,\n className,\n ...rest\n}: InputChipProps) {\n const labelId = useId();\n const selectedId = useId();\n const split = onRemove ? (onPress ? 'two' : 'removeOnly') : 'none';\n // Without an action there's no `aria-pressed` to carry the selection, so it's said in words\n // (WCAG 1.3.1): the remove button's description, or hidden text on a static chip.\n const announceSelected = Boolean(selected) && !onPress;\n const selectedWord = { ...DEFAULT_LABELS, ...labels }.selected;\n const styles = chipStyles({\n kind: 'input',\n split,\n outline,\n leading: avatar ? 'avatar' : leadingIcon ? 'icon' : 'none',\n trailing: Boolean(onRemove),\n });\n const leading = avatar ? (\n <span\n aria-hidden=\"true\"\n data-slot=\"leading\"\n className={styles.leading({ class: classNames?.leading })}\n >\n <span className={styles.avatar({ class: classNames?.avatar })}>{avatar}</span>\n </span>\n ) : (\n leadingIconOf(styles, leadingIcon, classNames?.leading)\n );\n const content = (\n <ChipContent styles={styles} classNames={classNames} leading={leading} labelId={labelId}>\n {children}\n </ChipContent>\n );\n\n return (\n <div\n {...rest}\n {...tokenAttributes('input', undefined, density, rest)}\n data-selected={selected || undefined}\n data-disabled={disabled || undefined}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n {onPress ? (\n <ButtonBase\n disabled={disabled}\n onPress={onPress}\n onKeyDown={removeKeys(onRemove, disabled)}\n aria-pressed={selected}\n data-chip-primary=\"\"\n className={styles.primary({ class: classNames?.primary })}\n >\n {content}\n </ButtonBase>\n ) : (\n <span data-chip-primary=\"\" className={styles.primary({ class: classNames?.primary })}>\n {content}\n {announceSelected &&\n (onRemove ? (\n <span id={selectedId} hidden>\n {selectedWord}\n </span>\n ) : (\n <VisuallyHidden>{`, ${selectedWord}`}</VisuallyHidden>\n ))}\n </span>\n )}\n {onRemove && (\n <RemoveButton\n styles={styles}\n className={classNames?.remove}\n labelId={labelId}\n labels={labels}\n onRemove={onRemove}\n disabled={disabled}\n describedBy={announceSelected ? selectedId : undefined}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0BA,SAAS,YAAY;CACnB,OACE,oBAAC,OAAD;EAAK,SAAQ;EAAiB,MAAK;EACjC,UAAA,oBAAC,QAAD,EAAM,GAAE,wDAAyD,CAAA;CAC9D,CAAA;AAET;AAEA,SAAS,YAAY;CACnB,OACE,oBAAC,OAAD;EAAK,eAAY;EAAO,SAAQ;EAAiB,MAAK;EACpD,UAAA,oBAAC,QAAD,EAAM,GAAE,oGAAqG,CAAA;CAC1G,CAAA;AAET;AA0BA,MAAM,iBAA6B;CAAE,QAAQ;CAAU,UAAU;AAAW;AA0B5E,SAAS,YAAY,EACnB,QACA,YACA,SACA,UACA,UACA,WAQC;CACD,OACE,qBAAC,QAAD;EAAM,WAAW,OAAO,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;EAA9D,UAAA;GACE,oBAAC,aAAD,CAAc,CAAA;GACb;GACD,oBAAC,QAAD;IAAM,IAAI;IAAS,WAAW,OAAO,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;IACpE;GACG,CAAA;GACL;EACG;;AAEV;;;;;;AAOA,MAAM,mBACJ,MACA,UACA,SACA,WACI;CACJ,eAAe,gBAAgB,WAAW,KAAK,QAAQ,KAAK;CAC5D,iBAAiB,YAAY,KAAA;CAC7B,GAAG,iBAAiB,OAAO;AAC7B;AAEA,MAAM,iBAAiB,QAAgB,MA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AAW,OAAO,KAAK,EAAE,OAAO,GAAG,YAAY,MAAM,SAAS,EAAE,CAAC;EALnE,UAAA,CAOG,UACC,oBAAC,YAAD;GACY;GACD;GACT,WAAW,WAAW,UAAU,QAAQ;GACxC,gBAAc;GACd,qBAAkB;GAClB,WAAW,OAAO,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;GAEvD,UAAA;EACS,CAAA,IAEZ,qBAAC,QAAD;GAAM,qBAAkB;GAAG,WAAW,OAAO,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;GAAnF,UAAA,CACG,SACA,qBACE,WACC,oBAAC,QAAD;IAAM,IAAI;IAAY,QAAA;IACnB,UAAA;GACG,CAAA,IAEN,oBAAC,gBAAD,EAAA,UAAiB,KAAK,eAA+B,CAAA,EAErD;EAEP,CAAA,GAAA,YACC,oBAAC,cAAD;GACU;GACR,WAAW,YAAY;GACd;GACD;GACE;GACA;GACV,aAAa,mBAAmB,aAAa,KAAA;EAC9C,CAAA,CAEA;;AAET"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Density } from "../../tokens/density.js";
|
|
2
|
+
import { ChipSetLayout } from "./chip-styles.js";
|
|
3
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
import { Key } from "react-stately";
|
|
5
|
+
//#region src/components/chip/ChipSet.d.ts
|
|
6
|
+
export interface ChipSetClassNames {
|
|
7
|
+
/** The set's container, merged with `className`. */
|
|
8
|
+
root?: string;
|
|
9
|
+
}
|
|
10
|
+
type Naming = {
|
|
11
|
+
/** Accessible name for the set of chips. Required unless `aria-labelledby` is set. */
|
|
12
|
+
'aria-label': string;
|
|
13
|
+
} | {
|
|
14
|
+
/** The id of the element that names the set. Required unless `aria-label` is set. */
|
|
15
|
+
'aria-labelledby': string;
|
|
16
|
+
};
|
|
17
|
+
interface ChipSetOwnProps {
|
|
18
|
+
/** The chips. Filter chips take part in the set's selection with a `value`. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Filter chip selection: `single` (a radio group: selecting a chip clears the others)
|
|
22
|
+
* or `multiple`. With `none`, each chip keeps its own state. @default "none"
|
|
23
|
+
*/
|
|
24
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
|
25
|
+
/** The selected chips' values (controlled). */
|
|
26
|
+
selectedKeys?: Iterable<Key>;
|
|
27
|
+
/** The chips selected at first (uncontrolled). */
|
|
28
|
+
defaultSelectedKeys?: Iterable<Key>;
|
|
29
|
+
/** Called with the selected chips' values when the selection changes. */
|
|
30
|
+
onSelectionChange?: (keys: Set<Key>) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The last selected chip can be deselected, leaving none. `false` keeps at least one chip
|
|
33
|
+
* selected. @default true
|
|
34
|
+
*/
|
|
35
|
+
deselectable?: boolean;
|
|
36
|
+
/** Disables every chip that takes part in the selection. @default false */
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* `wrap` onto new rows, or one row that `scroll`s sideways (M3 suggests scrolling past
|
|
40
|
+
* two rows). @default "wrap"
|
|
41
|
+
*/
|
|
42
|
+
layout?: ChipSetLayout;
|
|
43
|
+
/**
|
|
44
|
+
* Web density, `0` to `-3`, for the set and its chips: each step takes 4px off the chips
|
|
45
|
+
* (32px at 0, 24px at -2 and -3) and puts 2px more between rows, so each chip's 48px touch
|
|
46
|
+
* target stays clear of the rows above and below. Left out, the set takes the density of the
|
|
47
|
+
* nearest `ThemeProvider` or `ThemeScope`; M3 asks for density to be the reader's choice, so
|
|
48
|
+
* prefer setting it there.
|
|
49
|
+
* @default 0
|
|
50
|
+
*/
|
|
51
|
+
density?: Density;
|
|
52
|
+
/** Classes for each part, by slot. */
|
|
53
|
+
classNames?: ChipSetClassNames;
|
|
54
|
+
}
|
|
55
|
+
export type ChipSetProps = ChipSetOwnProps & Naming & Omit<ComponentPropsWithRef<'div'>, keyof ChipSetOwnProps | 'aria-label' | 'aria-labelledby'>;
|
|
56
|
+
/**
|
|
57
|
+
* M3 chip set: a labelled group of chips, 8px apart, that wraps or scrolls sideways. It is
|
|
58
|
+
* one Tab stop, and arrow keys move between its chips. With `selectionMode`, its filter
|
|
59
|
+
* chips (each with a `value`) share one selection; a single selection is a radio group,
|
|
60
|
+
* whose arrow keys select as they move.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <ChipSet aria-label="Diet" selectionMode="multiple" defaultSelectedKeys={['vegan']}>
|
|
64
|
+
* <FilterChip value="vegan">Vegan</FilterChip>
|
|
65
|
+
* <FilterChip value="gluten-free">Gluten-free</FilterChip>
|
|
66
|
+
* </ChipSet>
|
|
67
|
+
*/
|
|
68
|
+
export declare function ChipSet({ children, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, deselectable, disabled, layout, density, classNames, className, ref, onKeyDown, onFocus, onPointerDown, ...rest }: ChipSetProps): import("react").JSX.Element;
|
|
69
|
+
//#endregion
|
|
70
|
+
//# sourceMappingURL=ChipSet.d.ts.map
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { densityAttribute } from "../../tokens/density.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { ToggleGroupStateContext } from "../../primitives/ButtonBase.js";
|
|
5
|
+
import { focusCheckedRadio, notePointerDown, radioGroupKeyDown } from "../../utils/radio-group-keys.js";
|
|
6
|
+
import { chipSetStyles } from "./chip-styles.js";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useObjectRef } from "react-aria";
|
|
10
|
+
import { useToggleGroupState } from "react-stately";
|
|
11
|
+
//#region src/components/chip/ChipSet.tsx
|
|
12
|
+
const FOCUSABLE = "button:not([disabled]):not([tabindex=\"-1\"]), a[href]:not([tabindex=\"-1\"]), [tabindex=\"0\"]";
|
|
13
|
+
function focusables(root) {
|
|
14
|
+
return [...root.querySelectorAll(FOCUSABLE)].filter((element) => !element.closest("[hidden], [inert]"));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Keyboard use of a chip set (M3 chips, keyboard navigation): the set is one Tab stop,
|
|
18
|
+
* arrow keys move between its chips (and a chip's remove button), Home and End go to the
|
|
19
|
+
* first and last. Left and right follow the set's direction. Leaving with Tab and coming
|
|
20
|
+
* back returns to the chip that had focus. A single-selection set is a radio group (WAI-ARIA
|
|
21
|
+
* APG): the arrow keys, Home and End select the chip they move to, wrapping at the ends,
|
|
22
|
+
* and Tab enters at the selected chip.
|
|
23
|
+
*/
|
|
24
|
+
function useChipSetKeyboard(single) {
|
|
25
|
+
const lastFocused = useRef(null);
|
|
26
|
+
const onKeyDown = (event) => {
|
|
27
|
+
const from = event.currentTarget.ownerDocument.activeElement;
|
|
28
|
+
moveFocus(event);
|
|
29
|
+
const to = event.currentTarget.ownerDocument.activeElement;
|
|
30
|
+
if (event.key !== "Tab" && to !== from) revealInRow(event.currentTarget, to);
|
|
31
|
+
};
|
|
32
|
+
const moveFocus = (event) => {
|
|
33
|
+
if (single && radioGroupKeyDown(event)) return;
|
|
34
|
+
const root = event.currentTarget;
|
|
35
|
+
const items = focusables(root);
|
|
36
|
+
const current = items.indexOf(event.target);
|
|
37
|
+
if (current < 0 || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
38
|
+
const rtl = getComputedStyle(root).direction === "rtl";
|
|
39
|
+
let next;
|
|
40
|
+
switch (event.key) {
|
|
41
|
+
case "ArrowDown":
|
|
42
|
+
next = current + 1;
|
|
43
|
+
break;
|
|
44
|
+
case "ArrowUp":
|
|
45
|
+
next = current - 1;
|
|
46
|
+
break;
|
|
47
|
+
case "ArrowRight":
|
|
48
|
+
next = rtl ? current - 1 : current + 1;
|
|
49
|
+
break;
|
|
50
|
+
case "ArrowLeft":
|
|
51
|
+
next = rtl ? current + 1 : current - 1;
|
|
52
|
+
break;
|
|
53
|
+
case "Home":
|
|
54
|
+
next = 0;
|
|
55
|
+
break;
|
|
56
|
+
case "End":
|
|
57
|
+
next = items.length - 1;
|
|
58
|
+
break;
|
|
59
|
+
case "Tab":
|
|
60
|
+
lastFocused.current = items[current] ?? null;
|
|
61
|
+
(event.shiftKey ? items[0] : items.at(-1))?.focus();
|
|
62
|
+
return;
|
|
63
|
+
default: return;
|
|
64
|
+
}
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
items[Math.max(0, Math.min(items.length - 1, next))]?.focus();
|
|
67
|
+
};
|
|
68
|
+
const onFocus = (event) => {
|
|
69
|
+
const from = event.relatedTarget;
|
|
70
|
+
if (from && event.currentTarget.contains(from)) return;
|
|
71
|
+
const target = lastFocused.current;
|
|
72
|
+
lastFocused.current = null;
|
|
73
|
+
if (single && focusCheckedRadio(event)) return;
|
|
74
|
+
if (target && target !== event.target && event.currentTarget.contains(target)) target.focus();
|
|
75
|
+
};
|
|
76
|
+
const onPointerDown = () => {
|
|
77
|
+
lastFocused.current = null;
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
onKeyDown,
|
|
81
|
+
onFocus,
|
|
82
|
+
onPointerDown
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Scrolls a sideways-scrolling set just far enough to show the chip the arrow keys moved to,
|
|
87
|
+
* focus ring included: `focus()` scrolls only a chip that is wholly hidden, so one partly past
|
|
88
|
+
* the row's edge stayed clipped. Only the row moves, never the page.
|
|
89
|
+
*/
|
|
90
|
+
function revealInRow(row, chip) {
|
|
91
|
+
if (!(chip instanceof HTMLElement) || row.scrollWidth <= row.clientWidth) return;
|
|
92
|
+
const edges = row.getBoundingClientRect();
|
|
93
|
+
const box = chip.getBoundingClientRect();
|
|
94
|
+
const ring = 5;
|
|
95
|
+
const past = Math.max(0, box.right + ring - edges.right) - Math.max(0, edges.left - box.left + ring);
|
|
96
|
+
if (past !== 0) row.scrollLeft += past;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Keeps focus in the set when the focused chip goes away, e.g. after Backspace or Delete
|
|
100
|
+
* removes it (WCAG 2.4.3): focus moves to the next stop, or the previous one at the end,
|
|
101
|
+
* or the set itself once it's empty. The stops are read whenever focus enters a stop or a
|
|
102
|
+
* key is pressed, so the removed one's neighbours are known after it has left the DOM.
|
|
103
|
+
*/
|
|
104
|
+
function useFocusAfterRemoval(rootRef) {
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const root = rootRef.current;
|
|
107
|
+
if (!root) return;
|
|
108
|
+
let focused = null;
|
|
109
|
+
let stops = [];
|
|
110
|
+
const remember = () => {
|
|
111
|
+
const active = root.ownerDocument.activeElement;
|
|
112
|
+
stops = focusables(root);
|
|
113
|
+
focused = active instanceof HTMLElement && stops.includes(active) ? active : null;
|
|
114
|
+
};
|
|
115
|
+
const forget = (event) => {
|
|
116
|
+
if (event.relatedTarget instanceof Node && !root.contains(event.relatedTarget)) focused = null;
|
|
117
|
+
};
|
|
118
|
+
const restore = () => {
|
|
119
|
+
if (!focused || focused.isConnected) return;
|
|
120
|
+
const active = root.ownerDocument.activeElement;
|
|
121
|
+
const lost = focused;
|
|
122
|
+
focused = null;
|
|
123
|
+
if (active && active !== root.ownerDocument.body) return;
|
|
124
|
+
const index = stops.indexOf(lost);
|
|
125
|
+
(stops.slice(index + 1).find((stop) => stop.isConnected) ?? stops.slice(0, index).reverse().find((stop) => stop.isConnected) ?? root).focus({ preventScroll: true });
|
|
126
|
+
};
|
|
127
|
+
const observer = new MutationObserver(restore);
|
|
128
|
+
observer.observe(root, {
|
|
129
|
+
childList: true,
|
|
130
|
+
subtree: true
|
|
131
|
+
});
|
|
132
|
+
root.addEventListener("focusin", remember);
|
|
133
|
+
root.addEventListener("keydown", remember, true);
|
|
134
|
+
root.addEventListener("focusout", forget);
|
|
135
|
+
return () => {
|
|
136
|
+
observer.disconnect();
|
|
137
|
+
root.removeEventListener("focusin", remember);
|
|
138
|
+
root.removeEventListener("keydown", remember, true);
|
|
139
|
+
root.removeEventListener("focusout", forget);
|
|
140
|
+
};
|
|
141
|
+
}, [rootRef]);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* M3 chip set: a labelled group of chips, 8px apart, that wraps or scrolls sideways. It is
|
|
145
|
+
* one Tab stop, and arrow keys move between its chips. With `selectionMode`, its filter
|
|
146
|
+
* chips (each with a `value`) share one selection; a single selection is a radio group,
|
|
147
|
+
* whose arrow keys select as they move.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* <ChipSet aria-label="Diet" selectionMode="multiple" defaultSelectedKeys={['vegan']}>
|
|
151
|
+
* <FilterChip value="vegan">Vegan</FilterChip>
|
|
152
|
+
* <FilterChip value="gluten-free">Gluten-free</FilterChip>
|
|
153
|
+
* </ChipSet>
|
|
154
|
+
*/
|
|
155
|
+
function ChipSet({ children, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, deselectable = true, disabled, layout, density, classNames, className, ref, onKeyDown, onFocus, onPointerDown, ...rest }) {
|
|
156
|
+
const state = useToggleGroupState({
|
|
157
|
+
selectionMode: selectionMode === "single" ? "single" : "multiple",
|
|
158
|
+
selectedKeys,
|
|
159
|
+
defaultSelectedKeys,
|
|
160
|
+
onSelectionChange,
|
|
161
|
+
disallowEmptySelection: !deselectable,
|
|
162
|
+
isDisabled: disabled
|
|
163
|
+
});
|
|
164
|
+
const keyboard = useChipSetKeyboard(selectionMode === "single");
|
|
165
|
+
const rootRef = useObjectRef(ref);
|
|
166
|
+
useFocusAfterRemoval(rootRef);
|
|
167
|
+
return /* @__PURE__ */ jsx("div", {
|
|
168
|
+
role: selectionMode === "single" ? "radiogroup" : "group",
|
|
169
|
+
tabIndex: -1,
|
|
170
|
+
...rest,
|
|
171
|
+
ref: rootRef,
|
|
172
|
+
"data-layout": layout ?? "wrap",
|
|
173
|
+
...densityAttribute(density),
|
|
174
|
+
"aria-disabled": disabled || void 0,
|
|
175
|
+
onKeyDown: (event) => {
|
|
176
|
+
keyboard.onKeyDown(event);
|
|
177
|
+
onKeyDown?.(event);
|
|
178
|
+
},
|
|
179
|
+
onFocus: (event) => {
|
|
180
|
+
keyboard.onFocus(event);
|
|
181
|
+
onFocus?.(event);
|
|
182
|
+
},
|
|
183
|
+
onPointerDown: (event) => {
|
|
184
|
+
keyboard.onPointerDown();
|
|
185
|
+
onPointerDown?.(event);
|
|
186
|
+
},
|
|
187
|
+
onPointerDownCapture: selectionMode === "single" ? notePointerDown : void 0,
|
|
188
|
+
className: chipSetStyles({ layout }).root({ class: cn(classNames?.root, className) }),
|
|
189
|
+
children: /* @__PURE__ */ jsx(ToggleGroupStateContext, {
|
|
190
|
+
value: selectionMode === "none" ? null : state,
|
|
191
|
+
children
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { ChipSet };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=ChipSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChipSet.js","names":[],"sources":["../../../src/components/chip/ChipSet.tsx"],"sourcesContent":["'use client';\n\nimport {\n useEffect,\n useRef,\n type ComponentPropsWithRef,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { useObjectRef } from 'react-aria';\nimport { useToggleGroupState, type Key } from 'react-stately';\nimport { densityAttribute, type Density } from '../../tokens/density';\nimport { ToggleGroupStateContext } from '../../primitives/ButtonBase';\nimport { cn } from '../../utils/cn';\nimport {\n focusCheckedRadio,\n notePointerDown,\n radioGroupKeyDown,\n} from '../../utils/radio-group-keys';\nimport { chipSetStyles, type ChipSetLayout } from './chip-styles';\n\nexport interface ChipSetClassNames {\n /** The set's container, merged with `className`. */\n root?: string;\n}\n\ntype Naming =\n | {\n /** Accessible name for the set of chips. Required unless `aria-labelledby` is set. */\n 'aria-label': string;\n }\n | {\n /** The id of the element that names the set. Required unless `aria-label` is set. */\n 'aria-labelledby': string;\n };\n\ninterface ChipSetOwnProps {\n /** The chips. Filter chips take part in the set's selection with a `value`. */\n children: ReactNode;\n /**\n * Filter chip selection: `single` (a radio group: selecting a chip clears the others)\n * or `multiple`. With `none`, each chip keeps its own state. @default \"none\"\n */\n selectionMode?: 'none' | 'single' | 'multiple';\n /** The selected chips' values (controlled). */\n selectedKeys?: Iterable<Key>;\n /** The chips selected at first (uncontrolled). */\n defaultSelectedKeys?: Iterable<Key>;\n /** Called with the selected chips' values when the selection changes. */\n onSelectionChange?: (keys: Set<Key>) => void;\n /**\n * The last selected chip can be deselected, leaving none. `false` keeps at least one chip\n * selected. @default true\n */\n deselectable?: boolean;\n /** Disables every chip that takes part in the selection. @default false */\n disabled?: boolean;\n /**\n * `wrap` onto new rows, or one row that `scroll`s sideways (M3 suggests scrolling past\n * two rows). @default \"wrap\"\n */\n layout?: ChipSetLayout;\n /**\n * Web density, `0` to `-3`, for the set and its chips: each step takes 4px off the chips\n * (32px at 0, 24px at -2 and -3) and puts 2px more between rows, so each chip's 48px touch\n * target stays clear of the rows above and below. Left out, the set takes the density of the\n * nearest `ThemeProvider` or `ThemeScope`; M3 asks for density to be the reader's choice, so\n * prefer setting it there.\n * @default 0\n */\n density?: Density;\n /** Classes for each part, by slot. */\n classNames?: ChipSetClassNames;\n}\n\nexport type ChipSetProps = ChipSetOwnProps &\n Naming &\n Omit<ComponentPropsWithRef<'div'>, keyof ChipSetOwnProps | 'aria-label' | 'aria-labelledby'>;\n\nconst FOCUSABLE =\n 'button:not([disabled]):not([tabindex=\"-1\"]), a[href]:not([tabindex=\"-1\"]), [tabindex=\"0\"]';\n\nfunction focusables(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (element) => !element.closest('[hidden], [inert]'),\n );\n}\n\n/**\n * Keyboard use of a chip set (M3 chips, keyboard navigation): the set is one Tab stop,\n * arrow keys move between its chips (and a chip's remove button), Home and End go to the\n * first and last. Left and right follow the set's direction. Leaving with Tab and coming\n * back returns to the chip that had focus. A single-selection set is a radio group (WAI-ARIA\n * APG): the arrow keys, Home and End select the chip they move to, wrapping at the ends,\n * and Tab enters at the selected chip.\n */\nfunction useChipSetKeyboard(single: boolean) {\n const lastFocused = useRef<HTMLElement | null>(null);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const from = event.currentTarget.ownerDocument.activeElement;\n moveFocus(event);\n const to = event.currentTarget.ownerDocument.activeElement;\n if (event.key !== 'Tab' && to !== from) revealInRow(event.currentTarget, to);\n };\n\n const moveFocus = (event: KeyboardEvent<HTMLDivElement>) => {\n if (single && radioGroupKeyDown(event)) return;\n const root = event.currentTarget;\n const items = focusables(root);\n const current = items.indexOf(event.target as HTMLElement);\n if (current < 0 || event.altKey || event.ctrlKey || event.metaKey) return;\n const rtl = getComputedStyle(root).direction === 'rtl';\n let next: number;\n switch (event.key) {\n case 'ArrowDown':\n next = current + 1;\n break;\n case 'ArrowUp':\n next = current - 1;\n break;\n case 'ArrowRight':\n next = rtl ? current - 1 : current + 1;\n break;\n case 'ArrowLeft':\n next = rtl ? current + 1 : current - 1;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = items.length - 1;\n break;\n case 'Tab':\n // Leave the set: move to its first or last stop, and let the browser go on from there.\n lastFocused.current = items[current] ?? null;\n (event.shiftKey ? items[0] : items.at(-1))?.focus();\n return;\n default:\n return;\n }\n event.preventDefault();\n items[Math.max(0, Math.min(items.length - 1, next))]?.focus();\n };\n\n const onFocus = (event: FocusEvent<HTMLDivElement>) => {\n const from = event.relatedTarget as Node | null;\n if (from && event.currentTarget.contains(from)) return;\n const target = lastFocused.current;\n lastFocused.current = null;\n if (single && focusCheckedRadio(event)) return;\n if (target && target !== event.target && event.currentTarget.contains(target)) target.focus();\n };\n\n // A pointer press focuses the chip it lands on, never the one left with Tab.\n const onPointerDown = () => {\n lastFocused.current = null;\n };\n\n return { onKeyDown, onFocus, onPointerDown };\n}\n\n/**\n * Scrolls a sideways-scrolling set just far enough to show the chip the arrow keys moved to,\n * focus ring included: `focus()` scrolls only a chip that is wholly hidden, so one partly past\n * the row's edge stayed clipped. Only the row moves, never the page.\n */\nfunction revealInRow(row: HTMLElement, chip: Element | null) {\n if (!(chip instanceof HTMLElement) || row.scrollWidth <= row.clientWidth) return;\n const edges = row.getBoundingClientRect();\n const box = chip.getBoundingClientRect();\n // The focus ring: a 3px outline 2px outside the chip.\n const ring = 5;\n const past =\n Math.max(0, box.right + ring - edges.right) - Math.max(0, edges.left - box.left + ring);\n if (past !== 0) row.scrollLeft += past;\n}\n\n/**\n * Keeps focus in the set when the focused chip goes away, e.g. after Backspace or Delete\n * removes it (WCAG 2.4.3): focus moves to the next stop, or the previous one at the end,\n * or the set itself once it's empty. The stops are read whenever focus enters a stop or a\n * key is pressed, so the removed one's neighbours are known after it has left the DOM.\n */\nfunction useFocusAfterRemoval(rootRef: { current: HTMLDivElement | null }) {\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n let focused: HTMLElement | null = null;\n let stops: HTMLElement[] = [];\n const remember = () => {\n const active = root.ownerDocument.activeElement;\n stops = focusables(root);\n focused = active instanceof HTMLElement && stops.includes(active) ? active : null;\n };\n const forget = (event: globalThis.FocusEvent) => {\n // Focus moving elsewhere (not a removal, which leaves nothing focused) ends the watch.\n if (event.relatedTarget instanceof Node && !root.contains(event.relatedTarget)) {\n focused = null;\n }\n };\n const restore = () => {\n if (!focused || focused.isConnected) return;\n const active = root.ownerDocument.activeElement;\n const lost = focused;\n focused = null;\n if (active && active !== root.ownerDocument.body) return;\n const index = stops.indexOf(lost);\n const next =\n stops.slice(index + 1).find((stop) => stop.isConnected) ??\n stops\n .slice(0, index)\n .reverse()\n .find((stop) => stop.isConnected);\n // The neighbour sits beside the removed chip: focus it without scrolling the page\n // (a press on a partly hidden chip's remove button scrolled it, 2026-10-15).\n (next ?? root).focus({ preventScroll: true });\n };\n const observer = new MutationObserver(restore);\n observer.observe(root, { childList: true, subtree: true });\n root.addEventListener('focusin', remember);\n root.addEventListener('keydown', remember, true);\n root.addEventListener('focusout', forget);\n return () => {\n observer.disconnect();\n root.removeEventListener('focusin', remember);\n root.removeEventListener('keydown', remember, true);\n root.removeEventListener('focusout', forget);\n };\n }, [rootRef]);\n}\n\n/**\n * M3 chip set: a labelled group of chips, 8px apart, that wraps or scrolls sideways. It is\n * one Tab stop, and arrow keys move between its chips. With `selectionMode`, its filter\n * chips (each with a `value`) share one selection; a single selection is a radio group,\n * whose arrow keys select as they move.\n *\n * @example\n * <ChipSet aria-label=\"Diet\" selectionMode=\"multiple\" defaultSelectedKeys={['vegan']}>\n * <FilterChip value=\"vegan\">Vegan</FilterChip>\n * <FilterChip value=\"gluten-free\">Gluten-free</FilterChip>\n * </ChipSet>\n */\nexport function ChipSet({\n children,\n selectionMode = 'none',\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n deselectable = true,\n disabled,\n layout,\n density,\n classNames,\n className,\n ref,\n onKeyDown,\n onFocus,\n onPointerDown,\n ...rest\n}: ChipSetProps) {\n const state = useToggleGroupState({\n selectionMode: selectionMode === 'single' ? 'single' : 'multiple',\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n disallowEmptySelection: !deselectable,\n isDisabled: disabled,\n });\n const keyboard = useChipSetKeyboard(selectionMode === 'single');\n const rootRef = useObjectRef(ref);\n useFocusAfterRemoval(rootRef);\n return (\n <div\n role={selectionMode === 'single' ? 'radiogroup' : 'group'}\n // Focusable from script only: it takes focus when its last chip is removed.\n tabIndex={-1}\n {...rest}\n ref={rootRef}\n data-layout={layout ?? 'wrap'}\n {...densityAttribute(density)}\n aria-disabled={disabled || undefined}\n onKeyDown={(event) => {\n keyboard.onKeyDown(event);\n onKeyDown?.(event);\n }}\n onFocus={(event) => {\n keyboard.onFocus(event);\n onFocus?.(event);\n }}\n onPointerDown={(event) => {\n keyboard.onPointerDown();\n onPointerDown?.(event);\n }}\n // A press's focus stays on the chip it lands on, never the checked one (2026-10-15).\n onPointerDownCapture={selectionMode === 'single' ? notePointerDown : undefined}\n className={chipSetStyles({ layout }).root({ class: cn(classNames?.root, className) })}\n >\n <ToggleGroupStateContext value={selectionMode === 'none' ? null : state}>\n {children}\n </ToggleGroupStateContext>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgFA,MAAM,YACJ;AAEF,SAAS,WAAW,MAAkC;CACpD,OAAO,CAAC,GAAG,KAAK,iBAA8B,SAAS,CAAC,CAAC,CAAC,QACvD,YAAY,CAAC,QAAQ,QAAQ,mBAAmB,CACnD;AACF;;;;;;;;;AAUA,SAAS,mBAAmB,QAAiB;CAC3C,MAAM,cAAc,OAA2B,IAAI;CAEnD,MAAM,aAAa,UAAyC;EAC1D,MAAM,OAAO,MAAM,cAAc,cAAc;EAC/C,UAAU,KAAK;EACf,MAAM,KAAK,MAAM,cAAc,cAAc;EAC7C,IAAI,MAAM,QAAQ,SAAS,OAAO,MAAM,YAAY,MAAM,eAAe,EAAE;CAC7E;CAEA,MAAM,aAAa,UAAyC;EAC1D,IAAI,UAAU,kBAAkB,KAAK,GAAG;EACxC,MAAM,OAAO,MAAM;EACnB,MAAM,QAAQ,WAAW,IAAI;EAC7B,MAAM,UAAU,MAAM,QAAQ,MAAM,MAAqB;EACzD,IAAI,UAAU,KAAK,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS;EACnE,MAAM,MAAM,iBAAiB,IAAI,CAAC,CAAC,cAAc;EACjD,IAAI;EACJ,QAAQ,MAAM,KAAd;GACE,KAAK;IACH,OAAO,UAAU;IACjB;GACF,KAAK;IACH,OAAO,UAAU;IACjB;GACF,KAAK;IACH,OAAO,MAAM,UAAU,IAAI,UAAU;IACrC;GACF,KAAK;IACH,OAAO,MAAM,UAAU,IAAI,UAAU;IACrC;GACF,KAAK;IACH,OAAO;IACP;GACF,KAAK;IACH,OAAO,MAAM,SAAS;IACtB;GACF,KAAK;IAEH,YAAY,UAAU,MAAM,YAAY;IACxC,CAAC,MAAM,WAAW,MAAM,KAAK,MAAM,GAAG,EAAE,EAAA,EAAI,MAAM;IAClD;GACF,SACE;EACJ;EACA,MAAM,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OAAO;EAC5B,iBAAe,YAAY,KAAA;EAC3B,YAAY,UAAU;GACpB,SAAS,UAAU,KAAK;GACxB,YAAY,KAAK;EACnB;EACA,UAAU,UAAU;GAClB,SAAS,QAAQ,KAAK;GACtB,UAAU,KAAK;EACjB;EACA,gBAAgB,UAAU;GACxB,SAAS,cAAc;GACvB,gBAAgB,KAAK;EACvB;EAEA,sBAAsB,kBAAkB,WAAW,kBAAkB,KAAA;EACrE,WAAW,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,MAAM,SAAS,EAAE,CAAC;EAEpF,UAAA,oBAAC,yBAAD;GAAyB,OAAO,kBAAkB,SAAS,OAAO;GAC/D;EACsB,CAAA;CACtB,CAAA;AAET"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { VariantProps } from "../../utils/tv.js";
|
|
2
|
+
//#region src/components/chip/chip-styles.d.ts
|
|
3
|
+
/** Variant definitions for the chips; extend them to add variants. */
|
|
4
|
+
export declare const chipStyles: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
kind: {
|
|
6
|
+
assist: {
|
|
7
|
+
root: string[];
|
|
8
|
+
leading: string;
|
|
9
|
+
};
|
|
10
|
+
suggestion: {
|
|
11
|
+
root: string[];
|
|
12
|
+
leading: string;
|
|
13
|
+
};
|
|
14
|
+
filter: {
|
|
15
|
+
root: string[];
|
|
16
|
+
leading: string[];
|
|
17
|
+
};
|
|
18
|
+
input: {
|
|
19
|
+
root: string[];
|
|
20
|
+
leading: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* How the chip is built: one element (`none`); a container of two buttons, its main
|
|
25
|
+
* part and the remove button (`two`); or a remove-only input chip, whose one focus stop
|
|
26
|
+
* is the remove button, so its focus ring circles the whole chip (`removeOnly`).
|
|
27
|
+
*/
|
|
28
|
+
split: {
|
|
29
|
+
none: {};
|
|
30
|
+
two: {
|
|
31
|
+
root: string[];
|
|
32
|
+
remove: string;
|
|
33
|
+
};
|
|
34
|
+
removeOnly: {
|
|
35
|
+
root: string[];
|
|
36
|
+
remove: string;
|
|
37
|
+
primary: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
elevated: {
|
|
41
|
+
true: {
|
|
42
|
+
root: string[];
|
|
43
|
+
};
|
|
44
|
+
false: {
|
|
45
|
+
root: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** `strong` draws the border in `outline` for 3:1 contrast (M3's accessibility guidance). */
|
|
49
|
+
outline: {
|
|
50
|
+
standard: {};
|
|
51
|
+
strong: {};
|
|
52
|
+
};
|
|
53
|
+
leading: {
|
|
54
|
+
none: {};
|
|
55
|
+
icon: {};
|
|
56
|
+
avatar: {};
|
|
57
|
+
};
|
|
58
|
+
trailing: {
|
|
59
|
+
true: {};
|
|
60
|
+
false: {};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
root: string[];
|
|
64
|
+
content: string;
|
|
65
|
+
leading: string;
|
|
66
|
+
label: string;
|
|
67
|
+
trailing: string;
|
|
68
|
+
check: string[];
|
|
69
|
+
checkInner: string;
|
|
70
|
+
checkIcon: string;
|
|
71
|
+
avatar: string;
|
|
72
|
+
remove: string[];
|
|
73
|
+
primary: string;
|
|
74
|
+
}, undefined, {
|
|
75
|
+
kind: {
|
|
76
|
+
assist: {
|
|
77
|
+
root: string[];
|
|
78
|
+
leading: string;
|
|
79
|
+
};
|
|
80
|
+
suggestion: {
|
|
81
|
+
root: string[];
|
|
82
|
+
leading: string;
|
|
83
|
+
};
|
|
84
|
+
filter: {
|
|
85
|
+
root: string[];
|
|
86
|
+
leading: string[];
|
|
87
|
+
};
|
|
88
|
+
input: {
|
|
89
|
+
root: string[];
|
|
90
|
+
leading: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* How the chip is built: one element (`none`); a container of two buttons, its main
|
|
95
|
+
* part and the remove button (`two`); or a remove-only input chip, whose one focus stop
|
|
96
|
+
* is the remove button, so its focus ring circles the whole chip (`removeOnly`).
|
|
97
|
+
*/
|
|
98
|
+
split: {
|
|
99
|
+
none: {};
|
|
100
|
+
two: {
|
|
101
|
+
root: string[];
|
|
102
|
+
remove: string;
|
|
103
|
+
};
|
|
104
|
+
removeOnly: {
|
|
105
|
+
root: string[];
|
|
106
|
+
remove: string;
|
|
107
|
+
primary: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
elevated: {
|
|
111
|
+
true: {
|
|
112
|
+
root: string[];
|
|
113
|
+
};
|
|
114
|
+
false: {
|
|
115
|
+
root: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
/** `strong` draws the border in `outline` for 3:1 contrast (M3's accessibility guidance). */
|
|
119
|
+
outline: {
|
|
120
|
+
standard: {};
|
|
121
|
+
strong: {};
|
|
122
|
+
};
|
|
123
|
+
leading: {
|
|
124
|
+
none: {};
|
|
125
|
+
icon: {};
|
|
126
|
+
avatar: {};
|
|
127
|
+
};
|
|
128
|
+
trailing: {
|
|
129
|
+
true: {};
|
|
130
|
+
false: {};
|
|
131
|
+
};
|
|
132
|
+
}, {
|
|
133
|
+
root: string[];
|
|
134
|
+
content: string;
|
|
135
|
+
leading: string;
|
|
136
|
+
label: string;
|
|
137
|
+
trailing: string;
|
|
138
|
+
check: string[];
|
|
139
|
+
checkInner: string;
|
|
140
|
+
checkIcon: string;
|
|
141
|
+
avatar: string;
|
|
142
|
+
remove: string[];
|
|
143
|
+
primary: string;
|
|
144
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
145
|
+
kind: {
|
|
146
|
+
assist: {
|
|
147
|
+
root: string[];
|
|
148
|
+
leading: string;
|
|
149
|
+
};
|
|
150
|
+
suggestion: {
|
|
151
|
+
root: string[];
|
|
152
|
+
leading: string;
|
|
153
|
+
};
|
|
154
|
+
filter: {
|
|
155
|
+
root: string[];
|
|
156
|
+
leading: string[];
|
|
157
|
+
};
|
|
158
|
+
input: {
|
|
159
|
+
root: string[];
|
|
160
|
+
leading: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* How the chip is built: one element (`none`); a container of two buttons, its main
|
|
165
|
+
* part and the remove button (`two`); or a remove-only input chip, whose one focus stop
|
|
166
|
+
* is the remove button, so its focus ring circles the whole chip (`removeOnly`).
|
|
167
|
+
*/
|
|
168
|
+
split: {
|
|
169
|
+
none: {};
|
|
170
|
+
two: {
|
|
171
|
+
root: string[];
|
|
172
|
+
remove: string;
|
|
173
|
+
};
|
|
174
|
+
removeOnly: {
|
|
175
|
+
root: string[];
|
|
176
|
+
remove: string;
|
|
177
|
+
primary: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
elevated: {
|
|
181
|
+
true: {
|
|
182
|
+
root: string[];
|
|
183
|
+
};
|
|
184
|
+
false: {
|
|
185
|
+
root: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/** `strong` draws the border in `outline` for 3:1 contrast (M3's accessibility guidance). */
|
|
189
|
+
outline: {
|
|
190
|
+
standard: {};
|
|
191
|
+
strong: {};
|
|
192
|
+
};
|
|
193
|
+
leading: {
|
|
194
|
+
none: {};
|
|
195
|
+
icon: {};
|
|
196
|
+
avatar: {};
|
|
197
|
+
};
|
|
198
|
+
trailing: {
|
|
199
|
+
true: {};
|
|
200
|
+
false: {};
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
root: string[];
|
|
204
|
+
content: string;
|
|
205
|
+
leading: string;
|
|
206
|
+
label: string;
|
|
207
|
+
trailing: string;
|
|
208
|
+
check: string[];
|
|
209
|
+
checkInner: string;
|
|
210
|
+
checkIcon: string;
|
|
211
|
+
avatar: string;
|
|
212
|
+
remove: string[];
|
|
213
|
+
primary: string;
|
|
214
|
+
}>>;
|
|
215
|
+
/**
|
|
216
|
+
* Variant definitions for {@link ChipSet}. Chips are 8px apart (M3: "Keep an 8dp minimum
|
|
217
|
+
* space between chips"). With web density, rows come 2px further apart per step, half of what
|
|
218
|
+
* each chip loses (8 → 10 → 12px; 12px at -3, where chips stay 24px), so a chip's 48px touch
|
|
219
|
+
* target never reaches the chips in the rows above and below.
|
|
220
|
+
*/
|
|
221
|
+
export declare const chipSetStyles: import("tailwind-variants").TVReturnType<{
|
|
222
|
+
layout: {
|
|
223
|
+
wrap: {
|
|
224
|
+
root: string;
|
|
225
|
+
};
|
|
226
|
+
scroll: {
|
|
227
|
+
root: string[];
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
}, {
|
|
231
|
+
root: string;
|
|
232
|
+
}, undefined, {
|
|
233
|
+
layout: {
|
|
234
|
+
wrap: {
|
|
235
|
+
root: string;
|
|
236
|
+
};
|
|
237
|
+
scroll: {
|
|
238
|
+
root: string[];
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}, {
|
|
242
|
+
root: string;
|
|
243
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
244
|
+
layout: {
|
|
245
|
+
wrap: {
|
|
246
|
+
root: string;
|
|
247
|
+
};
|
|
248
|
+
scroll: {
|
|
249
|
+
root: string[];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
}, {
|
|
253
|
+
root: string;
|
|
254
|
+
}>>;
|
|
255
|
+
/**
|
|
256
|
+
* The variants of {@link chipStyles}, for building on its styles. They are the recipe's keys, not
|
|
257
|
+
* component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
|
|
258
|
+
*/
|
|
259
|
+
export type ChipStyleProps = VariantProps<typeof chipStyles>;
|
|
260
|
+
export type ChipOutline = NonNullable<ChipStyleProps['outline']>;
|
|
261
|
+
export type ChipSetLayout = NonNullable<VariantProps<typeof chipSetStyles>['layout']>;
|
|
262
|
+
//#endregion
|
|
263
|
+
//# sourceMappingURL=chip-styles.d.ts.map
|