@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
@@ -68,7 +68,8 @@ var __async = (__this, __arguments, generator) => {
68
68
  var ButtonRow_exports = {};
69
69
  __export(ButtonRow_exports, {
70
70
  ButtonRow: () => ButtonRow,
71
- ButtonRowContainer: () => ButtonRowContainer
71
+ ButtonRowContainer: () => ButtonRowContainer,
72
+ StyledButtonRow: () => StyledButtonRow
72
73
  });
73
74
  module.exports = __toCommonJS(ButtonRow_exports);
74
75
  var import_styled6 = __toESM(require("@emotion/styled"), 1);
@@ -172,7 +173,6 @@ function inRange(currentBp, assertBp) {
172
173
  // src/styles/common.tsx
173
174
  var import_react4 = require("@emotion/react");
174
175
  var import_styled = __toESM(require("@emotion/styled"), 1);
175
- var import_react_tooltip = require("react-tooltip");
176
176
 
177
177
  // src/styles/colors.tsx
178
178
  var import_react3 = require("@emotion/react");
@@ -1286,59 +1286,47 @@ function hexToRGB(hex) {
1286
1286
  ] : [0, 0, 0];
1287
1287
  }
1288
1288
 
1289
- // src/styles/z-index.tsx
1290
- var z = {
1291
- card: 1,
1292
- fieldError: 1,
1293
- textInput: 2,
1294
- select: 3,
1295
- selectFocused: 4,
1296
- walletActionPreviewTopGradient: 1,
1297
- headerContainer: 99,
1298
- smBanner: 99,
1299
- headerTop: 100,
1300
- navMenu: 100,
1301
- smNavMenu: 100,
1302
- navAction: 101,
1303
- smNavAction: 100,
1304
- // keep under navDropdown
1305
- tooltip: 160,
1306
- notificationBanner: 170,
1307
- qrReaderVideo: 180,
1308
- qrReaderOverlay: 181,
1309
- modalOverlay: 190,
1310
- modalContainer: 191,
1311
- dropdown: 192,
1312
- toast: 200
1313
- };
1314
-
1315
1289
  // src/styles/common.tsx
1316
1290
  var rootFontSizePx = 12;
1317
1291
  var rootFontSizeRems = rootFontSizePx / 16;
1318
- var standardContentInsetPx = 32;
1319
- var standardContentInsetMdPx = 24;
1320
- var standardContentInsetSmPx = 16;
1321
- var smContentInset = import_react4.css`
1322
- ${bp.sm(`
1323
- margin-left: auto;
1324
- margin-right: auto;
1325
- width: calc(100% - ${standardContentInsetSmPx * 2}px);
1326
- `)}
1327
- `;
1328
- var minSmMaxLgContentInset = import_react4.css`
1329
- ${bp.minSmMaxLg(`
1330
- width: calc(100% - ${standardContentInsetMdPx * 2}px);
1331
- `)}
1332
- `;
1333
- var standardContentInset = import_react4.css`
1334
- margin-left: auto;
1335
- margin-right: auto;
1336
- width: calc(100% - ${standardContentInsetPx * 2}px);
1337
- max-width: 1280px;
1338
-
1339
- ${smContentInset}
1340
- ${minSmMaxLgContentInset}
1341
- `;
1292
+ function buildStandardContentInset(smPx, minSmMaxLgPx, lgPx) {
1293
+ const smCSS = import_react4.css`
1294
+ ${bp.sm(`
1295
+ margin-left: auto;
1296
+ margin-right: auto;
1297
+ width: calc(100% - ${smPx * 2}px);
1298
+ `)}
1299
+ `;
1300
+ const minSmMaxLgCSS = import_react4.css`
1301
+ ${bp.minSmMaxLg(`
1302
+ margin-left: auto;
1303
+ margin-right: auto;
1304
+ width: calc(100% - ${minSmMaxLgPx * 2}px);
1305
+ `)}
1306
+ `;
1307
+ const lgCSS = import_react4.css`
1308
+ ${bp.lg(`
1309
+ margin-left: auto;
1310
+ margin-right: auto;
1311
+ width: calc(100% - ${lgPx * 2}px);
1312
+ max-width: 1280px;
1313
+ `)}
1314
+ `;
1315
+ return {
1316
+ smPx,
1317
+ minSmMaxLgPx,
1318
+ lgPx,
1319
+ smCSS,
1320
+ minSmMaxLgCSS,
1321
+ lgCSS,
1322
+ css: import_react4.css`
1323
+ ${lgCSS}
1324
+ ${smCSS}
1325
+ ${minSmMaxLgCSS}
1326
+ `
1327
+ };
1328
+ }
1329
+ var standardContentInset = buildStandardContentInset(16, 24, 32);
1342
1330
  var standardCardShadow = import_react4.css`
1343
1331
  box-shadow:
1344
1332
  0px 4px 10px 0px rgba(0, 0, 0, 0.08),
@@ -1373,8 +1361,25 @@ var Subtext = import_styled.default.div`
1373
1361
  var darkGradientBg = import_react4.css`
1374
1362
  background: ${darkGradient};
1375
1363
  `;
1376
- var StyledTooltip = (0, import_styled.default)(import_react_tooltip.Tooltip)`
1377
- z-index: ${z.modalOverlay};
1364
+ var overlaySurfaceBorderColor = ({
1365
+ theme,
1366
+ important = false
1367
+ }) => import_react4.css`
1368
+ border-color: ${themeOr(theme.c1Neutral, theme.c3Neutral)({ theme })}
1369
+ ${important ? "!important" : ""};
1370
+ `;
1371
+ var overlaySurface = ({
1372
+ theme,
1373
+ important = false
1374
+ }) => import_react4.css`
1375
+ background-color: ${themeOr(colors.white, theme.c1Neutral)({ theme })}
1376
+ ${important ? "!important" : ""};
1377
+ border: 0.5px solid ${important ? "!important" : ""};
1378
+ ${overlaySurfaceBorderColor({ theme, important })};
1379
+ ${themeOr(
1380
+ `box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 1px 4px rgba(0, 0, 0, 0.1) ${important ? "!important" : ""};`,
1381
+ ""
1382
+ )({ theme })}
1378
1383
  `;
1379
1384
 
1380
1385
  // src/styles/utils.tsx
@@ -1439,8 +1444,10 @@ var overflowAutoWithoutScrollbars = import_react5.css`
1439
1444
  `;
1440
1445
 
1441
1446
  // src/components/Button.tsx
1442
- var import_react8 = require("@emotion/react");
1447
+ var import_react10 = require("@emotion/react");
1443
1448
  var import_styled5 = __toESM(require("@emotion/styled"), 1);
1449
+ var import_lodash_es3 = require("lodash-es");
1450
+ var import_react11 = require("react");
1444
1451
 
1445
1452
  // src/router.tsx
1446
1453
  var import_lodash_es2 = require("lodash-es");
@@ -1481,32 +1488,36 @@ function Link({
1481
1488
  externalLink,
1482
1489
  params,
1483
1490
  children,
1484
- css: css6,
1491
+ css: css7,
1485
1492
  onClick,
1486
1493
  className,
1487
1494
  hash = null,
1488
1495
  blue = false,
1489
1496
  newTab = false
1490
1497
  }) {
1491
- if (!isString(to) && !externalLink) {
1492
- throw new Error("Link must have either `to` or `externalLink` defined");
1498
+ if (!isString(to) && !externalLink && !onClick) {
1499
+ throw new Error(
1500
+ "Link must have either `to` or `externalLink` or `onClick` defined"
1501
+ );
1493
1502
  }
1494
1503
  let toStr;
1495
1504
  if (isString(to)) {
1496
1505
  toStr = replaceParams(to, params);
1497
1506
  toStr += hash ? `#${hash}` : "";
1498
- } else {
1507
+ } else if (externalLink) {
1499
1508
  const definedExternalLink = externalLink;
1500
1509
  if (!definedExternalLink.startsWith("http")) {
1501
1510
  throw new Error("Link's externalLink must start with http");
1502
1511
  }
1503
1512
  toStr = definedExternalLink;
1513
+ } else {
1514
+ toStr = "#";
1504
1515
  }
1505
1516
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1506
1517
  import_react_router_dom.Link,
1507
1518
  {
1508
1519
  to: toStr,
1509
- css: css6,
1520
+ css: css7,
1510
1521
  onClick,
1511
1522
  className,
1512
1523
  style: { color: blue ? colors.blue43 : "inherit" },
@@ -1596,9 +1607,90 @@ var IconContainer = import_styled2.default.span`
1596
1607
  `}
1597
1608
  `;
1598
1609
 
1610
+ // src/components/LightTooltip.tsx
1611
+ var import_css = require("@emotion/css");
1612
+ var import_react8 = require("@emotion/react");
1613
+ var import_react9 = __toESM(require("react"), 1);
1614
+ var import_react_dom = __toESM(require("react-dom"), 1);
1615
+ var import_react_tooltip = require("react-tooltip");
1616
+
1617
+ // src/styles/z-index.tsx
1618
+ var z = {
1619
+ card: 1,
1620
+ fieldError: 1,
1621
+ textInput: 2,
1622
+ select: 3,
1623
+ selectFocused: 4,
1624
+ walletActionPreviewTopGradient: 1,
1625
+ headerContainer: 99,
1626
+ smBanner: 99,
1627
+ headerTop: 100,
1628
+ navMenu: 100,
1629
+ smNavMenu: 100,
1630
+ navAction: 101,
1631
+ smNavAction: 100,
1632
+ // keep under navDropdown
1633
+ notificationBanner: 170,
1634
+ qrReaderVideo: 180,
1635
+ qrReaderOverlay: 181,
1636
+ modalOverlay: 190,
1637
+ modalContainer: 191,
1638
+ dropdown: 192,
1639
+ tooltip: 193,
1640
+ toast: 200
1641
+ };
1642
+
1643
+ // src/components/LightTooltip.tsx
1644
+ var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
1645
+ function LightTooltip(props) {
1646
+ const nodeRef = (0, import_react9.useRef)(null);
1647
+ const [nodeReady, setNodeReady] = import_react9.default.useState(false);
1648
+ (0, import_react9.useEffect)(() => {
1649
+ if (!nodeRef.current) {
1650
+ nodeRef.current = document.createElement("div");
1651
+ document.body.appendChild(nodeRef.current);
1652
+ }
1653
+ setNodeReady(true);
1654
+ return () => {
1655
+ if (nodeRef.current) {
1656
+ document.body.removeChild(nodeRef.current);
1657
+ nodeRef.current = null;
1658
+ }
1659
+ };
1660
+ }, []);
1661
+ const theme = (0, import_react8.useTheme)();
1662
+ console.log("LightTooltip.tsx: tooltipProps:", props);
1663
+ return nodeReady && nodeRef.current ? import_react_dom.default.createPortal(
1664
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1665
+ import_react_tooltip.Tooltip,
1666
+ __spreadProps(__spreadValues({}, props), {
1667
+ id: props.id || "",
1668
+ content: props.content || "",
1669
+ noArrow: true,
1670
+ border: "0.05rem solid rgba(0, 0, 0, 0.1)",
1671
+ className: styles({ theme }),
1672
+ variant: "light",
1673
+ delayShow: 180
1674
+ })
1675
+ ),
1676
+ nodeRef.current
1677
+ ) : null;
1678
+ }
1679
+ var styles = ({ theme }) => import_css.css`
1680
+ font-size: "10px",
1681
+ color: ${theme.c2Neutral};
1682
+ border-radius: 8px !important;
1683
+ padding: 16px !important;
1684
+ z-index: ${z.tooltip};
1685
+ ${overlaySurface({ theme, important: true })};
1686
+
1687
+ max-width: 260px;
1688
+ box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10), 0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
1689
+ `;
1690
+
1599
1691
  // src/components/Loading.tsx
1600
1692
  var import_styled3 = __toESM(require("@emotion/styled"), 1);
1601
- var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
1693
+ var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
1602
1694
  var defaultProps = {
1603
1695
  size: 60,
1604
1696
  center: true,
@@ -1609,7 +1701,7 @@ function Loading({
1609
1701
  size: size2 = defaultProps.size,
1610
1702
  ml = defaultProps.ml
1611
1703
  }) {
1612
- 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: size2 }) }) });
1704
+ 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: size2 }) }) });
1613
1705
  }
1614
1706
  Loading.defaultProps = defaultProps;
1615
1707
  var LoadingWrapper = import_styled3.default.div`
@@ -1663,7 +1755,7 @@ var UnstyledButton = import_styled4.default.button`
1663
1755
  `;
1664
1756
 
1665
1757
  // src/components/Button.tsx
1666
- var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
1758
+ var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
1667
1759
  function getTextColor({ color, theme, primary: primary2, blue }) {
1668
1760
  if (color) {
1669
1761
  return color;
@@ -1698,12 +1790,37 @@ function getBackgroundColor({
1698
1790
  }
1699
1791
  return themeOr(colors.white, theme.c1Neutral)({ theme });
1700
1792
  }
1701
- function getPaddingX({ size: size2, ghost }) {
1702
- return ghost ? 0 : size2 === "lg" ? hPaddingPx : size2 === "md" ? 18 : 16;
1793
+ var paddingsY = {
1794
+ lg: 14,
1795
+ md: 9,
1796
+ sm: 6
1797
+ };
1798
+ var roundPaddingsX = {
1799
+ lg: 19,
1800
+ md: 14,
1801
+ sm: 10
1802
+ };
1803
+ var paddingsX = {
1804
+ lg: 24,
1805
+ md: 18,
1806
+ sm: 16
1807
+ };
1808
+ function getPaddingX({
1809
+ size: size2,
1810
+ ghost,
1811
+ isRound
1812
+ }) {
1813
+ return ghost ? 0 : isRound ? roundPaddingsX[size2] : paddingsX[size2];
1703
1814
  }
1704
- function getPadding({ iconWidth, size: size2, ghost, iconSide }) {
1705
- const paddingY = ghost ? 0 : size2 === "lg" ? 14 : size2 === "md" ? 9 : 6;
1706
- const paddingX = getPaddingX({ size: size2, ghost });
1815
+ function getPadding({
1816
+ iconWidth,
1817
+ size: size2,
1818
+ ghost,
1819
+ iconSide,
1820
+ isRound
1821
+ }) {
1822
+ const paddingY = ghost ? 0 : paddingsY[size2];
1823
+ const paddingX = getPaddingX({ size: size2, ghost, isRound });
1707
1824
  const paddingForIcon = iconWidth && !ghost ? iconWidth : 0;
1708
1825
  return `${paddingY}px ${paddingX + (iconSide === "right" ? paddingForIcon : 0)}px ${paddingY}px ${paddingX + (iconSide === "left" ? paddingForIcon : 0)}px`;
1709
1826
  }
@@ -1752,40 +1869,46 @@ function Button({
1752
1869
  type = "button",
1753
1870
  blue = false,
1754
1871
  newTab = false,
1755
- zIndex = void 0
1872
+ zIndex = void 0,
1873
+ tooltipText
1756
1874
  }) {
1875
+ const tooltipId = (0, import_react11.useRef)((0, import_lodash_es3.uniqueId)());
1757
1876
  const iconMarginRight = 6;
1758
1877
  const iconSize = size2 === "lg" ? 16 : 12;
1759
1878
  let currentIcon = null;
1760
1879
  if (loading) {
1761
- currentIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonIcon, { ghost, iconSide, text, size: size2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Loading, { size: iconSize, center: false }) });
1880
+ currentIcon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonIcon, { ghost, iconSide, text, size: size2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loading, { size: iconSize, center: false }) });
1762
1881
  } else if (icon) {
1763
- currentIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonIcon, { ghost, iconSide, text, size: size2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: icon, width: iconSize }) });
1882
+ currentIcon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonIcon, { ghost, iconSide, text, size: size2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: icon, width: iconSize }) });
1764
1883
  }
1765
- const content = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1766
- "div",
1767
- {
1768
- css: {
1769
- display: "flex",
1770
- alignItems: "center",
1771
- justifyContent: "center"
1772
- },
1773
- children: [
1774
- iconSide === "left" && currentIcon,
1775
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1776
- "div",
1777
- {
1778
- css: {
1779
- textOverflow: "ellipsis",
1780
- overflow: "hidden"
1781
- },
1782
- children: text
1783
- }
1784
- ),
1785
- iconSide === "right" && currentIcon
1786
- ]
1787
- }
1788
- );
1884
+ const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react11.Fragment, { children: [
1885
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1886
+ "div",
1887
+ __spreadProps(__spreadValues({}, tooltipText ? { "data-tooltip-id": tooltipId.current } : {}), {
1888
+ css: {
1889
+ display: "flex",
1890
+ alignItems: "center",
1891
+ justifyContent: "center"
1892
+ },
1893
+ children: [
1894
+ iconSide === "left" && currentIcon,
1895
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1896
+ "div",
1897
+ {
1898
+ css: {
1899
+ textOverflow: "ellipsis",
1900
+ overflow: "hidden"
1901
+ },
1902
+ children: text
1903
+ }
1904
+ ),
1905
+ iconSide === "right" && currentIcon
1906
+ ]
1907
+ })
1908
+ ),
1909
+ tooltipText ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LightTooltip, { id: tooltipId.current, content: tooltipText }) : null
1910
+ ] });
1911
+ const isSingleCharRoundButton = Boolean(text && text.length === 1 && !icon);
1789
1912
  const commonProps = {
1790
1913
  backgroundColor,
1791
1914
  color,
@@ -1798,6 +1921,7 @@ function Button({
1798
1921
  fullWidth,
1799
1922
  blue,
1800
1923
  iconSide,
1924
+ isRound: isSingleCharRoundButton,
1801
1925
  iconWidth: currentIcon ? iconSize + iconMarginRight : 0,
1802
1926
  isLoading: loading,
1803
1927
  disabled: disabled || loading,
@@ -1810,11 +1934,10 @@ function Button({
1810
1934
  zIndex
1811
1935
  };
1812
1936
  if (to) {
1813
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonLink, __spreadProps(__spreadValues({}, commonProps), { to, params: toParams, hash, children: content }));
1937
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonLink, __spreadProps(__spreadValues({}, commonProps), { to, params: toParams, hash, children: content }));
1814
1938
  }
1815
- 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 }));
1939
+ 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 }));
1816
1940
  }
1817
- var hPaddingPx = 24;
1818
1941
  var buttonStyle = ({
1819
1942
  color,
1820
1943
  backgroundColor,
@@ -1830,8 +1953,9 @@ var buttonStyle = ({
1830
1953
  blue,
1831
1954
  text,
1832
1955
  zIndex,
1833
- iconSide
1834
- }) => import_react8.css`
1956
+ iconSide,
1957
+ isRound
1958
+ }) => import_react10.css`
1835
1959
  display: inline-flex;
1836
1960
  opacity: ${disabled && !isLoading ? 0.2 : 1};
1837
1961
  transition: opacity 0.2s;
@@ -1867,8 +1991,15 @@ var buttonStyle = ({
1867
1991
  primary: primary2,
1868
1992
  blue
1869
1993
  })};
1870
- border-radius: 32px;
1871
- padding: ${getPadding({ size: size2, iconWidth, text, ghost, iconSide })};
1994
+ border-radius: ${isRound ? "100%" : "32px"};
1995
+ padding: ${getPadding({
1996
+ size: size2,
1997
+ iconWidth,
1998
+ text,
1999
+ ghost,
2000
+ iconSide,
2001
+ isRound
2002
+ })};
1872
2003
  color: ${getTextColor({ color, theme, primary: primary2, blue })};
1873
2004
  transition:
1874
2005
  background-color 0.2s ease-out,
@@ -1881,7 +2012,7 @@ var buttonStyle = ({
1881
2012
  `;
1882
2013
  var ButtonIcon = import_styled5.default.div`
1883
2014
  ${(props) => props.ghost ? "" : "position: absolute;"}
1884
- ${({ iconSide, ghost, text, size: size2 }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size: size2, ghost })}px;`}
2015
+ ${({ iconSide, ghost, text, size: size2 }) => `${iconSide}: ${ghost && text ? 0 : getPaddingX({ size: size2, ghost, isRound: false })}px;`}
1885
2016
  `;
1886
2017
  var StyledButton = (0, import_styled5.default)(UnstyledButton)`
1887
2018
  ${(props) => buttonStyle(props)}
@@ -1894,14 +2025,16 @@ var ButtonHrefLink = import_styled5.default.a`
1894
2025
  `;
1895
2026
 
1896
2027
  // src/components/ButtonRow.tsx
1897
- var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
2028
+ var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
1898
2029
  function ButtonRow({
1899
2030
  buttons,
1900
2031
  className,
1901
2032
  smSticky = true,
1902
2033
  headerHeight = 0
1903
2034
  }) {
1904
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonRowContainer, { smSticky, headerHeight, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StyledButtonRow, { className, children: buttons.map((button, idx) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, __spreadValues({}, button), idx)) }) });
2035
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ButtonRowContainer, { smSticky, headerHeight, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(StyledButtonRow, { className, children: buttons.map(
2036
+ (button, idx) => button === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ButtonRowDivider, {}, idx) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, __spreadValues({}, button), idx)
2037
+ ) }) });
1905
2038
  }
1906
2039
  var ButtonRowContainer = import_styled6.default.div`
1907
2040
  max-width: 100%;
@@ -1913,9 +2046,9 @@ var ButtonRowContainer = import_styled6.default.div`
1913
2046
  position: sticky;
1914
2047
  top: ${headerHeight}px;
1915
2048
  margin-top: 24px;
1916
- margin-left: -${standardContentInsetSmPx}px;
1917
- width: calc(100% + ${standardContentInsetSmPx * 2}px);
1918
- max-width: calc(100% + ${standardContentInsetSmPx * 2}px);
2049
+ margin-left: -${standardContentInset.smPx}px;
2050
+ width: calc(100% + ${standardContentInset.smPx * 2}px);
2051
+ max-width: calc(100% + ${standardContentInset.smPx * 2}px);
1919
2052
  z-index: 2;` : `position: relative;`}
1920
2053
  z-index: 2;
1921
2054
  &:before {
@@ -1931,6 +2064,11 @@ var ButtonRowContainer = import_styled6.default.div`
1931
2064
  `
1932
2065
  )}
1933
2066
  `;
2067
+ var ButtonRowDivider = import_styled6.default.div`
2068
+ border-left: 1px #d9d9d9 solid;
2069
+ margin-left: 16px;
2070
+ padding-left: 16px;
2071
+ `;
1934
2072
  var StyledButtonRow = import_styled6.default.div`
1935
2073
  ${overflowAutoWithoutScrollbars}
1936
2074
  background: ${({ theme }) => theme.bg};
@@ -1943,12 +2081,18 @@ var StyledButtonRow = import_styled6.default.div`
1943
2081
  margin-left: 8px;
1944
2082
  }
1945
2083
 
2084
+ & ${ButtonRowDivider} + button,
2085
+ & ${ButtonRowDivider} + a {
2086
+ margin-left: 0;
2087
+ }
2088
+
1946
2089
  ${bp.sm(`
1947
- padding: 12px;
2090
+ padding: ${standardContentInset.smPx}px;
1948
2091
  `)}
1949
2092
  `;
1950
2093
  // Annotate the CommonJS export names for ESM import in node:
1951
2094
  0 && (module.exports = {
1952
2095
  ButtonRow,
1953
- ButtonRowContainer
2096
+ ButtonRowContainer,
2097
+ StyledButtonRow
1954
2098
  });
@@ -7,7 +7,7 @@ import '../router.cjs';
7
7
  import 'react-router-dom';
8
8
 
9
9
  type ButtonRowProps<RoutesType extends string> = {
10
- buttons: ButtonProps<RoutesType>[];
10
+ buttons: (ButtonProps<RoutesType> | "divider")[];
11
11
  smSticky?: boolean;
12
12
  className?: string;
13
13
  headerHeight?: number;
@@ -20,5 +20,9 @@ declare const ButtonRowContainer: _emotion_styled.StyledComponent<{
20
20
  smSticky: boolean;
21
21
  headerHeight: number;
22
22
  }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ declare const StyledButtonRow: _emotion_styled.StyledComponent<{
24
+ theme?: _emotion_react.Theme;
25
+ as?: react.ElementType<any>;
26
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
27
 
24
- export { ButtonRow, ButtonRowContainer, ButtonRowProps };
28
+ export { ButtonRow, ButtonRowContainer, ButtonRowProps, StyledButtonRow };
@@ -7,7 +7,7 @@ import '../router.js';
7
7
  import 'react-router-dom';
8
8
 
9
9
  type ButtonRowProps<RoutesType extends string> = {
10
- buttons: ButtonProps<RoutesType>[];
10
+ buttons: (ButtonProps<RoutesType> | "divider")[];
11
11
  smSticky?: boolean;
12
12
  className?: string;
13
13
  headerHeight?: number;
@@ -20,5 +20,9 @@ declare const ButtonRowContainer: _emotion_styled.StyledComponent<{
20
20
  smSticky: boolean;
21
21
  headerHeight: number;
22
22
  }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ declare const StyledButtonRow: _emotion_styled.StyledComponent<{
24
+ theme?: _emotion_react.Theme;
25
+ as?: react.ElementType<any>;
26
+ }, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
27
 
24
- export { ButtonRow, ButtonRowContainer, ButtonRowProps };
28
+ export { ButtonRow, ButtonRowContainer, ButtonRowProps, StyledButtonRow };
@@ -1,22 +1,25 @@
1
1
  import {
2
2
  ButtonRow,
3
- ButtonRowContainer
4
- } from "../chunk-JYWYEOM6.js";
5
- import "../chunk-FKETYVPP.js";
6
- import "../chunk-M56R3RJ7.js";
3
+ ButtonRowContainer,
4
+ StyledButtonRow
5
+ } from "../chunk-NFSAJ5GJ.js";
6
+ import "../chunk-ZANLDY2W.js";
7
+ import "../chunk-OGSDZTHM.js";
7
8
  import "../chunk-YMNSXZ5D.js";
8
- import "../chunk-NGS4OSWT.js";
9
- import "../chunk-UO6U7AYM.js";
10
- import "../chunk-IQFU7CM5.js";
11
- import "../chunk-NZJCJJH5.js";
9
+ import "../chunk-J4FJQ3FN.js";
10
+ import "../chunk-3GS5EFXV.js";
11
+ import "../chunk-3EVAP5JT.js";
12
+ import "../chunk-55OQPFLF.js";
13
+ import "../chunk-FCZJILMW.js";
14
+ import "../chunk-RWIZ7Q74.js";
12
15
  import "../chunk-LAMQKQU3.js";
13
- import "../chunk-RFGKH3R6.js";
16
+ import "../chunk-JK4BP73A.js";
14
17
  import "../chunk-2VBDEO6M.js";
15
18
  import "../chunk-E4EXM4SY.js";
16
19
  import "../chunk-JSGRNWSB.js";
17
- import "../chunk-CLU2FRJZ.js";
18
20
  import "../chunk-CIGAQ47A.js";
19
21
  export {
20
22
  ButtonRow,
21
- ButtonRowContainer
23
+ ButtonRowContainer,
24
+ StyledButtonRow
22
25
  };