@lightsparkdev/ui 0.0.7 → 0.0.9
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/CHANGELOG.md +24 -0
- package/dist/chunk-3EVAP5JT.js +67 -0
- package/dist/{chunk-IQFU7CM5.js → chunk-3GS5EFXV.js} +1 -1
- package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
- package/dist/{chunk-N2RDQJQ5.js → chunk-5POPBNPS.js} +1 -1
- package/dist/{chunk-WWFDI534.js → chunk-7C4MHI6Q.js} +13 -6
- package/dist/{chunk-3CZOYF3X.js → chunk-7T36JGTC.js} +2 -2
- package/dist/chunk-A4FQBEYU.js +163 -0
- package/dist/chunk-ATUH6SXK.js +233 -0
- package/dist/chunk-DQRN4E5G.js +25 -0
- package/dist/{chunk-RTUZVKPK.js → chunk-E3AOYBY5.js} +1 -1
- package/dist/{chunk-I74XQIVV.js → chunk-EEFNW7NS.js} +3 -3
- package/dist/{chunk-UO6U7AYM.js → chunk-FCZJILMW.js} +1 -1
- package/dist/{chunk-2WYVO6B2.js → chunk-H3RW6JSU.js} +1 -1
- package/dist/chunk-IPAXAP6K.js +119 -0
- package/dist/{chunk-NGS4OSWT.js → chunk-J4FJQ3FN.js} +1 -1
- package/dist/{chunk-RFGKH3R6.js → chunk-JK4BP73A.js} +39 -38
- package/dist/{chunk-T33SBHYI.js → chunk-KMR5C25B.js} +3 -1
- package/dist/{chunk-JYWYEOM6.js → chunk-NFSAJ5GJ.js} +23 -10
- package/dist/{chunk-G2PZZFJL.js → chunk-NM7UW54G.js} +21 -24
- package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
- package/dist/chunk-P3EUPXFA.js +150 -0
- package/dist/chunk-PBRN7MJY.js +315 -0
- package/dist/{chunk-NH25O7PC.js → chunk-PVQCLQNA.js} +1 -1
- package/dist/{chunk-NZJCJJH5.js → chunk-RWIZ7Q74.js} +1 -1
- package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
- package/dist/{chunk-K7D7A34K.js → chunk-XP2MX2AA.js} +1 -1
- package/dist/{chunk-23SR7TFO.js → chunk-XZR237JJ.js} +1 -1
- package/dist/{chunk-VBWTKANQ.js → chunk-Y37DCY7Y.js} +3 -3
- package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
- package/dist/{chunk-FKETYVPP.js → chunk-ZANLDY2W.js} +87 -43
- package/dist/components/Badge.cjs +1346 -0
- package/dist/components/Badge.d.cts +10 -0
- package/dist/components/Badge.d.ts +10 -0
- package/dist/components/Badge.js +13 -0
- package/dist/components/Button.cjs +235 -107
- package/dist/components/Button.d.cts +3 -1
- package/dist/components/Button.d.ts +3 -1
- package/dist/components/Button.js +8 -7
- package/dist/components/ButtonRow.cjs +254 -110
- package/dist/components/ButtonRow.d.cts +6 -2
- package/dist/components/ButtonRow.d.ts +6 -2
- package/dist/components/ButtonRow.js +14 -11
- package/dist/components/CardPage.cjs +1921 -0
- package/dist/components/CardPage.d.cts +54 -0
- package/dist/components/CardPage.d.ts +54 -0
- package/dist/components/CardPage.js +33 -0
- package/dist/components/Collapsible.cjs +38 -54
- package/dist/components/Collapsible.js +4 -5
- package/dist/components/ContentTable.cjs +38 -54
- package/dist/components/ContentTable.js +3 -4
- package/dist/components/CopyToClipboardButton.cjs +161 -65
- package/dist/components/CopyToClipboardButton.js +6 -5
- package/dist/components/CurrencyAmount.cjs +38 -54
- package/dist/components/CurrencyAmount.js +3 -4
- package/dist/components/FileInput.cjs +1959 -0
- package/dist/components/FileInput.d.cts +21 -0
- package/dist/components/FileInput.d.ts +21 -0
- package/dist/components/FileInput.js +113 -0
- package/dist/components/GradientCardHeader.cjs +177 -0
- package/dist/components/GradientCardHeader.d.cts +10 -0
- package/dist/components/GradientCardHeader.d.ts +10 -0
- package/dist/components/GradientCardHeader.js +8 -0
- package/dist/components/Icon.cjs +38 -54
- package/dist/components/Icon.js +2 -3
- package/dist/components/LightTooltip.cjs +1428 -0
- package/dist/components/LightTooltip.d.cts +9 -0
- package/dist/components/LightTooltip.d.ts +9 -0
- package/dist/components/LightTooltip.js +12 -0
- package/dist/components/LightboxImage.cjs +1 -1
- package/dist/components/LightboxImage.js +2 -2
- package/dist/components/LightsparkProvider.cjs +41 -57
- package/dist/components/LightsparkProvider.js +3 -4
- package/dist/components/Loading.cjs +38 -54
- package/dist/components/Loading.js +3 -4
- package/dist/components/Modal.cjs +251 -145
- package/dist/components/Modal.js +12 -11
- package/dist/components/Pill.cjs +1717 -0
- package/dist/components/Pill.d.cts +19 -0
- package/dist/components/Pill.d.ts +19 -0
- package/dist/components/Pill.js +16 -0
- package/dist/components/ProgressBar.cjs +38 -56
- package/dist/components/ProgressBar.js +2 -3
- package/dist/components/SecretContainer.cjs +162 -66
- package/dist/components/SecretContainer.js +7 -6
- package/dist/components/TextIconAligner.cjs +38 -54
- package/dist/components/TextIconAligner.js +3 -4
- package/dist/components/UnstyledButton.cjs +38 -54
- package/dist/components/UnstyledButton.js +2 -3
- package/dist/components/documentation/AnchorLinkHeader.cjs +38 -56
- package/dist/components/documentation/AnchorLinkHeader.js +3 -4
- package/dist/components/documentation/index.cjs +38 -56
- package/dist/components/documentation/index.js +3 -4
- package/dist/components/index.cjs +1191 -358
- package/dist/components/index.d.cts +7 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +63 -32
- package/dist/icons/ArrowCornerDownRight.cjs +49 -0
- package/dist/icons/ArrowCornerDownRight.d.cts +5 -0
- package/dist/icons/ArrowCornerDownRight.d.ts +5 -0
- package/dist/icons/ArrowCornerDownRight.js +30 -0
- package/dist/icons/Copy.cjs +4 -3
- package/dist/icons/Copy.js +4 -3
- package/dist/icons/Download.cjs +22 -11
- package/dist/icons/Download.js +23 -12
- package/dist/icons/Sort.cjs +48 -0
- package/dist/icons/Sort.d.cts +5 -0
- package/dist/icons/Sort.d.ts +5 -0
- package/dist/icons/Sort.js +29 -0
- package/dist/icons/Upload.cjs +22 -11
- package/dist/icons/Upload.js +23 -12
- package/dist/icons/index.cjs +38 -54
- package/dist/icons/index.js +2 -3
- package/dist/router.cjs +7 -3
- package/dist/router.js +1 -1
- package/dist/styles/common.cjs +38 -66
- package/dist/styles/common.d.cts +10 -11
- package/dist/styles/common.d.ts +10 -11
- package/dist/styles/common.js +1 -14
- package/dist/styles/fields.cjs +117 -61
- package/dist/styles/fields.d.cts +12 -5
- package/dist/styles/fields.d.ts +12 -5
- package/dist/styles/fields.js +28 -164
- package/dist/styles/fonts/typography/Article.cjs +38 -54
- package/dist/styles/fonts/typography/Article.js +5 -6
- package/dist/styles/fonts/typography/index.cjs +38 -54
- package/dist/styles/fonts/typography/index.js +5 -6
- package/dist/styles/global.cjs +41 -57
- package/dist/styles/global.js +2 -3
- package/dist/styles/type.cjs +38 -54
- package/dist/styles/type.js +8 -145
- package/dist/styles/utils.cjs +38 -54
- package/dist/styles/utils.js +2 -3
- package/dist/styles/z-index.cjs +1 -1
- package/dist/styles/z-index.d.cts +1 -1
- package/dist/styles/z-index.d.ts +1 -1
- package/dist/styles/z-index.js +1 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/toReactNodes.cjs +7 -3
- package/dist/utils/toReactNodes.js +2 -2
- package/package.json +10 -6
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Heading
|
|
3
|
+
} from "./chunk-P3EUPXFA.js";
|
|
4
|
+
import {
|
|
5
|
+
ButtonRowContainer
|
|
6
|
+
} from "./chunk-NFSAJ5GJ.js";
|
|
7
|
+
import {
|
|
8
|
+
z
|
|
9
|
+
} from "./chunk-55OQPFLF.js";
|
|
10
|
+
import {
|
|
11
|
+
flexCenter,
|
|
12
|
+
overflowAutoWithoutScrollbars,
|
|
13
|
+
size
|
|
14
|
+
} from "./chunk-FCZJILMW.js";
|
|
15
|
+
import {
|
|
16
|
+
cardBorderRadiusPx,
|
|
17
|
+
darkGradientBg,
|
|
18
|
+
headingContentMarginPx,
|
|
19
|
+
standardBorderRadius,
|
|
20
|
+
standardCardShadow,
|
|
21
|
+
standardContentInset
|
|
22
|
+
} from "./chunk-JK4BP73A.js";
|
|
23
|
+
import {
|
|
24
|
+
themeOr
|
|
25
|
+
} from "./chunk-2VBDEO6M.js";
|
|
26
|
+
import {
|
|
27
|
+
bp,
|
|
28
|
+
useBreakpoints
|
|
29
|
+
} from "./chunk-JSGRNWSB.js";
|
|
30
|
+
|
|
31
|
+
// src/components/CardPage.tsx
|
|
32
|
+
import styled from "@emotion/styled";
|
|
33
|
+
import { Fragment, useEffect, useRef, useState } from "react";
|
|
34
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
35
|
+
function CardPage(props) {
|
|
36
|
+
const initiallyExpanded = useRef(Boolean(props.expandRight));
|
|
37
|
+
const [wasExpanded, setWasExpanded] = useState(Boolean(props.expandRight));
|
|
38
|
+
const bp2 = useBreakpoints();
|
|
39
|
+
const header = props.title ? /* @__PURE__ */ jsx(CardPageHeader, { children: /* @__PURE__ */ jsx(Heading, { type: "h1", m0: true, children: props.title }) }) : null;
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (props.expandRight) {
|
|
42
|
+
setWasExpanded(true);
|
|
43
|
+
}
|
|
44
|
+
}, [props.expandRight]);
|
|
45
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
46
|
+
CardPageContainer,
|
|
47
|
+
{
|
|
48
|
+
id: props.id,
|
|
49
|
+
bp: bp2,
|
|
50
|
+
hasRightContent: Boolean(props.rightContent),
|
|
51
|
+
wasExpanded,
|
|
52
|
+
expandRight: Boolean(props.expandRight),
|
|
53
|
+
minContentHeight: props.minContentHeight,
|
|
54
|
+
initiallyExpanded: initiallyExpanded.current,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx("div", { css: props.minContentWidth ? overflowAutoWithoutScrollbars : null, children: /* @__PURE__ */ jsxs(
|
|
57
|
+
CardPageContent,
|
|
58
|
+
{
|
|
59
|
+
hasPreHeaderContent: Boolean(props.preHeaderContent),
|
|
60
|
+
minContentHeight: props.minContentHeight,
|
|
61
|
+
maxContentWidth: props.maxContentWidth,
|
|
62
|
+
children: [
|
|
63
|
+
props.preHeaderContent,
|
|
64
|
+
header,
|
|
65
|
+
props.children
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
props.rightContent && /* @__PURE__ */ jsx(CardPageRightContent, { children: /* @__PURE__ */ jsx(
|
|
70
|
+
CardPageRightContentInner,
|
|
71
|
+
{
|
|
72
|
+
hasRightContent: Boolean(props.rightContent),
|
|
73
|
+
children: props.rightContent
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
}
|
|
80
|
+
CardPage.defaultProps = {
|
|
81
|
+
minContentHeight: void 0,
|
|
82
|
+
minContentWidth: void 0,
|
|
83
|
+
maxContentWidth: void 0
|
|
84
|
+
};
|
|
85
|
+
var CardPageFullContent = styled.div``;
|
|
86
|
+
var CardPageFullWidth = styled.div``;
|
|
87
|
+
var CardPageRightContentInner = styled.div`
|
|
88
|
+
${flexCenter}
|
|
89
|
+
height: 100%;
|
|
90
|
+
padding: 150px 25px;
|
|
91
|
+
${({ hasRightContent }) => hasRightContent && `justify-content: space-evenly;`}
|
|
92
|
+
`;
|
|
93
|
+
var CardPageRightContent = styled.div`
|
|
94
|
+
display: flex;
|
|
95
|
+
position: relative;
|
|
96
|
+
${CardPageRightContentInner} {
|
|
97
|
+
${darkGradientBg};
|
|
98
|
+
position: relative;
|
|
99
|
+
height: calc(100% + 80px);
|
|
100
|
+
margin-top: -40px;
|
|
101
|
+
margin-bottom: -40px;
|
|
102
|
+
margin-right: -40px;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
width: 100%;
|
|
105
|
+
|
|
106
|
+
${bp.minSm(`
|
|
107
|
+
${standardBorderRadius([0, cardBorderRadiusPx, cardBorderRadiusPx, 0])};
|
|
108
|
+
`)}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
var vCardPaddingPx = 40;
|
|
112
|
+
var expandTiming = `0.65s ease-in-out`;
|
|
113
|
+
var CardPageContainer = styled.div`
|
|
114
|
+
${standardContentInset.css}
|
|
115
|
+
${({ theme }) => themeOr(`background-color: ${theme.bg}`, "transparent")({ theme })};
|
|
116
|
+
position: relative;
|
|
117
|
+
z-index: ${z.card};
|
|
118
|
+
|
|
119
|
+
${({ minContentHeight }) => `
|
|
120
|
+
min-height: ${minContentHeight !== void 0 && minContentHeight !== null ? `${minContentHeight}px` : "250px"};
|
|
121
|
+
`}
|
|
122
|
+
|
|
123
|
+
${bp.sm(`
|
|
124
|
+
width: 100% !important;
|
|
125
|
+
`)}
|
|
126
|
+
|
|
127
|
+
& > * {
|
|
128
|
+
${standardContentInset.css}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& ${CardPageFullContent}, & ${CardPageFullWidth} {
|
|
132
|
+
${bp.sm(`
|
|
133
|
+
width: calc(100% + ${standardContentInset.smPx * 2}px);
|
|
134
|
+
margin-left: -${standardContentInset.smPx}px;
|
|
135
|
+
`)}
|
|
136
|
+
|
|
137
|
+
${bp.minSmMaxLg(`
|
|
138
|
+
width: calc(100% + ${standardContentInset.minSmMaxLgPx * 2}px);
|
|
139
|
+
margin-left: -${standardContentInset.minSmMaxLgPx}px;
|
|
140
|
+
`)}
|
|
141
|
+
|
|
142
|
+
${bp.lg(`
|
|
143
|
+
width: calc(100% + ${standardContentInset.lgPx * 2}px);
|
|
144
|
+
margin-left: -${standardContentInset.lgPx}px;
|
|
145
|
+
`)}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
& ${CardPageFullContent} {
|
|
149
|
+
& > * {
|
|
150
|
+
padding-top: ${vCardPaddingPx}px;
|
|
151
|
+
padding-bottom: ${vCardPaddingPx}px;
|
|
152
|
+
${bp.sm(`
|
|
153
|
+
padding-top: 0;
|
|
154
|
+
padding-bottom: 0;
|
|
155
|
+
`)}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
margin-top: -${vCardPaddingPx}px;
|
|
159
|
+
${bp.sm(`margin-top: 0;`)}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
${bp.minSm(`
|
|
163
|
+
${standardCardShadow.styles};
|
|
164
|
+
padding: ${vCardPaddingPx}px 0;
|
|
165
|
+
${standardBorderRadius(cardBorderRadiusPx)}
|
|
166
|
+
`)}
|
|
167
|
+
|
|
168
|
+
&:not(:last-child) {
|
|
169
|
+
margin-bottom: 30px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@keyframes rightSideExpand {
|
|
173
|
+
0% {
|
|
174
|
+
width: 50%;
|
|
175
|
+
}
|
|
176
|
+
100% {
|
|
177
|
+
width: 100%;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@keyframes rightSideCollapse {
|
|
182
|
+
0% {
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
100% {
|
|
186
|
+
width: 50%;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@keyframes leftSideCollapse {
|
|
191
|
+
0% {
|
|
192
|
+
width: 50%;
|
|
193
|
+
height: auto;
|
|
194
|
+
opacity: 1;
|
|
195
|
+
}
|
|
196
|
+
30% {
|
|
197
|
+
opacity: 0;
|
|
198
|
+
}
|
|
199
|
+
100% {
|
|
200
|
+
height: 0px;
|
|
201
|
+
width: 0%;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@keyframes leftSideExpand {
|
|
206
|
+
0% {
|
|
207
|
+
width: 0%;
|
|
208
|
+
opacity: 0;
|
|
209
|
+
}
|
|
210
|
+
50% {
|
|
211
|
+
opacity: 0;
|
|
212
|
+
}
|
|
213
|
+
100% {
|
|
214
|
+
width: 50%;
|
|
215
|
+
opacity: 1;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
${({ hasRightContent }) => hasRightContent && `
|
|
220
|
+
display: flex;
|
|
221
|
+
& > * {
|
|
222
|
+
width: 50%;
|
|
223
|
+
${bp.sm(`width: 100%;`)}
|
|
224
|
+
|
|
225
|
+
&:first-of-type > * {
|
|
226
|
+
${bp.minSmMaxLg(`
|
|
227
|
+
width: calc(100% - ${standardContentInset.minSmMaxLgPx * 2}px);
|
|
228
|
+
margin-left: ${standardContentInset.minSmMaxLgPx}px;
|
|
229
|
+
`)}
|
|
230
|
+
${bp.lg(`
|
|
231
|
+
width: calc(100% - ${standardContentInset.lgPx * 3}px);
|
|
232
|
+
margin-left: ${standardContentInset.lgPx}px;
|
|
233
|
+
`)}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
`}
|
|
237
|
+
|
|
238
|
+
& > :not(${CardPageRightContent}) {
|
|
239
|
+
${({ expandRight, wasExpanded, initiallyExpanded }) => expandRight && wasExpanded ? bp.minSm(`
|
|
240
|
+
width: 0%;
|
|
241
|
+
height: 0px;
|
|
242
|
+
${initiallyExpanded ? "" : `animation: leftSideCollapse ${expandTiming};`}
|
|
243
|
+
overflow: hidden;
|
|
244
|
+
margin: 0%;
|
|
245
|
+
opacity: 0;
|
|
246
|
+
`) : wasExpanded ? bp.minSm(`
|
|
247
|
+
width: 50%;
|
|
248
|
+
animation: leftSideExpand ${expandTiming};
|
|
249
|
+
`) : ""}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
& > ${CardPageRightContent} {
|
|
253
|
+
${({ expandRight, wasExpanded, initiallyExpanded }) => expandRight && wasExpanded ? bp.minSm(`
|
|
254
|
+
width: 100%;
|
|
255
|
+
${initiallyExpanded ? "" : `animation: rightSideExpand ${expandTiming};`}
|
|
256
|
+
margin: 0%;
|
|
257
|
+
& > ${CardPageRightContentInner.toString()} {
|
|
258
|
+
border-radius: ${cardBorderRadiusPx}px !important;
|
|
259
|
+
}
|
|
260
|
+
`) : wasExpanded ? bp.minSm(`
|
|
261
|
+
width: 50%;
|
|
262
|
+
animation: rightSideCollapse ${expandTiming};
|
|
263
|
+
`) : ""}
|
|
264
|
+
}
|
|
265
|
+
`;
|
|
266
|
+
var CardPageSubtitle = styled.p`
|
|
267
|
+
color: ${({ theme }) => theme.mcNeutral};
|
|
268
|
+
font-size: ${size.px14};
|
|
269
|
+
line-height: ${size.px18};
|
|
270
|
+
font-weight: 600;
|
|
271
|
+
margin: 0;
|
|
272
|
+
`;
|
|
273
|
+
var CardPageHeader = styled.div`
|
|
274
|
+
align-items: center;
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-direction: row;
|
|
277
|
+
justify-content: space-between;
|
|
278
|
+
position: relative;
|
|
279
|
+
|
|
280
|
+
& + *:not(${CardPageSubtitle}):not(${ButtonRowContainer}) {
|
|
281
|
+
margin-top: ${headingContentMarginPx}px !important;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
& + ${CardPageSubtitle} {
|
|
285
|
+
margin-top: 5px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
& + ${ButtonRowContainer} {
|
|
289
|
+
margin-top: 16px;
|
|
290
|
+
}
|
|
291
|
+
`;
|
|
292
|
+
var CardPageContent = styled.div`
|
|
293
|
+
${({
|
|
294
|
+
maxContentWidth,
|
|
295
|
+
minContentHeight,
|
|
296
|
+
minContentWidth,
|
|
297
|
+
hasPreHeaderContent
|
|
298
|
+
}) => `
|
|
299
|
+
max-width: ${maxContentWidth ? `${maxContentWidth}px` : "initial"};
|
|
300
|
+
min-width: ${minContentWidth ? `${minContentWidth}px` : "initial"};
|
|
301
|
+
${CardPageHeader.toString()} {
|
|
302
|
+
margin-top: ${hasPreHeaderContent ? "25px" : "0"};
|
|
303
|
+
}
|
|
304
|
+
min-height: ${minContentHeight !== void 0 && minContentHeight !== null ? `${minContentHeight}px` : "400px"};
|
|
305
|
+
`}
|
|
306
|
+
`;
|
|
307
|
+
|
|
308
|
+
export {
|
|
309
|
+
CardPage,
|
|
310
|
+
CardPageFullContent,
|
|
311
|
+
CardPageFullWidth,
|
|
312
|
+
CardPageRightContentInner,
|
|
313
|
+
CardPageSubtitle,
|
|
314
|
+
CardPageContent
|
|
315
|
+
};
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
} from "./chunk-YMNSXZ5D.js";
|
|
20
20
|
import {
|
|
21
21
|
overflowAutoWithoutScrollbars
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FCZJILMW.js";
|
|
23
23
|
import {
|
|
24
24
|
StyledContentTable
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XP2MX2AA.js";
|
|
26
26
|
import {
|
|
27
27
|
standardBorderRadius
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JK4BP73A.js";
|
|
29
29
|
import {
|
|
30
30
|
colors
|
|
31
31
|
} from "./chunk-2VBDEO6M.js";
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Link
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OGSDZTHM.js";
|
|
4
4
|
import {
|
|
5
5
|
select
|
|
6
6
|
} from "./chunk-YMNSXZ5D.js";
|
|
7
7
|
import {
|
|
8
8
|
Loading
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J4FJQ3FN.js";
|
|
10
10
|
import {
|
|
11
11
|
UnstyledButton
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3GS5EFXV.js";
|
|
13
|
+
import {
|
|
14
|
+
LightTooltip
|
|
15
|
+
} from "./chunk-3EVAP5JT.js";
|
|
13
16
|
import {
|
|
14
17
|
Icon
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RWIZ7Q74.js";
|
|
16
19
|
import {
|
|
17
20
|
getFocusOutline
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JK4BP73A.js";
|
|
19
22
|
import {
|
|
20
23
|
colors,
|
|
21
24
|
themeOr
|
|
@@ -28,6 +31,8 @@ import {
|
|
|
28
31
|
// src/components/Button.tsx
|
|
29
32
|
import { css } from "@emotion/react";
|
|
30
33
|
import styled from "@emotion/styled";
|
|
34
|
+
import { uniqueId } from "lodash-es";
|
|
35
|
+
import { Fragment, useRef } from "react";
|
|
31
36
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
32
37
|
function getTextColor({ color, theme, primary, blue }) {
|
|
33
38
|
if (color) {
|
|
@@ -63,12 +68,37 @@ function getBackgroundColor({
|
|
|
63
68
|
}
|
|
64
69
|
return themeOr(colors.white, theme.c1Neutral)({ theme });
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
var paddingsY = {
|
|
72
|
+
lg: 14,
|
|
73
|
+
md: 9,
|
|
74
|
+
sm: 6
|
|
75
|
+
};
|
|
76
|
+
var roundPaddingsX = {
|
|
77
|
+
lg: 19,
|
|
78
|
+
md: 14,
|
|
79
|
+
sm: 10
|
|
80
|
+
};
|
|
81
|
+
var paddingsX = {
|
|
82
|
+
lg: 24,
|
|
83
|
+
md: 18,
|
|
84
|
+
sm: 16
|
|
85
|
+
};
|
|
86
|
+
function getPaddingX({
|
|
87
|
+
size,
|
|
88
|
+
ghost,
|
|
89
|
+
isRound
|
|
90
|
+
}) {
|
|
91
|
+
return ghost ? 0 : isRound ? roundPaddingsX[size] : paddingsX[size];
|
|
68
92
|
}
|
|
69
|
-
function getPadding({
|
|
70
|
-
|
|
71
|
-
|
|
93
|
+
function getPadding({
|
|
94
|
+
iconWidth,
|
|
95
|
+
size,
|
|
96
|
+
ghost,
|
|
97
|
+
iconSide,
|
|
98
|
+
isRound
|
|
99
|
+
}) {
|
|
100
|
+
const paddingY = ghost ? 0 : paddingsY[size];
|
|
101
|
+
const paddingX = getPaddingX({ size, ghost, isRound });
|
|
72
102
|
const paddingForIcon = iconWidth && !ghost ? iconWidth : 0;
|
|
73
103
|
return `${paddingY}px ${paddingX + (iconSide === "right" ? paddingForIcon : 0)}px ${paddingY}px ${paddingX + (iconSide === "left" ? paddingForIcon : 0)}px`;
|
|
74
104
|
}
|
|
@@ -117,8 +147,10 @@ function Button({
|
|
|
117
147
|
type = "button",
|
|
118
148
|
blue = false,
|
|
119
149
|
newTab = false,
|
|
120
|
-
zIndex = void 0
|
|
150
|
+
zIndex = void 0,
|
|
151
|
+
tooltipText
|
|
121
152
|
}) {
|
|
153
|
+
const tooltipId = useRef(uniqueId());
|
|
122
154
|
const iconMarginRight = 6;
|
|
123
155
|
const iconSize = size === "lg" ? 16 : 12;
|
|
124
156
|
let currentIcon = null;
|
|
@@ -127,30 +159,34 @@ function Button({
|
|
|
127
159
|
} else if (icon) {
|
|
128
160
|
currentIcon = /* @__PURE__ */ jsx(ButtonIcon, { ghost, iconSide, text, size, children: /* @__PURE__ */ jsx(Icon, { name: icon, width: iconSize }) });
|
|
129
161
|
}
|
|
130
|
-
const content = /* @__PURE__ */ jsxs(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
163
|
+
/* @__PURE__ */ jsxs(
|
|
164
|
+
"div",
|
|
165
|
+
__spreadProps(__spreadValues({}, tooltipText ? { "data-tooltip-id": tooltipId.current } : {}), {
|
|
166
|
+
css: {
|
|
167
|
+
display: "flex",
|
|
168
|
+
alignItems: "center",
|
|
169
|
+
justifyContent: "center"
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
iconSide === "left" && currentIcon,
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
css: {
|
|
177
|
+
textOverflow: "ellipsis",
|
|
178
|
+
overflow: "hidden"
|
|
179
|
+
},
|
|
180
|
+
children: text
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
iconSide === "right" && currentIcon
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
),
|
|
187
|
+
tooltipText ? /* @__PURE__ */ jsx(LightTooltip, { id: tooltipId.current, content: tooltipText }) : null
|
|
188
|
+
] });
|
|
189
|
+
const isSingleCharRoundButton = Boolean(text && text.length === 1 && !icon);
|
|
154
190
|
const commonProps = {
|
|
155
191
|
backgroundColor,
|
|
156
192
|
color,
|
|
@@ -163,6 +199,7 @@ function Button({
|
|
|
163
199
|
fullWidth,
|
|
164
200
|
blue,
|
|
165
201
|
iconSide,
|
|
202
|
+
isRound: isSingleCharRoundButton,
|
|
166
203
|
iconWidth: currentIcon ? iconSize + iconMarginRight : 0,
|
|
167
204
|
isLoading: loading,
|
|
168
205
|
disabled: disabled || loading,
|
|
@@ -179,7 +216,6 @@ function Button({
|
|
|
179
216
|
}
|
|
180
217
|
return href ? /* @__PURE__ */ jsx(ButtonHrefLink, __spreadProps(__spreadValues({}, commonProps), { href, target: "_blank", children: content })) : /* @__PURE__ */ jsx(StyledButton, __spreadProps(__spreadValues({}, commonProps), { children: content }));
|
|
181
218
|
}
|
|
182
|
-
var hPaddingPx = 24;
|
|
183
219
|
var buttonStyle = ({
|
|
184
220
|
color,
|
|
185
221
|
backgroundColor,
|
|
@@ -195,7 +231,8 @@ var buttonStyle = ({
|
|
|
195
231
|
blue,
|
|
196
232
|
text,
|
|
197
233
|
zIndex,
|
|
198
|
-
iconSide
|
|
234
|
+
iconSide,
|
|
235
|
+
isRound
|
|
199
236
|
}) => css`
|
|
200
237
|
display: inline-flex;
|
|
201
238
|
opacity: ${disabled && !isLoading ? 0.2 : 1};
|
|
@@ -232,8 +269,15 @@ var buttonStyle = ({
|
|
|
232
269
|
primary,
|
|
233
270
|
blue
|
|
234
271
|
})};
|
|
235
|
-
border-radius: 32px;
|
|
236
|
-
padding: ${getPadding({
|
|
272
|
+
border-radius: ${isRound ? "100%" : "32px"};
|
|
273
|
+
padding: ${getPadding({
|
|
274
|
+
size,
|
|
275
|
+
iconWidth,
|
|
276
|
+
text,
|
|
277
|
+
ghost,
|
|
278
|
+
iconSide,
|
|
279
|
+
isRound
|
|
280
|
+
})};
|
|
237
281
|
color: ${getTextColor({ color, theme, primary, blue })};
|
|
238
282
|
transition:
|
|
239
283
|
background-color 0.2s ease-out,
|
|
@@ -246,7 +290,7 @@ var buttonStyle = ({
|
|
|
246
290
|
`;
|
|
247
291
|
var ButtonIcon = styled.div`
|
|
248
292
|
${(props) => props.ghost ? "" : "position: absolute;"}
|
|
249
|
-
${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost })}px;`}
|
|
293
|
+
${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost, isRound: false })}px;`}
|
|
250
294
|
`;
|
|
251
295
|
var StyledButton = styled(UnstyledButton)`
|
|
252
296
|
${(props) => buttonStyle(props)}
|
|
@@ -257,9 +301,9 @@ var ButtonLink = styled(Link)`
|
|
|
257
301
|
var ButtonHrefLink = styled.a`
|
|
258
302
|
${(props) => buttonStyle(props)}
|
|
259
303
|
`;
|
|
260
|
-
var ButtonSelector = (prepend = "", append = "") => `${prepend}${select(StyledButton)}${
|
|
261
|
-
|
|
262
|
-
)}
|
|
304
|
+
var ButtonSelector = (prepend = "", append = "") => `${prepend}*:is(${select(StyledButton)}, ${select(ButtonLink)}, ${select(
|
|
305
|
+
ButtonHrefLink
|
|
306
|
+
)})${append}`;
|
|
263
307
|
|
|
264
308
|
export {
|
|
265
309
|
Button,
|