@m3e/icon-button 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 +2910 -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 +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/src/IconButtonElement.d.ts +1 -1
- package/dist/src/IconButtonElement.d.ts.map +1 -1
- package/package.json +3 -3
- package/cem.config.mjs +0 -16
- package/demo/index.html +0 -103
- package/eslint.config.mjs +0 -13
- package/rollup.config.js +0 -32
- package/src/IconButtonElement.ts +0 -514
- package/src/IconButtonShape.ts +0 -2
- package/src/IconButtonSize.ts +0 -2
- package/src/IconButtonVariant.ts +0 -2
- package/src/IconButtonWidth.ts +0 -2
- package/src/index.ts +0 -5
- package/src/styles/IconButtonSizeStyle.ts +0 -95
- package/src/styles/IconButtonSizeToken.ts +0 -215
- package/src/styles/IconButtonStyle.ts +0 -184
- package/src/styles/IconButtonVariantStyle.ts +0 -123
- package/src/styles/IconButtonVariantToken.ts +0 -854
- package/src/styles/index.ts +0 -3
- package/tsconfig.json +0 -9
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { CSSResult, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { DesignToken } from "@m3e/core";
|
|
4
|
-
|
|
5
|
-
import { IconButtonSize } from "../IconButtonSize";
|
|
6
|
-
|
|
7
|
-
/** @private */
|
|
8
|
-
type _IconButtonSizeToken = {
|
|
9
|
-
containerHeight: CSSResult;
|
|
10
|
-
outlineThickness: CSSResult;
|
|
11
|
-
iconSize: CSSResult;
|
|
12
|
-
shapeRound: CSSResult;
|
|
13
|
-
shapeSquare: CSSResult;
|
|
14
|
-
selectedShapeRound: CSSResult;
|
|
15
|
-
selectedShapeSquare: CSSResult;
|
|
16
|
-
shapePressedMorph: CSSResult;
|
|
17
|
-
narrowLeadingSpace: CSSResult;
|
|
18
|
-
narrowTrailingSpace: CSSResult;
|
|
19
|
-
defaultLeadingSpace: CSSResult;
|
|
20
|
-
defaultTrailingSpace: CSSResult;
|
|
21
|
-
wideLeadingSpace: CSSResult;
|
|
22
|
-
wideTrailingSpace: CSSResult;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Component design tokens that control the `M3eIconButtonElement` for all size variants.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export const IconButtonSizeToken: Record<IconButtonSize, _IconButtonSizeToken> = {
|
|
30
|
-
/** Design tokens that control the `extra-small` `size` variant. */
|
|
31
|
-
"extra-small": {
|
|
32
|
-
containerHeight: unsafeCSS(
|
|
33
|
-
`calc(var(--m3e-icon-button-extra-small-container-height, 2rem) + ${DesignToken.density.calc(0)})`
|
|
34
|
-
),
|
|
35
|
-
outlineThickness: unsafeCSS("var(--m3e-icon-button-extra-small-outline-thickness, 1px)"),
|
|
36
|
-
iconSize: unsafeCSS(`calc(var(--m3e-icon-button-extra-small-icon-size, 1.25rem) + ${DesignToken.density.calc(0)})`),
|
|
37
|
-
shapeRound: unsafeCSS(`var(--m3e-icon-button-extra-small-shape-round, ${DesignToken.shape.corner.full})`),
|
|
38
|
-
shapeSquare: unsafeCSS(`var(--m3e-icon-button-extra-small-shape-square, ${DesignToken.shape.corner.medium})`),
|
|
39
|
-
selectedShapeRound: unsafeCSS(
|
|
40
|
-
`var(--m3e-icon-button-extra-small-selected-shape-round, ${DesignToken.shape.corner.medium})`
|
|
41
|
-
),
|
|
42
|
-
selectedShapeSquare: unsafeCSS(
|
|
43
|
-
`var(--m3e-icon-button-extra-small-selected-shape-square, ${DesignToken.shape.corner.full})`
|
|
44
|
-
),
|
|
45
|
-
shapePressedMorph: unsafeCSS(
|
|
46
|
-
`var(--m3e-icon-button-extra-small-shape-pressed-morph, ${DesignToken.shape.corner.small})`
|
|
47
|
-
),
|
|
48
|
-
narrowLeadingSpace: unsafeCSS(
|
|
49
|
-
`calc(var(--m3e-icon-button-extra-small-narrow-leading-space, 0.25rem) + ${DesignToken.density.calc(0)})`
|
|
50
|
-
),
|
|
51
|
-
narrowTrailingSpace: unsafeCSS(
|
|
52
|
-
`calc(var(--m3e-icon-button-extra-small-narrow-trailing-space, 0.25rem) + ${DesignToken.density.calc(0)})`
|
|
53
|
-
),
|
|
54
|
-
defaultLeadingSpace: unsafeCSS(
|
|
55
|
-
`calc(var(--m3e-icon-button-extra-small-default-leading-space, 0.375rem) + ${DesignToken.density.calc(0)})`
|
|
56
|
-
),
|
|
57
|
-
defaultTrailingSpace: unsafeCSS(
|
|
58
|
-
`calc(var(--m3e-icon-button-extra-small-default-trailing-space, 0.375rem) + ${DesignToken.density.calc(0)})`
|
|
59
|
-
),
|
|
60
|
-
wideLeadingSpace: unsafeCSS(
|
|
61
|
-
`calc(var(--m3e-icon-button-extra-small-wide-leading-space, 0.625rem) + ${DesignToken.density.calc(0)})`
|
|
62
|
-
),
|
|
63
|
-
wideTrailingSpace: unsafeCSS(
|
|
64
|
-
`calc(var(--m3e-icon-button-extra-small-wide-trailing-space, 0.625rem) + ${DesignToken.density.calc(0)})`
|
|
65
|
-
),
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
/** Design tokens that control the `small` `size` variant. */
|
|
69
|
-
small: {
|
|
70
|
-
containerHeight: unsafeCSS(
|
|
71
|
-
`calc(var(--m3e-icon-button-small-container-height, 2.5rem) + ${DesignToken.density.calc(-1)})`
|
|
72
|
-
),
|
|
73
|
-
outlineThickness: unsafeCSS("var(--m3e-icon-button-small-outline-thickness, 1px)"),
|
|
74
|
-
iconSize: unsafeCSS(`calc(var(--m3e-icon-button-small-icon-size, 1.5rem) + ${DesignToken.density.calc(-1)})`),
|
|
75
|
-
shapeRound: unsafeCSS(`var(--m3e-icon-button-small-shape-round, ${DesignToken.shape.corner.full})`),
|
|
76
|
-
shapeSquare: unsafeCSS(`var(--m3e-icon-button-small-shape-square, ${DesignToken.shape.corner.medium})`),
|
|
77
|
-
selectedShapeRound: unsafeCSS(
|
|
78
|
-
`var(--m3e-icon-button-small-selected-shape-round, ${DesignToken.shape.corner.medium})`
|
|
79
|
-
),
|
|
80
|
-
selectedShapeSquare: unsafeCSS(
|
|
81
|
-
`var(--m3e-icon-button-small-selected-shape-square, ${DesignToken.shape.corner.full})`
|
|
82
|
-
),
|
|
83
|
-
shapePressedMorph: unsafeCSS(`var(--m3e-icon-button-small-shape-pressed-morph, ${DesignToken.shape.corner.small})`),
|
|
84
|
-
narrowLeadingSpace: unsafeCSS(
|
|
85
|
-
`calc(var(--m3e-icon-button-small-narrow-leading-space, 0.25rem) + ${DesignToken.density.calc(-1)})`
|
|
86
|
-
),
|
|
87
|
-
narrowTrailingSpace: unsafeCSS(
|
|
88
|
-
`calc(var(--m3e-icon-button-small-narrow-trailing-space, 0.25rem) + ${DesignToken.density.calc(-1)})`
|
|
89
|
-
),
|
|
90
|
-
defaultLeadingSpace: unsafeCSS(
|
|
91
|
-
`calc(var(--m3e-icon-button-small-default-leading-space, 0.5rem) + ${DesignToken.density.calc(-1)})`
|
|
92
|
-
),
|
|
93
|
-
defaultTrailingSpace: unsafeCSS(
|
|
94
|
-
`calc(var(--m3e-icon-button-small-default-trailing-space, 0.5rem) + ${DesignToken.density.calc(-1)})`
|
|
95
|
-
),
|
|
96
|
-
wideLeadingSpace: unsafeCSS(
|
|
97
|
-
`calc(var(--m3e-icon-button-small-wide-leading-space, 0.875rem) + ${DesignToken.density.calc(-1)})`
|
|
98
|
-
),
|
|
99
|
-
wideTrailingSpace: unsafeCSS(
|
|
100
|
-
`calc(var(--m3e-icon-button-small-wide-trailing-space, 0.875rem) + ${DesignToken.density.calc(-1)})`
|
|
101
|
-
),
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
/** Design tokens that control the `medium` `size` variant. */
|
|
105
|
-
medium: {
|
|
106
|
-
containerHeight: unsafeCSS(
|
|
107
|
-
`calc(var(--m3e-icon-button-medium-container-height, 3.5rem) + ${DesignToken.density.calc(-2)})`
|
|
108
|
-
),
|
|
109
|
-
outlineThickness: unsafeCSS("var(--m3e-icon-button-medium-outline-thickness, 1px)"),
|
|
110
|
-
iconSize: unsafeCSS(`calc(var(--m3e-icon-button-medium-icon-size, 1.5rem) + ${DesignToken.density.calc(-2)})`),
|
|
111
|
-
shapeRound: unsafeCSS(`var(--m3e-icon-button-medium-shape-round, ${DesignToken.shape.corner.full})`),
|
|
112
|
-
shapeSquare: unsafeCSS(`var(--m3e-icon-button-medium-shape-square, ${DesignToken.shape.corner.large})`),
|
|
113
|
-
selectedShapeRound: unsafeCSS(
|
|
114
|
-
`var(--m3e-icon-button-medium-selected-shape-round, ${DesignToken.shape.corner.large})`
|
|
115
|
-
),
|
|
116
|
-
selectedShapeSquare: unsafeCSS(
|
|
117
|
-
`var(--m3e-icon-button-medium-selected-shape-square, ${DesignToken.shape.corner.full})`
|
|
118
|
-
),
|
|
119
|
-
shapePressedMorph: unsafeCSS(
|
|
120
|
-
`var(--m3e-icon-button-medium-shape-pressed-morph, ${DesignToken.shape.corner.medium})`
|
|
121
|
-
),
|
|
122
|
-
narrowLeadingSpace: unsafeCSS(
|
|
123
|
-
`calc(var(--m3e-icon-button-medium-narrow-leading-space, 0.75rem) + ${DesignToken.density.calc(-2)})`
|
|
124
|
-
),
|
|
125
|
-
narrowTrailingSpace: unsafeCSS(
|
|
126
|
-
`calc(var(--m3e-icon-button-medium-narrow-trailing-space, 0.75rem) + ${DesignToken.density.calc(-2)})`
|
|
127
|
-
),
|
|
128
|
-
defaultLeadingSpace: unsafeCSS(
|
|
129
|
-
`calc(var(--m3e-icon-button-medium-default-leading-space, 1rem) + ${DesignToken.density.calc(-2)})`
|
|
130
|
-
),
|
|
131
|
-
defaultTrailingSpace: unsafeCSS(
|
|
132
|
-
`calc(var(--m3e-icon-button-medium-default-trailing-space, 1rem) + ${DesignToken.density.calc(-2)})`
|
|
133
|
-
),
|
|
134
|
-
wideLeadingSpace: unsafeCSS(
|
|
135
|
-
`calc(var(--m3e-icon-button-medium-wide-leading-space, 1.5rem) + ${DesignToken.density.calc(-2)})`
|
|
136
|
-
),
|
|
137
|
-
wideTrailingSpace: unsafeCSS(
|
|
138
|
-
`calc(var(--m3e-icon-button-medium-wide-trailing-space, 1.5rem) + ${DesignToken.density.calc(-2)})`
|
|
139
|
-
),
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
/** Design tokens that control the `large` `size` variant. */
|
|
143
|
-
large: {
|
|
144
|
-
containerHeight: unsafeCSS(
|
|
145
|
-
`calc(var(--m3e-icon-button-large-container-height, 6rem) + ${DesignToken.density.calc(-3)})`
|
|
146
|
-
),
|
|
147
|
-
outlineThickness: unsafeCSS("var(--m3e-icon-button-large-outline-thickness, 0.125rem)"),
|
|
148
|
-
iconSize: unsafeCSS(`calc(var(--m3e-icon-button-large-icon-size, 2rem) + ${DesignToken.density.calc(-3)})`),
|
|
149
|
-
shapeRound: unsafeCSS(`var(--m3e-icon-button-large-shape-round, ${DesignToken.shape.corner.full})`),
|
|
150
|
-
shapeSquare: unsafeCSS(`var(--m3e-icon-button-large-shape-square, ${DesignToken.shape.corner.extraLarge})`),
|
|
151
|
-
selectedShapeRound: unsafeCSS(
|
|
152
|
-
`var(--m3e-icon-button-large-selected-shape-round, ${DesignToken.shape.corner.extraLarge})`
|
|
153
|
-
),
|
|
154
|
-
selectedShapeSquare: unsafeCSS(
|
|
155
|
-
`var(--m3e-icon-button-large-selected-shape-square, ${DesignToken.shape.corner.full})`
|
|
156
|
-
),
|
|
157
|
-
shapePressedMorph: unsafeCSS(`var(--m3e-icon-button-large-shape-pressed-morph, ${DesignToken.shape.corner.large})`),
|
|
158
|
-
narrowLeadingSpace: unsafeCSS(
|
|
159
|
-
`calc(var(--m3e-icon-button-large-narrow-leading-space, 1rem) + ${DesignToken.density.calc(-3)})`
|
|
160
|
-
),
|
|
161
|
-
narrowTrailingSpace: unsafeCSS(
|
|
162
|
-
`calc(var(--m3e-icon-button-large-narrow-trailing-space, 1rem) + ${DesignToken.density.calc(-3)})`
|
|
163
|
-
),
|
|
164
|
-
defaultLeadingSpace: unsafeCSS(
|
|
165
|
-
`calc(var(--m3e-icon-button-large-default-leading-space, 2rem) + ${DesignToken.density.calc(-3)})`
|
|
166
|
-
),
|
|
167
|
-
defaultTrailingSpace: unsafeCSS(
|
|
168
|
-
`calc(var(--m3e-icon-button-large-default-trailing-space, 2rem) + ${DesignToken.density.calc(-3)})`
|
|
169
|
-
),
|
|
170
|
-
wideLeadingSpace: unsafeCSS(
|
|
171
|
-
`calc(var(--m3e-icon-button-large-wide-leading-space, 3rem) + ${DesignToken.density.calc(-3)})`
|
|
172
|
-
),
|
|
173
|
-
wideTrailingSpace: unsafeCSS(
|
|
174
|
-
`calc(var(--m3e-icon-button-large-wide-trailing-space, 3rem) + ${DesignToken.density.calc(-3)})`
|
|
175
|
-
),
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
/** Design tokens that control the `extra-large` `size` variant. */
|
|
179
|
-
"extra-large": {
|
|
180
|
-
containerHeight: unsafeCSS(
|
|
181
|
-
`calc(var(--m3e-icon-button-extra-large-container-height, 8.5rem) + ${DesignToken.density.calc(-3)})`
|
|
182
|
-
),
|
|
183
|
-
outlineThickness: unsafeCSS("var(--m3e-icon-button-extra-large-outline-thickness, 0.1875rem)"),
|
|
184
|
-
iconSize: unsafeCSS(`calc(var(--m3e-icon-button-extra-large-icon-size, 2.5rem) + ${DesignToken.density.calc(-3)})`),
|
|
185
|
-
shapeRound: unsafeCSS(`var(--m3e-icon-button-extra-large-shape-round, ${DesignToken.shape.corner.full})`),
|
|
186
|
-
shapeSquare: unsafeCSS(`var(--m3e-icon-button-extra-large-shape-square, ${DesignToken.shape.corner.extraLarge})`),
|
|
187
|
-
selectedShapeRound: unsafeCSS(
|
|
188
|
-
`var(--m3e-icon-button-extra-large-selected-shape-round, ${DesignToken.shape.corner.extraLarge})`
|
|
189
|
-
),
|
|
190
|
-
selectedShapeSquare: unsafeCSS(
|
|
191
|
-
`var(--m3e-icon-button-extra-large-selected-shape-square, ${DesignToken.shape.corner.full})`
|
|
192
|
-
),
|
|
193
|
-
shapePressedMorph: unsafeCSS(
|
|
194
|
-
`var(--m3e-icon-button-extra-large-shape-pressed-morph, ${DesignToken.shape.corner.large})`
|
|
195
|
-
),
|
|
196
|
-
narrowLeadingSpace: unsafeCSS(
|
|
197
|
-
`calc(var(--m3e-icon-button-extra-large-narrow-leading-space, 2rem) + ${DesignToken.density.calc(-3)})`
|
|
198
|
-
),
|
|
199
|
-
narrowTrailingSpace: unsafeCSS(
|
|
200
|
-
`calc(var(--m3e-icon-button-extra-large-narrow-trailing-space, 2rem) + ${DesignToken.density.calc(-3)})`
|
|
201
|
-
),
|
|
202
|
-
defaultLeadingSpace: unsafeCSS(
|
|
203
|
-
`calc(var(--m3e-icon-button-extra-large-default-leading-space, 3rem) + ${DesignToken.density.calc(-3)})`
|
|
204
|
-
),
|
|
205
|
-
defaultTrailingSpace: unsafeCSS(
|
|
206
|
-
`calc(var(--m3e-icon-button-extra-large-default-trailing-space, 3rem) + ${DesignToken.density.calc(-3)})`
|
|
207
|
-
),
|
|
208
|
-
wideLeadingSpace: unsafeCSS(
|
|
209
|
-
`calc(var(--m3e-icon-button-extra-large-wide-leading-space, 4.5rem) + ${DesignToken.density.calc(-3)})`
|
|
210
|
-
),
|
|
211
|
-
wideTrailingSpace: unsafeCSS(
|
|
212
|
-
`calc(var(--m3e-icon-button-extra-large-wide-trailing-space, 4.5rem) + ${DesignToken.density.calc(-3)})`
|
|
213
|
-
),
|
|
214
|
-
},
|
|
215
|
-
} as const;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { css, CSSResultGroup, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { DesignToken } from "@m3e/core";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Baseline styles for `M3eIconButtonElement`.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const IconButtonStyle: 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
|
-
aspect-ratio: 1 / 1;
|
|
30
|
-
height: 3rem;
|
|
31
|
-
left: auto;
|
|
32
|
-
right: auto;
|
|
33
|
-
}
|
|
34
|
-
:host(.-pressed) .base,
|
|
35
|
-
:host(.-resting) .base {
|
|
36
|
-
transition: ${unsafeCSS(`background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard},
|
|
37
|
-
border-radius ${DesignToken.motion.spring.fastEffects}`)};
|
|
38
|
-
}
|
|
39
|
-
.wrapper {
|
|
40
|
-
width: 100%;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
transition: ${unsafeCSS(`padding-inline ${DesignToken.motion.spring.fastEffects}`)};
|
|
46
|
-
}
|
|
47
|
-
.icon {
|
|
48
|
-
transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
49
|
-
|
|
50
|
-
--m3e-icon-size: 1em;
|
|
51
|
-
}
|
|
52
|
-
:host(:not(:disabled):not([disabled-interactive])) {
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
}
|
|
55
|
-
:host([disabled-interactive]) {
|
|
56
|
-
cursor: not-allowed;
|
|
57
|
-
}
|
|
58
|
-
::slotted(*) {
|
|
59
|
-
font-size: inherit !important;
|
|
60
|
-
flex: none;
|
|
61
|
-
transform: var(--_icon-button-icon-transform);
|
|
62
|
-
transform-origin: center center;
|
|
63
|
-
transition: ${unsafeCSS(
|
|
64
|
-
`transform var(--_icon-button-icon-transform-transition, ${DesignToken.motion.spring.fastEffects})`
|
|
65
|
-
)};
|
|
66
|
-
}
|
|
67
|
-
::slotted(svg) {
|
|
68
|
-
width: 1em;
|
|
69
|
-
height: 1em;
|
|
70
|
-
}
|
|
71
|
-
:host([toggle]:not([selected])) .base.with-selected-icon slot[name="selected"],
|
|
72
|
-
:host([toggle][selected]) .base.with-selected-icon slot:not([name]) {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
a {
|
|
76
|
-
all: unset;
|
|
77
|
-
display: block;
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: 0px;
|
|
80
|
-
left: 0px;
|
|
81
|
-
right: 0px;
|
|
82
|
-
bottom: 0px;
|
|
83
|
-
z-index: 1;
|
|
84
|
-
}
|
|
85
|
-
:host(.-grouped.-connected) {
|
|
86
|
-
flex: 1 1 auto;
|
|
87
|
-
}
|
|
88
|
-
:host(.-grouped:not(.-connected):not(.-adjacent-pressed):not(.-pressed)) {
|
|
89
|
-
flex-shrink: 0;
|
|
90
|
-
flex-grow: 0;
|
|
91
|
-
}
|
|
92
|
-
:host(.-grouped:not(.-connected).-adjacent-pressed:not(.-pressed)) {
|
|
93
|
-
flex-shrink: 1;
|
|
94
|
-
min-width: 0;
|
|
95
|
-
}
|
|
96
|
-
:host(.-grouped:not(.-connected).-adjacent-pressed:not(.-pressed)) .label {
|
|
97
|
-
text-overflow: clip;
|
|
98
|
-
}
|
|
99
|
-
:host(.-grouped:not(.-connected).-pressed:not([disabled-interactive]):not(:disabled)) {
|
|
100
|
-
flex-shrink: 0;
|
|
101
|
-
flex-basis: calc(
|
|
102
|
-
var(--_button-width) + calc(var(--_button-width) * var(--m3e-standard-button-group-width-multiplier, 0.15))
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
@media (forced-colors: active) {
|
|
106
|
-
.base,
|
|
107
|
-
.icon {
|
|
108
|
-
transition: none;
|
|
109
|
-
}
|
|
110
|
-
:host(.-pressed) .base,
|
|
111
|
-
:host(.-resting) .base {
|
|
112
|
-
transition: border-radius ${DesignToken.motion.spring.fastEffects};
|
|
113
|
-
}
|
|
114
|
-
:host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .base {
|
|
115
|
-
background-color: ButtonFace;
|
|
116
|
-
outline-color: ButtonText;
|
|
117
|
-
}
|
|
118
|
-
:host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .label,
|
|
119
|
-
:host([variant]:not(:disabled):not([disabled-interactive]):not([toggle])) .icon {
|
|
120
|
-
color: ButtonText;
|
|
121
|
-
}
|
|
122
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .base {
|
|
123
|
-
background-color: ButtonFace;
|
|
124
|
-
outline-color: ButtonText;
|
|
125
|
-
}
|
|
126
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .label,
|
|
127
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle]:not([selected])) .icon {
|
|
128
|
-
color: ButtonText;
|
|
129
|
-
}
|
|
130
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .base {
|
|
131
|
-
background-color: ButtonText;
|
|
132
|
-
outline: none;
|
|
133
|
-
}
|
|
134
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .label,
|
|
135
|
-
:host([variant]:not(:disabled):not([disabled-interactive])[toggle][selected]) .icon {
|
|
136
|
-
forced-color-adjust: none;
|
|
137
|
-
color: ButtonFace;
|
|
138
|
-
background-color: ButtonText;
|
|
139
|
-
}
|
|
140
|
-
:host([variant]:disabled) .base,
|
|
141
|
-
:host([variant][disabled-interactive]) .base {
|
|
142
|
-
outline-color: GrayText;
|
|
143
|
-
background-color: unset;
|
|
144
|
-
}
|
|
145
|
-
:host([variant]:disabled) .label,
|
|
146
|
-
:host([variant][disabled-interactive]) .label,
|
|
147
|
-
:host([variant]:disabled) .icon,
|
|
148
|
-
:host([variant][disabled-interactive]) .icon {
|
|
149
|
-
color: GrayText;
|
|
150
|
-
}
|
|
151
|
-
.base {
|
|
152
|
-
outline-style: solid;
|
|
153
|
-
}
|
|
154
|
-
:host([size="extra-small"]) .base {
|
|
155
|
-
outline-offset: calc(0px - var(--m3e-icon-button-extra-small-outline-thickness, 1px));
|
|
156
|
-
outline-width: var(--m3e-icon-button-extra-small-outline-thickness, 1px);
|
|
157
|
-
}
|
|
158
|
-
:host([size="small"]) .base {
|
|
159
|
-
outline-offset: calc(0px - var(--m3e-icon-button-small-outline-thickness, 1px));
|
|
160
|
-
outline-width: var(--m3e-icon-button-small-outline-thickness, 1px);
|
|
161
|
-
}
|
|
162
|
-
:host([size="medium"]) .base {
|
|
163
|
-
outline-offset: calc(0px - var(--m3e-icon-button-medium-outline-thickness, 1px));
|
|
164
|
-
outline-width: var(--m3e-icon-button-medium-outline-thickness, 1px);
|
|
165
|
-
}
|
|
166
|
-
:host([size="large"]) .base {
|
|
167
|
-
outline-offset: calc(0px - var(--m3e-icon-button-large-outline-thickness, 0.125rem));
|
|
168
|
-
outline-width: var(--m3e-icon-button-large-outline-thickness, 0.125rem);
|
|
169
|
-
}
|
|
170
|
-
:host([size="extra-large"]) .base {
|
|
171
|
-
outline-offset: calc(0px - var(--m3e-icon-button-extra-large-outline-thickness, 0.1875rem));
|
|
172
|
-
outline-width: var(--m3e-icon-button-extra-large-outline-thickness, 0.1875rem);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
@media (prefers-reduced-motion) {
|
|
176
|
-
:host(.-pressed) .base,
|
|
177
|
-
:host(.-resting) .base,
|
|
178
|
-
.base,
|
|
179
|
-
.wrapper,
|
|
180
|
-
.icon {
|
|
181
|
-
transition: none;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { css, CSSResult, CSSResultGroup, unsafeCSS } from "lit";
|
|
2
|
-
|
|
3
|
-
import { IconButtonVariant } from "../IconButtonVariant";
|
|
4
|
-
import { IconButtonVariantToken } from "./IconButtonVariantToken";
|
|
5
|
-
|
|
6
|
-
/** @private */
|
|
7
|
-
function iconButtonVariantStyle(variant: IconButtonVariant | "elevated"): CSSResult {
|
|
8
|
-
return css`
|
|
9
|
-
:host([variant="${unsafeCSS(variant)}"]:not(:disabled):not([disabled-interactive])) .base {
|
|
10
|
-
background-color: ${IconButtonVariantToken[variant].containerColor ?? unsafeCSS("unset")};
|
|
11
|
-
--m3e-state-layer-hover-color: ${IconButtonVariantToken[variant].hover.stateLayerColor};
|
|
12
|
-
--m3e-state-layer-hover-opacity: ${IconButtonVariantToken[variant].hover.stateLayerOpacity};
|
|
13
|
-
--m3e-state-layer-focus-color: ${IconButtonVariantToken[variant].focus.stateLayerColor};
|
|
14
|
-
--m3e-state-layer-focus-opacity: ${IconButtonVariantToken[variant].focus.stateLayerOpacity};
|
|
15
|
-
--m3e-ripple-color: ${IconButtonVariantToken[variant].pressed.stateLayerColor};
|
|
16
|
-
--m3e-ripple-opacity: ${IconButtonVariantToken[variant].pressed.stateLayerOpacity};
|
|
17
|
-
--m3e-elevation-level: ${IconButtonVariantToken[variant].containerElevation ?? unsafeCSS("unset")};
|
|
18
|
-
--m3e-elevation-hover-level: ${IconButtonVariantToken[variant].hover.containerElevation ?? unsafeCSS("unset")};
|
|
19
|
-
--m3e-elevation-focus-level: ${IconButtonVariantToken[variant].focus.containerElevation ?? unsafeCSS("unset")};
|
|
20
|
-
--m3e-elevation-pressed-level: ${IconButtonVariantToken[variant].pressed.containerElevation ??
|
|
21
|
-
unsafeCSS("unset")};
|
|
22
|
-
}
|
|
23
|
-
:host([variant="${unsafeCSS(variant)}"][toggle]:not([selected]):not(:disabled):not([disabled-interactive])) .base {
|
|
24
|
-
background-color: ${IconButtonVariantToken[variant].unselectedContainerColor ?? unsafeCSS("unset")};
|
|
25
|
-
--m3e-state-layer-hover-color: ${IconButtonVariantToken[variant].hover.unselectedStateLayerColor};
|
|
26
|
-
--m3e-state-layer-focus-color: ${IconButtonVariantToken[variant].focus.unselectedStateLayerColor};
|
|
27
|
-
--m3e-ripple-color: ${IconButtonVariantToken[variant].pressed.unselectedStateLayerColor};
|
|
28
|
-
}
|
|
29
|
-
:host([variant="${unsafeCSS(variant)}"][toggle][selected]:not(:disabled):not([disabled-interactive])) .base {
|
|
30
|
-
background-color: ${IconButtonVariantToken[variant].selectedContainerColor ?? unsafeCSS("unset")};
|
|
31
|
-
--m3e-state-layer-hover-color: ${IconButtonVariantToken[variant].hover.selectedStateLayerColor};
|
|
32
|
-
--m3e-state-layer-focus-color: ${IconButtonVariantToken[variant].focus.selectedStateLayerColor};
|
|
33
|
-
--m3e-ripple-color: ${IconButtonVariantToken[variant].pressed.selectedStateLayerColor};
|
|
34
|
-
}
|
|
35
|
-
:host([variant="${unsafeCSS(variant)}"]:not(:disabled):not([disabled-interactive])) .base {
|
|
36
|
-
outline-color: ${IconButtonVariantToken[variant].outlineColor ?? unsafeCSS("unset")};
|
|
37
|
-
}
|
|
38
|
-
:host([variant="${unsafeCSS(variant)}"]:focus:not(:disabled):not([disabled-interactive])) .base {
|
|
39
|
-
outline-color: ${IconButtonVariantToken[variant].focus.outlineColor ?? unsafeCSS("unset")};
|
|
40
|
-
}
|
|
41
|
-
:host([variant="${unsafeCSS(variant)}"]:hover:not(:disabled):not([disabled-interactive])) .base {
|
|
42
|
-
outline-color: ${IconButtonVariantToken[variant].hover.outlineColor ?? unsafeCSS("unset")};
|
|
43
|
-
}
|
|
44
|
-
:host([variant="${unsafeCSS(variant)}"].-pressed:not(:disabled):not([disabled-interactive])) .base {
|
|
45
|
-
outline-color: ${IconButtonVariantToken[variant].pressed.outlineColor ?? unsafeCSS("unset")};
|
|
46
|
-
}
|
|
47
|
-
:host([variant="${unsafeCSS(variant)}"]:not(:disabled):not([disabled-interactive])) .icon {
|
|
48
|
-
color: ${IconButtonVariantToken[variant].iconColor};
|
|
49
|
-
}
|
|
50
|
-
:host([variant="${unsafeCSS(variant)}"][toggle]:not([selected]):not(:disabled):not([disabled-interactive])) .icon {
|
|
51
|
-
color: ${IconButtonVariantToken[variant].unselectedIconColor};
|
|
52
|
-
}
|
|
53
|
-
:host([variant="${unsafeCSS(variant)}"][toggle][selected]:not(:disabled):not([disabled-interactive])) .icon {
|
|
54
|
-
color: ${IconButtonVariantToken[variant].selectedIconColor};
|
|
55
|
-
}
|
|
56
|
-
:host([variant="${unsafeCSS(variant)}"]:focus:not(:disabled):not([disabled-interactive])) .icon {
|
|
57
|
-
color: ${IconButtonVariantToken[variant].focus.iconColor};
|
|
58
|
-
}
|
|
59
|
-
:host([variant="${unsafeCSS(variant)}"][toggle]:not([selected]):focus:not(:disabled):not([disabled-interactive]))
|
|
60
|
-
.icon {
|
|
61
|
-
color: ${IconButtonVariantToken[variant].focus.unselectedIconColor};
|
|
62
|
-
}
|
|
63
|
-
:host([variant="${unsafeCSS(variant)}"][toggle][selected]:focus:not(:disabled):not([disabled-interactive])) .icon {
|
|
64
|
-
color: ${IconButtonVariantToken[variant].focus.selectedIconColor};
|
|
65
|
-
}
|
|
66
|
-
:host([variant="${unsafeCSS(variant)}"]:hover:not(:disabled):not([disabled-interactive])) .icon {
|
|
67
|
-
color: ${IconButtonVariantToken[variant].hover.iconColor};
|
|
68
|
-
}
|
|
69
|
-
:host([variant="${unsafeCSS(variant)}"][toggle]:not([selected]):hover:not(:disabled):not([disabled-interactive]))
|
|
70
|
-
.icon {
|
|
71
|
-
color: ${IconButtonVariantToken[variant].hover.unselectedIconColor};
|
|
72
|
-
}
|
|
73
|
-
:host([variant="${unsafeCSS(variant)}"][toggle][selected]:hover:not(:disabled):not([disabled-interactive])) .icon {
|
|
74
|
-
color: ${IconButtonVariantToken[variant].hover.selectedIconColor};
|
|
75
|
-
}
|
|
76
|
-
:host([variant="${unsafeCSS(variant)}"].-pressed:not(:disabled):not([disabled-interactive])) .icon {
|
|
77
|
-
color: ${IconButtonVariantToken[variant].pressed.iconColor};
|
|
78
|
-
}
|
|
79
|
-
:host([variant="${unsafeCSS(variant)}"][toggle]:not([selected]).-pressed:not(:disabled):not([disabled-interactive]))
|
|
80
|
-
.icon {
|
|
81
|
-
color: ${IconButtonVariantToken[variant].pressed.unselectedIconColor};
|
|
82
|
-
}
|
|
83
|
-
:host([variant="${unsafeCSS(variant)}"][toggle][selected].-pressed:not(:disabled):not([disabled-interactive]))
|
|
84
|
-
.icon {
|
|
85
|
-
color: ${IconButtonVariantToken[variant].pressed.selectedIconColor};
|
|
86
|
-
}
|
|
87
|
-
:host([variant="${unsafeCSS(variant)}"]:disabled) .base,
|
|
88
|
-
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .base {
|
|
89
|
-
outline-color: ${IconButtonVariantToken[variant].disabled.outlineColor ?? unsafeCSS("unset")};
|
|
90
|
-
background-color: color-mix(
|
|
91
|
-
in srgb,
|
|
92
|
-
${IconButtonVariantToken[variant].disabled.containerColor}
|
|
93
|
-
${IconButtonVariantToken[variant].disabled.containerOpacity},
|
|
94
|
-
transparent
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
:host([variant="${unsafeCSS(variant)}"]:disabled) .icon,
|
|
98
|
-
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .icon {
|
|
99
|
-
color: color-mix(
|
|
100
|
-
in srgb,
|
|
101
|
-
${IconButtonVariantToken[variant].disabled.iconColor} ${IconButtonVariantToken[variant].disabled.iconOpacity},
|
|
102
|
-
transparent
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Appearance variant styles for `M3eIconButtonElement`.
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
|
-
export const IconButtonVariantStyle: CSSResultGroup = [
|
|
113
|
-
iconButtonVariantStyle("standard"),
|
|
114
|
-
iconButtonVariantStyle("outlined"),
|
|
115
|
-
iconButtonVariantStyle("filled"),
|
|
116
|
-
iconButtonVariantStyle("tonal"),
|
|
117
|
-
iconButtonVariantStyle("elevated"),
|
|
118
|
-
css`
|
|
119
|
-
:host([variant="outlined"]) .base {
|
|
120
|
-
outline-style: solid;
|
|
121
|
-
}
|
|
122
|
-
`,
|
|
123
|
-
];
|