@xyo-network/react-property 2.77.0 → 2.77.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/browser/index.cjs +1 -222
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -199
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +1 -222
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +1 -199
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +1 -231
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -201
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -5
package/dist/node/index.cjs
CHANGED
|
@@ -1,232 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
Property: () => Property,
|
|
24
|
-
PropertyGroup: () => PropertyGroup,
|
|
25
|
-
PropertyTitle: () => PropertyTitle,
|
|
26
|
-
PropertyValue: () => PropertyValue
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(src_exports);
|
|
29
|
-
|
|
30
|
-
// src/components/Group.tsx
|
|
31
|
-
var import_material2 = require("@mui/material");
|
|
32
|
-
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
33
|
-
var import_typeof = require("@xyo-network/typeof");
|
|
34
|
-
|
|
35
|
-
// src/components/Title.tsx
|
|
36
|
-
var import_material = require("@mui/material");
|
|
37
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
38
|
-
var import_react_quick_tip_button = require("@xylabs/react-quick-tip-button");
|
|
39
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
var PropertyTitle = ({ elevation = 1, size = "medium", tip, more, title, ...props }) => {
|
|
41
|
-
const sizeVariants = {
|
|
42
|
-
full: "caption",
|
|
43
|
-
large: "caption",
|
|
44
|
-
medium: "caption",
|
|
45
|
-
small: "caption"
|
|
46
|
-
};
|
|
47
|
-
const sizeTitleHeight = {
|
|
48
|
-
full: void 0,
|
|
49
|
-
large: 32,
|
|
50
|
-
medium: 20,
|
|
51
|
-
small: 16
|
|
52
|
-
};
|
|
53
|
-
const sizeFontSize = {
|
|
54
|
-
full: 16,
|
|
55
|
-
large: 16,
|
|
56
|
-
medium: 14,
|
|
57
|
-
small: 10
|
|
58
|
-
};
|
|
59
|
-
const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16;
|
|
60
|
-
const theme = (0, import_material.useTheme)();
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
62
|
-
import_react_flexbox.FlexRow,
|
|
63
|
-
{
|
|
64
|
-
bgcolor: theme.palette.mode === "dark" ? (0, import_material.lighten)(theme.palette.background.paper, 0.05 * elevation) : (0, import_material.darken)(theme.palette.background.paper, 0.025 * elevation),
|
|
65
|
-
alignItems: "center",
|
|
66
|
-
height: sizeTitleHeight[size],
|
|
67
|
-
justifyContent: "space-between",
|
|
68
|
-
...props,
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { paddingX: 1, paddingY: 0.5, children: [
|
|
71
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { fontWeight: 500, noWrap: true, variant: sizeVariants[size], fontSize: sizeFontSize[size], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: title }) }) }),
|
|
72
|
-
tip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_quick_tip_button.QuickTipButton, { style: { fontSize: quickTipSize }, color: "inherit", title: title ?? "", children: tip }) : null
|
|
73
|
-
] }),
|
|
74
|
-
more
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// src/components/Group.tsx
|
|
81
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
82
|
-
var PropertyGroupBox = ({ titleProps, children, title, tip, ...props }) => {
|
|
83
|
-
const theme = (0, import_material2.useTheme)();
|
|
84
|
-
const childrenArray = (0, import_typeof.typeOf)(children) === "array" ? children : void 0;
|
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexCol, { alignItems: "stretch", overflow: "hidden", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox2.FlexRow, { overflow: "hidden", justifyContent: "stretch", alignItems: "stretch", children: [
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyTitle, { alignItems: "flex-start", size: "full", title, tip, ...titleProps }),
|
|
87
|
-
childrenArray ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { children: childrenArray == null ? void 0 : childrenArray.map((child, index) => {
|
|
88
|
-
return child ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { borderLeft: 1, borderColor: theme.palette.divider, children: child }, index) : null;
|
|
89
|
-
}) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { overflow: "hidden", children })
|
|
90
|
-
] }) });
|
|
91
|
-
};
|
|
92
|
-
var PropertyGroupPaper = ({ style, variant, elevation, square, ...props }) => {
|
|
93
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Paper, { style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyGroupBox, { ...props, paper: false }) });
|
|
94
|
-
};
|
|
95
|
-
var PropertyGroup = (props) => {
|
|
96
|
-
return props.paper ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyGroupPaper, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyGroupBox, { ...props });
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// src/components/Property.tsx
|
|
100
|
-
var import_material5 = require("@mui/material");
|
|
101
|
-
var import_react_flexbox5 = require("@xylabs/react-flexbox");
|
|
102
|
-
var import_react4 = require("react");
|
|
103
|
-
|
|
104
|
-
// src/components/ActionsMenu.tsx
|
|
105
|
-
var import_icons_material = require("@mui/icons-material");
|
|
106
|
-
var import_material3 = require("@mui/material");
|
|
107
|
-
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
108
|
-
var import_react = require("react");
|
|
109
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
110
|
-
var PropertyActionsMenu = ({ actions, ...props }) => {
|
|
111
|
-
const [anchorEl, setAnchorEl] = (0, import_react.useState)(null);
|
|
112
|
-
const open = !!anchorEl;
|
|
113
|
-
const handleClick = (event) => {
|
|
114
|
-
setAnchorEl(event.currentTarget);
|
|
115
|
-
};
|
|
116
|
-
const handleClose = () => {
|
|
117
|
-
setAnchorEl(null);
|
|
118
|
-
};
|
|
119
|
-
return actions && (actions == null ? void 0 : actions.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_flexbox3.FlexRow, { ...props, children: [
|
|
120
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.IconButton, { size: "small", color: "inherit", onClick: handleClick, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material.MoreHoriz, { fontSize: "inherit" }) }),
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Menu, { anchorEl, open, onClose: handleClose, children: actions == null ? void 0 : actions.map((action) => {
|
|
122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
123
|
-
import_material3.MenuItem,
|
|
124
|
-
{
|
|
125
|
-
onClick: () => {
|
|
126
|
-
var _a;
|
|
127
|
-
(_a = action == null ? void 0 : action.onClick) == null ? void 0 : _a.call(action);
|
|
128
|
-
handleClose();
|
|
129
|
-
},
|
|
130
|
-
children: action.name
|
|
131
|
-
},
|
|
132
|
-
action.name
|
|
133
|
-
);
|
|
134
|
-
}) })
|
|
135
|
-
] }) : null;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
// src/components/IdenticonCorner.tsx
|
|
139
|
-
var import_material4 = require("@mui/material");
|
|
140
|
-
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
141
|
-
var import_react_identicon = require("@xylabs/react-identicon");
|
|
142
|
-
var import_react2 = require("react");
|
|
143
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
144
|
-
var IdenticonCorner = ({ value, ...props }) => {
|
|
145
|
-
const theme = (0, import_material4.useTheme)();
|
|
146
|
-
const [parentHeight, setParentHeight] = (0, import_react2.useState)();
|
|
147
|
-
const ref = (0, import_react2.useRef)(null);
|
|
148
|
-
(0, import_react2.useEffect)(() => {
|
|
149
|
-
var _a, _b, _c;
|
|
150
|
-
setParentHeight((_c = (_b = (_a = ref.current) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.parentElement) == null ? void 0 : _c.clientHeight);
|
|
151
|
-
}, []);
|
|
152
|
-
const calculatedHeight = parentHeight ?? 0;
|
|
153
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_flexbox4.FlexRow, { alignItems: "flex-start", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_flexbox4.FlexRow, { background: true, height: calculatedHeight, width: calculatedHeight, borderLeft: `1px solid ${theme.palette.divider}`, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_identicon.Identicon, { size: calculatedHeight * 0.6, value: `${value}`, sx: { padding: `${calculatedHeight * 0.2}px` }, ...props }) }) }) });
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// src/components/Value.tsx
|
|
157
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
158
|
-
var import_react3 = require("react");
|
|
159
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
160
|
-
var PropertyValue = (0, import_react3.forwardRef)(({ typographyVariant = "body1", value, ...props }, ref) => {
|
|
161
|
-
return value === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
162
|
-
import_react_shared.EllipsizeBox,
|
|
163
|
-
{
|
|
164
|
-
typographyProps: { component: void 0, title: value == null ? void 0 : value.toString(), variant: typographyVariant },
|
|
165
|
-
width: "100%",
|
|
166
|
-
ref,
|
|
167
|
-
...props,
|
|
168
|
-
children: value
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
});
|
|
172
|
-
PropertyValue.displayName = "PropertyValue";
|
|
173
|
-
|
|
174
|
-
// src/components/Property.tsx
|
|
175
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
176
|
-
var PropertyBox = (0, import_react4.forwardRef)(
|
|
177
|
-
({ titleProps, title, value, children, size = "medium", tip, actions, required, badge = false, ...props }, ref) => {
|
|
178
|
-
const sizeValueHeight = {
|
|
179
|
-
large: 48,
|
|
180
|
-
medium: 36,
|
|
181
|
-
small: 24
|
|
182
|
-
};
|
|
183
|
-
const sizeVariants = {
|
|
184
|
-
large: "h6",
|
|
185
|
-
medium: "body1",
|
|
186
|
-
small: "body2"
|
|
187
|
-
};
|
|
188
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_flexbox5.FlexRow, { ref, flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden", ...props, children: [
|
|
189
|
-
title === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
190
|
-
PropertyTitle,
|
|
191
|
-
{
|
|
192
|
-
tip,
|
|
193
|
-
title: required ? `${title}*` : title,
|
|
194
|
-
size,
|
|
195
|
-
more: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PropertyActionsMenu, { actions }),
|
|
196
|
-
...titleProps
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
200
|
-
import_react_flexbox5.FlexRow,
|
|
201
|
-
{
|
|
202
|
-
pl: 1,
|
|
203
|
-
columnGap: 1,
|
|
204
|
-
justifyContent: value === void 0 ? "center" : "space-between",
|
|
205
|
-
overflow: "hidden",
|
|
206
|
-
height: sizeValueHeight[size],
|
|
207
|
-
children: [
|
|
208
|
-
children ?? value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material5.CircularProgress, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PropertyValue, { value, typographyVariant: sizeVariants[size] }),
|
|
209
|
-
value === void 0 ? null : badge ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IdenticonCorner, { value }) : null
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
] });
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
PropertyBox.displayName = "PropertyBox";
|
|
217
|
-
var PropertyPaper = (0, import_react4.forwardRef)(({ style, variant, elevation = 2, square, ...props }, ref) => {
|
|
218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material5.Paper, { ref, style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PropertyBox, { ...props, paper: false }) });
|
|
219
|
-
});
|
|
220
|
-
PropertyPaper.displayName = "PropertyPaper";
|
|
221
|
-
var Property = (0, import_react4.forwardRef)((props, ref) => {
|
|
222
|
-
return props.paper ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PropertyPaper, { ref, ...props }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PropertyBox, { ref, ...props });
|
|
223
|
-
});
|
|
224
|
-
Property.displayName = "Property";
|
|
225
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
226
|
-
0 && (module.exports = {
|
|
227
|
-
Property,
|
|
228
|
-
PropertyGroup,
|
|
229
|
-
PropertyTitle,
|
|
230
|
-
PropertyValue
|
|
231
|
-
});
|
|
1
|
+
"use strict";var C=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var U=(r,e)=>{for(var o in e)C(r,o,{get:e[o],enumerable:!0})},Z=(r,e,o,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of J(e))!K.call(r,t)&&t!==o&&C(r,t,{get:()=>e[t],enumerable:!(p=Y(e,t))||p.enumerable});return r};var _=r=>Z(C({},"__esModule",{value:!0}),r);var re={};U(re,{Property:()=>O,PropertyGroup:()=>ee,PropertyTitle:()=>g,PropertyValue:()=>T});module.exports=_(re);var w=require("@mui/material"),f=require("@xylabs/react-flexbox"),I=require("@xyo-network/typeof");var d=require("@mui/material"),b=require("@xylabs/react-flexbox"),S=require("@xylabs/react-quick-tip-button"),u=require("react/jsx-runtime"),g=({elevation:r=1,size:e="medium",tip:o,more:p,title:t,...a})=>{let i={full:"caption",large:"caption",medium:"caption",small:"caption"},n={full:void 0,large:32,medium:20,small:16},l={full:16,large:16,medium:14,small:10},y=l[e]<16?l[e]:16,x=(0,d.useTheme)();return(0,u.jsxs)(b.FlexRow,{bgcolor:x.palette.mode==="dark"?(0,d.lighten)(x.palette.background.paper,.05*r):(0,d.darken)(x.palette.background.paper,.025*r),alignItems:"center",height:n[e],justifyContent:"space-between",...a,children:[(0,u.jsxs)(b.FlexRow,{paddingX:1,paddingY:.5,children:[(0,u.jsx)(d.Typography,{fontWeight:500,noWrap:!0,variant:i[e],fontSize:l[e],children:(0,u.jsx)("small",{children:(0,u.jsx)("strong",{children:t})})}),o?(0,u.jsx)(S.QuickTipButton,{style:{fontSize:y},color:"inherit",title:t??"",children:o}):null]}),p]})};var s=require("react/jsx-runtime"),M=({titleProps:r,children:e,title:o,tip:p,...t})=>{let a=(0,w.useTheme)(),i=(0,I.typeOf)(e)==="array"?e:void 0;return(0,s.jsx)(f.FlexCol,{alignItems:"stretch",overflow:"hidden",...t,children:(0,s.jsxs)(f.FlexRow,{overflow:"hidden",justifyContent:"stretch",alignItems:"stretch",children:[(0,s.jsx)(g,{alignItems:"flex-start",size:"full",title:o,tip:p,...r}),i?(0,s.jsx)(f.FlexGrowRow,{children:i==null?void 0:i.map((n,l)=>n?(0,s.jsx)(f.FlexGrowRow,{borderLeft:1,borderColor:a.palette.divider,children:n},l):null)}):(0,s.jsx)(f.FlexGrowRow,{overflow:"hidden",children:e})]})})},j=({style:r,variant:e,elevation:o,square:p,...t})=>(0,s.jsx)(w.Paper,{style:{minWidth:0,overflow:"hidden",...r},variant:e,elevation:o,square:p,children:(0,s.jsx)(M,{...t,paper:!1})}),ee=r=>r.paper?(0,s.jsx)(j,{...r}):(0,s.jsx)(M,{...r});var F=require("@mui/material"),B=require("@xylabs/react-flexbox"),z=require("react");var V=require("@mui/icons-material"),c=require("@mui/material"),H=require("@xylabs/react-flexbox"),k=require("react"),P=require("react/jsx-runtime"),G=({actions:r,...e})=>{let[o,p]=(0,k.useState)(null),t=!!o,a=n=>{p(n.currentTarget)},i=()=>{p(null)};return r&&(r==null?void 0:r.length)>0?(0,P.jsxs)(H.FlexRow,{...e,children:[(0,P.jsx)(c.IconButton,{size:"small",color:"inherit",onClick:a,children:(0,P.jsx)(V.MoreHoriz,{fontSize:"inherit"})}),(0,P.jsx)(c.Menu,{anchorEl:o,open:t,onClose:i,children:r==null?void 0:r.map(n=>(0,P.jsx)(c.MenuItem,{onClick:()=>{var l;(l=n==null?void 0:n.onClick)==null||l.call(n),i()},children:n.name},n.name))})]}):null};var L=require("@mui/material"),E=require("@xylabs/react-flexbox"),N=require("@xylabs/react-identicon"),h=require("react"),R=require("react/jsx-runtime"),D=({value:r,...e})=>{let o=(0,L.useTheme)(),[p,t]=(0,h.useState)(),a=(0,h.useRef)(null);(0,h.useEffect)(()=>{var n,l,y;t((y=(l=(n=a.current)==null?void 0:n.parentElement)==null?void 0:l.parentElement)==null?void 0:y.clientHeight)},[]);let i=p??0;return(0,R.jsx)(E.FlexRow,{alignItems:"flex-start",height:"100%",children:(0,R.jsx)(E.FlexRow,{background:!0,height:i,width:i,borderLeft:`1px solid ${o.palette.divider}`,children:(0,R.jsx)("div",{ref:a,children:(0,R.jsx)(N.Identicon,{size:i*.6,value:`${r}`,sx:{padding:`${i*.2}px`},...e})})})})};var W=require("@xyo-network/react-shared"),A=require("react"),$=require("react/jsx-runtime"),T=(0,A.forwardRef)(({typographyVariant:r="body1",value:e,...o},p)=>e===void 0?null:(0,$.jsx)(W.EllipsizeBox,{typographyProps:{component:void 0,title:e==null?void 0:e.toString(),variant:r},width:"100%",ref:p,...o,children:e}));T.displayName="PropertyValue";var m=require("react/jsx-runtime"),v=(0,z.forwardRef)(({titleProps:r,title:e,value:o,children:p,size:t="medium",tip:a,actions:i,required:n,badge:l=!1,...y},x)=>{let Q={large:48,medium:36,small:24},X={large:"h6",medium:"body1",small:"body2"};return(0,m.jsxs)(B.FlexRow,{ref:x,flexDirection:"column",minWidth:0,alignItems:"stretch",overflow:"hidden",...y,children:[e===void 0?null:(0,m.jsx)(g,{tip:a,title:n?`${e}*`:e,size:t,more:(0,m.jsx)(G,{actions:i}),...r}),(0,m.jsxs)(B.FlexRow,{pl:1,columnGap:1,justifyContent:o===void 0?"center":"space-between",overflow:"hidden",height:Q[t],children:[p??o===void 0?(0,m.jsx)(F.CircularProgress,{size:16}):(0,m.jsx)(T,{value:o,typographyVariant:X[t]}),o===void 0?null:l?(0,m.jsx)(D,{value:o}):null]})]})});v.displayName="PropertyBox";var q=(0,z.forwardRef)(({style:r,variant:e,elevation:o=2,square:p,...t},a)=>(0,m.jsx)(F.Paper,{ref:a,style:{minWidth:0,overflow:"hidden",...r},variant:e,elevation:o,square:p,children:(0,m.jsx)(v,{...t,paper:!1})}));q.displayName="PropertyPaper";var O=(0,z.forwardRef)((r,e)=>r.paper?(0,m.jsx)(q,{ref:e,...r}):(0,m.jsx)(v,{ref:e,...r}));O.displayName="Property";0&&(module.exports={Property,PropertyGroup,PropertyTitle,PropertyValue});
|
|
232
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/components/Group.tsx","../../src/components/Title.tsx","../../src/components/Property.tsx","../../src/components/ActionsMenu.tsx","../../src/components/IdenticonCorner.tsx","../../src/components/Value.tsx"],"sourcesContent":["export * from './components'\n","import { Paper, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport { typeOf } from '@xyo-network/typeof'\nimport { ReactElement } from 'react'\n\nimport { PropertyGroupBoxProps, PropertyGroupPaperProps, PropertyGroupProps } from './Props'\nimport { PropertyTitle } from './Title'\n\nconst PropertyGroupBox: React.FC<PropertyGroupBoxProps> = ({ titleProps, children, title, tip, ...props }) => {\n const theme = useTheme()\n const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined\n return (\n <FlexCol alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n <FlexRow overflow=\"hidden\" justifyContent=\"stretch\" alignItems=\"stretch\">\n <PropertyTitle alignItems=\"flex-start\" size=\"full\" title={title} tip={tip} {...titleProps} />\n {childrenArray ?\n <FlexGrowRow>\n {childrenArray?.map((child, index) => {\n return child ?\n <FlexGrowRow key={index} borderLeft={1} borderColor={theme.palette.divider}>\n {child}\n </FlexGrowRow>\n : null\n })}\n </FlexGrowRow>\n : <FlexGrowRow overflow=\"hidden\">{children}</FlexGrowRow>}\n </FlexRow>\n </FlexCol>\n )\n}\n\nconst PropertyGroupPaper: React.FC<PropertyGroupPaperProps> = ({ style, variant, elevation, square, ...props }) => {\n return (\n <Paper style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyGroupBox {...props} paper={false} />\n </Paper>\n )\n}\n\nexport const PropertyGroup: React.FC<PropertyGroupProps> = (props) => {\n return props.paper ? <PropertyGroupPaper {...props} /> : <PropertyGroupBox {...props} />\n}\n","import { darken, lighten, Typography, TypographyVariant, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { QuickTipButton } from '@xylabs/react-quick-tip-button'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport type TitleSizeProp = SizeProp | 'full'\n\nexport interface PropertyTitleProps extends FlexBoxProps {\n elevation?: number\n more?: ReactNode\n size?: TitleSizeProp\n tip?: ReactNode\n title?: string\n}\n\nexport const PropertyTitle: React.FC<PropertyTitleProps> = ({ elevation = 1, size = 'medium', tip, more, title, ...props }) => {\n const sizeVariants: Record<TitleSizeProp, TypographyVariant> = {\n full: 'caption',\n large: 'caption',\n medium: 'caption',\n small: 'caption',\n }\n\n const sizeTitleHeight: Record<TitleSizeProp, number | undefined> = {\n full: undefined,\n large: 32,\n medium: 20,\n small: 16,\n }\n\n const sizeFontSize: Record<TitleSizeProp, number> = {\n full: 16,\n large: 16,\n medium: 14,\n small: 10,\n }\n\n const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16\n\n const theme = useTheme()\n\n return (\n <FlexRow\n bgcolor={\n theme.palette.mode === 'dark' ?\n lighten(theme.palette.background.paper, 0.05 * elevation)\n : darken(theme.palette.background.paper, 0.025 * elevation)\n }\n alignItems=\"center\"\n height={sizeTitleHeight[size]}\n justifyContent=\"space-between\"\n {...props}\n >\n <FlexRow paddingX={1} paddingY={0.5}>\n <Typography fontWeight={500} noWrap variant={sizeVariants[size]} fontSize={sizeFontSize[size]}>\n <small>\n <strong>{title}</strong>\n </small>\n </Typography>\n {tip ?\n <QuickTipButton style={{ fontSize: quickTipSize }} color=\"inherit\" title={title ?? ''}>\n {tip}\n </QuickTipButton>\n : null}\n </FlexRow>\n {more}\n </FlexRow>\n )\n}\n","import { CircularProgress, Paper, TypographyVariant } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { PropertyActionsMenu } from './ActionsMenu'\nimport { IdenticonCorner } from './IdenticonCorner'\nimport { PropertyBoxProps, PropertyPaperProps, PropertyProps } from './Props'\nimport { PropertyTitle } from './Title'\nimport { PropertyValue } from './Value'\n\nconst PropertyBox = forwardRef<HTMLDivElement, PropertyBoxProps>(\n ({ titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props }, ref) => {\n const sizeValueHeight: Record<SizeProp, number> = {\n large: 48,\n medium: 36,\n small: 24,\n }\n\n const sizeVariants: Record<SizeProp, TypographyVariant> = {\n large: 'h6',\n medium: 'body1',\n small: 'body2',\n }\n\n return (\n <FlexRow ref={ref} flexDirection=\"column\" minWidth={0} alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n {title === undefined ? null : (\n <PropertyTitle\n tip={tip}\n title={required ? `${title}*` : title}\n size={size}\n more={<PropertyActionsMenu actions={actions} />}\n {...titleProps}\n />\n )}\n <FlexRow\n pl={1}\n columnGap={1}\n justifyContent={value === undefined ? 'center' : 'space-between'}\n overflow=\"hidden\"\n height={sizeValueHeight[size]}\n >\n {children ?? value === undefined ?\n <CircularProgress size={16} />\n : <PropertyValue value={value} typographyVariant={sizeVariants[size]} />}\n {value === undefined ?\n null\n : badge ?\n <IdenticonCorner value={value} />\n : null}\n </FlexRow>\n </FlexRow>\n )\n },\n)\nPropertyBox.displayName = 'PropertyBox'\n\nconst PropertyPaper = forwardRef<HTMLDivElement, PropertyPaperProps>(({ style, variant, elevation = 2, square, ...props }, ref) => {\n return (\n <Paper ref={ref} style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyBox {...props} paper={false} />\n </Paper>\n )\n})\nPropertyPaper.displayName = 'PropertyPaper'\n\nexport const Property = forwardRef<HTMLDivElement, PropertyProps>((props, ref) => {\n return props.paper ? <PropertyPaper ref={ref} {...props} /> : <PropertyBox ref={ref} {...props} />\n})\nProperty.displayName = 'Property'\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActionsMenu: React.FC<PropertyActionsProps> = ({ actions, ...props }) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = !!anchorEl\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return actions && actions?.length > 0 ?\n <FlexRow {...props}>\n <IconButton size=\"small\" color=\"inherit\" onClick={handleClick}>\n <MoreHorizIcon fontSize=\"inherit\" />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n {actions?.map((action) => {\n return (\n <MenuItem\n key={action.name}\n onClick={() => {\n action?.onClick?.()\n handleClose()\n }}\n >\n {action.name}\n </MenuItem>\n )\n })}\n </Menu>\n </FlexRow>\n : null\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEffect, useRef, useState } from 'react'\n\nexport interface IdenticonCornerProps extends FlexBoxProps {\n value?: string | number | boolean | null\n}\n\nexport const IdenticonCorner: React.FC<IdenticonCornerProps> = ({ value, ...props }) => {\n const theme = useTheme()\n const [parentHeight, setParentHeight] = useState<number>()\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight)\n }, [])\n\n const calculatedHeight = parentHeight ?? 0\n\n return (\n <FlexRow alignItems=\"flex-start\" height=\"100%\">\n <FlexRow background height={calculatedHeight} width={calculatedHeight} borderLeft={`1px solid ${theme.palette.divider}`}>\n <div ref={ref}>\n <Identicon size={calculatedHeight * 0.6} value={`${value}`} sx={{ padding: `${calculatedHeight * 0.2}px` }} {...props} />\n </div>\n </FlexRow>\n </FlexRow>\n )\n}\n","// eslint-disable-next-line import/no-internal-modules\nimport type { Variant } from '@mui/material/styles/createTypography'\nimport { EllipsizeBox, EllipsizeBoxProps } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface PropertyValueProps extends Omit<EllipsizeBoxProps, 'ref'> {\n typographyVariant?: Variant\n value?: string | number | boolean | null\n}\n\nexport const PropertyValue = forwardRef<HTMLDivElement, PropertyValueProps>(({ typographyVariant = 'body1', value, ...props }, ref) => {\n return value === undefined ? null : (\n <EllipsizeBox\n typographyProps={{ component: undefined, title: value?.toString(), variant: typographyVariant }}\n width=\"100%\"\n ref={ref}\n {...props}\n >\n {value}\n </EllipsizeBox>\n )\n})\n\nPropertyValue.displayName = 'PropertyValue'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACA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rB,6CAAC,qCAAiB,MAAM,IAAI,IAC5B,6CAAC,iBAAc,OAAc,mBAAmB,aAAa,IAAI,GAAG;AAAA,YACrE,UAAU,SACT,OACA,QACA,6CAAC,mBAAgB,OAAc,IAC/B;AAAA;AAAA;AAAA,MACJ;AAAA,OACF;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;AAE1B,IAAM,oBAAgB,0BAA+C,CAAC,EAAE,OAAO,SAAS,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACjI,SACE,6CAAC,0BAAM,KAAU,OAAO,EAAE,UAAU,GAAG,UAAU,UAAU,GAAG,MAAM,GAAG,SAAkB,WAAsB,QAC7G,uDAAC,eAAa,GAAG,OAAO,OAAO,OAAO,GACxC;AAEJ,CAAC;AACD,cAAc,cAAc;AAErB,IAAM,eAAW,0BAA0C,CAAC,OAAO,QAAQ;AAChF,SAAO,MAAM,QAAQ,6CAAC,iBAAc,KAAW,GAAG,OAAO,IAAK,6CAAC,eAAY,KAAW,GAAG,OAAO;AAClG,CAAC;AACD,SAAS,cAAc;","names":["import_material","import_react_flexbox","import_jsx_runtime","import_material","import_react_flexbox","import_react","import_material","import_react_flexbox","import_jsx_runtime","MoreHorizIcon","import_material","import_react_flexbox","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/Group.tsx","../../src/components/Title.tsx","../../src/components/Property.tsx","../../src/components/ActionsMenu.tsx","../../src/components/IdenticonCorner.tsx","../../src/components/Value.tsx"],"sourcesContent":["export * from './components'\n","import { Paper, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport { typeOf } from '@xyo-network/typeof'\nimport { ReactElement } from 'react'\n\nimport { PropertyGroupBoxProps, PropertyGroupPaperProps, PropertyGroupProps } from './Props'\nimport { PropertyTitle } from './Title'\n\nconst PropertyGroupBox: React.FC<PropertyGroupBoxProps> = ({ titleProps, children, title, tip, ...props }) => {\n const theme = useTheme()\n const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined\n return (\n <FlexCol alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n <FlexRow overflow=\"hidden\" justifyContent=\"stretch\" alignItems=\"stretch\">\n <PropertyTitle alignItems=\"flex-start\" size=\"full\" title={title} tip={tip} {...titleProps} />\n {childrenArray ?\n <FlexGrowRow>\n {childrenArray?.map((child, index) => {\n return child ?\n <FlexGrowRow key={index} borderLeft={1} borderColor={theme.palette.divider}>\n {child}\n </FlexGrowRow>\n : null\n })}\n </FlexGrowRow>\n : <FlexGrowRow overflow=\"hidden\">{children}</FlexGrowRow>}\n </FlexRow>\n </FlexCol>\n )\n}\n\nconst PropertyGroupPaper: React.FC<PropertyGroupPaperProps> = ({ style, variant, elevation, square, ...props }) => {\n return (\n <Paper style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyGroupBox {...props} paper={false} />\n </Paper>\n )\n}\n\nexport const PropertyGroup: React.FC<PropertyGroupProps> = (props) => {\n return props.paper ? <PropertyGroupPaper {...props} /> : <PropertyGroupBox {...props} />\n}\n","import { darken, lighten, Typography, TypographyVariant, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { QuickTipButton } from '@xylabs/react-quick-tip-button'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport type TitleSizeProp = SizeProp | 'full'\n\nexport interface PropertyTitleProps extends FlexBoxProps {\n elevation?: number\n more?: ReactNode\n size?: TitleSizeProp\n tip?: ReactNode\n title?: string\n}\n\nexport const PropertyTitle: React.FC<PropertyTitleProps> = ({ elevation = 1, size = 'medium', tip, more, title, ...props }) => {\n const sizeVariants: Record<TitleSizeProp, TypographyVariant> = {\n full: 'caption',\n large: 'caption',\n medium: 'caption',\n small: 'caption',\n }\n\n const sizeTitleHeight: Record<TitleSizeProp, number | undefined> = {\n full: undefined,\n large: 32,\n medium: 20,\n small: 16,\n }\n\n const sizeFontSize: Record<TitleSizeProp, number> = {\n full: 16,\n large: 16,\n medium: 14,\n small: 10,\n }\n\n const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16\n\n const theme = useTheme()\n\n return (\n <FlexRow\n bgcolor={\n theme.palette.mode === 'dark' ?\n lighten(theme.palette.background.paper, 0.05 * elevation)\n : darken(theme.palette.background.paper, 0.025 * elevation)\n }\n alignItems=\"center\"\n height={sizeTitleHeight[size]}\n justifyContent=\"space-between\"\n {...props}\n >\n <FlexRow paddingX={1} paddingY={0.5}>\n <Typography fontWeight={500} noWrap variant={sizeVariants[size]} fontSize={sizeFontSize[size]}>\n <small>\n <strong>{title}</strong>\n </small>\n </Typography>\n {tip ?\n <QuickTipButton style={{ fontSize: quickTipSize }} color=\"inherit\" title={title ?? ''}>\n {tip}\n </QuickTipButton>\n : null}\n </FlexRow>\n {more}\n </FlexRow>\n )\n}\n","import { CircularProgress, Paper, TypographyVariant } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { PropertyActionsMenu } from './ActionsMenu'\nimport { IdenticonCorner } from './IdenticonCorner'\nimport { PropertyBoxProps, PropertyPaperProps, PropertyProps } from './Props'\nimport { PropertyTitle } from './Title'\nimport { PropertyValue } from './Value'\n\nconst PropertyBox = forwardRef<HTMLDivElement, PropertyBoxProps>(\n ({ titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props }, ref) => {\n const sizeValueHeight: Record<SizeProp, number> = {\n large: 48,\n medium: 36,\n small: 24,\n }\n\n const sizeVariants: Record<SizeProp, TypographyVariant> = {\n large: 'h6',\n medium: 'body1',\n small: 'body2',\n }\n\n return (\n <FlexRow ref={ref} flexDirection=\"column\" minWidth={0} alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n {title === undefined ? null : (\n <PropertyTitle\n tip={tip}\n title={required ? `${title}*` : title}\n size={size}\n more={<PropertyActionsMenu actions={actions} />}\n {...titleProps}\n />\n )}\n <FlexRow\n pl={1}\n columnGap={1}\n justifyContent={value === undefined ? 'center' : 'space-between'}\n overflow=\"hidden\"\n height={sizeValueHeight[size]}\n >\n {children ?? value === undefined ?\n <CircularProgress size={16} />\n : <PropertyValue value={value} typographyVariant={sizeVariants[size]} />}\n {value === undefined ?\n null\n : badge ?\n <IdenticonCorner value={value} />\n : null}\n </FlexRow>\n </FlexRow>\n )\n },\n)\nPropertyBox.displayName = 'PropertyBox'\n\nconst PropertyPaper = forwardRef<HTMLDivElement, PropertyPaperProps>(({ style, variant, elevation = 2, square, ...props }, ref) => {\n return (\n <Paper ref={ref} style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyBox {...props} paper={false} />\n </Paper>\n )\n})\nPropertyPaper.displayName = 'PropertyPaper'\n\nexport const Property = forwardRef<HTMLDivElement, PropertyProps>((props, ref) => {\n return props.paper ? <PropertyPaper ref={ref} {...props} /> : <PropertyBox ref={ref} {...props} />\n})\nProperty.displayName = 'Property'\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActionsMenu: React.FC<PropertyActionsProps> = ({ actions, ...props }) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = !!anchorEl\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return actions && actions?.length > 0 ?\n <FlexRow {...props}>\n <IconButton size=\"small\" color=\"inherit\" onClick={handleClick}>\n <MoreHorizIcon fontSize=\"inherit\" />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n {actions?.map((action) => {\n return (\n <MenuItem\n key={action.name}\n onClick={() => {\n action?.onClick?.()\n handleClose()\n }}\n >\n {action.name}\n </MenuItem>\n )\n })}\n </Menu>\n </FlexRow>\n : null\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEffect, useRef, useState } from 'react'\n\nexport interface IdenticonCornerProps extends FlexBoxProps {\n value?: string | number | boolean | null\n}\n\nexport const IdenticonCorner: React.FC<IdenticonCornerProps> = ({ value, ...props }) => {\n const theme = useTheme()\n const [parentHeight, setParentHeight] = useState<number>()\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight)\n }, [])\n\n const calculatedHeight = parentHeight ?? 0\n\n return (\n <FlexRow alignItems=\"flex-start\" height=\"100%\">\n <FlexRow background height={calculatedHeight} width={calculatedHeight} borderLeft={`1px solid ${theme.palette.divider}`}>\n <div ref={ref}>\n <Identicon size={calculatedHeight * 0.6} value={`${value}`} sx={{ padding: `${calculatedHeight * 0.2}px` }} {...props} />\n </div>\n </FlexRow>\n </FlexRow>\n )\n}\n","// eslint-disable-next-line import/no-internal-modules\nimport type { Variant } from '@mui/material/styles/createTypography'\nimport { EllipsizeBox, EllipsizeBoxProps } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface PropertyValueProps extends Omit<EllipsizeBoxProps, 'ref'> {\n typographyVariant?: Variant\n value?: string | number | boolean | null\n}\n\nexport const PropertyValue = forwardRef<HTMLDivElement, PropertyValueProps>(({ typographyVariant = 'body1', value, ...props }, ref) => {\n return value === undefined ? null : (\n <EllipsizeBox\n typographyProps={{ component: undefined, title: value?.toString(), variant: typographyVariant }}\n width=\"100%\"\n ref={ref}\n {...props}\n >\n {value}\n </EllipsizeBox>\n )\n})\n\nPropertyValue.displayName = 'PropertyValue'\n"],"mappings":"yaAAA,IAAAA,GAAA,GA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AAA,CAAgB,MAAOd,EAAO,EAC/B,MACJ,GACF,CAEJ,CACF,EACAH,EAAY,YAAc,cAE1B,IAAMkB,KAAgB,cAA+C,CAAC,CAAE,MAAAC,EAAO,QAAAC,EAAS,UAAAC,EAAY,EAAG,OAAAC,EAAQ,GAAGZ,CAAM,EAAGC,OAEvH,OAAC,SAAM,IAAKA,EAAK,MAAO,CAAE,SAAU,EAAG,SAAU,SAAU,GAAGQ,CAAM,EAAG,QAASC,EAAS,UAAWC,EAAW,OAAQC,EACrH,mBAACtB,EAAA,CAAa,GAAGU,EAAO,MAAO,GAAO,EACxC,CAEH,EACDQ,EAAc,YAAc,gBAErB,IAAMK,KAAW,cAA0C,CAACb,EAAOC,IACjED,EAAM,SAAQ,OAACQ,EAAA,CAAc,IAAKP,EAAM,GAAGD,EAAO,KAAK,OAACV,EAAA,CAAY,IAAKW,EAAM,GAAGD,EAAO,CACjG,EACDa,EAAS,YAAc","names":["src_exports","__export","Property","PropertyGroup","PropertyTitle","PropertyValue","__toCommonJS","import_material","import_react_flexbox","import_typeof","import_material","import_react_flexbox","import_react_quick_tip_button","import_jsx_runtime","PropertyTitle","elevation","size","tip","more","title","props","sizeVariants","sizeTitleHeight","sizeFontSize","quickTipSize","theme","import_jsx_runtime","PropertyGroupBox","titleProps","children","title","tip","props","theme","childrenArray","PropertyTitle","child","index","PropertyGroupPaper","style","variant","elevation","square","PropertyGroup","import_material","import_react_flexbox","import_react","import_icons_material","import_material","import_react_flexbox","import_react","import_jsx_runtime","PropertyActionsMenu","actions","props","anchorEl","setAnchorEl","open","handleClick","event","handleClose","MoreHorizIcon","action","_a","import_material","import_react_flexbox","import_react_identicon","import_react","import_jsx_runtime","IdenticonCorner","value","props","theme","parentHeight","setParentHeight","ref","_a","_b","_c","calculatedHeight","import_react_shared","import_react","import_jsx_runtime","PropertyValue","typographyVariant","value","props","ref","import_jsx_runtime","PropertyBox","titleProps","title","value","children","size","tip","actions","required","badge","props","ref","sizeValueHeight","sizeVariants","PropertyTitle","PropertyActionsMenu","PropertyValue","IdenticonCorner","PropertyPaper","style","variant","elevation","square","Property"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,202 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { Paper, useTheme as useTheme2 } from "@mui/material";
|
|
3
|
-
import { FlexCol, FlexGrowRow, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
4
|
-
import { typeOf } from "@xyo-network/typeof";
|
|
5
|
-
|
|
6
|
-
// src/components/Title.tsx
|
|
7
|
-
import { darken, lighten, Typography, useTheme } from "@mui/material";
|
|
8
|
-
import { FlexRow } from "@xylabs/react-flexbox";
|
|
9
|
-
import { QuickTipButton } from "@xylabs/react-quick-tip-button";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
var PropertyTitle = ({ elevation = 1, size = "medium", tip, more, title, ...props }) => {
|
|
12
|
-
const sizeVariants = {
|
|
13
|
-
full: "caption",
|
|
14
|
-
large: "caption",
|
|
15
|
-
medium: "caption",
|
|
16
|
-
small: "caption"
|
|
17
|
-
};
|
|
18
|
-
const sizeTitleHeight = {
|
|
19
|
-
full: void 0,
|
|
20
|
-
large: 32,
|
|
21
|
-
medium: 20,
|
|
22
|
-
small: 16
|
|
23
|
-
};
|
|
24
|
-
const sizeFontSize = {
|
|
25
|
-
full: 16,
|
|
26
|
-
large: 16,
|
|
27
|
-
medium: 14,
|
|
28
|
-
small: 10
|
|
29
|
-
};
|
|
30
|
-
const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16;
|
|
31
|
-
const theme = useTheme();
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
33
|
-
FlexRow,
|
|
34
|
-
{
|
|
35
|
-
bgcolor: theme.palette.mode === "dark" ? lighten(theme.palette.background.paper, 0.05 * elevation) : darken(theme.palette.background.paper, 0.025 * elevation),
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
height: sizeTitleHeight[size],
|
|
38
|
-
justifyContent: "space-between",
|
|
39
|
-
...props,
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(FlexRow, { paddingX: 1, paddingY: 0.5, children: [
|
|
42
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: 500, noWrap: true, variant: sizeVariants[size], fontSize: sizeFontSize[size], children: /* @__PURE__ */ jsx("small", { children: /* @__PURE__ */ jsx("strong", { children: title }) }) }),
|
|
43
|
-
tip ? /* @__PURE__ */ jsx(QuickTipButton, { style: { fontSize: quickTipSize }, color: "inherit", title: title ?? "", children: tip }) : null
|
|
44
|
-
] }),
|
|
45
|
-
more
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// src/components/Group.tsx
|
|
52
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
53
|
-
var PropertyGroupBox = ({ titleProps, children, title, tip, ...props }) => {
|
|
54
|
-
const theme = useTheme2();
|
|
55
|
-
const childrenArray = typeOf(children) === "array" ? children : void 0;
|
|
56
|
-
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", overflow: "hidden", ...props, children: /* @__PURE__ */ jsxs2(FlexRow2, { overflow: "hidden", justifyContent: "stretch", alignItems: "stretch", children: [
|
|
57
|
-
/* @__PURE__ */ jsx2(PropertyTitle, { alignItems: "flex-start", size: "full", title, tip, ...titleProps }),
|
|
58
|
-
childrenArray ? /* @__PURE__ */ jsx2(FlexGrowRow, { children: childrenArray == null ? void 0 : childrenArray.map((child, index) => {
|
|
59
|
-
return child ? /* @__PURE__ */ jsx2(FlexGrowRow, { borderLeft: 1, borderColor: theme.palette.divider, children: child }, index) : null;
|
|
60
|
-
}) }) : /* @__PURE__ */ jsx2(FlexGrowRow, { overflow: "hidden", children })
|
|
61
|
-
] }) });
|
|
62
|
-
};
|
|
63
|
-
var PropertyGroupPaper = ({ style, variant, elevation, square, ...props }) => {
|
|
64
|
-
return /* @__PURE__ */ jsx2(Paper, { style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ jsx2(PropertyGroupBox, { ...props, paper: false }) });
|
|
65
|
-
};
|
|
66
|
-
var PropertyGroup = (props) => {
|
|
67
|
-
return props.paper ? /* @__PURE__ */ jsx2(PropertyGroupPaper, { ...props }) : /* @__PURE__ */ jsx2(PropertyGroupBox, { ...props });
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// src/components/Property.tsx
|
|
71
|
-
import { CircularProgress, Paper as Paper2 } from "@mui/material";
|
|
72
|
-
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
73
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
74
|
-
|
|
75
|
-
// src/components/ActionsMenu.tsx
|
|
76
|
-
import { MoreHoriz as MoreHorizIcon } from "@mui/icons-material";
|
|
77
|
-
import { IconButton, Menu, MenuItem } from "@mui/material";
|
|
78
|
-
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
79
|
-
import { useState } from "react";
|
|
80
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
81
|
-
var PropertyActionsMenu = ({ actions, ...props }) => {
|
|
82
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
83
|
-
const open = !!anchorEl;
|
|
84
|
-
const handleClick = (event) => {
|
|
85
|
-
setAnchorEl(event.currentTarget);
|
|
86
|
-
};
|
|
87
|
-
const handleClose = () => {
|
|
88
|
-
setAnchorEl(null);
|
|
89
|
-
};
|
|
90
|
-
return actions && (actions == null ? void 0 : actions.length) > 0 ? /* @__PURE__ */ jsxs3(FlexRow3, { ...props, children: [
|
|
91
|
-
/* @__PURE__ */ jsx3(IconButton, { size: "small", color: "inherit", onClick: handleClick, children: /* @__PURE__ */ jsx3(MoreHorizIcon, { fontSize: "inherit" }) }),
|
|
92
|
-
/* @__PURE__ */ jsx3(Menu, { anchorEl, open, onClose: handleClose, children: actions == null ? void 0 : actions.map((action) => {
|
|
93
|
-
return /* @__PURE__ */ jsx3(
|
|
94
|
-
MenuItem,
|
|
95
|
-
{
|
|
96
|
-
onClick: () => {
|
|
97
|
-
var _a;
|
|
98
|
-
(_a = action == null ? void 0 : action.onClick) == null ? void 0 : _a.call(action);
|
|
99
|
-
handleClose();
|
|
100
|
-
},
|
|
101
|
-
children: action.name
|
|
102
|
-
},
|
|
103
|
-
action.name
|
|
104
|
-
);
|
|
105
|
-
}) })
|
|
106
|
-
] }) : null;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/components/IdenticonCorner.tsx
|
|
110
|
-
import { useTheme as useTheme3 } from "@mui/material";
|
|
111
|
-
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
112
|
-
import { Identicon } from "@xylabs/react-identicon";
|
|
113
|
-
import { useEffect, useRef, useState as useState2 } from "react";
|
|
114
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
115
|
-
var IdenticonCorner = ({ value, ...props }) => {
|
|
116
|
-
const theme = useTheme3();
|
|
117
|
-
const [parentHeight, setParentHeight] = useState2();
|
|
118
|
-
const ref = useRef(null);
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
var _a, _b, _c;
|
|
121
|
-
setParentHeight((_c = (_b = (_a = ref.current) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.parentElement) == null ? void 0 : _c.clientHeight);
|
|
122
|
-
}, []);
|
|
123
|
-
const calculatedHeight = parentHeight ?? 0;
|
|
124
|
-
return /* @__PURE__ */ jsx4(FlexRow4, { alignItems: "flex-start", height: "100%", children: /* @__PURE__ */ jsx4(FlexRow4, { background: true, height: calculatedHeight, width: calculatedHeight, borderLeft: `1px solid ${theme.palette.divider}`, children: /* @__PURE__ */ jsx4("div", { ref, children: /* @__PURE__ */ jsx4(Identicon, { size: calculatedHeight * 0.6, value: `${value}`, sx: { padding: `${calculatedHeight * 0.2}px` }, ...props }) }) }) });
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
// src/components/Value.tsx
|
|
128
|
-
import { EllipsizeBox } from "@xyo-network/react-shared";
|
|
129
|
-
import { forwardRef } from "react";
|
|
130
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
131
|
-
var PropertyValue = forwardRef(({ typographyVariant = "body1", value, ...props }, ref) => {
|
|
132
|
-
return value === void 0 ? null : /* @__PURE__ */ jsx5(
|
|
133
|
-
EllipsizeBox,
|
|
134
|
-
{
|
|
135
|
-
typographyProps: { component: void 0, title: value == null ? void 0 : value.toString(), variant: typographyVariant },
|
|
136
|
-
width: "100%",
|
|
137
|
-
ref,
|
|
138
|
-
...props,
|
|
139
|
-
children: value
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
});
|
|
143
|
-
PropertyValue.displayName = "PropertyValue";
|
|
144
|
-
|
|
145
|
-
// src/components/Property.tsx
|
|
146
|
-
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
147
|
-
var PropertyBox = forwardRef2(
|
|
148
|
-
({ titleProps, title, value, children, size = "medium", tip, actions, required, badge = false, ...props }, ref) => {
|
|
149
|
-
const sizeValueHeight = {
|
|
150
|
-
large: 48,
|
|
151
|
-
medium: 36,
|
|
152
|
-
small: 24
|
|
153
|
-
};
|
|
154
|
-
const sizeVariants = {
|
|
155
|
-
large: "h6",
|
|
156
|
-
medium: "body1",
|
|
157
|
-
small: "body2"
|
|
158
|
-
};
|
|
159
|
-
return /* @__PURE__ */ jsxs4(FlexRow5, { ref, flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden", ...props, children: [
|
|
160
|
-
title === void 0 ? null : /* @__PURE__ */ jsx6(
|
|
161
|
-
PropertyTitle,
|
|
162
|
-
{
|
|
163
|
-
tip,
|
|
164
|
-
title: required ? `${title}*` : title,
|
|
165
|
-
size,
|
|
166
|
-
more: /* @__PURE__ */ jsx6(PropertyActionsMenu, { actions }),
|
|
167
|
-
...titleProps
|
|
168
|
-
}
|
|
169
|
-
),
|
|
170
|
-
/* @__PURE__ */ jsxs4(
|
|
171
|
-
FlexRow5,
|
|
172
|
-
{
|
|
173
|
-
pl: 1,
|
|
174
|
-
columnGap: 1,
|
|
175
|
-
justifyContent: value === void 0 ? "center" : "space-between",
|
|
176
|
-
overflow: "hidden",
|
|
177
|
-
height: sizeValueHeight[size],
|
|
178
|
-
children: [
|
|
179
|
-
children ?? value === void 0 ? /* @__PURE__ */ jsx6(CircularProgress, { size: 16 }) : /* @__PURE__ */ jsx6(PropertyValue, { value, typographyVariant: sizeVariants[size] }),
|
|
180
|
-
value === void 0 ? null : badge ? /* @__PURE__ */ jsx6(IdenticonCorner, { value }) : null
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
] });
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
PropertyBox.displayName = "PropertyBox";
|
|
188
|
-
var PropertyPaper = forwardRef2(({ style, variant, elevation = 2, square, ...props }, ref) => {
|
|
189
|
-
return /* @__PURE__ */ jsx6(Paper2, { ref, style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ jsx6(PropertyBox, { ...props, paper: false }) });
|
|
190
|
-
});
|
|
191
|
-
PropertyPaper.displayName = "PropertyPaper";
|
|
192
|
-
var Property = forwardRef2((props, ref) => {
|
|
193
|
-
return props.paper ? /* @__PURE__ */ jsx6(PropertyPaper, { ref, ...props }) : /* @__PURE__ */ jsx6(PropertyBox, { ref, ...props });
|
|
194
|
-
});
|
|
195
|
-
Property.displayName = "Property";
|
|
196
|
-
export {
|
|
197
|
-
Property,
|
|
198
|
-
PropertyGroup,
|
|
199
|
-
PropertyTitle,
|
|
200
|
-
PropertyValue
|
|
201
|
-
};
|
|
1
|
+
import{Paper as L,useTheme as N}from"@mui/material";import{FlexCol as D,FlexGrowRow as h,FlexRow as W}from"@xylabs/react-flexbox";import{typeOf as A}from"@xyo-network/typeof";import{darken as M,lighten as V,Typography as H,useTheme as k}from"@mui/material";import{FlexRow as w}from"@xylabs/react-flexbox";import{QuickTipButton as G}from"@xylabs/react-quick-tip-button";import{jsx as f,jsxs as T}from"react/jsx-runtime";var P=({elevation:e=1,size:r="medium",tip:o,more:p,title:n,...m})=>{let i={full:"caption",large:"caption",medium:"caption",small:"caption"},t={full:void 0,large:32,medium:20,small:16},l={full:16,large:16,medium:14,small:10},u=l[r]<16?l[r]:16,d=k();return T(w,{bgcolor:d.palette.mode==="dark"?V(d.palette.background.paper,.05*e):M(d.palette.background.paper,.025*e),alignItems:"center",height:t[r],justifyContent:"space-between",...m,children:[T(w,{paddingX:1,paddingY:.5,children:[f(H,{fontWeight:500,noWrap:!0,variant:i[r],fontSize:l[r],children:f("small",{children:f("strong",{children:n})})}),o?f(G,{style:{fontSize:u},color:"inherit",title:n??"",children:o}):null]}),p]})};import{jsx as a,jsxs as q}from"react/jsx-runtime";var F=({titleProps:e,children:r,title:o,tip:p,...n})=>{let m=N(),i=A(r)==="array"?r:void 0;return a(D,{alignItems:"stretch",overflow:"hidden",...n,children:q(W,{overflow:"hidden",justifyContent:"stretch",alignItems:"stretch",children:[a(P,{alignItems:"flex-start",size:"full",title:o,tip:p,...e}),i?a(h,{children:i==null?void 0:i.map((t,l)=>t?a(h,{borderLeft:1,borderColor:m.palette.divider,children:t},l):null)}):a(h,{overflow:"hidden",children:r})]})})},$=({style:e,variant:r,elevation:o,square:p,...n})=>a(L,{style:{minWidth:0,overflow:"hidden",...e},variant:r,elevation:o,square:p,children:a(F,{...n,paper:!1})}),ge=e=>e.paper?a($,{...e}):a(F,{...e});import{CircularProgress as ne,Paper as ie}from"@mui/material";import{FlexRow as E}from"@xylabs/react-flexbox";import{forwardRef as g}from"react";import{MoreHoriz as O}from"@mui/icons-material";import{IconButton as Q,Menu as X,MenuItem as Y}from"@mui/material";import{FlexRow as J}from"@xylabs/react-flexbox";import{useState as K}from"react";import{jsx as y,jsxs as U}from"react/jsx-runtime";var z=({actions:e,...r})=>{let[o,p]=K(null),n=!!o,m=t=>{p(t.currentTarget)},i=()=>{p(null)};return e&&(e==null?void 0:e.length)>0?U(J,{...r,children:[y(Q,{size:"small",color:"inherit",onClick:m,children:y(O,{fontSize:"inherit"})}),y(X,{anchorEl:o,open:n,onClose:i,children:e==null?void 0:e.map(t=>y(Y,{onClick:()=>{var l;(l=t==null?void 0:t.onClick)==null||l.call(t),i()},children:t.name},t.name))})]}):null};import{useTheme as Z}from"@mui/material";import{FlexRow as C}from"@xylabs/react-flexbox";import{Identicon as _}from"@xylabs/react-identicon";import{useEffect as j,useRef as ee,useState as re}from"react";import{jsx as c}from"react/jsx-runtime";var b=({value:e,...r})=>{let o=Z(),[p,n]=re(),m=ee(null);j(()=>{var t,l,u;n((u=(l=(t=m.current)==null?void 0:t.parentElement)==null?void 0:l.parentElement)==null?void 0:u.clientHeight)},[]);let i=p??0;return c(C,{alignItems:"flex-start",height:"100%",children:c(C,{background:!0,height:i,width:i,borderLeft:`1px solid ${o.palette.divider}`,children:c("div",{ref:m,children:c(_,{size:i*.6,value:`${e}`,sx:{padding:`${i*.2}px`},...r})})})})};import{EllipsizeBox as oe}from"@xyo-network/react-shared";import{forwardRef as te}from"react";import{jsx as pe}from"react/jsx-runtime";var x=te(({typographyVariant:e="body1",value:r,...o},p)=>r===void 0?null:pe(oe,{typographyProps:{component:void 0,title:r==null?void 0:r.toString(),variant:e},width:"100%",ref:p,...o,children:r}));x.displayName="PropertyValue";import{jsx as s,jsxs as B}from"react/jsx-runtime";var R=g(({titleProps:e,title:r,value:o,children:p,size:n="medium",tip:m,actions:i,required:t,badge:l=!1,...u},d)=>{let S={large:48,medium:36,small:24},I={large:"h6",medium:"body1",small:"body2"};return B(E,{ref:d,flexDirection:"column",minWidth:0,alignItems:"stretch",overflow:"hidden",...u,children:[r===void 0?null:s(P,{tip:m,title:t?`${r}*`:r,size:n,more:s(z,{actions:i}),...e}),B(E,{pl:1,columnGap:1,justifyContent:o===void 0?"center":"space-between",overflow:"hidden",height:S[n],children:[p??o===void 0?s(ne,{size:16}):s(x,{value:o,typographyVariant:I[n]}),o===void 0?null:l?s(b,{value:o}):null]})]})});R.displayName="PropertyBox";var v=g(({style:e,variant:r,elevation:o=2,square:p,...n},m)=>s(ie,{ref:m,style:{minWidth:0,overflow:"hidden",...e},variant:r,elevation:o,square:p,children:s(R,{...n,paper:!1})}));v.displayName="PropertyPaper";var le=g((e,r)=>e.paper?s(v,{ref:r,...e}):s(R,{ref:r,...e}));le.displayName="Property";export{le as Property,ge as PropertyGroup,P as PropertyTitle,x as PropertyValue};
|
|
202
2
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Group.tsx","../../src/components/Title.tsx","../../src/components/Property.tsx","../../src/components/ActionsMenu.tsx","../../src/components/IdenticonCorner.tsx","../../src/components/Value.tsx"],"sourcesContent":["import { Paper, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport { typeOf } from '@xyo-network/typeof'\nimport { ReactElement } from 'react'\n\nimport { PropertyGroupBoxProps, PropertyGroupPaperProps, PropertyGroupProps } from './Props'\nimport { PropertyTitle } from './Title'\n\nconst PropertyGroupBox: React.FC<PropertyGroupBoxProps> = ({ titleProps, children, title, tip, ...props }) => {\n const theme = useTheme()\n const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined\n return (\n <FlexCol alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n <FlexRow overflow=\"hidden\" justifyContent=\"stretch\" alignItems=\"stretch\">\n <PropertyTitle alignItems=\"flex-start\" size=\"full\" title={title} tip={tip} {...titleProps} />\n {childrenArray ?\n <FlexGrowRow>\n {childrenArray?.map((child, index) => {\n return child ?\n <FlexGrowRow key={index} borderLeft={1} borderColor={theme.palette.divider}>\n {child}\n </FlexGrowRow>\n : null\n })}\n </FlexGrowRow>\n : <FlexGrowRow overflow=\"hidden\">{children}</FlexGrowRow>}\n </FlexRow>\n </FlexCol>\n )\n}\n\nconst PropertyGroupPaper: React.FC<PropertyGroupPaperProps> = ({ style, variant, elevation, square, ...props }) => {\n return (\n <Paper style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyGroupBox {...props} paper={false} />\n </Paper>\n )\n}\n\nexport const PropertyGroup: React.FC<PropertyGroupProps> = (props) => {\n return props.paper ? <PropertyGroupPaper {...props} /> : <PropertyGroupBox {...props} />\n}\n","import { darken, lighten, Typography, TypographyVariant, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { QuickTipButton } from '@xylabs/react-quick-tip-button'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport type TitleSizeProp = SizeProp | 'full'\n\nexport interface PropertyTitleProps extends FlexBoxProps {\n elevation?: number\n more?: ReactNode\n size?: TitleSizeProp\n tip?: ReactNode\n title?: string\n}\n\nexport const PropertyTitle: React.FC<PropertyTitleProps> = ({ elevation = 1, size = 'medium', tip, more, title, ...props }) => {\n const sizeVariants: Record<TitleSizeProp, TypographyVariant> = {\n full: 'caption',\n large: 'caption',\n medium: 'caption',\n small: 'caption',\n }\n\n const sizeTitleHeight: Record<TitleSizeProp, number | undefined> = {\n full: undefined,\n large: 32,\n medium: 20,\n small: 16,\n }\n\n const sizeFontSize: Record<TitleSizeProp, number> = {\n full: 16,\n large: 16,\n medium: 14,\n small: 10,\n }\n\n const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16\n\n const theme = useTheme()\n\n return (\n <FlexRow\n bgcolor={\n theme.palette.mode === 'dark' ?\n lighten(theme.palette.background.paper, 0.05 * elevation)\n : darken(theme.palette.background.paper, 0.025 * elevation)\n }\n alignItems=\"center\"\n height={sizeTitleHeight[size]}\n justifyContent=\"space-between\"\n {...props}\n >\n <FlexRow paddingX={1} paddingY={0.5}>\n <Typography fontWeight={500} noWrap variant={sizeVariants[size]} fontSize={sizeFontSize[size]}>\n <small>\n <strong>{title}</strong>\n </small>\n </Typography>\n {tip ?\n <QuickTipButton style={{ fontSize: quickTipSize }} color=\"inherit\" title={title ?? ''}>\n {tip}\n </QuickTipButton>\n : null}\n </FlexRow>\n {more}\n </FlexRow>\n )\n}\n","import { CircularProgress, Paper, TypographyVariant } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { PropertyActionsMenu } from './ActionsMenu'\nimport { IdenticonCorner } from './IdenticonCorner'\nimport { PropertyBoxProps, PropertyPaperProps, PropertyProps } from './Props'\nimport { PropertyTitle } from './Title'\nimport { PropertyValue } from './Value'\n\nconst PropertyBox = forwardRef<HTMLDivElement, PropertyBoxProps>(\n ({ titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props }, ref) => {\n const sizeValueHeight: Record<SizeProp, number> = {\n large: 48,\n medium: 36,\n small: 24,\n }\n\n const sizeVariants: Record<SizeProp, TypographyVariant> = {\n large: 'h6',\n medium: 'body1',\n small: 'body2',\n }\n\n return (\n <FlexRow ref={ref} flexDirection=\"column\" minWidth={0} alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n {title === undefined ? null : (\n <PropertyTitle\n tip={tip}\n title={required ? `${title}*` : title}\n size={size}\n more={<PropertyActionsMenu actions={actions} />}\n {...titleProps}\n />\n )}\n <FlexRow\n pl={1}\n columnGap={1}\n justifyContent={value === undefined ? 'center' : 'space-between'}\n overflow=\"hidden\"\n height={sizeValueHeight[size]}\n >\n {children ?? value === undefined ?\n <CircularProgress size={16} />\n : <PropertyValue value={value} typographyVariant={sizeVariants[size]} />}\n {value === undefined ?\n null\n : badge ?\n <IdenticonCorner value={value} />\n : null}\n </FlexRow>\n </FlexRow>\n )\n },\n)\nPropertyBox.displayName = 'PropertyBox'\n\nconst PropertyPaper = forwardRef<HTMLDivElement, PropertyPaperProps>(({ style, variant, elevation = 2, square, ...props }, ref) => {\n return (\n <Paper ref={ref} style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyBox {...props} paper={false} />\n </Paper>\n )\n})\nPropertyPaper.displayName = 'PropertyPaper'\n\nexport const Property = forwardRef<HTMLDivElement, PropertyProps>((props, ref) => {\n return props.paper ? <PropertyPaper ref={ref} {...props} /> : <PropertyBox ref={ref} {...props} />\n})\nProperty.displayName = 'Property'\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActionsMenu: React.FC<PropertyActionsProps> = ({ actions, ...props }) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = !!anchorEl\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return actions && actions?.length > 0 ?\n <FlexRow {...props}>\n <IconButton size=\"small\" color=\"inherit\" onClick={handleClick}>\n <MoreHorizIcon fontSize=\"inherit\" />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n {actions?.map((action) => {\n return (\n <MenuItem\n key={action.name}\n onClick={() => {\n action?.onClick?.()\n handleClose()\n }}\n >\n {action.name}\n </MenuItem>\n )\n })}\n </Menu>\n </FlexRow>\n : null\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEffect, useRef, useState } from 'react'\n\nexport interface IdenticonCornerProps extends FlexBoxProps {\n value?: string | number | boolean | null\n}\n\nexport const IdenticonCorner: React.FC<IdenticonCornerProps> = ({ value, ...props }) => {\n const theme = useTheme()\n const [parentHeight, setParentHeight] = useState<number>()\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight)\n }, [])\n\n const calculatedHeight = parentHeight ?? 0\n\n return (\n <FlexRow alignItems=\"flex-start\" height=\"100%\">\n <FlexRow background height={calculatedHeight} width={calculatedHeight} borderLeft={`1px solid ${theme.palette.divider}`}>\n <div ref={ref}>\n <Identicon size={calculatedHeight * 0.6} value={`${value}`} sx={{ padding: `${calculatedHeight * 0.2}px` }} {...props} />\n </div>\n </FlexRow>\n </FlexRow>\n )\n}\n","// eslint-disable-next-line import/no-internal-modules\nimport type { Variant } from '@mui/material/styles/createTypography'\nimport { EllipsizeBox, EllipsizeBoxProps } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface PropertyValueProps extends Omit<EllipsizeBoxProps, 'ref'> {\n typographyVariant?: Variant\n value?: string | number | boolean | null\n}\n\nexport const PropertyValue = forwardRef<HTMLDivElement, PropertyValueProps>(({ typographyVariant = 'body1', value, ...props }, ref) => {\n return value === undefined ? null : (\n <EllipsizeBox\n typographyProps={{ component: undefined, title: value?.toString(), variant: typographyVariant }}\n width=\"100%\"\n ref={ref}\n {...props}\n >\n {value}\n </EllipsizeBox>\n )\n})\n\nPropertyValue.displayName = 'PropertyValue'\n"],"mappings":";AAAA,SAAS,OAAO,YAAAA,iBAAgB;AAChC,SAAS,SAAS,aAAa,WAAAC,gBAAe;AAC9C,SAAS,cAAc;;;ACFvB,SAAS,QAAQ,SAAS,YAA+B,gBAAgB;AACzE,SAAuB,eAAe;AACtC,SAAS,sBAAsB;AAoDzB,SAGM,KAHN;AAtCC,IAAM,gBAA8C,CAAC,EAAE,YAAY,GAAG,OAAO,UAAU,KAAK,MAAM,OAAO,GAAG,MAAM,MAAM;AAC7H,QAAM,eAAyD;AAAA,IAC7D,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAEA,QAAM,kBAA6D;AAAA,IACjE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,I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AAc,mBAAmB,aAAa,IAAI,GAAG;AAAA,YACrE,UAAU,SACT,OACA,QACA,gBAAAA,KAAC,mBAAgB,OAAc,IAC/B;AAAA;AAAA;AAAA,MACJ;AAAA,OACF;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;AAE1B,IAAM,gBAAgBE,YAA+C,CAAC,EAAE,OAAO,SAAS,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACjI,SACE,gBAAAF,KAACI,QAAA,EAAM,KAAU,OAAO,EAAE,UAAU,GAAG,UAAU,UAAU,GAAG,MAAM,GAAG,SAAkB,WAAsB,QAC7G,0BAAAJ,KAAC,eAAa,GAAG,OAAO,OAAO,OAAO,GACxC;AAEJ,CAAC;AACD,cAAc,cAAc;AAErB,IAAM,WAAWE,YAA0C,CAAC,OAAO,QAAQ;AAChF,SAAO,MAAM,QAAQ,gBAAAF,KAAC,iBAAc,KAAW,GAAG,OAAO,IAAK,gBAAAA,KAAC,eAAY,KAAW,GAAG,OAAO;AAClG,CAAC;AACD,SAAS,cAAc;","names":["useTheme","FlexRow","jsx","jsxs","useTheme","FlexRow","Paper","FlexRow","forwardRef","FlexRow","jsx","jsxs","useTheme","FlexRow","useState","jsx","jsx","jsx","jsxs","forwardRef","FlexRow","Paper"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/Group.tsx","../../src/components/Title.tsx","../../src/components/Property.tsx","../../src/components/ActionsMenu.tsx","../../src/components/IdenticonCorner.tsx","../../src/components/Value.tsx"],"sourcesContent":["import { Paper, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowRow, FlexRow } from '@xylabs/react-flexbox'\nimport { typeOf } from '@xyo-network/typeof'\nimport { ReactElement } from 'react'\n\nimport { PropertyGroupBoxProps, PropertyGroupPaperProps, PropertyGroupProps } from './Props'\nimport { PropertyTitle } from './Title'\n\nconst PropertyGroupBox: React.FC<PropertyGroupBoxProps> = ({ titleProps, children, title, tip, ...props }) => {\n const theme = useTheme()\n const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined\n return (\n <FlexCol alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n <FlexRow overflow=\"hidden\" justifyContent=\"stretch\" alignItems=\"stretch\">\n <PropertyTitle alignItems=\"flex-start\" size=\"full\" title={title} tip={tip} {...titleProps} />\n {childrenArray ?\n <FlexGrowRow>\n {childrenArray?.map((child, index) => {\n return child ?\n <FlexGrowRow key={index} borderLeft={1} borderColor={theme.palette.divider}>\n {child}\n </FlexGrowRow>\n : null\n })}\n </FlexGrowRow>\n : <FlexGrowRow overflow=\"hidden\">{children}</FlexGrowRow>}\n </FlexRow>\n </FlexCol>\n )\n}\n\nconst PropertyGroupPaper: React.FC<PropertyGroupPaperProps> = ({ style, variant, elevation, square, ...props }) => {\n return (\n <Paper style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyGroupBox {...props} paper={false} />\n </Paper>\n )\n}\n\nexport const PropertyGroup: React.FC<PropertyGroupProps> = (props) => {\n return props.paper ? <PropertyGroupPaper {...props} /> : <PropertyGroupBox {...props} />\n}\n","import { darken, lighten, Typography, TypographyVariant, useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { QuickTipButton } from '@xylabs/react-quick-tip-button'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { ReactNode } from 'react'\n\nexport type TitleSizeProp = SizeProp | 'full'\n\nexport interface PropertyTitleProps extends FlexBoxProps {\n elevation?: number\n more?: ReactNode\n size?: TitleSizeProp\n tip?: ReactNode\n title?: string\n}\n\nexport const PropertyTitle: React.FC<PropertyTitleProps> = ({ elevation = 1, size = 'medium', tip, more, title, ...props }) => {\n const sizeVariants: Record<TitleSizeProp, TypographyVariant> = {\n full: 'caption',\n large: 'caption',\n medium: 'caption',\n small: 'caption',\n }\n\n const sizeTitleHeight: Record<TitleSizeProp, number | undefined> = {\n full: undefined,\n large: 32,\n medium: 20,\n small: 16,\n }\n\n const sizeFontSize: Record<TitleSizeProp, number> = {\n full: 16,\n large: 16,\n medium: 14,\n small: 10,\n }\n\n const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16\n\n const theme = useTheme()\n\n return (\n <FlexRow\n bgcolor={\n theme.palette.mode === 'dark' ?\n lighten(theme.palette.background.paper, 0.05 * elevation)\n : darken(theme.palette.background.paper, 0.025 * elevation)\n }\n alignItems=\"center\"\n height={sizeTitleHeight[size]}\n justifyContent=\"space-between\"\n {...props}\n >\n <FlexRow paddingX={1} paddingY={0.5}>\n <Typography fontWeight={500} noWrap variant={sizeVariants[size]} fontSize={sizeFontSize[size]}>\n <small>\n <strong>{title}</strong>\n </small>\n </Typography>\n {tip ?\n <QuickTipButton style={{ fontSize: quickTipSize }} color=\"inherit\" title={title ?? ''}>\n {tip}\n </QuickTipButton>\n : null}\n </FlexRow>\n {more}\n </FlexRow>\n )\n}\n","import { CircularProgress, Paper, TypographyVariant } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { SizeProp } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nimport { PropertyActionsMenu } from './ActionsMenu'\nimport { IdenticonCorner } from './IdenticonCorner'\nimport { PropertyBoxProps, PropertyPaperProps, PropertyProps } from './Props'\nimport { PropertyTitle } from './Title'\nimport { PropertyValue } from './Value'\n\nconst PropertyBox = forwardRef<HTMLDivElement, PropertyBoxProps>(\n ({ titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props }, ref) => {\n const sizeValueHeight: Record<SizeProp, number> = {\n large: 48,\n medium: 36,\n small: 24,\n }\n\n const sizeVariants: Record<SizeProp, TypographyVariant> = {\n large: 'h6',\n medium: 'body1',\n small: 'body2',\n }\n\n return (\n <FlexRow ref={ref} flexDirection=\"column\" minWidth={0} alignItems=\"stretch\" overflow=\"hidden\" {...props}>\n {title === undefined ? null : (\n <PropertyTitle\n tip={tip}\n title={required ? `${title}*` : title}\n size={size}\n more={<PropertyActionsMenu actions={actions} />}\n {...titleProps}\n />\n )}\n <FlexRow\n pl={1}\n columnGap={1}\n justifyContent={value === undefined ? 'center' : 'space-between'}\n overflow=\"hidden\"\n height={sizeValueHeight[size]}\n >\n {children ?? value === undefined ?\n <CircularProgress size={16} />\n : <PropertyValue value={value} typographyVariant={sizeVariants[size]} />}\n {value === undefined ?\n null\n : badge ?\n <IdenticonCorner value={value} />\n : null}\n </FlexRow>\n </FlexRow>\n )\n },\n)\nPropertyBox.displayName = 'PropertyBox'\n\nconst PropertyPaper = forwardRef<HTMLDivElement, PropertyPaperProps>(({ style, variant, elevation = 2, square, ...props }, ref) => {\n return (\n <Paper ref={ref} style={{ minWidth: 0, overflow: 'hidden', ...style }} variant={variant} elevation={elevation} square={square}>\n <PropertyBox {...props} paper={false} />\n </Paper>\n )\n})\nPropertyPaper.displayName = 'PropertyPaper'\n\nexport const Property = forwardRef<HTMLDivElement, PropertyProps>((props, ref) => {\n return props.paper ? <PropertyPaper ref={ref} {...props} /> : <PropertyBox ref={ref} {...props} />\n})\nProperty.displayName = 'Property'\n","import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { useState } from 'react'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActionsMenu: React.FC<PropertyActionsProps> = ({ actions, ...props }) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)\n const open = !!anchorEl\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget)\n }\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n return actions && actions?.length > 0 ?\n <FlexRow {...props}>\n <IconButton size=\"small\" color=\"inherit\" onClick={handleClick}>\n <MoreHorizIcon fontSize=\"inherit\" />\n </IconButton>\n <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>\n {actions?.map((action) => {\n return (\n <MenuItem\n key={action.name}\n onClick={() => {\n action?.onClick?.()\n handleClose()\n }}\n >\n {action.name}\n </MenuItem>\n )\n })}\n </Menu>\n </FlexRow>\n : null\n}\n","import { useTheme } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { Identicon } from '@xylabs/react-identicon'\nimport { useEffect, useRef, useState } from 'react'\n\nexport interface IdenticonCornerProps extends FlexBoxProps {\n value?: string | number | boolean | null\n}\n\nexport const IdenticonCorner: React.FC<IdenticonCornerProps> = ({ value, ...props }) => {\n const theme = useTheme()\n const [parentHeight, setParentHeight] = useState<number>()\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight)\n }, [])\n\n const calculatedHeight = parentHeight ?? 0\n\n return (\n <FlexRow alignItems=\"flex-start\" height=\"100%\">\n <FlexRow background height={calculatedHeight} width={calculatedHeight} borderLeft={`1px solid ${theme.palette.divider}`}>\n <div ref={ref}>\n <Identicon size={calculatedHeight * 0.6} value={`${value}`} sx={{ padding: `${calculatedHeight * 0.2}px` }} {...props} />\n </div>\n </FlexRow>\n </FlexRow>\n )\n}\n","// eslint-disable-next-line import/no-internal-modules\nimport type { Variant } from '@mui/material/styles/createTypography'\nimport { EllipsizeBox, EllipsizeBoxProps } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface PropertyValueProps extends Omit<EllipsizeBoxProps, 'ref'> {\n typographyVariant?: Variant\n value?: string | number | boolean | null\n}\n\nexport const PropertyValue = forwardRef<HTMLDivElement, PropertyValueProps>(({ typographyVariant = 'body1', value, ...props }, ref) => {\n return value === undefined ? null : (\n <EllipsizeBox\n typographyProps={{ component: undefined, title: value?.toString(), variant: typographyVariant }}\n width=\"100%\"\n ref={ref}\n {...props}\n >\n {value}\n </EllipsizeBox>\n )\n})\n\nPropertyValue.displayName = 'PropertyValue'\n"],"mappings":"AAAA,OAAS,SAAAA,EAAO,YAAAC,MAAgB,gBAChC,OAAS,WAAAC,EAAS,eAAAC,E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Theme","FlexRow","QuickTipButton","jsx","jsxs","PropertyTitle","elevation","size","tip","more","title","props","sizeVariants","sizeTitleHeight","sizeFontSize","quickTipSize","theme","jsx","jsxs","PropertyGroupBox","titleProps","children","title","tip","props","theme","useTheme","childrenArray","typeOf","FlexCol","FlexRow","PropertyTitle","FlexGrowRow","child","index","PropertyGroupPaper","style","variant","elevation","square","Paper","PropertyGroup","CircularProgress","Paper","FlexRow","forwardRef","MoreHorizIcon","IconButton","Menu","MenuItem","FlexRow","useState","jsx","jsxs","PropertyActionsMenu","actions","props","anchorEl","setAnchorEl","open","handleClick","event","handleClose","action","_a","useTheme","FlexRow","Identicon","useEffect","useRef","useState","jsx","IdenticonCorner","value","props","theme","parentHeight","setParentHeight","ref","_a","_b","_c","calculatedHeight","EllipsizeBox","forwardRef","jsx","PropertyValue","typographyVariant","value","props","ref","jsx","jsxs","PropertyBox","forwardRef","titleProps","title","value","children","size","tip","actions","required","badge","props","ref","sizeValueHeight","sizeVariants","FlexRow","PropertyTitle","PropertyActionsMenu","CircularProgress","PropertyValue","IdenticonCorner","PropertyPaper","style","variant","elevation","square","Paper","Property"]}
|