@xyo-network/react-share 2.64.9 → 2.65.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/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.9",
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.9",
82
+ "version": "2.65.0",
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":[]}
package/dist/docs.json DELETED
@@ -1,231 +0,0 @@
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/798614ebd/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/798614ebd/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/798614ebd/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/798614ebd/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": 568,
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
- }
@@ -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;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,Q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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;AAwB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