@xyo-network/react-address-render 2.64.0-rc.7 → 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.
Files changed (148) hide show
  1. package/dist/browser/components/RenderRowBox.cjs +239 -0
  2. package/dist/browser/components/RenderRowBox.cjs.map +1 -0
  3. package/dist/browser/components/RenderRowBox.d.cts +14 -0
  4. package/dist/browser/components/RenderRowBox.d.cts.map +1 -0
  5. package/dist/browser/components/favorite/FavoriteIconButton.cjs +191 -0
  6. package/dist/browser/components/favorite/FavoriteIconButton.cjs.map +1 -0
  7. package/dist/browser/components/favorite/FavoriteIconButton.d.cts +12 -0
  8. package/dist/browser/components/favorite/FavoriteIconButton.d.cts.map +1 -0
  9. package/dist/browser/components/favorite/FavoriteToggleSVG.cjs +29 -0
  10. package/dist/{node/components/favorite/FavoriteToggleSVG.mjs.map → browser/components/favorite/FavoriteToggleSVG.cjs.map} +1 -1
  11. package/dist/browser/components/favorite/FavoriteToggleSVG.d.cts +5 -0
  12. package/dist/browser/components/favorite/FavoriteToggleSVG.d.cts.map +1 -0
  13. package/dist/browser/components/favorite/Popper.cjs +112 -0
  14. package/dist/browser/components/favorite/Popper.cjs.map +1 -0
  15. package/dist/browser/components/favorite/Popper.d.cts +11 -0
  16. package/dist/browser/components/favorite/Popper.d.cts.map +1 -0
  17. package/dist/browser/components/favorite/PopperButtonGroup.cjs +57 -0
  18. package/dist/browser/components/favorite/PopperButtonGroup.cjs.map +1 -0
  19. package/dist/browser/components/favorite/PopperButtonGroup.d.cts +9 -0
  20. package/dist/browser/components/favorite/PopperButtonGroup.d.cts.map +1 -0
  21. package/dist/browser/components/favorite/index.cjs +193 -0
  22. package/dist/browser/components/favorite/index.cjs.map +1 -0
  23. package/dist/browser/components/favorite/index.d.cts +2 -0
  24. package/dist/browser/components/favorite/index.d.cts.map +1 -0
  25. package/dist/browser/components/favorite/lib/PopperId.cjs +27 -0
  26. package/dist/{node/components/favorite/lib/PopperId.mjs.map → browser/components/favorite/lib/PopperId.cjs.map} +1 -1
  27. package/dist/browser/components/favorite/lib/PopperId.d.cts +2 -0
  28. package/dist/browser/components/favorite/lib/PopperId.d.cts.map +1 -0
  29. package/dist/browser/components/favorite/lib/index.cjs +29 -0
  30. package/dist/browser/components/favorite/lib/index.cjs.map +1 -0
  31. package/dist/browser/components/favorite/lib/index.d.cts +2 -0
  32. package/dist/browser/components/favorite/lib/index.d.cts.map +1 -0
  33. package/dist/browser/components/index.cjs +241 -0
  34. package/dist/browser/components/index.cjs.map +1 -0
  35. package/dist/browser/components/index.d.cts +4 -0
  36. package/dist/browser/components/index.d.cts.map +1 -0
  37. package/dist/browser/components/lib/FavoriteItemEvent.cjs +32 -0
  38. package/dist/{node/components/lib/FavoriteItemEvent.mjs.map → browser/components/lib/FavoriteItemEvent.cjs.map} +1 -1
  39. package/dist/browser/components/lib/FavoriteItemEvent.d.cts +9 -0
  40. package/dist/browser/components/lib/FavoriteItemEvent.d.cts.map +1 -0
  41. package/dist/browser/components/lib/index.cjs +34 -0
  42. package/dist/browser/components/lib/index.cjs.map +1 -0
  43. package/dist/browser/components/lib/index.d.cts +2 -0
  44. package/dist/browser/components/lib/index.d.cts.map +1 -0
  45. package/dist/browser/index.cjs +241 -0
  46. package/dist/browser/index.cjs.map +1 -0
  47. package/dist/browser/index.d.cts +2 -0
  48. package/dist/browser/index.d.cts.map +1 -0
  49. package/dist/docs.json +24106 -0
  50. package/dist/node/components/RenderRowBox.cjs +243 -0
  51. package/dist/node/components/RenderRowBox.cjs.map +1 -0
  52. package/dist/node/components/RenderRowBox.d.cts +14 -0
  53. package/dist/node/components/RenderRowBox.d.cts.map +1 -0
  54. package/dist/node/components/RenderRowBox.js +187 -42
  55. package/dist/node/components/RenderRowBox.js.map +1 -1
  56. package/dist/node/components/favorite/FavoriteIconButton.cjs +195 -0
  57. package/dist/node/components/favorite/FavoriteIconButton.cjs.map +1 -0
  58. package/dist/node/components/favorite/FavoriteIconButton.d.cts +12 -0
  59. package/dist/node/components/favorite/FavoriteIconButton.d.cts.map +1 -0
  60. package/dist/node/components/favorite/FavoriteIconButton.js +123 -47
  61. package/dist/node/components/favorite/FavoriteIconButton.js.map +1 -1
  62. package/dist/node/components/favorite/FavoriteToggleSVG.cjs +33 -0
  63. package/dist/node/components/favorite/FavoriteToggleSVG.cjs.map +1 -0
  64. package/dist/node/components/favorite/FavoriteToggleSVG.d.cts +5 -0
  65. package/dist/node/components/favorite/FavoriteToggleSVG.d.cts.map +1 -0
  66. package/dist/node/components/favorite/FavoriteToggleSVG.js +6 -29
  67. package/dist/node/components/favorite/FavoriteToggleSVG.js.map +1 -1
  68. package/dist/node/components/favorite/Popper.cjs +116 -0
  69. package/dist/node/components/favorite/Popper.cjs.map +1 -0
  70. package/dist/node/components/favorite/Popper.d.cts +11 -0
  71. package/dist/node/components/favorite/Popper.d.cts.map +1 -0
  72. package/dist/node/components/favorite/Popper.js +54 -41
  73. package/dist/node/components/favorite/Popper.js.map +1 -1
  74. package/dist/node/components/favorite/PopperButtonGroup.cjs +61 -0
  75. package/dist/node/components/favorite/{PopperButtonGroup.mjs.map → PopperButtonGroup.cjs.map} +1 -1
  76. package/dist/node/components/favorite/PopperButtonGroup.d.cts +9 -0
  77. package/dist/node/components/favorite/PopperButtonGroup.d.cts.map +1 -0
  78. package/dist/node/components/favorite/PopperButtonGroup.js +16 -39
  79. package/dist/node/components/favorite/PopperButtonGroup.js.map +1 -1
  80. package/dist/node/components/favorite/index.cjs +197 -0
  81. package/dist/node/components/favorite/index.cjs.map +1 -0
  82. package/dist/node/components/favorite/index.d.cts +2 -0
  83. package/dist/node/components/favorite/index.d.cts.map +1 -0
  84. package/dist/node/components/favorite/index.js +167 -20
  85. package/dist/node/components/favorite/index.js.map +1 -1
  86. package/dist/node/components/favorite/lib/PopperId.cjs +31 -0
  87. package/dist/node/components/favorite/lib/PopperId.cjs.map +1 -0
  88. package/dist/node/components/favorite/lib/PopperId.d.cts +2 -0
  89. package/dist/node/components/favorite/lib/PopperId.d.cts.map +1 -0
  90. package/dist/node/components/favorite/lib/PopperId.js +4 -27
  91. package/dist/node/components/favorite/lib/PopperId.js.map +1 -1
  92. package/dist/node/components/favorite/lib/index.cjs +33 -0
  93. package/dist/node/components/favorite/lib/index.cjs.map +1 -0
  94. package/dist/node/components/favorite/lib/index.d.cts +2 -0
  95. package/dist/node/components/favorite/lib/index.d.cts.map +1 -0
  96. package/dist/node/components/favorite/lib/index.js +4 -21
  97. package/dist/node/components/favorite/lib/index.js.map +1 -1
  98. package/dist/node/components/index.cjs +247 -0
  99. package/dist/node/components/index.cjs.map +1 -0
  100. package/dist/node/components/index.d.cts +4 -0
  101. package/dist/node/components/index.d.cts.map +1 -0
  102. package/dist/node/components/index.js +215 -24
  103. package/dist/node/components/index.js.map +1 -1
  104. package/dist/node/components/lib/FavoriteItemEvent.cjs +36 -0
  105. package/dist/node/components/lib/FavoriteItemEvent.cjs.map +1 -0
  106. package/dist/node/components/lib/FavoriteItemEvent.d.cts +9 -0
  107. package/dist/node/components/lib/FavoriteItemEvent.d.cts.map +1 -0
  108. package/dist/node/components/lib/FavoriteItemEvent.js +4 -27
  109. package/dist/node/components/lib/FavoriteItemEvent.js.map +1 -1
  110. package/dist/node/components/lib/index.cjs +38 -0
  111. package/dist/node/components/lib/index.cjs.map +1 -0
  112. package/dist/node/components/lib/index.d.cts +2 -0
  113. package/dist/node/components/lib/index.d.cts.map +1 -0
  114. package/dist/node/components/lib/index.js +9 -21
  115. package/dist/node/components/lib/index.js.map +1 -1
  116. package/dist/node/index.cjs +247 -0
  117. package/dist/node/index.cjs.map +1 -0
  118. package/dist/node/index.d.cts +2 -0
  119. package/dist/node/index.d.cts.map +1 -0
  120. package/dist/node/index.js +215 -20
  121. package/dist/node/index.js.map +1 -1
  122. package/package.json +20 -20
  123. package/dist/browser/components/RenderRowBox.stories.js +0 -81
  124. package/dist/browser/components/RenderRowBox.stories.js.map +0 -1
  125. package/dist/node/components/RenderRowBox.mjs +0 -49
  126. package/dist/node/components/RenderRowBox.mjs.map +0 -1
  127. package/dist/node/components/RenderRowBox.stories.js +0 -111
  128. package/dist/node/components/RenderRowBox.stories.js.map +0 -1
  129. package/dist/node/components/RenderRowBox.stories.mjs +0 -81
  130. package/dist/node/components/RenderRowBox.stories.mjs.map +0 -1
  131. package/dist/node/components/favorite/FavoriteIconButton.mjs +0 -70
  132. package/dist/node/components/favorite/FavoriteIconButton.mjs.map +0 -1
  133. package/dist/node/components/favorite/FavoriteToggleSVG.mjs +0 -7
  134. package/dist/node/components/favorite/Popper.mjs +0 -54
  135. package/dist/node/components/favorite/Popper.mjs.map +0 -1
  136. package/dist/node/components/favorite/PopperButtonGroup.mjs +0 -35
  137. package/dist/node/components/favorite/index.mjs +0 -2
  138. package/dist/node/components/favorite/index.mjs.map +0 -1
  139. package/dist/node/components/favorite/lib/PopperId.mjs +0 -5
  140. package/dist/node/components/favorite/lib/index.mjs +0 -2
  141. package/dist/node/components/favorite/lib/index.mjs.map +0 -1
  142. package/dist/node/components/index.mjs +0 -4
  143. package/dist/node/components/index.mjs.map +0 -1
  144. package/dist/node/components/lib/FavoriteItemEvent.mjs +0 -10
  145. package/dist/node/components/lib/index.mjs +0 -2
  146. package/dist/node/components/lib/index.mjs.map +0 -1
  147. package/dist/node/index.mjs +0 -2
  148. package/dist/node/index.mjs.map +0 -1
@@ -0,0 +1,243 @@
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/components/RenderRowBox.tsx
21
+ var RenderRowBox_exports = {};
22
+ __export(RenderRowBox_exports, {
23
+ AddressRenderRowBox: () => AddressRenderRowBox
24
+ });
25
+ module.exports = __toCommonJS(RenderRowBox_exports);
26
+ var import_material4 = require("@mui/material");
27
+ var import_react_flexbox = require("@xylabs/react-flexbox");
28
+ var import_react_identicon = require("@xylabs/react-identicon");
29
+ var import_react_event2 = require("@xyo-network/react-event");
30
+ var import_react_shared2 = require("@xyo-network/react-shared");
31
+ var import_react3 = require("react");
32
+
33
+ // src/components/favorite/FavoriteIconButton.tsx
34
+ var import_material3 = require("@mui/material");
35
+ var import_react_event = require("@xyo-network/react-event");
36
+ var import_react_shared = require("@xyo-network/react-shared");
37
+ var import_react2 = require("react");
38
+
39
+ // src/components/lib/FavoriteItemEvent.ts
40
+ var generateFavoriteEvent = (favorite, favoriteType, favoriteValue, name) => ({
41
+ favorite: !!favorite,
42
+ favoriteType,
43
+ favoriteValue,
44
+ name
45
+ });
46
+
47
+ // src/components/favorite/FavoriteToggleSVG.tsx
48
+ var import_icons_material = require("@mui/icons-material");
49
+ var import_jsx_runtime = require("react/jsx-runtime");
50
+ var FavoriteToggleSVG = ({ favorite }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: favorite ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Star, { className: "favorite-icon", component: "svg", color: "secondary", fontSize: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.StarBorder, { className: "favorite-icon", fontSize: "small" }) });
51
+
52
+ // src/components/favorite/lib/PopperId.ts
53
+ var popperId = "favorite-popper";
54
+
55
+ // src/components/favorite/Popper.tsx
56
+ var import_material2 = require("@mui/material");
57
+ var import_react = require("react");
58
+
59
+ // src/components/favorite/PopperButtonGroup.tsx
60
+ var import_icons_material2 = require("@mui/icons-material");
61
+ var import_material = require("@mui/material");
62
+ var import_jsx_runtime2 = require("react/jsx-runtime");
63
+ var PopperButtonGroup = ({ name, onConfirmFavorite, favorite, ...props }) => {
64
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material.ButtonGroup, { ...props, children: [
65
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
66
+ import_material.Button,
67
+ {
68
+ title: "Save Favorite",
69
+ variant: "contained",
70
+ onClick: (e) => {
71
+ e.stopPropagation();
72
+ onConfirmFavorite == null ? void 0 : onConfirmFavorite(name, true);
73
+ },
74
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material2.Star, {})
75
+ }
76
+ ),
77
+ favorite ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
78
+ import_material.Button,
79
+ {
80
+ title: "Remove Favorite",
81
+ variant: "contained",
82
+ onClick: (e) => {
83
+ e.stopPropagation();
84
+ onConfirmFavorite == null ? void 0 : onConfirmFavorite(name, false);
85
+ },
86
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material2.Delete, {})
87
+ }
88
+ ) : null
89
+ ] });
90
+ };
91
+
92
+ // src/components/favorite/Popper.tsx
93
+ var import_jsx_runtime3 = require("react/jsx-runtime");
94
+ var FavoritePopper = (0, import_react.forwardRef)(
95
+ ({
96
+ name: nameProp,
97
+ favorite,
98
+ favoriteRef,
99
+ onClickAway = () => {
100
+ return;
101
+ },
102
+ onConfirmFavorite,
103
+ ...props
104
+ }, ref) => {
105
+ const [name, setName] = (0, import_react.useState)(nameProp);
106
+ (0, import_react.useEffect)(() => {
107
+ setName(nameProp);
108
+ }, [nameProp]);
109
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.ClickAwayListener, { onClickAway, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
110
+ PopperStyled,
111
+ {
112
+ id: popperId,
113
+ anchorEl: favoriteRef == null ? void 0 : favoriteRef.current,
114
+ onClick: (e) => e.stopPropagation(),
115
+ onTouchStart: (e) => e.stopPropagation(),
116
+ transition: true,
117
+ ref,
118
+ ...props,
119
+ children: ({ TransitionProps }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Fade, { ...TransitionProps, timeout: 350, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material2.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material2.CardContent, { sx: { display: "flex", gap: 1 }, children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
121
+ import_material2.TextField,
122
+ {
123
+ autoFocus: true,
124
+ label: "Favorite Name",
125
+ placeholder: "optional",
126
+ size: "small",
127
+ value: name ?? "",
128
+ onChange: (e) => setName(e.target.value)
129
+ }
130
+ ),
131
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PopperButtonGroup, { favorite, onConfirmFavorite, name })
132
+ ] }) }) })
133
+ }
134
+ ) });
135
+ }
136
+ );
137
+ FavoritePopper.displayName = "FavoritePopper";
138
+ var PopperStyled = (0, import_material2.styled)(import_material2.Popper, { name: "PopperStyled" })(() => ({ zIndex: 9999 }));
139
+
140
+ // src/components/favorite/FavoriteIconButton.tsx
141
+ var import_jsx_runtime4 = require("react/jsx-runtime");
142
+ var FavoriteIconButton = (0, import_react2.forwardRef)(
143
+ ({ children, favorite: favoriteProp, name, valueType, value, ...props }, ref) => {
144
+ const [openPopper, setOpenPopper] = (0, import_react2.useState)(false);
145
+ const [favorite, setFavorite] = (0, import_react2.useState)(favoriteProp);
146
+ (0, import_react2.useEffect)(() => {
147
+ setFavorite(favoriteProp);
148
+ }, [favoriteProp]);
149
+ const sharedRef = (0, import_react_shared.useShareForwardedRef)(ref);
150
+ const [buttonRef, dispatch] = (0, import_react_event.useEvent)(void 0, sharedRef);
151
+ const onConfirmFavorite = (name2, newFavoriteState) => {
152
+ const favoriteEvent = generateFavoriteEvent(!!newFavoriteState, valueType, value, name2);
153
+ dispatch("address", "favorite", JSON.stringify(favoriteEvent));
154
+ setFavorite(newFavoriteState);
155
+ setOpenPopper(false);
156
+ };
157
+ const starRef = (0, import_react2.useRef)(null);
158
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
159
+ IconButtonCondensed,
160
+ {
161
+ "aria-describedby": popperId,
162
+ ref: buttonRef,
163
+ onClick: (event) => {
164
+ event.stopPropagation();
165
+ setOpenPopper(!openPopper);
166
+ },
167
+ onTouchStart: (event) => {
168
+ event.stopPropagation();
169
+ setOpenPopper(!openPopper);
170
+ },
171
+ onMouseDown: (e) => e.stopPropagation(),
172
+ sx: { lineHeight: 0, p: 0.25 },
173
+ ...props,
174
+ children: [
175
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { ref: starRef, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FavoriteToggleSVG, { favorite }) }),
176
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
177
+ FavoritePopper,
178
+ {
179
+ sx: { zIndex: 1301 },
180
+ name,
181
+ favorite,
182
+ favoriteRef: starRef,
183
+ open: openPopper,
184
+ onConfirmFavorite,
185
+ onClickAway: () => setOpenPopper(false)
186
+ }
187
+ ),
188
+ children
189
+ ]
190
+ }
191
+ );
192
+ }
193
+ );
194
+ FavoriteIconButton.displayName = "FavoriteIconButton";
195
+ var IconButtonCondensed = (0, import_material3.styled)(import_material3.IconButton, { name: "IconButtonCondensed" })(({ theme }) => ({
196
+ lineHeight: 0,
197
+ padding: theme.spacing(0.25)
198
+ }));
199
+
200
+ // src/components/RenderRowBox.tsx
201
+ var import_jsx_runtime5 = require("react/jsx-runtime");
202
+ var AddressRenderRowBox = (0, import_react3.forwardRef)(
203
+ ({ address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
204
+ const theme = (0, import_material4.useTheme)();
205
+ const sharedRef = (0, import_react_shared2.useShareForwardedRef)(ref);
206
+ const [elementRef, dispatch] = (0, import_react_event2.useEvent)(void 0, sharedRef);
207
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
208
+ import_react_flexbox.FlexRow,
209
+ {
210
+ gap: 2,
211
+ justifyContent: "flex-start",
212
+ ref: elementRef,
213
+ onClick: () => {
214
+ if (address) {
215
+ dispatch("address", "click", address);
216
+ }
217
+ },
218
+ ...props,
219
+ children: [
220
+ icons && address ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material4.ListItemIcon, { sx: { minWidth: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_identicon.Identicon, { size: iconSize, value: address }) }) : null,
221
+ iconOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
222
+ import_react_shared2.EllipsizeBox,
223
+ {
224
+ disableSharedRef,
225
+ ellipsisPosition: "end",
226
+ width: "100%",
227
+ typographyProps: { fontSize: theme.typography.body1.fontSize },
228
+ children: name ?? address
229
+ }
230
+ ),
231
+ children,
232
+ showFavorite && address ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FavoriteIconButton, { name, size: "small", value: address, valueType: "address", favorite: favoriteProp }) : null
233
+ ]
234
+ }
235
+ );
236
+ }
237
+ );
238
+ AddressRenderRowBox.displayName = "AddressRenderRowBox";
239
+ // Annotate the CommonJS export names for ESM import in node:
240
+ 0 && (module.exports = {
241
+ AddressRenderRowBox
242
+ });
243
+ //# sourceMappingURL=RenderRowBox.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/RenderRowBox.tsx","../../../src/components/favorite/FavoriteIconButton.tsx","../../../src/components/lib/FavoriteItemEvent.ts","../../../src/components/favorite/FavoriteToggleSVG.tsx","../../../src/components/favorite/lib/PopperId.ts","../../../src/components/favorite/Popper.tsx","../../../src/components/favorite/PopperButtonGroup.tsx"],"sourcesContent":["import { ListItemIcon, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEvent } from '@xyo-network/react-event'\nimport { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { FavoriteIconButton } from './favorite'\n\nexport interface AddressRenderRowBoxProps extends FlexBoxProps {\n address?: string | null\n disableSharedRef?: boolean\n favorite?: boolean\n iconOnly?: boolean\n iconSize?: number\n icons?: boolean\n name?: string\n showFavorite?: boolean\n}\n\nexport const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxProps>(\n (\n { address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props },\n ref,\n ) => {\n const theme = useTheme()\n\n const sharedRef = useShareForwardedRef(ref)\n const [elementRef, dispatch] = useEvent(undefined, sharedRef)\n\n return (\n <FlexRow\n gap={2}\n justifyContent=\"flex-start\"\n ref={elementRef}\n onClick={() => {\n if (address) {\n dispatch('address', 'click', address)\n }\n }}\n {...props}\n >\n {icons && address ? (\n <ListItemIcon sx={{ minWidth: 0 }}>\n <Identicon size={iconSize} value={address} />\n </ListItemIcon>\n ) : null}\n {iconOnly ? null : (\n <EllipsizeBox\n disableSharedRef={disableSharedRef}\n ellipsisPosition={'end'}\n width=\"100%\"\n typographyProps={{ fontSize: theme.typography.body1.fontSize }}\n >\n {name ?? address}\n </EllipsizeBox>\n )}\n {children}\n {showFavorite && address ? (\n <FavoriteIconButton name={name} size={'small'} value={address} valueType={'address'} favorite={favoriteProp} />\n ) : null}\n </FlexRow>\n )\n },\n)\n\nAddressRenderRowBox.displayName = 'AddressRenderRowBox'\n","import { IconButton, IconButtonProps, styled } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useEvent } from '@xyo-network/react-event'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, useEffect, useRef, useState } from 'react'\n\nimport { FavoriteItemEvent, generateFavoriteEvent } from '../lib'\nimport { FavoriteToggleSVG } from './FavoriteToggleSVG'\nimport { popperId } from './lib'\nimport { FavoritePopper } from './Popper'\n\nexport interface FavoriteIconButtonProps extends WithChildren, IconButtonProps {\n favorite?: FavoriteItemEvent['favorite']\n name?: FavoriteItemEvent['name']\n value?: string\n valueType?: FavoriteItemEvent['favoriteType']\n}\n\nexport const FavoriteIconButton = forwardRef<HTMLButtonElement, FavoriteIconButtonProps>(\n ({ children, favorite: favoriteProp, name, valueType, value, ...props }, ref) => {\n const [openPopper, setOpenPopper] = useState(false)\n\n const [favorite, setFavorite] = useState(favoriteProp)\n useEffect(() => {\n setFavorite(favoriteProp)\n }, [favoriteProp])\n\n const sharedRef = useShareForwardedRef(ref)\n const [buttonRef, dispatch] = useEvent(undefined, sharedRef)\n\n const onConfirmFavorite = (name?: string, newFavoriteState?: boolean) => {\n const favoriteEvent = generateFavoriteEvent(!!newFavoriteState, valueType, value, name)\n dispatch('address', 'favorite', JSON.stringify(favoriteEvent))\n setFavorite(newFavoriteState)\n setOpenPopper(false)\n }\n\n const starRef = useRef<HTMLSpanElement>(null)\n\n return (\n <IconButtonCondensed\n aria-describedby={popperId}\n ref={buttonRef}\n onClick={(event) => {\n event.stopPropagation()\n setOpenPopper(!openPopper)\n }}\n onTouchStart={(event) => {\n event.stopPropagation()\n setOpenPopper(!openPopper)\n }}\n onMouseDown={(e) => e.stopPropagation()}\n sx={{ lineHeight: 0, p: 0.25 }}\n {...props}\n >\n <span ref={starRef}>\n <FavoriteToggleSVG favorite={favorite} />\n </span>\n <FavoritePopper\n sx={{ zIndex: 1301 }}\n name={name}\n favorite={favorite}\n favoriteRef={starRef}\n open={openPopper}\n onConfirmFavorite={onConfirmFavorite}\n onClickAway={() => setOpenPopper(false)}\n />\n {children}\n </IconButtonCondensed>\n )\n },\n)\n\nFavoriteIconButton.displayName = 'FavoriteIconButton'\n\nconst IconButtonCondensed = styled(IconButton, { name: 'IconButtonCondensed' })(({ theme }) => ({\n lineHeight: 0,\n padding: theme.spacing(0.25),\n}))\n","export interface FavoriteItemEvent {\n favorite?: boolean\n favoriteType?: FavoriteType\n favoriteValue?: string\n name?: string\n}\n\nexport type FavoriteType = 'address' | 'schema' | 'hash'\n\nexport const generateFavoriteEvent = (favorite?: boolean, favoriteType?: FavoriteType, favoriteValue?: string, name?: string): FavoriteItemEvent => ({\n favorite: !!favorite,\n favoriteType,\n favoriteValue,\n name,\n})\n","import { Star as StarIcon, StarBorder as StarBorderIcon } from '@mui/icons-material'\n\nexport const FavoriteToggleSVG: React.FC<{ favorite?: boolean }> = ({ favorite }) => (\n <>\n {favorite ? (\n <StarIcon className=\"favorite-icon\" component={'svg'} color=\"secondary\" fontSize=\"small\" />\n ) : (\n <StarBorderIcon className=\"favorite-icon\" fontSize=\"small\" />\n )}\n </>\n)\n","export const popperId = 'favorite-popper'\n","import { Card, CardContent, ClickAwayListener, Fade, Popper, PopperProps, styled, TextField } from '@mui/material'\nimport { forwardRef, RefObject, useEffect, useState } from 'react'\n\nimport { popperId } from './lib'\nimport { PopperButtonGroup } from './PopperButtonGroup'\n\nexport interface FavoritePopperProps extends PopperProps {\n favorite?: boolean\n favoriteRef?: RefObject<HTMLElement>\n name?: string\n onClickAway?: (event: MouseEvent | TouchEvent) => void\n onConfirmFavorite?: (name?: string, newFavoriteState?: boolean) => void\n}\nexport const FavoritePopper = forwardRef<HTMLDivElement, FavoritePopperProps>(\n (\n {\n name: nameProp,\n favorite,\n favoriteRef,\n onClickAway = () => {\n return\n },\n onConfirmFavorite,\n ...props\n },\n ref,\n ) => {\n const [name, setName] = useState(nameProp)\n useEffect(() => {\n setName(nameProp)\n }, [nameProp])\n\n return (\n <ClickAwayListener onClickAway={onClickAway}>\n <PopperStyled\n id={popperId}\n anchorEl={favoriteRef?.current}\n onClick={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n transition\n ref={ref}\n {...props}\n >\n {({ TransitionProps }) => (\n <Fade {...TransitionProps} timeout={350}>\n <Card>\n <CardContent sx={{ display: 'flex', gap: 1 }}>\n <TextField\n autoFocus\n label=\"Favorite Name\"\n placeholder=\"optional\"\n size=\"small\"\n value={name ?? ''}\n onChange={(e) => setName(e.target.value)}\n />\n <PopperButtonGroup favorite={favorite} onConfirmFavorite={onConfirmFavorite} name={name} />\n </CardContent>\n </Card>\n </Fade>\n )}\n </PopperStyled>\n </ClickAwayListener>\n )\n },\n)\n\nFavoritePopper.displayName = 'FavoritePopper'\n\n// Ensure the popper is over all other mui portal elements\nconst PopperStyled = styled(Popper, { name: 'PopperStyled' })(() => ({ zIndex: 9999 }))\n","import { Delete as DeleteIcon, Star as StarIcon } from '@mui/icons-material'\nimport { Button, ButtonGroup, ButtonGroupProps } from '@mui/material'\n\nexport interface FavoritePopperProps extends ButtonGroupProps {\n favorite?: boolean\n name?: string\n onConfirmFavorite?: (name?: string, newFavoriteState?: boolean) => void\n}\n\nexport const PopperButtonGroup: React.FC<FavoritePopperProps> = ({ name, onConfirmFavorite, favorite, ...props }) => {\n return (\n <ButtonGroup {...props}>\n <Button\n title=\"Save Favorite\"\n variant=\"contained\"\n onClick={(e) => {\n e.stopPropagation()\n onConfirmFavorite?.(name, true)\n }}\n >\n <StarIcon />\n </Button>\n {favorite ? (\n <Button\n title=\"Remove Favorite\"\n variant=\"contained\"\n onClick={(e) => {\n e.stopPropagation()\n onConfirmFavorite?.(name, false)\n }}\n >\n <DeleteIcon />\n </Button>\n ) : null}\n </ButtonGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,mBAAuC;AACvC,2BAAsC;AACtC,6BAA0B;AAC1B,IAAAC,sBAAyB;AACzB,IAAAC,uBAAmD;AACnD,IAAAC,gBAA2B;;;ACL3B,IAAAC,mBAAoD;AAEpD,yBAAyB;AACzB,0BAAqC;AACrC,IAAAC,gBAAwD;;;ACKjD,IAAM,wBAAwB,CAAC,UAAoB,cAA6B,eAAwB,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AO,MAAM,eAAe,OAAO,GAAG,MAAM,GAC5I,QACG;AACH,UAAM,YAAQ,2BAAS;AAEvB,UAAM,gBAAY,2CAAqB,GAAG;AAC1C,UAAM,CAAC,YAAY,QAAQ,QAAI,8BAAS,QAAW,SAAS;AAE5D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,gBAAe;AAAA,QACf,KAAK;AAAA,QACL,SAAS,MAAM;AACb,cAAI,SAAS;AACX,qBAAS,WAAW,SAAS,OAAO;AAAA,UACtC;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,mBAAS,UACR,6CAAC,iCAAa,IAAI,EAAE,UAAU,EAAE,GAC9B,uDAAC,oCAAU,MAAM,UAAU,OAAO,SAAS,GAC7C,IACE;AAAA,UACH,WAAW,OACV;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,kBAAkB;AAAA,cAClB,OAAM;AAAA,cACN,iBAAiB,EAAE,UAAU,MAAM,WAAW,MAAM,SAAS;AAAA,cAE5D,kBAAQ;AAAA;AAAA,UACX;AAAA,UAED;AAAA,UACA,gBAAgB,UACf,6CAAC,sBAAmB,MAAY,MAAM,SAAS,OAAO,SAAS,WAAW,WAAW,UAAU,cAAc,IAC3G;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;","names":["import_material","import_react_event","import_react_shared","import_react","import_material","import_react","StarIcon","StarBorderIcon","import_material","import_icons_material","import_jsx_runtime","StarIcon","DeleteIcon","import_jsx_runtime","import_jsx_runtime","name","import_jsx_runtime"]}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FlexBoxProps } from '@xylabs/react-flexbox';
3
+ export interface AddressRenderRowBoxProps extends FlexBoxProps {
4
+ address?: string | null;
5
+ disableSharedRef?: boolean;
6
+ favorite?: boolean;
7
+ iconOnly?: boolean;
8
+ iconSize?: number;
9
+ icons?: boolean;
10
+ name?: string;
11
+ showFavorite?: boolean;
12
+ }
13
+ export declare const AddressRenderRowBox: import("react").ForwardRefExoticComponent<AddressRenderRowBoxProps & import("react").RefAttributes<HTMLElement>>;
14
+ //# sourceMappingURL=RenderRowBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderRowBox.d.ts","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAQ7D,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,mBAAmB,kHA4C/B,CAAA"}
@@ -1,41 +1,187 @@
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 });
1
+ // src/components/RenderRowBox.tsx
2
+ import { ListItemIcon, useTheme } from "@mui/material";
3
+ import { FlexRow } from "@xylabs/react-flexbox";
4
+ import { Identicon } from "@xylabs/react-identicon";
5
+ import { useEvent as useEvent2 } from "@xyo-network/react-event";
6
+ import { EllipsizeBox, useShareForwardedRef as useShareForwardedRef2 } from "@xyo-network/react-shared";
7
+ import { forwardRef as forwardRef3 } from "react";
8
+
9
+ // src/components/favorite/FavoriteIconButton.tsx
10
+ import { IconButton, styled as styled2 } from "@mui/material";
11
+ import { useEvent } from "@xyo-network/react-event";
12
+ import { useShareForwardedRef } from "@xyo-network/react-shared";
13
+ import { forwardRef as forwardRef2, useEffect as useEffect2, useRef, useState as useState2 } from "react";
14
+
15
+ // src/components/lib/FavoriteItemEvent.ts
16
+ var generateFavoriteEvent = (favorite, favoriteType, favoriteValue, name) => ({
17
+ favorite: !!favorite,
18
+ favoriteType,
19
+ favoriteValue,
20
+ name
21
+ });
22
+
23
+ // src/components/favorite/FavoriteToggleSVG.tsx
24
+ import { Star as StarIcon, StarBorder as StarBorderIcon } from "@mui/icons-material";
25
+ import { Fragment, jsx } from "react/jsx-runtime";
26
+ var FavoriteToggleSVG = ({ favorite }) => /* @__PURE__ */ jsx(Fragment, { children: favorite ? /* @__PURE__ */ jsx(StarIcon, { className: "favorite-icon", component: "svg", color: "secondary", fontSize: "small" }) : /* @__PURE__ */ jsx(StarBorderIcon, { className: "favorite-icon", fontSize: "small" }) });
27
+
28
+ // src/components/favorite/lib/PopperId.ts
29
+ var popperId = "favorite-popper";
30
+
31
+ // src/components/favorite/Popper.tsx
32
+ import { Card, CardContent, ClickAwayListener, Fade, Popper, styled, TextField } from "@mui/material";
33
+ import { forwardRef, useEffect, useState } from "react";
34
+
35
+ // src/components/favorite/PopperButtonGroup.tsx
36
+ import { Delete as DeleteIcon, Star as StarIcon2 } from "@mui/icons-material";
37
+ import { Button, ButtonGroup } from "@mui/material";
38
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
39
+ var PopperButtonGroup = ({ name, onConfirmFavorite, favorite, ...props }) => {
40
+ return /* @__PURE__ */ jsxs(ButtonGroup, { ...props, children: [
41
+ /* @__PURE__ */ jsx2(
42
+ Button,
43
+ {
44
+ title: "Save Favorite",
45
+ variant: "contained",
46
+ onClick: (e) => {
47
+ e.stopPropagation();
48
+ onConfirmFavorite == null ? void 0 : onConfirmFavorite(name, true);
49
+ },
50
+ children: /* @__PURE__ */ jsx2(StarIcon2, {})
51
+ }
52
+ ),
53
+ favorite ? /* @__PURE__ */ jsx2(
54
+ Button,
55
+ {
56
+ title: "Remove Favorite",
57
+ variant: "contained",
58
+ onClick: (e) => {
59
+ e.stopPropagation();
60
+ onConfirmFavorite == null ? void 0 : onConfirmFavorite(name, false);
61
+ },
62
+ children: /* @__PURE__ */ jsx2(DeleteIcon, {})
63
+ }
64
+ ) : null
65
+ ] });
9
66
  };
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 });
67
+
68
+ // src/components/favorite/Popper.tsx
69
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
70
+ var FavoritePopper = forwardRef(
71
+ ({
72
+ name: nameProp,
73
+ favorite,
74
+ favoriteRef,
75
+ onClickAway = () => {
76
+ return;
77
+ },
78
+ onConfirmFavorite,
79
+ ...props
80
+ }, ref) => {
81
+ const [name, setName] = useState(nameProp);
82
+ useEffect(() => {
83
+ setName(nameProp);
84
+ }, [nameProp]);
85
+ return /* @__PURE__ */ jsx3(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx3(
86
+ PopperStyled,
87
+ {
88
+ id: popperId,
89
+ anchorEl: favoriteRef == null ? void 0 : favoriteRef.current,
90
+ onClick: (e) => e.stopPropagation(),
91
+ onTouchStart: (e) => e.stopPropagation(),
92
+ transition: true,
93
+ ref,
94
+ ...props,
95
+ children: ({ TransitionProps }) => /* @__PURE__ */ jsx3(Fade, { ...TransitionProps, timeout: 350, children: /* @__PURE__ */ jsx3(Card, { children: /* @__PURE__ */ jsxs2(CardContent, { sx: { display: "flex", gap: 1 }, children: [
96
+ /* @__PURE__ */ jsx3(
97
+ TextField,
98
+ {
99
+ autoFocus: true,
100
+ label: "Favorite Name",
101
+ placeholder: "optional",
102
+ size: "small",
103
+ value: name ?? "",
104
+ onChange: (e) => setName(e.target.value)
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx3(PopperButtonGroup, { favorite, onConfirmFavorite, name })
108
+ ] }) }) })
109
+ }
110
+ ) });
15
111
  }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var RenderRowBox_exports = {};
20
- __export(RenderRowBox_exports, {
21
- AddressRenderRowBox: () => AddressRenderRowBox
22
- });
23
- module.exports = __toCommonJS(RenderRowBox_exports);
24
- var import_jsx_runtime = require("react/jsx-runtime");
25
- var import_material = require("@mui/material");
26
- var import_react_flexbox = require("@xylabs/react-flexbox");
27
- var import_react_identicon = require("@xylabs/react-identicon");
28
- var import_react_event = require("@xyo-network/react-event");
29
- var import_react_shared = require("@xyo-network/react-shared");
30
- var import_react = require("react");
31
- var import_favorite = require("./favorite");
32
- const AddressRenderRowBox = (0, import_react.forwardRef)(
112
+ );
113
+ FavoritePopper.displayName = "FavoritePopper";
114
+ var PopperStyled = styled(Popper, { name: "PopperStyled" })(() => ({ zIndex: 9999 }));
115
+
116
+ // src/components/favorite/FavoriteIconButton.tsx
117
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
118
+ var FavoriteIconButton = forwardRef2(
119
+ ({ children, favorite: favoriteProp, name, valueType, value, ...props }, ref) => {
120
+ const [openPopper, setOpenPopper] = useState2(false);
121
+ const [favorite, setFavorite] = useState2(favoriteProp);
122
+ useEffect2(() => {
123
+ setFavorite(favoriteProp);
124
+ }, [favoriteProp]);
125
+ const sharedRef = useShareForwardedRef(ref);
126
+ const [buttonRef, dispatch] = useEvent(void 0, sharedRef);
127
+ const onConfirmFavorite = (name2, newFavoriteState) => {
128
+ const favoriteEvent = generateFavoriteEvent(!!newFavoriteState, valueType, value, name2);
129
+ dispatch("address", "favorite", JSON.stringify(favoriteEvent));
130
+ setFavorite(newFavoriteState);
131
+ setOpenPopper(false);
132
+ };
133
+ const starRef = useRef(null);
134
+ return /* @__PURE__ */ jsxs3(
135
+ IconButtonCondensed,
136
+ {
137
+ "aria-describedby": popperId,
138
+ ref: buttonRef,
139
+ onClick: (event) => {
140
+ event.stopPropagation();
141
+ setOpenPopper(!openPopper);
142
+ },
143
+ onTouchStart: (event) => {
144
+ event.stopPropagation();
145
+ setOpenPopper(!openPopper);
146
+ },
147
+ onMouseDown: (e) => e.stopPropagation(),
148
+ sx: { lineHeight: 0, p: 0.25 },
149
+ ...props,
150
+ children: [
151
+ /* @__PURE__ */ jsx4("span", { ref: starRef, children: /* @__PURE__ */ jsx4(FavoriteToggleSVG, { favorite }) }),
152
+ /* @__PURE__ */ jsx4(
153
+ FavoritePopper,
154
+ {
155
+ sx: { zIndex: 1301 },
156
+ name,
157
+ favorite,
158
+ favoriteRef: starRef,
159
+ open: openPopper,
160
+ onConfirmFavorite,
161
+ onClickAway: () => setOpenPopper(false)
162
+ }
163
+ ),
164
+ children
165
+ ]
166
+ }
167
+ );
168
+ }
169
+ );
170
+ FavoriteIconButton.displayName = "FavoriteIconButton";
171
+ var IconButtonCondensed = styled2(IconButton, { name: "IconButtonCondensed" })(({ theme }) => ({
172
+ lineHeight: 0,
173
+ padding: theme.spacing(0.25)
174
+ }));
175
+
176
+ // src/components/RenderRowBox.tsx
177
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
178
+ var AddressRenderRowBox = forwardRef3(
33
179
  ({ address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
34
- const theme = (0, import_material.useTheme)();
35
- const sharedRef = (0, import_react_shared.useShareForwardedRef)(ref);
36
- const [elementRef, dispatch] = (0, import_react_event.useEvent)(void 0, sharedRef);
37
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
38
- import_react_flexbox.FlexRow,
180
+ const theme = useTheme();
181
+ const sharedRef = useShareForwardedRef2(ref);
182
+ const [elementRef, dispatch] = useEvent2(void 0, sharedRef);
183
+ return /* @__PURE__ */ jsxs4(
184
+ FlexRow,
39
185
  {
40
186
  gap: 2,
41
187
  justifyContent: "flex-start",
@@ -47,9 +193,9 @@ const AddressRenderRowBox = (0, import_react.forwardRef)(
47
193
  },
48
194
  ...props,
49
195
  children: [
50
- icons && address ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ListItemIcon, { sx: { minWidth: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_identicon.Identicon, { size: iconSize, value: address }) }) : null,
51
- iconOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
- import_react_shared.EllipsizeBox,
196
+ icons && address ? /* @__PURE__ */ jsx5(ListItemIcon, { sx: { minWidth: 0 }, children: /* @__PURE__ */ jsx5(Identicon, { size: iconSize, value: address }) }) : null,
197
+ iconOnly ? null : /* @__PURE__ */ jsx5(
198
+ EllipsizeBox,
53
199
  {
54
200
  disableSharedRef,
55
201
  ellipsisPosition: "end",
@@ -59,15 +205,14 @@ const AddressRenderRowBox = (0, import_react.forwardRef)(
59
205
  }
60
206
  ),
61
207
  children,
62
- showFavorite && address ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_favorite.FavoriteIconButton, { name, size: "small", value: address, valueType: "address", favorite: favoriteProp }) : null
208
+ showFavorite && address ? /* @__PURE__ */ jsx5(FavoriteIconButton, { name, size: "small", value: address, valueType: "address", favorite: favoriteProp }) : null
63
209
  ]
64
210
  }
65
211
  );
66
212
  }
67
213
  );
68
214
  AddressRenderRowBox.displayName = "AddressRenderRowBox";
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
215
+ export {
71
216
  AddressRenderRowBox
72
- });
217
+ };
73
218
  //# sourceMappingURL=RenderRowBox.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/RenderRowBox.tsx"],"sourcesContent":["import { ListItemIcon, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEvent } from '@xyo-network/react-event'\nimport { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { FavoriteIconButton } from './favorite'\n\nexport interface AddressRenderRowBoxProps extends FlexBoxProps {\n address?: string | null\n disableSharedRef?: boolean\n favorite?: boolean\n iconOnly?: boolean\n iconSize?: number\n icons?: boolean\n name?: string\n showFavorite?: boolean\n}\n\nexport const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxProps>(\n (\n { address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props },\n ref,\n ) => {\n const theme = useTheme()\n\n const sharedRef = useShareForwardedRef(ref)\n const [elementRef, dispatch] = useEvent(undefined, sharedRef)\n\n return (\n <FlexRow\n gap={2}\n justifyContent=\"flex-start\"\n ref={elementRef}\n onClick={() => {\n if (address) {\n dispatch('address', 'click', address)\n }\n }}\n {...props}\n >\n {icons && address ? (\n <ListItemIcon sx={{ minWidth: 0 }}>\n <Identicon size={iconSize} value={address} />\n </ListItemIcon>\n ) : null}\n {iconOnly ? null : (\n <EllipsizeBox\n disableSharedRef={disableSharedRef}\n ellipsisPosition={'end'}\n width=\"100%\"\n typographyProps={{ fontSize: theme.typography.body1.fontSize }}\n >\n {name ?? address}\n </EllipsizeBox>\n )}\n {children}\n {showFavorite && address ? (\n <FavoriteIconButton name={name} size={'small'} value={address} valueType={'address'} favorite={favoriteProp} />\n ) : null}\n </FlexRow>\n )\n },\n)\n\nAddressRenderRowBox.displayName = 'AddressRenderRowBox'\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BM;AA/BN,sBAAuC;AACvC,2BAAsC;AACtC,6BAA0B;AAC1B,yBAAyB;AACzB,0BAAmD;AACnD,mBAA2B;AAE3B,sBAAmC;AAa5B,MAAM,0BAAsB;AAAA,EACjC,CACE,EAAE,SAAS,UAAU,kBAAkB,UAAU,eAAe,OAAO,UAAU,WAAW,IAAI,OAAO,MAAM,eAAe,OAAO,GAAG,MAAM,GAC5I,QACG;AACH,UAAM,YAAQ,0BAAS;AAEvB,UAAM,gBAAY,0CAAqB,GAAG;AAC1C,UAAM,CAAC,YAAY,QAAQ,QAAI,6BAAS,QAAW,SAAS;AAE5D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,gBAAe;AAAA,QACf,KAAK;AAAA,QACL,SAAS,MAAM;AACb,cAAI,SAAS;AACX,qBAAS,WAAW,SAAS,OAAO;AAAA,UACtC;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,mBAAS,UACR,4CAAC,gCAAa,IAAI,EAAE,UAAU,EAAE,GAC9B,sDAAC,oCAAU,MAAM,UAAU,OAAO,SAAS,GAC7C,IACE;AAAA,UACH,WAAW,OACV;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,kBAAkB;AAAA,cAClB,OAAM;AAAA,cACN,iBAAiB,EAAE,UAAU,MAAM,WAAW,MAAM,SAAS;AAAA,cAE5D,kBAAQ;AAAA;AAAA,UACX;AAAA,UAED;AAAA,UACA,gBAAgB,UACf,4CAAC,sCAAmB,MAAY,MAAM,SAAS,OAAO,SAAS,WAAW,WAAW,UAAU,cAAc,IAC3G;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/RenderRowBox.tsx","../../../src/components/favorite/FavoriteIconButton.tsx","../../../src/components/lib/FavoriteItemEvent.ts","../../../src/components/favorite/FavoriteToggleSVG.tsx","../../../src/components/favorite/lib/PopperId.ts","../../../src/components/favorite/Popper.tsx","../../../src/components/favorite/PopperButtonGroup.tsx"],"sourcesContent":["import { ListItemIcon, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEvent } from '@xyo-network/react-event'\nimport { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { FavoriteIconButton } from './favorite'\n\nexport interface AddressRenderRowBoxProps extends FlexBoxProps {\n address?: string | null\n disableSharedRef?: boolean\n favorite?: boolean\n iconOnly?: boolean\n iconSize?: number\n icons?: boolean\n name?: string\n showFavorite?: boolean\n}\n\nexport const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxProps>(\n (\n { address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props },\n ref,\n ) => {\n const theme = useTheme()\n\n const sharedRef = useShareForwardedRef(ref)\n const [elementRef, dispatch] = useEvent(undefined, sharedRef)\n\n return (\n <FlexRow\n gap={2}\n justifyContent=\"flex-start\"\n ref={elementRef}\n onClick={() => {\n if (address) {\n dispatch('address', 'click', address)\n }\n }}\n {...props}\n >\n {icons && address ? (\n <ListItemIcon sx={{ minWidth: 0 }}>\n <Identicon size={iconSize} value={address} />\n </ListItemIcon>\n ) : null}\n {iconOnly ? null : (\n <EllipsizeBox\n disableSharedRef={disableSharedRef}\n ellipsisPosition={'end'}\n width=\"100%\"\n typographyProps={{ fontSize: theme.typography.body1.fontSize }}\n >\n {name ?? address}\n </EllipsizeBox>\n )}\n {children}\n {showFavorite && address ? (\n <FavoriteIconButton name={name} size={'small'} value={address} valueType={'address'} favorite={favoriteProp} />\n ) : null}\n </FlexRow>\n )\n },\n)\n\nAddressRenderRowBox.displayName = 'AddressRenderRowBox'\n","import { IconButton, IconButtonProps, styled } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useEvent } from '@xyo-network/react-event'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, useEffect, useRef, useState } from 'react'\n\nimport { FavoriteItemEvent, generateFavoriteEvent } from '../lib'\nimport { FavoriteToggleSVG } from './FavoriteToggleSVG'\nimport { popperId } from './lib'\nimport { FavoritePopper } from './Popper'\n\nexport interface FavoriteIconButtonProps extends WithChildren, IconButtonProps {\n favorite?: FavoriteItemEvent['favorite']\n name?: FavoriteItemEvent['name']\n value?: string\n valueType?: FavoriteItemEvent['favoriteType']\n}\n\nexport const FavoriteIconButton = forwardRef<HTMLButtonElement, FavoriteIconButtonProps>(\n ({ children, favorite: favoriteProp, name, valueType, value, ...props }, ref) => {\n const [openPopper, setOpenPopper] = useState(false)\n\n const [favorite, setFavorite] = useState(favoriteProp)\n useEffect(() => {\n setFavorite(favoriteProp)\n }, [favoriteProp])\n\n const sharedRef = useShareForwardedRef(ref)\n const [buttonRef, dispatch] = useEvent(undefined, sharedRef)\n\n const onConfirmFavorite = (name?: string, newFavoriteState?: boolean) => {\n const favoriteEvent = generateFavoriteEvent(!!newFavoriteState, valueType, value, name)\n dispatch('address', 'favorite', JSON.stringify(favoriteEvent))\n setFavorite(newFavoriteState)\n setOpenPopper(false)\n }\n\n const starRef = useRef<HTMLSpanElement>(null)\n\n return (\n <IconButtonCondensed\n aria-describedby={popperId}\n ref={buttonRef}\n onClick={(event) => {\n event.stopPropagation()\n setOpenPopper(!openPopper)\n }}\n onTouchStart={(event) => {\n event.stopPropagation()\n setOpenPopper(!openPopper)\n }}\n onMouseDown={(e) => e.stopPropagation()}\n sx={{ lineHeight: 0, p: 0.25 }}\n {...props}\n >\n <span ref={starRef}>\n <FavoriteToggleSVG favorite={favorite} />\n </span>\n <FavoritePopper\n sx={{ zIndex: 1301 }}\n name={name}\n favorite={favorite}\n favoriteRef={starRef}\n open={openPopper}\n onConfirmFavorite={onConfirmFavorite}\n onClickAway={() => setOpenPopper(false)}\n />\n {children}\n </IconButtonCondensed>\n )\n },\n)\n\nFavoriteIconButton.displayName = 'FavoriteIconButton'\n\nconst IconButtonCondensed = styled(IconButton, { name: 'IconButtonCondensed' })(({ theme }) => ({\n lineHeight: 0,\n padding: theme.spacing(0.25),\n}))\n","export interface FavoriteItemEvent {\n favorite?: boolean\n favoriteType?: FavoriteType\n favoriteValue?: string\n name?: string\n}\n\nexport type FavoriteType = 'address' | 'schema' | 'hash'\n\nexport const generateFavoriteEvent = (favorite?: boolean, favoriteType?: FavoriteType, favoriteValue?: string, name?: string): FavoriteItemEvent => ({\n favorite: !!favorite,\n favoriteType,\n favoriteValue,\n name,\n})\n","import { Star as StarIcon, StarBorder as StarBorderIcon } from '@mui/icons-material'\n\nexport const FavoriteToggleSVG: React.FC<{ favorite?: boolean }> = ({ favorite }) => (\n <>\n {favorite ? (\n <StarIcon className=\"favorite-icon\" component={'svg'} color=\"secondary\" fontSize=\"small\" />\n ) : (\n <StarBorderIcon className=\"favorite-icon\" fontSize=\"small\" />\n )}\n </>\n)\n","export const popperId = 'favorite-popper'\n","import { Card, CardContent, ClickAwayListener, Fade, Popper, PopperProps, styled, TextField } from '@mui/material'\nimport { forwardRef, RefObject, useEffect, useState } from 'react'\n\nimport { popperId } from './lib'\nimport { PopperButtonGroup } from './PopperButtonGroup'\n\nexport interface FavoritePopperProps extends PopperProps {\n favorite?: boolean\n favoriteRef?: RefObject<HTMLElement>\n name?: string\n onClickAway?: (event: MouseEvent | TouchEvent) => void\n onConfirmFavorite?: (name?: string, newFavoriteState?: boolean) => void\n}\nexport const FavoritePopper = forwardRef<HTMLDivElement, FavoritePopperProps>(\n (\n {\n name: nameProp,\n favorite,\n favoriteRef,\n onClickAway = () => {\n return\n },\n onConfirmFavorite,\n ...props\n },\n ref,\n ) => {\n const [name, setName] = useState(nameProp)\n useEffect(() => {\n setName(nameProp)\n }, [nameProp])\n\n return (\n <ClickAwayListener onClickAway={onClickAway}>\n <PopperStyled\n id={popperId}\n anchorEl={favoriteRef?.current}\n onClick={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n transition\n ref={ref}\n {...props}\n >\n {({ TransitionProps }) => (\n <Fade {...TransitionProps} timeout={350}>\n <Card>\n <CardContent sx={{ display: 'flex', gap: 1 }}>\n <TextField\n autoFocus\n label=\"Favorite Name\"\n placeholder=\"optional\"\n size=\"small\"\n value={name ?? ''}\n onChange={(e) => setName(e.target.value)}\n />\n <PopperButtonGroup favorite={favorite} onConfirmFavorite={onConfirmFavorite} name={name} />\n </CardContent>\n </Card>\n </Fade>\n )}\n </PopperStyled>\n </ClickAwayListener>\n )\n },\n)\n\nFavoritePopper.displayName = 'FavoritePopper'\n\n// Ensure the popper is over all other mui portal elements\nconst PopperStyled = styled(Popper, { name: 'PopperStyled' })(() => ({ zIndex: 9999 }))\n","import { Delete as DeleteIcon, Star as StarIcon } from '@mui/icons-material'\nimport { Button, ButtonGroup, ButtonGroupProps } from '@mui/material'\n\nexport interface FavoritePopperProps extends ButtonGroupProps {\n favorite?: boolean\n name?: string\n onConfirmFavorite?: (name?: string, newFavoriteState?: boolean) => void\n}\n\nexport const PopperButtonGroup: React.FC<FavoritePopperProps> = ({ name, onConfirmFavorite, favorite, ...props }) => {\n return (\n <ButtonGroup {...props}>\n <Button\n title=\"Save Favorite\"\n variant=\"contained\"\n onClick={(e) => {\n e.stopPropagation()\n onConfirmFavorite?.(name, true)\n }}\n >\n <StarIcon />\n </Button>\n {favorite ? (\n <Button\n title=\"Remove Favorite\"\n variant=\"contained\"\n onClick={(e) => {\n e.stopPropagation()\n onConfirmFavorite?.(name, false)\n }}\n >\n <DeleteIcon />\n </Button>\n ) : null}\n </ButtonGroup>\n )\n}\n"],"mappings":";AAAA,SAAS,cAAc,gBAAgB;AACvC,SAAuB,eAAe;AACtC,SAAS,iBAAiB;AAC1B,SAAS,YAAAA,iBAAgB;AACzB,SAAS,cAAc,wBAAAC,6BAA4B;AACnD,SAAS,cAAAC,mBAAkB;;;ACL3B,SAAS,YAA6B,UAAAC,eAAc;AAEpD,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AACrC,SAAS,cAAAC,aAAY,aAAAC,YAAW,QAAQ,YAAAC,iBAAgB;;;ACKjD,IAAM,wBAAwB,CAAC,UAAoB,cAA6B,eAAwB,UAAsC;AAAA,EACnJ,UAAU,CAAC,CAAC;AAAA,EACZ;AAAA,EACA;AA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SAAS,MAAM,QAAQ,IAAI;AAC7B,EAAE;;;AD/CI,SAaM,OAAAC,MAbN,QAAAC,aAAA;AAXC,IAAM,sBAAsBC;AAAA,EACjC,CACE,EAAE,SAAS,UAAU,kBAAkB,UAAU,eAAe,OAAO,UAAU,WAAW,IAAI,OAAO,MAAM,eAAe,OAAO,GAAG,MAAM,GAC5I,QACG;AACH,UAAM,QAAQ,SAAS;AAEvB,UAAM,YAAYC,sBAAqB,GAAG;AAC1C,UAAM,CAAC,YAAY,QAAQ,IAAIC,UAAS,QAAW,SAAS;AAE5D,WACE,gBAAAH;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,gBAAe;AAAA,QACf,KAAK;AAAA,QACL,SAAS,MAAM;AACb,cAAI,SAAS;AACX,qBAAS,WAAW,SAAS,OAAO;AAAA,UACtC;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,mBAAS,UACR,gBAAAD,KAAC,gBAAa,IAAI,EAAE,UAAU,EAAE,GAC9B,0BAAAA,KAAC,aAAU,MAAM,UAAU,OAAO,SAAS,GAC7C,IACE;AAAA,UACH,WAAW,OACV,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,kBAAkB;AAAA,cAClB,OAAM;AAAA,cACN,iBAAiB,EAAE,UAAU,MAAM,WAAW,MAAM,SAAS;AAAA,cAE5D,kBAAQ;AAAA;AAAA,UACX;AAAA,UAED;AAAA,UACA,gBAAgB,UACf,gBAAAA,KAAC,sBAAmB,MAAY,MAAM,SAAS,OAAO,SAAS,WAAW,WAAW,UAAU,cAAc,IAC3G;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,oBAAoB,cAAc;","names":["useEvent","useShareForwardedRef","forwardRef","styled","forwardRef","useEffect","useState","StarIcon","jsx","jsx","jsxs","jsx","jsxs","forwardRef","useState","useEffect","name","styled","jsx","jsxs","forwardRef","useShareForwardedRef","useEvent"]}