@selfdecode/sd-component-library 4.0.143 → 4.0.144
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/links/link/interfaces.d.ts +1 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- package/lib/sd-component-library102.js +2 -2
- package/lib/sd-component-library104.js +2 -2
- package/lib/sd-component-library106.js +2 -2
- package/lib/sd-component-library112.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library127.js +1 -1
- 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-library16.js +1 -1
- package/lib/sd-component-library167.js +1 -1
- 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 +3 -2
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +2 -30
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +21 -590
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +599 -3
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +24 -55
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +55 -24
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +18 -21
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +64 -3
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -3
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +39 -17
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +127 -62
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -23
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +14 -40
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -14
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +2 -2
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +65 -3
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -129
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +3 -13
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +45 -64
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +52 -3
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +17 -3
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +19 -50
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +3 -46
- 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-library225.js +3 -26
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +31 -3
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +19 -31
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +20 -19
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +28 -20
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +32 -27
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +128 -32
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +43 -3
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +46 -128
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +7 -42
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +3 -47
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +21 -8
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +107 -19
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +47 -20
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +22 -46
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +1 -1
- package/lib/sd-component-library240.js +51 -73
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +64 -2
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +41 -62
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +13 -43
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +47 -12
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +41 -21
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +22 -104
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +17 -43
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +20 -24
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +73 -51
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +2 -325
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +325 -5
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +5 -41
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +25 -26
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +21 -25
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library256.js +22 -24
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library258.js +25 -21
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +24 -22
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library265.js +30 -9
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +17 -47
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +123 -88
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +120 -90
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +10 -30
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +46 -17
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +9 -125
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +46 -117
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +90 -10
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +90 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library286.js +4 -4
- package/lib/sd-component-library290.js +2 -58
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +8 -2
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +327 -7
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +48 -325
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +56 -49
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library296.js +88 -20
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +50 -34
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +33 -91
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +25 -51
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library303.js +1 -1
- package/lib/sd-component-library317.js +6 -90
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +90 -6
- package/lib/sd-component-library318.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-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library64.js +1 -1
- 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-library81.js +9 -7
- package/lib/sd-component-library81.js.map +1 -1
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library86.js +6 -6
- package/lib/sd-component-library87.js +2 -2
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +5 -5
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library92.js +6 -6
- package/lib/sd-component-library93.js +1 -1
- package/lib/sd-component-library94.js +7 -7
- package/lib/sd-component-library95.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-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-
|
|
1
|
+
{"version":3,"file":"sd-component-library242.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/discrete-meter-needle/discrete-meter-needle.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { BaseNeedle } from \"../../../outline-meter/partials/base-needle\";\nimport {\n degToRad,\n getCoordinateForArc,\n getInnerX,\n getInnerY,\n} from \"../../../outline-meter/utils\";\nimport { DiscreteMeterNeedleProps as Props } from \"./interfaces\";\n\nexport function DiscreteMeterNeedle<T>(props: PropsWithChildren<Props<T>>) {\n const {\n needleColor,\n options,\n value,\n needleWidth,\n innerCircleRadius,\n innerCircleStrokeWidth,\n diameter,\n arc,\n distanceBetweenRanges,\n distanceFromRange,\n gaugeWidth,\n } = props;\n\n const matchingRangeIndex = options.findIndex(\n (option) => value === option.value\n );\n\n const radius = diameter / 2;\n\n const arcStart = (360 - arc) / 2;\n const arcForRanges = arc - (options.length - 1) * distanceBetweenRanges;\n\n const start = matchingRangeIndex / options.length;\n const end = (matchingRangeIndex + 1) / options.length;\n\n const rangeArc = arcForRanges * (end - start);\n\n const rangeArcStart =\n arcStart +\n distanceBetweenRanges * matchingRangeIndex +\n arcForRanges * start;\n\n const valueAlpha = rangeArcStart + rangeArc / 2;\n const { x: valueX, y: valueY } = getCoordinateForArc(radius, valueAlpha);\n\n const needleTipX = getInnerX(\n valueX,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n const needleTipY = getInnerY(\n valueY,\n degToRad(valueAlpha),\n distanceFromRange + gaugeWidth + needleWidth / 2\n );\n\n const dx = (needleWidth / 2) * Math.cos(degToRad(valueAlpha));\n const dy = (needleWidth / 2) * Math.sin(degToRad(valueAlpha));\n\n return (\n <BaseNeedle\n dx={dx}\n dy={dy}\n color={needleColor}\n radius={radius}\n tipX={needleTipX}\n tipY={needleTipY}\n innerCircleStrokeWidth={innerCircleStrokeWidth}\n innerCircleRadius={innerCircleRadius}\n needleWidth={needleWidth}\n />\n );\n}\n"],"names":["DiscreteMeterNeedle","props","needleColor","options","value","needleWidth","innerCircleRadius","innerCircleStrokeWidth","diameter","arc","distanceBetweenRanges","distanceFromRange","gaugeWidth","matchingRangeIndex","option","radius","arcStart","arcForRanges","start","end","rangeArc","valueAlpha","valueX","valueY","getCoordinateForArc","needleTipX","getInnerX","degToRad","needleTipY","getInnerY","dx","dy","jsx","BaseNeedle"],"mappings":";;;AAWO,SAASA,EAAuBC,GAAoC;AACnE,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IAC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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
arc: a,
|
|
14
|
-
distanceBetweenRanges: c,
|
|
15
|
-
distanceFromRange: s,
|
|
16
|
-
gaugeWidth: i
|
|
17
|
-
} = p, o = n.findIndex(
|
|
18
|
-
(F) => h === F.value
|
|
19
|
-
), d = R / 2, f = (360 - a) / 2, l = a - (n.length - 1) * c, g = o / n.length, v = (o + 1) / n.length, A = l * (v - g), t = f + c * o + l * g + A / 2, { x: C, y: I } = y(d, t), S = T(
|
|
20
|
-
C,
|
|
21
|
-
r(t),
|
|
22
|
-
s + i + e / 2
|
|
23
|
-
), X = W(
|
|
24
|
-
I,
|
|
25
|
-
r(t),
|
|
26
|
-
s + i + e / 2
|
|
27
|
-
), Y = e / 2 * Math.cos(r(t)), j = e / 2 * Math.sin(r(t));
|
|
28
|
-
return /* @__PURE__ */ M.jsx(
|
|
29
|
-
B,
|
|
30
|
-
{
|
|
31
|
-
dx: Y,
|
|
32
|
-
dy: j,
|
|
33
|
-
color: u,
|
|
34
|
-
radius: d,
|
|
35
|
-
tipX: S,
|
|
36
|
-
tipY: X,
|
|
37
|
-
innerCircleStrokeWidth: x,
|
|
38
|
-
innerCircleRadius: m,
|
|
39
|
-
needleWidth: e
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
1
|
+
import { j as g } from "./sd-component-library197.js";
|
|
2
|
+
import { getRangeProperties as d } from "./sd-component-library300.js";
|
|
3
|
+
import { MatchedRangeLabelBox as x } from "./sd-component-library296.js";
|
|
4
|
+
const h = (e) => {
|
|
5
|
+
const { idx: t, totalRanges: a, distanceBetweenRanges: r, arc: n } = e, { rangeArcStart: o, rangeArcEnd: s } = d(
|
|
6
|
+
n,
|
|
7
|
+
a,
|
|
8
|
+
r,
|
|
9
|
+
t
|
|
10
|
+
), c = Math.round((o + s) / 2);
|
|
11
|
+
return /* @__PURE__ */ g.jsx(x, { ...e, alpha: c, round: !0 });
|
|
12
|
+
};
|
|
43
13
|
export {
|
|
44
|
-
|
|
14
|
+
h as MatchedRangeLabelBox
|
|
45
15
|
};
|
|
46
16
|
//# sourceMappingURL=sd-component-library243.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/
|
|
1
|
+
{"version":3,"file":"sd-component-library243.js","sources":["../src/components/meters/multi-option-discrete-outline-meter/partials/matched-range-label-box/matched-range-label-box.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { MatchedRangeLabelBox as LabelBox } from \"../../../common-outline-meter-partials\";\nimport { getRangeProperties } from \"../../utils\";\nimport { MatchedRangeLabelBoxProps as Props } from \"./interfaces\";\n\nexport const MatchedRangeLabelBox: React.FC<Props> = (props) => {\n const { idx, totalRanges, distanceBetweenRanges, arc } = props;\n\n const { rangeArcStart, rangeArcEnd } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx\n );\n\n const alpha = Math.round((rangeArcStart + rangeArcEnd) / 2);\n\n return <LabelBox {...props} alpha={alpha} round />;\n};\n"],"names":["MatchedRangeLabelBox","props","idx","totalRanges","distanceBetweenRanges","arc","rangeArcStart","rangeArcEnd","getRangeProperties","alpha","LabelBox"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,KAAAC,GAAK,aAAAC,GAAa,uBAAAC,GAAuB,KAAAC,MAAQJ,GAEnD,EAAE,eAAAK,GAAe,aAAAC,EAAA,IAAgBC;AAAA,IACrCH;AAAA,IACAF;AAAA,IACAC;AAAA,IACAF;AAAA,EAAA,GAGIO,IAAQ,KAAK,OAAOH,IAAgBC,KAAe,CAAC;AAE1D,+BAAQG,GAAU,EAAA,GAAGT,GAAO,OAAAQ,GAAc,OAAK,GAAC,CAAA;AAClD;"}
|
|
@@ -1,16 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
+
};
|
|
12
46
|
};
|
|
13
47
|
export {
|
|
14
|
-
|
|
48
|
+
v as areSegmentsValid,
|
|
49
|
+
x as getSegmentCoordinates
|
|
15
50
|
};
|
|
16
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;AA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12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { j as n } from "./sd-component-library197.js";
|
|
2
|
+
import g from "./sd-component-library196.js";
|
|
3
|
+
import { getSegmentCoordinates as I } from "./sd-component-library244.js";
|
|
4
|
+
const w = ({
|
|
5
|
+
segment: e,
|
|
6
|
+
size: o,
|
|
7
|
+
segmentWidth: s,
|
|
8
|
+
outlineWidth: c,
|
|
9
|
+
isMatching: a
|
|
10
|
+
}) => {
|
|
11
|
+
const { color: d } = e, t = o / 2, $ = t - s, {
|
|
12
|
+
startX: l,
|
|
13
|
+
startY: m,
|
|
14
|
+
arc: i,
|
|
15
|
+
startInnerY: p,
|
|
16
|
+
startInnerX: h,
|
|
17
|
+
endInnerY: u,
|
|
18
|
+
endInnerX: x,
|
|
19
|
+
endX: f,
|
|
20
|
+
endY: j
|
|
21
|
+
} = I(e, t, s), r = o / 2;
|
|
22
|
+
return /* @__PURE__ */ n.jsxs("g", { children: [
|
|
23
|
+
/* @__PURE__ */ n.jsx(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
d: `M${r},${r} L${l},${m} A${t},${t} 0 ${i > 180 ? "1" : "0"},1 ${f},${j}Z`,
|
|
27
|
+
fill: a ? d : g.colors.cl_lightGrey,
|
|
28
|
+
strokeWidth: c,
|
|
29
|
+
stroke: "white"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ n.jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
d: `M${r},${r} L${h},${p} A${$},${$} 0 ${i > 180 ? "1" : "0"},1 ${x},${u}Z`,
|
|
36
|
+
fill: "white"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
18
41
|
export {
|
|
19
|
-
|
|
20
|
-
I as getFractionColor,
|
|
21
|
-
h as isLabelActive,
|
|
22
|
-
T as mapAdjacent
|
|
42
|
+
w as CompactDonutGaugeSegment
|
|
23
43
|
};
|
|
24
44
|
//# sourceMappingURL=sd-component-library245.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library245.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library245.js","sources":["../src/components/meters/compact-donut-gauge/partials/compact-donut-gauge-segment/compact-donut-gauge-segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport theme from \"../../../../../core/theme\";\nimport { getSegmentCoordinates } from \"../../../donut-diagram/utils\";\nimport { CompactDonutGaugeSegmentProps as Props } from \"./interfaces\";\n\nexport const CompactDonutGaugeSegment: React.FC<Props> = ({\n segment,\n size: diameter,\n segmentWidth,\n outlineWidth,\n isMatching,\n}) => {\n const { color } = segment;\n\n const radius = diameter / 2;\n const innerRadius = radius - segmentWidth;\n\n const {\n startX,\n startY,\n arc,\n startInnerY,\n startInnerX,\n endInnerY,\n endInnerX,\n endX,\n endY,\n } = getSegmentCoordinates(segment, radius, segmentWidth);\n\n const center = diameter / 2;\n\n return (\n <g>\n {/* colored sector */}\n <path\n d={`M${center},${center} L${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY}Z`}\n fill={isMatching ? color : theme.colors[\"cl_lightGrey\"]}\n strokeWidth={outlineWidth}\n stroke=\"white\"\n />\n\n {/* white inner sector */}\n <path\n d={`M${center},${center} L${startInnerX},${startInnerY} A${innerRadius},${innerRadius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endInnerX},${endInnerY}Z`}\n fill=\"white\"\n />\n </g>\n );\n};\n"],"names":["CompactDonutGaugeSegment","segment","diameter","segmentWidth","outlineWidth","isMatching","color","radius","innerRadius","startX","startY","arc","startInnerY","startInnerX","endInnerY","endInnerX","endX","endY","getSegmentCoordinates","center","jsx","theme"],"mappings":";;;AAMO,MAAMA,IAA4C,CAAC;AAAA,EACxD,SAAAC;AAAA,EACA,MAAMC;AAAA,EACN,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|
-
innerPointRadius: W,
|
|
16
|
-
pointStrokeWidth: C,
|
|
17
|
-
gaugeWidth: e,
|
|
18
|
-
pointColor: $
|
|
19
|
-
} = G, c = d / n, x = (d + 1) / n, k = i >= c && i <= x, R = (360 - l) / 2, r = I / 2, g = R + l * c, j = R + l * x, { x: u, y: h } = A(
|
|
20
|
-
r,
|
|
21
|
-
g
|
|
22
|
-
), { x: m, y } = A(
|
|
23
|
-
r,
|
|
24
|
-
j
|
|
25
|
-
);
|
|
26
|
-
if (v || !k)
|
|
27
|
-
return /* @__PURE__ */ t.jsx(
|
|
28
|
-
X,
|
|
29
|
-
{
|
|
30
|
-
startX: u,
|
|
31
|
-
startY: h,
|
|
32
|
-
endX: m,
|
|
33
|
-
endY: y,
|
|
34
|
-
startAlpha: g,
|
|
35
|
-
endAlpha: j,
|
|
36
|
-
color: v || i > x ? `url(#gradient-${f}-${Y})` : w,
|
|
37
|
-
radius: r,
|
|
38
|
-
width: e
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
const o = g + (i - c) / (x - c) * l / n, { x: a, y: s } = A(r, o), F = H(a, E(o), e), B = M(s, E(o), e), D = d >= n / 2, S = d + 1 === n / 2 + 0.5, z = S ? (a - u) / (m - u) : (s - h) / (y - h), p = O(z, f, Y);
|
|
42
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsxs(
|
|
44
|
-
"linearGradient",
|
|
45
|
-
{
|
|
46
|
-
id: `value-gradient-${p}`,
|
|
47
|
-
...D ? {
|
|
48
|
-
x1: 0,
|
|
49
|
-
y1: 0,
|
|
50
|
-
x2: 0,
|
|
51
|
-
y2: 1
|
|
52
|
-
} : S ? { x1: 0, y1: 0, x2: 1, y2: 0 } : {
|
|
53
|
-
x1: 0,
|
|
54
|
-
y1: 1,
|
|
55
|
-
x2: 0,
|
|
56
|
-
y2: 0
|
|
57
|
-
},
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ t.jsx("stop", { stopColor: f, offset: "0%" }),
|
|
60
|
-
/* @__PURE__ */ t.jsx("stop", { stopColor: p, offset: "100%" })
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
) }),
|
|
64
|
-
/* @__PURE__ */ t.jsxs("g", { children: [
|
|
2
|
+
import { FlexCenter as s } from "./sd-component-library34.js";
|
|
3
|
+
import { ResponsiveTextV2 as i } from "./sd-component-library150.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
segment: { start: n, end: r, color: e },
|
|
6
|
+
size: o
|
|
7
|
+
}) => /* @__PURE__ */ t.jsx("foreignObject", { x: 0, y: 0, width: o, height: o, children: /* @__PURE__ */ t.jsx(s, { height: "100%", children: /* @__PURE__ */ t.jsxs(
|
|
8
|
+
i,
|
|
9
|
+
{
|
|
10
|
+
fontSizeWeight: [20, "bold"],
|
|
11
|
+
color: e,
|
|
12
|
+
sx: { position: "relative" },
|
|
13
|
+
children: [
|
|
14
|
+
Math.round((r - n) * 100),
|
|
65
15
|
/* @__PURE__ */ t.jsx(
|
|
66
|
-
|
|
16
|
+
i,
|
|
67
17
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
startAlpha: g,
|
|
73
|
-
endAlpha: o,
|
|
74
|
-
color: `url(#value-gradient-${p})`,
|
|
75
|
-
radius: r,
|
|
76
|
-
width: e,
|
|
77
|
-
roundEnd: !1
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ t.jsx(
|
|
81
|
-
X,
|
|
82
|
-
{
|
|
83
|
-
startX: a,
|
|
84
|
-
startY: s,
|
|
85
|
-
endX: m,
|
|
86
|
-
endY: y,
|
|
87
|
-
startAlpha: o,
|
|
88
|
-
endAlpha: j,
|
|
89
|
-
color: w,
|
|
90
|
-
radius: r,
|
|
91
|
-
width: e,
|
|
92
|
-
roundStart: !1
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ t.jsx(
|
|
96
|
-
"circle",
|
|
97
|
-
{
|
|
98
|
-
cx: (a + F) / 2,
|
|
99
|
-
cy: (s + B) / 2,
|
|
100
|
-
r: C + W,
|
|
101
|
-
strokeWidth: C,
|
|
102
|
-
stroke: $ || p,
|
|
103
|
-
fill: "white"
|
|
18
|
+
fontSizeWeight: [10, "bold"],
|
|
19
|
+
color: e,
|
|
20
|
+
sx: { position: "absolute", top: "4px", left: "100%" },
|
|
21
|
+
children: "%"
|
|
104
22
|
}
|
|
105
23
|
)
|
|
106
|
-
]
|
|
107
|
-
|
|
108
|
-
};
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) }) });
|
|
109
27
|
export {
|
|
110
|
-
|
|
28
|
+
l as CompactDonutGaugeValueIndicator
|
|
111
29
|
};
|
|
112
30
|
//# sourceMappingURL=sd-component-library246.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library246.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library246.js","sources":["../src/components/meters/compact-donut-gauge/partials/compact-donut-gauge-value-indicator/compact-donut-gauge-value-indicator.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flex } from \"rebass\";\n\nimport { FlexCenter } from \"../../../../containers\";\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { CompactDonutGaugeValueIndicatorProps as Props } from \"./interfaces\";\n\nexport const CompactDonutGaugeValueIndicator: React.FC<Props> = ({\n segment: { start, end, color },\n size,\n}) => {\n return (\n <foreignObject x={0} y={0} width={size} height={size}>\n <FlexCenter height=\"100%\">\n <ResponsiveTextV2\n fontSizeWeight={[20, \"bold\"]}\n color={color}\n sx={{ position: \"relative\" }}\n >\n {Math.round((end - start) * 100)}\n\n <ResponsiveTextV2\n fontSizeWeight={[10, \"bold\"]}\n color={color}\n sx={{ position: \"absolute\", top: \"4px\", left: \"100%\" }}\n >\n %\n </ResponsiveTextV2>\n </ResponsiveTextV2>\n </FlexCenter>\n </foreignObject>\n );\n};\n"],"names":["CompactDonutGaugeValueIndicator","start","end","color","size","jsx","FlexCenter","jsxs","ResponsiveTextV2"],"mappings":";;;AAQO,MAAMA,IAAmD,CAAC;AAAA,EAC/D,SAAS,EAAE,OAAAC,GAAO,KAAAC,GAAK,OAAAC,EAAM;AAAA,EAC7B,MAAAC;AACF,MAEKC,gBAAAA,EAAAA,IAAA,iBAAA,EAAc,GAAG,GAAG,GAAG,GAAG,OAAOD,GAAM,QAAQA,GAC9C,UAACC,gBAAAA,MAAAC,GAAA,EAAW,QAAO,QACjB,UAAAC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,gBAAgB,CAAC,IAAI,MAAM;AAAA,IAC3B,OAAAL;AAAA,IACA,IAAI,EAAE,UAAU,WAAW;AAAA,IAE1B,UAAA;AAAA,MAAK,KAAA,OAAOD,IAAMD,KAAS,GAAG;AAAA,MAE/BI,gBAAAA,EAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,gBAAgB,CAAC,IAAI,MAAM;AAAA,UAC3B,OAAAL;AAAA,UACA,IAAI,EAAE,UAAU,YAAY,KAAK,OAAO,MAAM,OAAO;AAAA,UACtD,UAAA;AAAA,QAAA;AAAA,MAED;AAAA,IAAA;AAAA,EAAA;AAAA,EAEJ,CAAA,EACF,CAAA;"}
|
|
@@ -1,50 +1,24 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
arc: a,
|
|
13
|
-
value: l,
|
|
14
|
-
gaugeWidth: g,
|
|
15
|
-
diameter: v,
|
|
16
|
-
needleColor: S
|
|
17
|
-
} = R, s = v / 2, e = r.length, t = Math.floor(l * e), y = r[t][0], A = r[t][1], u = (360 - a) / 2, m = u + a * t / e, E = u + a * (t + 1) / e, p = t / e, M = (t + 1) / e, { x: h, y: x } = i(
|
|
18
|
-
s,
|
|
19
|
-
m
|
|
20
|
-
), { x: j, y: F } = i(
|
|
21
|
-
s,
|
|
22
|
-
E
|
|
23
|
-
), o = m + (l - p) / (M - p) * a / r.length, { x: C, y: f } = i(s, o), G = k(
|
|
24
|
-
C,
|
|
25
|
-
c(o),
|
|
26
|
-
d + g + n / 2
|
|
27
|
-
), I = B(
|
|
28
|
-
f,
|
|
29
|
-
c(o),
|
|
30
|
-
d + g + n / 2
|
|
31
|
-
), T = n / 2 * Math.cos(c(o)), W = n / 2 * Math.sin(c(o)), z = t + 1 === e / 2 + 0.5 ? (C - h) / (j - h) : (f - x) / (F - x), H = b(z, y, A);
|
|
32
|
-
return /* @__PURE__ */ N.jsx(
|
|
33
|
-
q,
|
|
1
|
+
import { j as x } from "./sd-component-library197.js";
|
|
2
|
+
import { Box as n } from "rebass";
|
|
3
|
+
const $ = ({
|
|
4
|
+
idx: o,
|
|
5
|
+
color: t,
|
|
6
|
+
total: i,
|
|
7
|
+
segmentHeight: r
|
|
8
|
+
}) => {
|
|
9
|
+
const s = `${o === 0 ? r / 2 : 0}px`, a = `${o === i - 1 ? r / 2 : 0}px`;
|
|
10
|
+
return /* @__PURE__ */ x.jsx(
|
|
11
|
+
n,
|
|
34
12
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
dx: T,
|
|
41
|
-
dy: W,
|
|
42
|
-
tipX: G,
|
|
43
|
-
tipY: I
|
|
13
|
+
bg: t,
|
|
14
|
+
height: r,
|
|
15
|
+
sx: {
|
|
16
|
+
borderRadius: `${s} ${[...Array(2)].fill(a).join(" ")} ${s}`
|
|
17
|
+
}
|
|
44
18
|
}
|
|
45
19
|
);
|
|
46
20
|
};
|
|
47
21
|
export {
|
|
48
|
-
|
|
22
|
+
$ as LinearGaugeSegment
|
|
49
23
|
};
|
|
50
24
|
//# sourceMappingURL=sd-component-library247.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library247.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library247.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-segment/linear-gauge-segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { LinearGaugeSegmentProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeSegment: React.FC<Props> = ({\n idx,\n color,\n total,\n segmentHeight,\n}) => {\n const leftRadius = `${idx === 0 ? segmentHeight / 2 : 0}px`;\n const rightRadius = `${idx === total - 1 ? segmentHeight / 2 : 0}px`;\n\n return (\n <Box\n bg={color}\n height={segmentHeight}\n sx={{\n borderRadius: `${leftRadius} ${[...Array(2)]\n .fill(rightRadius)\n .join(\" \")} ${leftRadius}`,\n }}\n />\n );\n};\n"],"names":["LinearGaugeSegment","idx","color","total","segmentHeight","leftRadius","rightRadius","jsx","Box"],"mappings":";;AAMO,MAAMA,IAAsC,CAAC;AAAA,EAClD,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAa,GAAGJ,MAAQ,IAAIG,IAAgB,IAAI,CAAC,MACjDE,IAAc,GAAGL,MAAQE,IAAQ,IAAIC,IAAgB,IAAI,CAAC;AAG9D,SAAAG,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAIN;AAAA,MACJ,QAAQE;AAAA,MACR,IAAI;AAAA,QACF,cAAc,GAAGC,CAAU,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EACxC,KAAKC,CAAW,EAChB,KAAK,GAAG,CAAC,IAAID,CAAU;AAAA,MAC5B;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
endY: t / 2 - 0.5
|
|
21
|
-
};
|
|
22
|
-
return /* @__PURE__ */ p.jsx("path", { d: `M${d},${i} L${X},${Y}`, stroke: "#CCD0DB" });
|
|
23
|
-
};
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import { ResponsiveTextV2 as r } from "./sd-component-library150.js";
|
|
3
|
+
const m = ({
|
|
4
|
+
text: e,
|
|
5
|
+
color: t,
|
|
6
|
+
...i
|
|
7
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
+
r,
|
|
9
|
+
{
|
|
10
|
+
height: "12px",
|
|
11
|
+
fontSizeWeight: [10, "semi-bold"],
|
|
12
|
+
color: t,
|
|
13
|
+
mx: "auto",
|
|
14
|
+
maxWidth: "100%",
|
|
15
|
+
textAlign: "center",
|
|
16
|
+
...i,
|
|
17
|
+
children: e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
24
20
|
export {
|
|
25
|
-
m as
|
|
21
|
+
m as LinearGaugeLabel
|
|
26
22
|
};
|
|
27
23
|
//# sourceMappingURL=sd-component-library248.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library248.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library248.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-label/linear-gauge-label.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { ResponsiveTextV2 } from \"../../../texts\";\nimport { LinearGaugeLabelProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeLabel: React.FC<Props> = ({\n text,\n color,\n ...restOfProps\n}) => {\n return (\n <ResponsiveTextV2\n height=\"12px\"\n fontSizeWeight={[10, \"semi-bold\"]}\n color={color}\n mx=\"auto\"\n maxWidth=\"100%\"\n textAlign=\"center\"\n {...restOfProps}\n >\n {text}\n </ResponsiveTextV2>\n );\n};\n"],"names":["LinearGaugeLabel","text","color","restOfProps","jsx","ResponsiveTextV2"],"mappings":";;AAKO,MAAMA,IAAoC,CAAC;AAAA,EAChD,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,QAAO;AAAA,IACP,gBAAgB,CAAC,IAAI,WAAW;AAAA,IAChC,OAAAH;AAAA,IACA,IAAG;AAAA,IACH,UAAS;AAAA,IACT,WAAU;AAAA,IACT,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AAAA;"}
|