@rikstv/shared-components 3.3.6 → 3.3.7-alpha.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.
package/CHANGELOG.md
CHANGED
package/dist/components/progress/{CircularProgress-CD_dLu6N.mjs → CircularProgress-DlB7Fl1m.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as e, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { S as
|
|
4
|
-
const
|
|
5
|
-
({ progressRatio: r, label: a, size: l = "small", className: c = "", children: d,
|
|
6
|
-
const [
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
}, [r]), /* @__PURE__ */ e(
|
|
1
|
+
import { jsxs as e, Fragment as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h, useState as t, useEffect as x } from "react";
|
|
3
|
+
import { S as _ } from "../typography/Typography-CXNJ1SFo.mjs";
|
|
4
|
+
const v = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, C = h(
|
|
5
|
+
({ progressRatio: r, label: a, size: l = "small", className: c = "", children: d, stopColor0: o, stopColor100: i, ...n }, p) => {
|
|
6
|
+
const [g, u] = t(0), [m] = t(l === "small" ? "160px" : "260px");
|
|
7
|
+
return x(() => {
|
|
8
|
+
u(v({ progressRatio: r }));
|
|
9
|
+
}, [r]), /* @__PURE__ */ e(f, { children: [
|
|
10
10
|
/* @__PURE__ */ e("label", { className: "sr-only", "data-testid": "rds-progress__label", children: [
|
|
11
11
|
a,
|
|
12
12
|
/* @__PURE__ */ s("progress", { "data-testid": "rds-progress__progress", value: r, max: 1 })
|
|
@@ -14,24 +14,24 @@ const x = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, _ = m(
|
|
|
14
14
|
/* @__PURE__ */ e(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
ref:
|
|
17
|
+
ref: p,
|
|
18
18
|
"data-testid": "rds-progress",
|
|
19
19
|
className: `rds-progress--circular ${c}`,
|
|
20
|
-
style: { "--progress-circle-size":
|
|
21
|
-
...
|
|
20
|
+
style: { "--progress-circle-size": m },
|
|
21
|
+
...n,
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */ s("div", { className: "rds-progress--circular__outer", "data-testid": "rds-progress__content", children: d || /* @__PURE__ */ s(
|
|
23
|
+
/* @__PURE__ */ s("div", { className: "rds-progress--circular__outer", "data-testid": "rds-progress__content", children: d || /* @__PURE__ */ s(_, { "data-testid": "rds-progress__default-text", lookLike: "title-3", children: r === 1 ? "Du er i mål!" : `${r * 100} %` }) }),
|
|
24
24
|
/* @__PURE__ */ e(
|
|
25
25
|
"svg",
|
|
26
26
|
{
|
|
27
|
-
style: { "--calculated-progress":
|
|
27
|
+
style: { "--calculated-progress": g, "--progress": `${r + 1}s` },
|
|
28
28
|
xmlns: "http://www.w3.org/2000/svg",
|
|
29
29
|
version: "1.1",
|
|
30
30
|
viewBox: "-10 0 120 100",
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ e("linearGradient", { id: "GradientColor", children: [
|
|
33
|
-
/* @__PURE__ */ s("stop", { offset: "0%", stopColor:
|
|
34
|
-
/* @__PURE__ */ s("stop", { offset: "100%", stopColor:
|
|
33
|
+
/* @__PURE__ */ s("stop", { offset: "0%", stopColor: `var(${o ?? "--rds-heading-accent"})` }),
|
|
34
|
+
/* @__PURE__ */ s("stop", { offset: "100%", stopColor: `var(${i ?? "--rds-background-card"})` })
|
|
35
35
|
] }) }),
|
|
36
36
|
/* @__PURE__ */ s("circle", { id: "path", cx: "50", cy: "50", r: "50", strokeLinecap: "round" }),
|
|
37
37
|
/* @__PURE__ */ s("circle", { id: "prog", cx: "50", cy: "50", r: "50", strokeLinecap: "round" })
|
|
@@ -44,7 +44,7 @@ const x = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, _ = m(
|
|
|
44
44
|
] });
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
|
|
47
|
+
C.displayName = "CircularProgress";
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
C
|
|
50
50
|
};
|
|
@@ -4,6 +4,8 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
label: string;
|
|
5
5
|
size?: "small" | "large";
|
|
6
6
|
className?: string;
|
|
7
|
+
stopColor0?: string;
|
|
8
|
+
stopColor100?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare const calculateProgress: ({ progressRatio }: Pick<Props, "progressRatio">) => number;
|
|
9
11
|
export declare const CircularProgress: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -10,7 +10,7 @@ import { A as z } from "./components/alert/Alert-BDfwNOJx.mjs";
|
|
|
10
10
|
import { B as K, a as X } from "./components/breadcrumb/Breadcrumb-BJNLZ7iB.mjs";
|
|
11
11
|
import { P as Z } from "./components/progress/Progress-CjnegHvC.mjs";
|
|
12
12
|
import { L as re } from "./components/loader/Loader-gjL6yh1f.mjs";
|
|
13
|
-
import { C as ne } from "./components/progress/CircularProgress-
|
|
13
|
+
import { C as ne } from "./components/progress/CircularProgress-DlB7Fl1m.mjs";
|
|
14
14
|
import { D as se } from "./components/dropdown/Dropdown-CWVW7rKD.mjs";
|
|
15
15
|
import { G as ae, P as ce, S as ue, T as de } from "./components/button/Button-DGXKZhwG.mjs";
|
|
16
16
|
import { G as fe, P as le, S as xe, T as ge } from "./components/button/ArrowButton-DqViaPQ-.mjs";
|