@serendie/ui 3.5.1-dev.202606091509 → 3.5.1-dev.202606160617
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.
- package/dist/components/DataTable/DataTable.sampleData.d.ts +12 -0
- package/dist/components/DataTable/DataTable.sampleData.test.d.ts +1 -0
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +1 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +31 -34
- package/dist/components/ProgressIndicator/AnimatedArc.test.d.ts +1 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +2 -1
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +49 -36
- package/dist/components/ProgressIndicator/animatedArcProps.d.ts +11 -0
- package/dist/components/ProgressIndicator/animatedArcProps.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DataRow = {
|
|
2
|
+
id: number;
|
|
3
|
+
area: string;
|
|
4
|
+
time: string;
|
|
5
|
+
status: string;
|
|
6
|
+
connections: number;
|
|
7
|
+
households: number;
|
|
8
|
+
coverage: string;
|
|
9
|
+
errorRate: string;
|
|
10
|
+
process: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function createDataTableRows(seed?: number): DataRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import e from "react";
|
|
3
|
+
import { getAnimatedArcProps as P } from "./animatedArcProps.js";
|
|
4
|
+
const F = 2.5, E = ({ className: l, radius: u, width: o, progress: t }) => {
|
|
5
|
+
const [s, m] = e.useState(0), r = e.useRef(null), n = e.useRef(null);
|
|
6
|
+
e.useEffect(() => {
|
|
7
|
+
if (t != null)
|
|
8
|
+
return;
|
|
9
|
+
const a = (c) => {
|
|
10
|
+
r.current == null && (r.current = c);
|
|
11
|
+
const d = (c - r.current) / 1e3;
|
|
12
|
+
r.current = c;
|
|
13
|
+
const A = d / F;
|
|
14
|
+
m((p) => (p + A) % 1), n.current = requestAnimationFrame(a);
|
|
13
15
|
};
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
+
return n.current = requestAnimationFrame(a), () => {
|
|
17
|
+
n.current != null && cancelAnimationFrame(n.current);
|
|
16
18
|
};
|
|
17
|
-
}, []);
|
|
18
|
-
const { d:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
t * 360 + u,
|
|
28
|
-
t * 360 + r
|
|
29
|
-
), rotationDeg: t * 360 };
|
|
30
|
-
}, [t, o, c]);
|
|
31
|
-
return /* @__PURE__ */ A(
|
|
19
|
+
}, [t]);
|
|
20
|
+
const { d: f, rotationDeg: i } = e.useMemo(
|
|
21
|
+
() => P({
|
|
22
|
+
progress: t ?? s,
|
|
23
|
+
radius: u,
|
|
24
|
+
width: o
|
|
25
|
+
}),
|
|
26
|
+
[t, s, u, o]
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ R(
|
|
32
29
|
"path",
|
|
33
30
|
{
|
|
34
|
-
d:
|
|
35
|
-
transform: `rotate(${
|
|
31
|
+
d: f,
|
|
32
|
+
transform: `rotate(${i})`,
|
|
36
33
|
strokeLinecap: "butt",
|
|
37
34
|
stroke: "currentColor",
|
|
38
|
-
strokeWidth:
|
|
35
|
+
strokeWidth: o,
|
|
39
36
|
fill: "none",
|
|
40
|
-
className:
|
|
37
|
+
className: l
|
|
41
38
|
}
|
|
42
39
|
);
|
|
43
40
|
};
|
|
44
41
|
export {
|
|
45
|
-
|
|
42
|
+
E as AnimatedArc
|
|
46
43
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,8 +3,9 @@ export interface ProgressIndicatorIndeterminateProps extends React.ComponentProp
|
|
|
3
3
|
type?: "linear" | "circular";
|
|
4
4
|
size?: "small" | "medium" | "large";
|
|
5
5
|
color?: "primary" | "subtle";
|
|
6
|
+
animationProgress?: number;
|
|
6
7
|
}
|
|
7
8
|
export declare const ProgressIndicatorIndeterminate: {
|
|
8
|
-
({ type, size, color, className, style, ...props }: ProgressIndicatorIndeterminateProps): React.JSX.Element;
|
|
9
|
+
({ type, size, color, animationProgress, className, style, ...props }: ProgressIndicatorIndeterminateProps): React.JSX.Element;
|
|
9
10
|
displayName: string;
|
|
10
11
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { AnimatedArc as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as i, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { AnimatedArc as y } from "./AnimatedArc.js";
|
|
3
|
+
import { normalizeProgress as f } from "./animatedArcProps.js";
|
|
4
|
+
import { cx as u } from "../../styled-system/css/cx.js";
|
|
5
|
+
import { cva as l } from "../../styled-system/css/cva.js";
|
|
6
|
+
const p = l({
|
|
6
7
|
base: {
|
|
7
8
|
position: "relative",
|
|
8
9
|
display: "flex",
|
|
@@ -80,7 +81,7 @@ const m = o({
|
|
|
80
81
|
size: "medium",
|
|
81
82
|
color: "primary"
|
|
82
83
|
}
|
|
83
|
-
}),
|
|
84
|
+
}), b = l({
|
|
84
85
|
base: {
|
|
85
86
|
position: "absolute",
|
|
86
87
|
backgroundColor: "sd.reference.color.scale.gray.100"
|
|
@@ -106,7 +107,7 @@ const m = o({
|
|
|
106
107
|
}
|
|
107
108
|
},
|
|
108
109
|
compoundVariants: []
|
|
109
|
-
}),
|
|
110
|
+
}), g = l({
|
|
110
111
|
base: {
|
|
111
112
|
position: "absolute"
|
|
112
113
|
},
|
|
@@ -140,7 +141,7 @@ const m = o({
|
|
|
140
141
|
}
|
|
141
142
|
},
|
|
142
143
|
compoundVariants: []
|
|
143
|
-
}),
|
|
144
|
+
}), x = (r) => ({
|
|
144
145
|
small: {
|
|
145
146
|
radius: 6,
|
|
146
147
|
strokeWidth: 2
|
|
@@ -153,37 +154,40 @@ const m = o({
|
|
|
153
154
|
radius: 20,
|
|
154
155
|
strokeWidth: 8
|
|
155
156
|
}
|
|
156
|
-
})[
|
|
157
|
-
type:
|
|
158
|
-
size:
|
|
157
|
+
})[r], v = ({
|
|
158
|
+
type: r = "linear",
|
|
159
|
+
size: e = "medium",
|
|
159
160
|
color: s = "primary",
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
animationProgress: n,
|
|
162
|
+
className: d,
|
|
163
|
+
style: c,
|
|
164
|
+
...m
|
|
163
165
|
}) => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
const a = n == null ? void 0 : f(n);
|
|
167
|
+
if (r === "circular") {
|
|
168
|
+
const { radius: t, strokeWidth: o } = x(e);
|
|
166
169
|
return /* @__PURE__ */ i(
|
|
167
170
|
"div",
|
|
168
171
|
{
|
|
169
|
-
className:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
className: u(
|
|
173
|
+
p({ type: r, size: e, color: s }),
|
|
174
|
+
d
|
|
172
175
|
),
|
|
173
176
|
role: "progressbar",
|
|
174
177
|
"aria-valuetext": "Loading",
|
|
175
|
-
style:
|
|
176
|
-
...
|
|
178
|
+
style: c,
|
|
179
|
+
...m,
|
|
177
180
|
children: /* @__PURE__ */ i(
|
|
178
181
|
"svg",
|
|
179
182
|
{
|
|
180
|
-
viewBox: `0 0 ${
|
|
183
|
+
viewBox: `0 0 ${t * 2 + o * 2} ${t * 2 + o * 2}`,
|
|
181
184
|
children: /* @__PURE__ */ i(
|
|
182
|
-
|
|
185
|
+
y,
|
|
183
186
|
{
|
|
184
|
-
className:
|
|
185
|
-
radius:
|
|
186
|
-
width:
|
|
187
|
+
className: g({ type: r, size: e, color: s }),
|
|
188
|
+
radius: t,
|
|
189
|
+
width: o,
|
|
190
|
+
progress: a
|
|
187
191
|
}
|
|
188
192
|
)
|
|
189
193
|
}
|
|
@@ -191,25 +195,34 @@ const m = o({
|
|
|
191
195
|
}
|
|
192
196
|
);
|
|
193
197
|
}
|
|
194
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ h(
|
|
195
199
|
"div",
|
|
196
200
|
{
|
|
197
|
-
className:
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
className: u(
|
|
202
|
+
p({ type: r, size: e, color: s }),
|
|
203
|
+
d
|
|
200
204
|
),
|
|
201
205
|
role: "progressbar",
|
|
202
206
|
"aria-valuetext": "Loading",
|
|
203
|
-
style:
|
|
204
|
-
...
|
|
207
|
+
style: c,
|
|
208
|
+
...m,
|
|
205
209
|
children: [
|
|
206
|
-
/* @__PURE__ */ i("div", { className:
|
|
207
|
-
/* @__PURE__ */ i(
|
|
210
|
+
/* @__PURE__ */ i("div", { className: b({ type: r, size: e }) }),
|
|
211
|
+
/* @__PURE__ */ i(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
className: g({ type: r, size: e, color: s }),
|
|
215
|
+
style: a == null ? void 0 : {
|
|
216
|
+
animation: "none",
|
|
217
|
+
transform: `translateX(${a * 300 - 150}%)`
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
)
|
|
208
221
|
]
|
|
209
222
|
}
|
|
210
223
|
);
|
|
211
224
|
};
|
|
212
|
-
|
|
225
|
+
v.displayName = "ProgressIndicatorIndeterminate";
|
|
213
226
|
export {
|
|
214
|
-
|
|
227
|
+
v as ProgressIndicatorIndeterminate
|
|
215
228
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type AnimatedArcProps = {
|
|
2
|
+
progress: number;
|
|
3
|
+
radius: number;
|
|
4
|
+
width: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const normalizeProgress: (progress: number) => number;
|
|
7
|
+
export declare const getAnimatedArcProps: ({ progress, radius, width, }: AnimatedArcProps) => {
|
|
8
|
+
d: string;
|
|
9
|
+
rotationDeg: number;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describeArc as a } from "./util.js";
|
|
2
|
+
const i = (n) => (n % 1 + 1) % 1, h = ({
|
|
3
|
+
progress: n,
|
|
4
|
+
radius: o,
|
|
5
|
+
width: r
|
|
6
|
+
}) => {
|
|
7
|
+
const t = i(n), e = t * Math.PI * 2, s = 180 + 40 * Math.sin(-e) + 40, c = 90 * Math.sin(e) + 90;
|
|
8
|
+
return { d: a(
|
|
9
|
+
o + r,
|
|
10
|
+
o + r,
|
|
11
|
+
o,
|
|
12
|
+
t * 360 + c,
|
|
13
|
+
t * 360 + s
|
|
14
|
+
), rotationDeg: t * 360 };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
h as getAnimatedArcProps,
|
|
18
|
+
i as normalizeProgress
|
|
19
|
+
};
|