@selfdecode/sd-component-library 4.0.134 → 4.0.136
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/lib/components/forms-v2/input-container/interfaces.d.ts +2 -1
- package/lib/components/modals/modal/interfaces.d.ts +2 -1
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +2 -2
- package/lib/sd-component-library102.js +59 -56
- package/lib/sd-component-library102.js.map +1 -1
- package/lib/sd-component-library104.js +4 -4
- package/lib/sd-component-library106.js +4 -4
- package/lib/sd-component-library112.js +1 -1
- package/lib/sd-component-library117.js +1 -1
- package/lib/sd-component-library118.js +2 -2
- package/lib/sd-component-library120.js +1 -1
- package/lib/sd-component-library121.js +1 -1
- package/lib/sd-component-library126.js +2 -2
- package/lib/sd-component-library127.js +2 -2
- package/lib/sd-component-library129.js +1 -1
- package/lib/sd-component-library133.js +3 -3
- package/lib/sd-component-library134.js +1 -1
- package/lib/sd-component-library136.js +2 -2
- package/lib/sd-component-library168.js +1 -1
- package/lib/sd-component-library171.js +1 -1
- package/lib/sd-component-library172.js +4 -4
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library201.js +2 -3
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -2
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +590 -21
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +25 -598
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library206.js +17 -25
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +21 -18
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +3 -21
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +1 -1
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +64 -3
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +19 -60
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +37 -20
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +127 -38
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +13 -129
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +65 -13
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -14
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +2 -2
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +46 -3
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +14 -3
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +3 -52
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +3 -65
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +17 -3
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +51 -45
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -17
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library232.js +1 -1
- package/lib/sd-component-library234.js +1 -1
- package/lib/sd-component-library236.js +1 -1
- package/lib/sd-component-library237.js +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +1 -1
- package/lib/sd-component-library241.js +1 -1
- package/lib/sd-component-library244.js +46 -19
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +75 -20
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +39 -46
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +26 -74
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library249.js +18 -38
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +18 -25
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library252.js +323 -27
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +5 -3
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +25 -20
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +1 -1
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +17 -18
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +3 -22
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +25 -30
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +21 -50
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +30 -134
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +39 -62
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +120 -62
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +75 -29
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +68 -15
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +25 -120
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +16 -117
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +125 -10
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +111 -39
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +10 -9
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +48 -323
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +9 -51
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +48 -87
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +52 -54
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +92 -5
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library277.js +10 -2
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -2
- package/lib/sd-component-library279.js +2 -6
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library283.js +6 -10
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library286.js +1 -1
- package/lib/sd-component-library304.js +1 -1
- package/lib/sd-component-library308.js +5 -57
- package/lib/sd-component-library308.js.map +1 -1
- package/lib/sd-component-library309.js +57 -5
- package/lib/sd-component-library309.js.map +1 -1
- package/lib/sd-component-library313.js +23 -33
- package/lib/sd-component-library313.js.map +1 -1
- package/lib/sd-component-library314.js +33 -23
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library48.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library51.js +3 -3
- package/lib/sd-component-library52.js +2 -2
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library55.js +65 -63
- package/lib/sd-component-library55.js.map +1 -1
- package/lib/sd-component-library57.js +81 -71
- package/lib/sd-component-library57.js.map +1 -1
- package/lib/sd-component-library58.js +46 -41
- package/lib/sd-component-library58.js.map +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library61.js +1 -1
- package/lib/sd-component-library62.js +1 -1
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +2 -2
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library7.js +1 -1
- package/lib/sd-component-library70.js +2 -2
- package/lib/sd-component-library72.js +3 -3
- package/lib/sd-component-library74.js +2 -2
- package/lib/sd-component-library75.js +3 -3
- package/lib/sd-component-library76.js +1 -1
- package/lib/sd-component-library77.js +1 -1
- package/lib/sd-component-library79.js +1 -1
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library218.js","sources":["../src/components/inputs/
|
|
1
|
+
{"version":3,"file":"sd-component-library218.js","sources":["../src/components/inputs/secondary-text-input/partials/secondary-input-labels/secondary-input-labels.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flex } from \"rebass\";\n\nimport { BaseTextV2, ResponsiveTextV2 } from \"../../../../texts\";\nimport { SecondaryInputLabelsProps as Props } from \"./interfaces\";\n\nexport const SecondaryInputLabels: React.FC<Props> = (props) => {\n const {\n label,\n errorMessage,\n labelMargin,\n secondLabel,\n secondLabelTextTransform,\n labelSx,\n labelColor = \"cl_darkGrey\",\n ...restOfProps\n } = props;\n\n if (!label) return null;\n\n return (\n <Flex sx={{ cursor: \"default\" }} {...restOfProps}>\n <BaseTextV2\n color={errorMessage ? \"cl_red\" : labelColor}\n sx={{\n fontSize: 12,\n fontWeight: 600,\n m: labelMargin,\n letterSpacing: \"1px\",\n textTransform: \"uppercase\",\n ...labelSx,\n }}\n >\n {label}\n </BaseTextV2>\n\n {secondLabel && (\n <ResponsiveTextV2\n letterSpacing=\"1px\"\n ml={secondLabel.ml || \"3px\"}\n color={secondLabel.color || \"cl_grey\"}\n fontSizeWeight={secondLabel.fontSizeWeight || [[10, \"semi-bold\"]]}\n textTransform={secondLabelTextTransform}\n {...secondLabel}\n >\n {secondLabel.text}\n </ResponsiveTextV2>\n )}\n </Flex>\n );\n};\n"],"names":["SecondaryInputLabels","props","label","errorMessage","labelMargin","secondLabel","secondLabelTextTransform","labelSx","labelColor","restOfProps","jsxs","Flex","jsx","BaseTextV2","ResponsiveTextV2"],"mappings":";;;;AAOa,MAAAA,IAAwC,CAACC,MAAU;AACxD,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAR;AAEJ,SAAKC,IAGHQ,gBAAAA,EAAA,KAACC,KAAK,IAAI,EAAE,QAAQ,UAAU,GAAI,GAAGF,GACnC,UAAA;AAAA,IAAAG,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOV,IAAe,WAAWK;AAAA,QACjC,IAAI;AAAA,UACF,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,GAAGJ;AAAA,UACH,eAAe;AAAA,UACf,eAAe;AAAA,UACf,GAAGG;AAAA,QACL;AAAA,QAEC,UAAAL;AAAA,MAAA;AAAA,IACH;AAAA,IAECG,KACCO,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,eAAc;AAAA,QACd,IAAIT,EAAY,MAAM;AAAA,QACtB,OAAOA,EAAY,SAAS;AAAA,QAC5B,gBAAgBA,EAAY,kBAAkB,CAAC,CAAC,IAAI,WAAW,CAAC;AAAA,QAChE,eAAeC;AAAA,QACd,GAAGD;AAAA,QAEH,UAAYA,EAAA;AAAA,MAAA;AAAA,IACf;AAAA,EAEJ,EAAA,CAAA,IA9BiB;AAgCrB;"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { j as i } from "./sd-component-library197.js";
|
|
2
|
+
import { Button as e } from "./sd-component-library24.js";
|
|
3
|
+
const n = (t) => /* @__PURE__ */ i.jsx(
|
|
4
|
+
e,
|
|
5
|
+
{
|
|
6
|
+
...t,
|
|
7
|
+
variant: "_circle",
|
|
8
|
+
width: [`${t.diameter}px`],
|
|
9
|
+
height: [`${t.diameter}px`],
|
|
10
|
+
"data-testid": "circle-button",
|
|
11
|
+
children: t.children
|
|
12
|
+
}
|
|
13
|
+
);
|
|
3
14
|
export {
|
|
4
|
-
|
|
15
|
+
n as CircleButton
|
|
5
16
|
};
|
|
6
17
|
//# sourceMappingURL=sd-component-library219.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library219.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library219.js","sources":["../src/components/buttons/partials/circle-button/circle-button.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { CircleButtonProps } from \".\";\nimport { Button } from \"../../button\";\n\n/**\n * The circle button.\n */\nexport const CircleButton: React.FC<CircleButtonProps> = (props) => (\n <Button\n {...props}\n variant=\"_circle\"\n width={[`${props.diameter}px`]}\n height={[`${props.diameter}px`]}\n data-testid=\"circle-button\"\n >\n {props.children}\n </Button>\n);\n"],"names":["CircleButton","props","jsx","Button"],"mappings":";;AAQa,MAAAA,IAA4C,CAACC,MACxDC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACE,GAAGF;AAAA,IACJ,SAAQ;AAAA,IACR,OAAO,CAAC,GAAGA,EAAM,QAAQ,IAAI;AAAA,IAC7B,QAAQ,CAAC,GAAGA,EAAM,QAAQ,IAAI;AAAA,IAC9B,eAAY;AAAA,IAEX,UAAMA,EAAA;AAAA,EAAA;AACT;"}
|
|
@@ -1,55 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Box as t } from "rebass";
|
|
4
|
-
import { HorizontalDivider as i } from "./sd-component-library48.js";
|
|
5
|
-
import { SearchAutocompleteRow as a } from "./sd-component-library310.js";
|
|
6
|
-
const g = (l) => {
|
|
7
|
-
const { results: p, onSelect: s, rowHeight: e, rowsDisplayed: x } = l, c = (r) => () => s(r);
|
|
8
|
-
return /* @__PURE__ */ o.jsxs(
|
|
9
|
-
t,
|
|
10
|
-
{
|
|
11
|
-
sx: {
|
|
12
|
-
top: "calc(100% - 2px)",
|
|
13
|
-
left: 0,
|
|
14
|
-
position: "absolute",
|
|
15
|
-
width: "100%",
|
|
16
|
-
cursor: "pointer",
|
|
17
|
-
zIndex: 1
|
|
18
|
-
},
|
|
19
|
-
children: [
|
|
20
|
-
/* @__PURE__ */ o.jsx(i, { color: "cl_purple", height: "2px" }),
|
|
21
|
-
/* @__PURE__ */ o.jsx(
|
|
22
|
-
t,
|
|
23
|
-
{
|
|
24
|
-
sx: {
|
|
25
|
-
overflowY: "auto",
|
|
26
|
-
maxHeight: `${x * (e + 1) - 1}px`,
|
|
27
|
-
borderWidth: "1px",
|
|
28
|
-
borderStyle: "solid",
|
|
29
|
-
borderColor: "cl_lightGrey",
|
|
30
|
-
borderRadius: "0 0 3px 3px",
|
|
31
|
-
borderTopStyle: "none",
|
|
32
|
-
boxShadow: "2px 3px 10px rgba(211,223,255,0.25)",
|
|
33
|
-
bg: "cl_white"
|
|
34
|
-
},
|
|
35
|
-
children: p.map((r, d) => /* @__PURE__ */ o.jsxs(n.Fragment, { children: [
|
|
36
|
-
d !== 0 && /* @__PURE__ */ o.jsx(i, { color: "cl_headerLine" }),
|
|
37
|
-
/* @__PURE__ */ o.jsx(
|
|
38
|
-
a,
|
|
39
|
-
{
|
|
40
|
-
...r,
|
|
41
|
-
onClick: c(r),
|
|
42
|
-
height: e
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
] }, r.id))
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
};
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const o = (e) => /* @__PURE__ */ t.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ t.createElement("path", { fill: "#4B71F7", d: "M0 9h24v6h-24z" }));
|
|
52
3
|
export {
|
|
53
|
-
|
|
4
|
+
o as ReactComponent
|
|
54
5
|
};
|
|
55
6
|
//# sourceMappingURL=sd-component-library220.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library220.js","sources":["../src/components/inputs/
|
|
1
|
+
{"version":3,"file":"sd-component-library220.js","sources":["../src/components/inputs/primary-number-input/assets/minus-active.svg"],"sourcesContent":["export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjNEI3MUY3IiBkPSJNMCA5aDI0djZoLTI0eiIvPjwvc3ZnPg==\""],"names":["SvgMinusActive","props","React"],"mappings":";AACK,MAACA,IAAiB,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,GAAGD,EAAO,GAAkB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,MAAM,WAAW,GAAG,iBAAgB,CAAE,CAAC;"}
|
|
@@ -1,68 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Link as m } from "react-router-dom";
|
|
4
|
-
import { Box as n, Flex as f } from "rebass";
|
|
5
|
-
import { RegularText as h } from "./sd-component-library163.js";
|
|
6
|
-
import { PrimaryBadge as s } from "./sd-component-library9.js";
|
|
7
|
-
import { HorizontalDivider as c } from "./sd-component-library48.js";
|
|
8
|
-
const S = ({
|
|
9
|
-
searchResults: t,
|
|
10
|
-
useRouterLinks: i,
|
|
11
|
-
onResultClick: r
|
|
12
|
-
}) => /* @__PURE__ */ o.jsx(
|
|
13
|
-
n,
|
|
14
|
-
{
|
|
15
|
-
sx: {
|
|
16
|
-
position: "absolute",
|
|
17
|
-
top: "100%",
|
|
18
|
-
bg: "white",
|
|
19
|
-
width: "100%",
|
|
20
|
-
borderRadius: ["0", "0px 0px 3px 3px"],
|
|
21
|
-
borderWidth: "1px",
|
|
22
|
-
borderStyle: "solid",
|
|
23
|
-
borderTopStyle: "none",
|
|
24
|
-
borderColor: "#C8CCE5",
|
|
25
|
-
boxShadow: "2px 3px 10px rgba(211,223,255,0.25)"
|
|
26
|
-
},
|
|
27
|
-
children: t.map((e, p) => /* @__PURE__ */ o.jsxs(d.Fragment, { children: [
|
|
28
|
-
i ? /* @__PURE__ */ o.jsx(m, { to: e.url, style: { textDecoration: "none" }, children: /* @__PURE__ */ o.jsx(x, { ...e, onResultClick: r }) }) : /* @__PURE__ */ o.jsx(
|
|
29
|
-
x,
|
|
30
|
-
{
|
|
31
|
-
...e,
|
|
32
|
-
onResultClick: r,
|
|
33
|
-
onClick: () => window.location.href = `https://www.selfdecode.com${e.url}`
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
p + 1 !== t.length && /* @__PURE__ */ o.jsx(c, { color: "cl_lightGrey" })
|
|
37
|
-
] }, `${p}-${e.url}`))
|
|
38
|
-
}
|
|
39
|
-
), x = ({
|
|
40
|
-
onResultClick: t,
|
|
41
|
-
onClick: i,
|
|
42
|
-
...r
|
|
43
|
-
}) => {
|
|
44
|
-
const e = () => {
|
|
45
|
-
t == null || t(r), i == null || i();
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ o.jsxs(
|
|
48
|
-
f,
|
|
49
|
-
{
|
|
50
|
-
flexDirection: ["column-reverse", "row"],
|
|
51
|
-
justifyContent: "space-between",
|
|
52
|
-
sx: {
|
|
53
|
-
p: "10px 16px",
|
|
54
|
-
cursor: "pointer",
|
|
55
|
-
":hover": { bg: "#eff4ff" }
|
|
56
|
-
},
|
|
57
|
-
onClick: e,
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ o.jsx(h, { fontSize: 16, children: r.text }),
|
|
60
|
-
!!r.type && /* @__PURE__ */ o.jsx(n, { width: "max-content", mb: ["8px", "0"], children: /* @__PURE__ */ o.jsx(s, { children: r.type }) })
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
};
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const h = (e) => /* @__PURE__ */ t.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ t.createElement("path", { fill: "#4B71F7", d: "M24 9h-9v-9h-6v9h-9v6h9v9h6v-9h9z" }));
|
|
65
3
|
export {
|
|
66
|
-
|
|
4
|
+
h as ReactComponent
|
|
67
5
|
};
|
|
68
6
|
//# sourceMappingURL=sd-component-library221.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library221.js","sources":["../src/components/inputs/
|
|
1
|
+
{"version":3,"file":"sd-component-library221.js","sources":["../src/components/inputs/primary-number-input/assets/plus-active.svg"],"sourcesContent":["export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjNEI3MUY3IiBkPSJNMjQgOWgtOXYtOWgtNnY5aC05djZoOXY5aDZ2LTloOXoiLz48L3N2Zz4=\""],"names":["SvgPlusActive","props","React"],"mappings":";AACK,MAACA,IAAgB,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,GAAGD,EAAO,GAAkB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,MAAM,WAAW,GAAG,oCAAmC,CAAE,CAAC;"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import { Label as s } from "@rebass/forms";
|
|
3
|
+
const l = ({
|
|
4
|
+
variant: a,
|
|
5
|
+
label: t,
|
|
6
|
+
...e
|
|
7
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
+
s,
|
|
9
|
+
{
|
|
10
|
+
"data-testid": "base-label",
|
|
11
|
+
...e,
|
|
12
|
+
sx: { fontFamily: "proxima-nova" },
|
|
13
|
+
variant: `_labels.${a}`,
|
|
14
|
+
children: t
|
|
15
|
+
}
|
|
16
|
+
);
|
|
3
17
|
export {
|
|
4
|
-
|
|
18
|
+
l as BaseLabel
|
|
5
19
|
};
|
|
6
20
|
//# sourceMappingURL=sd-component-library222.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library222.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library222.js","sources":["../src/components/labels/base-label/base-label.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Label } from \"@rebass/forms\";\n\nimport { BaseLabelProps } from \"./interfaces\";\n\nexport const BaseLabel: React.FC<BaseLabelProps> = ({\n variant,\n label,\n ...props\n}) => (\n <Label\n data-testid=\"base-label\"\n {...props}\n sx={{ fontFamily: \"proxima-nova\" }}\n variant={`_labels.${variant}`}\n >\n {label}\n </Label>\n);\n"],"names":["BaseLabel","variant","label","props","jsx","Label"],"mappings":";;AAMO,MAAMA,IAAsC,CAAC;AAAA,EAClD,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MACEC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACX,GAAGF;AAAA,IACJ,IAAI,EAAE,YAAY,eAAe;AAAA,IACjC,SAAS,WAAWF,CAAO;AAAA,IAE1B,UAAAC;AAAA,EAAA;AACH;"}
|
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Box as t } from "rebass";
|
|
4
|
+
import { HorizontalDivider as i } from "./sd-component-library48.js";
|
|
5
|
+
import { SearchAutocompleteRow as a } from "./sd-component-library310.js";
|
|
6
|
+
const g = (l) => {
|
|
7
|
+
const { results: p, onSelect: s, rowHeight: e, rowsDisplayed: x } = l, c = (r) => () => s(r);
|
|
8
|
+
return /* @__PURE__ */ o.jsxs(
|
|
9
|
+
t,
|
|
10
|
+
{
|
|
11
|
+
sx: {
|
|
12
|
+
top: "calc(100% - 2px)",
|
|
13
|
+
left: 0,
|
|
14
|
+
position: "absolute",
|
|
15
|
+
width: "100%",
|
|
16
|
+
cursor: "pointer",
|
|
17
|
+
zIndex: 1
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ o.jsx(i, { color: "cl_purple", height: "2px" }),
|
|
21
|
+
/* @__PURE__ */ o.jsx(
|
|
22
|
+
t,
|
|
23
|
+
{
|
|
24
|
+
sx: {
|
|
25
|
+
overflowY: "auto",
|
|
26
|
+
maxHeight: `${x * (e + 1) - 1}px`,
|
|
27
|
+
borderWidth: "1px",
|
|
28
|
+
borderStyle: "solid",
|
|
29
|
+
borderColor: "cl_lightGrey",
|
|
30
|
+
borderRadius: "0 0 3px 3px",
|
|
31
|
+
borderTopStyle: "none",
|
|
32
|
+
boxShadow: "2px 3px 10px rgba(211,223,255,0.25)",
|
|
33
|
+
bg: "cl_white"
|
|
34
|
+
},
|
|
35
|
+
children: p.map((r, d) => /* @__PURE__ */ o.jsxs(n.Fragment, { children: [
|
|
36
|
+
d !== 0 && /* @__PURE__ */ o.jsx(i, { color: "cl_headerLine" }),
|
|
37
|
+
/* @__PURE__ */ o.jsx(
|
|
38
|
+
a,
|
|
39
|
+
{
|
|
40
|
+
...r,
|
|
41
|
+
onClick: c(r),
|
|
42
|
+
height: e
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }, r.id))
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
45
51
|
};
|
|
46
52
|
export {
|
|
47
|
-
|
|
53
|
+
g as SearchAutocompleteResultsBox
|
|
48
54
|
};
|
|
49
55
|
//# sourceMappingURL=sd-component-library223.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library223.js","sources":["../src/components/inputs/
|
|
1
|
+
{"version":3,"file":"sd-component-library223.js","sources":["../src/components/inputs/search-autocomplete-input/partials/search-autocomplete-results-box/search-autocomplete-results-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { HorizontalDivider } from \"../../../../dividers/horizontal-divider\";\nimport { SearchAutocompleteOption } from \"../../interfaces\";\nimport { SearchAutocompleteRow } from \"../search-autocomplete-row\";\nimport { SearchAutocompleteResultsBoxProps as Props } from \"./interfaces\";\n\nexport const SearchAutocompleteResultsBox = <\n T extends { id: string } = { id: string }\n>(\n props: Props<T>\n) => {\n const { results, onSelect, rowHeight, rowsDisplayed } = props;\n\n const onClick = (result: SearchAutocompleteOption<T>) => () =>\n onSelect(result);\n\n return (\n <Box\n sx={{\n top: \"calc(100% - 2px)\",\n left: 0,\n position: \"absolute\",\n width: \"100%\",\n cursor: \"pointer\",\n zIndex: 1,\n }}\n >\n <HorizontalDivider color=\"cl_purple\" height=\"2px\" />\n\n <Box\n sx={{\n overflowY: \"auto\",\n maxHeight: `${rowsDisplayed * (rowHeight + 1) - 1}px`,\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"cl_lightGrey\",\n borderRadius: \"0 0 3px 3px\",\n borderTopStyle: \"none\",\n boxShadow: \"2px 3px 10px rgba(211,223,255,0.25)\",\n bg: \"cl_white\",\n }}\n >\n {results.map((result, idx) => (\n <React.Fragment key={result.id}>\n {idx !== 0 && <HorizontalDivider color=\"cl_headerLine\" />}\n\n <SearchAutocompleteRow\n {...result}\n onClick={onClick(result)}\n height={rowHeight}\n />\n </React.Fragment>\n ))}\n </Box>\n </Box>\n );\n};\n"],"names":["SearchAutocompleteResultsBox","props","results","onSelect","rowHeight","rowsDisplayed","onClick","result","jsxs","Box","jsx","HorizontalDivider","idx","React","SearchAutocompleteRow"],"mappings":";;;;;AASa,MAAAA,IAA+B,CAG1CC,MACG;AACH,QAAM,EAAE,SAAAC,GAAS,UAAAC,GAAU,WAAAC,GAAW,eAAAC,MAAkBJ,GAElDK,IAAU,CAACC,MAAwC,MACvDJ,EAASI,CAAM;AAGf,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,KAAK;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV;AAAA,MAEA,UAAA;AAAA,QAAAC,gBAAAA,EAAA,IAACC,GAAkB,EAAA,OAAM,aAAY,QAAO,OAAM;AAAA,QAElDD,gBAAAA,EAAA;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,cACF,WAAW;AAAA,cACX,WAAW,GAAGJ,KAAiBD,IAAY,KAAK,CAAC;AAAA,cACjD,aAAa;AAAA,cACb,aAAa;AAAA,cACb,aAAa;AAAA,cACb,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB,WAAW;AAAA,cACX,IAAI;AAAA,YACN;AAAA,YAEC,UAAAF,EAAQ,IAAI,CAACK,GAAQK,MACnBJ,gBAAAA,EAAAA,KAAAK,EAAM,UAAN,EACE,UAAA;AAAA,cAAAD,MAAQ,KAAKF,gBAAAA,EAAA,IAACC,GAAkB,EAAA,OAAM,iBAAgB;AAAA,cAEvDD,gBAAAA,EAAA;AAAA,gBAACI;AAAA,gBAAA;AAAA,kBACE,GAAGP;AAAA,kBACJ,SAASD,EAAQC,CAAM;AAAA,kBACvB,QAAQH;AAAA,gBAAA;AAAA,cACV;AAAA,YAAA,KAPmBG,EAAO,EAQ5B,CACD;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const l = ({
|
|
4
|
-
variant: a,
|
|
5
|
-
label: t,
|
|
6
|
-
...e
|
|
7
|
-
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
-
s,
|
|
9
|
-
{
|
|
10
|
-
"data-testid": "base-label",
|
|
11
|
-
...e,
|
|
12
|
-
sx: { fontFamily: "proxima-nova" },
|
|
13
|
-
variant: `_labels.${a}`,
|
|
14
|
-
children: t
|
|
15
|
-
}
|
|
16
|
-
);
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
const e = (a) => /* @__PURE__ */ t.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 9.984, height: 6.021, viewBox: "0 0 9.984 6.021", ...a }, /* @__PURE__ */ t.createElement("path", { id: "dropdown_arrow_up", d: "M1262.106,88.295l4.662-4.218a.336.336,0,0,1,.459,0l4.662,4.218a.266.266,0,0,1,0,.416l-.5,1.205a.327.327,0,0,1-.23.091.331.331,0,0,1-.23-.091L1267,86.359l-3.93,3.557a.338.338,0,0,1-.46,0l-.5-1.205a.265.265,0,0,1,0-.416Z", transform: "translate(-1262.005 -83.986)" }));
|
|
17
3
|
export {
|
|
18
|
-
|
|
4
|
+
e as ReactComponent
|
|
19
5
|
};
|
|
20
6
|
//# sourceMappingURL=sd-component-library224.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library224.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library224.js","sources":["../src/components/accordions/base-accordion/assets/dropdown_arrow_up.svg"],"sourcesContent":["export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5Ljk4NCIgaGVpZ2h0PSI2LjAyMSIgdmlld0JveD0iMCAwIDkuOTg0IDYuMDIxIj4NCiAgPHBhdGggaWQ9ImRyb3Bkb3duX2Fycm93X3VwIiBkPSJNMTI2Mi4xMDYsODguMjk1bDQuNjYyLTQuMjE4YS4zMzYuMzM2LDAsMCwxLC40NTksMGw0LjY2Miw0LjIxOGEuMjY2LjI2NiwwLDAsMSwwLC40MTZsLS41LDEuMjA1YS4zMjcuMzI3LDAsMCwxLS4yMy4wOTEuMzMxLjMzMSwwLDAsMS0uMjMtLjA5MUwxMjY3LDg2LjM1OWwtMy45MywzLjU1N2EuMzM4LjMzOCwwLDAsMS0uNDYsMGwtLjUtMS4yMDVhLjI2NS4yNjUsMCwwLDEsMC0uNDE2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEyNjIuMDA1IC04My45ODYpIi8+DQo8L3N2Zz4NCg==\""],"names":["SvgDropdownArrowUp","props","React"],"mappings":";AACK,MAACA,IAAqB,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,OAAO,OAAO,QAAQ,OAAO,SAAS,mBAAmB,GAAGD,EAAO,GAAkB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,IAAI,qBAAqB,GAAG,8NAA8N,WAAW,+BAA8B,CAAE,CAAC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./sd-component-library197.js";
|
|
2
2
|
import U from "react";
|
|
3
3
|
import { isValueInRange as Z, inValueHigherThanRange as F, getCoordinateForArc as d, getInnerX as $, getInnerY as tt, degToRad as L } from "./sd-component-library91.js";
|
|
4
|
-
import { BaseOutlineArc as X } from "./sd-component-
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library313.js";
|
|
5
5
|
import { OutlineMeterLabelPointer as O } from "./sd-component-library242.js";
|
|
6
6
|
const st = U.forwardRef(
|
|
7
7
|
(D, M) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as k } from "./sd-component-library197.js";
|
|
2
2
|
import { isValueInRange as w, getInnerX as E, getInnerY as O, degToRad as r, getCoordinateForArc as V } from "./sd-component-library91.js";
|
|
3
|
-
import { BaseNeedle as b } from "./sd-component-
|
|
3
|
+
import { BaseNeedle as b } from "./sd-component-library314.js";
|
|
4
4
|
const G = (x) => {
|
|
5
5
|
const {
|
|
6
6
|
diameter: f,
|
|
@@ -2,7 +2,7 @@ import { j as a } from "./sd-component-library197.js";
|
|
|
2
2
|
import { getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
3
|
import { defaultTextBottomMargin as X } from "./sd-component-library225.js";
|
|
4
4
|
import { getRangeProperties as Y } from "./sd-component-library315.js";
|
|
5
|
-
import { BaseOutlineArc as b } from "./sd-component-
|
|
5
|
+
import { BaseOutlineArc as b } from "./sd-component-library313.js";
|
|
6
6
|
import { DiscreteMeterLabelPointer as w } from "./sd-component-library316.js";
|
|
7
7
|
function z(s) {
|
|
8
8
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as M } from "./sd-component-library197.js";
|
|
2
2
|
import { getInnerX as T, getInnerY as W, degToRad as r, getCoordinateForArc as y } from "./sd-component-library91.js";
|
|
3
|
-
import { BaseNeedle as B } from "./sd-component-
|
|
3
|
+
import { BaseNeedle as B } from "./sd-component-library314.js";
|
|
4
4
|
function E(p) {
|
|
5
5
|
const {
|
|
6
6
|
needleColor: u,
|
|
@@ -2,7 +2,7 @@ import { j as r } from "./sd-component-library197.js";
|
|
|
2
2
|
import { Link as Q } from "react-router-dom";
|
|
3
3
|
import { Button as U, Flex as V } from "rebass";
|
|
4
4
|
import { generateTestLocator as X } from "./sd-component-library4.js";
|
|
5
|
-
import { LoadingSpinner as Y } from "./sd-component-
|
|
5
|
+
import { LoadingSpinner as Y } from "./sd-component-library204.js";
|
|
6
6
|
function Z(t, o, e) {
|
|
7
7
|
return (n) => {
|
|
8
8
|
t == null || t(n), o && (`#${o}` !== window.location.hash && (e != null && e.replace(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./sd-component-library197.js";
|
|
2
2
|
import { getCoordinateForArc as A, getInnerX as H, getInnerY as M, degToRad as E } from "./sd-component-library91.js";
|
|
3
3
|
import { getFractionColor as O } from "./sd-component-library239.js";
|
|
4
|
-
import { BaseOutlineArc as X } from "./sd-component-
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library313.js";
|
|
5
5
|
const w = "#CCD0DB", q = (G) => {
|
|
6
6
|
const {
|
|
7
7
|
diameter: I,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as N } from "./sd-component-library197.js";
|
|
2
2
|
import { getInnerX as k, getInnerY as B, degToRad as c, getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
3
|
import { getFractionColor as b } from "./sd-component-library239.js";
|
|
4
|
-
import { BaseNeedle as q } from "./sd-component-
|
|
4
|
+
import { BaseNeedle as q } from "./sd-component-library314.js";
|
|
5
5
|
const O = (R) => {
|
|
6
6
|
const {
|
|
7
7
|
ranges: r,
|
|
@@ -1,24 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { getCoordinateForArc as s } from "./sd-component-library91.js";
|
|
2
|
+
const v = (r) => {
|
|
3
|
+
const a = `Received ${r.map(
|
|
4
|
+
({ start: e, end: t }) => `(${e},${t})`
|
|
5
|
+
)}`, n = (e) => console.error(e, a);
|
|
6
|
+
if (r.some(
|
|
7
|
+
({ start: e, end: t }) => [e, t].some((o) => o < 0 || o > 1)
|
|
8
|
+
))
|
|
9
|
+
return n("Segment values should be between 0 and 1"), !1;
|
|
10
|
+
if (r.reduce(
|
|
11
|
+
(e, { start: t }) => e + (t === 0 ? 1 : 0),
|
|
12
|
+
0
|
|
13
|
+
) !== 1)
|
|
14
|
+
return n("One segment should start from 0"), !1;
|
|
15
|
+
if (r.reduce((e, { end: t }) => e + (t === 1 ? 1 : 0), 0) !== 1)
|
|
16
|
+
return n("One segment should end by 1"), !1;
|
|
17
|
+
if (r.some(({ start: e, end: t }) => e >= t))
|
|
18
|
+
return n("Segment start should be smaller than end"), !1;
|
|
19
|
+
for (let e = 1; e < r.length; e++) {
|
|
20
|
+
const t = r[e];
|
|
21
|
+
if (r[e - 1].end !== t.start)
|
|
22
|
+
return n("Previous segment end should be equal to next segment start"), !1;
|
|
23
|
+
}
|
|
24
|
+
return !0;
|
|
25
|
+
}, x = ({ start: r, end: a }, n, e) => {
|
|
26
|
+
const t = n - e, o = Math.round(r * 360), c = Math.round(a * 360), d = c - o, { x: l, y: u } = s(n, o), { x: f, y: m } = s(
|
|
27
|
+
t,
|
|
28
|
+
o,
|
|
29
|
+
n
|
|
30
|
+
), { x: h, y: i } = s(n, c), { x: g, y: S } = s(
|
|
31
|
+
t,
|
|
32
|
+
c,
|
|
33
|
+
n
|
|
19
34
|
);
|
|
35
|
+
return {
|
|
36
|
+
startX: l,
|
|
37
|
+
startY: u,
|
|
38
|
+
endX: h,
|
|
39
|
+
endY: i,
|
|
40
|
+
startInnerX: f,
|
|
41
|
+
startInnerY: m,
|
|
42
|
+
endInnerX: g,
|
|
43
|
+
endInnerY: S,
|
|
44
|
+
arc: d
|
|
45
|
+
};
|
|
20
46
|
};
|
|
21
47
|
export {
|
|
22
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
23
50
|
};
|
|
24
51
|
//# sourceMappingURL=sd-component-library244.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library244.js","sources":["../src/components/meters/donut-diagram/utils.ts"],"sourcesContent":["import { getCoordinateForArc } from \"../outline-meter/utils\";\nimport { DonutSegment } from \"./interfaces\";\n\nexport const areSegmentsValid = (\n segments: Pick<DonutSegment, \"start\" | \"end\">[]\n): boolean => {\n const receivedSegments = `Received ${segments.map(\n ({ start, end }) => `(${start},${end})`\n )}`;\n const showError = (text: string) => console.error(text, receivedSegments);\n\n if (\n segments.some(({ start, end }) =>\n [start, end].some((point) => point < 0 || point > 1)\n )\n ) {\n showError(\"Segment values should be between 0 and 1\");\n return false;\n }\n\n if (\n segments.reduce<number>(\n (acc, { start }) => acc + (start === 0 ? 1 : 0),\n 0\n ) !== 1\n ) {\n showError(\"One segment should start from 0\");\n return false;\n }\n\n if (\n segments.reduce<number>((acc, { end }) => acc + (end === 1 ? 1 : 0), 0) !==\n 1\n ) {\n showError(\"One segment should end by 1\");\n return false;\n }\n\n if (segments.some(({ start, end }) => start >= end)) {\n showError(\"Segment start should be smaller than end\");\n return false;\n }\n\n for (let i = 1; i < segments.length; i++) {\n const currentSegment = segments[i];\n const prevSegment = segments[i - 1];\n if (prevSegment.end !== currentSegment.start) {\n showError(\"Previous segment end should be equal to next segment start\");\n return false;\n }\n }\n\n return true;\n};\n\nexport const getSegmentCoordinates = (\n { start, end }: Pick<DonutSegment, \"start\" | \"end\">,\n radius: number,\n segmentWidth: number\n) => {\n const innerRadius = radius - segmentWidth;\n\n const startAlpha = Math.round(start * 360);\n const endAlpha = Math.round(end * 360);\n const arc = endAlpha - startAlpha;\n\n const { x: startX, y: startY } = getCoordinateForArc(radius, startAlpha);\n const { x: startInnerX, y: startInnerY } = getCoordinateForArc(\n innerRadius,\n startAlpha,\n radius\n );\n\n const { x: endX, y: endY } = getCoordinateForArc(radius, endAlpha);\n const { x: endInnerX, y: endInnerY } = getCoordinateForArc(\n innerRadius,\n endAlpha,\n radius\n );\n return {\n startX,\n startY,\n endX,\n endY,\n startInnerX,\n startInnerY,\n endInnerX,\n endInnerY,\n arc,\n };\n};\n"],"names":["areSegmentsValid","segments","receivedSegments","start","end","showError","text","point","acc","i","currentSegment","getSegmentCoordinates","radius","segmentWidth","innerRadius","startAlpha","endAlpha","arc","startX","startY","getCoordinateForArc","startInnerX","startInnerY","endX","endY","endInnerX","endInnerY"],"mappings":";AAGa,MAAAA,IAAmB,CAC9BC,MACY;AACN,QAAAC,IAAmB,YAAYD,EAAS;AAAA,IAC5C,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAU,IAAID,CAAK,IAAIC,CAAG;AAAA,EACrC,CAAA,IACKC,IAAY,CAACC,MAAiB,QAAQ,MAAMA,GAAMJ,CAAgB;AAExE,MACED,EAAS;AAAA,IAAK,CAAC,EAAE,OAAAE,GAAO,KAAAC,QACtB,CAACD,GAAOC,CAAG,EAAE,KAAK,CAACG,MAAUA,IAAQ,KAAKA,IAAQ,CAAC;AAAA,EAAA;AAGrD,WAAAF,EAAU,0CAA0C,GAC7C;AAGT,MACEJ,EAAS;AAAA,IACP,CAACO,GAAK,EAAE,OAAAL,QAAYK,KAAOL,MAAU,IAAI,IAAI;AAAA,IAC7C;AAAA,QACI;AAEN,WAAAE,EAAU,iCAAiC,GACpC;AAGT,MACEJ,EAAS,OAAe,CAACO,GAAK,EAAE,KAAAJ,EAAI,MAAMI,KAAOJ,MAAQ,IAAI,IAAI,IAAI,CAAC,MACtE;AAEA,WAAAC,EAAU,6BAA6B,GAChC;AAGL,MAAAJ,EAAS,KAAK,CAAC,EAAE,OAAAE,GAAO,KAAAC,QAAUD,KAASC,CAAG;AAChD,WAAAC,EAAU,0CAA0C,GAC7C;AAGT,WAASI,IAAI,GAAGA,IAAIR,EAAS,QAAQQ,KAAK;AAClC,UAAAC,IAAiBT,EAASQ,CAAC;AAE7B,QADgBR,EAASQ,IAAI,CAAC,EAClB,QAAQC,EAAe;AACrC,aAAAL,EAAU,4DAA4D,GAC/D;AAAA,EAEX;AAEO,SAAA;AACT,GAEaM,IAAwB,CACnC,EAAE,OAAAR,GAAO,KAAAC,EAAI,GACbQ,GACAC,MACG;AACH,QAAMC,IAAcF,IAASC,GAEvBE,IAAa,KAAK,MAAMZ,IAAQ,GAAG,GACnCa,IAAW,KAAK,MAAMZ,IAAM,GAAG,GAC/Ba,IAAMD,IAAWD,GAEjB,EAAE,GAAGG,GAAQ,GAAGC,MAAWC,EAAoBR,GAAQG,CAAU,GACjE,EAAE,GAAGM,GAAa,GAAGC,EAAgB,IAAAF;AAAA,IACzCN;AAAA,IACAC;AAAA,IACAH;AAAA,EAAA,GAGI,EAAE,GAAGW,GAAM,GAAGC,MAASJ,EAAoBR,GAAQI,CAAQ,GAC3D,EAAE,GAAGS,GAAW,GAAGC,EAAc,IAAAN;AAAA,IACrCN;AAAA,IACAE;AAAA,IACAJ;AAAA,EAAA;AAEK,SAAA;AAAA,IACL,QAAAM;AAAA,IACA,QAAAC;AAAA,IACA,MAAAI;AAAA,IACA,MAAAC;AAAA,IACA,aAAAH;AAAA,IACA,aAAAC;AAAA,IACA,WAAAG;AAAA,IACA,WAAAC;AAAA,IACA,KAAAT;AAAA,EAAA;AAEJ;"}
|