@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.
Files changed (125) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{chunk-JYWYEOM6.js → chunk-2JM7UTAZ.js} +18 -5
  3. package/dist/{chunk-UO6U7AYM.js → chunk-2YB7653N.js} +1 -1
  4. package/dist/{chunk-RTUZVKPK.js → chunk-36C653MV.js} +1 -1
  5. package/dist/{chunk-IQFU7CM5.js → chunk-4KWTXZRY.js} +1 -1
  6. package/dist/{chunk-CLU2FRJZ.js → chunk-55OQPFLF.js} +1 -1
  7. package/dist/{chunk-3CZOYF3X.js → chunk-6FHLZM6N.js} +2 -2
  8. package/dist/{chunk-K7D7A34K.js → chunk-744FBGRP.js} +1 -1
  9. package/dist/{chunk-FKETYVPP.js → chunk-76Q4BK35.js} +87 -43
  10. package/dist/{chunk-NGS4OSWT.js → chunk-BAO4T4G5.js} +1 -1
  11. package/dist/{chunk-NH25O7PC.js → chunk-CW3W2VTZ.js} +1 -1
  12. package/dist/{chunk-G2PZZFJL.js → chunk-DAVVD7YE.js} +10 -10
  13. package/dist/{chunk-VBWTKANQ.js → chunk-FN5PM3HQ.js} +6 -6
  14. package/dist/{chunk-RFGKH3R6.js → chunk-HNVQIY5U.js} +0 -8
  15. package/dist/{chunk-I74XQIVV.js → chunk-MAMSU2XB.js} +3 -3
  16. package/dist/chunk-NRXJA2PM.js +67 -0
  17. package/dist/{chunk-M56R3RJ7.js → chunk-OGSDZTHM.js} +7 -3
  18. package/dist/chunk-SZVMKB4E.js +222 -0
  19. package/dist/chunk-U6XT5JKC.js +25 -0
  20. package/dist/{chunk-WWFDI534.js → chunk-UWN53KLJ.js} +13 -6
  21. package/dist/{chunk-TAI352I3.js → chunk-VE7J2N47.js} +1 -1
  22. package/dist/{chunk-NZJCJJH5.js → chunk-VHW2KROZ.js} +1 -1
  23. package/dist/{chunk-N2RDQJQ5.js → chunk-WTO7C7WA.js} +1 -1
  24. package/dist/{chunk-23SR7TFO.js → chunk-XAZ6NZ6I.js} +1 -1
  25. package/dist/chunk-YPB5SA65.js +163 -0
  26. package/dist/{chunk-SVQELXFK.js → chunk-Z5TPS2BO.js} +1 -1
  27. package/dist/{chunk-T33SBHYI.js → chunk-ZSUX6RLD.js} +3 -1
  28. package/dist/{chunk-2WYVO6B2.js → chunk-ZYHA6MJC.js} +1 -1
  29. package/dist/components/Badge.cjs +1332 -0
  30. package/dist/components/Badge.d.cts +10 -0
  31. package/dist/components/Badge.d.ts +10 -0
  32. package/dist/components/Badge.js +13 -0
  33. package/dist/components/Button.cjs +197 -83
  34. package/dist/components/Button.d.cts +3 -1
  35. package/dist/components/Button.d.ts +3 -1
  36. package/dist/components/Button.js +8 -7
  37. package/dist/components/ButtonRow.cjs +212 -82
  38. package/dist/components/ButtonRow.d.cts +6 -2
  39. package/dist/components/ButtonRow.d.ts +6 -2
  40. package/dist/components/ButtonRow.js +14 -11
  41. package/dist/components/Collapsible.cjs +0 -30
  42. package/dist/components/Collapsible.js +4 -5
  43. package/dist/components/ContentTable.cjs +0 -30
  44. package/dist/components/ContentTable.js +3 -4
  45. package/dist/components/CopyToClipboardButton.cjs +123 -41
  46. package/dist/components/CopyToClipboardButton.js +6 -5
  47. package/dist/components/CurrencyAmount.cjs +0 -30
  48. package/dist/components/CurrencyAmount.js +3 -4
  49. package/dist/components/FileInput.cjs +1945 -0
  50. package/dist/components/FileInput.d.cts +21 -0
  51. package/dist/components/FileInput.d.ts +21 -0
  52. package/dist/components/FileInput.js +113 -0
  53. package/dist/components/Icon.cjs +0 -30
  54. package/dist/components/Icon.js +2 -3
  55. package/dist/components/LightTooltip.cjs +1414 -0
  56. package/dist/components/LightTooltip.d.cts +9 -0
  57. package/dist/components/LightTooltip.d.ts +9 -0
  58. package/dist/components/LightTooltip.js +12 -0
  59. package/dist/components/LightboxImage.cjs +1 -1
  60. package/dist/components/LightboxImage.js +2 -2
  61. package/dist/components/LightsparkProvider.cjs +3 -33
  62. package/dist/components/LightsparkProvider.js +3 -4
  63. package/dist/components/Loading.cjs +0 -30
  64. package/dist/components/Loading.js +3 -4
  65. package/dist/components/Modal.cjs +208 -114
  66. package/dist/components/Modal.js +12 -11
  67. package/dist/components/Pill.cjs +1703 -0
  68. package/dist/components/Pill.d.cts +19 -0
  69. package/dist/components/Pill.d.ts +19 -0
  70. package/dist/components/Pill.js +16 -0
  71. package/dist/components/ProgressBar.cjs +0 -32
  72. package/dist/components/ProgressBar.js +2 -3
  73. package/dist/components/SecretContainer.cjs +124 -42
  74. package/dist/components/SecretContainer.js +7 -6
  75. package/dist/components/TextIconAligner.cjs +0 -30
  76. package/dist/components/TextIconAligner.js +3 -4
  77. package/dist/components/UnstyledButton.cjs +0 -30
  78. package/dist/components/UnstyledButton.js +2 -3
  79. package/dist/components/documentation/AnchorLinkHeader.cjs +0 -32
  80. package/dist/components/documentation/AnchorLinkHeader.js +3 -4
  81. package/dist/components/documentation/index.cjs +0 -32
  82. package/dist/components/documentation/index.js +3 -4
  83. package/dist/components/index.cjs +608 -327
  84. package/dist/components/index.d.cts +5 -1
  85. package/dist/components/index.d.ts +5 -1
  86. package/dist/components/index.js +37 -25
  87. package/dist/icons/Copy.cjs +4 -3
  88. package/dist/icons/Copy.js +4 -3
  89. package/dist/icons/Download.cjs +22 -11
  90. package/dist/icons/Download.js +23 -12
  91. package/dist/icons/Upload.cjs +22 -11
  92. package/dist/icons/Upload.js +23 -12
  93. package/dist/icons/index.cjs +0 -30
  94. package/dist/icons/index.js +2 -3
  95. package/dist/router.cjs +7 -3
  96. package/dist/router.js +1 -1
  97. package/dist/styles/common.cjs +0 -32
  98. package/dist/styles/common.d.cts +1 -5
  99. package/dist/styles/common.d.ts +1 -5
  100. package/dist/styles/common.js +1 -4
  101. package/dist/styles/fields.cjs +65 -34
  102. package/dist/styles/fields.d.cts +8 -2
  103. package/dist/styles/fields.d.ts +8 -2
  104. package/dist/styles/fields.js +28 -164
  105. package/dist/styles/fonts/typography/Article.cjs +0 -30
  106. package/dist/styles/fonts/typography/Article.js +6 -7
  107. package/dist/styles/fonts/typography/index.cjs +0 -30
  108. package/dist/styles/fonts/typography/index.js +11 -12
  109. package/dist/styles/fonts/typographyTokens.d.cts +4 -1
  110. package/dist/styles/fonts/typographyTokens.d.ts +4 -1
  111. package/dist/styles/global.cjs +3 -33
  112. package/dist/styles/global.js +2 -3
  113. package/dist/styles/type.cjs +0 -30
  114. package/dist/styles/type.js +2 -3
  115. package/dist/styles/utils.cjs +0 -30
  116. package/dist/styles/utils.js +2 -3
  117. package/dist/styles/z-index.cjs +1 -1
  118. package/dist/styles/z-index.d.cts +1 -1
  119. package/dist/styles/z-index.d.ts +1 -1
  120. package/dist/styles/z-index.js +1 -1
  121. package/dist/types/index.d.cts +2 -0
  122. package/dist/types/index.d.ts +2 -0
  123. package/dist/utils/toReactNodes.cjs +7 -3
  124. package/dist/utils/toReactNodes.js +2 -2
  125. package/package.json +5 -4
@@ -72,12 +72,15 @@ __export(CopyToClipboardButton_exports, {
72
72
  module.exports = __toCommonJS(CopyToClipboardButton_exports);
73
73
  var import_styled4 = __toESM(require("@emotion/styled"), 1);
74
74
  var import_nanoid = require("nanoid");
75
- var import_react6 = require("react");
75
+ var import_react8 = require("react");
76
+
77
+ // src/components/Icon.tsx
78
+ var import_styled2 = __toESM(require("@emotion/styled"), 1);
79
+ var import_react5 = require("react");
76
80
 
77
81
  // src/styles/common.tsx
78
82
  var import_react4 = require("@emotion/react");
79
83
  var import_styled = __toESM(require("@emotion/styled"), 1);
80
- var import_react_tooltip = require("react-tooltip");
81
84
 
82
85
  // src/styles/breakpoints.tsx
83
86
  var import_react = require("@emotion/react");
@@ -1260,6 +1263,10 @@ var umaLightTheme = extend(lightTheme, {
1260
1263
  bg: uma.blue90
1261
1264
  })
1262
1265
  });
1266
+ var isLight = (theme) => theme.type === "light" /* Light */;
1267
+ var themeOr = (lightValue, darkValue) => ({ theme }) => {
1268
+ return isLight(theme) ? lightValue : darkValue;
1269
+ };
1263
1270
  function luminance(r, g, b) {
1264
1271
  const a = [r, g, b].map(function(v) {
1265
1272
  v /= 255;
@@ -1283,32 +1290,6 @@ function hexToRGB(hex) {
1283
1290
  ] : [0, 0, 0];
1284
1291
  }
1285
1292
 
1286
- // src/styles/z-index.tsx
1287
- var z = {
1288
- card: 1,
1289
- fieldError: 1,
1290
- textInput: 2,
1291
- select: 3,
1292
- selectFocused: 4,
1293
- walletActionPreviewTopGradient: 1,
1294
- headerContainer: 99,
1295
- smBanner: 99,
1296
- headerTop: 100,
1297
- navMenu: 100,
1298
- smNavMenu: 100,
1299
- navAction: 101,
1300
- smNavAction: 100,
1301
- // keep under navDropdown
1302
- tooltip: 160,
1303
- notificationBanner: 170,
1304
- qrReaderVideo: 180,
1305
- qrReaderOverlay: 181,
1306
- modalOverlay: 190,
1307
- modalContainer: 191,
1308
- dropdown: 192,
1309
- toast: 200
1310
- };
1311
-
1312
1293
  // src/styles/common.tsx
1313
1294
  var rootFontSizePx = 12;
1314
1295
  var rootFontSizeRems = rootFontSizePx / 16;
@@ -1370,13 +1351,26 @@ var Subtext = import_styled.default.div`
1370
1351
  var darkGradientBg = import_react4.css`
1371
1352
  background: ${darkGradient};
1372
1353
  `;
1373
- var StyledTooltip = (0, import_styled.default)(import_react_tooltip.Tooltip)`
1374
- z-index: ${z.modalOverlay};
1354
+ var overlaySurfaceBorderColor = ({
1355
+ theme,
1356
+ important = false
1357
+ }) => import_react4.css`
1358
+ border-color: ${themeOr(theme.c1Neutral, theme.c3Neutral)({ theme })}
1359
+ ${important ? "!important" : ""};
1360
+ `;
1361
+ var overlaySurface = ({
1362
+ theme,
1363
+ important = false
1364
+ }) => import_react4.css`
1365
+ background-color: ${themeOr(colors.white, theme.c1Neutral)({ theme })}
1366
+ ${important ? "!important" : ""};
1367
+ border: 0.5px solid ${important ? "!important" : ""};
1368
+ ${overlaySurfaceBorderColor({ theme, important })};
1369
+ ${themeOr(
1370
+ `box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08), 0px 1px 4px rgba(0, 0, 0, 0.1) ${important ? "!important" : ""};`,
1371
+ ""
1372
+ )({ theme })}
1375
1373
  `;
1376
-
1377
- // src/components/Icon.tsx
1378
- var import_styled2 = __toESM(require("@emotion/styled"), 1);
1379
- var import_react5 = require("react");
1380
1374
 
1381
1375
  // src/utils/strings.tsx
1382
1376
  function isString(str) {
@@ -1460,6 +1454,87 @@ var IconContainer = import_styled2.default.span`
1460
1454
  `}
1461
1455
  `;
1462
1456
 
1457
+ // src/components/LightTooltip.tsx
1458
+ var import_css = require("@emotion/css");
1459
+ var import_react6 = require("@emotion/react");
1460
+ var import_react7 = __toESM(require("react"), 1);
1461
+ var import_react_dom = __toESM(require("react-dom"), 1);
1462
+ var import_react_tooltip = require("react-tooltip");
1463
+
1464
+ // src/styles/z-index.tsx
1465
+ var z = {
1466
+ card: 1,
1467
+ fieldError: 1,
1468
+ textInput: 2,
1469
+ select: 3,
1470
+ selectFocused: 4,
1471
+ walletActionPreviewTopGradient: 1,
1472
+ headerContainer: 99,
1473
+ smBanner: 99,
1474
+ headerTop: 100,
1475
+ navMenu: 100,
1476
+ smNavMenu: 100,
1477
+ navAction: 101,
1478
+ smNavAction: 100,
1479
+ // keep under navDropdown
1480
+ notificationBanner: 170,
1481
+ qrReaderVideo: 180,
1482
+ qrReaderOverlay: 181,
1483
+ modalOverlay: 190,
1484
+ modalContainer: 191,
1485
+ dropdown: 192,
1486
+ tooltip: 193,
1487
+ toast: 200
1488
+ };
1489
+
1490
+ // src/components/LightTooltip.tsx
1491
+ var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
1492
+ function LightTooltip(props) {
1493
+ const nodeRef = (0, import_react7.useRef)(null);
1494
+ const [nodeReady, setNodeReady] = import_react7.default.useState(false);
1495
+ (0, import_react7.useEffect)(() => {
1496
+ if (!nodeRef.current) {
1497
+ nodeRef.current = document.createElement("div");
1498
+ document.body.appendChild(nodeRef.current);
1499
+ }
1500
+ setNodeReady(true);
1501
+ return () => {
1502
+ if (nodeRef.current) {
1503
+ document.body.removeChild(nodeRef.current);
1504
+ nodeRef.current = null;
1505
+ }
1506
+ };
1507
+ }, []);
1508
+ const theme = (0, import_react6.useTheme)();
1509
+ console.log("LightTooltip.tsx: tooltipProps:", props);
1510
+ return nodeReady && nodeRef.current ? import_react_dom.default.createPortal(
1511
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1512
+ import_react_tooltip.Tooltip,
1513
+ __spreadProps(__spreadValues({}, props), {
1514
+ id: props.id || "",
1515
+ content: props.content || "",
1516
+ noArrow: true,
1517
+ border: "0.05rem solid rgba(0, 0, 0, 0.1)",
1518
+ className: styles({ theme }),
1519
+ variant: "light",
1520
+ delayShow: 180
1521
+ })
1522
+ ),
1523
+ nodeRef.current
1524
+ ) : null;
1525
+ }
1526
+ var styles = ({ theme }) => import_css.css`
1527
+ font-size: "10px",
1528
+ color: ${theme.c2Neutral};
1529
+ border-radius: 8px !important;
1530
+ padding: 16px !important;
1531
+ z-index: ${z.tooltip};
1532
+ ${overlaySurface({ theme, important: true })};
1533
+
1534
+ max-width: 260px;
1535
+ box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10), 0px 4px 8px 0px rgba(0, 0, 0, 0.08) !important;
1536
+ `;
1537
+
1463
1538
  // src/components/UnstyledButton.tsx
1464
1539
  var import_styled3 = __toESM(require("@emotion/styled"), 1);
1465
1540
  var UnstyledButton = import_styled3.default.button`
@@ -1477,15 +1552,15 @@ var UnstyledButton = import_styled3.default.button`
1477
1552
  `;
1478
1553
 
1479
1554
  // src/components/CopyToClipboardButton.tsx
1480
- var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
1555
+ var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
1481
1556
  var CopyToClipboardButton = (props) => {
1482
1557
  var _a;
1483
1558
  const originalTooltipContent = props.tooltipContent || "Click to copy";
1484
1559
  const icon = props.icon || "Copy";
1485
1560
  const id = `copy-node-name-${(_a = props.id) != null ? _a : (0, import_nanoid.nanoid)()}`;
1486
- const [tooltipContent, setTooltipContent] = (0, import_react6.useState)(originalTooltipContent);
1487
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1488
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1561
+ const [tooltipContent, setTooltipContent] = (0, import_react8.useState)(originalTooltipContent);
1562
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1563
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1489
1564
  Button,
1490
1565
  {
1491
1566
  type: "button",
@@ -1506,12 +1581,19 @@ var CopyToClipboardButton = (props) => {
1506
1581
  ml: props.ml,
1507
1582
  "data-tooltip-id": id,
1508
1583
  children: [
1509
- props.children ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Children, { children: props.children }) : null,
1510
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, { name: icon, width: props.isSm ? 12 : 16 })
1584
+ props.children ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Children, { children: props.children }) : null,
1585
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: icon, width: props.isSm ? 12 : 16 })
1511
1586
  ]
1512
1587
  }
1513
1588
  ),
1514
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledTooltip, { id, place: props.place || "right", variant: "dark", children: tooltipContent })
1589
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1590
+ LightTooltip,
1591
+ {
1592
+ id,
1593
+ place: props.place || "right",
1594
+ content: tooltipContent
1595
+ }
1596
+ )
1515
1597
  ] });
1516
1598
  };
1517
1599
  var Children = import_styled4.default.span`
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  CopyToClipboardButton
3
- } from "../chunk-WWFDI534.js";
4
- import "../chunk-IQFU7CM5.js";
5
- import "../chunk-NZJCJJH5.js";
3
+ } from "../chunk-UWN53KLJ.js";
4
+ import "../chunk-4KWTXZRY.js";
5
+ import "../chunk-NRXJA2PM.js";
6
+ import "../chunk-55OQPFLF.js";
7
+ import "../chunk-VHW2KROZ.js";
6
8
  import "../chunk-LAMQKQU3.js";
7
- import "../chunk-RFGKH3R6.js";
9
+ import "../chunk-HNVQIY5U.js";
8
10
  import "../chunk-2VBDEO6M.js";
9
11
  import "../chunk-E4EXM4SY.js";
10
12
  import "../chunk-JSGRNWSB.js";
11
- import "../chunk-CLU2FRJZ.js";
12
13
  import "../chunk-CIGAQ47A.js";
13
14
  export {
14
15
  CopyToClipboardButton
@@ -82,7 +82,6 @@ var import_react5 = require("react");
82
82
  // src/styles/common.tsx
83
83
  var import_react4 = require("@emotion/react");
84
84
  var import_styled = __toESM(require("@emotion/styled"), 1);
85
- var import_react_tooltip = require("react-tooltip");
86
85
 
87
86
  // src/styles/breakpoints.tsx
88
87
  var import_react = require("@emotion/react");
@@ -1288,32 +1287,6 @@ function hexToRGB(hex) {
1288
1287
  ] : [0, 0, 0];
1289
1288
  }
1290
1289
 
1291
- // src/styles/z-index.tsx
1292
- var z = {
1293
- card: 1,
1294
- fieldError: 1,
1295
- textInput: 2,
1296
- select: 3,
1297
- selectFocused: 4,
1298
- walletActionPreviewTopGradient: 1,
1299
- headerContainer: 99,
1300
- smBanner: 99,
1301
- headerTop: 100,
1302
- navMenu: 100,
1303
- smNavMenu: 100,
1304
- navAction: 101,
1305
- smNavAction: 100,
1306
- // keep under navDropdown
1307
- tooltip: 160,
1308
- notificationBanner: 170,
1309
- qrReaderVideo: 180,
1310
- qrReaderOverlay: 181,
1311
- modalOverlay: 190,
1312
- modalContainer: 191,
1313
- dropdown: 192,
1314
- toast: 200
1315
- };
1316
-
1317
1290
  // src/styles/common.tsx
1318
1291
  var rootFontSizePx = 12;
1319
1292
  var rootFontSizeRems = rootFontSizePx / 16;
@@ -1360,9 +1333,6 @@ var Subtext = import_styled.default.div`
1360
1333
  var darkGradientBg = import_react4.css`
1361
1334
  background: ${darkGradient};
1362
1335
  `;
1363
- var StyledTooltip = (0, import_styled.default)(import_react_tooltip.Tooltip)`
1364
- z-index: ${z.modalOverlay};
1365
- `;
1366
1336
 
1367
1337
  // src/utils/strings.tsx
1368
1338
  function isString(str) {
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  CurrencyAmount,
3
3
  CurrencyIcon
4
- } from "../chunk-23SR7TFO.js";
5
- import "../chunk-NZJCJJH5.js";
4
+ } from "../chunk-XAZ6NZ6I.js";
5
+ import "../chunk-VHW2KROZ.js";
6
6
  import "../chunk-LAMQKQU3.js";
7
- import "../chunk-RFGKH3R6.js";
7
+ import "../chunk-HNVQIY5U.js";
8
8
  import "../chunk-2VBDEO6M.js";
9
9
  import "../chunk-E4EXM4SY.js";
10
10
  import "../chunk-JSGRNWSB.js";
11
- import "../chunk-CLU2FRJZ.js";
12
11
  import "../chunk-CIGAQ47A.js";
13
12
  export {
14
13
  CurrencyAmount,