@lightsparkdev/ui 0.0.6 → 0.0.8
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 +18 -0
- package/dist/{chunk-JYWYEOM6.js → chunk-2JM7UTAZ.js} +18 -5
- package/dist/{chunk-UO6U7AYM.js → chunk-2YB7653N.js} +1 -1
- package/dist/{chunk-RTUZVKPK.js → chunk-36C653MV.js} +1 -1
- package/dist/{chunk-IQFU7CM5.js → chunk-4KWTXZRY.js} +1 -1
- package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
- package/dist/{chunk-3CZOYF3X.js → chunk-6FHLZM6N.js} +2 -2
- package/dist/{chunk-K7D7A34K.js → chunk-744FBGRP.js} +1 -1
- package/dist/{chunk-FKETYVPP.js → chunk-76Q4BK35.js} +87 -43
- package/dist/{chunk-NGS4OSWT.js → chunk-BAO4T4G5.js} +1 -1
- package/dist/{chunk-NH25O7PC.js → chunk-CW3W2VTZ.js} +1 -1
- package/dist/{chunk-G2PZZFJL.js → chunk-DAVVD7YE.js} +10 -10
- package/dist/{chunk-VBWTKANQ.js → chunk-FN5PM3HQ.js} +6 -6
- package/dist/{chunk-RFGKH3R6.js → chunk-HNVQIY5U.js} +0 -8
- package/dist/{chunk-I74XQIVV.js → chunk-MAMSU2XB.js} +3 -3
- package/dist/chunk-NRXJA2PM.js +67 -0
- package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
- package/dist/chunk-SZVMKB4E.js +222 -0
- package/dist/chunk-U6XT5JKC.js +25 -0
- package/dist/{chunk-WWFDI534.js → chunk-UWN53KLJ.js} +13 -6
- package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
- package/dist/{chunk-NZJCJJH5.js → chunk-VHW2KROZ.js} +1 -1
- package/dist/{chunk-N2RDQJQ5.js → chunk-WTO7C7WA.js} +1 -1
- package/dist/{chunk-23SR7TFO.js → chunk-XAZ6NZ6I.js} +1 -1
- package/dist/chunk-YPB5SA65.js +163 -0
- package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
- package/dist/{chunk-T33SBHYI.js → chunk-ZSUX6RLD.js} +3 -1
- package/dist/{chunk-2WYVO6B2.js → chunk-ZYHA6MJC.js} +1 -1
- package/dist/components/Badge.cjs +1332 -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 +197 -83
- 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 +212 -82
- 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/Collapsible.cjs +0 -30
- package/dist/components/Collapsible.js +4 -5
- package/dist/components/ContentTable.cjs +0 -30
- package/dist/components/ContentTable.js +3 -4
- package/dist/components/CopyToClipboardButton.cjs +123 -41
- package/dist/components/CopyToClipboardButton.js +6 -5
- package/dist/components/CurrencyAmount.cjs +0 -30
- package/dist/components/CurrencyAmount.js +3 -4
- package/dist/components/FileInput.cjs +1945 -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/Icon.cjs +0 -30
- package/dist/components/Icon.js +2 -3
- package/dist/components/LightTooltip.cjs +1414 -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 +3 -33
- package/dist/components/LightsparkProvider.js +3 -4
- package/dist/components/Loading.cjs +0 -30
- package/dist/components/Loading.js +3 -4
- package/dist/components/Modal.cjs +208 -114
- package/dist/components/Modal.js +12 -11
- package/dist/components/Pill.cjs +1703 -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 +0 -32
- package/dist/components/ProgressBar.js +2 -3
- package/dist/components/SecretContainer.cjs +124 -42
- package/dist/components/SecretContainer.js +7 -6
- package/dist/components/TextIconAligner.cjs +0 -30
- package/dist/components/TextIconAligner.js +3 -4
- package/dist/components/UnstyledButton.cjs +0 -30
- package/dist/components/UnstyledButton.js +2 -3
- package/dist/components/documentation/AnchorLinkHeader.cjs +0 -32
- package/dist/components/documentation/AnchorLinkHeader.js +3 -4
- package/dist/components/documentation/index.cjs +0 -32
- package/dist/components/documentation/index.js +3 -4
- package/dist/components/index.cjs +608 -327
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +37 -25
- 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/Upload.cjs +22 -11
- package/dist/icons/Upload.js +23 -12
- package/dist/icons/index.cjs +0 -30
- package/dist/icons/index.js +2 -3
- package/dist/router.cjs +7 -3
- package/dist/router.js +1 -1
- package/dist/styles/common.cjs +0 -32
- package/dist/styles/common.d.cts +1 -5
- package/dist/styles/common.d.ts +1 -5
- package/dist/styles/common.js +1 -4
- package/dist/styles/fields.cjs +65 -34
- package/dist/styles/fields.d.cts +8 -2
- package/dist/styles/fields.d.ts +8 -2
- package/dist/styles/fields.js +28 -164
- package/dist/styles/fonts/typography/Article.cjs +0 -30
- package/dist/styles/fonts/typography/Article.js +6 -7
- package/dist/styles/fonts/typography/index.cjs +0 -30
- package/dist/styles/fonts/typography/index.js +11 -12
- package/dist/styles/fonts/typographyTokens.d.cts +4 -1
- package/dist/styles/fonts/typographyTokens.d.ts +4 -1
- package/dist/styles/global.cjs +3 -33
- package/dist/styles/global.js +2 -3
- package/dist/styles/type.cjs +0 -30
- package/dist/styles/type.js +2 -3
- package/dist/styles/utils.cjs +0 -30
- 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 +5 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type BadgeProps = {
|
|
4
|
+
text?: string | undefined;
|
|
5
|
+
ml?: number;
|
|
6
|
+
};
|
|
7
|
+
declare function Badge({ text, ml }: BadgeProps): _emotion_react_jsx_runtime.JSX.Element | null;
|
|
8
|
+
declare const badgeVPadding = 2;
|
|
9
|
+
|
|
10
|
+
export { Badge, badgeVPadding };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type BadgeProps = {
|
|
4
|
+
text?: string | undefined;
|
|
5
|
+
ml?: number;
|
|
6
|
+
};
|
|
7
|
+
declare function Badge({ text, ml }: BadgeProps): _emotion_react_jsx_runtime.JSX.Element | null;
|
|
8
|
+
declare const badgeVPadding = 2;
|
|
9
|
+
|
|
10
|
+
export { Badge, badgeVPadding };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Badge,
|
|
3
|
+
badgeVPadding
|
|
4
|
+
} from "../chunk-U6XT5JKC.js";
|
|
5
|
+
import "../chunk-HNVQIY5U.js";
|
|
6
|
+
import "../chunk-2VBDEO6M.js";
|
|
7
|
+
import "../chunk-E4EXM4SY.js";
|
|
8
|
+
import "../chunk-JSGRNWSB.js";
|
|
9
|
+
import "../chunk-CIGAQ47A.js";
|
|
10
|
+
export {
|
|
11
|
+
Badge,
|
|
12
|
+
badgeVPadding
|
|
13
|
+
};
|
|
@@ -72,8 +72,10 @@ __export(Button_exports, {
|
|
|
72
72
|
StyledButton: () => StyledButton
|
|
73
73
|
});
|
|
74
74
|
module.exports = __toCommonJS(Button_exports);
|
|
75
|
-
var
|
|
75
|
+
var import_react9 = require("@emotion/react");
|
|
76
76
|
var import_styled5 = __toESM(require("@emotion/styled"), 1);
|
|
77
|
+
var import_lodash_es3 = require("lodash-es");
|
|
78
|
+
var import_react10 = require("react");
|
|
77
79
|
|
|
78
80
|
// src/router.tsx
|
|
79
81
|
var import_lodash_es2 = require("lodash-es");
|
|
@@ -1322,32 +1324,36 @@ function Link({
|
|
|
1322
1324
|
externalLink,
|
|
1323
1325
|
params,
|
|
1324
1326
|
children,
|
|
1325
|
-
css:
|
|
1327
|
+
css: css6,
|
|
1326
1328
|
onClick,
|
|
1327
1329
|
className,
|
|
1328
1330
|
hash = null,
|
|
1329
1331
|
blue = false,
|
|
1330
1332
|
newTab = false
|
|
1331
1333
|
}) {
|
|
1332
|
-
if (!isString(to) && !externalLink) {
|
|
1333
|
-
throw new Error(
|
|
1334
|
+
if (!isString(to) && !externalLink && !onClick) {
|
|
1335
|
+
throw new Error(
|
|
1336
|
+
"Link must have either `to` or `externalLink` or `onClick` defined"
|
|
1337
|
+
);
|
|
1334
1338
|
}
|
|
1335
1339
|
let toStr;
|
|
1336
1340
|
if (isString(to)) {
|
|
1337
1341
|
toStr = replaceParams(to, params);
|
|
1338
1342
|
toStr += hash ? `#${hash}` : "";
|
|
1339
|
-
} else {
|
|
1343
|
+
} else if (externalLink) {
|
|
1340
1344
|
const definedExternalLink = externalLink;
|
|
1341
1345
|
if (!definedExternalLink.startsWith("http")) {
|
|
1342
1346
|
throw new Error("Link's externalLink must start with http");
|
|
1343
1347
|
}
|
|
1344
1348
|
toStr = definedExternalLink;
|
|
1349
|
+
} else {
|
|
1350
|
+
toStr = "#";
|
|
1345
1351
|
}
|
|
1346
1352
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1347
1353
|
import_react_router_dom.Link,
|
|
1348
1354
|
{
|
|
1349
1355
|
to: toStr,
|
|
1350
|
-
css:
|
|
1356
|
+
css: css6,
|
|
1351
1357
|
onClick,
|
|
1352
1358
|
className,
|
|
1353
1359
|
style: { color: blue ? colors.blue43 : "inherit" },
|
|
@@ -1361,35 +1367,6 @@ function Link({
|
|
|
1361
1367
|
// src/styles/common.tsx
|
|
1362
1368
|
var import_react5 = require("@emotion/react");
|
|
1363
1369
|
var import_styled = __toESM(require("@emotion/styled"), 1);
|
|
1364
|
-
var import_react_tooltip = require("react-tooltip");
|
|
1365
|
-
|
|
1366
|
-
// src/styles/z-index.tsx
|
|
1367
|
-
var z = {
|
|
1368
|
-
card: 1,
|
|
1369
|
-
fieldError: 1,
|
|
1370
|
-
textInput: 2,
|
|
1371
|
-
select: 3,
|
|
1372
|
-
selectFocused: 4,
|
|
1373
|
-
walletActionPreviewTopGradient: 1,
|
|
1374
|
-
headerContainer: 99,
|
|
1375
|
-
smBanner: 99,
|
|
1376
|
-
headerTop: 100,
|
|
1377
|
-
navMenu: 100,
|
|
1378
|
-
smNavMenu: 100,
|
|
1379
|
-
navAction: 101,
|
|
1380
|
-
smNavAction: 100,
|
|
1381
|
-
// keep under navDropdown
|
|
1382
|
-
tooltip: 160,
|
|
1383
|
-
notificationBanner: 170,
|
|
1384
|
-
qrReaderVideo: 180,
|
|
1385
|
-
qrReaderOverlay: 181,
|
|
1386
|
-
modalOverlay: 190,
|
|
1387
|
-
modalContainer: 191,
|
|
1388
|
-
dropdown: 192,
|
|
1389
|
-
toast: 200
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
|
-
// src/styles/common.tsx
|
|
1393
1370
|
var rootFontSizePx = 12;
|
|
1394
1371
|
var rootFontSizeRems = rootFontSizePx / 16;
|
|
1395
1372
|
var standardContentInsetPx = 32;
|
|
@@ -1450,8 +1427,25 @@ var Subtext = import_styled.default.div`
|
|
|
1450
1427
|
var darkGradientBg = import_react5.css`
|
|
1451
1428
|
background: ${darkGradient};
|
|
1452
1429
|
`;
|
|
1453
|
-
var
|
|
1454
|
-
|
|
1430
|
+
var overlaySurfaceBorderColor = ({
|
|
1431
|
+
theme,
|
|
1432
|
+
important = false
|
|
1433
|
+
}) => import_react5.css`
|
|
1434
|
+
border-color: ${themeOr(theme.c1Neutral, theme.c3Neutral)({ theme })}
|
|
1435
|
+
${important ? "!important" : ""};
|
|
1436
|
+
`;
|
|
1437
|
+
var overlaySurface = ({
|
|
1438
|
+
theme,
|
|
1439
|
+
important = false
|
|
1440
|
+
}) => import_react5.css`
|
|
1441
|
+
background-color: ${themeOr(colors.white, theme.c1Neutral)({ theme })}
|
|
1442
|
+
${important ? "!important" : ""};
|
|
1443
|
+
border: 0.5px solid ${important ? "!important" : ""};
|
|
1444
|
+
${overlaySurfaceBorderColor({ theme, important })};
|
|
1445
|
+
${themeOr(
|
|
1446
|
+
`box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 1px 4px rgba(0, 0, 0, 0.1) ${important ? "!important" : ""};`,
|
|
1447
|
+
""
|
|
1448
|
+
)({ theme })}
|
|
1455
1449
|
`;
|
|
1456
1450
|
|
|
1457
1451
|
// src/utils/emotion.tsx
|
|
@@ -1538,9 +1532,90 @@ var IconContainer = import_styled2.default.span`
|
|
|
1538
1532
|
`}
|
|
1539
1533
|
`;
|
|
1540
1534
|
|
|
1535
|
+
// src/components/LightTooltip.tsx
|
|
1536
|
+
var import_css = require("@emotion/css");
|
|
1537
|
+
var import_react7 = require("@emotion/react");
|
|
1538
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
1539
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
1540
|
+
var import_react_tooltip = require("react-tooltip");
|
|
1541
|
+
|
|
1542
|
+
// src/styles/z-index.tsx
|
|
1543
|
+
var z = {
|
|
1544
|
+
card: 1,
|
|
1545
|
+
fieldError: 1,
|
|
1546
|
+
textInput: 2,
|
|
1547
|
+
select: 3,
|
|
1548
|
+
selectFocused: 4,
|
|
1549
|
+
walletActionPreviewTopGradient: 1,
|
|
1550
|
+
headerContainer: 99,
|
|
1551
|
+
smBanner: 99,
|
|
1552
|
+
headerTop: 100,
|
|
1553
|
+
navMenu: 100,
|
|
1554
|
+
smNavMenu: 100,
|
|
1555
|
+
navAction: 101,
|
|
1556
|
+
smNavAction: 100,
|
|
1557
|
+
// keep under navDropdown
|
|
1558
|
+
notificationBanner: 170,
|
|
1559
|
+
qrReaderVideo: 180,
|
|
1560
|
+
qrReaderOverlay: 181,
|
|
1561
|
+
modalOverlay: 190,
|
|
1562
|
+
modalContainer: 191,
|
|
1563
|
+
dropdown: 192,
|
|
1564
|
+
tooltip: 193,
|
|
1565
|
+
toast: 200
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
// src/components/LightTooltip.tsx
|
|
1569
|
+
var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
|
|
1570
|
+
function LightTooltip(props) {
|
|
1571
|
+
const nodeRef = (0, import_react8.useRef)(null);
|
|
1572
|
+
const [nodeReady, setNodeReady] = import_react8.default.useState(false);
|
|
1573
|
+
(0, import_react8.useEffect)(() => {
|
|
1574
|
+
if (!nodeRef.current) {
|
|
1575
|
+
nodeRef.current = document.createElement("div");
|
|
1576
|
+
document.body.appendChild(nodeRef.current);
|
|
1577
|
+
}
|
|
1578
|
+
setNodeReady(true);
|
|
1579
|
+
return () => {
|
|
1580
|
+
if (nodeRef.current) {
|
|
1581
|
+
document.body.removeChild(nodeRef.current);
|
|
1582
|
+
nodeRef.current = null;
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
}, []);
|
|
1586
|
+
const theme = (0, import_react7.useTheme)();
|
|
1587
|
+
console.log("LightTooltip.tsx: tooltipProps:", props);
|
|
1588
|
+
return nodeReady && nodeRef.current ? import_react_dom.default.createPortal(
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1590
|
+
import_react_tooltip.Tooltip,
|
|
1591
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1592
|
+
id: props.id || "",
|
|
1593
|
+
content: props.content || "",
|
|
1594
|
+
noArrow: true,
|
|
1595
|
+
border: "0.05rem solid rgba(0, 0, 0, 0.1)",
|
|
1596
|
+
className: styles({ theme }),
|
|
1597
|
+
variant: "light",
|
|
1598
|
+
delayShow: 180
|
|
1599
|
+
})
|
|
1600
|
+
),
|
|
1601
|
+
nodeRef.current
|
|
1602
|
+
) : null;
|
|
1603
|
+
}
|
|
1604
|
+
var styles = ({ theme }) => import_css.css`
|
|
1605
|
+
font-size: "10px",
|
|
1606
|
+
color: ${theme.c2Neutral};
|
|
1607
|
+
border-radius: 8px !important;
|
|
1608
|
+
padding: 16px !important;
|
|
1609
|
+
z-index: ${z.tooltip};
|
|
1610
|
+
${overlaySurface({ theme, important: true })};
|
|
1611
|
+
|
|
1612
|
+
max-width: 260px;
|
|
1613
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10), 0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
|
|
1614
|
+
`;
|
|
1615
|
+
|
|
1541
1616
|
// src/components/Loading.tsx
|
|
1542
1617
|
var import_styled3 = __toESM(require("@emotion/styled"), 1);
|
|
1543
|
-
var
|
|
1618
|
+
var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
|
|
1544
1619
|
var defaultProps = {
|
|
1545
1620
|
size: 60,
|
|
1546
1621
|
center: true,
|
|
@@ -1551,7 +1626,7 @@ function Loading({
|
|
|
1551
1626
|
size = defaultProps.size,
|
|
1552
1627
|
ml = defaultProps.ml
|
|
1553
1628
|
}) {
|
|
1554
|
-
return /* @__PURE__ */ (0,
|
|
1629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingWrapper, { center, ml, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Rotate, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "LoadingSpinner", width: size }) }) });
|
|
1555
1630
|
}
|
|
1556
1631
|
Loading.defaultProps = defaultProps;
|
|
1557
1632
|
var LoadingWrapper = import_styled3.default.div`
|
|
@@ -1605,7 +1680,7 @@ var UnstyledButton = import_styled4.default.button`
|
|
|
1605
1680
|
`;
|
|
1606
1681
|
|
|
1607
1682
|
// src/components/Button.tsx
|
|
1608
|
-
var
|
|
1683
|
+
var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
|
|
1609
1684
|
function getTextColor({ color, theme, primary: primary2, blue }) {
|
|
1610
1685
|
if (color) {
|
|
1611
1686
|
return color;
|
|
@@ -1640,12 +1715,37 @@ function getBackgroundColor({
|
|
|
1640
1715
|
}
|
|
1641
1716
|
return themeOr(colors.white, theme.c1Neutral)({ theme });
|
|
1642
1717
|
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1718
|
+
var paddingsY = {
|
|
1719
|
+
lg: 14,
|
|
1720
|
+
md: 9,
|
|
1721
|
+
sm: 6
|
|
1722
|
+
};
|
|
1723
|
+
var roundPaddingsX = {
|
|
1724
|
+
lg: 19,
|
|
1725
|
+
md: 14,
|
|
1726
|
+
sm: 10
|
|
1727
|
+
};
|
|
1728
|
+
var paddingsX = {
|
|
1729
|
+
lg: 24,
|
|
1730
|
+
md: 18,
|
|
1731
|
+
sm: 16
|
|
1732
|
+
};
|
|
1733
|
+
function getPaddingX({
|
|
1734
|
+
size,
|
|
1735
|
+
ghost,
|
|
1736
|
+
isRound
|
|
1737
|
+
}) {
|
|
1738
|
+
return ghost ? 0 : isRound ? roundPaddingsX[size] : paddingsX[size];
|
|
1645
1739
|
}
|
|
1646
|
-
function getPadding({
|
|
1647
|
-
|
|
1648
|
-
|
|
1740
|
+
function getPadding({
|
|
1741
|
+
iconWidth,
|
|
1742
|
+
size,
|
|
1743
|
+
ghost,
|
|
1744
|
+
iconSide,
|
|
1745
|
+
isRound
|
|
1746
|
+
}) {
|
|
1747
|
+
const paddingY = ghost ? 0 : paddingsY[size];
|
|
1748
|
+
const paddingX = getPaddingX({ size, ghost, isRound });
|
|
1649
1749
|
const paddingForIcon = iconWidth && !ghost ? iconWidth : 0;
|
|
1650
1750
|
return `${paddingY}px ${paddingX + (iconSide === "right" ? paddingForIcon : 0)}px ${paddingY}px ${paddingX + (iconSide === "left" ? paddingForIcon : 0)}px`;
|
|
1651
1751
|
}
|
|
@@ -1694,40 +1794,46 @@ function Button({
|
|
|
1694
1794
|
type = "button",
|
|
1695
1795
|
blue = false,
|
|
1696
1796
|
newTab = false,
|
|
1697
|
-
zIndex = void 0
|
|
1797
|
+
zIndex = void 0,
|
|
1798
|
+
tooltipText
|
|
1698
1799
|
}) {
|
|
1800
|
+
const tooltipId = (0, import_react10.useRef)((0, import_lodash_es3.uniqueId)());
|
|
1699
1801
|
const iconMarginRight = 6;
|
|
1700
1802
|
const iconSize = size === "lg" ? 16 : 12;
|
|
1701
1803
|
let currentIcon = null;
|
|
1702
1804
|
if (loading) {
|
|
1703
|
-
currentIcon = /* @__PURE__ */ (0,
|
|
1805
|
+
currentIcon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonIcon, { ghost, iconSide, text, size, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loading, { size: iconSize, center: false }) });
|
|
1704
1806
|
} else if (icon) {
|
|
1705
|
-
currentIcon = /* @__PURE__ */ (0,
|
|
1807
|
+
currentIcon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonIcon, { ghost, iconSide, text, size, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: icon, width: iconSize }) });
|
|
1706
1808
|
}
|
|
1707
|
-
const content = /* @__PURE__ */ (0,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1809
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react10.Fragment, { children: [
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1811
|
+
"div",
|
|
1812
|
+
__spreadProps(__spreadValues({}, tooltipText ? { "data-tooltip-id": tooltipId.current } : {}), {
|
|
1813
|
+
css: {
|
|
1814
|
+
display: "flex",
|
|
1815
|
+
alignItems: "center",
|
|
1816
|
+
justifyContent: "center"
|
|
1817
|
+
},
|
|
1818
|
+
children: [
|
|
1819
|
+
iconSide === "left" && currentIcon,
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1821
|
+
"div",
|
|
1822
|
+
{
|
|
1823
|
+
css: {
|
|
1824
|
+
textOverflow: "ellipsis",
|
|
1825
|
+
overflow: "hidden"
|
|
1826
|
+
},
|
|
1827
|
+
children: text
|
|
1828
|
+
}
|
|
1829
|
+
),
|
|
1830
|
+
iconSide === "right" && currentIcon
|
|
1831
|
+
]
|
|
1832
|
+
})
|
|
1833
|
+
),
|
|
1834
|
+
tooltipText ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LightTooltip, { id: tooltipId.current, content: tooltipText }) : null
|
|
1835
|
+
] });
|
|
1836
|
+
const isSingleCharRoundButton = Boolean(text && text.length === 1 && !icon);
|
|
1731
1837
|
const commonProps = {
|
|
1732
1838
|
backgroundColor,
|
|
1733
1839
|
color,
|
|
@@ -1740,6 +1846,7 @@ function Button({
|
|
|
1740
1846
|
fullWidth,
|
|
1741
1847
|
blue,
|
|
1742
1848
|
iconSide,
|
|
1849
|
+
isRound: isSingleCharRoundButton,
|
|
1743
1850
|
iconWidth: currentIcon ? iconSize + iconMarginRight : 0,
|
|
1744
1851
|
isLoading: loading,
|
|
1745
1852
|
disabled: disabled || loading,
|
|
@@ -1752,11 +1859,10 @@ function Button({
|
|
|
1752
1859
|
zIndex
|
|
1753
1860
|
};
|
|
1754
1861
|
if (to) {
|
|
1755
|
-
return /* @__PURE__ */ (0,
|
|
1862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonLink, __spreadProps(__spreadValues({}, commonProps), { to, params: toParams, hash, children: content }));
|
|
1756
1863
|
}
|
|
1757
|
-
return href ? /* @__PURE__ */ (0,
|
|
1864
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonHrefLink, __spreadProps(__spreadValues({}, commonProps), { href, target: "_blank", children: content })) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StyledButton, __spreadProps(__spreadValues({}, commonProps), { children: content }));
|
|
1758
1865
|
}
|
|
1759
|
-
var hPaddingPx = 24;
|
|
1760
1866
|
var buttonStyle = ({
|
|
1761
1867
|
color,
|
|
1762
1868
|
backgroundColor,
|
|
@@ -1772,8 +1878,9 @@ var buttonStyle = ({
|
|
|
1772
1878
|
blue,
|
|
1773
1879
|
text,
|
|
1774
1880
|
zIndex,
|
|
1775
|
-
iconSide
|
|
1776
|
-
|
|
1881
|
+
iconSide,
|
|
1882
|
+
isRound
|
|
1883
|
+
}) => import_react9.css`
|
|
1777
1884
|
display: inline-flex;
|
|
1778
1885
|
opacity: ${disabled && !isLoading ? 0.2 : 1};
|
|
1779
1886
|
transition: opacity 0.2s;
|
|
@@ -1809,8 +1916,15 @@ var buttonStyle = ({
|
|
|
1809
1916
|
primary: primary2,
|
|
1810
1917
|
blue
|
|
1811
1918
|
})};
|
|
1812
|
-
border-radius: 32px;
|
|
1813
|
-
padding: ${getPadding({
|
|
1919
|
+
border-radius: ${isRound ? "100%" : "32px"};
|
|
1920
|
+
padding: ${getPadding({
|
|
1921
|
+
size,
|
|
1922
|
+
iconWidth,
|
|
1923
|
+
text,
|
|
1924
|
+
ghost,
|
|
1925
|
+
iconSide,
|
|
1926
|
+
isRound
|
|
1927
|
+
})};
|
|
1814
1928
|
color: ${getTextColor({ color, theme, primary: primary2, blue })};
|
|
1815
1929
|
transition:
|
|
1816
1930
|
background-color 0.2s ease-out,
|
|
@@ -1823,7 +1937,7 @@ var buttonStyle = ({
|
|
|
1823
1937
|
`;
|
|
1824
1938
|
var ButtonIcon = import_styled5.default.div`
|
|
1825
1939
|
${(props) => props.ghost ? "" : "position: absolute;"}
|
|
1826
|
-
${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost })}px;`}
|
|
1940
|
+
${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost, isRound: false })}px;`}
|
|
1827
1941
|
`;
|
|
1828
1942
|
var StyledButton = (0, import_styled5.default)(UnstyledButton)`
|
|
1829
1943
|
${(props) => buttonStyle(props)}
|
|
@@ -1834,9 +1948,9 @@ var ButtonLink = (0, import_styled5.default)(Link)`
|
|
|
1834
1948
|
var ButtonHrefLink = import_styled5.default.a`
|
|
1835
1949
|
${(props) => buttonStyle(props)}
|
|
1836
1950
|
`;
|
|
1837
|
-
var ButtonSelector = (prepend = "", append = "") => `${prepend}${select(StyledButton)}${
|
|
1838
|
-
|
|
1839
|
-
)}
|
|
1951
|
+
var ButtonSelector = (prepend = "", append = "") => `${prepend}*:is(${select(StyledButton)}, ${select(ButtonLink)}, ${select(
|
|
1952
|
+
ButtonHrefLink
|
|
1953
|
+
)})${append}`;
|
|
1840
1954
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1841
1955
|
0 && (module.exports = {
|
|
1842
1956
|
Button,
|
|
@@ -31,9 +31,10 @@ type ButtonProps<RoutesType extends string> = {
|
|
|
31
31
|
type?: "button" | "submit";
|
|
32
32
|
blue?: boolean;
|
|
33
33
|
newTab?: boolean;
|
|
34
|
+
tooltipText?: string;
|
|
34
35
|
zIndex?: number;
|
|
35
36
|
};
|
|
36
|
-
declare function Button<RoutesType extends string>({ backgroundColor, color, hoverColor, primary, ghost, text, to, hash, href, toParams, onClick, icon, iconSide, loading, fullWidth, disabled, size, mt, ml, type, blue, newTab, zIndex, }: ButtonProps<RoutesType>): _emotion_react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function Button<RoutesType extends string>({ backgroundColor, color, hoverColor, primary, ghost, text, to, hash, href, toParams, onClick, icon, iconSide, loading, fullWidth, disabled, size, mt, ml, type, blue, newTab, zIndex, tooltipText, }: ButtonProps<RoutesType>): _emotion_react_jsx_runtime.JSX.Element;
|
|
37
38
|
type StyledButtonProps = {
|
|
38
39
|
backgroundColor?: string | undefined;
|
|
39
40
|
color?: string | undefined;
|
|
@@ -50,6 +51,7 @@ type StyledButtonProps = {
|
|
|
50
51
|
text?: string | undefined;
|
|
51
52
|
zIndex?: number | undefined;
|
|
52
53
|
iconSide?: IconSide | undefined;
|
|
54
|
+
isRound: boolean;
|
|
53
55
|
};
|
|
54
56
|
declare const StyledButton: _emotion_styled.StyledComponent<{
|
|
55
57
|
theme?: Theme;
|
|
@@ -31,9 +31,10 @@ type ButtonProps<RoutesType extends string> = {
|
|
|
31
31
|
type?: "button" | "submit";
|
|
32
32
|
blue?: boolean;
|
|
33
33
|
newTab?: boolean;
|
|
34
|
+
tooltipText?: string;
|
|
34
35
|
zIndex?: number;
|
|
35
36
|
};
|
|
36
|
-
declare function Button<RoutesType extends string>({ backgroundColor, color, hoverColor, primary, ghost, text, to, hash, href, toParams, onClick, icon, iconSide, loading, fullWidth, disabled, size, mt, ml, type, blue, newTab, zIndex, }: ButtonProps<RoutesType>): _emotion_react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function Button<RoutesType extends string>({ backgroundColor, color, hoverColor, primary, ghost, text, to, hash, href, toParams, onClick, icon, iconSide, loading, fullWidth, disabled, size, mt, ml, type, blue, newTab, zIndex, tooltipText, }: ButtonProps<RoutesType>): _emotion_react_jsx_runtime.JSX.Element;
|
|
37
38
|
type StyledButtonProps = {
|
|
38
39
|
backgroundColor?: string | undefined;
|
|
39
40
|
color?: string | undefined;
|
|
@@ -50,6 +51,7 @@ type StyledButtonProps = {
|
|
|
50
51
|
text?: string | undefined;
|
|
51
52
|
zIndex?: number | undefined;
|
|
52
53
|
iconSide?: IconSide | undefined;
|
|
54
|
+
isRound: boolean;
|
|
53
55
|
};
|
|
54
56
|
declare const StyledButton: _emotion_styled.StyledComponent<{
|
|
55
57
|
theme?: Theme;
|
|
@@ -2,18 +2,19 @@ import {
|
|
|
2
2
|
Button,
|
|
3
3
|
ButtonSelector,
|
|
4
4
|
StyledButton
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-76Q4BK35.js";
|
|
6
|
+
import "../chunk-OGSDZTHM.js";
|
|
7
7
|
import "../chunk-YMNSXZ5D.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-BAO4T4G5.js";
|
|
9
|
+
import "../chunk-4KWTXZRY.js";
|
|
10
|
+
import "../chunk-NRXJA2PM.js";
|
|
11
|
+
import "../chunk-55OQPFLF.js";
|
|
12
|
+
import "../chunk-VHW2KROZ.js";
|
|
11
13
|
import "../chunk-LAMQKQU3.js";
|
|
12
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-HNVQIY5U.js";
|
|
13
15
|
import "../chunk-2VBDEO6M.js";
|
|
14
16
|
import "../chunk-E4EXM4SY.js";
|
|
15
17
|
import "../chunk-JSGRNWSB.js";
|
|
16
|
-
import "../chunk-CLU2FRJZ.js";
|
|
17
18
|
import "../chunk-CIGAQ47A.js";
|
|
18
19
|
export {
|
|
19
20
|
Button,
|