m3-svelte 5.4.0 → 5.7.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.
Files changed (47) hide show
  1. package/package/buttons/Button.svelte +15 -10
  2. package/package/buttons/Button.svelte.d.ts +6 -6
  3. package/package/buttons/SplitButton.svelte +4 -4
  4. package/package/buttons/SplitButton.svelte.d.ts +2 -2
  5. package/package/containers/Card.svelte +2 -3
  6. package/package/containers/Card.svelte.d.ts +2 -3
  7. package/package/containers/Dialog.svelte +35 -37
  8. package/package/containers/Dialog.svelte.d.ts +4 -0
  9. package/package/containers/ListItem.svelte +36 -47
  10. package/package/containers/ListItem.svelte.d.ts +3 -3
  11. package/package/containers/Snackbar.svelte +2 -2
  12. package/package/containers/Snackbar.svelte.d.ts +2 -2
  13. package/package/containers/SnackbarItem.svelte +2 -2
  14. package/package/containers/SnackbarItem.svelte.d.ts +2 -2
  15. package/package/forms/Checkbox.svelte +3 -2
  16. package/package/forms/Checkbox.svelte.d.ts +2 -2
  17. package/package/forms/Chip.svelte +20 -13
  18. package/package/forms/Chip.svelte.d.ts +3 -3
  19. package/package/forms/DateField.svelte +1 -1
  20. package/package/forms/DateFieldOutlined.svelte +1 -1
  21. package/package/forms/LinearProgressIndeterminate.svelte +2 -2
  22. package/package/forms/LinearProgressIndeterminate.svelte.d.ts +2 -2
  23. package/package/forms/RadioAnim1.svelte +3 -2
  24. package/package/forms/RadioAnim1.svelte.d.ts +2 -2
  25. package/package/forms/RadioAnim2.svelte +3 -2
  26. package/package/forms/RadioAnim2.svelte.d.ts +2 -2
  27. package/package/forms/RadioAnim3.svelte +3 -2
  28. package/package/forms/RadioAnim3.svelte.d.ts +2 -2
  29. package/package/forms/Select.svelte +2 -1
  30. package/package/forms/SelectOutlined.svelte +3 -3
  31. package/package/forms/Slider.svelte +127 -147
  32. package/package/forms/Slider.svelte.d.ts +1 -1
  33. package/package/forms/SliderTicks.svelte +2 -2
  34. package/package/forms/SliderTicks.svelte.d.ts +2 -2
  35. package/package/forms/TextField.svelte +5 -4
  36. package/package/forms/TextFieldMultiline.svelte +5 -4
  37. package/package/forms/TextFieldOutlined.svelte +8 -4
  38. package/package/forms/TextFieldOutlinedMultiline.svelte +8 -4
  39. package/package/forms/WavyLinearProgress.svelte +5 -7
  40. package/package/index.d.ts +1 -0
  41. package/package/index.js +1 -0
  42. package/package/misc/_icon.svelte +14 -1
  43. package/package/misc/typing-utils.d.ts +4 -1
  44. package/package/nav/NavCMLXItem.svelte +4 -2
  45. package/package/utils/badge.d.ts +11 -0
  46. package/package/utils/badge.js +30 -0
  47. package/package.json +10 -10
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from "svelte";
3
- import type { HTMLAttributes } from "svelte/elements";
4
3
  import Layer from "../misc/Layer.svelte";
4
+ import type { DivAttrs } from "../misc/typing-utils";
5
5
 
6
6
  // MUST BE WRAPPED IN A <label>
7
7
  let {
@@ -9,7 +9,7 @@
9
9
  ...extra
10
10
  }: {
11
11
  children: Snippet;
12
- } & HTMLAttributes<HTMLDivElement> = $props();
12
+ } & DivAttrs = $props();
13
13
  </script>
14
14
 
15
15
  <div class="m3-container" {...extra}>
@@ -32,6 +32,7 @@
32
32
  .m3-container :global(input) {
33
33
  position: absolute;
34
34
  opacity: 0;
35
+ pointer-events: none;
35
36
  }
36
37
 
37
38
  .layer-container {
@@ -1,8 +1,8 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
2
+ import type { DivAttrs } from "../misc/typing-utils";
3
3
  type $$ComponentProps = {
4
4
  children: Snippet;
5
- } & HTMLAttributes<HTMLDivElement>;
5
+ } & DivAttrs;
6
6
  declare const RadioAnim2: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type RadioAnim2 = ReturnType<typeof RadioAnim2>;
8
8
  export default RadioAnim2;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from "svelte";
3
- import type { HTMLAttributes } from "svelte/elements";
4
3
  import Layer from "../misc/Layer.svelte";
4
+ import type { DivAttrs } from "../misc/typing-utils";
5
5
 
6
6
  // MUST BE WRAPPED IN A <label>
7
7
  let {
@@ -9,7 +9,7 @@
9
9
  ...extra
10
10
  }: {
11
11
  children: Snippet;
12
- } & HTMLAttributes<HTMLDivElement> = $props();
12
+ } & DivAttrs = $props();
13
13
  </script>
14
14
 
15
15
  <div class="m3-container" {...extra}>
@@ -32,6 +32,7 @@
32
32
  .m3-container :global(input) {
33
33
  position: absolute;
34
34
  opacity: 0;
35
+ pointer-events: none;
35
36
  }
36
37
 
37
38
  .layer-container {
@@ -1,8 +1,8 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
2
+ import type { DivAttrs } from "../misc/typing-utils";
3
3
  type $$ComponentProps = {
4
4
  children: Snippet;
5
- } & HTMLAttributes<HTMLDivElement>;
5
+ } & DivAttrs;
6
6
  declare const RadioAnim3: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type RadioAnim3 = ReturnType<typeof RadioAnim3>;
8
8
  export default RadioAnim3;
@@ -47,6 +47,7 @@
47
47
  <style>
48
48
  :root {
49
49
  --m3-menu-shape: var(--m3-util-rounding-extra-small);
50
+ --m3-field-filled-shape: var(--m3-util-rounding-extra-small);
50
51
  }
51
52
 
52
53
  .m3-container {
@@ -92,7 +93,7 @@
92
93
  );
93
94
  padding-inline: 1rem;
94
95
 
95
- border-radius: var(--m3-textfield-filled-shape) var(--m3-textfield-filled-shape) 0 0;
96
+ border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
96
97
  background-color: rgb(var(--m3-scheme-surface-container-highest));
97
98
  transition:
98
99
  background-color var(--m3-util-easing-fast),
@@ -52,7 +52,7 @@
52
52
  */
53
53
  :root {
54
54
  --m3-menu-shape: var(--m3-util-rounding-extra-small);
55
- --m3-select-outlined-shape: var(--m3-util-rounding-extra-small);
55
+ --m3-field-outlined-shape: var(--m3-util-rounding-extra-small);
56
56
  }
57
57
 
58
58
  .m3-container {
@@ -79,7 +79,7 @@
79
79
  position: absolute;
80
80
  inset: 0;
81
81
  border: 1px solid var(--outline-color);
82
- border-radius: var(--m3-select-outlined-shape);
82
+ border-radius: var(--m3-field-outlined-shape);
83
83
  pointer-events: none;
84
84
  transition: all 100ms;
85
85
  }
@@ -109,7 +109,7 @@
109
109
  height: calc(3.5rem + var(--m3-util-density-term));
110
110
  padding-inline: 1rem;
111
111
 
112
- border-radius: var(--m3-select-outlined-shape);
112
+ border-radius: var(--m3-field-outlined-shape);
113
113
  background-color: transparent;
114
114
  color: rgb(var(--m3-scheme-on-surface));
115
115
 
@@ -14,7 +14,7 @@
14
14
  size = "xs",
15
15
  leadingIcon,
16
16
  trailingIcon,
17
- ticks = false,
17
+ stops: _stops = false,
18
18
  endStops = true,
19
19
  format = (n: number) => {
20
20
  return n.toFixed(0);
@@ -30,10 +30,12 @@
30
30
  size?: "xs" | "s" | "m" | "l" | "xl";
31
31
  leadingIcon?: IconifyIcon;
32
32
  trailingIcon?: IconifyIcon;
33
- ticks?: boolean;
33
+ stops?: boolean;
34
34
  endStops?: boolean;
35
35
  format?: (n: number) => string;
36
36
  } & Omit<HTMLInputAttributes, "size"> = $props();
37
+ // @ts-expect-error deprecated backwards compatibility with ticks
38
+ let stops = $derived(extra.ticks ? true : _stops);
37
39
  let containerWidth = $state(600);
38
40
 
39
41
  const valueDisplayed = new Spring(value, { stiffness: 0.3, damping: 1 });
@@ -45,23 +47,27 @@
45
47
  };
46
48
 
47
49
  const range = $derived(max - min);
48
- const percent = $derived((valueDisplayed.current - min) / range);
49
- const tickList = $derived.by(() => {
50
- if (typeof step != "number") return [];
51
-
52
- const ticksList = [];
53
-
54
- for (let i = 0; i <= range; i += step) ticksList.push(i / range);
50
+ const handle = $derived((valueDisplayed.current - min) / range);
51
+ const stopList = $derived.by(() => {
52
+ const output: number[] = [];
53
+ const add = (stop: number) => {
54
+ if (leadingIcon && stop == 0) return;
55
+ if (trailingIcon && stop == 1) return;
56
+ output.push(stop);
57
+ };
58
+
59
+ if (stops && typeof step == "number") {
60
+ for (let i = 0; i <= range; i += step) add(i / range);
61
+ }
62
+ if (endStops && !output.includes(1)) {
63
+ add(1);
64
+ }
55
65
 
56
- return ticksList;
66
+ return output;
57
67
  });
58
68
  </script>
59
69
 
60
- <div
61
- class="m3-container {size}"
62
- style:--percent="{percent * 100}%"
63
- bind:offsetWidth={containerWidth}
64
- >
70
+ <div class="m3-container {size}" style:--handle={handle - 0.5} bind:offsetWidth={containerWidth}>
65
71
  <input
66
72
  type="range"
67
73
  oninput={updateValue}
@@ -72,33 +78,28 @@
72
78
  {disabled}
73
79
  {...extra}
74
80
  />
75
-
76
- <div class="track"></div>
81
+ <div class="track-1">
82
+ {#each stopList as stop}
83
+ <div class="stop" style:--x={stop - 0.5}></div>
84
+ {/each}
85
+ </div>
86
+ <div class="track-2">
87
+ {#each stopList as stop}
88
+ <div class="stop" style:--x={stop - 0.5}></div>
89
+ {/each}
90
+ </div>
77
91
  {#if leadingIcon}
78
92
  <Icon
79
93
  icon={leadingIcon}
80
- class={"leading" + (containerWidth * percent < (size == "xl" ? 48 : 40) ? " pop" : "")}
94
+ class={"leading" + (containerWidth * handle < (size == "xl" ? 48 : 40) ? " pop" : "")}
81
95
  />
82
96
  {/if}
83
97
  {#if trailingIcon}
84
98
  <Icon
85
99
  icon={trailingIcon}
86
- class={"trailing" + (containerWidth * (1 - percent) < (size == "xl" ? 48 : 40) ? " pop" : "")}
100
+ class={"trailing" + (containerWidth * (1 - handle) < (size == "xl" ? 48 : 40) ? " pop" : "")}
87
101
  />
88
102
  {/if}
89
- {#if ticks}
90
- {#each tickList as tick}
91
- <div
92
- class="tick"
93
- class:hidden={Math.abs(tick - percent) < 0.01}
94
- class:inactive={tick > percent}
95
- style:--x={tick - 0.5}
96
- ></div>
97
- {/each}
98
- {/if}
99
- {#if endStops && !ticks && !trailingIcon}
100
- <div class="endstop" class:hidden={containerWidth * (1 - percent) < 14}></div>
101
- {/if}
102
103
  <div class="handle"></div>
103
104
  {#if showValue}
104
105
  <div class="value m3-font-label-large">{format(value)}</div>
@@ -118,6 +119,11 @@
118
119
  min-width: 10rem;
119
120
  print-color-adjust: exact;
120
121
  -webkit-print-color-adjust: exact;
122
+
123
+ --functional-width: calc(100% - 2 * (0.25rem + 0.125rem));
124
+ --handle-left: calc(50% + var(--functional-width) * var(--handle) - 0.125rem - 0.375rem);
125
+ --handle-center: calc(50% + var(--functional-width) * var(--handle));
126
+ --handle-right: calc(50% + var(--functional-width) * var(--handle) + 0.125rem + 0.375rem);
121
127
  }
122
128
 
123
129
  .m3-container.xs {
@@ -160,15 +166,15 @@
160
166
  width: var(--icon-size);
161
167
  height: var(--icon-size);
162
168
  top: 50%;
163
- inset-inline-start: 0.25rem;
169
+ inset-inline-start: 0;
170
+ margin-inline-start: 0.25rem;
164
171
  translate: 0 -50%;
165
172
  pointer-events: none;
166
173
  color: rgb(var(--m3-scheme-secondary-container));
167
174
  }
168
175
 
169
176
  .m3-container :global(.leading.pop) {
170
- inset-inline-start: var(--percent);
171
- margin-inline-start: 0.625rem;
177
+ inset-inline-start: var(--handle-right);
172
178
  color: rgb(var(--m3-scheme-primary));
173
179
  }
174
180
 
@@ -177,113 +183,118 @@
177
183
  width: var(--icon-size);
178
184
  height: var(--icon-size);
179
185
  top: 50%;
180
- inset-inline-end: 0.25rem;
186
+ inset-inline-end: 0;
187
+ margin-inline-end: 0.25rem;
181
188
  translate: 0 -50%;
182
189
  pointer-events: none;
183
190
  color: rgb(var(--m3-scheme-primary));
184
191
  }
185
192
 
186
193
  .m3-container :global(.trailing.pop) {
187
- inset-inline-end: abs(100% - var(--percent));
188
- margin-inline-end: 0.625rem;
194
+ inset-inline-end: calc(100% - var(--handle-left));
189
195
  color: rgb(var(--m3-scheme-secondary-container));
190
196
  }
191
197
 
192
- .endstop {
193
- position: absolute;
194
- width: 4px;
195
- height: 4px;
196
- border-radius: var(--m3-util-rounding-full);
197
- top: 50%;
198
- inset-inline-end: 4px;
199
- translate: 0 -50%;
200
- background-color: rgb(var(--m3-scheme-on-secondary-container));
201
- pointer-events: none;
202
- &.hidden {
203
- display: none;
204
- }
205
- }
206
-
207
198
  input {
208
199
  position: absolute;
209
- inset-inline: -0.5rem;
210
- width: calc(100% + 1rem);
200
+ width: calc(var(--functional-width) + 1rem);
201
+ left: 50%;
202
+ translate: -50% 0;
211
203
  height: 100%;
212
204
 
213
205
  opacity: 0;
214
206
  appearance: none;
215
207
  margin: 0;
216
- cursor: pointer;
217
- }
218
208
 
219
- .track::before {
220
- position: absolute;
221
- content: " ";
222
- inset-inline-start: 0;
223
- top: 50%;
224
- translate: 0 -50%;
225
- width: calc(var(--percent) - 0.375rem);
226
- height: var(--track-height);
227
- pointer-events: none;
228
-
229
- background-color: rgb(var(--m3-scheme-primary));
230
- border-start-start-radius: var(--track-radius);
231
- border-end-start-radius: var(--track-radius);
232
- border-start-end-radius: var(--m3-slider-track-in-shape);
233
- border-end-end-radius: var(--m3-slider-track-in-shape);
209
+ &:enabled {
210
+ cursor: pointer;
211
+ }
234
212
  }
235
213
 
236
- .track::after {
214
+ .track-1,
215
+ .track-2 {
237
216
  position: absolute;
238
- content: " ";
239
- inset-inline-end: 0;
217
+ inset-inline: 0;
240
218
  top: 50%;
241
219
  translate: 0 -50%;
242
- width: calc(100% - var(--percent) - 0.375rem);
243
220
  height: var(--track-height);
244
221
  pointer-events: none;
222
+ }
223
+ .track-1 {
224
+ background-color: rgb(var(--m3-scheme-primary));
225
+ clip-path: inset(
226
+ 0 calc(100% - var(--handle-left)) 0 0 round var(--track-radius)
227
+ var(--m3-slider-track-in-shape) var(--m3-slider-track-in-shape) var(--track-radius)
228
+ );
229
+ &:dir(rtl) {
230
+ clip-path: inset(
231
+ 0 0 0 calc(100% - var(--handle-left)) round var(--m3-slider-track-in-shape)
232
+ var(--track-radius) var(--track-radius) var(--m3-slider-track-in-shape)
233
+ );
234
+ }
245
235
 
246
- background-color: rgb(var(--m3-scheme-secondary-container));
247
- border-start-start-radius: var(--m3-slider-track-in-shape);
248
- border-end-start-radius: var(--m3-slider-track-in-shape);
249
- border-start-end-radius: var(--track-radius);
250
- border-end-end-radius: var(--track-radius);
236
+ @media screen and (forced-colors: active) {
237
+ background-color: selecteditem;
238
+ }
239
+ &:is(input:disabled ~ .track-1) {
240
+ background-color: rgb(var(--m3-scheme-on-surface) / 0.38);
241
+ @media screen and (forced-colors: active) {
242
+ background-color: canvastext;
243
+ }
244
+ }
251
245
  }
246
+ .track-2 {
247
+ background-color: rgb(var(--m3-scheme-secondary-container));
248
+ clip-path: inset(
249
+ 0 0 0 var(--handle-right) round var(--m3-slider-track-in-shape) var(--track-radius)
250
+ var(--track-radius) var(--m3-slider-track-in-shape)
251
+ );
252
+ &:dir(rtl) {
253
+ clip-path: inset(
254
+ 0 var(--handle-right) 0 0 round var(--track-radius) var(--m3-slider-track-in-shape)
255
+ var(--m3-slider-track-in-shape) var(--track-radius)
256
+ );
257
+ }
252
258
 
253
- .tick {
259
+ @media screen and (forced-colors: active) {
260
+ background-color: canvastext;
261
+ }
262
+ &:is(input:disabled ~ .track-2) {
263
+ background-color: rgb(var(--m3-scheme-on-surface) / 0.12);
264
+ @media screen and (forced-colors: active) {
265
+ background-color: graytext;
266
+ }
267
+ }
268
+ }
269
+ .stop {
254
270
  position: absolute;
255
271
  width: 4px;
256
272
  height: 4px;
257
273
  border-radius: var(--m3-util-rounding-full);
258
274
  top: 50%;
259
- inset-inline-start: calc(50% + (100% - 0.75rem) * var(--x));
275
+ inset-inline-start: calc(50% + (100% - 0.5rem - 0.25rem) * var(--x));
260
276
  translate: -50% -50%;
261
277
  &:dir(rtl) {
262
278
  translate: 50% -50%;
263
279
  }
264
- background-color: rgb(var(--m3-scheme-on-primary));
280
+ &:is(.track-1 > .stop) {
281
+ background-color: rgb(var(--m3-scheme-on-primary));
282
+ &:is(input:disabled ~ .track-1 > .stop) {
283
+ background-color: rgb(var(--m3-scheme-inverse-on-surface));
284
+ }
285
+ }
286
+ &:is(.track-2 > .stop) {
287
+ background-color: rgb(var(--m3-scheme-primary));
288
+ &:is(input:disabled ~ .track-2 > .stop) {
289
+ background-color: rgb(var(--m3-scheme-on-surface) / 0.38);
290
+ }
291
+ }
265
292
  pointer-events: none;
266
293
  }
267
294
 
268
- .tick.hidden {
269
- display: none;
270
- }
271
-
272
- .tick.inactive {
273
- background-color: rgb(var(--m3-scheme-on-secondary-container));
274
- }
275
-
276
- :global(.leading) ~ .tick:nth-child(1 of div.tick) {
277
- display: none;
278
- }
279
-
280
- :global(.trailing) ~ .tick:nth-last-child(1 of div.tick) {
281
- display: none;
282
- }
283
-
284
295
  .handle {
285
296
  position: absolute;
286
- inset-inline-start: var(--percent);
297
+ inset-inline-start: var(--handle-center);
287
298
  translate: -50% 0;
288
299
  &:dir(rtl) {
289
300
  translate: 50% 0;
@@ -295,6 +306,16 @@
295
306
 
296
307
  pointer-events: none;
297
308
  transition: width var(--m3-util-easing);
309
+
310
+ @media screen and (forced-colors: active) {
311
+ background-color: selecteditem;
312
+ }
313
+ &:is(input:disabled ~ .handle) {
314
+ background-color: rgb(var(--m3-scheme-on-surface) / 0.38);
315
+ @media screen and (forced-colors: active) {
316
+ background-color: graytext;
317
+ }
318
+ }
298
319
  }
299
320
 
300
321
  .value {
@@ -309,7 +330,7 @@
309
330
  padding: 0.75rem 1rem;
310
331
  border-radius: var(--m3-slider-handle-shape);
311
332
 
312
- inset-inline-start: var(--percent);
333
+ inset-inline-start: var(--handle-center);
313
334
  bottom: calc(var(--handle-height) + 4px);
314
335
  translate: -50% 0;
315
336
  &:dir(rtl) {
@@ -320,6 +341,10 @@
320
341
  pointer-events: none;
321
342
  transition: opacity var(--m3-util-easing);
322
343
  z-index: 1;
344
+ @media screen and (forced-colors: active) {
345
+ border: 2px solid selecteditem;
346
+ overflow: hidden;
347
+ }
323
348
  }
324
349
 
325
350
  input:focus-visible ~ .handle {
@@ -338,49 +363,4 @@
338
363
  input:enabled:active ~ .value {
339
364
  opacity: 1;
340
365
  }
341
-
342
- input:disabled {
343
- cursor: auto;
344
- }
345
- input:disabled ~ .track::before {
346
- background-color: rgb(var(--m3-scheme-on-surface) / 0.38);
347
- }
348
- input:disabled ~ .track::after {
349
- background-color: rgb(var(--m3-scheme-on-surface) / 0.12);
350
- }
351
- input:disabled ~ .handle {
352
- background-color: rgb(var(--m3-scheme-on-surface) / 0.38);
353
- }
354
- input:disabled ~ .tick {
355
- background-color: rgb(var(--m3-scheme-inverse-on-surface));
356
- }
357
- input:disabled ~ .tick.inactive,
358
- input:disabled ~ .endstop {
359
- background-color: rgb(var(--m3-scheme-on-surface));
360
- }
361
-
362
- @media screen and (forced-colors: active) {
363
- .track::before {
364
- background-color: selecteditem;
365
- }
366
- .track::after {
367
- background-color: canvastext;
368
- }
369
- .handle {
370
- background-color: selecteditem;
371
- }
372
- .value {
373
- border: 2px solid selecteditem;
374
- overflow: hidden;
375
- }
376
- input:disabled + .track::before {
377
- background-color: canvastext;
378
- }
379
- input:disabled + .track::after {
380
- background-color: graytext;
381
- }
382
- input:disabled ~ .handle {
383
- background-color: graytext;
384
- }
385
- }
386
366
  </style>
@@ -10,7 +10,7 @@ type $$ComponentProps = {
10
10
  size?: "xs" | "s" | "m" | "l" | "xl";
11
11
  leadingIcon?: IconifyIcon;
12
12
  trailingIcon?: IconifyIcon;
13
- ticks?: boolean;
13
+ stops?: boolean;
14
14
  endStops?: boolean;
15
15
  format?: (n: number) => string;
16
16
  } & Omit<HTMLInputAttributes, "size">;
@@ -6,7 +6,7 @@
6
6
  import type { ComponentProps } from "svelte";
7
7
  import Slider from "./Slider.svelte";
8
8
 
9
- let props: Omit<ComponentProps<typeof Slider>, "ticks"> = $props();
9
+ let props: Omit<ComponentProps<typeof Slider>, "stops"> = $props();
10
10
  </script>
11
11
 
12
- <Slider {...props} ticks={true}></Slider>
12
+ <Slider {...props} stops={true}></Slider>
@@ -9,9 +9,9 @@ declare const SliderTicks: import("svelte").Component<Omit<{
9
9
  size?: "xs" | "s" | "m" | "l" | "xl";
10
10
  leadingIcon?: import("@iconify/types").IconifyIcon;
11
11
  trailingIcon?: import("@iconify/types").IconifyIcon;
12
- ticks?: boolean;
12
+ stops?: boolean;
13
13
  endStops?: boolean;
14
14
  format?: (n: number) => string;
15
- } & Omit<import("svelte/elements").HTMLInputAttributes, "size">, "ticks">, {}, "">;
15
+ } & Omit<import("svelte/elements").HTMLInputAttributes, "size">, "stops">, {}, "">;
16
16
  type SliderTicks = ReturnType<typeof SliderTicks>;
17
17
  export default SliderTicks;
@@ -45,7 +45,7 @@
45
45
  {...extra}
46
46
  defaultValue={extra.defaultValue}
47
47
  />
48
- <!-- TODO: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
48
+ <!-- TODO/deprecated: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
49
49
  <label class="m3-font-body-large" for={id}>{label}</label>
50
50
  <div class="layer"></div>
51
51
  {#if leadingIcon}
@@ -62,7 +62,8 @@
62
62
 
63
63
  <style>
64
64
  :root {
65
- --m3-textfield-filled-shape: var(--m3-util-rounding-extra-small);
65
+ /* "textfield" is deprecated */
66
+ --m3-field-filled-shape: var(--m3-textfield-filled-shape, var(--m3-util-rounding-extra-small));
66
67
  }
67
68
 
68
69
  .m3-container {
@@ -80,7 +81,7 @@
80
81
  border: none;
81
82
  outline: none;
82
83
  padding: 1.5rem 1rem 0.5rem 1rem;
83
- border-radius: var(--m3-textfield-filled-shape) var(--m3-textfield-filled-shape) 0 0;
84
+ border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
84
85
  background-color: rgb(var(--m3-scheme-surface-container-highest));
85
86
  color: rgb(var(--m3-scheme-on-surface));
86
87
  }
@@ -118,7 +119,7 @@
118
119
  .layer {
119
120
  position: absolute;
120
121
  inset: 0;
121
- border-radius: var(--m3-textfield-filled-shape) var(--m3-textfield-filled-shape) 0 0;
122
+ border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
122
123
  pointer-events: none;
123
124
  transition: all 100ms;
124
125
  &:is(input:enabled:hover ~ .layer) {
@@ -47,7 +47,7 @@
47
47
  {...extra}
48
48
  defaultValue={extra.defaultValue}
49
49
  ></textarea>
50
- <!-- TODO: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
50
+ <!-- TODO/deprecated: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
51
51
  <label class="m3-font-body-large" for={id}>{label}</label>
52
52
  <div class="layer"></div>
53
53
  {#if leadingIcon}
@@ -57,7 +57,8 @@
57
57
 
58
58
  <style>
59
59
  :root {
60
- --m3-textfield-filled-shape: var(--m3-util-rounding-extra-small);
60
+ /* "textfield" is deprecated */
61
+ --m3-field-filled-shape: var(--m3-textfield-filled-shape, var(--m3-util-rounding-extra-small));
61
62
  }
62
63
  .m3-container {
63
64
  display: inline-flex;
@@ -74,7 +75,7 @@
74
75
  border: none;
75
76
  outline: none;
76
77
  padding: 1.5rem 1rem 0.5rem 1rem;
77
- border-radius: var(--m3-textfield-filled-shape) var(--m3-textfield-filled-shape) 0 0;
78
+ border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
78
79
  background-color: rgb(var(--m3-scheme-surface-container-highest));
79
80
  color: rgb(var(--m3-scheme-on-surface));
80
81
  resize: none;
@@ -113,7 +114,7 @@
113
114
  .layer {
114
115
  position: absolute;
115
116
  inset: 0;
116
- border-radius: var(--m3-textfield-filled-shape) var(--m3-textfield-filled-shape) 0 0;
117
+ border-radius: var(--m3-field-filled-shape) var(--m3-field-filled-shape) 0 0;
117
118
  pointer-events: none;
118
119
  transition: all 100ms;
119
120
  &:is(textarea:enabled:hover ~ .layer) {
@@ -45,7 +45,7 @@
45
45
  {...extra}
46
46
  defaultValue={extra.defaultValue}
47
47
  />
48
- <!-- TODO: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
48
+ <!-- TODO/deprecated: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
49
49
  <div class="layer"></div>
50
50
  <label class="m3-font-body-large" for={id}>{label}</label>
51
51
  {#if leadingIcon}
@@ -66,7 +66,11 @@
66
66
  do this: <TextFieldOutlined --m3-util-background="rgb(var(--m3-scheme-surface-container))" />
67
67
  */
68
68
  :root {
69
- --m3-textfield-outlined-shape: var(--m3-util-rounding-extra-small);
69
+ /* "textfield" is deprecated */
70
+ --m3-field-outlined-shape: var(
71
+ --m3-textfield-outlined-shape,
72
+ var(--m3-util-rounding-extra-small)
73
+ );
70
74
  }
71
75
  .m3-container {
72
76
  display: inline-flex;
@@ -83,7 +87,7 @@
83
87
  border: none;
84
88
  outline: none;
85
89
  padding: 1rem;
86
- border-radius: var(--m3-textfield-outlined-shape);
90
+ border-radius: var(--m3-field-outlined-shape);
87
91
  background-color: transparent;
88
92
  color: rgb(var(--m3-scheme-on-surface));
89
93
  }
@@ -122,7 +126,7 @@
122
126
  position: absolute;
123
127
  inset: 0;
124
128
  border: 1px solid rgb(var(--error, var(--m3-scheme-outline)));
125
- border-radius: var(--m3-textfield-outlined-shape);
129
+ border-radius: var(--m3-field-outlined-shape);
126
130
  pointer-events: none;
127
131
  transition: all 100ms;
128
132
  &:is(input:enabled:hover ~ .layer) {