m3-svelte 4.3.3 → 4.4.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.
@@ -14,7 +14,7 @@
14
14
  };
15
15
 
16
16
  let {
17
- name,
17
+ label: _label,
18
18
  leadingIcon,
19
19
  trailingIcon,
20
20
  trailingClick,
@@ -25,7 +25,7 @@
25
25
  enter,
26
26
  ...extra
27
27
  }: {
28
- name: string;
28
+ label: string;
29
29
  leadingIcon?: IconifyIcon;
30
30
  disabled?: boolean;
31
31
  required?: boolean;
@@ -35,6 +35,8 @@
35
35
  } & TrailingProps &
36
36
  HTMLInputAttributes = $props();
37
37
  const id = crypto.randomUUID();
38
+
39
+ let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
38
40
  </script>
39
41
 
40
42
  <div
@@ -53,7 +55,7 @@
53
55
  {required}
54
56
  {...extra}
55
57
  />
56
- <label class="m3-font-body-large" for={id}>{name}</label>
58
+ <label class="m3-font-body-large" for={id}>{label}</label>
57
59
  <div class="layer"></div>
58
60
  {#if leadingIcon}
59
61
  <Icon icon={leadingIcon} class="leading" />
@@ -8,7 +8,7 @@ type TrailingProps = {
8
8
  trailingClick?: undefined;
9
9
  };
10
10
  type $$ComponentProps = {
11
- name: string;
11
+ label: string;
12
12
  leadingIcon?: IconifyIcon;
13
13
  disabled?: boolean;
14
14
  required?: boolean;
@@ -4,7 +4,7 @@
4
4
  import type { HTMLTextareaAttributes } from "svelte/elements";
5
5
 
6
6
  let {
7
- name,
7
+ label: _label,
8
8
  leadingIcon,
9
9
  disabled = false,
10
10
  required = false,
@@ -12,7 +12,7 @@
12
12
  value = $bindable(""),
13
13
  ...extra
14
14
  }: {
15
- name: string;
15
+ label: string;
16
16
  leadingIcon?: IconifyIcon;
17
17
  disabled?: boolean;
18
18
  required?: boolean;
@@ -34,6 +34,8 @@
34
34
  },
35
35
  };
36
36
  };
37
+
38
+ let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
37
39
  </script>
38
40
 
39
41
  <div class="m3-container" class:leading-icon={leadingIcon} class:error use:resize>
@@ -46,7 +48,7 @@
46
48
  {required}
47
49
  {...extra}
48
50
  ></textarea>
49
- <label class="m3-font-body-large" for={id}>{name}</label>
51
+ <label class="m3-font-body-large" for={id}>{label}</label>
50
52
  <div class="layer"></div>
51
53
  {#if leadingIcon}
52
54
  <Icon icon={leadingIcon} />
@@ -1,7 +1,7 @@
1
1
  import type { IconifyIcon } from "@iconify/types";
2
2
  import type { HTMLTextareaAttributes } from "svelte/elements";
3
3
  type $$ComponentProps = {
4
- name: string;
4
+ label: string;
5
5
  leadingIcon?: IconifyIcon;
6
6
  disabled?: boolean;
7
7
  required?: boolean;
@@ -14,7 +14,7 @@
14
14
  };
15
15
 
16
16
  let {
17
- name,
17
+ label: _label,
18
18
  leadingIcon,
19
19
  trailingIcon,
20
20
  trailingClick,
@@ -25,7 +25,7 @@
25
25
  enter,
26
26
  ...extra
27
27
  }: {
28
- name: string;
28
+ label: string;
29
29
  leadingIcon?: IconifyIcon;
30
30
  disabled?: boolean;
31
31
  required?: boolean;
@@ -35,6 +35,8 @@
35
35
  } & TrailingProps &
36
36
  HTMLInputAttributes = $props();
37
37
  const id = crypto.randomUUID();
38
+
39
+ let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
38
40
  </script>
39
41
 
40
42
  <div
@@ -54,7 +56,7 @@
54
56
  {...extra}
55
57
  />
56
58
  <div class="layer"></div>
57
- <label class="m3-font-body-large" for={id}>{name}</label>
59
+ <label class="m3-font-body-large" for={id}>{label}</label>
58
60
  {#if leadingIcon}
59
61
  <Icon icon={leadingIcon} class="leading" />
60
62
  {/if}
@@ -8,7 +8,7 @@ type TrailingProps = {
8
8
  trailingClick?: undefined;
9
9
  };
10
10
  type $$ComponentProps = {
11
- name: string;
11
+ label: string;
12
12
  leadingIcon?: IconifyIcon;
13
13
  disabled?: boolean;
14
14
  required?: boolean;
@@ -4,7 +4,7 @@
4
4
  import type { HTMLTextareaAttributes } from "svelte/elements";
5
5
 
6
6
  let {
7
- name,
7
+ label: _label,
8
8
  leadingIcon,
9
9
  disabled = false,
10
10
  required = false,
@@ -12,7 +12,7 @@
12
12
  value = $bindable(""),
13
13
  ...extra
14
14
  }: {
15
- name: string;
15
+ label: string;
16
16
  leadingIcon?: IconifyIcon;
17
17
  disabled?: boolean;
18
18
  required?: boolean;
@@ -34,6 +34,8 @@
34
34
  },
35
35
  };
36
36
  };
37
+
38
+ let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
37
39
  </script>
38
40
 
39
41
  <div class="m3-container" class:leading-icon={leadingIcon} class:error use:resize>
@@ -47,7 +49,7 @@
47
49
  {...extra}
48
50
  ></textarea>
49
51
  <div class="layer"></div>
50
- <label class="m3-font-body-large" for={id}>{name}</label>
52
+ <label class="m3-font-body-large" for={id}>{label}</label>
51
53
  {#if leadingIcon}
52
54
  <Icon icon={leadingIcon} />
53
55
  {/if}
@@ -1,7 +1,7 @@
1
1
  import type { IconifyIcon } from "@iconify/types";
2
2
  import type { HTMLTextareaAttributes } from "svelte/elements";
3
3
  type $$ComponentProps = {
4
- name: string;
4
+ label: string;
5
5
  leadingIcon?: IconifyIcon;
6
6
  disabled?: boolean;
7
7
  required?: boolean;
@@ -10,13 +10,13 @@
10
10
  import { easeEmphasized } from "../misc/easing";
11
11
 
12
12
  let {
13
- name,
13
+ label: _label,
14
14
  date = $bindable(""),
15
15
  required = false,
16
16
  disabled = false,
17
17
  ...extra
18
18
  }: {
19
- name: string;
19
+ label: string;
20
20
  date?: string;
21
21
  required?: boolean;
22
22
  disabled?: boolean;
@@ -52,6 +52,8 @@ transform: scaleY(${(t * 0.3 + 0.7) * 100}%);
52
52
  opacity: ${Math.min(t * 3, 1)};`,
53
53
  };
54
54
  };
55
+
56
+ let label = $derived(_label || extra.name); // TODO: next breaking version, drop name backsupport
55
57
  </script>
56
58
 
57
59
  <div class="m3-container" class:has-js={hasJs} class:disabled use:clickOutside>
@@ -64,7 +66,7 @@ opacity: ${Math.min(t * 3, 1)};`,
64
66
  bind:value={date}
65
67
  {...extra}
66
68
  />
67
- <label class="m3-font-body-small" for={id}>{name}</label>
69
+ <label class="m3-font-body-small" for={id}>{label}</label>
68
70
  <button type="button" {disabled} onclick={() => (picker = !picker)}>
69
71
  <Layer />
70
72
  <Icon icon={iconCalendar} />
@@ -1,6 +1,6 @@
1
1
  import type { HTMLInputAttributes } from "svelte/elements";
2
2
  type $$ComponentProps = {
3
- name: string;
3
+ label: string;
4
4
  date?: string;
5
5
  required?: boolean;
6
6
  disabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "4.3.3",
3
+ "version": "4.4.0",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {