m3-svelte 5.15.5 → 6.0.0
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/package/buttons/Button.svelte +137 -131
- package/package/buttons/ConnectedButtons.svelte +1 -1
- package/package/buttons/FAB.svelte +27 -20
- package/package/buttons/SplitButton.svelte +26 -19
- package/package/containers/BottomSheet.svelte +7 -7
- package/package/containers/Card.svelte +12 -12
- package/package/containers/Dialog.svelte +33 -44
- package/package/containers/Dialog.svelte.d.ts +0 -8
- package/package/containers/ListItem.svelte +43 -11
- package/package/containers/Menu.svelte +3 -3
- package/package/containers/MenuItem.svelte +13 -6
- package/package/containers/Snackbar.svelte +49 -45
- package/package/containers/Snackbar.svelte.d.ts +4 -17
- package/package/containers/SnackbarItem.svelte +6 -6
- package/package/containers/StandardSideSheet.svelte +11 -2
- package/package/forms/Checkbox.svelte +12 -12
- package/package/forms/Chip.svelte +28 -18
- package/package/forms/CircularProgress.svelte +3 -3
- package/package/forms/CircularProgressEstimate.svelte +2 -2
- package/package/forms/DateField.svelte +30 -18
- package/package/forms/DateFieldOutlined.svelte +39 -27
- package/package/forms/DatePickerDocked.svelte +2 -2
- package/package/forms/LinearProgress.svelte +5 -5
- package/package/forms/LinearProgressEstimate.svelte +4 -4
- package/package/forms/LoadingIndicator.svelte +4 -4
- package/package/forms/RadioAnim1.svelte +9 -9
- package/package/forms/RadioAnim2.svelte +9 -9
- package/package/forms/RadioAnim3.svelte +9 -9
- package/package/forms/Select.svelte +43 -35
- package/package/forms/SelectOutlined.svelte +44 -36
- package/package/forms/Slider.svelte +35 -30
- package/package/forms/Switch.svelte +27 -28
- package/package/forms/TextField.svelte +41 -29
- package/package/forms/TextFieldMultiline.svelte +41 -29
- package/package/forms/TextFieldOutlined.svelte +41 -29
- package/package/forms/TextFieldOutlinedMultiline.svelte +41 -29
- package/package/forms/WavyLinearProgress.svelte +2 -7
- package/package/forms/WavyLinearProgressEstimate.svelte +2 -7
- package/package/forms/_picker/CalendarPicker.svelte +9 -2
- package/package/forms/_picker/FocusPicker.svelte +9 -7
- package/package/forms/_picker/Header.svelte +12 -5
- package/package/forms/_picker/Item.svelte +15 -8
- package/package/index.d.ts +4 -8
- package/package/index.js +4 -7
- package/package/{utils → misc}/Divider.svelte +1 -1
- package/package/misc/Icon.svelte +0 -4
- package/package/misc/Layer.svelte +1 -1
- package/package/{utils → misc}/badge.js +8 -5
- package/package/misc/recommended-styles.css +9 -9
- package/package/misc/styles.css +160 -227
- package/package/misc/tailwind-styles.css +199 -107
- package/package/misc/utils.js +2 -4
- package/package/nav/NavCMLX.svelte +65 -29
- package/package/nav/NavCMLX.svelte.d.ts +1 -1
- package/package/nav/NavCMLXItem.svelte +359 -188
- package/package/nav/NavCMLXItem.svelte.d.ts +4 -7
- package/package/nav/Tabs.svelte +19 -10
- package/package/nav/TabsLink.svelte +19 -10
- package/package/nav/VariableTabs.svelte +18 -9
- package/package/nav/VariableTabsLink.svelte +18 -9
- package/package.json +16 -13
- package/package/containers/NewSnackbar.svelte +0 -113
- package/package/containers/NewSnackbar.svelte.d.ts +0 -7
- package/package/forms/CircularProgressIndeterminate.svelte +0 -62
- package/package/forms/CircularProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/LinearProgressIndeterminate.svelte +0 -57
- package/package/forms/LinearProgressIndeterminate.svelte.d.ts +0 -5
- package/package/forms/SliderTicks.svelte +0 -12
- package/package/forms/SliderTicks.svelte.d.ts +0 -18
- /package/package/{utils → misc}/ChipChooser.svelte +0 -0
- /package/package/{utils → misc}/ChipChooser.svelte.d.ts +0 -0
- /package/package/{utils → misc}/Divider.svelte.d.ts +0 -0
- /package/package/{utils → misc}/badge.d.ts +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { IconifyIcon } from "@iconify/types";
|
|
3
|
-
import type { HTMLButtonAttributes
|
|
3
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
+
import type { AnchorAttrs } from "../misc/typing-utils";
|
|
4
5
|
import Icon from "../misc/Icon.svelte";
|
|
5
6
|
import Layer from "../misc/Layer.svelte";
|
|
6
7
|
|
|
7
|
-
type ActionProps =
|
|
8
|
-
| ({ click?: () => void } & HTMLButtonAttributes) // deprecated: drop in favour of `onclick`
|
|
9
|
-
| ({ href: string } & HTMLAnchorAttributes);
|
|
8
|
+
type ActionProps = AnchorAttrs | HTMLButtonAttributes;
|
|
10
9
|
let {
|
|
11
10
|
variant,
|
|
12
11
|
icon,
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
selected,
|
|
15
14
|
...props
|
|
16
15
|
}: {
|
|
17
|
-
variant: "compact" | "medium" | "large" | "
|
|
16
|
+
variant: "compact" | "medium" | "large" | "extra-large" | "auto";
|
|
18
17
|
icon: IconifyIcon;
|
|
19
18
|
text: string;
|
|
20
19
|
selected: boolean;
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
</script>
|
|
23
22
|
|
|
24
23
|
{#if "href" in props}
|
|
25
|
-
<a class="m3-container
|
|
24
|
+
<a class="m3-container {variant}" {...props}>
|
|
26
25
|
<div class="content" class:selected>
|
|
27
26
|
<Layer />
|
|
28
27
|
<div class="icon">
|
|
@@ -32,14 +31,7 @@
|
|
|
32
31
|
</div>
|
|
33
32
|
</a>
|
|
34
33
|
{:else}
|
|
35
|
-
|
|
36
|
-
<button
|
|
37
|
-
type="button"
|
|
38
|
-
onclick={click}
|
|
39
|
-
class="m3-container m3-font-label-medium {variant}"
|
|
40
|
-
disabled={selected}
|
|
41
|
-
{...extra}
|
|
42
|
-
>
|
|
34
|
+
<button type="button" class="m3-container {variant}" disabled={selected} {...props}>
|
|
43
35
|
<div class="content" class:selected>
|
|
44
36
|
<Layer />
|
|
45
37
|
<div class="icon">
|
|
@@ -51,7 +43,96 @@
|
|
|
51
43
|
{/if}
|
|
52
44
|
|
|
53
45
|
<style>
|
|
46
|
+
@mixin --cmlxi-compact {
|
|
47
|
+
height: 4rem;
|
|
48
|
+
padding-block: 0.375rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin --cmlxi-horizontal {
|
|
52
|
+
.content {
|
|
53
|
+
padding-inline: 1rem;
|
|
54
|
+
border-radius: var(--m3-shape-full);
|
|
55
|
+
}
|
|
56
|
+
.content.selected {
|
|
57
|
+
background-color: var(--m3c-secondary-container);
|
|
58
|
+
color: var(--m3c-on-secondary-container);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin --cmlxi-vertical {
|
|
63
|
+
.content {
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
text-align: center;
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
> .icon {
|
|
69
|
+
background-color: --translucent(currentColor, 0.08);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:focus-visible,
|
|
74
|
+
&:active {
|
|
75
|
+
> .icon {
|
|
76
|
+
background-color: --translucent(currentColor, 0.12);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
> .icon {
|
|
81
|
+
width: 3.5rem;
|
|
82
|
+
height: 2rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.content.selected {
|
|
91
|
+
color: var(--m3c-secondary);
|
|
92
|
+
> .icon {
|
|
93
|
+
color: var(--m3c-on-secondary-container);
|
|
94
|
+
}
|
|
95
|
+
> .icon::before {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
width: 100%;
|
|
98
|
+
inset: 0;
|
|
99
|
+
transition:
|
|
100
|
+
width var(--m3-easing-fast-spatial),
|
|
101
|
+
inset var(--m3-easing-fast-spatial);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@mixin --cmlxi-medium {
|
|
107
|
+
height: 4rem;
|
|
108
|
+
padding-block: 0.75rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@mixin --cmlxi-large {
|
|
112
|
+
height: 4rem;
|
|
113
|
+
.content {
|
|
114
|
+
padding-block: 0.375rem;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@mixin --cmlxi-extra-large {
|
|
119
|
+
@apply --m3-label-large;
|
|
120
|
+
height: 3.5rem;
|
|
121
|
+
padding-inline: 1.25rem;
|
|
122
|
+
|
|
123
|
+
.content {
|
|
124
|
+
gap: 0.75rem;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
54
128
|
.m3-container {
|
|
129
|
+
|
|
130
|
+
font-family: var(--m3-font);
|
|
131
|
+
font-size: 0.75rem;
|
|
132
|
+
line-height: 1.333;
|
|
133
|
+
letter-spacing: 0.031rem;
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
|
|
55
136
|
display: flex;
|
|
56
137
|
|
|
57
138
|
&:is(button) {
|
|
@@ -65,239 +146,329 @@
|
|
|
65
146
|
gap: 0.25rem;
|
|
66
147
|
align-items: center;
|
|
67
148
|
position: relative;
|
|
68
|
-
color:
|
|
69
|
-
transition: var(--m3-
|
|
70
|
-
&:is(.compact .content, .large .content) {
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
text-align: center;
|
|
73
|
-
&.selected {
|
|
74
|
-
color: rgb(var(--m3-scheme-secondary));
|
|
75
|
-
> .icon {
|
|
76
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
77
|
-
}
|
|
78
|
-
> .icon::before {
|
|
79
|
-
opacity: 1;
|
|
80
|
-
width: 100%;
|
|
81
|
-
inset: 0;
|
|
82
|
-
transition:
|
|
83
|
-
width var(--m3-util-easing-fast-spatial),
|
|
84
|
-
inset var(--m3-util-easing-fast-spatial);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
&:hover {
|
|
88
|
-
> .icon {
|
|
89
|
-
background-color: color-mix(in oklab, currentColor 8%, transparent);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
&:focus-visible,
|
|
93
|
-
&:active {
|
|
94
|
-
> .icon {
|
|
95
|
-
background-color: color-mix(in oklab, currentColor 12%, transparent);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
> .icon {
|
|
99
|
-
width: 3.5rem;
|
|
100
|
-
height: 2rem;
|
|
101
|
-
}
|
|
102
|
-
> :global(:is(.ripple-container, .tint)) {
|
|
103
|
-
display: none;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
&:is(.medium .content, .expanded .content) {
|
|
107
|
-
padding-inline: 1rem;
|
|
108
|
-
border-radius: var(--m3-util-rounding-full);
|
|
109
|
-
&.selected {
|
|
110
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
111
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
&:is(.large .content) {
|
|
115
|
-
padding-block: 0.375rem;
|
|
116
|
-
}
|
|
117
|
-
&:is(.expanded .content) {
|
|
118
|
-
gap: 0.75rem;
|
|
119
|
-
}
|
|
149
|
+
color: var(--m3c-on-surface-variant);
|
|
150
|
+
transition: var(--m3-easing);
|
|
120
151
|
}
|
|
152
|
+
|
|
121
153
|
.icon {
|
|
122
154
|
display: flex;
|
|
123
155
|
align-items: center;
|
|
124
156
|
justify-content: center;
|
|
125
|
-
border-radius: var(--m3-
|
|
157
|
+
border-radius: var(--m3-shape-full);
|
|
126
158
|
position: relative;
|
|
127
|
-
transition: var(--m3-
|
|
159
|
+
transition: var(--m3-easing);
|
|
128
160
|
}
|
|
161
|
+
.icon > :global(svg) {
|
|
162
|
+
z-index: 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
129
165
|
.icon::before {
|
|
130
166
|
position: absolute;
|
|
131
167
|
display: block;
|
|
132
168
|
content: " ";
|
|
133
|
-
background-color:
|
|
169
|
+
background-color: var(--m3c-secondary-container);
|
|
134
170
|
|
|
135
171
|
opacity: 0;
|
|
136
172
|
inset: 0 50%;
|
|
137
173
|
width: 0;
|
|
138
174
|
border-radius: 2rem;
|
|
139
175
|
transition:
|
|
140
|
-
opacity var(--m3-
|
|
176
|
+
opacity var(--m3-easing),
|
|
141
177
|
inset 0ms 500ms,
|
|
142
178
|
width 0ms 500ms;
|
|
143
179
|
}
|
|
144
|
-
|
|
145
|
-
z-index: 1;
|
|
146
|
-
}
|
|
180
|
+
|
|
147
181
|
&.compact {
|
|
182
|
+
|
|
183
|
+
height: 4rem;
|
|
184
|
+
padding-block: 0.375rem;
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
.content {
|
|
148
188
|
flex-direction: column;
|
|
149
|
-
|
|
150
|
-
|
|
189
|
+
text-align: center;
|
|
190
|
+
|
|
191
|
+
&:hover {
|
|
192
|
+
> .icon {
|
|
193
|
+
background-color: oklab(from currentColor l a b / 0.08);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:focus-visible,
|
|
198
|
+
&:active {
|
|
199
|
+
> .icon {
|
|
200
|
+
background-color: oklab(from currentColor l a b / 0.12);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
> .icon {
|
|
205
|
+
width: 3.5rem;
|
|
206
|
+
height: 2rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
210
|
+
display: none;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.content.selected {
|
|
215
|
+
color: var(--m3c-secondary);
|
|
216
|
+
> .icon {
|
|
217
|
+
color: var(--m3c-on-secondary-container);
|
|
218
|
+
}
|
|
219
|
+
> .icon::before {
|
|
220
|
+
opacity: 1;
|
|
221
|
+
width: 100%;
|
|
222
|
+
inset: 0;
|
|
223
|
+
transition:
|
|
224
|
+
width var(--m3-easing-fast-spatial),
|
|
225
|
+
inset var(--m3-easing-fast-spatial);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
151
229
|
}
|
|
152
230
|
&.medium {
|
|
153
|
-
|
|
154
|
-
|
|
231
|
+
|
|
232
|
+
height: 4rem;
|
|
233
|
+
padding-block: 0.75rem;
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
.content {
|
|
237
|
+
padding-inline: 1rem;
|
|
238
|
+
border-radius: var(--m3-shape-full);
|
|
239
|
+
}
|
|
240
|
+
.content.selected {
|
|
241
|
+
background-color: var(--m3c-secondary-container);
|
|
242
|
+
color: var(--m3c-on-secondary-container);
|
|
243
|
+
}
|
|
244
|
+
|
|
155
245
|
}
|
|
156
246
|
&.large {
|
|
247
|
+
|
|
248
|
+
height: 4rem;
|
|
249
|
+
.content {
|
|
250
|
+
padding-block: 0.375rem;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
.content {
|
|
157
255
|
flex-direction: column;
|
|
158
|
-
|
|
256
|
+
text-align: center;
|
|
257
|
+
|
|
258
|
+
&:hover {
|
|
259
|
+
> .icon {
|
|
260
|
+
background-color: oklab(from currentColor l a b / 0.08);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&:focus-visible,
|
|
265
|
+
&:active {
|
|
266
|
+
> .icon {
|
|
267
|
+
background-color: oklab(from currentColor l a b / 0.12);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
> .icon {
|
|
272
|
+
width: 3.5rem;
|
|
273
|
+
height: 2rem;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
277
|
+
display: none;
|
|
278
|
+
}
|
|
159
279
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
280
|
+
|
|
281
|
+
.content.selected {
|
|
282
|
+
color: var(--m3c-secondary);
|
|
283
|
+
> .icon {
|
|
284
|
+
color: var(--m3c-on-secondary-container);
|
|
285
|
+
}
|
|
286
|
+
> .icon::before {
|
|
287
|
+
opacity: 1;
|
|
288
|
+
width: 100%;
|
|
289
|
+
inset: 0;
|
|
290
|
+
transition:
|
|
291
|
+
width var(--m3-easing-fast-spatial),
|
|
292
|
+
inset var(--m3-easing-fast-spatial);
|
|
293
|
+
}
|
|
167
294
|
}
|
|
168
|
-
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
&.extra-large {
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
font-family: var(--m3-font);
|
|
301
|
+
font-size: 0.875rem;
|
|
302
|
+
line-height: 1.429;
|
|
303
|
+
letter-spacing: 0.006rem;
|
|
304
|
+
font-weight: 500;
|
|
169
305
|
|
|
306
|
+
height: 3.5rem;
|
|
307
|
+
padding-inline: 1.25rem;
|
|
308
|
+
|
|
309
|
+
.content {
|
|
310
|
+
gap: 0.75rem;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
.content {
|
|
315
|
+
padding-inline: 1rem;
|
|
316
|
+
border-radius: var(--m3-shape-full);
|
|
317
|
+
}
|
|
318
|
+
.content.selected {
|
|
319
|
+
background-color: var(--m3c-secondary-container);
|
|
320
|
+
color: var(--m3c-on-secondary-container);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
}
|
|
324
|
+
}
|
|
170
325
|
.m3-container.auto {
|
|
171
326
|
@media (width < 37.5rem) {
|
|
172
327
|
/* Compact */
|
|
328
|
+
|
|
329
|
+
height: 4rem;
|
|
330
|
+
padding-block: 0.375rem;
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
.content {
|
|
173
334
|
flex-direction: column;
|
|
174
|
-
|
|
175
|
-
padding-block: 0.375rem;
|
|
335
|
+
text-align: center;
|
|
176
336
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
&.selected {
|
|
182
|
-
color: rgb(var(--m3-scheme-secondary));
|
|
183
|
-
> .icon {
|
|
184
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
185
|
-
}
|
|
186
|
-
> .icon::before {
|
|
187
|
-
opacity: 1;
|
|
188
|
-
width: 100%;
|
|
189
|
-
inset: 0;
|
|
190
|
-
transition:
|
|
191
|
-
width var(--m3-util-easing-fast-spatial),
|
|
192
|
-
inset var(--m3-util-easing-fast-spatial);
|
|
193
|
-
}
|
|
337
|
+
&:hover {
|
|
338
|
+
> .icon {
|
|
339
|
+
background-color: oklab(from currentColor l a b / 0.08);
|
|
194
340
|
}
|
|
341
|
+
}
|
|
195
342
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
343
|
+
&:focus-visible,
|
|
344
|
+
&:active {
|
|
345
|
+
> .icon {
|
|
346
|
+
background-color: oklab(from currentColor l a b / 0.12);
|
|
200
347
|
}
|
|
348
|
+
}
|
|
201
349
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
}
|
|
350
|
+
> .icon {
|
|
351
|
+
width: 3.5rem;
|
|
352
|
+
height: 2rem;
|
|
353
|
+
}
|
|
208
354
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
355
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
356
|
+
display: none;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
213
359
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
360
|
+
.content.selected {
|
|
361
|
+
color: var(--m3c-secondary);
|
|
362
|
+
> .icon {
|
|
363
|
+
color: var(--m3c-on-secondary-container);
|
|
364
|
+
}
|
|
365
|
+
> .icon::before {
|
|
366
|
+
opacity: 1;
|
|
367
|
+
width: 100%;
|
|
368
|
+
inset: 0;
|
|
369
|
+
transition:
|
|
370
|
+
width var(--m3-easing-fast-spatial),
|
|
371
|
+
inset var(--m3-easing-fast-spatial);
|
|
217
372
|
}
|
|
218
373
|
}
|
|
374
|
+
|
|
375
|
+
}
|
|
219
376
|
@media (37.5rem <= width < 52.5rem) {
|
|
220
377
|
/* Medium */
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
378
|
+
|
|
379
|
+
height: 4rem;
|
|
380
|
+
padding-block: 0.75rem;
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
.content {
|
|
384
|
+
padding-inline: 1rem;
|
|
385
|
+
border-radius: var(--m3-shape-full);
|
|
386
|
+
}
|
|
387
|
+
.content.selected {
|
|
388
|
+
background-color: var(--m3c-secondary-container);
|
|
389
|
+
color: var(--m3c-on-secondary-container);
|
|
390
|
+
}
|
|
391
|
+
|
|
233
392
|
}
|
|
234
393
|
@media (52.5rem <= width < 100rem) {
|
|
235
394
|
/* Large */
|
|
395
|
+
|
|
396
|
+
height: 4rem;
|
|
397
|
+
.content {
|
|
398
|
+
padding-block: 0.375rem;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
.content {
|
|
236
403
|
flex-direction: column;
|
|
237
404
|
text-align: center;
|
|
238
|
-
min-height: 4rem;
|
|
239
|
-
|
|
240
|
-
.content {
|
|
241
|
-
flex-direction: column;
|
|
242
|
-
padding-block: 0.375rem;
|
|
243
|
-
|
|
244
|
-
&.selected {
|
|
245
|
-
color: rgb(var(--m3-scheme-secondary));
|
|
246
|
-
> .icon {
|
|
247
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
248
|
-
}
|
|
249
|
-
> .icon::before {
|
|
250
|
-
opacity: 1;
|
|
251
|
-
width: 100%;
|
|
252
|
-
inset: 0;
|
|
253
|
-
transition:
|
|
254
|
-
width var(--m3-util-easing-fast-spatial),
|
|
255
|
-
inset var(--m3-util-easing-fast-spatial);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
&:hover {
|
|
260
|
-
> .icon {
|
|
261
|
-
background-color: color-mix(in oklab, currentColor 8%, transparent);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
405
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
background-color: color-mix(in oklab, currentColor 12%, transparent);
|
|
269
|
-
}
|
|
406
|
+
&:hover {
|
|
407
|
+
> .icon {
|
|
408
|
+
background-color: oklab(from currentColor l a b / 0.08);
|
|
270
409
|
}
|
|
410
|
+
}
|
|
271
411
|
|
|
412
|
+
&:focus-visible,
|
|
413
|
+
&:active {
|
|
272
414
|
> .icon {
|
|
273
|
-
|
|
274
|
-
height: 2rem;
|
|
415
|
+
background-color: oklab(from currentColor l a b / 0.12);
|
|
275
416
|
}
|
|
417
|
+
}
|
|
276
418
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
419
|
+
> .icon {
|
|
420
|
+
width: 3.5rem;
|
|
421
|
+
height: 2rem;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
> :global(:is(.ripple-container, .tint)) {
|
|
425
|
+
display: none;
|
|
280
426
|
}
|
|
281
427
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
&.selected {
|
|
297
|
-
background-color: rgb(var(--m3-scheme-secondary-container));
|
|
298
|
-
color: rgb(var(--m3-scheme-on-secondary-container));
|
|
299
|
-
}
|
|
428
|
+
|
|
429
|
+
.content.selected {
|
|
430
|
+
color: var(--m3c-secondary);
|
|
431
|
+
> .icon {
|
|
432
|
+
color: var(--m3c-on-secondary-container);
|
|
433
|
+
}
|
|
434
|
+
> .icon::before {
|
|
435
|
+
opacity: 1;
|
|
436
|
+
width: 100%;
|
|
437
|
+
inset: 0;
|
|
438
|
+
transition:
|
|
439
|
+
width var(--m3-easing-fast-spatial),
|
|
440
|
+
inset var(--m3-easing-fast-spatial);
|
|
300
441
|
}
|
|
301
442
|
}
|
|
443
|
+
|
|
444
|
+
}
|
|
445
|
+
@media (100rem <= width) {
|
|
446
|
+
/* Extra large */
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
font-family: var(--m3-font);
|
|
450
|
+
font-size: 0.875rem;
|
|
451
|
+
line-height: 1.429;
|
|
452
|
+
letter-spacing: 0.006rem;
|
|
453
|
+
font-weight: 500;
|
|
454
|
+
|
|
455
|
+
height: 3.5rem;
|
|
456
|
+
padding-inline: 1.25rem;
|
|
457
|
+
|
|
458
|
+
.content {
|
|
459
|
+
gap: 0.75rem;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
.content {
|
|
464
|
+
padding-inline: 1rem;
|
|
465
|
+
border-radius: var(--m3-shape-full);
|
|
466
|
+
}
|
|
467
|
+
.content.selected {
|
|
468
|
+
background-color: var(--m3c-secondary-container);
|
|
469
|
+
color: var(--m3c-on-secondary-container);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
}
|
|
302
473
|
}
|
|
303
474
|
</style>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { IconifyIcon } from "@iconify/types";
|
|
2
|
-
import type { HTMLButtonAttributes
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
} & HTMLButtonAttributes) | ({
|
|
6
|
-
href: string;
|
|
7
|
-
} & HTMLAnchorAttributes);
|
|
2
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
+
import type { AnchorAttrs } from "../misc/typing-utils";
|
|
4
|
+
type ActionProps = AnchorAttrs | HTMLButtonAttributes;
|
|
8
5
|
type $$ComponentProps = {
|
|
9
|
-
variant: "compact" | "medium" | "large" | "
|
|
6
|
+
variant: "compact" | "medium" | "large" | "extra-large" | "auto";
|
|
10
7
|
icon: IconifyIcon;
|
|
11
8
|
text: string;
|
|
12
9
|
selected: boolean;
|