@selfdecode/sd-component-library 4.0.143 → 4.0.145
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 +4 -4
- package/lib/sd-component-library106.js +4 -4
- package/lib/sd-component-library111.js +1 -1
- package/lib/sd-component-library117.js +1 -1
- package/lib/sd-component-library118.js +1 -1
- package/lib/sd-component-library120.js +1 -1
- package/lib/sd-component-library121.js +1 -1
- package/lib/sd-component-library126.js +1 -1
- package/lib/sd-component-library127.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-library200.js +2 -60
- package/lib/sd-component-library200.js.map +1 -1
- package/lib/sd-component-library201.js +30 -2
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +590 -21
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +56 -595
- package/lib/sd-component-library203.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 +19 -62
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +3 -23
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +3 -40
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +128 -13
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +13 -3
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +14 -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 +3 -65
- 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 +46 -3
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +54 -41
- 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-library230.js +1 -1
- package/lib/sd-component-library231.js +1 -1
- package/lib/sd-component-library233.js +64 -129
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library235.js +36 -40
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +12 -7
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +21 -21
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +109 -20
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +45 -46
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +23 -74
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +53 -2
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +20 -63
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +20 -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 +2 -47
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +74 -23
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +25 -49
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +3 -325
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +24 -5
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library252.js +3 -41
- package/lib/sd-component-library252.js.map +1 -1
- package/lib/sd-component-library253.js +324 -26
- package/lib/sd-component-library253.js.map +1 -1
- package/lib/sd-component-library254.js +5 -29
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library255.js +2 -3
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +2 -24
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +129 -3
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +43 -21
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +8 -22
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +25 -30
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +21 -50
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +30 -134
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +119 -59
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +38 -63
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +74 -9
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +72 -47
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +25 -85
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +19 -90
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +120 -25
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +117 -16
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +10 -125
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +39 -111
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +9 -10
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +49 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library275.js +90 -2
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +92 -2
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library279.js +70 -10
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +101 -69
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library281.js +95 -91
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +10 -106
- package/lib/sd-component-library282.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 +4 -92
- 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-library300.js +4 -5
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +35 -4
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library303.js +1 -1
- package/lib/sd-component-library315.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-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 +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-library81.js +9 -7
- package/lib/sd-component-library81.js.map +1 -1
- package/lib/sd-component-library89.js +3 -3
- package/lib/sd-component-library92.js +3 -3
- package/lib/sd-component-library94.js +5 -5
- package/lib/sd-component-library98.js +2 -2
- package/lib/sd-component-library99.js +3 -3
- package/package.json +1 -1
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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,
|
|
1
|
+
import { j as i } from "./sd-component-library197.js";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { FlexCenter as e } from "./sd-component-library34.js";
|
|
4
|
+
import { ResponsiveTextV2 as r } from "./sd-component-library150.js";
|
|
5
|
+
import { HorizontalDivider as m } from "./sd-component-library48.js";
|
|
6
|
+
const g = d.forwardRef(
|
|
7
|
+
({ mobileTitle: t, tooltipWidth: o, tooltipText: x, zIndex: h, pointerColor: n }, p) => /* @__PURE__ */ i.jsx(
|
|
8
|
+
e,
|
|
21
9
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
10
|
+
sx: {
|
|
11
|
+
position: "fixed",
|
|
12
|
+
top: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
width: "100vw",
|
|
15
|
+
height: "100vh",
|
|
16
|
+
bg: "#262626AA",
|
|
17
|
+
zIndex: h
|
|
18
|
+
},
|
|
19
|
+
ref: p,
|
|
20
|
+
children: /* @__PURE__ */ i.jsxs(
|
|
21
|
+
e,
|
|
22
|
+
{
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
sx: {
|
|
25
|
+
width: o,
|
|
26
|
+
maxWidth: "min(500px, calc(100vw - 30px))",
|
|
27
|
+
bg: "cl_white",
|
|
28
|
+
p: "20px",
|
|
29
|
+
borderRadius: "5px"
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
t && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ i.jsx(r, { maxWidth: "100%", fontSizeWeight: [16, "bold"], children: t }),
|
|
34
|
+
/* @__PURE__ */ i.jsx(
|
|
35
|
+
m,
|
|
36
|
+
{
|
|
37
|
+
width: "min(50px, calc(100% - 40px))",
|
|
38
|
+
color: n,
|
|
39
|
+
height: "2px",
|
|
40
|
+
m: "10px 0"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ i.jsx(r, { maxWidth: "100%", fontSizeWeight: [14, "regular"], children: x })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
)
|
|
47
48
|
}
|
|
48
|
-
)
|
|
49
|
-
|
|
49
|
+
)
|
|
50
|
+
);
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
g as TooltipWithPointerMobile
|
|
52
53
|
};
|
|
53
54
|
//# sourceMappingURL=sd-component-library274.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library274.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library274.js","sources":["../src/components/tooltips/tooltip-with-pointer/partials/tooltip-with-pointer-mobile/tooltip-with-pointer-mobile.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { FlexCenter } from \"../../../../containers\";\nimport { HorizontalDivider } from \"../../../../dividers\";\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { TooltipWithPointerProps } from \"../../interfaces\";\n\ntype Props = Pick<\n TooltipWithPointerProps,\n \"mobileTitle\" | \"tooltipText\" | \"tooltipWidth\" | \"zIndex\" | \"pointerColor\"\n>;\n\nexport const TooltipWithPointerMobile = React.forwardRef<HTMLDivElement, Props>(\n ({ mobileTitle, tooltipWidth, tooltipText, zIndex, pointerColor }, ref) => {\n return (\n <FlexCenter\n sx={{\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n bg: \"#262626AA\",\n zIndex,\n }}\n ref={ref}\n >\n <FlexCenter\n flexDirection=\"column\"\n sx={{\n width: tooltipWidth,\n maxWidth: \"min(500px, calc(100vw - 30px))\",\n bg: \"cl_white\",\n p: \"20px\",\n borderRadius: \"5px\",\n }}\n >\n {mobileTitle && (\n <>\n <ResponsiveTextV2 maxWidth=\"100%\" fontSizeWeight={[16, \"bold\"]}>\n {mobileTitle}\n </ResponsiveTextV2>\n\n <HorizontalDivider\n width=\"min(50px, calc(100% - 40px))\"\n color={pointerColor}\n height=\"2px\"\n m=\"10px 0\"\n />\n </>\n )}\n\n <ResponsiveTextV2 maxWidth=\"100%\" fontSizeWeight={[14, \"regular\"]}>\n {tooltipText}\n </ResponsiveTextV2>\n </FlexCenter>\n </FlexCenter>\n );\n }\n);\n"],"names":["TooltipWithPointerMobile","React","mobileTitle","tooltipWidth","tooltipText","zIndex","pointerColor","ref","jsx","FlexCenter","jsxs","Fragment","ResponsiveTextV2","HorizontalDivider"],"mappings":";;;;;AAYO,MAAMA,IAA2BC,EAAM;AAAA,EAC5C,CAAC,EAAE,aAAAC,GAAa,cAAAC,GAAc,aAAAC,GAAa,QAAAC,GAAQ,cAAAC,KAAgBC,MAE/DC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,UAAU;AAAA,QACV,KAAK;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,IAAI;AAAA,QACJ,QAAAJ;AAAA,MACF;AAAA,MACA,KAAAE;AAAA,MAEA,UAAAG,gBAAAA,EAAA;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,eAAc;AAAA,UACd,IAAI;AAAA,YACF,OAAON;AAAA,YACP,UAAU;AAAA,YACV,IAAI;AAAA,YACJ,GAAG;AAAA,YACH,cAAc;AAAA,UAChB;AAAA,UAEC,UAAA;AAAA,YAAAD,KAEGQ,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,cAACH,gBAAAA,EAAAA,IAAAI,GAAA,EAAiB,UAAS,QAAO,gBAAgB,CAAC,IAAI,MAAM,GAC1D,UACHV,EAAA,CAAA;AAAA,cAEAM,gBAAAA,EAAA;AAAA,gBAACK;AAAA,gBAAA;AAAA,kBACC,OAAM;AAAA,kBACN,OAAOP;AAAA,kBACP,QAAO;AAAA,kBACP,GAAE;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA,GACF;AAAA,YAGFE,gBAAAA,EAAAA,IAACI,KAAiB,UAAS,QAAO,gBAAgB,CAAC,IAAI,SAAS,GAC7D,UACHR,EAAA,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,5 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
import { j as r } from "./sd-component-library197.js";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { Flex as j, Box as s } from "rebass";
|
|
4
|
+
import { TriangularPointerIcon as x } from "./sd-component-library191.js";
|
|
5
|
+
import { ResponsiveTextV2 as R } from "./sd-component-library150.js";
|
|
6
|
+
const $ = u.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
pointerSx: n,
|
|
9
|
+
tooltipSx: d,
|
|
10
|
+
tooltipText: p,
|
|
11
|
+
tooltipWidth: l,
|
|
12
|
+
tooltipPy: a,
|
|
13
|
+
tooltipPx: h,
|
|
14
|
+
pointerSize: c,
|
|
15
|
+
tooltipOffset: i,
|
|
16
|
+
placement: t,
|
|
17
|
+
containerSx: y,
|
|
18
|
+
animationDuration: g,
|
|
19
|
+
state: m,
|
|
20
|
+
pointerColor: o
|
|
21
|
+
}, f) => {
|
|
22
|
+
const b = t === "right" ? {
|
|
23
|
+
left: "100%"
|
|
24
|
+
} : {
|
|
25
|
+
right: "100%"
|
|
26
|
+
}, e = {
|
|
27
|
+
size: `${c}px`,
|
|
28
|
+
color: o,
|
|
29
|
+
sx: {
|
|
30
|
+
my: "auto",
|
|
31
|
+
...n
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ r.jsxs(
|
|
35
|
+
j,
|
|
36
|
+
{
|
|
37
|
+
sx: {
|
|
38
|
+
position: "absolute",
|
|
39
|
+
top: "calc(50% - 14px)",
|
|
40
|
+
cursor: "default",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
opacity: m === "entered" ? 1 : 0,
|
|
43
|
+
transition: `opacity ${g}ms`,
|
|
44
|
+
zIndex: 1,
|
|
45
|
+
...b,
|
|
46
|
+
...d
|
|
47
|
+
},
|
|
48
|
+
ref: f,
|
|
49
|
+
"data-test": "tooltip-content",
|
|
50
|
+
children: [
|
|
51
|
+
t === "right" && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
52
|
+
/* @__PURE__ */ r.jsx(s, { width: `${i}px` }),
|
|
53
|
+
/* @__PURE__ */ r.jsx(x, { direction: "left", ...e })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ r.jsx(
|
|
56
|
+
R,
|
|
57
|
+
{
|
|
58
|
+
fontSizeWeight: [14, "regular"],
|
|
59
|
+
sx: {
|
|
60
|
+
width: l,
|
|
61
|
+
lineHeight: "16px",
|
|
62
|
+
bg: "cl_white",
|
|
63
|
+
px: h,
|
|
64
|
+
py: a,
|
|
65
|
+
borderColor: "cl_lightGrey",
|
|
66
|
+
borderWidth: "1px",
|
|
67
|
+
borderStyle: "solid",
|
|
68
|
+
...t === "left" ? {
|
|
69
|
+
borderRightWidth: "2px",
|
|
70
|
+
borderRightColor: o,
|
|
71
|
+
borderRadius: "3px 0 0 3px"
|
|
72
|
+
} : {
|
|
73
|
+
borderLeftWidth: "2px",
|
|
74
|
+
borderLeftColor: o,
|
|
75
|
+
borderRadius: "0 3px 3px 0"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
children: p
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
t === "left" && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
82
|
+
/* @__PURE__ */ r.jsx(x, { direction: "right", ...e }),
|
|
83
|
+
/* @__PURE__ */ r.jsx(s, { width: `${i}px` })
|
|
84
|
+
] })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
);
|
|
2
90
|
export {
|
|
3
|
-
|
|
91
|
+
$ as TooltipWithPointerHorizontal
|
|
4
92
|
};
|
|
5
93
|
//# sourceMappingURL=sd-component-library275.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library275.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"sd-component-library275.js","sources":["../src/components/tooltips/tooltip-with-pointer/partials/tooltip-with-pointer-horizontal/tooltip-with-pointer-horizontal.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box, Flex } from \"rebass\";\n\nimport { TriangularPointerIcon } from \"../../../../icons\";\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { TooltipWithPointerPartialProps as Props } from \"../interfaces\";\n\nexport const TooltipWithPointerHorizontal = React.forwardRef<\n HTMLDivElement,\n Props\n>(\n (\n {\n pointerSx,\n tooltipSx,\n tooltipText,\n tooltipWidth,\n tooltipPy,\n tooltipPx,\n pointerSize,\n tooltipOffset,\n placement,\n containerSx,\n animationDuration,\n state,\n pointerColor,\n },\n ref\n ) => {\n const tooltipContainerProps =\n placement === \"right\"\n ? {\n left: \"100%\",\n }\n : {\n right: \"100%\",\n };\n\n const pointerCommonProps = {\n size: `${pointerSize}px`,\n color: pointerColor,\n sx: {\n my: \"auto\",\n ...pointerSx,\n },\n };\n\n return (\n <Flex\n sx={{\n position: \"absolute\",\n top: \"calc(50% - 14px)\",\n cursor: \"default\",\n alignItems: \"center\",\n opacity: state === \"entered\" ? 1 : 0,\n transition: `opacity ${animationDuration}ms`,\n zIndex: 1,\n ...tooltipContainerProps,\n ...tooltipSx,\n }}\n ref={ref}\n data-test=\"tooltip-content\"\n >\n {placement === \"right\" && (\n <>\n <Box width={`${tooltipOffset}px`} />\n <TriangularPointerIcon direction=\"left\" {...pointerCommonProps} />\n </>\n )}\n\n <ResponsiveTextV2\n fontSizeWeight={[14, \"regular\"]}\n sx={{\n width: tooltipWidth,\n lineHeight: \"16px\",\n bg: \"cl_white\",\n px: tooltipPx,\n py: tooltipPy,\n borderColor: \"cl_lightGrey\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n ...(placement === \"left\"\n ? {\n borderRightWidth: \"2px\",\n borderRightColor: pointerColor,\n borderRadius: \"3px 0 0 3px\",\n }\n : {\n borderLeftWidth: \"2px\",\n borderLeftColor: pointerColor,\n borderRadius: \"0 3px 3px 0\",\n }),\n }}\n >\n {tooltipText}\n </ResponsiveTextV2>\n\n {placement === \"left\" && (\n <>\n <TriangularPointerIcon direction=\"right\" {...pointerCommonProps} />\n <Box width={`${tooltipOffset}px`} />\n </>\n )}\n </Flex>\n );\n }\n);\n"],"names":["TooltipWithPointerHorizontal","React","pointerSx","tooltipSx","tooltipText","tooltipWidth","tooltipPy","tooltipPx","pointerSize","tooltipOffset","placement","containerSx","animationDuration","state","pointerColor","ref","tooltipContainerProps","pointerCommonProps","jsxs","Flex","Fragment","jsx","Box","TriangularPointerIcon","ResponsiveTextV2"],"mappings":";;;;;AAQO,MAAMA,IAA+BC,EAAM;AAAA,EAIhD,CACE;AAAA,IACE,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,KAEFC,MACG;AACG,UAAAC,IACJN,MAAc,UACV;AAAA,MACE,MAAM;AAAA,IAAA,IAER;AAAA,MACE,OAAO;AAAA,IAAA,GAGTO,IAAqB;AAAA,MACzB,MAAM,GAAGT,CAAW;AAAA,MACpB,OAAOM;AAAA,MACP,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,GAAGZ;AAAA,MACL;AAAA,IAAA;AAIA,WAAAgB,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,UACF,UAAU;AAAA,UACV,KAAK;AAAA,UACL,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,SAASN,MAAU,YAAY,IAAI;AAAA,UACnC,YAAY,WAAWD,CAAiB;AAAA,UACxC,QAAQ;AAAA,UACR,GAAGI;AAAA,UACH,GAAGb;AAAA,QACL;AAAA,QACA,KAAAY;AAAA,QACA,aAAU;AAAA,QAET,UAAA;AAAA,UAAAL,MAAc,WAEXQ,gBAAAA,EAAAA,KAAAE,EAAA,UAAA,EAAA,UAAA;AAAA,YAAAC,gBAAAA,EAAA,IAACC,GAAI,EAAA,OAAO,GAAGb,CAAa,MAAM;AAAA,YACjCY,gBAAAA,EAAA,IAAAE,GAAA,EAAsB,WAAU,QAAQ,GAAGN,EAAoB,CAAA;AAAA,UAAA,GAClE;AAAA,UAGFI,gBAAAA,EAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,gBAAgB,CAAC,IAAI,SAAS;AAAA,cAC9B,IAAI;AAAA,gBACF,OAAOnB;AAAA,gBACP,YAAY;AAAA,gBACZ,IAAI;AAAA,gBACJ,IAAIE;AAAA,gBACJ,IAAID;AAAA,gBACJ,aAAa;AAAA,gBACb,aAAa;AAAA,gBACb,aAAa;AAAA,gBACb,GAAII,MAAc,SACd;AAAA,kBACE,kBAAkB;AAAA,kBAClB,kBAAkBI;AAAA,kBAClB,cAAc;AAAA,gBAAA,IAEhB;AAAA,kBACE,iBAAiB;AAAA,kBACjB,iBAAiBA;AAAA,kBACjB,cAAc;AAAA,gBAChB;AAAA,cACN;AAAA,cAEC,UAAAV;AAAA,YAAA;AAAA,UACH;AAAA,UAECM,MAAc,UAEXQ,gBAAAA,EAAAA,KAAAE,EAAA,UAAA,EAAA,UAAA;AAAA,YAAAC,gBAAAA,EAAA,IAACE,GAAsB,EAAA,WAAU,SAAS,GAAGN,EAAoB,CAAA;AAAA,YAChEI,gBAAAA,EAAA,IAAAC,GAAA,EAAI,OAAO,GAAGb,CAAa,MAAM;AAAA,UAAA,GACpC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
@@ -1,5 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { Flex as j, Box as s } from "rebass";
|
|
4
|
+
import { TriangularPointerIcon as n } from "./sd-component-library191.js";
|
|
5
|
+
import { ResponsiveTextV2 as y } from "./sd-component-library150.js";
|
|
6
|
+
const w = g.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
pointerSx: x,
|
|
9
|
+
tooltipPx: p,
|
|
10
|
+
tooltipText: d,
|
|
11
|
+
tooltipSx: a,
|
|
12
|
+
tooltipPy: l,
|
|
13
|
+
tooltipOffset: e,
|
|
14
|
+
pointerSize: m,
|
|
15
|
+
tooltipWidth: c,
|
|
16
|
+
placement: t,
|
|
17
|
+
state: h,
|
|
18
|
+
containerSx: R,
|
|
19
|
+
animationDuration: b,
|
|
20
|
+
pointerColor: r
|
|
21
|
+
}, u) => {
|
|
22
|
+
const f = t === "bottom" ? {
|
|
23
|
+
top: "100%"
|
|
24
|
+
} : {
|
|
25
|
+
bottom: "100%"
|
|
26
|
+
}, i = {
|
|
27
|
+
size: `${m}px`,
|
|
28
|
+
color: r,
|
|
29
|
+
sx: {
|
|
30
|
+
my: "auto",
|
|
31
|
+
...x
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ o.jsxs(
|
|
35
|
+
j,
|
|
36
|
+
{
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
sx: {
|
|
39
|
+
position: "absolute",
|
|
40
|
+
left: "50%",
|
|
41
|
+
transform: "translateX(-50%)",
|
|
42
|
+
cursor: "default",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
opacity: h === "entered" ? 1 : 0,
|
|
45
|
+
transition: `opacity ${b}ms`,
|
|
46
|
+
zIndex: 1,
|
|
47
|
+
...f,
|
|
48
|
+
...a
|
|
49
|
+
},
|
|
50
|
+
ref: u,
|
|
51
|
+
"data-test": "tooltip-content",
|
|
52
|
+
children: [
|
|
53
|
+
t === "bottom" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
54
|
+
/* @__PURE__ */ o.jsx(s, { height: `${e}px` }),
|
|
55
|
+
/* @__PURE__ */ o.jsx(n, { direction: "top", ...i })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ o.jsx(
|
|
58
|
+
y,
|
|
59
|
+
{
|
|
60
|
+
fontSizeWeight: [14, "regular"],
|
|
61
|
+
sx: {
|
|
62
|
+
width: c,
|
|
63
|
+
lineHeight: "16px",
|
|
64
|
+
bg: "cl_white",
|
|
65
|
+
px: p,
|
|
66
|
+
py: l,
|
|
67
|
+
borderColor: "cl_lightGrey",
|
|
68
|
+
borderWidth: "1px",
|
|
69
|
+
borderStyle: "solid",
|
|
70
|
+
...t === "top" ? {
|
|
71
|
+
borderBottomWidth: "2px",
|
|
72
|
+
borderBottomColor: r,
|
|
73
|
+
borderRadius: "3px 3px 0 0"
|
|
74
|
+
} : {
|
|
75
|
+
borderTopWidth: "2px",
|
|
76
|
+
borderTopColor: r,
|
|
77
|
+
borderRadius: "0 0 3px 3px"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
children: d
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
t === "top" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
84
|
+
/* @__PURE__ */ o.jsx(n, { direction: "bottom", ...i }),
|
|
85
|
+
/* @__PURE__ */ o.jsx(s, { height: `${e}px` })
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
2
92
|
export {
|
|
3
|
-
|
|
93
|
+
w as TooltipWithPointerVertical
|
|
4
94
|
};
|
|
5
95
|
//# sourceMappingURL=sd-component-library276.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library276.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"sd-component-library276.js","sources":["../src/components/tooltips/tooltip-with-pointer/partials/tooltip-with-pointer-vertical/tooltip-with-pointer-vertical.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box, Flex } from \"rebass\";\n\nimport { TriangularPointerIcon } from \"../../../../icons\";\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { TooltipWithPointerPartialProps as Props } from \"../interfaces\";\n\nexport const TooltipWithPointerVertical = React.forwardRef<\n HTMLDivElement,\n Props\n>(\n (\n {\n pointerSx,\n tooltipPx,\n tooltipText,\n tooltipSx,\n tooltipPy,\n tooltipOffset,\n pointerSize,\n tooltipWidth,\n placement,\n state,\n containerSx,\n animationDuration,\n pointerColor,\n },\n ref\n ) => {\n const tooltipContainerProps =\n placement === \"bottom\"\n ? {\n top: \"100%\",\n }\n : {\n bottom: \"100%\",\n };\n\n const pointerCommonProps = {\n size: `${pointerSize}px`,\n color: pointerColor,\n sx: {\n my: \"auto\",\n ...pointerSx,\n },\n };\n\n return (\n <Flex\n flexDirection=\"column\"\n sx={{\n position: \"absolute\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n cursor: \"default\",\n alignItems: \"center\",\n opacity: state === \"entered\" ? 1 : 0,\n transition: `opacity ${animationDuration}ms`,\n zIndex: 1,\n ...tooltipContainerProps,\n ...tooltipSx,\n }}\n ref={ref}\n data-test=\"tooltip-content\"\n >\n {placement === \"bottom\" && (\n <>\n <Box height={`${tooltipOffset}px`} />\n <TriangularPointerIcon direction=\"top\" {...pointerCommonProps} />\n </>\n )}\n\n <ResponsiveTextV2\n fontSizeWeight={[14, \"regular\"]}\n sx={{\n width: tooltipWidth,\n lineHeight: \"16px\",\n bg: \"cl_white\",\n px: tooltipPx,\n py: tooltipPy,\n borderColor: \"cl_lightGrey\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n ...(placement === \"top\"\n ? {\n borderBottomWidth: \"2px\",\n borderBottomColor: pointerColor,\n borderRadius: \"3px 3px 0 0\",\n }\n : {\n borderTopWidth: \"2px\",\n borderTopColor: pointerColor,\n borderRadius: \"0 0 3px 3px\",\n }),\n }}\n >\n {tooltipText}\n </ResponsiveTextV2>\n\n {placement === \"top\" && (\n <>\n <TriangularPointerIcon direction=\"bottom\" {...pointerCommonProps} />\n <Box height={`${tooltipOffset}px`} />\n </>\n )}\n </Flex>\n );\n }\n);\n"],"names":["TooltipWithPointerVertical","React","pointerSx","tooltipPx","tooltipText","tooltipSx","tooltipPy","tooltipOffset","pointerSize","tooltipWidth","placement","state","containerSx","animationDuration","pointerColor","ref","tooltipContainerProps","pointerCommonProps","jsxs","Flex","Fragment","jsx","Box","TriangularPointerIcon","ResponsiveTextV2"],"mappings":";;;;;AAQO,MAAMA,IAA6BC,EAAM;AAAA,EAI9C,CACE;AAAA,IACE,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,KAEFC,MACG;AACG,UAAAC,IACJN,MAAc,WACV;AAAA,MACE,KAAK;AAAA,IAAA,IAEP;AAAA,MACE,QAAQ;AAAA,IAAA,GAGVO,IAAqB;AAAA,MACzB,MAAM,GAAGT,CAAW;AAAA,MACpB,OAAOM;AAAA,MACP,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,GAAGZ;AAAA,MACL;AAAA,IAAA;AAIA,WAAAgB,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,eAAc;AAAA,QACd,IAAI;AAAA,UACF,UAAU;AAAA,UACV,MAAM;AAAA,UACN,WAAW;AAAA,UACX,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,SAASR,MAAU,YAAY,IAAI;AAAA,UACnC,YAAY,WAAWE,CAAiB;AAAA,UACxC,QAAQ;AAAA,UACR,GAAGG;AAAA,UACH,GAAGX;AAAA,QACL;AAAA,QACA,KAAAU;AAAA,QACA,aAAU;AAAA,QAET,UAAA;AAAA,UAAAL,MAAc,YAEXQ,gBAAAA,EAAAA,KAAAE,EAAA,UAAA,EAAA,UAAA;AAAA,YAAAC,gBAAAA,EAAA,IAACC,GAAI,EAAA,QAAQ,GAAGf,CAAa,MAAM;AAAA,YAClCc,gBAAAA,EAAA,IAAAE,GAAA,EAAsB,WAAU,OAAO,GAAGN,EAAoB,CAAA;AAAA,UAAA,GACjE;AAAA,UAGFI,gBAAAA,EAAA;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,gBAAgB,CAAC,IAAI,SAAS;AAAA,cAC9B,IAAI;AAAA,gBACF,OAAOf;AAAA,gBACP,YAAY;AAAA,gBACZ,IAAI;AAAA,gBACJ,IAAIN;AAAA,gBACJ,IAAIG;AAAA,gBACJ,aAAa;AAAA,gBACb,aAAa;AAAA,gBACb,aAAa;AAAA,gBACb,GAAII,MAAc,QACd;AAAA,kBACE,mBAAmB;AAAA,kBACnB,mBAAmBI;AAAA,kBACnB,cAAc;AAAA,gBAAA,IAEhB;AAAA,kBACE,gBAAgB;AAAA,kBAChB,gBAAgBA;AAAA,kBAChB,cAAc;AAAA,gBAChB;AAAA,cACN;AAAA,cAEC,UAAAV;AAAA,YAAA;AAAA,UACH;AAAA,UAECM,MAAc,SAEXQ,gBAAAA,EAAAA,KAAAE,EAAA,UAAA,EAAA,UAAA;AAAA,YAAAC,gBAAAA,EAAA,IAACE,GAAsB,EAAA,WAAU,UAAU,GAAGN,EAAoB,CAAA;AAAA,YACjEI,gBAAAA,EAAA,IAAAC,GAAA,EAAI,QAAQ,GAAGf,CAAa,MAAM;AAAA,UAAA,GACrC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
@@ -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-library279.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library279.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library279.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,EAAa,oBAAA,KAAA,GAAQ,EAAE,GAAG,EAAE,cAAc,GAAG;AAAA,IACpE,SAASC,EAAUD,EAAa,oBAAA,KAAA,GAAQ,EAAE,GAAG,EAAE,cAAc,GAAG;AAAA,EAClE;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,WAAWD,EAAYC,EAAa,oBAAA,KAAA,GAAQ,EAAE,GAAG,EAAE,cAAc,GAAG;AAAA,IACpE,SAASC,EAAUD,EAAa,oBAAA,KAAA,GAAQ,EAAE,GAAG,EAAE,cAAc,GAAG;AAAA,EAClE;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,WAAWE,EAAaC,sBAAc,KAAK,GAAG,EAAE,CAAC;AAAA,IACjD,SAASC,EAAWD,sBAAc,KAAK,GAAG,EAAE,CAAC;AAAA,EAC/C;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,WAAWE,EAAYC,sBAAa,KAAK,GAAG,EAAE,CAAC;AAAA,IAC/C,SAASC,EAAUD,sBAAa,KAAK,GAAG,EAAE,CAAC;AAAA,EAC7C;AACF,GAEaE,IAAkB,CAC7BC,GACAC,GACAC,GACAC,GACAC,GACAC,MACkB;AAElB,QAAMC,KADeF,KAAgBlB,GACY;AAAA,IAC/C,CAAC,EAAE,OAAAqB,GAAO,WAAAC,GAAW,SAAAC,SAAe;AAAA,MAClC,OAAAF;AAAA,MACA,OAAO,CAACG,OAAO;AAAA,QACb,WAAAF;AAAA,QACA,SAAAC;AAAA,MAAA;AAAA,MAEF,YAAY,CAAC1B,MACXA,EAAM,aAAaA,EAAM,UACrBE,EAAUF,EAAM,WAAWyB,CAAS,KACpCvB,EAAUF,EAAM,SAAS0B,CAAO,IAChC;AAAA,IAAA;AAAA,EACR;AAGF,SAAQJ,IAEJC,EAAa,OAAO;AAAA,IAClB,OAAO;AAAA,IACP,OAAO,CAACI,OACcT,KACb;AAAA,MACL,YAAWD,KAAA,gBAAAA,EAAe,cAAa,oBAAI,KAAK;AAAA,MAChD,UAASA,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-library197.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-library279.js";
|
|
6
|
+
import { OutsideClickBox as m } from "./sd-component-library12.js";
|
|
7
|
+
import { ResponsiveTextV2 as f } from "./sd-component-library150.js";
|
|
8
|
+
import { SelectedRangeText as h } from "./sd-component-library315.js";
|
|
9
|
+
import { FrFrContainer as g } from "./sd-component-library36.js";
|
|
10
|
+
import { PrimaryTextButton as u } from "./sd-component-library22.js";
|
|
11
|
+
import { ApplyButton as R } from "./sd-component-library316.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-library280.js.map
|