@xyo-network/react-property 2.64.0-rc.6 → 2.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/Action.cjs +19 -0
- package/dist/browser/components/Action.cjs.map +1 -0
- package/dist/browser/components/Action.d.cts +8 -0
- package/dist/browser/components/Action.d.cts.map +1 -0
- package/dist/browser/components/Actions.cjs +38 -0
- package/dist/{node/components/Actions.mjs.map → browser/components/Actions.cjs.map} +1 -1
- package/dist/browser/components/Actions.d.cts +4 -0
- package/dist/browser/components/Actions.d.cts.map +1 -0
- package/dist/browser/components/ActionsMenu.cjs +57 -0
- package/dist/{node/components/ActionsMenu.mjs.map → browser/components/ActionsMenu.cjs.map} +1 -1
- package/dist/browser/components/ActionsMenu.d.cts +4 -0
- package/dist/browser/components/ActionsMenu.d.cts.map +1 -0
- package/dist/browser/components/ActionsProps.cjs +19 -0
- package/dist/browser/components/ActionsProps.cjs.map +1 -0
- package/dist/browser/components/ActionsProps.d.cts +7 -0
- package/dist/browser/components/ActionsProps.d.cts.map +1 -0
- package/dist/browser/components/Group.cjs +93 -0
- package/dist/browser/components/Group.cjs.map +1 -0
- package/dist/browser/components/Group.d.cts +4 -0
- package/dist/browser/components/Group.d.cts.map +1 -0
- package/dist/browser/components/IdenticonCorner.cjs +41 -0
- package/dist/{node/components/IdenticonCorner.mjs.map → browser/components/IdenticonCorner.cjs.map} +1 -1
- package/dist/browser/components/IdenticonCorner.d.cts +7 -0
- package/dist/browser/components/IdenticonCorner.d.cts.map +1 -0
- package/dist/browser/components/Property.cjs +185 -0
- package/dist/browser/components/Property.cjs.map +1 -0
- package/dist/browser/components/Property.d.cts +4 -0
- package/dist/browser/components/Property.d.cts.map +1 -0
- package/dist/browser/components/Props.cjs +19 -0
- package/dist/browser/components/Props.cjs.map +1 -0
- package/dist/browser/components/Props.d.cts +35 -0
- package/dist/browser/components/Props.d.cts.map +1 -0
- package/dist/browser/components/Title.cjs +69 -0
- package/dist/{node/components/Title.mjs.map → browser/components/Title.cjs.map} +1 -1
- package/dist/browser/components/Title.d.cts +13 -0
- package/dist/browser/components/Title.d.cts.map +1 -0
- package/dist/browser/components/Value.cjs +33 -0
- package/dist/browser/components/Value.cjs.map +1 -0
- package/dist/browser/components/Value.d.cts +9 -0
- package/dist/browser/components/Value.d.cts.map +1 -0
- package/dist/browser/components/index.cjs +214 -0
- package/dist/browser/components/index.cjs.map +1 -0
- package/dist/browser/components/index.d.cts +7 -0
- package/dist/browser/components/index.d.cts.map +1 -0
- package/dist/browser/index.cjs +214 -0
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.cts +2 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/docs.json +48117 -0
- package/dist/node/components/Action.cjs +19 -0
- package/dist/node/components/Action.cjs.map +1 -0
- package/dist/node/components/Action.d.cts +8 -0
- package/dist/node/components/Action.d.cts.map +1 -0
- package/dist/node/components/Action.js +0 -16
- package/dist/node/components/Action.js.map +1 -1
- package/dist/node/components/Actions.cjs +42 -0
- package/dist/node/components/Actions.cjs.map +1 -0
- package/dist/node/components/Actions.d.cts +4 -0
- package/dist/node/components/Actions.d.cts.map +1 -0
- package/dist/node/components/Actions.js +10 -33
- package/dist/node/components/Actions.js.map +1 -1
- package/dist/node/components/ActionsMenu.cjs +62 -0
- package/dist/node/components/ActionsMenu.cjs.map +1 -0
- package/dist/node/components/ActionsMenu.d.cts +4 -0
- package/dist/node/components/ActionsMenu.d.cts.map +1 -0
- package/dist/node/components/ActionsMenu.js +17 -39
- package/dist/node/components/ActionsMenu.js.map +1 -1
- package/dist/node/components/ActionsProps.cjs +19 -0
- package/dist/node/components/ActionsProps.cjs.map +1 -0
- package/dist/node/components/ActionsProps.d.cts +7 -0
- package/dist/node/components/ActionsProps.d.cts.map +1 -0
- package/dist/node/components/ActionsProps.js +0 -16
- package/dist/node/components/ActionsProps.js.map +1 -1
- package/dist/node/components/Group.cjs +97 -0
- package/dist/node/components/Group.cjs.map +1 -0
- package/dist/node/components/Group.d.cts +4 -0
- package/dist/node/components/Group.d.cts.map +1 -0
- package/dist/node/components/Group.js +65 -42
- package/dist/node/components/Group.js.map +1 -1
- package/dist/node/components/IdenticonCorner.cjs +46 -0
- package/dist/node/components/IdenticonCorner.cjs.map +1 -0
- package/dist/node/components/IdenticonCorner.d.cts +7 -0
- package/dist/node/components/IdenticonCorner.d.cts.map +1 -0
- package/dist/node/components/IdenticonCorner.js +16 -38
- package/dist/node/components/IdenticonCorner.js.map +1 -1
- package/dist/node/components/Property.cjs +191 -0
- package/dist/node/components/Property.cjs.map +1 -0
- package/dist/node/components/Property.d.cts +4 -0
- package/dist/node/components/Property.d.cts.map +1 -0
- package/dist/node/components/Property.js +125 -44
- package/dist/node/components/Property.js.map +1 -1
- package/dist/node/components/Props.cjs +19 -0
- package/dist/node/components/Props.cjs.map +1 -0
- package/dist/node/components/Props.d.cts +35 -0
- package/dist/node/components/Props.d.cts.map +1 -0
- package/dist/node/components/Props.js +0 -16
- package/dist/node/components/Props.js.map +1 -1
- package/dist/node/components/Title.cjs +73 -0
- package/dist/node/components/Title.cjs.map +1 -0
- package/dist/node/components/Title.d.cts +13 -0
- package/dist/node/components/Title.d.cts.map +1 -0
- package/dist/node/components/Title.js +15 -38
- package/dist/node/components/Title.js.map +1 -1
- package/dist/node/components/{Title.stories.js → Value.cjs} +14 -30
- package/dist/node/components/{Value.mjs.map → Value.cjs.map} +1 -1
- package/dist/node/components/Value.d.cts +9 -0
- package/dist/node/components/Value.d.cts.map +1 -0
- package/dist/node/components/Value.js +8 -31
- package/dist/node/components/Value.js.map +1 -1
- package/dist/node/components/index.cjs +223 -0
- package/dist/node/components/index.cjs.map +1 -0
- package/dist/node/components/index.d.cts +7 -0
- package/dist/node/components/index.d.cts.map +1 -0
- package/dist/node/components/index.js +190 -30
- package/dist/node/components/index.js.map +1 -1
- package/dist/node/index.cjs +223 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +2 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.js +190 -20
- package/dist/node/index.js.map +1 -1
- package/package.json +21 -21
- package/dist/browser/components/PropertyBox.stories.js +0 -160
- package/dist/browser/components/PropertyBox.stories.js.map +0 -1
- package/dist/browser/components/PropertyPaper.stories.js +0 -178
- package/dist/browser/components/PropertyPaper.stories.js.map +0 -1
- package/dist/browser/components/Title.stories.js +0 -27
- package/dist/browser/components/Title.stories.js.map +0 -1
- package/dist/browser/components/Value.stories.js +0 -26
- package/dist/browser/components/Value.stories.js.map +0 -1
- package/dist/node/components/Action.mjs +0 -1
- package/dist/node/components/Action.mjs.map +0 -1
- package/dist/node/components/Actions.mjs +0 -16
- package/dist/node/components/ActionsMenu.mjs +0 -35
- package/dist/node/components/ActionsProps.mjs +0 -1
- package/dist/node/components/ActionsProps.mjs.map +0 -1
- package/dist/node/components/Group.mjs +0 -25
- package/dist/node/components/Group.mjs.map +0 -1
- package/dist/node/components/IdenticonCorner.mjs +0 -19
- package/dist/node/components/Property.mjs +0 -61
- package/dist/node/components/Property.mjs.map +0 -1
- package/dist/node/components/PropertyBox.stories.js +0 -197
- package/dist/node/components/PropertyBox.stories.js.map +0 -1
- package/dist/node/components/PropertyBox.stories.mjs +0 -160
- package/dist/node/components/PropertyBox.stories.mjs.map +0 -1
- package/dist/node/components/PropertyPaper.stories.js +0 -217
- package/dist/node/components/PropertyPaper.stories.js.map +0 -1
- package/dist/node/components/PropertyPaper.stories.mjs +0 -178
- package/dist/node/components/PropertyPaper.stories.mjs.map +0 -1
- package/dist/node/components/Props.mjs +0 -1
- package/dist/node/components/Props.mjs.map +0 -1
- package/dist/node/components/Title.mjs +0 -47
- package/dist/node/components/Title.stories.js.map +0 -1
- package/dist/node/components/Title.stories.mjs +0 -27
- package/dist/node/components/Title.stories.mjs.map +0 -1
- package/dist/node/components/Value.mjs +0 -11
- package/dist/node/components/Value.stories.js +0 -51
- package/dist/node/components/Value.stories.js.map +0 -1
- package/dist/node/components/Value.stories.mjs +0 -26
- package/dist/node/components/Value.stories.mjs.map +0 -1
- package/dist/node/components/index.mjs +0 -7
- package/dist/node/components/index.mjs.map +0 -1
- package/dist/node/index.mjs +0 -2
- package/dist/node/index.mjs.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/components/Action.ts
|
|
17
|
+
var Action_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(Action_exports);
|
|
19
|
+
//# sourceMappingURL=Action.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Action.ts"],"sourcesContent":["import { ReactNode } from 'react'\n\nexport interface PropertyAction {\n disabled?: boolean\n icon?: ReactNode\n name: string\n onClick?: () => void\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/components/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/Actions.tsx
|
|
21
|
+
var Actions_exports = {};
|
|
22
|
+
__export(Actions_exports, {
|
|
23
|
+
PropertyActions: () => PropertyActions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Actions_exports);
|
|
26
|
+
var import_material = require("@mui/material");
|
|
27
|
+
var import_react_button = require("@xylabs/react-button");
|
|
28
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var PropertyActions = ({ buttons = false, actions, ...props }) => {
|
|
31
|
+
if (actions) {
|
|
32
|
+
return (actions?.length ?? 0) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexRow, { gap: 1, ...props, children: actions.map((action, index) => {
|
|
33
|
+
return action.icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.IconButton, { size: "small", color: "inherit", onClick: action.onClick, children: action.icon }, index) : buttons ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_button.ButtonEx, { paddingY: 0, color: "primary", size: "small", disabled: action.disabled, onClick: action.onClick, variant: "contained", children: action.name }, index) : null;
|
|
34
|
+
}) }) : null;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=Actions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Actions.tsx"],"sourcesContent":["import { IconButton } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActions: React.FC<PropertyActionsProps> = ({ buttons = false, actions, ...props }) => {\n if (actions) {\n return (actions?.length ?? 0) > 0 ? (\n <FlexRow gap={1} {...props}>\n {actions.map((action, index) => {\n return action.icon ? (\n <IconButton size=\"small\" key={index} color=\"inherit\" onClick={action.onClick}>\n {action.icon}\n </IconButton>\n ) : buttons ? (\n <ButtonEx paddingY={0} color=\"primary\" key={index} size=\"small\" disabled={action.disabled} onClick={action.onClick} variant=\"contained\">\n {action.name}\n </ButtonEx>\n ) : null\n })}\n </FlexRow>\n ) : null\n }\n return null\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Actions.tsx"],"sourcesContent":["import { IconButton } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nimport { PropertyActionsProps } from './ActionsProps'\n\nexport const PropertyActions: React.FC<PropertyActionsProps> = ({ buttons = false, actions, ...props }) => {\n if (actions) {\n return (actions?.length ?? 0) > 0 ? (\n <FlexRow gap={1} {...props}>\n {actions.map((action, index) => {\n return action.icon ? (\n <IconButton size=\"small\" key={index} color=\"inherit\" onClick={action.onClick}>\n {action.icon}\n </IconButton>\n ) : buttons ? (\n <ButtonEx paddingY={0} color=\"primary\" key={index} size=\"small\" disabled={action.disabled} onClick={action.onClick} variant=\"contained\">\n {action.name}\n </ButtonEx>\n ) : null\n })}\n </FlexRow>\n ) : null\n }\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AAC3B,0BAAyB;AACzB,2BAAwB;AAUZ;AANL,IAAM,kBAAkD,CAAC,EAAE,UAAU,OAAO,SAAS,GAAG,MAAM,MAAM;AACzG,MAAI,SAAS;AACX,YAAQ,SAAS,UAAU,KAAK,IAC9B,4CAAC,gCAAQ,KAAK,GAAI,GAAG,OAClB,kBAAQ,IAAI,CAAC,QAAQ,UAAU;AAC9B,aAAO,OAAO,OACZ,4CAAC,8BAAW,MAAK,SAAoB,OAAM,WAAU,SAAS,OAAO,SAClE,iBAAO,QADoB,KAE9B,IACE,UACF,4CAAC,gCAAS,UAAU,GAAG,OAAM,WAAsB,MAAK,SAAQ,UAAU,OAAO,UAAU,SAAS,OAAO,SAAS,SAAQ,aACzH,iBAAO,QADkC,KAE5C,IACE;AAAA,IACN,CAAC,GACH,IACE;AAAA,EACN;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../src/components/Actions.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmB1D,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/ActionsMenu.tsx
|
|
21
|
+
var ActionsMenu_exports = {};
|
|
22
|
+
__export(ActionsMenu_exports, {
|
|
23
|
+
PropertyActionsMenu: () => PropertyActionsMenu
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ActionsMenu_exports);
|
|
26
|
+
var import_icons_material = require("@mui/icons-material");
|
|
27
|
+
var import_material = require("@mui/material");
|
|
28
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var PropertyActionsMenu = ({ actions, ...props }) => {
|
|
32
|
+
const [anchorEl, setAnchorEl] = (0, import_react.useState)(null);
|
|
33
|
+
const open = !!anchorEl;
|
|
34
|
+
const handleClick = (event) => {
|
|
35
|
+
setAnchorEl(event.currentTarget);
|
|
36
|
+
};
|
|
37
|
+
const handleClose = () => {
|
|
38
|
+
setAnchorEl(null);
|
|
39
|
+
};
|
|
40
|
+
return actions && actions?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { ...props, children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.IconButton, { size: "small", color: "inherit", onClick: handleClick, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.MoreHoriz, { fontSize: "inherit" }) }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Menu, { anchorEl, open, onClose: handleClose, children: actions?.map((action) => {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
import_material.MenuItem,
|
|
45
|
+
{
|
|
46
|
+
onClick: () => {
|
|
47
|
+
action?.onClick?.();
|
|
48
|
+
handleClose();
|
|
49
|
+
},
|
|
50
|
+
children: action.name
|
|
51
|
+
},
|
|
52
|
+
action.name
|
|
53
|
+
);
|
|
54
|
+
}) })
|
|
55
|
+
] }) : null;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=ActionsMenu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ActionsMenu.tsx"],"sourcesContent":["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"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ActionsMenu.tsx"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2C;AAC3C,sBAA2C;AAC3C,2BAAwB;AACxB,mBAAyB;AAgBrB;AAZG,IAAM,sBAAsD,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AAC5F,QAAM,CAAC,UAAU,WAAW,QAAI,uBAA6B,IAAI;AACjE,QAAM,OAAO,CAAC,CAAC;AAEf,QAAM,cAAc,CAAC,UAAyC;AAC5D,gBAAY,MAAM,aAAa;AAAA,EACjC;AACA,QAAM,cAAc,MAAM;AACxB,gBAAY,IAAI;AAAA,EAClB;AAEA,SAAO,WAAW,SAAS,SAAS,IAClC,6CAAC,gCAAS,GAAG,OACX;AAAA,gDAAC,8BAAW,MAAK,SAAQ,OAAM,WAAU,SAAS,aAChD,sDAAC,sBAAAA,WAAA,EAAc,UAAS,WAAU,GACpC;AAAA,IACA,4CAAC,wBAAK,UAAoB,MAAY,SAAS,aAC5C,mBAAS,IAAI,CAAC,WAAW;AACxB,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,SAAS,MAAM;AACb,oBAAQ,UAAU;AAClB,wBAAY;AAAA,UACd;AAAA,UAEC,iBAAO;AAAA;AAAA,QANH,OAAO;AAAA,MAOd;AAAA,IAEJ,CAAC,GACH;AAAA,KACF,IACE;AACN;","names":["MoreHorizIcon"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsMenu.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAiC9D,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/components/ActionsProps.ts
|
|
17
|
+
var ActionsProps_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(ActionsProps_exports);
|
|
19
|
+
//# sourceMappingURL=ActionsProps.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ActionsProps.ts"],"sourcesContent":["import { FlexBoxProps } from '@xylabs/react-flexbox'\n\nimport { PropertyAction } from './Action'\n\nexport interface PropertyActionsProps extends FlexBoxProps {\n actions?: PropertyAction[]\n buttons?: boolean\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsProps.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/Group.tsx
|
|
21
|
+
var Group_exports = {};
|
|
22
|
+
__export(Group_exports, {
|
|
23
|
+
PropertyGroup: () => PropertyGroup
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Group_exports);
|
|
26
|
+
var import_material2 = require("@mui/material");
|
|
27
|
+
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
28
|
+
var import_typeof = require("@xyo-network/typeof");
|
|
29
|
+
|
|
30
|
+
// src/components/Title.tsx
|
|
31
|
+
var import_material = require("@mui/material");
|
|
32
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
33
|
+
var import_react_quick_tip_button = require("@xylabs/react-quick-tip-button");
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var PropertyTitle = ({ elevation = 1, size = "medium", tip, more, title, ...props }) => {
|
|
36
|
+
const sizeVariants = {
|
|
37
|
+
full: "caption",
|
|
38
|
+
large: "caption",
|
|
39
|
+
medium: "caption",
|
|
40
|
+
small: "caption"
|
|
41
|
+
};
|
|
42
|
+
const sizeTitleHeight = {
|
|
43
|
+
full: void 0,
|
|
44
|
+
large: 32,
|
|
45
|
+
medium: 20,
|
|
46
|
+
small: 16
|
|
47
|
+
};
|
|
48
|
+
const sizeFontSize = {
|
|
49
|
+
full: 16,
|
|
50
|
+
large: 16,
|
|
51
|
+
medium: 14,
|
|
52
|
+
small: 10
|
|
53
|
+
};
|
|
54
|
+
const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16;
|
|
55
|
+
const theme = (0, import_material.useTheme)();
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
57
|
+
import_react_flexbox.FlexRow,
|
|
58
|
+
{
|
|
59
|
+
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),
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
height: sizeTitleHeight[size],
|
|
62
|
+
justifyContent: "space-between",
|
|
63
|
+
...props,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { paddingX: 1, paddingY: 0.5, children: [
|
|
66
|
+
/* @__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 }) }) }),
|
|
67
|
+
tip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_quick_tip_button.QuickTipButton, { style: { fontSize: quickTipSize }, color: "inherit", title: title ?? "", children: tip }) : null
|
|
68
|
+
] }),
|
|
69
|
+
more
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// src/components/Group.tsx
|
|
76
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
77
|
+
var PropertyGroupBox = ({ titleProps, children, title, tip, ...props }) => {
|
|
78
|
+
const theme = (0, import_material2.useTheme)();
|
|
79
|
+
const childrenArray = (0, import_typeof.typeOf)(children) === "array" ? children : void 0;
|
|
80
|
+
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: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyTitle, { alignItems: "flex-start", size: "full", title, tip, ...titleProps }),
|
|
82
|
+
childrenArray ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { children: childrenArray?.map((child, index) => {
|
|
83
|
+
return child ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { borderLeft: 1, borderColor: theme.palette.divider, children: child }, index) : null;
|
|
84
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexGrowRow, { overflow: "hidden", children })
|
|
85
|
+
] }) });
|
|
86
|
+
};
|
|
87
|
+
var PropertyGroupPaper = ({ style, variant, elevation, square, ...props }) => {
|
|
88
|
+
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 }) });
|
|
89
|
+
};
|
|
90
|
+
var PropertyGroup = (props) => {
|
|
91
|
+
return props.paper ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyGroupPaper, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PropertyGroupBox, { ...props });
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=Group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Group.tsx","../../../src/components/Title.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 ) : (\n <FlexGrowRow overflow=\"hidden\">{children}</FlexGrowRow>\n )}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,mBAAgC;AAChC,IAAAC,wBAA8C;AAC9C,oBAAuB;;;ACFvB,sBAAyE;AACzE,2BAAsC;AACtC,oCAA+B;AAoDzB;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,IACR,OAAO;AAAA,EACT;AAEA,QAAM,eAA8C;AAAA,IAClD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAEA,QAAM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C,qCAAY,UAAS,UAAU,UAAS;AAAA,KAE7C,GACF;AAEJ;AAEA,IAAM,qBAAwD,CAAC,EAAE,OAAO,SAAS,WAAW,QAAQ,GAAG,MAAM,MAAM;AACjH,SACE,6CAAC,0BAAM,OAAO,EAAE,UAAU,GAAG,UAAU,UAAU,GAAG,MAAM,GAAG,SAAkB,WAAsB,QACnG,uDAAC,oBAAkB,GAAG,OAAO,OAAO,OAAO,GAC7C;AAEJ;AAEO,IAAM,gBAA8C,CAAC,UAAU;AACpE,SAAO,MAAM,QAAQ,6CAAC,sBAAoB,GAAG,OAAO,IAAK,6CAAC,oBAAkB,GAAG,OAAO;AACxF;","names":["import_material","import_react_flexbox","import_jsx_runtime"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/components/Group.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAkD,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAoC5F,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAEtD,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/IdenticonCorner.tsx
|
|
21
|
+
var IdenticonCorner_exports = {};
|
|
22
|
+
__export(IdenticonCorner_exports, {
|
|
23
|
+
IdenticonCorner: () => IdenticonCorner
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(IdenticonCorner_exports);
|
|
26
|
+
var import_material = require("@mui/material");
|
|
27
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
28
|
+
var import_react_identicon = require("@xylabs/react-identicon");
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var IdenticonCorner = ({ value, ...props }) => {
|
|
32
|
+
const theme = (0, import_material.useTheme)();
|
|
33
|
+
const [parentHeight, setParentHeight] = (0, import_react.useState)();
|
|
34
|
+
const ref = (0, import_react.useRef)(null);
|
|
35
|
+
(0, import_react.useEffect)(() => {
|
|
36
|
+
setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight);
|
|
37
|
+
}, []);
|
|
38
|
+
const calculatedHeight = parentHeight ?? 0;
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexRow, { alignItems: "flex-start", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexRow, { background: true, height: calculatedHeight, width: calculatedHeight, borderLeft: `1px solid ${theme.palette.divider}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_identicon.Identicon, { size: calculatedHeight * 0.6, value: `${value}`, sx: { padding: `${calculatedHeight * 0.2}px` }, ...props }) }) }) });
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=IdenticonCorner.cjs.map
|
package/dist/{node/components/IdenticonCorner.mjs.map → browser/components/IdenticonCorner.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/IdenticonCorner.tsx"],"sourcesContent":["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"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/IdenticonCorner.tsx"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,2BAAsC;AACtC,6BAA0B;AAC1B,mBAA4C;AAqBlC;AAfH,IAAM,kBAAkD,CAAC,EAAE,OAAO,GAAG,MAAM,MAAM;AACtF,QAAM,YAAQ,0BAAS;AACvB,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAiB;AACzD,QAAM,UAAM,qBAAuB,IAAI;AAEvC,8BAAU,MAAM;AACd,oBAAgB,IAAI,SAAS,eAAe,eAAe,YAAY;AAAA,EACzE,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB,gBAAgB;AAEzC,SACE,4CAAC,gCAAQ,YAAW,cAAa,QAAO,QACtC,sDAAC,gCAAQ,YAAU,MAAC,QAAQ,kBAAkB,OAAO,kBAAkB,YAAY,aAAa,MAAM,QAAQ,OAAO,IACnH,sDAAC,SAAI,KACH,sDAAC,oCAAU,MAAM,mBAAmB,KAAK,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,SAAS,GAAG,mBAAmB,GAAG,KAAK,GAAI,GAAG,OAAO,GACzH,GACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
export interface IdenticonCornerProps extends FlexBoxProps {
|
|
4
|
+
value?: string | number | boolean | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const IdenticonCorner: React.FC<IdenticonCornerProps>;
|
|
7
|
+
//# sourceMappingURL=IdenticonCorner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdenticonCorner.d.ts","sourceRoot":"","sources":["../../../src/components/IdenticonCorner.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAI7D,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CACzC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoB1D,CAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/Property.tsx
|
|
21
|
+
var Property_exports = {};
|
|
22
|
+
__export(Property_exports, {
|
|
23
|
+
Property: () => Property
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Property_exports);
|
|
26
|
+
var import_material4 = require("@mui/material");
|
|
27
|
+
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
28
|
+
var import_react4 = require("react");
|
|
29
|
+
|
|
30
|
+
// src/components/ActionsMenu.tsx
|
|
31
|
+
var import_icons_material = require("@mui/icons-material");
|
|
32
|
+
var import_material = require("@mui/material");
|
|
33
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
34
|
+
var import_react = require("react");
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var PropertyActionsMenu = ({ actions, ...props }) => {
|
|
37
|
+
const [anchorEl, setAnchorEl] = (0, import_react.useState)(null);
|
|
38
|
+
const open = !!anchorEl;
|
|
39
|
+
const handleClick = (event) => {
|
|
40
|
+
setAnchorEl(event.currentTarget);
|
|
41
|
+
};
|
|
42
|
+
const handleClose = () => {
|
|
43
|
+
setAnchorEl(null);
|
|
44
|
+
};
|
|
45
|
+
return actions && actions?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { ...props, children: [
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.IconButton, { size: "small", color: "inherit", onClick: handleClick, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.MoreHoriz, { fontSize: "inherit" }) }),
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Menu, { anchorEl, open, onClose: handleClose, children: actions?.map((action) => {
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
import_material.MenuItem,
|
|
50
|
+
{
|
|
51
|
+
onClick: () => {
|
|
52
|
+
action?.onClick?.();
|
|
53
|
+
handleClose();
|
|
54
|
+
},
|
|
55
|
+
children: action.name
|
|
56
|
+
},
|
|
57
|
+
action.name
|
|
58
|
+
);
|
|
59
|
+
}) })
|
|
60
|
+
] }) : null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/components/IdenticonCorner.tsx
|
|
64
|
+
var import_material2 = require("@mui/material");
|
|
65
|
+
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
66
|
+
var import_react_identicon = require("@xylabs/react-identicon");
|
|
67
|
+
var import_react2 = require("react");
|
|
68
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
69
|
+
var IdenticonCorner = ({ value, ...props }) => {
|
|
70
|
+
const theme = (0, import_material2.useTheme)();
|
|
71
|
+
const [parentHeight, setParentHeight] = (0, import_react2.useState)();
|
|
72
|
+
const ref = (0, import_react2.useRef)(null);
|
|
73
|
+
(0, import_react2.useEffect)(() => {
|
|
74
|
+
setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight);
|
|
75
|
+
}, []);
|
|
76
|
+
const calculatedHeight = parentHeight ?? 0;
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexRow, { alignItems: "flex-start", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_flexbox2.FlexRow, { background: true, height: calculatedHeight, width: calculatedHeight, borderLeft: `1px solid ${theme.palette.divider}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_identicon.Identicon, { size: calculatedHeight * 0.6, value: `${value}`, sx: { padding: `${calculatedHeight * 0.2}px` }, ...props }) }) }) });
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/components/Title.tsx
|
|
81
|
+
var import_material3 = require("@mui/material");
|
|
82
|
+
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
83
|
+
var import_react_quick_tip_button = require("@xylabs/react-quick-tip-button");
|
|
84
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
85
|
+
var PropertyTitle = ({ elevation = 1, size = "medium", tip, more, title, ...props }) => {
|
|
86
|
+
const sizeVariants = {
|
|
87
|
+
full: "caption",
|
|
88
|
+
large: "caption",
|
|
89
|
+
medium: "caption",
|
|
90
|
+
small: "caption"
|
|
91
|
+
};
|
|
92
|
+
const sizeTitleHeight = {
|
|
93
|
+
full: void 0,
|
|
94
|
+
large: 32,
|
|
95
|
+
medium: 20,
|
|
96
|
+
small: 16
|
|
97
|
+
};
|
|
98
|
+
const sizeFontSize = {
|
|
99
|
+
full: 16,
|
|
100
|
+
large: 16,
|
|
101
|
+
medium: 14,
|
|
102
|
+
small: 10
|
|
103
|
+
};
|
|
104
|
+
const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16;
|
|
105
|
+
const theme = (0, import_material3.useTheme)();
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
107
|
+
import_react_flexbox3.FlexRow,
|
|
108
|
+
{
|
|
109
|
+
bgcolor: theme.palette.mode === "dark" ? (0, import_material3.lighten)(theme.palette.background.paper, 0.05 * elevation) : (0, import_material3.darken)(theme.palette.background.paper, 0.025 * elevation),
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
height: sizeTitleHeight[size],
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
...props,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_flexbox3.FlexRow, { paddingX: 1, paddingY: 0.5, children: [
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Typography, { fontWeight: 500, noWrap: true, variant: sizeVariants[size], fontSize: sizeFontSize[size], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: title }) }) }),
|
|
117
|
+
tip ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_quick_tip_button.QuickTipButton, { style: { fontSize: quickTipSize }, color: "inherit", title: title ?? "", children: tip }) : null
|
|
118
|
+
] }),
|
|
119
|
+
more
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// src/components/Value.tsx
|
|
126
|
+
var import_react_shared = require("@xyo-network/react-shared");
|
|
127
|
+
var import_react3 = require("react");
|
|
128
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
129
|
+
var PropertyValue = (0, import_react3.forwardRef)(({ typographyVariant = "body1", value, ...props }, ref) => {
|
|
130
|
+
return value !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_shared.EllipsizeBox, { typographyProps: { component: void 0, title: value?.toString(), variant: typographyVariant }, width: "100%", ref, ...props, children: value }) : null;
|
|
131
|
+
});
|
|
132
|
+
PropertyValue.displayName = "PropertyValue";
|
|
133
|
+
|
|
134
|
+
// src/components/Property.tsx
|
|
135
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
136
|
+
var PropertyBox = (0, import_react4.forwardRef)(
|
|
137
|
+
({ titleProps, title, value, children, size = "medium", tip, actions, required, badge = false, ...props }, ref) => {
|
|
138
|
+
const sizeValueHeight = {
|
|
139
|
+
large: 48,
|
|
140
|
+
medium: 36,
|
|
141
|
+
small: 24
|
|
142
|
+
};
|
|
143
|
+
const sizeVariants = {
|
|
144
|
+
large: "h6",
|
|
145
|
+
medium: "body1",
|
|
146
|
+
small: "body2"
|
|
147
|
+
};
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox4.FlexRow, { ref, flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden", ...props, children: [
|
|
149
|
+
title !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
150
|
+
PropertyTitle,
|
|
151
|
+
{
|
|
152
|
+
tip,
|
|
153
|
+
title: required ? `${title}*` : title,
|
|
154
|
+
size,
|
|
155
|
+
more: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PropertyActionsMenu, { actions }),
|
|
156
|
+
...titleProps
|
|
157
|
+
}
|
|
158
|
+
) : null,
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
160
|
+
import_react_flexbox4.FlexRow,
|
|
161
|
+
{
|
|
162
|
+
pl: 1,
|
|
163
|
+
columnGap: 1,
|
|
164
|
+
justifyContent: value === void 0 ? "center" : "space-between",
|
|
165
|
+
overflow: "hidden",
|
|
166
|
+
height: sizeValueHeight[size],
|
|
167
|
+
children: [
|
|
168
|
+
children ? children : value !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PropertyValue, { value, typographyVariant: sizeVariants[size] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material4.CircularProgress, { size: 16 }),
|
|
169
|
+
value !== void 0 ? badge ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IdenticonCorner, { value }) : null : null
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] });
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
PropertyBox.displayName = "PropertyBox";
|
|
177
|
+
var PropertyPaper = (0, import_react4.forwardRef)(({ style, variant, elevation = 2, square, ...props }, ref) => {
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material4.Paper, { ref, style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PropertyBox, { ...props, paper: false }) });
|
|
179
|
+
});
|
|
180
|
+
PropertyPaper.displayName = "PropertyPaper";
|
|
181
|
+
var Property = (0, import_react4.forwardRef)((props, ref) => {
|
|
182
|
+
return props.paper ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PropertyPaper, { ref, ...props }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PropertyBox, { ref, ...props });
|
|
183
|
+
});
|
|
184
|
+
Property.displayName = "Property";
|
|
185
|
+
//# sourceMappingURL=Property.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Property.tsx","../../../src/components/ActionsMenu.tsx","../../../src/components/IdenticonCorner.tsx","../../../src/components/Title.tsx","../../../src/components/Value.tsx"],"sourcesContent":["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 ? (\n <PropertyTitle\n tip={tip}\n title={required ? `${title}*` : title}\n size={size}\n more={<PropertyActionsMenu actions={actions} />}\n {...titleProps}\n />\n ) : null}\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 ? (\n children\n ) : value !== undefined ? (\n <PropertyValue value={value} typographyVariant={sizeVariants[size]} />\n ) : (\n <CircularProgress size={16} />\n )}\n {value !== undefined ? badge ? <IdenticonCorner value={value} /> : null : 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","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 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 ? (\n <EllipsizeBox typographyProps={{ component: undefined, title: value?.toString(), variant: typographyVariant }} width=\"100%\" ref={ref} {...props}>\n {value}\n </EllipsizeBox>\n ) : null\n})\n\nPropertyValue.displayName = 'PropertyValue'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,mBAA2D;AAC3D,IAAAC,wBAAwB;AAExB,IAAAC,gBAA2B;;;ACH3B,4BAA2C;AAC3C,sBAA2C;AAC3C,2BAAwB;AACxB,mBAAyB;AAgBrB;AAZG,IAAM,sBAAsD,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AAC5F,QAAM,CAAC,UAAU,WAAW,QAAI,uBAA6B,IAAI;AACjE,QAAM,OAAO,CAAC,CAAC;AAEf,QAAM,cAAc,CAAC,UAAyC;AAC5D,gBAAY,MAAM,aAAa;AAAA,EACjC;AACA,QAAM,cAAc,MAAM;AACxB,gBAAY,IAAI;AAAA,EAClB;AAEA,SAAO,WAAW,SAAS,SAAS,IAClC,6CAAC,gCAAS,GAAG,OACX;AAAA,gDAAC,8BAAW,MAAK,SAAQ,OAAM,WAAU,SAAS,aAChD,sDAAC,sBAAAC,WAAA,EAAc,UAAS,WAAU,GACpC;AAAA,IACA,4CAAC,wBAAK,UAAoB,MAAY,SAAS,aAC5C,mBAAS,IAAI,CAAC,WAAW;AACxB,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,SAAS,MAAM;AACb,oBAAQ,UAAU;A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AAc,KAAW,GAAG,OAAO,IAAK,6CAAC,eAAY,KAAW,GAAG,OAAO;AAClG,CAAC;AACD,SAAS,cAAc;","names":["import_material","import_react_flexbox","import_react","MoreHorizIcon","import_material","import_react_flexbox","import_react","import_jsx_runtime","import_material","import_react_flexbox","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PropertyBoxProps, PropertyPaperProps } from './Props';
|
|
3
|
+
export declare const Property: import("react").ForwardRefExoticComponent<(PropertyBoxProps | Omit<PropertyPaperProps, "ref">) & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
//# sourceMappingURL=Property.d.ts.map
|