@xyo-network/react-share 2.64.8 → 2.64.10

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/docs.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
26
26
  "line": 9,
27
27
  "character": 2,
28
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b21883567/packages/sdk/packages/share/src/ShareButton.tsx#L9"
28
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/5704df3a9/packages/sdk/packages/share/src/ShareButton.tsx#L9"
29
29
  }
30
30
  ],
31
31
  "type": {
@@ -46,7 +46,7 @@
46
46
  "fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
47
47
  "line": 10,
48
48
  "character": 2,
49
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b21883567/packages/sdk/packages/share/src/ShareButton.tsx#L10"
49
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/5704df3a9/packages/sdk/packages/share/src/ShareButton.tsx#L10"
50
50
  }
51
51
  ],
52
52
  "type": {
@@ -69,7 +69,7 @@
69
69
  "fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
70
70
  "line": 8,
71
71
  "character": 17,
72
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b21883567/packages/sdk/packages/share/src/ShareButton.tsx#L8"
72
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/5704df3a9/packages/sdk/packages/share/src/ShareButton.tsx#L8"
73
73
  }
74
74
  ],
75
75
  "extendedTypes": [
@@ -95,7 +95,7 @@
95
95
  "fileName": "packages/sdk/packages/share/src/ShareButton.tsx",
96
96
  "line": 13,
97
97
  "character": 13,
98
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b21883567/packages/sdk/packages/share/src/ShareButton.tsx#L13"
98
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/5704df3a9/packages/sdk/packages/share/src/ShareButton.tsx#L13"
99
99
  }
100
100
  ],
101
101
  "signatures": [
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.0.15",
14
- "@xylabs/react-flexbox": "^3.0.15",
15
- "@xylabs/react-link": "^3.0.15"
13
+ "@xylabs/react-button": "^3.0.18",
14
+ "@xylabs/react-flexbox": "^3.0.18",
15
+ "@xylabs/react-link": "^3.0.18"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "@mui/icons-material": "^5",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@storybook/react": "^7.4.6",
28
- "@xylabs/ts-scripts-yarn3": "^3.0.82",
28
+ "@xylabs/ts-scripts-yarn3": "^3.1.3",
29
29
  "typescript": "^5.2.2"
30
30
  },
31
31
  "description": "Common React library for all XYO projects that use React",
@@ -79,6 +79,6 @@
79
79
  },
80
80
  "sideEffects": false,
81
81
  "types": "dist/browser/index.d.ts",
82
- "version": "2.64.8",
82
+ "version": "2.64.10",
83
83
  "type": "module"
84
84
  }
@@ -1,80 +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
-
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 +0,0 @@
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"]}
@@ -1,59 +0,0 @@
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
58
- };
59
- //# sourceMappingURL=ShareButton.js.map
@@ -1 +0,0 @@
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":[]}
@@ -1,84 +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
-
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
@@ -1 +0,0 @@
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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MACjC;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["ShareIcon","TwitterIcon","FacebookIcon"]}
@@ -1,59 +0,0 @@
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
58
- };
59
- //# sourceMappingURL=ShareButton.js.map
@@ -1 +0,0 @@
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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