m3-svelte 5.1.2 → 5.2.1
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/forms/DateField.svelte +2 -2
- package/package/forms/DateFieldOutlined.svelte +3 -2
- package/package/forms/TextField.svelte +5 -2
- package/package/forms/TextFieldMultiline.svelte +5 -2
- package/package/forms/TextFieldOutlined.svelte +7 -6
- package/package/forms/TextFieldOutlinedMultiline.svelte +6 -5
- 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
|
|
|
@@ -93,7 +93,7 @@ opacity: ${Math.min(t * 3, 1)};`,
|
|
|
93
93
|
}
|
|
94
94
|
.m3-container {
|
|
95
95
|
position: relative;
|
|
96
|
-
height: 3.5rem;
|
|
96
|
+
height: calc(3.5rem + var(--m3-util-density-term));
|
|
97
97
|
min-width: 15rem;
|
|
98
98
|
background-color: rgb(var(--m3-scheme-surface-container-highest));
|
|
99
99
|
border-radius: var(--m3-datefield-shape) var(--m3-datefield-shape) 0 0;
|
|
@@ -106,7 +106,7 @@ opacity: ${Math.min(t * 3, 1)};`,
|
|
|
106
106
|
height: 100%;
|
|
107
107
|
border: none;
|
|
108
108
|
outline: none;
|
|
109
|
-
padding:
|
|
109
|
+
padding: 1rem 1rem 0rem 1rem;
|
|
110
110
|
background-color: transparent;
|
|
111
111
|
color: rgb(var(--m3-scheme-on-surface));
|
|
112
112
|
}
|
|
@@ -99,7 +99,7 @@ opacity: ${Math.min(t * 3, 1)};`,
|
|
|
99
99
|
.m3-container {
|
|
100
100
|
display: inline-flex;
|
|
101
101
|
position: relative;
|
|
102
|
-
height: 3.5rem;
|
|
102
|
+
height: calc(3.5rem + var(--m3-util-density-term));
|
|
103
103
|
min-width: 15rem;
|
|
104
104
|
}
|
|
105
105
|
input {
|
|
@@ -117,7 +117,8 @@ opacity: ${Math.min(t * 3, 1)};`,
|
|
|
117
117
|
label {
|
|
118
118
|
position: absolute;
|
|
119
119
|
left: 0.75rem;
|
|
120
|
-
top:
|
|
120
|
+
top: 0;
|
|
121
|
+
translate: 0 -50%;
|
|
121
122
|
color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
|
|
122
123
|
background-color: var(--m3-util-background, rgb(var(--m3-scheme-surface)));
|
|
123
124
|
padding: 0 0.25rem;
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
display: inline-flex;
|
|
70
70
|
position: relative;
|
|
71
71
|
align-items: center;
|
|
72
|
-
height: 3.5rem;
|
|
72
|
+
height: calc(3.5rem + var(--m3-util-density-term));
|
|
73
73
|
min-width: 15rem;
|
|
74
74
|
}
|
|
75
75
|
input {
|
|
@@ -87,7 +87,8 @@
|
|
|
87
87
|
label {
|
|
88
88
|
position: absolute;
|
|
89
89
|
left: 1rem;
|
|
90
|
-
top:
|
|
90
|
+
top: 50%;
|
|
91
|
+
translate: 0 -50%;
|
|
91
92
|
color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
|
|
92
93
|
&:is(input:hover ~ label) {
|
|
93
94
|
color: rgb(var(--error, var(--m3-scheme-on-surface)));
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
}
|
|
101
102
|
&:is(input:focus ~ label, input:not(:placeholder-shown) ~ label) {
|
|
102
103
|
top: 0.5rem;
|
|
104
|
+
translate: 0 0;
|
|
103
105
|
font-size: var(--m3-font-body-small-size, 0.75rem);
|
|
104
106
|
line-height: var(--m3-font-body-small-height, 1.333);
|
|
105
107
|
letter-spacing: var(--m3-font-body-small-tracking, 0.025rem);
|
|
@@ -108,6 +110,7 @@
|
|
|
108
110
|
transition:
|
|
109
111
|
color 100ms,
|
|
110
112
|
top 100ms,
|
|
113
|
+
translate 100ms,
|
|
111
114
|
font-size 300ms,
|
|
112
115
|
line-height 300ms,
|
|
113
116
|
letter-spacing 300ms;
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
display: inline-flex;
|
|
64
64
|
position: relative;
|
|
65
65
|
align-items: center;
|
|
66
|
-
min-height: 5rem;
|
|
66
|
+
min-height: calc(5rem + var(--m3-util-density-term));
|
|
67
67
|
min-width: 15rem;
|
|
68
68
|
}
|
|
69
69
|
textarea {
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
label {
|
|
83
83
|
position: absolute;
|
|
84
84
|
left: 1rem;
|
|
85
|
-
top:
|
|
85
|
+
top: 50%;
|
|
86
|
+
translate: 0 -50%;
|
|
86
87
|
color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
|
|
87
88
|
&:is(textarea:hover ~ label) {
|
|
88
89
|
color: rgb(var(--error, var(--m3-scheme-on-surface)));
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
}
|
|
96
97
|
&:is(textarea:focus ~ label, textarea:not(:placeholder-shown) ~ label) {
|
|
97
98
|
top: 0.5rem;
|
|
99
|
+
translate: 0 0;
|
|
98
100
|
font-size: var(--m3-font-body-small-size, 0.75rem);
|
|
99
101
|
line-height: var(--m3-font-body-small-height, 1.333);
|
|
100
102
|
letter-spacing: var(--m3-font-body-small-tracking, 0.025rem);
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
transition:
|
|
104
106
|
color 100ms,
|
|
105
107
|
top 100ms,
|
|
108
|
+
translate 100ms,
|
|
106
109
|
font-size 300ms,
|
|
107
110
|
line-height 300ms,
|
|
108
111
|
letter-spacing 300ms;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
display: inline-flex;
|
|
73
73
|
position: relative;
|
|
74
74
|
align-items: center;
|
|
75
|
-
height: 3.5rem;
|
|
75
|
+
height: calc(3.5rem + var(--m3-util-density-term));
|
|
76
76
|
min-width: 15rem;
|
|
77
77
|
}
|
|
78
78
|
input {
|
|
@@ -90,21 +90,22 @@
|
|
|
90
90
|
label {
|
|
91
91
|
position: absolute;
|
|
92
92
|
left: 0.75rem;
|
|
93
|
-
top:
|
|
93
|
+
top: 50%;
|
|
94
|
+
translate: 0 -50%;
|
|
94
95
|
color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
|
|
95
96
|
background-color: var(--m3-util-background, rgb(var(--m3-scheme-surface)));
|
|
96
97
|
padding: 0 0.25rem;
|
|
97
98
|
&:is(input:hover ~ label) {
|
|
98
99
|
color: rgb(var(--error, var(--m3-scheme-on-surface)));
|
|
99
100
|
}
|
|
100
|
-
&:is(input:focus ~ label) {
|
|
101
|
+
&:is(input:enabled:focus ~ label) {
|
|
101
102
|
color: rgb(var(--error, var(--m3-scheme-primary)));
|
|
102
103
|
}
|
|
103
104
|
&:is(input:disabled ~ label) {
|
|
104
105
|
color: rgb(var(--m3-scheme-on-surface) / 0.38);
|
|
105
106
|
}
|
|
106
107
|
&:is(input:focus ~ label, input:not(:placeholder-shown) ~ label) {
|
|
107
|
-
top:
|
|
108
|
+
top: 0;
|
|
108
109
|
font-size: var(--m3-font-body-small-size, 0.75rem);
|
|
109
110
|
line-height: var(--m3-font-body-small-height, 1.333);
|
|
110
111
|
letter-spacing: var(--m3-font-body-small-tracking, 0.025rem);
|
|
@@ -124,10 +125,10 @@
|
|
|
124
125
|
border-radius: var(--m3-textfield-outlined-shape);
|
|
125
126
|
pointer-events: none;
|
|
126
127
|
transition: all 100ms;
|
|
127
|
-
&:is(input:hover ~ .layer) {
|
|
128
|
+
&:is(input:enabled:hover ~ .layer) {
|
|
128
129
|
border-color: rgb(var(--error, var(--m3-scheme-on-surface)));
|
|
129
130
|
}
|
|
130
|
-
&:is(input:focus ~ .layer) {
|
|
131
|
+
&:is(input:enabled:focus ~ .layer) {
|
|
131
132
|
border-color: rgb(var(--error, var(--m3-scheme-primary)));
|
|
132
133
|
border-width: 0.125rem;
|
|
133
134
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
display: inline-flex;
|
|
68
68
|
position: relative;
|
|
69
69
|
align-items: center;
|
|
70
|
-
min-height: 5rem;
|
|
70
|
+
min-height: calc(5rem + var(--m3-util-density-term));
|
|
71
71
|
min-width: 15rem;
|
|
72
72
|
}
|
|
73
73
|
textarea {
|
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
label {
|
|
87
87
|
position: absolute;
|
|
88
88
|
left: 0.75rem;
|
|
89
|
-
top:
|
|
89
|
+
top: 50%;
|
|
90
|
+
translate: 0 -50%;
|
|
90
91
|
color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
|
|
91
92
|
background-color: var(--m3-util-background, rgb(var(--m3-scheme-surface)));
|
|
92
93
|
padding: 0 0.25rem;
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
color: rgb(var(--m3-scheme-on-surface) / 0.38);
|
|
101
102
|
}
|
|
102
103
|
&:is(textarea:focus ~ label, textarea:not(:placeholder-shown) ~ label) {
|
|
103
|
-
top:
|
|
104
|
+
top: 0;
|
|
104
105
|
font-size: var(--m3-font-body-small-size, 0.75rem);
|
|
105
106
|
line-height: var(--m3-font-body-small-height, 1.333);
|
|
106
107
|
letter-spacing: var(--m3-font-body-small-tracking, 0.025rem);
|
|
@@ -120,10 +121,10 @@
|
|
|
120
121
|
border-radius: var(--m3-textfield-outlined-shape);
|
|
121
122
|
pointer-events: none;
|
|
122
123
|
transition: all 100ms;
|
|
123
|
-
&:is(textarea:hover ~ .layer) {
|
|
124
|
+
&:is(textarea:enabled:hover ~ .layer) {
|
|
124
125
|
border-color: rgb(var(--error, var(--m3-scheme-on-surface)));
|
|
125
126
|
}
|
|
126
|
-
&:is(textarea:focus ~ .layer) {
|
|
127
|
+
&:is(textarea:enabled:focus ~ .layer) {
|
|
127
128
|
border-color: rgb(var(--error, var(--m3-scheme-primary)));
|
|
128
129
|
border-width: 0.125rem;
|
|
129
130
|
}
|
|
@@ -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;
|