@m3e/core 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/NOTICE.md +8 -0
- package/README.md +59 -0
- package/cem.config.mjs +16 -0
- package/demo/index.html +58 -0
- package/dist/a11y.js +1431 -0
- package/dist/a11y.js.map +1 -0
- package/dist/a11y.min.js +87 -0
- package/dist/a11y.min.js.map +1 -0
- package/dist/anchoring.js +1748 -0
- package/dist/anchoring.js.map +1 -0
- package/dist/anchoring.min.js +7 -0
- package/dist/anchoring.min.js.map +1 -0
- package/dist/bidi.js +106 -0
- package/dist/bidi.js.map +1 -0
- package/dist/bidi.min.js +16 -0
- package/dist/bidi.min.js.map +1 -0
- package/dist/css-custom-data.json +257 -0
- package/dist/custom-elements.json +13504 -0
- package/dist/html-custom-data.json +199 -0
- package/dist/index.js +4342 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +520 -0
- package/dist/index.min.js.map +1 -0
- package/dist/layout.js +64 -0
- package/dist/layout.js.map +1 -0
- package/dist/layout.min.js +15 -0
- package/dist/layout.min.js.map +1 -0
- package/dist/platform.js +56 -0
- package/dist/platform.js.map +1 -0
- package/dist/platform.min.js +15 -0
- package/dist/platform.min.js.map +1 -0
- package/dist/src/a11y/AriaDescriber.d.ts +31 -0
- package/dist/src/a11y/AriaDescriber.d.ts.map +1 -0
- package/dist/src/a11y/FocusTrapElement.d.ts +25 -0
- package/dist/src/a11y/FocusTrapElement.d.ts.map +1 -0
- package/dist/src/a11y/InteractivityChecker.d.ts +22 -0
- package/dist/src/a11y/InteractivityChecker.d.ts.map +1 -0
- package/dist/src/a11y/LiveAnnouncer.d.ts +56 -0
- package/dist/src/a11y/LiveAnnouncer.d.ts.map +1 -0
- package/dist/src/a11y/aria-reference.d.ts +30 -0
- package/dist/src/a11y/aria-reference.d.ts.map +1 -0
- package/dist/src/a11y/index.d.ts +8 -0
- package/dist/src/a11y/index.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/KeyCode.d.ts +118 -0
- package/dist/src/a11y/keycodes/KeyCode.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/ModifierKeys.d.ts +5 -0
- package/dist/src/a11y/keycodes/ModifierKeys.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/getKeyCode.d.ts +7 -0
- package/dist/src/a11y/keycodes/getKeyCode.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/hasModifierKey.d.ts +9 -0
- package/dist/src/a11y/keycodes/hasModifierKey.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/index.d.ts +6 -0
- package/dist/src/a11y/keycodes/index.d.ts.map +1 -0
- package/dist/src/a11y/keycodes/isModifierAllowed.d.ts +9 -0
- package/dist/src/a11y/keycodes/isModifierAllowed.d.ts.map +1 -0
- package/dist/src/a11y/list-key/FocusKeyManager.d.ts +17 -0
- package/dist/src/a11y/list-key/FocusKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/ListKeyManager.d.ts +114 -0
- package/dist/src/a11y/list-key/ListKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/ListManager.d.ts +37 -0
- package/dist/src/a11y/list-key/ListManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/RadioKeyManager.d.ts +20 -0
- package/dist/src/a11y/list-key/RadioKeyManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts +22 -0
- package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/SelectionManager.d.ts +46 -0
- package/dist/src/a11y/list-key/SelectionManager.d.ts.map +1 -0
- package/dist/src/a11y/list-key/Typeahead.d.ts +64 -0
- package/dist/src/a11y/list-key/Typeahead.d.ts.map +1 -0
- package/dist/src/a11y/list-key/index.d.ts +8 -0
- package/dist/src/a11y/list-key/index.d.ts.map +1 -0
- package/dist/src/a11y/visuallyHide.d.ts +6 -0
- package/dist/src/a11y/visuallyHide.d.ts.map +1 -0
- package/dist/src/anchoring/AnchorOptions.d.ts +15 -0
- package/dist/src/anchoring/AnchorOptions.d.ts.map +1 -0
- package/dist/src/anchoring/AnchorPosition.d.ts +3 -0
- package/dist/src/anchoring/AnchorPosition.d.ts.map +1 -0
- package/dist/src/anchoring/index.d.ts +4 -0
- package/dist/src/anchoring/index.d.ts.map +1 -0
- package/dist/src/anchoring/positionAnchor.d.ts +12 -0
- package/dist/src/anchoring/positionAnchor.d.ts.map +1 -0
- package/dist/src/bidi/Directionality.d.ts +27 -0
- package/dist/src/bidi/Directionality.d.ts.map +1 -0
- package/dist/src/bidi/index.d.ts +2 -0
- package/dist/src/bidi/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/layout/Breakpoint.d.ts +26 -0
- package/dist/src/layout/Breakpoint.d.ts.map +1 -0
- package/dist/src/layout/BreakpointObserver.d.ts +18 -0
- package/dist/src/layout/BreakpointObserver.d.ts.map +1 -0
- package/dist/src/layout/index.d.ts +3 -0
- package/dist/src/layout/index.d.ts.map +1 -0
- package/dist/src/platform/Platform.d.ts +34 -0
- package/dist/src/platform/Platform.d.ts.map +1 -0
- package/dist/src/platform/index.d.ts +2 -0
- package/dist/src/platform/index.d.ts.map +1 -0
- package/dist/src/shared/controllers/FocusController.d.ts +30 -0
- package/dist/src/shared/controllers/FocusController.d.ts.map +1 -0
- package/dist/src/shared/controllers/HoverController.d.ts +40 -0
- package/dist/src/shared/controllers/HoverController.d.ts.map +1 -0
- package/dist/src/shared/controllers/IntersectionController.d.ts +40 -0
- package/dist/src/shared/controllers/IntersectionController.d.ts.map +1 -0
- package/dist/src/shared/controllers/LongPressController.d.ts +32 -0
- package/dist/src/shared/controllers/LongPressController.d.ts.map +1 -0
- package/dist/src/shared/controllers/MonitorControllerBase.d.ts +62 -0
- package/dist/src/shared/controllers/MonitorControllerBase.d.ts.map +1 -0
- package/dist/src/shared/controllers/MutationController.d.ts +37 -0
- package/dist/src/shared/controllers/MutationController.d.ts.map +1 -0
- package/dist/src/shared/controllers/PressedController.d.ts +45 -0
- package/dist/src/shared/controllers/PressedController.d.ts.map +1 -0
- package/dist/src/shared/controllers/ResizeController.d.ts +40 -0
- package/dist/src/shared/controllers/ResizeController.d.ts.map +1 -0
- package/dist/src/shared/controllers/ScrollController.d.ts +34 -0
- package/dist/src/shared/controllers/ScrollController.d.ts.map +1 -0
- package/dist/src/shared/controllers/index.d.ts +9 -0
- package/dist/src/shared/controllers/index.d.ts.map +1 -0
- package/dist/src/shared/decorators/debounce.d.ts +7 -0
- package/dist/src/shared/decorators/debounce.d.ts.map +1 -0
- package/dist/src/shared/decorators/index.d.ts +2 -0
- package/dist/src/shared/decorators/index.d.ts.map +1 -0
- package/dist/src/shared/directives/index.d.ts +2 -0
- package/dist/src/shared/directives/index.d.ts.map +1 -0
- package/dist/src/shared/directives/safeStyleMap.d.ts +44 -0
- package/dist/src/shared/directives/safeStyleMap.d.ts.map +1 -0
- package/dist/src/shared/index.d.ts +8 -0
- package/dist/src/shared/index.d.ts.map +1 -0
- package/dist/src/shared/mixins/AttachInternals.d.ts +24 -0
- package/dist/src/shared/mixins/AttachInternals.d.ts.map +1 -0
- package/dist/src/shared/mixins/Checked.d.ts +24 -0
- package/dist/src/shared/mixins/Checked.d.ts.map +1 -0
- package/dist/src/shared/mixins/CheckedIndeterminate.d.ts +25 -0
- package/dist/src/shared/mixins/CheckedIndeterminate.d.ts.map +1 -0
- package/dist/src/shared/mixins/CheckedOrSelected.d.ts +23 -0
- package/dist/src/shared/mixins/CheckedOrSelected.d.ts.map +1 -0
- package/dist/src/shared/mixins/ConstraintValidation.d.ts +48 -0
- package/dist/src/shared/mixins/ConstraintValidation.d.ts.map +1 -0
- package/dist/src/shared/mixins/Constructor.d.ts +3 -0
- package/dist/src/shared/mixins/Constructor.d.ts.map +1 -0
- package/dist/src/shared/mixins/Dirty.d.ts +27 -0
- package/dist/src/shared/mixins/Dirty.d.ts.map +1 -0
- package/dist/src/shared/mixins/Disabled.d.ts +25 -0
- package/dist/src/shared/mixins/Disabled.d.ts.map +1 -0
- package/dist/src/shared/mixins/DisabledInteractive.d.ts +25 -0
- package/dist/src/shared/mixins/DisabledInteractive.d.ts.map +1 -0
- package/dist/src/shared/mixins/EventAttribute.d.ts +11 -0
- package/dist/src/shared/mixins/EventAttribute.d.ts.map +1 -0
- package/dist/src/shared/mixins/Focusable.d.ts +11 -0
- package/dist/src/shared/mixins/Focusable.d.ts.map +1 -0
- package/dist/src/shared/mixins/FormAssociated.d.ts +34 -0
- package/dist/src/shared/mixins/FormAssociated.d.ts.map +1 -0
- package/dist/src/shared/mixins/FormSubmitter.d.ts +31 -0
- package/dist/src/shared/mixins/FormSubmitter.d.ts.map +1 -0
- package/dist/src/shared/mixins/HtmlFor.d.ts +30 -0
- package/dist/src/shared/mixins/HtmlFor.d.ts.map +1 -0
- package/dist/src/shared/mixins/KeyboardClick.d.ts +11 -0
- package/dist/src/shared/mixins/KeyboardClick.d.ts.map +1 -0
- package/dist/src/shared/mixins/Labelled.d.ts +22 -0
- package/dist/src/shared/mixins/Labelled.d.ts.map +1 -0
- package/dist/src/shared/mixins/LinkButton.d.ts +36 -0
- package/dist/src/shared/mixins/LinkButton.d.ts.map +1 -0
- package/dist/src/shared/mixins/ReadOnly.d.ts +25 -0
- package/dist/src/shared/mixins/ReadOnly.d.ts.map +1 -0
- package/dist/src/shared/mixins/Required.d.ts +26 -0
- package/dist/src/shared/mixins/Required.d.ts.map +1 -0
- package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts +21 -0
- package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts.map +1 -0
- package/dist/src/shared/mixins/Role.d.ts +13 -0
- package/dist/src/shared/mixins/Role.d.ts.map +1 -0
- package/dist/src/shared/mixins/Selected.d.ts +24 -0
- package/dist/src/shared/mixins/Selected.d.ts.map +1 -0
- package/dist/src/shared/mixins/Touched.d.ts +27 -0
- package/dist/src/shared/mixins/Touched.d.ts.map +1 -0
- package/dist/src/shared/mixins/Vertical.d.ts +24 -0
- package/dist/src/shared/mixins/Vertical.d.ts.map +1 -0
- package/dist/src/shared/mixins/hasKeys.d.ts +9 -0
- package/dist/src/shared/mixins/hasKeys.d.ts.map +1 -0
- package/dist/src/shared/mixins/index.d.ts +25 -0
- package/dist/src/shared/mixins/index.d.ts.map +1 -0
- package/dist/src/shared/primitives/CollapsibleElement.d.ts +58 -0
- package/dist/src/shared/primitives/CollapsibleElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationElement.d.ts +88 -0
- package/dist/src/shared/primitives/ElevationElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationLevel.d.ts +3 -0
- package/dist/src/shared/primitives/ElevationLevel.d.ts.map +1 -0
- package/dist/src/shared/primitives/ElevationToken.d.ts +15 -0
- package/dist/src/shared/primitives/ElevationToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/FocusRingElement.d.ts +78 -0
- package/dist/src/shared/primitives/FocusRingElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/FocusRingToken.d.ts +17 -0
- package/dist/src/shared/primitives/FocusRingToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts +50 -0
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts +41 -0
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/RippleElement.d.ts +110 -0
- package/dist/src/shared/primitives/RippleElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/RippleToken.d.ts +12 -0
- package/dist/src/shared/primitives/RippleToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts +64 -0
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/ScrollDividers.d.ts +3 -0
- package/dist/src/shared/primitives/ScrollDividers.d.ts.map +1 -0
- package/dist/src/shared/primitives/SlideElement.d.ts +48 -0
- package/dist/src/shared/primitives/SlideElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/StateLayerElement.d.ts +77 -0
- package/dist/src/shared/primitives/StateLayerElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/StateLayerToken.d.ts +13 -0
- package/dist/src/shared/primitives/StateLayerToken.d.ts.map +1 -0
- package/dist/src/shared/primitives/TextOverflowElement.d.ts +39 -0
- package/dist/src/shared/primitives/TextOverflowElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/index.d.ts +13 -0
- package/dist/src/shared/primitives/index.d.ts.map +1 -0
- package/dist/src/shared/tokens/ColorToken.d.ts +96 -0
- package/dist/src/shared/tokens/ColorToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/DensityToken.d.ts +15 -0
- package/dist/src/shared/tokens/DensityToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/DesignToken.d.ts +366 -0
- package/dist/src/shared/tokens/DesignToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ElevationToken.d.ts +16 -0
- package/dist/src/shared/tokens/ElevationToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/MotionToken.d.ts +69 -0
- package/dist/src/shared/tokens/MotionToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ScrollbarToken.d.ts +10 -0
- package/dist/src/shared/tokens/ScrollbarToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/ShapeToken.d.ts +79 -0
- package/dist/src/shared/tokens/ShapeToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/StateToken.d.ts +10 -0
- package/dist/src/shared/tokens/StateToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/TypescaleToken.d.ts +220 -0
- package/dist/src/shared/tokens/TypescaleToken.d.ts.map +1 -0
- package/dist/src/shared/tokens/index.d.ts +2 -0
- package/dist/src/shared/tokens/index.d.ts.map +1 -0
- package/dist/src/shared/utils/getTextContent.d.ts +8 -0
- package/dist/src/shared/utils/getTextContent.d.ts.map +1 -0
- package/dist/src/shared/utils/guid.d.ts +6 -0
- package/dist/src/shared/utils/guid.d.ts.map +1 -0
- package/dist/src/shared/utils/hasAssignedNodes.d.ts +7 -0
- package/dist/src/shared/utils/hasAssignedNodes.d.ts.map +1 -0
- package/dist/src/shared/utils/index.d.ts +6 -0
- package/dist/src/shared/utils/index.d.ts.map +1 -0
- package/dist/src/shared/utils/prefersReducedMotion.d.ts +6 -0
- package/dist/src/shared/utils/prefersReducedMotion.d.ts.map +1 -0
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts +8 -0
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts.map +1 -0
- package/eslint.config.mjs +21 -0
- package/package.json +87 -0
- package/rollup.config.js +132 -0
- package/src/a11y/AriaDescriber.ts +130 -0
- package/src/a11y/FocusTrapElement.ts +136 -0
- package/src/a11y/InteractivityChecker.ts +62 -0
- package/src/a11y/LiveAnnouncer.ts +143 -0
- package/src/a11y/aria-reference.ts +51 -0
- package/src/a11y/index.ts +8 -0
- package/src/a11y/keycodes/KeyCode.ts +128 -0
- package/src/a11y/keycodes/ModifierKeys.ts +5 -0
- package/src/a11y/keycodes/getKeyCode.ts +8 -0
- package/src/a11y/keycodes/hasModifierKey.ts +11 -0
- package/src/a11y/keycodes/index.ts +5 -0
- package/src/a11y/keycodes/isModifierAllowed.ts +12 -0
- package/src/a11y/list-key/FocusKeyManager.ts +25 -0
- package/src/a11y/list-key/ListKeyManager.ts +350 -0
- package/src/a11y/list-key/ListManager.ts +66 -0
- package/src/a11y/list-key/RadioKeyManager.ts +49 -0
- package/src/a11y/list-key/RovingTabIndexManager.ts +56 -0
- package/src/a11y/list-key/SelectionManager.ts +132 -0
- package/src/a11y/list-key/Typeahead.ts +131 -0
- package/src/a11y/list-key/index.ts +7 -0
- package/src/a11y/visuallyHide.ts +18 -0
- package/src/anchoring/AnchorOptions.ts +19 -0
- package/src/anchoring/AnchorPosition.ts +14 -0
- package/src/anchoring/index.ts +3 -0
- package/src/anchoring/positionAnchor.ts +53 -0
- package/src/bidi/Directionality.ts +85 -0
- package/src/bidi/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/layout/Breakpoint.ts +26 -0
- package/src/layout/BreakpointObserver.ts +44 -0
- package/src/layout/index.ts +2 -0
- package/src/platform/Platform.ts +67 -0
- package/src/platform/index.ts +1 -0
- package/src/shared/controllers/FocusController.ts +60 -0
- package/src/shared/controllers/HoverController.ts +140 -0
- package/src/shared/controllers/IntersectionController.ts +81 -0
- package/src/shared/controllers/LongPressController.ts +87 -0
- package/src/shared/controllers/MonitorControllerBase.ts +99 -0
- package/src/shared/controllers/MutationController.ts +89 -0
- package/src/shared/controllers/PressedController.ts +137 -0
- package/src/shared/controllers/ResizeController.ts +83 -0
- package/src/shared/controllers/ScrollController.ts +100 -0
- package/src/shared/controllers/index.ts +8 -0
- package/src/shared/decorators/debounce.ts +19 -0
- package/src/shared/decorators/index.ts +1 -0
- package/src/shared/directives/index.ts +1 -0
- package/src/shared/directives/safeStyleMap.ts +108 -0
- package/src/shared/index.ts +7 -0
- package/src/shared/mixins/AttachInternals.ts +48 -0
- package/src/shared/mixins/Checked.ts +50 -0
- package/src/shared/mixins/CheckedIndeterminate.ts +47 -0
- package/src/shared/mixins/CheckedOrSelected.ts +36 -0
- package/src/shared/mixins/ConstraintValidation.ts +213 -0
- package/src/shared/mixins/Constructor.ts +2 -0
- package/src/shared/mixins/Dirty.ts +71 -0
- package/src/shared/mixins/Disabled.ts +49 -0
- package/src/shared/mixins/DisabledInteractive.ts +78 -0
- package/src/shared/mixins/EventAttribute.ts +25 -0
- package/src/shared/mixins/Focusable.ts +52 -0
- package/src/shared/mixins/FormAssociated.ts +152 -0
- package/src/shared/mixins/FormSubmitter.ts +123 -0
- package/src/shared/mixins/HtmlFor.ts +89 -0
- package/src/shared/mixins/KeyboardClick.ts +46 -0
- package/src/shared/mixins/Labelled.ts +88 -0
- package/src/shared/mixins/LinkButton.ts +169 -0
- package/src/shared/mixins/ReadOnly.ts +48 -0
- package/src/shared/mixins/Required.ts +50 -0
- package/src/shared/mixins/RequiredConstraintValidation.ts +45 -0
- package/src/shared/mixins/Role.ts +134 -0
- package/src/shared/mixins/Selected.ts +50 -0
- package/src/shared/mixins/Touched.ts +71 -0
- package/src/shared/mixins/Vertical.ts +44 -0
- package/src/shared/mixins/hasKeys.ts +10 -0
- package/src/shared/mixins/index.ts +24 -0
- package/src/shared/primitives/CollapsibleElement.ts +227 -0
- package/src/shared/primitives/ElevationElement.ts +254 -0
- package/src/shared/primitives/ElevationLevel.ts +2 -0
- package/src/shared/primitives/ElevationToken.ts +18 -0
- package/src/shared/primitives/FocusRingElement.ts +199 -0
- package/src/shared/primitives/FocusRingToken.ts +24 -0
- package/src/shared/primitives/PseudoCheckboxElement.ts +116 -0
- package/src/shared/primitives/PseudoRadioElement.ts +83 -0
- package/src/shared/primitives/RippleElement.ts +289 -0
- package/src/shared/primitives/RippleToken.ts +15 -0
- package/src/shared/primitives/ScrollContainerElement.ts +151 -0
- package/src/shared/primitives/ScrollDividers.ts +2 -0
- package/src/shared/primitives/SlideElement.ts +128 -0
- package/src/shared/primitives/StateLayerElement.ts +191 -0
- package/src/shared/primitives/StateLayerToken.ts +16 -0
- package/src/shared/primitives/TextOverflowElement.ts +60 -0
- package/src/shared/primitives/index.ts +12 -0
- package/src/shared/tokens/ColorToken.ts +142 -0
- package/src/shared/tokens/DensityToken.ts +23 -0
- package/src/shared/tokens/DesignToken.ts +35 -0
- package/src/shared/tokens/ElevationToken.ts +115 -0
- package/src/shared/tokens/MotionToken.ts +107 -0
- package/src/shared/tokens/ScrollbarToken.ts +13 -0
- package/src/shared/tokens/ShapeToken.ts +138 -0
- package/src/shared/tokens/StateToken.ts +13 -0
- package/src/shared/tokens/TypescaleToken.ts +230 -0
- package/src/shared/tokens/index.ts +1 -0
- package/src/shared/utils/getTextContent.ts +31 -0
- package/src/shared/utils/guid.ts +11 -0
- package/src/shared/utils/hasAssignedNodes.ts +8 -0
- package/src/shared/utils/index.ts +5 -0
- package/src/shared/utils/prefersReducedMotion.ts +9 -0
- package/src/shared/utils/scrollIntoViewIfNeeded.ts +18 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { unsafeCSS } from "lit";
|
|
2
|
+
|
|
3
|
+
const EasingToken = {
|
|
4
|
+
/** Emphasized transition. */
|
|
5
|
+
emphasized: unsafeCSS("var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0.0, 0, 1.0))"),
|
|
6
|
+
|
|
7
|
+
/** Decelerated emphasized transition. */
|
|
8
|
+
emphasizedDecelerate: unsafeCSS(
|
|
9
|
+
"var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1.0))"
|
|
10
|
+
),
|
|
11
|
+
|
|
12
|
+
/** Accelerated emphasized transition. */
|
|
13
|
+
emphasizedAccelerate: unsafeCSS(
|
|
14
|
+
"var(--md-sys-motion-easing-emphasized-accelerate, cubic-bezier(0.3, 0.0, 0.8, 0.15))"
|
|
15
|
+
),
|
|
16
|
+
|
|
17
|
+
/** Simple, small, or utility-focused transition. */
|
|
18
|
+
standard: unsafeCSS("var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0))"),
|
|
19
|
+
|
|
20
|
+
/** Decelerated standard transition. */
|
|
21
|
+
standardDecelerate: unsafeCSS("var(--md-sys-motion-easing-standard-decelerate, cubic-bezier(0, 0, 0, 1))"),
|
|
22
|
+
|
|
23
|
+
/** Accelerated standard transition. */
|
|
24
|
+
standardAccelerate: unsafeCSS("var(--md-sys-motion-easing-standard-accelerate, cubic-bezier(0.3, 0, 1, 1))"),
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
const SpringToken = {
|
|
28
|
+
/** Fast spatial spring. */
|
|
29
|
+
fastSpatial: unsafeCSS("var(--md-sys-motion-spring-fast-spatial, 350ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
|
|
30
|
+
|
|
31
|
+
/** Default spatial spring. */
|
|
32
|
+
defaultSpatial: unsafeCSS("var(--md-sys-motion-spring-default-spatial, 500ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
|
|
33
|
+
|
|
34
|
+
/** Slow spatial spring. */
|
|
35
|
+
slowSpatial: unsafeCSS("var(--md-sys-motion-spring-slow-spatial, 750ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
|
|
36
|
+
|
|
37
|
+
/** Fast effects spring. */
|
|
38
|
+
fastEffects: unsafeCSS("var(--md-sys-motion-spring-fast-effects, 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00))"),
|
|
39
|
+
|
|
40
|
+
/** Default effects spring. */
|
|
41
|
+
defaultEffects: unsafeCSS("var(--md-sys-motion-spring-default-effects, 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00))"),
|
|
42
|
+
|
|
43
|
+
/** Slow effects spring. */
|
|
44
|
+
slowEffects: unsafeCSS("var(--md-sys-motion-spring-slow-effects, 200ms cubic-bezier(0.34, 0.88, 0.34, 1.00))"),
|
|
45
|
+
} as const;
|
|
46
|
+
|
|
47
|
+
const DurationToken = {
|
|
48
|
+
/** Small utility-focused transition duration. */
|
|
49
|
+
short1: unsafeCSS("var(--md-sys-motion-duration-short-1, 50ms)"),
|
|
50
|
+
|
|
51
|
+
/** Small utility-focused transition duration. */
|
|
52
|
+
short2: unsafeCSS("var(--md-sys-motion-duration-short-2, 100ms)"),
|
|
53
|
+
|
|
54
|
+
/** Small utility-focused transition duration. */
|
|
55
|
+
short3: unsafeCSS("var(--md-sys-motion-duration-short-3, 150ms)"),
|
|
56
|
+
|
|
57
|
+
/** Small utility-focused transition duration. */
|
|
58
|
+
short4: unsafeCSS("var(--md-sys-motion-duration-short-4, 200ms)"),
|
|
59
|
+
|
|
60
|
+
/** Duration for transitions that traverse a medium area of the screen. */
|
|
61
|
+
medium1: unsafeCSS("var(--md-sys-motion-duration-medium-1, 250ms)"),
|
|
62
|
+
|
|
63
|
+
/** Duration for transitions that traverse a medium area of the screen. */
|
|
64
|
+
medium2: unsafeCSS("var(--md-sys-motion-duration-medium-2, 300ms)"),
|
|
65
|
+
|
|
66
|
+
/** Duration for transitions that traverse a medium area of the screen. */
|
|
67
|
+
medium3: unsafeCSS("var(--md-sys-motion-duration-medium-3, 350ms)"),
|
|
68
|
+
|
|
69
|
+
/** Duration for transitions that traverse a medium area of the screen. */
|
|
70
|
+
medium4: unsafeCSS("var(--md-sys-motion-duration-medium-4, 400ms)"),
|
|
71
|
+
|
|
72
|
+
/** Duration for large expressive transitions. */
|
|
73
|
+
long1: unsafeCSS("var(--md-sys-motion-duration-long-1, 450ms)"),
|
|
74
|
+
|
|
75
|
+
/** Duration for large expressive transitions. */
|
|
76
|
+
long2: unsafeCSS("var(--md-sys-motion-duration-long-2, 500ms)"),
|
|
77
|
+
|
|
78
|
+
/** Duration for large expressive transitions. */
|
|
79
|
+
long3: unsafeCSS("var(--md-sys-motion-duration-long-3, 550ms)"),
|
|
80
|
+
|
|
81
|
+
/** Duration for large expressive transitions. */
|
|
82
|
+
long4: unsafeCSS("var(--md-sys-motion-duration-long-4, 600ms)"),
|
|
83
|
+
|
|
84
|
+
/** Extra long duration for ambient transitions. */
|
|
85
|
+
extraLong1: unsafeCSS("var(--md-sys-motion-duration-extra-long-1, 700ms)"),
|
|
86
|
+
|
|
87
|
+
/** Extra long duration for ambient transitions. */
|
|
88
|
+
extraLong2: unsafeCSS("var(--md-sys-motion-duration-extra-long-2, 800ms)"),
|
|
89
|
+
|
|
90
|
+
/** Extra long duration for ambient transitions. */
|
|
91
|
+
extraLong3: unsafeCSS("var(--md-sys-motion-duration-extra-long-3, 900ms)"),
|
|
92
|
+
|
|
93
|
+
/** Extra long duration for ambient transitions. */
|
|
94
|
+
extraLong4: unsafeCSS("var(--md-sys-motion-duration-extra-long-4, 1000ms)"),
|
|
95
|
+
} as const;
|
|
96
|
+
|
|
97
|
+
/** Design tokens that control motion. */
|
|
98
|
+
export const MotionToken = {
|
|
99
|
+
/** Design tokens that control transition effects. */
|
|
100
|
+
easing: EasingToken,
|
|
101
|
+
|
|
102
|
+
/** Design tokens that control transition duration. */
|
|
103
|
+
duration: DurationToken,
|
|
104
|
+
|
|
105
|
+
/** Design tokens that control spring effects. */
|
|
106
|
+
spring: SpringToken,
|
|
107
|
+
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { unsafeCSS } from "lit";
|
|
2
|
+
|
|
3
|
+
/** Design tokens that control scrollbars. */
|
|
4
|
+
export const ScrollbarToken = {
|
|
5
|
+
/** Width of a standard scrollbar. */
|
|
6
|
+
width: unsafeCSS(`var(--m3e-scrollbar-width, auto)`),
|
|
7
|
+
|
|
8
|
+
/** Width of a thin scrollbar. */
|
|
9
|
+
thinWidth: unsafeCSS(`var(--m3e-scrollbar-thin-width, thin)`),
|
|
10
|
+
|
|
11
|
+
/** Color of a scrollbar. */
|
|
12
|
+
color: unsafeCSS(`var(--m3e-scrollbar-thumb-color, #938f94) var(--m3e-scrollbar-track-color, transparent)`),
|
|
13
|
+
} as const;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { unsafeCSS } from "lit";
|
|
2
|
+
|
|
3
|
+
const CornerValue = {
|
|
4
|
+
/** No rounding. */
|
|
5
|
+
none: unsafeCSS("var(--md-sys-shape-corner-value-none, 0)"),
|
|
6
|
+
|
|
7
|
+
/** Extra small rounded corner. */
|
|
8
|
+
extraSmall: unsafeCSS("var(--md-sys-shape-corner-value-extra-small, 0.25rem)"),
|
|
9
|
+
|
|
10
|
+
/** Small rounded corner. */
|
|
11
|
+
small: unsafeCSS("var(--md-sys-shape-corner-value-small, 0.5rem)"),
|
|
12
|
+
|
|
13
|
+
/** Medium rounded corner. */
|
|
14
|
+
medium: unsafeCSS("var(--md-sys-shape-corner-value-medium, 0.75rem)"),
|
|
15
|
+
|
|
16
|
+
/** Large rounded corner. */
|
|
17
|
+
large: unsafeCSS("var(--md-sys-shape-corner-value-large, 1rem)"),
|
|
18
|
+
|
|
19
|
+
/** Increased large rounded corner. */
|
|
20
|
+
largeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-large-increased, 1.25rem)"),
|
|
21
|
+
|
|
22
|
+
/** Extra large rounded corner. */
|
|
23
|
+
extraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-large, 1.75rem)"),
|
|
24
|
+
|
|
25
|
+
/** Increased extra large rounded corner. */
|
|
26
|
+
extraLargeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-extra-large-increased, 2rem)"),
|
|
27
|
+
|
|
28
|
+
/** Extra extra large rounded corner. */
|
|
29
|
+
extraExtraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-extra-large, 3rem)"),
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
/** Design tokens that control shape. */
|
|
33
|
+
export const ShapeToken = {
|
|
34
|
+
corner: {
|
|
35
|
+
/** Fully rounded symmetric shape. */
|
|
36
|
+
full: unsafeCSS("var(--md-sys-shape-corner-full, 624.9375rem)"),
|
|
37
|
+
|
|
38
|
+
/** Extra large rounded asymmetric shape directed towards the top. */
|
|
39
|
+
extraLargeTop: unsafeCSS(
|
|
40
|
+
`var(--md-sys-shape-corner-extra-large-top, ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none})`
|
|
41
|
+
),
|
|
42
|
+
|
|
43
|
+
/** Extra large rounded symmetric shape. */
|
|
44
|
+
extraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-large, ${CornerValue.extraLarge})`),
|
|
45
|
+
|
|
46
|
+
/** Extra large rounded asymmetric shape directed towards the end. */
|
|
47
|
+
extraLargeEnd: unsafeCSS(
|
|
48
|
+
`${CornerValue.none} ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none}`
|
|
49
|
+
),
|
|
50
|
+
|
|
51
|
+
/** Extra large rounded asymmetric shape directed towards the start. */
|
|
52
|
+
extraLargeStart: unsafeCSS(
|
|
53
|
+
`${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraLarge}`
|
|
54
|
+
),
|
|
55
|
+
|
|
56
|
+
/** Large rounded asymmetric shape directed towards the top. */
|
|
57
|
+
largeTop: unsafeCSS(
|
|
58
|
+
`var(--md-sys-shape-corner-large-top, ${CornerValue.large} ${CornerValue.large} ${CornerValue.none} ${CornerValue.none})`
|
|
59
|
+
),
|
|
60
|
+
|
|
61
|
+
/** Large rounded asymmetric shape directed towards the end. */
|
|
62
|
+
largeEnd: unsafeCSS(
|
|
63
|
+
`var(--md-sys-shape-corner-large-end, ${CornerValue.none} ${CornerValue.large} ${CornerValue.large} ${CornerValue.none})`
|
|
64
|
+
),
|
|
65
|
+
|
|
66
|
+
/** Large rounded asymmetric shape directed towards the start. */
|
|
67
|
+
largeStart: unsafeCSS(
|
|
68
|
+
`var(--md-sys-shape-corner-large-end, ${CornerValue.large} ${CornerValue.none} ${CornerValue.none} ${CornerValue.large})`
|
|
69
|
+
),
|
|
70
|
+
|
|
71
|
+
/** Large rounded symmetric shape. */
|
|
72
|
+
large: unsafeCSS(`var(--md-sys-shape-corner-large, ${CornerValue.large})`),
|
|
73
|
+
|
|
74
|
+
/** Medium rounded symmetric shape. */
|
|
75
|
+
medium: unsafeCSS(`var(--md-sys-shape-corner-medium, ${CornerValue.medium})`),
|
|
76
|
+
|
|
77
|
+
/** Medium rounded asymmetric shape directed towards the top. */
|
|
78
|
+
mediumTop: unsafeCSS(`${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none} ${CornerValue.none}`),
|
|
79
|
+
|
|
80
|
+
/** Medium rounded asymmetric shape directed towards the end. */
|
|
81
|
+
mediumEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none}`),
|
|
82
|
+
|
|
83
|
+
/** Medium rounded asymmetric shape directed towards the start. */
|
|
84
|
+
mediumStart: unsafeCSS(`${CornerValue.medium} ${CornerValue.none} ${CornerValue.none} ${CornerValue.medium}`),
|
|
85
|
+
|
|
86
|
+
/** Small rounded symmetric shape. */
|
|
87
|
+
small: unsafeCSS(`var(--md-sys-shape-corner-small, ${CornerValue.small})`),
|
|
88
|
+
|
|
89
|
+
/** Small rounded asymmetric shape directed towards the top. */
|
|
90
|
+
smallTop: unsafeCSS(`${CornerValue.small} ${CornerValue.small} ${CornerValue.none} ${CornerValue.none}`),
|
|
91
|
+
|
|
92
|
+
/** Small rounded asymmetric shape directed towards the end. */
|
|
93
|
+
smallEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.small} ${CornerValue.small} ${CornerValue.none}`),
|
|
94
|
+
|
|
95
|
+
/** Small rounded asymmetric shape directed towards the start. */
|
|
96
|
+
smallStart: unsafeCSS(`${CornerValue.small} ${CornerValue.none} ${CornerValue.none} ${CornerValue.small}`),
|
|
97
|
+
|
|
98
|
+
/** Extra small rounded asymmetric shape directed towards the top. */
|
|
99
|
+
extraSmallTop: unsafeCSS(
|
|
100
|
+
`var(--md-sys-shape-corner-extra-small-top, ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none})`
|
|
101
|
+
),
|
|
102
|
+
|
|
103
|
+
/** Extra small rounded symmetric shape. */
|
|
104
|
+
extraSmall: unsafeCSS(`var(--md-sys-shape-corner-extra-small, ${CornerValue.extraSmall})`),
|
|
105
|
+
|
|
106
|
+
/** Extra small rounded asymmetric shape directed towards the end. */
|
|
107
|
+
extraSmallEnd: unsafeCSS(
|
|
108
|
+
`${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none}`
|
|
109
|
+
),
|
|
110
|
+
|
|
111
|
+
/** Extra small rounded asymmetric shape directed towards the start. */
|
|
112
|
+
extraSmallStart: unsafeCSS(
|
|
113
|
+
`${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall}`
|
|
114
|
+
),
|
|
115
|
+
|
|
116
|
+
/** Extra small rounded asymmetric shape directed towards the bottom. */
|
|
117
|
+
extraSmallBottom: unsafeCSS(
|
|
118
|
+
`${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall}`
|
|
119
|
+
),
|
|
120
|
+
|
|
121
|
+
/** No rounding. */
|
|
122
|
+
none: unsafeCSS(`var(--md-sys-shape-corner-none, ${CornerValue.none})`),
|
|
123
|
+
|
|
124
|
+
/** Increased large rounded symmetric shape. */
|
|
125
|
+
largeIncreased: unsafeCSS(`var(--md-sys-shape-corner-large-increased, ${CornerValue.largeIncreased})`),
|
|
126
|
+
|
|
127
|
+
/** Increased extra large rounded symmetric shape. */
|
|
128
|
+
extraLargeIncreased: unsafeCSS(
|
|
129
|
+
`var(--md-sys-shape-corner-extra-large-increased, ${CornerValue.extraLargeIncreased})`
|
|
130
|
+
),
|
|
131
|
+
|
|
132
|
+
/** Extra extra large rounded symmetric shape. */
|
|
133
|
+
extraExtraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-extra-large, ${CornerValue.extraExtraLarge})`),
|
|
134
|
+
|
|
135
|
+
/** Design tokens that control specific corners. */
|
|
136
|
+
value: CornerValue,
|
|
137
|
+
},
|
|
138
|
+
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { unsafeCSS } from "lit";
|
|
2
|
+
|
|
3
|
+
/** Design tokens that control state layer. */
|
|
4
|
+
export const StateToken = {
|
|
5
|
+
/** Opacity of the state layer on focus. */
|
|
6
|
+
focusStateLayerOpacity: unsafeCSS("var(--md-sys-state-focus-state-layer-opacity, 10%)"),
|
|
7
|
+
|
|
8
|
+
/** Opacity of the state layer on hover. */
|
|
9
|
+
hoverStateLayerOpacity: unsafeCSS("var(--md-sys-state-hover-state-layer-opacity, 8%)"),
|
|
10
|
+
|
|
11
|
+
/** Opacity of the state layer on pressed. */
|
|
12
|
+
pressedStateLayerOpacity: unsafeCSS("var(--md-sys-state-pressed-state-layer-opacity, 10%)"),
|
|
13
|
+
} as const;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { unsafeCSS } from "lit";
|
|
2
|
+
|
|
3
|
+
/** Design tokens that control typescale. */
|
|
4
|
+
export const TypescaleToken = {
|
|
5
|
+
/** Standard typescale variant. */
|
|
6
|
+
standard: {
|
|
7
|
+
/** Short, important text or numerals. */
|
|
8
|
+
display: {
|
|
9
|
+
large: {
|
|
10
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-display-large-font-size, 3.5625rem)"),
|
|
11
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-display-large-font-weight, 400)"),
|
|
12
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-display-large-line-height, 4rem)"),
|
|
13
|
+
tracking: unsafeCSS("var(--md-sys-typescale-display-large-tracking, 0.015625rem)"),
|
|
14
|
+
},
|
|
15
|
+
medium: {
|
|
16
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-display-medium-font-size, 2.8125rem)"),
|
|
17
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-display-medium-font-weight, 400)"),
|
|
18
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-display-medium-line-height, 3.25rem)"),
|
|
19
|
+
tracking: unsafeCSS("var(--md-sys-typescale-display-medium-tracking, 0)"),
|
|
20
|
+
},
|
|
21
|
+
small: {
|
|
22
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-display-small-font-size, 2.25rem)"),
|
|
23
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-display-small-font-weight, 400)"),
|
|
24
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-display-small-line-height, 2.75rem)"),
|
|
25
|
+
tracking: unsafeCSS("var(--md-sys-typescale-display-small-tracking, 0)"),
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
/** Short, high-emphasis text on smaller screens. */
|
|
30
|
+
headline: {
|
|
31
|
+
large: {
|
|
32
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-headline-large-font-size, 2rem)"),
|
|
33
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-headline-large-font-weight, 400)"),
|
|
34
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-headline-large-line-height, 2.5rem)"),
|
|
35
|
+
tracking: unsafeCSS("var(--md-sys-typescale-headline-large-tracking, 0)"),
|
|
36
|
+
},
|
|
37
|
+
medium: {
|
|
38
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-headline-medium-font-size, 1.75rem)"),
|
|
39
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-headline-medium-font-weight, 400)"),
|
|
40
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-headline-medium-line-height, 2.25rem)"),
|
|
41
|
+
tracking: unsafeCSS("var(--md-sys-typescale-headline-medium-tracking, 0)"),
|
|
42
|
+
},
|
|
43
|
+
small: {
|
|
44
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-headline-small-font-size, 1.5rem)"),
|
|
45
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-headline-small-font-weight, 400)"),
|
|
46
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-headline-small-line-height, 2rem)"),
|
|
47
|
+
tracking: unsafeCSS("var(--md-sys-typescale-headline-small-tracking, 0)"),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/** Medium-emphasis text that remains relatively short. */
|
|
52
|
+
title: {
|
|
53
|
+
large: {
|
|
54
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-title-large-font-size, 1.375rem)"),
|
|
55
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-title-large-font-weight, 400)"),
|
|
56
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-title-large-line-height, 1.75rem)"),
|
|
57
|
+
tracking: unsafeCSS("var(--md-sys-typescale-title-large-tracking, 0)"),
|
|
58
|
+
},
|
|
59
|
+
medium: {
|
|
60
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-title-medium-font-size, 1rem)"),
|
|
61
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-title-medium-font-weight, 500)"),
|
|
62
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-title-medium-line-height, 1.5rem)"),
|
|
63
|
+
tracking: unsafeCSS("var(--md-sys-typescale-title-medium-tracking, 0.009375rem)"),
|
|
64
|
+
},
|
|
65
|
+
small: {
|
|
66
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-title-small-font-size, 0.875rem)"),
|
|
67
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-title-small-font-weight, 500)"),
|
|
68
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-title-small-line-height, 1.25rem)"),
|
|
69
|
+
tracking: unsafeCSS("var(--md-sys-typescale-title-small-tracking, 0.00625rem)"),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
/** Longer passages of text. */
|
|
74
|
+
body: {
|
|
75
|
+
large: {
|
|
76
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-body-large-font-size, 1rem)"),
|
|
77
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-body-large-font-weight, 400)"),
|
|
78
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-body-large-line-height, 1.5rem)"),
|
|
79
|
+
tracking: unsafeCSS("var(--md-sys-typescale-body-large-tracking, 0.03125rem)"),
|
|
80
|
+
},
|
|
81
|
+
medium: {
|
|
82
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-body-medium-font-size, 0.875rem)"),
|
|
83
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-body-medium-font-weight, 400)"),
|
|
84
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-body-medium-line-height, 1.25rem)"),
|
|
85
|
+
tracking: unsafeCSS("var(--md-sys-typescale-body-medium-tracking, 0.015625rem)"),
|
|
86
|
+
},
|
|
87
|
+
small: {
|
|
88
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-body-small-font-size, 0.75rem)"),
|
|
89
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-body-small-font-weight, 400)"),
|
|
90
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-body-small-line-height, 1rem)"),
|
|
91
|
+
tracking: unsafeCSS("var(--md-sys-typescale-body-small-tracking, 0.025rem)"),
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/** Smaller, utilitarian text. */
|
|
96
|
+
label: {
|
|
97
|
+
large: {
|
|
98
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-label-large-font-size, 0.875rem)"),
|
|
99
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-label-large-font-weight, 500)"),
|
|
100
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-label-large-line-height, 1.25rem)"),
|
|
101
|
+
tracking: unsafeCSS("var(--md-sys-typescale-label-large-tracking, 0.00625rem)"),
|
|
102
|
+
},
|
|
103
|
+
medium: {
|
|
104
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-label-medium-font-size, 0.75rem)"),
|
|
105
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-label-medium-font-weight, 500)"),
|
|
106
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-label-medium-line-height, 1rem)"),
|
|
107
|
+
tracking: unsafeCSS("var(--md-sys-typescale-label-medium-tracking, 0.03125rem)"),
|
|
108
|
+
},
|
|
109
|
+
small: {
|
|
110
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-label-small-font-size, 0.6875rem)"),
|
|
111
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-label-small-font-weight, 500)"),
|
|
112
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-label-small-line-height, 1rem)"),
|
|
113
|
+
tracking: unsafeCSS("var(--md-sys-typescale-label-small-tracking, 0.03125rem)"),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/** Emphasized typescale variant. */
|
|
119
|
+
emphasized: {
|
|
120
|
+
/** Short, important text or numerals. */
|
|
121
|
+
display: {
|
|
122
|
+
large: {
|
|
123
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-size, 3.5625rem)"),
|
|
124
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-weight, 500)"),
|
|
125
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-line-height, 4rem)"),
|
|
126
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-tracking, 0.015625rem)"),
|
|
127
|
+
},
|
|
128
|
+
medium: {
|
|
129
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-size, 2.8125rem)"),
|
|
130
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-weight, 500)"),
|
|
131
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-line-height, 3.25rem)"),
|
|
132
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-tracking, 0)"),
|
|
133
|
+
},
|
|
134
|
+
small: {
|
|
135
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-size, 2.25rem)"),
|
|
136
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-weight, 500)"),
|
|
137
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-line-height, 2.75rem)"),
|
|
138
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-tracking, 0)"),
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
/** Short, high-emphasis text on smaller screens. */
|
|
143
|
+
headline: {
|
|
144
|
+
large: {
|
|
145
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-size, 2rem)"),
|
|
146
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-weight, 500)"),
|
|
147
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-line-height, 2.5rem)"),
|
|
148
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-tracking, 0)"),
|
|
149
|
+
},
|
|
150
|
+
medium: {
|
|
151
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-size, 1.75rem)"),
|
|
152
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-weight, 500)"),
|
|
153
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-line-height, 2.25rem)"),
|
|
154
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-tracking, 0)"),
|
|
155
|
+
},
|
|
156
|
+
small: {
|
|
157
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-size, 1.5rem)"),
|
|
158
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-weight, 500)"),
|
|
159
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-line-height, 2rem)"),
|
|
160
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-tracking, 0)"),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/** Medium-emphasis text that remains relatively short. */
|
|
165
|
+
title: {
|
|
166
|
+
large: {
|
|
167
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-size, 1.375rem)"),
|
|
168
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-weight, 500)"),
|
|
169
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-line-height, 1.75rem)"),
|
|
170
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-tracking, 0)"),
|
|
171
|
+
},
|
|
172
|
+
medium: {
|
|
173
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-size, 1rem)"),
|
|
174
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-weight, 700)"),
|
|
175
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-line-height, 3.5rem)"),
|
|
176
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-tracking, 0.009375rem)"),
|
|
177
|
+
},
|
|
178
|
+
small: {
|
|
179
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-size, 0.875rem)"),
|
|
180
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-weight, 700)"),
|
|
181
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-line-height, 1.25rem)"),
|
|
182
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-tracking, 0.00625rem)"),
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
/** Longer passages of text. */
|
|
187
|
+
body: {
|
|
188
|
+
large: {
|
|
189
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-size, 1rem)"),
|
|
190
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-weight, 500)"),
|
|
191
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-line-height, 1.5rem)"),
|
|
192
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-tracking, 0.03125rem)"),
|
|
193
|
+
},
|
|
194
|
+
medium: {
|
|
195
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-size, 0.875rem)"),
|
|
196
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-weight, 500)"),
|
|
197
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-line-height, 1.25rem)"),
|
|
198
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-tracking, 0.015625rem)"),
|
|
199
|
+
},
|
|
200
|
+
small: {
|
|
201
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-size, 0.75rem)"),
|
|
202
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-weight, 500)"),
|
|
203
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-line-height, 1rem)"),
|
|
204
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-tracking, 0.025rem)"),
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
/** Smaller, utilitarian text. */
|
|
209
|
+
label: {
|
|
210
|
+
large: {
|
|
211
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-size, 0.875rem)"),
|
|
212
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-weight, 700)"),
|
|
213
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-line-height, 1.25rem)"),
|
|
214
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-tracking, 0.00625rem)"),
|
|
215
|
+
},
|
|
216
|
+
medium: {
|
|
217
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-size, 0.75rem)"),
|
|
218
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-weight, 700)"),
|
|
219
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-line-height, 1rem)"),
|
|
220
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-tracking, 0.03125rem)"),
|
|
221
|
+
},
|
|
222
|
+
small: {
|
|
223
|
+
fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-size, 0.6875rem)"),
|
|
224
|
+
fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-weight, 700)"),
|
|
225
|
+
lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-line-height, 1rem)"),
|
|
226
|
+
tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-tracking, 0.03125rem)"),
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
} as const;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DesignToken";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the text content of a given node, including slotted content.
|
|
3
|
+
* @param {Node} node The node for which to get text content.
|
|
4
|
+
* @param {boolean} [trim = false] A value indicating whether to trim content.
|
|
5
|
+
* @returns {string} The text content of `node`.
|
|
6
|
+
*/
|
|
7
|
+
export function getTextContent(node: Node, trim: boolean = false): string {
|
|
8
|
+
let textContent = "";
|
|
9
|
+
|
|
10
|
+
switch (node.nodeType) {
|
|
11
|
+
case Node.TEXT_NODE:
|
|
12
|
+
textContent = node.nodeValue ?? "";
|
|
13
|
+
break;
|
|
14
|
+
case Node.ELEMENT_NODE:
|
|
15
|
+
if (node instanceof HTMLSlotElement) {
|
|
16
|
+
for (const assignedNode of node.assignedNodes({ flatten: true })) {
|
|
17
|
+
textContent += getTextContent(assignedNode, trim);
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
for (const child of node.childNodes) {
|
|
21
|
+
textContent += getTextContent(child, trim);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (trim) {
|
|
28
|
+
textContent = textContent.trim();
|
|
29
|
+
}
|
|
30
|
+
return textContent;
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a new globally unique identifier (GUID).
|
|
3
|
+
* @returns {string} A new globally unique identifier.
|
|
4
|
+
*/
|
|
5
|
+
export function guid(): string {
|
|
6
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
7
|
+
const r = (Math.random() * 16) | 0;
|
|
8
|
+
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
9
|
+
return v.toString(16);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether a slot has any assigned nodes.
|
|
3
|
+
* @param {HTMLSlotElement} slot The slot to test.
|
|
4
|
+
* @returns {boolean} Whether `slot` has any assigned nodes.
|
|
5
|
+
*/
|
|
6
|
+
export function hasAssignedNodes(slot: HTMLSlotElement): boolean {
|
|
7
|
+
return slot.assignedNodes({ flatten: true }).length > 0;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isServer } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether reduced motion is preferred.
|
|
5
|
+
* @returns {boolean} Whether reduced motion is preferred.
|
|
6
|
+
*/
|
|
7
|
+
export function prefersReducedMotion(): boolean {
|
|
8
|
+
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If needed, scrolls an element into view within a given scroll container.
|
|
3
|
+
* @param {HTMLElement} element The element to scroll into view.
|
|
4
|
+
* @param {HTMLElement} scrollContainer The scrollable container.
|
|
5
|
+
* @param {ScrollBehavior} [behavior="auto"] The scroll behavior.
|
|
6
|
+
*/
|
|
7
|
+
export function scrollIntoViewIfNeeded(
|
|
8
|
+
element: HTMLElement,
|
|
9
|
+
scrollContainer: HTMLElement,
|
|
10
|
+
behavior: ScrollBehavior = "auto"
|
|
11
|
+
): void {
|
|
12
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
13
|
+
const elementRect = element.getBoundingClientRect();
|
|
14
|
+
|
|
15
|
+
if (elementRect.top < containerRect.top || elementRect.bottom > containerRect.bottom) {
|
|
16
|
+
element.scrollIntoView({ block: "nearest", behavior: behavior });
|
|
17
|
+
}
|
|
18
|
+
}
|