@rikstv/shared-components 3.3.11 → 3.3.12-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 📖 Changelog
2
2
 
3
+ ## 3.3.12
4
+
5
+ - Allow to set Circular Progress size in px
6
+
3
7
  ## 3.3.11
4
8
 
5
9
  - Allow to override Circular Progress stroke color background (not completed part of stroke)
@@ -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 d, useId as k, useEffect as y } from "react";
3
- import { S as P } from "../typography/Typography-CXNJ1SFo.mjs";
4
- const $ = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, w = _(
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: o,
8
- size: c = "small",
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] = d(0), [x] = d(c === "small" ? "160px" : "260px"), t = k(), a = `url(#${t})`;
17
- return y(() => {
18
- h($({ progressRatio: r }));
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
- o,
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(P, { "data-testid": "rds-progress__default-text", lookLike: "title-3", children: r === 1 ? "Du er i mål!" : `${r * 100} %` }) }),
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: t, children: [
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: a, strokeLinecap: "round" }),
51
- /* @__PURE__ */ s("circle", { id: "prog", cx: "50", cy: "50", r: "50", stroke: a, strokeLinecap: "round" })
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
  )
@@ -2,7 +2,7 @@ import { HTMLAttributes } from 'react';
2
2
  interface Props extends HTMLAttributes<HTMLDivElement> {
3
3
  progressRatio: number;
4
4
  label: string;
5
- size?: "small" | "large";
5
+ size?: string;
6
6
  className?: string;
7
7
  stopColor0?: string;
8
8
  stopColor100?: string;
@@ -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-D4pvWH68.mjs";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rikstv/shared-components",
3
- "version": "3.3.11",
3
+ "version": "3.3.12-alpha.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },