@selfdecode/sd-component-library 4.0.90 → 4.0.91
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/containers/flex-containers/flex-containers.d.ts +6 -6
- package/lib/components/containers/grid-containers/grid-align-content-start/grid-align-content-start.d.ts +1 -1
- package/lib/components/containers/grid-containers/grid-center/grid-center.d.ts +1 -1
- package/lib/components/containers/grid-containers/grid-container-v2/grid-container-v2.d.ts +1 -1
- package/lib/components/texts/mixed-texts.d.ts +2 -2
- package/lib/components/texts/responsive-texts.d.ts +6 -6
- package/lib/components/texts/transformed-texts.d.ts +3 -3
- package/lib/components/texts/weighted-texts.d.ts +3 -3
- package/lib/core/theme.d.ts +19 -0
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library101.js +3 -3
- 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-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-library132.js +3 -3
- package/lib/sd-component-library133.js +1 -1
- package/lib/sd-component-library15.js +1 -1
- package/lib/sd-component-library166.js +1 -1
- package/lib/sd-component-library194.js +19 -0
- package/lib/sd-component-library194.js.map +1 -1
- package/lib/sd-component-library195.js +3 -3
- package/lib/sd-component-library199.js +57 -3
- package/lib/sd-component-library199.js.map +1 -1
- package/lib/sd-component-library200.js +63 -55
- package/lib/sd-component-library200.js.map +1 -1
- package/lib/sd-component-library201.js +2 -25
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -19
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +599 -5
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +21 -5
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +3 -65
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +3 -2
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +3 -30
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +60 -595
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -18
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +40 -21
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +129 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -3
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +3 -64
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +48 -19
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +59 -34
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -129
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +46 -13
- package/lib/sd-component-library217.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 -45
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +3 -65
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +31 -3
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +19 -46
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +20 -17
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +28 -3
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +33 -3
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +3 -31
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library23.js +2 -2
- package/lib/sd-component-library230.js +129 -19
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +42 -19
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +47 -28
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +7 -32
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +64 -129
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +41 -41
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +12 -46
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +21 -8
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +103 -58
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +41 -37
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library24.js +2 -2
- package/lib/sd-component-library240.js +23 -12
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +53 -21
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +46 -107
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +71 -43
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +40 -23
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +24 -50
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +19 -46
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +20 -75
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +2 -41
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +24 -26
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library25.js +1 -1
- package/lib/sd-component-library250.js +15 -17
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +5 -20
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +5 -2
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +18 -26
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library256.js +21 -25
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library258.js +22 -24
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library260.js +30 -25
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +50 -21
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +131 -30
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +62 -39
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +62 -117
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +25 -70
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +18 -70
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +30 -122
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +20 -29
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +121 -17
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +109 -112
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library282.js +70 -10
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +101 -69
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +95 -91
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +10 -106
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library289.js +4 -4
- package/lib/sd-component-library290.js +3 -2
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +3 -8
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +3 -328
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +2 -51
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +8 -3
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +328 -3
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +51 -3
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library314.js +47 -89
- package/lib/sd-component-library314.js.map +1 -1
- package/lib/sd-component-library315.js +89 -47
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library32.js +1 -1
- package/lib/sd-component-library321.js +1 -1
- package/lib/sd-component-library33.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library5.js +1 -1
- package/lib/sd-component-library50.js +1 -1
- package/lib/sd-component-library52.js +3 -3
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library54.js +2 -2
- package/lib/sd-component-library55.js +72 -65
- package/lib/sd-component-library55.js.map +1 -1
- package/lib/sd-component-library57.js +26 -25
- package/lib/sd-component-library57.js.map +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library62.js +3 -3
- 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-library70.js +2 -2
- 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-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,128 +1,125 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ResponsiveTextV2 as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
color:
|
|
9
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
borderRadius: j = "4px",
|
|
38
|
-
tabHeaderComponent: a,
|
|
39
|
-
elementId: g,
|
|
40
|
-
maxWidth: _,
|
|
41
|
-
labelSx: R,
|
|
42
|
-
secondaryTextSx: S,
|
|
43
|
-
containerSx: w
|
|
44
|
-
}) {
|
|
45
|
-
const T = a ? i ? c : o : b || e;
|
|
46
|
-
return /* @__PURE__ */ t.jsxs(
|
|
47
|
-
f,
|
|
1
|
+
import { j as i } from "./sd-component-library195.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-library149.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,
|
|
48
37
|
{
|
|
49
|
-
|
|
38
|
+
onClick: () => S(b),
|
|
50
39
|
sx: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
position: "relative",
|
|
42
|
+
left: `-${n > e ? 2 : n == e ? 1 : 0}px`,
|
|
43
|
+
zIndex: t ? 1 : 0
|
|
55
44
|
},
|
|
45
|
+
ref: c,
|
|
56
46
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
47
|
+
/* @__PURE__ */ i.jsx(
|
|
48
|
+
s,
|
|
59
49
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
display: "flex",
|
|
70
|
-
children: [
|
|
71
|
-
r && /* @__PURE__ */ t.jsx(
|
|
72
|
-
m,
|
|
73
|
-
{
|
|
74
|
-
fontSizeWeight: [[13, "bold"]],
|
|
75
|
-
sx: {
|
|
76
|
-
letterSpacing: "1.3px",
|
|
77
|
-
textTransform: "uppercase",
|
|
78
|
-
...R
|
|
79
|
-
},
|
|
80
|
-
"data-testid": "tab-text",
|
|
81
|
-
color: i ? e : l,
|
|
82
|
-
children: r
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
x && /* @__PURE__ */ t.jsx(
|
|
86
|
-
m,
|
|
87
|
-
{
|
|
88
|
-
fontSizeWeight: [[10, "semi-bold"]],
|
|
89
|
-
sx: {
|
|
90
|
-
letterSpacing: "1px",
|
|
91
|
-
textTransform: "uppercase",
|
|
92
|
-
...S
|
|
93
|
-
},
|
|
94
|
-
color: i ? e : l,
|
|
95
|
-
children: x
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
p && /* @__PURE__ */ t.jsx(
|
|
99
|
-
f,
|
|
100
|
-
{
|
|
101
|
-
height: "16px",
|
|
102
|
-
flexDirection: "column",
|
|
103
|
-
justifyContent: "space-between",
|
|
104
|
-
ml: "10px",
|
|
105
|
-
children: p
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
a
|
|
109
|
-
]
|
|
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"
|
|
58
|
+
}
|
|
110
59
|
}
|
|
111
60
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
61
|
+
/* @__PURE__ */ i.jsx(
|
|
62
|
+
s,
|
|
114
63
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
+
}
|
|
118
116
|
}
|
|
119
117
|
)
|
|
120
118
|
]
|
|
121
119
|
}
|
|
122
120
|
);
|
|
123
|
-
}
|
|
121
|
+
};
|
|
124
122
|
export {
|
|
125
|
-
|
|
126
|
-
E as Tab
|
|
123
|
+
R as TabV2
|
|
127
124
|
};
|
|
128
125
|
//# sourceMappingURL=sd-component-library270.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library270.js","sources":["../src/components/tabs/tab-bar/partials/tab/tab.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"sd-component-library270.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":";;;;AAOO,MAAMA,IAAyB,CAAC;AAAA,EACrC,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,wBAAAC,IAAyB;AAAA,EACzB,gBAAAC,IAAiB;AACnB,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AA,gBACC,gBAAgB,CAAChB,GAAU,MAAM;AAAA,gBACjC,eAAc;AAAA,gBACd,OAAOO,IAASjB,IAAcD;AAAA,gBAC9B,IAAI;AAAA,kBACF,IAAI;AAAA,kBACJ,eAAe;AAAA,kBACf,IAAAU;AAAA,gBACF;AAAA,gBAEC,UAAAX;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QACF;AAAA,QAEA2B,gBAAAA,EAAA;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,cACF,QAAQ,GAAGrB,IAAeU,CAAsB;AAAA,cAChD,aAAAX;AAAA,cACA,aAAAD;AAAA,cACA,mBAAmBgB,IAAS,SAAS;AAAA,cACrC,iBAAiBI,IAAkB,UAAU;AAAA,cAC7C,kBAAkBD,IAAiB,UAAU;AAAA,cAC7C,gBAAgB;AAAA,cAChB,cAAc,OAAOA,IAAiBjB,IAAe,CAAC,MACpDkB,IAAkBlB,IAAe,CACnC;AAAA,cACA,IAAI;AAAA,cACJ,IAAIc,IAAS,QAAQ;AAAA,YACvB;AAAA,UAAA;AAAA,QACF;AAAA,QAECA,KACCQ,gBAAAA,EAAA;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,cACF,IAAIxB;AAAA,cACJ,QAAQ,GAAGQ,CAAU;AAAA,cACrB,OAAO,GAAGD,CAAS;AAAA,cACnB,UAAU;AAAA,cACV,MAAM;AAAA,cACN,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,cAAc;AAAA,YAChB;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,13 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { startOfDay as y, addDays as l, endOfDay as i, startOfWeek as O, addWeeks as n, endOfWeek as S, startOfMonth as u, addMonths as f, endOfMonth as M, startOfYear as b, addYears as c, endOfYear as C, isSameDay as r, format as W } from "date-fns";
|
|
2
|
+
const D = (t) => W(t, "EEE d MMM yyyy"), x = (t) => {
|
|
3
|
+
const e = "No date selected";
|
|
4
|
+
return !t || !t.startDate || !t.endDate ? e : r(t.startDate, t.endDate) ? D(t.startDate) : `${D(t.startDate)} - ${D(
|
|
5
|
+
t.endDate
|
|
6
|
+
)}`;
|
|
7
|
+
}, Y = [
|
|
8
|
+
{
|
|
9
|
+
label: "Yesterday",
|
|
10
|
+
startDate: y(l(/* @__PURE__ */ new Date(), -1)),
|
|
11
|
+
endDate: i(l(/* @__PURE__ */ new Date(), -1))
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: "Last Week",
|
|
15
|
+
startDate: O(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 }),
|
|
16
|
+
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Last 2 Weeks",
|
|
20
|
+
startDate: O(n(/* @__PURE__ */ new Date(), -2), { weekStartsOn: 1 }),
|
|
21
|
+
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Last Month",
|
|
25
|
+
startDate: u(f(/* @__PURE__ */ new Date(), -1)),
|
|
26
|
+
endDate: M(f(/* @__PURE__ */ new Date(), -1))
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Last Year",
|
|
30
|
+
startDate: b(c(/* @__PURE__ */ new Date(), -1)),
|
|
31
|
+
endDate: C(c(/* @__PURE__ */ new Date(), -1))
|
|
32
|
+
}
|
|
33
|
+
], _ = (t, e, E, k, m, h) => {
|
|
34
|
+
const o = (m || Y).map(
|
|
35
|
+
({ label: s, startDate: d, endDate: w }) => ({
|
|
36
|
+
label: s,
|
|
37
|
+
range: (a) => ({
|
|
38
|
+
startDate: d,
|
|
39
|
+
endDate: w
|
|
40
|
+
}),
|
|
41
|
+
isSelected: (a) => a.startDate && a.endDate ? r(a.startDate, d) && r(a.endDate, w) : !1
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
return h ? o.concat({
|
|
45
|
+
label: "Custom Range",
|
|
46
|
+
range: (s) => (e(), {
|
|
47
|
+
startDate: (t == null ? void 0 : t.startDate) || /* @__PURE__ */ new Date(),
|
|
48
|
+
endDate: (t == null ? void 0 : t.endDate) || /* @__PURE__ */ new Date()
|
|
49
|
+
}),
|
|
50
|
+
isSelected: (s) => k
|
|
51
|
+
}) : o;
|
|
52
|
+
}, g = (t) => ({
|
|
53
|
+
...t,
|
|
54
|
+
rangeColors: [t.color ?? "#9E1CB5"],
|
|
55
|
+
weekStartsOn: 1,
|
|
56
|
+
inputRanges: [],
|
|
57
|
+
ranges: [
|
|
58
|
+
t.selectedRange ?? {
|
|
59
|
+
startDate: /* @__PURE__ */ new Date(),
|
|
60
|
+
endDate: /* @__PURE__ */ new Date()
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
months: t.months,
|
|
64
|
+
onChange: (e) => {
|
|
65
|
+
t.setSelectedRange(e.range1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
10
68
|
export {
|
|
11
|
-
|
|
69
|
+
g as getCalendarProps,
|
|
70
|
+
x as getSelectedRangeText,
|
|
71
|
+
_ as getStaticRanges
|
|
12
72
|
};
|
|
13
73
|
//# sourceMappingURL=sd-component-library282.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library282.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library282.js","sources":["../src/components/inputs/date-inputs/base-date-range-input/utils.ts"],"sourcesContent":["import { OnChangeProps, Range, StaticRange } from \"react-date-range\";\n\nimport {\n addDays,\n addMonths,\n addWeeks,\n addYears,\n endOfDay,\n endOfMonth,\n endOfWeek,\n endOfYear,\n format,\n isSameDay,\n startOfDay,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from \"date-fns\";\n\nimport { OnRangeSelection, StaticRangeOption } from \"./interfaces\";\nimport { BaseDateRangeInputMobileProps } from \"./partials/base-date-range-input-mobile/interfaces\";\n\nconst getFormattedDate = (date: Date) => format(date, \"EEE d MMM yyyy\");\n\nexport const getSelectedRangeText = (range: Range | null | undefined) => {\n const defaultText = \"No date selected\";\n\n return !range || !range.startDate || !range.endDate\n ? defaultText\n : isSameDay(range.startDate, range.endDate)\n ? getFormattedDate(range.startDate)\n : `${getFormattedDate(range.startDate)} - ${getFormattedDate(\n range.endDate\n )}`;\n};\n\nconst ranges = [\n {\n label: \"Yesterday\",\n startDate: startOfDay(addDays(new Date(), -1)),\n endDate: endOfDay(addDays(new Date(), -1)),\n },\n {\n label: \"Last Week\",\n startDate: startOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n endDate: endOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n },\n {\n label: \"Last 2 Weeks\",\n startDate: startOfWeek(addWeeks(new Date(), -2), { weekStartsOn: 1 }),\n endDate: endOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n },\n {\n label: \"Last Month\",\n startDate: startOfMonth(addMonths(new Date(), -1)),\n endDate: endOfMonth(addMonths(new Date(), -1)),\n },\n {\n label: \"Last Year\",\n startDate: startOfYear(addYears(new Date(), -1)),\n endDate: endOfYear(addYears(new Date(), -1)),\n },\n];\n\nexport const getStaticRanges = (\n selectedRange: Range | undefined | null,\n onCustomRangeSelect: () => void,\n deselectCustomRange: () => void,\n customOptionSelected: boolean,\n customRanges?: StaticRangeOption[],\n mobile?: boolean\n): StaticRange[] => {\n const rangesToShow = customRanges || ranges;\n const staticRanges: StaticRange[] = rangesToShow.map(\n ({ label, startDate, endDate }) => ({\n label,\n range: (_) => ({\n startDate,\n endDate,\n }),\n isSelected: (range) =>\n range.startDate && range.endDate\n ? isSameDay(range.startDate, startDate) &&\n isSameDay(range.endDate, endDate)\n : false,\n })\n );\n\n return !mobile\n ? staticRanges\n : staticRanges.concat({\n label: \"Custom Range\",\n range: (_) => {\n onCustomRangeSelect();\n return {\n startDate: selectedRange?.startDate || new Date(),\n endDate: selectedRange?.endDate || new Date(),\n };\n },\n isSelected: (_) => customOptionSelected,\n });\n};\n\nexport const getCalendarProps = (props: BaseDateRangeInputMobileProps) => ({\n ...props,\n rangeColors: [props.color ?? \"#9E1CB5\"],\n weekStartsOn: 1,\n inputRanges: [],\n ranges: [\n props.selectedRange ?? {\n startDate: new Date(),\n endDate: new Date(),\n },\n ],\n months: props.months,\n onChange: (value: OnChangeProps) => {\n props.setSelectedRange((value as OnRangeSelection).range1);\n },\n});\n"],"names":["getFormattedDate","date","format","getSelectedRangeText","range","defaultText","isSameDay","ranges","startOfDay","addDays","endOfDay","startOfWeek","addWeeks","endOfWeek","startOfMonth","addMonths","endOfMonth","startOfYear","addYears","endOfYear","getStaticRanges","selectedRange","onCustomRangeSelect","deselectCustomRange","customOptionSelected","customRanges","mobile","staticRanges","label","startDate","endDate","_","getCalendarProps","props","value"],"mappings":";AAsBA,MAAMA,IAAmB,CAACC,MAAeC,EAAOD,GAAM,gBAAgB,GAEzDE,IAAuB,CAACC,MAAoC;AACvE,QAAMC,IAAc;AAEb,SAAA,CAACD,KAAS,CAACA,EAAM,aAAa,CAACA,EAAM,UACxCC,IACAC,EAAUF,EAAM,WAAWA,EAAM,OAAO,IACxCJ,EAAiBI,EAAM,SAAS,IAChC,GAAGJ,EAAiBI,EAAM,SAAS,CAAC,MAAMJ;AAAA,IACxCI,EAAM;AAAA,EACP,CAAA;AACP,GAEMG,IAAS;AAAA,EACb;AAAA,IACE,OAAO;AAAA,IACP,WAAWC,EAAWC,sBAAY,KAAK,GAAG,EAAE,CAAC;AAAA,IAC7C,SAASC,EAASD,sBAAY,KAAK,GAAG,EAAE,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,WAAWE,EAAYC,E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A,KAAA,gBAAAA,EAAe,YAAW,oBAAI,KAAK;AAAA,IAAA;AAAA,IAGhD,YAAY,CAACU,MAAMP;AAAA,EAAA,CACpB,IAXDG;AAYN,GAEaK,IAAmB,CAACC,OAA0C;AAAA,EACzE,GAAGA;AAAA,EACH,aAAa,CAACA,EAAM,SAAS,SAAS;AAAA,EACtC,cAAc;AAAA,EACd,aAAa,CAAC;AAAA,EACd,QAAQ;AAAA,IACNA,EAAM,iBAAiB;AAAA,MACrB,+BAAe,KAAK;AAAA,MACpB,6BAAa,KAAK;AAAA,IACpB;AAAA,EACF;AAAA,EACA,QAAQA,EAAM;AAAA,EACd,UAAU,CAACC,MAAyB;AAC5B,IAAAD,EAAA,iBAAkBC,EAA2B,MAAM;AAAA,EAC3D;AACF;"}
|
|
@@ -1,73 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
import { j as r } from "./sd-component-library195.js";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { DateRangePicker as s } from "react-date-range";
|
|
4
|
+
import { Box as x } from "rebass";
|
|
5
|
+
import { getCalendarProps as c } from "./sd-component-library282.js";
|
|
6
|
+
import { OutsideClickBox as m } from "./sd-component-library11.js";
|
|
7
|
+
import { ResponsiveTextV2 as f } from "./sd-component-library149.js";
|
|
8
|
+
import { SelectedRangeText as h } from "./sd-component-library321.js";
|
|
9
|
+
import { FrFrContainer as g } from "./sd-component-library37.js";
|
|
10
|
+
import { PrimaryTextButton as u } from "./sd-component-library21.js";
|
|
11
|
+
import { ApplyButton as R } from "./sd-component-library322.js";
|
|
12
|
+
const z = l.forwardRef(
|
|
13
|
+
(e, i) => {
|
|
14
|
+
const { zIndex: n, customOptionSelected: a, handleCancel: o, getStaticRanges: d } = e, p = (t) => {
|
|
15
|
+
t == null || t.preventDefault(), o();
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ r.jsx(
|
|
18
|
+
x,
|
|
19
|
+
{
|
|
20
|
+
sx: {
|
|
21
|
+
position: "fixed",
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
width: "100vw",
|
|
25
|
+
height: "100vh",
|
|
26
|
+
overflowY: "auto",
|
|
27
|
+
py: "30px",
|
|
28
|
+
bg: "#434A5499"
|
|
29
|
+
},
|
|
30
|
+
"data-testid": "calendar-wrapper",
|
|
31
|
+
children: /* @__PURE__ */ r.jsxs(
|
|
32
|
+
m,
|
|
33
|
+
{
|
|
34
|
+
onClickOutside: p,
|
|
35
|
+
sx: {
|
|
36
|
+
borderStyle: "solid",
|
|
37
|
+
borderWidth: "1px",
|
|
38
|
+
borderColor: "cl_lightGrey",
|
|
39
|
+
minWidth: "352px",
|
|
40
|
+
width: "max-content",
|
|
41
|
+
backgroundColor: "#fff",
|
|
42
|
+
m: "auto",
|
|
43
|
+
borderRadius: "4px",
|
|
44
|
+
zIndex: n,
|
|
45
|
+
".rdrDateRangePickerWrapper": {
|
|
46
|
+
width: "100%",
|
|
47
|
+
flexDirection: "column"
|
|
48
|
+
},
|
|
49
|
+
".rdrDefinedRangesWrapper": {
|
|
50
|
+
width: "100%"
|
|
51
|
+
},
|
|
52
|
+
".rdrCalendarWrapper": {
|
|
53
|
+
display: a ? "inline-flex" : "none"
|
|
54
|
+
},
|
|
55
|
+
".rdrInputRanges": {
|
|
56
|
+
display: "none"
|
|
57
|
+
},
|
|
58
|
+
".rdrStaticRanges:before": {
|
|
59
|
+
fontSize: "16px",
|
|
60
|
+
fontFamily: "proxima-nova",
|
|
61
|
+
color: "#9BA2B4",
|
|
62
|
+
fontWeight: "300",
|
|
63
|
+
p: "10px 20px"
|
|
64
|
+
},
|
|
65
|
+
".rdrStaticRange": {
|
|
66
|
+
fontSize: "16px",
|
|
67
|
+
fontFamily: "proxima-nova",
|
|
68
|
+
color: "#434A54",
|
|
69
|
+
borderBottomWidth: "0"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ r.jsx(f, { fontSizeWeight: [12, "semi-bold"], ref: i, children: /* @__PURE__ */ r.jsx(
|
|
74
|
+
s,
|
|
75
|
+
{
|
|
76
|
+
...c(e),
|
|
77
|
+
direction: "vertical",
|
|
78
|
+
staticRanges: d(!0)
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ r.jsx(h, { ...e, isMobile: !0 }),
|
|
82
|
+
/* @__PURE__ */ r.jsxs(g, { p: "10px 20px", children: [
|
|
83
|
+
/* @__PURE__ */ r.jsx(
|
|
84
|
+
u,
|
|
85
|
+
{
|
|
86
|
+
onClick: o,
|
|
87
|
+
height: "42px",
|
|
88
|
+
color: "cl_darkGrey",
|
|
89
|
+
padding: "0",
|
|
90
|
+
children: "Cancel"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ r.jsx(R, { ...e })
|
|
94
|
+
] })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
);
|
|
32
100
|
}
|
|
33
|
-
|
|
34
|
-
const o = (m || Y).map(
|
|
35
|
-
({ label: s, startDate: d, endDate: w }) => ({
|
|
36
|
-
label: s,
|
|
37
|
-
range: (a) => ({
|
|
38
|
-
startDate: d,
|
|
39
|
-
endDate: w
|
|
40
|
-
}),
|
|
41
|
-
isSelected: (a) => a.startDate && a.endDate ? r(a.startDate, d) && r(a.endDate, w) : !1
|
|
42
|
-
})
|
|
43
|
-
);
|
|
44
|
-
return h ? o.concat({
|
|
45
|
-
label: "Custom Range",
|
|
46
|
-
range: (s) => (e(), {
|
|
47
|
-
startDate: (t == null ? void 0 : t.startDate) || /* @__PURE__ */ new Date(),
|
|
48
|
-
endDate: (t == null ? void 0 : t.endDate) || /* @__PURE__ */ new Date()
|
|
49
|
-
}),
|
|
50
|
-
isSelected: (s) => k
|
|
51
|
-
}) : o;
|
|
52
|
-
}, g = (t) => ({
|
|
53
|
-
...t,
|
|
54
|
-
rangeColors: [t.color ?? "#9E1CB5"],
|
|
55
|
-
weekStartsOn: 1,
|
|
56
|
-
inputRanges: [],
|
|
57
|
-
ranges: [
|
|
58
|
-
t.selectedRange ?? {
|
|
59
|
-
startDate: /* @__PURE__ */ new Date(),
|
|
60
|
-
endDate: /* @__PURE__ */ new Date()
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
months: t.months,
|
|
64
|
-
onChange: (e) => {
|
|
65
|
-
t.setSelectedRange(e.range1);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
101
|
+
);
|
|
68
102
|
export {
|
|
69
|
-
|
|
70
|
-
x as getSelectedRangeText,
|
|
71
|
-
_ as getStaticRanges
|
|
103
|
+
z as BaseDateRangeInputMobile
|
|
72
104
|
};
|
|
73
105
|
//# sourceMappingURL=sd-component-library283.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library283.js","sources":["../src/components/inputs/date-inputs/base-date-range-input/
|
|
1
|
+
{"version":3,"file":"sd-component-library283.js","sources":["../src/components/inputs/date-inputs/base-date-range-input/partials/base-date-range-input-mobile/base-date-range-input-mobile.tsx"],"sourcesContent":["import React from \"react\";\nimport { DateRangePicker } from \"react-date-range\";\n\nimport { Box } from \"rebass\";\n\nimport { OutsideClickBox } from \"../../../../../boxes\";\nimport { PrimaryTextButton } from \"../../../../../buttons\";\nimport { FrFrContainer } from \"../../../../../containers\";\nimport { ResponsiveTextV2 } from \"../../../../../texts/responsive-text-v2\";\nimport { getCalendarProps } from \"../../utils\";\nimport { ApplyButton } from \"../apply-button\";\nimport { SelectedRangeText } from \"../selected-range-text\";\nimport { BaseDateRangeInputMobileProps as Props } from \"./interfaces\";\n\nexport const BaseDateRangeInputMobile = React.forwardRef<HTMLDivElement, Props>(\n (props, ref) => {\n const { zIndex, customOptionSelected, handleCancel, getStaticRanges } =\n props;\n\n const onClickOutside = (event?: React.MouseEvent<HTMLDivElement>) => {\n event?.preventDefault();\n handleCancel();\n };\n\n return (\n <Box\n sx={{\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n overflowY: \"auto\",\n py: \"30px\",\n bg: \"#434A5499\",\n }}\n data-testid=\"calendar-wrapper\"\n >\n <OutsideClickBox\n onClickOutside={onClickOutside}\n sx={{\n borderStyle: \"solid\",\n borderWidth: \"1px\",\n borderColor: \"cl_lightGrey\",\n minWidth: \"352px\",\n width: \"max-content\",\n backgroundColor: \"#fff\",\n m: \"auto\",\n borderRadius: \"4px\",\n zIndex,\n \".rdrDateRangePickerWrapper\": {\n width: \"100%\",\n flexDirection: \"column\",\n },\n \".rdrDefinedRangesWrapper\": {\n width: \"100%\",\n },\n \".rdrCalendarWrapper\": {\n display: customOptionSelected ? \"inline-flex\" : \"none\",\n },\n \".rdrInputRanges\": {\n display: \"none\",\n },\n \".rdrStaticRanges:before\": {\n fontSize: \"16px\",\n fontFamily: \"proxima-nova\",\n color: \"#9BA2B4\",\n fontWeight: \"300\",\n p: \"10px 20px\",\n },\n \".rdrStaticRange\": {\n fontSize: \"16px\",\n fontFamily: \"proxima-nova\",\n color: \"#434A54\",\n borderBottomWidth: \"0\",\n },\n }}\n >\n <ResponsiveTextV2 fontSizeWeight={[12, \"semi-bold\"]} ref={ref}>\n <DateRangePicker\n {...getCalendarProps(props)}\n direction=\"vertical\"\n staticRanges={getStaticRanges(true)}\n />\n </ResponsiveTextV2>\n\n <SelectedRangeText {...props} isMobile />\n\n <FrFrContainer p=\"10px 20px\">\n <PrimaryTextButton\n onClick={handleCancel}\n height=\"42px\"\n color=\"cl_darkGrey\"\n padding=\"0\"\n >\n Cancel\n </PrimaryTextButton>\n\n <ApplyButton {...props} />\n </FrFrContainer>\n </OutsideClickBox>\n </Box>\n );\n }\n);\n"],"names":["BaseDateRangeInputMobile","React","props","ref","zIndex","customOptionSelected","handleCancel","getStaticRanges","onClickOutside","event","jsx","Box","jsxs","OutsideClickBox","ResponsiveTextV2","DateRangePicker","getCalendarProps","SelectedRangeText","FrFrContainer","PrimaryTextButton","ApplyButton"],"mappings":";;;;;;;;;;;AAcO,MAAMA,IAA2BC,EAAM;AAAA,EAC5C,CAACC,GAAOC,MAAQ;AACd,UAAM,EAAE,QAAAC,GAAQ,sBAAAC,GAAsB,cAAAC,GAAc,iBAAAC,MAClDL,GAEIM,IAAiB,CAACC,MAA6C;AACnE,MAAAA,KAAA,QAAAA,EAAO,kBACMH;IAAA;AAIb,WAAAI,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,UACF,UAAU;AAAA,UACV,KAAK;AAAA,UACL,MAAM;AAAA,UACN,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QACA,eAAY;AAAA,QAEZ,UAAAC,gBAAAA,EAAA;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,gBAAAL;AAAA,YACA,IAAI;AAAA,cACF,aAAa;AAAA,cACb,aAAa;AAAA,cACb,aAAa;AAAA,cACb,UAAU;AAAA,cACV,OAAO;AAAA,cACP,iBAAiB;AAAA,cACjB,GAAG;AAAA,cACH,cAAc;AAAA,cACd,QAAAJ;AAAA,cACA,8BAA8B;AAAA,gBAC5B,OAAO;AAAA,gBACP,eAAe;AAAA,cACjB;AAAA,cACA,4BAA4B;AAAA,gBAC1B,OAAO;AAAA,cACT;AAAA,cACA,uBAAuB;AAAA,gBACr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