@m3e/core 1.0.0-rc.1 → 1.0.0-rc.3
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 +1 -2
- package/dist/a11y.js +6 -18
- package/dist/a11y.js.map +1 -1
- package/dist/a11y.min.js +5 -5
- package/dist/a11y.min.js.map +1 -1
- package/dist/css-custom-data.json +20 -0
- package/dist/custom-elements.json +3605 -3375
- package/dist/html-custom-data.json +36 -6
- package/dist/index.js +417 -33
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +95 -84
- package/dist/index.min.js.map +1 -1
- package/dist/src/a11y/FocusTrapElement.d.ts +1 -1
- package/dist/src/a11y/FocusTrapElement.d.ts.map +1 -1
- package/dist/src/shared/controllers/PressedController.d.ts +2 -0
- package/dist/src/shared/controllers/PressedController.d.ts.map +1 -1
- package/dist/src/shared/mixins/AttachInternals.d.ts.map +1 -1
- package/dist/src/shared/mixins/Checked.d.ts.map +1 -1
- package/dist/src/shared/mixins/CheckedIndeterminate.d.ts.map +1 -1
- package/dist/src/shared/mixins/ConstraintValidation.d.ts.map +1 -1
- package/dist/src/shared/mixins/Dirty.d.ts.map +1 -1
- package/dist/src/shared/mixins/Disabled.d.ts.map +1 -1
- package/dist/src/shared/mixins/DisabledInteractive.d.ts.map +1 -1
- package/dist/src/shared/mixins/EventAttribute.d.ts.map +1 -1
- package/dist/src/shared/mixins/Focusable.d.ts.map +1 -1
- package/dist/src/shared/mixins/FormAssociated.d.ts.map +1 -1
- package/dist/src/shared/mixins/FormSubmitter.d.ts +4 -1
- package/dist/src/shared/mixins/FormSubmitter.d.ts.map +1 -1
- package/dist/src/shared/mixins/HtmlFor.d.ts.map +1 -1
- package/dist/src/shared/mixins/KeyboardClick.d.ts.map +1 -1
- package/dist/src/shared/mixins/Labelled.d.ts.map +1 -1
- package/dist/src/shared/mixins/LinkButton.d.ts +13 -3
- package/dist/src/shared/mixins/LinkButton.d.ts.map +1 -1
- package/dist/src/shared/mixins/ReadOnly.d.ts.map +1 -1
- package/dist/src/shared/mixins/Required.d.ts.map +1 -1
- package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts.map +1 -1
- package/dist/src/shared/mixins/Role.d.ts.map +1 -1
- package/dist/src/shared/mixins/Selected.d.ts.map +1 -1
- package/dist/src/shared/mixins/Touched.d.ts.map +1 -1
- package/dist/src/shared/mixins/Vertical.d.ts.map +1 -1
- package/dist/src/shared/primitives/CollapsibleElement.d.ts +1 -1
- package/dist/src/shared/primitives/CollapsibleElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/ElevationElement.d.ts +0 -1
- package/dist/src/shared/primitives/ElevationElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/FocusRingElement.d.ts +0 -1
- package/dist/src/shared/primitives/FocusRingElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts +0 -1
- package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts +0 -1
- package/dist/src/shared/primitives/PseudoRadioElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/RippleElement.d.ts +0 -1
- package/dist/src/shared/primitives/RippleElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts +1 -4
- package/dist/src/shared/primitives/ScrollContainerElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/SlideElement.d.ts +1 -3
- package/dist/src/shared/primitives/SlideElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/StateLayerElement.d.ts +0 -1
- package/dist/src/shared/primitives/StateLayerElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/TextHighlightElement.d.ts +81 -0
- package/dist/src/shared/primitives/TextHighlightElement.d.ts.map +1 -0
- package/dist/src/shared/primitives/TextOverflowElement.d.ts +0 -1
- package/dist/src/shared/primitives/TextOverflowElement.d.ts.map +1 -1
- package/dist/src/shared/primitives/index.d.ts +1 -0
- package/dist/src/shared/primitives/index.d.ts.map +1 -1
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts +2 -2
- package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts.map +1 -1
- package/package.json +1 -1
- package/cem.config.mjs +0 -16
- package/demo/index.html +0 -58
- package/eslint.config.mjs +0 -21
- package/rollup.config.js +0 -132
- package/src/a11y/AriaDescriber.ts +0 -130
- package/src/a11y/FocusTrapElement.ts +0 -136
- package/src/a11y/InteractivityChecker.ts +0 -62
- package/src/a11y/LiveAnnouncer.ts +0 -143
- package/src/a11y/aria-reference.ts +0 -51
- package/src/a11y/index.ts +0 -8
- package/src/a11y/keycodes/KeyCode.ts +0 -128
- package/src/a11y/keycodes/ModifierKeys.ts +0 -5
- package/src/a11y/keycodes/getKeyCode.ts +0 -8
- package/src/a11y/keycodes/hasModifierKey.ts +0 -11
- package/src/a11y/keycodes/index.ts +0 -5
- package/src/a11y/keycodes/isModifierAllowed.ts +0 -12
- package/src/a11y/list-key/FocusKeyManager.ts +0 -25
- package/src/a11y/list-key/ListKeyManager.ts +0 -350
- package/src/a11y/list-key/ListManager.ts +0 -66
- package/src/a11y/list-key/RadioKeyManager.ts +0 -49
- package/src/a11y/list-key/RovingTabIndexManager.ts +0 -56
- package/src/a11y/list-key/SelectionManager.ts +0 -132
- package/src/a11y/list-key/Typeahead.ts +0 -131
- package/src/a11y/list-key/index.ts +0 -7
- package/src/a11y/visuallyHide.ts +0 -18
- package/src/anchoring/AnchorOptions.ts +0 -19
- package/src/anchoring/AnchorPosition.ts +0 -14
- package/src/anchoring/index.ts +0 -3
- package/src/anchoring/positionAnchor.ts +0 -53
- package/src/bidi/Directionality.ts +0 -85
- package/src/bidi/index.ts +0 -1
- package/src/index.ts +0 -1
- package/src/layout/Breakpoint.ts +0 -26
- package/src/layout/BreakpointObserver.ts +0 -44
- package/src/layout/index.ts +0 -2
- package/src/platform/Platform.ts +0 -67
- package/src/platform/index.ts +0 -1
- package/src/shared/controllers/FocusController.ts +0 -60
- package/src/shared/controllers/HoverController.ts +0 -140
- package/src/shared/controllers/IntersectionController.ts +0 -81
- package/src/shared/controllers/LongPressController.ts +0 -87
- package/src/shared/controllers/MonitorControllerBase.ts +0 -99
- package/src/shared/controllers/MutationController.ts +0 -89
- package/src/shared/controllers/PressedController.ts +0 -137
- package/src/shared/controllers/ResizeController.ts +0 -83
- package/src/shared/controllers/ScrollController.ts +0 -100
- package/src/shared/controllers/index.ts +0 -8
- package/src/shared/decorators/debounce.ts +0 -19
- package/src/shared/decorators/index.ts +0 -1
- package/src/shared/directives/index.ts +0 -1
- package/src/shared/directives/safeStyleMap.ts +0 -108
- package/src/shared/index.ts +0 -7
- package/src/shared/mixins/AttachInternals.ts +0 -48
- package/src/shared/mixins/Checked.ts +0 -50
- package/src/shared/mixins/CheckedIndeterminate.ts +0 -47
- package/src/shared/mixins/CheckedOrSelected.ts +0 -36
- package/src/shared/mixins/ConstraintValidation.ts +0 -213
- package/src/shared/mixins/Constructor.ts +0 -2
- package/src/shared/mixins/Dirty.ts +0 -71
- package/src/shared/mixins/Disabled.ts +0 -49
- package/src/shared/mixins/DisabledInteractive.ts +0 -78
- package/src/shared/mixins/EventAttribute.ts +0 -25
- package/src/shared/mixins/Focusable.ts +0 -52
- package/src/shared/mixins/FormAssociated.ts +0 -152
- package/src/shared/mixins/FormSubmitter.ts +0 -123
- package/src/shared/mixins/HtmlFor.ts +0 -89
- package/src/shared/mixins/KeyboardClick.ts +0 -46
- package/src/shared/mixins/Labelled.ts +0 -88
- package/src/shared/mixins/LinkButton.ts +0 -169
- package/src/shared/mixins/ReadOnly.ts +0 -48
- package/src/shared/mixins/Required.ts +0 -50
- package/src/shared/mixins/RequiredConstraintValidation.ts +0 -45
- package/src/shared/mixins/Role.ts +0 -134
- package/src/shared/mixins/Selected.ts +0 -50
- package/src/shared/mixins/Touched.ts +0 -71
- package/src/shared/mixins/Vertical.ts +0 -44
- package/src/shared/mixins/hasKeys.ts +0 -10
- package/src/shared/mixins/index.ts +0 -24
- package/src/shared/primitives/CollapsibleElement.ts +0 -227
- package/src/shared/primitives/ElevationElement.ts +0 -254
- package/src/shared/primitives/ElevationLevel.ts +0 -2
- package/src/shared/primitives/ElevationToken.ts +0 -18
- package/src/shared/primitives/FocusRingElement.ts +0 -199
- package/src/shared/primitives/FocusRingToken.ts +0 -24
- package/src/shared/primitives/PseudoCheckboxElement.ts +0 -116
- package/src/shared/primitives/PseudoRadioElement.ts +0 -83
- package/src/shared/primitives/RippleElement.ts +0 -289
- package/src/shared/primitives/RippleToken.ts +0 -15
- package/src/shared/primitives/ScrollContainerElement.ts +0 -151
- package/src/shared/primitives/ScrollDividers.ts +0 -2
- package/src/shared/primitives/SlideElement.ts +0 -128
- package/src/shared/primitives/StateLayerElement.ts +0 -191
- package/src/shared/primitives/StateLayerToken.ts +0 -16
- package/src/shared/primitives/TextOverflowElement.ts +0 -60
- package/src/shared/primitives/index.ts +0 -12
- package/src/shared/tokens/ColorToken.ts +0 -142
- package/src/shared/tokens/DensityToken.ts +0 -23
- package/src/shared/tokens/DesignToken.ts +0 -35
- package/src/shared/tokens/ElevationToken.ts +0 -115
- package/src/shared/tokens/MotionToken.ts +0 -107
- package/src/shared/tokens/ScrollbarToken.ts +0 -13
- package/src/shared/tokens/ShapeToken.ts +0 -138
- package/src/shared/tokens/StateToken.ts +0 -13
- package/src/shared/tokens/TypescaleToken.ts +0 -230
- package/src/shared/tokens/index.ts +0 -1
- package/src/shared/utils/getTextContent.ts +0 -31
- package/src/shared/utils/guid.ts +0 -11
- package/src/shared/utils/hasAssignedNodes.ts +0 -8
- package/src/shared/utils/index.ts +0 -5
- package/src/shared/utils/prefersReducedMotion.ts +0 -9
- package/src/shared/utils/scrollIntoViewIfNeeded.ts +0 -18
- package/tsconfig.json +0 -9
|
@@ -1,107 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,138 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,230 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DesignToken";
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
}
|
package/src/shared/utils/guid.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|