@selfdecode/sd-component-library 4.0.119-test1 → 4.0.119
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/sd-component-library106.js +2 -2
- package/lib/sd-component-library108.js +2 -2
- package/lib/sd-component-library119.js +1 -1
- package/lib/sd-component-library120.js +1 -1
- package/lib/sd-component-library122.js +1 -1
- package/lib/sd-component-library128.js +1 -1
- package/lib/sd-component-library129.js +1 -1
- package/lib/sd-component-library131.js +1 -1
- package/lib/sd-component-library135.js +3 -3
- package/lib/sd-component-library136.js +1 -1
- package/lib/sd-component-library138.js +2 -2
- package/lib/sd-component-library16.js +1 -1
- package/lib/sd-component-library174.js +3 -3
- package/lib/sd-component-library175.js +1 -1
- package/lib/sd-component-library202.js +3 -57
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library206.js +25 -3
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +55 -23
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library212.js +62 -19
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +23 -3
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +21 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -64
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -23
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library233.js +1 -1
- package/lib/sd-component-library234.js +1 -1
- package/lib/sd-component-library236.js +1 -1
- package/lib/sd-component-library238.js +1 -1
- package/lib/sd-component-library240.js +2 -2
- package/lib/sd-component-library241.js +1 -1
- package/lib/sd-component-library242.js +2 -2
- package/lib/sd-component-library244.js +1 -1
- package/lib/sd-component-library245.js +1 -1
- package/lib/sd-component-library258.js +25 -21
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library26.js +1 -1
- package/lib/sd-component-library260.js +24 -22
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library262.js +21 -25
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +22 -24
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +30 -51
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +51 -30
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library267.js +54 -52
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +52 -54
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +122 -30
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +9 -20
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +41 -116
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +30 -10
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +17 -46
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +112 -109
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library276.js +49 -51
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +48 -87
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +52 -54
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +91 -48
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library282.js +10 -2
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +2 -2
- package/lib/sd-component-library284.js +2 -70
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +69 -101
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +91 -95
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +106 -10
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library316.js +47 -89
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +88 -20
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +34 -50
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library319.js +4 -34
- package/lib/sd-component-library319.js.map +1 -1
- package/lib/sd-component-library320.js +24 -4
- package/lib/sd-component-library320.js.map +1 -1
- package/lib/sd-component-library323.js +1 -1
- package/lib/sd-component-library53.js +3 -3
- package/lib/sd-component-library54.js +2 -2
- package/lib/sd-component-library55.js +2 -2
- package/lib/sd-component-library59.js +48 -51
- package/lib/sd-component-library59.js.map +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library63.js +1 -1
- package/lib/sd-component-library64.js +4 -4
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library66.js +1 -1
- package/lib/sd-component-library7.js +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,96 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { j as a } from "./sd-component-library198.js";
|
|
2
|
+
import { useState as S, useCallback as B } from "react";
|
|
3
|
+
import { Box as Y } from "rebass";
|
|
4
|
+
import { labelPaddingX as c, labelWidth as W } from "./sd-component-library230.js";
|
|
5
|
+
import { getCoordinateForArc as $ } from "./sd-component-library93.js";
|
|
6
|
+
import { ResponsiveTextV2 as z } from "./sd-component-library152.js";
|
|
7
|
+
const D = (j) => {
|
|
4
8
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
label: d,
|
|
10
|
+
color: p,
|
|
11
|
+
alpha: e,
|
|
12
|
+
radius: r,
|
|
13
|
+
horizontal: v,
|
|
14
|
+
pointerLength: m,
|
|
15
|
+
round: y,
|
|
16
|
+
pointY: i
|
|
17
|
+
} = j, [h, C] = S(0), [f, R] = S(0), T = B((t) => {
|
|
18
|
+
if (t) {
|
|
19
|
+
const { height: o, y: l } = t.getBoundingClientRect();
|
|
20
|
+
C(o), R(l);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
let { x: b, y: g } = $(
|
|
24
|
+
r + m,
|
|
25
|
+
e,
|
|
26
|
+
r
|
|
27
|
+
);
|
|
28
|
+
const s = e === 180, n = e < 180, u = e > 180;
|
|
29
|
+
if (v) {
|
|
30
|
+
const { x: t, y: o } = $(
|
|
31
|
+
r,
|
|
32
|
+
e,
|
|
33
|
+
r
|
|
34
|
+
);
|
|
35
|
+
b = t + m * (n ? -1 : 1), g = o;
|
|
36
|
+
}
|
|
37
|
+
if (!d)
|
|
38
|
+
return null;
|
|
39
|
+
let x = y || s ? `${c}px` : void 0;
|
|
40
|
+
if (!x && i) {
|
|
41
|
+
const t = f - h, o = f;
|
|
42
|
+
x = [
|
|
43
|
+
n || i > t,
|
|
44
|
+
u || i > t,
|
|
45
|
+
u || i < o,
|
|
46
|
+
n || i < o
|
|
47
|
+
].map((l) => l ? `${c}px` : "0").join(" ");
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ a.jsx(
|
|
50
|
+
Y,
|
|
19
51
|
{
|
|
20
|
-
|
|
21
|
-
|
|
52
|
+
sx: {
|
|
53
|
+
position: "absolute",
|
|
54
|
+
left: `${b}px`,
|
|
55
|
+
top: `${g}px`
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ a.jsx(
|
|
58
|
+
Y,
|
|
59
|
+
{
|
|
60
|
+
sx: {
|
|
61
|
+
boxSizing: "content-box",
|
|
62
|
+
position: "relative",
|
|
63
|
+
top: `calc(-${h}px)`,
|
|
64
|
+
left: s ? "-50%" : n ? "-100%" : void 0,
|
|
65
|
+
py: "7px",
|
|
66
|
+
px: `${c}px`,
|
|
67
|
+
borderColor: p,
|
|
68
|
+
borderWidth: "2px",
|
|
69
|
+
borderStyle: "solid",
|
|
70
|
+
borderRadius: x,
|
|
71
|
+
bg: "cl_white",
|
|
72
|
+
"& > div": {
|
|
73
|
+
maxWidth: s ? void 0 : `${W}px`
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
ref: T,
|
|
77
|
+
children: /* @__PURE__ */ a.jsx(
|
|
78
|
+
z,
|
|
79
|
+
{
|
|
80
|
+
fontSizeWeight: [[12, "semi-bold"]],
|
|
81
|
+
width: "max-content",
|
|
82
|
+
color: p !== "#CCD0DB" ? p : "cl_darkGrey",
|
|
83
|
+
textTransform: "uppercase",
|
|
84
|
+
letterSpacing: "1.8px",
|
|
85
|
+
children: d
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
)
|
|
22
90
|
}
|
|
23
91
|
);
|
|
24
92
|
};
|
|
25
93
|
export {
|
|
26
|
-
|
|
94
|
+
D as MatchedRangeLabelBox
|
|
27
95
|
};
|
|
28
96
|
//# sourceMappingURL=sd-component-library317.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library317.js","sources":["../src/components/meters/outline-meter
|
|
1
|
+
{"version":3,"file":"sd-component-library317.js","sources":["../src/components/meters/common-outline-meter-partials/matched-range-label-box/matched-range-label-box.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ResponsiveTextV2 } from \"../../../texts/responsive-text-v2\";\nimport { labelPaddingX, labelWidth } from \"../../outline-meter/contants\";\nimport { getCoordinateForArc } from \"../../outline-meter/utils\";\nimport { MatchedRangeLabelBoxProps as Props } from \"./interfaces\";\n\nexport const MatchedRangeLabelBox: React.FC<Props> = (props) => {\n const {\n label,\n color,\n alpha,\n radius,\n horizontal,\n pointerLength,\n round,\n pointY,\n } = props;\n\n const [textHeight, setTextHeight] = useState(0);\n const [textY, setTextY] = useState(0);\n\n const ref = useCallback((node: HTMLElement) => {\n if (node) {\n const { height, y } = node.getBoundingClientRect();\n setTextHeight(height);\n setTextY(y);\n }\n }, []);\n\n let { x: pointerEndX, y: pointerEndY } = getCoordinateForArc(\n radius + pointerLength,\n alpha,\n radius\n );\n\n const isOnTop = alpha === 180;\n const isOnLeft = alpha < 180;\n const isOnRight = alpha > 180;\n\n if (horizontal) {\n const { x: pointerStartX, y: pointerStartY } = getCoordinateForArc(\n radius,\n alpha,\n radius\n );\n\n pointerEndX = pointerStartX + pointerLength * (isOnLeft ? -1 : 1);\n pointerEndY = pointerStartY;\n }\n\n if (!label) return null;\n\n let borderRadius = round || isOnTop ? `${labelPaddingX}px` : undefined;\n if (!borderRadius && pointY) {\n const textTopY = textY - textHeight;\n const textBottomY = textY;\n\n borderRadius = [\n isOnLeft || pointY > textTopY,\n isOnRight || pointY > textTopY,\n isOnRight || pointY < textBottomY,\n isOnLeft || pointY < textBottomY,\n ]\n .map((flag) => (flag ? `${labelPaddingX}px` : \"0\"))\n .join(\" \");\n }\n\n return (\n <Box\n sx={{\n position: \"absolute\",\n left: `${pointerEndX}px`,\n top: `${pointerEndY}px`,\n }}\n >\n <Box\n sx={{\n boxSizing: \"content-box\",\n position: \"relative\",\n top: `calc(-${textHeight}px)`,\n left: isOnTop ? \"-50%\" : isOnLeft ? \"-100%\" : undefined,\n py: \"7px\",\n px: `${labelPaddingX}px`,\n borderColor: color,\n borderWidth: \"2px\",\n borderStyle: \"solid\",\n borderRadius,\n bg: \"cl_white\",\n \"& > div\": {\n maxWidth: isOnTop ? undefined : `${labelWidth}px`,\n },\n }}\n ref={ref}\n >\n <ResponsiveTextV2\n fontSizeWeight={[[12, \"semi-bold\"]]}\n width=\"max-content\"\n color={color !== \"#CCD0DB\" ? color : \"cl_darkGrey\"}\n textTransform=\"uppercase\"\n letterSpacing=\"1.8px\"\n >\n {label}\n </ResponsiveTextV2>\n </Box>\n </Box>\n );\n};\n"],"names":["MatchedRangeLabelBox","props","label","color","alpha","radius","horizontal","pointerLength","round","pointY","textHeight","setTextHeight","useState","textY","setTextY","ref","useCallback","node","height","y","pointerEndX","pointerEndY","getCoordinateForArc","isOnTop","isOnLeft","isOnRight","pointerStartX","pointerStartY","borderRadius","labelPaddingX","textTopY","textBottomY","flag","jsx","Box","labelWidth","ResponsiveTextV2"],"mappings":";;;;;;AASa,MAAAA,IAAwC,CAACC,MAAU;AACxD,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAR,GAEE,CAACS,GAAYC,CAAa,IAAIC,EAAS,CAAC,GACxC,CAACC,GAAOC,CAAQ,IAAIF,EAAS,CAAC,GAE9BG,IAAMC,EAAY,CAACC,MAAsB;AAC7C,QAAIA,GAAM;AACR,YAAM,EAAE,QAAAC,GAAQ,GAAAC,EAAE,IAAIF,EAAK,sBAAsB;AACjD,MAAAN,EAAcO,CAAM,GACpBJ,EAASK,CAAC;AAAA,IACZ;AAAA,EACF,GAAG,CAAE,CAAA;AAEL,MAAI,EAAE,GAAGC,GAAa,GAAGC,EAAgB,IAAAC;AAAA,IACvCjB,IAASE;AAAA,IACTH;AAAA,IACAC;AAAA,EAAA;AAGF,QAAMkB,IAAUnB,MAAU,KACpBoB,IAAWpB,IAAQ,KACnBqB,IAAYrB,IAAQ;AAE1B,MAAIE,GAAY;AACd,UAAM,EAAE,GAAGoB,GAAe,GAAGC,EAAkB,IAAAL;AAAA,MAC7CjB;AAAA,MACAD;AAAA,MACAC;AAAA,IAAA;AAGY,IAAAe,IAAAM,IAAgBnB,KAAiBiB,IAAW,KAAK,IACjDH,IAAAM;AAAA,EAChB;AAEA,MAAI,CAACzB;AAAc,WAAA;AAEnB,MAAI0B,IAAepB,KAASe,IAAU,GAAGM,CAAa,OAAO;AACzD,MAAA,CAACD,KAAgBnB,GAAQ;AAC3B,UAAMqB,IAAWjB,IAAQH,GACnBqB,IAAclB;AAEL,IAAAe,IAAA;AAAA,MACbJ,KAAYf,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|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ref: r
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
!l && !g && /* @__PURE__ */ t.jsx(
|
|
39
|
-
b,
|
|
40
|
-
{
|
|
41
|
-
...e,
|
|
42
|
-
radius: R,
|
|
43
|
-
color: u.colors.cl_lightGrey,
|
|
44
|
-
alpha: h,
|
|
45
|
-
horizontal: j(e)
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
] });
|
|
49
|
-
}
|
|
50
|
-
);
|
|
2
|
+
const h = (n) => {
|
|
3
|
+
const {
|
|
4
|
+
color: s,
|
|
5
|
+
innerCircleRadius: $,
|
|
6
|
+
innerCircleStrokeWidth: d,
|
|
7
|
+
dx: i,
|
|
8
|
+
dy: r,
|
|
9
|
+
radius: e,
|
|
10
|
+
tipX: l,
|
|
11
|
+
tipY: o,
|
|
12
|
+
needleWidth: c
|
|
13
|
+
} = n;
|
|
14
|
+
return /* @__PURE__ */ t.jsxs("g", { children: [
|
|
15
|
+
/* @__PURE__ */ t.jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: `M${l - i},${o - r} A${c / 2},${c / 2} 0 0,0 ${l + i},${o + r} L${e + i},${e + r} L${e - i},${e - r} Z`,
|
|
19
|
+
fill: s
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ t.jsx(
|
|
23
|
+
"circle",
|
|
24
|
+
{
|
|
25
|
+
cx: e,
|
|
26
|
+
cy: e,
|
|
27
|
+
r: $ + d,
|
|
28
|
+
strokeWidth: d,
|
|
29
|
+
stroke: s,
|
|
30
|
+
fill: "white"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
51
35
|
export {
|
|
52
|
-
|
|
36
|
+
h as BaseNeedle
|
|
53
37
|
};
|
|
54
38
|
//# sourceMappingURL=sd-component-library318.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library318.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library318.js","sources":["../src/components/meters/outline-meter/partials/base-needle/base-needle.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { BaseNeedleProps as Props } from \"./interfaces\";\n\nexport const BaseNeedle: React.FC<Props> = (props) => {\n const {\n color,\n innerCircleRadius,\n innerCircleStrokeWidth,\n dx,\n dy,\n radius,\n tipX,\n tipY,\n needleWidth,\n } = props;\n\n return (\n <g>\n <path\n d={`M${tipX - dx},${tipY - dy} A${needleWidth / 2},${\n needleWidth / 2\n } 0 0,0 ${tipX + dx},${tipY + dy} L${radius + dx},${radius + dy} L${\n radius - dx\n },${radius - dy} Z`}\n fill={color}\n />\n <circle\n cx={radius}\n cy={radius}\n r={innerCircleRadius + innerCircleStrokeWidth}\n strokeWidth={innerCircleStrokeWidth}\n stroke={color}\n fill=\"white\"\n />\n </g>\n );\n};\n"],"names":["BaseNeedle","props","color","innerCircleRadius","innerCircleStrokeWidth","dx","dy","radius","tipX","tipY","needleWidth","jsx"],"mappings":";AAIa,MAAAA,IAA8B,CAACC,MAAU;AAC9C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,IAAAC;AAAA,IACA,IAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,EACE,IAAAT;AAEJ,gCACG,KACC,EAAA,UAAA;AAAA,IAAAU,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIH,IAAOH,CAAE,IAAII,IAAOH,CAAE,KAAKI,IAAc,CAAC,IAC/CA,IAAc,CAChB,UAAUF,IAAOH,CAAE,IAAII,IAAOH,CAAE,KAAKC,IAASF,CAAE,IAAIE,IAASD,CAAE,KAC7DC,IAASF,CACX,IAAIE,IAASD,CAAE;AAAA,QACf,MAAMJ;AAAA,MAAA;AAAA,IACR;AAAA,IACAS,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAIJ;AAAA,QACJ,IAAIA;AAAA,QACJ,GAAGJ,IAAoBC;AAAA,QACvB,aAAaA;AAAA,QACb,QAAQF;AAAA,QACR,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
color: s,
|
|
5
|
-
innerCircleRadius: $,
|
|
6
|
-
innerCircleStrokeWidth: d,
|
|
7
|
-
dx: i,
|
|
8
|
-
dy: r,
|
|
9
|
-
radius: e,
|
|
10
|
-
tipX: l,
|
|
11
|
-
tipY: o,
|
|
12
|
-
needleWidth: c
|
|
13
|
-
} = n;
|
|
14
|
-
return /* @__PURE__ */ t.jsxs("g", { children: [
|
|
15
|
-
/* @__PURE__ */ t.jsx(
|
|
16
|
-
"path",
|
|
17
|
-
{
|
|
18
|
-
d: `M${l - i},${o - r} A${c / 2},${c / 2} 0 0,0 ${l + i},${o + r} L${e + i},${e + r} L${e - i},${e - r} Z`,
|
|
19
|
-
fill: s
|
|
20
|
-
}
|
|
21
|
-
),
|
|
22
|
-
/* @__PURE__ */ t.jsx(
|
|
23
|
-
"circle",
|
|
24
|
-
{
|
|
25
|
-
cx: e,
|
|
26
|
-
cy: e,
|
|
27
|
-
r: $ + d,
|
|
28
|
-
strokeWidth: d,
|
|
29
|
-
stroke: s,
|
|
30
|
-
fill: "white"
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
] });
|
|
1
|
+
const p = (c, r, n, t) => {
|
|
2
|
+
const o = c - (r - 1) * n, s = t / r, e = (t + 1) / r, a = (360 - c) / 2 + n * t + o * s, S = a + o * (e - s);
|
|
3
|
+
return { rangeArcStart: a, rangeArcEnd: S };
|
|
34
4
|
};
|
|
35
5
|
export {
|
|
36
|
-
|
|
6
|
+
p as getRangeProperties
|
|
37
7
|
};
|
|
38
8
|
//# sourceMappingURL=sd-component-library319.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library319.js","sources":["../src/components/meters/outline-meter/
|
|
1
|
+
{"version":3,"file":"sd-component-library319.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/utils.ts"],"sourcesContent":["export const getRangeProperties = (\n arc: number,\n totalRanges: number,\n distanceBetweenRanges: number,\n idx: number\n) => {\n const arcForRanges = arc - (totalRanges - 1) * distanceBetweenRanges;\n\n const start = idx / totalRanges;\n const end = (idx + 1) / totalRanges;\n\n const arcStart = (360 - arc) / 2; // deg\n\n const rangeArcStart =\n arcStart + distanceBetweenRanges * idx + arcForRanges * start;\n\n const rangeArcEnd = rangeArcStart + arcForRanges * (end - start);\n\n return { rangeArcStart, rangeArcEnd };\n};\n"],"names":["getRangeProperties","arc","totalRanges","distanceBetweenRanges","idx","arcForRanges","start","end","rangeArcStart","rangeArcEnd"],"mappings":"AAAO,MAAMA,IAAqB,CAChCC,GACAC,GACAC,GACAC,MACG;AACG,QAAAC,IAAeJ,KAAOC,IAAc,KAAKC,GAEzCG,IAAQF,IAAMF,GACdK,KAAOH,IAAM,KAAKF,GAIlBM,KAFY,MAAMP,KAAO,IAGlBE,IAAwBC,IAAMC,IAAeC,GAEpDG,IAAcD,IAAgBH,KAAgBE,IAAMD;AAEnD,SAAA,EAAE,eAAAE,GAAe,aAAAC;AAC1B;"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { j as x } from "./sd-component-library198.js";
|
|
2
|
+
import { getInnerX as u, degToRad as r, getInnerY as i } from "./sd-component-library93.js";
|
|
3
|
+
const j = (p) => {
|
|
4
|
+
const {
|
|
5
|
+
startX: $,
|
|
6
|
+
startY: e,
|
|
7
|
+
endX: a,
|
|
8
|
+
endY: d,
|
|
9
|
+
radius: n,
|
|
10
|
+
color: A,
|
|
11
|
+
width: t,
|
|
12
|
+
roundStart: l = !0,
|
|
13
|
+
roundEnd: I = !0,
|
|
14
|
+
startAlpha: o,
|
|
15
|
+
endAlpha: s
|
|
16
|
+
} = p, c = s - o, m = u($, r(o), t), X = i(e, r(o), t), Y = u(a, r(s), t), h = i(d, r(s), t);
|
|
17
|
+
return /* @__PURE__ */ x.jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: `M${$},${e} A${n},${n} 0 ${c > 180 ? "1" : "0"},1 ${a},${d} ${I ? `A${t / 2},${t / 2} 0 0,1 ` : "L"}${Y},${h} A${n - t},${n - t} 0 ${c > 180 ? "1" : "0"},0 ${m},${X} ${l ? `A${t / 2},${t / 2} 0 0,1 ` : "L"}${$},${e}`,
|
|
21
|
+
fill: A
|
|
22
|
+
}
|
|
23
|
+
);
|
|
4
24
|
};
|
|
5
25
|
export {
|
|
6
|
-
|
|
26
|
+
j as BaseOutlineArc
|
|
7
27
|
};
|
|
8
28
|
//# sourceMappingURL=sd-component-library320.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library320.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library320.js","sources":["../src/components/meters/outline-meter/partials/base-outline-arc/base-outline-arc.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { degToRad, getInnerX, getInnerY } from \"../../utils\";\nimport { BaseOutlineArcProps as Props } from \"./interfaces\";\n\nexport const BaseOutlineArc: React.FC<Props> = (props) => {\n const {\n startX,\n startY,\n endX,\n endY,\n radius,\n color,\n width,\n roundStart = true,\n roundEnd = true,\n startAlpha,\n endAlpha,\n } = props;\n\n const arc = endAlpha - startAlpha;\n\n const startInnerX = getInnerX(startX, degToRad(startAlpha), width);\n const startInnerY = getInnerY(startY, degToRad(startAlpha), width);\n\n const endInnerX = getInnerX(endX, degToRad(endAlpha), width);\n const endInnerY = getInnerY(endY, degToRad(endAlpha), width);\n\n return (\n <path\n d={`M${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY} ${\n roundEnd ? `A${width / 2},${width / 2} 0 0,1 ` : \"L\"\n }${endInnerX},${endInnerY} A${radius - width},${radius - width} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },0 ${startInnerX},${startInnerY} ${\n roundStart ? `A${width / 2},${width / 2} 0 0,1 ` : \"L\"\n }${startX},${startY}`}\n fill={color}\n />\n );\n};\n"],"names":["BaseOutlineArc","props","startX","startY","endX","endY","radius","color","width","roundStart","roundEnd","startAlpha","endAlpha","arc","startInnerX","getInnerX","degToRad","startInnerY","getInnerY","endInnerX","endInnerY","jsx"],"mappings":";;AAKa,MAAAA,IAAkC,CAACC,MAAU;AAClD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,YAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAX,GAEEY,IAAMD,IAAWD,GAEjBG,IAAcC,EAAUb,GAAQc,EAASL,CAAU,GAAGH,CAAK,GAC3DS,IAAcC,EAAUf,GAAQa,EAASL,CAAU,GAAGH,CAAK,GAE3DW,IAAYJ,EAAUX,GAAMY,EAASJ,CAAQ,GAAGJ,CAAK,GACrDY,IAAYF,EAAUb,GAAMW,EAASJ,CAAQ,GAAGJ,CAAK;AAGzD,SAAAa,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,GAAG,IAAInB,CAAM,IAAIC,CAAM,KAAKG,CAAM,IAAIA,CAAM,MAC1CO,IAAM,MAAM,MAAM,GACpB,MAAMT,CAAI,IAAIC,CAAI,IAChBK,IAAW,IAAIF,IAAQ,CAAC,IAAIA,IAAQ,CAAC,YAAY,GACnD,GAAGW,CAAS,IAAIC,CAAS,KAAKd,IAASE,CAAK,IAAIF,IAASE,CAAK,MAC5DK,IAAM,MAAM,MAAM,GACpB,MAAMC,CAAW,IAAIG,CAAW,IAC9BR,IAAa,IAAID,IAAQ,CAAC,IAAIA,IAAQ,CAAC,YAAY,GACrD,GAAGN,CAAM,IAAIC,CAAM;AAAA,MACnB,MAAMI;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./sd-component-library198.js";
|
|
2
|
-
import { getSelectedRangeText as l } from "./sd-component-
|
|
2
|
+
import { getSelectedRangeText as l } from "./sd-component-library285.js";
|
|
3
3
|
import { FourteenRegular as n } from "./sd-component-library146.js";
|
|
4
4
|
import { FourteenSb as p } from "./sd-component-library147.js";
|
|
5
5
|
import { BaseGridContainer as i } from "./sd-component-library37.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "./sd-component-library198.js";
|
|
2
|
-
import { BaseBooleanFeedback as m } from "./sd-component-
|
|
2
|
+
import { BaseBooleanFeedback as m } from "./sd-component-library214.js";
|
|
3
3
|
import { IconButton as n } from "./sd-component-library23.js";
|
|
4
|
-
import { ReactComponent as c } from "./sd-component-
|
|
5
|
-
import { ReactComponent as u } from "./sd-component-
|
|
4
|
+
import { ReactComponent as c } from "./sd-component-library215.js";
|
|
5
|
+
import { ReactComponent as u } from "./sd-component-library216.js";
|
|
6
6
|
const f = (i) => {
|
|
7
7
|
const { title: s, onPositiveFeedback: r, onNegativeFeedback: d, optionSelected: e } = i, a = (o) => /* @__PURE__ */ t.jsx(n, { onClick: o, "data-testid": "thumbs-up-button", children: /* @__PURE__ */ t.jsx(
|
|
8
8
|
c,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./sd-component-library198.js";
|
|
2
2
|
import { useHover as x } from "./sd-component-library3.js";
|
|
3
|
-
import { BaseFeedbackContainer as f } from "./sd-component-
|
|
3
|
+
import { BaseFeedbackContainer as f } from "./sd-component-library212.js";
|
|
4
4
|
import { BaseGridContainer as j } from "./sd-component-library37.js";
|
|
5
|
-
import { BaseFeedbackButton as k } from "./sd-component-
|
|
5
|
+
import { BaseFeedbackButton as k } from "./sd-component-library213.js";
|
|
6
6
|
const C = ({
|
|
7
7
|
questionText: t,
|
|
8
8
|
options: a,
|
|
@@ -2,9 +2,9 @@ import { j as o } from "./sd-component-library198.js";
|
|
|
2
2
|
import { Box as l } from "rebass";
|
|
3
3
|
import { useHover as k, useBreakPoints as g } from "./sd-component-library3.js";
|
|
4
4
|
import { isTouchScreen as C } from "./sd-component-library4.js";
|
|
5
|
-
import { BaseFeedbackContainer as S } from "./sd-component-
|
|
5
|
+
import { BaseFeedbackContainer as S } from "./sd-component-library212.js";
|
|
6
6
|
import { GridContainerV2 as y } from "./sd-component-library40.js";
|
|
7
|
-
import { BaseFeedbackButton as a } from "./sd-component-
|
|
7
|
+
import { BaseFeedbackButton as a } from "./sd-component-library213.js";
|
|
8
8
|
import { FrMaxContainer as x } from "./sd-component-library39.js";
|
|
9
9
|
import { ReactComponent as B } from "./sd-component-library178.js";
|
|
10
10
|
const D = ({
|
|
@@ -1,121 +1,118 @@
|
|
|
1
1
|
import { j as n } from "./sd-component-library198.js";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as w, useCallback as y } from "react";
|
|
3
3
|
import { Select as F } from "@rebass/forms";
|
|
4
|
-
import { getNoTranslateClass as
|
|
4
|
+
import { getNoTranslateClass as g } from "./sd-component-library114.js";
|
|
5
5
|
import { InputContainer as M } from "./sd-component-library60.js";
|
|
6
|
-
const
|
|
7
|
-
defaultOptionObject:
|
|
6
|
+
const V = ({
|
|
7
|
+
defaultOptionObject: e,
|
|
8
8
|
hideDefaultOnSelect: x,
|
|
9
9
|
options: t,
|
|
10
|
-
value:
|
|
10
|
+
value: o,
|
|
11
11
|
onChange: a,
|
|
12
|
-
disabled:
|
|
12
|
+
disabled: l,
|
|
13
13
|
disabledTextValue: i,
|
|
14
14
|
translateSelect: c = !0,
|
|
15
15
|
translateDefaultOption: m,
|
|
16
16
|
onFocus: C,
|
|
17
|
-
id:
|
|
17
|
+
id: u,
|
|
18
18
|
textTransform: h = "none",
|
|
19
|
-
defaultOptionColor:
|
|
19
|
+
defaultOptionColor: p = "cl_grey"
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
() => (
|
|
23
|
-
[t,
|
|
24
|
-
),
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
({ title:
|
|
28
|
-
));
|
|
29
|
-
const L = r.find(
|
|
30
|
-
({ title: f }) => f.trim().replaceAll(/\s{2,}/g, " ") === e
|
|
21
|
+
const s = w(
|
|
22
|
+
() => (e ? [e] : []).concat(t),
|
|
23
|
+
[t, e]
|
|
24
|
+
), v = y(
|
|
25
|
+
(r) => {
|
|
26
|
+
const N = s.find(
|
|
27
|
+
({ title: _ }) => _.trim().replaceAll(/\s{2,}/g, " ") === r
|
|
31
28
|
);
|
|
32
|
-
a(
|
|
29
|
+
a(N);
|
|
33
30
|
},
|
|
34
|
-
[a,
|
|
35
|
-
),
|
|
31
|
+
[a, s]
|
|
32
|
+
), f = !t.length, d = !!e, S = g(
|
|
36
33
|
m !== !0 && !c || m === !1
|
|
37
|
-
),
|
|
34
|
+
), j = g(!c), L = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
|
|
38
35
|
return /* @__PURE__ */ n.jsx(
|
|
39
36
|
F,
|
|
40
37
|
{
|
|
41
|
-
value:
|
|
42
|
-
onChange: (
|
|
38
|
+
value: f ? i : o.title.trim(),
|
|
39
|
+
onChange: (r) => v(r.target.value),
|
|
43
40
|
variant: "_inputs.v2",
|
|
44
41
|
sx: {
|
|
45
42
|
pr: "16px",
|
|
46
43
|
textTransform: h,
|
|
47
44
|
cursor: "inherit",
|
|
48
45
|
borderBottomColor: "inherit",
|
|
49
|
-
...
|
|
46
|
+
...p && o.value === null ? { color: p } : {},
|
|
50
47
|
// to override default styles for selector arrow
|
|
51
48
|
"& + svg": {
|
|
52
|
-
fill:
|
|
53
|
-
transform: `translate(10px, ${
|
|
49
|
+
fill: l ? "cl_lightGrey" : "cl_darkGrey",
|
|
50
|
+
transform: `translate(10px, ${L ? 0 : 5}px) scale(.78)`,
|
|
54
51
|
path: {
|
|
55
52
|
d: "path('M12,8.6L6.72,3.29C6.32,2.9,5.68,2.9,5.29,3.29C4.90,3.69,4.9,4.33,5.29,4.73L11.23,10.7C11.44,10.91,11.72,11.01,12,11C12.27,11.01,12.55,10.91,12.76,10.7L18.7,4.73C19.09,4.33,19.09,3.69,18.7,3.29C18.31,2.9,17.67,2.9,17.27,3.29Z M12,8.6')"
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
55
|
},
|
|
59
|
-
id:
|
|
60
|
-
disabled:
|
|
56
|
+
id: u,
|
|
57
|
+
disabled: l,
|
|
61
58
|
onFocus: C,
|
|
62
|
-
children:
|
|
59
|
+
children: f ? /* @__PURE__ */ n.jsx("option", { "data-test": "disabled-option", children: i }, "disabledTextValue") : s.slice(
|
|
63
60
|
// should default option be hidden?
|
|
64
|
-
|
|
65
|
-
).map((
|
|
61
|
+
d && x && o.value !== null ? 1 : 0
|
|
62
|
+
).map((r) => /* @__PURE__ */ n.jsx(
|
|
66
63
|
"option",
|
|
67
64
|
{
|
|
68
65
|
"data-testid": "selector-option",
|
|
69
|
-
className:
|
|
70
|
-
children:
|
|
66
|
+
className: r.value === null ? S : j,
|
|
67
|
+
children: r.title
|
|
71
68
|
},
|
|
72
|
-
|
|
69
|
+
r.id
|
|
73
70
|
))
|
|
74
71
|
}
|
|
75
72
|
);
|
|
76
73
|
}, E = ({
|
|
77
|
-
defaultOptionObject:
|
|
74
|
+
defaultOptionObject: e,
|
|
78
75
|
hideDefaultOnSelect: x,
|
|
79
76
|
options: t,
|
|
80
|
-
value:
|
|
77
|
+
value: o,
|
|
81
78
|
onChange: a,
|
|
82
|
-
disabled:
|
|
79
|
+
disabled: l,
|
|
83
80
|
disabledTextValue: i,
|
|
84
81
|
translateSelect: c,
|
|
85
82
|
translateDefaultOption: m,
|
|
86
83
|
onFocus: C,
|
|
87
|
-
id:
|
|
84
|
+
id: u,
|
|
88
85
|
textTransform: h,
|
|
89
|
-
defaultOptionColor:
|
|
90
|
-
...
|
|
86
|
+
defaultOptionColor: p,
|
|
87
|
+
...s
|
|
91
88
|
}) => /* @__PURE__ */ n.jsx(
|
|
92
89
|
M,
|
|
93
90
|
{
|
|
94
|
-
id:
|
|
95
|
-
cursor:
|
|
96
|
-
...
|
|
91
|
+
id: u,
|
|
92
|
+
cursor: l ? "not-allowed" : "pointer",
|
|
93
|
+
...s,
|
|
97
94
|
children: /* @__PURE__ */ n.jsx(
|
|
98
|
-
|
|
95
|
+
V,
|
|
99
96
|
{
|
|
100
|
-
defaultOptionObject:
|
|
97
|
+
defaultOptionObject: e,
|
|
101
98
|
hideDefaultOnSelect: x,
|
|
102
99
|
options: t,
|
|
103
|
-
value:
|
|
100
|
+
value: o,
|
|
104
101
|
onChange: a,
|
|
105
|
-
disabled:
|
|
102
|
+
disabled: l,
|
|
106
103
|
disabledTextValue: i,
|
|
107
104
|
translateSelect: c,
|
|
108
105
|
translateDefaultOption: m,
|
|
109
106
|
onFocus: C,
|
|
110
|
-
id:
|
|
107
|
+
id: u,
|
|
111
108
|
textTransform: h,
|
|
112
|
-
defaultOptionColor:
|
|
109
|
+
defaultOptionColor: p
|
|
113
110
|
}
|
|
114
111
|
)
|
|
115
112
|
}
|
|
116
113
|
);
|
|
117
114
|
export {
|
|
118
|
-
|
|
115
|
+
V as FormV2Selector,
|
|
119
116
|
E as FormV2SelectorWithContainer
|
|
120
117
|
};
|
|
121
118
|
//# sourceMappingURL=sd-component-library59.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library59.js","sources":["../src/components/forms-v2/form-v2-selector/form-v2-selector.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\n\nimport { Select } from \"@rebass/forms\";\nimport { SxProps } from \"rebass\";\n\nimport { SelectorOptionV2 } from \"../../selectors\";\nimport { getNoTranslateClass } from \"../../selectors/selector/selector\";\nimport { InputContainer, InputContainerProps } from \"../input-container\";\nimport { FormV2SelectorProps as Props } from \"./interfaces\";\n\nexport const FormV2Selector = <T extends string = string>({\n defaultOptionObject,\n hideDefaultOnSelect,\n options,\n value: selection,\n onChange,\n disabled,\n disabledTextValue,\n translateSelect = true,\n translateDefaultOption,\n onFocus,\n id,\n textTransform = \"none\",\n defaultOptionColor = \"cl_grey\",\n}: Props<T>) => {\n const allOptions = useMemo<SelectorOptionV2<T | null>[]>(\n () =>\n (\n (defaultOptionObject\n ? [defaultOptionObject]\n : []) as SelectorOptionV2<T | null>[]\n ).concat(options),\n [options, defaultOptionObject]\n );\n\n const onSelect = useCallback(\n (selectionString: string) => {\n
|
|
1
|
+
{"version":3,"file":"sd-component-library59.js","sources":["../src/components/forms-v2/form-v2-selector/form-v2-selector.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\n\nimport { Select } from \"@rebass/forms\";\nimport { SxProps } from \"rebass\";\n\nimport { SelectorOptionV2 } from \"../../selectors\";\nimport { getNoTranslateClass } from \"../../selectors/selector/selector\";\nimport { InputContainer, InputContainerProps } from \"../input-container\";\nimport { FormV2SelectorProps as Props } from \"./interfaces\";\n\nexport const FormV2Selector = <T extends string = string>({\n defaultOptionObject,\n hideDefaultOnSelect,\n options,\n value: selection,\n onChange,\n disabled,\n disabledTextValue,\n translateSelect = true,\n translateDefaultOption,\n onFocus,\n id,\n textTransform = \"none\",\n defaultOptionColor = \"cl_grey\",\n}: Props<T>) => {\n const allOptions = useMemo<SelectorOptionV2<T | null>[]>(\n () =>\n (\n (defaultOptionObject\n ? [defaultOptionObject]\n : []) as SelectorOptionV2<T | null>[]\n ).concat(options),\n [options, defaultOptionObject]\n );\n\n const onSelect = useCallback(\n (selectionString: string) => {\n const newSelection = allOptions.find(\n ({ title }) =>\n title.trim().replaceAll(/\\s{2,}/g, \" \") === selectionString\n )!;\n onChange(newSelection);\n },\n [onChange, allOptions]\n );\n\n const noOptionsToSelect = !options.length;\n const hasDefaultValue = !!defaultOptionObject;\n\n const defaultOptionClassName = getNoTranslateClass(\n (translateDefaultOption !== true && !translateSelect) ||\n translateDefaultOption === false\n );\n const regularOptionClassName = getNoTranslateClass(!translateSelect);\n\n const isFirefox = navigator.userAgent.toLowerCase().indexOf(\"firefox\") > -1;\n\n return (\n <Select\n value={noOptionsToSelect ? disabledTextValue : selection.title.trim()}\n onChange={(event) => onSelect(event.target.value)}\n variant=\"_inputs.v2\"\n sx={\n {\n pr: \"16px\",\n textTransform,\n cursor: \"inherit\",\n borderBottomColor: \"inherit\",\n ...(defaultOptionColor && selection.value === null\n ? { color: defaultOptionColor }\n : {}),\n // to override default styles for selector arrow\n \"& + svg\": {\n fill: disabled ? \"cl_lightGrey\" : \"cl_darkGrey\",\n transform: `translate(10px, ${isFirefox ? 0 : 5}px) scale(.78)`,\n path: {\n d: \"path('M12,8.6L6.72,3.29C6.32,2.9,5.68,2.9,5.29,3.29C4.90,3.69,4.9,4.33,5.29,4.73L11.23,10.7C11.44,10.91,11.72,11.01,12,11C12.27,11.01,12.55,10.91,12.76,10.7L18.7,4.73C19.09,4.33,19.09,3.69,18.7,3.29C18.31,2.9,17.67,2.9,17.27,3.29Z M12,8.6')\",\n },\n },\n } as SxProps[\"sx\"]\n }\n {...{ id, disabled, onFocus }}\n >\n {noOptionsToSelect ? (\n <option key=\"disabledTextValue\" data-test=\"disabled-option\">\n {disabledTextValue}\n </option>\n ) : (\n allOptions\n .slice(\n // should default option be hidden?\n hasDefaultValue && hideDefaultOnSelect && selection.value !== null\n ? 1\n : 0\n )\n .map((option) => (\n <option\n key={option.id}\n data-testid=\"selector-option\"\n className={\n option.value === null\n ? defaultOptionClassName\n : regularOptionClassName\n }\n >\n {option.title}\n </option>\n ))\n )}\n </Select>\n );\n};\n\nexport const FormV2SelectorWithContainer = <T extends string = string>({\n defaultOptionObject,\n hideDefaultOnSelect,\n options,\n value,\n onChange,\n disabled,\n disabledTextValue,\n translateSelect,\n translateDefaultOption,\n onFocus,\n id,\n textTransform,\n defaultOptionColor,\n ...containerProps\n}: Props<T> & InputContainerProps) => (\n <InputContainer\n id={id}\n cursor={disabled ? \"not-allowed\" : \"pointer\"}\n {...containerProps}\n >\n <FormV2Selector\n {...{\n defaultOptionObject,\n hideDefaultOnSelect,\n options,\n value,\n onChange,\n disabled,\n disabledTextValue,\n translateSelect,\n translateDefaultOption,\n onFocus,\n id,\n textTransform,\n defaultOptionColor,\n }}\n />\n </InputContainer>\n);\n"],"names":["FormV2Selector","defaultOptionObject","hideDefaultOnSelect","options","selection","onChange","disabled","disabledTextValue","translateSelect","translateDefaultOption","onFocus","id","textTransform","defaultOptionColor","allOptions","useMemo","onSelect","useCallback","selectionString","newSelection","title","noOptionsToSelect","hasDefaultValue","defaultOptionClassName","getNoTranslateClass","regularOptionClassName","isFirefox","jsx","Select","event","option","FormV2SelectorWithContainer","value","containerProps","InputContainer"],"mappings":";;;;;AAUO,MAAMA,IAAiB,CAA4B;AAAA,EACxD,qBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAOC;AAAA,EACP,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,wBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,IAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,oBAAAC,IAAqB;AACvB,MAAgB;AACd,QAAMC,IAAaC;AAAA,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