@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
@@ -0,0 +1,21 @@
1
+ import * as _emotion_styled from '@emotion/styled';
2
+ import * as react from 'react';
3
+ import * as _emotion_react from '@emotion/react';
4
+ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
5
+
6
+ type FileInputProps = {
7
+ name: string;
8
+ onChange: (fileContent: string) => void;
9
+ filePurpose?: string;
10
+ onRemoveFile: () => void;
11
+ };
12
+ declare function FileInput({ name, onChange, filePurpose, onRemoveFile, }: FileInputProps): _emotion_react_jsx_runtime.JSX.Element;
13
+ type StyledFileInputProps = {
14
+ hasValidFileSet: boolean;
15
+ };
16
+ declare const StyledFileInput: _emotion_styled.StyledComponent<{
17
+ theme?: _emotion_react.Theme;
18
+ as?: react.ElementType<any>;
19
+ } & StyledFileInputProps, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+
21
+ export { FileInput, StyledFileInput };
@@ -0,0 +1,21 @@
1
+ import * as _emotion_styled from '@emotion/styled';
2
+ import * as react from 'react';
3
+ import * as _emotion_react from '@emotion/react';
4
+ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
5
+
6
+ type FileInputProps = {
7
+ name: string;
8
+ onChange: (fileContent: string) => void;
9
+ filePurpose?: string;
10
+ onRemoveFile: () => void;
11
+ };
12
+ declare function FileInput({ name, onChange, filePurpose, onRemoveFile, }: FileInputProps): _emotion_react_jsx_runtime.JSX.Element;
13
+ type StyledFileInputProps = {
14
+ hasValidFileSet: boolean;
15
+ };
16
+ declare const StyledFileInput: _emotion_styled.StyledComponent<{
17
+ theme?: _emotion_react.Theme;
18
+ as?: react.ElementType<any>;
19
+ } & StyledFileInputProps, react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+
21
+ export { FileInput, StyledFileInput };
@@ -0,0 +1,113 @@
1
+ import {
2
+ InputSubtext,
3
+ inputBlockStyle
4
+ } from "../chunk-SZVMKB4E.js";
5
+ import {
6
+ Pill
7
+ } from "../chunk-YPB5SA65.js";
8
+ import "../chunk-BAO4T4G5.js";
9
+ import "../chunk-2YB7653N.js";
10
+ import "../chunk-4KWTXZRY.js";
11
+ import "../chunk-55OQPFLF.js";
12
+ import {
13
+ Icon
14
+ } from "../chunk-VHW2KROZ.js";
15
+ import "../chunk-LAMQKQU3.js";
16
+ import "../chunk-HNVQIY5U.js";
17
+ import "../chunk-2VBDEO6M.js";
18
+ import "../chunk-E4EXM4SY.js";
19
+ import "../chunk-JSGRNWSB.js";
20
+ import "../chunk-CIGAQ47A.js";
21
+
22
+ // src/components/FileInput.tsx
23
+ import styled from "@emotion/styled";
24
+ import { Fragment, useRef, useState } from "react";
25
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
26
+ function FileInput({
27
+ name,
28
+ onChange,
29
+ filePurpose = "",
30
+ onRemoveFile
31
+ }) {
32
+ const [fileName, setFileName] = useState();
33
+ const [fileContent, setFileContent] = useState();
34
+ const [fileErrorMsg, setFileErrorMsg] = useState();
35
+ const fileInputRef = useRef(null);
36
+ const handleChange = (changeEvent) => {
37
+ var _a;
38
+ const file = (_a = changeEvent.target.files) == null ? void 0 : _a[0];
39
+ if (!file) {
40
+ return;
41
+ }
42
+ const reader = new FileReader();
43
+ reader.onload = (readEvent) => {
44
+ var _a2;
45
+ let fileContent2 = (_a2 = readEvent == null ? void 0 : readEvent.target) == null ? void 0 : _a2.result;
46
+ setFileName(file.name);
47
+ if (!fileContent2) {
48
+ setFileErrorMsg("Unable to read file");
49
+ return;
50
+ }
51
+ if (typeof fileContent2 !== "string") {
52
+ fileContent2 = new TextDecoder().decode(fileContent2);
53
+ }
54
+ setFileErrorMsg(void 0);
55
+ setFileContent(fileContent2);
56
+ onChange(fileContent2);
57
+ };
58
+ reader.readAsText(file);
59
+ };
60
+ function handleRemoveFile() {
61
+ if (fileInputRef.current) {
62
+ fileInputRef.current.value = "";
63
+ }
64
+ setFileName(void 0);
65
+ setFileContent(void 0);
66
+ setFileErrorMsg(void 0);
67
+ onRemoveFile();
68
+ }
69
+ return /* @__PURE__ */ jsxs(StyledFileInputContainer, { children: [
70
+ /* @__PURE__ */ jsxs(StyledFileInput, { hasValidFileSet: Boolean(fileName && fileContent), children: [
71
+ /* @__PURE__ */ jsx("label", { htmlFor: name, children: fileName && fileContent ? /* @__PURE__ */ jsx(
72
+ Pill,
73
+ {
74
+ text: fileName,
75
+ cursor: "pointer",
76
+ onDeleteMouseDown: handleRemoveFile,
77
+ onDeleteFromKeyboard: handleRemoveFile
78
+ }
79
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ /* @__PURE__ */ jsx(Icon, { name: "Upload", width: 26, tutorialStep: 6 }),
81
+ "Upload ",
82
+ filePurpose || "",
83
+ " file"
84
+ ] }) }),
85
+ /* @__PURE__ */ jsx(
86
+ "input",
87
+ {
88
+ type: "file",
89
+ id: name,
90
+ onChange: handleChange,
91
+ ref: fileInputRef
92
+ }
93
+ )
94
+ ] }),
95
+ fileErrorMsg ? /* @__PURE__ */ jsx(InputSubtext, { text: fileErrorMsg, hasError: true }) : null
96
+ ] });
97
+ }
98
+ var StyledFileInputContainer = styled.div``;
99
+ var StyledFileInput = styled.div`
100
+ input[type="file"] {
101
+ display: none;
102
+ }
103
+
104
+ label {
105
+ display: block;
106
+ cursor: pointer;
107
+ ${({ theme, hasValidFileSet }) => inputBlockStyle({ theme, hasValue: hasValidFileSet, hasError: false })}
108
+ }
109
+ `;
110
+ export {
111
+ FileInput,
112
+ StyledFileInput
113
+ };
@@ -77,7 +77,6 @@ var import_react5 = require("react");
77
77
  // src/styles/common.tsx
78
78
  var import_react4 = require("@emotion/react");
79
79
  var import_styled = __toESM(require("@emotion/styled"), 1);
80
- var import_react_tooltip = require("react-tooltip");
81
80
 
82
81
  // src/styles/breakpoints.tsx
83
82
  var import_react = require("@emotion/react");
@@ -1283,32 +1282,6 @@ function hexToRGB(hex) {
1283
1282
  ] : [0, 0, 0];
1284
1283
  }
1285
1284
 
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
1285
  // src/styles/common.tsx
1313
1286
  var rootFontSizePx = 12;
1314
1287
  var rootFontSizeRems = rootFontSizePx / 16;
@@ -1355,9 +1328,6 @@ var Subtext = import_styled.default.div`
1355
1328
  var darkGradientBg = import_react4.css`
1356
1329
  background: ${darkGradient};
1357
1330
  `;
1358
- var StyledTooltip = (0, import_styled.default)(import_react_tooltip.Tooltip)`
1359
- z-index: ${z.modalOverlay};
1360
- `;
1361
1331
 
1362
1332
  // src/utils/strings.tsx
1363
1333
  function isString(str) {
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  Icon,
3
3
  IconContainer
4
- } from "../chunk-NZJCJJH5.js";
4
+ } from "../chunk-VHW2KROZ.js";
5
5
  import "../chunk-LAMQKQU3.js";
6
- import "../chunk-RFGKH3R6.js";
6
+ import "../chunk-HNVQIY5U.js";
7
7
  import "../chunk-2VBDEO6M.js";
8
8
  import "../chunk-E4EXM4SY.js";
9
9
  import "../chunk-JSGRNWSB.js";
10
- import "../chunk-CLU2FRJZ.js";
11
10
  import "../chunk-CIGAQ47A.js";
12
11
  export {
13
12
  Icon,