@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,193 @@
|
|
|
1
|
+
import { EVENT_HANDLER_TYPE } from '../core/customTypes.js';
|
|
2
|
+
import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
|
|
3
|
+
import HyperlinkMixin from '../mixins/HyperlinkMixin.js';
|
|
4
|
+
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
5
|
+
|
|
6
|
+
import Box from './Box.js';
|
|
7
|
+
import './Button.js';
|
|
8
|
+
import './Icon.js';
|
|
9
|
+
import './IconButton.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Input chips allow users to enter or edit information as a chip (tag-like).
|
|
13
|
+
* @see https://m3.material.io/components/chips/specs
|
|
14
|
+
*/
|
|
15
|
+
export default Box
|
|
16
|
+
.extend()
|
|
17
|
+
.mixin(ShapeMixin)
|
|
18
|
+
.mixin(DelegatesFocusMixin)
|
|
19
|
+
.mixin(HyperlinkMixin)
|
|
20
|
+
.observe({
|
|
21
|
+
/** Render the chip in avatar (larger) style. */
|
|
22
|
+
avatar: 'boolean',
|
|
23
|
+
|
|
24
|
+
/** Show a close action button inside the chip. */
|
|
25
|
+
closeButton: 'boolean',
|
|
26
|
+
|
|
27
|
+
/** Icon name to use for the close button (default: 'close'). */
|
|
28
|
+
closeIcon: { empty: 'close' },
|
|
29
|
+
|
|
30
|
+
/** Ink color used for the close icon (default: inherit). */
|
|
31
|
+
closeInk: { empty: 'inherit' },
|
|
32
|
+
|
|
33
|
+
/** Reflects the `readonly` attribute; prevents editing/closing when true. */
|
|
34
|
+
readOnly: { attr: 'readonly', type: 'boolean' },
|
|
35
|
+
|
|
36
|
+
/** Whether the chip is disabled. */
|
|
37
|
+
disabled: 'boolean',
|
|
38
|
+
|
|
39
|
+
/** Leading icon name for the chip. */
|
|
40
|
+
icon: 'string',
|
|
41
|
+
|
|
42
|
+
/** Ink color for the leading icon. */
|
|
43
|
+
iconInk: 'string',
|
|
44
|
+
|
|
45
|
+
/** Image `src` for an avatar or image-backed icon. */
|
|
46
|
+
src: 'string',
|
|
47
|
+
|
|
48
|
+
/** External SVG URL to render as the icon. */
|
|
49
|
+
svg: 'string',
|
|
50
|
+
|
|
51
|
+
/** SVG `viewBox` used for inline SVG rendering. */
|
|
52
|
+
viewBox: 'string',
|
|
53
|
+
|
|
54
|
+
/** SVG path data to render as the icon. */
|
|
55
|
+
svgPath: 'string',
|
|
56
|
+
|
|
57
|
+
/** Event handler/callback for the `close` event. */
|
|
58
|
+
onclose: EVENT_HANDLER_TYPE,
|
|
59
|
+
|
|
60
|
+
/** Selection state used by chip-selection patterns. */
|
|
61
|
+
selected: 'boolean',
|
|
62
|
+
})
|
|
63
|
+
.set({
|
|
64
|
+
outlined: true,
|
|
65
|
+
})
|
|
66
|
+
.expressions({
|
|
67
|
+
hasIcon({ icon, svg, src, svgPath } = this) {
|
|
68
|
+
return icon ?? svg ?? src ?? svgPath;
|
|
69
|
+
},
|
|
70
|
+
showCloseIcon({ disabled, readOnly, closeButton }) {
|
|
71
|
+
return closeButton && !disabled && !readOnly;
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
.html`
|
|
75
|
+
<mdw-button
|
|
76
|
+
role=none
|
|
77
|
+
tabindex=-1
|
|
78
|
+
href={href}
|
|
79
|
+
target={target}
|
|
80
|
+
download={download}
|
|
81
|
+
ping={ping}
|
|
82
|
+
rel={rel}
|
|
83
|
+
hreflang={hreflang}
|
|
84
|
+
referrerpolicy={referrerPolicy} id=action disabled={disabled}></mdw-button>
|
|
85
|
+
<mdw-icon mdw-if={hasIcon} id=icon ink={iconInk} disabled={disabled}
|
|
86
|
+
outlined={outlined} variation={iconVariation} aria-hidden=true svg={svg} src={src}
|
|
87
|
+
svg-path={svgPath} view-box={viewBox} icon={icon} avatar={avatar}></mdw-icon>
|
|
88
|
+
<mdw-icon-button role=none disabled={disabled} tabindex=-1 mdw-if={showCloseIcon} id=close class=button icon={closeIcon} ink={closeInk}>Close</mdw-icon-button>
|
|
89
|
+
`
|
|
90
|
+
.css`
|
|
91
|
+
/* https://m3.material.io/components/chips/specs */
|
|
92
|
+
|
|
93
|
+
:host {
|
|
94
|
+
--mdw-shape__size: 8px;
|
|
95
|
+
--mdw-ink: var(--mdw-color__on-surface);
|
|
96
|
+
position: relative;
|
|
97
|
+
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
gap: 8px;
|
|
102
|
+
|
|
103
|
+
padding-block: calc(4px + (var(--mdw-density) * 2px));
|
|
104
|
+
padding-inline: calc(12px + (var(--mdw-density) * 2px));
|
|
105
|
+
|
|
106
|
+
color: rgb(var(--mdw-ink));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host(:where([icon])) {
|
|
110
|
+
padding-inline-start: calc(8px + (var(--mdw-density) * 2px));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host(:where([avatar])) {
|
|
114
|
+
padding-inline-start: calc(4px + (var(--mdw-density) * 2px));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host(:where([close-button]:not([disabled]):not([readonly]))) {
|
|
118
|
+
padding-inline-end: calc(8px + 18px + 8px + (var(--mdw-density) * 2px));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
#action {
|
|
122
|
+
--mdw-shape__size: inherit;
|
|
123
|
+
position: absolute;
|
|
124
|
+
inset: 0;
|
|
125
|
+
|
|
126
|
+
padding: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#close {
|
|
130
|
+
position: absolute;
|
|
131
|
+
inset-inline-end: calc(8px - 3px);
|
|
132
|
+
|
|
133
|
+
padding: 3px; /* Pad to 24px */
|
|
134
|
+
|
|
135
|
+
font-size: 18px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#icon {
|
|
139
|
+
font-size: 18px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
#icon[avatar] {
|
|
143
|
+
font-size: 24px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
#close::part(control) {
|
|
147
|
+
min-inline-size: calc(18px + (2 * 8px)); /* Reach up to edge of chip */
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
#outline {
|
|
151
|
+
--mdw-ink: rgb(var(--mdw-color__on-surface-variant));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
#outline:is([ink],[color],[disabled]) {
|
|
155
|
+
/* stylelint-disable-next-line rule-selector-property-disallowed-list */
|
|
156
|
+
--mdw-ink: inherit;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host([disabled]) {
|
|
160
|
+
color: rgba(var(--mdw-color__on-surface), 0.38);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
`
|
|
164
|
+
.childEvents({
|
|
165
|
+
action: {
|
|
166
|
+
click() {
|
|
167
|
+
this.dispatchEvent(new Event('action'));
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
close: {
|
|
171
|
+
click() {
|
|
172
|
+
this.dispatchEvent(new Event('close'));
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
})
|
|
176
|
+
.on({
|
|
177
|
+
selectedChanged(previous, current) {
|
|
178
|
+
const action = /** @type {InstanceType<typeof import('./Button.js').default>} */ (this.refs.action);
|
|
179
|
+
action._focused = current;
|
|
180
|
+
},
|
|
181
|
+
})
|
|
182
|
+
.recompose(({ refs: { anchor, slot, icon, outline } }) => {
|
|
183
|
+
icon.after(slot);
|
|
184
|
+
anchor.remove();
|
|
185
|
+
slot.setAttribute('disabled', '{disabled}');
|
|
186
|
+
slot.removeAttribute('ink');
|
|
187
|
+
slot.removeAttribute('color');
|
|
188
|
+
outline.removeAttribute('mdw-if');
|
|
189
|
+
outline.setAttribute('ink', '{ink}');
|
|
190
|
+
outline.setAttribute('color', '{color}');
|
|
191
|
+
outline.setAttribute('disabled', '{disabled}');
|
|
192
|
+
})
|
|
193
|
+
.autoRegister('mdw-input-chip');
|
package/components/Label.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import TypographyMixin from '../mixins/TypographyMixin.js';
|
|
2
|
+
|
|
1
3
|
import Box from './Box.js';
|
|
2
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Material Design Type scale: Label.
|
|
7
|
+
* @see https://m3.material.io/styles/typography/type-scale-tokens
|
|
8
|
+
*/
|
|
3
9
|
export default Box
|
|
4
10
|
.extend()
|
|
11
|
+
.mixin(TypographyMixin)
|
|
5
12
|
.css`
|
|
6
13
|
:host {
|
|
7
14
|
font: var(--mdw-typescale__label-large__font);
|
package/components/List.js
CHANGED
|
@@ -5,26 +5,32 @@ import Box from './Box.js';
|
|
|
5
5
|
|
|
6
6
|
/** @typedef {'compact'} DeprecatedHTMLMenuElementProperties */
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Lists present a single column of related content, such as options or navigation.
|
|
10
|
+
* @see https://m3.material.io/components/lists/specs
|
|
11
|
+
*/
|
|
8
12
|
export default Box
|
|
9
13
|
.extend()
|
|
10
14
|
.mixin(DensityMixin)
|
|
11
15
|
.mixin(AriaReflectorMixin)
|
|
12
16
|
.set({
|
|
17
|
+
/** ARIA role applied to the host element (default: 'list'). */
|
|
13
18
|
_ariaRole: 'list',
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Visual color token for list surfaces. Default is `surface` to match
|
|
22
|
+
* Material surface theming.
|
|
23
|
+
*/
|
|
14
24
|
color: { empty: 'surface' },
|
|
15
25
|
})
|
|
16
26
|
.css`
|
|
17
27
|
/* https://m3.material.io/components/lists/specs */
|
|
18
28
|
|
|
19
29
|
:host {
|
|
20
|
-
|
|
21
|
-
--mdw-ink: var(--mdw-color__on-surface);
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
30
|
+
display: block;
|
|
24
31
|
|
|
25
32
|
padding-block: 8px;
|
|
26
33
|
|
|
27
|
-
background-color: rgb(var(--mdw-bg));
|
|
28
34
|
color: rgb(var(--mdw-ink));
|
|
29
35
|
}
|
|
30
36
|
|
package/components/ListItem.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
2
2
|
|
|
3
|
+
import './Box.js';
|
|
3
4
|
import './CheckboxIcon.js';
|
|
4
5
|
import './RadioIcon.js';
|
|
5
6
|
import './Divider.js';
|
|
@@ -7,44 +8,98 @@ import './Icon.js';
|
|
|
7
8
|
|
|
8
9
|
import CustomElement from '../core/CustomElement.js';
|
|
9
10
|
import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';
|
|
11
|
+
import HyperlinkMixin from '../mixins/HyperlinkMixin.js';
|
|
10
12
|
import RippleMixin from '../mixins/RippleMixin.js';
|
|
11
13
|
import StateMixin from '../mixins/StateMixin.js';
|
|
12
14
|
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
13
15
|
|
|
16
|
+
/**
|
|
17
|
+
* List item representing a single row in a list; supports leading/trailing
|
|
18
|
+
* content, selection, and accessibility features.
|
|
19
|
+
* @see https://m3.material.io/components/lists/specs
|
|
20
|
+
*/
|
|
14
21
|
export default CustomElement
|
|
15
22
|
.extend()
|
|
16
23
|
.mixin(ThemableMixin)
|
|
17
24
|
.mixin(StateMixin)
|
|
18
25
|
.mixin(RippleMixin)
|
|
19
26
|
.mixin(AriaReflectorMixin)
|
|
27
|
+
.mixin(HyperlinkMixin)
|
|
20
28
|
.set({
|
|
29
|
+
/** ARIA role applied to the host element (default: 'listitem'). */
|
|
21
30
|
_ariaRole: 'listitem',
|
|
22
|
-
|
|
31
|
+
|
|
32
|
+
/** When true, draw the Material state layer for interactive feedback. */
|
|
23
33
|
stateLayer: true,
|
|
24
34
|
})
|
|
25
35
|
.observe({
|
|
36
|
+
/** Leading slot content or shorthand string. */
|
|
26
37
|
leading: 'string',
|
|
38
|
+
|
|
39
|
+
/** Avatar label or shorthand content for a leading avatar. */
|
|
27
40
|
avatar: 'string',
|
|
41
|
+
|
|
42
|
+
/** Color token used for the avatar container (default: primary-container). */
|
|
28
43
|
avatarColor: { value: 'primary-container' },
|
|
44
|
+
|
|
45
|
+
/** Image source for the avatar. */
|
|
29
46
|
avatarSrc: 'string',
|
|
47
|
+
|
|
48
|
+
/** Image source URL for a leading image in the list item. */
|
|
30
49
|
src: 'string',
|
|
50
|
+
|
|
51
|
+
/** Alt text for the leading image. */
|
|
31
52
|
alt: 'string',
|
|
53
|
+
|
|
54
|
+
/** Icon name for a leading icon. */
|
|
32
55
|
icon: 'string',
|
|
33
|
-
|
|
56
|
+
|
|
57
|
+
/** Ink/color token used for the leading icon. */
|
|
34
58
|
iconInk: 'string',
|
|
59
|
+
|
|
60
|
+
/** External image/SVG source for the leading icon. */
|
|
35
61
|
iconSrc: 'string',
|
|
62
|
+
|
|
63
|
+
/** Icon variation (e.g., 'filled'). */
|
|
64
|
+
iconVariation: 'string',
|
|
65
|
+
|
|
66
|
+
/** Checkbox shorthand name or placement class for a selectable leading checkbox. */
|
|
36
67
|
checkbox: 'string',
|
|
68
|
+
|
|
69
|
+
/** Radio shorthand name or placement class for a selectable leading radio. */
|
|
37
70
|
radio: 'string',
|
|
71
|
+
|
|
72
|
+
/** Selection color token used when item is selected (default: primary). */
|
|
38
73
|
selectionColor: { value: 'primary' },
|
|
74
|
+
|
|
75
|
+
/** Selection state for the item. */
|
|
39
76
|
selected: 'boolean',
|
|
77
|
+
|
|
78
|
+
/** Supporting text (secondary line) for the list item. */
|
|
40
79
|
supporting: 'string',
|
|
80
|
+
|
|
81
|
+
/** Trailing text slot or shorthand. */
|
|
41
82
|
trailing: 'string',
|
|
83
|
+
|
|
84
|
+
/** Trailing icon name. */
|
|
42
85
|
trailingIcon: 'string',
|
|
86
|
+
|
|
87
|
+
/** Ink/color token for the trailing icon. */
|
|
43
88
|
trailingIconInk: 'string',
|
|
89
|
+
|
|
90
|
+
/** External image/SVG source for the trailing icon. */
|
|
44
91
|
trailingIconSrc: 'string',
|
|
45
|
-
|
|
92
|
+
|
|
93
|
+
/** Divider style identifier (e.g., 'inset'). */
|
|
94
|
+
divider: 'string',
|
|
95
|
+
|
|
96
|
+
/** If true, indicates the list item contains video content and adjusts layout. */
|
|
46
97
|
video: 'boolean',
|
|
98
|
+
|
|
99
|
+
/** Number of text lines the item should reserve for content (integer). */
|
|
47
100
|
lines: 'integer',
|
|
101
|
+
|
|
102
|
+
/** Internal flag set when supporting content is provided via slot. */
|
|
48
103
|
_supportingSlotted: 'boolean',
|
|
49
104
|
})
|
|
50
105
|
.observe({
|
|
@@ -67,33 +122,36 @@ export default CustomElement
|
|
|
67
122
|
radioClass() {
|
|
68
123
|
return this.radio || 'leading';
|
|
69
124
|
},
|
|
125
|
+
computedIconVariation({ iconVariation }) {
|
|
126
|
+
return iconVariation ?? 'filled';
|
|
127
|
+
},
|
|
70
128
|
})
|
|
71
129
|
.html`
|
|
72
|
-
<a id=anchor mdw-if={href} href={href} disabled={disabledState} aria-labelledby=content></a>
|
|
73
130
|
<mdw-checkbox-icon id=checkbox mdw-if={checkbox} aria-hidden=true class={checkboxClass} color={selectionColor} disabled={disabledState} icon=check selected={selected}></mdw-checkbox-icon>
|
|
74
131
|
<mdw-radio-icon id=radio mdw-if={radio} aria-hidden=true class={radioClass} disabled={disabledState} ink={selectionColor} selected={selected}></mdw-radio-icon>
|
|
75
|
-
<mdw-box mdw-if={avatar} id=avatar color={avatarColor} type-style=title-medium src={AvatarSrc}
|
|
132
|
+
<mdw-box mdw-if={avatar} id=avatar color={avatarColor} x=center y=center type-style=title-medium src={AvatarSrc}
|
|
76
133
|
aria-hidden=true>{avatar}</mdw-box>
|
|
77
|
-
<mdw-icon mdw-if={icon} id=icon ink={iconInk} src={iconSrc} aria-hidden=true
|
|
134
|
+
<mdw-icon mdw-if={icon} id=icon ink={iconInk} src={iconSrc} aria-hidden=true icon={icon} variation={computedIconVariation}></mdw-icon>
|
|
78
135
|
<img id=img mdw-if={src} src={src} alt={alt} video={video} />
|
|
79
136
|
<slot name=leading>{leading}</slot>
|
|
80
137
|
<div id=content has-supporting={hasSupporting} lines={lines}>
|
|
81
138
|
<slot id=slot></slot>
|
|
82
139
|
<slot id=supporting name=supporting class=text lines={lines}>{supporting}</slot>
|
|
83
140
|
</div>
|
|
84
|
-
<mdw-icon mdw-if={trailingIcon} id=trailing-icon ink={trailingIconInk} src={trailingIconSrc} aria-hidden=true
|
|
141
|
+
<mdw-icon mdw-if={trailingIcon} id=trailing-icon ink={trailingIconInk} src={trailingIconSrc} aria-hidden=true icon={trailingIcon}></mdw-icon>
|
|
85
142
|
<slot id=trailing name=trailing role=note>{trailing}</slot>
|
|
86
|
-
<mdw-divider mdw-if={divider} id=divider
|
|
143
|
+
<mdw-divider mdw-if={divider} id=divider divider={divider}></mdw-divider>
|
|
87
144
|
`
|
|
145
|
+
.recompose(({ refs: { state, rippleContainer, anchor } }) => {
|
|
146
|
+
anchor.setAttribute('mdw-if', '{href}');
|
|
147
|
+
anchor.setAttribute('aria-labelledby', 'content');
|
|
148
|
+
anchor.append(
|
|
149
|
+
state,
|
|
150
|
+
rippleContainer,
|
|
151
|
+
);
|
|
152
|
+
state.setAttribute('state-disabled', 'focus hover');
|
|
153
|
+
})
|
|
88
154
|
.on({
|
|
89
|
-
composed() {
|
|
90
|
-
const { state, rippleContainer, anchor } = this.refs;
|
|
91
|
-
anchor.append(
|
|
92
|
-
state,
|
|
93
|
-
rippleContainer,
|
|
94
|
-
);
|
|
95
|
-
state.setAttribute('state-disabled', 'focus hover');
|
|
96
|
-
},
|
|
97
155
|
disabledStateChanged(oldValue, newValue) {
|
|
98
156
|
this.updateAriaProperty('ariaDisabled', newValue ? 'true' : 'false');
|
|
99
157
|
},
|
|
@@ -111,7 +169,7 @@ export default CustomElement
|
|
|
111
169
|
|
|
112
170
|
border: none;
|
|
113
171
|
padding-block: 8px;
|
|
114
|
-
padding-inline: 16px
|
|
172
|
+
padding-inline: 16px;
|
|
115
173
|
|
|
116
174
|
cursor: auto;
|
|
117
175
|
|
|
@@ -122,6 +180,20 @@ export default CustomElement
|
|
|
122
180
|
text-decoration: none;
|
|
123
181
|
}
|
|
124
182
|
|
|
183
|
+
:host(:where([color])) {
|
|
184
|
+
background-color: rgb(var(--mdw-bg));
|
|
185
|
+
color: rgb(var(--mdw-ink));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host(:is([color="none"],[color="transparent"])) {
|
|
189
|
+
background-color: transparent;
|
|
190
|
+
color: inherit;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([ink]) {
|
|
194
|
+
color: rgb(var(--mdw-ink));
|
|
195
|
+
}
|
|
196
|
+
|
|
125
197
|
:host([href]) {
|
|
126
198
|
cursor: pointer;
|
|
127
199
|
}
|
|
@@ -180,6 +252,7 @@ export default CustomElement
|
|
|
180
252
|
#divider {
|
|
181
253
|
position: absolute;
|
|
182
254
|
inset-block-end: 0;
|
|
255
|
+
inset-inline: 0;
|
|
183
256
|
|
|
184
257
|
display: block;
|
|
185
258
|
|
|
@@ -215,8 +288,8 @@ export default CustomElement
|
|
|
215
288
|
#trailing {
|
|
216
289
|
color: var(--mdw-color__on-surface-variant);
|
|
217
290
|
|
|
218
|
-
font: var(--mdw-
|
|
219
|
-
letter-spacing: var(--mdw-
|
|
291
|
+
font: var(--mdw-typescale__label-small__font);
|
|
292
|
+
letter-spacing: var(--mdw-typescale__label-small__letter-spacing);
|
|
220
293
|
}
|
|
221
294
|
|
|
222
295
|
#slot, #supporting {
|
|
@@ -280,10 +353,6 @@ export default CustomElement
|
|
|
280
353
|
}
|
|
281
354
|
|
|
282
355
|
#avatar {
|
|
283
|
-
display: flex;
|
|
284
|
-
align-items: center;
|
|
285
|
-
justify-content: center;
|
|
286
|
-
|
|
287
356
|
block-size: 40px;
|
|
288
357
|
inline-size: 40px;
|
|
289
358
|
|