@telia/teddy 0.6.8 → 0.6.10

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.
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const components_tooltip_index = require("../tooltip/index.cjs");
5
+ const components_circleBar_css = require("./css.cjs");
6
+ const CircleBar = ({ title, value, tooltip, tooltipLocation = "left" }) => {
7
+ const radius = 180;
8
+ const gapSize = 150;
9
+ const rotate = 114;
10
+ const circumference = 2 * Math.PI * radius;
11
+ const fillableCircumference = circumference - gapSize;
12
+ const percentFilled = value / 100;
13
+ const offset = circumference - fillableCircumference * percentFilled;
14
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: components_circleBar_css.css("teddy-circle-bar"), children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${components_circleBar_css.css("__tooltip")} ${components_circleBar_css.css("__tooltip-" + tooltipLocation)}`, children: tooltip && /* @__PURE__ */ jsxRuntime.jsxs(components_tooltip_index.Tooltip, { children: [
16
+ /* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Trigger, {}),
17
+ /* @__PURE__ */ jsxRuntime.jsx(components_tooltip_index.Tooltip.Content, { className: components_circleBar_css.css("__tooltip-content"), children: tooltip })
18
+ ] }) }),
19
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: components_circleBar_css.css("__svg-container"), children: [
20
+ /* @__PURE__ */ jsxRuntime.jsxs(
21
+ "svg",
22
+ {
23
+ width: "100%",
24
+ height: "100%",
25
+ viewBox: "0 0 400 400",
26
+ className: components_circleBar_css.css("__svg"),
27
+ style: { strokeDasharray: `${fillableCircumference}, ${circumference}`, rotate: `${rotate}deg` },
28
+ children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "200", cy: "200", r: radius, strokeWidth: "35", stroke: "#F5E0FF", fill: "none" }),
30
+ /* @__PURE__ */ jsxRuntime.jsx(
31
+ "circle",
32
+ {
33
+ cx: "200",
34
+ cy: "200",
35
+ r: radius,
36
+ strokeWidth: "35.25",
37
+ stroke: "#4E0174",
38
+ fill: "none",
39
+ strokeDasharray: `${circumference}`,
40
+ strokeDashoffset: offset,
41
+ style: { transition: "stroke-dashoffset 0.222s ease-in-out" }
42
+ }
43
+ )
44
+ ]
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: components_circleBar_css.css("__info-box"), children: [
48
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: components_circleBar_css.css("__value-label"), children: [
49
+ value,
50
+ " %"
51
+ ] }),
52
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: title })
53
+ ] })
54
+ ] })
55
+ ] });
56
+ };
57
+ exports.CircleBar = CircleBar;
58
+ exports.default = CircleBar;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface CircleBarProps {
4
+ title: string;
5
+ value: number;
6
+ tooltip?: string;
7
+ tooltipLocation?: 'left' | 'right';
8
+ }
9
+ export declare const CircleBar: React.FC<CircleBarProps>;
10
+ export default CircleBar;
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Tooltip } from "../tooltip/index.js";
3
+ import { css } from "./css.js";
4
+ const CircleBar = ({ title, value, tooltip, tooltipLocation = "left" }) => {
5
+ const radius = 180;
6
+ const gapSize = 150;
7
+ const rotate = 114;
8
+ const circumference = 2 * Math.PI * radius;
9
+ const fillableCircumference = circumference - gapSize;
10
+ const percentFilled = value / 100;
11
+ const offset = circumference - fillableCircumference * percentFilled;
12
+ return /* @__PURE__ */ jsxs("div", { className: css("teddy-circle-bar"), children: [
13
+ /* @__PURE__ */ jsx("div", { className: `${css("__tooltip")} ${css("__tooltip-" + tooltipLocation)}`, children: tooltip && /* @__PURE__ */ jsxs(Tooltip, { children: [
14
+ /* @__PURE__ */ jsx(Tooltip.Trigger, {}),
15
+ /* @__PURE__ */ jsx(Tooltip.Content, { className: css("__tooltip-content"), children: tooltip })
16
+ ] }) }),
17
+ /* @__PURE__ */ jsxs("div", { className: css("__svg-container"), children: [
18
+ /* @__PURE__ */ jsxs(
19
+ "svg",
20
+ {
21
+ width: "100%",
22
+ height: "100%",
23
+ viewBox: "0 0 400 400",
24
+ className: css("__svg"),
25
+ style: { strokeDasharray: `${fillableCircumference}, ${circumference}`, rotate: `${rotate}deg` },
26
+ children: [
27
+ /* @__PURE__ */ jsx("circle", { cx: "200", cy: "200", r: radius, strokeWidth: "35", stroke: "#F5E0FF", fill: "none" }),
28
+ /* @__PURE__ */ jsx(
29
+ "circle",
30
+ {
31
+ cx: "200",
32
+ cy: "200",
33
+ r: radius,
34
+ strokeWidth: "35.25",
35
+ stroke: "#4E0174",
36
+ fill: "none",
37
+ strokeDasharray: `${circumference}`,
38
+ strokeDashoffset: offset,
39
+ style: { transition: "stroke-dashoffset 0.222s ease-in-out" }
40
+ }
41
+ )
42
+ ]
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsxs("div", { className: css("__info-box"), children: [
46
+ /* @__PURE__ */ jsxs("div", { className: css("__value-label"), children: [
47
+ value,
48
+ " %"
49
+ ] }),
50
+ /* @__PURE__ */ jsx("h3", { children: title })
51
+ ] })
52
+ ] })
53
+ ] });
54
+ };
55
+ export {
56
+ CircleBar,
57
+ CircleBar as default
58
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const clsx = require("clsx");
4
+ const styles = {
5
+ "teddy-circle-bar": "_teddy-circle-bar_40j64_1",
6
+ "teddy-circle-bar__tooltip": "_teddy-circle-bar__tooltip_40j64_6",
7
+ "teddy-circle-bar__tooltip-left": "_teddy-circle-bar__tooltip-left_40j64_12",
8
+ "teddy-circle-bar__tooltip-right": "_teddy-circle-bar__tooltip-right_40j64_15",
9
+ "teddy-circle-bar__tooltip-content": "_teddy-circle-bar__tooltip-content_40j64_18",
10
+ "teddy-circle-bar__svg-container": "_teddy-circle-bar__svg-container_40j64_21",
11
+ "teddy-circle-bar__svg": "_teddy-circle-bar__svg_40j64_21",
12
+ "teddy-circle-bar__info-box": "_teddy-circle-bar__info-box_40j64_31",
13
+ "teddy-circle-bar__value-label": "_teddy-circle-bar__value-label_40j64_37"
14
+ };
15
+ const rootClassName = "teddy-circle-bar";
16
+ const css = (suffix) => {
17
+ if (suffix == null)
18
+ return "";
19
+ let tmp = null;
20
+ if (suffix.startsWith("_") || suffix.startsWith("-") || suffix === "") {
21
+ tmp = clsx([styles[`${rootClassName + suffix}`]], "");
22
+ } else {
23
+ tmp = clsx([styles[`${suffix}`]], "");
24
+ }
25
+ if (!tmp) {
26
+ console.warn("Could not find css class " + suffix + " for the root " + rootClassName);
27
+ }
28
+ return tmp;
29
+ };
30
+ exports.css = css;
@@ -0,0 +1 @@
1
+ export declare const css: (suffix: string | null) => string;
@@ -0,0 +1,30 @@
1
+ import clsx from "clsx";
2
+ const styles = {
3
+ "teddy-circle-bar": "_teddy-circle-bar_40j64_1",
4
+ "teddy-circle-bar__tooltip": "_teddy-circle-bar__tooltip_40j64_6",
5
+ "teddy-circle-bar__tooltip-left": "_teddy-circle-bar__tooltip-left_40j64_12",
6
+ "teddy-circle-bar__tooltip-right": "_teddy-circle-bar__tooltip-right_40j64_15",
7
+ "teddy-circle-bar__tooltip-content": "_teddy-circle-bar__tooltip-content_40j64_18",
8
+ "teddy-circle-bar__svg-container": "_teddy-circle-bar__svg-container_40j64_21",
9
+ "teddy-circle-bar__svg": "_teddy-circle-bar__svg_40j64_21",
10
+ "teddy-circle-bar__info-box": "_teddy-circle-bar__info-box_40j64_31",
11
+ "teddy-circle-bar__value-label": "_teddy-circle-bar__value-label_40j64_37"
12
+ };
13
+ const rootClassName = "teddy-circle-bar";
14
+ const css = (suffix) => {
15
+ if (suffix == null)
16
+ return "";
17
+ let tmp = null;
18
+ if (suffix.startsWith("_") || suffix.startsWith("-") || suffix === "") {
19
+ tmp = clsx([styles[`${rootClassName + suffix}`]], "");
20
+ } else {
21
+ tmp = clsx([styles[`${suffix}`]], "");
22
+ }
23
+ if (!tmp) {
24
+ console.warn("Could not find css class " + suffix + " for the root " + rootClassName);
25
+ }
26
+ return tmp;
27
+ };
28
+ export {
29
+ css
30
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_circleBar_circleBar = require("./circle-bar.cjs");
4
+ exports.CircleBar = components_circleBar_circleBar.CircleBar;
@@ -0,0 +1,2 @@
1
+ export type { CircleBarProps } from './circle-bar';
2
+ export { CircleBar } from './circle-bar';
@@ -0,0 +1,4 @@
1
+ import { CircleBar } from "./circle-bar.js";
2
+ export {
3
+ CircleBar
4
+ };
@@ -7,7 +7,8 @@ const APP_KEYS = {
7
7
  "my-pages": "my-pages",
8
8
  "my-business": "my-business",
9
9
  "my-portal": "my-portal",
10
- "business-net": "business-net"
10
+ "business-net": "business-net",
11
+ "telia-hub": "telia-hub"
11
12
  };
12
13
  const MY_PAGE_LINKS = {
13
14
  name: "Min Side",
@@ -47,6 +48,13 @@ const MY_BUSINESS_LINKS = {
47
48
  links: [],
48
49
  icon: "home"
49
50
  };
51
+ const TELIA_HUB_LINKS = {
52
+ name: "Telia Hub",
53
+ link: "https://beta.hub.telia.no/",
54
+ appKey: APP_KEYS["telia-hub"],
55
+ links: [],
56
+ icon: "people-hub"
57
+ };
50
58
  const MY_PORTAL_LINKS = {
51
59
  name: "Min portal",
52
60
  link: "https://minportal.telia.no",
@@ -69,6 +77,7 @@ const SMART_CONNECT_LINKS = {
69
77
  icon: "smart-connect"
70
78
  };
71
79
  const LOGGED_IN_LINKS_BUSINESS = [
80
+ TELIA_HUB_LINKS,
72
81
  MY_BUSINESS_LINKS,
73
82
  MY_PORTAL_LINKS,
74
83
  SMART_CONNECT_LINKS,
@@ -1079,5 +1088,6 @@ exports.MY_PAGE_LINKS = MY_PAGE_LINKS;
1079
1088
  exports.MY_PORTAL_LINKS = MY_PORTAL_LINKS;
1080
1089
  exports.PRIVATE_LINKS = PRIVATE_LINKS;
1081
1090
  exports.SMART_CONNECT_LINKS = SMART_CONNECT_LINKS;
1091
+ exports.TELIA_HUB_LINKS = TELIA_HUB_LINKS;
1082
1092
  exports.getActiveSubLink = getActiveSubLink;
1083
1093
  exports.getLinks = getLinks;
@@ -8,6 +8,7 @@ export declare const APP_KEYS: {
8
8
  readonly 'my-business': "my-business";
9
9
  readonly 'my-portal': "my-portal";
10
10
  readonly 'business-net': "business-net";
11
+ readonly 'telia-hub': "telia-hub";
11
12
  };
12
13
  export type AppKey = (typeof APP_KEYS)[keyof typeof APP_KEYS];
13
14
  export type Link = {
@@ -51,6 +52,13 @@ export declare const MY_BUSINESS_LINKS: {
51
52
  readonly links: [];
52
53
  readonly icon: "home";
53
54
  };
55
+ export declare const TELIA_HUB_LINKS: {
56
+ readonly name: "Telia Hub";
57
+ readonly link: "https://beta.hub.telia.no/";
58
+ readonly appKey: "telia-hub";
59
+ readonly links: [];
60
+ readonly icon: "people-hub";
61
+ };
54
62
  export declare const MY_PORTAL_LINKS: {
55
63
  readonly name: "Min portal";
56
64
  readonly link: "https://minportal.telia.no";
@@ -73,6 +81,12 @@ export declare const SMART_CONNECT_LINKS: {
73
81
  readonly icon: "smart-connect";
74
82
  };
75
83
  export declare const LOGGED_IN_LINKS_BUSINESS: [{
84
+ readonly name: "Telia Hub";
85
+ readonly link: "https://beta.hub.telia.no/";
86
+ readonly appKey: "telia-hub";
87
+ readonly links: [];
88
+ readonly icon: "people-hub";
89
+ }, {
76
90
  readonly name: "Min bedrift";
77
91
  readonly link: "https://beta.minbedrift.telia.no";
78
92
  readonly appKey: "my-business";
@@ -122,6 +136,12 @@ export declare const LOGGED_IN_LINKS: [{
122
136
  readonly appKey: "my-pages";
123
137
  readonly icon: "secured-1";
124
138
  }];
139
+ }, {
140
+ readonly name: "Telia Hub";
141
+ readonly link: "https://beta.hub.telia.no/";
142
+ readonly appKey: "telia-hub";
143
+ readonly links: [];
144
+ readonly icon: "people-hub";
125
145
  }, {
126
146
  readonly name: "Min bedrift";
127
147
  readonly link: "https://beta.minbedrift.telia.no";
@@ -5,7 +5,8 @@ const APP_KEYS = {
5
5
  "my-pages": "my-pages",
6
6
  "my-business": "my-business",
7
7
  "my-portal": "my-portal",
8
- "business-net": "business-net"
8
+ "business-net": "business-net",
9
+ "telia-hub": "telia-hub"
9
10
  };
10
11
  const MY_PAGE_LINKS = {
11
12
  name: "Min Side",
@@ -45,6 +46,13 @@ const MY_BUSINESS_LINKS = {
45
46
  links: [],
46
47
  icon: "home"
47
48
  };
49
+ const TELIA_HUB_LINKS = {
50
+ name: "Telia Hub",
51
+ link: "https://beta.hub.telia.no/",
52
+ appKey: APP_KEYS["telia-hub"],
53
+ links: [],
54
+ icon: "people-hub"
55
+ };
48
56
  const MY_PORTAL_LINKS = {
49
57
  name: "Min portal",
50
58
  link: "https://minportal.telia.no",
@@ -67,6 +75,7 @@ const SMART_CONNECT_LINKS = {
67
75
  icon: "smart-connect"
68
76
  };
69
77
  const LOGGED_IN_LINKS_BUSINESS = [
78
+ TELIA_HUB_LINKS,
70
79
  MY_BUSINESS_LINKS,
71
80
  MY_PORTAL_LINKS,
72
81
  SMART_CONNECT_LINKS,
@@ -1078,6 +1087,7 @@ export {
1078
1087
  MY_PORTAL_LINKS,
1079
1088
  PRIVATE_LINKS,
1080
1089
  SMART_CONNECT_LINKS,
1090
+ TELIA_HUB_LINKS,
1081
1091
  getActiveSubLink,
1082
1092
  getLinks
1083
1093
  };
package/dist/style.css CHANGED
@@ -7675,4 +7675,49 @@
7675
7675
  :root {
7676
7676
  --teddy-scale: var(--teddy-rescale, 1);
7677
7677
  interpolate-size: allow-keywords;
7678
+ }._teddy-circle-bar_40j64_1 {
7679
+ position: relative;
7680
+ width: max-content;
7681
+ padding: 17px;
7682
+ }
7683
+ ._teddy-circle-bar__tooltip_40j64_6 {
7684
+ width: max-content;
7685
+ position: absolute;
7686
+ top: -2px;
7687
+ z-index: 1;
7688
+ }
7689
+ ._teddy-circle-bar__tooltip-left_40j64_12 {
7690
+ left: -2px;
7691
+ }
7692
+ ._teddy-circle-bar__tooltip-right_40j64_15 {
7693
+ right: -2px;
7694
+ }
7695
+ ._teddy-circle-bar__tooltip-content_40j64_18 {
7696
+ max-width: 300px;
7697
+ }
7698
+ ._teddy-circle-bar__svg-container_40j64_21 {
7699
+ width: 155px;
7700
+ position: relative;
7701
+ }
7702
+ ._teddy-circle-bar__svg_40j64_21 {
7703
+ transform-origin: center center;
7704
+ fill: transparent;
7705
+ stroke-linecap: round;
7706
+ stroke: #c4c4c4;
7707
+ }
7708
+ ._teddy-circle-bar__info-box_40j64_31 {
7709
+ position: absolute;
7710
+ width: 100%;
7711
+ top: 47px;
7712
+ text-align: center;
7713
+ }
7714
+ ._teddy-circle-bar__value-label_40j64_37 {
7715
+ font-size: 28px;
7716
+ font-weight: 700;
7717
+ margin-bottom: 6px;
7718
+ }
7719
+ ._teddy-circle-bar_40j64_1 h3 {
7720
+ margin: 0;
7721
+ font-size: 14px;
7722
+ font-weight: 400;
7678
7723
  }
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "pnpm": ">=9"
21
21
  },
22
22
  "private": false,
23
- "version": "0.6.8",
23
+ "version": "0.6.10",
24
24
  "sideEffects": [
25
25
  "**/*.css",
26
26
  "**/*.svg"