@xyo-network/react-property 2.64.0-rc.2 → 2.64.0-rc.4
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.d.mts.map +1 -0
- package/dist/browser/components/Action.d.ts.map +1 -0
- package/dist/browser/components/Action.js +1 -0
- package/dist/browser/components/Action.js.map +1 -0
- package/dist/browser/components/Actions.d.mts.map +1 -0
- package/dist/browser/components/Actions.d.ts.map +1 -0
- package/dist/browser/components/Actions.js +16 -0
- package/dist/browser/components/Actions.js.map +1 -0
- package/dist/browser/components/ActionsMenu.d.mts.map +1 -0
- package/dist/browser/components/ActionsMenu.d.ts.map +1 -0
- package/dist/browser/components/ActionsMenu.js +35 -0
- package/dist/browser/components/ActionsMenu.js.map +1 -0
- package/dist/browser/components/ActionsProps.d.mts.map +1 -0
- package/dist/browser/components/ActionsProps.d.ts.map +1 -0
- package/dist/browser/components/ActionsProps.js +1 -0
- package/dist/browser/components/ActionsProps.js.map +1 -0
- package/dist/browser/components/Group.d.mts.map +1 -0
- package/dist/browser/components/Group.d.ts.map +1 -0
- package/dist/browser/components/Group.js +25 -0
- package/dist/browser/components/Group.js.map +1 -0
- package/dist/browser/components/IdenticonCorner.d.mts.map +1 -0
- package/dist/browser/components/IdenticonCorner.d.ts.map +1 -0
- package/dist/browser/components/IdenticonCorner.js +19 -0
- package/dist/browser/components/IdenticonCorner.js.map +1 -0
- package/dist/browser/components/Property.d.mts.map +1 -0
- package/dist/browser/components/Property.d.ts.map +1 -0
- package/dist/browser/components/Property.js +61 -0
- package/dist/browser/components/Property.js.map +1 -0
- package/dist/browser/components/PropertyBox.stories.js +160 -0
- package/dist/browser/components/PropertyBox.stories.js.map +1 -0
- package/dist/browser/components/PropertyPaper.stories.js +178 -0
- package/dist/browser/components/PropertyPaper.stories.js.map +1 -0
- package/dist/browser/components/Props.d.mts.map +1 -0
- package/dist/browser/components/Props.d.ts.map +1 -0
- package/dist/browser/components/Props.js +1 -0
- package/dist/browser/components/Props.js.map +1 -0
- package/dist/browser/components/Title.d.mts.map +1 -0
- package/dist/browser/components/Title.d.ts.map +1 -0
- package/dist/browser/components/Title.js +47 -0
- package/dist/browser/components/Title.js.map +1 -0
- package/dist/browser/components/Title.stories.js +27 -0
- package/dist/browser/components/Title.stories.js.map +1 -0
- package/dist/browser/components/Value.d.mts.map +1 -0
- package/dist/browser/components/Value.d.ts.map +1 -0
- package/dist/browser/components/Value.js +11 -0
- package/dist/browser/components/Value.js.map +1 -0
- package/dist/browser/components/Value.stories.js +26 -0
- package/dist/browser/components/Value.stories.js.map +1 -0
- package/dist/browser/components/index.d.mts.map +1 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +7 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
- package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/components/Action.d.mts +8 -0
- package/dist/node/components/Action.d.mts.map +1 -0
- package/dist/node/components/Action.d.ts +8 -0
- package/dist/node/components/Action.d.ts.map +1 -0
- package/dist/node/components/Action.js +17 -0
- package/dist/node/components/Action.js.map +1 -0
- package/dist/node/components/Action.mjs +1 -0
- package/dist/node/components/Action.mjs.map +1 -0
- package/dist/node/components/Actions.d.mts +4 -0
- package/dist/node/components/Actions.d.mts.map +1 -0
- package/dist/node/components/Actions.d.ts +4 -0
- package/dist/node/components/Actions.d.ts.map +1 -0
- package/dist/node/components/Actions.js +40 -0
- package/dist/node/components/Actions.js.map +1 -0
- package/dist/node/components/Actions.mjs +16 -0
- package/dist/node/components/Actions.mjs.map +1 -0
- package/dist/node/components/ActionsMenu.d.mts +4 -0
- package/dist/node/components/ActionsMenu.d.mts.map +1 -0
- package/dist/node/components/ActionsMenu.d.ts +4 -0
- package/dist/node/components/ActionsMenu.d.ts.map +1 -0
- package/dist/node/components/ActionsMenu.js +59 -0
- package/dist/node/components/ActionsMenu.js.map +1 -0
- package/dist/node/components/ActionsMenu.mjs +35 -0
- package/dist/node/components/ActionsMenu.mjs.map +1 -0
- package/dist/node/components/ActionsProps.d.mts +7 -0
- package/dist/node/components/ActionsProps.d.mts.map +1 -0
- package/dist/node/components/ActionsProps.d.ts +7 -0
- package/dist/node/components/ActionsProps.d.ts.map +1 -0
- package/dist/node/components/ActionsProps.js +17 -0
- package/dist/node/components/ActionsProps.js.map +1 -0
- package/dist/node/components/ActionsProps.mjs +1 -0
- package/dist/node/components/ActionsProps.mjs.map +1 -0
- package/dist/node/components/Group.d.mts +4 -0
- package/dist/node/components/Group.d.mts.map +1 -0
- package/dist/node/components/Group.d.ts +4 -0
- package/dist/node/components/Group.d.ts.map +1 -0
- package/dist/node/components/Group.js +49 -0
- package/dist/node/components/Group.js.map +1 -0
- package/dist/node/components/Group.mjs +25 -0
- package/dist/node/components/Group.mjs.map +1 -0
- package/dist/node/components/IdenticonCorner.d.mts +7 -0
- package/dist/node/components/IdenticonCorner.d.mts.map +1 -0
- package/dist/node/components/IdenticonCorner.d.ts +7 -0
- package/dist/node/components/IdenticonCorner.d.ts.map +1 -0
- package/dist/node/components/IdenticonCorner.js +43 -0
- package/dist/node/components/IdenticonCorner.js.map +1 -0
- package/dist/node/components/IdenticonCorner.mjs +19 -0
- package/dist/node/components/IdenticonCorner.mjs.map +1 -0
- package/dist/node/components/Property.d.mts +4 -0
- package/dist/node/components/Property.d.mts.map +1 -0
- package/dist/node/components/Property.d.ts +4 -0
- package/dist/node/components/Property.d.ts.map +1 -0
- package/dist/node/components/Property.js +85 -0
- package/dist/node/components/Property.js.map +1 -0
- package/dist/node/components/Property.mjs +61 -0
- package/dist/node/components/Property.mjs.map +1 -0
- package/dist/node/components/PropertyBox.stories.js +197 -0
- package/dist/node/components/PropertyBox.stories.js.map +1 -0
- package/dist/node/components/PropertyBox.stories.mjs +160 -0
- package/dist/node/components/PropertyBox.stories.mjs.map +1 -0
- package/dist/node/components/PropertyPaper.stories.js +217 -0
- package/dist/node/components/PropertyPaper.stories.js.map +1 -0
- package/dist/node/components/PropertyPaper.stories.mjs +178 -0
- package/dist/node/components/PropertyPaper.stories.mjs.map +1 -0
- package/dist/node/components/Props.d.mts +35 -0
- package/dist/node/components/Props.d.mts.map +1 -0
- package/dist/node/components/Props.d.ts +35 -0
- package/dist/node/components/Props.d.ts.map +1 -0
- package/dist/node/components/Props.js +17 -0
- package/dist/node/components/Props.js.map +1 -0
- package/dist/node/components/Props.mjs +1 -0
- package/dist/node/components/Props.mjs.map +1 -0
- package/dist/node/components/Title.d.mts +13 -0
- package/dist/node/components/Title.d.mts.map +1 -0
- package/dist/node/components/Title.d.ts +13 -0
- package/dist/node/components/Title.d.ts.map +1 -0
- package/dist/node/components/Title.js +71 -0
- package/dist/node/components/Title.js.map +1 -0
- package/dist/node/components/Title.mjs +47 -0
- package/dist/node/components/Title.mjs.map +1 -0
- package/dist/node/components/Title.stories.js +53 -0
- package/dist/node/components/Title.stories.js.map +1 -0
- package/dist/node/components/Title.stories.mjs +27 -0
- package/dist/node/components/Title.stories.mjs.map +1 -0
- package/dist/node/components/Value.d.mts +9 -0
- package/dist/node/components/Value.d.mts.map +1 -0
- package/dist/node/components/Value.d.ts +9 -0
- package/dist/node/components/Value.d.ts.map +1 -0
- package/dist/node/components/Value.js +35 -0
- package/dist/node/components/Value.js.map +1 -0
- package/dist/node/components/Value.mjs +11 -0
- package/dist/node/components/Value.mjs.map +1 -0
- package/dist/node/components/Value.stories.js +51 -0
- package/dist/node/components/Value.stories.js.map +1 -0
- package/dist/node/components/Value.stories.mjs +26 -0
- package/dist/node/components/Value.stories.mjs.map +1 -0
- package/dist/node/components/index.d.mts +7 -0
- package/dist/node/components/index.d.mts.map +1 -0
- package/dist/node/components/index.d.ts +7 -0
- package/dist/node/components/index.d.ts.map +1 -0
- package/dist/node/components/index.js +33 -0
- package/dist/node/components/index.js.map +1 -0
- package/dist/node/components/index.mjs +7 -0
- package/dist/node/components/index.mjs.map +1 -0
- package/dist/node/index.d.mts +2 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +23 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +23 -23
- package/dist/components/Action.d.mts.map +0 -1
- package/dist/components/Action.d.ts.map +0 -1
- package/dist/components/Actions.d.mts.map +0 -1
- package/dist/components/Actions.d.ts.map +0 -1
- package/dist/components/ActionsMenu.d.mts.map +0 -1
- package/dist/components/ActionsMenu.d.ts.map +0 -1
- package/dist/components/ActionsProps.d.mts.map +0 -1
- package/dist/components/ActionsProps.d.ts.map +0 -1
- package/dist/components/Group.d.mts.map +0 -1
- package/dist/components/Group.d.ts.map +0 -1
- package/dist/components/IdenticonCorner.d.mts.map +0 -1
- package/dist/components/IdenticonCorner.d.ts.map +0 -1
- package/dist/components/Property.d.mts.map +0 -1
- package/dist/components/Property.d.ts.map +0 -1
- package/dist/components/PropertyBox.stories.d.mts +0 -19
- package/dist/components/PropertyBox.stories.d.mts.map +0 -1
- package/dist/components/PropertyBox.stories.d.ts +0 -19
- package/dist/components/PropertyBox.stories.d.ts.map +0 -1
- package/dist/components/PropertyPaper.stories.d.mts +0 -22
- package/dist/components/PropertyPaper.stories.d.mts.map +0 -1
- package/dist/components/PropertyPaper.stories.d.ts +0 -22
- package/dist/components/PropertyPaper.stories.d.ts.map +0 -1
- package/dist/components/Props.d.mts.map +0 -1
- package/dist/components/Props.d.ts.map +0 -1
- package/dist/components/Title.d.mts.map +0 -1
- package/dist/components/Title.d.ts.map +0 -1
- package/dist/components/Title.stories.d.mts +0 -7
- package/dist/components/Title.stories.d.mts.map +0 -1
- package/dist/components/Title.stories.d.ts +0 -7
- package/dist/components/Title.stories.d.ts.map +0 -1
- package/dist/components/Value.d.mts.map +0 -1
- package/dist/components/Value.d.ts.map +0 -1
- package/dist/components/Value.stories.d.mts +0 -7
- package/dist/components/Value.stories.d.mts.map +0 -1
- package/dist/components/Value.stories.d.ts +0 -7
- package/dist/components/Value.stories.d.ts.map +0 -1
- package/dist/components/index.d.mts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/index.js +0 -225
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -195
- package/dist/index.mjs.map +0 -1
- /package/dist/{components → browser/components}/Action.d.mts +0 -0
- /package/dist/{components → browser/components}/Action.d.ts +0 -0
- /package/dist/{components → browser/components}/Actions.d.mts +0 -0
- /package/dist/{components → browser/components}/Actions.d.ts +0 -0
- /package/dist/{components → browser/components}/ActionsMenu.d.mts +0 -0
- /package/dist/{components → browser/components}/ActionsMenu.d.ts +0 -0
- /package/dist/{components → browser/components}/ActionsProps.d.mts +0 -0
- /package/dist/{components → browser/components}/ActionsProps.d.ts +0 -0
- /package/dist/{components → browser/components}/Group.d.mts +0 -0
- /package/dist/{components → browser/components}/Group.d.ts +0 -0
- /package/dist/{components → browser/components}/IdenticonCorner.d.mts +0 -0
- /package/dist/{components → browser/components}/IdenticonCorner.d.ts +0 -0
- /package/dist/{components → browser/components}/Property.d.mts +0 -0
- /package/dist/{components → browser/components}/Property.d.ts +0 -0
- /package/dist/{components → browser/components}/Props.d.mts +0 -0
- /package/dist/{components → browser/components}/Props.d.ts +0 -0
- /package/dist/{components → browser/components}/Title.d.mts +0 -0
- /package/dist/{components → browser/components}/Title.d.ts +0 -0
- /package/dist/{components → browser/components}/Value.d.mts +0 -0
- /package/dist/{components → browser/components}/Value.d.ts +0 -0
- /package/dist/{components → browser/components}/index.d.mts +0 -0
- /package/dist/{components → browser/components}/index.d.ts +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","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 @@
|
|
|
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,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
4
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
5
|
+
const PropertyActions = ({ buttons = false, actions, ...props }) => {
|
|
6
|
+
if (actions) {
|
|
7
|
+
return (actions?.length ?? 0) > 0 ? /* @__PURE__ */ jsx(FlexRow, { gap: 1, ...props, children: actions.map((action, index) => {
|
|
8
|
+
return action.icon ? /* @__PURE__ */ jsx(IconButton, { size: "small", color: "inherit", onClick: action.onClick, children: action.icon }, index) : buttons ? /* @__PURE__ */ jsx(ButtonEx, { paddingY: 0, color: "primary", size: "small", disabled: action.disabled, onClick: action.onClick, variant: "contained", children: action.name }, index) : null;
|
|
9
|
+
}) }) : null;
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
PropertyActions
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Actions.js.map
|
|
@@ -0,0 +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":"AAYY;AAZZ,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAIjB,MAAM,kBAAkD,CAAC,EAAE,UAAU,OAAO,SAAS,GAAG,MAAM,MAAM;AACzG,MAAI,SAAS;AACX,YAAQ,SAAS,UAAU,KAAK,IAC9B,oBAAC,WAAQ,KAAK,GAAI,GAAG,OAClB,kBAAQ,IAAI,CAAC,QAAQ,UAAU;AAC9B,aAAO,OAAO,OACZ,oBAAC,cAAW,MAAK,SAAoB,OAAM,WAAU,SAAS,OAAO,SAClE,iBAAO,QADoB,KAE9B,IACE,UACF,oBAAC,YAAS,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":"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 @@
|
|
|
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,35 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHoriz as MoreHorizIcon } from "@mui/icons-material";
|
|
3
|
+
import { IconButton, Menu, MenuItem } from "@mui/material";
|
|
4
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
const PropertyActionsMenu = ({ actions, ...props }) => {
|
|
7
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
8
|
+
const open = !!anchorEl;
|
|
9
|
+
const handleClick = (event) => {
|
|
10
|
+
setAnchorEl(event.currentTarget);
|
|
11
|
+
};
|
|
12
|
+
const handleClose = () => {
|
|
13
|
+
setAnchorEl(null);
|
|
14
|
+
};
|
|
15
|
+
return actions && actions?.length > 0 ? /* @__PURE__ */ jsxs(FlexRow, { ...props, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(IconButton, { size: "small", color: "inherit", onClick: handleClick, children: /* @__PURE__ */ jsx(MoreHorizIcon, { fontSize: "inherit" }) }),
|
|
17
|
+
/* @__PURE__ */ jsx(Menu, { anchorEl, open, onClose: handleClose, children: actions?.map((action) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
MenuItem,
|
|
20
|
+
{
|
|
21
|
+
onClick: () => {
|
|
22
|
+
action?.onClick?.();
|
|
23
|
+
handleClose();
|
|
24
|
+
},
|
|
25
|
+
children: action.name
|
|
26
|
+
},
|
|
27
|
+
action.name
|
|
28
|
+
);
|
|
29
|
+
}) })
|
|
30
|
+
] }) : null;
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
PropertyActionsMenu
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ActionsMenu.js.map
|
|
@@ -0,0 +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":"AAmBI,SAEI,KAFJ;AAnBJ,SAAS,aAAa,qBAAqB;AAC3C,SAAS,YAAY,MAAM,gBAAgB;AAC3C,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAIlB,MAAM,sBAAsD,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AAC5F,QAAM,CAAC,UAAU,WAAW,IAAI,SAA6B,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,qBAAC,WAAS,GAAG,OACX;AAAA,wBAAC,cAAW,MAAK,SAAQ,OAAM,WAAU,SAAS,aAChD,8BAAC,iBAAc,UAAS,WAAU,GACpC;AAAA,IACA,oBAAC,QAAK,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":[]}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
//# sourceMappingURL=ActionsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -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 @@
|
|
|
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,25 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Paper, useTheme } from "@mui/material";
|
|
3
|
+
import { FlexCol, FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { typeOf } from "@xyo-network/typeof";
|
|
5
|
+
import { PropertyTitle } from "./Title";
|
|
6
|
+
const PropertyGroupBox = ({ titleProps, children, title, tip, ...props }) => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const childrenArray = typeOf(children) === "array" ? children : void 0;
|
|
9
|
+
return /* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", overflow: "hidden", ...props, children: /* @__PURE__ */ jsxs(FlexRow, { overflow: "hidden", justifyContent: "stretch", alignItems: "stretch", children: [
|
|
10
|
+
/* @__PURE__ */ jsx(PropertyTitle, { alignItems: "flex-start", size: "full", title, tip, ...titleProps }),
|
|
11
|
+
childrenArray ? /* @__PURE__ */ jsx(FlexGrowRow, { children: childrenArray?.map((child, index) => {
|
|
12
|
+
return child ? /* @__PURE__ */ jsx(FlexGrowRow, { borderLeft: 1, borderColor: theme.palette.divider, children: child }, index) : null;
|
|
13
|
+
}) }) : /* @__PURE__ */ jsx(FlexGrowRow, { overflow: "hidden", children })
|
|
14
|
+
] }) });
|
|
15
|
+
};
|
|
16
|
+
const PropertyGroupPaper = ({ style, variant, elevation, square, ...props }) => {
|
|
17
|
+
return /* @__PURE__ */ jsx(Paper, { style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ jsx(PropertyGroupBox, { ...props, paper: false }) });
|
|
18
|
+
};
|
|
19
|
+
const PropertyGroup = (props) => {
|
|
20
|
+
return props.paper ? /* @__PURE__ */ jsx(PropertyGroupPaper, { ...props }) : /* @__PURE__ */ jsx(PropertyGroupBox, { ...props });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
PropertyGroup
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Group.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"],"mappings":"AAaM,SACE,KADF;AAbN,SAAS,OAAO,gBAAgB;AAChC,SAAS,SAAS,aAAa,eAAe;AAC9C,SAAS,cAAc;AAIv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ACzC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoB1D,CAAA"}
|
|
@@ -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,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { Identicon } from "@xylabs/react-identicon";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
const IdenticonCorner = ({ value, ...props }) => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const [parentHeight, setParentHeight] = useState();
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setParentHeight(ref.current?.parentElement?.parentElement?.clientHeight);
|
|
12
|
+
}, []);
|
|
13
|
+
const calculatedHeight = parentHeight ?? 0;
|
|
14
|
+
return /* @__PURE__ */ jsx(FlexRow, { alignItems: "flex-start", height: "100%", children: /* @__PURE__ */ jsx(FlexRow, { background: true, height: calculatedHeight, width: calculatedHeight, borderLeft: `1px solid ${theme.palette.divider}`, children: /* @__PURE__ */ jsx("div", { ref, children: /* @__PURE__ */ jsx(Identicon, { size: calculatedHeight * 0.6, value: `${value}`, sx: { padding: `${calculatedHeight * 0.2}px` }, ...props }) }) }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
IdenticonCorner
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=IdenticonCorner.js.map
|
|
@@ -0,0 +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":"AAwBU;AAxBV,SAAS,gBAAgB;AACzB,SAAuB,eAAe;AACtC,SAAS,iBAAiB;AAC1B,SAAS,WAAW,QAAQ,gBAAgB;AAMrC,MAAM,kBAAkD,CAAC,EAAE,OAAO,GAAG,MAAM,MAAM;AACtF,QAAM,QAAQ,SAAS;AACvB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAiB;AACzD,QAAM,MAAM,OAAuB,IAAI;AAEvC,YAAU,MAAM;AACd,oBAAgB,IAAI,SAAS,eAAe,eAAe,YAAY;AAAA,EACzE,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB,gBAAgB;AAEzC,SACE,oBAAC,WAAQ,YAAW,cAAa,QAAO,QACtC,8BAAC,WAAQ,YAAU,MAAC,QAAQ,kBAAkB,OAAO,kBAAkB,YAAY,aAAa,MAAM,QAAQ,OAAO,IACnH,8BAAC,SAAI,KACH,8BAAC,aAAU,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 @@
|
|
|
1
|
+
{"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../src/components/Property.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAiB,MAAM,SAAS,CAAA;AA4D7E,eAAO,MAAM,QAAQ,iJAEnB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../src/components/Property.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAiB,MAAM,SAAS,CAAA;AA4D7E,eAAO,MAAM,QAAQ,iJAEnB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircularProgress, Paper } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { PropertyActionsMenu } from "./ActionsMenu";
|
|
6
|
+
import { IdenticonCorner } from "./IdenticonCorner";
|
|
7
|
+
import { PropertyTitle } from "./Title";
|
|
8
|
+
import { PropertyValue } from "./Value";
|
|
9
|
+
const PropertyBox = forwardRef(
|
|
10
|
+
({ titleProps, title, value, children, size = "medium", tip, actions, required, badge = false, ...props }, ref) => {
|
|
11
|
+
const sizeValueHeight = {
|
|
12
|
+
large: 48,
|
|
13
|
+
medium: 36,
|
|
14
|
+
small: 24
|
|
15
|
+
};
|
|
16
|
+
const sizeVariants = {
|
|
17
|
+
large: "h6",
|
|
18
|
+
medium: "body1",
|
|
19
|
+
small: "body2"
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsxs(FlexRow, { ref, flexDirection: "column", minWidth: 0, alignItems: "stretch", overflow: "hidden", ...props, children: [
|
|
22
|
+
title !== void 0 ? /* @__PURE__ */ jsx(
|
|
23
|
+
PropertyTitle,
|
|
24
|
+
{
|
|
25
|
+
tip,
|
|
26
|
+
title: required ? `${title}*` : title,
|
|
27
|
+
size,
|
|
28
|
+
more: /* @__PURE__ */ jsx(PropertyActionsMenu, { actions }),
|
|
29
|
+
...titleProps
|
|
30
|
+
}
|
|
31
|
+
) : null,
|
|
32
|
+
/* @__PURE__ */ jsxs(
|
|
33
|
+
FlexRow,
|
|
34
|
+
{
|
|
35
|
+
pl: 1,
|
|
36
|
+
columnGap: 1,
|
|
37
|
+
justifyContent: value === void 0 ? "center" : "space-between",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
height: sizeValueHeight[size],
|
|
40
|
+
children: [
|
|
41
|
+
children ? children : value !== void 0 ? /* @__PURE__ */ jsx(PropertyValue, { value, typographyVariant: sizeVariants[size] }) : /* @__PURE__ */ jsx(CircularProgress, { size: 16 }),
|
|
42
|
+
value !== void 0 ? badge ? /* @__PURE__ */ jsx(IdenticonCorner, { value }) : null : null
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
PropertyBox.displayName = "PropertyBox";
|
|
50
|
+
const PropertyPaper = forwardRef(({ style, variant, elevation = 2, square, ...props }, ref) => {
|
|
51
|
+
return /* @__PURE__ */ jsx(Paper, { ref, style: { minWidth: 0, overflow: "hidden", ...style }, variant, elevation, square, children: /* @__PURE__ */ jsx(PropertyBox, { ...props, paper: false }) });
|
|
52
|
+
});
|
|
53
|
+
PropertyPaper.displayName = "PropertyPaper";
|
|
54
|
+
const Property = forwardRef((props, ref) => {
|
|
55
|
+
return props.paper ? /* @__PURE__ */ jsx(PropertyPaper, { ref, ...props }) : /* @__PURE__ */ jsx(PropertyBox, { ref, ...props });
|
|
56
|
+
});
|
|
57
|
+
Property.displayName = "Property";
|
|
58
|
+
export {
|
|
59
|
+
Property
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=Property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Property.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"],"mappings":"AAgCkB,cAIV,YAJU;AAhClB,SAAS,kBAAkB,aAAgC;AAC3D,SAAS,eAAe;AAExB,SAAS,kBAAkB;AAE3B,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAEhC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAE9B,MAAM,cAAc;AAAA,EAClB,CAAC,EAAE,YAAY,OAAO,OAAO,UAAU,OAAO,UAAU,KAAK,SAAS,UAAU,QAAQ,OAAO,GAAG,MAAM,GAAG,QAAQ;AACjH,UAAM,kBAA4C;AAAA,MAChD,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAEA,UAAM,eAAoD;AAAA,MACxD,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAEA,WACE,qBAAC,WAAQ,KAAU,eAAc,UAAS,UAAU,GAAG,YAAW,WAAU,UAAS,UAAU,GAAG,OAC/F;AAAA,gBAAU,SACT;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,OAAO,WAAW,GAAG,KAAK,MAAM;AAAA,UAChC;AAAA,UACA,MAAM,oBAAC,uBAAoB,SAAkB;AAAA,UAC5C,GAAG;AAAA;AAAA,MACN,IACE;AAAA,MACJ;AAAA,QAAC;AAAA;AAAA,UACC,IAAI;AAAA,UACJ,WAAW;AAAA,UACX,gBAAgB,UAAU,SAAY,WAAW;AAAA,UACjD,UAAS;AAAA,UACT,QAAQ,gBAAgB,IAAI;AAAA,UAE3B;AAAA,uBACC,WACE,UAAU,SACZ,oBAAC,iBAAc,OAAc,mBAAmB,aAAa,IAAI,GAAG,IAEpE,oBAAC,oBAAiB,MAAM,IAAI;AAAA,YAE7B,UAAU,SAAY,QAAQ,oBAAC,mBAAgB,OAAc,IAAK,OAAO;AAAA;AAAA;AAAA,MAC5E;AAAA,OACF;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;AAE1B,MAAM,gBAAgB,WAA+C,CAAC,EAAE,OAAO,SAAS,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACjI,SACE,oBAAC,SAAM,KAAU,OAAO,EAAE,UAAU,GAAG,UAAU,UAAU,GAAG,MAAM,GAAG,SAAkB,WAAsB,QAC7G,8BAAC,eAAa,GAAG,OAAO,OAAO,OAAO,GACxC;AAEJ,CAAC;AACD,cAAc,cAAc;AAErB,MAAM,WAAW,WAA0C,CAAC,OAAO,QAAQ;AAChF,SAAO,MAAM,QAAQ,oBAAC,iBAAc,KAAW,GAAG,OAAO,IAAK,oBAAC,eAAY,KAAW,GAAG,OAAO;AAClG,CAAC;AACD,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Replay as ReplayIcon } from "@mui/icons-material";
|
|
3
|
+
import { TextField } from "@mui/material";
|
|
4
|
+
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
5
|
+
import { PayloadWrapper } from "@xyo-network/payload-wrapper";
|
|
6
|
+
import { sampleBlockWithPayloads, useAppThemeDecorator } from "@xyo-network/react-storybook";
|
|
7
|
+
import { Property } from "./Property";
|
|
8
|
+
const StorybookEntry = {
|
|
9
|
+
argTypes: {},
|
|
10
|
+
component: Property,
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
page: null
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
title: "property/PropertyBox"
|
|
17
|
+
};
|
|
18
|
+
const Template = (args) => /* @__PURE__ */ jsx(Property, { ...args, paper: false });
|
|
19
|
+
const TemplateWithCompare = (args) => /* @__PURE__ */ jsxs(FlexCol, { gap: 1, alignItems: "stretch", children: [
|
|
20
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
21
|
+
/* @__PURE__ */ jsx(TextField, { size: "small", value: "Sample text Field" }),
|
|
22
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "small" })
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "small" }),
|
|
26
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "small" })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(TextField, { size: "medium", value: "Sample text Field" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "medium" })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "medium" }),
|
|
34
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "medium" })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
37
|
+
/* @__PURE__ */ jsx(TextField, { value: "Sample text Field" }),
|
|
38
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "large" })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "large" }),
|
|
42
|
+
/* @__PURE__ */ jsx(Property, { ...args, size: "large" })
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
const Default = Template.bind({});
|
|
46
|
+
Default.args = {};
|
|
47
|
+
Default.decorators = [useAppThemeDecorator];
|
|
48
|
+
const WithTitle = Template.bind({});
|
|
49
|
+
WithTitle.args = { title: "No Data" };
|
|
50
|
+
WithTitle.decorators = [useAppThemeDecorator];
|
|
51
|
+
const WithUndefinedData = Template.bind({});
|
|
52
|
+
WithUndefinedData.args = { title: "Block Hash" };
|
|
53
|
+
WithUndefinedData.decorators = [useAppThemeDecorator];
|
|
54
|
+
const WithData = Template.bind({});
|
|
55
|
+
WithData.args = { title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
56
|
+
WithData.decorators = [useAppThemeDecorator];
|
|
57
|
+
const WithDataSmall = Template.bind({});
|
|
58
|
+
WithDataSmall.args = { size: "small", title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
59
|
+
WithDataSmall.decorators = [useAppThemeDecorator];
|
|
60
|
+
const WithDataCompare = TemplateWithCompare.bind({});
|
|
61
|
+
WithDataCompare.args = { tip: "This is the block hash", title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
62
|
+
WithDataCompare.decorators = [useAppThemeDecorator];
|
|
63
|
+
const WithDataAndBadgeSmall = Template.bind({});
|
|
64
|
+
WithDataAndBadgeSmall.args = {
|
|
65
|
+
badge: true,
|
|
66
|
+
size: "small",
|
|
67
|
+
tip: "This is the block hash",
|
|
68
|
+
title: "Block Hash",
|
|
69
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
70
|
+
};
|
|
71
|
+
WithDataAndBadgeSmall.decorators = [useAppThemeDecorator];
|
|
72
|
+
const WithDataAndBadgeMedium = Template.bind({});
|
|
73
|
+
WithDataAndBadgeMedium.args = {
|
|
74
|
+
badge: true,
|
|
75
|
+
size: "medium",
|
|
76
|
+
tip: "This is the block hash",
|
|
77
|
+
title: "Block Hash",
|
|
78
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
79
|
+
};
|
|
80
|
+
WithDataAndBadgeMedium.decorators = [useAppThemeDecorator];
|
|
81
|
+
const WithDataAndBadgeLarge = Template.bind({});
|
|
82
|
+
WithDataAndBadgeLarge.args = {
|
|
83
|
+
badge: true,
|
|
84
|
+
size: "large",
|
|
85
|
+
tip: "This is the block hash",
|
|
86
|
+
title: "Block Hash",
|
|
87
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
88
|
+
};
|
|
89
|
+
WithDataAndBadgeLarge.decorators = [useAppThemeDecorator];
|
|
90
|
+
const WithTip = Template.bind({});
|
|
91
|
+
WithTip.args = {
|
|
92
|
+
tip: "This is the block hash",
|
|
93
|
+
title: "Block Hash",
|
|
94
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
95
|
+
};
|
|
96
|
+
WithTip.decorators = [useAppThemeDecorator];
|
|
97
|
+
const WithTipAndBadge = Template.bind({});
|
|
98
|
+
WithTipAndBadge.args = {
|
|
99
|
+
badge: true,
|
|
100
|
+
tip: "This is the block hash",
|
|
101
|
+
title: "Block Hash",
|
|
102
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
103
|
+
};
|
|
104
|
+
WithTipAndBadge.decorators = [useAppThemeDecorator];
|
|
105
|
+
const WithActions = Template.bind({});
|
|
106
|
+
WithActions.args = {
|
|
107
|
+
actions: [{ name: "ActionOne" }, { name: "ActionTwo" }],
|
|
108
|
+
tip: "This is the block hash",
|
|
109
|
+
title: "Block Hash",
|
|
110
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
111
|
+
};
|
|
112
|
+
WithActions.decorators = [useAppThemeDecorator];
|
|
113
|
+
const LargeWithValue = Template.bind({});
|
|
114
|
+
LargeWithValue.args = {
|
|
115
|
+
badge: true,
|
|
116
|
+
size: "large",
|
|
117
|
+
tip: "This is the block hash",
|
|
118
|
+
title: "Block Hash",
|
|
119
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
120
|
+
};
|
|
121
|
+
LargeWithValue.decorators = [useAppThemeDecorator];
|
|
122
|
+
const LargeWithValueAndActions = Template.bind({});
|
|
123
|
+
LargeWithValueAndActions.args = {
|
|
124
|
+
actions: [{ icon: /* @__PURE__ */ jsx(ReplayIcon, {}), name: "ActionOne" }, { name: "ActionTwo" }],
|
|
125
|
+
badge: true,
|
|
126
|
+
size: "large",
|
|
127
|
+
tip: "This is the block hash",
|
|
128
|
+
title: "Block Hash",
|
|
129
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
130
|
+
};
|
|
131
|
+
LargeWithValueAndActions.decorators = [useAppThemeDecorator];
|
|
132
|
+
const SmallWithValueAndActions = Template.bind({});
|
|
133
|
+
SmallWithValueAndActions.args = {
|
|
134
|
+
actions: [{ icon: /* @__PURE__ */ jsx(ReplayIcon, {}), name: "ActionOne" }, { name: "ActionTwo" }],
|
|
135
|
+
badge: true,
|
|
136
|
+
size: "small",
|
|
137
|
+
tip: "This is the block hash",
|
|
138
|
+
title: "Block Hash",
|
|
139
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
140
|
+
};
|
|
141
|
+
SmallWithValueAndActions.decorators = [useAppThemeDecorator];
|
|
142
|
+
var PropertyBox_stories_default = StorybookEntry;
|
|
143
|
+
export {
|
|
144
|
+
Default,
|
|
145
|
+
LargeWithValue,
|
|
146
|
+
LargeWithValueAndActions,
|
|
147
|
+
SmallWithValueAndActions,
|
|
148
|
+
WithActions,
|
|
149
|
+
WithData,
|
|
150
|
+
WithDataAndBadgeLarge,
|
|
151
|
+
WithDataAndBadgeMedium,
|
|
152
|
+
WithDataAndBadgeSmall,
|
|
153
|
+
WithDataCompare,
|
|
154
|
+
WithDataSmall,
|
|
155
|
+
WithTip,
|
|
156
|
+
WithTipAndBadge,
|
|
157
|
+
WithUndefinedData,
|
|
158
|
+
PropertyBox_stories_default as default
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=PropertyBox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PropertyBox.stories.tsx"],"sourcesContent":["import { Replay as ReplayIcon } from '@mui/icons-material'\nimport { TextField } from '@mui/material'\nimport { Meta, StoryFn } from '@storybook/react'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { PayloadWrapper } from '@xyo-network/payload-wrapper'\nimport { sampleBlockWithPayloads, useAppThemeDecorator } from '@xyo-network/react-storybook'\n\nimport { Property } from './Property'\nimport { PropertyProps } from './Props'\n\nconst StorybookEntry = {\n argTypes: {},\n component: Property,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'property/PropertyBox',\n} as Meta<typeof Property>\n\nconst Template: StoryFn<typeof Property> = (args: PropertyProps) => <Property {...args} paper={false}></Property>\n\nconst TemplateWithCompare: StoryFn<typeof Property> = (args: PropertyProps) => (\n <FlexCol gap={1} alignItems=\"stretch\">\n <FlexRow gap={1}>\n <TextField size=\"small\" value=\"Sample text Field\" />\n <Property {...args} size=\"small\"></Property>\n </FlexRow>\n <FlexRow gap={1}>\n <Property {...args} size=\"small\"></Property>\n <Property {...args} size=\"small\"></Property>\n </FlexRow>\n <FlexRow gap={1}>\n <TextField size=\"medium\" value=\"Sample text Field\" />\n <Property {...args} size=\"medium\"></Property>\n </FlexRow>\n <FlexRow gap={1}>\n <Property {...args} size=\"medium\"></Property>\n <Property {...args} size=\"medium\"></Property>\n </FlexRow>\n <FlexRow gap={1}>\n <TextField value=\"Sample text Field\" />\n <Property {...args} size=\"large\"></Property>\n </FlexRow>\n <FlexRow gap={1}>\n <Property {...args} size=\"large\"></Property>\n <Property {...args} size=\"large\"></Property>\n </FlexRow>\n </FlexCol>\n)\n\nconst Default = Template.bind({})\nDefault.args = {}\nDefault.decorators = [useAppThemeDecorator]\n\nconst WithTitle = Template.bind({})\nWithTitle.args = { title: 'No Data' }\nWithTitle.decorators = [useAppThemeDecorator]\n\nconst WithUndefinedData = Template.bind({})\nWithUndefinedData.args = { title: 'Block Hash' }\nWithUndefinedData.decorators = [useAppThemeDecorator]\n\nconst WithData = Template.bind({})\nWithData.args = { title: 'Block Hash', value: PayloadWrapper.hashSync(sampleBlockWithPayloads) }\nWithData.decorators = [useAppThemeDecorator]\n\nconst WithDataSmall = Template.bind({})\nWithDataSmall.args = { size: 'small', title: 'Block Hash', value: PayloadWrapper.hashSync(sampleBlockWithPayloads) }\nWithDataSmall.decorators = [useAppThemeDecorator]\n\nconst WithDataCompare = TemplateWithCompare.bind({})\nWithDataCompare.args = { tip: 'This is the block hash', title: 'Block Hash', value: PayloadWrapper.hashSync(sampleBlockWithPayloads) }\nWithDataCompare.decorators = [useAppThemeDecorator]\n\nconst WithDataAndBadgeSmall = Template.bind({})\nWithDataAndBadgeSmall.args = {\n badge: true,\n size: 'small',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithDataAndBadgeSmall.decorators = [useAppThemeDecorator]\n\nconst WithDataAndBadgeMedium = Template.bind({})\nWithDataAndBadgeMedium.args = {\n badge: true,\n size: 'medium',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithDataAndBadgeMedium.decorators = [useAppThemeDecorator]\n\nconst WithDataAndBadgeLarge = Template.bind({})\nWithDataAndBadgeLarge.args = {\n badge: true,\n size: 'large',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithDataAndBadgeLarge.decorators = [useAppThemeDecorator]\n\nconst WithTip = Template.bind({})\nWithTip.args = {\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithTip.decorators = [useAppThemeDecorator]\n\nconst WithTipAndBadge = Template.bind({})\nWithTipAndBadge.args = {\n badge: true,\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithTipAndBadge.decorators = [useAppThemeDecorator]\n\nconst WithActions = Template.bind({})\nWithActions.args = {\n actions: [{ name: 'ActionOne' }, { name: 'ActionTwo' }],\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nWithActions.decorators = [useAppThemeDecorator]\n\nconst LargeWithValue = Template.bind({})\nLargeWithValue.args = {\n badge: true,\n size: 'large',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nLargeWithValue.decorators = [useAppThemeDecorator]\n\nconst LargeWithValueAndActions = Template.bind({})\nLargeWithValueAndActions.args = {\n actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],\n badge: true,\n size: 'large',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nLargeWithValueAndActions.decorators = [useAppThemeDecorator]\n\nconst SmallWithValueAndActions = Template.bind({})\nSmallWithValueAndActions.args = {\n actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],\n badge: true,\n size: 'small',\n tip: 'This is the block hash',\n title: 'Block Hash',\n value: PayloadWrapper.hashSync(sampleBlockWithPayloads),\n}\nSmallWithValueAndActions.decorators = [useAppThemeDecorator]\n\nexport {\n Default,\n LargeWithValue,\n LargeWithValueAndActions,\n SmallWithValueAndActions,\n WithActions,\n WithData,\n WithDataAndBadgeLarge,\n WithDataAndBadgeMedium,\n WithDataAndBadgeSmall,\n WithDataCompare,\n WithDataSmall,\n WithTip,\n WithTipAndBadge,\n WithUndefinedData,\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AAqBoE,cAIhE,YAJgE;AArBpE,SAAS,UAAU,kBAAkB;AACrC,SAAS,iBAAiB;AAE1B,SAAS,SAAS,eAAe;AACjC,SAAS,sBAAsB;AAC/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ACL,OAAO;AAAA,EACP,OAAO,eAAe,SAAS,uBAAuB;AACxD;AACA,yBAAyB,aAAa,CAAC,oBAAoB;AAE3D,MAAM,2BAA2B,SAAS,KAAK,CAAC,CAAC;AACjD,yBAAyB,OAAO;AAAA,EAC9B,SAAS,CAAC,EAAE,MAAM,oBAAC,cAAW,GAAI,MAAM,YAAY,GAAG,EAAE,MAAM,YAAY,CAAC;AAAA,EAC5E,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO,eAAe,SAAS,uBAAuB;AACxD;AACA,yBAAyB,aAAa,CAAC,oBAAoB;AAoB3D,IAAO,8BAAQ;","names":[]}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Replay as ReplayIcon } from "@mui/icons-material";
|
|
3
|
+
import { TextField } from "@mui/material";
|
|
4
|
+
import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
5
|
+
import { PayloadWrapper } from "@xyo-network/payload-wrapper";
|
|
6
|
+
import { sampleBlockWithPayloads, useAppThemeDecorator } from "@xyo-network/react-storybook";
|
|
7
|
+
import { Property } from "./Property";
|
|
8
|
+
const StorybookEntry = {
|
|
9
|
+
argTypes: {},
|
|
10
|
+
component: Property,
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
page: null
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
title: "property/PropertyPaper"
|
|
17
|
+
};
|
|
18
|
+
const Template = (args) => /* @__PURE__ */ jsx(Property, { ...args, paper: true });
|
|
19
|
+
const TemplateWithCompare = (args) => /* @__PURE__ */ jsxs(FlexCol, { gap: 1, alignItems: "stretch", children: [
|
|
20
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
21
|
+
/* @__PURE__ */ jsx(TextField, { size: "small", value: "Sample text Field" }),
|
|
22
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "small" })
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "small" }),
|
|
26
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "small" })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
29
|
+
/* @__PURE__ */ jsx(TextField, { size: "medium", value: "Sample text Field" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "medium" })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "medium" }),
|
|
34
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "medium" })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
37
|
+
/* @__PURE__ */ jsx(TextField, { value: "Sample text Field" }),
|
|
38
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "large" })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs(FlexRow, { gap: 1, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "large" }),
|
|
42
|
+
/* @__PURE__ */ jsx(Property, { ...args, paper: true, size: "large" })
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
const Default = Template.bind({});
|
|
46
|
+
Default.args = {};
|
|
47
|
+
Default.decorators = [useAppThemeDecorator];
|
|
48
|
+
const WithTitle = Template.bind({});
|
|
49
|
+
WithTitle.args = { title: "No Data" };
|
|
50
|
+
WithTitle.decorators = [useAppThemeDecorator];
|
|
51
|
+
const WithUndefinedData = Template.bind({});
|
|
52
|
+
WithUndefinedData.args = { title: "Block Hash" };
|
|
53
|
+
WithUndefinedData.decorators = [useAppThemeDecorator];
|
|
54
|
+
const WithData = Template.bind({});
|
|
55
|
+
WithData.args = { title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
56
|
+
WithData.decorators = [useAppThemeDecorator];
|
|
57
|
+
const WithDataSmall = Template.bind({});
|
|
58
|
+
WithDataSmall.args = { size: "small", title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
59
|
+
WithDataSmall.decorators = [useAppThemeDecorator];
|
|
60
|
+
const WithDataCompare = TemplateWithCompare.bind({});
|
|
61
|
+
WithDataCompare.args = { tip: "This is the block hash", title: "Block Hash", value: PayloadWrapper.hashSync(sampleBlockWithPayloads) };
|
|
62
|
+
WithDataCompare.decorators = [useAppThemeDecorator];
|
|
63
|
+
const WithDataCompareOutlined = TemplateWithCompare.bind({});
|
|
64
|
+
WithDataCompareOutlined.args = {
|
|
65
|
+
tip: "This is the block hash",
|
|
66
|
+
title: "Block Hash",
|
|
67
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads),
|
|
68
|
+
variant: "outlined"
|
|
69
|
+
};
|
|
70
|
+
WithDataCompareOutlined.decorators = [useAppThemeDecorator];
|
|
71
|
+
const WithDataCompareElevation = TemplateWithCompare.bind({});
|
|
72
|
+
WithDataCompareElevation.args = {
|
|
73
|
+
tip: "This is the block hash",
|
|
74
|
+
title: "Block Hash",
|
|
75
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads),
|
|
76
|
+
variant: "elevation"
|
|
77
|
+
};
|
|
78
|
+
WithDataCompareElevation.decorators = [useAppThemeDecorator];
|
|
79
|
+
const WithDataAndBadgeSmall = Template.bind({});
|
|
80
|
+
WithDataAndBadgeSmall.args = {
|
|
81
|
+
badge: true,
|
|
82
|
+
size: "small",
|
|
83
|
+
tip: "This is the block hash",
|
|
84
|
+
title: "Block Hash",
|
|
85
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
86
|
+
};
|
|
87
|
+
WithDataAndBadgeSmall.decorators = [useAppThemeDecorator];
|
|
88
|
+
const WithDataAndBadgeMedium = Template.bind({});
|
|
89
|
+
WithDataAndBadgeMedium.args = {
|
|
90
|
+
badge: true,
|
|
91
|
+
size: "medium",
|
|
92
|
+
tip: "This is the block hash",
|
|
93
|
+
title: "Block Hash",
|
|
94
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
95
|
+
};
|
|
96
|
+
WithDataAndBadgeMedium.decorators = [useAppThemeDecorator];
|
|
97
|
+
const WithDataAndBadgeLarge = Template.bind({});
|
|
98
|
+
WithDataAndBadgeLarge.args = {
|
|
99
|
+
badge: true,
|
|
100
|
+
size: "large",
|
|
101
|
+
tip: "This is the block hash",
|
|
102
|
+
title: "Block Hash",
|
|
103
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
104
|
+
};
|
|
105
|
+
WithDataAndBadgeLarge.decorators = [useAppThemeDecorator];
|
|
106
|
+
const WithTip = Template.bind({});
|
|
107
|
+
WithTip.args = {
|
|
108
|
+
tip: "This is the block hash",
|
|
109
|
+
title: "Block Hash",
|
|
110
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
111
|
+
};
|
|
112
|
+
WithTip.decorators = [useAppThemeDecorator];
|
|
113
|
+
const WithTipAndBadge = Template.bind({});
|
|
114
|
+
WithTipAndBadge.args = {
|
|
115
|
+
badge: true,
|
|
116
|
+
tip: "This is the block hash",
|
|
117
|
+
title: "Block Hash",
|
|
118
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
119
|
+
};
|
|
120
|
+
WithTipAndBadge.decorators = [useAppThemeDecorator];
|
|
121
|
+
const WithActions = Template.bind({});
|
|
122
|
+
WithActions.args = {
|
|
123
|
+
actions: [{ name: "ActionOne" }, { name: "ActionTwo" }],
|
|
124
|
+
tip: "This is the block hash",
|
|
125
|
+
title: "Block Hash",
|
|
126
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
127
|
+
};
|
|
128
|
+
WithActions.decorators = [useAppThemeDecorator];
|
|
129
|
+
const LargeWithValue = Template.bind({});
|
|
130
|
+
LargeWithValue.args = {
|
|
131
|
+
badge: true,
|
|
132
|
+
size: "large",
|
|
133
|
+
tip: "This is the block hash",
|
|
134
|
+
title: "Block Hash",
|
|
135
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
136
|
+
};
|
|
137
|
+
LargeWithValue.decorators = [useAppThemeDecorator];
|
|
138
|
+
const LargeWithValueAndActions = Template.bind({});
|
|
139
|
+
LargeWithValueAndActions.args = {
|
|
140
|
+
actions: [{ icon: /* @__PURE__ */ jsx(ReplayIcon, {}), name: "ActionOne" }, { name: "ActionTwo" }],
|
|
141
|
+
badge: true,
|
|
142
|
+
size: "large",
|
|
143
|
+
tip: "This is the block hash",
|
|
144
|
+
title: "Block Hash",
|
|
145
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
146
|
+
};
|
|
147
|
+
LargeWithValueAndActions.decorators = [useAppThemeDecorator];
|
|
148
|
+
const SmallWithValueAndActions = Template.bind({});
|
|
149
|
+
SmallWithValueAndActions.args = {
|
|
150
|
+
actions: [{ icon: /* @__PURE__ */ jsx(ReplayIcon, {}), name: "ActionOne" }, { name: "ActionTwo" }],
|
|
151
|
+
badge: true,
|
|
152
|
+
size: "small",
|
|
153
|
+
tip: "This is the block hash",
|
|
154
|
+
title: "Block Hash",
|
|
155
|
+
value: PayloadWrapper.hashSync(sampleBlockWithPayloads)
|
|
156
|
+
};
|
|
157
|
+
SmallWithValueAndActions.decorators = [useAppThemeDecorator];
|
|
158
|
+
var PropertyPaper_stories_default = StorybookEntry;
|
|
159
|
+
export {
|
|
160
|
+
Default,
|
|
161
|
+
LargeWithValue,
|
|
162
|
+
LargeWithValueAndActions,
|
|
163
|
+
SmallWithValueAndActions,
|
|
164
|
+
WithActions,
|
|
165
|
+
WithData,
|
|
166
|
+
WithDataAndBadgeLarge,
|
|
167
|
+
WithDataAndBadgeMedium,
|
|
168
|
+
WithDataAndBadgeSmall,
|
|
169
|
+
WithDataCompare,
|
|
170
|
+
WithDataCompareElevation,
|
|
171
|
+
WithDataCompareOutlined,
|
|
172
|
+
WithDataSmall,
|
|
173
|
+
WithTip,
|
|
174
|
+
WithTipAndBadge,
|
|
175
|
+
WithUndefinedData,
|
|
176
|
+
PropertyPaper_stories_default as default
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=PropertyPaper.stories.js.map
|