@rikstv/shared-components 3.3.12-alpha.0 → 3.3.12
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-D4pvWH68.mjs → CircularProgress-BKmJjWRu.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as e, Fragment as v, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as _, useState as
|
|
3
|
-
import { S as
|
|
4
|
-
const
|
|
2
|
+
import { forwardRef as _, useState as o, useId as k, useEffect as $ } from "react";
|
|
3
|
+
import { S as y } from "../typography/Typography-CXNJ1SFo.mjs";
|
|
4
|
+
const P = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, w = _(
|
|
5
5
|
({
|
|
6
6
|
progressRatio: r,
|
|
7
|
-
label:
|
|
8
|
-
size:
|
|
7
|
+
label: c,
|
|
8
|
+
size: t = "160px",
|
|
9
9
|
className: l = "",
|
|
10
10
|
children: i,
|
|
11
11
|
stopColor0: n,
|
|
@@ -13,12 +13,12 @@ const $ = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, w = _(
|
|
|
13
13
|
backgroundColor: g,
|
|
14
14
|
...u
|
|
15
15
|
}, m) => {
|
|
16
|
-
const [f, h] =
|
|
17
|
-
return
|
|
18
|
-
h(
|
|
16
|
+
const [f, h] = o(0), [x] = o(t.endsWith("px") ? t : `${t}px`), a = k(), d = `url(#${a})`;
|
|
17
|
+
return $(() => {
|
|
18
|
+
h(P({ progressRatio: r }));
|
|
19
19
|
}, [r]), /* @__PURE__ */ e(v, { children: [
|
|
20
20
|
/* @__PURE__ */ e("label", { className: "sr-only", "data-testid": "rds-progress__label", children: [
|
|
21
|
-
|
|
21
|
+
c,
|
|
22
22
|
/* @__PURE__ */ s("progress", { "data-testid": "rds-progress__progress", value: r, max: 1 })
|
|
23
23
|
] }),
|
|
24
24
|
/* @__PURE__ */ e(
|
|
@@ -30,7 +30,7 @@ const $ = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, w = _(
|
|
|
30
30
|
style: { "--progress-circle-size": x },
|
|
31
31
|
...u,
|
|
32
32
|
children: [
|
|
33
|
-
/* @__PURE__ */ s("div", { className: "rds-progress--circular__outer", "data-testid": "rds-progress__content", children: i || /* @__PURE__ */ s(
|
|
33
|
+
/* @__PURE__ */ s("div", { className: "rds-progress--circular__outer", "data-testid": "rds-progress__content", children: i || /* @__PURE__ */ s(y, { "data-testid": "rds-progress__default-text", lookLike: "title-3", children: r === 1 ? "Du er i mål!" : `${r * 100} %` }) }),
|
|
34
34
|
/* @__PURE__ */ e(
|
|
35
35
|
"svg",
|
|
36
36
|
{
|
|
@@ -43,12 +43,12 @@ const $ = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, w = _(
|
|
|
43
43
|
version: "1.1",
|
|
44
44
|
viewBox: "-10 0 120 100",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ e("linearGradient", { id:
|
|
46
|
+
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ e("linearGradient", { id: a, children: [
|
|
47
47
|
/* @__PURE__ */ s("stop", { offset: "0%", stopColor: `var(${n ?? "--rds-heading-accent"})` }),
|
|
48
48
|
/* @__PURE__ */ s("stop", { offset: "100%", stopColor: `var(${p ?? "--rds-background-card"})` })
|
|
49
49
|
] }) }),
|
|
50
|
-
/* @__PURE__ */ s("circle", { id: "path", cx: "50", cy: "50", r: "50", stroke:
|
|
51
|
-
/* @__PURE__ */ s("circle", { id: "prog", cx: "50", cy: "50", r: "50", stroke:
|
|
50
|
+
/* @__PURE__ */ s("circle", { id: "path", cx: "50", cy: "50", r: "50", stroke: d, strokeLinecap: "round" }),
|
|
51
|
+
/* @__PURE__ */ s("circle", { id: "prog", cx: "50", cy: "50", r: "50", stroke: d, strokeLinecap: "round" })
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
)
|
|
@@ -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-BKmJjWRu.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";
|