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.
@@ -79,7 +79,7 @@
79
79
  .m3-container {
80
80
  display: inline-flex;
81
81
  border: none;
82
- height: 2.5rem;
82
+ height: calc(2.5rem + var(--m3-util-density-term));
83
83
  gap: 0.5rem;
84
84
  padding: 0 1rem;
85
85
  border-radius: var(--m3-button-shape);
@@ -91,7 +91,7 @@
91
91
  display: flex;
92
92
  align-items: center;
93
93
  justify-content: center;
94
- height: 2.5rem;
94
+ height: calc(2.5rem + var(--m3-util-density-term));
95
95
  gap: 0.5rem;
96
96
 
97
97
  cursor: pointer;
@@ -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;
@@ -15,7 +15,6 @@
15
15
  .m3-container {
16
16
  display: flex;
17
17
  position: relative;
18
- overflow: hidden;
19
18
  flex-direction: column;
20
19
  padding: 0.5rem 0;
21
20
  border-radius: var(--m3-menu-shape);
@@ -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-one 0.6s cubic-bezier(0.14, 5.63, 0.4, 0.5) forwards;
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-simple 0.3s forwards cubic-bezier(0.05, 0.7, 0.1, 1);
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-one {
15
+ @keyframes refocus-outward {
16
16
  0% {
17
- box-shadow: 0 0 0 0px rgb(var(--m3-scheme-primary));
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-primary));
20
+ box-shadow: 0 0 0 3px rgb(var(--m3-scheme-secondary));
21
21
  }
22
22
  }
23
- @keyframes refocus-simple {
23
+ @keyframes refocus-inward {
24
24
  0% {
25
- box-shadow: inset 0 0 0 0px rgb(var(--m3-scheme-primary));
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-primary));
28
+ box-shadow: inset 0 0 0 3px rgb(var(--m3-scheme-secondary));
29
29
  }
30
30
  }
31
31
 
@@ -2,8 +2,9 @@
2
2
  :root {
3
3
  --m3-util-elevation-0: none;
4
4
  --m3-util-elevation-1:
5
- 0px 1px 2px 0px rgb(var(--m3-scheme-shadow) / 0.3), /* Spot */
6
- 0px 1px 3px 1px rgb(var(--m3-scheme-shadow) / 0.15); /* Ambient */
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "5.1.2",
3
+ "version": "5.2.0",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {