@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.
Files changed (142) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/chunk-3EVAP5JT.js +67 -0
  3. package/dist/{chunk-IQFU7CM5.js → chunk-3GS5EFXV.js} +1 -1
  4. package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
  5. package/dist/{chunk-N2RDQJQ5.js → chunk-5POPBNPS.js} +1 -1
  6. package/dist/{chunk-WWFDI534.js → chunk-7C4MHI6Q.js} +13 -6
  7. package/dist/{chunk-3CZOYF3X.js → chunk-7T36JGTC.js} +2 -2
  8. package/dist/chunk-A4FQBEYU.js +163 -0
  9. package/dist/chunk-ATUH6SXK.js +233 -0
  10. package/dist/chunk-DQRN4E5G.js +25 -0
  11. package/dist/{chunk-RTUZVKPK.js → chunk-E3AOYBY5.js} +1 -1
  12. package/dist/{chunk-I74XQIVV.js → chunk-EEFNW7NS.js} +3 -3
  13. package/dist/{chunk-UO6U7AYM.js → chunk-FCZJILMW.js} +1 -1
  14. package/dist/{chunk-2WYVO6B2.js → chunk-H3RW6JSU.js} +1 -1
  15. package/dist/chunk-IPAXAP6K.js +119 -0
  16. package/dist/{chunk-NGS4OSWT.js → chunk-J4FJQ3FN.js} +1 -1
  17. package/dist/{chunk-RFGKH3R6.js → chunk-JK4BP73A.js} +39 -38
  18. package/dist/{chunk-T33SBHYI.js → chunk-KMR5C25B.js} +3 -1
  19. package/dist/{chunk-JYWYEOM6.js → chunk-NFSAJ5GJ.js} +23 -10
  20. package/dist/{chunk-G2PZZFJL.js → chunk-NM7UW54G.js} +21 -24
  21. package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
  22. package/dist/chunk-P3EUPXFA.js +150 -0
  23. package/dist/chunk-PBRN7MJY.js +315 -0
  24. package/dist/{chunk-NH25O7PC.js → chunk-PVQCLQNA.js} +1 -1
  25. package/dist/{chunk-NZJCJJH5.js → chunk-RWIZ7Q74.js} +1 -1
  26. package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
  27. package/dist/{chunk-K7D7A34K.js → chunk-XP2MX2AA.js} +1 -1
  28. package/dist/{chunk-23SR7TFO.js → chunk-XZR237JJ.js} +1 -1
  29. package/dist/{chunk-VBWTKANQ.js → chunk-Y37DCY7Y.js} +3 -3
  30. package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
  31. package/dist/{chunk-FKETYVPP.js → chunk-ZANLDY2W.js} +87 -43
  32. package/dist/components/Badge.cjs +1346 -0
  33. package/dist/components/Badge.d.cts +10 -0
  34. package/dist/components/Badge.d.ts +10 -0
  35. package/dist/components/Badge.js +13 -0
  36. package/dist/components/Button.cjs +235 -107
  37. package/dist/components/Button.d.cts +3 -1
  38. package/dist/components/Button.d.ts +3 -1
  39. package/dist/components/Button.js +8 -7
  40. package/dist/components/ButtonRow.cjs +254 -110
  41. package/dist/components/ButtonRow.d.cts +6 -2
  42. package/dist/components/ButtonRow.d.ts +6 -2
  43. package/dist/components/ButtonRow.js +14 -11
  44. package/dist/components/CardPage.cjs +1921 -0
  45. package/dist/components/CardPage.d.cts +54 -0
  46. package/dist/components/CardPage.d.ts +54 -0
  47. package/dist/components/CardPage.js +33 -0
  48. package/dist/components/Collapsible.cjs +38 -54
  49. package/dist/components/Collapsible.js +4 -5
  50. package/dist/components/ContentTable.cjs +38 -54
  51. package/dist/components/ContentTable.js +3 -4
  52. package/dist/components/CopyToClipboardButton.cjs +161 -65
  53. package/dist/components/CopyToClipboardButton.js +6 -5
  54. package/dist/components/CurrencyAmount.cjs +38 -54
  55. package/dist/components/CurrencyAmount.js +3 -4
  56. package/dist/components/FileInput.cjs +1959 -0
  57. package/dist/components/FileInput.d.cts +21 -0
  58. package/dist/components/FileInput.d.ts +21 -0
  59. package/dist/components/FileInput.js +113 -0
  60. package/dist/components/GradientCardHeader.cjs +177 -0
  61. package/dist/components/GradientCardHeader.d.cts +10 -0
  62. package/dist/components/GradientCardHeader.d.ts +10 -0
  63. package/dist/components/GradientCardHeader.js +8 -0
  64. package/dist/components/Icon.cjs +38 -54
  65. package/dist/components/Icon.js +2 -3
  66. package/dist/components/LightTooltip.cjs +1428 -0
  67. package/dist/components/LightTooltip.d.cts +9 -0
  68. package/dist/components/LightTooltip.d.ts +9 -0
  69. package/dist/components/LightTooltip.js +12 -0
  70. package/dist/components/LightboxImage.cjs +1 -1
  71. package/dist/components/LightboxImage.js +2 -2
  72. package/dist/components/LightsparkProvider.cjs +41 -57
  73. package/dist/components/LightsparkProvider.js +3 -4
  74. package/dist/components/Loading.cjs +38 -54
  75. package/dist/components/Loading.js +3 -4
  76. package/dist/components/Modal.cjs +251 -145
  77. package/dist/components/Modal.js +12 -11
  78. package/dist/components/Pill.cjs +1717 -0
  79. package/dist/components/Pill.d.cts +19 -0
  80. package/dist/components/Pill.d.ts +19 -0
  81. package/dist/components/Pill.js +16 -0
  82. package/dist/components/ProgressBar.cjs +38 -56
  83. package/dist/components/ProgressBar.js +2 -3
  84. package/dist/components/SecretContainer.cjs +162 -66
  85. package/dist/components/SecretContainer.js +7 -6
  86. package/dist/components/TextIconAligner.cjs +38 -54
  87. package/dist/components/TextIconAligner.js +3 -4
  88. package/dist/components/UnstyledButton.cjs +38 -54
  89. package/dist/components/UnstyledButton.js +2 -3
  90. package/dist/components/documentation/AnchorLinkHeader.cjs +38 -56
  91. package/dist/components/documentation/AnchorLinkHeader.js +3 -4
  92. package/dist/components/documentation/index.cjs +38 -56
  93. package/dist/components/documentation/index.js +3 -4
  94. package/dist/components/index.cjs +1191 -358
  95. package/dist/components/index.d.cts +7 -1
  96. package/dist/components/index.d.ts +7 -1
  97. package/dist/components/index.js +63 -32
  98. package/dist/icons/ArrowCornerDownRight.cjs +49 -0
  99. package/dist/icons/ArrowCornerDownRight.d.cts +5 -0
  100. package/dist/icons/ArrowCornerDownRight.d.ts +5 -0
  101. package/dist/icons/ArrowCornerDownRight.js +30 -0
  102. package/dist/icons/Copy.cjs +4 -3
  103. package/dist/icons/Copy.js +4 -3
  104. package/dist/icons/Download.cjs +22 -11
  105. package/dist/icons/Download.js +23 -12
  106. package/dist/icons/Sort.cjs +48 -0
  107. package/dist/icons/Sort.d.cts +5 -0
  108. package/dist/icons/Sort.d.ts +5 -0
  109. package/dist/icons/Sort.js +29 -0
  110. package/dist/icons/Upload.cjs +22 -11
  111. package/dist/icons/Upload.js +23 -12
  112. package/dist/icons/index.cjs +38 -54
  113. package/dist/icons/index.js +2 -3
  114. package/dist/router.cjs +7 -3
  115. package/dist/router.js +1 -1
  116. package/dist/styles/common.cjs +38 -66
  117. package/dist/styles/common.d.cts +10 -11
  118. package/dist/styles/common.d.ts +10 -11
  119. package/dist/styles/common.js +1 -14
  120. package/dist/styles/fields.cjs +117 -61
  121. package/dist/styles/fields.d.cts +12 -5
  122. package/dist/styles/fields.d.ts +12 -5
  123. package/dist/styles/fields.js +28 -164
  124. package/dist/styles/fonts/typography/Article.cjs +38 -54
  125. package/dist/styles/fonts/typography/Article.js +5 -6
  126. package/dist/styles/fonts/typography/index.cjs +38 -54
  127. package/dist/styles/fonts/typography/index.js +5 -6
  128. package/dist/styles/global.cjs +41 -57
  129. package/dist/styles/global.js +2 -3
  130. package/dist/styles/type.cjs +38 -54
  131. package/dist/styles/type.js +8 -145
  132. package/dist/styles/utils.cjs +38 -54
  133. package/dist/styles/utils.js +2 -3
  134. package/dist/styles/z-index.cjs +1 -1
  135. package/dist/styles/z-index.d.cts +1 -1
  136. package/dist/styles/z-index.d.ts +1 -1
  137. package/dist/styles/z-index.js +1 -1
  138. package/dist/types/index.d.cts +2 -0
  139. package/dist/types/index.d.ts +2 -0
  140. package/dist/utils/toReactNodes.cjs +7 -3
  141. package/dist/utils/toReactNodes.js +2 -2
  142. package/package.json +10 -6
@@ -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-DQRN4E5G.js";
5
+ import "../chunk-JK4BP73A.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 import_react7 = require("@emotion/react");
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: css5,
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("Link must have either `to` or `externalLink` defined");
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: css5,
1356
+ css: css6,
1351
1357
  onClick,
1352
1358
  className,
1353
1359
  style: { color: blue ? colors.blue43 : "inherit" },
@@ -1361,61 +1367,46 @@ 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
- var standardContentInsetPx = 32;
1396
- var standardContentInsetMdPx = 24;
1397
- var standardContentInsetSmPx = 16;
1398
- var smContentInset = import_react5.css`
1399
- ${bp.sm(`
1400
- margin-left: auto;
1401
- margin-right: auto;
1402
- width: calc(100% - ${standardContentInsetSmPx * 2}px);
1403
- `)}
1404
- `;
1405
- var minSmMaxLgContentInset = import_react5.css`
1406
- ${bp.minSmMaxLg(`
1407
- width: calc(100% - ${standardContentInsetMdPx * 2}px);
1408
- `)}
1409
- `;
1410
- var standardContentInset = import_react5.css`
1411
- margin-left: auto;
1412
- margin-right: auto;
1413
- width: calc(100% - ${standardContentInsetPx * 2}px);
1414
- max-width: 1280px;
1415
-
1416
- ${smContentInset}
1417
- ${minSmMaxLgContentInset}
1418
- `;
1372
+ function buildStandardContentInset(smPx, minSmMaxLgPx, lgPx) {
1373
+ const smCSS = import_react5.css`
1374
+ ${bp.sm(`
1375
+ margin-left: auto;
1376
+ margin-right: auto;
1377
+ width: calc(100% - ${smPx * 2}px);
1378
+ `)}
1379
+ `;
1380
+ const minSmMaxLgCSS = import_react5.css`
1381
+ ${bp.minSmMaxLg(`
1382
+ margin-left: auto;
1383
+ margin-right: auto;
1384
+ width: calc(100% - ${minSmMaxLgPx * 2}px);
1385
+ `)}
1386
+ `;
1387
+ const lgCSS = import_react5.css`
1388
+ ${bp.lg(`
1389
+ margin-left: auto;
1390
+ margin-right: auto;
1391
+ width: calc(100% - ${lgPx * 2}px);
1392
+ max-width: 1280px;
1393
+ `)}
1394
+ `;
1395
+ return {
1396
+ smPx,
1397
+ minSmMaxLgPx,
1398
+ lgPx,
1399
+ smCSS,
1400
+ minSmMaxLgCSS,
1401
+ lgCSS,
1402
+ css: import_react5.css`
1403
+ ${lgCSS}
1404
+ ${smCSS}
1405
+ ${minSmMaxLgCSS}
1406
+ `
1407
+ };
1408
+ }
1409
+ var standardContentInset = buildStandardContentInset(16, 24, 32);
1419
1410
  var standardCardShadow = import_react5.css`
1420
1411
  box-shadow:
1421
1412
  0px 4px 10px 0px rgba(0, 0, 0, 0.08),
@@ -1450,8 +1441,25 @@ var Subtext = import_styled.default.div`
1450
1441
  var darkGradientBg = import_react5.css`
1451
1442
  background: ${darkGradient};
1452
1443
  `;
1453
- var StyledTooltip = (0, import_styled.default)(import_react_tooltip.Tooltip)`
1454
- z-index: ${z.modalOverlay};
1444
+ var overlaySurfaceBorderColor = ({
1445
+ theme,
1446
+ important = false
1447
+ }) => import_react5.css`
1448
+ border-color: ${themeOr(theme.c1Neutral, theme.c3Neutral)({ theme })}
1449
+ ${important ? "!important" : ""};
1450
+ `;
1451
+ var overlaySurface = ({
1452
+ theme,
1453
+ important = false
1454
+ }) => import_react5.css`
1455
+ background-color: ${themeOr(colors.white, theme.c1Neutral)({ theme })}
1456
+ ${important ? "!important" : ""};
1457
+ border: 0.5px solid ${important ? "!important" : ""};
1458
+ ${overlaySurfaceBorderColor({ theme, important })};
1459
+ ${themeOr(
1460
+ `box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 1px 4px rgba(0, 0, 0, 0.1) ${important ? "!important" : ""};`,
1461
+ ""
1462
+ )({ theme })}
1455
1463
  `;
1456
1464
 
1457
1465
  // src/utils/emotion.tsx
@@ -1538,9 +1546,90 @@ var IconContainer = import_styled2.default.span`
1538
1546
  `}
1539
1547
  `;
1540
1548
 
1549
+ // src/components/LightTooltip.tsx
1550
+ var import_css = require("@emotion/css");
1551
+ var import_react7 = require("@emotion/react");
1552
+ var import_react8 = __toESM(require("react"), 1);
1553
+ var import_react_dom = __toESM(require("react-dom"), 1);
1554
+ var import_react_tooltip = require("react-tooltip");
1555
+
1556
+ // src/styles/z-index.tsx
1557
+ var z = {
1558
+ card: 1,
1559
+ fieldError: 1,
1560
+ textInput: 2,
1561
+ select: 3,
1562
+ selectFocused: 4,
1563
+ walletActionPreviewTopGradient: 1,
1564
+ headerContainer: 99,
1565
+ smBanner: 99,
1566
+ headerTop: 100,
1567
+ navMenu: 100,
1568
+ smNavMenu: 100,
1569
+ navAction: 101,
1570
+ smNavAction: 100,
1571
+ // keep under navDropdown
1572
+ notificationBanner: 170,
1573
+ qrReaderVideo: 180,
1574
+ qrReaderOverlay: 181,
1575
+ modalOverlay: 190,
1576
+ modalContainer: 191,
1577
+ dropdown: 192,
1578
+ tooltip: 193,
1579
+ toast: 200
1580
+ };
1581
+
1582
+ // src/components/LightTooltip.tsx
1583
+ var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
1584
+ function LightTooltip(props) {
1585
+ const nodeRef = (0, import_react8.useRef)(null);
1586
+ const [nodeReady, setNodeReady] = import_react8.default.useState(false);
1587
+ (0, import_react8.useEffect)(() => {
1588
+ if (!nodeRef.current) {
1589
+ nodeRef.current = document.createElement("div");
1590
+ document.body.appendChild(nodeRef.current);
1591
+ }
1592
+ setNodeReady(true);
1593
+ return () => {
1594
+ if (nodeRef.current) {
1595
+ document.body.removeChild(nodeRef.current);
1596
+ nodeRef.current = null;
1597
+ }
1598
+ };
1599
+ }, []);
1600
+ const theme = (0, import_react7.useTheme)();
1601
+ console.log("LightTooltip.tsx: tooltipProps:", props);
1602
+ return nodeReady && nodeRef.current ? import_react_dom.default.createPortal(
1603
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1604
+ import_react_tooltip.Tooltip,
1605
+ __spreadProps(__spreadValues({}, props), {
1606
+ id: props.id || "",
1607
+ content: props.content || "",
1608
+ noArrow: true,
1609
+ border: "0.05rem solid rgba(0, 0, 0, 0.1)",
1610
+ className: styles({ theme }),
1611
+ variant: "light",
1612
+ delayShow: 180
1613
+ })
1614
+ ),
1615
+ nodeRef.current
1616
+ ) : null;
1617
+ }
1618
+ var styles = ({ theme }) => import_css.css`
1619
+ font-size: "10px",
1620
+ color: ${theme.c2Neutral};
1621
+ border-radius: 8px !important;
1622
+ padding: 16px !important;
1623
+ z-index: ${z.tooltip};
1624
+ ${overlaySurface({ theme, important: true })};
1625
+
1626
+ max-width: 260px;
1627
+ box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10), 0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
1628
+ `;
1629
+
1541
1630
  // src/components/Loading.tsx
1542
1631
  var import_styled3 = __toESM(require("@emotion/styled"), 1);
1543
- var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
1632
+ var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
1544
1633
  var defaultProps = {
1545
1634
  size: 60,
1546
1635
  center: true,
@@ -1551,7 +1640,7 @@ function Loading({
1551
1640
  size = defaultProps.size,
1552
1641
  ml = defaultProps.ml
1553
1642
  }) {
1554
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LoadingWrapper, { center, ml, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Rotate, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "LoadingSpinner", width: size }) }) });
1643
+ 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
1644
  }
1556
1645
  Loading.defaultProps = defaultProps;
1557
1646
  var LoadingWrapper = import_styled3.default.div`
@@ -1605,7 +1694,7 @@ var UnstyledButton = import_styled4.default.button`
1605
1694
  `;
1606
1695
 
1607
1696
  // src/components/Button.tsx
1608
- var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
1697
+ var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
1609
1698
  function getTextColor({ color, theme, primary: primary2, blue }) {
1610
1699
  if (color) {
1611
1700
  return color;
@@ -1640,12 +1729,37 @@ function getBackgroundColor({
1640
1729
  }
1641
1730
  return themeOr(colors.white, theme.c1Neutral)({ theme });
1642
1731
  }
1643
- function getPaddingX({ size, ghost }) {
1644
- return ghost ? 0 : size === "lg" ? hPaddingPx : size === "md" ? 18 : 16;
1732
+ var paddingsY = {
1733
+ lg: 14,
1734
+ md: 9,
1735
+ sm: 6
1736
+ };
1737
+ var roundPaddingsX = {
1738
+ lg: 19,
1739
+ md: 14,
1740
+ sm: 10
1741
+ };
1742
+ var paddingsX = {
1743
+ lg: 24,
1744
+ md: 18,
1745
+ sm: 16
1746
+ };
1747
+ function getPaddingX({
1748
+ size,
1749
+ ghost,
1750
+ isRound
1751
+ }) {
1752
+ return ghost ? 0 : isRound ? roundPaddingsX[size] : paddingsX[size];
1645
1753
  }
1646
- function getPadding({ iconWidth, size, ghost, iconSide }) {
1647
- const paddingY = ghost ? 0 : size === "lg" ? 14 : size === "md" ? 9 : 6;
1648
- const paddingX = getPaddingX({ size, ghost });
1754
+ function getPadding({
1755
+ iconWidth,
1756
+ size,
1757
+ ghost,
1758
+ iconSide,
1759
+ isRound
1760
+ }) {
1761
+ const paddingY = ghost ? 0 : paddingsY[size];
1762
+ const paddingX = getPaddingX({ size, ghost, isRound });
1649
1763
  const paddingForIcon = iconWidth && !ghost ? iconWidth : 0;
1650
1764
  return `${paddingY}px ${paddingX + (iconSide === "right" ? paddingForIcon : 0)}px ${paddingY}px ${paddingX + (iconSide === "left" ? paddingForIcon : 0)}px`;
1651
1765
  }
@@ -1694,40 +1808,46 @@ function Button({
1694
1808
  type = "button",
1695
1809
  blue = false,
1696
1810
  newTab = false,
1697
- zIndex = void 0
1811
+ zIndex = void 0,
1812
+ tooltipText
1698
1813
  }) {
1814
+ const tooltipId = (0, import_react10.useRef)((0, import_lodash_es3.uniqueId)());
1699
1815
  const iconMarginRight = 6;
1700
1816
  const iconSize = size === "lg" ? 16 : 12;
1701
1817
  let currentIcon = null;
1702
1818
  if (loading) {
1703
- currentIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonIcon, { ghost, iconSide, text, size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Loading, { size: iconSize, center: false }) });
1819
+ 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
1820
  } else if (icon) {
1705
- currentIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonIcon, { ghost, iconSide, text, size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: icon, width: iconSize }) });
1821
+ 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
1822
  }
1707
- const content = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1708
- "div",
1709
- {
1710
- css: {
1711
- display: "flex",
1712
- alignItems: "center",
1713
- justifyContent: "center"
1714
- },
1715
- children: [
1716
- iconSide === "left" && currentIcon,
1717
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1718
- "div",
1719
- {
1720
- css: {
1721
- textOverflow: "ellipsis",
1722
- overflow: "hidden"
1723
- },
1724
- children: text
1725
- }
1726
- ),
1727
- iconSide === "right" && currentIcon
1728
- ]
1729
- }
1730
- );
1823
+ const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react10.Fragment, { children: [
1824
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1825
+ "div",
1826
+ __spreadProps(__spreadValues({}, tooltipText ? { "data-tooltip-id": tooltipId.current } : {}), {
1827
+ css: {
1828
+ display: "flex",
1829
+ alignItems: "center",
1830
+ justifyContent: "center"
1831
+ },
1832
+ children: [
1833
+ iconSide === "left" && currentIcon,
1834
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1835
+ "div",
1836
+ {
1837
+ css: {
1838
+ textOverflow: "ellipsis",
1839
+ overflow: "hidden"
1840
+ },
1841
+ children: text
1842
+ }
1843
+ ),
1844
+ iconSide === "right" && currentIcon
1845
+ ]
1846
+ })
1847
+ ),
1848
+ tooltipText ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LightTooltip, { id: tooltipId.current, content: tooltipText }) : null
1849
+ ] });
1850
+ const isSingleCharRoundButton = Boolean(text && text.length === 1 && !icon);
1731
1851
  const commonProps = {
1732
1852
  backgroundColor,
1733
1853
  color,
@@ -1740,6 +1860,7 @@ function Button({
1740
1860
  fullWidth,
1741
1861
  blue,
1742
1862
  iconSide,
1863
+ isRound: isSingleCharRoundButton,
1743
1864
  iconWidth: currentIcon ? iconSize + iconMarginRight : 0,
1744
1865
  isLoading: loading,
1745
1866
  disabled: disabled || loading,
@@ -1752,11 +1873,10 @@ function Button({
1752
1873
  zIndex
1753
1874
  };
1754
1875
  if (to) {
1755
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonLink, __spreadProps(__spreadValues({}, commonProps), { to, params: toParams, hash, children: content }));
1876
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonLink, __spreadProps(__spreadValues({}, commonProps), { to, params: toParams, hash, children: content }));
1756
1877
  }
1757
- return href ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonHrefLink, __spreadProps(__spreadValues({}, commonProps), { href, target: "_blank", children: content })) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledButton, __spreadProps(__spreadValues({}, commonProps), { children: content }));
1878
+ 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
1879
  }
1759
- var hPaddingPx = 24;
1760
1880
  var buttonStyle = ({
1761
1881
  color,
1762
1882
  backgroundColor,
@@ -1772,8 +1892,9 @@ var buttonStyle = ({
1772
1892
  blue,
1773
1893
  text,
1774
1894
  zIndex,
1775
- iconSide
1776
- }) => import_react7.css`
1895
+ iconSide,
1896
+ isRound
1897
+ }) => import_react9.css`
1777
1898
  display: inline-flex;
1778
1899
  opacity: ${disabled && !isLoading ? 0.2 : 1};
1779
1900
  transition: opacity 0.2s;
@@ -1809,8 +1930,15 @@ var buttonStyle = ({
1809
1930
  primary: primary2,
1810
1931
  blue
1811
1932
  })};
1812
- border-radius: 32px;
1813
- padding: ${getPadding({ size, iconWidth, text, ghost, iconSide })};
1933
+ border-radius: ${isRound ? "100%" : "32px"};
1934
+ padding: ${getPadding({
1935
+ size,
1936
+ iconWidth,
1937
+ text,
1938
+ ghost,
1939
+ iconSide,
1940
+ isRound
1941
+ })};
1814
1942
  color: ${getTextColor({ color, theme, primary: primary2, blue })};
1815
1943
  transition:
1816
1944
  background-color 0.2s ease-out,
@@ -1823,7 +1951,7 @@ var buttonStyle = ({
1823
1951
  `;
1824
1952
  var ButtonIcon = import_styled5.default.div`
1825
1953
  ${(props) => props.ghost ? "" : "position: absolute;"}
1826
- ${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost })}px;`}
1954
+ ${({ iconSide, ghost, text, size }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size, ghost, isRound: false })}px;`}
1827
1955
  `;
1828
1956
  var StyledButton = (0, import_styled5.default)(UnstyledButton)`
1829
1957
  ${(props) => buttonStyle(props)}
@@ -1834,9 +1962,9 @@ var ButtonLink = (0, import_styled5.default)(Link)`
1834
1962
  var ButtonHrefLink = import_styled5.default.a`
1835
1963
  ${(props) => buttonStyle(props)}
1836
1964
  `;
1837
- var ButtonSelector = (prepend = "", append = "") => `${prepend}${select(StyledButton)}${append}, ${prepend}${select(
1838
- ButtonLink
1839
- )}${append}, ${prepend}${select(ButtonHrefLink)}${append}`;
1965
+ var ButtonSelector = (prepend = "", append = "") => `${prepend}*:is(${select(StyledButton)}, ${select(ButtonLink)}, ${select(
1966
+ ButtonHrefLink
1967
+ )})${append}`;
1840
1968
  // Annotate the CommonJS export names for ESM import in node:
1841
1969
  0 && (module.exports = {
1842
1970
  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-FKETYVPP.js";
6
- import "../chunk-M56R3RJ7.js";
5
+ } from "../chunk-ZANLDY2W.js";
6
+ import "../chunk-OGSDZTHM.js";
7
7
  import "../chunk-YMNSXZ5D.js";
8
- import "../chunk-NGS4OSWT.js";
9
- import "../chunk-IQFU7CM5.js";
10
- import "../chunk-NZJCJJH5.js";
8
+ import "../chunk-J4FJQ3FN.js";
9
+ import "../chunk-3GS5EFXV.js";
10
+ import "../chunk-3EVAP5JT.js";
11
+ import "../chunk-55OQPFLF.js";
12
+ import "../chunk-RWIZ7Q74.js";
11
13
  import "../chunk-LAMQKQU3.js";
12
- import "../chunk-RFGKH3R6.js";
14
+ import "../chunk-JK4BP73A.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,