@xyo-network/react-share 3.0.4 → 3.0.6
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.
- package/dist/browser/index.mjs +100 -95
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/out/CopyLinkStack.d.ts +9 -0
- package/dist/browser/out/CopyLinkStack.d.ts.map +1 -0
- package/dist/browser/out/index.d.ts +1 -1
- package/dist/browser/out/index.d.ts.map +1 -1
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts +4 -1
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/out/CopyLinkStack.stories.tsx +41 -0
- package/src/out/{CopyLinkTypography.tsx → CopyLinkStack.tsx} +20 -10
- package/src/out/index.ts +1 -1
- package/src/out/lib/AnimatedGradientTypography.tsx +35 -31
- package/dist/browser/out/CopyLinkTypography.d.ts +0 -7
- package/dist/browser/out/CopyLinkTypography.d.ts.map +0 -1
- package/src/out/CopyLinkTypography.stories.tsx +0 -30
package/dist/browser/index.mjs
CHANGED
|
@@ -136,9 +136,10 @@ var HideParentsFlexbox = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
|
136
136
|
}, children);
|
|
137
137
|
}, "HideParentsFlexbox");
|
|
138
138
|
|
|
139
|
-
// src/out/
|
|
140
|
-
import {
|
|
141
|
-
import
|
|
139
|
+
// src/out/CopyLinkStack.tsx
|
|
140
|
+
import { Cancel } from "@mui/icons-material";
|
|
141
|
+
import { Stack, Tooltip as Tooltip2, Typography as Typography2 } from "@mui/material";
|
|
142
|
+
import React7, { useCallback, useMemo, useState as useState3 } from "react";
|
|
142
143
|
|
|
143
144
|
// src/out/CopyIconButton.tsx
|
|
144
145
|
import { CopyAllRounded } from "@mui/icons-material";
|
|
@@ -175,41 +176,6 @@ var CopyIconButton = /* @__PURE__ */ __name(({ onCopyToClipboard, shareLinkName,
|
|
|
175
176
|
}, /* @__PURE__ */ React6.createElement(CopyAllRounded, null)));
|
|
176
177
|
}, "CopyIconButton");
|
|
177
178
|
|
|
178
|
-
// src/out/CopyLinkTextField.tsx
|
|
179
|
-
var CopyLinkTextField = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, ...props }) => {
|
|
180
|
-
const [error, setError] = useState3();
|
|
181
|
-
const onCopyToClipboard = useCallback((error2) => {
|
|
182
|
-
setError(error2);
|
|
183
|
-
}, []);
|
|
184
|
-
return /* @__PURE__ */ React7.createElement(TextField, {
|
|
185
|
-
disabled: true,
|
|
186
|
-
error: !!error,
|
|
187
|
-
helperText: error?.message,
|
|
188
|
-
// to override the color that appears when it's a text field, only on dark mode
|
|
189
|
-
sx: {
|
|
190
|
-
input: {
|
|
191
|
-
WebkitTextFillColor: "lightgray !important"
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
InputProps: {
|
|
195
|
-
endAdornment: /* @__PURE__ */ React7.createElement(InputAdornment, {
|
|
196
|
-
position: "end"
|
|
197
|
-
}, /* @__PURE__ */ React7.createElement(CopyIconButton, {
|
|
198
|
-
shareLinkName,
|
|
199
|
-
shareUrl,
|
|
200
|
-
onCopyToClipboard
|
|
201
|
-
}))
|
|
202
|
-
},
|
|
203
|
-
value: shareUrl,
|
|
204
|
-
...props
|
|
205
|
-
});
|
|
206
|
-
}, "CopyLinkTextField");
|
|
207
|
-
|
|
208
|
-
// src/out/CopyLinkTypography.tsx
|
|
209
|
-
import { Cancel } from "@mui/icons-material";
|
|
210
|
-
import { Stack, Tooltip as Tooltip2, Typography as Typography2 } from "@mui/material";
|
|
211
|
-
import React8, { useCallback as useCallback2, useMemo, useState as useState4 } from "react";
|
|
212
|
-
|
|
213
179
|
// src/out/lib/AnimatedGradientTypography.tsx
|
|
214
180
|
import { keyframes, styled, Typography } from "@mui/material";
|
|
215
181
|
var moveBg = keyframes(`
|
|
@@ -222,37 +188,39 @@ var moveBg = keyframes(`
|
|
|
222
188
|
`);
|
|
223
189
|
var AnimatedGradientTypography = styled(Typography, {
|
|
224
190
|
name: "AnimatedGradientTypography"
|
|
225
|
-
})(({ theme }) =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
191
|
+
})(({ theme, color1, color2 }) => {
|
|
192
|
+
return {
|
|
193
|
+
// Set the color variables for the gradient
|
|
194
|
+
"--color-one": color1 ?? theme.palette.secondary.dark,
|
|
195
|
+
"--color-two": color2 ?? theme.palette.primary.light,
|
|
196
|
+
// set the gradient so it has the same start and end color for looping effect
|
|
197
|
+
"background": `linear-gradient(
|
|
198
|
+
.25turn,
|
|
199
|
+
var(--color-one),
|
|
200
|
+
var(--color-two),
|
|
201
|
+
var(--color-one)
|
|
202
|
+
)`,
|
|
203
|
+
// Set the text color to transparent so the gradient shows through
|
|
204
|
+
"color": "transparent",
|
|
205
|
+
// Clip the background to the text shape
|
|
206
|
+
"backgroundClip": "text",
|
|
207
|
+
// Set the background size to 800% so we don't see the third color initially creating the looping effect
|
|
208
|
+
"backgroundSize": "800%",
|
|
209
|
+
// Set the text to bold so the gradient is more visible
|
|
210
|
+
"fontWeight": "bold",
|
|
211
|
+
// Set the animation
|
|
212
|
+
"@media (prefers-reduced-motion: no-preference)": {
|
|
213
|
+
animationName: moveBg,
|
|
214
|
+
animationDuration: "2s",
|
|
215
|
+
animationIterationCount: "infinite"
|
|
216
|
+
},
|
|
217
|
+
// reset for users that prefer reduced motion
|
|
218
|
+
"@media (prefers-reduced-motion)": {
|
|
219
|
+
background: "none",
|
|
220
|
+
color: theme.palette.text.primary
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
});
|
|
256
224
|
|
|
257
225
|
// src/out/lib/splitAroundSubstring.ts
|
|
258
226
|
var splitAroundSubstring = /* @__PURE__ */ __name((path, substring) => {
|
|
@@ -270,10 +238,10 @@ var splitAroundSubstring = /* @__PURE__ */ __name((path, substring) => {
|
|
|
270
238
|
];
|
|
271
239
|
}, "splitAroundSubstring");
|
|
272
240
|
|
|
273
|
-
// src/out/
|
|
274
|
-
var
|
|
275
|
-
const [error, setError] =
|
|
276
|
-
const onCopyToClipboard =
|
|
241
|
+
// src/out/CopyLinkStack.tsx
|
|
242
|
+
var CopyLinkStack = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, xnsStartColor, ...props }) => {
|
|
243
|
+
const [error, setError] = useState3();
|
|
244
|
+
const onCopyToClipboard = useCallback((error2) => {
|
|
277
245
|
setError(error2);
|
|
278
246
|
}, []);
|
|
279
247
|
const parsedXnsName = useMemo(() => {
|
|
@@ -287,48 +255,85 @@ var CopyLinkTypography = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, xnsN
|
|
|
287
255
|
}
|
|
288
256
|
}, []);
|
|
289
257
|
const [part1, xnsName, part3] = parsedXnsName || [];
|
|
290
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ React7.createElement(Stack, {
|
|
291
259
|
direction: "row",
|
|
292
260
|
alignItems: "center",
|
|
293
|
-
gap: 0.25
|
|
294
|
-
}, xnsName ? /* @__PURE__ */ React8.createElement(Stack, {
|
|
295
|
-
direction: "row"
|
|
296
|
-
}, /* @__PURE__ */ React8.createElement(Typography2, {
|
|
297
|
-
sx: {
|
|
298
|
-
display: "inline-flex"
|
|
299
|
-
},
|
|
261
|
+
gap: 0.25,
|
|
300
262
|
...props
|
|
301
|
-
},
|
|
263
|
+
}, xnsName ? /* @__PURE__ */ React7.createElement(Stack, {
|
|
264
|
+
direction: "row",
|
|
265
|
+
maxWidth: "100%",
|
|
266
|
+
sx: {
|
|
267
|
+
overflowX: "auto"
|
|
268
|
+
}
|
|
269
|
+
}, /* @__PURE__ */ React7.createElement(Typography2, {
|
|
302
270
|
sx: {
|
|
303
271
|
display: "inline-flex"
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
272
|
+
}
|
|
273
|
+
}, part1), /* @__PURE__ */ React7.createElement(AnimatedGradientTypography, {
|
|
274
|
+
color1: xnsStartColor,
|
|
275
|
+
color2: xnsEndColor,
|
|
307
276
|
sx: {
|
|
308
277
|
display: "inline-flex"
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
}, part3)) : /* @__PURE__ */ React8.createElement(Typography2, {
|
|
278
|
+
}
|
|
279
|
+
}, xnsName), /* @__PURE__ */ React7.createElement(Typography2, {
|
|
312
280
|
sx: {
|
|
313
281
|
display: "inline-flex"
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
282
|
+
}
|
|
283
|
+
}, part3)) : /* @__PURE__ */ React7.createElement(Typography2, {
|
|
284
|
+
sx: {
|
|
285
|
+
display: "inline-flex",
|
|
286
|
+
maxWidth: "100%",
|
|
287
|
+
overflow: "auto"
|
|
288
|
+
}
|
|
289
|
+
}, shareUrl), /* @__PURE__ */ React7.createElement(CopyIconButton, {
|
|
317
290
|
onCopyToClipboard,
|
|
318
291
|
shareLinkName,
|
|
319
292
|
shareUrl,
|
|
320
293
|
sx: {
|
|
321
294
|
display: "inline-flex"
|
|
322
295
|
}
|
|
323
|
-
}), error ? /* @__PURE__ */
|
|
296
|
+
}), error ? /* @__PURE__ */ React7.createElement(Tooltip2, {
|
|
324
297
|
title: error.message
|
|
325
|
-
}, /* @__PURE__ */
|
|
298
|
+
}, /* @__PURE__ */ React7.createElement(Cancel, {
|
|
326
299
|
color: "error",
|
|
327
300
|
sx: {
|
|
328
301
|
display: "inline-flex"
|
|
329
302
|
}
|
|
330
303
|
})) : null);
|
|
331
|
-
}, "
|
|
304
|
+
}, "CopyLinkStack");
|
|
305
|
+
|
|
306
|
+
// src/out/CopyLinkTextField.tsx
|
|
307
|
+
import { InputAdornment, TextField } from "@mui/material";
|
|
308
|
+
import React8, { useCallback as useCallback2, useState as useState4 } from "react";
|
|
309
|
+
var CopyLinkTextField = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, ...props }) => {
|
|
310
|
+
const [error, setError] = useState4();
|
|
311
|
+
const onCopyToClipboard = useCallback2((error2) => {
|
|
312
|
+
setError(error2);
|
|
313
|
+
}, []);
|
|
314
|
+
return /* @__PURE__ */ React8.createElement(TextField, {
|
|
315
|
+
disabled: true,
|
|
316
|
+
error: !!error,
|
|
317
|
+
helperText: error?.message,
|
|
318
|
+
// to override the color that appears when it's a text field, only on dark mode
|
|
319
|
+
sx: {
|
|
320
|
+
input: {
|
|
321
|
+
WebkitTextFillColor: "lightgray !important"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
InputProps: {
|
|
325
|
+
endAdornment: /* @__PURE__ */ React8.createElement(InputAdornment, {
|
|
326
|
+
position: "end"
|
|
327
|
+
}, /* @__PURE__ */ React8.createElement(CopyIconButton, {
|
|
328
|
+
shareLinkName,
|
|
329
|
+
shareUrl,
|
|
330
|
+
onCopyToClipboard
|
|
331
|
+
}))
|
|
332
|
+
},
|
|
333
|
+
value: shareUrl,
|
|
334
|
+
...props
|
|
335
|
+
});
|
|
336
|
+
}, "CopyLinkTextField");
|
|
332
337
|
|
|
333
338
|
// src/out/Dialog.tsx
|
|
334
339
|
import { Dialog, DialogActions, DialogContent, DialogTitle, Stack as Stack2, Typography as Typography3 } from "@mui/material";
|
|
@@ -472,8 +477,8 @@ var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, ...props }) => {
|
|
|
472
477
|
}, "Share on Facebook")) : null));
|
|
473
478
|
}, "SocialButtonsFlexbox");
|
|
474
479
|
export {
|
|
480
|
+
CopyLinkStack,
|
|
475
481
|
CopyLinkTextField,
|
|
476
|
-
CopyLinkTypography,
|
|
477
482
|
DynamicShareImage,
|
|
478
483
|
FacebookSvgIcon,
|
|
479
484
|
GenerateShareLinkButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/ShareButton.tsx","../../src/icons/social/Facebook.tsx","../../src/icons/social/XTwitter.tsx","../../src/meta-server/dynamic-share/DynamicShareImage.tsx","../../src/meta-server/live-share/HideParentsFlexbox.tsx","../../src/out/CopyLinkTextField.tsx","../../src/out/CopyIconButton.tsx","../../src/out/CopyLinkTypography.tsx","../../src/out/lib/AnimatedGradientTypography.tsx","../../src/out/lib/splitAroundSubstring.ts","../../src/out/Dialog.tsx","../../src/out/Explanation.tsx","../../src/out/GenerateShareLinkButton.tsx","../../src/out/HeadingFlexbox.tsx","../../src/out/SocialButtonsFlexbox.tsx"],"sourcesContent":["import {\n Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon,\n} from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport React, { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({\n prepared = true, shareLink, ...props\n}) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const link = shareLink ?? window.location.href\n\n return (\n <FlexRow gap={1} ref={anchorRef}>\n <ButtonEx\n variant=\"text\"\n minWidth={32}\n size=\"small\"\n disabled={!prepared}\n onClick={() => {\n setExpanded(true)\n }}\n {...props}\n >\n <ShareIcon htmlColor=\"gray\" fontSize=\"small\" />\n </ButtonEx>\n <Popover open={prepared ? expanded : false} anchorEl={anchorRef.current} onClose={() => setExpanded(false)} transitionDuration={500}>\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n style={{ color: '#1da1f2' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <TwitterIcon fontSize=\"small\" />\n </LinkEx>\n <LinkEx\n lineHeight={0}\n style={{ color: '#4267b2' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <FacebookIcon fontSize=\"small\" />\n </LinkEx>\n </FlexRow>\n </Popover>\n </FlexRow>\n )\n}\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const FacebookSvgIcon = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"800\" width=\"1200\" viewBox=\"-204.79995 -341.33325 1774.9329 2047.9995\">\n <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\" />\n <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\" />\n </svg>\n , 'Facebook',\n)\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XTwitterSvgIcon = createSvgIcon(\n <svg viewBox=\"0 0 1200 1227\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n , 'XTwitterSvgIcon',\n)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\n\n/**\n * The props for the DynamicShareImage component.\n */\nexport interface DynamicShareImageProps {\n /**\n * The URL of the share image for the page.\n */\n image: string\n}\n\n/**\n * Used in conjunction with the XY Meta Server to dynamically set the share image for a page.\n */\nexport const DynamicShareImage: React.FC<DynamicShareImageProps> = ({ image }) => {\n return (\n <Helmet>\n <meta property=\"xyo:og:image\" content={image} />\n </Helmet>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps> = ({ children, ...props }) => {\n useEffect(() => {\n const style = document.createElement('style')\n document.head.append(style)\n style.innerHTML = `\n /** make all elements hidden */\n * {\n visibility: hidden;\n }\n\n /** move the preview area to the top of the page */\n #preview-area {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 9999;\n }\n\n /** make the preview area and all its children visible */\n #preview-area * {\n visibility: visible;\n }`\n\n return () => {\n style.remove()\n }\n }, [])\n\n return (\n <FlexGrowRow alignItems=\"stretch\" id=\"preview-area\" justifyContent=\"start\" {...props}>\n {children}\n </FlexGrowRow>\n )\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { InputAdornment, TextField } from '@mui/material'\nimport React, { useCallback, useState } from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\n\nexport interface CopyLinkTextFieldProps extends StandardTextFieldProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({\n shareLinkName, shareUrl, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onCopyToClipboard = useCallback((error?: Error) => {\n setError(error)\n }, [])\n\n return (\n <TextField\n disabled\n error={!!error}\n helperText={error?.message}\n // to override the color that appears when it's a text field, only on dark mode\n sx={{ input: { WebkitTextFillColor: 'lightgray !important' } }}\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <CopyIconButton shareLinkName={shareLinkName} shareUrl={shareUrl} onCopyToClipboard={onCopyToClipboard} />\n </InputAdornment>\n ),\n }}\n value={shareUrl}\n {...props}\n />\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport {\n type ButtonProps, IconButton, Tooltip,\n} from '@mui/material'\nimport { forget } from '@xylabs/forget'\nimport React, { useState } from 'react'\n\nimport type { ShareLinkProps } from './lib/index.ts'\n\nexport interface CopyIconButtonProps extends ButtonProps, ShareLinkProps {\n onCopyToClipboard?: (error?: Error) => void\n}\n\nconst CopyLink = 'Copy Link'\nconst Copied = 'Copied!'\n\nexport const CopyIconButton: React.FC<CopyIconButtonProps> = ({\n onCopyToClipboard, shareLinkName, shareUrl, ...props\n}) => {\n const [copyTooltipTitle, setCopyToolTipTitle] = useState(CopyLink)\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n await navigator.clipboard.writeText(link)\n onCopyToClipboard?.()\n setCopyToolTipTitle(Copied)\n setTimeout(() => setCopyToolTipTitle(CopyLink), 2000)\n } catch (e) {\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n onCopyToClipboard?.(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <Tooltip title={copyTooltipTitle}>\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\" {...props}>\n <CopyAllRounded />\n </IconButton>\n </Tooltip>\n )\n}\n","import { Cancel } from '@mui/icons-material'\nimport type { TypographyProps } from '@mui/material'\nimport {\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport React, {\n useCallback, useMemo, useState,\n} from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\nimport {\n AnimatedGradientTypography, type ShareLinkProps, splitAroundSubstring,\n} from './lib/index.ts'\n\nexport interface CopyLinkTypographyProps extends ShareLinkProps, TypographyProps {}\n\nexport const CopyLinkTypography: React.FC<CopyLinkTypographyProps> = ({\n shareLinkName, shareUrl, xnsName: xnsNameProp, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onCopyToClipboard = useCallback((error?: Error) => {\n setError(error)\n }, [])\n\n const parsedXnsName = useMemo(() => {\n if (shareUrl && xnsNameProp) {\n try {\n const parts = splitAroundSubstring(shareUrl, xnsNameProp)\n return parts\n } catch (e) {\n setError(e as Error)\n }\n }\n }, [])\n\n const [part1, xnsName, part3] = parsedXnsName || []\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={0.25}>\n {xnsName\n ? (\n <Stack direction=\"row\">\n <Typography sx={{ display: 'inline-flex' }} {...props}>{part1}</Typography>\n <AnimatedGradientTypography sx={{ display: 'inline-flex' }} {...props}>{xnsName}</AnimatedGradientTypography>\n <Typography sx={{ display: 'inline-flex' }} {...props}>{part3}</Typography>\n </Stack>\n )\n : <Typography sx={{ display: 'inline-flex' }} {...props}>{shareUrl}</Typography>}\n <CopyIconButton onCopyToClipboard={onCopyToClipboard} shareLinkName={shareLinkName} shareUrl={shareUrl} sx={{ display: 'inline-flex' }} />\n {error ? <Tooltip title={error.message}><Cancel color=\"error\" sx={{ display: 'inline-flex' }} /></Tooltip> : null}\n </Stack>\n )\n}\n","import {\n keyframes, styled, Typography,\n} from '@mui/material'\n\n/**\n * Start the animation at 100% to give the gradient a left to right effect\n */\nconst moveBg = keyframes(`\n 0% {\n background-position: 100% 0%;\n }\n 100% {\n background-position: 0% 0%;\n }\n`)\n\n/**\n * Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE\n */\nexport const AnimatedGradientTypography = styled(Typography, { name: 'AnimatedGradientTypography' })(({ theme }) => ({\n // Set the color variables for the gradient\n '--color-one': theme.palette.secondary.dark,\n '--color-two': theme.palette.primary.light,\n // set the gradient so it has the same start and end color for looping effect\n 'background': `linear-gradient(\n .25turn,\n var(--color-one),\n var(--color-two),\n var(--color-one)\n )`,\n // Set the text color to transparent so the gradient shows through\n 'color': 'transparent',\n // Clip the background to the text shape\n 'backgroundClip': 'text',\n // Set the background size to 800% so we don't see the third color initially creating the looping effect\n 'backgroundSize': '800%',\n // Set the text to bold so the gradient is more visible\n 'fontWeight': 'bold',\n // Set the animation\n '@media (prefers-reduced-motion: no-preference)': {\n animationName: moveBg,\n animationDuration: '2s',\n animationIterationCount: 'infinite',\n },\n // reset for users that prefer reduced motion\n '@media (prefers-reduced-motion)': {\n background: 'none',\n color: theme.palette.text.primary,\n },\n}))\n","export const splitAroundSubstring = (path: string, substring: string): [string, string, string] => {\n // Find the index of the substring\n const index = path.indexOf(substring)\n\n if (index === -1) {\n throw new Error(`XNS name \"${substring}\" not found in path.`)\n }\n\n // Extract the part before the substring\n const part1 = path.slice(0, index)\n\n // The substring itself is part2\n const part2 = substring\n\n // Extract the part after the substring\n const part3 = path.slice(index + substring.length)\n\n return [part1, part2, part3]\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography,\n} from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport type { ComponentType, ReactNode } from 'react'\nimport React from 'react'\n\nexport interface ShareOutDialogProps extends DialogProps {\n ShareOutDialogActions?: ComponentType<{ onClose?: () => void }>\n cardImg?: ReactNode\n shareOutDialogContent?: ReactNode\n subtitle?: string\n title?: string\n}\n\nexport const ShareOutDialog: React.FC<ShareOutDialogProps> = ({\n ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props\n}) => {\n const handleClose = () => {\n onClose?.('', 'backdropClick')\n }\n\n return (\n <Dialog onClose={onClose} open={open} {...props}>\n <DialogTitle>\n <Stack direction=\"row\" spacing={2}>\n <FlexGrowCol alignItems=\"flex-start\" width=\"60%\">\n <Typography variant=\"h5\">{title}</Typography>\n <Typography variant=\"body1\">\n {' '}\n {subtitle}\n </Typography>\n </FlexGrowCol>\n <FlexGrowCol alignItems=\"flex-end\" width=\"40%\">\n {cardImg}\n </FlexGrowCol>\n </Stack>\n </DialogTitle>\n <DialogContent>\n {shareOutDialogContent}\n <FlexCol alignItems=\"stretch\">\n </FlexCol>\n </DialogContent>\n {ShareOutDialogActions ? <DialogActions><ShareOutDialogActions onClose={handleClose} /></DialogActions> : null}\n </Dialog>\n )\n}\n","import { InfoOutlined } from '@mui/icons-material'\nimport {\n Tooltip, Typography, useTheme,\n} from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutExplanationProps {\n toolTipTitle?: string\n}\n\nexport const ShareOutExplanation: React.FC<ShareOutExplanationProps> = ({ toolTipTitle }) => {\n const theme = useTheme()\n // eslint-disable-next-line @stylistic/max-len\n 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.'\n return (\n <>\n <FlexGrowRow alignItems=\"center\">\n <Typography variant=\"body2\" paddingRight={0.5}>\n What am I sharing?\n </Typography>\n <Tooltip\n title={title}\n placement=\"bottom\"\n >\n <InfoOutlined fontSize=\"small\" sx={{ fontSize: theme.typography.caption.fontSize }} />\n </Tooltip>\n </FlexGrowRow>\n </>\n )\n}\n","import type { ButtonProps } from '@mui/material'\nimport {\n Button, CircularProgress, styled,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface GenerateShareLinkButtonProps extends ButtonProps {\n loading?: boolean\n}\n\nexport const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({\n children = 'Generate My Share Link', loading, ...props\n}) => {\n return (\n <Button\n variant=\"contained\"\n startIcon={loading ? <StyledCircularProgress size=\"small\" /> : null}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nconst StyledCircularProgress = styled(CircularProgress, { name: 'StyledCircularProgress' })(({ theme }) => ({\n // ensure the color of the spinner is the same as the button color\n color: theme.palette.getContrastText(theme.palette.primary.main),\n height: '20px',\n opacity: '.87',\n width: '20px',\n}))\n","import { Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutHeadingFlexboxProps extends FlexBoxProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({\n children, shareLinkName, shareUrl, ...props\n}) => {\n const GenerateShareLinkExplanation = \"When you generate your share link, we'll make a small amount of your data public so friends can check it out!\"\n\n return (\n <FlexGrowCol alignItems=\"flex-start\" paddingBottom={1} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Your Share Link</strong>\n </Typography>\n <Typography variant=\"body1\">\n {shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation}\n </Typography>\n {children}\n </FlexGrowCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({ shareUrl, ...props }) => {\n return (\n <FlexGrowCol alignItems=\"stretch\" paddingTop={2} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Share on Social Media</strong>\n </Typography>\n <FlexRow\n gap={0.5}\n sx={{ flexDirection: { md: 'row', xs: 'column' } }}\n >\n {shareUrl\n ? (\n <>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#000', color: '#fff' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n </FlexGrowCol>\n )\n}\n"],"mappings":";;;;AAAA,SACEA,YAAYC,cAAcC,SAASC,WAAWC,WAAWC,mBACpD;AACP,SAASC,eAAe;AAExB,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,OAAOC,SAASC,QAAQC,gBAAgB;AAOjC,IAAMC,cAA0C,wBAAC,EACtDC,WAAW,MAAMC,WAAW,GAAGC,MAAAA,MAChC;AACC,QAAM,CAACC,UAAUC,WAAAA,IAAeC,SAAS,KAAA;AACzC,QAAMC,YAAYC,OAAO,IAAA;AACzB,QAAMC,OAAOP,aAAaQ,OAAOC,SAASC;AAE1C,SACE,sBAAA,cAACC,SAAAA;IAAQC,KAAK;IAAGC,KAAKR;KACpB,sBAAA,cAACS,UAAAA;IACCC,SAAQ;IACRC,UAAU;IACVC,MAAK;IACLC,UAAU,CAACnB;IACXoB,SAAS,6BAAA;AACPhB,kBAAY,IAAA;IACd,GAFS;IAGR,GAAGF;KAEJ,sBAAA,cAACmB,WAAAA;IAAUC,WAAU;IAAOC,UAAS;OAEvC,sBAAA,cAACC,SAAAA;IAAQC,MAAMzB,WAAWG,WAAW;IAAOuB,UAAUpB,UAAUqB;IAASC,SAAS,6BAAMxB,YAAY,KAAA,GAAlB;IAA0ByB,oBAAoB;KAC9H,sBAAA,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iBAAiB;MAAQC,OAAO;IAAO;IAChDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,wCAAwCC,mBAAmBvB,QAAAA,CAAAA,EAAW;IACpF,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACuB,iBAAAA;MAAgBC,OAAM;;KACnC,sBAAA,GAGD,gBAAAxB,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAWC,OAAO;IAAO;IACnDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,gDAAgDC,mBAAmBvB,QAAAA,CAAAA,EAAW;IAC5F,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACyB,iBAAAA,IAAAA;KACb,mBAAA,CAAA,IAKL,IAAA,CAAA;AAIZ,GAvCyE;","names":["Facebook","FacebookIcon","Share","ShareIcon","Twitter","TwitterIcon","Popover","ButtonEx","FlexRow","LinkEx","React","useRef","useState","ShareButton","prepared","shareLink","props","expanded","setExpanded","useState","anchorRef","useRef","link","window","location","href","FlexRow","gap","ref","ButtonEx","variant","minWidth","size","disabled","onClick","ShareIcon","htmlColor","fontSize","Popover","open","anchorEl","current","onClose","transitionDuration","padding","LinkEx","lineHeight","style","color","encodeURIComponent","TwitterIcon","FacebookIcon","createSvgIcon","React","FacebookSvgIcon","svg","xmlns","height","width","viewBox","path","d","fill","createSvgIcon","React","XTwitterSvgIcon","svg","viewBox","fill","xmlns","path","d","React","Helmet","DynamicShareImage","image","React","Helmet","meta","property","content","FlexGrowRow","React","useEffect","HideParentsFlexbox","children","props","useEffect","style","document","createElement","head","append","innerHTML","remove","React","FlexGrowRow","alignItems","id","justifyContent","InputAdornment","TextField","React","useCallback","useState","CopyAllRounded","IconButton","Tooltip","forget","React","useState","CopyLink","Copied","CopyIconButton","onCopyToClipboard","shareLinkName","shareUrl","props","copyTooltipTitle","setCopyToolTipTitle","useState","copyToClipboard","link","navigator","clipboard","writeText","setTimeout","e","message","console","error","Error","warn","React","Tooltip","title","IconButton","aria-label","onClick","forget","edge","CopyAllRounded","CopyLinkTextField","shareLinkName","shareUrl","props","error","setError","useState","onCopyToClipboard","useCallback","React","TextField","disabled","helperText","message","sx","input","WebkitTextFillColor","InputProps","endAdornment","InputAdornment","position","CopyIconButton","value","Cancel","Stack","Tooltip","Typography","React","useCallback","useMemo","useState","keyframes","styled","Typography","moveBg","AnimatedGradientTypography","name","theme","palette","secondary","dark","primary","light","animationName","animationDuration","animationIterationCount","background","color","text","splitAroundSubstring","path","substring","index","indexOf","Error","part1","slice","part2","part3","length","CopyLinkTypography","shareLinkName","shareUrl","xnsName","xnsNameProp","props","error","setError","useState","onCopyToClipboard","useCallback","parsedXnsName","useMemo","parts","splitAroundSubstring","e","part1","part3","React","Stack","direction","alignItems","gap","Typography","sx","display","AnimatedGradientTypography","CopyIconButton","Tooltip","title","message","Cancel","color","Dialog","DialogActions","DialogContent","DialogTitle","Stack","Typography","FlexCol","FlexGrowCol","React","ShareOutDialog","ShareOutDialogActions","cardImg","open","onClose","shareOutDialogContent","subtitle","title","props","handleClose","React","Dialog","DialogTitle","Stack","direction","spacing","FlexGrowCol","alignItems","width","Typography","variant","DialogContent","FlexCol","DialogActions","InfoOutlined","Tooltip","Typography","useTheme","FlexGrowRow","React","ShareOutExplanation","toolTipTitle","theme","useTheme","title","React","FlexGrowRow","alignItems","Typography","variant","paddingRight","Tooltip","placement","InfoOutlined","fontSize","sx","typography","caption","Button","CircularProgress","styled","React","GenerateShareLinkButton","children","loading","props","React","Button","variant","startIcon","StyledCircularProgress","size","styled","CircularProgress","name","theme","color","palette","getContrastText","primary","main","height","opacity","width","Typography","FlexGrowCol","React","ShareOutHeadingFlexbox","children","shareLinkName","shareUrl","props","GenerateShareLinkExplanation","React","FlexGrowCol","alignItems","paddingBottom","Typography","variant","gutterBottom","strong","Typography","ButtonEx","FlexGrowCol","FlexRow","React","SocialButtonsFlexbox","shareUrl","props","React","FlexGrowCol","alignItems","paddingTop","Typography","variant","gutterBottom","strong","FlexRow","gap","sx","flexDirection","md","xs","ButtonEx","style","backgroundColor","color","onClick","window","open","encodeURIComponent","startIcon","XTwitterSvgIcon","width","FacebookSvgIcon"]}
|
|
1
|
+
{"version":3,"sources":["../../src/button/ShareButton.tsx","../../src/icons/social/Facebook.tsx","../../src/icons/social/XTwitter.tsx","../../src/meta-server/dynamic-share/DynamicShareImage.tsx","../../src/meta-server/live-share/HideParentsFlexbox.tsx","../../src/out/CopyLinkStack.tsx","../../src/out/CopyIconButton.tsx","../../src/out/lib/AnimatedGradientTypography.tsx","../../src/out/lib/splitAroundSubstring.ts","../../src/out/CopyLinkTextField.tsx","../../src/out/Dialog.tsx","../../src/out/Explanation.tsx","../../src/out/GenerateShareLinkButton.tsx","../../src/out/HeadingFlexbox.tsx","../../src/out/SocialButtonsFlexbox.tsx"],"sourcesContent":["import {\n Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon,\n} from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport React, { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({\n prepared = true, shareLink, ...props\n}) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const link = shareLink ?? window.location.href\n\n return (\n <FlexRow gap={1} ref={anchorRef}>\n <ButtonEx\n variant=\"text\"\n minWidth={32}\n size=\"small\"\n disabled={!prepared}\n onClick={() => {\n setExpanded(true)\n }}\n {...props}\n >\n <ShareIcon htmlColor=\"gray\" fontSize=\"small\" />\n </ButtonEx>\n <Popover open={prepared ? expanded : false} anchorEl={anchorRef.current} onClose={() => setExpanded(false)} transitionDuration={500}>\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n style={{ color: '#1da1f2' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <TwitterIcon fontSize=\"small\" />\n </LinkEx>\n <LinkEx\n lineHeight={0}\n style={{ color: '#4267b2' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <FacebookIcon fontSize=\"small\" />\n </LinkEx>\n </FlexRow>\n </Popover>\n </FlexRow>\n )\n}\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const FacebookSvgIcon = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"800\" width=\"1200\" viewBox=\"-204.79995 -341.33325 1774.9329 2047.9995\">\n <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\" />\n <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\" />\n </svg>\n , 'Facebook',\n)\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XTwitterSvgIcon = createSvgIcon(\n <svg viewBox=\"0 0 1200 1227\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <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\" />\n </svg>\n , 'XTwitterSvgIcon',\n)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\n\n/**\n * The props for the DynamicShareImage component.\n */\nexport interface DynamicShareImageProps {\n /**\n * The URL of the share image for the page.\n */\n image: string\n}\n\n/**\n * Used in conjunction with the XY Meta Server to dynamically set the share image for a page.\n */\nexport const DynamicShareImage: React.FC<DynamicShareImageProps> = ({ image }) => {\n return (\n <Helmet>\n <meta property=\"xyo:og:image\" content={image} />\n </Helmet>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps> = ({ children, ...props }) => {\n useEffect(() => {\n const style = document.createElement('style')\n document.head.append(style)\n style.innerHTML = `\n /** make all elements hidden */\n * {\n visibility: hidden;\n }\n\n /** move the preview area to the top of the page */\n #preview-area {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 9999;\n }\n\n /** make the preview area and all its children visible */\n #preview-area * {\n visibility: visible;\n }`\n\n return () => {\n style.remove()\n }\n }, [])\n\n return (\n <FlexGrowRow alignItems=\"stretch\" id=\"preview-area\" justifyContent=\"start\" {...props}>\n {children}\n </FlexGrowRow>\n )\n}\n","import { Cancel } from '@mui/icons-material'\nimport type { StackProps, TypographyProps } from '@mui/material'\nimport {\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport React, {\n useCallback, useMemo, useState,\n} from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\nimport {\n AnimatedGradientTypography, type ShareLinkProps, splitAroundSubstring,\n} from './lib/index.ts'\n\nexport interface CopyLinkStackProps extends ShareLinkProps, StackProps {\n xnsEndColor?: string\n xnsStartColor?: string\n}\n\nexport const CopyLinkStack: React.FC<CopyLinkStackProps> = ({\n shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, xnsStartColor, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onCopyToClipboard = useCallback((error?: Error) => {\n setError(error)\n }, [])\n\n const parsedXnsName = useMemo(() => {\n if (shareUrl && xnsNameProp) {\n try {\n const parts = splitAroundSubstring(shareUrl, xnsNameProp)\n return parts\n } catch (e) {\n setError(e as Error)\n }\n }\n }, [])\n\n const [part1, xnsName, part3] = parsedXnsName || []\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={0.25} {...props}>\n {xnsName\n ? (\n <Stack direction=\"row\" maxWidth=\"100%\" sx={{ overflowX: 'auto' }}>\n <Typography sx={{ display: 'inline-flex' }}>{part1}</Typography>\n <AnimatedGradientTypography color1={xnsStartColor} color2={xnsEndColor} sx={{ display: 'inline-flex' }}>{xnsName}</AnimatedGradientTypography>\n <Typography sx={{ display: 'inline-flex' }}>{part3}</Typography>\n </Stack>\n )\n : (\n <Typography sx={{\n display: 'inline-flex', maxWidth: '100%', overflow: 'auto',\n }}\n >\n {shareUrl}\n </Typography>\n )}\n <CopyIconButton onCopyToClipboard={onCopyToClipboard} shareLinkName={shareLinkName} shareUrl={shareUrl} sx={{ display: 'inline-flex' }} />\n {error ? <Tooltip title={error.message}><Cancel color=\"error\" sx={{ display: 'inline-flex' }} /></Tooltip> : null}\n </Stack>\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport {\n type ButtonProps, IconButton, Tooltip,\n} from '@mui/material'\nimport { forget } from '@xylabs/forget'\nimport React, { useState } from 'react'\n\nimport type { ShareLinkProps } from './lib/index.ts'\n\nexport interface CopyIconButtonProps extends ButtonProps, ShareLinkProps {\n onCopyToClipboard?: (error?: Error) => void\n}\n\nconst CopyLink = 'Copy Link'\nconst Copied = 'Copied!'\n\nexport const CopyIconButton: React.FC<CopyIconButtonProps> = ({\n onCopyToClipboard, shareLinkName, shareUrl, ...props\n}) => {\n const [copyTooltipTitle, setCopyToolTipTitle] = useState(CopyLink)\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n await navigator.clipboard.writeText(link)\n onCopyToClipboard?.()\n setCopyToolTipTitle(Copied)\n setTimeout(() => setCopyToolTipTitle(CopyLink), 2000)\n } catch (e) {\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n onCopyToClipboard?.(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <Tooltip title={copyTooltipTitle}>\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\" {...props}>\n <CopyAllRounded />\n </IconButton>\n </Tooltip>\n )\n}\n","import {\n keyframes, styled, Typography,\n} from '@mui/material'\n\n/**\n * Start the animation at 100% to give the gradient a left to right effect\n */\nconst moveBg = keyframes(`\n 0% {\n background-position: 100% 0%;\n }\n 100% {\n background-position: 0% 0%;\n }\n`)\n\n/**\n * Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE\n */\nexport const AnimatedGradientTypography = styled(Typography, { name: 'AnimatedGradientTypography' })<{ color1?: string; color2?: string }>(({\n theme, color1, color2,\n}) => {\n return {\n // Set the color variables for the gradient\n '--color-one': color1 ?? theme.palette.secondary.dark,\n '--color-two': color2 ?? theme.palette.primary.light,\n // set the gradient so it has the same start and end color for looping effect\n 'background': `linear-gradient(\n .25turn,\n var(--color-one),\n var(--color-two),\n var(--color-one)\n )`,\n // Set the text color to transparent so the gradient shows through\n 'color': 'transparent',\n // Clip the background to the text shape\n 'backgroundClip': 'text',\n // Set the background size to 800% so we don't see the third color initially creating the looping effect\n 'backgroundSize': '800%',\n // Set the text to bold so the gradient is more visible\n 'fontWeight': 'bold',\n // Set the animation\n '@media (prefers-reduced-motion: no-preference)': {\n animationName: moveBg,\n animationDuration: '2s',\n animationIterationCount: 'infinite',\n },\n // reset for users that prefer reduced motion\n '@media (prefers-reduced-motion)': {\n background: 'none',\n color: theme.palette.text.primary,\n },\n }\n})\n","export const splitAroundSubstring = (path: string, substring: string): [string, string, string] => {\n // Find the index of the substring\n const index = path.indexOf(substring)\n\n if (index === -1) {\n throw new Error(`XNS name \"${substring}\" not found in path.`)\n }\n\n // Extract the part before the substring\n const part1 = path.slice(0, index)\n\n // The substring itself is part2\n const part2 = substring\n\n // Extract the part after the substring\n const part3 = path.slice(index + substring.length)\n\n return [part1, part2, part3]\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { InputAdornment, TextField } from '@mui/material'\nimport React, { useCallback, useState } from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\n\nexport interface CopyLinkTextFieldProps extends StandardTextFieldProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({\n shareLinkName, shareUrl, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onCopyToClipboard = useCallback((error?: Error) => {\n setError(error)\n }, [])\n\n return (\n <TextField\n disabled\n error={!!error}\n helperText={error?.message}\n // to override the color that appears when it's a text field, only on dark mode\n sx={{ input: { WebkitTextFillColor: 'lightgray !important' } }}\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <CopyIconButton shareLinkName={shareLinkName} shareUrl={shareUrl} onCopyToClipboard={onCopyToClipboard} />\n </InputAdornment>\n ),\n }}\n value={shareUrl}\n {...props}\n />\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography,\n} from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport type { ComponentType, ReactNode } from 'react'\nimport React from 'react'\n\nexport interface ShareOutDialogProps extends DialogProps {\n ShareOutDialogActions?: ComponentType<{ onClose?: () => void }>\n cardImg?: ReactNode\n shareOutDialogContent?: ReactNode\n subtitle?: string\n title?: string\n}\n\nexport const ShareOutDialog: React.FC<ShareOutDialogProps> = ({\n ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props\n}) => {\n const handleClose = () => {\n onClose?.('', 'backdropClick')\n }\n\n return (\n <Dialog onClose={onClose} open={open} {...props}>\n <DialogTitle>\n <Stack direction=\"row\" spacing={2}>\n <FlexGrowCol alignItems=\"flex-start\" width=\"60%\">\n <Typography variant=\"h5\">{title}</Typography>\n <Typography variant=\"body1\">\n {' '}\n {subtitle}\n </Typography>\n </FlexGrowCol>\n <FlexGrowCol alignItems=\"flex-end\" width=\"40%\">\n {cardImg}\n </FlexGrowCol>\n </Stack>\n </DialogTitle>\n <DialogContent>\n {shareOutDialogContent}\n <FlexCol alignItems=\"stretch\">\n </FlexCol>\n </DialogContent>\n {ShareOutDialogActions ? <DialogActions><ShareOutDialogActions onClose={handleClose} /></DialogActions> : null}\n </Dialog>\n )\n}\n","import { InfoOutlined } from '@mui/icons-material'\nimport {\n Tooltip, Typography, useTheme,\n} from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutExplanationProps {\n toolTipTitle?: string\n}\n\nexport const ShareOutExplanation: React.FC<ShareOutExplanationProps> = ({ toolTipTitle }) => {\n const theme = useTheme()\n // eslint-disable-next-line @stylistic/max-len\n 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.'\n return (\n <>\n <FlexGrowRow alignItems=\"center\">\n <Typography variant=\"body2\" paddingRight={0.5}>\n What am I sharing?\n </Typography>\n <Tooltip\n title={title}\n placement=\"bottom\"\n >\n <InfoOutlined fontSize=\"small\" sx={{ fontSize: theme.typography.caption.fontSize }} />\n </Tooltip>\n </FlexGrowRow>\n </>\n )\n}\n","import type { ButtonProps } from '@mui/material'\nimport {\n Button, CircularProgress, styled,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface GenerateShareLinkButtonProps extends ButtonProps {\n loading?: boolean\n}\n\nexport const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({\n children = 'Generate My Share Link', loading, ...props\n}) => {\n return (\n <Button\n variant=\"contained\"\n startIcon={loading ? <StyledCircularProgress size=\"small\" /> : null}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nconst StyledCircularProgress = styled(CircularProgress, { name: 'StyledCircularProgress' })(({ theme }) => ({\n // ensure the color of the spinner is the same as the button color\n color: theme.palette.getContrastText(theme.palette.primary.main),\n height: '20px',\n opacity: '.87',\n width: '20px',\n}))\n","import { Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutHeadingFlexboxProps extends FlexBoxProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({\n children, shareLinkName, shareUrl, ...props\n}) => {\n const GenerateShareLinkExplanation = \"When you generate your share link, we'll make a small amount of your data public so friends can check it out!\"\n\n return (\n <FlexGrowCol alignItems=\"flex-start\" paddingBottom={1} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Your Share Link</strong>\n </Typography>\n <Typography variant=\"body1\">\n {shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation}\n </Typography>\n {children}\n </FlexGrowCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({ shareUrl, ...props }) => {\n return (\n <FlexGrowCol alignItems=\"stretch\" paddingTop={2} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Share on Social Media</strong>\n </Typography>\n <FlexRow\n gap={0.5}\n sx={{ flexDirection: { md: 'row', xs: 'column' } }}\n >\n {shareUrl\n ? (\n <>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#000', color: '#fff' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n </FlexGrowCol>\n )\n}\n"],"mappings":";;;;AAAA,SACEA,YAAYC,cAAcC,SAASC,WAAWC,WAAWC,mBACpD;AACP,SAASC,eAAe;AAExB,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,OAAOC,SAASC,QAAQC,gBAAgB;AAOjC,IAAMC,cAA0C,wBAAC,EACtDC,WAAW,MAAMC,WAAW,GAAGC,MAAAA,MAChC;AACC,QAAM,CAACC,UAAUC,WAAAA,IAAeC,SAAS,KAAA;AACzC,QAAMC,YAAYC,OAAO,IAAA;AACzB,QAAMC,OAAOP,aAAaQ,OAAOC,SAASC;AAE1C,SACE,sBAAA,cAACC,SAAAA;IAAQC,KAAK;IAAGC,KAAKR;KACpB,sBAAA,cAACS,UAAAA;IACCC,SAAQ;IACRC,UAAU;IACVC,MAAK;IACLC,UAAU,CAACnB;IACXoB,SAAS,6BAAA;AACPhB,kBAAY,IAAA;IACd,GAFS;IAGR,GAAGF;KAEJ,sBAAA,cAACmB,WAAAA;IAA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,aAAAA;IAAWC,SAAQ;IAAQC,cAAAA;KAC1B,gBAAAN,QAAA,cAACO,UAAAA,MAAO,uBAAA,CAAA,GAEV,gBAAAP,QAAA,cAACQ,UAAAA;IACCC,KAAK;IACLC,IAAI;MAAEC,eAAe;QAAEC,IAAI;QAAOC,IAAI;MAAS;IAAE;KAEhDf,WAEK,gBAAAE,QAAA,cAAAA,QAAA,UAAA,MACE,gBAAAA,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAQC,OAAO;IAAO;IAChDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,wCAAwCC,mBAAmBvB,QAAAA,CAAAA,EAAW;IACpF,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACuB,iBAAAA;MAAgBC,OAAM;;KACnC,sBAAA,GAGD,gBAAAxB,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAWC,OAAO;IAAO;IACnDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,gDAAgDC,mBAAmBvB,QAAAA,CAAAA,EAAW;IAC5F,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACyB,iBAAAA,IAAAA;KACb,mBAAA,CAAA,IAKL,IAAA,CAAA;AAIZ,GAvCyE;","names":["Facebook","FacebookIcon","Share","ShareIcon","Twitter","TwitterIcon","Popover","ButtonEx","FlexRow","LinkEx","React","useRef","useState","ShareButton","prepared","shareLink","props","expanded","setExpanded","useState","anchorRef","useRef","link","window","location","href","FlexRow","gap","ref","ButtonEx","variant","minWidth","size","disabled","onClick","ShareIcon","htmlColor","fontSize","Popover","open","anchorEl","current","onClose","transitionDuration","padding","LinkEx","lineHeight","style","color","encodeURIComponent","TwitterIcon","FacebookIcon","createSvgIcon","React","FacebookSvgIcon","svg","xmlns","height","width","viewBox","path","d","fill","createSvgIcon","React","XTwitterSvgIcon","svg","viewBox","fill","xmlns","path","d","React","Helmet","DynamicShareImage","image","React","Helmet","meta","property","content","FlexGrowRow","React","useEffect","HideParentsFlexbox","children","props","useEffect","style","document","createElement","head","append","innerHTML","remove","React","FlexGrowRow","alignItems","id","justifyContent","Cancel","Stack","Tooltip","Typography","React","useCallback","useMemo","useState","CopyAllRounded","IconButton","Tooltip","forget","React","useState","CopyLink","Copied","CopyIconButton","onCopyToClipboard","shareLinkName","shareUrl","props","copyTooltipTitle","setCopyToolTipTitle","useState","copyToClipboard","link","navigator","clipboard","writeText","setTimeout","e","message","console","error","Error","warn","React","Tooltip","title","IconButton","aria-label","onClick","forget","edge","CopyAllRounded","keyframes","styled","Typography","moveBg","AnimatedGradientTypography","name","theme","color1","color2","palette","secondary","dark","primary","light","animationName","animationDuration","animationIterationCount","background","color","text","splitAroundSubstring","path","substring","index","indexOf","Error","part1","slice","part2","part3","length","CopyLinkStack","shareLinkName","shareUrl","xnsName","xnsNameProp","xnsEndColor","xnsStartColor","props","error","setError","useState","onCopyToClipboard","useCallback","parsedXnsName","useMemo","parts","splitAroundSubstring","e","part1","part3","React","Stack","direction","alignItems","gap","maxWidth","sx","overflowX","Typography","display","AnimatedGradientTypography","color1","color2","overflow","CopyIconButton","Tooltip","title","message","Cancel","color","InputAdornment","TextField","React","useCallback","useState","CopyLinkTextField","shareLinkName","shareUrl","props","error","setError","useState","onCopyToClipboard","useCallback","React","TextField","disabled","helperText","message","sx","input","WebkitTextFillColor","InputProps","endAdornment","InputAdornment","position","CopyIconButton","value","Dialog","DialogActions","DialogContent","DialogTitle","Stack","Typography","FlexCol","FlexGrowCol","React","ShareOutDialog","ShareOutDialogActions","cardImg","open","onClose","shareOutDialogContent","subtitle","title","props","handleClose","React","Dialog","DialogTitle","Stack","direction","spacing","FlexGrowCol","alignItems","width","Typography","variant","DialogContent","FlexCol","DialogActions","InfoOutlined","Tooltip","Typography","useTheme","FlexGrowRow","React","ShareOutExplanation","toolTipTitle","theme","useTheme","title","React","FlexGrowRow","alignItems","Typography","variant","paddingRight","Tooltip","placement","InfoOutlined","fontSize","sx","typography","caption","Button","CircularProgress","styled","React","GenerateShareLinkButton","children","loading","props","React","Button","variant","startIcon","StyledCircularProgress","size","styled","CircularProgress","name","theme","color","palette","getContrastText","primary","main","height","opacity","width","Typography","FlexGrowCol","React","ShareOutHeadingFlexbox","children","shareLinkName","shareUrl","props","GenerateShareLinkExplanation","React","FlexGrowCol","alignItems","paddingBottom","Typography","variant","gutterBottom","strong","Typography","ButtonEx","FlexGrowCol","FlexRow","React","SocialButtonsFlexbox","shareUrl","props","React","FlexGrowCol","alignItems","paddingTop","Typography","variant","gutterBottom","strong","FlexRow","gap","sx","flexDirection","md","xs","ButtonEx","style","backgroundColor","color","onClick","window","open","encodeURIComponent","startIcon","XTwitterSvgIcon","width","FacebookSvgIcon"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type ShareLinkProps } from './lib/index.ts';
|
|
4
|
+
export interface CopyLinkStackProps extends ShareLinkProps, StackProps {
|
|
5
|
+
xnsEndColor?: string;
|
|
6
|
+
xnsStartColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CopyLinkStack: React.FC<CopyLinkStackProps>;
|
|
9
|
+
//# sourceMappingURL=CopyLinkStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyLinkStack.d.ts","sourceRoot":"","sources":["../../../src/out/CopyLinkStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;AAMhE,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,EACuB,KAAK,cAAc,EAChD,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,kBAAmB,SAAQ,cAAc,EAAE,UAAU;IACpE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4CtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/out/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/out/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const AnimatedGradientTypography: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
3
|
-
}, "className" | "style" | "classes" | "children" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "className" | "style" | "classes" | "children" | "sx" | "tabIndex" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "ref" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
3
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "className" | "style" | "classes" | "children" | "sx" | "tabIndex" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "ref" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
|
+
color1?: string;
|
|
5
|
+
color2?: string;
|
|
6
|
+
}, {}, {}>;
|
|
4
7
|
//# sourceMappingURL=AnimatedGradientTypography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedGradientTypography.d.ts","sourceRoot":"","sources":["../../../../src/out/lib/AnimatedGradientTypography.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"AnimatedGradientTypography.d.ts","sourceRoot":"","sources":["../../../../src/out/lib/AnimatedGradientTypography.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,0BAA0B;;;aAAyE,MAAM;aAAW,MAAM;UAkCrI,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { CopyLinkStack } from './CopyLinkStack.tsx'
|
|
5
|
+
|
|
6
|
+
export default { title: 'modules/ShareOut/CopyLinkStack' } as Meta<typeof CopyLinkStack>
|
|
7
|
+
|
|
8
|
+
const Template: StoryFn<typeof CopyLinkStack> = (props) => {
|
|
9
|
+
return <CopyLinkStack {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Default = Template.bind({})
|
|
13
|
+
Default.args = {}
|
|
14
|
+
|
|
15
|
+
const WithShareUrl = Template.bind({})
|
|
16
|
+
WithShareUrl.args = { shareUrl: 'https://google.com' }
|
|
17
|
+
|
|
18
|
+
const WithXnsName = Template.bind({})
|
|
19
|
+
WithXnsName.args = { shareUrl: 'https://beta.node.xyo.network.com/view/arietrouw.xyo/profile', xnsName: 'arietrouw.xyo' }
|
|
20
|
+
|
|
21
|
+
const WithXnsNameShortened = Template.bind({})
|
|
22
|
+
WithXnsNameShortened.args = {
|
|
23
|
+
shareUrl: 'https://beta.node.xyo.network.com/view/arietrouw.xyo/profile', xnsName: 'arietrouw.xyo', sx: { maxWidth: '200px' },
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const WithXnsNameInSubdomain = Template.bind({})
|
|
27
|
+
WithXnsNameInSubdomain.args = { shareUrl: 'https://arietrouw.xyo.network', xnsName: 'arietrouw.xyo' }
|
|
28
|
+
|
|
29
|
+
const WithXnsNameCustomColors = Template.bind({})
|
|
30
|
+
WithXnsNameCustomColors.args = {
|
|
31
|
+
shareUrl: 'https://arietrouw.xyo.network', xnsName: 'arietrouw.xyo', xnsStartColor: 'blue', xnsEndColor: 'red',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const WithError = Template.bind({})
|
|
35
|
+
WithError.args = { shareUrl: 'https://google.com', xnsName: 'foo.xyo' }
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
Default, WithError,
|
|
39
|
+
WithShareUrl, WithXnsName, WithXnsNameCustomColors,
|
|
40
|
+
WithXnsNameInSubdomain, WithXnsNameShortened,
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cancel } from '@mui/icons-material'
|
|
2
|
-
import type { TypographyProps } from '@mui/material'
|
|
2
|
+
import type { StackProps, TypographyProps } from '@mui/material'
|
|
3
3
|
import {
|
|
4
4
|
Stack,
|
|
5
5
|
Tooltip,
|
|
@@ -14,10 +14,13 @@ import {
|
|
|
14
14
|
AnimatedGradientTypography, type ShareLinkProps, splitAroundSubstring,
|
|
15
15
|
} from './lib/index.ts'
|
|
16
16
|
|
|
17
|
-
export interface
|
|
17
|
+
export interface CopyLinkStackProps extends ShareLinkProps, StackProps {
|
|
18
|
+
xnsEndColor?: string
|
|
19
|
+
xnsStartColor?: string
|
|
20
|
+
}
|
|
18
21
|
|
|
19
|
-
export const
|
|
20
|
-
shareLinkName, shareUrl, xnsName: xnsNameProp, ...props
|
|
22
|
+
export const CopyLinkStack: React.FC<CopyLinkStackProps> = ({
|
|
23
|
+
shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, xnsStartColor, ...props
|
|
21
24
|
}) => {
|
|
22
25
|
const [error, setError] = useState<Error>()
|
|
23
26
|
|
|
@@ -39,16 +42,23 @@ export const CopyLinkTypography: React.FC<CopyLinkTypographyProps> = ({
|
|
|
39
42
|
const [part1, xnsName, part3] = parsedXnsName || []
|
|
40
43
|
|
|
41
44
|
return (
|
|
42
|
-
<Stack direction="row" alignItems="center" gap={0.25}>
|
|
45
|
+
<Stack direction="row" alignItems="center" gap={0.25} {...props}>
|
|
43
46
|
{xnsName
|
|
44
47
|
? (
|
|
45
|
-
<Stack direction="row">
|
|
46
|
-
<Typography sx={{ display: 'inline-flex' }}
|
|
47
|
-
<AnimatedGradientTypography sx={{ display: 'inline-flex' }}
|
|
48
|
-
<Typography sx={{ display: 'inline-flex' }}
|
|
48
|
+
<Stack direction="row" maxWidth="100%" sx={{ overflowX: 'auto' }}>
|
|
49
|
+
<Typography sx={{ display: 'inline-flex' }}>{part1}</Typography>
|
|
50
|
+
<AnimatedGradientTypography color1={xnsStartColor} color2={xnsEndColor} sx={{ display: 'inline-flex' }}>{xnsName}</AnimatedGradientTypography>
|
|
51
|
+
<Typography sx={{ display: 'inline-flex' }}>{part3}</Typography>
|
|
49
52
|
</Stack>
|
|
50
53
|
)
|
|
51
|
-
:
|
|
54
|
+
: (
|
|
55
|
+
<Typography sx={{
|
|
56
|
+
display: 'inline-flex', maxWidth: '100%', overflow: 'auto',
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
{shareUrl}
|
|
60
|
+
</Typography>
|
|
61
|
+
)}
|
|
52
62
|
<CopyIconButton onCopyToClipboard={onCopyToClipboard} shareLinkName={shareLinkName} shareUrl={shareUrl} sx={{ display: 'inline-flex' }} />
|
|
53
63
|
{error ? <Tooltip title={error.message}><Cancel color="error" sx={{ display: 'inline-flex' }} /></Tooltip> : null}
|
|
54
64
|
</Stack>
|
package/src/out/index.ts
CHANGED
|
@@ -17,34 +17,38 @@ const moveBg = keyframes(`
|
|
|
17
17
|
/**
|
|
18
18
|
* Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE
|
|
19
19
|
*/
|
|
20
|
-
export const AnimatedGradientTypography = styled(Typography, { name: 'AnimatedGradientTypography' })
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
export const AnimatedGradientTypography = styled(Typography, { name: 'AnimatedGradientTypography' })<{ color1?: string; color2?: string }>(({
|
|
21
|
+
theme, color1, color2,
|
|
22
|
+
}) => {
|
|
23
|
+
return {
|
|
24
|
+
// Set the color variables for the gradient
|
|
25
|
+
'--color-one': color1 ?? theme.palette.secondary.dark,
|
|
26
|
+
'--color-two': color2 ?? theme.palette.primary.light,
|
|
27
|
+
// set the gradient so it has the same start and end color for looping effect
|
|
28
|
+
'background': `linear-gradient(
|
|
29
|
+
.25turn,
|
|
30
|
+
var(--color-one),
|
|
31
|
+
var(--color-two),
|
|
32
|
+
var(--color-one)
|
|
33
|
+
)`,
|
|
34
|
+
// Set the text color to transparent so the gradient shows through
|
|
35
|
+
'color': 'transparent',
|
|
36
|
+
// Clip the background to the text shape
|
|
37
|
+
'backgroundClip': 'text',
|
|
38
|
+
// Set the background size to 800% so we don't see the third color initially creating the looping effect
|
|
39
|
+
'backgroundSize': '800%',
|
|
40
|
+
// Set the text to bold so the gradient is more visible
|
|
41
|
+
'fontWeight': 'bold',
|
|
42
|
+
// Set the animation
|
|
43
|
+
'@media (prefers-reduced-motion: no-preference)': {
|
|
44
|
+
animationName: moveBg,
|
|
45
|
+
animationDuration: '2s',
|
|
46
|
+
animationIterationCount: 'infinite',
|
|
47
|
+
},
|
|
48
|
+
// reset for users that prefer reduced motion
|
|
49
|
+
'@media (prefers-reduced-motion)': {
|
|
50
|
+
background: 'none',
|
|
51
|
+
color: theme.palette.text.primary,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
})
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TypographyProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { type ShareLinkProps } from './lib/index.ts';
|
|
4
|
-
export interface CopyLinkTypographyProps extends ShareLinkProps, TypographyProps {
|
|
5
|
-
}
|
|
6
|
-
export declare const CopyLinkTypography: React.FC<CopyLinkTypographyProps>;
|
|
7
|
-
//# sourceMappingURL=CopyLinkTypography.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyLinkTypography.d.ts","sourceRoot":"","sources":["../../../src/out/CopyLinkTypography.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpD,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,EACuB,KAAK,cAAc,EAChD,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,uBAAwB,SAAQ,cAAc,EAAE,eAAe;CAAG;AAEnF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqChE,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { CopyLinkTypography } from './CopyLinkTypography.tsx'
|
|
5
|
-
|
|
6
|
-
export default { title: 'modules/ShareOut/CopyLinkTypography' } as Meta<typeof CopyLinkTypography>
|
|
7
|
-
|
|
8
|
-
const Template: StoryFn<typeof CopyLinkTypography> = (props) => {
|
|
9
|
-
return <CopyLinkTypography {...props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Default = Template.bind({})
|
|
13
|
-
Default.args = {}
|
|
14
|
-
|
|
15
|
-
const WithShareUrl = Template.bind({})
|
|
16
|
-
WithShareUrl.args = { shareUrl: 'https://google.com' }
|
|
17
|
-
|
|
18
|
-
const WithXnsName = Template.bind({})
|
|
19
|
-
WithXnsName.args = { shareUrl: 'https://beta.node.xyo.network.com/view/arietrouw.xyo/profile', xnsName: 'arietrouw.xyo' }
|
|
20
|
-
|
|
21
|
-
const WithXnsNameInSubdomain = Template.bind({})
|
|
22
|
-
WithXnsNameInSubdomain.args = { shareUrl: 'https://arietrouw.xyo.network', xnsName: 'arietrouw.xyo' }
|
|
23
|
-
|
|
24
|
-
const WithError = Template.bind({})
|
|
25
|
-
WithError.args = { shareUrl: 'https://google.com', xnsName: 'foo.xyo' }
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
Default, WithError,
|
|
29
|
-
WithShareUrl, WithXnsName, WithXnsNameInSubdomain,
|
|
30
|
-
}
|