m3-svelte 4.5.5 → 4.5.7

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.
@@ -13,7 +13,7 @@
13
13
  round?: boolean;
14
14
  children: Snippet;
15
15
  } = $props();
16
- const id = crypto.randomUUID();
16
+ const id = $props.id();
17
17
  </script>
18
18
 
19
19
  <input type="checkbox" {id} bind:checked={toggle} />
@@ -39,6 +39,7 @@
39
39
  border: none;
40
40
  border-radius: var(--m3-card-shape);
41
41
  background-color: rgb(var(--m3-scheme-surface));
42
+ --m3-util-background: var(--m3-scheme-surface);
42
43
  color: rgb(var(--m3-scheme-on-surface));
43
44
  }
44
45
 
@@ -60,10 +61,12 @@
60
61
 
61
62
  .elevated {
62
63
  background-color: rgb(var(--m3-scheme-surface-container-low));
64
+ --m3-util-background: var(--m3-scheme-surface-container-low);
63
65
  box-shadow: var(--m3-util-elevation-1);
64
66
  }
65
67
  .filled {
66
68
  background-color: rgb(var(--m3-scheme-surface-container-highest));
69
+ --m3-util-background: var(--m3-scheme-surface-container-highest);
67
70
  }
68
71
  .outlined {
69
72
  border: solid 1px rgb(var(--m3-scheme-outline-variant));
@@ -77,6 +77,7 @@
77
77
  display: flex;
78
78
  flex-direction: column;
79
79
  background-color: rgb(var(--m3-scheme-surface-container-high));
80
+ --m3-util-background: var(--m3-scheme-surface-container-high);
80
81
  border: none;
81
82
  border-radius: var(--m3-dialog-shape);
82
83
  min-width: 17.5rem;
@@ -34,7 +34,7 @@
34
34
  enter?: () => void;
35
35
  } & TrailingProps &
36
36
  HTMLInputAttributes = $props();
37
- const id = crypto.randomUUID();
37
+ const id = $props.id();
38
38
 
39
39
  let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
40
40
  </script>
@@ -19,7 +19,7 @@
19
19
  error?: boolean;
20
20
  value?: string;
21
21
  } & HTMLTextareaAttributes = $props();
22
- const id = crypto.randomUUID();
22
+ const id = $props.id();
23
23
  const resize = (node: HTMLElement) => {
24
24
  const update = () => {
25
25
  const textarea = node.firstElementChild as HTMLTextAreaElement;
@@ -34,7 +34,7 @@
34
34
  enter?: () => void;
35
35
  } & TrailingProps &
36
36
  HTMLInputAttributes = $props();
37
- const id = crypto.randomUUID();
37
+ const id = $props.id();
38
38
 
39
39
  let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
40
40
  </script>
@@ -99,7 +99,9 @@
99
99
  left: 0.75rem;
100
100
  top: 1rem;
101
101
  color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
102
- background-color: rgb(var(--m3-util-background, var(--m3-scheme-surface)));
102
+ background-color: rgb(
103
+ var(--m3-util-background, var(--m3-scheme-surface))
104
+ ); /* TODO: next breaking change, make --m3-util-background a full color and update the comment above */
103
105
  padding: 0 0.25rem;
104
106
  pointer-events: none;
105
107
  transition:
@@ -19,7 +19,7 @@
19
19
  error?: boolean;
20
20
  value?: string;
21
21
  } & HTMLTextareaAttributes = $props();
22
- const id = crypto.randomUUID();
22
+ const id = $props.id();
23
23
  const resize = (node: HTMLElement) => {
24
24
  const update = () => {
25
25
  const textarea = node.firstElementChild as HTMLTextAreaElement;
@@ -88,7 +88,9 @@
88
88
  left: 0.75rem;
89
89
  top: 1rem;
90
90
  color: rgb(var(--error, var(--m3-scheme-on-surface-variant)));
91
- background-color: rgb(var(--m3-util-background, var(--m3-scheme-surface)));
91
+ background-color: rgb(
92
+ var(--m3-util-background, var(--m3-scheme-surface))
93
+ ); /* TODO: next breaking change, make --m3-util-background a full color and update the comment above */
92
94
  padding: 0 0.25rem;
93
95
  pointer-events: none;
94
96
  transition:
@@ -18,7 +18,7 @@
18
18
  value: string;
19
19
  }[];
20
20
  } & HTMLInputAttributes = $props();
21
- const name = crypto.randomUUID();
21
+ const name = $props.id();
22
22
  </script>
23
23
 
24
24
  <div class="m3-container" class:primary={!secondary} style:--items={items.length}>
@@ -19,7 +19,7 @@
19
19
  }[];
20
20
  } & HTMLInputAttributes = $props();
21
21
 
22
- const name = crypto.randomUUID();
22
+ const name = $props.id();
23
23
  let wrapper: HTMLDivElement | undefined = $state();
24
24
  const handleInput = (e: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
25
25
  const before = tab;
@@ -22,7 +22,7 @@
22
22
  disabled?: boolean;
23
23
  } & HTMLInputAttributes = $props();
24
24
 
25
- const id = crypto.randomUUID();
25
+ const id = $props.id();
26
26
  let hasJs = $state(false);
27
27
  onMount(() => {
28
28
  hasJs = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "4.5.5",
3
+ "version": "4.5.7",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {