@xylabs/sdk-react 2.7.6 → 2.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/components/AppBarEx/AppBarEx.stories.d.ts +2 -2
  2. package/dist/components/AppBarEx/AppBarEx.stories.d.ts.map +1 -1
  3. package/dist/components/AppBarEx/AppBarEx.stories.js +5 -5
  4. package/dist/components/AppBarEx/AppBarEx.stories.js.map +1 -1
  5. package/dist/components/BasePage/BasePage.stories.d.ts +1 -1
  6. package/dist/components/BasePage/BasePage.stories.d.ts.map +1 -1
  7. package/dist/components/BasePage/BasePage.stories.js +3 -2
  8. package/dist/components/BasePage/BasePage.stories.js.map +1 -1
  9. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js +1 -1
  10. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js.map +1 -1
  11. package/dist/components/ButtonEx/ButtonEx.stories.js +1 -1
  12. package/dist/components/ButtonEx/ButtonEx.stories.js.map +1 -1
  13. package/dist/components/CookieConsent/CookieConsent.stories.js +1 -1
  14. package/dist/components/CookieConsent/CookieConsent.stories.js.map +1 -1
  15. package/dist/components/Errors/ErrorViewer.stories.js +1 -1
  16. package/dist/components/Errors/ErrorViewer.stories.js.map +1 -1
  17. package/dist/components/Errors/ErrorsViewer.stories.js +1 -1
  18. package/dist/components/Errors/ErrorsViewer.stories.js.map +1 -1
  19. package/dist/components/EthAccount/EthAccount.d.ts.map +1 -1
  20. package/dist/components/EthAccount/EthAccount.js +30 -10
  21. package/dist/components/EthAccount/EthAccount.js.map +1 -1
  22. package/dist/components/EthAccount/EthAccount.stories.d.ts +7 -2
  23. package/dist/components/EthAccount/EthAccount.stories.d.ts.map +1 -1
  24. package/dist/components/EthAccount/EthAccount.stories.js +44 -6
  25. package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
  26. package/dist/components/EthAccount/EthAccountProps.d.ts +5 -7
  27. package/dist/components/EthAccount/EthAccountProps.d.ts.map +1 -1
  28. package/dist/components/FlexBox/BusyBox.stories.js +1 -1
  29. package/dist/components/FlexBox/BusyBox.stories.js.map +1 -1
  30. package/dist/components/FlexBox/FlexCol.stories.js +1 -1
  31. package/dist/components/FlexBox/FlexCol.stories.js.map +1 -1
  32. package/dist/components/FlexBox/FlexRow.stories.js +1 -1
  33. package/dist/components/FlexBox/FlexRow.stories.js.map +1 -1
  34. package/dist/components/Identicon.d.ts +3 -2
  35. package/dist/components/Identicon.d.ts.map +1 -1
  36. package/dist/components/Identicon.js +21 -10
  37. package/dist/components/Identicon.js.map +1 -1
  38. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js +1 -1
  39. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js.map +1 -1
  40. package/dist/components/NumberStatus/NumberStatus.stories.js +1 -1
  41. package/dist/components/NumberStatus/NumberStatus.stories.js.map +1 -1
  42. package/dist/components/QuickTipButton/QuickTipButton.stories.js +1 -1
  43. package/dist/components/QuickTipButton/QuickTipButton.stories.js.map +1 -1
  44. package/dist/components/TokenAmount/TokenAmount.stories.js +1 -1
  45. package/dist/components/TokenAmount/TokenAmount.stories.js.map +1 -1
  46. package/dist/components/dialogs/ErrorDialog.d.ts +4 -4
  47. package/dist/components/dialogs/ErrorDialog.d.ts.map +1 -1
  48. package/dist/components/dialogs/ErrorDialog.js +21 -11
  49. package/dist/components/dialogs/ErrorDialog.js.map +1 -1
  50. package/dist/components/dialogs/ErrorDialog.stories.d.ts +7 -0
  51. package/dist/components/dialogs/ErrorDialog.stories.d.ts.map +1 -0
  52. package/dist/components/dialogs/ErrorDialog.stories.js +22 -0
  53. package/dist/components/dialogs/ErrorDialog.stories.js.map +1 -0
  54. package/dist/components/dialogs/MessageDialog.d.ts +2 -3
  55. package/dist/components/dialogs/MessageDialog.d.ts.map +1 -1
  56. package/dist/components/dialogs/MessageDialog.js +1 -2
  57. package/dist/components/dialogs/MessageDialog.js.map +1 -1
  58. package/dist/components/dialogs/MessageDialog.stories.d.ts +7 -0
  59. package/dist/components/dialogs/MessageDialog.stories.d.ts.map +1 -0
  60. package/dist/components/dialogs/MessageDialog.stories.js +22 -0
  61. package/dist/components/dialogs/MessageDialog.stories.js.map +1 -0
  62. package/package.json +13 -15
  63. package/src/components/AppBarEx/AppBarEx.stories.tsx +5 -5
  64. package/src/components/BasePage/BasePage.stories.tsx +3 -2
  65. package/src/components/Breadcrumbs/BreadcrumbsEx.stories.tsx +1 -1
  66. package/src/components/ButtonEx/ButtonEx.stories.tsx +1 -1
  67. package/src/components/CookieConsent/CookieConsent.stories.tsx +1 -1
  68. package/src/components/Errors/ErrorViewer.stories.tsx +1 -1
  69. package/src/components/Errors/ErrorsViewer.stories.tsx +1 -1
  70. package/src/components/EthAccount/EthAccount.stories.tsx +53 -6
  71. package/src/components/EthAccount/EthAccount.tsx +71 -7
  72. package/src/components/EthAccount/EthAccountProps.tsx +6 -7
  73. package/src/components/FlexBox/BusyBox.stories.tsx +1 -1
  74. package/src/components/FlexBox/FlexCol.stories.tsx +1 -1
  75. package/src/components/FlexBox/FlexRow.stories.tsx +1 -1
  76. package/src/components/Identicon.tsx +26 -13
  77. package/src/components/InvertableThemeProvider/InvertableThemeProvider.stories.tsx +1 -1
  78. package/src/components/NumberStatus/NumberStatus.stories.tsx +1 -1
  79. package/src/components/QuickTipButton/QuickTipButton.stories.tsx +1 -1
  80. package/src/components/TokenAmount/TokenAmount.stories.tsx +1 -1
  81. package/src/components/dialogs/ErrorDialog.stories.tsx +27 -0
  82. package/src/components/dialogs/ErrorDialog.tsx +14 -14
  83. package/src/components/dialogs/MessageDialog.stories.tsx +27 -0
  84. package/src/components/dialogs/MessageDialog.tsx +2 -4
  85. package/dist/components/EthAccount/EthAccountBase.d.ts +0 -5
  86. package/dist/components/EthAccount/EthAccountBase.d.ts.map +0 -1
  87. package/dist/components/EthAccount/EthAccountBase.js +0 -42
  88. package/dist/components/EthAccount/EthAccountBase.js.map +0 -1
  89. package/dist/components/EthAccount/EthAccountTo.d.ts +0 -5
  90. package/dist/components/EthAccount/EthAccountTo.d.ts.map +0 -1
  91. package/dist/components/EthAccount/EthAccountTo.js +0 -30
  92. package/dist/components/EthAccount/EthAccountTo.js.map +0 -1
  93. package/src/components/EthAccount/EthAccountBase.tsx +0 -60
  94. package/src/components/EthAccount/EthAccountTo.tsx +0 -30
@@ -1 +1 @@
1
- {"version":3,"file":"QuickTipButton.stories.js","sourceRoot":"","sources":["../../../src/components/QuickTipButton/QuickTipButton.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,gBAAgB;CACgB,CAAA;AAEzC,MAAM,QAAQ,GAA0C,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,cAAc,oBAAK,IAAI,UAAmB,CAAA;AAE7G,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,KAAC,UAAU,mGAAsF;IAC3G,KAAK,EAAE,kBAAkB;CAC1B,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"QuickTipButton.stories.js","sourceRoot":"","sources":["../../../src/components/QuickTipButton/QuickTipButton.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,2BAA2B;CACK,CAAA;AAEzC,MAAM,QAAQ,GAA0C,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,cAAc,oBAAK,IAAI,UAAmB,CAAA;AAE7G,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,KAAC,UAAU,mGAAsF;IAC3G,KAAK,EAAE,kBAAkB;CAC1B,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
@@ -9,7 +9,7 @@ const StorybookEntry = {
9
9
  page: null,
10
10
  },
11
11
  },
12
- title: 'TokenAmount',
12
+ title: 'Components/TokenAmount',
13
13
  };
14
14
  const Template = (args) => _jsx(TokenAmount, Object.assign({}, args), void 0);
15
15
  const Default = Template.bind({});
@@ -1 +1 @@
1
- {"version":3,"file":"TokenAmount.stories.js","sourceRoot":"","sources":["../../../src/components/TokenAmount/TokenAmount.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,aAAa;CACgB,CAAA;AAEtC,MAAM,QAAQ,GAAuC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,WAAW,oBAAK,IAAI,UAAgB,CAAA;AAEpG,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM,E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,oBAAK,IAAI,UAAgB,CAAA;AAEpG,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM,EAAE,IAAI,SAAS,CAAC,yBAAyB,EAAE,EAAE,CAAC;CACrD,CAAA;AAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAClC,QAAQ,CAAC,IAAI,GAAG;IACd,MAAM,EAAE,IAAI,SAAS,CAAC,yBAAyB,EAAE,EAAE,CAAC;IACpD,IAAI,EAAE,IAAI;CACX,CAAA;AAED,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACnC,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,EAAE,IAAI,SAAS,CAAC,yBAAyB,EAAE,EAAE,CAAC;IACpD,KAAK,EAAE,SAAS;CACjB,CAAA;AAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC1C,gBAAgB,CAAC,IAAI,GAAG;IACtB,MAAM,EAAE,IAAI,SAAS,CAAC,yBAAyB,EAAE,EAAE,CAAC;IACpD,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,IAAI;CACX,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA;AAEzD,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
@@ -1,9 +1,9 @@
1
+ import { DialogProps } from '@mui/material';
1
2
  import React from 'react';
2
- interface Props {
3
+ export interface ErrorDialogProps extends DialogProps {
3
4
  error?: Error;
4
- onClose?: (retry: boolean) => void;
5
+ onAction?: (retry: boolean) => void;
5
6
  title?: string;
6
7
  }
7
- declare const ErrorDialog: React.FC<Props>;
8
- export { ErrorDialog };
8
+ export declare const ErrorDialog: React.FC<ErrorDialogProps>;
9
9
  //# sourceMappingURL=ErrorDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA4CD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAOhC,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"ErrorDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,WAAW,EAA2B,MAAM,eAAe,CAAA;AAE1G,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA+CD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAMlD,CAAA"}
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { Dialog, DialogActions, DialogContent, DialogTitle, Typography } from '@mui/material';
3
14
  import { ButtonEx } from '../ButtonEx';
@@ -5,27 +16,26 @@ import { FlexRow } from '../FlexBox';
5
16
  const toAxiosError = (error) => {
6
17
  return error.isAxiosError ? error : undefined;
7
18
  };
8
- const ErrorDialogOpen = (props) => {
9
- var _a, _b;
10
- const { onClose, title = 'Oops. Something went wrong.', error = Error('Unknown Error') } = props;
19
+ const ErrorDialogOpen = (_a) => {
20
+ var _b, _c;
21
+ var { onAction, title = 'Oops. Something went wrong.', error = Error('Unknown Error') } = _a, props = __rest(_a, ["onAction", "title", "error"]);
11
22
  const onCloseClicked = () => {
12
- onClose === null || onClose === void 0 ? void 0 : onClose(false);
23
+ onAction === null || onAction === void 0 ? void 0 : onAction(false);
13
24
  };
14
25
  const onRetryClicked = () => {
15
- onClose === null || onClose === void 0 ? void 0 : onClose(true);
26
+ onAction === null || onAction === void 0 ? void 0 : onAction(true);
16
27
  };
17
28
  const axiosError = toAxiosError(error);
18
- const message = (_a = error.message) !== null && _a !== void 0 ? _a : error.toString();
19
- return (_jsxs(Dialog, Object.assign({ onClose: onClose, open: !!error }, { children: [_jsx(DialogTitle, { children: title }, void 0), _jsx(DialogContent, { children: _jsx(FlexRow, { children: _jsx(Typography, Object.assign({ color: "error" }, { children: axiosError ? `${message} [${(_b = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _b !== void 0 ? _b : 'Connection Failure'}]` : `${message}` }), void 0) }, void 0) }, void 0), _jsx(DialogActions, { children: _jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [_jsx(ButtonEx, Object.assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), _jsx(ButtonEx, Object.assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
29
+ const message = (_b = error.message) !== null && _b !== void 0 ? _b : error.toString();
30
+ return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsx(DialogTitle, { children: title }, void 0), _jsx(DialogContent, { children: _jsx(FlexRow, { children: _jsx(Typography, Object.assign({ color: "error" }, { children: axiosError ? `${message} [${(_c = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _c !== void 0 ? _c : 'Connection Failure'}]` : `${message}` }), void 0) }, void 0) }, void 0), _jsx(DialogActions, { children: _jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [_jsx(ButtonEx, Object.assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), _jsx(ButtonEx, Object.assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
20
31
  };
21
- const ErrorDialog = (props) => {
22
- const { error } = props;
32
+ export const ErrorDialog = (_a) => {
33
+ var { open, error } = _a, props = __rest(_a, ["open", "error"]);
23
34
  if (error) {
24
- return _jsx(ErrorDialogOpen, Object.assign({}, props), void 0);
35
+ return _jsx(ErrorDialogOpen, Object.assign({ open: !!error || open, error: error }, props), void 0);
25
36
  }
26
37
  else {
27
38
  return null;
28
39
  }
29
40
  };
30
- export { ErrorDialog };
31
41
  //# sourceMappingURL=ErrorDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI7F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAQpC,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,EAAE;IACpC,OAAQ,KAAoB,CAAC,YAAY,CAAC,CAAC,CAAE,KAAoB,CAAC,CAAC,CAAC,SAAS,CAAA;AAC/E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C,OAAO,mCAAI,KAAK,CAAC,QAAQ,EAAE,CAAA;IAEjD,OAAO,CACL,MAAC,MAAM,oBAAK,KAAK,eACf,KAAC,WAAW,cAAE,KAAK,WAAe,EAClC,KAAC,aAAa,cACZ,KAAC,OAAO,cACN,KAAC,UAAU,kBAAC,KAAK,EAAC,OAAO,gBACtB,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,mCAAI,oBAAoB,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,YAC5E,WACL,WACI,EAChB,KAAC,aAAa,cACZ,MAAC,OAAO,kBAAC,cAAc,EAAC,eAAe,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAC,OAAO,iBACnE,KAAC,QAAQ,kBAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAC,MAAM,mCAEtC,EACX,KAAC,QAAQ,kBAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAC,MAAM,mCAEtC,aACH,WACI,aACT,CACV,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAyB,EAAE,EAAE;QAA7B,EAAE,IAAI,EAAE,KAAK,OAAY,EAAP,KAAK,cAAvB,iBAAyB,CAAF;IAC7E,IAAI,KAAK,EAAE;QACT,OAAO,KAAC,eAAe,kBAAC,IAAI,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,UAAI,CAAA;KAC3E;SAAM;QACL,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ declare const StorybookEntry: ComponentMeta<import("react").FC<import("./ErrorDialog").ErrorDialogProps>>;
4
+ declare const Default: ComponentStory<import("react").FC<import("./ErrorDialog").ErrorDialogProps>>;
5
+ export { Default };
6
+ export default StorybookEntry;
7
+ //# sourceMappingURL=ErrorDialog.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorDialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,6EASkB,CAAA;AAItC,QAAA,MAAM,OAAO,8EAAoB,CAAA;AAMjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAGlB,eAAe,cAAc,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ErrorDialog } from './ErrorDialog';
3
+ const StorybookEntry = {
4
+ argTypes: {},
5
+ component: ErrorDialog,
6
+ parameters: {
7
+ docs: {
8
+ page: null,
9
+ },
10
+ },
11
+ title: 'Dialogs/ErrorDialog',
12
+ };
13
+ const Template = (args) => _jsx(ErrorDialog, Object.assign({}, args), void 0);
14
+ const Default = Template.bind({});
15
+ Default.args = {
16
+ error: Error('Test Error'),
17
+ title: 'Test Error',
18
+ };
19
+ export { Default };
20
+ // eslint-disable-next-line import/no-default-export
21
+ export default StorybookEntry;
22
+ //# sourceMappingURL=ErrorDialog.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorDialog.stories.js","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,qBAAqB;CACQ,CAAA;AAEtC,MAAM,QAAQ,GAAuC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,WAAW,oBAAK,IAAI,UAAgB,CAAA;AAEpG,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,KAAK,EAAE,YAAY;CACpB,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { DialogProps } from '@mui/material';
3
- interface Props extends DialogProps {
3
+ export interface MessageDialogProps extends DialogProps {
4
4
  onOk?: () => void;
5
5
  onCancel?: () => void;
6
6
  }
7
- declare const MessageDialog: React.FC<Props>;
8
- export { MessageDialog };
7
+ export declare const MessageDialog: React.FC<MessageDialogProps>;
9
8
  //# sourceMappingURL=MessageDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/MessageDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgD,WAAW,EAAe,MAAM,eAAe,CAAA;AAItG,UAAU,KAAM,SAAQ,WAAW;IACjC,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmBlC,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"MessageDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/MessageDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgD,WAAW,EAAe,MAAM,eAAe,CAAA;AAItG,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmBtD,CAAA"}
@@ -12,9 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';
14
14
  import { FlexCol, FlexRow } from '../FlexBox';
15
- const MessageDialog = (_a) => {
15
+ export const MessageDialog = (_a) => {
16
16
  var { onOk, onCancel, children, title } = _a, props = __rest(_a, ["onOk", "onCancel", "children", "title"]);
17
17
  return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsx(DialogTitle, { children: title }, void 0), _jsx(DialogContent, { children: _jsx(FlexCol, Object.assign({ alignItems: "stretch" }, { children: children }), void 0) }, void 0), _jsx(DialogActions, { children: _jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%" }, { children: [_jsx(Button, Object.assign({ onClick: onCancel, variant: "text" }, { children: "Cancel" }), void 0), _jsx(Button, Object.assign({ onClick: onOk, variant: "text" }, { children: "Ok" }), void 0)] }), void 0) }, void 0)] }), void 0));
18
18
  };
19
- export { MessageDialog };
20
19
  //# sourceMappingURL=MessageDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/MessageDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAe,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAO7C,MAAM,aAAa,GAAoB,CAAC,EAA6C,EAAE,EAAE;QAAjD,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,OAAY,EAAP,KAAK,cAA3C,yCAA6C,CAAF;IACjF,OAAO,CACL,MAAC,MAAM,oBAAK,KAAK,eACf,KAAC,WAAW,cAAE,KAAK,WAAe,E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I,aACT,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ declare const StorybookEntry: ComponentMeta<import("react").FC<import("./MessageDialog").MessageDialogProps>>;
4
+ declare const Default: ComponentStory<import("react").FC<import("./MessageDialog").MessageDialogProps>>;
5
+ export { Default };
6
+ export default StorybookEntry;
7
+ //# sourceMappingURL=MessageDialog.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageDialog.stories.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/MessageDialog.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,iFASoB,CAAA;AAIxC,QAAA,MAAM,OAAO,kFAAoB,CAAA;AAMjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAGlB,eAAe,cAAc,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { MessageDialog } from './MessageDialog';
3
+ const StorybookEntry = {
4
+ argTypes: {},
5
+ component: MessageDialog,
6
+ parameters: {
7
+ docs: {
8
+ page: null,
9
+ },
10
+ },
11
+ title: 'Dialogs/MessageDialog',
12
+ };
13
+ const Template = (args) => _jsx(MessageDialog, Object.assign({}, args, { children: "Test Message" }), void 0);
14
+ const Default = Template.bind({});
15
+ Default.args = {
16
+ open: true,
17
+ title: 'Test Error',
18
+ };
19
+ export { Default };
20
+ // eslint-disable-next-line import/no-default-export
21
+ export default StorybookEntry;
22
+ //# sourceMappingURL=MessageDialog.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageDialog.stories.js","sourceRoot":"","sources":["../../../src/components/dialogs/MessageDialog.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,aAAa;IACxB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,uBAAuB;CACQ,CAAA;AAExC,MAAM,QAAQ,GAAyC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,aAAa,oBAAK,IAAI,wCAA8B,CAAA;AAEtH,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,YAAY;CACpB,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
package/package.json CHANGED
@@ -26,18 +26,16 @@
26
26
  "@emotion/styled": "^11.6.0",
27
27
  "@ethersproject/abstract-signer": "^5.5.0",
28
28
  "@ethersproject/providers": "^5.5.1",
29
- "@mui/icons-material": "^5.2.0",
30
- "@mui/material": "^5.2.2",
31
- "@mui/styles": "^5.2.2",
32
- "@storybook/addon-actions": "^6.4.7",
33
- "@storybook/addon-docs": "^6.4.7",
34
- "@storybook/addon-essentials": "^6.4.7",
35
- "@storybook/addon-links": "^6.4.7",
36
- "@storybook/addons": "^6.4.7",
37
- "@storybook/components": "^6.4.7",
38
- "@storybook/core-events": "^6.4.7",
39
- "@storybook/react": "^6.4.7",
40
- "@storybook/theming": "^6.4.7",
29
+ "@mui/icons-material": "^5.2.1",
30
+ "@mui/material": "^5.2.3",
31
+ "@mui/styles": "^5.2.3",
32
+ "@storybook/addon-actions": "^6.4.8",
33
+ "@storybook/addon-docs": "^6.4.8",
34
+ "@storybook/addon-essentials": "^6.4.8",
35
+ "@storybook/addon-links": "^6.4.8",
36
+ "@storybook/components": "^6.4.8",
37
+ "@storybook/core-events": "^6.4.8",
38
+ "@storybook/react": "^6.4.8",
41
39
  "@types/bn.js": "^5.1.0",
42
40
  "@types/lodash": "^4.14.177",
43
41
  "@types/md5": "^2.3.1",
@@ -45,7 +43,7 @@
45
43
  "@types/react": "^17",
46
44
  "@xylabs/eslint-config-react": "^2",
47
45
  "@xylabs/pixel": "^1.1.6",
48
- "@xylabs/sdk-js": "^2.3.12",
46
+ "@xylabs/sdk-js": "^2.3.13",
49
47
  "@xylabs/ts-scripts": "^1.0.23",
50
48
  "babel-loader": "^8.2.3",
51
49
  "bn.js": "^5.2.0",
@@ -54,7 +52,7 @@
54
52
  "eslint-plugin-prettier": "^4.0.0",
55
53
  "eslint-plugin-react": "^7.27.1",
56
54
  "eslint-plugin-react-hooks": "^4.3.0",
57
- "prettier": "^2.5.0",
55
+ "prettier": "^2.5.1",
58
56
  "react": "^17.0.2",
59
57
  "react-dom": "^17.0.2",
60
58
  "react-router-dom": "^6",
@@ -110,5 +108,5 @@
110
108
  "sideEffects": false,
111
109
  "type": "module",
112
110
  "types": "dist/index.d.ts",
113
- "version": "2.7.6"
111
+ "version": "2.7.10"
114
112
  }
@@ -10,17 +10,17 @@ const StorybookEntry = {
10
10
  page: null,
11
11
  },
12
12
  },
13
- title: 'AppBarEx',
13
+ title: 'Components/AppBarEx',
14
14
  } as ComponentMeta<typeof AppBarEx>
15
15
 
16
16
  const Template: ComponentStory<typeof AppBarEx> = (args) => <AppBarEx {...args}></AppBarEx>
17
17
 
18
- const Default = Template.bind({})
19
- Default.args = {
20
- title: 'Default',
18
+ const Empty = Template.bind({})
19
+ Empty.args = {
20
+ title: 'Empty',
21
21
  }
22
22
 
23
- export { Default, StorybookEntry }
23
+ export { Empty }
24
24
 
25
25
  // eslint-disable-next-line import/no-default-export
26
26
  export default StorybookEntry
@@ -10,7 +10,7 @@ const StorybookEntry = {
10
10
  page: null,
11
11
  },
12
12
  },
13
- title: 'BasePage',
13
+ title: 'Components/BasePage',
14
14
  } as ComponentMeta<typeof BasePage>
15
15
 
16
16
  const Template: ComponentStory<typeof BasePage> = (args) => <BasePage {...args}></BasePage>
@@ -22,4 +22,5 @@ Default.args = {
22
22
 
23
23
  export { Default }
24
24
 
25
- export { StorybookEntry }
25
+ // eslint-disable-next-line import/no-default-export
26
+ export default StorybookEntry
@@ -11,7 +11,7 @@ const StorybookEntry = {
11
11
  page: null,
12
12
  },
13
13
  },
14
- title: 'BreadcrumbsEx',
14
+ title: 'Components/BreadcrumbsEx',
15
15
  } as ComponentMeta<typeof BreadcrumbsEx>
16
16
 
17
17
  const Template: ComponentStory<typeof BreadcrumbsEx> = (args) => (
@@ -11,7 +11,7 @@ const StorybookEntry = {
11
11
  page: null,
12
12
  },
13
13
  },
14
- title: 'ButtonEx',
14
+ title: 'Components/ButtonEx',
15
15
  } as ComponentMeta<typeof ButtonEx>
16
16
 
17
17
  const DefaultTemplate: ComponentStory<typeof ButtonEx> = (args) => (
@@ -13,7 +13,7 @@ const StorybookEntry = {
13
13
  page: null,
14
14
  },
15
15
  },
16
- title: 'CookieConsent',
16
+ title: 'Components/CookieConsent',
17
17
  } as ComponentMeta<typeof CookieConsent>
18
18
 
19
19
  const TemplateWithContext: ComponentStory<typeof CookieConsent> = (args) => {
@@ -10,7 +10,7 @@ const StorybookEntry = {
10
10
  page: null,
11
11
  },
12
12
  },
13
- title: 'ErrorViewer',
13
+ title: 'Components/ErrorViewer',
14
14
  } as ComponentMeta<typeof ErrorViewer>
15
15
 
16
16
  const Template: ComponentStory<typeof ErrorViewer> = (args) => <ErrorViewer {...args}></ErrorViewer>
@@ -10,7 +10,7 @@ const StorybookEntry = {
10
10
  page: null,
11
11
  },
12
12
  },
13
- title: 'ErrorsViewer',
13
+ title: 'Components/ErrorsViewer',
14
14
  } as ComponentMeta<typeof ErrorsViewer>
15
15
 
16
16
  const Template: ComponentStory<typeof ErrorsViewer> = (args) => <ErrorsViewer {...args}></ErrorsViewer>
@@ -1,6 +1,7 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react'
2
2
  import { EthAddress } from '@xylabs/sdk-js'
3
3
 
4
+ import { FlexRow } from '../FlexBox'
4
5
  import { EthAccount } from './EthAccount'
5
6
 
6
7
  const StorybookEntry = {
@@ -11,21 +12,67 @@ const StorybookEntry = {
11
12
  page: null,
12
13
  },
13
14
  },
14
- title: 'EthAccount',
15
+ title: 'Components/EthAccount',
15
16
  } as ComponentMeta<typeof EthAccount>
16
17
 
17
- const Template: ComponentStory<typeof EthAccount> = (args) => <EthAccount {...args}></EthAccount>
18
+ const Template: ComponentStory<typeof EthAccount> = (args) => (
19
+ <FlexRow>
20
+ <EthAccount variant="outlined" {...args}></EthAccount>
21
+ </FlexRow>
22
+ )
18
23
 
19
- const Default = Template.bind({})
20
- Default.args = {
24
+ const Long = Template.bind({})
25
+ Long.args = {
21
26
  address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
22
- auto: true,
27
+ addressLength: 'long',
23
28
  icon: true,
24
29
  title: 'Sample EthAccount',
25
30
  toEtherScan: true,
26
31
  }
27
32
 
28
- export { Default }
33
+ const LongEmpty = Template.bind({})
34
+ LongEmpty.args = {
35
+ addressLength: 'long',
36
+ icon: true,
37
+ title: 'Sample EthAccount',
38
+ toEtherScan: true,
39
+ }
40
+
41
+ const Short = Template.bind({})
42
+ Short.args = {
43
+ address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
44
+ addressLength: 'short',
45
+ icon: true,
46
+ title: 'Sample EthAccount',
47
+ toEtherScan: true,
48
+ }
49
+
50
+ const ShortEmpty = Template.bind({})
51
+ ShortEmpty.args = {
52
+ addressLength: 'short',
53
+ icon: true,
54
+ title: 'Sample EthAccount',
55
+ toEtherScan: true,
56
+ }
57
+
58
+ const Auto = Template.bind({})
59
+ Auto.args = {
60
+ address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
61
+ addressLength: 'auto',
62
+ icon: true,
63
+ title: 'Sample EthAccount',
64
+ toEtherScan: true,
65
+ }
66
+
67
+ const AutoEmpty = Template.bind({})
68
+ AutoEmpty.args = {
69
+ addressLength: 'auto',
70
+ icon: true,
71
+ title: 'Sample EthAccount',
72
+ toEtherScan: true,
73
+ }
74
+
75
+ export { Auto, AutoEmpty, Long, LongEmpty, Short, ShortEmpty }
29
76
 
30
77
  // eslint-disable-next-line import/no-default-export
31
78
  export default StorybookEntry
@@ -1,13 +1,77 @@
1
- import { EthAccountBase } from './EthAccountBase'
1
+ import { Typography, useTheme } from '@mui/material'
2
+ import { assertEx, EthAddress } from '@xylabs/sdk-js'
3
+ import { MouseEvent, useContext } from 'react'
4
+
5
+ import { EthersContext } from '../../contexts'
6
+ import { useMediaQuery } from '../../hooks'
7
+ import { ButtonEx } from '../ButtonEx'
8
+ import { FlexGrowRow, FlexRow } from '../FlexBox'
9
+ import { Identicon } from '../Identicon'
2
10
  import { EthAccountProps } from './EthAccountProps'
3
- import { EthAccountTo } from './EthAccountTo'
4
11
 
5
- const EthAccount: React.FC<EthAccountProps> = ({ to, toOptions, ...props }) => {
6
- if (to || toOptions) {
7
- return <EthAccountTo to={to} toOptions={toOptions} {...props} />
8
- } else {
9
- return <EthAccountBase {...props} />
12
+ const EthAccount: React.FC<EthAccountProps> = ({
13
+ address,
14
+ icon = false,
15
+ iconSize = 16,
16
+ iconOnly = false,
17
+ addressLength = 'auto',
18
+ fontFamily = '"Source Code Pro",monospace',
19
+ toEtherScan,
20
+ onButtonClick,
21
+ ...props
22
+ }) => {
23
+ const { localAddress } = useContext(EthersContext)
24
+ const theme = useTheme()
25
+
26
+ const large = useMediaQuery(theme.breakpoints.up('md'))
27
+
28
+ const isLocalAddress = address ? localAddress?.toString() === address.toString() : false
29
+
30
+ const onClickLocal = (event: MouseEvent<HTMLButtonElement>) => {
31
+ onButtonClick?.(event)
32
+ if (toEtherScan && address) {
33
+ window.open(`https://etherscan.io/address/${address.toString()}`, '_blank')
34
+ }
10
35
  }
36
+
37
+ const addressToDisplay = assertEx(address ?? EthAddress.fromString('0x00'), 'Bad Eth Address')
38
+
39
+ const testToDisplay =
40
+ addressLength === 'long'
41
+ ? addressToDisplay.toString()
42
+ : addressLength === 'short'
43
+ ? addressToDisplay.toShortString()
44
+ : large
45
+ ? addressToDisplay.toString()
46
+ : addressToDisplay.toShortString()
47
+
48
+ // Note: We use the all zero address for spacing in case it is
49
+
50
+ return (
51
+ <ButtonEx onClick={onClickLocal} title={`0x${address?.toHex()}`} {...props}>
52
+ <FlexGrowRow justifyContent="space-between" alignItems="center">
53
+ {icon && address ? <Identicon size={iconSize} value={address?.toHex()} /> : null}
54
+ {iconOnly ? null : (
55
+ <FlexRow>
56
+ <Typography
57
+ marginLeft={icon ? 1 : 0}
58
+ variant="body1"
59
+ fontFamily={fontFamily}
60
+ visibility={address ? 'inherit' : 'hidden'}
61
+ >
62
+ {testToDisplay}
63
+ </Typography>
64
+ {address ? null : (
65
+ <Typography position="absolute" marginLeft={icon ? 1 : 0} variant="body1" fontFamily={fontFamily}>
66
+ -- --
67
+ </Typography>
68
+ )}
69
+ </FlexRow>
70
+ )}
71
+ {isLocalAddress ? <FlexRow marginLeft={0.5}>(You)</FlexRow> : null}
72
+ </FlexGrowRow>
73
+ </ButtonEx>
74
+ )
11
75
  }
12
76
 
13
77
  export { EthAccount }
@@ -1,20 +1,19 @@
1
- import { BoxProps } from '@mui/material'
2
1
  import { EthAddress } from '@xylabs/sdk-js'
3
2
  import { MouseEventHandler } from 'react'
4
- import { NavigateOptions, To } from 'react-router-dom'
5
3
 
6
- interface EthAccountProps extends BoxProps {
4
+ import { ButtonExProps } from '../ButtonEx'
5
+
6
+ interface EthAccountProps extends ButtonExProps {
7
7
  address?: EthAddress | null
8
- auto?: boolean
8
+ addressLength?: 'auto' | 'short' | 'long'
9
9
  full?: boolean
10
10
  icon?: boolean
11
+ iconSize?: number
11
12
  iconOnly?: boolean
12
- size?: number
13
13
  text?: boolean
14
- to?: To
15
- toOptions?: NavigateOptions
16
14
  page?: string
17
15
  toEtherScan?: boolean
16
+ fontFamily?: string
18
17
  onButtonClick?: MouseEventHandler<HTMLButtonElement>
19
18
  }
20
19
 
@@ -10,7 +10,7 @@ const StorybookEntry = {
10
10
  page: null,
11
11
  },
12
12
  },
13
- title: 'BusyBox',
13
+ title: 'Components/BusyBox',
14
14
  } as ComponentMeta<typeof BusyBox>
15
15
 
16
16
  const BusyBoxTemplate: ComponentStory<typeof BusyBox> = (args) => <BusyBox {...args}></BusyBox>
@@ -11,7 +11,7 @@ const StorybookEntry = {
11
11
  page: null,
12
12
  },
13
13
  },
14
- title: 'FlexCol',
14
+ title: 'Components/FlexCol',
15
15
  } as ComponentMeta<typeof FlexCol>
16
16
 
17
17
  const Template: ComponentStory<typeof FlexCol> = (args) => <FlexCol {...args}></FlexCol>
@@ -11,7 +11,7 @@ const StorybookEntry = {
11
11
  page: null,
12
12
  },
13
13
  },
14
- title: 'FlexRow',
14
+ title: 'Components/FlexRow',
15
15
  } as ComponentMeta<typeof FlexRow>
16
16
 
17
17
  const Template: ComponentStory<typeof FlexRow> = (args) => <FlexRow {...args}></FlexRow>