m3-svelte 5.12.0 → 5.12.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.
@@ -5,6 +5,7 @@
5
5
  percent,
6
6
  size = 48,
7
7
  thickness = 4,
8
+ ...extra
8
9
  }: { percent: number; size?: number; thickness?: number } & HTMLAttributes<SVGElement> = $props();
9
10
 
10
11
  let r = $derived(size / 2 - thickness / 2);
@@ -18,6 +19,7 @@
18
19
  xmlns="http://www.w3.org/2000/svg"
19
20
  class="m3-container"
20
21
  role="progressbar"
22
+ {...extra}
21
23
  >
22
24
  <circle
23
25
  cx={size / 2}
@@ -1,13 +1,16 @@
1
1
  <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+
2
4
  let {
3
5
  sToHalfway = 1,
4
6
  size = 48,
5
7
  thickness = 2,
8
+ ...extra
6
9
  }: {
7
10
  sToHalfway?: number;
8
11
  size?: number;
9
12
  thickness?: number;
10
- } = $props();
13
+ } & HTMLAttributes<SVGElement> = $props();
11
14
 
12
15
  let r = $derived(size / 2 - thickness / 2);
13
16
  let circumference = $derived(Math.PI * r * 2);
@@ -23,6 +26,7 @@
23
26
  role="progressbar"
24
27
  style:--speed="{sToHalfway * 8}s"
25
28
  style:--circumference={circumference}
29
+ {...extra}
26
30
  >
27
31
  <circle
28
32
  cx={size / 2}
@@ -1,8 +1,9 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
1
2
  type $$ComponentProps = {
2
3
  sToHalfway?: number;
3
4
  size?: number;
4
5
  thickness?: number;
5
- };
6
+ } & HTMLAttributes<SVGElement>;
6
7
  declare const CircularProgressEstimate: import("svelte").Component<$$ComponentProps, {}, "">;
7
8
  type CircularProgressEstimate = ReturnType<typeof CircularProgressEstimate>;
8
9
  export default CircularProgressEstimate;
@@ -112,13 +112,6 @@
112
112
  currentColor 8%
113
113
  );
114
114
  }
115
- &:active {
116
- background-color: color-mix(
117
- in oklab,
118
- rgb(var(--m3-scheme-surface-container-highest)),
119
- currentColor 12%
120
- );
121
- }
122
115
  }
123
116
 
124
117
  box-shadow: inset 0px -1px var(--secondary-color);
@@ -11,8 +11,6 @@
11
11
 
12
12
  let time = $state(0);
13
13
 
14
- let top = $derived(thickness * 0.5);
15
- let bottom = $derived(height - thickness * 0.5);
16
14
  let left = $derived(thickness * 0.5);
17
15
  let right = $derived(width - thickness * 0.5);
18
16
  let percentX = $derived((percent / 100) * (right - left) + left);
@@ -20,7 +18,7 @@
20
18
  const getSMILData = (time: number) => {
21
19
  let paths: string[] = [];
22
20
  for (let x = 0; x <= 1000; x += 1000 / 30) {
23
- paths.push(linear(top, bottom, left, percentX, time + x));
21
+ paths.push(linear(height / 2 - thickness / 2, height / 2, left, percentX, time + x));
24
22
  }
25
23
  return paths.join(";");
26
24
  };
@@ -8,8 +8,6 @@
8
8
  thickness = 4,
9
9
  }: { sToHalfway?: number; width?: number; height?: number; thickness?: number } = $props();
10
10
 
11
- let top = $derived(thickness * 0.5);
12
- let bottom = $derived(height - thickness * 0.5);
13
11
  let left = $derived(thickness * 0.5);
14
12
  let right = $derived(width - thickness * 0.5);
15
13
  let endTime = $derived(sToHalfway * 8);
@@ -21,14 +19,23 @@
21
19
  let value = 1 - Math.pow(0.5, time / sToHalfway);
22
20
  if (value == 0) value = 0.001;
23
21
  const ms = time * 1000;
24
- paths.push(linear(top, bottom, left, right, ms, value * (right - left) + left));
22
+ paths.push(
23
+ linear(
24
+ height / 2 - thickness / 2,
25
+ height / 2,
26
+ left,
27
+ right,
28
+ ms,
29
+ value * (right - left) + left,
30
+ ),
31
+ );
25
32
  }
26
33
  return paths.join(";");
27
34
  });
28
35
  const infiniteSMIL = $derived.by(() => {
29
36
  let paths: string[] = [];
30
37
  for (let time = 0; time <= 1; time += 1 / 30) {
31
- paths.push(linear(top, bottom, left, right, time * 1000));
38
+ paths.push(linear(height / 2 - thickness / 2, height / 2, left, right, time * 1000));
32
39
  }
33
40
  return paths.join(";");
34
41
  });
@@ -1,2 +1,2 @@
1
- export declare const linear: (t: number, b: number, from: number, to: number, time: number, cutoffTo?: number) => string;
1
+ export declare const linear: (amp: number, center: number, from: number, to: number, time: number, cutoffTo?: number) => string;
2
2
  export declare const trackOpacity: (right: number, x: number) => number;
@@ -2,7 +2,7 @@ const frequencyT = (Math.PI * 2) / 1000;
2
2
  const frequencyX = (Math.PI * 2) / 40;
3
3
  const round2 = (x) => Math.round(x * 100) / 100;
4
4
  const round1 = (x) => Math.round(x * 10) / 10;
5
- export const linear = (t, b, from, to, time, cutoffTo) => {
5
+ export const linear = (amp, center, from, to, time, cutoffTo) => {
6
6
  time = time * frequencyT;
7
7
  time %= Math.PI * 2;
8
8
  if (from >= to)
@@ -10,8 +10,8 @@ export const linear = (t, b, from, to, time, cutoffTo) => {
10
10
  let path = "";
11
11
  for (let xIterator = from; xIterator <= to; xIterator += 0.5) {
12
12
  const x = cutoffTo ? Math.min(cutoffTo, xIterator) : xIterator;
13
- const sinV = (Math.sin(x * frequencyX + time) + 1) * 0.5;
14
- const y = sinV * (t - b) + b;
13
+ const sinV = Math.sin(x * frequencyX + time);
14
+ const y = sinV * amp + center;
15
15
  if (x == from) {
16
16
  path = `M ${round1(x)} ${round2(y)}`;
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "5.12.0",
3
+ "version": "5.12.1",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@iconify/types": "^2.0.0",
38
- "@ktibow/iconset-material-symbols": "~0.0.1760591837",
39
- "@ktibow/material-color-utilities-nightly": "^0.3.11760728781000",
40
- "svelte": "^5.41.0"
38
+ "@ktibow/iconset-material-symbols": "~0.0.1761892960",
39
+ "@ktibow/material-color-utilities-nightly": "^0.3.11761929426000",
40
+ "svelte": "^5.43.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@eslint/compat": "^1.4.0",
44
- "@eslint/js": "^9.38.0",
43
+ "@eslint/compat": "^1.4.1",
44
+ "@eslint/js": "^9.39.0",
45
45
  "@sveltejs/adapter-static": "^3.0.10",
46
46
  "@sveltejs/kit": "^2.47.1",
47
47
  "@sveltejs/package": "^2.5.4",
@@ -50,15 +50,15 @@
50
50
  "eslint-config-prettier": "^10.1.8",
51
51
  "eslint-plugin-svelte": "^3.12.4",
52
52
  "fast-glob": "^3.3.3",
53
- "globals": "^16.4.0",
53
+ "globals": "^16.5.0",
54
54
  "prettier": "^3.6.2",
55
55
  "prettier-plugin-svelte": "^3.4.0",
56
- "publint": "^0.3.14",
56
+ "publint": "^0.3.15",
57
57
  "svelte-check": "^4.3.3",
58
- "svelte-highlight": "^7.8.4",
58
+ "svelte-highlight": "^7.9.0",
59
59
  "typescript": "^5.9.3",
60
- "typescript-eslint": "^8.46.1",
61
- "vite": "^7.1.10"
60
+ "typescript-eslint": "^8.46.3",
61
+ "vite": "^7.1.12"
62
62
  },
63
63
  "keywords": [
64
64
  "svelte",