@windmorph/react 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +149 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/app-bar/AppBarItems.js +23 -0
- package/dist/components/app-bar/AppBarItems.js.map +1 -0
- package/dist/components/app-bar/TopAppBar.d.ts +89 -0
- package/dist/components/app-bar/TopAppBar.js +103 -0
- package/dist/components/app-bar/TopAppBar.js.map +1 -0
- package/dist/components/app-bar/app-bar-styles.d.ts +280 -0
- package/dist/components/app-bar/app-bar-styles.js +142 -0
- package/dist/components/app-bar/app-bar-styles.js.map +1 -0
- package/dist/components/app-bar/app-bar-tokens.d.ts +7 -0
- package/dist/components/app-bar/app-bar-tokens.js +64 -0
- package/dist/components/app-bar/app-bar-tokens.js.map +1 -0
- package/dist/components/app-bar/use-app-bar-scroll.d.ts +6 -0
- package/dist/components/app-bar/use-app-bar-scroll.js +139 -0
- package/dist/components/app-bar/use-app-bar-scroll.js.map +1 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +142 -0
- package/dist/components/autocomplete/Autocomplete.js +284 -0
- package/dist/components/autocomplete/Autocomplete.js.map +1 -0
- package/dist/components/badge/Badge.d.ts +71 -0
- package/dist/components/badge/Badge.js +72 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/badge/badge-styles.d.ts +100 -0
- package/dist/components/badge/badge-styles.js +43 -0
- package/dist/components/badge/badge-styles.js.map +1 -0
- package/dist/components/badge/badge-tokens.d.ts +7 -0
- package/dist/components/badge/badge-tokens.js +40 -0
- package/dist/components/badge/badge-tokens.js.map +1 -0
- package/dist/components/button/Button.d.ts +91 -0
- package/dist/components/button/Button.js +96 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/button/ButtonContext.d.ts +30 -0
- package/dist/components/button/ButtonContext.js +18 -0
- package/dist/components/button/ButtonContext.js.map +1 -0
- package/dist/components/button/DensityZeroButtons.js +25 -0
- package/dist/components/button/DensityZeroButtons.js.map +1 -0
- package/dist/components/button/button-pending.d.ts +10 -0
- package/dist/components/button/button-pending.js +166 -0
- package/dist/components/button/button-pending.js.map +1 -0
- package/dist/components/button/button-styles.d.ts +216 -0
- package/dist/components/button/button-styles.js +199 -0
- package/dist/components/button/button-styles.js.map +1 -0
- package/dist/components/button/button-tokens.d.ts +10 -0
- package/dist/components/button/button-tokens.js +257 -0
- package/dist/components/button/button-tokens.js.map +1 -0
- package/dist/components/button/connected-shapes.js +152 -0
- package/dist/components/button/connected-shapes.js.map +1 -0
- package/dist/components/card/Card.d.ts +60 -0
- package/dist/components/card/Card.js +69 -0
- package/dist/components/card/Card.js.map +1 -0
- package/dist/components/card/card-styles.d.ts +42 -0
- package/dist/components/card/card-styles.js +64 -0
- package/dist/components/card/card-styles.js.map +1 -0
- package/dist/components/card/card-tokens.d.ts +7 -0
- package/dist/components/card/card-tokens.js +84 -0
- package/dist/components/card/card-tokens.js.map +1 -0
- package/dist/components/carousel/Carousel.d.ts +124 -0
- package/dist/components/carousel/Carousel.js +387 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/carousel-keylines.js +486 -0
- package/dist/components/carousel/carousel-keylines.js.map +1 -0
- package/dist/components/carousel/carousel-press-area.js +35 -0
- package/dist/components/carousel/carousel-press-area.js.map +1 -0
- package/dist/components/carousel/carousel-styles.d.ts +188 -0
- package/dist/components/carousel/carousel-styles.js +116 -0
- package/dist/components/carousel/carousel-styles.js.map +1 -0
- package/dist/components/carousel/carousel-tokens.d.ts +7 -0
- package/dist/components/carousel/carousel-tokens.js +18 -0
- package/dist/components/carousel/carousel-tokens.js.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +78 -0
- package/dist/components/checkbox/Checkbox.js +77 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox-box.js +34 -0
- package/dist/components/checkbox/checkbox-box.js.map +1 -0
- package/dist/components/checkbox/checkbox-styles.d.ts +100 -0
- package/dist/components/checkbox/checkbox-styles.js +54 -0
- package/dist/components/checkbox/checkbox-styles.js.map +1 -0
- package/dist/components/checkbox/checkbox-tokens.d.ts +7 -0
- package/dist/components/checkbox/checkbox-tokens.js +41 -0
- package/dist/components/checkbox/checkbox-tokens.js.map +1 -0
- package/dist/components/chip/Chip.d.ts +171 -0
- package/dist/components/chip/Chip.js +348 -0
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipSet.d.ts +70 -0
- package/dist/components/chip/ChipSet.js +198 -0
- package/dist/components/chip/ChipSet.js.map +1 -0
- package/dist/components/chip/chip-styles.d.ts +263 -0
- package/dist/components/chip/chip-styles.js +360 -0
- package/dist/components/chip/chip-styles.js.map +1 -0
- package/dist/components/chip/chip-tokens.d.ts +13 -0
- package/dist/components/chip/chip-tokens.js +185 -0
- package/dist/components/chip/chip-tokens.js.map +1 -0
- package/dist/components/date-picker/CalendarGrid.js +94 -0
- package/dist/components/date-picker/CalendarGrid.js.map +1 -0
- package/dist/components/date-picker/CompactDateDialog.js +63 -0
- package/dist/components/date-picker/CompactDateDialog.js.map +1 -0
- package/dist/components/date-picker/DateField.d.ts +161 -0
- package/dist/components/date-picker/DateField.js +393 -0
- package/dist/components/date-picker/DateField.js.map +1 -0
- package/dist/components/date-picker/DateInput.d.ts +20 -0
- package/dist/components/date-picker/DateInput.js +99 -0
- package/dist/components/date-picker/DateInput.js.map +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +165 -0
- package/dist/components/date-picker/DatePicker.js +492 -0
- package/dist/components/date-picker/DatePicker.js.map +1 -0
- package/dist/components/date-picker/PickerDialog.d.ts +121 -0
- package/dist/components/date-picker/PickerDialog.js +161 -0
- package/dist/components/date-picker/PickerDialog.js.map +1 -0
- package/dist/components/date-picker/calendar-parts.js +141 -0
- package/dist/components/date-picker/calendar-parts.js.map +1 -0
- package/dist/components/date-picker/date-format.js +72 -0
- package/dist/components/date-picker/date-format.js.map +1 -0
- package/dist/components/date-picker/date-picker-styles.d.ts +247 -0
- package/dist/components/date-picker/date-picker-styles.js +163 -0
- package/dist/components/date-picker/date-picker-styles.js.map +1 -0
- package/dist/components/date-picker/date-picker-tokens.d.ts +7 -0
- package/dist/components/date-picker/date-picker-tokens.js +104 -0
- package/dist/components/date-picker/date-picker-tokens.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-context.js +8 -0
- package/dist/components/date-picker/picker-dialog-context.js.map +1 -0
- package/dist/components/date-picker/picker-dialog-styles.d.ts +95 -0
- package/dist/components/date-picker/picker-dialog-styles.js +57 -0
- package/dist/components/date-picker/picker-dialog-styles.js.map +1 -0
- package/dist/components/date-picker/picker-icons.js +24 -0
- package/dist/components/date-picker/picker-icons.js.map +1 -0
- package/dist/components/date-picker/use-media-query.js +21 -0
- package/dist/components/date-picker/use-media-query.js.map +1 -0
- package/dist/components/date-picker/use-size-transform.js +62 -0
- package/dist/components/date-picker/use-size-transform.js.map +1 -0
- package/dist/components/date-picker/use-view-exit.js +68 -0
- package/dist/components/date-picker/use-view-exit.js.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +267 -0
- package/dist/components/dialog/Dialog.js +521 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/dialog-styles.d.ts +335 -0
- package/dist/components/dialog/dialog-styles.js +377 -0
- package/dist/components/dialog/dialog-styles.js.map +1 -0
- package/dist/components/dialog/dialog-tokens.d.ts +7 -0
- package/dist/components/dialog/dialog-tokens.js +57 -0
- package/dist/components/dialog/dialog-tokens.js.map +1 -0
- package/dist/components/divider/Divider.d.ts +59 -0
- package/dist/components/divider/Divider.js +53 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/divider-styles.d.ts +90 -0
- package/dist/components/divider/divider-styles.js +66 -0
- package/dist/components/divider/divider-styles.js.map +1 -0
- package/dist/components/divider/divider-tokens.d.ts +7 -0
- package/dist/components/divider/divider-tokens.js +16 -0
- package/dist/components/divider/divider-tokens.js.map +1 -0
- package/dist/components/fab/Fab.d.ts +130 -0
- package/dist/components/fab/Fab.js +137 -0
- package/dist/components/fab/Fab.js.map +1 -0
- package/dist/components/fab/FabTooltip.js +36 -0
- package/dist/components/fab/FabTooltip.js.map +1 -0
- package/dist/components/fab/fab-styles.d.ts +286 -0
- package/dist/components/fab/fab-styles.js +131 -0
- package/dist/components/fab/fab-styles.js.map +1 -0
- package/dist/components/fab/fab-tokens.d.ts +12 -0
- package/dist/components/fab/fab-tokens.js +105 -0
- package/dist/components/fab/fab-tokens.js.map +1 -0
- package/dist/components/fab-menu/FabMenu.d.ts +156 -0
- package/dist/components/fab-menu/FabMenu.js +291 -0
- package/dist/components/fab-menu/FabMenu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-stagger.js +51 -0
- package/dist/components/fab-menu/fab-menu-stagger.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-styles.d.ts +166 -0
- package/dist/components/fab-menu/fab-menu-styles.js +107 -0
- package/dist/components/fab-menu/fab-menu-styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu-tokens.d.ts +7 -0
- package/dist/components/fab-menu/fab-menu-tokens.js +120 -0
- package/dist/components/fab-menu/fab-menu-tokens.js.map +1 -0
- package/dist/components/icon-button/IconButton.d.ts +125 -0
- package/dist/components/icon-button/IconButton.js +112 -0
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/icon-button-styles.d.ts +217 -0
- package/dist/components/icon-button/icon-button-styles.js +244 -0
- package/dist/components/icon-button/icon-button-styles.js.map +1 -0
- package/dist/components/icon-button/icon-button-tokens.d.ts +11 -0
- package/dist/components/icon-button/icon-button-tokens.js +215 -0
- package/dist/components/icon-button/icon-button-tokens.js.map +1 -0
- package/dist/components/list/List.d.ts +265 -0
- package/dist/components/list/List.js +1386 -0
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/list/ListMedia.d.ts +88 -0
- package/dist/components/list/ListMedia.js +132 -0
- package/dist/components/list/ListMedia.js.map +1 -0
- package/dist/components/list/list-styles.d.ts +375 -0
- package/dist/components/list/list-styles.js +220 -0
- package/dist/components/list/list-styles.js.map +1 -0
- package/dist/components/list/list-tokens.d.ts +7 -0
- package/dist/components/list/list-tokens.js +92 -0
- package/dist/components/list/list-tokens.js.map +1 -0
- package/dist/components/loading-indicator/LoadingIndicator.d.ts +65 -0
- package/dist/components/loading-indicator/LoadingIndicator.js +92 -0
- package/dist/components/loading-indicator/LoadingIndicator.js.map +1 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js +25 -0
- package/dist/components/loading-indicator/lazy-loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js +149 -0
- package/dist/components/loading-indicator/loading-indicator-frames.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-styles.d.ts +36 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js +22 -0
- package/dist/components/loading-indicator/loading-indicator-styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.d.ts +7 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js +44 -0
- package/dist/components/loading-indicator/loading-indicator-tokens.js.map +1 -0
- package/dist/components/menu/Menu.d.ts +215 -0
- package/dist/components/menu/Menu.js +715 -0
- package/dist/components/menu/Menu.js.map +1 -0
- package/dist/components/menu/menu-styles.d.ts +354 -0
- package/dist/components/menu/menu-styles.js +219 -0
- package/dist/components/menu/menu-styles.js.map +1 -0
- package/dist/components/menu/menu-tokens.d.ts +7 -0
- package/dist/components/menu/menu-tokens.js +93 -0
- package/dist/components/menu/menu-tokens.js.map +1 -0
- package/dist/components/menu/menu-trigger.d.ts +51 -0
- package/dist/components/menu/menu-trigger.js +100 -0
- package/dist/components/menu/menu-trigger.js.map +1 -0
- package/dist/components/menu/use-reveal-entering.js +42 -0
- package/dist/components/menu/use-reveal-entering.js.map +1 -0
- package/dist/components/navigation/NavItem.d.ts +54 -0
- package/dist/components/navigation/NavItem.js +182 -0
- package/dist/components/navigation/NavItem.js.map +1 -0
- package/dist/components/navigation/NavigationBar.d.ts +64 -0
- package/dist/components/navigation/NavigationBar.js +121 -0
- package/dist/components/navigation/NavigationBar.js.map +1 -0
- package/dist/components/navigation/NavigationRail.d.ts +91 -0
- package/dist/components/navigation/NavigationRail.js +285 -0
- package/dist/components/navigation/NavigationRail.js.map +1 -0
- package/dist/components/navigation/nav-item-styles.d.ts +190 -0
- package/dist/components/navigation/nav-item-styles.js +123 -0
- package/dist/components/navigation/nav-item-styles.js.map +1 -0
- package/dist/components/navigation/navigation-styles.d.ts +239 -0
- package/dist/components/navigation/navigation-styles.js +134 -0
- package/dist/components/navigation/navigation-styles.js.map +1 -0
- package/dist/components/navigation/navigation-tokens.d.ts +9 -0
- package/dist/components/navigation/navigation-tokens.js +114 -0
- package/dist/components/navigation/navigation-tokens.js.map +1 -0
- package/dist/components/navigation/use-hide-on-scroll.js +115 -0
- package/dist/components/navigation/use-hide-on-scroll.js.map +1 -0
- package/dist/components/navigation/use-item-arrow-keys.js +37 -0
- package/dist/components/navigation/use-item-arrow-keys.js.map +1 -0
- package/dist/components/navigation/use-rail-item-morph.js +61 -0
- package/dist/components/navigation/use-rail-item-morph.js.map +1 -0
- package/dist/components/progress/ProgressIndicator.d.ts +95 -0
- package/dist/components/progress/ProgressIndicator.js +426 -0
- package/dist/components/progress/ProgressIndicator.js.map +1 -0
- package/dist/components/progress/progress-geometry.js +285 -0
- package/dist/components/progress/progress-geometry.js.map +1 -0
- package/dist/components/progress/progress-styles.d.ts +81 -0
- package/dist/components/progress/progress-styles.js +43 -0
- package/dist/components/progress/progress-styles.js.map +1 -0
- package/dist/components/progress/progress-tokens.d.ts +7 -0
- package/dist/components/progress/progress-tokens.js +39 -0
- package/dist/components/progress/progress-tokens.js.map +1 -0
- package/dist/components/pull-to-refresh/PullToRefresh.d.ts +94 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js +395 -0
- package/dist/components/pull-to-refresh/PullToRefresh.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js +37 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-math.js.map +1 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.d.ts +53 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js +14 -0
- package/dist/components/pull-to-refresh/pull-to-refresh-styles.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +121 -0
- package/dist/components/radio/RadioGroup.js +163 -0
- package/dist/components/radio/RadioGroup.js.map +1 -0
- package/dist/components/radio/radio-ring.js +21 -0
- package/dist/components/radio/radio-ring.js.map +1 -0
- package/dist/components/radio/radio-styles.d.ts +155 -0
- package/dist/components/radio/radio-styles.js +60 -0
- package/dist/components/radio/radio-styles.js.map +1 -0
- package/dist/components/radio/radio-tokens.d.ts +7 -0
- package/dist/components/radio/radio-tokens.js +31 -0
- package/dist/components/radio/radio-tokens.js.map +1 -0
- package/dist/components/search/SearchAppBar.d.ts +45 -0
- package/dist/components/search/SearchAppBar.js +61 -0
- package/dist/components/search/SearchAppBar.js.map +1 -0
- package/dist/components/search/SearchBar.d.ts +147 -0
- package/dist/components/search/SearchBar.js +412 -0
- package/dist/components/search/SearchBar.js.map +1 -0
- package/dist/components/search/search-styles.d.ts +243 -0
- package/dist/components/search/search-styles.js +143 -0
- package/dist/components/search/search-styles.js.map +1 -0
- package/dist/components/search/search-tokens.d.ts +9 -0
- package/dist/components/search/search-tokens.js +70 -0
- package/dist/components/search/search-tokens.js.map +1 -0
- package/dist/components/select/Select.d.ts +187 -0
- package/dist/components/select/Select.js +319 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select/field-shell.d.ts +29 -0
- package/dist/components/select/field-shell.js +135 -0
- package/dist/components/select/field-shell.js.map +1 -0
- package/dist/components/select/option-list.d.ts +81 -0
- package/dist/components/select/option-list.js +291 -0
- package/dist/components/select/option-list.js.map +1 -0
- package/dist/components/select/search-list.js +135 -0
- package/dist/components/select/search-list.js.map +1 -0
- package/dist/components/select/selection-cap.js +30 -0
- package/dist/components/select/selection-cap.js.map +1 -0
- package/dist/components/sheet/BottomSheet.d.ts +154 -0
- package/dist/components/sheet/BottomSheet.js +442 -0
- package/dist/components/sheet/BottomSheet.js.map +1 -0
- package/dist/components/sheet/SheetTrigger.d.ts +25 -0
- package/dist/components/sheet/SheetTrigger.js +46 -0
- package/dist/components/sheet/SheetTrigger.js.map +1 -0
- package/dist/components/sheet/SideSheet.d.ts +139 -0
- package/dist/components/sheet/SideSheet.js +289 -0
- package/dist/components/sheet/SideSheet.js.map +1 -0
- package/dist/components/sheet/bottom-sheet-gesture.js +30 -0
- package/dist/components/sheet/bottom-sheet-gesture.js.map +1 -0
- package/dist/components/sheet/lazy-bottom-sheet.js +33 -0
- package/dist/components/sheet/lazy-bottom-sheet.js.map +1 -0
- package/dist/components/sheet/sheet-gesture.js +48 -0
- package/dist/components/sheet/sheet-gesture.js.map +1 -0
- package/dist/components/sheet/sheet-icons.js +31 -0
- package/dist/components/sheet/sheet-icons.js.map +1 -0
- package/dist/components/sheet/sheet-settle.js +58 -0
- package/dist/components/sheet/sheet-settle.js.map +1 -0
- package/dist/components/sheet/sheet-styles.d.ts +312 -0
- package/dist/components/sheet/sheet-styles.js +229 -0
- package/dist/components/sheet/sheet-styles.js.map +1 -0
- package/dist/components/sheet/sheet-tokens.d.ts +12 -0
- package/dist/components/sheet/sheet-tokens.js +115 -0
- package/dist/components/sheet/sheet-tokens.js.map +1 -0
- package/dist/components/sheet/side-swipe-gesture.js +22 -0
- package/dist/components/sheet/side-swipe-gesture.js.map +1 -0
- package/dist/components/sheet/use-peek-inert.js +32 -0
- package/dist/components/sheet/use-peek-inert.js.map +1 -0
- package/dist/components/sheet/use-side-swipe.js +174 -0
- package/dist/components/sheet/use-side-swipe.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +129 -0
- package/dist/components/slider/Slider.js +295 -0
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/slider-geometry.js +138 -0
- package/dist/components/slider/slider-geometry.js.map +1 -0
- package/dist/components/slider/slider-styles.d.ts +133 -0
- package/dist/components/slider/slider-styles.js +97 -0
- package/dist/components/slider/slider-styles.js.map +1 -0
- package/dist/components/slider/slider-tokens.d.ts +7 -0
- package/dist/components/slider/slider-tokens.js +66 -0
- package/dist/components/slider/slider-tokens.js.map +1 -0
- package/dist/components/slider/use-touch-track.js +138 -0
- package/dist/components/slider/use-touch-track.js.map +1 -0
- package/dist/components/snackbar/Snackbar.d.ts +96 -0
- package/dist/components/snackbar/Snackbar.js +253 -0
- package/dist/components/snackbar/Snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar-state.d.ts +58 -0
- package/dist/components/snackbar/snackbar-state.js +73 -0
- package/dist/components/snackbar/snackbar-state.js.map +1 -0
- package/dist/components/snackbar/snackbar-styles.d.ts +109 -0
- package/dist/components/snackbar/snackbar-styles.js +67 -0
- package/dist/components/snackbar/snackbar-styles.js.map +1 -0
- package/dist/components/snackbar/snackbar-tokens.d.ts +7 -0
- package/dist/components/snackbar/snackbar-tokens.js +54 -0
- package/dist/components/snackbar/snackbar-tokens.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +109 -0
- package/dist/components/split-button/SplitButton.js +195 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/split-button-styles.d.ts +214 -0
- package/dist/components/split-button/split-button-styles.js +164 -0
- package/dist/components/split-button/split-button-styles.js.map +1 -0
- package/dist/components/split-button/split-button-tokens.d.ts +7 -0
- package/dist/components/split-button/split-button-tokens.js +36 -0
- package/dist/components/split-button/split-button-tokens.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +82 -0
- package/dist/components/switch/Switch.js +165 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/switch-styles.d.ts +96 -0
- package/dist/components/switch/switch-styles.js +68 -0
- package/dist/components/switch/switch-styles.js.map +1 -0
- package/dist/components/switch/switch-thumb.js +41 -0
- package/dist/components/switch/switch-thumb.js.map +1 -0
- package/dist/components/switch/switch-tokens.d.ts +7 -0
- package/dist/components/switch/switch-tokens.js +78 -0
- package/dist/components/switch/switch-tokens.js.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +120 -0
- package/dist/components/tabs/Tabs.js +346 -0
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/tabs-styles.d.ts +198 -0
- package/dist/components/tabs/tabs-styles.js +99 -0
- package/dist/components/tabs/tabs-styles.js.map +1 -0
- package/dist/components/tabs/tabs-tokens.d.ts +7 -0
- package/dist/components/tabs/tabs-tokens.js +121 -0
- package/dist/components/tabs/tabs-tokens.js.map +1 -0
- package/dist/components/text-field/TextField.d.ts +175 -0
- package/dist/components/text-field/TextField.js +250 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/text-field-styles.d.ts +252 -0
- package/dist/components/text-field/text-field-styles.js +209 -0
- package/dist/components/text-field/text-field-styles.js.map +1 -0
- package/dist/components/text-field/text-field-tokens.d.ts +7 -0
- package/dist/components/text-field/text-field-tokens.js +177 -0
- package/dist/components/text-field/text-field-tokens.js.map +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +142 -0
- package/dist/components/time-picker/TimePicker.js +700 -0
- package/dist/components/time-picker/TimePicker.js.map +1 -0
- package/dist/components/time-picker/time-picker-styles.d.ts +175 -0
- package/dist/components/time-picker/time-picker-styles.js +112 -0
- package/dist/components/time-picker/time-picker-styles.js.map +1 -0
- package/dist/components/time-picker/time-picker-tokens.d.ts +7 -0
- package/dist/components/time-picker/time-picker-tokens.js +86 -0
- package/dist/components/time-picker/time-picker-tokens.js.map +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +209 -0
- package/dist/components/toolbar/Toolbar.js +282 -0
- package/dist/components/toolbar/Toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar-styles.d.ts +403 -0
- package/dist/components/toolbar/toolbar-styles.js +253 -0
- package/dist/components/toolbar/toolbar-styles.js.map +1 -0
- package/dist/components/toolbar/toolbar-tokens.d.ts +27 -0
- package/dist/components/toolbar/toolbar-tokens.js +117 -0
- package/dist/components/toolbar/toolbar-tokens.js.map +1 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.d.ts +56 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js +86 -0
- package/dist/components/toolbar/use-toolbar-scroll-expansion.js.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +131 -0
- package/dist/components/tooltip/Tooltip.js +388 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/lazy-tooltip.js +35 -0
- package/dist/components/tooltip/lazy-tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +16 -0
- package/dist/components/tooltip/tooltip-placement.js +14 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip-styles.d.ts +142 -0
- package/dist/components/tooltip/tooltip-styles.js +81 -0
- package/dist/components/tooltip/tooltip-styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-tokens.d.ts +9 -0
- package/dist/components/tooltip/tooltip-tokens.js +72 -0
- package/dist/components/tooltip/tooltip-tokens.js.map +1 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +42 -0
- package/dist/components/tooltip/tooltip-trigger.js +115 -0
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -0
- package/dist/composites/button-group/ButtonGroup.d.ts +116 -0
- package/dist/composites/button-group/ButtonGroup.js +270 -0
- package/dist/composites/button-group/ButtonGroup.js.map +1 -0
- package/dist/composites/button-group/button-group-styles.d.ts +73 -0
- package/dist/composites/button-group/button-group-styles.js +87 -0
- package/dist/composites/button-group/button-group-styles.js.map +1 -0
- package/dist/composites/button-group/lazy-overflow-menu.js +43 -0
- package/dist/composites/button-group/lazy-overflow-menu.js.map +1 -0
- package/dist/composites/button-group/overflow-menu-list.js +26 -0
- package/dist/composites/button-group/overflow-menu-list.js.map +1 -0
- package/dist/composites/button-group/use-overflow.js +75 -0
- package/dist/composites/button-group/use-overflow.js.map +1 -0
- package/dist/composites/button-group/use-press-expansion.js +155 -0
- package/dist/composites/button-group/use-press-expansion.js.map +1 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +136 -0
- package/dist/motion/get-m3-spring.d.ts +6 -0
- package/dist/motion/get-m3-spring.js +10 -0
- package/dist/motion/get-m3-spring.js.map +1 -0
- package/dist/motion/reduced-motion.js +19 -0
- package/dist/motion/reduced-motion.js.map +1 -0
- package/dist/motion/use-m3-spring.d.ts +13 -0
- package/dist/motion/use-m3-spring.js +22 -0
- package/dist/motion/use-m3-spring.js.map +1 -0
- package/dist/next/NextRouterProvider.d.ts +13 -0
- package/dist/next/NextRouterProvider.js +26 -0
- package/dist/next/NextRouterProvider.js.map +1 -0
- package/dist/next/get-theme-from-cookies.d.ts +32 -0
- package/dist/next/get-theme-from-cookies.js +27 -0
- package/dist/next/get-theme-from-cookies.js.map +1 -0
- package/dist/next/navigation-guard.d.ts +30 -0
- package/dist/next/navigation-guard.js +68 -0
- package/dist/next/navigation-guard.js.map +1 -0
- package/dist/next.d.ts +5 -0
- package/dist/next.js +5 -0
- package/dist/primitives/ButtonBase.d.ts +115 -0
- package/dist/primitives/ButtonBase.js +231 -0
- package/dist/primitives/ButtonBase.js.map +1 -0
- package/dist/primitives/DomDirectionLocale.d.ts +18 -0
- package/dist/primitives/DomDirectionLocale.js +28 -0
- package/dist/primitives/DomDirectionLocale.js.map +1 -0
- package/dist/primitives/Field.d.ts +50 -0
- package/dist/primitives/Field.js +74 -0
- package/dist/primitives/Field.js.map +1 -0
- package/dist/primitives/IconFaces.js +23 -0
- package/dist/primitives/IconFaces.js.map +1 -0
- package/dist/primitives/Overlay.d.ts +39 -0
- package/dist/primitives/Overlay.js +86 -0
- package/dist/primitives/Overlay.js.map +1 -0
- package/dist/primitives/SelectionControl.d.ts +55 -0
- package/dist/primitives/SelectionControl.js +58 -0
- package/dist/primitives/SelectionControl.js.map +1 -0
- package/dist/primitives/Surface.d.ts +123 -0
- package/dist/primitives/Surface.js +68 -0
- package/dist/primitives/Surface.js.map +1 -0
- package/dist/primitives/ToolbarContext.js +12 -0
- package/dist/primitives/ToolbarContext.js.map +1 -0
- package/dist/primitives/TouchTarget.d.ts +14 -0
- package/dist/primitives/TouchTarget.js +20 -0
- package/dist/primitives/TouchTarget.js.map +1 -0
- package/dist/primitives/TriggerContext.d.ts +34 -0
- package/dist/primitives/TriggerContext.js +24 -0
- package/dist/primitives/TriggerContext.js.map +1 -0
- package/dist/primitives/hidden-input-focus.js +27 -0
- package/dist/primitives/hidden-input-focus.js.map +1 -0
- package/dist/primitives/icon-faces-styles.d.ts +9 -0
- package/dist/primitives/icon-faces-styles.js +45 -0
- package/dist/primitives/icon-faces-styles.js.map +1 -0
- package/dist/primitives/locale-with-direction.d.ts +9 -0
- package/dist/primitives/locale-with-direction.js +17 -0
- package/dist/primitives/locale-with-direction.js.map +1 -0
- package/dist/primitives/morph-path.d.ts +25 -0
- package/dist/primitives/morph-path.js +38 -0
- package/dist/primitives/morph-path.js.map +1 -0
- package/dist/primitives/selection-control-styles.d.ts +54 -0
- package/dist/primitives/selection-control-styles.js +44 -0
- package/dist/primitives/selection-control-styles.js.map +1 -0
- package/dist/primitives/use-m3-interaction.d.ts +51 -0
- package/dist/primitives/use-m3-interaction.js +149 -0
- package/dist/primitives/use-m3-interaction.js.map +1 -0
- package/dist/primitives/use-m3-morph.d.ts +18 -0
- package/dist/primitives/use-m3-morph.js +36 -0
- package/dist/primitives/use-m3-morph.js.map +1 -0
- package/dist/primitives/use-presence.d.ts +19 -0
- package/dist/primitives/use-presence.js +37 -0
- package/dist/primitives/use-presence.js.map +1 -0
- package/dist/primitives.d.ts +36 -0
- package/dist/primitives.js +34 -0
- package/dist/shapes/corner-rounding.d.ts +13 -0
- package/dist/shapes/corner-rounding.js +18 -0
- package/dist/shapes/corner-rounding.js.map +1 -0
- package/dist/shapes/cubic.d.ts +52 -0
- package/dist/shapes/cubic.js +189 -0
- package/dist/shapes/cubic.js.map +1 -0
- package/dist/shapes/feature-mapping.js +80 -0
- package/dist/shapes/feature-mapping.js.map +1 -0
- package/dist/shapes/features.d.ts +23 -0
- package/dist/shapes/features.js +82 -0
- package/dist/shapes/features.js.map +1 -0
- package/dist/shapes/float-mapping.js +65 -0
- package/dist/shapes/float-mapping.js.map +1 -0
- package/dist/shapes/generated/material-shape-path-record.d.ts +11 -0
- package/dist/shapes/generated/material-shape-path-record.js +48 -0
- package/dist/shapes/generated/material-shape-path-record.js.map +1 -0
- package/dist/shapes/generated/material-shape-paths.d.ts +78 -0
- package/dist/shapes/generated/material-shape-paths.js +218 -0
- package/dist/shapes/generated/material-shape-paths.js.map +1 -0
- package/dist/shapes/mask.d.ts +14 -0
- package/dist/shapes/mask.js +24 -0
- package/dist/shapes/mask.js.map +1 -0
- package/dist/shapes/material-shapes.d.ts +11 -0
- package/dist/shapes/material-shapes.js +250 -0
- package/dist/shapes/material-shapes.js.map +1 -0
- package/dist/shapes/morph.d.ts +25 -0
- package/dist/shapes/morph.js +97 -0
- package/dist/shapes/morph.js.map +1 -0
- package/dist/shapes/path.d.ts +33 -0
- package/dist/shapes/path.js +47 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/point.d.ts +28 -0
- package/dist/shapes/point.js +103 -0
- package/dist/shapes/point.js.map +1 -0
- package/dist/shapes/polygon-measure.js +140 -0
- package/dist/shapes/polygon-measure.js.map +1 -0
- package/dist/shapes/rounded-polygon.d.ts +44 -0
- package/dist/shapes/rounded-polygon.js +278 -0
- package/dist/shapes/rounded-polygon.js.map +1 -0
- package/dist/shapes/shape-path.d.ts +15 -0
- package/dist/shapes/shapes.d.ts +53 -0
- package/dist/shapes/shapes.js +171 -0
- package/dist/shapes/shapes.js.map +1 -0
- package/dist/styles/generated/components.css +710 -0
- package/dist/styles/generated/theme.css +247 -0
- package/dist/styles/generated/themes.css +3361 -0
- package/dist/styles/generated/tokens.css +284 -0
- package/dist/styles/styles.css +15 -0
- package/dist/styles/utilities.css +283 -0
- package/dist/styles.compiled.css +2 -0
- package/dist/theme/ThemeProvider.d.ts +72 -0
- package/dist/theme/ThemeProvider.js +144 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScope.d.ts +32 -0
- package/dist/theme/ThemeScope.js +67 -0
- package/dist/theme/ThemeScope.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +26 -0
- package/dist/theme/ThemeScript.js +44 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/context.d.ts +32 -0
- package/dist/theme/context.js +47 -0
- package/dist/theme/context.js.map +1 -0
- package/dist/theme/create-theme.d.ts +60 -0
- package/dist/theme/create-theme.js +47 -0
- package/dist/theme/create-theme.js.map +1 -0
- package/dist/theme/css.js +54 -0
- package/dist/theme/css.js.map +1 -0
- package/dist/theme/parse-palettes.js +40 -0
- package/dist/theme/parse-palettes.js.map +1 -0
- package/dist/theme/scheme.d.ts +6 -0
- package/dist/theme/scheme.js +118 -0
- package/dist/theme/scheme.js.map +1 -0
- package/dist/theme/state.d.ts +38 -0
- package/dist/theme/state.js +93 -0
- package/dist/theme/state.js.map +1 -0
- package/dist/theme/storage.js +21 -0
- package/dist/theme/storage.js.map +1 -0
- package/dist/tokens/breakpoints.d.ts +15 -0
- package/dist/tokens/breakpoints.js +16 -0
- package/dist/tokens/breakpoints.js.map +1 -0
- package/dist/tokens/color.d.ts +104 -0
- package/dist/tokens/color.js +147 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/component.d.ts +110 -0
- package/dist/tokens/component.js +67 -0
- package/dist/tokens/component.js.map +1 -0
- package/dist/tokens/density.d.ts +20 -0
- package/dist/tokens/density.js +27 -0
- package/dist/tokens/density.js.map +1 -0
- package/dist/tokens/elevation.d.ts +44 -0
- package/dist/tokens/elevation.js +45 -0
- package/dist/tokens/elevation.js.map +1 -0
- package/dist/tokens/motion.d.ts +79 -0
- package/dist/tokens/motion.js +126 -0
- package/dist/tokens/motion.js.map +1 -0
- package/dist/tokens/shape.d.ts +22 -0
- package/dist/tokens/shape.js +22 -0
- package/dist/tokens/shape.js.map +1 -0
- package/dist/tokens/spring-velocity.d.ts +19 -0
- package/dist/tokens/spring-velocity.js +44 -0
- package/dist/tokens/spring-velocity.js.map +1 -0
- package/dist/tokens/state.d.ts +18 -0
- package/dist/tokens/state.js +19 -0
- package/dist/tokens/state.js.map +1 -0
- package/dist/tokens/typography.d.ts +64 -0
- package/dist/tokens/typography.js +60 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/z-index.d.ts +17 -0
- package/dist/tokens/z-index.js +18 -0
- package/dist/tokens/z-index.js.map +1 -0
- package/dist/utils/announce.js +51 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/assert-collection-children.js +26 -0
- package/dist/utils/assert-collection-children.js.map +1 -0
- package/dist/utils/closed-by.d.ts +9 -0
- package/dist/utils/closed-by.js +12 -0
- package/dist/utils/closed-by.js.map +1 -0
- package/dist/utils/cn.d.ts +31 -0
- package/dist/utils/cn.js +37 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/composite-keys.js +32 -0
- package/dist/utils/composite-keys.js.map +1 -0
- package/dist/utils/focus-visible.js +14 -0
- package/dist/utils/focus-visible.js.map +1 -0
- package/dist/utils/focus.js +51 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/focusable-disabled.js +12 -0
- package/dist/utils/focusable-disabled.js.map +1 -0
- package/dist/utils/keep-pressed-in-place.d.ts +60 -0
- package/dist/utils/keep-pressed-in-place.js +127 -0
- package/dist/utils/keep-pressed-in-place.js.map +1 -0
- package/dist/utils/load-on-demand.js +111 -0
- package/dist/utils/load-on-demand.js.map +1 -0
- package/dist/utils/merge-data-tokens.d.ts +9 -0
- package/dist/utils/merge-data-tokens.js +15 -0
- package/dist/utils/merge-data-tokens.js.map +1 -0
- package/dist/utils/natural-size.js +53 -0
- package/dist/utils/natural-size.js.map +1 -0
- package/dist/utils/nearest-reveal.js +28 -0
- package/dist/utils/nearest-reveal.js.map +1 -0
- package/dist/utils/placement.js +14 -0
- package/dist/utils/placement.js.map +1 -0
- package/dist/utils/radio-group-keys.js +74 -0
- package/dist/utils/radio-group-keys.js.map +1 -0
- package/dist/utils/rendered-description.js +17 -0
- package/dist/utils/rendered-description.js.map +1 -0
- package/dist/utils/root-props.d.ts +103 -0
- package/dist/utils/root-props.js +51 -0
- package/dist/utils/root-props.js.map +1 -0
- package/dist/utils/search.d.ts +11 -0
- package/dist/utils/search.js +18 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/shortcut.js +20 -0
- package/dist/utils/shortcut.js.map +1 -0
- package/dist/utils/split-data-attributes.d.ts +12 -0
- package/dist/utils/split-data-attributes.js +20 -0
- package/dist/utils/split-data-attributes.js.map +1 -0
- package/dist/utils/toolbar-keys.js +28 -0
- package/dist/utils/toolbar-keys.js.map +1 -0
- package/dist/utils/tv.d.ts +7 -0
- package/dist/utils/tv.js +9 -0
- package/dist/utils/tv.js.map +1 -0
- package/dist/utils/typeahead.js +64 -0
- package/dist/utils/typeahead.js.map +1 -0
- package/dist/utils/warn-once.js +30 -0
- package/dist/utils/warn-once.js.map +1 -0
- package/dist/vendor/material-color-utilities/blend/blend.js +88 -0
- package/dist/vendor/material-color-utilities/blend/blend.js.map +1 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js +131 -0
- package/dist/vendor/material-color-utilities/contrast/contrast.js.map +1 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js +58 -0
- package/dist/vendor/material-color-utilities/dislike/dislike_analyzer.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js +620 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2021.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js +786 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/color_spec_2025.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js +59 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/contrast_curve.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js +420 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_color.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js +701 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/dynamic_scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js +374 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/material_dynamic_colors.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js +65 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/tone_delta_pair.js.map +1 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js +38 -0
- package/dist/vendor/material-color-utilities/dynamiccolor/variant.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js +309 -0
- package/dist/vendor/material-color-utilities/hct/cam16.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct.js +148 -0
- package/dist/vendor/material-color-utilities/hct/hct.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js +660 -0
- package/dist/vendor/material-color-utilities/hct/hct_solver.js.map +1 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js +117 -0
- package/dist/vendor/material-color-utilities/hct/viewing_conditions.js.map +1 -0
- package/dist/vendor/material-color-utilities/index.js +51 -0
- package/dist/vendor/material-color-utilities/index.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js +22 -0
- package/dist/vendor/material-color-utilities/palettes/core_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js +134 -0
- package/dist/vendor/material-color-utilities/palettes/tonal_palette.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js +21 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_android.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_content.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js +38 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_expressive.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fidelity.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_fruit_salad.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_monochrome.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js +36 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_neutral.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js +22 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_rainbow.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js +41 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_tonal_spot.js.map +1 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js +39 -0
- package/dist/vendor/material-color-utilities/scheme/scheme_vibrant.js.map +1 -0
- package/dist/vendor/material-color-utilities/score/score.js +115 -0
- package/dist/vendor/material-color-utilities/score/score.js.map +1 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js +227 -0
- package/dist/vendor/material-color-utilities/temperature/temperature_cache.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js +246 -0
- package/dist/vendor/material-color-utilities/utils/color_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js +21 -0
- package/dist/vendor/material-color-utilities/utils/image_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js +119 -0
- package/dist/vendor/material-color-utilities/utils/math_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js +74 -0
- package/dist/vendor/material-color-utilities/utils/string_utils.js.map +1 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js +24 -0
- package/dist/vendor/material-color-utilities/utils/theme_utils.js.map +1 -0
- package/package.json +114 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temperature_cache.js","names":["mathUtils.sanitizeDegreesInt","mathUtils.sanitizeDegreesDouble","colorUtils.labFromArgb"],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/temperature/temperature_cache.js"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// This file is automatically generated. Do not modify it.\nimport { Hct } from '../hct/hct.js';\nimport * as colorUtils from '../utils/color_utils.js';\nimport * as mathUtils from '../utils/math_utils.js';\n/**\n * Design utilities using color temperature theory.\n *\n * Analogous colors, complementary color, and cache to efficiently, lazily,\n * generate data for calculations when needed.\n */\nexport class TemperatureCache {\n constructor(input) {\n this.input = input;\n this.hctsByTempCache = [];\n this.hctsByHueCache = [];\n this.tempsByHctCache = new Map();\n this.inputRelativeTemperatureCache = -1.0;\n this.complementCache = null;\n }\n get hctsByTemp() {\n if (this.hctsByTempCache.length > 0) {\n return this.hctsByTempCache;\n }\n const hcts = this.hctsByHue.concat([this.input]);\n const temperaturesByHct = this.tempsByHct;\n hcts.sort((a, b) => temperaturesByHct.get(a) - temperaturesByHct.get(b));\n this.hctsByTempCache = hcts;\n return hcts;\n }\n get warmest() {\n return this.hctsByTemp[this.hctsByTemp.length - 1];\n }\n get coldest() {\n return this.hctsByTemp[0];\n }\n /**\n * A set of colors with differing hues, equidistant in temperature.\n *\n * In art, this is usually described as a set of 5 colors on a color wheel\n * divided into 12 sections. This method allows provision of either of those\n * values.\n *\n * Behavior is undefined when [count] or [divisions] is 0.\n * When divisions < count, colors repeat.\n *\n * [count] The number of colors to return, includes the input color.\n * [divisions] The number of divisions on the color wheel.\n */\n analogous(count = 5, divisions = 12) {\n const startHue = Math.round(this.input.hue);\n const startHct = this.hctsByHue[startHue];\n let lastTemp = this.relativeTemperature(startHct);\n const allColors = [startHct];\n let absoluteTotalTempDelta = 0.0;\n for (let i = 0; i < 360; i++) {\n const hue = mathUtils.sanitizeDegreesInt(startHue + i);\n const hct = this.hctsByHue[hue];\n const temp = this.relativeTemperature(hct);\n const tempDelta = Math.abs(temp - lastTemp);\n lastTemp = temp;\n absoluteTotalTempDelta += tempDelta;\n }\n let hueAddend = 1;\n const tempStep = absoluteTotalTempDelta / divisions;\n let totalTempDelta = 0.0;\n lastTemp = this.relativeTemperature(startHct);\n while (allColors.length < divisions) {\n const hue = mathUtils.sanitizeDegreesInt(startHue + hueAddend);\n const hct = this.hctsByHue[hue];\n const temp = this.relativeTemperature(hct);\n const tempDelta = Math.abs(temp - lastTemp);\n totalTempDelta += tempDelta;\n const desiredTotalTempDeltaForIndex = allColors.length * tempStep;\n let indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex;\n let indexAddend = 1;\n // Keep adding this hue to the answers until its temperature is\n // insufficient. This ensures consistent behavior when there aren't\n // [divisions] discrete steps between 0 and 360 in hue with [tempStep]\n // delta in temperature between them.\n //\n // For example, white and black have no analogues: there are no other\n // colors at T100/T0. Therefore, they should just be added to the array\n // as answers.\n while (indexSatisfied && allColors.length < divisions) {\n allColors.push(hct);\n const desiredTotalTempDeltaForIndex = ((allColors.length + indexAddend) * tempStep);\n indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex;\n indexAddend++;\n }\n lastTemp = temp;\n hueAddend++;\n if (hueAddend > 360) {\n while (allColors.length < divisions) {\n allColors.push(hct);\n }\n break;\n }\n }\n const answers = [this.input];\n // First, generate analogues from rotating counter-clockwise.\n const increaseHueCount = Math.floor((count - 1) / 2.0);\n for (let i = 1; i < (increaseHueCount + 1); i++) {\n let index = 0 - i;\n while (index < 0) {\n index = allColors.length + index;\n }\n if (index >= allColors.length) {\n index = index % allColors.length;\n }\n answers.splice(0, 0, allColors[index]);\n }\n // Second, generate analogues from rotating clockwise.\n const decreaseHueCount = count - increaseHueCount - 1;\n for (let i = 1; i < (decreaseHueCount + 1); i++) {\n let index = i;\n while (index < 0) {\n index = allColors.length + index;\n }\n if (index >= allColors.length) {\n index = index % allColors.length;\n }\n answers.push(allColors[index]);\n }\n return answers;\n }\n /**\n * A color that complements the input color aesthetically.\n *\n * In art, this is usually described as being across the color wheel.\n * History of this shows intent as a color that is just as cool-warm as the\n * input color is warm-cool.\n */\n get complement() {\n if (this.complementCache != null) {\n return this.complementCache;\n }\n const coldestHue = this.coldest.hue;\n const coldestTemp = this.tempsByHct.get(this.coldest);\n const warmestHue = this.warmest.hue;\n const warmestTemp = this.tempsByHct.get(this.warmest);\n const range = warmestTemp - coldestTemp;\n const startHueIsColdestToWarmest = TemperatureCache.isBetween(this.input.hue, coldestHue, warmestHue);\n const startHue = startHueIsColdestToWarmest ? warmestHue : coldestHue;\n const endHue = startHueIsColdestToWarmest ? coldestHue : warmestHue;\n const directionOfRotation = 1.0;\n let smallestError = 1000.0;\n let answer = this.hctsByHue[Math.round(this.input.hue)];\n const complementRelativeTemp = 1.0 - this.inputRelativeTemperature;\n // Find the color in the other section, closest to the inverse percentile\n // of the input color. This is the complement.\n for (let hueAddend = 0.0; hueAddend <= 360.0; hueAddend += 1.0) {\n const hue = mathUtils.sanitizeDegreesDouble(startHue + directionOfRotation * hueAddend);\n if (!TemperatureCache.isBetween(hue, startHue, endHue)) {\n continue;\n }\n const possibleAnswer = this.hctsByHue[Math.round(hue)];\n const relativeTemp = (this.tempsByHct.get(possibleAnswer) - coldestTemp) / range;\n const error = Math.abs(complementRelativeTemp - relativeTemp);\n if (error < smallestError) {\n smallestError = error;\n answer = possibleAnswer;\n }\n }\n this.complementCache = answer;\n return this.complementCache;\n }\n /**\n * Temperature relative to all colors with the same chroma and tone.\n * Value on a scale from 0 to 1.\n */\n relativeTemperature(hct) {\n const range = this.tempsByHct.get(this.warmest) - this.tempsByHct.get(this.coldest);\n const differenceFromColdest = this.tempsByHct.get(hct) - this.tempsByHct.get(this.coldest);\n // Handle when there's no difference in temperature between warmest and\n // coldest: for example, at T100, only one color is available, white.\n if (range === 0.0) {\n return 0.5;\n }\n return differenceFromColdest / range;\n }\n /** Relative temperature of the input color. See [relativeTemperature]. */\n get inputRelativeTemperature() {\n if (this.inputRelativeTemperatureCache >= 0.0) {\n return this.inputRelativeTemperatureCache;\n }\n this.inputRelativeTemperatureCache = this.relativeTemperature(this.input);\n return this.inputRelativeTemperatureCache;\n }\n /** A Map with keys of HCTs in [hctsByTemp], values of raw temperature. */\n get tempsByHct() {\n if (this.tempsByHctCache.size > 0) {\n return this.tempsByHctCache;\n }\n const allHcts = this.hctsByHue.concat([this.input]);\n const temperaturesByHct = new Map();\n for (const e of allHcts) {\n temperaturesByHct.set(e, TemperatureCache.rawTemperature(e));\n }\n this.tempsByHctCache = temperaturesByHct;\n return temperaturesByHct;\n }\n /**\n * HCTs for all hues, with the same chroma/tone as the input.\n * Sorted ascending, hue 0 to 360.\n */\n get hctsByHue() {\n if (this.hctsByHueCache.length > 0) {\n return this.hctsByHueCache;\n }\n const hcts = [];\n for (let hue = 0.0; hue <= 360.0; hue += 1.0) {\n const colorAtHue = Hct.from(hue, this.input.chroma, this.input.tone);\n hcts.push(colorAtHue);\n }\n this.hctsByHueCache = hcts;\n return this.hctsByHueCache;\n }\n /** Determines if an angle is between two other angles, rotating clockwise. */\n static isBetween(angle, a, b) {\n if (a < b) {\n return a <= angle && angle <= b;\n }\n return a <= angle || angle <= b;\n }\n /**\n * Value representing cool-warm factor of a color.\n * Values below 0 are considered cool, above, warm.\n *\n * Color science has researched emotion and harmony, which art uses to select\n * colors. Warm-cool is the foundation of analogous and complementary colors.\n * See:\n * - Li-Chen Ou's Chapter 19 in Handbook of Color Psychology (2015).\n * - Josef Albers' Interaction of Color chapters 19 and 21.\n *\n * Implementation of Ou, Woodcock and Wright's algorithm, which uses\n * L*a*b* / LCH color space.\n * Return value has these properties:\n * - Values below 0 are cool, above 0 are warm.\n * - Lower bound: -0.52 - (chroma ^ 1.07 / 20). L*a*b* chroma is infinite.\n * Assuming max of 130 chroma, -9.66.\n * - Upper bound: -0.52 + (chroma ^ 1.07 / 20). L*a*b* chroma is infinite.\n * Assuming max of 130 chroma, 8.61.\n */\n static rawTemperature(color) {\n const lab = colorUtils.labFromArgb(color.toInt());\n const hue = mathUtils.sanitizeDegreesDouble(Math.atan2(lab[2], lab[1]) * 180.0 / Math.PI);\n const chroma = Math.sqrt((lab[1] * lab[1]) + (lab[2] * lab[2]));\n const temperature = -0.5 +\n 0.02 * Math.pow(chroma, 1.07) *\n Math.cos(mathUtils.sanitizeDegreesDouble(hue - 50.0) * Math.PI / 180.0);\n return temperature;\n }\n}\n//# sourceMappingURL=temperature_cache.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,mBAAb,MAAa,iBAAiB;CAC1B,YAAY,OAAO;EACf,KAAK,QAAQ;EACb,KAAK,kBAAkB,CAAC;EACxB,KAAK,iBAAiB,CAAC;EACvB,KAAK,kCAAkB,IAAI,IAAI;EAC/B,KAAK,gCAAgC;EACrC,KAAK,kBAAkB;CAC3B;CACA,IAAI,aAAa;EACb,IAAI,KAAK,gBAAgB,SAAS,GAC9B,OAAO,KAAK;EAEhB,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OAAO,KAAO,OAAO,GAAK;GAC1C,MAAM,aAAa,IAAI,KAAK,KAAK,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;GACnE,KAAK,KAAK,UAAU;EACxB;EACA,KAAK,iBAAiB;EACtB,OAAO,KAAK;CAChB;;CAEA,OAAO,UAAU,OAAO,GAAG,GAAG;EAC1B,IAAI,IAAI,GACJ,OAAO,KAAK,SAAS,SAAS;EAElC,OAAO,KAAK,SAAS,SAAS;CAClC;;;;;;;;;;;;;;;;;;;;CAoBA,OAAO,eAAe,OAAO;EACzB,MAAM,MAAMC,YAAuB,MAAM,MAAM,CAAC;EAChD,MAAM,MAAMD,sBAAgC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,IAAI,MAAQ,KAAK,EAAE;EACxF,MAAM,SAAS,KAAK,KAAM,IAAI,KAAK,IAAI,KAAO,IAAI,KAAK,IAAI,EAAG;EAI9D,OAHoB,MAChB,MAAO,KAAK,IAAI,QAAQ,IAAI,IACxB,KAAK,IAAIA,sBAAgC,MAAM,EAAI,IAAI,KAAK,KAAK,GAAK;CAElF;AACJ"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { clampInt, matrixMultiply } from "./math_utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/color_utils.js
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2021 Google LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Color science utilities.
|
|
21
|
+
*
|
|
22
|
+
* Utility methods for color science constants and color space
|
|
23
|
+
* conversions that aren't HCT or CAM16.
|
|
24
|
+
*/
|
|
25
|
+
const SRGB_TO_XYZ = [
|
|
26
|
+
[
|
|
27
|
+
.41233895,
|
|
28
|
+
.35762064,
|
|
29
|
+
.18051042
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
.2126,
|
|
33
|
+
.7152,
|
|
34
|
+
.0722
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
.01932141,
|
|
38
|
+
.11916382,
|
|
39
|
+
.95034478
|
|
40
|
+
]
|
|
41
|
+
];
|
|
42
|
+
const XYZ_TO_SRGB = [
|
|
43
|
+
[
|
|
44
|
+
3.2413774792388685,
|
|
45
|
+
-1.5376652402851851,
|
|
46
|
+
-.49885366846268053
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
-.9691452513005321,
|
|
50
|
+
1.8758853451067872,
|
|
51
|
+
.04156585616912061
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
.05562093689691305,
|
|
55
|
+
-.20395524564742123,
|
|
56
|
+
1.0571799111220335
|
|
57
|
+
]
|
|
58
|
+
];
|
|
59
|
+
const WHITE_POINT_D65 = [
|
|
60
|
+
95.047,
|
|
61
|
+
100,
|
|
62
|
+
108.883
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Converts a color from RGB components to ARGB format.
|
|
66
|
+
*/
|
|
67
|
+
function argbFromRgb(red, green, blue) {
|
|
68
|
+
return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Converts a color from linear RGB components to ARGB format.
|
|
72
|
+
*/
|
|
73
|
+
function argbFromLinrgb(linrgb) {
|
|
74
|
+
return argbFromRgb(delinearized(linrgb[0]), delinearized(linrgb[1]), delinearized(linrgb[2]));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns the red component of a color in ARGB format.
|
|
78
|
+
*/
|
|
79
|
+
function redFromArgb(argb) {
|
|
80
|
+
return argb >> 16 & 255;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the green component of a color in ARGB format.
|
|
84
|
+
*/
|
|
85
|
+
function greenFromArgb(argb) {
|
|
86
|
+
return argb >> 8 & 255;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Returns the blue component of a color in ARGB format.
|
|
90
|
+
*/
|
|
91
|
+
function blueFromArgb(argb) {
|
|
92
|
+
return argb & 255;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Converts a color from ARGB to XYZ.
|
|
96
|
+
*/
|
|
97
|
+
function argbFromXyz(x, y, z) {
|
|
98
|
+
const matrix = XYZ_TO_SRGB;
|
|
99
|
+
const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;
|
|
100
|
+
const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;
|
|
101
|
+
const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;
|
|
102
|
+
return argbFromRgb(delinearized(linearR), delinearized(linearG), delinearized(linearB));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Converts a color from XYZ to ARGB.
|
|
106
|
+
*/
|
|
107
|
+
function xyzFromArgb(argb) {
|
|
108
|
+
const r = linearized(redFromArgb(argb));
|
|
109
|
+
const g = linearized(greenFromArgb(argb));
|
|
110
|
+
const b = linearized(blueFromArgb(argb));
|
|
111
|
+
return matrixMultiply([
|
|
112
|
+
r,
|
|
113
|
+
g,
|
|
114
|
+
b
|
|
115
|
+
], SRGB_TO_XYZ);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Converts a color from ARGB representation to L*a*b*
|
|
119
|
+
* representation.
|
|
120
|
+
*
|
|
121
|
+
* @param argb the ARGB representation of a color
|
|
122
|
+
* @return a Lab object representing the color
|
|
123
|
+
*/
|
|
124
|
+
function labFromArgb(argb) {
|
|
125
|
+
const linearR = linearized(redFromArgb(argb));
|
|
126
|
+
const linearG = linearized(greenFromArgb(argb));
|
|
127
|
+
const linearB = linearized(blueFromArgb(argb));
|
|
128
|
+
const matrix = SRGB_TO_XYZ;
|
|
129
|
+
const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;
|
|
130
|
+
const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;
|
|
131
|
+
const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;
|
|
132
|
+
const whitePoint = WHITE_POINT_D65;
|
|
133
|
+
const xNormalized = x / whitePoint[0];
|
|
134
|
+
const yNormalized = y / whitePoint[1];
|
|
135
|
+
const zNormalized = z / whitePoint[2];
|
|
136
|
+
const fx = labF(xNormalized);
|
|
137
|
+
const fy = labF(yNormalized);
|
|
138
|
+
const fz = labF(zNormalized);
|
|
139
|
+
return [
|
|
140
|
+
116 * fy - 16,
|
|
141
|
+
500 * (fx - fy),
|
|
142
|
+
200 * (fy - fz)
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Converts an L* value to an ARGB representation.
|
|
147
|
+
*
|
|
148
|
+
* @param lstar L* in L*a*b*
|
|
149
|
+
* @return ARGB representation of grayscale color with lightness
|
|
150
|
+
* matching L*
|
|
151
|
+
*/
|
|
152
|
+
function argbFromLstar(lstar) {
|
|
153
|
+
const component = delinearized(yFromLstar(lstar));
|
|
154
|
+
return argbFromRgb(component, component, component);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Computes the L* value of a color in ARGB representation.
|
|
158
|
+
*
|
|
159
|
+
* @param argb ARGB representation of a color
|
|
160
|
+
* @return L*, from L*a*b*, coordinate of the color
|
|
161
|
+
*/
|
|
162
|
+
function lstarFromArgb(argb) {
|
|
163
|
+
const y = xyzFromArgb(argb)[1];
|
|
164
|
+
return 116 * labF(y / 100) - 16;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Converts an L* value to a Y value.
|
|
168
|
+
*
|
|
169
|
+
* L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
|
|
170
|
+
*
|
|
171
|
+
* L* measures perceptual luminance, a linear scale. Y in XYZ
|
|
172
|
+
* measures relative luminance, a logarithmic scale.
|
|
173
|
+
*
|
|
174
|
+
* @param lstar L* in L*a*b*
|
|
175
|
+
* @return Y in XYZ
|
|
176
|
+
*/
|
|
177
|
+
function yFromLstar(lstar) {
|
|
178
|
+
return 100 * labInvf((lstar + 16) / 116);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Converts a Y value to an L* value.
|
|
182
|
+
*
|
|
183
|
+
* L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
|
|
184
|
+
*
|
|
185
|
+
* L* measures perceptual luminance, a linear scale. Y in XYZ
|
|
186
|
+
* measures relative luminance, a logarithmic scale.
|
|
187
|
+
*
|
|
188
|
+
* @param y Y in XYZ
|
|
189
|
+
* @return L* in L*a*b*
|
|
190
|
+
*/
|
|
191
|
+
function lstarFromY(y) {
|
|
192
|
+
return labF(y / 100) * 116 - 16;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Linearizes an RGB component.
|
|
196
|
+
*
|
|
197
|
+
* @param rgbComponent 0 <= rgb_component <= 255, represents R/G/B
|
|
198
|
+
* channel
|
|
199
|
+
* @return 0.0 <= output <= 100.0, color channel converted to
|
|
200
|
+
* linear RGB space
|
|
201
|
+
*/
|
|
202
|
+
function linearized(rgbComponent) {
|
|
203
|
+
const normalized = rgbComponent / 255;
|
|
204
|
+
if (normalized <= .040449936) return normalized / 12.92 * 100;
|
|
205
|
+
else return Math.pow((normalized + .055) / 1.055, 2.4) * 100;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Delinearizes an RGB component.
|
|
209
|
+
*
|
|
210
|
+
* @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
|
|
211
|
+
* linear R/G/B channel
|
|
212
|
+
* @return 0 <= output <= 255, color channel converted to regular
|
|
213
|
+
* RGB space
|
|
214
|
+
*/
|
|
215
|
+
function delinearized(rgbComponent) {
|
|
216
|
+
const normalized = rgbComponent / 100;
|
|
217
|
+
let delinearized = 0;
|
|
218
|
+
if (normalized <= .0031308) delinearized = normalized * 12.92;
|
|
219
|
+
else delinearized = 1.055 * Math.pow(normalized, 1 / 2.4) - .055;
|
|
220
|
+
return clampInt(0, 255, Math.round(delinearized * 255));
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Returns the standard white point; white on a sunny day.
|
|
224
|
+
*
|
|
225
|
+
* @return The white point
|
|
226
|
+
*/
|
|
227
|
+
function whitePointD65() {
|
|
228
|
+
return WHITE_POINT_D65;
|
|
229
|
+
}
|
|
230
|
+
function labF(t) {
|
|
231
|
+
const e = 216 / 24389;
|
|
232
|
+
const kappa = 24389 / 27;
|
|
233
|
+
if (t > e) return Math.pow(t, 1 / 3);
|
|
234
|
+
else return (kappa * t + 16) / 116;
|
|
235
|
+
}
|
|
236
|
+
function labInvf(ft) {
|
|
237
|
+
const e = 216 / 24389;
|
|
238
|
+
const kappa = 24389 / 27;
|
|
239
|
+
const ft3 = ft * ft * ft;
|
|
240
|
+
if (ft3 > e) return ft3;
|
|
241
|
+
else return (116 * ft - 16) / kappa;
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
export { argbFromLinrgb, argbFromLstar, argbFromRgb, argbFromXyz, blueFromArgb, delinearized, greenFromArgb, labFromArgb, linearized, lstarFromArgb, lstarFromY, redFromArgb, whitePointD65, xyzFromArgb, yFromLstar };
|
|
245
|
+
|
|
246
|
+
//# sourceMappingURL=color_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_utils.js","names":["mathUtils.matrixMultiply","mathUtils.clampInt"],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/color_utils.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// This file is automatically generated. Do not modify it.\nimport * as mathUtils from './math_utils.js';\n/**\n * Color science utilities.\n *\n * Utility methods for color science constants and color space\n * conversions that aren't HCT or CAM16.\n */\nconst SRGB_TO_XYZ = [\n [0.41233895, 0.35762064, 0.18051042],\n [0.2126, 0.7152, 0.0722],\n [0.01932141, 0.11916382, 0.95034478],\n];\nconst XYZ_TO_SRGB = [\n [\n 3.2413774792388685,\n -1.5376652402851851,\n -0.49885366846268053,\n ],\n [\n -0.9691452513005321,\n 1.8758853451067872,\n 0.04156585616912061,\n ],\n [\n 0.05562093689691305,\n -0.20395524564742123,\n 1.0571799111220335,\n ],\n];\nconst WHITE_POINT_D65 = [95.047, 100.0, 108.883];\n/**\n * Converts a color from RGB components to ARGB format.\n */\nexport function argbFromRgb(red, green, blue) {\n return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>>\n 0;\n}\n/**\n * Converts a color from linear RGB components to ARGB format.\n */\nexport function argbFromLinrgb(linrgb) {\n const r = delinearized(linrgb[0]);\n const g = delinearized(linrgb[1]);\n const b = delinearized(linrgb[2]);\n return argbFromRgb(r, g, b);\n}\n/**\n * Returns the alpha component of a color in ARGB format.\n */\nexport function alphaFromArgb(argb) {\n return argb >> 24 & 255;\n}\n/**\n * Returns the red component of a color in ARGB format.\n */\nexport function redFromArgb(argb) {\n return argb >> 16 & 255;\n}\n/**\n * Returns the green component of a color in ARGB format.\n */\nexport function greenFromArgb(argb) {\n return argb >> 8 & 255;\n}\n/**\n * Returns the blue component of a color in ARGB format.\n */\nexport function blueFromArgb(argb) {\n return argb & 255;\n}\n/**\n * Returns whether a color in ARGB format is opaque.\n */\nexport function isOpaque(argb) {\n return alphaFromArgb(argb) >= 255;\n}\n/**\n * Converts a color from ARGB to XYZ.\n */\nexport function argbFromXyz(x, y, z) {\n const matrix = XYZ_TO_SRGB;\n const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;\n const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;\n const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;\n const r = delinearized(linearR);\n const g = delinearized(linearG);\n const b = delinearized(linearB);\n return argbFromRgb(r, g, b);\n}\n/**\n * Converts a color from XYZ to ARGB.\n */\nexport function xyzFromArgb(argb) {\n const r = linearized(redFromArgb(argb));\n const g = linearized(greenFromArgb(argb));\n const b = linearized(blueFromArgb(argb));\n return mathUtils.matrixMultiply([r, g, b], SRGB_TO_XYZ);\n}\n/**\n * Converts a color represented in Lab color space into an ARGB\n * integer.\n */\nexport function argbFromLab(l, a, b) {\n const whitePoint = WHITE_POINT_D65;\n const fy = (l + 16.0) / 116.0;\n const fx = a / 500.0 + fy;\n const fz = fy - b / 200.0;\n const xNormalized = labInvf(fx);\n const yNormalized = labInvf(fy);\n const zNormalized = labInvf(fz);\n const x = xNormalized * whitePoint[0];\n const y = yNormalized * whitePoint[1];\n const z = zNormalized * whitePoint[2];\n return argbFromXyz(x, y, z);\n}\n/**\n * Converts a color from ARGB representation to L*a*b*\n * representation.\n *\n * @param argb the ARGB representation of a color\n * @return a Lab object representing the color\n */\nexport function labFromArgb(argb) {\n const linearR = linearized(redFromArgb(argb));\n const linearG = linearized(greenFromArgb(argb));\n const linearB = linearized(blueFromArgb(argb));\n const matrix = SRGB_TO_XYZ;\n const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;\n const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;\n const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;\n const whitePoint = WHITE_POINT_D65;\n const xNormalized = x / whitePoint[0];\n const yNormalized = y / whitePoint[1];\n const zNormalized = z / whitePoint[2];\n const fx = labF(xNormalized);\n const fy = labF(yNormalized);\n const fz = labF(zNormalized);\n const l = 116.0 * fy - 16;\n const a = 500.0 * (fx - fy);\n const b = 200.0 * (fy - fz);\n return [l, a, b];\n}\n/**\n * Converts an L* value to an ARGB representation.\n *\n * @param lstar L* in L*a*b*\n * @return ARGB representation of grayscale color with lightness\n * matching L*\n */\nexport function argbFromLstar(lstar) {\n const y = yFromLstar(lstar);\n const component = delinearized(y);\n return argbFromRgb(component, component, component);\n}\n/**\n * Computes the L* value of a color in ARGB representation.\n *\n * @param argb ARGB representation of a color\n * @return L*, from L*a*b*, coordinate of the color\n */\nexport function lstarFromArgb(argb) {\n const y = xyzFromArgb(argb)[1];\n return 116.0 * labF(y / 100.0) - 16.0;\n}\n/**\n * Converts an L* value to a Y value.\n *\n * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.\n *\n * L* measures perceptual luminance, a linear scale. Y in XYZ\n * measures relative luminance, a logarithmic scale.\n *\n * @param lstar L* in L*a*b*\n * @return Y in XYZ\n */\nexport function yFromLstar(lstar) {\n return 100.0 * labInvf((lstar + 16.0) / 116.0);\n}\n/**\n * Converts a Y value to an L* value.\n *\n * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.\n *\n * L* measures perceptual luminance, a linear scale. Y in XYZ\n * measures relative luminance, a logarithmic scale.\n *\n * @param y Y in XYZ\n * @return L* in L*a*b*\n */\nexport function lstarFromY(y) {\n return labF(y / 100.0) * 116.0 - 16.0;\n}\n/**\n * Linearizes an RGB component.\n *\n * @param rgbComponent 0 <= rgb_component <= 255, represents R/G/B\n * channel\n * @return 0.0 <= output <= 100.0, color channel converted to\n * linear RGB space\n */\nexport function linearized(rgbComponent) {\n const normalized = rgbComponent / 255.0;\n if (normalized <= 0.040449936) {\n return normalized / 12.92 * 100.0;\n }\n else {\n return Math.pow((normalized + 0.055) / 1.055, 2.4) * 100.0;\n }\n}\n/**\n * Delinearizes an RGB component.\n *\n * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return 0 <= output <= 255, color channel converted to regular\n * RGB space\n */\nexport function delinearized(rgbComponent) {\n const normalized = rgbComponent / 100.0;\n let delinearized = 0.0;\n if (normalized <= 0.0031308) {\n delinearized = normalized * 12.92;\n }\n else {\n delinearized = 1.055 * Math.pow(normalized, 1.0 / 2.4) - 0.055;\n }\n return mathUtils.clampInt(0, 255, Math.round(delinearized * 255.0));\n}\n/**\n * Returns the standard white point; white on a sunny day.\n *\n * @return The white point\n */\nexport function whitePointD65() {\n return WHITE_POINT_D65;\n}\nfunction labF(t) {\n const e = 216.0 / 24389.0;\n const kappa = 24389.0 / 27.0;\n if (t > e) {\n return Math.pow(t, 1.0 / 3.0);\n }\n else {\n return (kappa * t + 16) / 116;\n }\n}\nfunction labInvf(ft) {\n const e = 216.0 / 24389.0;\n const kappa = 24389.0 / 27.0;\n const ft3 = ft * ft * ft;\n if (ft3 > e) {\n return ft3;\n }\n else {\n return (116 * ft - 16) / kappa;\n }\n}\n//# sourceMappingURL=color_utils.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,cAAc;CAChB;EAAC;EAAY;EAAY;CAAU;CACnC;EAAC;EAAQ;EAAQ;CAAM;CACvB;EAAC;EAAY;EAAY;CAAU;AACvC;AACA,MAAM,cAAc;CAChB;EACI;EACA;EACA;CACJ;CACA;EACI;EACA;EACA;CACJ;CACA;EACI;EACA;EACA;CACJ;AACJ;AACA,MAAM,kBAAkB;CAAC;CAAQ;CAAO;AAAO;;;;AAI/C,SAAgB,YAAY,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AM,aAAa,eAAe;CAClC,IAAI,eAAe;CACnB,IAAI,cAAc,UACd,eAAe,aAAa;MAG5B,eAAe,QAAQ,KAAK,IAAI,YAAY,IAAM,GAAG,IAAI;CAE7D,OAAOC,SAAmB,GAAG,KAAK,KAAK,MAAM,eAAe,GAAK,CAAC;AACtE;;;;;;AAMA,SAAgB,gBAAgB;CAC5B,OAAO;AACX;AACA,SAAS,KAAK,GAAG;CACb,MAAM,IAAI,MAAQ;CAClB,MAAM,QAAQ,QAAU;CACxB,IAAI,IAAI,GACJ,OAAO,KAAK,IAAI,GAAG,IAAM,CAAG;MAG5B,QAAQ,QAAQ,IAAI,MAAM;AAElC;AACA,SAAS,QAAQ,IAAI;CACjB,MAAM,IAAI,MAAQ;CAClB,MAAM,QAAQ,QAAU;CACxB,MAAM,MAAM,KAAK,KAAK;CACtB,IAAI,MAAM,GACN,OAAO;MAGP,QAAQ,MAAM,KAAK,MAAM;AAEjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../score/score.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/image_utils.js
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2021 Google LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
//#endregion
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=image_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image_utils.js","names":[],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/image_utils.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { QuantizerCelebi } from '../quantize/quantizer_celebi.js';\nimport { Score } from '../score/score.js';\nimport { argbFromRgb } from './color_utils.js';\n/**\n * Get the source color from an image.\n *\n * @param image The image element\n * @return Source color - the color most suitable for creating a UI theme\n */\nexport async function sourceColorFromImage(image) {\n // Convert Image data to Pixel Array\n const imageBytes = await new Promise((resolve, reject) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n reject(new Error('Could not get canvas context'));\n return;\n }\n const loadCallback = () => {\n canvas.width = image.width;\n canvas.height = image.height;\n context.drawImage(image, 0, 0);\n let rect = [0, 0, image.width, image.height];\n const area = image.dataset['area'];\n if (area && /^\\d+(\\s*,\\s*\\d+){3}$/.test(area)) {\n rect = area.split(/\\s*,\\s*/).map(s => {\n // tslint:disable-next-line:ban\n return parseInt(s, 10);\n });\n }\n const [sx, sy, sw, sh] = rect;\n resolve(context.getImageData(sx, sy, sw, sh).data);\n };\n const errorCallback = () => {\n reject(new Error('Image load failed'));\n };\n if (image.complete) {\n loadCallback();\n }\n else {\n image.onload = loadCallback;\n image.onerror = errorCallback;\n }\n });\n return sourceColorFromImageBytes(imageBytes);\n}\n/**\n * Get the source color from image bytes.\n *\n * @param imageBytes The image bytes\n * @return Source color - the color most suitable for creating a UI theme\n */\nexport function sourceColorFromImageBytes(imageBytes) {\n // Convert Image data to Pixel Array\n const pixels = [];\n for (let i = 0; i < imageBytes.length; i += 4) {\n const r = imageBytes[i];\n const g = imageBytes[i + 1];\n const b = imageBytes[i + 2];\n const a = imageBytes[i + 3];\n if (a < 255) {\n continue;\n }\n const argb = argbFromRgb(r, g, b);\n pixels.push(argb);\n }\n // Convert Pixels to Material Colors\n const result = QuantizerCelebi.quantize(pixels, 128);\n const ranked = Score.score(result);\n const top = ranked[0];\n return top;\n}\n//# sourceMappingURL=image_utils.js.map"],"ignoreList":[0],"mappings":""}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/math_utils.js
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Utility methods for mathematical operations.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The signum function.
|
|
23
|
+
*
|
|
24
|
+
* @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
|
|
25
|
+
*/
|
|
26
|
+
function signum(num) {
|
|
27
|
+
if (num < 0) return -1;
|
|
28
|
+
else if (num === 0) return 0;
|
|
29
|
+
else return 1;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The linear interpolation function.
|
|
33
|
+
*
|
|
34
|
+
* @return start if amount = 0 and stop if amount = 1
|
|
35
|
+
*/
|
|
36
|
+
function lerp(start, stop, amount) {
|
|
37
|
+
return (1 - amount) * start + amount * stop;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Clamps an integer between two integers.
|
|
41
|
+
*
|
|
42
|
+
* @return input when min <= input <= max, and either min or max
|
|
43
|
+
* otherwise.
|
|
44
|
+
*/
|
|
45
|
+
function clampInt(min, max, input) {
|
|
46
|
+
if (input < min) return min;
|
|
47
|
+
else if (input > max) return max;
|
|
48
|
+
return input;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Clamps an integer between two floating-point numbers.
|
|
52
|
+
*
|
|
53
|
+
* @return input when min <= input <= max, and either min or max
|
|
54
|
+
* otherwise.
|
|
55
|
+
*/
|
|
56
|
+
function clampDouble(min, max, input) {
|
|
57
|
+
if (input < min) return min;
|
|
58
|
+
else if (input > max) return max;
|
|
59
|
+
return input;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Sanitizes a degree measure as an integer.
|
|
63
|
+
*
|
|
64
|
+
* @return a degree measure between 0 (inclusive) and 360
|
|
65
|
+
* (exclusive).
|
|
66
|
+
*/
|
|
67
|
+
function sanitizeDegreesInt(degrees) {
|
|
68
|
+
degrees = degrees % 360;
|
|
69
|
+
if (degrees < 0) degrees = degrees + 360;
|
|
70
|
+
return degrees;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Sanitizes a degree measure as a floating-point number.
|
|
74
|
+
*
|
|
75
|
+
* @return a degree measure between 0.0 (inclusive) and 360.0
|
|
76
|
+
* (exclusive).
|
|
77
|
+
*/
|
|
78
|
+
function sanitizeDegreesDouble(degrees) {
|
|
79
|
+
degrees = degrees % 360;
|
|
80
|
+
if (degrees < 0) degrees = degrees + 360;
|
|
81
|
+
return degrees;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Sign of direction change needed to travel from one angle to
|
|
85
|
+
* another.
|
|
86
|
+
*
|
|
87
|
+
* For angles that are 180 degrees apart from each other, both
|
|
88
|
+
* directions have the same travel distance, so either direction is
|
|
89
|
+
* shortest. The value 1.0 is returned in this case.
|
|
90
|
+
*
|
|
91
|
+
* @param from The angle travel starts from, in degrees.
|
|
92
|
+
* @param to The angle travel ends at, in degrees.
|
|
93
|
+
* @return -1 if decreasing from leads to the shortest travel
|
|
94
|
+
* distance, 1 if increasing from leads to the shortest travel
|
|
95
|
+
* distance.
|
|
96
|
+
*/
|
|
97
|
+
function rotationDirection(from, to) {
|
|
98
|
+
return sanitizeDegreesDouble(to - from) <= 180 ? 1 : -1;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Distance of two points on a circle, represented using degrees.
|
|
102
|
+
*/
|
|
103
|
+
function differenceDegrees(a, b) {
|
|
104
|
+
return 180 - Math.abs(Math.abs(a - b) - 180);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Multiplies a 1x3 row vector with a 3x3 matrix.
|
|
108
|
+
*/
|
|
109
|
+
function matrixMultiply(row, matrix) {
|
|
110
|
+
return [
|
|
111
|
+
row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2],
|
|
112
|
+
row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2],
|
|
113
|
+
row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2]
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { clampDouble, clampInt, differenceDegrees, lerp, matrixMultiply, rotationDirection, sanitizeDegreesDouble, sanitizeDegreesInt, signum };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=math_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math_utils.js","names":[],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/math_utils.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// This file is automatically generated. Do not modify it.\n/**\n * Utility methods for mathematical operations.\n */\n/**\n * The signum function.\n *\n * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0\n */\nexport function signum(num) {\n if (num < 0) {\n return -1;\n }\n else if (num === 0) {\n return 0;\n }\n else {\n return 1;\n }\n}\n/**\n * The linear interpolation function.\n *\n * @return start if amount = 0 and stop if amount = 1\n */\nexport function lerp(start, stop, amount) {\n return (1.0 - amount) * start + amount * stop;\n}\n/**\n * Clamps an integer between two integers.\n *\n * @return input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampInt(min, max, input) {\n if (input < min) {\n return min;\n }\n else if (input > max) {\n return max;\n }\n return input;\n}\n/**\n * Clamps an integer between two floating-point numbers.\n *\n * @return input when min <= input <= max, and either min or max\n * otherwise.\n */\nexport function clampDouble(min, max, input) {\n if (input < min) {\n return min;\n }\n else if (input > max) {\n return max;\n }\n return input;\n}\n/**\n * Sanitizes a degree measure as an integer.\n *\n * @return a degree measure between 0 (inclusive) and 360\n * (exclusive).\n */\nexport function sanitizeDegreesInt(degrees) {\n degrees = degrees % 360;\n if (degrees < 0) {\n degrees = degrees + 360;\n }\n return degrees;\n}\n/**\n * Sanitizes a degree measure as a floating-point number.\n *\n * @return a degree measure between 0.0 (inclusive) and 360.0\n * (exclusive).\n */\nexport function sanitizeDegreesDouble(degrees) {\n degrees = degrees % 360.0;\n if (degrees < 0) {\n degrees = degrees + 360.0;\n }\n return degrees;\n}\n/**\n * Sign of direction change needed to travel from one angle to\n * another.\n *\n * For angles that are 180 degrees apart from each other, both\n * directions have the same travel distance, so either direction is\n * shortest. The value 1.0 is returned in this case.\n *\n * @param from The angle travel starts from, in degrees.\n * @param to The angle travel ends at, in degrees.\n * @return -1 if decreasing from leads to the shortest travel\n * distance, 1 if increasing from leads to the shortest travel\n * distance.\n */\nexport function rotationDirection(from, to) {\n const increasingDifference = sanitizeDegreesDouble(to - from);\n return increasingDifference <= 180.0 ? 1.0 : -1.0;\n}\n/**\n * Distance of two points on a circle, represented using degrees.\n */\nexport function differenceDegrees(a, b) {\n return 180.0 - Math.abs(Math.abs(a - b) - 180.0);\n}\n/**\n * Multiplies a 1x3 row vector with a 3x3 matrix.\n */\nexport function matrixMultiply(row, matrix) {\n const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];\n const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];\n const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];\n return [a, b, c];\n}\n//# sourceMappingURL=math_utils.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,OAAO,KAAK;CACxB,IAAI,MAAM,GACN,OAAO;MAEN,IAAI,QAAQ,GACb,OAAO;MAGP,OAAO;AAEf;;;;;;AAMA,SAAgB,KAAK,OAAO,MAAM,QAAQ;CACtC,QAAQ,IAAM,UAAU,QAAQ,SAAS;AAC7C;;;;;;;AAOA,SAAgB,SAAS,KAAK,KAAK,OAAO;CACtC,IAAI,QAAQ,KACR,OAAO;MAEN,IAAI,QAAQ,KACb,OAAO;CAEX,OAAO;AACX;;;;;;;AAOA,SAAgB,YAAY,KAAK,KAAK,OAAO;CACzC,IAAI,QAAQ,KACR,OAAO;MAEN,IAAI,QAAQ,KACb,OAAO;CAEX,OAAO;AACX;;;;;;;AAOA,SAAgB,mBAAmB,SAAS;CACxC,UAAU,UAAU;CACpB,IAAI,UAAU,GACV,UAAU,UAAU;CAExB,OAAO;AACX;;;;;;;AAOA,SAAgB,sBAAsB,SAAS;CAC3C,UAAU,UAAU;CACpB,IAAI,UAAU,GACV,UAAU,UAAU;CAExB,OAAO;AACX;;;;;;;;;;;;;;;AAeA,SAAgB,kBAAkB,MAAM,IAAI;CAExC,OAD6B,sBAAsB,KAAK,IAC9B,KAAK,MAAQ,IAAM;AACjD;;;;AAIA,SAAgB,kBAAkB,GAAG,GAAG;CACpC,OAAO,MAAQ,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,GAAK;AACnD;;;;AAIA,SAAgB,eAAe,KAAK,QAAQ;CAIxC,OAAO;EAHG,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC;EACnE,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC;EACnE,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC;CAC9D;AACnB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { blueFromArgb, greenFromArgb, redFromArgb } from "./color_utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/string_utils.js
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2021 Google LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Utility methods for hexadecimal representations of colors.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* @param argb ARGB representation of a color.
|
|
24
|
+
* @return Hex string representing color, ex. #ff0000 for red.
|
|
25
|
+
*/
|
|
26
|
+
function hexFromArgb(argb) {
|
|
27
|
+
const r = redFromArgb(argb);
|
|
28
|
+
const g = greenFromArgb(argb);
|
|
29
|
+
const b = blueFromArgb(argb);
|
|
30
|
+
const outParts = [
|
|
31
|
+
r.toString(16),
|
|
32
|
+
g.toString(16),
|
|
33
|
+
b.toString(16)
|
|
34
|
+
];
|
|
35
|
+
for (const [i, part] of outParts.entries()) if (part.length === 1) outParts[i] = "0" + part;
|
|
36
|
+
return "#" + outParts.join("");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param hex String representing color as hex code. Accepts strings with or
|
|
40
|
+
* without leading #, and string representing the color using 3, 6, or 8
|
|
41
|
+
* hex characters.
|
|
42
|
+
* @return ARGB representation of color.
|
|
43
|
+
*/
|
|
44
|
+
function argbFromHex(hex) {
|
|
45
|
+
hex = hex.replace("#", "");
|
|
46
|
+
const isThree = hex.length === 3;
|
|
47
|
+
const isSix = hex.length === 6;
|
|
48
|
+
const isEight = hex.length === 8;
|
|
49
|
+
if (!isThree && !isSix && !isEight) throw new Error("unexpected hex " + hex);
|
|
50
|
+
let r = 0;
|
|
51
|
+
let g = 0;
|
|
52
|
+
let b = 0;
|
|
53
|
+
if (isThree) {
|
|
54
|
+
r = parseIntHex(hex.slice(0, 1).repeat(2));
|
|
55
|
+
g = parseIntHex(hex.slice(1, 2).repeat(2));
|
|
56
|
+
b = parseIntHex(hex.slice(2, 3).repeat(2));
|
|
57
|
+
} else if (isSix) {
|
|
58
|
+
r = parseIntHex(hex.slice(0, 2));
|
|
59
|
+
g = parseIntHex(hex.slice(2, 4));
|
|
60
|
+
b = parseIntHex(hex.slice(4, 6));
|
|
61
|
+
} else if (isEight) {
|
|
62
|
+
r = parseIntHex(hex.slice(2, 4));
|
|
63
|
+
g = parseIntHex(hex.slice(4, 6));
|
|
64
|
+
b = parseIntHex(hex.slice(6, 8));
|
|
65
|
+
}
|
|
66
|
+
return (255 << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255) >>> 0;
|
|
67
|
+
}
|
|
68
|
+
function parseIntHex(value) {
|
|
69
|
+
return parseInt(value, 16);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { argbFromHex, hexFromArgb };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=string_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string_utils.js","names":["colorUtils.redFromArgb","colorUtils.greenFromArgb","colorUtils.blueFromArgb"],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/string_utils.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as colorUtils from './color_utils.js';\n/**\n * Utility methods for hexadecimal representations of colors.\n */\n/**\n * @param argb ARGB representation of a color.\n * @return Hex string representing color, ex. #ff0000 for red.\n */\nexport function hexFromArgb(argb) {\n const r = colorUtils.redFromArgb(argb);\n const g = colorUtils.greenFromArgb(argb);\n const b = colorUtils.blueFromArgb(argb);\n const outParts = [r.toString(16), g.toString(16), b.toString(16)];\n // Pad single-digit output values\n for (const [i, part] of outParts.entries()) {\n if (part.length === 1) {\n outParts[i] = '0' + part;\n }\n }\n return '#' + outParts.join('');\n}\n/**\n * @param hex String representing color as hex code. Accepts strings with or\n * without leading #, and string representing the color using 3, 6, or 8\n * hex characters.\n * @return ARGB representation of color.\n */\nexport function argbFromHex(hex) {\n hex = hex.replace('#', '');\n const isThree = hex.length === 3;\n const isSix = hex.length === 6;\n const isEight = hex.length === 8;\n if (!isThree && !isSix && !isEight) {\n throw new Error('unexpected hex ' + hex);\n }\n let r = 0;\n let g = 0;\n let b = 0;\n if (isThree) {\n r = parseIntHex(hex.slice(0, 1).repeat(2));\n g = parseIntHex(hex.slice(1, 2).repeat(2));\n b = parseIntHex(hex.slice(2, 3).repeat(2));\n }\n else if (isSix) {\n r = parseIntHex(hex.slice(0, 2));\n g = parseIntHex(hex.slice(2, 4));\n b = parseIntHex(hex.slice(4, 6));\n }\n else if (isEight) {\n r = parseIntHex(hex.slice(2, 4));\n g = parseIntHex(hex.slice(4, 6));\n b = parseIntHex(hex.slice(6, 8));\n }\n return (((255 << 24) | ((r & 0x0ff) << 16) | ((g & 0x0ff) << 8) | (b & 0x0ff)) >>>\n 0);\n}\nfunction parseIntHex(value) {\n // tslint:disable-next-line:ban\n return parseInt(value, 16);\n}\n//# sourceMappingURL=string_utils.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,YAAY,MAAM;CAC9B,MAAM,IAAIA,YAAuB,IAAI;CACrC,MAAM,IAAIC,cAAyB,IAAI;CACvC,MAAM,IAAIC,aAAwB,IAAI;CACtC,MAAM,WAAW;EAAC,EAAE,SAAS,EAAE;EAAG,EAAE,SAAS,EAAE;EAAG,EAAE,SAAS,EAAE;CAAC;CAEhE,KAAK,MAAM,CAAC,GAAG,SAAS,SAAS,QAAQ,GACrC,IAAI,KAAK,WAAW,GA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//#region ../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/theme_utils.js
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2021 Google LLC
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
//#endregion
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=theme_utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme_utils.js","names":[],"sources":["../../../../../../node_modules/.pnpm/@material+material-color-utilities@0.4.0/node_modules/@material/material-color-utilities/utils/theme_utils.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Blend } from '../blend/blend.js';\nimport { CorePalette } from '../palettes/core_palette.js';\nimport { Scheme } from '../scheme/scheme.js';\nimport { sourceColorFromImage } from './image_utils.js';\nimport { hexFromArgb } from './string_utils.js';\n/**\n * Generate a theme from a source color\n *\n * @param source Source color\n * @param customColors Array of custom colors\n * @return Theme object\n */\nexport function themeFromSourceColor(source, customColors = []) {\n const palette = CorePalette.of(source);\n return {\n source,\n schemes: {\n light: Scheme.light(source),\n dark: Scheme.dark(source),\n },\n palettes: {\n primary: palette.a1,\n secondary: palette.a2,\n tertiary: palette.a3,\n neutral: palette.n1,\n neutralVariant: palette.n2,\n error: palette.error,\n },\n customColors: customColors.map((c) => customColor(source, c)),\n };\n}\n/**\n * Generate a theme from an image source\n *\n * @param image Image element\n * @param customColors Array of custom colors\n * @return Theme object\n */\nexport async function themeFromImage(image, customColors = []) {\n const source = await sourceColorFromImage(image);\n return themeFromSourceColor(source, customColors);\n}\n/**\n * Generate custom color group from source and target color\n *\n * @param source Source color\n * @param color Custom color\n * @return Custom color group\n *\n * @link https://m3.material.io/styles/color/the-color-system/color-roles\n */\nexport function customColor(source, color) {\n let value = color.value;\n const from = value;\n const to = source;\n if (color.blend) {\n value = Blend.harmonize(from, to);\n }\n const palette = CorePalette.of(value);\n const tones = palette.a1;\n return {\n color,\n value,\n light: {\n color: tones.tone(40),\n onColor: tones.tone(100),\n colorContainer: tones.tone(90),\n onColorContainer: tones.tone(10),\n },\n dark: {\n color: tones.tone(80),\n onColor: tones.tone(20),\n colorContainer: tones.tone(30),\n onColorContainer: tones.tone(90),\n },\n };\n}\n/**\n * Apply a theme to an element\n *\n * @param theme Theme object\n * @param options Options\n */\nexport function applyTheme(theme, options) {\n const target = options?.target || document.body;\n const isDark = options?.dark ?? false;\n const scheme = isDark ? theme.schemes.dark : theme.schemes.light;\n setSchemeProperties(target, scheme);\n if (options?.brightnessSuffix) {\n setSchemeProperties(target, theme.schemes.dark, '-dark');\n setSchemeProperties(target, theme.schemes.light, '-light');\n }\n if (options?.paletteTones) {\n const tones = options?.paletteTones ?? [];\n for (const [key, palette] of Object.entries(theme.palettes)) {\n const paletteKey = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n for (const tone of tones) {\n const token = `--md-ref-palette-${paletteKey}-${paletteKey}${tone}`;\n const color = hexFromArgb(palette.tone(tone));\n target.style.setProperty(token, color);\n }\n }\n }\n}\nfunction setSchemeProperties(target, scheme, suffix = '') {\n for (const [key, value] of Object.entries(scheme.toJSON())) {\n const token = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n const color = hexFromArgb(value);\n target.style.setProperty(`--md-sys-color-${token}${suffix}`, color);\n }\n}\n//# sourceMappingURL=theme_utils.js.map"],"ignoreList":[0],"mappings":""}
|