@shortfuse/materialdesignweb 0.8.0 → 0.9.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/README.md +50 -198
- package/bin/mdw-css.js +1 -1
- package/components/Badge.js +15 -5
- package/components/Body.js +7 -0
- package/components/BottomAppBar.js +7 -10
- package/components/BottomSheet.js +472 -0
- package/components/Box.js +11 -49
- package/components/Button.js +81 -82
- package/components/Card.js +74 -62
- package/components/Checkbox.js +15 -25
- package/components/CheckboxIcon.js +19 -31
- package/components/Chip.js +18 -13
- package/components/Dialog.js +70 -100
- package/components/DialogActions.js +4 -0
- package/components/Display.js +64 -0
- package/components/Divider.js +5 -0
- package/components/Fab.js +94 -17
- package/components/FabContainer.js +57 -0
- package/components/FilterChip.js +43 -32
- package/components/Grid.js +187 -0
- package/components/Headline.js +9 -28
- package/components/Icon.js +80 -71
- package/components/IconButton.js +77 -120
- package/components/Input.js +745 -86
- package/components/InputChip.js +193 -0
- package/components/Label.js +7 -0
- package/components/List.js +11 -5
- package/components/ListItem.js +92 -23
- package/components/ListOption.js +143 -65
- package/components/Listbox.js +57 -17
- package/components/Menu.js +39 -27
- package/components/MenuItem.js +49 -36
- package/components/NavBar.js +66 -21
- package/components/NavBarItem.js +5 -0
- package/components/NavDrawer.js +33 -16
- package/components/NavDrawerItem.js +7 -4
- package/components/NavItem.js +61 -34
- package/components/NavRail.js +32 -21
- package/components/NavRailItem.js +10 -2
- package/components/Page.js +119 -0
- package/components/Pane.js +24 -0
- package/components/Popup.js +23 -8
- package/components/Progress.js +25 -5
- package/components/Radio.js +8 -7
- package/components/RadioIcon.js +24 -15
- package/components/Ripple.js +25 -7
- package/components/Root.js +225 -0
- package/components/Scrim.js +95 -0
- package/components/Search.js +30 -25
- package/components/SegmentedButton.js +53 -40
- package/components/SegmentedButtonGroup.js +15 -12
- package/components/Select.js +19 -10
- package/components/Shape.js +10 -66
- package/components/SideSheet.js +337 -0
- package/components/Slider.js +93 -36
- package/components/Snackbar.js +52 -20
- package/components/SnackbarContainer.js +51 -0
- package/components/Surface.js +20 -10
- package/components/Switch.js +21 -18
- package/components/SwitchIcon.js +62 -33
- package/components/Tab.js +78 -38
- package/components/TabContent.js +33 -12
- package/components/TabList.js +95 -34
- package/components/TabPanel.js +10 -1
- package/components/Table.js +151 -0
- package/components/TextArea.js +48 -16
- package/components/Title.js +8 -9
- package/components/Tooltip.js +51 -22
- package/components/TopAppBar.js +71 -78
- package/constants/shapes.js +36 -0
- package/constants/typography.js +127 -0
- package/core/Composition.js +391 -201
- package/core/CompositionAdapter.js +35 -18
- package/core/CustomElement.js +634 -254
- package/core/css.js +117 -12
- package/core/customTypes.js +161 -49
- package/core/dom.js +18 -11
- package/core/jsonMergePatch.js +27 -11
- package/core/observe.js +308 -256
- package/core/optimizations.js +9 -9
- package/core/template.js +14 -57
- package/dist/CustomElement.min.js +2 -0
- package/dist/CustomElement.min.js.map +7 -0
- package/dist/core/CustomElement.min.js +2 -0
- package/dist/core/CustomElement.min.js.map +7 -0
- package/dist/index.min.js +85 -115
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +1 -1
- package/dom/HTMLOptionsCollectionProxy.js +108 -0
- package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
- package/loaders/theme.js +12 -0
- package/mixins/AriaReflectorMixin.js +64 -15
- package/mixins/AriaToolbarMixin.js +6 -0
- package/mixins/ControlMixin.js +79 -33
- package/mixins/DelegatesFocusMixin.js +62 -0
- package/mixins/DensityMixin.js +7 -3
- package/mixins/ElevationMixin.js +61 -0
- package/mixins/FlexableMixin.js +87 -39
- package/mixins/FormAssociatedMixin.js +76 -10
- package/mixins/HyperlinkMixin.js +76 -0
- package/mixins/InputMixin.js +227 -32
- package/mixins/KeyboardNavMixin.js +11 -7
- package/mixins/NavigationListenerMixin.js +33 -0
- package/mixins/PopupMixin.js +216 -219
- package/mixins/RTLObserverMixin.js +2 -0
- package/mixins/ResizeObserverMixin.js +18 -4
- package/mixins/RippleMixin.js +11 -7
- package/mixins/ScrollListenerMixin.js +14 -2
- package/mixins/SemiStickyMixin.js +51 -98
- package/mixins/ShapeMaskedMixin.js +125 -0
- package/mixins/ShapeMixin.js +30 -203
- package/mixins/StateMixin.js +74 -34
- package/mixins/TextFieldMixin.js +128 -145
- package/mixins/ThemableMixin.js +57 -56
- package/mixins/TooltipTriggerMixin.js +305 -359
- package/mixins/TouchTargetMixin.js +5 -2
- package/mixins/TypographyMixin.js +128 -0
- package/package.json +125 -81
- package/services/rtl.js +10 -0
- package/services/svgAlias.js +17 -0
- package/{theming/index.js → services/theme.js} +25 -176
- package/types/bin/mdw-css.d.ts +3 -0
- package/types/bin/mdw-css.d.ts.map +1 -0
- package/types/components/Badge.d.ts +39 -0
- package/types/components/Badge.d.ts.map +1 -0
- package/types/components/Body.d.ts +29 -0
- package/types/components/Body.d.ts.map +1 -0
- package/types/components/BottomAppBar.d.ts +72 -0
- package/types/components/BottomAppBar.d.ts.map +1 -0
- package/types/components/BottomSheet.d.ts +135 -0
- package/types/components/BottomSheet.d.ts.map +1 -0
- package/types/components/Box.d.ts +16 -0
- package/types/components/Box.d.ts.map +1 -0
- package/types/components/Button.d.ts +245 -0
- package/types/components/Button.d.ts.map +1 -0
- package/types/components/Card.d.ts +147 -0
- package/types/components/Card.d.ts.map +1 -0
- package/types/components/Checkbox.d.ts +207 -0
- package/types/components/Checkbox.d.ts.map +1 -0
- package/types/components/CheckboxIcon.d.ts +44 -0
- package/types/components/CheckboxIcon.d.ts.map +1 -0
- package/types/components/Chip.d.ts +248 -0
- package/types/components/Chip.d.ts.map +1 -0
- package/types/components/Dialog.d.ts +103 -0
- package/types/components/Dialog.d.ts.map +1 -0
- package/types/components/DialogActions.d.ts +4 -0
- package/types/components/DialogActions.d.ts.map +1 -0
- package/types/components/Display.d.ts +46 -0
- package/types/components/Display.d.ts.map +1 -0
- package/types/components/Divider.d.ts +10 -0
- package/types/components/Divider.d.ts.map +1 -0
- package/types/components/Fab.d.ts +273 -0
- package/types/components/Fab.d.ts.map +1 -0
- package/types/components/FabContainer.d.ts +10 -0
- package/types/components/FabContainer.d.ts.map +1 -0
- package/types/components/FilterChip.d.ts +256 -0
- package/types/components/FilterChip.d.ts.map +1 -0
- package/types/components/Grid.d.ts +38 -0
- package/types/components/Grid.d.ts.map +1 -0
- package/types/components/Headline.d.ts +46 -0
- package/types/components/Headline.d.ts.map +1 -0
- package/types/components/Icon.d.ts +55 -0
- package/types/components/Icon.d.ts.map +1 -0
- package/types/components/IconButton.d.ts +284 -0
- package/types/components/IconButton.d.ts.map +1 -0
- package/types/components/Input.d.ts +2528 -0
- package/types/components/Input.d.ts.map +1 -0
- package/types/components/InputChip.d.ts +85 -0
- package/types/components/InputChip.d.ts.map +1 -0
- package/types/components/Label.d.ts +29 -0
- package/types/components/Label.d.ts.map +1 -0
- package/types/components/List.d.ts +35 -0
- package/types/components/List.d.ts.map +1 -0
- package/types/components/ListItem.d.ts +124 -0
- package/types/components/ListItem.d.ts.map +1 -0
- package/types/components/ListOption.d.ts +158 -0
- package/types/components/ListOption.d.ts.map +1 -0
- package/types/components/Listbox.d.ts +763 -0
- package/types/components/Listbox.d.ts.map +1 -0
- package/types/components/Menu.d.ts +130 -0
- package/types/components/Menu.d.ts.map +1 -0
- package/types/components/MenuItem.d.ts +232 -0
- package/types/components/MenuItem.d.ts.map +1 -0
- package/types/components/NavBar.d.ts +20 -0
- package/types/components/NavBar.d.ts.map +1 -0
- package/types/components/NavBarItem.d.ts +97 -0
- package/types/components/NavBarItem.d.ts.map +1 -0
- package/types/components/NavDrawer.d.ts +107 -0
- package/types/components/NavDrawer.d.ts.map +1 -0
- package/types/components/NavDrawerItem.d.ts +97 -0
- package/types/components/NavDrawerItem.d.ts.map +1 -0
- package/types/components/NavItem.d.ts +99 -0
- package/types/components/NavItem.d.ts.map +1 -0
- package/types/components/NavRail.d.ts +108 -0
- package/types/components/NavRail.d.ts.map +1 -0
- package/types/components/NavRailItem.d.ts +97 -0
- package/types/components/NavRailItem.d.ts.map +1 -0
- package/types/components/Page.d.ts +25 -0
- package/types/components/Page.d.ts.map +1 -0
- package/types/components/Pane.d.ts +44 -0
- package/types/components/Pane.d.ts.map +1 -0
- package/types/components/Popup.d.ts +78 -0
- package/types/components/Popup.d.ts.map +1 -0
- package/types/components/Progress.d.ts +21 -0
- package/types/components/Progress.d.ts.map +1 -0
- package/types/components/Radio.d.ts +201 -0
- package/types/components/Radio.d.ts.map +1 -0
- package/types/components/RadioIcon.d.ts +46 -0
- package/types/components/RadioIcon.d.ts.map +1 -0
- package/types/components/Ripple.d.ts +35 -0
- package/types/components/Ripple.d.ts.map +1 -0
- package/types/components/Root.d.ts +68 -0
- package/types/components/Root.d.ts.map +1 -0
- package/types/components/Scrim.d.ts +6 -0
- package/types/components/Scrim.d.ts.map +1 -0
- package/types/components/Search.d.ts +516 -0
- package/types/components/Search.d.ts.map +1 -0
- package/types/components/SegmentedButton.d.ts +252 -0
- package/types/components/SegmentedButton.d.ts.map +1 -0
- package/types/components/SegmentedButtonGroup.d.ts +43 -0
- package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
- package/types/components/Select.d.ts +158 -0
- package/types/components/Select.d.ts.map +1 -0
- package/types/components/Shape.d.ts +10 -0
- package/types/components/Shape.d.ts.map +1 -0
- package/types/components/SideSheet.d.ts +111 -0
- package/types/components/SideSheet.d.ts.map +1 -0
- package/types/components/Slider.d.ts +203 -0
- package/types/components/Slider.d.ts.map +1 -0
- package/types/components/Snackbar.d.ts +73 -0
- package/types/components/Snackbar.d.ts.map +1 -0
- package/types/components/SnackbarContainer.d.ts +6 -0
- package/types/components/SnackbarContainer.d.ts.map +1 -0
- package/types/components/Surface.d.ts +45 -0
- package/types/components/Surface.d.ts.map +1 -0
- package/types/components/Switch.d.ts +187 -0
- package/types/components/Switch.d.ts.map +1 -0
- package/types/components/SwitchIcon.d.ts +61 -0
- package/types/components/SwitchIcon.d.ts.map +1 -0
- package/types/components/Tab.d.ts +139 -0
- package/types/components/Tab.d.ts.map +1 -0
- package/types/components/TabContent.d.ts +124 -0
- package/types/components/TabContent.d.ts.map +1 -0
- package/types/components/TabList.d.ts +1111 -0
- package/types/components/TabList.d.ts.map +1 -0
- package/types/components/TabPanel.d.ts +28 -0
- package/types/components/TabPanel.d.ts.map +1 -0
- package/types/components/Table.d.ts +25 -0
- package/types/components/Table.d.ts.map +1 -0
- package/types/components/TextArea.d.ts +201 -0
- package/types/components/TextArea.d.ts.map +1 -0
- package/types/components/Title.d.ts +46 -0
- package/types/components/Title.d.ts.map +1 -0
- package/types/components/Tooltip.d.ts +49 -0
- package/types/components/Tooltip.d.ts.map +1 -0
- package/types/components/TopAppBar.d.ts +129 -0
- package/types/components/TopAppBar.d.ts.map +1 -0
- package/types/constants/colorKeywords.d.ts +2 -0
- package/types/constants/colorKeywords.d.ts.map +1 -0
- package/types/constants/shapes.d.ts +38 -0
- package/types/constants/shapes.d.ts.map +1 -0
- package/types/constants/typography.d.ts +212 -0
- package/types/constants/typography.d.ts.map +1 -0
- package/types/core/Composition.d.ts +260 -0
- package/types/core/Composition.d.ts.map +1 -0
- package/types/core/CompositionAdapter.d.ts +114 -0
- package/types/core/CompositionAdapter.d.ts.map +1 -0
- package/types/core/CustomElement.d.ts +304 -0
- package/types/core/CustomElement.d.ts.map +1 -0
- package/types/core/css.d.ts +44 -0
- package/types/core/css.d.ts.map +1 -0
- package/types/core/customTypes.d.ts +22 -0
- package/types/core/customTypes.d.ts.map +1 -0
- package/types/core/dom.d.ts +32 -0
- package/types/core/dom.d.ts.map +1 -0
- package/types/core/jsonMergePatch.d.ts +31 -0
- package/types/core/jsonMergePatch.d.ts.map +1 -0
- package/types/core/observe.d.ts +114 -0
- package/types/core/observe.d.ts.map +1 -0
- package/types/core/optimizations.d.ts +7 -0
- package/types/core/optimizations.d.ts.map +1 -0
- package/types/core/template.d.ts +47 -0
- package/types/core/template.d.ts.map +1 -0
- package/types/core/uid.d.ts +6 -0
- package/types/core/uid.d.ts.map +1 -0
- package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
- package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
- package/types/index.d.ts +88 -0
- package/types/index.d.ts.map +1 -0
- package/types/loaders/palette.d.ts +2 -0
- package/types/loaders/palette.d.ts.map +1 -0
- package/types/loaders/theme.d.ts +2 -0
- package/types/loaders/theme.d.ts.map +1 -0
- package/types/mixins/AriaReflectorMixin.d.ts +31 -0
- package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
- package/types/mixins/AriaToolbarMixin.d.ts +34 -0
- package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
- package/types/mixins/ControlMixin.d.ts +124 -0
- package/types/mixins/ControlMixin.d.ts.map +1 -0
- package/types/mixins/DelegatesFocusMixin.d.ts +13 -0
- package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
- package/types/mixins/DensityMixin.d.ts +8 -0
- package/types/mixins/DensityMixin.d.ts.map +1 -0
- package/types/mixins/ElevationMixin.d.ts +32 -0
- package/types/mixins/ElevationMixin.d.ts.map +1 -0
- package/types/mixins/FlexableMixin.d.ts +14 -0
- package/types/mixins/FlexableMixin.d.ts.map +1 -0
- package/types/mixins/FormAssociatedMixin.d.ts +123 -0
- package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
- package/types/mixins/HyperlinkMixin.d.ts +25 -0
- package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
- package/types/mixins/InputMixin.d.ts +173 -0
- package/types/mixins/InputMixin.d.ts.map +1 -0
- package/types/mixins/KeyboardNavMixin.d.ts +46 -0
- package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
- package/types/mixins/NavigationListenerMixin.d.ts +8 -0
- package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
- package/types/mixins/PopupMixin.d.ts +98 -0
- package/types/mixins/PopupMixin.d.ts.map +1 -0
- package/types/mixins/RTLObserverMixin.d.ts +8 -0
- package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
- package/types/mixins/ResizeObserverMixin.d.ts +13 -0
- package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
- package/types/mixins/RippleMixin.d.ts +94 -0
- package/types/mixins/RippleMixin.d.ts.map +1 -0
- package/types/mixins/ScrollListenerMixin.d.ts +46 -0
- package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
- package/types/mixins/SemiStickyMixin.d.ts +50 -0
- package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMaskedMixin.d.ts +12 -0
- package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMixin.d.ts +39 -0
- package/types/mixins/ShapeMixin.d.ts.map +1 -0
- package/types/mixins/StateMixin.d.ts +29 -0
- package/types/mixins/StateMixin.d.ts.map +1 -0
- package/types/mixins/TextFieldMixin.d.ts +153 -0
- package/types/mixins/TextFieldMixin.d.ts.map +1 -0
- package/types/mixins/ThemableMixin.d.ts +10 -0
- package/types/mixins/ThemableMixin.d.ts.map +1 -0
- package/types/mixins/TooltipTriggerMixin.d.ts +114 -0
- package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
- package/types/mixins/TouchTargetMixin.d.ts +6 -0
- package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
- package/types/mixins/TypographyMixin.d.ts +20 -0
- package/types/mixins/TypographyMixin.d.ts.map +1 -0
- package/types/services/rtl.d.ts +3 -0
- package/types/services/rtl.d.ts.map +1 -0
- package/types/services/svgAlias.d.ts +13 -0
- package/types/services/svgAlias.d.ts.map +1 -0
- package/types/services/theme.d.ts +45 -0
- package/types/services/theme.d.ts.map +1 -0
- package/types/utils/cli.d.ts +3 -0
- package/types/utils/cli.d.ts.map +1 -0
- package/types/utils/function.d.ts +3 -0
- package/types/utils/function.d.ts.map +1 -0
- package/types/utils/jsx-runtime.d.ts +20 -0
- package/types/utils/jsx-runtime.d.ts.map +1 -0
- package/types/utils/material-color/blend.d.ts +34 -0
- package/types/utils/material-color/blend.d.ts.map +1 -0
- package/types/utils/material-color/hct/Cam16.d.ts +142 -0
- package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
- package/types/utils/material-color/hct/Hct.d.ts +93 -0
- package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
- package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
- package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
- package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
- package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
- package/types/utils/material-color/helper.d.ts +8 -0
- package/types/utils/material-color/helper.d.ts.map +1 -0
- package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
- package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
- package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
- package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
- package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
- package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
- package/types/utils/material-color/utils/color.d.ts +172 -0
- package/types/utils/material-color/utils/color.d.ts.map +1 -0
- package/types/utils/material-color/utils/math.d.ts +94 -0
- package/types/utils/material-color/utils/math.d.ts.map +1 -0
- package/types/utils/pixelmatch.d.ts +22 -0
- package/types/utils/pixelmatch.d.ts.map +1 -0
- package/types/utils/popup.d.ts +106 -0
- package/types/utils/popup.d.ts.map +1 -0
- package/types/utils/searchParams.d.ts +3 -0
- package/types/utils/searchParams.d.ts.map +1 -0
- package/types/utils/svg.d.ts +7 -0
- package/types/utils/svg.d.ts.map +1 -0
- package/utils/jsx-runtime.js +9 -4
- package/utils/material-color/scheme/Scheme.js +1 -1
- package/utils/pixelmatch.js +363 -0
- package/utils/popup.js +86 -10
- package/utils/searchParams.js +22 -0
- package/components/Button.md +0 -61
- package/components/ExtendedFab.js +0 -32
- package/components/Layout.js +0 -504
- package/components/Nav.js +0 -38
- package/core/DomAdapter.js +0 -586
- package/core/ICustomElement.d.ts +0 -291
- package/core/ICustomElement.js +0 -1
- package/core/test.js +0 -126
- package/core/typings.d.ts +0 -142
- package/core/typings.js +0 -1
- package/mixins/SurfaceMixin.js +0 -127
- package/theming/loader.js +0 -22
- /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import CustomElement from '../core/CustomElement.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A scrim can bring focus to specific elements by increasing the visual contrast of a large layered surface.
|
|
5
|
+
* Use the scrim beneath elements like modals and expanded navigation menus.
|
|
6
|
+
* @see https://m3.material.io/styles/elevation/applying-elevation
|
|
7
|
+
*/
|
|
8
|
+
export default CustomElement
|
|
9
|
+
.extend()
|
|
10
|
+
.observe({
|
|
11
|
+
/** When true the scrim is hidden and will be removed after its fade-out animation. */
|
|
12
|
+
hidden: 'boolean',
|
|
13
|
+
})
|
|
14
|
+
.html`<div id=scroll-blocker></div>`
|
|
15
|
+
.css`
|
|
16
|
+
:host {
|
|
17
|
+
position: fixed;
|
|
18
|
+
inset: 0;
|
|
19
|
+
|
|
20
|
+
display: block;
|
|
21
|
+
overflow: overlay;
|
|
22
|
+
|
|
23
|
+
overscroll-behavior: none;
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
scrollbar-color: transparent transparent;
|
|
26
|
+
scrollbar-width: none;
|
|
27
|
+
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
|
|
30
|
+
outline: none; /* Older Chromium Builds */
|
|
31
|
+
|
|
32
|
+
-webkit-tap-highlight-color: transparent;
|
|
33
|
+
|
|
34
|
+
opacity: 0;
|
|
35
|
+
|
|
36
|
+
z-index: 23;
|
|
37
|
+
|
|
38
|
+
background-color: rgb(var(--mdw-color__scrim));
|
|
39
|
+
|
|
40
|
+
animation: fade-in 200ms forwards ease-out;
|
|
41
|
+
will-change: opacity;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host::-webkit-scrollbar {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([hidden]) {
|
|
49
|
+
animation-name: fade-out;
|
|
50
|
+
animation-timing-function: ease-in;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([invisible]) {
|
|
54
|
+
background: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#scroll-blocker {
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset-block-start: 0;
|
|
60
|
+
inset-inline-start: 0;
|
|
61
|
+
|
|
62
|
+
display: block;
|
|
63
|
+
|
|
64
|
+
block-size: 200%;
|
|
65
|
+
inline-size: 200%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes fade-in {
|
|
69
|
+
from {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
to {
|
|
74
|
+
opacity: 0.38;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes fade-out {
|
|
79
|
+
from {
|
|
80
|
+
opacity: 0.38;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
to {
|
|
84
|
+
opacity: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`
|
|
88
|
+
.events({
|
|
89
|
+
animationend() {
|
|
90
|
+
if (this.hidden) {
|
|
91
|
+
this.remove();
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
.autoRegister('mdw-scrim');
|
package/components/Search.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import TopAppBar from './TopAppBar.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Search provides an app bar integrated search field for querying content.
|
|
5
|
+
* implements {HTMLSelectElement}
|
|
6
|
+
* @see https://m3.material.io/components/search/overview
|
|
7
|
+
*/
|
|
4
8
|
export default TopAppBar
|
|
5
9
|
.extend()
|
|
6
10
|
.undefine('headline')
|
|
@@ -8,18 +12,27 @@ export default TopAppBar
|
|
|
8
12
|
.undefine('size')
|
|
9
13
|
.undefine('_headlineStyle')
|
|
10
14
|
.observe({
|
|
15
|
+
/** Placeholder text shown in the search input. */
|
|
11
16
|
placeholder: { type: 'string', empty: 'Search' },
|
|
17
|
+
/** Visual color token to apply to the search surface. */
|
|
12
18
|
color: { empty: 'surface-container-high' },
|
|
19
|
+
/** Shape style token to apply (e.g. 'full', 'none'). */
|
|
13
20
|
shapeStyle: { empty: 'full' },
|
|
21
|
+
/** Enable keyboard navigation mode for search results when true. */
|
|
14
22
|
kbdNav: { empty: 'false' },
|
|
15
23
|
})
|
|
16
24
|
.define({
|
|
17
|
-
/**
|
|
18
|
-
input() {
|
|
25
|
+
/** Returns the current text value of the internal input. */
|
|
26
|
+
input() {
|
|
27
|
+
return /** @type {HTMLInputElement} */ (this.refs.input).value;
|
|
28
|
+
},
|
|
29
|
+
/** The `value` accessor proxies the internal input's value. */
|
|
19
30
|
value: {
|
|
20
|
-
get() {
|
|
31
|
+
get() {
|
|
32
|
+
return /** @type {HTMLInputElement} */ (this.refs.input).value;
|
|
33
|
+
},
|
|
21
34
|
set(value) {
|
|
22
|
-
this.refs.input.value = value;
|
|
35
|
+
/** @type {HTMLInputElement} */ (this.refs.input).value = value;
|
|
23
36
|
},
|
|
24
37
|
},
|
|
25
38
|
})
|
|
@@ -29,28 +42,25 @@ export default TopAppBar
|
|
|
29
42
|
.css`
|
|
30
43
|
:host {
|
|
31
44
|
--mdw-bg: var(--mdw-color__surface-container-high);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
#surface {
|
|
36
|
-
background-color: transparent;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#leading:not([slotted]),
|
|
40
|
-
#trailing:not([slotted]) {
|
|
41
|
-
display: none;
|
|
42
|
-
}
|
|
45
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
46
|
+
inset-block-start: 8px;
|
|
43
47
|
|
|
44
|
-
#shape {
|
|
45
48
|
display: flex;
|
|
46
49
|
align-items: center;
|
|
47
50
|
gap: 16px;
|
|
48
51
|
|
|
52
|
+
margin-block: 16px;
|
|
53
|
+
|
|
49
54
|
padding-inline: 16px;
|
|
50
55
|
|
|
51
56
|
background-color: rgb(var(--mdw-bg));
|
|
52
57
|
}
|
|
53
58
|
|
|
59
|
+
#leading:not([slotted]),
|
|
60
|
+
#trailing:not([slotted]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
#input {
|
|
55
65
|
--mdw-state__hovered-opacity: 0;
|
|
56
66
|
flex: 1;
|
|
@@ -73,13 +83,8 @@ export default TopAppBar
|
|
|
73
83
|
},
|
|
74
84
|
},
|
|
75
85
|
})
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
companion.remove();
|
|
80
|
-
headline.replaceWith(input);
|
|
81
|
-
surface.removeAttribute('aria-labelledby');
|
|
82
|
-
},
|
|
86
|
+
.recompose(({ refs: { companion, headline, input } }) => {
|
|
87
|
+
companion.remove();
|
|
88
|
+
headline.replaceWith(input);
|
|
83
89
|
})
|
|
84
|
-
|
|
85
90
|
.autoRegister('mdw-search');
|
|
@@ -2,52 +2,54 @@ import './Icon.js';
|
|
|
2
2
|
|
|
3
3
|
import Button from './Button.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Segmented buttons group individual related actions or options where
|
|
7
|
+
* multiple choices are presented inline; each segment acts like a toggle
|
|
8
|
+
* or option within a set.
|
|
9
|
+
* @see https://m3.material.io/components/segmented-buttons/specs
|
|
10
|
+
*/
|
|
5
11
|
export default Button
|
|
6
12
|
.extend()
|
|
7
13
|
.observe({
|
|
14
|
+
/** Interaction model for the segment: 'radio' (single select) or 'checkbox' (multi-select). */
|
|
8
15
|
type: { empty: 'radio' },
|
|
16
|
+
/** When true this segment is rendered as an inner segment inside a segmented group. */
|
|
9
17
|
innerSegmentedButton: 'boolean',
|
|
10
18
|
})
|
|
11
19
|
.set({
|
|
20
|
+
/** Render the button with an outline style. */
|
|
21
|
+
outlined: true,
|
|
22
|
+
/** Allow the control to receive focus even when disabled. */
|
|
12
23
|
focusableOnDisabled: true,
|
|
13
24
|
})
|
|
14
|
-
.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
));
|
|
39
|
-
|
|
40
|
-
state.setAttribute('state-disabled', 'focus');
|
|
41
|
-
},
|
|
42
|
-
constructed() {
|
|
43
|
-
this.outlined = true;
|
|
44
|
-
},
|
|
25
|
+
.recompose(({ html, inline, refs: { icon, outline, control, slot, state } }) => {
|
|
26
|
+
slot.before(html`
|
|
27
|
+
<div id=icons>
|
|
28
|
+
${icon}
|
|
29
|
+
<mdw-icon selected={checked} id=check-icon aria-hidden=true icon=check variation=filled></mdw-icon>
|
|
30
|
+
</div>
|
|
31
|
+
`);
|
|
32
|
+
|
|
33
|
+
icon.removeAttribute('mdw-if');
|
|
34
|
+
icon.setAttribute('has-icon', '{hasIcon}');
|
|
35
|
+
icon.setAttribute('selected', '{checked}');
|
|
36
|
+
outline.setAttribute('selected', '{checked}');
|
|
37
|
+
outline.setAttribute('inner-segmented-button', '{innerSegmentedButton}');
|
|
38
|
+
outline.setAttribute('shape-start', '{shapeStart}');
|
|
39
|
+
outline.setAttribute('shape-end', '{shapeEnd}');
|
|
40
|
+
control.setAttribute('role', 'option');
|
|
41
|
+
control.setAttribute('aria-checked', inline(
|
|
42
|
+
({ type, checked }) => (type === 'checkbox' ? `${(!!checked)}` : null),
|
|
43
|
+
));
|
|
44
|
+
control.setAttribute('aria-selected', inline(
|
|
45
|
+
({ type, checked }) => (type === 'checkbox' ? null : `${!!checked}`),
|
|
46
|
+
));
|
|
47
|
+
|
|
48
|
+
state.setAttribute('state-disabled', 'focus');
|
|
45
49
|
})
|
|
46
50
|
.css`
|
|
47
|
-
/* https://m3.material.io/components/segmented-buttons/specs */
|
|
48
|
-
|
|
49
51
|
:host {
|
|
50
|
-
--mdw-shape__size:
|
|
52
|
+
--mdw-shape__size: 0;
|
|
51
53
|
--mdw-ink: var(--mdw-color__on-surface);
|
|
52
54
|
gap: 8px;
|
|
53
55
|
|
|
@@ -58,19 +60,29 @@ export default Button
|
|
|
58
60
|
color: rgb(var(--mdw-ink));
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
:host(
|
|
62
|
-
--mdw-shape__size:
|
|
63
|
+
:host(:first-of-type) {
|
|
64
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
65
|
+
--mdw-shape__size__top-end-size: 0px;
|
|
66
|
+
--mdw-shape__size__bottom-end-size: 0px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host(:last-of-type) {
|
|
70
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
71
|
+
--mdw-shape__size__top-start-size: 0px;
|
|
72
|
+
--mdw-shape__size__bottom-start-size: 0px;
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
#outline {
|
|
66
76
|
inset-inline-end: -1px;
|
|
77
|
+
|
|
78
|
+
z-index: -1;
|
|
67
79
|
}
|
|
68
80
|
|
|
69
|
-
#outline
|
|
81
|
+
:host(:last-of-type) #outline {
|
|
70
82
|
inset-inline-end: 0;
|
|
71
83
|
}
|
|
72
84
|
|
|
73
|
-
#
|
|
85
|
+
#outline[selected] {
|
|
74
86
|
background-color: rgb(var(--mdw-bg));
|
|
75
87
|
}
|
|
76
88
|
|
|
@@ -107,12 +119,13 @@ export default Button
|
|
|
107
119
|
|
|
108
120
|
overflow: visible;
|
|
109
121
|
|
|
122
|
+
block-size: 100%;
|
|
123
|
+
|
|
110
124
|
margin: 0;
|
|
111
125
|
|
|
112
126
|
opacity: 0;
|
|
113
127
|
|
|
114
128
|
font-size: 18px;
|
|
115
|
-
font-variation-settings: 'FILL' 1;
|
|
116
129
|
}
|
|
117
130
|
|
|
118
131
|
#check-icon[selected] {
|
|
@@ -125,7 +138,7 @@ export default Button
|
|
|
125
138
|
color: rgba(var(--mdw-color__on-surface), 0.38);
|
|
126
139
|
}
|
|
127
140
|
|
|
128
|
-
#
|
|
141
|
+
#outline[disabled][selected] {
|
|
129
142
|
background-color: rgba(var(--mdw-color__on-surface), 0.12);
|
|
130
143
|
}
|
|
131
144
|
`
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';
|
|
2
1
|
import KeyboardNav from '../mixins/KeyboardNavMixin.js';
|
|
3
2
|
|
|
4
3
|
import Box from './Box.js';
|
|
@@ -6,10 +5,14 @@ import SegmentedButton from './SegmentedButton.js';
|
|
|
6
5
|
|
|
7
6
|
/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */
|
|
8
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A segmented button group arranges multiple `mdw-segmented-button` items
|
|
10
|
+
* so they behave as a related set of choices or toggles.
|
|
11
|
+
* @see https://m3.material.io/components/segmented-buttons/specs
|
|
12
|
+
*/
|
|
9
13
|
export default Box
|
|
10
14
|
.extend()
|
|
11
15
|
.mixin(KeyboardNav)
|
|
12
|
-
.mixin(AriaReflectorMixin)
|
|
13
16
|
.define({
|
|
14
17
|
kbdNavQuery() {
|
|
15
18
|
return SegmentedButton.elementName;
|
|
@@ -20,15 +23,7 @@ export default Box
|
|
|
20
23
|
})
|
|
21
24
|
.childEvents({
|
|
22
25
|
slot: {
|
|
23
|
-
slotchange
|
|
24
|
-
this.refreshTabIndexes();
|
|
25
|
-
const list = /** @type {NodeListOf<InstanceType<SegmentedButton>>} */ (this.kbdNavChildren);
|
|
26
|
-
for (const [index, child] of list.entries()) {
|
|
27
|
-
child.shapeStart = index === 0;
|
|
28
|
-
child.innerSegmentedButton = index > 0 && index < list.length - 1;
|
|
29
|
-
child.shapeEnd = index === list.length - 1;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
26
|
+
slotchange: 'refreshTabIndexes',
|
|
32
27
|
},
|
|
33
28
|
})
|
|
34
29
|
.css`
|
|
@@ -39,8 +34,15 @@ export default Box
|
|
|
39
34
|
--mdw-ink: var(--mdw-color__on-secondary-container);
|
|
40
35
|
|
|
41
36
|
display: inline-flex;
|
|
37
|
+
align-items: stretch;
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
justify-content: initial;
|
|
42
40
|
overflow-x: auto;
|
|
43
41
|
overflow-y: hidden;
|
|
42
|
+
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
min-inline-size: 100%;
|
|
45
|
+
flex: none;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
:host([color]) {
|
|
@@ -49,6 +51,7 @@ export default Box
|
|
|
49
51
|
|
|
50
52
|
#slot {
|
|
51
53
|
display: grid;
|
|
54
|
+
grid-auto-columns: 1fr;
|
|
52
55
|
grid-auto-flow: column;
|
|
53
56
|
|
|
54
57
|
flex: none;
|
|
@@ -57,7 +60,7 @@ export default Box
|
|
|
57
60
|
`
|
|
58
61
|
.on({
|
|
59
62
|
constructed() {
|
|
60
|
-
this.
|
|
63
|
+
this.updateAriaProperty('ariaOrientation', 'horizontal');
|
|
61
64
|
},
|
|
62
65
|
})
|
|
63
66
|
.autoRegister('mdw-segmented-button-group');
|
package/components/Select.js
CHANGED
|
@@ -4,7 +4,11 @@ import StateMixin from '../mixins/StateMixin.js';
|
|
|
4
4
|
import TextFieldMixin from '../mixins/TextFieldMixin.js';
|
|
5
5
|
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Select provides a control for choosing an option from a list of options.
|
|
9
|
+
* implements {HTMLSelectElement}
|
|
10
|
+
* @see https://m3.material.io/components/text-fields/overview
|
|
11
|
+
*/
|
|
8
12
|
export default CustomElement
|
|
9
13
|
.extend()
|
|
10
14
|
.mixin(ThemableMixin)
|
|
@@ -12,6 +16,7 @@ export default CustomElement
|
|
|
12
16
|
.mixin(ControlMixin)
|
|
13
17
|
.mixin(TextFieldMixin)
|
|
14
18
|
.observe({
|
|
19
|
+
/** Name of the trailing icon to render (defaults to the dropdown arrow). */
|
|
15
20
|
trailingIcon: { empty: 'arrow_drop_down' },
|
|
16
21
|
})
|
|
17
22
|
.overrides({
|
|
@@ -20,11 +25,13 @@ export default CustomElement
|
|
|
20
25
|
type: 'select-one',
|
|
21
26
|
})
|
|
22
27
|
.define({
|
|
28
|
+
/** Return the internal native <select> element used as the control. */
|
|
23
29
|
_select() {
|
|
24
30
|
return /** @type {HTMLSelectElement} */ (this.refs.control);
|
|
25
31
|
},
|
|
26
|
-
/** Readonly
|
|
32
|
+
/** Readonly: whether the underlying control allows multiple selection. */
|
|
27
33
|
multiple: { value: false },
|
|
34
|
+
/** Readonly: the rendered size of the native select control. */
|
|
28
35
|
size: { value: 1 },
|
|
29
36
|
})
|
|
30
37
|
.html`<slot id=slot></slot>`
|
|
@@ -41,17 +48,19 @@ export default CustomElement
|
|
|
41
48
|
},
|
|
42
49
|
},
|
|
43
50
|
})
|
|
51
|
+
.recompose(({ template, refs: { slot, prefix, suffix, control } }) => {
|
|
52
|
+
control.setAttribute('icon', '{icon}');
|
|
53
|
+
template.append(slot);
|
|
54
|
+
prefix.remove();
|
|
55
|
+
suffix.remove();
|
|
56
|
+
})
|
|
44
57
|
.on({
|
|
45
|
-
|
|
46
|
-
const { slot, prefix, suffix, control } = this.refs;
|
|
47
|
-
control.setAttribute('icon', '{icon}');
|
|
48
|
-
template.append(slot);
|
|
49
|
-
prefix.remove();
|
|
50
|
-
suffix.remove();
|
|
51
|
-
},
|
|
58
|
+
/** When the form resets, restore the select value from any option[selected]. */
|
|
52
59
|
_formResetChanged(oldValue, newValue) {
|
|
53
60
|
if (!newValue) return;
|
|
54
|
-
|
|
61
|
+
/** @type {HTMLSelectElement} */
|
|
62
|
+
const selectedOption = this.querySelector('option[selected]');
|
|
63
|
+
this._select.value = selectedOption?.value ?? '';
|
|
55
64
|
},
|
|
56
65
|
})
|
|
57
66
|
.css`
|
package/components/Shape.js
CHANGED
|
@@ -1,68 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import CustomElement from '../core/CustomElement.js';
|
|
2
|
+
import ShapeMaskedMixin from '../mixins/ShapeMaskedMixin.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shape applies shape tokens (corner radius) to elements and surfaces.
|
|
6
|
+
* @see https://m3.material.io/styles/shape/overview-principles
|
|
7
|
+
*/
|
|
8
|
+
export default CustomElement
|
|
6
9
|
.extend()
|
|
7
|
-
.mixin(
|
|
8
|
-
.
|
|
9
|
-
composed() {
|
|
10
|
-
const { shape, outline } = this.refs;
|
|
11
|
-
shape.before(outline);
|
|
12
|
-
shape.remove();
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
.css`
|
|
16
|
-
:host {
|
|
17
|
-
position: relative;
|
|
18
|
-
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
|
|
21
|
-
z-index: auto;
|
|
22
|
-
|
|
23
|
-
background-color: var(--mdw-shape__bg, transparent);
|
|
24
|
-
|
|
25
|
-
border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));
|
|
26
|
-
border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));
|
|
27
|
-
border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));
|
|
28
|
-
border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));
|
|
29
|
-
|
|
30
|
-
transition-delay: 1ms;
|
|
31
|
-
transition-duration: 200ms;
|
|
32
|
-
transition-property: background-color, color;
|
|
33
|
-
will-change: background-color, color;
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([color]) {
|
|
38
|
-
background-color: rgb(var(--mdw-bg));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host(:where([ink],[color])) {
|
|
42
|
-
color: rgb(var(--mdw-ink));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([outlined]) {
|
|
46
|
-
background-color: transparent;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host(:is([color="none"], [color="transparent"])) {
|
|
50
|
-
background-color: transparent;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@supports(-webkit-mask-box-image: none) {
|
|
54
|
-
:host {
|
|
55
|
-
-webkit-mask-box-image: var(--mdw-shape__mask-border-source)
|
|
56
|
-
8 fill /
|
|
57
|
-
var(--mdw-shape__size)
|
|
58
|
-
stretch;
|
|
59
|
-
|
|
60
|
-
-webkit-mask: var(--mdw-shape__mask);
|
|
61
|
-
|
|
62
|
-
transition-duration: 200ms, 200ms, 200ms;
|
|
63
|
-
transition-property: background-color, color, -webkit-mask-box-image-width;
|
|
64
|
-
will-change: background-color, color, -webkit-mask-box-image;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`
|
|
10
|
+
.mixin(ShapeMaskedMixin)
|
|
11
|
+
.html`<slot id=slot></slot>`
|
|
68
12
|
.autoRegister('mdw-shape');
|