@m3e/fab 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/custom-elements.json +2912 -12
- package/dist/html-custom-data.json +3 -3
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/src/FabElement.d.ts +2 -1
- package/dist/src/FabElement.d.ts.map +1 -1
- package/package.json +3 -3
- package/cem.config.mjs +0 -16
- package/demo/index.html +0 -80
- package/eslint.config.mjs +0 -13
- package/rollup.config.js +0 -32
- package/src/FabElement.ts +0 -448
- package/src/FabSize.ts +0 -2
- package/src/FabVariant.ts +0 -9
- package/src/index.ts +0 -3
- package/src/styles/FabSizeStyle.ts +0 -45
- package/src/styles/FabSizeToken.ts +0 -102
- package/src/styles/FabStyle.ts +0 -155
- package/src/styles/FabVariantStyle.ts +0 -95
- package/src/styles/FabVariantToken.ts +0 -1068
- package/src/styles/index.ts +0 -3
- package/tsconfig.json +0 -9
package/src/FabSize.ts
DELETED
package/src/FabVariant.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { css, CSSResult, CSSResultGroup, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { FabSize } from "../FabSize";
|
|
4
|
-
import { FabSizeToken } from "./FabSizeToken";
|
|
5
|
-
|
|
6
|
-
/** @private */
|
|
7
|
-
function fabStyle(size: FabSize): CSSResult {
|
|
8
|
-
return css`
|
|
9
|
-
:host([size="${unsafeCSS(size)}"]) .base {
|
|
10
|
-
height: ${FabSizeToken[size].containerHeight};
|
|
11
|
-
}
|
|
12
|
-
:host([size="${unsafeCSS(size)}"]) .base {
|
|
13
|
-
border-radius: ${FabSizeToken[size].shape};
|
|
14
|
-
}
|
|
15
|
-
:host([size="${unsafeCSS(size)}"]) .label {
|
|
16
|
-
font-size: ${FabSizeToken[size].labelTextFontSize};
|
|
17
|
-
font-weight: ${FabSizeToken[size].labelTextFontWeight};
|
|
18
|
-
line-height: ${FabSizeToken[size].labelTextLineHeight};
|
|
19
|
-
letter-spacing: ${FabSizeToken[size].labelTextTracking};
|
|
20
|
-
}
|
|
21
|
-
:host([size="${unsafeCSS(size)}"]:not([extended])) .wrapper {
|
|
22
|
-
padding-inline-start: ${FabSizeToken[size].leadingSpace};
|
|
23
|
-
padding-inline-end: ${FabSizeToken[size].trailingSpace};
|
|
24
|
-
}
|
|
25
|
-
:host([size="${unsafeCSS(size)}"]:not([extended])) .icon {
|
|
26
|
-
font-size: ${FabSizeToken[size].iconSize};
|
|
27
|
-
--m3e-icon-size: ${FabSizeToken[size].iconSize};
|
|
28
|
-
}
|
|
29
|
-
:host([size="${unsafeCSS(size)}"][extended]) .wrapper {
|
|
30
|
-
padding-inline-start: ${FabSizeToken[size].extendedLeadingSpace};
|
|
31
|
-
padding-inline-end: ${FabSizeToken[size].extendedTrailingSpace};
|
|
32
|
-
column-gap: ${FabSizeToken[size].iconLabelSpace};
|
|
33
|
-
}
|
|
34
|
-
:host([size="${unsafeCSS(size)}"][extended]) .icon {
|
|
35
|
-
font-size: ${FabSizeToken[size].extendedIconSize};
|
|
36
|
-
--m3e-icon-size: ${FabSizeToken[size].extendedIconSize};
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Size variant styles for `M3eFabElement`.
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export const FabSizeStyle: CSSResultGroup = [fabStyle("small"), fabStyle("medium"), fabStyle("large")];
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { CSSResult, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { DesignToken } from "@m3e/core";
|
|
4
|
-
import { FabSize } from "../FabSize";
|
|
5
|
-
|
|
6
|
-
/** @private */
|
|
7
|
-
type _FabSizeToken = {
|
|
8
|
-
containerHeight: CSSResult;
|
|
9
|
-
labelTextFontSize: CSSResult;
|
|
10
|
-
labelTextFontWeight: CSSResult;
|
|
11
|
-
labelTextLineHeight: CSSResult;
|
|
12
|
-
labelTextTracking: CSSResult;
|
|
13
|
-
iconSize: CSSResult;
|
|
14
|
-
extendedIconSize: CSSResult;
|
|
15
|
-
shape: CSSResult;
|
|
16
|
-
leadingSpace: CSSResult;
|
|
17
|
-
trailingSpace: CSSResult;
|
|
18
|
-
extendedLeadingSpace: CSSResult;
|
|
19
|
-
extendedTrailingSpace: CSSResult;
|
|
20
|
-
iconLabelSpace: CSSResult;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Component design tokens that control the `M3eFabElement` for all size variants.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export const FabSizeToken: Record<FabSize, _FabSizeToken> = {
|
|
28
|
-
/** Design tokens that control the `small` `size` variant. */
|
|
29
|
-
small: {
|
|
30
|
-
containerHeight: unsafeCSS(`calc(var(--m3e-fab-small-container-height, 3.5rem) + ${DesignToken.density.calc(-3)})`),
|
|
31
|
-
labelTextFontSize: unsafeCSS(
|
|
32
|
-
`var(--m3e-fab-small-label-text-font-size, ${DesignToken.typescale.standard.title.medium.fontSize})`
|
|
33
|
-
),
|
|
34
|
-
labelTextFontWeight: unsafeCSS(
|
|
35
|
-
`var(--m3e-fab-small-label-text-font-weight, ${DesignToken.typescale.standard.title.medium.fontWeight})`
|
|
36
|
-
),
|
|
37
|
-
labelTextLineHeight: unsafeCSS(
|
|
38
|
-
`var(--m3e-fab-small-label-text-line-height, ${DesignToken.typescale.standard.title.medium.lineHeight})`
|
|
39
|
-
),
|
|
40
|
-
labelTextTracking: unsafeCSS(
|
|
41
|
-
`var(--m3e-fab-small-label-text-tracking, ${DesignToken.typescale.standard.title.medium.tracking})`
|
|
42
|
-
),
|
|
43
|
-
iconSize: unsafeCSS(`calc(var(--m3e-fab-small-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)})`),
|
|
44
|
-
extendedIconSize: unsafeCSS("var(--m3e-fab-small-icon-size, 1.5rem)"),
|
|
45
|
-
shape: unsafeCSS(`var(--m3e-fab-small-shape, ${DesignToken.shape.corner.large})`),
|
|
46
|
-
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-small-leading-space, 1rem) + ${DesignToken.density.calc(-3)})`),
|
|
47
|
-
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-small-trailing-space, 1rem) + ${DesignToken.density.calc(-3)})`),
|
|
48
|
-
iconLabelSpace: unsafeCSS("var(--m3e-fab-small-icon-label-space, 0.5rem)"),
|
|
49
|
-
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-small-leading-space, 1rem)"),
|
|
50
|
-
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-small-trailing-space, 1rem)"),
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/** Design tokens that control the `medium` `size` variant. */
|
|
54
|
-
medium: {
|
|
55
|
-
containerHeight: unsafeCSS(`calc(var(--m3e-fab-medium-container-height, 5rem) + ${DesignToken.density.calc(-3)})`),
|
|
56
|
-
labelTextFontSize: unsafeCSS(
|
|
57
|
-
`var(--m3e-fab-medium-label-text-font-size, ${DesignToken.typescale.standard.title.large.fontSize})`
|
|
58
|
-
),
|
|
59
|
-
labelTextFontWeight: unsafeCSS(
|
|
60
|
-
`var(--m3e-fab-medium-label-text-font-weight, ${DesignToken.typescale.standard.title.large.fontWeight})`
|
|
61
|
-
),
|
|
62
|
-
labelTextLineHeight: unsafeCSS(
|
|
63
|
-
`var(--m3e-fab-medium-label-text-line-height, ${DesignToken.typescale.standard.title.large.lineHeight})`
|
|
64
|
-
),
|
|
65
|
-
labelTextTracking: unsafeCSS(
|
|
66
|
-
`var(--m3e-fab-medium-label-text-tracking, ${DesignToken.typescale.standard.title.large.tracking})`
|
|
67
|
-
),
|
|
68
|
-
iconSize: unsafeCSS(`calc(var(--m3e-fab-medium-icon-size, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
69
|
-
extendedIconSize: unsafeCSS("var(--m3e-fab-medium-icon-size, 1.75rem)"),
|
|
70
|
-
shape: unsafeCSS(`var(--m3e-fab-medium-shape, ${DesignToken.shape.corner.largeIncreased})`),
|
|
71
|
-
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-medium-leading-space, 1.625rem) + ${DesignToken.density.calc(-3)})`),
|
|
72
|
-
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-medium-trailing-space, 1.625rem) + ${DesignToken.density.calc(-3)})`),
|
|
73
|
-
iconLabelSpace: unsafeCSS("var(--m3e-fab-medium-icon-label-space, 0.75rem)"),
|
|
74
|
-
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-medium-leading-space, 1.625rem)"),
|
|
75
|
-
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-medium-trailing-space, 1.625rem)"),
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
/** Design tokens that control the `large` `size` variant. */
|
|
79
|
-
large: {
|
|
80
|
-
containerHeight: unsafeCSS(`calc(var(--m3e-fab-large-container-height, 6rem) + ${DesignToken.density.calc(-3)})`),
|
|
81
|
-
labelTextFontSize: unsafeCSS(
|
|
82
|
-
`var(--m3e-fab-large-label-text-font-size, ${DesignToken.typescale.standard.headline.small.fontSize})`
|
|
83
|
-
),
|
|
84
|
-
labelTextFontWeight: unsafeCSS(
|
|
85
|
-
`var(--m3e-fab-large-label-text-font-weight, ${DesignToken.typescale.standard.headline.small.fontWeight})`
|
|
86
|
-
),
|
|
87
|
-
labelTextLineHeight: unsafeCSS(
|
|
88
|
-
`var(--m3e-fab-large-label-text-line-height, ${DesignToken.typescale.standard.headline.small.lineHeight})`
|
|
89
|
-
),
|
|
90
|
-
labelTextTracking: unsafeCSS(
|
|
91
|
-
`var(--m3e-fab-large-label-text-tracking, ${DesignToken.typescale.standard.headline.small.tracking})`
|
|
92
|
-
),
|
|
93
|
-
iconSize: unsafeCSS(`calc(var(--m3e-fab-large-icon-size, 2.25rem) + ${DesignToken.density.calc(-3)})`),
|
|
94
|
-
extendedIconSize: unsafeCSS("var(--m3e-fab-large-icon-size, 2.25rem)"),
|
|
95
|
-
shape: unsafeCSS(`var(--m3e-fab-large-shape, ${DesignToken.shape.corner.extraLarge})`),
|
|
96
|
-
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-large-leading-space, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
97
|
-
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-large-trailing-space, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
98
|
-
iconLabelSpace: unsafeCSS("var(--m3e-fab-large-icon-label-space, 1rem)"),
|
|
99
|
-
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-large-leading-space, 1.75rem)"),
|
|
100
|
-
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-large-trailing-space, 1.75rem)"),
|
|
101
|
-
},
|
|
102
|
-
} as const;
|
package/src/styles/FabStyle.ts
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { css, CSSResultGroup, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { DesignToken } from "@m3e/core";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Baseline styles for `M3eFabElement`.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const FabStyle: CSSResultGroup = css`
|
|
10
|
-
:host {
|
|
11
|
-
display: inline-block;
|
|
12
|
-
outline: none;
|
|
13
|
-
user-select: none;
|
|
14
|
-
}
|
|
15
|
-
.base {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
vertical-align: middle;
|
|
18
|
-
display: inline-flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
position: relative;
|
|
22
|
-
width: 100%;
|
|
23
|
-
transition: ${unsafeCSS(
|
|
24
|
-
`background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`
|
|
25
|
-
)};
|
|
26
|
-
}
|
|
27
|
-
.touch {
|
|
28
|
-
position: absolute;
|
|
29
|
-
height: 3rem;
|
|
30
|
-
left: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
}
|
|
33
|
-
.wrapper {
|
|
34
|
-
width: 100%;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
display: inline-flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
}
|
|
39
|
-
.label {
|
|
40
|
-
justify-self: center;
|
|
41
|
-
flex: 1 1 auto;
|
|
42
|
-
text-align: center;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
text-overflow: ellipsis;
|
|
46
|
-
transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
47
|
-
}
|
|
48
|
-
.icon {
|
|
49
|
-
transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
50
|
-
}
|
|
51
|
-
:host(:not(:disabled):not([disabled-interactive])) {
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
}
|
|
54
|
-
:host([disabled-interactive]) {
|
|
55
|
-
cursor: not-allowed;
|
|
56
|
-
}
|
|
57
|
-
.close-icon,
|
|
58
|
-
::slotted(:not([slot])),
|
|
59
|
-
::slotted([slot="close-icon"]) {
|
|
60
|
-
font-size: inherit !important;
|
|
61
|
-
flex: none;
|
|
62
|
-
}
|
|
63
|
-
.close-icon,
|
|
64
|
-
::slotted(svg:not([slot])),
|
|
65
|
-
::slotted(svg[slot="close-icon"]) {
|
|
66
|
-
width: 1em;
|
|
67
|
-
height: 1em;
|
|
68
|
-
}
|
|
69
|
-
:host(:not([extended])) ::slotted([slot="label"]),
|
|
70
|
-
.base.-with-menu ::slotted([slot="label"]),
|
|
71
|
-
.base:not(.-with-menu) ::slotted([slot="close-icon"]),
|
|
72
|
-
.base:not(.-with-menu) .close-icon,
|
|
73
|
-
:host([aria-expanded="true"]) .base.-with-menu ::slotted(:not([slot])),
|
|
74
|
-
:host([aria-expanded="false"]) .base.-with-menu ::slotted([slot="close-icon"]),
|
|
75
|
-
:host([aria-expanded="false"]) .base.-with-menu .close-icon {
|
|
76
|
-
display: none;
|
|
77
|
-
}
|
|
78
|
-
:host([aria-expanded="true"]) .base.-with-menu {
|
|
79
|
-
border-radius: var(--m3e-fab-menu-close-button-container-shape, ${DesignToken.shape.corner.full});
|
|
80
|
-
height: calc(var(--m3e-fab-menu-close-button-container-height, 3.5rem) + ${DesignToken.density.calc(-3)});
|
|
81
|
-
}
|
|
82
|
-
:host([aria-expanded="true"]) .base.-with-menu .wrapper {
|
|
83
|
-
padding-inline-start: calc(var(--m3e-fab-menu-close-button-leading-space, 1rem) + ${DesignToken.density.calc(-3)});
|
|
84
|
-
padding-inline-end: calc(var(--m3e-fab-menu-close-button-trailing-space, 1rem) + ${DesignToken.density.calc(-3)});
|
|
85
|
-
}
|
|
86
|
-
:host([aria-expanded="true"]) .base.-with-menu .icon {
|
|
87
|
-
font-size: calc(var(--m3e-fab-menu-close-button-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)});
|
|
88
|
-
--m3e-icon-size: calc(var(--m3e-fab-menu-close-button-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)});
|
|
89
|
-
}
|
|
90
|
-
.base.-with-menu {
|
|
91
|
-
transition: height ${DesignToken.motion.spring.fastSpatial};
|
|
92
|
-
}
|
|
93
|
-
.base.-with-menu .wrapper {
|
|
94
|
-
transition: padding ${DesignToken.motion.spring.fastSpatial};
|
|
95
|
-
}
|
|
96
|
-
a {
|
|
97
|
-
all: unset;
|
|
98
|
-
display: block;
|
|
99
|
-
position: absolute;
|
|
100
|
-
top: 0px;
|
|
101
|
-
left: 0px;
|
|
102
|
-
right: 0px;
|
|
103
|
-
bottom: 0px;
|
|
104
|
-
z-index: 1;
|
|
105
|
-
}
|
|
106
|
-
@media (forced-colors: active) {
|
|
107
|
-
.base,
|
|
108
|
-
.icon {
|
|
109
|
-
transition: none;
|
|
110
|
-
}
|
|
111
|
-
.base {
|
|
112
|
-
outline-style: solid;
|
|
113
|
-
}
|
|
114
|
-
:host([variant]:not(:disabled):not([disabled-interactive])) .base {
|
|
115
|
-
background-color: ButtonFace;
|
|
116
|
-
outline-color: ButtonText;
|
|
117
|
-
}
|
|
118
|
-
:host([variant]:not(:disabled):not([disabled-interactive])) .label,
|
|
119
|
-
:host([variant]:not(:disabled):not([disabled-interactive])) .icon {
|
|
120
|
-
color: ButtonText;
|
|
121
|
-
}
|
|
122
|
-
:host([variant]:disabled) .base,
|
|
123
|
-
:host([variant][disabled-interactive]) .base {
|
|
124
|
-
outline-color: GrayText;
|
|
125
|
-
background-color: unset;
|
|
126
|
-
}
|
|
127
|
-
:host([variant]:disabled) .label,
|
|
128
|
-
:host([variant][disabled-interactive]) .label,
|
|
129
|
-
:host([variant]:disabled) .icon,
|
|
130
|
-
:host([variant][disabled-interactive]) .icon {
|
|
131
|
-
color: GrayText;
|
|
132
|
-
}
|
|
133
|
-
:host([size="small"]) .base {
|
|
134
|
-
outline-offset: calc(0px - var(--m3e-button-small-outline-thickness, 1px));
|
|
135
|
-
outline-width: var(--m3e-button-small-outline-thickness, 1px);
|
|
136
|
-
}
|
|
137
|
-
:host([size="medium"]) .base {
|
|
138
|
-
outline-offset: calc(0px - var(--m3e-button-medium-outline-thickness, 1px));
|
|
139
|
-
outline-width: var(--m3e-button-medium-outline-thickness, 1px);
|
|
140
|
-
}
|
|
141
|
-
:host([size="large"]) .base {
|
|
142
|
-
outline-offset: calc(0px - var(--m3e-button-large-outline-thickness, 0.125rem));
|
|
143
|
-
outline-width: var(--m3e-button-large-outline-thickness, 0.125rem);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
@media (prefers-reduced-motion) {
|
|
147
|
-
.base,
|
|
148
|
-
.base.resting,
|
|
149
|
-
.base.pressed,
|
|
150
|
-
.label,
|
|
151
|
-
.icon {
|
|
152
|
-
transition: none;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
`;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { css, CSSResult, CSSResultGroup, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { FabVariant } from "../FabVariant";
|
|
4
|
-
import { FabVariantToken } from "./FabVariantToken";
|
|
5
|
-
|
|
6
|
-
/** @private */
|
|
7
|
-
function fabVariantStyle(variant: FabVariant): CSSResult {
|
|
8
|
-
return css`
|
|
9
|
-
:host([variant="${unsafeCSS(variant)}"]:not([lowered])) .base {
|
|
10
|
-
background-color: ${FabVariantToken[variant].containerColor};
|
|
11
|
-
--m3e-elevation-level: ${FabVariantToken[variant].containerElevation};
|
|
12
|
-
--m3e-elevation-hover-level: ${FabVariantToken[variant].hover.containerElevation};
|
|
13
|
-
--m3e-elevation-focus-level: ${FabVariantToken[variant].focus.containerElevation};
|
|
14
|
-
--m3e-elevation-pressed-level: ${FabVariantToken[variant].pressed.containerElevation};
|
|
15
|
-
}
|
|
16
|
-
:host([variant="${unsafeCSS(variant)}"][lowered]) .base {
|
|
17
|
-
background-color: ${FabVariantToken[variant].loweredContainerColor ?? FabVariantToken[variant].containerColor};
|
|
18
|
-
--m3e-elevation-level: ${FabVariantToken[variant].loweredContainerElevation};
|
|
19
|
-
--m3e-elevation-hover-level: ${FabVariantToken[variant].hover.loweredContainerElevation};
|
|
20
|
-
--m3e-elevation-focus-level: ${FabVariantToken[variant].focus.loweredContainerElevation};
|
|
21
|
-
--m3e-elevation-pressed-level: ${FabVariantToken[variant].pressed.loweredContainerElevation};
|
|
22
|
-
}
|
|
23
|
-
:host([variant="${unsafeCSS(variant)}"]) .base {
|
|
24
|
-
--m3e-state-layer-hover-color: ${FabVariantToken[variant].hover.stateLayerColor};
|
|
25
|
-
--m3e-state-layer-hover-opacity: ${FabVariantToken[variant].hover.stateLayerOpacity};
|
|
26
|
-
--m3e-state-layer-focus-color: ${FabVariantToken[variant].focus.stateLayerColor};
|
|
27
|
-
--m3e-state-layer-focus-opacity: ${FabVariantToken[variant].focus.stateLayerOpacity};
|
|
28
|
-
--m3e-ripple-color: ${FabVariantToken[variant].pressed.stateLayerColor};
|
|
29
|
-
--m3e-ripple-opacity: ${FabVariantToken[variant].pressed.stateLayerOpacity};
|
|
30
|
-
}
|
|
31
|
-
:host([variant="${unsafeCSS(variant)}"]) .label {
|
|
32
|
-
color: ${FabVariantToken[variant].labelTextColor};
|
|
33
|
-
}
|
|
34
|
-
:host([variant="${unsafeCSS(variant)}"]:focus) .label {
|
|
35
|
-
color: ${FabVariantToken[variant].focus.labelTextColor};
|
|
36
|
-
}
|
|
37
|
-
:host([variant="${unsafeCSS(variant)}"]:hover) .label {
|
|
38
|
-
color: ${FabVariantToken[variant].hover.labelTextColor};
|
|
39
|
-
}
|
|
40
|
-
:host([variant="${unsafeCSS(variant)}"]) .base.pressed .label {
|
|
41
|
-
color: ${FabVariantToken[variant].pressed.labelTextColor};
|
|
42
|
-
}
|
|
43
|
-
:host([variant="${unsafeCSS(variant)}"]) .icon {
|
|
44
|
-
color: ${FabVariantToken[variant].iconColor};
|
|
45
|
-
}
|
|
46
|
-
:host([variant="${unsafeCSS(variant)}"]:focus) .icon {
|
|
47
|
-
color: ${FabVariantToken[variant].focus.iconColor};
|
|
48
|
-
}
|
|
49
|
-
:host([variant="${unsafeCSS(variant)}"]:hover) .icon {
|
|
50
|
-
color: ${FabVariantToken[variant].hover.iconColor};
|
|
51
|
-
}
|
|
52
|
-
:host([variant="${unsafeCSS(variant)}"]) .base.pressed .icon {
|
|
53
|
-
color: ${FabVariantToken[variant].pressed.iconColor};
|
|
54
|
-
}
|
|
55
|
-
:host([variant="${unsafeCSS(variant)}"]:disabled) .base,
|
|
56
|
-
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .base {
|
|
57
|
-
--m3e-elevation-level: ${FabVariantToken[variant].disabled.containerElevation};
|
|
58
|
-
background-color: color-mix(
|
|
59
|
-
in srgb,
|
|
60
|
-
${FabVariantToken[variant].disabled.containerColor} ${FabVariantToken[variant].disabled.containerOpacity},
|
|
61
|
-
transparent
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
:host([variant="${unsafeCSS(variant)}"]:disabled) .label,
|
|
65
|
-
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .label {
|
|
66
|
-
color: color-mix(
|
|
67
|
-
in srgb,
|
|
68
|
-
${FabVariantToken[variant].disabled.labelTextColor} ${FabVariantToken[variant].disabled.labelTextOpacity},
|
|
69
|
-
transparent
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
:host([variant="${unsafeCSS(variant)}"]:disabled) .icon,
|
|
73
|
-
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .icon {
|
|
74
|
-
color: color-mix(
|
|
75
|
-
in srgb,
|
|
76
|
-
${FabVariantToken[variant].disabled.iconColor} ${FabVariantToken[variant].disabled.iconOpacity},
|
|
77
|
-
transparent
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Appearance variant styles for `M3eFabElement`.
|
|
85
|
-
* @internal
|
|
86
|
-
*/
|
|
87
|
-
export const FabVariantStyle: CSSResultGroup = [
|
|
88
|
-
fabVariantStyle("primary"),
|
|
89
|
-
fabVariantStyle("secondary"),
|
|
90
|
-
fabVariantStyle("tertiary"),
|
|
91
|
-
fabVariantStyle("primary-container"),
|
|
92
|
-
fabVariantStyle("secondary-container"),
|
|
93
|
-
fabVariantStyle("tertiary-container"),
|
|
94
|
-
fabVariantStyle("surface"),
|
|
95
|
-
];
|