m3-svelte 4.2.0 → 4.3.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.
@@ -59,6 +59,7 @@
59
59
  --m3-chip-shape: var(--m3-util-rounding-small);
60
60
  }
61
61
  .m3-container {
62
+ display: flex;
62
63
  height: 2rem;
63
64
  border-radius: var(--m3-chip-shape);
64
65
  padding: 0 1rem;
@@ -1,24 +1,40 @@
1
1
  <script lang="ts">
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
3
 
4
- let { percent, ...extra }: { percent: number } & HTMLAttributes<SVGElement> = $props();
4
+ let {
5
+ percent,
6
+ size = 48,
7
+ thickness = 4,
8
+ }: { percent: number; size?: number; thickness?: number } & HTMLAttributes<SVGElement> = $props();
9
+
10
+ let r = $derived(size / 2 - thickness / 2);
11
+ let circumference = $derived(Math.PI * r * 2);
5
12
  </script>
6
13
 
7
14
  <svg
8
- viewBox="0 0 48 48"
15
+ width={size}
16
+ height={size}
17
+ viewBox="0 0 {size} {size}"
9
18
  xmlns="http://www.w3.org/2000/svg"
10
19
  class="m3-container"
11
- style:--percent="{percent}px"
12
20
  role="progressbar"
13
- {...extra}
14
21
  >
15
22
  <circle
16
- cx="24"
17
- cy="24"
18
- r="20"
23
+ cx={size / 2}
24
+ cy={size / 2}
25
+ {r}
26
+ stroke="rgb(var(--m3-scheme-secondary-container))"
27
+ stroke-width={thickness}
28
+ fill="none"
29
+ />
30
+ <circle
31
+ cx={size / 2}
32
+ cy={size / 2}
33
+ {r}
19
34
  stroke="rgb(var(--m3-scheme-primary))"
20
- stroke-width="4"
21
- stroke-dasharray="125.66 125.66"
35
+ stroke-width={thickness}
36
+ stroke-dasharray="{circumference} {circumference}"
37
+ stroke-dashoffset={(percent / -100) * circumference + circumference}
22
38
  stroke-linecap="round"
23
39
  fill="none"
24
40
  />
@@ -26,12 +42,9 @@
26
42
 
27
43
  <style>
28
44
  svg {
29
- width: 3rem;
30
- height: 3rem;
31
- transform: rotate(-90deg);
45
+ rotate: -90deg;
32
46
  }
33
47
  circle {
34
- stroke-dashoffset: calc((var(--percent) / -100 + 1px) * 125.66);
35
48
  transition: var(--m3-util-easing-fast);
36
49
  }
37
50
  </style>
@@ -1,6 +1,8 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
2
  type $$ComponentProps = {
3
3
  percent: number;
4
+ size?: number;
5
+ thickness?: number;
4
6
  } & HTMLAttributes<SVGElement>;
5
7
  declare const CircularProgress: import("svelte").Component<$$ComponentProps, {}, "">;
6
8
  type CircularProgress = ReturnType<typeof CircularProgress>;
@@ -0,0 +1,97 @@
1
+ <script lang="ts">
2
+ let {
3
+ sToHalfway = 1,
4
+ size = 48,
5
+ thickness = 2,
6
+ }: {
7
+ sToHalfway?: number;
8
+ size?: number;
9
+ thickness?: number;
10
+ } = $props();
11
+
12
+ let r = $derived(size / 2 - thickness / 2);
13
+ let circumference = $derived(Math.PI * r * 2);
14
+
15
+ /* Easing calculated the same way it was in LinearProgressEstimate */
16
+ </script>
17
+
18
+ <svg
19
+ width={size}
20
+ height={size}
21
+ viewBox="0 0 {size} {size}"
22
+ class="m3-container"
23
+ role="progressbar"
24
+ style:--speed="{sToHalfway * 8}s"
25
+ style:--circumference={circumference}
26
+ >
27
+ <circle
28
+ cx={size / 2}
29
+ cy={size / 2}
30
+ {r}
31
+ stroke="rgb(var(--m3-scheme-secondary-container))"
32
+ stroke-width={thickness}
33
+ fill="none"
34
+ />
35
+ <circle
36
+ cx={size / 2}
37
+ cy={size / 2}
38
+ {r}
39
+ stroke="rgb(var(--m3-scheme-primary))"
40
+ stroke-width={thickness}
41
+ stroke-dasharray="{circumference} {circumference}"
42
+ stroke-linecap="round"
43
+ fill="none"
44
+ class="percent"
45
+ />
46
+ </svg>
47
+
48
+ <style>
49
+ .m3-container {
50
+ rotate: -90deg;
51
+ }
52
+
53
+ .percent {
54
+ animation: grow
55
+ linear(
56
+ 0,
57
+ 0.08 1.5%,
58
+ 0.15 2.93%,
59
+ 0.22 4.48%,
60
+ 0.29 6.18%,
61
+ 0.35 7.77%,
62
+ 0.41 9.52%,
63
+ 0.47 11.45%,
64
+ 0.52 13.24%,
65
+ 0.57 15.22%,
66
+ 0.61 16.98%,
67
+ 0.65 18.93%,
68
+ 0.69 21.12%,
69
+ 0.73 23.61%,
70
+ 0.76 25.74%,
71
+ 0.79 28.14%,
72
+ 0.82 30.92%,
73
+ 0.84 33.05%,
74
+ 0.86 35.46%,
75
+ 0.88 38.24%,
76
+ 0.9 41.52%,
77
+ 0.92 45.55%,
78
+ 0.93 47.96%,
79
+ 0.95 54.02%,
80
+ 0.96 58.05%,
81
+ 0.97 63.24%,
82
+ 0.98 70.55%,
83
+ 0.99 83.05%,
84
+ 1
85
+ )
86
+ var(--speed) both;
87
+ }
88
+
89
+ @keyframes grow {
90
+ 0% {
91
+ stroke-dashoffset: var(--circumference);
92
+ }
93
+ 100% {
94
+ stroke-dashoffset: 0;
95
+ }
96
+ }
97
+ </style>
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ sToHalfway?: number;
3
+ size?: number;
4
+ thickness?: number;
5
+ };
6
+ declare const CircularProgressEstimate: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type CircularProgressEstimate = ReturnType<typeof CircularProgressEstimate>;
8
+ export default CircularProgressEstimate;
@@ -1,3 +1,7 @@
1
+ <!--
2
+ @component
3
+ @deprecated use LoadingIndicator or one of the Estimate components instead
4
+ -->
1
5
  <script lang="ts">
2
6
  import type { HTMLAttributes } from "svelte/elements";
3
7
 
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
+ /** @deprecated use LoadingIndicator or one of the Estimate components instead */
2
3
  declare const CircularProgressIndeterminate: import("svelte").Component<HTMLAttributes<SVGElement>, {}, "">;
3
4
  type CircularProgressIndeterminate = ReturnType<typeof CircularProgressIndeterminate>;
4
5
  export default CircularProgressIndeterminate;
@@ -1,43 +1,26 @@
1
1
  <script lang="ts">
2
- import type { HTMLAttributes } from "svelte/elements";
3
-
4
- let {
5
- percent,
6
- ...extra
7
- }: {
8
- percent: number;
9
- } & HTMLAttributes<HTMLDivElement> = $props();
2
+ let { percent, height = 4 }: { percent: number; height?: number } = $props();
10
3
  </script>
11
4
 
12
- <div class="m3-container" role="progressbar" {...extra}>
5
+ <div class="m3-container" role="progressbar" style:height="{height / 16}rem">
13
6
  <div class="percent" style:width="{percent}%"></div>
7
+ <div class="track"></div>
14
8
  </div>
15
9
 
16
10
  <style>
17
- :root {
18
- --m3-linear-progress-shape: var(--m3-util-rounding-full);
19
- }
20
11
  .m3-container {
21
- display: inline-flex;
22
- background-color: rgb(var(--m3-scheme-primary-container));
23
- height: 0.25rem;
24
- min-width: 8rem;
25
- overflow: hidden;
26
- border-radius: var(--m3-linear-progress-shape);
12
+ display: flex;
13
+ gap: 0.25rem;
27
14
  }
28
15
  .percent {
29
16
  background-color: rgb(var(--m3-scheme-primary));
17
+ border-radius: var(--m3-util-rounding-full);
18
+ flex-shrink: 0;
30
19
  transition: var(--m3-util-easing-fast);
31
- border-radius: var(--m3-linear-progress-shape);
32
- }
33
-
34
- .m3-container {
35
- print-color-adjust: exact;
36
- -webkit-print-color-adjust: exact;
37
20
  }
38
- @media screen and (forced-colors: active) {
39
- .percent {
40
- background-color: selecteditem;
41
- }
21
+ .track {
22
+ background-color: rgb(var(--m3-scheme-secondary-container));
23
+ border-radius: var(--m3-util-rounding-full);
24
+ flex-grow: 1;
42
25
  }
43
26
  </style>
@@ -1,7 +1,7 @@
1
- import type { HTMLAttributes } from "svelte/elements";
2
1
  type $$ComponentProps = {
3
2
  percent: number;
4
- } & HTMLAttributes<HTMLDivElement>;
3
+ height?: number;
4
+ };
5
5
  declare const LinearProgress: import("svelte").Component<$$ComponentProps, {}, "">;
6
6
  type LinearProgress = ReturnType<typeof LinearProgress>;
7
7
  export default LinearProgress;
@@ -0,0 +1,136 @@
1
+ <script lang="ts">
2
+ let { sToHalfway = 1, height = 4 }: { sToHalfway?: number; height?: number } = $props();
3
+ /*
4
+ Easing calculated with
5
+ // 1) define the original mapping f(y)=time-%, capped at 100% for y=1
6
+ const whenReached = (y) => Math.log(1 - y) / Math.log(0.5);
7
+ const makePoints = () => {
8
+ const pts = [];
9
+ for (let i = 0; i < 100; i++) {
10
+ const v = i / 100;
11
+ const t = (whenReached(v) * 100) / 8;
12
+ pts.push([v, t]);
13
+ }
14
+ // add the final point (1, 100)
15
+ pts.push([1, 100]);
16
+ return pts;
17
+ };
18
+
19
+ // 2) helper: compute perpendicular distance from pt to line (p0→p1)
20
+ const perpDist = (pt, p0, p1) => {
21
+ const [x, y] = pt;
22
+ const [x1, y1] = p0;
23
+ const [x2, y2] = p1;
24
+ const num = Math.abs((y2 - y1) * x - (x2 - x1) * y + x2 * y1 - y2 * x1);
25
+ const den = Math.hypot(y2 - y1, x2 - x1);
26
+ return den === 0 ? 0 : num / den;
27
+ };
28
+
29
+ // 3) RDP (recursive)
30
+ function rdp(points, eps) {
31
+ if (points.length < 3) return points;
32
+ let maxD = 0,
33
+ idx = 0;
34
+ for (let i = 1; i < points.length - 1; i++) {
35
+ const d = perpDist(points[i], points[0], points[points.length - 1]);
36
+ if (d > maxD) {
37
+ maxD = d;
38
+ idx = i;
39
+ }
40
+ }
41
+ if (maxD > eps) {
42
+ const left = rdp(points.slice(0, idx + 1), eps);
43
+ const right = rdp(points.slice(idx), eps);
44
+ return left.slice(0, -1).concat(right);
45
+ }
46
+ return [points[0], points[points.length - 1]];
47
+ }
48
+
49
+ // 4) round x to 2 decimals (keep trailing zeros); round y to 2 decimals (cap tiny negatives to 0)
50
+ const fmt = (v, t) => {
51
+ const xv = v.toFixed(2);
52
+ let tv = Math.round(t * 100) / 100; // round to 2 decimals
53
+ if (Math.abs(tv) < 1e-8) tv = 0; // avoid "-0.00"
54
+ return `${xv} ${tv.toFixed(2)}%`;
55
+ };
56
+
57
+ // 5) put it all together
58
+ function buildCompressedLinear(tolerance) {
59
+ const raw = makePoints();
60
+ const reduced = rdp(raw, tolerance);
61
+ return `linear(${reduced.map(([v, t]) => fmt(v, t)).join(", ")})`;
62
+ }
63
+
64
+ // 6) example result
65
+ const compressed = buildCompressedLinear(0.001);
66
+ console.log(compressed);
67
+ */
68
+ </script>
69
+
70
+ <div
71
+ class="m3-container"
72
+ role="progressbar"
73
+ style:height="{height / 16}rem"
74
+ style:--speed="{sToHalfway * 8}s"
75
+ >
76
+ <div class="percent"></div>
77
+ <div class="track"></div>
78
+ </div>
79
+
80
+ <style>
81
+ .m3-container {
82
+ display: flex;
83
+ gap: 0.25rem;
84
+ }
85
+ .percent {
86
+ background-color: rgb(var(--m3-scheme-primary));
87
+ border-radius: var(--m3-util-rounding-full);
88
+ flex-shrink: 0;
89
+ animation: grow
90
+ linear(
91
+ 0,
92
+ 0.08 1.5%,
93
+ 0.15 2.93%,
94
+ 0.22 4.48%,
95
+ 0.29 6.18%,
96
+ 0.35 7.77%,
97
+ 0.41 9.52%,
98
+ 0.47 11.45%,
99
+ 0.52 13.24%,
100
+ 0.57 15.22%,
101
+ 0.61 16.98%,
102
+ 0.65 18.93%,
103
+ 0.69 21.12%,
104
+ 0.73 23.61%,
105
+ 0.76 25.74%,
106
+ 0.79 28.14%,
107
+ 0.82 30.92%,
108
+ 0.84 33.05%,
109
+ 0.86 35.46%,
110
+ 0.88 38.24%,
111
+ 0.9 41.52%,
112
+ 0.92 45.55%,
113
+ 0.93 47.96%,
114
+ 0.95 54.02%,
115
+ 0.96 58.05%,
116
+ 0.97 63.24%,
117
+ 0.98 70.55%,
118
+ 0.99 83.05%,
119
+ 1
120
+ )
121
+ var(--speed) both;
122
+ }
123
+ @keyframes grow {
124
+ 0% {
125
+ width: 0%;
126
+ }
127
+ 100% {
128
+ width: 100%;
129
+ }
130
+ }
131
+ .track {
132
+ background-color: rgb(var(--m3-scheme-secondary-container));
133
+ border-radius: var(--m3-util-rounding-full);
134
+ flex-grow: 1;
135
+ }
136
+ </style>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ sToHalfway?: number;
3
+ height?: number;
4
+ };
5
+ declare const LinearProgressEstimate: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type LinearProgressEstimate = ReturnType<typeof LinearProgressEstimate>;
7
+ export default LinearProgressEstimate;
@@ -1,3 +1,7 @@
1
+ <!--
2
+ @component
3
+ @deprecated use LoadingIndicator or one of the Estimate components instead
4
+ -->
1
5
  <script lang="ts">
2
6
  import type { HTMLAttributes } from "svelte/elements";
3
7
 
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAttributes } from "svelte/elements";
2
+ /** @deprecated use LoadingIndicator or one of the Estimate components instead */
2
3
  declare const LinearProgressIndeterminate: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
4
  type LinearProgressIndeterminate = ReturnType<typeof LinearProgressIndeterminate>;
4
5
  export default LinearProgressIndeterminate;
@@ -0,0 +1,64 @@
1
+ <script lang="ts">
2
+ // for more weird loaders check out https://www.npmjs.com/package/kreations
3
+ let {
4
+ size = 48,
5
+ container = false,
6
+ center = true,
7
+ }: {
8
+ size?: number;
9
+ container?: boolean;
10
+ center?: boolean;
11
+ } = $props();
12
+ </script>
13
+
14
+ <svg width={size} height={size} class:container class:center>
15
+ <path fill="currentColor">
16
+ <animate
17
+ attributeName="d"
18
+ dur="5s"
19
+ repeatCount="indefinite"
20
+ calcMode="spline"
21
+ keySplines="0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8"
22
+ keyTimes="0; 0.14; 0.14; 0.29; 0.29; 0.43; 0.43; 0.57; 0.57; 0.71; 0.71; 0.86; 0.86; 1"
23
+ values="M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z;
24
+ M20.3 8.6 21.1 8 22 7.6 23 7.3 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.2 15.5 37.6 16.5 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8 17.6 9.8 18.6 9.6 19.5 9.2Z;
25
+ M18.6 9.6 19.5 9.2 20.3 8.6 21.1 8 22 7.6 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.6 16.4 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8Z;
26
+ M18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.2 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 33.7 13.1 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.5 30.5 39.5 30 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7.1 21.7 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8 15.4 12.3 16.2 11.7 17 11.1 17.8 10.5Z;
27
+ M15.4 12.3 16.2 11.7 17 11.1 17.8 10.5 18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.3 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.4 30.5 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8Z;
28
+ M17 12.8 17.7 12.1 18.5 11.5 19.3 10.9 20.1 10.5 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 25 9 26 9 27 9 27.6 9.1 28 9.1 28.9 9.3 29.9 9.6 30.9 9.9 31.8 10.3 32.6 10.8 33.5 11.3 34.3 11.9 34.6 12.2 35 12.6 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.6 18.5 38.6 18.7 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.3 38.2 26.4 37.8 27.3 37.4 28.2 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.8 32.5 33.5 32.8 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.2 37.3 27.9 37.5 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 22.5 39 21.5 39 20.5 38.9 20.4 38.9 19.5 38.8 18.6 38.6 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.4 35.8 13.3 35.8 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.6 30 9.4 29.3 9.3 29 9.1 28 9 27 9 26 9 25 9.2 24 9.4 23 9.6 22.1 9.8 21.7 10 21.1 10.4 20.2 10.9 19.4 11.4 18.5 12.1 17.8 12.7 17 13.4 16.3 14.2 15.6 14.2 15.5 14.9 14.9 15.6 14.2 16.3 13.5Z;
29
+ M33.5 11.3 34.3 11.9 35 12.6 35.3 12.8 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.3 17.7 38.6 18.5 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.4 37.8 27.3 37.4 28.2 36.9 28.9 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.5 32.8 33.1 33.2 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.7 37 28.2 37.3 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 23.3 38.9 22.5 39 21.5 39 20.5 38.9 19.5 38.8 18.6 38.6 17.6 38.3 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.3 35.8 12.7 35.2 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.7 30.3 9.6 29.9 9.3 29 9.1 28 9 27 9 26 9 25 9.1 24.5 9.2 24 9.4 23 9.6 22.1 10 21.1 10.4 20.2 10.9 19.4 11.1 19.1 11.5 18.5 12.1 17.7 12.7 17 13.5 16.3 14.2 15.6 14.9 14.9 14.9 14.8 15.6 14.2 16.3 13.5 17 12.8 17.7 12.1 18.5 11.5 19.3 11 19.3 10.9 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 24.7 9.1 25 9 26 9 27 9 28 9.1 28.9 9.3 29.9 9.6 30.4 9.7 30.9 9.9 31.8 10.3 32.6 10.8Z;
30
+ M33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.8 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.6 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7 27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1Z;
31
+ M27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1 33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.9 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.5 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7Z;
32
+ M27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 34.8 11.3 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.9 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.4 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35 36 35.7 35.3 36.4 34.4 37 34.1 37.2 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.6 10 30.1 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10 16.6 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 20.9 11 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11Z;
33
+ M36 35.7 35.3 36.4 34.4 37 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.2 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11 27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.8 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35Z;
34
+ M32.1 32.1 31.4 32.8 30.7 33.5 29.9 34.1 29.1 34.7 28.3 35.3 27.6 35.8 27.5 35.8 26.6 36.4 25.8 36.8 24.9 37.3 24 37.7 23.1 38 22.1 38.3 21.2 38.6 20.2 38.8 19.2 38.9 18.2 39 17.2 39 16.6 38.9 16.3 38.9 15.3 38.7 14.3 38.4 13.4 38 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10 34.6 9.6 33.7 9.3 32.7 9.1 31.7 9.1 31.4 9 30.8 9 29.8 9.1 28.8 9.2 27.8 9.4 26.8 9.7 25.9 10 24.9 10.3 24 10.7 23.1 11.2 22.2 11.6 21.4 12.2 20.5 12.2 20.4 12.7 19.7 13.3 18.9 13.9 18.1 14.5 17.3 15.2 16.6 15.9 15.9 16.6 15.2 17.3 14.5 18.1 13.9 18.9 13.3 19.7 12.7 20.4 12.2 20.5 12.2 21.4 11.6 22.2 11.2 23.1 10.7 24 10.3 24.9 10 25.9 9.7 26.8 9.4 27.8 9.2 28.8 9.1 29.8 9 30.8 9 31.4 9.1 31.7 9.1 32.7 9.3 33.7 9.6 34.6 10 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 38 13.4 38.4 14.3 38.7 15.3 38.9 16.3 38.9 16.6 39 17.2 39 18.2 38.9 19.2 38.8 20.2 38.6 21.2 38.3 22.1 38 23.1 37.7 24 37.3 24.9 36.8 25.8 36.4 26.6 35.8 27.5 35.8 27.6 35.3 28.3 34.7 29.1 34.1 29.9 33.5 30.7 32.8 31.4Z;
35
+ M24.3 10.2 24.9 10 25.9 9.7 26.8 9.4 27.1 9.4 27.8 9.2 28.8 9.1 29.8 9 29.9 9 30.8 9 31.7 9.1 32.7 9.3 32.8 9.3 33.7 9.6 34.6 10 35.5 10.5 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 37.5 12.5 38 13.4 38.4 14.3 38.7 15.2 38.7 15.3 38.9 16.3 39 17.2 39 18.1 39 18.2 38.9 19.2 38.8 20.2 38.6 20.9 38.6 21.2 38.3 22.1 38 23.1 37.8 23.7 37.7 24 37.3 24.9 36.8 25.8 36.5 26.4 36.4 26.6 35.8 27.5 35.3 28.3 35 28.8 34.7 29.1 34.1 29.9 33.5 30.7 33.1 31.1 32.8 31.4 32.1 32.1 31.4 32.8 31.1 33.1 30.7 33.5 29.9 34.1 29.1 34.7 28.8 35 28.3 35.3 27.5 35.8 26.6 36.4 26.4 36.5 25.8 36.8 24.9 37.3 24 37.7 23.7 37.8 23.1 38 22.1 38.3 21.2 38.6 20.9 38.6 20.2 38.8 19.2 38.9 18.2 39 18.1 39 17.2 39 16.3 38.9 15.3 38.7 15.2 38.7 14.3 38.4 13.4 38 12.5 37.5 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10.5 35.5 10 34.6 9.6 33.7 9.3 32.8 9.3 32.7 9.1 31.7 9 30.8 9 29.9 9 29.8 9.1 28.8 9.2 27.8 9.4 27.1 9.4 26.8 9.7 25.9 10 24.9 10.2 24.3 10.3 24 10.7 23.1 11.2 22.2 11.5 21.6 11.6 21.4 12.2 20.5 12.7 19.7 13 19.2 13.3 18.9 13.9 18.1 14.5 17.3 14.9 16.9 15.2 16.6 15.9 15.9 16.6 15.2 16.9 14.9 17.3 14.5 18.1 13.9 18.9 13.3 19.2 13 19.7 12.7 20.5 12.2 21.4 11.6 21.6 11.5 22.2 11.2 23.1 10.7 24 10.3Z;
36
+ M22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.3 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.4 38.9 26.2 39.6 27 40.2 27.7 40.5 28.6 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.8 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.6 9.1 21.8 8.4 21 7.8 20.3 7.5 19.4 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.2 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1 20.9 10.4 21.4 9.5 21.9 8.7Z"
37
+ />
38
+ <animateTransform
39
+ attributeName="transform"
40
+ attributeType="XML"
41
+ type="rotate"
42
+ dur="5s"
43
+ repeatCount="indefinite"
44
+ calcMode="spline"
45
+ keySplines="0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8; 0.5 0.2 0 0.8"
46
+ keyTimes="0; 0.14; 0.29; 0.43; 0.57; 0.71; 0.86; 1"
47
+ values="0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24"
48
+ />
49
+ </path>
50
+ </svg>
51
+
52
+ <style>
53
+ svg {
54
+ color: rgb(var(--m3-scheme-primary));
55
+ &.container {
56
+ background-color: rgb(var(--m3-scheme-primary-container));
57
+ color: rgb(var(--m3-scheme-on-primary-container));
58
+ border-radius: var(--m3-util-rounding-full);
59
+ }
60
+ &.center {
61
+ margin: auto;
62
+ }
63
+ }
64
+ </style>
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ size?: number;
3
+ container?: boolean;
4
+ center?: boolean;
5
+ };
6
+ declare const LoadingIndicator: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type LoadingIndicator = ReturnType<typeof LoadingIndicator>;
8
+ export default LoadingIndicator;
@@ -0,0 +1,67 @@
1
+ <script lang="ts">
2
+ import { onMount, untrack } from "svelte";
3
+ import { linear, trackOpacity } from "./_wavy";
4
+
5
+ let {
6
+ width = 600,
7
+ height = 10,
8
+ thickness = 4,
9
+ percent,
10
+ }: { width?: number; height?: number; thickness?: number; percent: number } = $props();
11
+
12
+ let time = $state(0);
13
+
14
+ let top = $derived(thickness * 0.5);
15
+ let bottom = $derived(height - thickness * 0.5);
16
+ let left = $derived(thickness * 0.5);
17
+ let right = $derived(width - thickness * 0.5);
18
+ let percentX = $derived((percent / 100) * (right - left) + left);
19
+
20
+ const getSMILData = (time: number) => {
21
+ let paths: string[] = [];
22
+ for (let x = 0; x <= 1000; x += 1000 / 30) {
23
+ paths.push(linear(top, bottom, left, percentX, time + x));
24
+ }
25
+ return paths.join(";");
26
+ };
27
+
28
+ onMount(() => {
29
+ let mounted = true;
30
+ const start = performance.now();
31
+ const update = () => {
32
+ if (!mounted) return;
33
+
34
+ time = performance.now() - start;
35
+ requestAnimationFrame(update);
36
+ };
37
+ update();
38
+ return () => (mounted = false);
39
+ });
40
+ </script>
41
+
42
+ <svg viewBox="0 0 {width} {height}">
43
+ <path
44
+ fill="none"
45
+ stroke="rgb(var(--m3-scheme-primary))"
46
+ stroke-width={thickness}
47
+ stroke-linecap="round"
48
+ >
49
+ <animate
50
+ attributeName="d"
51
+ dur="1s"
52
+ repeatCount="indefinite"
53
+ values={getSMILData(untrack(() => time))}
54
+ />
55
+ </path>
56
+ <line
57
+ fill="none"
58
+ stroke="rgb(var(--m3-scheme-secondary-container))"
59
+ stroke-width={thickness}
60
+ stroke-linecap="round"
61
+ x1={percentX + thickness + 4}
62
+ y1={height / 2}
63
+ x2={right}
64
+ y2={height / 2}
65
+ opacity={trackOpacity(right, percentX + thickness + 4)}
66
+ />
67
+ </svg>
@@ -0,0 +1,9 @@
1
+ type $$ComponentProps = {
2
+ width?: number;
3
+ height?: number;
4
+ thickness?: number;
5
+ percent: number;
6
+ };
7
+ declare const WavyLinearProgress: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type WavyLinearProgress = ReturnType<typeof WavyLinearProgress>;
9
+ export default WavyLinearProgress;
@@ -0,0 +1,82 @@
1
+ <script lang="ts">
2
+ import { linear, trackOpacity } from "./_wavy";
3
+
4
+ let {
5
+ sToHalfway = 1,
6
+ width = 600,
7
+ height = 10,
8
+ thickness = 4,
9
+ }: { sToHalfway?: number; width?: number; height?: number; thickness?: number } = $props();
10
+
11
+ let top = $derived(thickness * 0.5);
12
+ let bottom = $derived(height - thickness * 0.5);
13
+ let left = $derived(thickness * 0.5);
14
+ let right = $derived(width - thickness * 0.5);
15
+ let endTime = $derived(sToHalfway * 8);
16
+
17
+ const expressiveSMIL = $derived.by(() => {
18
+ let paths: string[] = [];
19
+
20
+ for (let time = 0; time < endTime; time += 1 / 30) {
21
+ let value = 1 - Math.pow(0.5, time / sToHalfway);
22
+ if (value == 0) value = 0.001;
23
+ const ms = time * 1000;
24
+ paths.push(linear(top, bottom, left, right, ms, value * (right - left) + left));
25
+ }
26
+ return paths.join(";");
27
+ });
28
+ const infiniteSMIL = $derived.by(() => {
29
+ let paths: string[] = [];
30
+ for (let time = 0; time <= 1; time += 1 / 30) {
31
+ paths.push(linear(top, bottom, left, right, time * 1000));
32
+ }
33
+ return paths.join(";");
34
+ });
35
+ let { trackSMIL, opacitySMIL } = $derived.by(() => {
36
+ let xs: number[] = [];
37
+ let opacities: number[] = [];
38
+
39
+ for (let time = 0; time < endTime; time += 1 / 30) {
40
+ const value = 1 - Math.pow(0.5, time / sToHalfway);
41
+ const percentX = value * (right - left) + left;
42
+ const x = percentX + thickness + 4;
43
+ xs.push(x);
44
+
45
+ opacities.push(trackOpacity(right, x));
46
+ }
47
+ return {
48
+ trackSMIL: xs.join(";"),
49
+ opacitySMIL: opacities.join(";"),
50
+ };
51
+ });
52
+ </script>
53
+
54
+ <svg viewBox="0 0 {width} {height}">
55
+ <path
56
+ fill="none"
57
+ stroke="rgb(var(--m3-scheme-primary))"
58
+ stroke-width={thickness}
59
+ stroke-linecap="round"
60
+ >
61
+ <animate attributeName="d" dur="{endTime}s" values={expressiveSMIL} />
62
+ <animate
63
+ attributeName="d"
64
+ dur="1s"
65
+ begin="{endTime}s"
66
+ repeatCount="indefinite"
67
+ values={infiniteSMIL}
68
+ />
69
+ </path>
70
+ <line
71
+ fill="none"
72
+ stroke="rgb(var(--m3-scheme-secondary-container))"
73
+ stroke-width={thickness}
74
+ stroke-linecap="round"
75
+ y1={height / 2}
76
+ x2={right}
77
+ y2={height / 2}
78
+ >
79
+ <animate attributeName="x1" dur="{endTime}s" values={trackSMIL} />
80
+ <animate attributeName="opacity" dur="{endTime}s" values={opacitySMIL} fill="freeze" />
81
+ </line>
82
+ </svg>
@@ -0,0 +1,9 @@
1
+ type $$ComponentProps = {
2
+ sToHalfway?: number;
3
+ width?: number;
4
+ height?: number;
5
+ thickness?: number;
6
+ };
7
+ declare const WavyLinearProgressEstimate: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type WavyLinearProgressEstimate = ReturnType<typeof WavyLinearProgressEstimate>;
9
+ export default WavyLinearProgressEstimate;
@@ -0,0 +1,2 @@
1
+ export declare const linear: (t: number, b: number, from: number, to: number, time: number, cutoffTo?: number) => string;
2
+ export declare const trackOpacity: (right: number, x: number) => number;
@@ -0,0 +1,32 @@
1
+ const frequencyT = (Math.PI * 2) / 1000;
2
+ const frequencyX = (Math.PI * 2) / 40;
3
+ const round2 = (x) => Math.round(x * 100) / 100;
4
+ const round1 = (x) => Math.round(x * 10) / 10;
5
+ export const linear = (t, b, from, to, time, cutoffTo) => {
6
+ time = time * frequencyT;
7
+ time %= Math.PI * 2;
8
+ if (from >= to)
9
+ return "";
10
+ let path = "";
11
+ for (let xIterator = from; xIterator <= to; xIterator += 0.5) {
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;
15
+ if (x == from) {
16
+ path = `M ${round1(x)} ${round2(y)}`;
17
+ }
18
+ else {
19
+ path += ` ${round1(x)} ${round2(y)}`;
20
+ }
21
+ }
22
+ return path;
23
+ };
24
+ export const trackOpacity = (right, x) => {
25
+ let opacity = right - x;
26
+ if (opacity < 0)
27
+ opacity = 0;
28
+ if (opacity > 1)
29
+ opacity = 1;
30
+ opacity = round2(opacity);
31
+ return opacity;
32
+ };
@@ -18,8 +18,12 @@ export { default as Snackbar } from "./containers/Snackbar.svelte";
18
18
  export type { SnackbarIn } from "./containers/Snackbar.svelte";
19
19
  export { default as SnackbarItem } from "./containers/SnackbarItem.svelte";
20
20
  export { default as LinearProgress } from "./forms/LinearProgress.svelte";
21
+ export { default as LinearProgressEstimate } from "./forms/LinearProgressEstimate.svelte";
21
22
  export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
23
+ export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
24
+ export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
22
25
  export { default as CircularProgress } from "./forms/CircularProgress.svelte";
26
+ export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
23
27
  export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
24
28
  export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
25
29
  export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
package/package/index.js CHANGED
@@ -17,8 +17,12 @@ export { default as MenuItem } from "./containers/MenuItem.svelte";
17
17
  export { default as Snackbar } from "./containers/Snackbar.svelte";
18
18
  export { default as SnackbarItem } from "./containers/SnackbarItem.svelte";
19
19
  export { default as LinearProgress } from "./forms/LinearProgress.svelte";
20
+ export { default as LinearProgressEstimate } from "./forms/LinearProgressEstimate.svelte";
20
21
  export { default as LinearProgressIndeterminate } from "./forms/LinearProgressIndeterminate.svelte";
22
+ export { default as WavyLinearProgress } from "./forms/WavyLinearProgress.svelte";
23
+ export { default as WavyLinearProgressEstimate } from "./forms/WavyLinearProgressEstimate.svelte";
21
24
  export { default as CircularProgress } from "./forms/CircularProgress.svelte";
25
+ export { default as CircularProgressEstimate } from "./forms/CircularProgressEstimate.svelte";
22
26
  export { default as CircularProgressIndeterminate } from "./forms/CircularProgressIndeterminate.svelte";
23
27
  export { default as RadioAnim1 } from "./forms/RadioAnim1.svelte";
24
28
  export { default as RadioAnim2 } from "./forms/RadioAnim2.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m3-svelte",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "license": "Apache-2.0 OR GPL-3.0-only",
5
5
  "repository": "KTibow/m3-svelte",
6
6
  "author": {
@@ -29,20 +29,20 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@iconify/types": "^2.0.0",
32
- "@ktibow/iconset-material-symbols": "^0.0.1747426012",
33
- "@ktibow/material-color-utilities-nightly": "^0.3.11748742074820",
34
- "svelte": "^5.33.2"
32
+ "@ktibow/iconset-material-symbols": "^0.0.1748584357",
33
+ "@ktibow/material-color-utilities-nightly": "^0.3.11748827599657",
34
+ "svelte": "^5.33.13"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@eslint/compat": "^1.2.9",
38
- "@eslint/js": "^9.27.0",
38
+ "@eslint/js": "^9.28.0",
39
39
  "@sveltejs/adapter-static": "^3.0.8",
40
40
  "@sveltejs/kit": "^2.21.1",
41
41
  "@sveltejs/package": "^2.3.11",
42
42
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
43
43
  "eslint": "^9.27.0",
44
44
  "eslint-config-prettier": "^10.1.5",
45
- "eslint-plugin-svelte": "^3.9.0",
45
+ "eslint-plugin-svelte": "^3.9.1",
46
46
  "fast-glob": "^3.3.3",
47
47
  "globals": "^16.2.0",
48
48
  "prettier": "^3.5.3",
@@ -51,7 +51,7 @@
51
51
  "svelte-check": "^4.2.1",
52
52
  "svelte-highlight": "^7.8.3",
53
53
  "typescript": "^5.8.3",
54
- "typescript-eslint": "^8.32.1",
54
+ "typescript-eslint": "^8.33.1",
55
55
  "vite": "^6.3.5"
56
56
  },
57
57
  "keywords": [