@xyo-network/react-address-render 2.63.1 → 2.64.0-rc.1
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/components/RenderRowBox.d.mts.map +1 -0
- package/dist/components/RenderRowBox.d.ts +14 -0
- package/dist/components/RenderRowBox.d.ts.map +1 -0
- package/dist/components/RenderRowBox.stories.d.mts +12 -0
- package/dist/components/RenderRowBox.stories.d.mts.map +1 -0
- package/dist/components/RenderRowBox.stories.d.ts +12 -0
- package/dist/components/RenderRowBox.stories.d.ts.map +1 -0
- package/dist/components/favorite/FavoriteIconButton.d.mts.map +1 -0
- package/dist/components/favorite/FavoriteIconButton.d.ts +12 -0
- package/dist/components/favorite/FavoriteIconButton.d.ts.map +1 -0
- package/dist/components/favorite/FavoriteToggleSVG.d.mts.map +1 -0
- package/dist/components/favorite/FavoriteToggleSVG.d.ts +5 -0
- package/dist/components/favorite/FavoriteToggleSVG.d.ts.map +1 -0
- package/dist/components/favorite/Popper.d.mts.map +1 -0
- package/dist/components/favorite/Popper.d.ts +11 -0
- package/dist/components/favorite/Popper.d.ts.map +1 -0
- package/dist/components/favorite/PopperButtonGroup.d.mts.map +1 -0
- package/dist/components/favorite/PopperButtonGroup.d.ts +9 -0
- package/dist/components/favorite/PopperButtonGroup.d.ts.map +1 -0
- package/dist/components/favorite/index.d.mts.map +1 -0
- package/dist/{esm/components/favorite/index.js → components/favorite/index.d.ts} +1 -1
- package/dist/components/favorite/index.d.ts.map +1 -0
- package/dist/components/favorite/lib/PopperId.d.mts.map +1 -0
- package/dist/components/favorite/lib/PopperId.d.ts +2 -0
- package/dist/components/favorite/lib/PopperId.d.ts.map +1 -0
- package/dist/components/favorite/lib/index.d.mts.map +1 -0
- package/dist/components/favorite/lib/index.d.ts +2 -0
- package/dist/components/favorite/lib/index.d.ts.map +1 -0
- package/dist/components/index.d.mts.map +1 -0
- package/dist/{esm/components/index.js → components/index.d.ts} +1 -1
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/lib/FavoriteItemEvent.d.mts.map +1 -0
- package/dist/components/lib/FavoriteItemEvent.d.ts +9 -0
- package/dist/components/lib/FavoriteItemEvent.d.ts.map +1 -0
- package/dist/components/lib/index.d.mts.map +1 -0
- package/dist/{esm/components/lib/index.js → components/lib/index.d.ts} +1 -1
- package/dist/components/lib/index.d.ts.map +1 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/{types/index.d.ts.map → index.d.ts.map} +1 -1
- package/dist/index.js +247 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +218 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +31 -22
- package/src/components/favorite/FavoriteToggleSVG.tsx +1 -2
- package/src/components/favorite/PopperButtonGroup.tsx +1 -2
- package/dist/cjs/components/RenderRowBox.js +0 -25
- package/dist/cjs/components/RenderRowBox.js.map +0 -1
- package/dist/cjs/components/favorite/FavoriteIconButton.js +0 -43
- package/dist/cjs/components/favorite/FavoriteIconButton.js.map +0 -1
- package/dist/cjs/components/favorite/FavoriteToggleSVG.js +0 -10
- package/dist/cjs/components/favorite/FavoriteToggleSVG.js.map +0 -1
- package/dist/cjs/components/favorite/Popper.js +0 -23
- package/dist/cjs/components/favorite/Popper.js.map +0 -1
- package/dist/cjs/components/favorite/PopperButtonGroup.js +0 -20
- package/dist/cjs/components/favorite/PopperButtonGroup.js.map +0 -1
- package/dist/cjs/components/favorite/index.js +0 -5
- package/dist/cjs/components/favorite/index.js.map +0 -1
- package/dist/cjs/components/favorite/lib/PopperId.js +0 -5
- package/dist/cjs/components/favorite/lib/PopperId.js.map +0 -1
- package/dist/cjs/components/favorite/lib/index.js +0 -5
- package/dist/cjs/components/favorite/lib/index.js.map +0 -1
- package/dist/cjs/components/index.js +0 -7
- package/dist/cjs/components/index.js.map +0 -1
- package/dist/cjs/components/lib/FavoriteItemEvent.js +0 -11
- package/dist/cjs/components/lib/FavoriteItemEvent.js.map +0 -1
- package/dist/cjs/components/lib/index.js +0 -5
- package/dist/cjs/components/lib/index.js.map +0 -1
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/index.js.map +0 -1
- package/dist/docs.json +0 -24106
- package/dist/esm/components/RenderRowBox.js +0 -20
- package/dist/esm/components/RenderRowBox.js.map +0 -1
- package/dist/esm/components/favorite/FavoriteIconButton.js +0 -38
- package/dist/esm/components/favorite/FavoriteIconButton.js.map +0 -1
- package/dist/esm/components/favorite/FavoriteToggleSVG.js +0 -5
- package/dist/esm/components/favorite/FavoriteToggleSVG.js.map +0 -1
- package/dist/esm/components/favorite/Popper.js +0 -18
- package/dist/esm/components/favorite/Popper.js.map +0 -1
- package/dist/esm/components/favorite/PopperButtonGroup.js +0 -14
- package/dist/esm/components/favorite/PopperButtonGroup.js.map +0 -1
- package/dist/esm/components/favorite/index.js.map +0 -1
- package/dist/esm/components/favorite/lib/PopperId.js +0 -2
- package/dist/esm/components/favorite/lib/PopperId.js.map +0 -1
- package/dist/esm/components/favorite/lib/index.js +0 -2
- package/dist/esm/components/favorite/lib/index.js.map +0 -1
- package/dist/esm/components/index.js.map +0 -1
- package/dist/esm/components/lib/FavoriteItemEvent.js +0 -7
- package/dist/esm/components/lib/FavoriteItemEvent.js.map +0 -1
- package/dist/esm/components/lib/index.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/types/components/RenderRowBox.d.ts.map +0 -1
- package/dist/types/components/favorite/FavoriteIconButton.d.ts.map +0 -1
- package/dist/types/components/favorite/FavoriteToggleSVG.d.ts.map +0 -1
- package/dist/types/components/favorite/Popper.d.ts.map +0 -1
- package/dist/types/components/favorite/PopperButtonGroup.d.ts.map +0 -1
- package/dist/types/components/favorite/index.d.ts.map +0 -1
- package/dist/types/components/favorite/lib/PopperId.d.ts.map +0 -1
- package/dist/types/components/favorite/lib/index.d.ts.map +0 -1
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/components/lib/FavoriteItemEvent.d.ts.map +0 -1
- package/dist/types/components/lib/index.d.ts.map +0 -1
- /package/dist/{types/components/RenderRowBox.d.ts → components/RenderRowBox.d.mts} +0 -0
- /package/dist/{types/components/favorite/FavoriteIconButton.d.ts → components/favorite/FavoriteIconButton.d.mts} +0 -0
- /package/dist/{types/components/favorite/FavoriteToggleSVG.d.ts → components/favorite/FavoriteToggleSVG.d.mts} +0 -0
- /package/dist/{types/components/favorite/Popper.d.ts → components/favorite/Popper.d.mts} +0 -0
- /package/dist/{types/components/favorite/PopperButtonGroup.d.ts → components/favorite/PopperButtonGroup.d.mts} +0 -0
- /package/dist/{types/components/favorite/index.d.ts → components/favorite/index.d.mts} +0 -0
- /package/dist/{types/components/favorite/lib/PopperId.d.ts → components/favorite/lib/PopperId.d.mts} +0 -0
- /package/dist/{types/components/favorite/lib/index.d.ts → components/favorite/lib/index.d.mts} +0 -0
- /package/dist/{types/components/index.d.ts → components/index.d.mts} +0 -0
- /package/dist/{types/components/lib/FavoriteItemEvent.d.ts → components/lib/FavoriteItemEvent.d.mts} +0 -0
- /package/dist/{types/components/lib/index.d.ts → components/lib/index.d.mts} +0 -0
- /package/dist/{types/index.d.ts → index.d.mts} +0 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// src/components/favorite/FavoriteIconButton.tsx
|
|
2
|
+
import { IconButton, styled as styled2 } from "@mui/material";
|
|
3
|
+
import { useEvent } from "@xyo-network/react-event";
|
|
4
|
+
import { useShareForwardedRef } from "@xyo-network/react-shared";
|
|
5
|
+
import { forwardRef as forwardRef2, useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
6
|
+
|
|
7
|
+
// src/components/lib/FavoriteItemEvent.ts
|
|
8
|
+
var generateFavoriteEvent = (favorite, favoriteType, favoriteValue, name) => ({
|
|
9
|
+
favorite: !!favorite,
|
|
10
|
+
favoriteType,
|
|
11
|
+
favoriteValue,
|
|
12
|
+
name
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// src/components/favorite/FavoriteToggleSVG.tsx
|
|
16
|
+
import { Star as StarIcon, StarBorder as StarBorderIcon } from "@mui/icons-material";
|
|
17
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
18
|
+
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" }) });
|
|
19
|
+
|
|
20
|
+
// src/components/favorite/lib/PopperId.ts
|
|
21
|
+
var popperId = "favorite-popper";
|
|
22
|
+
|
|
23
|
+
// src/components/favorite/Popper.tsx
|
|
24
|
+
import { Card, CardContent, ClickAwayListener, Fade, Popper, styled, TextField } from "@mui/material";
|
|
25
|
+
import { forwardRef, useEffect, useState } from "react";
|
|
26
|
+
|
|
27
|
+
// src/components/favorite/PopperButtonGroup.tsx
|
|
28
|
+
import { Delete as DeleteIcon, Star as StarIcon2 } from "@mui/icons-material";
|
|
29
|
+
import { Button, ButtonGroup } from "@mui/material";
|
|
30
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var PopperButtonGroup = ({ name, onConfirmFavorite, favorite, ...props }) => {
|
|
32
|
+
return /* @__PURE__ */ jsxs(ButtonGroup, { ...props, children: [
|
|
33
|
+
/* @__PURE__ */ jsx2(
|
|
34
|
+
Button,
|
|
35
|
+
{
|
|
36
|
+
title: "Save Favorite",
|
|
37
|
+
variant: "contained",
|
|
38
|
+
onClick: (e) => {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
onConfirmFavorite?.(name, true);
|
|
41
|
+
},
|
|
42
|
+
children: /* @__PURE__ */ jsx2(StarIcon2, {})
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
favorite ? /* @__PURE__ */ jsx2(
|
|
46
|
+
Button,
|
|
47
|
+
{
|
|
48
|
+
title: "Remove Favorite",
|
|
49
|
+
variant: "contained",
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
onConfirmFavorite?.(name, false);
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ jsx2(DeleteIcon, {})
|
|
55
|
+
}
|
|
56
|
+
) : null
|
|
57
|
+
] });
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/components/favorite/Popper.tsx
|
|
61
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
62
|
+
var FavoritePopper = forwardRef(
|
|
63
|
+
({
|
|
64
|
+
name: nameProp,
|
|
65
|
+
favorite,
|
|
66
|
+
favoriteRef,
|
|
67
|
+
onClickAway = () => {
|
|
68
|
+
return;
|
|
69
|
+
},
|
|
70
|
+
onConfirmFavorite,
|
|
71
|
+
...props
|
|
72
|
+
}, ref) => {
|
|
73
|
+
const [name, setName] = useState(nameProp);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
setName(nameProp);
|
|
76
|
+
}, [nameProp]);
|
|
77
|
+
return /* @__PURE__ */ jsx3(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx3(
|
|
78
|
+
PopperStyled,
|
|
79
|
+
{
|
|
80
|
+
id: popperId,
|
|
81
|
+
anchorEl: favoriteRef?.current,
|
|
82
|
+
onClick: (e) => e.stopPropagation(),
|
|
83
|
+
onTouchStart: (e) => e.stopPropagation(),
|
|
84
|
+
transition: true,
|
|
85
|
+
ref,
|
|
86
|
+
...props,
|
|
87
|
+
children: ({ TransitionProps }) => /* @__PURE__ */ jsx3(Fade, { ...TransitionProps, timeout: 350, children: /* @__PURE__ */ jsx3(Card, { children: /* @__PURE__ */ jsxs2(CardContent, { sx: { display: "flex", gap: 1 }, children: [
|
|
88
|
+
/* @__PURE__ */ jsx3(
|
|
89
|
+
TextField,
|
|
90
|
+
{
|
|
91
|
+
autoFocus: true,
|
|
92
|
+
label: "Favorite Name",
|
|
93
|
+
placeholder: "optional",
|
|
94
|
+
size: "small",
|
|
95
|
+
value: name ?? "",
|
|
96
|
+
onChange: (e) => setName(e.target.value)
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx3(PopperButtonGroup, { favorite, onConfirmFavorite, name })
|
|
100
|
+
] }) }) })
|
|
101
|
+
}
|
|
102
|
+
) });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
FavoritePopper.displayName = "FavoritePopper";
|
|
106
|
+
var PopperStyled = styled(Popper, { name: "PopperStyled" })(() => ({ zIndex: 9999 }));
|
|
107
|
+
|
|
108
|
+
// src/components/favorite/FavoriteIconButton.tsx
|
|
109
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
110
|
+
var FavoriteIconButton = forwardRef2(
|
|
111
|
+
({ children, favorite: favoriteProp, name, valueType, value, ...props }, ref) => {
|
|
112
|
+
const [openPopper, setOpenPopper] = useState2(false);
|
|
113
|
+
const [favorite, setFavorite] = useState2(favoriteProp);
|
|
114
|
+
useEffect2(() => {
|
|
115
|
+
setFavorite(favoriteProp);
|
|
116
|
+
}, [favoriteProp]);
|
|
117
|
+
const sharedRef = useShareForwardedRef(ref);
|
|
118
|
+
const [buttonRef, dispatch] = useEvent(void 0, sharedRef);
|
|
119
|
+
const onConfirmFavorite = (name2, newFavoriteState) => {
|
|
120
|
+
const favoriteEvent = generateFavoriteEvent(!!newFavoriteState, valueType, value, name2);
|
|
121
|
+
dispatch("address", "favorite", JSON.stringify(favoriteEvent));
|
|
122
|
+
setFavorite(newFavoriteState);
|
|
123
|
+
setOpenPopper(false);
|
|
124
|
+
};
|
|
125
|
+
const starRef = useRef(null);
|
|
126
|
+
return /* @__PURE__ */ jsxs3(
|
|
127
|
+
IconButtonCondensed,
|
|
128
|
+
{
|
|
129
|
+
"aria-describedby": popperId,
|
|
130
|
+
ref: buttonRef,
|
|
131
|
+
onClick: (event) => {
|
|
132
|
+
event.stopPropagation();
|
|
133
|
+
setOpenPopper(!openPopper);
|
|
134
|
+
},
|
|
135
|
+
onTouchStart: (event) => {
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
setOpenPopper(!openPopper);
|
|
138
|
+
},
|
|
139
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
140
|
+
sx: { lineHeight: 0, p: 0.25 },
|
|
141
|
+
...props,
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ jsx4("span", { ref: starRef, children: /* @__PURE__ */ jsx4(FavoriteToggleSVG, { favorite }) }),
|
|
144
|
+
/* @__PURE__ */ jsx4(
|
|
145
|
+
FavoritePopper,
|
|
146
|
+
{
|
|
147
|
+
sx: { zIndex: 1301 },
|
|
148
|
+
name,
|
|
149
|
+
favorite,
|
|
150
|
+
favoriteRef: starRef,
|
|
151
|
+
open: openPopper,
|
|
152
|
+
onConfirmFavorite,
|
|
153
|
+
onClickAway: () => setOpenPopper(false)
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
children
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
FavoriteIconButton.displayName = "FavoriteIconButton";
|
|
163
|
+
var IconButtonCondensed = styled2(IconButton, { name: "IconButtonCondensed" })(({ theme }) => ({
|
|
164
|
+
lineHeight: 0,
|
|
165
|
+
padding: theme.spacing(0.25)
|
|
166
|
+
}));
|
|
167
|
+
|
|
168
|
+
// src/components/RenderRowBox.tsx
|
|
169
|
+
import { ListItemIcon, useTheme } from "@mui/material";
|
|
170
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
171
|
+
import { Identicon } from "@xylabs/react-identicon";
|
|
172
|
+
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
173
|
+
import { EllipsizeBox, useShareForwardedRef as useShareForwardedRef2 } from "@xyo-network/react-shared";
|
|
174
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
175
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
176
|
+
var AddressRenderRowBox = forwardRef3(
|
|
177
|
+
({ address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
|
|
178
|
+
const theme = useTheme();
|
|
179
|
+
const sharedRef = useShareForwardedRef2(ref);
|
|
180
|
+
const [elementRef, dispatch] = useEvent2(void 0, sharedRef);
|
|
181
|
+
return /* @__PURE__ */ jsxs4(
|
|
182
|
+
FlexRow,
|
|
183
|
+
{
|
|
184
|
+
gap: 2,
|
|
185
|
+
justifyContent: "flex-start",
|
|
186
|
+
ref: elementRef,
|
|
187
|
+
onClick: () => {
|
|
188
|
+
if (address) {
|
|
189
|
+
dispatch("address", "click", address);
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
...props,
|
|
193
|
+
children: [
|
|
194
|
+
icons && address ? /* @__PURE__ */ jsx5(ListItemIcon, { sx: { minWidth: 0 }, children: /* @__PURE__ */ jsx5(Identicon, { size: iconSize, value: address }) }) : null,
|
|
195
|
+
iconOnly ? null : /* @__PURE__ */ jsx5(
|
|
196
|
+
EllipsizeBox,
|
|
197
|
+
{
|
|
198
|
+
disableSharedRef,
|
|
199
|
+
ellipsisPosition: "end",
|
|
200
|
+
width: "100%",
|
|
201
|
+
typographyProps: { fontSize: theme.typography.body1.fontSize },
|
|
202
|
+
children: name ?? address
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
children,
|
|
206
|
+
showFavorite && address ? /* @__PURE__ */ jsx5(FavoriteIconButton, { name, size: "small", value: address, valueType: "address", favorite: favoriteProp }) : null
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
AddressRenderRowBox.displayName = "AddressRenderRowBox";
|
|
213
|
+
export {
|
|
214
|
+
AddressRenderRowBox,
|
|
215
|
+
FavoriteIconButton,
|
|
216
|
+
generateFavoriteEvent
|
|
217
|
+
};
|
|
218
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../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","../src/components/RenderRowBox.tsx"],"sourcesContent":["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","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,SAAS,YAA6B,UA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AS;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":["styled","forwardRef","useEffect","useState","StarIcon","jsx","jsx","jsxs","jsx","jsxs","forwardRef","useState","useEffect","name","styled","useEvent","useShareForwardedRef","forwardRef","jsx","jsxs","forwardRef","useShareForwardedRef","useEvent"]}
|
package/package.json
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/react-flexbox": "
|
|
14
|
-
"@xylabs/react-identicon": "
|
|
15
|
-
"@xylabs/react-shared": "
|
|
16
|
-
"@xyo-network/react-event": "~2.
|
|
17
|
-
"@xyo-network/react-shared": "~2.
|
|
13
|
+
"@xylabs/react-flexbox": "^3.1.0-rc.3",
|
|
14
|
+
"@xylabs/react-identicon": "^3.1.0-rc.3",
|
|
15
|
+
"@xylabs/react-shared": "^3.1.0-rc.3",
|
|
16
|
+
"@xyo-network/react-event": "~2.64.0-rc.1",
|
|
17
|
+
"@xyo-network/react-shared": "~2.64.0-rc.1"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mui/icons-material": "^5",
|
|
@@ -28,33 +28,41 @@
|
|
|
28
28
|
"description": "Common React library for all XYO projects that use React",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@storybook/react": "^7.4.3",
|
|
31
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
32
|
-
"@xylabs/tsconfig-react": "^
|
|
33
|
-
"@xyo-network/account": "^2.74.
|
|
34
|
-
"@xyo-network/react-event": "~2.
|
|
31
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.28",
|
|
32
|
+
"@xylabs/tsconfig-react": "^3.0.28",
|
|
33
|
+
"@xyo-network/account": "^2.74.4",
|
|
34
|
+
"@xyo-network/react-event": "~2.64.0-rc.1",
|
|
35
35
|
"typescript": "^5.2.2"
|
|
36
36
|
},
|
|
37
|
-
"browser": "dist/esm/index.js",
|
|
38
37
|
"docs": "dist/docs.json",
|
|
39
38
|
"exports": {
|
|
40
39
|
".": {
|
|
41
40
|
"node": {
|
|
42
|
-
"import":
|
|
43
|
-
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/index.d.mts",
|
|
43
|
+
"default": "./dist/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
|
+
}
|
|
44
49
|
},
|
|
45
50
|
"browser": {
|
|
46
|
-
"import":
|
|
47
|
-
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/index.d.mts",
|
|
53
|
+
"default": "./dist/index.mjs"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/index.d.ts",
|
|
57
|
+
"default": "./dist/index.js"
|
|
58
|
+
}
|
|
48
59
|
},
|
|
49
|
-
"default": "./dist/
|
|
50
|
-
},
|
|
51
|
-
"./dist/docs.json": {
|
|
52
|
-
"default": "./dist/docs.json"
|
|
60
|
+
"default": "./dist/index.mjs"
|
|
53
61
|
},
|
|
54
62
|
"./package.json": "./package.json"
|
|
55
63
|
},
|
|
56
|
-
"main": "dist/
|
|
57
|
-
"module": "dist/
|
|
64
|
+
"main": "dist/index.js",
|
|
65
|
+
"module": "dist/index.mjs",
|
|
58
66
|
"homepage": "https://xyo.network",
|
|
59
67
|
"keywords": [
|
|
60
68
|
"xyo",
|
|
@@ -75,6 +83,7 @@
|
|
|
75
83
|
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
|
|
76
84
|
},
|
|
77
85
|
"sideEffects": false,
|
|
78
|
-
"types": "dist/
|
|
79
|
-
"version": "2.
|
|
86
|
+
"types": "dist/index.d.ts",
|
|
87
|
+
"version": "2.64.0-rc.1",
|
|
88
|
+
"stableVersion": "2.63.1"
|
|
80
89
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import StarIcon from '@mui/icons-material
|
|
2
|
-
import StarBorderIcon from '@mui/icons-material/StarBorder'
|
|
1
|
+
import { Star as StarIcon, StarBorder as StarBorderIcon } from '@mui/icons-material'
|
|
3
2
|
|
|
4
3
|
export const FavoriteToggleSVG: React.FC<{ favorite?: boolean }> = ({ favorite }) => (
|
|
5
4
|
<>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import DeleteIcon from '@mui/icons-material
|
|
2
|
-
import StarIcon from '@mui/icons-material/Star'
|
|
1
|
+
import { Delete as DeleteIcon, Star as StarIcon } from '@mui/icons-material'
|
|
3
2
|
import { Button, ButtonGroup, ButtonGroupProps } from '@mui/material'
|
|
4
3
|
|
|
5
4
|
export interface FavoritePopperProps extends ButtonGroupProps {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddressRenderRowBox = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
8
|
-
const react_identicon_1 = require("@xylabs/react-identicon");
|
|
9
|
-
const react_event_1 = require("@xyo-network/react-event");
|
|
10
|
-
const react_shared_1 = require("@xyo-network/react-shared");
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const favorite_1 = require("./favorite");
|
|
13
|
-
exports.AddressRenderRowBox = (0, react_1.forwardRef)((_a, ref) => {
|
|
14
|
-
var { address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false } = _a, props = tslib_1.__rest(_a, ["address", "children", "disableSharedRef", "favorite", "iconOnly", "iconSize", "icons", "name", "showFavorite"]);
|
|
15
|
-
const theme = (0, material_1.useTheme)();
|
|
16
|
-
const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
|
|
17
|
-
const [elementRef, dispatch] = (0, react_event_1.useEvent)(undefined, sharedRef);
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => {
|
|
19
|
-
if (address) {
|
|
20
|
-
dispatch('address', 'click', address);
|
|
21
|
-
}
|
|
22
|
-
} }, props, { children: [icons && address ? ((0, jsx_runtime_1.jsx)(material_1.ListItemIcon, Object.assign({ sx: { minWidth: 0 } }, { children: (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: iconSize, value: address }) }))) : null, iconOnly ? null : ((0, jsx_runtime_1.jsx)(react_shared_1.EllipsizeBox, Object.assign({ disableSharedRef: disableSharedRef, ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize } }, { children: name !== null && name !== void 0 ? name : address }))), children, showFavorite && address ? ((0, jsx_runtime_1.jsx)(favorite_1.FavoriteIconButton, { name: name, size: 'small', value: address, valueType: 'address', favorite: favoriteProp })) : null] })));
|
|
23
|
-
});
|
|
24
|
-
exports.AddressRenderRowBox.displayName = 'AddressRenderRowBox';
|
|
25
|
-
//# sourceMappingURL=RenderRowBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAsD;AACtD,yDAA6D;AAC7D,6DAAmD;AACnD,0DAAmD;AACnD,4DAA8E;AAC9E,iCAAkC;AAElC,yCAA+C;AAalC,QAAA,mBA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I,cAAJ,IAAI,GAAI,OAAO,IACH,CAChB,EACA,QAAQ,EACR,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,CACzB,uBAAC,6BAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,GAAI,CAChH,CAAC,CAAC,CAAC,IAAI,KACA,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,2BAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FavoriteIconButton = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_event_1 = require("@xyo-network/react-event");
|
|
8
|
-
const react_shared_1 = require("@xyo-network/react-shared");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const lib_1 = require("../lib");
|
|
11
|
-
const FavoriteToggleSVG_1 = require("./FavoriteToggleSVG");
|
|
12
|
-
const lib_2 = require("./lib");
|
|
13
|
-
const Popper_1 = require("./Popper");
|
|
14
|
-
exports.FavoriteIconButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
15
|
-
var { children, favorite: favoriteProp, name, valueType, value } = _a, props = tslib_1.__rest(_a, ["children", "favorite", "name", "valueType", "value"]);
|
|
16
|
-
const [openPopper, setOpenPopper] = (0, react_1.useState)(false);
|
|
17
|
-
const [favorite, setFavorite] = (0, react_1.useState)(favoriteProp);
|
|
18
|
-
(0, react_1.useEffect)(() => {
|
|
19
|
-
setFavorite(favoriteProp);
|
|
20
|
-
}, [favoriteProp]);
|
|
21
|
-
const sharedRef = (0, react_shared_1.useShareForwardedRef)(ref);
|
|
22
|
-
const [buttonRef, dispatch] = (0, react_event_1.useEvent)(undefined, sharedRef);
|
|
23
|
-
const onConfirmFavorite = (name, newFavoriteState) => {
|
|
24
|
-
const favoriteEvent = (0, lib_1.generateFavoriteEvent)(!!newFavoriteState, valueType, value, name);
|
|
25
|
-
dispatch('address', 'favorite', JSON.stringify(favoriteEvent));
|
|
26
|
-
setFavorite(newFavoriteState);
|
|
27
|
-
setOpenPopper(false);
|
|
28
|
-
};
|
|
29
|
-
const starRef = (0, react_1.useRef)(null);
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(IconButtonCondensed, Object.assign({ "aria-describedby": lib_2.popperId, ref: buttonRef, onClick: (event) => {
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
setOpenPopper(!openPopper);
|
|
33
|
-
}, onTouchStart: (event) => {
|
|
34
|
-
event.stopPropagation();
|
|
35
|
-
setOpenPopper(!openPopper);
|
|
36
|
-
}, onMouseDown: (e) => e.stopPropagation(), sx: { lineHeight: 0, p: 0.25 } }, props, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ ref: starRef }, { children: (0, jsx_runtime_1.jsx)(FavoriteToggleSVG_1.FavoriteToggleSVG, { favorite: favorite }) })), (0, jsx_runtime_1.jsx)(Popper_1.FavoritePopper, { sx: { zIndex: 1301 }, name: name, favorite: favorite, favoriteRef: starRef, open: openPopper, onConfirmFavorite: onConfirmFavorite, onClickAway: () => setOpenPopper(false) }), children] })));
|
|
37
|
-
});
|
|
38
|
-
exports.FavoriteIconButton.displayName = 'FavoriteIconButton';
|
|
39
|
-
const IconButtonCondensed = (0, material_1.styled)(material_1.IconButton, { name: 'IconButtonCondensed' })(({ theme }) => ({
|
|
40
|
-
lineHeight: 0,
|
|
41
|
-
padding: theme.spacing(0.25),
|
|
42
|
-
}));
|
|
43
|
-
//# sourceMappingURL=FavoriteIconButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteIconButton.js","sourceRoot":"","sources":["../../../../src/components/favorite/FavoriteIcon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
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FavoriteToggleSVG = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const Star_1 = tslib_1.__importDefault(require("@mui/icons-material/Star"));
|
|
7
|
-
const StarBorder_1 = tslib_1.__importDefault(require("@mui/icons-material/StarBorder"));
|
|
8
|
-
const FavoriteToggleSVG = ({ favorite }) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: favorite ? ((0, jsx_runtime_1.jsx)(Star_1.default, { className: "favorite-icon", component: 'svg', color: "secondary", fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(StarBorder_1.default, { className: "favorite-icon", fontSize: "small" })) }));
|
|
9
|
-
exports.FavoriteToggleSVG = FavoriteToggleSVG;
|
|
10
|
-
//# sourceMappingURL=FavoriteToggleSVG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteToggleSVG.js","sourceRoot":"","sources":["../../../../src/components/favorite/FavoriteToggleSVG.tsx"],"names":[],"mappings":";;;;;AAAA,4EAA+C;AAC/C,wFAA2D;AAEpD,MAAM,iBAAiB,GAAqC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACnF,2DACG,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,cAAQ,IAAC,SAAS,EAAC,eAAe,EAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAC,OAAO,GAAG,CAC5F,CAAC,CAAC,CAAC,CACF,uBAAC,oBAAc,IAAC,SAAS,EAAC,eAAe,EAAC,QAAQ,EAAC,OAAO,GAAG,CAC9D,GACA,CACJ,CAAA;AARY,QAAA,iBAAiB,qBAQ7B"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FavoritePopper = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const lib_1 = require("./lib");
|
|
9
|
-
const PopperButtonGroup_1 = require("./PopperButtonGroup");
|
|
10
|
-
exports.FavoritePopper = (0, react_1.forwardRef)((_a, ref) => {
|
|
11
|
-
var { name: nameProp, favorite, favoriteRef, onClickAway = () => {
|
|
12
|
-
return;
|
|
13
|
-
}, onConfirmFavorite } = _a, props = tslib_1.__rest(_a, ["name", "favorite", "favoriteRef", "onClickAway", "onConfirmFavorite"]);
|
|
14
|
-
const [name, setName] = (0, react_1.useState)(nameProp);
|
|
15
|
-
(0, react_1.useEffect)(() => {
|
|
16
|
-
setName(nameProp);
|
|
17
|
-
}, [nameProp]);
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: onClickAway }, { children: (0, jsx_runtime_1.jsx)(PopperStyled, Object.assign({ id: lib_1.popperId, anchorEl: favoriteRef === null || favoriteRef === void 0 ? void 0 : favoriteRef.current, onClick: (e) => e.stopPropagation(), onTouchStart: (e) => e.stopPropagation(), transition: true, ref: ref }, props, { children: ({ TransitionProps }) => ((0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({}, TransitionProps, { timeout: 350 }, { children: (0, jsx_runtime_1.jsx)(material_1.Card, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ sx: { display: 'flex', gap: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { autoFocus: true, label: "Favorite Name", placeholder: "optional", size: "small", value: name !== null && name !== void 0 ? name : '', onChange: (e) => setName(e.target.value) }), (0, jsx_runtime_1.jsx)(PopperButtonGroup_1.PopperButtonGroup, { favorite: favorite, onConfirmFavorite: onConfirmFavorite, name: name })] })) }) }))) })) })));
|
|
19
|
-
});
|
|
20
|
-
exports.FavoritePopper.displayName = 'FavoritePopper';
|
|
21
|
-
// Ensure the popper is over all other mui portal elements
|
|
22
|
-
const PopperStyled = (0, material_1.styled)(material_1.Popper, { name: 'PopperStyled' })(() => ({ zIndex: 9999 }));
|
|
23
|
-
//# sourceMappingURL=Popper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.js","sourceRoot":"","sources":["../../../../src/components/favorite/Popper.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAkH;AAClH,iCAAkE;AAElE,+BAAgC;AAChC,2DAAuD;AAS1C,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,WAAW,EACX,WAAW,GAAG,GAAG,EAAE;QACjB,OAAM;IACR,CAAC,EACD,iBAAiB,OAElB,EADI,KAAK,sBARV,uEASC,CADS;IAIV,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAA;IAC1C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,QAAQ,CAAC,CAAA;IACnB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,OAAO,CACL,uBAAC,4BAAiB,kBAAC,WAAW,EAAE,WAAW,gBACzC,uBAAC,YAAY,kBACX,EAAE,EAAE,cAAQ,EACZ,QAAQ,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,EAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACxC,UAAU,QACV,GAAG,EAAE,GAAG,IACJ,KAAK,cAER,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CACxB,uBAAC,eAAI,oBAAK,eAAe,IAAE,OAAO,EAAE,GAAG,gBACrC,uBAAC,eAAI,cACH,wBAAC,sBAAW,kBAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,iBAC1C,uBAAC,oBAAS,IACR,SAAS,QACT,KAAK,EAAC,eAAe,EACrB,WAAW,EAAC,UAAU,EACtB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GACxC,EACF,uBAAC,qCAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,GAAI,KAC/E,GACT,IACF,CACR,IACY,IACG,CACrB,CAAA;AACH,CAAC,CACF,CAAA;AAED,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAE7C,0DAA0D;AAC1D,MAAM,YAAY,GAAG,IAAA,iBAAM,EAAC,iBAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PopperButtonGroup = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const Delete_1 = tslib_1.__importDefault(require("@mui/icons-material/Delete"));
|
|
7
|
-
const Star_1 = tslib_1.__importDefault(require("@mui/icons-material/Star"));
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
|
-
const PopperButtonGroup = (_a) => {
|
|
10
|
-
var { name, onConfirmFavorite, favorite } = _a, props = tslib_1.__rest(_a, ["name", "onConfirmFavorite", "favorite"]);
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ButtonGroup, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ title: "Save Favorite", variant: "contained", onClick: (e) => {
|
|
12
|
-
e.stopPropagation();
|
|
13
|
-
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(name, true);
|
|
14
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Star_1.default, {}) })), favorite ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ title: "Remove Favorite", variant: "contained", onClick: (e) => {
|
|
15
|
-
e.stopPropagation();
|
|
16
|
-
onConfirmFavorite === null || onConfirmFavorite === void 0 ? void 0 : onConfirmFavorite(name, false);
|
|
17
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }))) : null] })));
|
|
18
|
-
};
|
|
19
|
-
exports.PopperButtonGroup = PopperButtonGroup;
|
|
20
|
-
//# sourceMappingURL=PopperButtonGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopperButtonGroup.js","sourceRoot":"","sources":["../../../../src/components/favorite/PopperButtonGroup.tsx"],"names":[],"mappings":";;;;;AAAA,gFAAmD;AACnD,4EAA+C;AAC/C,4CAAqE;AAQ9D,MAAM,iBAAiB,GAAkC,CAAC,EAA+C,EAAE,EAAE;QAAnD,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAA7C,yCAA+C,CAAF;IAC5G,OAAO,CACL,wBAAC,sBAAW,oBAAK,KAAK,eACpB,uBAAC,iBAAM,kBACL,KAAK,EAAC,eAAe,EACrB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,IAAI,EAAE,IAAI,CAAC,CAAA;gBACjC,CAAC,gBAED,uBAAC,cAAQ,KAAG,IACL,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,iBAAM,kBACL,KAAK,EAAC,iBAAiB,EACvB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,eAAe,EAAE,CAAA;oBACnB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,IAAI,EAAE,KAAK,CAAC,CAAA;gBAClC,CAAC,gBAED,uBAAC,gBAAU,KAAG,IACP,CACV,CAAC,CAAC,CAAC,IAAI,KACI,CACf,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,iBAAiB,qBA2B7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/favorite/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopperId.js","sourceRoot":"","sources":["../../../../../src/components/favorite/lib/PopperId.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,iBAAiB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/favorite/lib/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./favorite"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./RenderRowBox"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,gDAAqB;AACrB,yDAA8B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateFavoriteEvent = void 0;
|
|
4
|
-
const generateFavoriteEvent = (favorite, favoriteType, favoriteValue, name) => ({
|
|
5
|
-
favorite: !!favorite,
|
|
6
|
-
favoriteType,
|
|
7
|
-
favoriteValue,
|
|
8
|
-
name,
|
|
9
|
-
});
|
|
10
|
-
exports.generateFavoriteEvent = generateFavoriteEvent;
|
|
11
|
-
//# sourceMappingURL=FavoriteItemEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteItemEvent.js","sourceRoot":"","sources":["../../../../src/components/lib/FavoriteItemEvent.ts"],"names":[],"mappings":";;;AASO,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAE,YAA2B,EAAE,aAAsB,EAAE,IAAa,EAAqB,EAAE,CAAC,CAAC;IACnJ,QAAQ,EAAE,CAAC,CAAC,QAAQ;IACpB,YAAY;IACZ,aAAa;IACb,IAAI;CACL,CAAC,CAAA;AALW,QAAA,qBAAqB,yBAKhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC"}
|
package/dist/cjs/index.js
DELETED
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B"}
|