@selfdecode/sd-component-library 4.0.137 → 4.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/sd-component-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-library126.js +1 -1
- package/lib/sd-component-library127.js +1 -1
- package/lib/sd-component-library167.js +1 -1
- package/lib/sd-component-library172.js +3 -3
- package/lib/sd-component-library202.js +1 -1
- package/lib/sd-component-library203.js +1 -1
- package/lib/sd-component-library206.js +25 -17
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +18 -21
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +64 -3
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +23 -3
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +31 -55
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +127 -21
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +13 -26
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +14 -40
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library214.js +3 -26
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -129
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +65 -13
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +3 -14
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +2 -2
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library219.js +52 -3
- package/lib/sd-component-library219.js.map +1 -1
- package/lib/sd-component-library220.js +46 -3
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +16 -51
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +20 -64
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +2 -2
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +3 -46
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +26 -17
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library233.js +1 -1
- package/lib/sd-component-library235.js +1 -1
- package/lib/sd-component-library237.js +1 -1
- package/lib/sd-component-library238.js +1 -1
- package/lib/sd-component-library24.js +66 -64
- package/lib/sd-component-library24.js.map +1 -1
- package/lib/sd-component-library241.js +1 -1
- package/lib/sd-component-library242.js +1 -1
- package/lib/sd-component-library249.js +21 -2
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +19 -20
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +2 -20
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library254.js +25 -21
- package/lib/sd-component-library254.js.map +1 -1
- package/lib/sd-component-library256.js +24 -22
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library258.js +21 -25
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +22 -24
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +30 -51
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +51 -30
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +1 -1
- package/lib/sd-component-library272.js +51 -2
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +90 -2
- package/lib/sd-component-library273.js.map +1 -1
- package/lib/sd-component-library274.js +89 -48
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library275.js +2 -90
- package/lib/sd-component-library275.js.map +1 -1
- package/lib/sd-component-library276.js +2 -92
- package/lib/sd-component-library276.js.map +1 -1
- package/lib/sd-component-library277.js +2 -6
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +2 -2
- package/lib/sd-component-library279.js +70 -2
- 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-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-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-library318.js +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-library61.js +1 -1
- package/lib/sd-component-library62.js +4 -4
- 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-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-library85.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as r } from "./sd-component-library197.js";
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { generateTestLocator as
|
|
5
|
-
import { LoadingSpinner as Z } from "./sd-component-
|
|
2
|
+
import { Link as U } from "react-router-dom";
|
|
3
|
+
import { Button as V, Flex as X } from "rebass";
|
|
4
|
+
import { generateTestLocator as Y } from "./sd-component-library4.js";
|
|
5
|
+
import { LoadingSpinner as Z } from "./sd-component-library206.js";
|
|
6
6
|
function tt(t, o, e) {
|
|
7
7
|
return (n) => {
|
|
8
8
|
t == null || t(n), o && (`#${o}` !== window.location.hash && (e != null && e.replace(
|
|
@@ -20,7 +20,7 @@ const ot = ({
|
|
|
20
20
|
children: e,
|
|
21
21
|
target: n = "_self",
|
|
22
22
|
rel: a = "noopener noreferrer",
|
|
23
|
-
onLinkClick:
|
|
23
|
+
onLinkClick: d
|
|
24
24
|
}) => {
|
|
25
25
|
const i = {
|
|
26
26
|
display: "grid",
|
|
@@ -28,12 +28,12 @@ const ot = ({
|
|
|
28
28
|
textDecoration: "none"
|
|
29
29
|
};
|
|
30
30
|
return t === void 0 ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e }) : o ? /* @__PURE__ */ r.jsx(
|
|
31
|
-
|
|
31
|
+
U,
|
|
32
32
|
{
|
|
33
33
|
to: t,
|
|
34
34
|
style: i,
|
|
35
35
|
"data-testid": "react-router-link",
|
|
36
|
-
onClick:
|
|
36
|
+
onClick: d,
|
|
37
37
|
children: e
|
|
38
38
|
}
|
|
39
39
|
) : /* @__PURE__ */ r.jsx(
|
|
@@ -43,27 +43,27 @@ const ot = ({
|
|
|
43
43
|
target: n,
|
|
44
44
|
rel: a,
|
|
45
45
|
style: i,
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: d,
|
|
47
47
|
"data-testid": "anchor-tag",
|
|
48
48
|
children: e
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
},
|
|
51
|
+
}, dt = (t) => {
|
|
52
52
|
const {
|
|
53
53
|
link: o,
|
|
54
54
|
isInternal: e = !0,
|
|
55
55
|
scrollTo: n,
|
|
56
56
|
onClick: a,
|
|
57
|
-
children:
|
|
57
|
+
children: d,
|
|
58
58
|
disabled: i,
|
|
59
|
-
variant:
|
|
60
|
-
padding:
|
|
59
|
+
variant: p,
|
|
60
|
+
padding: c,
|
|
61
61
|
fontSize: h,
|
|
62
62
|
fontWeight: x,
|
|
63
63
|
letterSpacing: f,
|
|
64
64
|
textDecoration: m,
|
|
65
|
-
textTransform:
|
|
66
|
-
hoverFontWeight:
|
|
65
|
+
textTransform: u,
|
|
66
|
+
hoverFontWeight: g,
|
|
67
67
|
hoverTextDecoration: v,
|
|
68
68
|
borderRadius: b,
|
|
69
69
|
width: w,
|
|
@@ -71,9 +71,9 @@ const ot = ({
|
|
|
71
71
|
borderStyle: y,
|
|
72
72
|
borderWidth: j,
|
|
73
73
|
borderColor: k,
|
|
74
|
-
fill:
|
|
75
|
-
color:
|
|
76
|
-
bg:
|
|
74
|
+
fill: C,
|
|
75
|
+
color: W,
|
|
76
|
+
bg: B,
|
|
77
77
|
stroke: $,
|
|
78
78
|
hoverBorderStyle: E,
|
|
79
79
|
hoverBorderWidth: I,
|
|
@@ -81,23 +81,23 @@ const ot = ({
|
|
|
81
81
|
hoverFill: F,
|
|
82
82
|
hoverColor: D,
|
|
83
83
|
hoverBg: L,
|
|
84
|
-
hoverStroke:
|
|
85
|
-
display:
|
|
86
|
-
transition:
|
|
87
|
-
history:
|
|
88
|
-
zIndex:
|
|
89
|
-
cursor:
|
|
90
|
-
rel:
|
|
91
|
-
target:
|
|
92
|
-
onLinkClick:
|
|
93
|
-
testLocatorId:
|
|
94
|
-
tooltipText:
|
|
84
|
+
hoverStroke: T,
|
|
85
|
+
display: H,
|
|
86
|
+
transition: R,
|
|
87
|
+
history: _,
|
|
88
|
+
zIndex: P,
|
|
89
|
+
cursor: A = "pointer",
|
|
90
|
+
rel: G,
|
|
91
|
+
target: M,
|
|
92
|
+
onLinkClick: q,
|
|
93
|
+
testLocatorId: J,
|
|
94
|
+
tooltipText: l
|
|
95
95
|
} = t, {
|
|
96
|
-
loading:
|
|
97
|
-
loadingIconProps:
|
|
98
|
-
onHover:
|
|
99
|
-
sx:
|
|
100
|
-
...
|
|
96
|
+
loading: s = !1,
|
|
97
|
+
loadingIconProps: K = {},
|
|
98
|
+
onHover: N,
|
|
99
|
+
sx: O,
|
|
100
|
+
...Q
|
|
101
101
|
} = t;
|
|
102
102
|
if (o !== void 0 && a !== void 0)
|
|
103
103
|
throw new Error("Cannot have link and onClick at the same time");
|
|
@@ -106,57 +106,59 @@ const ot = ({
|
|
|
106
106
|
{
|
|
107
107
|
link: o,
|
|
108
108
|
isInternal: e,
|
|
109
|
-
rel:
|
|
110
|
-
target:
|
|
111
|
-
onLinkClick:
|
|
109
|
+
rel: G,
|
|
110
|
+
target: M,
|
|
111
|
+
onLinkClick: q,
|
|
112
112
|
children: /* @__PURE__ */ r.jsx(
|
|
113
|
-
|
|
113
|
+
V,
|
|
114
114
|
{
|
|
115
115
|
"data-testid": "button",
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
variant:
|
|
116
|
+
...Y(J),
|
|
117
|
+
...Q,
|
|
118
|
+
variant: p,
|
|
119
119
|
sx: {
|
|
120
120
|
position: "relative",
|
|
121
|
-
display:
|
|
122
|
-
padding:
|
|
121
|
+
display: H,
|
|
122
|
+
padding: c,
|
|
123
123
|
fontFamily: "proxima-nova",
|
|
124
124
|
fontSize: h,
|
|
125
125
|
fontWeight: x,
|
|
126
126
|
letterSpacing: f,
|
|
127
127
|
textDecoration: m,
|
|
128
|
-
textTransform:
|
|
128
|
+
textTransform: u,
|
|
129
129
|
width: w,
|
|
130
130
|
height: S,
|
|
131
131
|
borderRadius: b,
|
|
132
132
|
borderStyle: y,
|
|
133
133
|
borderWidth: j,
|
|
134
134
|
borderColor: k,
|
|
135
|
-
fill:
|
|
135
|
+
fill: C,
|
|
136
136
|
stroke: $,
|
|
137
|
-
color:
|
|
138
|
-
bg:
|
|
137
|
+
color: W,
|
|
138
|
+
bg: B,
|
|
139
139
|
outline: "none !important",
|
|
140
|
-
transition:
|
|
141
|
-
...
|
|
140
|
+
transition: R,
|
|
141
|
+
...l ? {
|
|
142
142
|
"::after": {
|
|
143
143
|
position: "absolute",
|
|
144
144
|
opacity: 0,
|
|
145
145
|
pointerEvents: "none",
|
|
146
|
-
content: `"${
|
|
146
|
+
content: `"${l}"`,
|
|
147
147
|
color: "cl_darkGrey",
|
|
148
148
|
textTransform: "none",
|
|
149
149
|
letterSpacing: 0,
|
|
150
|
-
left:
|
|
150
|
+
left: "50%",
|
|
151
151
|
top: "calc(100% + 10px)",
|
|
152
|
-
borderRadius: "3px",
|
|
152
|
+
borderRadius: "0 0 3px 3px",
|
|
153
153
|
boxShadow: "0 0 5px 2px #0000001A",
|
|
154
|
+
borderTop: "2px solid",
|
|
155
|
+
borderColor: "cl_purple",
|
|
154
156
|
bg: "white",
|
|
155
157
|
zIndex: 10,
|
|
156
158
|
padding: "8px",
|
|
157
159
|
width: "max-content",
|
|
158
160
|
maxWidth: "100%",
|
|
159
|
-
transform: "
|
|
161
|
+
transform: "translate(-50%, -20px)",
|
|
160
162
|
transition: "all 150ms cubic-bezier(.25, .8, .25, 1)",
|
|
161
163
|
fontSize: "14px",
|
|
162
164
|
fontWeight: 400,
|
|
@@ -164,38 +166,38 @@ const ot = ({
|
|
|
164
166
|
}
|
|
165
167
|
} : {},
|
|
166
168
|
":hover": {
|
|
167
|
-
cursor: i ? "default" :
|
|
169
|
+
cursor: i ? "default" : A,
|
|
168
170
|
borderStyle: E,
|
|
169
171
|
borderWidth: I,
|
|
170
172
|
borderColor: z,
|
|
171
173
|
fill: F,
|
|
172
|
-
stroke:
|
|
174
|
+
stroke: T,
|
|
173
175
|
color: D,
|
|
174
176
|
bg: L,
|
|
175
|
-
hoverFontWeight:
|
|
177
|
+
hoverFontWeight: g,
|
|
176
178
|
hoverTextDecoration: v,
|
|
177
|
-
...
|
|
179
|
+
...l ? {
|
|
178
180
|
"::after": {
|
|
179
181
|
opacity: 1,
|
|
180
|
-
transform: "
|
|
182
|
+
transform: "translate(-50%, 0)",
|
|
181
183
|
transitionDuration: "300ms"
|
|
182
184
|
}
|
|
183
185
|
} : {}
|
|
184
186
|
},
|
|
185
|
-
zIndex:
|
|
186
|
-
...
|
|
187
|
+
zIndex: P,
|
|
188
|
+
...O
|
|
187
189
|
},
|
|
188
|
-
onClick: o === void 0 ? tt(a, n,
|
|
190
|
+
onClick: o === void 0 ? tt(a, n, _) : () => {
|
|
189
191
|
},
|
|
190
|
-
onMouseEnter:
|
|
191
|
-
disabled: i ||
|
|
192
|
-
children:
|
|
192
|
+
onMouseEnter: N,
|
|
193
|
+
disabled: i || s,
|
|
194
|
+
children: s ? /* @__PURE__ */ r.jsx(X, { height: "100%", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ r.jsx(Z, { ...K }) }) : d
|
|
193
195
|
}
|
|
194
196
|
)
|
|
195
197
|
}
|
|
196
198
|
);
|
|
197
199
|
};
|
|
198
200
|
export {
|
|
199
|
-
|
|
201
|
+
dt as Button
|
|
200
202
|
};
|
|
201
203
|
//# sourceMappingURL=sd-component-library24.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library24.js","sources":["../src/components/buttons/button/button.tsx"],"sourcesContent":["import React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { History } from \"history\";\nimport { Flex, Button as RebassButton } from \"rebass\";\n\nimport { generateTestLocator } from \"../../../core/functions\";\nimport { LoadingSpinner } from \"../../animations/loading-spinner\";\nimport { ButtonProps } from \"./interfaces\";\n\n/**\n * A wrapper to handle various click behaviours for buttons.\n *\n * @param history The history object for navigation.\n * @param onClick The call back to run on button click.\n * @param link The location to navigate to if the button is a link.\n * @param scrollTo The section of the page to scroll to.\n *\n * @returns The on click call back.\n */\nfunction clickWrapper(\n onClick?: ButtonProps[\"onClick\"],\n scrollTo?: string,\n history?: History\n): (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void {\n return (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void => {\n onClick?.(_event);\n\n if (scrollTo) {\n // If current hash is not same as new hash, update the hash\n if (`#${scrollTo}` !== window.location.hash)\n history?.replace(\n `${window.location.pathname.split(\"#\")[0]}#${scrollTo}`\n ) ||\n window.history.replaceState(\n undefined,\n \"\",\n `${window.location.pathname.split(\"#\")[0]}#${scrollTo}`\n );\n // Otherwise forcefully dispatch a `hashchange` event to scroll.\n window.dispatchEvent(new HashChangeEvent(\"hashchange\"));\n }\n };\n}\n\nconst ButtonWrapper: React.FC<\n Pick<\n ButtonProps,\n \"link\" | \"isInternal\" | \"children\" | \"target\" | \"rel\" | \"onLinkClick\"\n >\n> = ({\n link,\n isInternal = true,\n children,\n target = \"_self\",\n rel = \"noopener noreferrer\",\n onLinkClick,\n}) => {\n const linkStyle: React.CSSProperties = {\n display: \"grid\",\n color: \"inherit\",\n textDecoration: \"none\",\n };\n\n return link === undefined ? (\n <>{children}</>\n ) : isInternal ? (\n <Link\n to={link}\n style={linkStyle}\n data-testid=\"react-router-link\"\n onClick={onLinkClick}\n >\n {children}\n </Link>\n ) : (\n <a\n href={link}\n target={target}\n rel={rel}\n style={linkStyle}\n onClick={onLinkClick}\n data-testid=\"anchor-tag\"\n >\n {children}\n </a>\n );\n};\n\n/**\n * Base button component. Other button components should be built from this.\n */\nexport const Button: React.FC<ButtonProps> = (props) => {\n const {\n link,\n isInternal = true,\n scrollTo,\n onClick,\n children,\n disabled,\n variant,\n padding,\n fontSize,\n fontWeight,\n letterSpacing,\n textDecoration,\n textTransform,\n hoverFontWeight,\n hoverTextDecoration,\n borderRadius,\n width,\n height,\n borderStyle,\n borderWidth,\n borderColor,\n fill,\n color,\n bg,\n stroke,\n hoverBorderStyle,\n hoverBorderWidth,\n hoverBorderColor,\n hoverFill,\n hoverColor,\n hoverBg,\n hoverStroke,\n display,\n transition,\n history,\n zIndex,\n cursor = \"pointer\",\n rel,\n target,\n onLinkClick,\n testLocatorId,\n tooltipText,\n } = props;\n\n const {\n loading = false,\n loadingIconProps = {},\n onHover,\n sx,\n ...actualProps\n } = props;\n\n if (link !== undefined && onClick !== undefined) {\n throw new Error(\"Cannot have link and onClick at the same time\");\n }\n\n return (\n <ButtonWrapper\n link={link}\n isInternal={isInternal}\n rel={rel}\n target={target}\n onLinkClick={onLinkClick}\n >\n <RebassButton\n data-testid=\"button\"\n {...generateTestLocator(testLocatorId)}\n {...actualProps}\n variant={variant}\n sx={{\n position: \"relative\",\n display,\n padding,\n fontFamily: \"proxima-nova\",\n fontSize,\n fontWeight,\n letterSpacing,\n textDecoration,\n textTransform,\n width,\n height,\n borderRadius,\n borderStyle,\n borderWidth,\n borderColor,\n fill,\n stroke,\n color,\n bg,\n outline: \"none !important\",\n transition,\n ...(!!tooltipText\n ? {\n \"::after\": {\n position: \"absolute\",\n opacity: 0,\n pointerEvents: \"none\",\n content: `\"${tooltipText}\"`,\n color: \"cl_darkGrey\",\n textTransform: \"none\",\n letterSpacing: 0,\n left: 0,\n top: \"calc(100% + 10px)\",\n borderRadius: \"3px\",\n boxShadow: \"0 0 5px 2px #0000001A\",\n bg: \"white\",\n zIndex: 10,\n padding: \"8px\",\n width: \"max-content\",\n maxWidth: \"100%\",\n transform: \"translateY(-20px)\",\n transition: \"all 150ms cubic-bezier(.25, .8, .25, 1)\",\n fontSize: \"14px\",\n fontWeight: 400,\n lineHeight: \"17px\",\n },\n }\n : {}),\n \":hover\": {\n cursor: disabled ? \"default\" : cursor,\n borderStyle: hoverBorderStyle,\n borderWidth: hoverBorderWidth,\n borderColor: hoverBorderColor,\n fill: hoverFill,\n stroke: hoverStroke,\n color: hoverColor,\n bg: hoverBg,\n hoverFontWeight,\n hoverTextDecoration,\n ...(!!tooltipText\n ? {\n \"::after\": {\n opacity: 1,\n transform: \"translateY(0)\",\n transitionDuration: \"300ms\",\n },\n }\n : {}),\n },\n zIndex,\n ...sx,\n }}\n onClick={\n link === undefined\n ? clickWrapper(onClick, scrollTo, history)\n : () => {}\n }\n onMouseEnter={onHover}\n disabled={disabled || loading}\n >\n {!loading ? (\n children\n ) : (\n <Flex height=\"100%\" justifyContent=\"center\" alignItems=\"center\">\n <LoadingSpinner {...loadingIconProps} />\n </Flex>\n )}\n </RebassButton>\n </ButtonWrapper>\n );\n};\n"],"names":["clickWrapper","onClick","scrollTo","history","_event","ButtonWrapper","link","isInternal","children","target","rel","onLinkClick","linkStyle","jsx","Fragment","Link","Button","props","disabled","variant","padding","fontSize","fontWeight","letterSpacing","textDecoration","textTransform","hoverFontWeight","hoverTextDecoration","borderRadius","width","height","borderStyle","borderWidth","borderColor","fill","color","bg","stroke","hoverBorderStyle","hoverBorderWidth","hoverBorderColor","hoverFill","hoverColor","hoverBg","hoverStroke","display","transition","zIndex","cursor","testLocatorId","tooltipText","loading","loadingIconProps","onHover","sx","actualProps","RebassButton","generateTestLocator","Flex","LoadingSpinner"],"mappings":";;;;;AAoBA,SAASA,GACPC,GACAC,GACAC,GACkE;AAClE,SAAO,CAACC,MAAkE;AACxE,IAAAH,KAAA,QAAAA,EAAUG,IAENF,MAEE,IAAIA,CAAQ,OAAO,OAAO,SAAS,SAC5BC,KAAA,QAAAA,EAAA;AAAA,MACP,GAAG,OAAO,SAAS,SAAS,MAAM,GAAG,EAAE,CAAC,CAAC,IAAID,CAAQ;AAAA,SAErD,OAAO,QAAQ;AAAA,MACb;AAAA,MACA;AAAA,MACA,GAAG,OAAO,SAAS,SAAS,MAAM,GAAG,EAAE,CAAC,CAAC,IAAIA,CAAQ;AAAA,IAAA,IAG3D,OAAO,cAAc,IAAI,gBAAgB,YAAY,CAAC;AAAA,EACxD;AAEJ;AAEA,MAAMG,KAKF,CAAC;AAAA,EACH,MAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,KAAAC,IAAM;AAAA,EACN,aAAAC;AACF,MAAM;AACJ,QAAMC,IAAiC;AAAA,IACrC,SAAS;AAAA,IACT,OAAO;AAAA,IACP,gBAAgB;AAAA,EAAA;AAGlB,SAAON,MAAS,SACXO,gBAAAA,EAAA,IAAAC,EAAA,U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A,gBACP,UAAU;AAAA,gBACV,WAAW;AAAA,gBACX,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ,YAAY;AAAA,cACd;AAAA,YAAA,IAEF,CAAC;AAAA,YACL,UAAU;AAAA,cACR,QAAQhC,IAAW,YAAY8B;AAAA,cAC/B,aAAaV;AAAA,cACb,aAAaC;AAAA,cACb,aAAaC;AAAA,cACb,MAAMC;AAAA,cACN,QAAQG;AAAA,cACR,OAAOF;AAAA,cACP,IAAIC;AAAA,cACJ,iBAAAjB;AAAA,cACA,qBAAAC;AAAA,cACA,GAAMuB,IACF;AAAA,gBACE,WAAW;AAAA,kBACT,SAAS;AAAA,kBACT,WAAW;AAAA,kBACX,oBAAoB;AAAA,gBACtB;AAAA,cAAA,IAEF,CAAC;AAAA,YACP;AAAA,YACA,QAAAH;AAAA,YACA,GAAGO;AAAA,UACL;AAAA,UACA,SACEhD,MAAS,SACLN,GAAaC,GAASC,GAAUC,CAAO,IACvC,MAAM;AAAA,UAAC;AAAA,UAEb,cAAckD;AAAA,UACd,UAAUnC,KAAYiC;AAAA,UAErB,UAACA,IAGAtC,gBAAAA,EAAAA,IAAC6C,KAAK,QAAO,QAAO,gBAAe,UAAS,YAAW,UACrD,UAAA7C,gBAAAA,EAAA,IAAC8C,GAAgB,EAAA,GAAGP,EAAkB,CAAA,GACxC,IAJA5C;AAAA,QAIA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"sd-component-library24.js","sources":["../src/components/buttons/button/button.tsx"],"sourcesContent":["import React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { History } from \"history\";\nimport { Flex, Button as RebassButton } from \"rebass\";\n\nimport { generateTestLocator } from \"../../../core/functions\";\nimport { LoadingSpinner } from \"../../animations/loading-spinner\";\nimport { ButtonProps } from \"./interfaces\";\n\n/**\n * A wrapper to handle various click behaviours for buttons.\n *\n * @param history The history object for navigation.\n * @param onClick The call back to run on button click.\n * @param link The location to navigate to if the button is a link.\n * @param scrollTo The section of the page to scroll to.\n *\n * @returns The on click call back.\n */\nfunction clickWrapper(\n onClick?: ButtonProps[\"onClick\"],\n scrollTo?: string,\n history?: History\n): (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void {\n return (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void => {\n onClick?.(_event);\n\n if (scrollTo) {\n // If current hash is not same as new hash, update the hash\n if (`#${scrollTo}` !== window.location.hash)\n history?.replace(\n `${window.location.pathname.split(\"#\")[0]}#${scrollTo}`\n ) ||\n window.history.replaceState(\n undefined,\n \"\",\n `${window.location.pathname.split(\"#\")[0]}#${scrollTo}`\n );\n // Otherwise forcefully dispatch a `hashchange` event to scroll.\n window.dispatchEvent(new HashChangeEvent(\"hashchange\"));\n }\n };\n}\n\nconst ButtonWrapper: React.FC<\n Pick<\n ButtonProps,\n \"link\" | \"isInternal\" | \"children\" | \"target\" | \"rel\" | \"onLinkClick\"\n >\n> = ({\n link,\n isInternal = true,\n children,\n target = \"_self\",\n rel = \"noopener noreferrer\",\n onLinkClick,\n}) => {\n const linkStyle: React.CSSProperties = {\n display: \"grid\",\n color: \"inherit\",\n textDecoration: \"none\",\n };\n\n return link === undefined ? (\n <>{children}</>\n ) : isInternal ? (\n <Link\n to={link}\n style={linkStyle}\n data-testid=\"react-router-link\"\n onClick={onLinkClick}\n >\n {children}\n </Link>\n ) : (\n <a\n href={link}\n target={target}\n rel={rel}\n style={linkStyle}\n onClick={onLinkClick}\n data-testid=\"anchor-tag\"\n >\n {children}\n </a>\n );\n};\n\n/**\n * Base button component. Other button components should be built from this.\n */\nexport const Button: React.FC<ButtonProps> = (props) => {\n const {\n link,\n isInternal = true,\n scrollTo,\n onClick,\n children,\n disabled,\n variant,\n padding,\n fontSize,\n fontWeight,\n letterSpacing,\n textDecoration,\n textTransform,\n hoverFontWeight,\n hoverTextDecoration,\n borderRadius,\n width,\n height,\n borderStyle,\n borderWidth,\n borderColor,\n fill,\n color,\n bg,\n stroke,\n hoverBorderStyle,\n hoverBorderWidth,\n hoverBorderColor,\n hoverFill,\n hoverColor,\n hoverBg,\n hoverStroke,\n display,\n transition,\n history,\n zIndex,\n cursor = \"pointer\",\n rel,\n target,\n onLinkClick,\n testLocatorId,\n tooltipText,\n } = props;\n\n const {\n loading = false,\n loadingIconProps = {},\n onHover,\n sx,\n ...actualProps\n } = props;\n\n if (link !== undefined && onClick !== undefined) {\n throw new Error(\"Cannot have link and onClick at the same time\");\n }\n\n return (\n <ButtonWrapper\n link={link}\n isInternal={isInternal}\n rel={rel}\n target={target}\n onLinkClick={onLinkClick}\n >\n <RebassButton\n data-testid=\"button\"\n {...generateTestLocator(testLocatorId)}\n {...actualProps}\n variant={variant}\n sx={{\n position: \"relative\",\n display,\n padding,\n fontFamily: \"proxima-nova\",\n fontSize,\n fontWeight,\n letterSpacing,\n textDecoration,\n textTransform,\n width,\n height,\n borderRadius,\n borderStyle,\n borderWidth,\n borderColor,\n fill,\n stroke,\n color,\n bg,\n outline: \"none !important\",\n transition,\n ...(!!tooltipText\n ? {\n \"::after\": {\n position: \"absolute\",\n opacity: 0,\n pointerEvents: \"none\",\n content: `\"${tooltipText}\"`,\n color: \"cl_darkGrey\",\n textTransform: \"none\",\n letterSpacing: 0,\n left: \"50%\",\n top: \"calc(100% + 10px)\",\n borderRadius: \"0 0 3px 3px\",\n boxShadow: \"0 0 5px 2px #0000001A\",\n borderTop: \"2px solid\",\n borderColor: \"cl_purple\",\n bg: \"white\",\n zIndex: 10,\n padding: \"8px\",\n width: \"max-content\",\n maxWidth: \"100%\",\n transform: \"translate(-50%, -20px)\",\n transition: \"all 150ms cubic-bezier(.25, .8, .25, 1)\",\n fontSize: \"14px\",\n fontWeight: 400,\n lineHeight: \"17px\",\n },\n }\n : {}),\n \":hover\": {\n cursor: disabled ? \"default\" : cursor,\n borderStyle: hoverBorderStyle,\n borderWidth: hoverBorderWidth,\n borderColor: hoverBorderColor,\n fill: hoverFill,\n stroke: hoverStroke,\n color: hoverColor,\n bg: hoverBg,\n hoverFontWeight,\n hoverTextDecoration,\n ...(!!tooltipText\n ? {\n \"::after\": {\n opacity: 1,\n transform: \"translate(-50%, 0)\",\n transitionDuration: \"300ms\",\n },\n }\n : {}),\n },\n zIndex,\n ...sx,\n }}\n onClick={\n link === undefined\n ? clickWrapper(onClick, scrollTo, history)\n : () => {}\n }\n onMouseEnter={onHover}\n disabled={disabled || loading}\n >\n {!loading ? (\n children\n ) : (\n <Flex height=\"100%\" justifyContent=\"center\" alignItems=\"center\">\n <LoadingSpinner {...loadingIconProps} />\n </Flex>\n )}\n </RebassButton>\n </ButtonWrapper>\n );\n};\n"],"names":["clickWrapper","onClick","scrollTo","history","_event","ButtonWrapper","link","isInternal","children","target","rel","onLinkClick","linkStyle","jsx","Fragment","Link","Button","props","disabled","variant","padding","fontSize","fontWeight","letterSpacing","textDecoration","textTransform","hoverFontWeight","hoverTextDecoration","borderRadius","width","height","borderStyle","borderWidth","borderColor","fill","color","bg","stroke","hoverBorderStyle","hoverBorderWidth","hoverBorderColor","hoverFill","hoverColor","hoverBg","hoverStroke","display","transition","zIndex","cursor","testLocatorId","tooltipText","loading","loadingIconProps","onHover","sx","actualProps","RebassButton","generateTestLocator","Flex","LoadingSpinner"],"mappings":";;;;;AAoBA,SAASA,GACPC,GACAC,GACAC,GACkE;AAClE,SAAO,CAACC,MAAkE;AACxE,IAAAH,KAAA,QAAAA,EAAUG,IAENF,MAEE,IAAIA,CAAQ,OAAO,OAAO,SAAS,SAC5BC,KAAA,QAAAA,EAAA;AAAA,MACP,GAAG,OAAO,SAAS,SAAS,MAAM,GAAG,EAAE,CAAC,CAAC,IAAID,CAAQ;AAAA,SAErD,OAAO,QAAQ;AAAA,MACb;AAAA,MACA;AAAA,MACA,GAAG,OAAO,SAAS,SAAS,MAAM,GAAG,EAAE,CAAC,CAAC,IAAIA,CAAQ;AAAA,IAAA,IAG3D,OAAO,cAAc,IAAI,gBAAgB,YAA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IA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./sd-component-library197.js";
|
|
2
2
|
import { getCoordinateForArc as A, getInnerX as H, getInnerY as M, degToRad as E } from "./sd-component-library91.js";
|
|
3
3
|
import { getFractionColor as O } from "./sd-component-library240.js";
|
|
4
|
-
import { BaseOutlineArc as X } from "./sd-component-
|
|
4
|
+
import { BaseOutlineArc as X } from "./sd-component-library313.js";
|
|
5
5
|
const w = "#CCD0DB", q = (G) => {
|
|
6
6
|
const {
|
|
7
7
|
diameter: I,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as N } from "./sd-component-library197.js";
|
|
2
2
|
import { getInnerX as k, getInnerY as B, degToRad as c, getCoordinateForArc as i } from "./sd-component-library91.js";
|
|
3
3
|
import { getFractionColor as b } from "./sd-component-library240.js";
|
|
4
|
-
import { BaseNeedle as q } from "./sd-component-
|
|
4
|
+
import { BaseNeedle as q } from "./sd-component-library314.js";
|
|
5
5
|
const O = (R) => {
|
|
6
6
|
const {
|
|
7
7
|
ranges: r,
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { j as x } from "./sd-component-library197.js";
|
|
2
|
+
import { Box as n } from "rebass";
|
|
3
|
+
const $ = ({
|
|
4
|
+
idx: o,
|
|
5
|
+
color: t,
|
|
6
|
+
total: i,
|
|
7
|
+
segmentHeight: r
|
|
8
|
+
}) => {
|
|
9
|
+
const s = `${o === 0 ? r / 2 : 0}px`, a = `${o === i - 1 ? r / 2 : 0}px`;
|
|
10
|
+
return /* @__PURE__ */ x.jsx(
|
|
11
|
+
n,
|
|
12
|
+
{
|
|
13
|
+
bg: t,
|
|
14
|
+
height: r,
|
|
15
|
+
sx: {
|
|
16
|
+
borderRadius: `${s} ${[...Array(2)].fill(a).join(" ")} ${s}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
2
21
|
export {
|
|
3
|
-
|
|
22
|
+
$ as LinearGaugeSegment
|
|
4
23
|
};
|
|
5
24
|
//# sourceMappingURL=sd-component-library249.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library249.js","sources":["../src/components/meters/linear-
|
|
1
|
+
{"version":3,"file":"sd-component-library249.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-segment/linear-gauge-segment.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { LinearGaugeSegmentProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeSegment: React.FC<Props> = ({\n idx,\n color,\n total,\n segmentHeight,\n}) => {\n const leftRadius = `${idx === 0 ? segmentHeight / 2 : 0}px`;\n const rightRadius = `${idx === total - 1 ? segmentHeight / 2 : 0}px`;\n\n return (\n <Box\n bg={color}\n height={segmentHeight}\n sx={{\n borderRadius: `${leftRadius} ${[...Array(2)]\n .fill(rightRadius)\n .join(\" \")} ${leftRadius}`,\n }}\n />\n );\n};\n"],"names":["LinearGaugeSegment","idx","color","total","segmentHeight","leftRadius","rightRadius","jsx","Box"],"mappings":";;AAMO,MAAMA,IAAsC,CAAC;AAAA,EAClD,KAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAa,GAAGJ,MAAQ,IAAIG,IAAgB,IAAI,CAAC,MACjDE,IAAc,GAAGL,MAAQE,IAAQ,IAAIC,IAAgB,IAAI,CAAC;AAG9D,SAAAG,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAIN;AAAA,MACJ,QAAQE;AAAA,MACR,IAAI;AAAA,QACF,cAAc,GAAGC,CAAU,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EACxC,KAAKC,CAAW,EAChB,KAAK,GAAG,CAAC,IAAID,CAAU;AAAA,MAC5B;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { j as o } from "./sd-component-library197.js";
|
|
2
|
+
import { ResponsiveTextV2 as r } from "./sd-component-library150.js";
|
|
3
|
+
const m = ({
|
|
4
|
+
text: e,
|
|
5
5
|
color: t,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
6
|
+
...i
|
|
7
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
+
r,
|
|
9
|
+
{
|
|
10
|
+
height: "12px",
|
|
11
|
+
fontSizeWeight: [10, "semi-bold"],
|
|
12
|
+
color: t,
|
|
13
|
+
mx: "auto",
|
|
14
|
+
maxWidth: "100%",
|
|
15
|
+
textAlign: "center",
|
|
16
|
+
...i,
|
|
17
|
+
children: e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
m as LinearGaugeLabel
|
|
23
22
|
};
|
|
24
23
|
//# sourceMappingURL=sd-component-library250.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-
|
|
1
|
+
{"version":3,"file":"sd-component-library250.js","sources":["../src/components/meters/linear-gauge-meter-partials/linear-gauge-label/linear-gauge-label.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { ResponsiveTextV2 } from \"../../../texts\";\nimport { LinearGaugeLabelProps as Props } from \"./interfaces\";\n\nexport const LinearGaugeLabel: React.FC<Props> = ({\n text,\n color,\n ...restOfProps\n}) => {\n return (\n <ResponsiveTextV2\n height=\"12px\"\n fontSizeWeight={[10, \"semi-bold\"]}\n color={color}\n mx=\"auto\"\n maxWidth=\"100%\"\n textAlign=\"center\"\n {...restOfProps}\n >\n {text}\n </ResponsiveTextV2>\n );\n};\n"],"names":["LinearGaugeLabel","text","color","restOfProps","jsx","ResponsiveTextV2"],"mappings":";;AAKO,MAAMA,IAAoC,CAAC;AAAA,EAChD,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,QAAO;AAAA,IACP,gBAAgB,CAAC,IAAI,WAAW;AAAA,IAChC,OAAAH;AAAA,IACA,IAAG;AAAA,IACH,UAAS;AAAA,IACT,WAAU;AAAA,IACT,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AAAA;"}
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { ResponsiveTextV2 as r } from "./sd-component-library150.js";
|
|
3
|
-
const m = ({
|
|
4
|
-
text: e,
|
|
5
|
-
color: t,
|
|
6
|
-
...i
|
|
7
|
-
}) => /* @__PURE__ */ o.jsx(
|
|
8
|
-
r,
|
|
9
|
-
{
|
|
10
|
-
height: "12px",
|
|
11
|
-
fontSizeWeight: [10, "semi-bold"],
|
|
12
|
-
color: t,
|
|
13
|
-
mx: "auto",
|
|
14
|
-
maxWidth: "100%",
|
|
15
|
-
textAlign: "center",
|
|
16
|
-
...i,
|
|
17
|
-
children: e
|
|
18
|
-
}
|
|
19
|
-
);
|
|
1
|
+
const i = ({ start: g, end: t }, c) => c >= g && (t === 1 ? c <= t : c < t);
|
|
20
2
|
export {
|
|
21
|
-
|
|
3
|
+
i as isMatchingRange
|
|
22
4
|
};
|
|
23
5
|
//# sourceMappingURL=sd-component-library251.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library251.js","sources":["../src/components/meters/linear-gauge-meter
|
|
1
|
+
{"version":3,"file":"sd-component-library251.js","sources":["../src/components/meters/linear-numeric-gauge-meter/utils.ts"],"sourcesContent":["import { LinearNumericGaugeMeterSegment } from \"./interfaces\";\n\nexport const isMatchingRange = (\n { start, end }: Pick<LinearNumericGaugeMeterSegment, \"start\" | \"end\">,\n value: number\n) => value >= start && (end === 1 ? value <= end : value < end);\n"],"names":["isMatchingRange","start","end","value"],"mappings":"AAEO,MAAMA,IAAkB,CAC7B,EAAE,OAAAC,GAAO,KAAAC,EAAI,GACbC,MACGA,KAASF,MAAUC,MAAQ,IAAIC,KAASD,IAAMC,IAAQD;"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { j as n } from "./sd-component-library197.js";
|
|
2
|
+
import { Button as a } from "./sd-component-library24.js";
|
|
3
|
+
const u = (r) => {
|
|
4
|
+
const {
|
|
5
|
+
borderColor: e,
|
|
6
|
+
borderStyle: o,
|
|
7
|
+
borderWidth: i,
|
|
8
|
+
fill: d,
|
|
9
|
+
width: l,
|
|
10
|
+
height: h,
|
|
11
|
+
disabled: t
|
|
12
|
+
} = r;
|
|
13
|
+
return /* @__PURE__ */ n.jsx(
|
|
14
|
+
a,
|
|
11
15
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children:
|
|
16
|
+
...r,
|
|
17
|
+
width: l || ["30px"],
|
|
18
|
+
height: h || ["30px"],
|
|
19
|
+
borderColor: t ? "cl_lightGrey" : e || "#4668F8",
|
|
20
|
+
borderStyle: o || "solid",
|
|
21
|
+
borderWidth: i || "2px",
|
|
22
|
+
fill: t ? "cl_lightGrey" : d || "#4668F8",
|
|
23
|
+
"data-testid": "square-button",
|
|
24
|
+
variant: "_square",
|
|
25
|
+
children: r.children
|
|
22
26
|
}
|
|
23
27
|
);
|
|
24
28
|
};
|
|
25
29
|
export {
|
|
26
|
-
|
|
30
|
+
u as SquareButton
|
|
27
31
|
};
|
|
28
32
|
//# sourceMappingURL=sd-component-library254.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library254.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library254.js","sources":["../src/components/buttons/partials/square-button/square-button.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Button } from \"../../button\";\nimport { SquareButtonProps } from \"./interfaces\";\n\n/**\n * The circle button.\n */\nexport const SquareButton: React.FC<SquareButtonProps> = (props) => {\n const {\n borderColor,\n borderStyle,\n borderWidth,\n fill,\n width,\n height,\n disabled,\n } = props;\n return (\n <Button\n {...props}\n width={width || [\"30px\"]}\n height={height || [\"30px\"]}\n borderColor={!disabled ? borderColor || \"#4668F8\" : \"cl_lightGrey\"}\n borderStyle={borderStyle || \"solid\"}\n borderWidth={borderWidth || \"2px\"}\n fill={!disabled ? fill || \"#4668F8\" : \"cl_lightGrey\"}\n data-testid=\"square-button\"\n variant=\"_square\"\n >\n {props.children}\n </Button>\n );\n};\n"],"names":["SquareButton","props","borderColor","borderStyle","borderWidth","fill","width","height","disabled","jsx","Button"],"mappings":";;AAQa,MAAAA,IAA4C,CAACC,MAAU;AAC5D,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAP;AAEF,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGT;AAAA,MACJ,OAAOK,KAAS,CAAC,MAAM;AAAA,MACvB,QAAQC,KAAU,CAAC,MAAM;AAAA,MACzB,aAAcC,IAAsC,iBAA3BN,KAAe;AAAA,MACxC,aAAaC,KAAe;AAAA,MAC5B,aAAaC,KAAe;AAAA,MAC5B,MAAOI,IAA+B,iBAApBH,KAAQ;AAAA,MAC1B,eAAY;AAAA,MACZ,SAAQ;AAAA,MAEP,UAAMJ,EAAA;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { ResponsiveTextV2 as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { j as t } from "./sd-component-library197.js";
|
|
2
|
+
import { ResponsiveTextV2 as o } from "./sd-component-library150.js";
|
|
3
|
+
const s = (e) => {
|
|
4
|
+
const { currentPage: r } = e;
|
|
5
|
+
return /* @__PURE__ */ t.jsx(
|
|
6
|
+
o,
|
|
7
|
+
{
|
|
8
|
+
fontSizeWeight: [14, "regular"],
|
|
9
|
+
sx: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
borderColor: "cl_lightGrey",
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderStyle: "solid",
|
|
16
|
+
borderRadius: "3px",
|
|
17
|
+
height: "30px",
|
|
18
|
+
minWidth: "30px"
|
|
19
|
+
},
|
|
20
|
+
children: r
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
22
24
|
export {
|
|
23
|
-
|
|
25
|
+
s as CurrentPage
|
|
24
26
|
};
|
|
25
27
|
//# sourceMappingURL=sd-component-library256.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library256.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library256.js","sources":["../src/components/page-selectors/page-selector/partials/current-page/current-page.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts\";\nimport { CurrentPageProps as Props } from \"./interfaces\";\n\nexport const CurrentPage: React.FC<Props> = (props) => {\n const { currentPage } = props;\n\n return (\n <ResponsiveTextV2\n fontSizeWeight={[14, \"regular\"]}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderColor: \"cl_lightGrey\",\n borderWidth: 1,\n borderStyle: \"solid\",\n borderRadius: \"3px\",\n height: \"30px\",\n minWidth: \"30px\",\n }}\n >\n {currentPage}\n </ResponsiveTextV2>\n );\n};\n"],"names":["CurrentPage","props","currentPage","jsx","ResponsiveTextV2"],"mappings":";;AAKa,MAAAA,IAA+B,CAACC,MAAU;AAC/C,QAAA,EAAE,aAAAC,EAAgB,IAAAD;AAGtB,SAAAE,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgB,CAAC,IAAI,SAAS;AAAA,MAC9B,IAAI;AAAA,QACF,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,aAAa;AAAA,QACb,aAAa;AAAA,QACb,aAAa;AAAA,QACb,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,MAEC,UAAAF;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|