@xyo-network/react-share 2.64.0-rc.6 → 2.64.0
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/ShareButton.cjs +80 -0
- package/dist/{node/ShareButton.mjs.map → browser/ShareButton.cjs.map} +1 -1
- package/dist/browser/ShareButton.d.cts +8 -0
- package/dist/browser/ShareButton.d.cts.map +1 -0
- package/dist/browser/index.cjs +82 -0
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.cts +2 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/docs.json +231 -0
- package/dist/node/ShareButton.cjs +84 -0
- package/dist/node/ShareButton.cjs.map +1 -0
- package/dist/node/ShareButton.d.cts +8 -0
- package/dist/node/ShareButton.d.cts.map +1 -0
- package/dist/node/ShareButton.js +24 -47
- package/dist/node/ShareButton.js.map +1 -1
- package/dist/node/index.cjs +86 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +2 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.js +57 -21
- package/dist/node/index.js.map +1 -1
- package/package.json +15 -15
- package/dist/browser/ShareButton.stories.js +0 -21
- package/dist/browser/ShareButton.stories.js.map +0 -1
- package/dist/node/ShareButton.mjs +0 -58
- package/dist/node/ShareButton.stories.js +0 -47
- package/dist/node/ShareButton.stories.js.map +0 -1
- package/dist/node/ShareButton.stories.mjs +0 -21
- package/dist/node/ShareButton.stories.mjs.map +0 -1
- package/dist/node/index.mjs +0 -2
- package/dist/node/index.mjs.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ShareButton.tsx
|
|
21
|
+
var ShareButton_exports = {};
|
|
22
|
+
__export(ShareButton_exports, {
|
|
23
|
+
ShareButton: () => ShareButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ShareButton_exports);
|
|
26
|
+
var import_icons_material = require("@mui/icons-material");
|
|
27
|
+
var import_material = require("@mui/material");
|
|
28
|
+
var import_react_button = require("@xylabs/react-button");
|
|
29
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
30
|
+
var import_react_link = require("@xylabs/react-link");
|
|
31
|
+
var import_react = require("react");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
34
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
35
|
+
const anchorRef = (0, import_react.useRef)(null);
|
|
36
|
+
const link = shareLink ?? window.location.href;
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_react_button.ButtonEx,
|
|
40
|
+
{
|
|
41
|
+
variant: "text",
|
|
42
|
+
minWidth: 32,
|
|
43
|
+
size: "small",
|
|
44
|
+
disabled: !prepared,
|
|
45
|
+
onClick: () => {
|
|
46
|
+
setExpanded(true);
|
|
47
|
+
},
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Share, { htmlColor: "gray", fontSize: "small" })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_react_link.LinkEx,
|
|
55
|
+
{
|
|
56
|
+
lineHeight: 0,
|
|
57
|
+
style: { color: "#1da1f2" },
|
|
58
|
+
onClick: () => {
|
|
59
|
+
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
60
|
+
setExpanded(false);
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Twitter, { fontSize: "small" })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_react_link.LinkEx,
|
|
67
|
+
{
|
|
68
|
+
lineHeight: 0,
|
|
69
|
+
style: { color: "#4267b2" },
|
|
70
|
+
onClick: () => {
|
|
71
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
72
|
+
setExpanded(false);
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Facebook, { fontSize: "small" })
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }) })
|
|
78
|
+
] });
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=ShareButton.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAqF;AACrF,sBAAwB;AACxB,0BAAwC;AACxC,2BAAwB;AACxB,wBAAuB;AACvB,mBAAiC;AAwBzB;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,gBAAY,qBAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,6CAAC,gCAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,sDAAC,sBAAAA,OAAA,EAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,4CAAC,2BAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,uDAAC,gCAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,SAAA,EAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,UAAA,EAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["ShareIcon","TwitterIcon","FacebookIcon"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from '@xylabs/react-button';
|
|
3
|
+
export interface ShareButtonProps extends ButtonExProps {
|
|
4
|
+
prepared?: boolean;
|
|
5
|
+
shareLink?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShareButton: React.FC<ShareButtonProps>;
|
|
8
|
+
//# sourceMappingURL=ShareButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareButton.d.ts","sourceRoot":"","sources":["../../src/ShareButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAY,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAK9D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA6ClD,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ShareButton: () => ShareButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/ShareButton.tsx
|
|
28
|
+
var import_icons_material = require("@mui/icons-material");
|
|
29
|
+
var import_material = require("@mui/material");
|
|
30
|
+
var import_react_button = require("@xylabs/react-button");
|
|
31
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
32
|
+
var import_react_link = require("@xylabs/react-link");
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
36
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
37
|
+
const anchorRef = (0, import_react.useRef)(null);
|
|
38
|
+
const link = shareLink ?? window.location.href;
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_react_button.ButtonEx,
|
|
42
|
+
{
|
|
43
|
+
variant: "text",
|
|
44
|
+
minWidth: 32,
|
|
45
|
+
size: "small",
|
|
46
|
+
disabled: !prepared,
|
|
47
|
+
onClick: () => {
|
|
48
|
+
setExpanded(true);
|
|
49
|
+
},
|
|
50
|
+
...props,
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Share, { htmlColor: "gray", fontSize: "small" })
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_react_link.LinkEx,
|
|
57
|
+
{
|
|
58
|
+
lineHeight: 0,
|
|
59
|
+
style: { color: "#1da1f2" },
|
|
60
|
+
onClick: () => {
|
|
61
|
+
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
62
|
+
setExpanded(false);
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Twitter, { fontSize: "small" })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_react_link.LinkEx,
|
|
69
|
+
{
|
|
70
|
+
lineHeight: 0,
|
|
71
|
+
style: { color: "#4267b2" },
|
|
72
|
+
onClick: () => {
|
|
73
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
74
|
+
setExpanded(false);
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Facebook, { fontSize: "small" })
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }) })
|
|
80
|
+
] });
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/ShareButton.tsx"],"sourcesContent":["export * from './ShareButton'\n","import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAqF;AACrF,sBAAwB;AACxB,0BAAwC;AACxC,2BAAwB;AACxB,wBAAuB;AACvB,mBAAiC;AAwBzB;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,gBAAY,qBAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,6CAAC,gCAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,sDAAC,sBAAAA,OAAA,EAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,4CAAC,2BAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,uDAAC,gCAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,SAAA,EAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,UAAA,EAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["ShareIcon","TwitterIcon","FacebookIcon"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 0,
|
|
3
|
+
"name": "@xyo-network/react-share",
|
|
4
|
+
"variant": "project",
|
|
5
|
+
"kind": 1,
|
|
6
|
+
"flags": {},
|
|
7
|
+
"children": [
|
|
8
|
+
{
|
|
9
|
+
"id": 1,
|
|
10
|
+
"name": "ShareButtonProps",
|
|
11
|
+
"variant": "declaration",
|
|
12
|
+
"kind": 256,
|
|
13
|
+
"flags": {},
|
|
14
|
+
"children": [
|
|
15
|
+
{
|
|
16
|
+
"id": 2,
|
|
17
|
+
"name": "prepared",
|
|
18
|
+
"variant": "declaration",
|
|
19
|
+
"kind": 1024,
|
|
20
|
+
"flags": {
|
|
21
|
+
"isOptional": true
|
|
22
|
+
},
|
|
23
|
+
"sources": [
|
|
24
|
+
{
|
|
25
|
+
"fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
|
|
26
|
+
"line": 9,
|
|
27
|
+
"character": 2,
|
|
28
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d3056af66/packages/sdk/packages/share/src/ShareButton.tsx#L9"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"type": {
|
|
32
|
+
"type": "intrinsic",
|
|
33
|
+
"name": "boolean"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": 3,
|
|
38
|
+
"name": "shareLink",
|
|
39
|
+
"variant": "declaration",
|
|
40
|
+
"kind": 1024,
|
|
41
|
+
"flags": {
|
|
42
|
+
"isOptional": true
|
|
43
|
+
},
|
|
44
|
+
"sources": [
|
|
45
|
+
{
|
|
46
|
+
"fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
|
|
47
|
+
"line": 10,
|
|
48
|
+
"character": 2,
|
|
49
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d3056af66/packages/sdk/packages/share/src/ShareButton.tsx#L10"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"type": {
|
|
53
|
+
"type": "intrinsic",
|
|
54
|
+
"name": "string"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"groups": [
|
|
59
|
+
{
|
|
60
|
+
"title": "Properties",
|
|
61
|
+
"children": [
|
|
62
|
+
2,
|
|
63
|
+
3
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"sources": [
|
|
68
|
+
{
|
|
69
|
+
"fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
|
|
70
|
+
"line": 8,
|
|
71
|
+
"character": 17,
|
|
72
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d3056af66/packages/sdk/packages/share/src/ShareButton.tsx#L8"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"extendedTypes": [
|
|
76
|
+
{
|
|
77
|
+
"type": "reference",
|
|
78
|
+
"target": {
|
|
79
|
+
"sourceFileName": "../../../../node_modules/@xylabs/react-button/src/components/ButtonExProps.tsx",
|
|
80
|
+
"qualifiedName": "ButtonExProps"
|
|
81
|
+
},
|
|
82
|
+
"name": "ButtonExProps",
|
|
83
|
+
"package": "@xylabs/react-button"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": 4,
|
|
89
|
+
"name": "ShareButton",
|
|
90
|
+
"variant": "declaration",
|
|
91
|
+
"kind": 64,
|
|
92
|
+
"flags": {},
|
|
93
|
+
"sources": [
|
|
94
|
+
{
|
|
95
|
+
"fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
|
|
96
|
+
"line": 13,
|
|
97
|
+
"character": 13,
|
|
98
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/d3056af66/packages/sdk/packages/share/src/ShareButton.tsx#L13"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"signatures": [
|
|
102
|
+
{
|
|
103
|
+
"id": 5,
|
|
104
|
+
"name": "ShareButton",
|
|
105
|
+
"variant": "signature",
|
|
106
|
+
"kind": 4096,
|
|
107
|
+
"flags": {},
|
|
108
|
+
"sources": [
|
|
109
|
+
{
|
|
110
|
+
"fileName": "node_modules/@types/react/ts5.0/index.d.ts",
|
|
111
|
+
"line": 569,
|
|
112
|
+
"character": 8
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"parameters": [
|
|
116
|
+
{
|
|
117
|
+
"id": 6,
|
|
118
|
+
"name": "props",
|
|
119
|
+
"variant": "param",
|
|
120
|
+
"kind": 32768,
|
|
121
|
+
"flags": {},
|
|
122
|
+
"type": {
|
|
123
|
+
"type": "reference",
|
|
124
|
+
"target": 1,
|
|
125
|
+
"name": "ShareButtonProps",
|
|
126
|
+
"package": "@xyo-network/react-share"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": 7,
|
|
131
|
+
"name": "context",
|
|
132
|
+
"variant": "param",
|
|
133
|
+
"kind": 32768,
|
|
134
|
+
"flags": {
|
|
135
|
+
"isOptional": true
|
|
136
|
+
},
|
|
137
|
+
"type": {
|
|
138
|
+
"type": "intrinsic",
|
|
139
|
+
"name": "any"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"type": {
|
|
144
|
+
"type": "union",
|
|
145
|
+
"types": [
|
|
146
|
+
{
|
|
147
|
+
"type": "literal",
|
|
148
|
+
"value": null
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "reference",
|
|
152
|
+
"target": {
|
|
153
|
+
"sourceFileName": "../../../../node_modules/@types/react/ts5.0/index.d.ts",
|
|
154
|
+
"qualifiedName": "React.ReactElement"
|
|
155
|
+
},
|
|
156
|
+
"typeArguments": [
|
|
157
|
+
{
|
|
158
|
+
"type": "intrinsic",
|
|
159
|
+
"name": "any"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"type": "intrinsic",
|
|
163
|
+
"name": "any"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"name": "ReactElement",
|
|
167
|
+
"package": "@types/react",
|
|
168
|
+
"qualifiedName": "React.ReactElement"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"groups": [
|
|
177
|
+
{
|
|
178
|
+
"title": "Interfaces",
|
|
179
|
+
"children": [
|
|
180
|
+
1
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"title": "Functions",
|
|
185
|
+
"children": [
|
|
186
|
+
4
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"packageName": "@xyo-network/react-share",
|
|
191
|
+
"readme": [
|
|
192
|
+
{
|
|
193
|
+
"kind": "text",
|
|
194
|
+
"text": "[![logo][]](https://xyo.network)\n\nPart of [@xyo-network/sdk-xyo-react](https://www.npmjs.com/package/@xyo-network/sdk-xyo-react)\n\n## License\n\n> See the [LICENSE](LICENSE) file for license details\n\n## Credits\n\n[Made with 🔥 and ❄️ by XYO](https://xyo.network)\n\n[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"symbolIdMap": {
|
|
198
|
+
"0": {
|
|
199
|
+
"sourceFileName": "src/index.ts",
|
|
200
|
+
"qualifiedName": ""
|
|
201
|
+
},
|
|
202
|
+
"1": {
|
|
203
|
+
"sourceFileName": "src/ShareButton.tsx",
|
|
204
|
+
"qualifiedName": "ShareButtonProps"
|
|
205
|
+
},
|
|
206
|
+
"2": {
|
|
207
|
+
"sourceFileName": "src/ShareButton.tsx",
|
|
208
|
+
"qualifiedName": "ShareButtonProps.prepared"
|
|
209
|
+
},
|
|
210
|
+
"3": {
|
|
211
|
+
"sourceFileName": "src/ShareButton.tsx",
|
|
212
|
+
"qualifiedName": "ShareButtonProps.shareLink"
|
|
213
|
+
},
|
|
214
|
+
"4": {
|
|
215
|
+
"sourceFileName": "src/ShareButton.tsx",
|
|
216
|
+
"qualifiedName": "ShareButton"
|
|
217
|
+
},
|
|
218
|
+
"5": {
|
|
219
|
+
"sourceFileName": "../../../../node_modules/@types/react/ts5.0/index.d.ts",
|
|
220
|
+
"qualifiedName": "ShareButton"
|
|
221
|
+
},
|
|
222
|
+
"6": {
|
|
223
|
+
"sourceFileName": "../../../../node_modules/@types/react/ts5.0/index.d.ts",
|
|
224
|
+
"qualifiedName": "props"
|
|
225
|
+
},
|
|
226
|
+
"7": {
|
|
227
|
+
"sourceFileName": "../../../../node_modules/@types/react/ts5.0/index.d.ts",
|
|
228
|
+
"qualifiedName": "context"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ShareButton.tsx
|
|
21
|
+
var ShareButton_exports = {};
|
|
22
|
+
__export(ShareButton_exports, {
|
|
23
|
+
ShareButton: () => ShareButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ShareButton_exports);
|
|
26
|
+
var import_icons_material = require("@mui/icons-material");
|
|
27
|
+
var import_material = require("@mui/material");
|
|
28
|
+
var import_react_button = require("@xylabs/react-button");
|
|
29
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
30
|
+
var import_react_link = require("@xylabs/react-link");
|
|
31
|
+
var import_react = require("react");
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
34
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
35
|
+
const anchorRef = (0, import_react.useRef)(null);
|
|
36
|
+
const link = shareLink ?? window.location.href;
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_react_button.ButtonEx,
|
|
40
|
+
{
|
|
41
|
+
variant: "text",
|
|
42
|
+
minWidth: 32,
|
|
43
|
+
size: "small",
|
|
44
|
+
disabled: !prepared,
|
|
45
|
+
onClick: () => {
|
|
46
|
+
setExpanded(true);
|
|
47
|
+
},
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Share, { htmlColor: "gray", fontSize: "small" })
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_react_link.LinkEx,
|
|
55
|
+
{
|
|
56
|
+
lineHeight: 0,
|
|
57
|
+
style: { color: "#1da1f2" },
|
|
58
|
+
onClick: () => {
|
|
59
|
+
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
60
|
+
setExpanded(false);
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Twitter, { fontSize: "small" })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_react_link.LinkEx,
|
|
67
|
+
{
|
|
68
|
+
lineHeight: 0,
|
|
69
|
+
style: { color: "#4267b2" },
|
|
70
|
+
onClick: () => {
|
|
71
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
72
|
+
setExpanded(false);
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Facebook, { fontSize: "small" })
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }) })
|
|
78
|
+
] });
|
|
79
|
+
};
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
ShareButton
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=ShareButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAqF;AACrF,sBAAwB;AACxB,0BAAwC;AACxC,2BAAwB;AACxB,wBAAuB;AACvB,mBAAiC;AAwBzB;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,gBAAY,qBAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,6CAAC,gCAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,sDAAC,sBAAAA,OAAA,EAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,4CAAC,2BAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,uDAAC,gCAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,SAAA,EAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,UAAA,EAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["ShareIcon","TwitterIcon","FacebookIcon"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonExProps } from '@xylabs/react-button';
|
|
3
|
+
export interface ShareButtonProps extends ButtonExProps {
|
|
4
|
+
prepared?: boolean;
|
|
5
|
+
shareLink?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShareButton: React.FC<ShareButtonProps>;
|
|
8
|
+
//# sourceMappingURL=ShareButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareButton.d.ts","sourceRoot":"","sources":["../../src/ShareButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAY,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAK9D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA6ClD,CAAA"}
|
package/dist/node/ShareButton.js
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var ShareButton_exports = {};
|
|
20
|
-
__export(ShareButton_exports, {
|
|
21
|
-
ShareButton: () => ShareButton
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(ShareButton_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_icons_material = require("@mui/icons-material");
|
|
26
|
-
var import_material = require("@mui/material");
|
|
27
|
-
var import_react_button = require("@xylabs/react-button");
|
|
28
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
-
var import_react_link = require("@xylabs/react-link");
|
|
30
|
-
var import_react = require("react");
|
|
31
|
-
const ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
32
|
-
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
33
|
-
const anchorRef = (0, import_react.useRef)(null);
|
|
1
|
+
// src/ShareButton.tsx
|
|
2
|
+
import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from "@mui/icons-material";
|
|
3
|
+
import { Popover } from "@mui/material";
|
|
4
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
5
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
6
|
+
import { LinkEx } from "@xylabs/react-link";
|
|
7
|
+
import { useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
10
|
+
const [expanded, setExpanded] = useState(false);
|
|
11
|
+
const anchorRef = useRef(null);
|
|
34
12
|
const link = shareLink ?? window.location.href;
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
13
|
+
return /* @__PURE__ */ jsxs(FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
ButtonEx,
|
|
38
16
|
{
|
|
39
17
|
variant: "text",
|
|
40
18
|
minWidth: 32,
|
|
@@ -44,12 +22,12 @@ const ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
|
44
22
|
setExpanded(true);
|
|
45
23
|
},
|
|
46
24
|
...props,
|
|
47
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ jsx(ShareIcon, { htmlColor: "gray", fontSize: "small" })
|
|
48
26
|
}
|
|
49
27
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
28
|
+
/* @__PURE__ */ jsx(Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ jsxs(FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
LinkEx,
|
|
53
31
|
{
|
|
54
32
|
lineHeight: 0,
|
|
55
33
|
style: { color: "#1da1f2" },
|
|
@@ -57,11 +35,11 @@ const ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
|
57
35
|
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
58
36
|
setExpanded(false);
|
|
59
37
|
},
|
|
60
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ jsx(TwitterIcon, { fontSize: "small" })
|
|
61
39
|
}
|
|
62
40
|
),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
LinkEx,
|
|
65
43
|
{
|
|
66
44
|
lineHeight: 0,
|
|
67
45
|
style: { color: "#4267b2" },
|
|
@@ -69,14 +47,13 @@ const ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
|
69
47
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
70
48
|
setExpanded(false);
|
|
71
49
|
},
|
|
72
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ jsx(FacebookIcon, { fontSize: "small" })
|
|
73
51
|
}
|
|
74
52
|
)
|
|
75
53
|
] }) })
|
|
76
54
|
] });
|
|
77
55
|
};
|
|
78
|
-
|
|
79
|
-
0 && (module.exports = {
|
|
56
|
+
export {
|
|
80
57
|
ShareButton
|
|
81
|
-
}
|
|
58
|
+
};
|
|
82
59
|
//# sourceMappingURL=ShareButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";AAAA,SAAS,YAAY,cAAc,SAAS,WAAW,WAAW,mBAAmB;AACrF,SAAS,eAAe;AACxB,SAAS,gBAA+B;AACxC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,QAAQ,gBAAgB;AAwBzB,cAGA,YAHA;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,YAAY,OAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,qBAAC,WAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,8BAAC,aAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,oBAAC,WAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,+BAAC,WAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,8BAAC,eAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,8BAAC,gBAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ShareButton: () => ShareButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/ShareButton.tsx
|
|
28
|
+
var import_icons_material = require("@mui/icons-material");
|
|
29
|
+
var import_material = require("@mui/material");
|
|
30
|
+
var import_react_button = require("@xylabs/react-button");
|
|
31
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
32
|
+
var import_react_link = require("@xylabs/react-link");
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
36
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
37
|
+
const anchorRef = (0, import_react.useRef)(null);
|
|
38
|
+
const link = shareLink ?? window.location.href;
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_react_button.ButtonEx,
|
|
42
|
+
{
|
|
43
|
+
variant: "text",
|
|
44
|
+
minWidth: 32,
|
|
45
|
+
size: "small",
|
|
46
|
+
disabled: !prepared,
|
|
47
|
+
onClick: () => {
|
|
48
|
+
setExpanded(true);
|
|
49
|
+
},
|
|
50
|
+
...props,
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Share, { htmlColor: "gray", fontSize: "small" })
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_react_link.LinkEx,
|
|
57
|
+
{
|
|
58
|
+
lineHeight: 0,
|
|
59
|
+
style: { color: "#1da1f2" },
|
|
60
|
+
onClick: () => {
|
|
61
|
+
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
62
|
+
setExpanded(false);
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Twitter, { fontSize: "small" })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
import_react_link.LinkEx,
|
|
69
|
+
{
|
|
70
|
+
lineHeight: 0,
|
|
71
|
+
style: { color: "#4267b2" },
|
|
72
|
+
onClick: () => {
|
|
73
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
74
|
+
setExpanded(false);
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Facebook, { fontSize: "small" })
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }) })
|
|
80
|
+
] });
|
|
81
|
+
};
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
ShareButton
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/ShareButton.tsx"],"sourcesContent":["export * from './ShareButton'\n","import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAqF;AACrF,sBAAwB;AACxB,0BAAwC;AACxC,2BAAwB;AACxB,wBAAuB;AACvB,mBAAiC;AAwBzB;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAC9C,QAAM,gBAAY,qBAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,6CAAC,gCAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,sDAAC,sBAAAA,OAAA,EAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,4CAAC,2BAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,uDAAC,gCAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,SAAA,EAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,sDAAC,sBAAAC,UAAA,EAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["ShareIcon","TwitterIcon","FacebookIcon"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
package/dist/node/index.js
CHANGED
|
@@ -1,23 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
// src/ShareButton.tsx
|
|
2
|
+
import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from "@mui/icons-material";
|
|
3
|
+
import { Popover } from "@mui/material";
|
|
4
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
5
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
6
|
+
import { LinkEx } from "@xylabs/react-link";
|
|
7
|
+
import { useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
10
|
+
const [expanded, setExpanded] = useState(false);
|
|
11
|
+
const anchorRef = useRef(null);
|
|
12
|
+
const link = shareLink ?? window.location.href;
|
|
13
|
+
return /* @__PURE__ */ jsxs(FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
ButtonEx,
|
|
16
|
+
{
|
|
17
|
+
variant: "text",
|
|
18
|
+
minWidth: 32,
|
|
19
|
+
size: "small",
|
|
20
|
+
disabled: !prepared,
|
|
21
|
+
onClick: () => {
|
|
22
|
+
setExpanded(true);
|
|
23
|
+
},
|
|
24
|
+
...props,
|
|
25
|
+
children: /* @__PURE__ */ jsx(ShareIcon, { htmlColor: "gray", fontSize: "small" })
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ jsx(Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ jsxs(FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
LinkEx,
|
|
31
|
+
{
|
|
32
|
+
lineHeight: 0,
|
|
33
|
+
style: { color: "#1da1f2" },
|
|
34
|
+
onClick: () => {
|
|
35
|
+
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
36
|
+
setExpanded(false);
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx(TwitterIcon, { fontSize: "small" })
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
LinkEx,
|
|
43
|
+
{
|
|
44
|
+
lineHeight: 0,
|
|
45
|
+
style: { color: "#4267b2" },
|
|
46
|
+
onClick: () => {
|
|
47
|
+
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
48
|
+
setExpanded(false);
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ jsx(FacebookIcon, { fontSize: "small" })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }) })
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
ShareButton
|
|
13
58
|
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(src_exports);
|
|
18
|
-
__reExport(src_exports, require("./ShareButton"), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require("./ShareButton")
|
|
22
|
-
});
|
|
23
59
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/ShareButton.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\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"],"mappings":";AAAA,SAAS,YAAY,cAAc,SAAS,WAAW,WAAW,mBAAmB;AACrF,SAAS,eAAe;AACxB,SAAS,gBAA+B;AACxC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,QAAQ,gBAAgB;AAwBzB,cAGA,YAHA;AAjBD,IAAM,cAA0C,CAAC,EAAE,WAAW,MAAM,WAAW,GAAG,MAAM,MAAM;AACnG,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,YAAY,OAAO,IAAI;AAC7B,QAAM,OAAO,aAAa,OAAO,SAAS;AAE1C,SACE,qBAAC,WAAQ,KAAK,GAAG,KAAK,WACpB;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU,CAAC;AAAA,QACX,SAAS,MAAM;AACb,sBAAY,IAAI;AAAA,QAClB;AAAA,QACC,GAAG;AAAA,QAEJ,8BAAC,aAAU,WAAU,QAAO,UAAS,SAAQ;AAAA;AAAA,IAC/C;AAAA,IACA,oBAAC,WAAQ,MAAM,WAAW,WAAW,OAAO,UAAU,UAAU,SAAS,SAAS,MAAM,YAAY,KAAK,GAAG,oBAAoB,KAC9H,+BAAC,WAAQ,KAAK,KAAK,SAAS,KAC1B;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,wCAAwC,mBAAmB,IAAI,CAAC,EAAE;AAC9E,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,8BAAC,eAAY,UAAS,SAAQ;AAAA;AAAA,MAChC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ,OAAO,EAAE,OAAO,UAAU;AAAA,UAC1B,SAAS,MAAM;AACb,mBAAO,KAAK,gDAAgD,mBAAmB,IAAI,CAAC,EAAE;AACtF,wBAAY,KAAK;AAAA,UACnB;AAAA,UAEA,8BAAC,gBAAa,UAAS,SAAQ;AAAA;AAAA,MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/react-button": "^3.
|
|
14
|
-
"@xylabs/react-flexbox": "^3.
|
|
15
|
-
"@xylabs/react-link": "^3.
|
|
13
|
+
"@xylabs/react-button": "^3.0.5",
|
|
14
|
+
"@xylabs/react-flexbox": "^3.0.5",
|
|
15
|
+
"@xylabs/react-link": "^3.0.5"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@mui/icons-material": "^5",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"react-router-dom": "^6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@storybook/react": "^7.4.
|
|
29
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
28
|
+
"@storybook/react": "^7.4.5",
|
|
29
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.78",
|
|
30
30
|
"typescript": "^5.2.2"
|
|
31
31
|
},
|
|
32
32
|
"description": "Common React library for all XYO projects that use React",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"node": {
|
|
37
37
|
"import": {
|
|
38
38
|
"types": "./dist/node/index.d.mts",
|
|
39
|
-
"default": "./dist/node/index.
|
|
39
|
+
"default": "./dist/node/index.js"
|
|
40
40
|
},
|
|
41
41
|
"require": {
|
|
42
|
-
"types": "./dist/node/index.d.
|
|
43
|
-
"default": "./dist/node/index.
|
|
42
|
+
"types": "./dist/node/index.d.cts",
|
|
43
|
+
"default": "./dist/node/index.cjs"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"browser": {
|
|
47
47
|
"import": {
|
|
48
|
-
"types": "./dist/browser/index.d.
|
|
48
|
+
"types": "./dist/browser/index.d.mts",
|
|
49
49
|
"default": "./dist/browser/index.js"
|
|
50
50
|
},
|
|
51
51
|
"require": {
|
|
52
|
-
"types": "./dist/browser/index.d.
|
|
53
|
-
"default": "./dist/browser/index.
|
|
52
|
+
"types": "./dist/browser/index.d.cts",
|
|
53
|
+
"default": "./dist/browser/index.cjs"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"default": "./dist/browser/index.
|
|
56
|
+
"default": "./dist/browser/index.js"
|
|
57
57
|
},
|
|
58
58
|
"./package.json": "./package.json"
|
|
59
59
|
},
|
|
60
|
-
"main": "dist/browser/index.
|
|
60
|
+
"main": "dist/browser/index.cjs",
|
|
61
61
|
"module": "dist/browser/index.js",
|
|
62
62
|
"homepage": "https://xyo.network",
|
|
63
63
|
"keywords": [
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
},
|
|
81
81
|
"sideEffects": false,
|
|
82
82
|
"types": "dist/browser/index.d.ts",
|
|
83
|
-
"version": "2.64.0
|
|
84
|
-
"
|
|
83
|
+
"version": "2.64.0",
|
|
84
|
+
"type": "module"
|
|
85
85
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ShareButton } from "./ShareButton";
|
|
3
|
-
var ShareButton_stories_default = {
|
|
4
|
-
title: "modules/ShareButton"
|
|
5
|
-
};
|
|
6
|
-
const Template = (props) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(ShareButton, { ...props });
|
|
8
|
-
};
|
|
9
|
-
const Default = Template.bind({});
|
|
10
|
-
Default.args = {};
|
|
11
|
-
const WithUnPrepared = Template.bind({});
|
|
12
|
-
WithUnPrepared.args = { prepared: false };
|
|
13
|
-
const WithCustomShareLink = Template.bind({});
|
|
14
|
-
WithCustomShareLink.args = { shareLink: "http://explore.xyo.network" };
|
|
15
|
-
export {
|
|
16
|
-
Default,
|
|
17
|
-
WithCustomShareLink,
|
|
18
|
-
WithUnPrepared,
|
|
19
|
-
ShareButton_stories_default as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=ShareButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ShareButton.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\n\nimport { ShareButton } from './ShareButton'\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'modules/ShareButton',\n} as Meta<typeof ShareButton>\n\nconst Template: StoryFn<typeof ShareButton> = (props) => {\n return <ShareButton {...props} />\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst WithUnPrepared = Template.bind({})\nWithUnPrepared.args = { prepared: false }\n\nconst WithCustomShareLink = Template.bind({})\nWithCustomShareLink.args = { shareLink: 'http://explore.xyo.network' }\n\nexport { Default, WithCustomShareLink, WithUnPrepared }\n"],"mappings":"AAUS;AART,SAAS,mBAAmB;AAG5B,IAAO,8BAAQ;AAAA,EACb,OAAO;AACT;AAEA,MAAM,WAAwC,CAAC,UAAU;AACvD,SAAO,oBAAC,eAAa,GAAG,OAAO;AACjC;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;AACvC,eAAe,OAAO,EAAE,UAAU,MAAM;AAExC,MAAM,sBAAsB,SAAS,KAAK,CAAC,CAAC;AAC5C,oBAAoB,OAAO,EAAE,WAAW,6BAA6B;","names":[]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from "@mui/icons-material";
|
|
3
|
-
import { Popover } from "@mui/material";
|
|
4
|
-
import { ButtonEx } from "@xylabs/react-button";
|
|
5
|
-
import { FlexRow } from "@xylabs/react-flexbox";
|
|
6
|
-
import { LinkEx } from "@xylabs/react-link";
|
|
7
|
-
import { useRef, useState } from "react";
|
|
8
|
-
const ShareButton = ({ prepared = true, shareLink, ...props }) => {
|
|
9
|
-
const [expanded, setExpanded] = useState(false);
|
|
10
|
-
const anchorRef = useRef(null);
|
|
11
|
-
const link = shareLink ?? window.location.href;
|
|
12
|
-
return /* @__PURE__ */ jsxs(FlexRow, { gap: 1, ref: anchorRef, children: [
|
|
13
|
-
/* @__PURE__ */ jsx(
|
|
14
|
-
ButtonEx,
|
|
15
|
-
{
|
|
16
|
-
variant: "text",
|
|
17
|
-
minWidth: 32,
|
|
18
|
-
size: "small",
|
|
19
|
-
disabled: !prepared,
|
|
20
|
-
onClick: () => {
|
|
21
|
-
setExpanded(true);
|
|
22
|
-
},
|
|
23
|
-
...props,
|
|
24
|
-
children: /* @__PURE__ */ jsx(ShareIcon, { htmlColor: "gray", fontSize: "small" })
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ jsx(Popover, { open: prepared ? expanded : false, anchorEl: anchorRef.current, onClose: () => setExpanded(false), transitionDuration: 500, children: /* @__PURE__ */ jsxs(FlexRow, { gap: 0.5, padding: 0.5, children: [
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
LinkEx,
|
|
30
|
-
{
|
|
31
|
-
lineHeight: 0,
|
|
32
|
-
style: { color: "#1da1f2" },
|
|
33
|
-
onClick: () => {
|
|
34
|
-
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`);
|
|
35
|
-
setExpanded(false);
|
|
36
|
-
},
|
|
37
|
-
children: /* @__PURE__ */ jsx(TwitterIcon, { fontSize: "small" })
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
LinkEx,
|
|
42
|
-
{
|
|
43
|
-
lineHeight: 0,
|
|
44
|
-
style: { color: "#4267b2" },
|
|
45
|
-
onClick: () => {
|
|
46
|
-
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`);
|
|
47
|
-
setExpanded(false);
|
|
48
|
-
},
|
|
49
|
-
children: /* @__PURE__ */ jsx(FacebookIcon, { fontSize: "small" })
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
] }) })
|
|
53
|
-
] });
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
ShareButton
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=ShareButton.mjs.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var ShareButton_stories_exports = {};
|
|
20
|
-
__export(ShareButton_stories_exports, {
|
|
21
|
-
Default: () => Default,
|
|
22
|
-
WithCustomShareLink: () => WithCustomShareLink,
|
|
23
|
-
WithUnPrepared: () => WithUnPrepared,
|
|
24
|
-
default: () => ShareButton_stories_default
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(ShareButton_stories_exports);
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
var import_ShareButton = require("./ShareButton");
|
|
29
|
-
var ShareButton_stories_default = {
|
|
30
|
-
title: "modules/ShareButton"
|
|
31
|
-
};
|
|
32
|
-
const Template = (props) => {
|
|
33
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ShareButton.ShareButton, { ...props });
|
|
34
|
-
};
|
|
35
|
-
const Default = Template.bind({});
|
|
36
|
-
Default.args = {};
|
|
37
|
-
const WithUnPrepared = Template.bind({});
|
|
38
|
-
WithUnPrepared.args = { prepared: false };
|
|
39
|
-
const WithCustomShareLink = Template.bind({});
|
|
40
|
-
WithCustomShareLink.args = { shareLink: "http://explore.xyo.network" };
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
Default,
|
|
44
|
-
WithCustomShareLink,
|
|
45
|
-
WithUnPrepared
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=ShareButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ShareButton.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\n\nimport { ShareButton } from './ShareButton'\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'modules/ShareButton',\n} as Meta<typeof ShareButton>\n\nconst Template: StoryFn<typeof ShareButton> = (props) => {\n return <ShareButton {...props} />\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst WithUnPrepared = Template.bind({})\nWithUnPrepared.args = { prepared: false }\n\nconst WithCustomShareLink = Template.bind({})\nWithCustomShareLink.args = { shareLink: 'http://explore.xyo.network' }\n\nexport { Default, WithCustomShareLink, WithUnPrepared }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUS;AART,yBAA4B;AAG5B,IAAO,8BAAQ;AAAA,EACb,OAAO;AACT;AAEA,MAAM,WAAwC,CAAC,UAAU;AACvD,SAAO,4CAAC,kCAAa,GAAG,OAAO;AACjC;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;AACvC,eAAe,OAAO,EAAE,UAAU,MAAM;AAExC,MAAM,sBAAsB,SAAS,KAAK,CAAC,CAAC;AAC5C,oBAAoB,OAAO,EAAE,WAAW,6BAA6B;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ShareButton } from "./ShareButton";
|
|
3
|
-
var ShareButton_stories_default = {
|
|
4
|
-
title: "modules/ShareButton"
|
|
5
|
-
};
|
|
6
|
-
const Template = (props) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(ShareButton, { ...props });
|
|
8
|
-
};
|
|
9
|
-
const Default = Template.bind({});
|
|
10
|
-
Default.args = {};
|
|
11
|
-
const WithUnPrepared = Template.bind({});
|
|
12
|
-
WithUnPrepared.args = { prepared: false };
|
|
13
|
-
const WithCustomShareLink = Template.bind({});
|
|
14
|
-
WithCustomShareLink.args = { shareLink: "http://explore.xyo.network" };
|
|
15
|
-
export {
|
|
16
|
-
Default,
|
|
17
|
-
WithCustomShareLink,
|
|
18
|
-
WithUnPrepared,
|
|
19
|
-
ShareButton_stories_default as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=ShareButton.stories.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ShareButton.stories.tsx"],"sourcesContent":["import { Meta, StoryFn } from '@storybook/react'\n\nimport { ShareButton } from './ShareButton'\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'modules/ShareButton',\n} as Meta<typeof ShareButton>\n\nconst Template: StoryFn<typeof ShareButton> = (props) => {\n return <ShareButton {...props} />\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst WithUnPrepared = Template.bind({})\nWithUnPrepared.args = { prepared: false }\n\nconst WithCustomShareLink = Template.bind({})\nWithCustomShareLink.args = { shareLink: 'http://explore.xyo.network' }\n\nexport { Default, WithCustomShareLink, WithUnPrepared }\n"],"mappings":"AAUS;AART,SAAS,mBAAmB;AAG5B,IAAO,8BAAQ;AAAA,EACb,OAAO;AACT;AAEA,MAAM,WAAwC,CAAC,UAAU;AACvD,SAAO,oBAAC,eAAa,GAAG,OAAO;AACjC;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;AACvC,eAAe,OAAO,EAAE,UAAU,MAAM;AAExC,MAAM,sBAAsB,SAAS,KAAK,CAAC,CAAC;AAC5C,oBAAoB,OAAO,EAAE,WAAW,6BAA6B;","names":[]}
|
package/dist/node/index.mjs
DELETED
package/dist/node/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './ShareButton'\n"],"mappings":"AAAA,cAAc;","names":[]}
|