@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,121 @@
|
|
|
1
|
+
import { Density } from "../../tokens/density.js";
|
|
2
|
+
import { RootDOMProps, WrapperRootDOMProps } from "../../utils/root-props.js";
|
|
3
|
+
import { SelectionControlClassNames } from "../../primitives/SelectionControl.js";
|
|
4
|
+
import { CSSProperties, ReactNode, Ref } from "react";
|
|
5
|
+
import { AriaRadioGroupProps, AriaRadioProps } from "react-aria";
|
|
6
|
+
//#region src/components/radio/RadioGroup.d.ts
|
|
7
|
+
export interface RadioGroupClassNames {
|
|
8
|
+
/** The group's outer element. */
|
|
9
|
+
root?: string;
|
|
10
|
+
/** The visible group label. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** The wrapper around the radio buttons. */
|
|
13
|
+
options?: string;
|
|
14
|
+
/** The helper text below the options. */
|
|
15
|
+
supportingText?: string;
|
|
16
|
+
/** The error message, shown in place of the helper text while invalid. */
|
|
17
|
+
errorText?: string;
|
|
18
|
+
}
|
|
19
|
+
type RenamedGroupProps = 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'description' | 'label' | 'onChange' | 'validationState';
|
|
20
|
+
interface RadioGroupOwnProps extends Omit<AriaRadioGroupProps, RenamedGroupProps>, Omit<RootDOMProps, keyof AriaRadioGroupProps> {
|
|
21
|
+
/** Visible group label. */
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
/** Helper text below the options. */
|
|
24
|
+
supportingText?: ReactNode;
|
|
25
|
+
/** Called with the selected option's value when the selection changes. */
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
/** Turns every option off: none can be selected or focused. @default false */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** The options can be focused but the selection can't change. @default false */
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
/** An option must be selected before the form submits. @default false */
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** Shows the error state. @default false */
|
|
34
|
+
invalid?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Web density, `0` to `-3`, for every option: each step takes 4px off their round state
|
|
37
|
+
* layers (40px at 0, 28px at -3) and puts 2px more between rows, so each option keeps a
|
|
38
|
+
* 48px touch target that never reaches the next one's ring. Left out, the group takes the
|
|
39
|
+
* density of the nearest `ThemeProvider` or `ThemeScope`; M3 asks for density to be the
|
|
40
|
+
* reader's choice, so prefer setting it there.
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
density?: Density;
|
|
44
|
+
/** The options: `Radio` elements. */
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
/** Classes for the root element, merged with `classNames.root`; consumer classes win. */
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Classes for each part, by slot. `classNames.root` is merged with `className`. */
|
|
49
|
+
classNames?: RadioGroupClassNames;
|
|
50
|
+
/** Inline styles for the root element. */
|
|
51
|
+
style?: CSSProperties;
|
|
52
|
+
/** Ref to the root `<div>` element. */
|
|
53
|
+
ref?: Ref<HTMLDivElement>;
|
|
54
|
+
}
|
|
55
|
+
type GroupLabel = {
|
|
56
|
+
label: ReactNode;
|
|
57
|
+
} | {
|
|
58
|
+
label?: undefined;
|
|
59
|
+
'aria-label': string;
|
|
60
|
+
} | {
|
|
61
|
+
label?: undefined;
|
|
62
|
+
'aria-labelledby': string;
|
|
63
|
+
};
|
|
64
|
+
export type RadioGroupProps = RadioGroupOwnProps & GroupLabel;
|
|
65
|
+
/**
|
|
66
|
+
* A set of radio buttons with one selection. Provides the selection state, arrow-key
|
|
67
|
+
* navigation, the group label, supporting text and validation (React Aria `useRadioGroup`).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* <RadioGroup label="Delivery" defaultValue="standard" name="delivery">
|
|
71
|
+
* <Radio value="standard">Standard</Radio>
|
|
72
|
+
* <Radio value="express">Express</Radio>
|
|
73
|
+
* </RadioGroup>
|
|
74
|
+
*/
|
|
75
|
+
export declare function RadioGroup(props: RadioGroupProps): import("react").JSX.Element;
|
|
76
|
+
export interface RadioClassNames extends SelectionControlClassNames {
|
|
77
|
+
/** The outer ring. */
|
|
78
|
+
ring?: string;
|
|
79
|
+
/** The dot inside the ring while selected. */
|
|
80
|
+
dot?: string;
|
|
81
|
+
}
|
|
82
|
+
interface RadioOwnProps extends Omit<AriaRadioProps, 'isDisabled' | 'children'>, Omit<WrapperRootDOMProps<HTMLLabelElement>, keyof AriaRadioProps> {
|
|
83
|
+
/** The value this option selects. */
|
|
84
|
+
value: string;
|
|
85
|
+
/** Turns this option off: it can't be selected or focused. @default false */
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Web density, `0` to `-3`: each step takes 4px off the round state layer (40px at 0, 28px
|
|
89
|
+
* at -3); the ring stays 20px and the touch target 48px. Left out, the option takes its
|
|
90
|
+
* group's density, or the nearest `ThemeProvider`'s or `ThemeScope`'s.
|
|
91
|
+
* @default 0
|
|
92
|
+
*/
|
|
93
|
+
density?: Density;
|
|
94
|
+
/** Classes for the root `<label>`, merged with `classNames.root`; consumer classes win. */
|
|
95
|
+
className?: string;
|
|
96
|
+
/** Classes for each part, by slot. `classNames.root` is merged with `className`. */
|
|
97
|
+
classNames?: RadioClassNames;
|
|
98
|
+
/** Inline styles for the root `<label>`. */
|
|
99
|
+
style?: CSSProperties;
|
|
100
|
+
/** The root `<label>`. Use `inputRef` for the radio input. */
|
|
101
|
+
ref?: Ref<HTMLLabelElement>;
|
|
102
|
+
/** Ref to the visually hidden radio `<input>`. */
|
|
103
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
104
|
+
}
|
|
105
|
+
type RadioLabel = {
|
|
106
|
+
children: ReactNode;
|
|
107
|
+
} | {
|
|
108
|
+
children?: undefined;
|
|
109
|
+
'aria-label': string;
|
|
110
|
+
} | {
|
|
111
|
+
children?: undefined;
|
|
112
|
+
'aria-labelledby': string;
|
|
113
|
+
};
|
|
114
|
+
export type RadioProps = RadioOwnProps & RadioLabel;
|
|
115
|
+
/**
|
|
116
|
+
* M3 radio button: a 20px ring whose dot grows when selected, with a 40px state layer
|
|
117
|
+
* and a 48px touch target. Must be rendered inside a `RadioGroup`.
|
|
118
|
+
*/
|
|
119
|
+
export declare function Radio({ disabled, density, className, classNames, style, ref, inputRef, children, ...otherProps }: RadioProps): import("react").JSX.Element;
|
|
120
|
+
//#endregion
|
|
121
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { densityAttribute } from "../../tokens/density.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useRippleHold } from "../../primitives/use-m3-interaction.js";
|
|
5
|
+
import { mergeDataTokens } from "../../utils/merge-data-tokens.js";
|
|
6
|
+
import { DomDirectionLocale } from "../../primitives/DomDirectionLocale.js";
|
|
7
|
+
import { pickWidgetAria, splitRootProps } from "../../utils/root-props.js";
|
|
8
|
+
import { ErrorText, SupportingText } from "../../primitives/Field.js";
|
|
9
|
+
import { SelectionControl } from "../../primitives/SelectionControl.js";
|
|
10
|
+
import { radioGroupStyles, radioStyles } from "./radio-styles.js";
|
|
11
|
+
import { RadioRing } from "./radio-ring.js";
|
|
12
|
+
import { createContext, useContext, useMemo } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { mergeProps, mergeRefs, useFocusRing, useHover, useObjectRef, useRadio, useRadioGroup } from "react-aria";
|
|
15
|
+
import { useRadioGroupState } from "react-stately";
|
|
16
|
+
//#region src/components/radio/RadioGroup.tsx
|
|
17
|
+
const RadioGroupContext = createContext(null);
|
|
18
|
+
/**
|
|
19
|
+
* A set of radio buttons with one selection. Provides the selection state, arrow-key
|
|
20
|
+
* navigation, the group label, supporting text and validation (React Aria `useRadioGroup`).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <RadioGroup label="Delivery" defaultValue="standard" name="delivery">
|
|
24
|
+
* <Radio value="standard">Standard</Radio>
|
|
25
|
+
* <Radio value="express">Express</Radio>
|
|
26
|
+
* </RadioGroup>
|
|
27
|
+
*/
|
|
28
|
+
function RadioGroup(props) {
|
|
29
|
+
return /* @__PURE__ */ jsx(DomDirectionLocale, { children: (directionRef) => /* @__PURE__ */ jsx(RadioGroupRoot, {
|
|
30
|
+
...props,
|
|
31
|
+
directionRef
|
|
32
|
+
}) });
|
|
33
|
+
}
|
|
34
|
+
const ARROW_KEYS = /* @__PURE__ */ new Set([
|
|
35
|
+
"ArrowUp",
|
|
36
|
+
"ArrowDown",
|
|
37
|
+
"ArrowLeft",
|
|
38
|
+
"ArrowRight"
|
|
39
|
+
]);
|
|
40
|
+
/**
|
|
41
|
+
* Arrow keys on a radio stay in the group (WAI-ARIA APG: they wrap). With one radio React
|
|
42
|
+
* Aria finds nowhere to move and leaves the key alone, so it scrolled the page (2026-10-15).
|
|
43
|
+
*/
|
|
44
|
+
function keepArrowKeys(event) {
|
|
45
|
+
if (event.altKey || event.ctrlKey || event.metaKey || !ARROW_KEYS.has(event.key)) return;
|
|
46
|
+
if (event.target.matches("input[type=\"radio\"]")) event.preventDefault();
|
|
47
|
+
}
|
|
48
|
+
function RadioGroupRoot({ label, supportingText, errorMessage, onChange, disabled = false, readOnly, required, invalid, density, orientation = "vertical", children, className, classNames, style, ref, directionRef, ...otherProps }) {
|
|
49
|
+
const { root: data, rest } = splitRootProps(otherProps);
|
|
50
|
+
const rootRef = useMemo(() => mergeRefs(ref, directionRef), [ref, directionRef]);
|
|
51
|
+
const options = {
|
|
52
|
+
...rest,
|
|
53
|
+
label,
|
|
54
|
+
description: supportingText,
|
|
55
|
+
errorMessage,
|
|
56
|
+
onChange,
|
|
57
|
+
orientation,
|
|
58
|
+
isDisabled: disabled,
|
|
59
|
+
isReadOnly: readOnly,
|
|
60
|
+
isRequired: required,
|
|
61
|
+
isInvalid: invalid
|
|
62
|
+
};
|
|
63
|
+
const state = useRadioGroupState(options);
|
|
64
|
+
const { radioGroupProps, labelProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails } = useRadioGroup(options, state);
|
|
65
|
+
const resolvedError = typeof errorMessage === "function" ? errorMessage({
|
|
66
|
+
isInvalid,
|
|
67
|
+
validationErrors,
|
|
68
|
+
validationDetails
|
|
69
|
+
}) : errorMessage ?? validationErrors.join(" ");
|
|
70
|
+
const styles = radioGroupStyles({
|
|
71
|
+
orientation,
|
|
72
|
+
disabled
|
|
73
|
+
});
|
|
74
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
75
|
+
...mergeProps(data, radioGroupProps, { onKeyDown: keepArrowKeys }),
|
|
76
|
+
ref: rootRef,
|
|
77
|
+
style,
|
|
78
|
+
"data-orientation": orientation,
|
|
79
|
+
...densityAttribute(density),
|
|
80
|
+
"data-disabled": disabled || void 0,
|
|
81
|
+
"data-invalid": isInvalid || void 0,
|
|
82
|
+
className: styles.root({ class: cn(classNames?.root, className) }),
|
|
83
|
+
children: [
|
|
84
|
+
label !== void 0 && label !== null && /* @__PURE__ */ jsx("span", {
|
|
85
|
+
...labelProps,
|
|
86
|
+
className: styles.label({ class: classNames?.label }),
|
|
87
|
+
children: label
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: styles.options({ class: classNames?.options }),
|
|
91
|
+
children: /* @__PURE__ */ jsx(RadioGroupContext, {
|
|
92
|
+
value: state,
|
|
93
|
+
children
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
supportingText && !(isInvalid && resolvedError) && /* @__PURE__ */ jsx(SupportingText, {
|
|
97
|
+
...descriptionProps,
|
|
98
|
+
className: styles.supporting({ class: classNames?.supportingText }),
|
|
99
|
+
children: supportingText
|
|
100
|
+
}),
|
|
101
|
+
isInvalid && resolvedError && /* @__PURE__ */ jsx(ErrorText, {
|
|
102
|
+
...errorMessageProps,
|
|
103
|
+
className: styles.supporting({ class: classNames?.errorText }),
|
|
104
|
+
children: resolvedError
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* M3 radio button: a 20px ring whose dot grows when selected, with a 40px state layer
|
|
111
|
+
* and a 48px touch target. Must be rendered inside a `RadioGroup`.
|
|
112
|
+
*/
|
|
113
|
+
function Radio({ disabled = false, density, className, classNames, style, ref, inputRef, children, ...otherProps }) {
|
|
114
|
+
const state = useContext(RadioGroupContext);
|
|
115
|
+
if (!state) throw new Error("[@windmorph/react] <Radio> must be used inside <RadioGroup>.");
|
|
116
|
+
const { root: data, rest } = splitRootProps(otherProps, { wrapper: true });
|
|
117
|
+
const domInputRef = useObjectRef(inputRef);
|
|
118
|
+
const { inputProps, labelProps, isSelected, isDisabled, isPressed } = useRadio({
|
|
119
|
+
...rest,
|
|
120
|
+
children,
|
|
121
|
+
isDisabled: disabled
|
|
122
|
+
}, state, domInputRef);
|
|
123
|
+
const { focusProps, isFocusVisible } = useFocusRing();
|
|
124
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
125
|
+
const rippling = useRippleHold(isPressed && !isDisabled);
|
|
126
|
+
const styles = radioStyles();
|
|
127
|
+
const widgetAria = pickWidgetAria(rest);
|
|
128
|
+
if (state.isInvalid) delete widgetAria["aria-invalid"];
|
|
129
|
+
if (state.isRequired) delete widgetAria["aria-required"];
|
|
130
|
+
return /* @__PURE__ */ jsx(SelectionControl, {
|
|
131
|
+
ref,
|
|
132
|
+
rootProps: mergeProps(labelProps, hoverProps),
|
|
133
|
+
inputProps: mergeProps(widgetAria, inputProps, focusProps),
|
|
134
|
+
inputRef: domInputRef,
|
|
135
|
+
rootData: {
|
|
136
|
+
...data,
|
|
137
|
+
...densityAttribute(density),
|
|
138
|
+
"data-tokens": mergeDataTokens("md-comp-radio-button", data)
|
|
139
|
+
},
|
|
140
|
+
state: {
|
|
141
|
+
"data-checked": isSelected || void 0,
|
|
142
|
+
"data-disabled": isDisabled || void 0,
|
|
143
|
+
"data-hovered": isHovered && !isDisabled || void 0,
|
|
144
|
+
"data-pressed": isPressed && !isDisabled || void 0,
|
|
145
|
+
"data-rippling": rippling || void 0,
|
|
146
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
147
|
+
},
|
|
148
|
+
styles,
|
|
149
|
+
className,
|
|
150
|
+
classNames,
|
|
151
|
+
style,
|
|
152
|
+
indicator: /* @__PURE__ */ jsx(RadioRing, {
|
|
153
|
+
styles,
|
|
154
|
+
className: classNames?.ring,
|
|
155
|
+
dotClassName: classNames?.dot
|
|
156
|
+
}),
|
|
157
|
+
children
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { Radio, RadioGroup };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":[],"sources":["../../../src/components/radio/RadioGroup.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n useContext,\n useMemo,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n type RefCallback,\n} from 'react';\nimport {\n mergeProps,\n mergeRefs,\n useFocusRing,\n useHover,\n useObjectRef,\n useRadio,\n useRadioGroup,\n type AriaRadioGroupProps,\n type AriaRadioProps,\n} from 'react-aria';\nimport { useRadioGroupState, type RadioGroupState } from 'react-stately';\nimport { DomDirectionLocale } from '../../primitives/DomDirectionLocale';\nimport { ErrorText, SupportingText } from '../../primitives/Field';\nimport {\n SelectionControl,\n type SelectionControlClassNames,\n} from '../../primitives/SelectionControl';\nimport { densityAttribute, type Density } from '../../tokens/density';\nimport { cn } from '../../utils/cn';\nimport { mergeDataTokens } from '../../utils/merge-data-tokens';\nimport {\n pickWidgetAria,\n splitRootProps,\n type RootDOMProps,\n type WrapperRootDOMProps,\n} from '../../utils/root-props';\nimport { radioGroupStyles, radioStyles } from './radio-styles';\nimport { useRippleHold } from '../../primitives/use-m3-interaction';\nimport { RadioRing } from './radio-ring';\n\nconst RadioGroupContext = createContext<RadioGroupState | null>(null);\n\nexport interface RadioGroupClassNames {\n /** The group's outer element. */\n root?: string;\n /** The visible group label. */\n label?: string;\n /** The wrapper around the radio buttons. */\n options?: string;\n /** The helper text below the options. */\n supportingText?: string;\n /** The error message, shown in place of the helper text while invalid. */\n errorText?: string;\n}\n\ntype RenamedGroupProps =\n | 'isDisabled'\n | 'isReadOnly'\n | 'isRequired'\n | 'isInvalid'\n | 'description'\n | 'label'\n | 'onChange'\n // The deprecated `validationState` is left out: `invalid` replaces it.\n | 'validationState';\n\ninterface RadioGroupOwnProps\n extends\n Omit<AriaRadioGroupProps, RenamedGroupProps>,\n Omit<RootDOMProps, keyof AriaRadioGroupProps> {\n /** Visible group label. */\n label?: ReactNode;\n /** Helper text below the options. */\n supportingText?: ReactNode;\n /** Called with the selected option's value when the selection changes. */\n onChange?: (value: string) => void;\n /** Turns every option off: none can be selected or focused. @default false */\n disabled?: boolean;\n /** The options can be focused but the selection can't change. @default false */\n readOnly?: boolean;\n /** An option must be selected before the form submits. @default false */\n required?: boolean;\n /** Shows the error state. @default false */\n invalid?: boolean;\n /**\n * Web density, `0` to `-3`, for every option: each step takes 4px off their round state\n * layers (40px at 0, 28px at -3) and puts 2px more between rows, so each option keeps a\n * 48px touch target that never reaches the next one's ring. Left out, the group takes the\n * density of the nearest `ThemeProvider` or `ThemeScope`; M3 asks for density to be the\n * reader's choice, so prefer setting it there.\n * @default 0\n */\n density?: Density;\n /** The options: `Radio` elements. */\n children?: ReactNode;\n /** Classes for the root element, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Classes for each part, by slot. `classNames.root` is merged with `className`. */\n classNames?: RadioGroupClassNames;\n /** Inline styles for the root element. */\n style?: CSSProperties;\n /** Ref to the root `<div>` element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype GroupLabel =\n | { label: ReactNode }\n | { label?: undefined; 'aria-label': string }\n | { label?: undefined; 'aria-labelledby': string };\n\nexport type RadioGroupProps = RadioGroupOwnProps & GroupLabel;\n\n/**\n * A set of radio buttons with one selection. Provides the selection state, arrow-key\n * navigation, the group label, supporting text and validation (React Aria `useRadioGroup`).\n *\n * @example\n * <RadioGroup label=\"Delivery\" defaultValue=\"standard\" name=\"delivery\">\n * <Radio value=\"standard\">Standard</Radio>\n * <Radio value=\"express\">Express</Radio>\n * </RadioGroup>\n */\nexport function RadioGroup(props: RadioGroupProps) {\n // React Aria swaps ← / → by the locale's direction, so a horizontal group in an RTL region\n // under an LTR locale would move the wrong way; the laid-out direction drives it instead.\n return (\n <DomDirectionLocale>\n {(directionRef) => <RadioGroupRoot {...props} directionRef={directionRef} />}\n </DomDirectionLocale>\n );\n}\n\nconst ARROW_KEYS = new Set(['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']);\n\n/**\n * Arrow keys on a radio stay in the group (WAI-ARIA APG: they wrap). With one radio React\n * Aria finds nowhere to move and leaves the key alone, so it scrolled the page (2026-10-15).\n */\nfunction keepArrowKeys(event: KeyboardEvent<HTMLDivElement>) {\n if (event.altKey || event.ctrlKey || event.metaKey || !ARROW_KEYS.has(event.key)) return;\n if ((event.target as Element).matches('input[type=\"radio\"]')) event.preventDefault();\n}\n\nfunction RadioGroupRoot({\n label,\n supportingText,\n errorMessage,\n onChange,\n disabled = false,\n readOnly,\n required,\n invalid,\n density,\n orientation = 'vertical',\n children,\n className,\n classNames,\n style,\n ref,\n directionRef,\n ...otherProps\n}: RadioGroupProps & { directionRef: RefCallback<HTMLElement> }) {\n // The root is the radio group itself: its DOM attributes join the hook's.\n const { root: data, rest } = splitRootProps(otherProps);\n const rootRef = useMemo(\n () => mergeRefs<HTMLDivElement>(ref, directionRef as RefCallback<HTMLDivElement>),\n [ref, directionRef],\n );\n const options: AriaRadioGroupProps = {\n ...rest,\n label,\n description: supportingText,\n errorMessage,\n onChange,\n orientation,\n isDisabled: disabled,\n isReadOnly: readOnly,\n isRequired: required,\n isInvalid: invalid,\n };\n const state = useRadioGroupState(options);\n const {\n radioGroupProps,\n labelProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails,\n } = useRadioGroup(options, state);\n\n const resolvedError =\n typeof errorMessage === 'function'\n ? errorMessage({ isInvalid, validationErrors, validationDetails })\n : (errorMessage ?? validationErrors.join(' '));\n const styles = radioGroupStyles({ orientation, disabled });\n\n return (\n <div\n {...mergeProps(data, radioGroupProps, { onKeyDown: keepArrowKeys })}\n ref={rootRef}\n style={style}\n data-orientation={orientation}\n {...densityAttribute(density)}\n data-disabled={disabled || undefined}\n data-invalid={isInvalid || undefined}\n className={styles.root({ class: cn(classNames?.root, className) })}\n >\n {label !== undefined && label !== null && (\n <span {...labelProps} className={styles.label({ class: classNames?.label })}>\n {label}\n </span>\n )}\n <div className={styles.options({ class: classNames?.options })}>\n <RadioGroupContext value={state}>{children}</RadioGroupContext>\n </div>\n {supportingText && !(isInvalid && resolvedError) && (\n <SupportingText\n {...descriptionProps}\n className={styles.supporting({ class: classNames?.supportingText })}\n >\n {supportingText}\n </SupportingText>\n )}\n {isInvalid && resolvedError && (\n <ErrorText\n {...errorMessageProps}\n className={styles.supporting({ class: classNames?.errorText })}\n >\n {resolvedError}\n </ErrorText>\n )}\n </div>\n );\n}\n\nexport interface RadioClassNames extends SelectionControlClassNames {\n /** The outer ring. */\n ring?: string;\n /** The dot inside the ring while selected. */\n dot?: string;\n}\n\ninterface RadioOwnProps\n extends\n Omit<AriaRadioProps, 'isDisabled' | 'children'>,\n Omit<WrapperRootDOMProps<HTMLLabelElement>, keyof AriaRadioProps> {\n /** The value this option selects. */\n value: string;\n /** Turns this option off: it can't be selected or focused. @default false */\n disabled?: boolean;\n /**\n * Web density, `0` to `-3`: each step takes 4px off the round state layer (40px at 0, 28px\n * at -3); the ring stays 20px and the touch target 48px. Left out, the option takes its\n * group's density, or the nearest `ThemeProvider`'s or `ThemeScope`'s.\n * @default 0\n */\n density?: Density;\n /** Classes for the root `<label>`, merged with `classNames.root`; consumer classes win. */\n className?: string;\n /** Classes for each part, by slot. `classNames.root` is merged with `className`. */\n classNames?: RadioClassNames;\n /** Inline styles for the root `<label>`. */\n style?: CSSProperties;\n /** The root `<label>`. Use `inputRef` for the radio input. */\n ref?: Ref<HTMLLabelElement>;\n /** Ref to the visually hidden radio `<input>`. */\n inputRef?: Ref<HTMLInputElement>;\n}\n\ntype RadioLabel =\n | { children: ReactNode }\n | { children?: undefined; 'aria-label': string }\n | { children?: undefined; 'aria-labelledby': string };\n\nexport type RadioProps = RadioOwnProps & RadioLabel;\n\n/**\n * M3 radio button: a 20px ring whose dot grows when selected, with a 40px state layer\n * and a 48px touch target. Must be rendered inside a `RadioGroup`.\n */\nexport function Radio({\n disabled = false,\n density,\n className,\n classNames,\n style,\n ref,\n inputRef,\n children,\n ...otherProps\n}: RadioProps) {\n const state = useContext(RadioGroupContext);\n if (!state) throw new Error('[@windmorph/react] <Radio> must be used inside <RadioGroup>.');\n const { root: data, rest } = splitRootProps(otherProps, { wrapper: true });\n const domInputRef = useObjectRef(inputRef);\n const { inputProps, labelProps, isSelected, isDisabled, isPressed } = useRadio(\n { ...rest, children, isDisabled: disabled },\n state,\n domInputRef,\n );\n const { focusProps, isFocusVisible } = useFocusRing();\n const { hoverProps, isHovered } = useHover({ isDisabled });\n const rippling = useRippleHold(isPressed && !isDisabled);\n const styles = radioStyles();\n // The group's own state wins, as a field's does: the radiogroup carries it.\n const widgetAria = pickWidgetAria(rest);\n if (state.isInvalid) delete widgetAria['aria-invalid'];\n if (state.isRequired) delete widgetAria['aria-required'];\n\n return (\n <SelectionControl\n ref={ref}\n rootProps={mergeProps(labelProps, hoverProps)}\n inputProps={mergeProps(widgetAria, inputProps, focusProps)}\n inputRef={domInputRef}\n // The ring resolves the component tokens itself (list items draw it too); the root\n // is marked as well, so the tokens sit on the element that carries the state.\n rootData={{\n ...data,\n ...densityAttribute(density),\n 'data-tokens': mergeDataTokens('md-comp-radio-button', data),\n }}\n state={{\n 'data-checked': isSelected || undefined,\n 'data-disabled': isDisabled || undefined,\n 'data-hovered': (isHovered && !isDisabled) || undefined,\n 'data-pressed': (isPressed && !isDisabled) || undefined,\n 'data-rippling': rippling || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n }}\n styles={styles}\n className={className}\n classNames={classNames}\n style={style}\n indicator={\n <RadioRing styles={styles} className={classNames?.ring} dotClassName={classNames?.dot} />\n }\n >\n {children}\n </SelectionControl>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,MAAM,oBAAoB,cAAsC,IAAI;;;;;;;;;;;AAkFpE,SAAgB,WAAW,OAAwB;CAGjD,OACE,oBAAC,oBAAD,EAAA,WACI,iBAAiB,oBAAC,gBAAD;EAAgB,GAAI;EAAqB;CAAe,CAAA,EACzD,CAAA;AAExB;AAEA,MAAM,6BAAa,IAAI,IAAI;CAAC;CAAW;CAAa;CAAa;AAAY,CAAC;;;;;AAM9E,SAAS,cAAc,OAAsC;CAC3D,IAAI,MAAM,UAAU,MAAM,WAAW,MAAM,WAAW,CAAC,WAAW,IAAI,MAAM,GAAG,GAAG;CAClF,IAAK,MAAM,OAAmB,QAAQ,uBAAqB,GAAG,MAAM,eAAe;AACrF;AAEA,SAAS,eAAe,EACtB,OACA,gBACA,cACA,UACA,WAAW,OACX,UACA,UACA,SACA,SACA,cAAc,YACd,UACA,WACA,YACA,OACA,KACA,cACA,GAAG,cAC4D;CAE/D,MAAM,EAAE,MAAM,MAAM,SAAS,eAAe,UAAU;CACtD,MAAM,UAAU,cACR,UAA0B,KAAK,YAA2C,GAChF,CAAC,KAAK,YAAY,CACpB;CACA,MAAM,UAA+B;EACnC,GAAG;EACH;EACA,aAAa;EACb;EACA;EACA;EACA,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,WAAW;CACb;CACA,MAAM,QAAQ,mBAAmB,OAAO;CACxC,MAAM,EACJ,iBACA,YACA,kBACA,mBACA,WACA,kBACA,sBACE,cAAc,SAAS,KAAK;CAEhC,MAAM,gBACJ,OAAO,iBAAiB,aACpB,aAAa;EAAE;EAAW;EAAkB;CAAkB,CAAC,IAC9D,gBAAgB,iBAAiB,KAAK,GAAG;CAChD,MAAM,SAAS,iBAAiB;EAAE;EAAa;CAAS,CAAC;CAEzD,OACE,qBAAC,OAAD;EACE,GAAI,WAAW,MAAM,iBAAiB,EAAE,WAAW,cAAc,CAAC;EAClE,KAAK;EACE;EACP,oBAAkB;EAClB,GAAI,iBAAiB,OAAO;EAC5B,iBAAe,YAAY,KAAA;EAC3B,gBAAc,aAAa,KAAA;EAC3B,WAAW,OAAO,KAAK,EAAE,OAAO,GAAG,YAAY,MAAM,SAAS,EAAE,CAAC;EARnE,UAAA;GAUG,UAAU,KAAA,KAAa,UAAU,QAChC,oBAAC,QAAD;IAAM,GAAI;IAAY,WAAW,OAAO,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;IACvE,UAAA;GACG,CAAA;GAER,oBAAC,OAAD;IAAK,WAAW,OAAO,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;IAC3D,UAAA,oBAAC,mBAAD;KAAmB,OAAO;KAAQ;IAA4B,CAAA;GAC3D,CAAA;GACJ,kBAAkB,EAAE,aAAa,kBAChC,oBAAC,gBAAD;IACE,GAAI;IACJ,WAAW,OAAO,WAAW,EAAE,OAAO,YAAY,eAAe,CAAC;IAEjE,UAAA;GACa,CAAA;GAEjB,aAAa,iBACZ,oBAAC,WAAD;IACE,GAAI;IACJ,WAAW,OAAO,WAAW,EAAE,OAAO,YAAY,UAAU,CAAC;IAE5D,UAAA;GACQ,CAAA;EAEV;;AAET;;;;;AA+CA,SAAgB,MAAM,EACpB,WAAW,OACX,SACA,WACA,YACA,OACA,KACA,UACA,UACA,GAAG,cACU;CACb,MAAM,QAAQ,WAAW,iBAAiB;CAC1C,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,8DAA8D;CAC1F,MAAM,EAAE,MAAM,MAAM,SAAS,eAAe,YAAY,EAAE,SAAS,KAAK,CAAC;CACzE,MAAM,cAAc,aAAa,QAAQ;CACzC,MAAM,EAAE,YAAY,YAAY,YAAY,YAAY,cAAc,SACpE;EAAE,GAAG;EAAM;EAAU,YAAY;CAAS,GAC1C,OACA,WACF;CACA,MAAM,EAAE,YAAY,mBAAmB,aAAa;CACpD,MAAM,EAAE,YAAY,cAAc,SAAS,EAAE,WAAW,CAAC;CACzD,MAAM,WAAW,cAAc,aAAa,CAAC,UAAU;CACvD,MAAM,SAAS,YAAY;CAE3B,MAAM,aAAa,eAAe,IAAI;CACtC,IAAI,MAAM,WAAW,OAAO,WAAW;CACvC,IAAI,MAAM,YAAY,OAAO,WAAW;CAExC,OACE,oBAAC,kBAAD;EACO;EACL,WAAW,WAAW,YAAY,UAAU;EAC5C,YAAY,WAAW,YAAY,YAAY,UAAU;EACzD,UAAU;EAGV,UAAU;GACR,GAAG;GACH,GAAG,iBAAiB,OAAO;GAC3B,eAAe,gBAAgB,wBAAwB,IAAI;EAC7D;EACA,OAAO;GACL,gBAAgB,cAAc,KAAA;GAC9B,iBAAiB,cAAc,KAAA;GAC/B,gBAAiB,aAAa,CAAC,cAAe,KAAA;GAC9C,gBAAiB,aAAa,CAAC,cAAe,KAAA;GAC9C,iBAAiB,YAAY,KAAA;GAC7B,sBAAsB,kBAAkB,KAAA;EAC1C;EACQ;EACG;EACC;EACL;EACP,WACE,oBAAC,WAAD;GAAmB;GAAQ,WAAW,YAAY;GAAM,cAAc,YAAY;EAAM,CAAA;EAGzF;CACe,CAAA;AAEtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { radioStyles } from "./radio-styles.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/radio/radio-ring.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The drawn ring and dot, styled from a `group/control` ancestor's state attributes.
|
|
6
|
+
* Shared with list items that are radio buttons, so it carries the radio button's component
|
|
7
|
+
* tokens (`radio-tokens.ts`) itself.
|
|
8
|
+
*/
|
|
9
|
+
function RadioRing({ styles = radioStyles(), className, dotClassName }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("span", {
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
"data-tokens": "md-comp-radio-button",
|
|
13
|
+
"data-slot": "ring",
|
|
14
|
+
className: styles.ring({ class: className }),
|
|
15
|
+
children: /* @__PURE__ */ jsx("span", { className: styles.dot({ class: dotClassName }) })
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { RadioRing };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=radio-ring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-ring.js","names":[],"sources":["../../../src/components/radio/radio-ring.tsx"],"sourcesContent":["import { radioStyles } from './radio-styles';\n\n/**\n * The drawn ring and dot, styled from a `group/control` ancestor's state attributes.\n * Shared with list items that are radio buttons, so it carries the radio button's component\n * tokens (`radio-tokens.ts`) itself.\n */\nexport function RadioRing({\n styles = radioStyles(),\n className,\n dotClassName,\n}: {\n styles?: ReturnType<typeof radioStyles>;\n className?: string;\n dotClassName?: string;\n}) {\n return (\n <span\n aria-hidden=\"true\"\n data-tokens=\"md-comp-radio-button\"\n data-slot=\"ring\"\n className={styles.ring({ class: className })}\n >\n <span className={styles.dot({ class: dotClassName })} />\n </span>\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,UAAU,EACxB,SAAS,YAAY,GACrB,WACA,gBAKC;CACD,OACE,oBAAC,QAAD;EACE,eAAY;EACZ,eAAY;EACZ,aAAU;EACV,WAAW,OAAO,KAAK,EAAE,OAAO,UAAU,CAAC;EAE3C,UAAA,oBAAC,QAAD,EAAM,WAAW,OAAO,IAAI,EAAE,OAAO,aAAa,CAAC,EAAI,CAAA;CACnD,CAAA;AAEV"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { VariantProps } from "../../utils/tv.js";
|
|
2
|
+
//#region src/components/radio/radio-styles.d.ts
|
|
3
|
+
/** Variant definitions for {@link Radio}. */
|
|
4
|
+
export declare const radioStyles: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
7
|
+
ring?: import("tailwind-variants").ClassValue;
|
|
8
|
+
dot?: import("tailwind-variants").ClassValue;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
kind: {
|
|
13
|
+
circle: import("tailwind-variants").ClassValue | {
|
|
14
|
+
ring?: import("tailwind-variants").ClassValue;
|
|
15
|
+
dot?: import("tailwind-variants").ClassValue;
|
|
16
|
+
};
|
|
17
|
+
track: import("tailwind-variants").ClassValue | {
|
|
18
|
+
ring?: import("tailwind-variants").ClassValue;
|
|
19
|
+
dot?: import("tailwind-variants").ClassValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
ring: string[];
|
|
24
|
+
dot: string[];
|
|
25
|
+
}, undefined, {
|
|
26
|
+
kind: {
|
|
27
|
+
circle: {
|
|
28
|
+
control: string[];
|
|
29
|
+
};
|
|
30
|
+
track: {
|
|
31
|
+
control: string;
|
|
32
|
+
label: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}, {
|
|
36
|
+
root: string[];
|
|
37
|
+
control: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
40
|
+
kind: {
|
|
41
|
+
circle: {
|
|
42
|
+
control: string[];
|
|
43
|
+
};
|
|
44
|
+
track: {
|
|
45
|
+
control: string;
|
|
46
|
+
label: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
50
|
+
root: string[];
|
|
51
|
+
control: string;
|
|
52
|
+
label: string;
|
|
53
|
+
}, undefined, {
|
|
54
|
+
kind: {
|
|
55
|
+
circle: {
|
|
56
|
+
control: string[];
|
|
57
|
+
};
|
|
58
|
+
track: {
|
|
59
|
+
control: string;
|
|
60
|
+
label: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
root: string[];
|
|
65
|
+
control: string;
|
|
66
|
+
label: string;
|
|
67
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
68
|
+
kind: {
|
|
69
|
+
circle: {
|
|
70
|
+
control: string[];
|
|
71
|
+
};
|
|
72
|
+
track: {
|
|
73
|
+
control: string;
|
|
74
|
+
label: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
root: string[];
|
|
79
|
+
control: string;
|
|
80
|
+
label: string;
|
|
81
|
+
}>>>;
|
|
82
|
+
/** Variant definitions for {@link RadioGroup}. */
|
|
83
|
+
export declare const radioGroupStyles: import("tailwind-variants").TVReturnType<{
|
|
84
|
+
orientation: {
|
|
85
|
+
vertical: {
|
|
86
|
+
options: string;
|
|
87
|
+
};
|
|
88
|
+
horizontal: {
|
|
89
|
+
options: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
disabled: {
|
|
93
|
+
true: {
|
|
94
|
+
label: string;
|
|
95
|
+
};
|
|
96
|
+
false: {};
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
root: string;
|
|
100
|
+
label: string;
|
|
101
|
+
options: string;
|
|
102
|
+
supporting: string;
|
|
103
|
+
}, undefined, {
|
|
104
|
+
orientation: {
|
|
105
|
+
vertical: {
|
|
106
|
+
options: string;
|
|
107
|
+
};
|
|
108
|
+
horizontal: {
|
|
109
|
+
options: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
disabled: {
|
|
113
|
+
true: {
|
|
114
|
+
label: string;
|
|
115
|
+
};
|
|
116
|
+
false: {};
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
root: string;
|
|
120
|
+
label: string;
|
|
121
|
+
options: string;
|
|
122
|
+
supporting: string;
|
|
123
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
124
|
+
orientation: {
|
|
125
|
+
vertical: {
|
|
126
|
+
options: string;
|
|
127
|
+
};
|
|
128
|
+
horizontal: {
|
|
129
|
+
options: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
disabled: {
|
|
133
|
+
true: {
|
|
134
|
+
label: string;
|
|
135
|
+
};
|
|
136
|
+
false: {};
|
|
137
|
+
};
|
|
138
|
+
}, {
|
|
139
|
+
root: string;
|
|
140
|
+
label: string;
|
|
141
|
+
options: string;
|
|
142
|
+
supporting: string;
|
|
143
|
+
}>>;
|
|
144
|
+
/**
|
|
145
|
+
* The variants of {@link radioStyles}, for building on its styles. They are the recipe's keys, not
|
|
146
|
+
* component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
|
|
147
|
+
*/
|
|
148
|
+
export type RadioStyleProps = VariantProps<typeof radioStyles>;
|
|
149
|
+
/**
|
|
150
|
+
* The variants of {@link radioGroupStyles}, for building on its styles. They are the recipe's keys, not
|
|
151
|
+
* component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.
|
|
152
|
+
*/
|
|
153
|
+
export type RadioGroupStyleProps = VariantProps<typeof radioGroupStyles>;
|
|
154
|
+
//#endregion
|
|
155
|
+
//# sourceMappingURL=radio-styles.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { tv } from "../../utils/tv.js";
|
|
2
|
+
import { selectionControlStyles } from "../../primitives/selection-control-styles.js";
|
|
3
|
+
//#region src/components/radio/radio-styles.ts
|
|
4
|
+
/** Variant definitions for {@link Radio}. */
|
|
5
|
+
const radioStyles = tv({
|
|
6
|
+
extend: selectionControlStyles,
|
|
7
|
+
slots: {
|
|
8
|
+
ring: [
|
|
9
|
+
"relative inline-flex size-[20px] items-center justify-center rounded-full",
|
|
10
|
+
"border-2 border-solid border-[color:var(--_md-comp-radio-button-unselected-icon-color)]",
|
|
11
|
+
"text-[color:var(--_md-comp-radio-button-selected-icon-color)]",
|
|
12
|
+
"[transition-property:border-color,color]",
|
|
13
|
+
"[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]",
|
|
14
|
+
"[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]",
|
|
15
|
+
"group-data-hovered/control:border-on-surface",
|
|
16
|
+
"group-data-focus-visible/control:border-on-surface",
|
|
17
|
+
"group-data-pressed/control:border-on-surface",
|
|
18
|
+
"control-checked:border-[color:var(--_md-comp-radio-button-selected-icon-color)]",
|
|
19
|
+
"group-data-disabled/control:border-on-surface/38 group-data-disabled/control:text-on-surface/38",
|
|
20
|
+
"group-data-disabled/control:control-checked:border-on-surface/38",
|
|
21
|
+
"group-data-disabled/control:[transition-duration:0s]",
|
|
22
|
+
"forced-colors:forced-color-adjust-none forced-colors:border-[CanvasText]! forced-colors:text-[CanvasText]!",
|
|
23
|
+
"forced-colors:group-data-disabled/control:border-[GrayText]! forced-colors:group-data-disabled/control:text-[GrayText]!"
|
|
24
|
+
],
|
|
25
|
+
dot: [
|
|
26
|
+
"size-[10px] scale-0 rounded-full bg-current",
|
|
27
|
+
"[transition-property:scale]",
|
|
28
|
+
"[transition-duration:var(--md-sys-motion-spring-spatial-fast-duration)]",
|
|
29
|
+
"[transition-timing-function:var(--md-sys-motion-spring-spatial-fast-easing)]",
|
|
30
|
+
"control-checked:scale-100"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
/** Variant definitions for {@link RadioGroup}. */
|
|
35
|
+
const radioGroupStyles = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
root: "flex flex-col gap-[4px]",
|
|
38
|
+
label: "text-title-small text-on-surface",
|
|
39
|
+
options: "flex gap-y-[calc(0px-var(--md-sys-density,0)*2px)]",
|
|
40
|
+
supporting: "px-[4px]"
|
|
41
|
+
},
|
|
42
|
+
variants: {
|
|
43
|
+
orientation: {
|
|
44
|
+
vertical: { options: "flex-col" },
|
|
45
|
+
horizontal: { options: "flex-row flex-wrap gap-x-[16px]" }
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
true: { label: "text-on-surface/38" },
|
|
49
|
+
false: {}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
orientation: "vertical",
|
|
54
|
+
disabled: false
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { radioGroupStyles, radioStyles };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=radio-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-styles.js","names":[],"sources":["../../../src/components/radio/radio-styles.ts"],"sourcesContent":["import { selectionControlStyles } from '../../primitives/selection-control-styles';\nimport { tv, type VariantProps } from '../../utils/tv';\n\n/*\n * Values follow Compose Material 3 (RadioButton.kt and RadioButtonTokens): a 20px ring\n * with a 2px stroke and a 10px dot that grows on the fast spatial spring; colours change\n * on the default effects spring. Unselected rings are on-surface-variant and darken to\n * on-surface on hover, focus and press; selected rings are primary; disabled are\n * on-surface at 38%. M3 radio buttons have no error colour. The control and state layer\n * come from `selectionControlStyles`. The selected and unselected colours come from the radio\n * button's component tokens (`radio-tokens.ts`, `--md-comp-radio-button-*`), resolved on the\n * ring; a consumer class (`classNames.ring`) still wins in `cn()`. Every class is written\n * out in full.\n */\n\n/** Variant definitions for {@link Radio}. */\nexport const radioStyles = tv({\n extend: selectionControlStyles,\n slots: {\n ring: [\n 'relative inline-flex size-[20px] items-center justify-center rounded-full',\n 'border-2 border-solid border-[color:var(--_md-comp-radio-button-unselected-icon-color)]',\n // The dot is `bg-current`.\n 'text-[color:var(--_md-comp-radio-button-selected-icon-color)]',\n '[transition-property:border-color,color]',\n '[transition-duration:var(--md-sys-motion-spring-effects-default-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-effects-default-easing)]',\n 'group-data-hovered/control:border-on-surface',\n 'group-data-focus-visible/control:border-on-surface',\n 'group-data-pressed/control:border-on-surface',\n 'control-checked:border-[color:var(--_md-comp-radio-button-selected-icon-color)]',\n 'group-data-disabled/control:border-on-surface/38 group-data-disabled/control:text-on-surface/38',\n // Stacked so disabled also wins over the selected colour (equal specificity otherwise).\n 'group-data-disabled/control:control-checked:border-on-surface/38',\n 'group-data-disabled/control:[transition-duration:0s]',\n // Forced colours: the ring and its dot (`bg-current`, a background forced colours would\n // drop) in system colours, `GrayText` when disabled.\n 'forced-colors:forced-color-adjust-none forced-colors:border-[CanvasText]! forced-colors:text-[CanvasText]!',\n 'forced-colors:group-data-disabled/control:border-[GrayText]! forced-colors:group-data-disabled/control:text-[GrayText]!',\n ],\n dot: [\n 'size-[10px] scale-0 rounded-full bg-current',\n '[transition-property:scale]',\n '[transition-duration:var(--md-sys-motion-spring-spatial-fast-duration)]',\n '[transition-timing-function:var(--md-sys-motion-spring-spatial-fast-easing)]',\n 'control-checked:scale-100',\n ],\n },\n});\n\n/** Variant definitions for {@link RadioGroup}. */\nexport const radioGroupStyles = tv({\n slots: {\n root: 'flex flex-col gap-[4px]',\n label: 'text-title-small text-on-surface',\n // Rows are 2px further apart per density step (half of what each option loses), so an\n // option's 48px touch target never reaches the next one's ring (0px at 0, 6px at -3).\n options: 'flex gap-y-[calc(0px-var(--md-sys-density,0)*2px)]',\n supporting: 'px-[4px]',\n },\n variants: {\n orientation: {\n vertical: { options: 'flex-col' },\n horizontal: { options: 'flex-row flex-wrap gap-x-[16px]' },\n },\n disabled: {\n true: { label: 'text-on-surface/38' },\n false: {},\n },\n },\n defaultVariants: { orientation: 'vertical', disabled: false },\n});\n\n/**\n * The variants of {@link radioStyles}, for building on its styles. They are the recipe's keys, not\n * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.\n */\nexport type RadioStyleProps = VariantProps<typeof radioStyles>;\n/**\n * The variants of {@link radioGroupStyles}, for building on its styles. They are the recipe's keys, not\n * component props: their names (`hasIcon`, `isOpen`…) follow the classes and may change.\n */\nexport type RadioGroupStyleProps = VariantProps<typeof radioGroupStyles>;\n"],"mappings":";;;;AAgBA,MAAa,cAAc,GAAG;CAC5B,QAAQ;CACR,OAAO;EACL,MAAM;GACJ;GACA;GAEA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GACA;GAGA;GACA;EACF;EACA,KAAK;GACH;GACA;GACA;GACA;GACA;EACF;CACF;AACF,CAAC;;AAGD,MAAa,mBAAmB,GAAG;CACjC,OAAO;EACL,MAAM;EACN,OAAO;EAGP,SAAS;EACT,YAAY;CACd;CACA,UAAU;EACR,aAAa;GACX,UAAU,EAAE,SAAS,WAAW;GAChC,YAAY,EAAE,SAAS,kCAAkC;EAC3D;EACA,UAAU;GACR,MAAM,EAAE,OAAO,qBAAqB;GACpC,OAAO,CAAC;EACV;CACF;CACA,iBAAiB;EAAE,aAAa;EAAY,UAAU;CAAM;AAC9D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentTokenSet } from "../../tokens/component.js";
|
|
2
|
+
import "../../index.js";
|
|
3
|
+
//#region src/components/radio/radio-tokens.d.ts
|
|
4
|
+
/** The tokens of {@link Radio}: `--md-comp-radio-button-<part>`. */
|
|
5
|
+
export declare const radioTokenSet: ComponentTokenSet<"selected-icon-color" | "unselected-icon-color">;
|
|
6
|
+
//#endregion
|
|
7
|
+
//# sourceMappingURL=radio-tokens.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { color, defineComponentTokens } from "../../tokens/component.js";
|
|
2
|
+
//#region src/components/radio/radio-tokens.ts
|
|
3
|
+
/** The tokens of {@link Radio}: `--md-comp-radio-button-<part>`. */
|
|
4
|
+
const radioTokenSet = defineComponentTokens({
|
|
5
|
+
name: "md-comp-radio-button",
|
|
6
|
+
tokens: {
|
|
7
|
+
"selected-icon-color": {
|
|
8
|
+
value: color("primary"),
|
|
9
|
+
description: "The ring and dot of a selected radio button.",
|
|
10
|
+
compose: "RadioButtonTokens.SelectedIconColor",
|
|
11
|
+
paints: {
|
|
12
|
+
property: "border-top-color",
|
|
13
|
+
slot: "ring",
|
|
14
|
+
state: "checked"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"unselected-icon-color": {
|
|
18
|
+
value: color("on-surface-variant"),
|
|
19
|
+
description: "The ring of an unselected radio button.",
|
|
20
|
+
compose: "RadioButtonTokens.UnselectedIconColor",
|
|
21
|
+
paints: {
|
|
22
|
+
property: "border-top-color",
|
|
23
|
+
slot: "ring"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { radioTokenSet };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=radio-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-tokens.js","names":[],"sources":["../../../src/components/radio/radio-tokens.ts"],"sourcesContent":["import { color, defineComponentTokens } from '../../tokens/component';\n\n/*\n * The radio button's component tokens, M3's `md.comp.radio-button.*` names (checked against\n * m3.material.io's token tables, 2026-10-14), with Compose's RadioButtonTokens defaults. The\n * drawn ring (`radio-ring.tsx`) carries `data-tokens`, so list items that are radio buttons\n * read the same tokens; the radio's root carries it too. Hover, focus, pressed and disabled\n * values stay classes.\n */\n\n/** The tokens of {@link Radio}: `--md-comp-radio-button-<part>`. */\nexport const radioTokenSet = defineComponentTokens({\n name: 'md-comp-radio-button',\n tokens: {\n 'selected-icon-color': {\n value: color('primary'),\n description: 'The ring and dot of a selected radio button.',\n compose: 'RadioButtonTokens.SelectedIconColor',\n paints: { property: 'border-top-color', slot: 'ring', state: 'checked' },\n },\n 'unselected-icon-color': {\n value: color('on-surface-variant'),\n description: 'The ring of an unselected radio button.',\n compose: 'RadioButtonTokens.UnselectedIconColor',\n paints: { property: 'border-top-color', slot: 'ring' },\n },\n },\n});\n"],"mappings":";;;AAWA,MAAa,gBAAgB,sBAAsB;CACjD,MAAM;CACN,QAAQ;EACN,uBAAuB;GACrB,OAAO,MAAM,SAAS;GACtB,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAoB,MAAM;IAAQ,OAAO;GAAU;EACzE;EACA,yBAAyB;GACvB,OAAO,MAAM,oBAAoB;GACjC,aAAa;GACb,SAAS;GACT,QAAQ;IAAE,UAAU;IAAoB,MAAM;GAAO;EACvD;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ReactNode, RefObject } from "react";
|
|
2
|
+
//#region src/components/search/SearchAppBar.d.ts
|
|
3
|
+
export interface SearchAppBarClassNames {
|
|
4
|
+
/** The `<header>` container, merged with `className`. */
|
|
5
|
+
root?: string;
|
|
6
|
+
/** The leading slot holding `navigationIcon`. */
|
|
7
|
+
navigation?: string;
|
|
8
|
+
/** The area holding the search bar. */
|
|
9
|
+
search?: string;
|
|
10
|
+
/** The trailing slot holding `actions`. */
|
|
11
|
+
actions?: string;
|
|
12
|
+
}
|
|
13
|
+
interface SearchAppBarOwnProps {
|
|
14
|
+
/** The `SearchBar`. It fills the free space, up to 720px, centred. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** A leading control, e.g. a menu `IconButton`. */
|
|
17
|
+
navigationIcon?: ReactNode;
|
|
18
|
+
/** Trailing controls, e.g. an avatar or `IconButton`s. */
|
|
19
|
+
actions?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Respond to content scrolling under the bar: it sticks to the top and turns
|
|
22
|
+
* `surface-container` (its search bar `surface-container-highest`); `enter-always` also
|
|
23
|
+
* hides it on scroll down and brings it back on any scroll up. Leave it out for a static
|
|
24
|
+
* bar positioned by the consumer.
|
|
25
|
+
*/
|
|
26
|
+
scrollBehavior?: 'pinned' | 'enter-always';
|
|
27
|
+
/** The scroll container the bar responds to. Defaults to the window. */
|
|
28
|
+
scrollRef?: RefObject<HTMLElement | null>;
|
|
29
|
+
/** Classes for each part, by slot. */
|
|
30
|
+
classNames?: SearchAppBarClassNames;
|
|
31
|
+
}
|
|
32
|
+
export type SearchAppBarProps = SearchAppBarOwnProps & Omit<ComponentPropsWithRef<'header'>, keyof SearchAppBarOwnProps>;
|
|
33
|
+
/**
|
|
34
|
+
* M3 Expressive app bar with search (Compose's `AppBarWithSearch`): a top bar whose middle
|
|
35
|
+
* is a search bar, with an optional navigation icon and actions.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <SearchAppBar navigationIcon={<IconButton icon={<MenuIcon />} aria-label="Menu" />}
|
|
39
|
+
* actions={<Avatar />} scrollBehavior="enter-always">
|
|
40
|
+
* <SearchBar aria-label="Search" placeholder="Search" leadingIcon={<SearchIcon />} />
|
|
41
|
+
* </SearchAppBar>
|
|
42
|
+
*/
|
|
43
|
+
export declare function SearchAppBar({ children, navigationIcon, actions, scrollBehavior, scrollRef, classNames, className, ref, ...rest }: SearchAppBarProps): import("react").JSX.Element;
|
|
44
|
+
//#endregion
|
|
45
|
+
//# sourceMappingURL=SearchAppBar.d.ts.map
|