@xyo-network/react-share 7.0.0 → 7.0.1

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.
@@ -1,114 +1,114 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/button/ShareButton.tsx
5
- import { Facebook as FacebookIcon, Share as ShareIcon, X as XIcon } from "@mui/icons-material";
2
+ import {
3
+ Facebook as FacebookIcon,
4
+ Share as ShareIcon,
5
+ X as XIcon
6
+ } from "@mui/icons-material";
6
7
  import { Popover } from "@mui/material";
7
8
  import { ButtonEx } from "@xylabs/react-button";
8
9
  import { FlexRow } from "@xylabs/react-flexbox";
9
10
  import { LinkEx } from "@xylabs/react-link";
10
- import React, { useRef, useState } from "react";
11
- var ShareButton = /* @__PURE__ */ __name(({ prepared = true, shareLink, slot, ...props }) => {
11
+ import { useRef, useState } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var ShareButton = ({
14
+ prepared = true,
15
+ shareLink,
16
+ slot,
17
+ ...props
18
+ }) => {
12
19
  const [expanded, setExpanded] = useState(false);
13
20
  const anchorRef = useRef(null);
14
21
  const link = shareLink ?? globalThis.location.href;
15
- return /* @__PURE__ */ React.createElement(FlexRow, {
16
- gap: 1
17
- }, /* @__PURE__ */ React.createElement(ButtonEx, {
18
- variant: "text",
19
- minWidth: 32,
20
- size: "small",
21
- disabled: !prepared,
22
- onClick: /* @__PURE__ */ __name(() => {
23
- setExpanded(true);
24
- }, "onClick"),
25
- ...props
26
- }, /* @__PURE__ */ React.createElement(ShareIcon, {
27
- htmlColor: "gray",
28
- fontSize: "small",
29
- ref: anchorRef
30
- })), /* @__PURE__ */ React.createElement(Popover, {
31
- open: prepared ? expanded : false,
32
- anchorEl: anchorRef.current,
33
- anchorOrigin: {
34
- vertical: "top",
35
- horizontal: "right"
36
- },
37
- onClose: /* @__PURE__ */ __name(() => setExpanded(false), "onClose"),
38
- transitionDuration: 500,
39
- sx: {
40
- ml: 1,
41
- top: -4,
42
- ...slot?.popover?.sx
43
- },
44
- ...slot?.popover
45
- }, /* @__PURE__ */ React.createElement(FlexRow, {
46
- gap: 0.5,
47
- padding: 0.5
48
- }, /* @__PURE__ */ React.createElement(LinkEx, {
49
- lineHeight: 0,
50
- onClick: /* @__PURE__ */ __name(() => {
51
- window.open(`https://x.com/intent/tweet?url=${encodeURIComponent(link)}`);
52
- setExpanded(false);
53
- }, "onClick")
54
- }, /* @__PURE__ */ React.createElement(XIcon, {
55
- fontSize: "small"
56
- })), /* @__PURE__ */ React.createElement(LinkEx, {
57
- lineHeight: 0,
58
- style: {
59
- color: "#4267b2"
60
- },
61
- onClick: /* @__PURE__ */ __name(() => {
62
- window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
63
- setExpanded(false);
64
- }, "onClick")
65
- }, /* @__PURE__ */ React.createElement(FacebookIcon, {
66
- fontSize: "small"
67
- })))));
68
- }, "ShareButton");
22
+ return /* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
23
+ /* @__PURE__ */ jsx(
24
+ ButtonEx,
25
+ {
26
+ variant: "text",
27
+ minWidth: 32,
28
+ size: "small",
29
+ disabled: !prepared,
30
+ onClick: () => {
31
+ setExpanded(true);
32
+ },
33
+ ...props,
34
+ children: /* @__PURE__ */ jsx(ShareIcon, { htmlColor: "gray", fontSize: "small", ref: anchorRef })
35
+ }
36
+ ),
37
+ /* @__PURE__ */ jsx(
38
+ Popover,
39
+ {
40
+ open: prepared ? expanded : false,
41
+ anchorEl: anchorRef.current,
42
+ anchorOrigin: { vertical: "top", horizontal: "right" },
43
+ onClose: () => setExpanded(false),
44
+ transitionDuration: 500,
45
+ sx: {
46
+ ml: 1,
47
+ top: -4,
48
+ ...slot?.popover?.sx
49
+ },
50
+ ...slot?.popover,
51
+ children: /* @__PURE__ */ jsxs(FlexRow, { gap: 0.5, padding: 0.5, children: [
52
+ /* @__PURE__ */ jsx(
53
+ LinkEx,
54
+ {
55
+ lineHeight: 0,
56
+ onClick: () => {
57
+ window.open(`https://x.com/intent/tweet?url=${encodeURIComponent(link)}`);
58
+ setExpanded(false);
59
+ },
60
+ children: /* @__PURE__ */ jsx(XIcon, { fontSize: "small" })
61
+ }
62
+ ),
63
+ /* @__PURE__ */ jsx(
64
+ LinkEx,
65
+ {
66
+ lineHeight: 0,
67
+ style: { color: "#4267b2" },
68
+ onClick: () => {
69
+ window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
70
+ setExpanded(false);
71
+ },
72
+ children: /* @__PURE__ */ jsx(FacebookIcon, { fontSize: "small" })
73
+ }
74
+ )
75
+ ] })
76
+ }
77
+ )
78
+ ] });
79
+ };
69
80
 
70
81
  // src/icons/social/Facebook.tsx
71
82
  import { createSvgIcon } from "@mui/material";
72
- import React2 from "react";
73
- var FacebookSvgIcon = createSvgIcon(/* @__PURE__ */ React2.createElement("svg", {
74
- xmlns: "http://www.w3.org/2000/svg",
75
- height: "800",
76
- width: "1200",
77
- viewBox: "-204.79995 -341.33325 1774.9329 2047.9995"
78
- }, /* @__PURE__ */ React2.createElement("path", {
79
- d: "M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373",
80
- fill: "#1877f2"
81
- }), /* @__PURE__ */ React2.createElement("path", {
82
- d: "M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4",
83
- fill: "#fff"
84
- })), "Facebook");
83
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
84
+ var FacebookSvgIcon = createSvgIcon(
85
+ /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w3.org/2000/svg", height: "800", width: "1200", viewBox: "-204.79995 -341.33325 1774.9329 2047.9995", children: [
86
+ /* @__PURE__ */ jsx2("path", { d: "M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373", fill: "#1877f2" }),
87
+ /* @__PURE__ */ jsx2("path", { d: "M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4", fill: "#fff" })
88
+ ] }),
89
+ "Facebook"
90
+ );
85
91
 
86
92
  // src/icons/social/XTwitter.tsx
87
93
  import { createSvgIcon as createSvgIcon2 } from "@mui/material";
88
- import React3 from "react";
89
- var XTwitterSvgIcon = createSvgIcon2(/* @__PURE__ */ React3.createElement("svg", {
90
- viewBox: "0 0 1200 1227",
91
- fill: "none",
92
- xmlns: "http://www.w3.org/2000/svg"
93
- }, /* @__PURE__ */ React3.createElement("path", {
94
- d: "M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",
95
- fill: "white"
96
- })), "XTwitterSvgIcon");
94
+ import { jsx as jsx3 } from "react/jsx-runtime";
95
+ var XTwitterSvgIcon = createSvgIcon2(
96
+ /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 1200 1227", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx3("path", { d: "M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z", fill: "white" }) }),
97
+ "XTwitterSvgIcon"
98
+ );
97
99
 
98
100
  // src/meta-server/dynamic-share/DynamicShareImage.tsx
99
- import React4 from "react";
100
101
  import { Helmet } from "react-helmet";
101
- var DynamicShareImage = /* @__PURE__ */ __name(({ image }) => {
102
- return /* @__PURE__ */ React4.createElement(Helmet, null, /* @__PURE__ */ React4.createElement("meta", {
103
- property: "xyo:og:image",
104
- content: image
105
- }));
106
- }, "DynamicShareImage");
102
+ import { jsx as jsx4 } from "react/jsx-runtime";
103
+ var DynamicShareImage = ({ image }) => {
104
+ return /* @__PURE__ */ jsx4(Helmet, { children: /* @__PURE__ */ jsx4("meta", { property: "xyo:og:image", content: image }) });
105
+ };
107
106
 
108
107
  // src/meta-server/live-share/HideParentsFlexbox.tsx
109
108
  import { FlexGrowRow } from "@xylabs/react-flexbox";
110
- import React5, { useEffect } from "react";
111
- var HideParentsFlexbox = /* @__PURE__ */ __name(({ children, ...props }) => {
109
+ import { useEffect } from "react";
110
+ import { jsx as jsx5 } from "react/jsx-runtime";
111
+ var HideParentsFlexbox = ({ children, ...props }) => {
112
112
  useEffect(() => {
113
113
  const style = document.createElement("style");
114
114
  document.head.append(style);
@@ -135,30 +135,46 @@ var HideParentsFlexbox = /* @__PURE__ */ __name(({ children, ...props }) => {
135
135
  style.remove();
136
136
  };
137
137
  }, []);
138
- return /* @__PURE__ */ React5.createElement(FlexGrowRow, {
139
- alignItems: "stretch",
140
- id: "preview-area",
141
- justifyContent: "start",
142
- ...props
143
- }, children);
144
- }, "HideParentsFlexbox");
138
+ return /* @__PURE__ */ jsx5(FlexGrowRow, { alignItems: "stretch", id: "preview-area", justifyContent: "start", ...props, children });
139
+ };
145
140
 
146
141
  // src/out/CopyLinkStack.tsx
147
142
  import { Cancel } from "@mui/icons-material";
148
- import { Stack, Tooltip as Tooltip2, Typography as Typography2 } from "@mui/material";
149
- import React7, { useCallback, useMemo, useState as useState3 } from "react";
143
+ import {
144
+ Stack,
145
+ Tooltip as Tooltip2,
146
+ Typography as Typography2
147
+ } from "@mui/material";
148
+ import {
149
+ useCallback,
150
+ useMemo,
151
+ useState as useState3
152
+ } from "react";
150
153
 
151
154
  // src/out/CopyIconButton.tsx
152
155
  import { CopyAllRounded } from "@mui/icons-material";
153
- import { CircularProgress, IconButton, Tooltip } from "@mui/material";
156
+ import {
157
+ CircularProgress,
158
+ IconButton,
159
+ Tooltip
160
+ } from "@mui/material";
154
161
  import { forget } from "@xylabs/forget";
155
- import React6, { useState as useState2 } from "react";
156
- var CopyIconButton = /* @__PURE__ */ __name(({ copyLinkText, copiedLinkText, onClickError, shareLinkName, shareUrl, uploadPayloads, ...props }) => {
162
+ import { useState as useState2 } from "react";
163
+ import { jsx as jsx6 } from "react/jsx-runtime";
164
+ var CopyIconButton = ({
165
+ copyLinkText,
166
+ copiedLinkText,
167
+ onClickError,
168
+ shareLinkName,
169
+ shareUrl,
170
+ uploadPayloads,
171
+ ...props
172
+ }) => {
157
173
  const CopyLink = copyLinkText ?? "Copy Link";
158
174
  const Copied = copiedLinkText ?? "Copied!";
159
175
  const [copyTooltipTitle, setCopyToolTipTitle] = useState2(CopyLink);
160
176
  const [loading, setLoading] = useState2(false);
161
- const copyToClipboard = /* @__PURE__ */ __name(async (link) => {
177
+ const copyToClipboard = async (link) => {
162
178
  if (link) {
163
179
  try {
164
180
  setLoading(true);
@@ -176,21 +192,16 @@ var CopyIconButton = /* @__PURE__ */ __name(({ copyLinkText, copiedLinkText, onC
176
192
  } else {
177
193
  console.warn("tried to copy shareUrl before it was generated");
178
194
  }
179
- }, "copyToClipboard");
180
- return /* @__PURE__ */ React6.createElement(Tooltip, {
181
- title: copyTooltipTitle
182
- }, loading ? /* @__PURE__ */ React6.createElement(IconButton, null, /* @__PURE__ */ React6.createElement(CircularProgress, {
183
- size: "24px"
184
- })) : /* @__PURE__ */ React6.createElement(IconButton, {
185
- "aria-label": `copy ${shareLinkName} link`,
186
- onClick: /* @__PURE__ */ __name(() => forget(copyToClipboard(shareUrl)), "onClick"),
187
- edge: "end",
188
- ...props
189
- }, /* @__PURE__ */ React6.createElement(CopyAllRounded, null)));
190
- }, "CopyIconButton");
195
+ };
196
+ return /* @__PURE__ */ jsx6(Tooltip, { title: copyTooltipTitle, children: loading ? /* @__PURE__ */ jsx6(IconButton, { children: /* @__PURE__ */ jsx6(CircularProgress, { size: "24px" }) }) : /* @__PURE__ */ jsx6(IconButton, { "aria-label": `copy ${shareLinkName} link`, onClick: () => forget(copyToClipboard(shareUrl)), edge: "end", ...props, children: /* @__PURE__ */ jsx6(CopyAllRounded, {}) }) });
197
+ };
191
198
 
192
199
  // src/out/lib/AnimatedGradientTypography.tsx
193
- import { keyframes, styled, Typography } from "@mui/material";
200
+ import {
201
+ keyframes,
202
+ styled,
203
+ Typography
204
+ } from "@mui/material";
194
205
  var moveBg = keyframes(`
195
206
  0% {
196
207
  background-position: 100% 0%;
@@ -199,9 +210,11 @@ var moveBg = keyframes(`
199
210
  background-position: 0% 0%;
200
211
  }
201
212
  `);
202
- var AnimatedGradientTypography = styled(Typography, {
203
- name: "AnimatedGradientTypography"
204
- })(({ theme, color1, color2 }) => {
213
+ var AnimatedGradientTypography = styled(Typography, { name: "AnimatedGradientTypography" })(({
214
+ theme,
215
+ color1,
216
+ color2
217
+ }) => {
205
218
  return {
206
219
  // Set the color variables for the gradient
207
220
  "--color-one": color1 ?? theme.vars.palette.secondary.dark,
@@ -236,7 +249,7 @@ var AnimatedGradientTypography = styled(Typography, {
236
249
  });
237
250
 
238
251
  // src/out/lib/splitAroundSubstring.ts
239
- var splitAroundSubstring = /* @__PURE__ */ __name((path, substring) => {
252
+ var splitAroundSubstring = (path, substring) => {
240
253
  const index = path.indexOf(substring);
241
254
  if (index === -1) {
242
255
  throw new Error(`XNS name "${substring}" not found in path.`);
@@ -244,15 +257,23 @@ var splitAroundSubstring = /* @__PURE__ */ __name((path, substring) => {
244
257
  const part1 = path.slice(0, index);
245
258
  const part2 = substring;
246
259
  const part3 = path.slice(index + substring.length);
247
- return [
248
- part1,
249
- part2,
250
- part3
251
- ];
252
- }, "splitAroundSubstring");
260
+ return [part1, part2, part3];
261
+ };
253
262
 
254
263
  // src/out/CopyLinkStack.tsx
255
- var CopyLinkStack = /* @__PURE__ */ __name(({ addToXnsName, copiedLinkText, copyLinkText, shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, uploadPayloads, xnsStartColor, ...props }) => {
264
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
265
+ var CopyLinkStack = ({
266
+ addToXnsName,
267
+ copiedLinkText,
268
+ copyLinkText,
269
+ shareLinkName,
270
+ shareUrl,
271
+ xnsName: xnsNameProp,
272
+ xnsEndColor,
273
+ uploadPayloads,
274
+ xnsStartColor,
275
+ ...props
276
+ }) => {
256
277
  const [error, setError] = useState3();
257
278
  const onClickError = useCallback((error2) => {
258
279
  setError(error2);
@@ -268,162 +289,160 @@ var CopyLinkStack = /* @__PURE__ */ __name(({ addToXnsName, copiedLinkText, copy
268
289
  }
269
290
  }, []);
270
291
  const [part1, xnsName, part3] = parsedXnsName || [];
271
- return /* @__PURE__ */ React7.createElement(Stack, {
272
- direction: "row",
273
- alignItems: "center",
274
- gap: 0.25,
275
- ...props
276
- }, xnsName && addToXnsName ? /* @__PURE__ */ React7.createElement(Stack, {
277
- direction: "row",
278
- maxWidth: "100%",
279
- sx: {
280
- overflowX: "auto"
281
- }
282
- }, /* @__PURE__ */ React7.createElement(Typography2, {
283
- sx: {
284
- display: "inline-flex"
285
- }
286
- }, part1), /* @__PURE__ */ React7.createElement(AnimatedGradientTypography, {
287
- color1: xnsStartColor,
288
- color2: xnsEndColor,
289
- sx: {
290
- display: "inline-flex"
291
- }
292
- }, xnsName), /* @__PURE__ */ React7.createElement(Typography2, {
293
- sx: {
294
- display: "inline-flex"
295
- }
296
- }, part3)) : /* @__PURE__ */ React7.createElement(Typography2, {
297
- sx: {
298
- display: "inline-flex",
299
- maxWidth: "100%",
300
- overflow: "auto"
301
- }
302
- }, shareUrl), /* @__PURE__ */ React7.createElement(CopyIconButton, {
303
- copiedLinkText,
304
- copyLinkText,
305
- onClickError,
306
- shareLinkName,
307
- shareUrl,
308
- sx: {
309
- display: "inline-flex"
310
- },
311
- uploadPayloads
312
- }), error ? /* @__PURE__ */ React7.createElement(Tooltip2, {
313
- title: error.message
314
- }, /* @__PURE__ */ React7.createElement(Cancel, {
315
- color: "error",
316
- sx: {
317
- display: "inline-flex"
318
- }
319
- })) : null);
320
- }, "CopyLinkStack");
292
+ return /* @__PURE__ */ jsxs3(Stack, { direction: "row", alignItems: "center", gap: 0.25, ...props, children: [
293
+ xnsName && addToXnsName ? /* @__PURE__ */ jsxs3(Stack, { direction: "row", maxWidth: "100%", sx: { overflowX: "auto" }, children: [
294
+ /* @__PURE__ */ jsx7(Typography2, { sx: { display: "inline-flex" }, children: part1 }),
295
+ /* @__PURE__ */ jsx7(AnimatedGradientTypography, { color1: xnsStartColor, color2: xnsEndColor, sx: { display: "inline-flex" }, children: xnsName }),
296
+ /* @__PURE__ */ jsx7(Typography2, { sx: { display: "inline-flex" }, children: part3 })
297
+ ] }) : /* @__PURE__ */ jsx7(
298
+ Typography2,
299
+ {
300
+ sx: {
301
+ display: "inline-flex",
302
+ maxWidth: "100%",
303
+ overflow: "auto"
304
+ },
305
+ children: shareUrl
306
+ }
307
+ ),
308
+ /* @__PURE__ */ jsx7(
309
+ CopyIconButton,
310
+ {
311
+ copiedLinkText,
312
+ copyLinkText,
313
+ onClickError,
314
+ shareLinkName,
315
+ shareUrl,
316
+ sx: { display: "inline-flex" },
317
+ uploadPayloads
318
+ }
319
+ ),
320
+ error ? /* @__PURE__ */ jsx7(Tooltip2, { title: error.message, children: /* @__PURE__ */ jsx7(Cancel, { color: "error", sx: { display: "inline-flex" } }) }) : null
321
+ ] });
322
+ };
321
323
 
322
324
  // src/out/CopyLinkTextField.tsx
323
325
  import { InputAdornment, TextField } from "@mui/material";
324
- import React8, { useCallback as useCallback2, useState as useState4 } from "react";
325
- var CopyLinkTextField = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, ...props }) => {
326
+ import { useCallback as useCallback2, useState as useState4 } from "react";
327
+ import { jsx as jsx8 } from "react/jsx-runtime";
328
+ var CopyLinkTextField = ({
329
+ shareLinkName,
330
+ shareUrl,
331
+ ...props
332
+ }) => {
326
333
  const [error, setError] = useState4();
327
334
  const onClickError = useCallback2((error2) => {
328
335
  setError(error2);
329
336
  }, []);
330
- return /* @__PURE__ */ React8.createElement(TextField, {
331
- disabled: true,
332
- error: !!error,
333
- helperText: error?.message,
334
- // to override the color that appears when it's a text field, only on dark mode
335
- sx: {
336
- input: {
337
- WebkitTextFillColor: "lightgray !important"
338
- }
339
- },
340
- value: shareUrl,
341
- ...props,
342
- slotProps: {
343
- input: {
344
- endAdornment: /* @__PURE__ */ React8.createElement(InputAdornment, {
345
- position: "end"
346
- }, /* @__PURE__ */ React8.createElement(CopyIconButton, {
347
- shareLinkName,
348
- shareUrl,
349
- onClickError
350
- }))
337
+ return /* @__PURE__ */ jsx8(
338
+ TextField,
339
+ {
340
+ disabled: true,
341
+ error: !!error,
342
+ helperText: error?.message,
343
+ sx: { input: { WebkitTextFillColor: "lightgray !important" } },
344
+ value: shareUrl,
345
+ ...props,
346
+ slotProps: {
347
+ input: {
348
+ endAdornment: /* @__PURE__ */ jsx8(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx8(CopyIconButton, { shareLinkName, shareUrl, onClickError }) })
349
+ }
351
350
  }
352
351
  }
353
- });
354
- }, "CopyLinkTextField");
352
+ );
353
+ };
355
354
 
356
355
  // src/out/Dialog.tsx
357
- import { Dialog, DialogActions, DialogContent, DialogTitle, Stack as Stack2, Typography as Typography3 } from "@mui/material";
356
+ import {
357
+ Dialog,
358
+ DialogActions,
359
+ DialogContent,
360
+ DialogTitle,
361
+ Stack as Stack2,
362
+ Typography as Typography3
363
+ } from "@mui/material";
358
364
  import { FlexCol, FlexGrowCol } from "@xylabs/react-flexbox";
359
- import React9 from "react";
360
- var ShareOutDialog = /* @__PURE__ */ __name(({ ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props }) => {
361
- const handleClose = /* @__PURE__ */ __name(() => {
365
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
366
+ var ShareOutDialog = ({
367
+ ShareOutDialogActions,
368
+ cardImg,
369
+ open,
370
+ onClose,
371
+ shareOutDialogContent,
372
+ subtitle,
373
+ title,
374
+ ...props
375
+ }) => {
376
+ const handleClose = () => {
362
377
  onClose?.("", "backdropClick");
363
- }, "handleClose");
364
- return /* @__PURE__ */ React9.createElement(Dialog, {
365
- onClose,
366
- open,
367
- ...props
368
- }, /* @__PURE__ */ React9.createElement(DialogTitle, null, /* @__PURE__ */ React9.createElement(Stack2, {
369
- direction: "row",
370
- spacing: 2
371
- }, /* @__PURE__ */ React9.createElement(FlexGrowCol, {
372
- alignItems: "flex-start",
373
- width: "60%"
374
- }, /* @__PURE__ */ React9.createElement(Typography3, {
375
- variant: "h5"
376
- }, title), /* @__PURE__ */ React9.createElement(Typography3, {
377
- variant: "body1"
378
- }, " ", subtitle)), /* @__PURE__ */ React9.createElement(FlexGrowCol, {
379
- alignItems: "flex-end",
380
- width: "40%"
381
- }, cardImg))), /* @__PURE__ */ React9.createElement(DialogContent, null, shareOutDialogContent, /* @__PURE__ */ React9.createElement(FlexCol, {
382
- alignItems: "stretch"
383
- })), ShareOutDialogActions ? /* @__PURE__ */ React9.createElement(DialogActions, null, /* @__PURE__ */ React9.createElement(ShareOutDialogActions, {
384
- onClose: handleClose
385
- })) : null);
386
- }, "ShareOutDialog");
378
+ };
379
+ return /* @__PURE__ */ jsxs4(Dialog, { onClose, open, ...props, children: [
380
+ /* @__PURE__ */ jsx9(DialogTitle, { children: /* @__PURE__ */ jsxs4(Stack2, { direction: "row", spacing: 2, children: [
381
+ /* @__PURE__ */ jsxs4(FlexGrowCol, { alignItems: "flex-start", width: "60%", children: [
382
+ /* @__PURE__ */ jsx9(Typography3, { variant: "h5", children: title }),
383
+ /* @__PURE__ */ jsxs4(Typography3, { variant: "body1", children: [
384
+ " ",
385
+ subtitle
386
+ ] })
387
+ ] }),
388
+ /* @__PURE__ */ jsx9(FlexGrowCol, { alignItems: "flex-end", width: "40%", children: cardImg })
389
+ ] }) }),
390
+ /* @__PURE__ */ jsxs4(DialogContent, { children: [
391
+ shareOutDialogContent,
392
+ /* @__PURE__ */ jsx9(FlexCol, { alignItems: "stretch" })
393
+ ] }),
394
+ ShareOutDialogActions ? /* @__PURE__ */ jsx9(DialogActions, { children: /* @__PURE__ */ jsx9(ShareOutDialogActions, { onClose: handleClose }) }) : null
395
+ ] });
396
+ };
387
397
 
388
398
  // src/out/Explanation.tsx
389
399
  import { InfoOutlined } from "@mui/icons-material";
390
- import { Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
400
+ import {
401
+ Tooltip as Tooltip3,
402
+ Typography as Typography4,
403
+ useTheme
404
+ } from "@mui/material";
391
405
  import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
392
- import React10 from "react";
393
- var ShareOutExplanation = /* @__PURE__ */ __name(({ toolTipTitle }) => {
406
+ import { Fragment, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
407
+ var ShareOutExplanation = ({ toolTipTitle }) => {
394
408
  const theme = useTheme();
395
409
  const title = toolTipTitle ?? "In order for your data to be publicly viewable, it needs to be saved to the XYO Network Public Archivist. Public data can be seen by your friends, and XYO can generate preview images for easier sharing on social media.";
396
- return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(FlexGrowRow2, {
397
- alignItems: "center"
398
- }, /* @__PURE__ */ React10.createElement(Typography4, {
399
- variant: "body2",
400
- paddingRight: 0.5
401
- }, "What am I sharing?"), /* @__PURE__ */ React10.createElement(Tooltip3, {
402
- title,
403
- placement: "bottom"
404
- }, /* @__PURE__ */ React10.createElement(InfoOutlined, {
405
- fontSize: "small",
406
- sx: {
407
- fontSize: theme.typography.caption.fontSize
408
- }
409
- }))));
410
- }, "ShareOutExplanation");
410
+ return /* @__PURE__ */ jsx10(Fragment, { children: /* @__PURE__ */ jsxs5(FlexGrowRow2, { alignItems: "center", children: [
411
+ /* @__PURE__ */ jsx10(Typography4, { variant: "body2", paddingRight: 0.5, children: "What am I sharing?" }),
412
+ /* @__PURE__ */ jsx10(
413
+ Tooltip3,
414
+ {
415
+ title,
416
+ placement: "bottom",
417
+ children: /* @__PURE__ */ jsx10(InfoOutlined, { fontSize: "small", sx: { fontSize: theme.typography.caption.fontSize } })
418
+ }
419
+ )
420
+ ] }) });
421
+ };
411
422
 
412
423
  // src/out/GenerateShareLinkButton.tsx
413
- import { Button, CircularProgress as CircularProgress2, styled as styled2 } from "@mui/material";
414
- import React11 from "react";
415
- var GenerateShareLinkButton = /* @__PURE__ */ __name(({ children = "Generate My Share Link", loading, ...props }) => {
416
- return /* @__PURE__ */ React11.createElement(Button, {
417
- variant: "contained",
418
- startIcon: loading ? /* @__PURE__ */ React11.createElement(StyledCircularProgress, {
419
- size: "small"
420
- }) : null,
421
- ...props
422
- }, children);
423
- }, "GenerateShareLinkButton");
424
- var StyledCircularProgress = styled2(CircularProgress2, {
425
- name: "StyledCircularProgress"
426
- })(({ theme }) => ({
424
+ import {
425
+ Button,
426
+ CircularProgress as CircularProgress2,
427
+ styled as styled2
428
+ } from "@mui/material";
429
+ import { jsx as jsx11 } from "react/jsx-runtime";
430
+ var GenerateShareLinkButton = ({
431
+ children = "Generate My Share Link",
432
+ loading,
433
+ ...props
434
+ }) => {
435
+ return /* @__PURE__ */ jsx11(
436
+ Button,
437
+ {
438
+ variant: "contained",
439
+ startIcon: loading ? /* @__PURE__ */ jsx11(StyledCircularProgress, { size: "small" }) : null,
440
+ ...props,
441
+ children
442
+ }
443
+ );
444
+ };
445
+ var StyledCircularProgress = styled2(CircularProgress2, { name: "StyledCircularProgress" })(({ theme }) => ({
427
446
  // ensure the color of the spinner is the same as the button color
428
447
  color: theme.vars.palette.primary.contrastText,
429
448
  height: "20px",
@@ -434,32 +453,37 @@ var StyledCircularProgress = styled2(CircularProgress2, {
434
453
  // src/out/HeadingFlexbox.tsx
435
454
  import { Typography as Typography5 } from "@mui/material";
436
455
  import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
437
- import React12 from "react";
438
- var ShareOutHeadingFlexbox = /* @__PURE__ */ __name(({ children, shareLinkName, shareUrl, ...props }) => {
456
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
457
+ var ShareOutHeadingFlexbox = ({
458
+ children,
459
+ shareLinkName,
460
+ shareUrl,
461
+ ...props
462
+ }) => {
439
463
  const GenerateShareLinkExplanation = "When you generate your share link, we'll make a small amount of your data public so friends can check it out!";
440
- return /* @__PURE__ */ React12.createElement(FlexGrowCol2, {
441
- alignItems: "flex-start",
442
- paddingBottom: 1,
443
- ...props
444
- }, /* @__PURE__ */ React12.createElement(Typography5, {
445
- variant: "body1",
446
- gutterBottom: true
447
- }, /* @__PURE__ */ React12.createElement("strong", null, "Your Share Link")), /* @__PURE__ */ React12.createElement(Typography5, {
448
- variant: "body1"
449
- }, shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation), children);
450
- }, "ShareOutHeadingFlexbox");
464
+ return /* @__PURE__ */ jsxs6(FlexGrowCol2, { alignItems: "flex-start", paddingBottom: 1, ...props, children: [
465
+ /* @__PURE__ */ jsx12(Typography5, { variant: "body1", gutterBottom: true, children: /* @__PURE__ */ jsx12("strong", { children: "Your Share Link" }) }),
466
+ /* @__PURE__ */ jsx12(Typography5, { variant: "body1", children: shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation }),
467
+ children
468
+ ] });
469
+ };
451
470
 
452
471
  // src/out/SocialButtonsFlexbox.tsx
453
472
  import { Typography as Typography6 } from "@mui/material";
454
473
  import { ButtonEx as ButtonEx2 } from "@xylabs/react-button";
455
474
  import { ErrorRender } from "@xylabs/react-error";
456
475
  import { FlexGrowCol as FlexGrowCol3, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
457
- import React13, { useState as useState5 } from "react";
458
- var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, uploadPayloads, ...props }) => {
476
+ import { useState as useState5 } from "react";
477
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
478
+ var SocialButtonsFlexbox = ({
479
+ shareUrl,
480
+ uploadPayloads,
481
+ ...props
482
+ }) => {
459
483
  const [error, setError] = useState5();
460
484
  const [xLoading, setXLoading] = useState5(false);
461
485
  const [fbLoading, setFbLoading] = useState5(false);
462
- const handleClick = /* @__PURE__ */ __name(async (openUrl, buttonName) => {
486
+ const handleClick = async (openUrl, buttonName) => {
463
487
  const setLoading = buttonName === "x" ? setXLoading : setFbLoading;
464
488
  try {
465
489
  setLoading(true);
@@ -471,53 +495,49 @@ var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, uploadPayloads, .
471
495
  console.error("Error uploading payloads", e);
472
496
  setError(e);
473
497
  }
474
- }, "handleClick");
475
- return /* @__PURE__ */ React13.createElement(FlexGrowCol3, {
476
- alignItems: "stretch",
477
- paddingTop: 2,
478
- ...props
479
- }, /* @__PURE__ */ React13.createElement(Typography6, {
480
- variant: "body1",
481
- gutterBottom: true
482
- }, /* @__PURE__ */ React13.createElement("strong", null, "Share on Social Media")), /* @__PURE__ */ React13.createElement(FlexRow2, {
483
- gap: 0.5,
484
- sx: {
485
- flexDirection: {
486
- md: "row",
487
- xs: "column"
498
+ };
499
+ return /* @__PURE__ */ jsxs7(FlexGrowCol3, { alignItems: "stretch", paddingTop: 2, ...props, children: [
500
+ /* @__PURE__ */ jsx13(Typography6, { variant: "body1", gutterBottom: true, children: /* @__PURE__ */ jsx13("strong", { children: "Share on Social Media" }) }),
501
+ /* @__PURE__ */ jsx13(
502
+ FlexRow2,
503
+ {
504
+ gap: 0.5,
505
+ sx: { flexDirection: { md: "row", xs: "column" } },
506
+ children: shareUrl ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
507
+ /* @__PURE__ */ jsx13(
508
+ ButtonEx2,
509
+ {
510
+ variant: "contained",
511
+ style: { backgroundColor: "#000", color: "#fff" },
512
+ busy: xLoading,
513
+ onClick: async () => {
514
+ const openUrl = () => window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`);
515
+ await handleClick(openUrl, "x");
516
+ },
517
+ startIcon: /* @__PURE__ */ jsx13(XTwitterSvgIcon, { width: "20px" }),
518
+ children: "Share on X (Twitter)"
519
+ }
520
+ ),
521
+ /* @__PURE__ */ jsx13(
522
+ ButtonEx2,
523
+ {
524
+ busy: fbLoading,
525
+ variant: "contained",
526
+ style: { backgroundColor: "#4267b2", color: "#fff" },
527
+ onClick: async () => {
528
+ const openUrl = () => window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`);
529
+ await handleClick(openUrl, "fb");
530
+ },
531
+ startIcon: /* @__PURE__ */ jsx13(FacebookSvgIcon, {}),
532
+ children: "Share on Facebook"
533
+ }
534
+ )
535
+ ] }) : null
488
536
  }
489
- }
490
- }, shareUrl ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(ButtonEx2, {
491
- variant: "contained",
492
- style: {
493
- backgroundColor: "#000",
494
- color: "#fff"
495
- },
496
- busy: xLoading,
497
- onClick: /* @__PURE__ */ __name(async () => {
498
- const openUrl = /* @__PURE__ */ __name(() => window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`), "openUrl");
499
- await handleClick(openUrl, "x");
500
- }, "onClick"),
501
- startIcon: /* @__PURE__ */ React13.createElement(XTwitterSvgIcon, {
502
- width: "20px"
503
- })
504
- }, "Share on X (Twitter)"), /* @__PURE__ */ React13.createElement(ButtonEx2, {
505
- busy: fbLoading,
506
- variant: "contained",
507
- style: {
508
- backgroundColor: "#4267b2",
509
- color: "#fff"
510
- },
511
- onClick: /* @__PURE__ */ __name(async () => {
512
- const openUrl = /* @__PURE__ */ __name(() => window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`), "openUrl");
513
- await handleClick(openUrl, "fb");
514
- }, "onClick"),
515
- startIcon: /* @__PURE__ */ React13.createElement(FacebookSvgIcon, null)
516
- }, "Share on Facebook")) : null), /* @__PURE__ */ React13.createElement(ErrorRender, {
517
- error,
518
- scope: "SocialButtonsFlexbox"
519
- }));
520
- }, "SocialButtonsFlexbox");
537
+ ),
538
+ /* @__PURE__ */ jsx13(ErrorRender, { error, scope: "SocialButtonsFlexbox" })
539
+ ] });
540
+ };
521
541
  export {
522
542
  CopyLinkStack,
523
543
  CopyLinkTextField,