@shortfuse/materialdesignweb 0.8.0 → 0.9.0
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 +32 -24
- package/bin/mdw-css.js +1 -1
- package/components/Badge.js +12 -5
- package/components/Body.js +3 -0
- package/components/BottomAppBar.js +1 -8
- package/components/BottomSheet.js +424 -0
- package/components/Box.js +11 -49
- package/components/Button.js +61 -82
- package/components/Card.js +56 -61
- package/components/Checkbox.js +7 -25
- package/components/CheckboxIcon.js +10 -28
- package/components/Chip.js +13 -11
- package/components/Dialog.js +49 -98
- package/components/Display.js +55 -0
- package/components/Fab.js +83 -17
- package/components/FabContainer.js +48 -0
- package/components/FilterChip.js +34 -32
- package/components/Grid.js +176 -0
- package/components/Headline.js +5 -28
- package/components/Icon.js +54 -69
- package/components/IconButton.js +71 -120
- package/components/Input.js +669 -83
- package/components/InputChip.js +161 -0
- package/components/Label.js +3 -0
- package/components/List.js +1 -5
- package/components/ListItem.js +39 -23
- package/components/ListOption.js +79 -62
- package/components/Listbox.js +19 -10
- package/components/Menu.js +8 -18
- package/components/MenuItem.js +25 -26
- package/components/NavBar.js +53 -19
- package/components/NavDrawer.js +15 -15
- package/components/NavDrawerItem.js +2 -4
- package/components/NavItem.js +40 -33
- package/components/NavRail.js +23 -21
- package/components/NavRailItem.js +5 -2
- package/components/Page.js +105 -0
- package/components/Pane.js +18 -0
- package/components/Popup.js +17 -8
- package/components/Radio.js +2 -5
- package/components/RadioIcon.js +10 -14
- package/components/Ripple.js +11 -7
- package/components/Root.js +209 -0
- package/components/Scrim.js +87 -0
- package/components/Search.js +12 -20
- package/components/SegmentedButton.js +33 -36
- package/components/SegmentedButtonGroup.js +9 -3
- package/components/Select.js +6 -7
- package/components/Shape.js +5 -65
- package/components/SideSheet.js +308 -0
- package/components/Slider.js +71 -34
- package/components/Snackbar.js +22 -16
- package/components/SnackbarContainer.js +42 -0
- package/components/Surface.js +15 -10
- package/components/Switch.js +3 -16
- package/components/SwitchIcon.js +40 -32
- package/components/Tab.js +57 -38
- package/components/TabContent.js +1 -0
- package/components/TabList.js +60 -32
- package/components/TabPanel.js +1 -1
- package/components/Table.js +116 -0
- package/components/TextArea.js +16 -15
- package/components/Title.js +4 -9
- package/components/Tooltip.js +43 -21
- package/components/TopAppBar.js +56 -78
- package/constants/shapes.js +36 -0
- package/constants/typography.js +127 -0
- package/core/Composition.js +354 -192
- package/core/CompositionAdapter.js +11 -12
- package/core/CustomElement.js +588 -236
- package/core/css.js +117 -12
- package/core/customTypes.js +120 -25
- package/core/dom.js +17 -11
- package/core/jsonMergePatch.js +12 -10
- package/core/observe.js +298 -253
- package/core/optimizations.js +9 -9
- package/core/template.js +14 -57
- 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 +106 -0
- package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
- package/loaders/theme.js +12 -0
- package/mixins/AriaReflectorMixin.js +53 -13
- package/mixins/AriaToolbarMixin.js +3 -0
- package/mixins/ControlMixin.js +76 -33
- package/mixins/DelegatesFocusMixin.js +54 -0
- package/mixins/DensityMixin.js +2 -2
- package/mixins/ElevationMixin.js +62 -0
- package/mixins/FlexableMixin.js +66 -37
- package/mixins/FormAssociatedMixin.js +60 -8
- package/mixins/HyperlinkMixin.js +66 -0
- package/mixins/InputMixin.js +205 -32
- package/mixins/KeyboardNavMixin.js +8 -6
- package/mixins/NavigationListenerMixin.js +33 -0
- package/mixins/PopupMixin.js +176 -208
- package/mixins/ResizeObserverMixin.js +16 -4
- package/mixins/RippleMixin.js +8 -6
- package/mixins/ScrollListenerMixin.js +1 -1
- package/mixins/SemiStickyMixin.js +44 -98
- package/mixins/ShapeMaskedMixin.js +117 -0
- package/mixins/ShapeMixin.js +22 -204
- package/mixins/StateMixin.js +70 -34
- package/mixins/TextFieldMixin.js +107 -143
- package/mixins/ThemableMixin.js +44 -56
- package/mixins/TooltipTriggerMixin.js +291 -359
- package/mixins/TouchTargetMixin.js +1 -1
- package/mixins/TypographyMixin.js +121 -0
- package/package.json +110 -74
- package/services/rtl.js +10 -0
- package/services/svgAlias.js +17 -0
- package/{theming/index.js → services/theme.js} +24 -174
- 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 +73 -0
- package/types/components/BottomAppBar.d.ts.map +1 -0
- package/types/components/BottomSheet.d.ts +109 -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 +714 -0
- package/types/components/Button.d.ts.map +1 -0
- package/types/components/Card.d.ts +412 -0
- package/types/components/Card.d.ts.map +1 -0
- package/types/components/Checkbox.d.ts +205 -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 +1425 -0
- package/types/components/Chip.d.ts.map +1 -0
- package/types/components/Dialog.d.ts +286 -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 +45 -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 +741 -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 +4283 -0
- package/types/components/FilterChip.d.ts.map +1 -0
- package/types/components/Grid.d.ts +37 -0
- package/types/components/Grid.d.ts.map +1 -0
- package/types/components/Headline.d.ts +47 -0
- package/types/components/Headline.d.ts.map +1 -0
- package/types/components/Icon.d.ts +103 -0
- package/types/components/Icon.d.ts.map +1 -0
- package/types/components/IconButton.d.ts +1486 -0
- package/types/components/IconButton.d.ts.map +1 -0
- package/types/components/Input.d.ts +51288 -0
- package/types/components/Input.d.ts.map +1 -0
- package/types/components/InputChip.d.ts +243 -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 +31 -0
- package/types/components/List.d.ts.map +1 -0
- package/types/components/ListItem.d.ts +349 -0
- package/types/components/ListItem.d.ts.map +1 -0
- package/types/components/ListOption.d.ts +1493 -0
- package/types/components/ListOption.d.ts.map +1 -0
- package/types/components/Listbox.d.ts +12012 -0
- package/types/components/Listbox.d.ts.map +1 -0
- package/types/components/Menu.d.ts +119 -0
- package/types/components/Menu.d.ts.map +1 -0
- package/types/components/MenuItem.d.ts +3109 -0
- package/types/components/MenuItem.d.ts.map +1 -0
- package/types/components/NavBar.d.ts +18 -0
- package/types/components/NavBar.d.ts.map +1 -0
- package/types/components/NavBarItem.d.ts +186 -0
- package/types/components/NavBarItem.d.ts.map +1 -0
- package/types/components/NavDrawer.d.ts +108 -0
- package/types/components/NavDrawer.d.ts.map +1 -0
- package/types/components/NavDrawerItem.d.ts +186 -0
- package/types/components/NavDrawerItem.d.ts.map +1 -0
- package/types/components/NavItem.d.ts +190 -0
- package/types/components/NavItem.d.ts.map +1 -0
- package/types/components/NavRail.d.ts +109 -0
- package/types/components/NavRail.d.ts.map +1 -0
- package/types/components/NavRailItem.d.ts +186 -0
- package/types/components/NavRailItem.d.ts.map +1 -0
- package/types/components/Page.d.ts +24 -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 +76 -0
- package/types/components/Popup.d.ts.map +1 -0
- package/types/components/Progress.d.ts +19 -0
- package/types/components/Progress.d.ts.map +1 -0
- package/types/components/Radio.d.ts +199 -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 +34 -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 +16 -0
- package/types/components/Search.d.ts.map +1 -0
- package/types/components/SegmentedButton.d.ts +718 -0
- package/types/components/SegmentedButton.d.ts.map +1 -0
- package/types/components/SegmentedButtonGroup.d.ts +44 -0
- package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
- package/types/components/Select.d.ts +1361 -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 +106 -0
- package/types/components/SideSheet.d.ts.map +1 -0
- package/types/components/Slider.d.ts +382 -0
- package/types/components/Slider.d.ts.map +1 -0
- package/types/components/Snackbar.d.ts +65 -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 +183 -0
- package/types/components/Switch.d.ts.map +1 -0
- package/types/components/SwitchIcon.d.ts +169 -0
- package/types/components/SwitchIcon.d.ts.map +1 -0
- package/types/components/Tab.d.ts +879 -0
- package/types/components/Tab.d.ts.map +1 -0
- package/types/components/TabContent.d.ts +122 -0
- package/types/components/TabContent.d.ts.map +1 -0
- package/types/components/TabList.d.ts +6266 -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 +2 -0
- package/types/components/Table.d.ts.map +1 -0
- package/types/components/TextArea.d.ts +1394 -0
- package/types/components/TextArea.d.ts.map +1 -0
- package/types/components/Title.d.ts +47 -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 +130 -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 +252 -0
- package/types/core/Composition.d.ts.map +1 -0
- package/types/core/CompositionAdapter.d.ts +92 -0
- package/types/core/CompositionAdapter.d.ts.map +1 -0
- package/types/core/CustomElement.d.ts +302 -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 +26 -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 +113 -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 +23 -0
- package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
- package/types/mixins/AriaToolbarMixin.d.ts +32 -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 +5 -0
- package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
- package/types/mixins/DensityMixin.d.ts +5 -0
- package/types/mixins/DensityMixin.d.ts.map +1 -0
- package/types/mixins/ElevationMixin.d.ts +33 -0
- package/types/mixins/ElevationMixin.d.ts.map +1 -0
- package/types/mixins/FlexableMixin.d.ts +13 -0
- package/types/mixins/FlexableMixin.d.ts.map +1 -0
- package/types/mixins/FormAssociatedMixin.d.ts +122 -0
- package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
- package/types/mixins/HyperlinkMixin.d.ts +22 -0
- package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
- package/types/mixins/InputMixin.d.ts +179 -0
- package/types/mixins/InputMixin.d.ts.map +1 -0
- package/types/mixins/KeyboardNavMixin.d.ts +47 -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 +82 -0
- package/types/mixins/PopupMixin.d.ts.map +1 -0
- package/types/mixins/RTLObserverMixin.d.ts +7 -0
- package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
- package/types/mixins/ResizeObserverMixin.d.ts +12 -0
- package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
- package/types/mixins/RippleMixin.d.ts +92 -0
- package/types/mixins/RippleMixin.d.ts.map +1 -0
- package/types/mixins/ScrollListenerMixin.d.ts +41 -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 +9 -0
- package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMixin.d.ts +38 -0
- package/types/mixins/ShapeMixin.d.ts.map +1 -0
- package/types/mixins/StateMixin.d.ts +27 -0
- package/types/mixins/StateMixin.d.ts.map +1 -0
- package/types/mixins/TextFieldMixin.d.ts +1354 -0
- package/types/mixins/TextFieldMixin.d.ts.map +1 -0
- package/types/mixins/ThemableMixin.d.ts +9 -0
- package/types/mixins/ThemableMixin.d.ts.map +1 -0
- package/types/mixins/TooltipTriggerMixin.d.ts +106 -0
- package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
- package/types/mixins/TouchTargetMixin.d.ts +3 -0
- package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
- package/types/mixins/TypographyMixin.d.ts +17 -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/material-color/scheme/Scheme.js +1 -1
- package/utils/pixelmatch.js +360 -0
- package/utils/popup.js +86 -10
- package/utils/searchParams.js +19 -0
- 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,105 @@
|
|
|
1
|
+
/* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
|
|
2
|
+
|
|
3
|
+
import CustomElement from '../core/CustomElement.js';
|
|
4
|
+
import { ELEMENT_STYLE_TYPE } from '../core/customTypes.js';
|
|
5
|
+
import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
|
|
6
|
+
import ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';
|
|
7
|
+
|
|
8
|
+
export default CustomElement
|
|
9
|
+
.extend()
|
|
10
|
+
.mixin(DelegatesFocusMixin)
|
|
11
|
+
.mixin(ResizeObserverMixin)
|
|
12
|
+
.observe({
|
|
13
|
+
paneOne: {
|
|
14
|
+
value: /** @type {'fixed'|'flexible'} */ ('flexible'),
|
|
15
|
+
},
|
|
16
|
+
paneTwo: {
|
|
17
|
+
value: /** @type {'fixed'|'flexible'|null} */ (null),
|
|
18
|
+
},
|
|
19
|
+
paneTwoActive: 'boolean',
|
|
20
|
+
paneTwoBreakpoint: {
|
|
21
|
+
type: 'float',
|
|
22
|
+
empty: 720,
|
|
23
|
+
},
|
|
24
|
+
_lastComputedInlineSize: {
|
|
25
|
+
type: 'float',
|
|
26
|
+
nullable: false,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
.observe({
|
|
30
|
+
_isMultipane({ _lastComputedInlineSize, paneTwo, paneTwoBreakpoint }) {
|
|
31
|
+
return Boolean(paneTwo && _lastComputedInlineSize >= paneTwoBreakpoint);
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
.observe({
|
|
35
|
+
_styles: {
|
|
36
|
+
...ELEMENT_STYLE_TYPE,
|
|
37
|
+
get({ _isMultipane, paneOne, paneTwoActive }) {
|
|
38
|
+
if (_isMultipane) {
|
|
39
|
+
return `:host{grid-template-columns:${paneOne === 'fixed' ? '360px' : '1fr'} ${this.paneTwo === 'fixed' ? '360px' : '1fr'}}`;
|
|
40
|
+
}
|
|
41
|
+
if (paneTwoActive) {
|
|
42
|
+
return ':host{grid-template-columns:1fr 0}#slot{display:none}';
|
|
43
|
+
}
|
|
44
|
+
return ':host{grid-template-columns:1fr 0}#two{display:none}';
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
.html`
|
|
49
|
+
<slot id=slot mutli-pane={_isMultipane}></slot>
|
|
50
|
+
<slot id=two name=two mutli-pane={_isMultipane}></slot>
|
|
51
|
+
`
|
|
52
|
+
.css`
|
|
53
|
+
:host {
|
|
54
|
+
--mdw-pane__max-width: 1040px;
|
|
55
|
+
--mdw-pane__margin-inline: 16px;
|
|
56
|
+
--mdw-pane__padding-inline: max(var(--mdw-pane__margin-inline), calc((100% - var(--mdw-pane__max-width)) / 2));
|
|
57
|
+
--mdw-pane__shape__size: 0;
|
|
58
|
+
display: grid;
|
|
59
|
+
column-gap: var(--mdw-page__margin);
|
|
60
|
+
grid-auto-columns: 1fr;
|
|
61
|
+
grid-auto-flow: column;
|
|
62
|
+
|
|
63
|
+
block-size: 100%;
|
|
64
|
+
|
|
65
|
+
padding: 0;
|
|
66
|
+
|
|
67
|
+
font: var(--mdw-typescale__body-large__font);
|
|
68
|
+
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (min-width: 648px) {
|
|
72
|
+
:host {
|
|
73
|
+
--mdw-pane__margin-inline: 24px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (min-width: 728px) {
|
|
78
|
+
:host {
|
|
79
|
+
--mdw-pane__shape__size: var(--mdw-shape__large);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#slot[multi-pane] {
|
|
84
|
+
--mdw-pane__padding-inline: 24px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#two[mutli-pane] {
|
|
88
|
+
--mdw-pane__padding-inline: 0 24px;
|
|
89
|
+
position: sticky;
|
|
90
|
+
inset-block:0;
|
|
91
|
+
|
|
92
|
+
display: block;
|
|
93
|
+
|
|
94
|
+
overflow-y:auto;
|
|
95
|
+
|
|
96
|
+
block-size: 100vh;
|
|
97
|
+
block-size: 100dvh;
|
|
98
|
+
}
|
|
99
|
+
`
|
|
100
|
+
.overrides({
|
|
101
|
+
onResizeObserved(entry) {
|
|
102
|
+
this._lastComputedInlineSize = entry.borderBoxSize[0]?.inlineSize;
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
.autoRegister('mdw-page');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
2
|
+
|
|
3
|
+
import Box from './Box.js';
|
|
4
|
+
|
|
5
|
+
export default Box
|
|
6
|
+
.extend()
|
|
7
|
+
.mixin(ShapeMixin)
|
|
8
|
+
.css`
|
|
9
|
+
:host {
|
|
10
|
+
--mdw-shape__size: var(--mdw-pane__shape__size, 0);
|
|
11
|
+
--mdw-bg: var(--mdw-color__surface);
|
|
12
|
+
--mdw-ink: var(--mdw-color__on-surface);
|
|
13
|
+
background-color: rgb(var(--mdw-bg));
|
|
14
|
+
color: rgb(var(--mdw-ink));
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
`
|
|
18
|
+
.autoRegister('mdw-pane');
|
package/components/Popup.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import CustomElement from '../core/CustomElement.js';
|
|
2
|
+
import ElevationMixin from '../mixins/ElevationMixin.js';
|
|
2
3
|
import PopupMixin from '../mixins/PopupMixin.js';
|
|
3
4
|
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
4
|
-
import SurfaceMixin from '../mixins/SurfaceMixin.js';
|
|
5
5
|
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
6
6
|
|
|
7
7
|
export default CustomElement
|
|
8
8
|
.extend()
|
|
9
9
|
.mixin(ThemableMixin)
|
|
10
|
-
.mixin(
|
|
10
|
+
.mixin(ElevationMixin)
|
|
11
11
|
.mixin(ShapeMixin)
|
|
12
12
|
.mixin(PopupMixin)
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
const { shape, surface, dialog } = this.refs;
|
|
16
|
-
surface.append(shape);
|
|
17
|
-
dialog.prepend(surface);
|
|
18
|
-
},
|
|
13
|
+
.observe({
|
|
14
|
+
elevation: 'integer',
|
|
19
15
|
})
|
|
16
|
+
.css`
|
|
17
|
+
:host {
|
|
18
|
+
filter: var(--mdw-elevation__drop-shadow__0);
|
|
19
|
+
|
|
20
|
+
transition: filter 200ms;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(:where([elevation="1"])) { filter: var(--mdw-elevation__drop-shadow__1); }
|
|
24
|
+
:host(:where([elevation="2"])) { filter: var(--mdw-elevation__drop-shadow__2); }
|
|
25
|
+
:host(:where([elevation="3"])) { filter: var(--mdw-elevation__drop-shadow__3); }
|
|
26
|
+
:host(:where([elevation="4"])) { filter: var(--mdw-elevation__drop-shadow__4); }
|
|
27
|
+
:host(:where([elevation="5"])) { filter: var(--mdw-elevation__drop-shadow__5); }
|
|
28
|
+
`
|
|
20
29
|
.autoRegister('mdw-popup');
|
package/components/Radio.js
CHANGED
|
@@ -37,11 +37,8 @@ export default CustomElement
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
})
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
const { radio, rippleContainer, state } = this.refs;
|
|
43
|
-
radio.append(state, rippleContainer);
|
|
44
|
-
},
|
|
40
|
+
.recompose(({ refs: { radio, rippleContainer, state } }) => {
|
|
41
|
+
radio.append(state, rippleContainer);
|
|
45
42
|
})
|
|
46
43
|
.css`
|
|
47
44
|
/* stylelint-disable liberty/use-logical-spec */
|
package/components/RadioIcon.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './Shape.js';
|
|
2
|
+
|
|
1
3
|
import CustomElement from '../core/CustomElement.js';
|
|
2
4
|
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
3
5
|
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
@@ -22,13 +24,11 @@ export default CustomElement
|
|
|
22
24
|
},
|
|
23
25
|
})
|
|
24
26
|
.html`
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
outline.setAttribute('selected', '{selected}');
|
|
31
|
-
},
|
|
27
|
+
<mdw-shape id=inner-shape selected={selected}></div>
|
|
28
|
+
`
|
|
29
|
+
.recompose(({ refs: { outline } }) => {
|
|
30
|
+
outline.removeAttribute('mdw-if');
|
|
31
|
+
outline.setAttribute('selected', '{selected}');
|
|
32
32
|
})
|
|
33
33
|
.css`
|
|
34
34
|
/* https://m3.material.io/components/radio-button/specs */
|
|
@@ -52,16 +52,11 @@ export default CustomElement
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
#outline {
|
|
55
|
-
|
|
56
|
-
drop-shadow(1px 0px 0px var(--color))
|
|
57
|
-
drop-shadow(0px 1px 0px var(--color))
|
|
58
|
-
drop-shadow(-1px 0px 0px var(--color))
|
|
59
|
-
drop-shadow(0px -1px 0px var(--color))
|
|
60
|
-
;
|
|
55
|
+
border-width: 2px;
|
|
61
56
|
|
|
62
57
|
color: var(--color);
|
|
63
58
|
|
|
64
|
-
will-change:
|
|
59
|
+
will-change: color;
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
#inner-shape {
|
|
@@ -71,6 +66,7 @@ export default CustomElement
|
|
|
71
66
|
transform: scale(0);
|
|
72
67
|
|
|
73
68
|
background-color: var(--color);
|
|
69
|
+
border-radius: inherit;
|
|
74
70
|
|
|
75
71
|
transition: transform 200ms, background-color 100ms;
|
|
76
72
|
}
|
package/components/Ripple.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import CustomElement from '../core/CustomElement.js';
|
|
2
|
-
import {
|
|
2
|
+
import { ELEMENT_ANIMATION_TYPE } from '../core/customTypes.js';
|
|
3
3
|
|
|
4
4
|
export default CustomElement
|
|
5
5
|
.extend()
|
|
@@ -27,12 +27,14 @@ export default CustomElement
|
|
|
27
27
|
})
|
|
28
28
|
.observe({
|
|
29
29
|
_positionStyle: {
|
|
30
|
-
...
|
|
30
|
+
...ELEMENT_ANIMATION_TYPE,
|
|
31
31
|
get({ _positionX, _positionY, _radius }) {
|
|
32
|
+
// Skip if not measured
|
|
33
|
+
if (_radius == null) return null;
|
|
32
34
|
return {
|
|
33
35
|
styles: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
minHeight: `${_radius}px`,
|
|
37
|
+
minWidth: `${_radius}px`,
|
|
36
38
|
boxShadow: `0 0 calc(0.10 * ${_radius}px) calc(0.10 * ${_radius}px) currentColor`,
|
|
37
39
|
top: `calc(50% + ${_positionY}px)`,
|
|
38
40
|
left: `calc(50% + ${_positionX}px)`,
|
|
@@ -53,14 +55,16 @@ export default CustomElement
|
|
|
53
55
|
// Use offset to calculate parent size;
|
|
54
56
|
|
|
55
57
|
let hypotenuse = size;
|
|
56
|
-
const {
|
|
58
|
+
const { offsetParent } = this;
|
|
59
|
+
if (!offsetParent) return;
|
|
60
|
+
const { clientWidth: parentWidth, clientHeight: parentHeight } = offsetParent;
|
|
57
61
|
|
|
58
62
|
x ??= parentWidth / 2;
|
|
59
63
|
y ??= parentHeight / 2;
|
|
60
64
|
if (!hypotenuse) {
|
|
61
65
|
const width = (x >= parentWidth / 2) ? x : (parentWidth - x);
|
|
62
66
|
const height = (y >= parentHeight / 2) ? y : (parentHeight - y);
|
|
63
|
-
hypotenuse = 2 * Math.
|
|
67
|
+
hypotenuse = 2 * Math.hypot(width, height);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
// const expandDuration = Math.min(
|
|
@@ -99,7 +103,7 @@ export default CustomElement
|
|
|
99
103
|
animationend({ animationName }) {
|
|
100
104
|
switch (animationName) {
|
|
101
105
|
case 'ripple-fade-in':
|
|
102
|
-
this.
|
|
106
|
+
this.rippleState = 'filled';
|
|
103
107
|
break;
|
|
104
108
|
case 'ripple-fade-out':
|
|
105
109
|
this.handleRippleComplete();
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
|
|
2
|
+
|
|
3
|
+
import CustomElement from '../core/CustomElement.js';
|
|
4
|
+
import { ELEMENT_ANIMATION_TYPE } from '../core/customTypes.js';
|
|
5
|
+
import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
|
|
6
|
+
import ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';
|
|
7
|
+
|
|
8
|
+
export default CustomElement
|
|
9
|
+
.extend()
|
|
10
|
+
.mixin(ScrollListenerMixin)
|
|
11
|
+
.mixin(DelegatesFocusMixin)
|
|
12
|
+
.set({
|
|
13
|
+
/** @type {ResizeObserver} */
|
|
14
|
+
_bottomResizeObserver: null,
|
|
15
|
+
})
|
|
16
|
+
.html`
|
|
17
|
+
<slot id=start name=start></slot>
|
|
18
|
+
<div id=bottom>
|
|
19
|
+
<slot id=bottom-slot name=bottom></slot>
|
|
20
|
+
</div>
|
|
21
|
+
<div id=bottom-fixed>
|
|
22
|
+
<slot id=bottom-fixed-slot name=bottom-fixed></slot>
|
|
23
|
+
</div>
|
|
24
|
+
<slot id=slot></slot>
|
|
25
|
+
<slot id=end name=end></slot>
|
|
26
|
+
`
|
|
27
|
+
.observe({
|
|
28
|
+
_bottomHeight: { type: 'float', empty: 0 },
|
|
29
|
+
_bottomOffsetY: { type: 'float', empty: 0 },
|
|
30
|
+
_bottomDuration: { type: 'float', empty: 0 },
|
|
31
|
+
_bottomEasing: { empty: 'ease-in' },
|
|
32
|
+
})
|
|
33
|
+
.observe({
|
|
34
|
+
_sharedBottomStyle({ _bottomOffsetY, _bottomDuration, _bottomEasing, _bottomHeight }) {
|
|
35
|
+
if (!_bottomHeight) return null;
|
|
36
|
+
return {
|
|
37
|
+
styles: {
|
|
38
|
+
transform: `translateY(${_bottomOffsetY}px)`,
|
|
39
|
+
},
|
|
40
|
+
timing: {
|
|
41
|
+
duration: _bottomDuration,
|
|
42
|
+
easing: _bottomEasing,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
.observe({
|
|
48
|
+
_bottomSlotStyle: {
|
|
49
|
+
...ELEMENT_ANIMATION_TYPE,
|
|
50
|
+
get({ _sharedBottomStyle }) {
|
|
51
|
+
if (!_sharedBottomStyle) return null;
|
|
52
|
+
return {
|
|
53
|
+
target: 'bottom-slot',
|
|
54
|
+
..._sharedBottomStyle,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
_bottomFixedSlotStyle: {
|
|
59
|
+
...ELEMENT_ANIMATION_TYPE,
|
|
60
|
+
get({ _sharedBottomStyle }) {
|
|
61
|
+
if (!_sharedBottomStyle) return null;
|
|
62
|
+
return {
|
|
63
|
+
target: 'bottom-fixed-slot',
|
|
64
|
+
..._sharedBottomStyle,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
.on({
|
|
70
|
+
_scrollListenerPositionYChanged(oldValue, newValue) {
|
|
71
|
+
const delta = newValue - oldValue;
|
|
72
|
+
|
|
73
|
+
this._bottomDuration = 0;
|
|
74
|
+
// 0 if disabled or has scrolled upto element
|
|
75
|
+
// Valid range : 0 > x > (100% - required)
|
|
76
|
+
const bottomStartsAt = (document.documentElement.scrollHeight - window.innerHeight - 1);
|
|
77
|
+
const distanceFromBottom = bottomStartsAt - newValue;
|
|
78
|
+
const scrollVisible = this._bottomHeight - distanceFromBottom;
|
|
79
|
+
let mustIncludeSpace = 0;
|
|
80
|
+
if (scrollVisible > 0) {
|
|
81
|
+
mustIncludeSpace = scrollVisible;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this._bottomOffsetY = (newValue === 0 || distanceFromBottom < 0)
|
|
85
|
+
? 0
|
|
86
|
+
: Math.max(0, Math.min(
|
|
87
|
+
this._bottomOffsetY + delta,
|
|
88
|
+
this._bottomHeight - mustIncludeSpace,
|
|
89
|
+
));
|
|
90
|
+
},
|
|
91
|
+
_scrollListenerLastIdleChanged() {
|
|
92
|
+
const { _bottomHeight, _bottomOffsetY } = this;
|
|
93
|
+
const visibility = (_bottomHeight - _bottomOffsetY) / _bottomHeight;
|
|
94
|
+
if (visibility <= 0) return;
|
|
95
|
+
if (visibility >= 1) return;
|
|
96
|
+
if (visibility < 0.5) {
|
|
97
|
+
const bottomStartsAt = (document.documentElement.scrollHeight - window.innerHeight - 1);
|
|
98
|
+
const { _scrollListenerPositionY } = this;
|
|
99
|
+
const distanceFromBottom = bottomStartsAt - _scrollListenerPositionY;
|
|
100
|
+
const scrollVisible = _bottomHeight - distanceFromBottom;
|
|
101
|
+
|
|
102
|
+
if (_scrollListenerPositionY !== 0 && distanceFromBottom >= 0 && scrollVisible <= 0) {
|
|
103
|
+
this._bottomDuration = 200;
|
|
104
|
+
this._bottomEasing = 'ease-out';
|
|
105
|
+
this._bottomOffsetY = _bottomHeight;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Reveal all
|
|
111
|
+
this._bottomDuration = 250;
|
|
112
|
+
this._bottomEasing = 'ease-in';
|
|
113
|
+
this._bottomOffsetY = 0;
|
|
114
|
+
},
|
|
115
|
+
connected() {
|
|
116
|
+
// eslint-disable-next-line no-multi-assign
|
|
117
|
+
const observer = (this._bottomResizeObserver ??= new ResizeObserver((entries) => {
|
|
118
|
+
for (const { borderBoxSize } of entries) {
|
|
119
|
+
this._bottomHeight = borderBoxSize[0].blockSize;
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
122
|
+
observer.observe(this.refs.bottom);
|
|
123
|
+
this.startScrollListener(window);
|
|
124
|
+
},
|
|
125
|
+
disconnected() {
|
|
126
|
+
this._scrollListenerClear();
|
|
127
|
+
this._bottomResizeObserver.unobserve(this.refs.bottom);
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
.css`
|
|
131
|
+
:host {
|
|
132
|
+
position: relative;
|
|
133
|
+
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-template:
|
|
136
|
+
"start top end" auto
|
|
137
|
+
"start content end" minmax(auto, 1fr)
|
|
138
|
+
"start bottom end" auto
|
|
139
|
+
/ minmax(0px, auto) minmax(0px, 100%) minmax(0px, auto);
|
|
140
|
+
|
|
141
|
+
min-block-size: 100vh;
|
|
142
|
+
min-block-size: 100dvh;
|
|
143
|
+
|
|
144
|
+
font: var(--mdw-typescale__body-large__font);
|
|
145
|
+
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#start {
|
|
149
|
+
display: flex;
|
|
150
|
+
grid-area: start;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#slot {
|
|
154
|
+
display: block;
|
|
155
|
+
grid-area: content;
|
|
156
|
+
overflow-x: clip;
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#end {
|
|
161
|
+
display: none;
|
|
162
|
+
|
|
163
|
+
grid-area: end;
|
|
164
|
+
|
|
165
|
+
block-size: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
#bottom {
|
|
169
|
+
position: sticky;
|
|
170
|
+
inset-block-end: 0;
|
|
171
|
+
|
|
172
|
+
display: block;
|
|
173
|
+
grid-area: bottom;
|
|
174
|
+
overflow-y: hidden;
|
|
175
|
+
|
|
176
|
+
pointer-events: none;
|
|
177
|
+
|
|
178
|
+
z-index: 1;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
#bottom-slot {
|
|
182
|
+
position: sticky;
|
|
183
|
+
inset-block-end: 0;
|
|
184
|
+
|
|
185
|
+
display: flex;
|
|
186
|
+
/* Tab order flows from bottom-up */
|
|
187
|
+
flex-direction: column-reverse;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
#bottom-fixed {
|
|
191
|
+
position: sticky;
|
|
192
|
+
inset-block-end: 0;
|
|
193
|
+
|
|
194
|
+
display: block;
|
|
195
|
+
grid-area: bottom; /* Takes but does not dictate size of bottom area */
|
|
196
|
+
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
|
|
199
|
+
z-index: 2;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#bottom-fixed-slot {
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset-block-end: 100%;
|
|
205
|
+
|
|
206
|
+
display: block;
|
|
207
|
+
}
|
|
208
|
+
`
|
|
209
|
+
.autoRegister('mdw-root');
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import CustomElement from '../core/CustomElement.js';
|
|
2
|
+
|
|
3
|
+
export default CustomElement
|
|
4
|
+
.extend()
|
|
5
|
+
.observe({
|
|
6
|
+
hidden: 'boolean',
|
|
7
|
+
})
|
|
8
|
+
.html`<div id=scroll-blocker></div>`
|
|
9
|
+
.css`
|
|
10
|
+
:host {
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
|
|
14
|
+
display: block;
|
|
15
|
+
overflow: overlay;
|
|
16
|
+
|
|
17
|
+
overscroll-behavior: none;
|
|
18
|
+
overscroll-behavior: contain;
|
|
19
|
+
scrollbar-color: transparent transparent;
|
|
20
|
+
scrollbar-width: none;
|
|
21
|
+
|
|
22
|
+
cursor:pointer;
|
|
23
|
+
|
|
24
|
+
outline: none; /* Older Chromium Builds */
|
|
25
|
+
|
|
26
|
+
-webkit-tap-highlight-color: transparent;
|
|
27
|
+
|
|
28
|
+
opacity: 0;
|
|
29
|
+
|
|
30
|
+
z-index: 23;
|
|
31
|
+
|
|
32
|
+
background-color: rgb(var(--mdw-color__scrim));
|
|
33
|
+
|
|
34
|
+
animation: fade-in 200ms forwards ease-out;
|
|
35
|
+
will-change: opacity;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host::-webkit-scrollbar {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([hidden]) {
|
|
43
|
+
animation-name: fade-out;
|
|
44
|
+
animation-timing-function: ease-in;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([invisible]) {
|
|
48
|
+
background: transparent;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#scroll-blocker {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset-block-start: 0;
|
|
54
|
+
inset-inline-start: 0;
|
|
55
|
+
|
|
56
|
+
display: block;
|
|
57
|
+
|
|
58
|
+
block-size: 200%;
|
|
59
|
+
inline-size: 200%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes fade-in {
|
|
63
|
+
from {
|
|
64
|
+
opacity: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
to {
|
|
68
|
+
opacity: 0.38;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@keyframes fade-out {
|
|
73
|
+
from {
|
|
74
|
+
opacity: 0.38;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
to {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`
|
|
82
|
+
.events({
|
|
83
|
+
animationend() {
|
|
84
|
+
if (this.hidden) this.remove();
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
.autoRegister('mdw-scrim');
|
package/components/Search.js
CHANGED
|
@@ -29,28 +29,25 @@ export default TopAppBar
|
|
|
29
29
|
.css`
|
|
30
30
|
:host {
|
|
31
31
|
--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
|
-
}
|
|
32
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
33
|
+
inset-block-start: 8px;
|
|
43
34
|
|
|
44
|
-
#shape {
|
|
45
35
|
display: flex;
|
|
46
36
|
align-items: center;
|
|
47
37
|
gap: 16px;
|
|
48
38
|
|
|
39
|
+
margin-block: 16px;
|
|
40
|
+
|
|
49
41
|
padding-inline: 16px;
|
|
50
42
|
|
|
51
43
|
background-color: rgb(var(--mdw-bg));
|
|
52
44
|
}
|
|
53
45
|
|
|
46
|
+
#leading:not([slotted]),
|
|
47
|
+
#trailing:not([slotted]) {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
54
51
|
#input {
|
|
55
52
|
--mdw-state__hovered-opacity: 0;
|
|
56
53
|
flex: 1;
|
|
@@ -73,13 +70,8 @@ export default TopAppBar
|
|
|
73
70
|
},
|
|
74
71
|
},
|
|
75
72
|
})
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
companion.remove();
|
|
80
|
-
headline.replaceWith(input);
|
|
81
|
-
surface.removeAttribute('aria-labelledby');
|
|
82
|
-
},
|
|
73
|
+
.recompose(({ refs: { companion, headline, input } }) => {
|
|
74
|
+
companion.remove();
|
|
75
|
+
headline.replaceWith(input);
|
|
83
76
|
})
|
|
84
|
-
|
|
85
77
|
.autoRegister('mdw-search');
|