m3-svelte 5.1.2 → 5.2.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 +1 -1
- package/package/buttons/SplitButton.svelte +1 -1
- package/package/containers/ListItem.svelte +6 -6
- package/package/containers/Menu.svelte +0 -1
- package/package/containers/MenuItem.svelte +2 -2
- package/package/misc/recommended-styles.css +8 -8
- package/package/misc/styles.css +7 -2
- package/package.json +1 -1
|
@@ -62,19 +62,19 @@
|
|
|
62
62
|
label: _,
|
|
63
63
|
...extra
|
|
64
64
|
} = props}
|
|
65
|
-
<label class="m3-container lines-{_lines}" {...extra}>
|
|
65
|
+
<label class="m3-container focus-inset lines-{_lines}" {...extra}>
|
|
66
66
|
<Layer />
|
|
67
67
|
{@render content(leading, overline, headline, supporting, trailing)}
|
|
68
68
|
</label>
|
|
69
69
|
{:else if "onclick" in props}
|
|
70
70
|
{@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
|
|
71
|
-
<button type="button" class="m3-container lines-{_lines}" {...extra}>
|
|
71
|
+
<button type="button" class="m3-container focus-inset lines-{_lines}" {...extra}>
|
|
72
72
|
<Layer />
|
|
73
73
|
{@render content(leading, overline, headline, supporting, trailing)}
|
|
74
74
|
</button>
|
|
75
75
|
{:else if "href" in props}
|
|
76
76
|
{@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
|
|
77
|
-
<a class="m3-container lines-{_lines}" {...extra}>
|
|
77
|
+
<a class="m3-container focus-inset lines-{_lines}" {...extra}>
|
|
78
78
|
<Layer />
|
|
79
79
|
{@render content(leading, overline, headline, supporting, trailing)}
|
|
80
80
|
</a>
|
|
@@ -104,13 +104,13 @@
|
|
|
104
104
|
cursor: pointer;
|
|
105
105
|
}
|
|
106
106
|
.lines-1 {
|
|
107
|
-
height: 3.5rem;
|
|
107
|
+
height: calc(3.5rem + var(--m3-util-density-term));
|
|
108
108
|
}
|
|
109
109
|
.lines-2 {
|
|
110
|
-
height: 4.5rem;
|
|
110
|
+
height: calc(4.5rem + var(--m3-util-density-term));
|
|
111
111
|
}
|
|
112
112
|
.lines-3 {
|
|
113
|
-
height: 5.5rem;
|
|
113
|
+
height: calc(5.5rem + var(--m3-util-density-term));
|
|
114
114
|
padding-top: 0.75rem;
|
|
115
115
|
padding-bottom: 0.75rem;
|
|
116
116
|
align-items: flex-start;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
} = $props();
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<button type="button" class="item m3-font-label-large" {disabled} {onclick}>
|
|
20
|
+
<button type="button" class="item focus-inset m3-font-label-large" {disabled} {onclick}>
|
|
21
21
|
<Layer />
|
|
22
22
|
{#if icon == "space"}
|
|
23
23
|
<span class="icon"></span>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
.item {
|
|
34
34
|
display: flex;
|
|
35
35
|
align-items: center;
|
|
36
|
-
height: 3rem;
|
|
36
|
+
height: calc(3rem + var(--m3-util-density-term));
|
|
37
37
|
padding: 0 0.75rem;
|
|
38
38
|
white-space: nowrap;
|
|
39
39
|
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--m3-util-refocus: refocus-
|
|
2
|
+
--m3-util-refocus: refocus-outward 0.6s cubic-bezier(0.14, 5.63, 0.4, 0.5) forwards;
|
|
3
3
|
}
|
|
4
4
|
:focus-visible:not(.focus-inset, .focus-none) {
|
|
5
5
|
animation: var(--m3-util-refocus);
|
|
6
6
|
outline: none;
|
|
7
7
|
}
|
|
8
8
|
:focus-visible:is(.focus-inset):not(.focus-none) {
|
|
9
|
-
animation: refocus-
|
|
9
|
+
animation: refocus-inward 0.6s cubic-bezier(0.14, 5.63, 0.4, 0.5) forwards;
|
|
10
10
|
outline: none;
|
|
11
11
|
}
|
|
12
12
|
:focus-visible.focus-none {
|
|
13
13
|
outline: none;
|
|
14
14
|
}
|
|
15
|
-
@keyframes refocus-
|
|
15
|
+
@keyframes refocus-outward {
|
|
16
16
|
0% {
|
|
17
|
-
box-shadow: 0 0 0 0px rgb(var(--m3-scheme-
|
|
17
|
+
box-shadow: 0 0 0 0px rgb(var(--m3-scheme-secondary));
|
|
18
18
|
}
|
|
19
19
|
100% {
|
|
20
|
-
box-shadow: 0 0 0 3px rgb(var(--m3-scheme-
|
|
20
|
+
box-shadow: 0 0 0 3px rgb(var(--m3-scheme-secondary));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
@keyframes refocus-
|
|
23
|
+
@keyframes refocus-inward {
|
|
24
24
|
0% {
|
|
25
|
-
box-shadow: inset 0 0 0 0px rgb(var(--m3-scheme-
|
|
25
|
+
box-shadow: inset 0 0 0 0px rgb(var(--m3-scheme-secondary));
|
|
26
26
|
}
|
|
27
27
|
100% {
|
|
28
|
-
box-shadow: inset 0 0 0 3px rgb(var(--m3-scheme-
|
|
28
|
+
box-shadow: inset 0 0 0 3px rgb(var(--m3-scheme-secondary));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
package/package/misc/styles.css
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
:root {
|
|
3
3
|
--m3-util-elevation-0: none;
|
|
4
4
|
--m3-util-elevation-1:
|
|
5
|
-
|
|
6
|
-
0px 1px
|
|
5
|
+
/* Spot */
|
|
6
|
+
0px 1px 2px 0px rgb(var(--m3-scheme-shadow) / 0.3),
|
|
7
|
+
/* Ambient */ 0px 1px 3px 1px rgb(var(--m3-scheme-shadow) / 0.15);
|
|
7
8
|
--m3-util-elevation-2:
|
|
8
9
|
0px 1px 2px 0px rgb(var(--m3-scheme-shadow) / 0.3),
|
|
9
10
|
0px 2px 6px 2px rgb(var(--m3-scheme-shadow) / 0.15);
|
|
@@ -16,7 +17,11 @@
|
|
|
16
17
|
--m3-util-elevation-5:
|
|
17
18
|
0px 4px 4px 0px rgb(var(--m3-scheme-shadow) / 0.3),
|
|
18
19
|
0px 8px 12px 6px rgb(var(--m3-scheme-shadow) / 0.15);
|
|
20
|
+
|
|
21
|
+
/* Sizing */
|
|
19
22
|
--m3-util-bottom-offset: 0;
|
|
23
|
+
--m3-util-density: 0;
|
|
24
|
+
--m3-util-density-term: calc(var(--m3-util-density) * 0.25rem);
|
|
20
25
|
|
|
21
26
|
/* Shapes */
|
|
22
27
|
--m3-util-rounding-none: 0;
|