@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,53 +1,125 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { j as i } from "./sd-component-library197.js";
|
|
2
|
+
import { useRef as B, useEffect as L } from "react";
|
|
3
|
+
import { Box as s } from "rebass";
|
|
4
|
+
import { ResponsiveTextV2 as V } from "./sd-component-library150.js";
|
|
5
|
+
const R = ({
|
|
6
|
+
id: b,
|
|
7
|
+
label: g,
|
|
8
|
+
color: a,
|
|
9
|
+
activeColor: x,
|
|
10
|
+
borderColor: r,
|
|
11
|
+
borderWidth: p,
|
|
12
|
+
borderRadius: o,
|
|
13
|
+
selectedIndex: e,
|
|
14
|
+
idx: n,
|
|
15
|
+
onSelect: S,
|
|
16
|
+
dashWidth: $ = 20,
|
|
17
|
+
dashHeight: j = 3,
|
|
18
|
+
px: u,
|
|
19
|
+
fontSize: v,
|
|
20
|
+
totalTabs: y,
|
|
21
|
+
topAdditionalOffset: w = 8,
|
|
22
|
+
bottomAdditionalOffset: T = 4,
|
|
23
|
+
scrollOnChange: l = !0
|
|
24
|
+
}) => {
|
|
25
|
+
const c = B(null), t = e === n;
|
|
26
|
+
L(() => {
|
|
27
|
+
var h;
|
|
28
|
+
t && l && ((h = c.current) == null || h.scrollIntoView({
|
|
29
|
+
behavior: "smooth",
|
|
30
|
+
inline: "center",
|
|
31
|
+
block: "end"
|
|
32
|
+
}));
|
|
33
|
+
}, [t, l]);
|
|
34
|
+
const f = e === n + 1, m = e !== -1 && e === n - 1, z = n === y - 1;
|
|
35
|
+
return /* @__PURE__ */ i.jsxs(
|
|
36
|
+
s,
|
|
21
37
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
onClick: () => S(b),
|
|
39
|
+
sx: {
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
position: "relative",
|
|
42
|
+
left: `-${n > e ? 2 : n == e ? 1 : 0}px`,
|
|
43
|
+
zIndex: t ? 1 : 0
|
|
44
|
+
},
|
|
45
|
+
ref: c,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ i.jsx(
|
|
48
|
+
s,
|
|
30
49
|
{
|
|
31
|
-
|
|
32
|
-
height:
|
|
33
|
-
|
|
50
|
+
sx: {
|
|
51
|
+
height: `${o + w}px`,
|
|
52
|
+
borderWidth: p,
|
|
53
|
+
borderColor: r,
|
|
54
|
+
borderStyle: t ? "solid" : "none",
|
|
55
|
+
borderBottomStyle: "none",
|
|
56
|
+
borderRadius: t ? `${o}px ${o}px 0 0` : z ? `0 ${o}px 0 0` : void 0,
|
|
57
|
+
bg: "cl_white"
|
|
34
58
|
}
|
|
35
59
|
}
|
|
36
60
|
),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
61
|
+
/* @__PURE__ */ i.jsx(
|
|
62
|
+
s,
|
|
39
63
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
sx: {
|
|
65
|
+
borderWidth: p,
|
|
66
|
+
borderColor: r,
|
|
67
|
+
borderStyle: t ? "none solid" : "none",
|
|
68
|
+
boxSizing: "content-box"
|
|
69
|
+
},
|
|
70
|
+
children: /* @__PURE__ */ i.jsx(
|
|
71
|
+
V,
|
|
72
|
+
{
|
|
73
|
+
fontSizeWeight: [v, "bold"],
|
|
74
|
+
textTransform: "uppercase",
|
|
75
|
+
color: t ? x : a,
|
|
76
|
+
sx: {
|
|
77
|
+
bg: "cl_white",
|
|
78
|
+
letterSpacing: "1px",
|
|
79
|
+
px: u
|
|
80
|
+
},
|
|
81
|
+
children: g
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ i.jsx(
|
|
87
|
+
s,
|
|
88
|
+
{
|
|
89
|
+
sx: {
|
|
90
|
+
height: `${o + T}px`,
|
|
91
|
+
borderWidth: p,
|
|
92
|
+
borderColor: r,
|
|
93
|
+
borderBottomStyle: t ? "none" : "solid",
|
|
94
|
+
borderLeftStyle: m ? "solid" : "none",
|
|
95
|
+
borderRightStyle: f ? "solid" : "none",
|
|
96
|
+
borderTopStyle: "none",
|
|
97
|
+
borderRadius: `0 0 ${f ? o : 0}px ${m ? o : 0}px`,
|
|
98
|
+
bg: "cl_white",
|
|
99
|
+
mx: t ? "1px" : void 0
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
t && /* @__PURE__ */ i.jsx(
|
|
104
|
+
s,
|
|
105
|
+
{
|
|
106
|
+
sx: {
|
|
107
|
+
bg: x,
|
|
108
|
+
height: `${j}px`,
|
|
109
|
+
width: `${$}px`,
|
|
110
|
+
position: "absolute",
|
|
111
|
+
left: "50%",
|
|
112
|
+
bottom: 0,
|
|
113
|
+
transform: "translateX(-50%)",
|
|
114
|
+
borderRadius: "1px"
|
|
115
|
+
}
|
|
44
116
|
}
|
|
45
117
|
)
|
|
46
|
-
]
|
|
118
|
+
]
|
|
47
119
|
}
|
|
48
120
|
);
|
|
49
121
|
};
|
|
50
122
|
export {
|
|
51
|
-
|
|
123
|
+
R as TabV2
|
|
52
124
|
};
|
|
53
125
|
//# sourceMappingURL=sd-component-library268.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library268.js","sources":["../src/components/tabs/
|
|
1
|
+
{"version":3,"file":"sd-component-library268.js","sources":["../src/components/tabs/tab-bar-v2/partials/tab-v2/tab-v2.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { TabV2Props as Props } from \"./interfaces\";\n\nexport const TabV2: React.FC<Props> = ({\n id,\n label,\n color,\n activeColor,\n borderColor,\n borderWidth,\n borderRadius,\n selectedIndex,\n idx,\n onSelect,\n dashWidth = 20,\n dashHeight = 3,\n px,\n fontSize,\n totalTabs,\n topAdditionalOffset = 8,\n bottomAdditionalOffset = 4,\n scrollOnChange = true,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const active = selectedIndex === idx;\n\n useEffect(() => {\n if (active && scrollOnChange)\n ref.current?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"center\",\n block: \"end\",\n });\n }, [active, scrollOnChange]);\n\n const atLeftOfActive = selectedIndex === idx + 1;\n const atRightOfActive = selectedIndex !== -1 && selectedIndex === idx - 1;\n const isLast = idx === totalTabs - 1;\n\n return (\n <Box\n onClick={() => onSelect(id)}\n sx={{\n cursor: \"pointer\",\n position: \"relative\",\n left: `-${idx > selectedIndex ? 2 : idx == selectedIndex ? 1 : 0}px`,\n zIndex: active ? 1 : 0,\n }}\n ref={ref}\n >\n <Box\n sx={{\n height: `${borderRadius + topAdditionalOffset}px`,\n borderWidth,\n borderColor,\n borderStyle: active ? \"solid\" : \"none\",\n borderBottomStyle: \"none\",\n borderRadius: active\n ? `${borderRadius}px ${borderRadius}px 0 0`\n : isLast\n ? `0 ${borderRadius}px 0 0`\n : undefined,\n bg: \"cl_white\",\n }}\n />\n\n <Box\n sx={{\n borderWidth,\n borderColor,\n borderStyle: active ? \"none solid\" : \"none\",\n boxSizing: \"content-box\",\n }}\n >\n <ResponsiveTextV2\n fontSizeWeight={[fontSize, \"bold\"]}\n textTransform=\"uppercase\"\n color={active ? activeColor : color}\n sx={{\n bg: \"cl_white\",\n letterSpacing: \"1px\",\n px,\n }}\n >\n {label}\n </ResponsiveTextV2>\n </Box>\n\n <Box\n sx={{\n height: `${borderRadius + bottomAdditionalOffset}px`,\n borderWidth,\n borderColor,\n borderBottomStyle: active ? \"none\" : \"solid\",\n borderLeftStyle: atRightOfActive ? \"solid\" : \"none\",\n borderRightStyle: atLeftOfActive ? \"solid\" : \"none\",\n borderTopStyle: \"none\",\n borderRadius: `0 0 ${atLeftOfActive ? borderRadius : 0}px ${\n atRightOfActive ? borderRadius : 0\n }px`,\n bg: \"cl_white\",\n mx: active ? \"1px\" : undefined,\n }}\n />\n\n {active && (\n <Box\n sx={{\n bg: activeColor,\n height: `${dashHeight}px`,\n width: `${dashWidth}px`,\n position: \"absolute\",\n left: \"50%\",\n bottom: 0,\n transform: \"translateX(-50%)\",\n borderRadius: \"1px\",\n }}\n />\n )}\n </Box>\n );\n};\n"],"names":["TabV2","id","label","color","activeColor","borderColor","borderWidth","borderRadius","selectedIndex","idx","onSelect","dashWidth","dashHeight","px","fontSize","totalTabs","topAdditionalOffset","bottomAdditionalOffset","scrollOnChange","ref","useRef","active","useEffect","_a","atLeftOfActive","atRightOfActive","isLast","jsxs","Box","jsx","ResponsiveTextV2"],"mappings":"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"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { j as c } from "./sd-component-library197.js";
|
|
2
|
+
import { useRef as f, useEffect as n } from "react";
|
|
3
|
+
import { Box as p } from "rebass";
|
|
4
|
+
const m = (l) => {
|
|
5
|
+
const { hash: e, selectedTab: t, autoScrollTabs: o, scrollTabOnSelect: a, children: s } = l, r = f(null);
|
|
6
|
+
return n(() => {
|
|
7
|
+
o && t === e && r.current && a(r);
|
|
8
|
+
}, [t, e, o, r, a]), /* @__PURE__ */ c.jsx(p, { "data-test": "scrollable-tab-wrapper", ref: r, children: s });
|
|
9
|
+
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
m as ScrollableTabWrapper
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=sd-component-library269.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library269.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library269.js","sources":["../src/components/tabs/tabs-menu/partials/scrollable-tab-wrapper/scrollable-tab-wrapper.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { ScrollableTabWrapperProps as Props } from \"./interfaces\";\n\nexport const ScrollableTabWrapper: React.FC<Props> = (props) => {\n const { hash, selectedTab, autoScrollTabs, scrollTabOnSelect, children } =\n props;\n\n const tabRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!autoScrollTabs) return;\n\n /**\n * If current tab is the selected one, call the callback to scroll the tab.\n */\n if (selectedTab === hash && tabRef.current) {\n scrollTabOnSelect(tabRef);\n }\n }, [selectedTab, hash, autoScrollTabs, tabRef, scrollTabOnSelect]);\n\n return (\n <Box data-test=\"scrollable-tab-wrapper\" ref={tabRef}>\n {children}\n </Box>\n );\n};\n"],"names":["ScrollableTabWrapper","props","hash","selectedTab","autoScrollTabs","scrollTabOnSelect","children","tabRef","useRef","useEffect","Box"],"mappings":";;;AAMa,MAAAA,IAAwC,CAACC,MAAU;AAC9D,QAAM,EAAE,MAAAC,GAAM,aAAAC,GAAa,gBAAAC,GAAgB,mBAAAC,GAAmB,UAAAC,EAC5D,IAAAL,GAEIM,IAASC,EAAuB,IAAI;AAE1C,SAAAC,EAAU,MAAM;AACd,IAAKL,KAKDD,MAAgBD,KAAQK,EAAO,WACjCF,EAAkBE,CAAM;AAAA,EAC1B,GACC,CAACJ,GAAaD,GAAME,GAAgBG,GAAQF,CAAiB,CAAC,yBAG9DK,GAAI,EAAA,aAAU,0BAAyB,KAAKH,GAC1C,UAAAD,EACH,CAAA;AAEJ;"}
|
|
@@ -1,328 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import { ThirteenBold as h } from "./sd-component-library154.js";
|
|
3
|
+
import { Button as m } from "./sd-component-library24.js";
|
|
4
|
+
import { MaxMaxContainer as d } from "./sd-component-library40.js";
|
|
5
|
+
const T = (s) => {
|
|
6
|
+
const {
|
|
7
|
+
Icon: i,
|
|
8
|
+
iconHeight: n,
|
|
9
|
+
title: l,
|
|
10
|
+
isActive: r,
|
|
11
|
+
hash: t,
|
|
12
|
+
onTabSelect: c,
|
|
13
|
+
enableScroll: a,
|
|
14
|
+
activeColor: e,
|
|
15
|
+
history: p
|
|
16
|
+
} = s, x = a ? {
|
|
17
|
+
scrollTo: t
|
|
18
|
+
} : {};
|
|
19
|
+
return /* @__PURE__ */ o.jsx(
|
|
20
|
+
m,
|
|
21
|
+
{
|
|
22
|
+
bg: "transparent",
|
|
23
|
+
onClick: () => c(t),
|
|
24
|
+
history: p,
|
|
25
|
+
"data-testid": `tab-${t}`,
|
|
26
|
+
...x,
|
|
27
|
+
children: /* @__PURE__ */ o.jsxs(d, { gap: ["15px", "20px"], children: [
|
|
28
|
+
/* @__PURE__ */ o.jsx(
|
|
29
|
+
i,
|
|
30
|
+
{
|
|
31
|
+
style: {
|
|
32
|
+
height: n,
|
|
33
|
+
fill: r ? e : "#434A54"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ o.jsx(
|
|
38
|
+
h,
|
|
39
|
+
{
|
|
40
|
+
textTransform: "uppercase",
|
|
41
|
+
color: r ? e : "#434A54",
|
|
42
|
+
cursor: "pointer",
|
|
43
|
+
children: l
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] })
|
|
33
47
|
}
|
|
34
|
-
|
|
35
|
-
}, a.componentWillUnmount = function() {
|
|
36
|
-
this.cancelNextCallback();
|
|
37
|
-
}, a.getTimeouts = function() {
|
|
38
|
-
var e = this.props.timeout, t, n, r;
|
|
39
|
-
return t = n = r = e, e != null && typeof e != "number" && (t = e.exit, n = e.enter, r = e.appear !== void 0 ? e.appear : n), {
|
|
40
|
-
exit: t,
|
|
41
|
-
enter: n,
|
|
42
|
-
appear: r
|
|
43
|
-
};
|
|
44
|
-
}, a.updateStatus = function(e, t) {
|
|
45
|
-
e === void 0 && (e = !1), t !== null ? (this.cancelNextCallback(), t === f ? this.performEnter(e) : this.performExit()) : this.props.unmountOnExit && this.state.status === l && this.setState({
|
|
46
|
-
status: x
|
|
47
|
-
});
|
|
48
|
-
}, a.performEnter = function(e) {
|
|
49
|
-
var t = this, n = this.props.enter, r = this.context ? this.context.isMounting : e, s = this.props.nodeRef ? [r] : [b.findDOMNode(this), r], c = s[0], m = s[1], S = this.getTimeouts(), C = r ? S.appear : S.enter;
|
|
50
|
-
if (!e && !n || N.disabled) {
|
|
51
|
-
this.safeSetState({
|
|
52
|
-
status: h
|
|
53
|
-
}, function() {
|
|
54
|
-
t.props.onEntered(c);
|
|
55
|
-
});
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.props.onEnter(c, m), this.safeSetState({
|
|
59
|
-
status: f
|
|
60
|
-
}, function() {
|
|
61
|
-
t.props.onEntering(c, m), t.onTransitionEnd(C, function() {
|
|
62
|
-
t.safeSetState({
|
|
63
|
-
status: h
|
|
64
|
-
}, function() {
|
|
65
|
-
t.props.onEntered(c, m);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}, a.performExit = function() {
|
|
70
|
-
var e = this, t = this.props.exit, n = this.getTimeouts(), r = this.props.nodeRef ? void 0 : b.findDOMNode(this);
|
|
71
|
-
if (!t || N.disabled) {
|
|
72
|
-
this.safeSetState({
|
|
73
|
-
status: l
|
|
74
|
-
}, function() {
|
|
75
|
-
e.props.onExited(r);
|
|
76
|
-
});
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.props.onExit(r), this.safeSetState({
|
|
80
|
-
status: T
|
|
81
|
-
}, function() {
|
|
82
|
-
e.props.onExiting(r), e.onTransitionEnd(n.exit, function() {
|
|
83
|
-
e.safeSetState({
|
|
84
|
-
status: l
|
|
85
|
-
}, function() {
|
|
86
|
-
e.props.onExited(r);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}, a.cancelNextCallback = function() {
|
|
91
|
-
this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
|
|
92
|
-
}, a.safeSetState = function(e, t) {
|
|
93
|
-
t = this.setNextCallback(t), this.setState(e, t);
|
|
94
|
-
}, a.setNextCallback = function(e) {
|
|
95
|
-
var t = this, n = !0;
|
|
96
|
-
return this.nextCallback = function(r) {
|
|
97
|
-
n && (n = !1, t.nextCallback = null, e(r));
|
|
98
|
-
}, this.nextCallback.cancel = function() {
|
|
99
|
-
n = !1;
|
|
100
|
-
}, this.nextCallback;
|
|
101
|
-
}, a.onTransitionEnd = function(e, t) {
|
|
102
|
-
this.setNextCallback(t);
|
|
103
|
-
var n = this.props.nodeRef ? this.props.nodeRef.current : b.findDOMNode(this), r = e == null && !this.props.addEndListener;
|
|
104
|
-
if (!n || r) {
|
|
105
|
-
setTimeout(this.nextCallback, 0);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (this.props.addEndListener) {
|
|
109
|
-
var s = this.props.nodeRef ? [this.nextCallback] : [n, this.nextCallback], c = s[0], m = s[1];
|
|
110
|
-
this.props.addEndListener(c, m);
|
|
111
|
-
}
|
|
112
|
-
e != null && setTimeout(this.nextCallback, e);
|
|
113
|
-
}, a.render = function() {
|
|
114
|
-
var e = this.state.status;
|
|
115
|
-
if (e === x)
|
|
116
|
-
return null;
|
|
117
|
-
var t = this.props, n = t.children;
|
|
118
|
-
t.in, t.mountOnEnter, t.unmountOnExit, t.appear, t.enter, t.exit, t.timeout, t.addEndListener, t.onEnter, t.onEntering, t.onEntered, t.onExit, t.onExiting, t.onExited, t.nodeRef;
|
|
119
|
-
var r = O(t, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
120
|
-
return (
|
|
121
|
-
// allows for nested Transitions
|
|
122
|
-
/* @__PURE__ */ v.createElement(g.Provider, {
|
|
123
|
-
value: null
|
|
124
|
-
}, typeof n == "function" ? n(e, r) : v.cloneElement(v.Children.only(n), r))
|
|
125
|
-
);
|
|
126
|
-
}, u;
|
|
127
|
-
}(v.Component);
|
|
128
|
-
p.contextType = g;
|
|
129
|
-
p.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
130
|
-
/**
|
|
131
|
-
* A React reference to DOM element that need to transition:
|
|
132
|
-
* https://stackoverflow.com/a/51127130/4671932
|
|
133
|
-
*
|
|
134
|
-
* - When `nodeRef` prop is used, `node` is not passed to callback functions
|
|
135
|
-
* (e.g. `onEnter`) because user already has direct access to the node.
|
|
136
|
-
* - When changing `key` prop of `Transition` in a `TransitionGroup` a new
|
|
137
|
-
* `nodeRef` need to be provided to `Transition` with changed `key` prop
|
|
138
|
-
* (see
|
|
139
|
-
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
140
|
-
*/
|
|
141
|
-
nodeRef: o.shape({
|
|
142
|
-
current: typeof Element > "u" ? o.any : function(d, u, a, i, e, t) {
|
|
143
|
-
var n = d[u];
|
|
144
|
-
return o.instanceOf(n && "ownerDocument" in n ? n.ownerDocument.defaultView.Element : Element)(d, u, a, i, e, t);
|
|
145
|
-
}
|
|
146
|
-
}),
|
|
147
|
-
/**
|
|
148
|
-
* A `function` child can be used instead of a React element. This function is
|
|
149
|
-
* called with the current transition status (`'entering'`, `'entered'`,
|
|
150
|
-
* `'exiting'`, `'exited'`), which can be used to apply context
|
|
151
|
-
* specific props to a component.
|
|
152
|
-
*
|
|
153
|
-
* ```jsx
|
|
154
|
-
* <Transition in={this.state.in} timeout={150}>
|
|
155
|
-
* {state => (
|
|
156
|
-
* <MyComponent className={`fade fade-${state}`} />
|
|
157
|
-
* )}
|
|
158
|
-
* </Transition>
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
children: o.oneOfType([o.func.isRequired, o.element.isRequired]).isRequired,
|
|
162
|
-
/**
|
|
163
|
-
* Show the component; triggers the enter or exit states
|
|
164
|
-
*/
|
|
165
|
-
in: o.bool,
|
|
166
|
-
/**
|
|
167
|
-
* By default the child component is mounted immediately along with
|
|
168
|
-
* the parent `Transition` component. If you want to "lazy mount" the component on the
|
|
169
|
-
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
170
|
-
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
171
|
-
*/
|
|
172
|
-
mountOnEnter: o.bool,
|
|
173
|
-
/**
|
|
174
|
-
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
175
|
-
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
176
|
-
*/
|
|
177
|
-
unmountOnExit: o.bool,
|
|
178
|
-
/**
|
|
179
|
-
* By default the child component does not perform the enter transition when
|
|
180
|
-
* it first mounts, regardless of the value of `in`. If you want this
|
|
181
|
-
* behavior, set both `appear` and `in` to `true`.
|
|
182
|
-
*
|
|
183
|
-
* > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
|
|
184
|
-
* > only adds an additional enter transition. However, in the
|
|
185
|
-
* > `<CSSTransition>` component that first enter transition does result in
|
|
186
|
-
* > additional `.appear-*` classes, that way you can choose to style it
|
|
187
|
-
* > differently.
|
|
188
|
-
*/
|
|
189
|
-
appear: o.bool,
|
|
190
|
-
/**
|
|
191
|
-
* Enable or disable enter transitions.
|
|
192
|
-
*/
|
|
193
|
-
enter: o.bool,
|
|
194
|
-
/**
|
|
195
|
-
* Enable or disable exit transitions.
|
|
196
|
-
*/
|
|
197
|
-
exit: o.bool,
|
|
198
|
-
/**
|
|
199
|
-
* The duration of the transition, in milliseconds.
|
|
200
|
-
* Required unless `addEndListener` is provided.
|
|
201
|
-
*
|
|
202
|
-
* You may specify a single timeout for all transitions:
|
|
203
|
-
*
|
|
204
|
-
* ```jsx
|
|
205
|
-
* timeout={500}
|
|
206
|
-
* ```
|
|
207
|
-
*
|
|
208
|
-
* or individually:
|
|
209
|
-
*
|
|
210
|
-
* ```jsx
|
|
211
|
-
* timeout={{
|
|
212
|
-
* appear: 500,
|
|
213
|
-
* enter: 300,
|
|
214
|
-
* exit: 500,
|
|
215
|
-
* }}
|
|
216
|
-
* ```
|
|
217
|
-
*
|
|
218
|
-
* - `appear` defaults to the value of `enter`
|
|
219
|
-
* - `enter` defaults to `0`
|
|
220
|
-
* - `exit` defaults to `0`
|
|
221
|
-
*
|
|
222
|
-
* @type {number | { enter?: number, exit?: number, appear?: number }}
|
|
223
|
-
*/
|
|
224
|
-
timeout: function(u) {
|
|
225
|
-
var a = R;
|
|
226
|
-
u.addEndListener || (a = a.isRequired);
|
|
227
|
-
for (var i = arguments.length, e = new Array(i > 1 ? i - 1 : 0), t = 1; t < i; t++)
|
|
228
|
-
e[t - 1] = arguments[t];
|
|
229
|
-
return a.apply(void 0, [u].concat(e));
|
|
230
|
-
},
|
|
231
|
-
/**
|
|
232
|
-
* Add a custom transition end trigger. Called with the transitioning
|
|
233
|
-
* DOM node and a `done` callback. Allows for more fine grained transition end
|
|
234
|
-
* logic. Timeouts are still used as a fallback if provided.
|
|
235
|
-
*
|
|
236
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
237
|
-
*
|
|
238
|
-
* ```jsx
|
|
239
|
-
* addEndListener={(node, done) => {
|
|
240
|
-
* // use the css transitionend event to mark the finish of a transition
|
|
241
|
-
* node.addEventListener('transitionend', done, false);
|
|
242
|
-
* }}
|
|
243
|
-
* ```
|
|
244
|
-
*/
|
|
245
|
-
addEndListener: o.func,
|
|
246
|
-
/**
|
|
247
|
-
* Callback fired before the "entering" status is applied. An extra parameter
|
|
248
|
-
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
249
|
-
*
|
|
250
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
251
|
-
*
|
|
252
|
-
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
253
|
-
*/
|
|
254
|
-
onEnter: o.func,
|
|
255
|
-
/**
|
|
256
|
-
* Callback fired after the "entering" status is applied. An extra parameter
|
|
257
|
-
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
258
|
-
*
|
|
259
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
260
|
-
*
|
|
261
|
-
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
262
|
-
*/
|
|
263
|
-
onEntering: o.func,
|
|
264
|
-
/**
|
|
265
|
-
* Callback fired after the "entered" status is applied. An extra parameter
|
|
266
|
-
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
267
|
-
*
|
|
268
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
269
|
-
*
|
|
270
|
-
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
271
|
-
*/
|
|
272
|
-
onEntered: o.func,
|
|
273
|
-
/**
|
|
274
|
-
* Callback fired before the "exiting" status is applied.
|
|
275
|
-
*
|
|
276
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
277
|
-
*
|
|
278
|
-
* @type Function(node: HtmlElement) -> void
|
|
279
|
-
*/
|
|
280
|
-
onExit: o.func,
|
|
281
|
-
/**
|
|
282
|
-
* Callback fired after the "exiting" status is applied.
|
|
283
|
-
*
|
|
284
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed.
|
|
285
|
-
*
|
|
286
|
-
* @type Function(node: HtmlElement) -> void
|
|
287
|
-
*/
|
|
288
|
-
onExiting: o.func,
|
|
289
|
-
/**
|
|
290
|
-
* Callback fired after the "exited" status is applied.
|
|
291
|
-
*
|
|
292
|
-
* **Note**: when `nodeRef` prop is passed, `node` is not passed
|
|
293
|
-
*
|
|
294
|
-
* @type Function(node: HtmlElement) -> void
|
|
295
|
-
*/
|
|
296
|
-
onExited: o.func
|
|
297
|
-
} : {};
|
|
298
|
-
function E() {
|
|
299
|
-
}
|
|
300
|
-
p.defaultProps = {
|
|
301
|
-
in: !1,
|
|
302
|
-
mountOnEnter: !1,
|
|
303
|
-
unmountOnExit: !1,
|
|
304
|
-
appear: !1,
|
|
305
|
-
enter: !0,
|
|
306
|
-
exit: !0,
|
|
307
|
-
onEnter: E,
|
|
308
|
-
onEntering: E,
|
|
309
|
-
onEntered: E,
|
|
310
|
-
onExit: E,
|
|
311
|
-
onExiting: E,
|
|
312
|
-
onExited: E
|
|
48
|
+
);
|
|
313
49
|
};
|
|
314
|
-
p.UNMOUNTED = x;
|
|
315
|
-
p.EXITED = l;
|
|
316
|
-
p.ENTERING = f;
|
|
317
|
-
p.ENTERED = h;
|
|
318
|
-
p.EXITING = T;
|
|
319
|
-
const _ = p;
|
|
320
50
|
export {
|
|
321
|
-
|
|
322
|
-
f as ENTERING,
|
|
323
|
-
l as EXITED,
|
|
324
|
-
T as EXITING,
|
|
325
|
-
x as UNMOUNTED,
|
|
326
|
-
_ as default
|
|
51
|
+
T as Tab
|
|
327
52
|
};
|
|
328
53
|
//# sourceMappingURL=sd-component-library270.js.map
|