@rikstv/shared-components 3.3.6 → 3.3.7-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.7
4
+
5
+ - Specify color for CircularProgress
6
+
3
7
  ## 3.3.5
4
8
 
5
9
  - TextField styling for RiksTV
@@ -1,12 +1,12 @@
1
- import { jsxs as e, Fragment as u, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as m, useState as t, useEffect as f } from "react";
3
- import { S as h } from "../typography/Typography-CXNJ1SFo.mjs";
4
- const x = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, _ = m(
5
- ({ progressRatio: r, label: a, size: l = "small", className: c = "", children: d, ...o }, i) => {
6
- const [n, p] = t(0), [g] = t(l === "small" ? "160px" : "260px");
7
- return f(() => {
8
- p(x({ progressRatio: r }));
9
- }, [r]), /* @__PURE__ */ e(u, { children: [
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: i,
17
+ ref: p,
18
18
  "data-testid": "rds-progress",
19
19
  className: `rds-progress--circular ${c}`,
20
- style: { "--progress-circle-size": g },
21
- ...o,
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(h, { "data-testid": "rds-progress__default-text", lookLike: "title-3", children: r === 1 ? "Du er i mål!" : `${r * 100} %` }) }),
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": n, "--progress": `${r + 1}s` },
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: "var(--rds-heading-accent)" }),
34
- /* @__PURE__ */ s("stop", { offset: "100%", stopColor: "var(--rds-background-card)" })
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
- _.displayName = "CircularProgress";
47
+ C.displayName = "CircularProgress";
48
48
  export {
49
- _ as C
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-CD_dLu6N.mjs";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rikstv/shared-components",
3
- "version": "3.3.6",
3
+ "version": "3.3.7-alpha.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },