m3-svelte 5.6.0 → 5.7.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.
Files changed (32) hide show
  1. package/package/buttons/Button.svelte +15 -4
  2. package/package/buttons/Button.svelte.d.ts +5 -2
  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/ListItem.svelte +36 -47
  8. package/package/containers/ListItem.svelte.d.ts +3 -3
  9. package/package/containers/Snackbar.svelte +2 -2
  10. package/package/containers/Snackbar.svelte.d.ts +2 -2
  11. package/package/containers/SnackbarItem.svelte +2 -2
  12. package/package/containers/SnackbarItem.svelte.d.ts +2 -2
  13. package/package/forms/Checkbox.svelte +2 -2
  14. package/package/forms/Checkbox.svelte.d.ts +2 -2
  15. package/package/forms/DateField.svelte +1 -1
  16. package/package/forms/DateFieldOutlined.svelte +1 -1
  17. package/package/forms/LinearProgressIndeterminate.svelte +2 -2
  18. package/package/forms/LinearProgressIndeterminate.svelte.d.ts +2 -2
  19. package/package/forms/RadioAnim1.svelte +2 -2
  20. package/package/forms/RadioAnim1.svelte.d.ts +2 -2
  21. package/package/forms/RadioAnim2.svelte +2 -2
  22. package/package/forms/RadioAnim2.svelte.d.ts +2 -2
  23. package/package/forms/RadioAnim3.svelte +2 -2
  24. package/package/forms/RadioAnim3.svelte.d.ts +2 -2
  25. package/package/forms/TextField.svelte +1 -1
  26. package/package/forms/TextFieldMultiline.svelte +1 -1
  27. package/package/forms/TextFieldOutlined.svelte +1 -1
  28. package/package/forms/TextFieldOutlinedMultiline.svelte +1 -1
  29. package/package/forms/WavyLinearProgress.svelte +5 -7
  30. package/package/misc/typing-utils.d.ts +2 -1
  31. package/package/nav/NavCMLXItem.svelte +4 -2
  32. package/package.json +6 -6
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import type { HTMLButtonAttributes } from "svelte/elements";
2
+ import type { HTMLButtonAttributes, HTMLAttributes } from "svelte/elements";
3
3
  import type { Snippet } from "svelte";
4
4
  import type { LabelAttrs, AnchorAttrs } from "../misc/typing-utils";
5
5
  import Layer from "../misc/Layer.svelte";
6
6
 
7
7
  // If you want a toggle button, use `for` with a checkbox input.
8
- type ActionProps = LabelAttrs | AnchorAttrs | HTMLButtonAttributes;
8
+ type SummaryAttrs = HTMLAttributes<HTMLElement> & { summary: true };
9
+ type ActionProps = LabelAttrs | AnchorAttrs | SummaryAttrs | HTMLButtonAttributes;
9
10
  type Props = {
10
11
  variant?: "elevated" | "filled" | "tonal" | "outlined" | "text";
11
12
  square?: boolean;
@@ -52,6 +53,16 @@
52
53
  <Layer />
53
54
  {@render children()}
54
55
  </a>
56
+ {:else if "summary" in props}
57
+ {@const { variant = "filled", square = false, iconType = "none", children, ...extra } = props}
58
+ <summary
59
+ class="m3-container m3-font-label-large {variant} icon-{iconType}"
60
+ class:square
61
+ {...extra}
62
+ >
63
+ <Layer />
64
+ {@render children()}
65
+ </summary>
55
66
  {:else}
56
67
  {@const { variant = "filled", square = false, iconType = "none", children, ...extra } = props}
57
68
  <button
@@ -154,8 +165,8 @@
154
165
  }
155
166
  }
156
167
 
157
- &.square:not(:global(input:checked) + label),
158
- &:is(:global(input:checked) + label):not(.square) {
168
+ &.square:not(:is(:global(input:checked) + label, :global(:open) > summary)),
169
+ &:is(:global(input:checked) + label, :global(:open) > summary):not(.square) {
159
170
  border-radius: var(--m3-util-rounding-medium);
160
171
  }
161
172
  &:active:not(:disabled, :global(input:disabled) + label) {
@@ -1,7 +1,10 @@
1
- import type { HTMLButtonAttributes } from "svelte/elements";
1
+ import type { HTMLButtonAttributes, HTMLAttributes } from "svelte/elements";
2
2
  import type { Snippet } from "svelte";
3
3
  import type { LabelAttrs, AnchorAttrs } from "../misc/typing-utils";
4
- type ActionProps = LabelAttrs | AnchorAttrs | HTMLButtonAttributes;
4
+ type SummaryAttrs = HTMLAttributes<HTMLElement> & {
5
+ summary: true;
6
+ };
7
+ type ActionProps = LabelAttrs | AnchorAttrs | SummaryAttrs | HTMLButtonAttributes;
5
8
  type Props = {
6
9
  variant?: "elevated" | "filled" | "tonal" | "outlined" | "text";
7
10
  square?: boolean;
@@ -3,6 +3,7 @@
3
3
  import type { Snippet } from "svelte";
4
4
  import Layer from "../misc/Layer.svelte";
5
5
  import Icon from "../misc/_icon.svelte";
6
+ import type { ButtonAttrs } from "../misc/typing-utils";
6
7
 
7
8
  let {
8
9
  variant,
@@ -10,15 +11,14 @@
10
11
  y = "down",
11
12
  children,
12
13
  menu,
13
- onclick,
14
+ ...extra
14
15
  }: {
15
16
  variant: "elevated" | "filled" | "tonal" | "outlined";
16
17
  x?: "inner" | "right";
17
18
  y?: "down" | "up";
18
19
  children: Snippet;
19
20
  menu: Snippet;
20
- onclick: () => void;
21
- } = $props();
21
+ } & ButtonAttrs = $props();
22
22
 
23
23
  const autoclose = (node: HTMLDetailsElement) => {
24
24
  const close = (e: Event) => {
@@ -36,7 +36,7 @@
36
36
  </script>
37
37
 
38
38
  <div class="m3-container {variant}">
39
- <button type="button" class="split m3-font-label-large" {onclick}>
39
+ <button type="button" class="split m3-font-label-large" {...extra}>
40
40
  <Layer />
41
41
  {@render children()}
42
42
  </button>
@@ -1,12 +1,12 @@
1
1
  import type { Snippet } from "svelte";
2
+ import type { ButtonAttrs } from "../misc/typing-utils";
2
3
  type $$ComponentProps = {
3
4
  variant: "elevated" | "filled" | "tonal" | "outlined";
4
5
  x?: "inner" | "right";
5
6
  y?: "down" | "up";
6
7
  children: Snippet;
7
8
  menu: Snippet;
8
- onclick: () => void;
9
- };
9
+ } & ButtonAttrs;
10
10
  declare const SplitButton: import("svelte").Component<$$ComponentProps, {}, "">;
11
11
  type SplitButton = ReturnType<typeof SplitButton>;
12
12
  export default SplitButton;
@@ -1,10 +1,9 @@
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";
5
- import type { ButtonAttrs, NotButton } from "../misc/typing-utils";
4
+ import type { ButtonAttrs, DivAttrs } from "../misc/typing-utils";
6
5
 
7
- type ActionProps = ButtonAttrs | NotButton<HTMLAttributes<HTMLDivElement>>;
6
+ type ActionProps = ButtonAttrs | DivAttrs;
8
7
 
9
8
  let props: {
10
9
  variant: "elevated" | "filled" | "outlined";
@@ -1,7 +1,6 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
3
- import type { ButtonAttrs, NotButton } from "../misc/typing-utils";
4
- type ActionProps = ButtonAttrs | NotButton<HTMLAttributes<HTMLDivElement>>;
2
+ import type { ButtonAttrs, DivAttrs } from "../misc/typing-utils";
3
+ type ActionProps = ButtonAttrs | DivAttrs;
5
4
  type $$ComponentProps = {
6
5
  variant: "elevated" | "filled" | "outlined";
7
6
  children: Snippet;
@@ -1,16 +1,24 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from "svelte";
3
- import type { HTMLAnchorAttributes, HTMLAttributes, HTMLLabelAttributes } from "svelte/elements";
3
+ import type { HTMLAnchorAttributes, HTMLLabelAttributes } from "svelte/elements";
4
4
  import Layer from "../misc/Layer.svelte";
5
- import type { ButtonAttrs, NotButton } from "../misc/typing-utils";
5
+ import type { ButtonAttrs, DivAttrs, NotButton } from "../misc/typing-utils";
6
6
 
7
7
  type ActionProps =
8
- | NotButton<HTMLAttributes<HTMLDivElement>>
8
+ | DivAttrs
9
9
  | ButtonAttrs
10
10
  | ({ label: true } & NotButton<HTMLLabelAttributes>)
11
11
  | ({ href: string } & NotButton<HTMLAnchorAttributes>);
12
12
 
13
- let props: {
13
+ let {
14
+ leading,
15
+ overline = "",
16
+ headline = "",
17
+ supporting = "",
18
+ trailing,
19
+ lines = overline && supporting ? 3 : overline || supporting ? 2 : 1,
20
+ ...props
21
+ }: {
14
22
  leading?: Snippet;
15
23
  overline?: string;
16
24
  headline?: string;
@@ -18,19 +26,9 @@
18
26
  trailing?: Snippet;
19
27
  lines?: number;
20
28
  } & ActionProps = $props();
21
- let _lines = $derived(
22
- props.lines ||
23
- (props.overline && props.supporting ? 3 : props.overline || props.supporting ? 2 : 1),
24
- );
25
29
  </script>
26
30
 
27
- {#snippet content(
28
- leading: Snippet | undefined,
29
- overline: string,
30
- headline: string,
31
- supporting: string,
32
- trailing: Snippet | undefined,
33
- )}
31
+ {#snippet content()}
34
32
  {#if leading}
35
33
  <div class="leading">
36
34
  {@render leading()}
@@ -53,38 +51,29 @@
53
51
  {/if}
54
52
  {/snippet}
55
53
 
56
- {#if "label" in props}
57
- {@const {
58
- leading,
59
- overline = "",
60
- headline = "",
61
- supporting = "",
62
- trailing,
63
- label: _,
64
- ...extra
65
- } = props}
66
- <label class="m3-container focus-inset lines-{_lines}" {...extra}>
67
- <Layer />
68
- {@render content(leading, overline, headline, supporting, trailing)}
69
- </label>
70
- {:else if "onclick" in props}
71
- {@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
72
- <button type="button" class="m3-container focus-inset lines-{_lines}" {...extra}>
73
- <Layer />
74
- {@render content(leading, overline, headline, supporting, trailing)}
75
- </button>
76
- {:else if "href" in props}
77
- {@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
78
- <a class="m3-container focus-inset lines-{_lines}" {...extra}>
79
- <Layer />
80
- {@render content(leading, overline, headline, supporting, trailing)}
81
- </a>
82
- {:else}
83
- {@const { leading, overline = "", headline = "", supporting = "", trailing, ...extra } = props}
84
- <div class="m3-container lines-{_lines}" {...extra}>
85
- {@render content(leading, overline, headline, supporting, trailing)}
86
- </div>
87
- {/if}
54
+ <li style:display="contents">
55
+ {#if "label" in props}
56
+ {@const { label: _, ...extra } = props}
57
+ <label class="m3-container focus-inset lines-{lines}" {...extra}>
58
+ <Layer />
59
+ {@render content()}
60
+ </label>
61
+ {:else if "onclick" in props}
62
+ <button type="button" class="m3-container focus-inset lines-{lines}" {...props}>
63
+ <Layer />
64
+ {@render content()}
65
+ </button>
66
+ {:else if "href" in props}
67
+ <a class="m3-container focus-inset lines-{lines}" {...props}>
68
+ <Layer />
69
+ {@render content()}
70
+ </a>
71
+ {:else}
72
+ <div class="m3-container lines-{lines}" {...props}>
73
+ {@render content()}
74
+ </div>
75
+ {/if}
76
+ </li>
88
77
 
89
78
  <style>
90
79
  .m3-container {
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { HTMLAnchorAttributes, HTMLAttributes, HTMLLabelAttributes } from "svelte/elements";
3
- import type { ButtonAttrs, NotButton } from "../misc/typing-utils";
4
- type ActionProps = NotButton<HTMLAttributes<HTMLDivElement>> | ButtonAttrs | ({
2
+ import type { HTMLAnchorAttributes, HTMLLabelAttributes } from "svelte/elements";
3
+ import type { ButtonAttrs, DivAttrs, NotButton } from "../misc/typing-utils";
4
+ type ActionProps = DivAttrs | ButtonAttrs | ({
5
5
  label: true;
6
6
  } & NotButton<HTMLLabelAttributes>) | ({
7
7
  href: string;
@@ -14,12 +14,12 @@
14
14
 
15
15
  <script lang="ts">
16
16
  import { onDestroy, type ComponentProps } from "svelte";
17
- import type { HTMLAttributes } from "svelte/elements";
18
17
  import { fade } from "svelte/transition";
19
18
  import iconX from "@ktibow/iconset-material-symbols/close";
20
19
  import Icon from "../misc/_icon.svelte";
21
20
  import SnackbarItem from "./SnackbarItem.svelte";
22
21
  import Layer from "../misc/Layer.svelte";
22
+ import type { DivAttrs } from "../misc/typing-utils";
23
23
 
24
24
  type SnackbarConfig = Omit<ComponentProps<typeof SnackbarItem>, "children">;
25
25
 
@@ -30,7 +30,7 @@
30
30
  }: {
31
31
  config?: SnackbarConfig;
32
32
  closeButtonTitle?: string;
33
- } & HTMLAttributes<HTMLDivElement> = $props();
33
+ } & DivAttrs = $props();
34
34
  export const show = ({ message, actions = {}, closable = false, timeout = 4000 }: SnackbarIn) => {
35
35
  snackbar = { message, actions, closable, timeout };
36
36
  clearTimeout(timeoutId);
@@ -5,13 +5,13 @@ export type SnackbarIn = {
5
5
  timeout?: number | null;
6
6
  };
7
7
  import { type ComponentProps } from "svelte";
8
- import type { HTMLAttributes } from "svelte/elements";
9
8
  import SnackbarItem from "./SnackbarItem.svelte";
9
+ import type { DivAttrs } from "../misc/typing-utils";
10
10
  type SnackbarConfig = Omit<ComponentProps<typeof SnackbarItem>, "children">;
11
11
  type $$ComponentProps = {
12
12
  config?: SnackbarConfig;
13
13
  closeButtonTitle?: string;
14
- } & HTMLAttributes<HTMLDivElement>;
14
+ } & DivAttrs;
15
15
  declare const Snackbar: import("svelte").Component<$$ComponentProps, {
16
16
  show: ({ message, actions, closable, timeout }: SnackbarIn) => void;
17
17
  }, "">;
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
+ import type { DivAttrs } from "../misc/typing-utils";
2
3
  import type { Snippet } from "svelte";
3
- import type { HTMLAttributes } from "svelte/elements";
4
4
 
5
- let { children, ...extra }: { children: Snippet } & HTMLAttributes<HTMLDivElement> = $props();
5
+ let { children, ...extra }: { children: Snippet } & DivAttrs = $props();
6
6
  </script>
7
7
 
8
8
  <div class="m3-container" {...extra}>
@@ -1,8 +1,8 @@
1
+ import type { DivAttrs } from "../misc/typing-utils";
1
2
  import type { Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
3
3
  type $$ComponentProps = {
4
4
  children: Snippet;
5
- } & HTMLAttributes<HTMLDivElement>;
5
+ } & DivAttrs;
6
6
  declare const SnackbarItem: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type SnackbarItem = ReturnType<typeof SnackbarItem>;
8
8
  export default SnackbarItem;
@@ -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}>
@@ -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 Checkbox: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type Checkbox = ReturnType<typeof Checkbox>;
8
8
  export default Checkbox;
@@ -69,7 +69,7 @@ opacity: ${Math.min(t * 3, 1)};`,
69
69
  {...extra}
70
70
  defaultValue={extra.defaultValue}
71
71
  />
72
- <!-- TODO: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
72
+ <!-- TODO/deprecated: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
73
73
  <label class="m3-font-body-small" for={id}>{label}</label>
74
74
  <button type="button" {disabled} title={datePickerTitle} onclick={() => (picker = !picker)}>
75
75
  <Layer />
@@ -69,7 +69,7 @@ opacity: ${Math.min(t * 3, 1)};`,
69
69
  {...extra}
70
70
  defaultValue={extra.defaultValue}
71
71
  />
72
- <!-- TODO: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
72
+ <!-- TODO/deprecated: once https://github.com/sveltejs/svelte/pull/16481 is finished, remove the defaultvalue thing -->
73
73
  <div class="layer"></div>
74
74
  <label class="m3-font-body-small" for={id}>{label}</label>
75
75
  <button type="button" {disabled} title={datePickerTitle} onclick={() => (picker = !picker)}>
@@ -3,9 +3,9 @@
3
3
  @deprecated use LoadingIndicator or one of the Estimate components instead
4
4
  -->
5
5
  <script lang="ts">
6
- import type { HTMLAttributes } from "svelte/elements";
6
+ import type { DivAttrs } from "../misc/typing-utils";
7
7
 
8
- let extra: HTMLAttributes<HTMLDivElement> = $props();
8
+ let extra: DivAttrs = $props();
9
9
  </script>
10
10
 
11
11
  <div class="m3-container" role="progressbar" {...extra}>
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes } from "svelte/elements";
1
+ import type { DivAttrs } from "../misc/typing-utils";
2
2
  /** @deprecated use LoadingIndicator or one of the Estimate components instead */
3
- declare const LinearProgressIndeterminate: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ declare const LinearProgressIndeterminate: import("svelte").Component<DivAttrs, {}, "">;
4
4
  type LinearProgressIndeterminate = ReturnType<typeof LinearProgressIndeterminate>;
5
5
  export default LinearProgressIndeterminate;
@@ -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}>
@@ -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 RadioAnim1: import("svelte").Component<$$ComponentProps, {}, "">;
7
7
  type RadioAnim1 = ReturnType<typeof RadioAnim1>;
8
8
  export default RadioAnim1;
@@ -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}>
@@ -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}>
@@ -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;
@@ -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}
@@ -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}
@@ -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}
@@ -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
  <div class="layer"></div>
52
52
  <label class="m3-font-body-large" for={id}>{label}</label>
53
53
  {#if leadingIcon}
@@ -26,16 +26,14 @@
26
26
  };
27
27
 
28
28
  onMount(() => {
29
- let mounted = true;
30
29
  const start = performance.now();
31
- const update = () => {
32
- if (!mounted) return;
33
-
30
+ let id: number;
31
+ const updateTime = () => {
34
32
  time = performance.now() - start;
35
- requestAnimationFrame(update);
33
+ id = requestAnimationFrame(updateTime);
36
34
  };
37
- update();
38
- return () => (mounted = false);
35
+ updateTime();
36
+ return () => cancelAnimationFrame(id);
39
37
  });
40
38
  </script>
41
39
 
@@ -1,5 +1,6 @@
1
- import type { HTMLLabelAttributes, HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
1
+ import type { HTMLLabelAttributes, HTMLAnchorAttributes, HTMLButtonAttributes, HTMLAttributes } from "svelte/elements";
2
2
  export type LabelAttrs = HTMLLabelAttributes & Required<Pick<HTMLLabelAttributes, "for">>;
3
3
  export type AnchorAttrs = HTMLAnchorAttributes & Required<Pick<HTMLAnchorAttributes, "href">>;
4
4
  export type NotButton<T> = Omit<T, "onclick">;
5
5
  export type ButtonAttrs = HTMLButtonAttributes & Required<Pick<HTMLButtonAttributes, "onclick">>;
6
+ export type DivAttrs = NotButton<HTMLAttributes<HTMLDivElement>>;
@@ -106,6 +106,9 @@
106
106
  color: rgb(var(--m3-scheme-on-secondary-container));
107
107
  }
108
108
  }
109
+ &:is(.large .content) {
110
+ padding-block: 0.375rem;
111
+ }
109
112
  &:is(.expanded .content) {
110
113
  gap: 0.75rem;
111
114
  }
@@ -148,7 +151,6 @@
148
151
  &.large {
149
152
  flex-direction: column;
150
153
  min-height: 4rem;
151
- padding-block: 0.375rem;
152
154
  }
153
155
  &.expanded {
154
156
  height: 3.5rem;
@@ -229,10 +231,10 @@
229
231
  flex-direction: column;
230
232
  text-align: center;
231
233
  min-height: 4rem;
232
- padding-block: 0.375rem;
233
234
 
234
235
  .content {
235
236
  flex-direction: column;
237
+ padding-block: 0.375rem;
236
238
 
237
239
  &.selected {
238
240
  color: rgb(var(--m3-scheme-secondary));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "5.6.0",
3
+ "version": "5.7.1",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {
@@ -36,14 +36,14 @@
36
36
  "dependencies": {
37
37
  "@iconify/types": "^2.0.0",
38
38
  "@ktibow/iconset-material-symbols": "^0.0.1755063979",
39
- "@ktibow/material-color-utilities-nightly": "^0.3.11756085020728",
40
- "svelte": "^5.38.3"
39
+ "@ktibow/material-color-utilities-nightly": "^0.3.11756690739504",
40
+ "svelte": "^5.38.6"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@eslint/compat": "^1.3.2",
44
44
  "@eslint/js": "^9.34.0",
45
45
  "@sveltejs/adapter-static": "^3.0.9",
46
- "@sveltejs/kit": "^2.36.2",
46
+ "@sveltejs/kit": "^2.37.0",
47
47
  "@sveltejs/package": "^2.5.0",
48
48
  "@sveltejs/vite-plugin-svelte": "^6.1.3",
49
49
  "eslint": "^9.27.0",
@@ -55,10 +55,10 @@
55
55
  "prettier-plugin-svelte": "^3.4.0",
56
56
  "publint": "^0.3.12",
57
57
  "svelte-check": "^4.3.1",
58
- "svelte-highlight": "^7.8.3",
58
+ "svelte-highlight": "^7.8.4",
59
59
  "typescript": "^5.9.2",
60
60
  "typescript-eslint": "^8.41.0",
61
- "vite": "^7.1.3"
61
+ "vite": "^7.1.4"
62
62
  },
63
63
  "keywords": [
64
64
  "svelte",