@xylabs/sdk-react 2.7.4 → 2.7.8
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/README.md +29 -9
- package/dist/components/AppBarEx/AppBarEx.stories.d.ts +2 -2
- package/dist/components/AppBarEx/AppBarEx.stories.d.ts.map +1 -1
- package/dist/components/AppBarEx/AppBarEx.stories.js +5 -5
- package/dist/components/AppBarEx/AppBarEx.stories.js.map +1 -1
- package/dist/components/Background.d.ts.map +1 -1
- package/dist/components/Background.js +0 -1
- package/dist/components/Background.js.map +1 -1
- package/dist/components/BasePage/BasePage.stories.d.ts +1 -1
- package/dist/components/BasePage/BasePage.stories.d.ts.map +1 -1
- package/dist/components/BasePage/BasePage.stories.js +3 -2
- package/dist/components/BasePage/BasePage.stories.js.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js.map +1 -1
- package/dist/components/ButtonEx/ButtonEx.stories.js +1 -1
- package/dist/components/ButtonEx/ButtonEx.stories.js.map +1 -1
- package/dist/components/CookieConsent/CookieConsent.stories.js +1 -1
- package/dist/components/CookieConsent/CookieConsent.stories.js.map +1 -1
- package/dist/components/Errors/ErrorViewer.stories.js +1 -1
- package/dist/components/Errors/ErrorViewer.stories.js.map +1 -1
- package/dist/components/Errors/ErrorsViewer.stories.js +1 -1
- package/dist/components/Errors/ErrorsViewer.stories.js.map +1 -1
- package/dist/components/EthAccount/EthAccount.d.ts.map +1 -1
- package/dist/components/EthAccount/EthAccount.js +29 -7
- package/dist/components/EthAccount/EthAccount.js.map +1 -1
- package/dist/components/EthAccount/EthAccount.stories.d.ts +4 -2
- package/dist/components/EthAccount/EthAccount.stories.d.ts.map +1 -1
- package/dist/components/EthAccount/EthAccount.stories.js +23 -6
- package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
- package/dist/components/EthAccount/EthAccountProps.d.ts +5 -7
- package/dist/components/EthAccount/EthAccountProps.d.ts.map +1 -1
- package/dist/components/FlexBox/BusyBox.stories.js +1 -1
- package/dist/components/FlexBox/BusyBox.stories.js.map +1 -1
- package/dist/components/FlexBox/FlexCol.stories.js +1 -1
- package/dist/components/FlexBox/FlexCol.stories.js.map +1 -1
- package/dist/components/FlexBox/FlexRow.stories.js +1 -1
- package/dist/components/FlexBox/FlexRow.stories.js.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.d.ts.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js +8 -9
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js.map +1 -1
- package/dist/components/NumberStatus/NumberStatus.stories.js +1 -1
- package/dist/components/NumberStatus/NumberStatus.stories.js.map +1 -1
- package/dist/components/QuickTipButton/QuickTipButton.stories.js +1 -1
- package/dist/components/QuickTipButton/QuickTipButton.stories.js.map +1 -1
- package/dist/components/ScrollToTop.d.ts +2 -0
- package/dist/components/ScrollToTop.d.ts.map +1 -0
- package/dist/components/ScrollToTop.js +11 -0
- package/dist/components/ScrollToTop.js.map +1 -0
- package/dist/components/TokenAmount/TokenAmount.stories.js +1 -1
- package/dist/components/TokenAmount/TokenAmount.stories.js.map +1 -1
- package/dist/components/dialogs/ErrorDialog.d.ts +4 -4
- package/dist/components/dialogs/ErrorDialog.d.ts.map +1 -1
- package/dist/components/dialogs/ErrorDialog.js +21 -11
- package/dist/components/dialogs/ErrorDialog.js.map +1 -1
- package/dist/components/dialogs/ErrorDialog.stories.d.ts +7 -0
- package/dist/components/dialogs/ErrorDialog.stories.d.ts.map +1 -0
- package/dist/components/dialogs/ErrorDialog.stories.js +22 -0
- package/dist/components/dialogs/ErrorDialog.stories.js.map +1 -0
- package/dist/components/dialogs/MessageDialog.d.ts +2 -3
- package/dist/components/dialogs/MessageDialog.d.ts.map +1 -1
- package/dist/components/dialogs/MessageDialog.js +1 -2
- package/dist/components/dialogs/MessageDialog.js.map +1 -1
- package/dist/components/dialogs/MessageDialog.stories.d.ts +7 -0
- package/dist/components/dialogs/MessageDialog.stories.d.ts.map +1 -0
- package/dist/components/dialogs/MessageDialog.stories.js +22 -0
- package/dist/components/dialogs/MessageDialog.stories.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useBreakpoint.d.ts.map +1 -1
- package/dist/hooks/useBreakpoint.js +2 -1
- package/dist/hooks/useBreakpoint.js.map +1 -1
- package/dist/hooks/useMediaQuery.d.ts +3 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/useMediaQuery.js +5 -0
- package/dist/hooks/useMediaQuery.js.map +1 -0
- package/dist/lib/getApiStage.d.ts +1 -1
- package/dist/lib/getApiStage.d.ts.map +1 -1
- package/package.json +72 -74
- package/src/components/AppBarEx/AppBarEx.stories.tsx +5 -5
- package/src/components/Background.tsx +0 -1
- package/src/components/BasePage/BasePage.stories.tsx +3 -2
- package/src/components/Breadcrumbs/BreadcrumbsEx.stories.tsx +1 -1
- package/src/components/ButtonEx/ButtonEx.stories.tsx +1 -1
- package/src/components/CookieConsent/CookieConsent.stories.tsx +1 -1
- package/src/components/Errors/ErrorViewer.stories.tsx +1 -1
- package/src/components/Errors/ErrorsViewer.stories.tsx +1 -1
- package/src/components/EthAccount/EthAccount.stories.tsx +29 -6
- package/src/components/EthAccount/EthAccount.tsx +57 -6
- package/src/components/EthAccount/EthAccountProps.tsx +6 -7
- package/src/components/FlexBox/BusyBox.stories.tsx +1 -1
- package/src/components/FlexBox/FlexCol.stories.tsx +1 -1
- package/src/components/FlexBox/FlexRow.stories.tsx +1 -1
- package/src/components/InvertableThemeProvider/InvertableThemeProvider.stories.tsx +1 -1
- package/src/components/InvertableThemeProvider/InvertableThemeProvider.tsx +15 -9
- package/src/components/NumberStatus/NumberStatus.stories.tsx +1 -1
- package/src/components/QuickTipButton/QuickTipButton.stories.tsx +1 -1
- package/src/components/ScrollToTop.tsx +13 -0
- package/src/components/TokenAmount/TokenAmount.stories.tsx +1 -1
- package/src/components/dialogs/ErrorDialog.stories.tsx +27 -0
- package/src/components/dialogs/ErrorDialog.tsx +14 -14
- package/src/components/dialogs/MessageDialog.stories.tsx +27 -0
- package/src/components/dialogs/MessageDialog.tsx +2 -4
- package/src/components/index.ts +1 -1
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useBreakpoint.ts +3 -1
- package/src/hooks/useMediaQuery.ts +6 -0
- package/dist/components/EthAccount/EthAccountBase.d.ts +0 -5
- package/dist/components/EthAccount/EthAccountBase.d.ts.map +0 -1
- package/dist/components/EthAccount/EthAccountBase.js +0 -41
- package/dist/components/EthAccount/EthAccountBase.js.map +0 -1
- package/dist/components/EthAccount/EthAccountTo.d.ts +0 -5
- package/dist/components/EthAccount/EthAccountTo.d.ts.map +0 -1
- package/dist/components/EthAccount/EthAccountTo.js +0 -30
- package/dist/components/EthAccount/EthAccountTo.js.map +0 -1
- package/src/components/EthAccount/EthAccountBase.tsx +0 -59
- package/src/components/EthAccount/EthAccountTo.tsx +0 -30
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[![main-build][]][main-build-link]
|
|
6
6
|
[![beta-build][]][beta-build-link]
|
|
7
|
-
[![npm-badge]][npm-link]
|
|
8
|
-
[![bch-badge]][bch-link]
|
|
9
|
-
[![codacy-badge]][codacy-link]
|
|
10
|
-
[![codeclimate-badge]][codeclimate-link]
|
|
11
|
-
[![snyk-badge]][snyk-link]
|
|
7
|
+
[![npm-badge][]][npm-link]
|
|
8
|
+
[![bch-badge][]][bch-link]
|
|
9
|
+
[![codacy-badge][]][codacy-link]
|
|
10
|
+
[![codeclimate-badge][]][codeclimate-link]
|
|
11
|
+
[![snyk-badge][]][snyk-link]
|
|
12
12
|
|
|
13
13
|
> XY Labs generalized React library
|
|
14
14
|
|
|
@@ -28,19 +28,39 @@ Common React code that is used throughtout XYO projects that use React.
|
|
|
28
28
|
|
|
29
29
|
Using npm:
|
|
30
30
|
|
|
31
|
-
```
|
|
32
|
-
|
|
31
|
+
```sh
|
|
32
|
+
npm i --save @xylabs/sdk-react
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Using yarn:
|
|
36
36
|
|
|
37
|
+
```sh
|
|
38
|
+
yarn add @xylabs/sdk-react
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Scripts
|
|
42
|
+
|
|
43
|
+
See [ts-scripts](https://github.com/xylabs/ts-scripts/blob/main/README.md) for list of shared scripts. The below scripts are custom scripts for this repo.
|
|
44
|
+
|
|
45
|
+
### Build (Storybook)
|
|
46
|
+
|
|
47
|
+
Build the static Storkbook site
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
yarn build-storybook
|
|
37
51
|
```
|
|
38
|
-
|
|
52
|
+
|
|
53
|
+
### Start
|
|
54
|
+
|
|
55
|
+
Starts the project in the browser for testing, with auto reload using Storybook
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
yarn start
|
|
39
59
|
```
|
|
40
60
|
|
|
41
61
|
## Maintainers
|
|
42
62
|
|
|
43
|
-
- [Arie Trouw](https://github.com/arietrouw) (https://arietrouw.com)
|
|
63
|
+
- [Arie Trouw](https://github.com/arietrouw) [arietrouw.com](https://arietrouw.com)
|
|
44
64
|
|
|
45
65
|
## License
|
|
46
66
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
3
3
|
declare const StorybookEntry: ComponentMeta<import("react").FC<import("./AppBarExProps").AppBarExProps>>;
|
|
4
|
-
declare const
|
|
5
|
-
export {
|
|
4
|
+
declare const Empty: ComponentStory<import("react").FC<import("./AppBarExProps").AppBarExProps>>;
|
|
5
|
+
export { Empty };
|
|
6
6
|
export default StorybookEntry;
|
|
7
7
|
//# sourceMappingURL=AppBarEx.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBarEx.stories.d.ts","sourceRoot":"","sources":["../../../src/components/AppBarEx/AppBarEx.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,4EASe,CAAA;AAInC,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"AppBarEx.stories.d.ts","sourceRoot":"","sources":["../../../src/components/AppBarEx/AppBarEx.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,4EASe,CAAA;AAInC,QAAA,MAAM,KAAK,6EAAoB,CAAA;AAK/B,OAAO,EAAE,KAAK,EAAE,CAAA;AAGhB,eAAe,cAAc,CAAA"}
|
|
@@ -8,14 +8,14 @@ const StorybookEntry = {
|
|
|
8
8
|
page: null,
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
-
title: 'AppBarEx',
|
|
11
|
+
title: 'Components/AppBarEx',
|
|
12
12
|
};
|
|
13
13
|
const Template = (args) => _jsx(AppBarEx, Object.assign({}, args), void 0);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
title: '
|
|
14
|
+
const Empty = Template.bind({});
|
|
15
|
+
Empty.args = {
|
|
16
|
+
title: 'Empty',
|
|
17
17
|
};
|
|
18
|
-
export {
|
|
18
|
+
export { Empty };
|
|
19
19
|
// eslint-disable-next-line import/no-default-export
|
|
20
20
|
export default StorybookEntry;
|
|
21
21
|
//# sourceMappingURL=AppBarEx.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBarEx.stories.js","sourceRoot":"","sources":["../../../src/components/AppBarEx/AppBarEx.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AppBarEx.stories.js","sourceRoot":"","sources":["../../../src/components/AppBarEx/AppBarEx.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,qBAAqB;CACK,CAAA;AAEnC,MAAM,QAAQ,GAAoC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,QAAQ,oBAAK,IAAI,UAAa,CAAA;AAE3F,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/B,KAAK,CAAC,IAAI,GAAG;IACX,KAAK,EAAE,OAAO;CACf,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../src/components/Background.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,WAAW,CAAA;AAEjD;;GAEG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAEtC,CAAA;
|
|
1
|
+
{"version":3,"file":"Background.d.ts","sourceRoot":"","sources":["../../src/components/Background.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,WAAW,CAAA;AAEjD;;GAEG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAEtC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Background.js","sourceRoot":"","sources":["../../src/components/Background.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;GAEG;AACH,MAAM,UAAU,GAA2B,CAAC,KAAK,EAAE,EAAE;IACnD,OAAO,KAAC,OAAO,oBAAK,KAAK,UAAI,CAAA;AAC/B,CAAC,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"Background.js","sourceRoot":"","sources":["../../src/components/Background.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;GAEG;AACH,MAAM,UAAU,GAA2B,CAAC,KAAK,EAAE,EAAE;IACnD,OAAO,KAAC,OAAO,oBAAK,KAAK,UAAI,CAAA;AAC/B,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -3,5 +3,5 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
|
3
3
|
declare const StorybookEntry: ComponentMeta<import("react").FC<import("./BasePageProps").BasePageProps>>;
|
|
4
4
|
declare const Default: ComponentStory<import("react").FC<import("./BasePageProps").BasePageProps>>;
|
|
5
5
|
export { Default };
|
|
6
|
-
export
|
|
6
|
+
export default StorybookEntry;
|
|
7
7
|
//# sourceMappingURL=BasePage.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePage.stories.d.ts","sourceRoot":"","sources":["../../../src/components/BasePage/BasePage.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,4EASe,CAAA;AAInC,QAAA,MAAM,OAAO,6EAAoB,CAAA;AAKjC,OAAO,EAAE,OAAO,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"BasePage.stories.d.ts","sourceRoot":"","sources":["../../../src/components/BasePage/BasePage.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIhE,QAAA,MAAM,cAAc,4EASe,CAAA;AAInC,QAAA,MAAM,OAAO,6EAAoB,CAAA;AAKjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAGlB,eAAe,cAAc,CAAA"}
|
|
@@ -8,7 +8,7 @@ const StorybookEntry = {
|
|
|
8
8
|
page: null,
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
-
title: 'BasePage',
|
|
11
|
+
title: 'Components/BasePage',
|
|
12
12
|
};
|
|
13
13
|
const Template = (args) => _jsx(BasePage, Object.assign({}, args), void 0);
|
|
14
14
|
const Default = Template.bind({});
|
|
@@ -16,5 +16,6 @@ Default.args = {
|
|
|
16
16
|
title: 'Default',
|
|
17
17
|
};
|
|
18
18
|
export { Default };
|
|
19
|
-
|
|
19
|
+
// eslint-disable-next-line import/no-default-export
|
|
20
|
+
export default StorybookEntry;
|
|
20
21
|
//# sourceMappingURL=BasePage.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePage.stories.js","sourceRoot":"","sources":["../../../src/components/BasePage/BasePage.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BasePage.stories.js","sourceRoot":"","sources":["../../../src/components/BasePage/BasePage.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,qBAAqB;CACK,CAAA;AAEnC,MAAM,QAAQ,GAAoC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,QAAQ,oBAAK,IAAI,UAAa,CAAA;AAE3F,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,SAAS;CACjB,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: 'BreadcrumbsEx',
|
|
12
|
+
title: 'Components/BreadcrumbsEx',
|
|
13
13
|
};
|
|
14
14
|
const Template = (args) => (_jsx(BrowserRouter, { children: _jsx(BreadcrumbsEx, Object.assign({}, args), void 0) }, void 0));
|
|
15
15
|
const SingleLevel = Template.bind({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbsEx.stories.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsEx.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,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,
|
|
1
|
+
{"version":3,"file":"BreadcrumbsEx.stories.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/BreadcrumbsEx.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,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,0BAA0B;CACK,CAAA;AAExC,MAAM,QAAQ,GAAyC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/D,KAAC,aAAa,cACZ,KAAC,aAAa,oBAAK,IAAI,UAAkB,WAC3B,CACjB,CAAA;AAED,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrC,WAAW,CAAC,IAAI,GAAG;IACjB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,CAAC,MAAM,CAAC;CACjB,CAAA;AAED,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrC,WAAW,CAAC,IAAI,GAAG;IACjB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AAEnC,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -9,7 +9,7 @@ const StorybookEntry = {
|
|
|
9
9
|
page: null,
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
|
-
title: 'ButtonEx',
|
|
12
|
+
title: 'Components/ButtonEx',
|
|
13
13
|
};
|
|
14
14
|
const DefaultTemplate = (args) => (_jsxs(FlexRow, Object.assign({ justifyContent: "flex-start" }, { children: [_jsx(FlexCol, Object.assign({ marginX: 1 }, { children: _jsx(ButtonEx, Object.assign({}, args, { children: "Default" }), void 0) }), void 0), _jsx(FlexCol, Object.assign({ marginX: 1 }, { children: _jsx(ButtonEx, Object.assign({ variant: "outlined" }, args, { children: "Outlined" }), void 0) }), void 0), _jsx(FlexCol, Object.assign({ marginX: 1 }, { children: _jsx(ButtonEx, Object.assign({ variant: "contained" }, args, { children: "Contained" }), void 0) }), void 0)] }), void 0));
|
|
15
15
|
const Default = DefaultTemplate.bind({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonEx.stories.js","sourceRoot":"","sources":["../../../src/components/ButtonEx/ButtonEx.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ButtonEx.stories.js","sourceRoot":"","sources":["../../../src/components/ButtonEx/ButtonEx.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,qBAAqB;CACK,CAAA;AAEnC,MAAM,eAAe,GAAoC,CAAC,IA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AAE,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,
|
|
1
|
+
{"version":3,"file":"CookieConsent.stories.js","sourceRoot":"","sources":["../../../src/components/CookieConsent/CookieConsent.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,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,0BAA0B;CACK,CAAA;AAExC,MAAM,mBAAmB,GAAyC,CAAC,IAAI,EAAE,EAAE;IACzE,MAAM,KAAK,GAAa,GAAG,EAAE;QAC3B,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE,CAAA;QAC5C,OAAO,CACL,MAAC,OAAO,eACN,KAAC,QAAQ,kBACP,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE;wBACZ,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAA;oBACnB,CAAC,iDAGQ,EACX,KAAC,aAAa,oBAAK,IAAI,UAAkB,YACjC,CACX,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,KAAC,mBAAmB,cAClB,KAAC,KAAK,aAAG,WACW,CACvB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,sBAAsB,GAAyC,CAAC,IAAI,EAAE,EAAE;IAC5E,OAAO,CACL,KAAC,OAAO,cACN,KAAC,aAAa,oBAAK,IAAI,UAAkB,WACjC,CACX,CAAA;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAChD,WAAW,CAAC,IAAI,GAAG;IACjB,KAAK,EAAE,cAAc;CACtB,CAAA;AAED,MAAM,cAAc,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACtD,cAAc,CAAC,IAAI,GAAG;IACpB,KAAK,EAAE,iBAAiB;CACzB,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA;AAEtC,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorViewer.stories.js","sourceRoot":"","sources":["../../../src/components/Errors/ErrorViewer.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,
|
|
1
|
+
{"version":3,"file":"ErrorViewer.stories.js","sourceRoot":"","sources":["../../../src/components/Errors/ErrorViewer.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,wBAAwB;CACK,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,SAAS;CACjB,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorsViewer.stories.js","sourceRoot":"","sources":["../../../src/components/Errors/ErrorsViewer.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ErrorsViewer.stories.js","sourceRoot":"","sources":["../../../src/components/Errors/ErrorsViewer.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,yBAAyB;CACK,CAAA;AAEvC,MAAM,QAAQ,GAAwC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,YAAY,oBAAK,IAAI,UAAiB,CAAA;AAEvG,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG;IACb,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAChD,KAAK,EAAE,SAAS;CACjB,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthAccount.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EthAccount.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmDzC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -9,16 +9,38 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Typography, useTheme } from '@mui/material';
|
|
14
|
+
import { useContext } from 'react';
|
|
15
|
+
import { EthersContext } from '../../contexts';
|
|
16
|
+
import { useMediaQuery } from '../../hooks';
|
|
17
|
+
import { ButtonEx } from '../ButtonEx';
|
|
18
|
+
import { FlexGrowRow, FlexRow } from '../FlexBox';
|
|
19
|
+
import { Identicon } from '../Identicon';
|
|
15
20
|
const EthAccount = (_a) => {
|
|
16
|
-
var {
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
var { address, icon = false, iconSize = 16, iconOnly = false, addressLength = 'auto', fontFamily = '"Source Code Pro",monospace', toEtherScan, onButtonClick } = _a, props = __rest(_a, ["address", "icon", "iconSize", "iconOnly", "addressLength", "fontFamily", "toEtherScan", "onButtonClick"]);
|
|
22
|
+
const { localAddress } = useContext(EthersContext);
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const large = useMediaQuery(theme.breakpoints.up('md'));
|
|
25
|
+
if (address) {
|
|
26
|
+
const isLocalAddress = (localAddress === null || localAddress === void 0 ? void 0 : localAddress.toString()) === address.toString();
|
|
27
|
+
const onClickLocal = (event) => {
|
|
28
|
+
onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick(event);
|
|
29
|
+
if (toEtherScan) {
|
|
30
|
+
window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const testToDisplay = addressLength === 'long'
|
|
34
|
+
? address.toString()
|
|
35
|
+
: addressLength === 'short'
|
|
36
|
+
? address.toShortString()
|
|
37
|
+
: large
|
|
38
|
+
? address.toString()
|
|
39
|
+
: address.toShortString();
|
|
40
|
+
return (_jsx(ButtonEx, Object.assign({ onClick: onClickLocal, title: `0x${address === null || address === void 0 ? void 0 : address.toHex()}` }, props, { children: _jsxs(FlexGrowRow, Object.assign({ justifyContent: "space-between", alignItems: "center" }, { children: [icon ? _jsx(Identicon, { size: iconSize, value: address === null || address === void 0 ? void 0 : address.toHex() }, void 0) : null, iconOnly ? null : (_jsx(Typography, Object.assign({ marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily }, { children: testToDisplay }), void 0)), isLocalAddress ? _jsx(FlexRow, Object.assign({ marginLeft: 0.5 }, { children: "(You)" }), void 0) : null] }), void 0) }), void 0));
|
|
19
41
|
}
|
|
20
42
|
else {
|
|
21
|
-
return _jsx(
|
|
43
|
+
return _jsx(ButtonEx, Object.assign({}, props, { children: ' - - ' }), void 0);
|
|
22
44
|
}
|
|
23
45
|
};
|
|
24
46
|
export { EthAccount };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthAccount.js","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EthAccount.js","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OA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
|
declare const StorybookEntry: ComponentMeta<import("react").FC<import("./EthAccountProps").EthAccountProps>>;
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const Long: ComponentStory<import("react").FC<import("./EthAccountProps").EthAccountProps>>;
|
|
5
|
+
declare const Short: ComponentStory<import("react").FC<import("./EthAccountProps").EthAccountProps>>;
|
|
6
|
+
declare const Auto: ComponentStory<import("react").FC<import("./EthAccountProps").EthAccountProps>>;
|
|
7
|
+
export { Auto, Long, Short };
|
|
6
8
|
export default StorybookEntry;
|
|
7
9
|
//# sourceMappingURL=EthAccount.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthAccount.stories.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"EthAccount.stories.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMhE,QAAA,MAAM,cAAc,gFASiB,CAAA;AAQrC,QAAA,MAAM,IAAI,iFAAoB,CAAA;AAS9B,QAAA,MAAM,KAAK,iFAAoB,CAAA;AAS/B,QAAA,MAAM,IAAI,iFAAoB,CAAA;AAS9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AAG5B,eAAe,cAAc,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { EthAddress } from '@xylabs/sdk-js';
|
|
3
|
+
import { FlexRow } from '../FlexBox';
|
|
3
4
|
import { EthAccount } from './EthAccount';
|
|
4
5
|
const StorybookEntry = {
|
|
5
6
|
argTypes: {},
|
|
@@ -9,18 +10,34 @@ const StorybookEntry = {
|
|
|
9
10
|
page: null,
|
|
10
11
|
},
|
|
11
12
|
},
|
|
12
|
-
title: 'EthAccount',
|
|
13
|
+
title: 'Components/EthAccount',
|
|
13
14
|
};
|
|
14
|
-
const Template = (args) => _jsx(EthAccount, Object.assign({}, args), void 0);
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const Template = (args) => (_jsx(FlexRow, { children: _jsx(EthAccount, Object.assign({ variant: "outlined" }, args), void 0) }, void 0));
|
|
16
|
+
const Long = Template.bind({});
|
|
17
|
+
Long.args = {
|
|
17
18
|
address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
|
|
18
|
-
|
|
19
|
+
addressLength: 'long',
|
|
19
20
|
icon: true,
|
|
20
21
|
title: 'Sample EthAccount',
|
|
21
22
|
toEtherScan: true,
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
const Short = Template.bind({});
|
|
25
|
+
Short.args = {
|
|
26
|
+
address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
|
|
27
|
+
addressLength: 'short',
|
|
28
|
+
icon: true,
|
|
29
|
+
title: 'Sample EthAccount',
|
|
30
|
+
toEtherScan: true,
|
|
31
|
+
};
|
|
32
|
+
const Auto = Template.bind({});
|
|
33
|
+
Auto.args = {
|
|
34
|
+
address: EthAddress.fromString('0x6792b02f88b32c4fe8e31cfa41ae5af44865f930'),
|
|
35
|
+
addressLength: 'auto',
|
|
36
|
+
icon: true,
|
|
37
|
+
title: 'Sample EthAccount',
|
|
38
|
+
toEtherScan: true,
|
|
39
|
+
};
|
|
40
|
+
export { Auto, Long, Short };
|
|
24
41
|
// eslint-disable-next-line import/no-default-export
|
|
25
42
|
export default StorybookEntry;
|
|
26
43
|
//# sourceMappingURL=EthAccount.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthAccount.stories.js","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"EthAccount.stories.js","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccount.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,uBAAuB;CACK,CAAA;AAErC,MAAM,QAAQ,GAAsC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC5D,KAAC,OAAO,cACN,KAAC,UAAU,kBAAC,OAAO,EAAC,UAAU,IAAK,IAAI,UAAe,WAC9C,CACX,CAAA;AAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC9B,IAAI,CAAC,IAAI,GAAG;IACV,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,4CAA4C,CAAC;IAC5E,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,IAAI;CAClB,CAAA;AAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/B,KAAK,CAAC,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,4CAA4C,CAAC;IAC5E,aAAa,EAAE,OAAO;IACtB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,IAAI;CAClB,CAAA;AAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC9B,IAAI,CAAC,IAAI,GAAG;IACV,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,4CAA4C,CAAC;IAC5E,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,IAAI;CAClB,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AAE5B,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { BoxProps } from '@mui/material';
|
|
2
1
|
import { EthAddress } from '@xylabs/sdk-js';
|
|
3
2
|
import { MouseEventHandler } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
interface EthAccountProps extends
|
|
3
|
+
import { ButtonExProps } from '../ButtonEx';
|
|
4
|
+
interface EthAccountProps extends ButtonExProps {
|
|
6
5
|
address?: EthAddress | null;
|
|
7
|
-
|
|
6
|
+
addressLength?: 'auto' | 'short' | 'long';
|
|
8
7
|
full?: boolean;
|
|
9
8
|
icon?: boolean;
|
|
9
|
+
iconSize?: number;
|
|
10
10
|
iconOnly?: boolean;
|
|
11
|
-
size?: number;
|
|
12
11
|
text?: boolean;
|
|
13
|
-
to?: To;
|
|
14
|
-
toOptions?: NavigateOptions;
|
|
15
12
|
page?: string;
|
|
16
13
|
toEtherScan?: boolean;
|
|
14
|
+
fontFamily?: string;
|
|
17
15
|
onButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
18
16
|
}
|
|
19
17
|
export type { EthAccountProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthAccountProps.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccountProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EthAccountProps.d.ts","sourceRoot":"","sources":["../../../src/components/EthAccount/EthAccountProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,UAAU,eAAgB,SAAQ,aAAa;IAC7C,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IACzC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;CACrD;AAED,YAAY,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusyBox.stories.js","sourceRoot":"","sources":["../../../src/components/FlexBox/BusyBox.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BusyBox.stories.js","source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AA;AAClD,iBAAiB,CAAC,IAAI,GAAG;IACvB,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,IAAI;IACV,eAAe,EAAE;QACf,OAAO,EAAE,aAAa;KACvB;IACD,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,GAAG;CACX,CAAA;AAED,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC5C,WAAW,CAAC,IAAI,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,IAAI;IACV,eAAe,EAAE;QACf,OAAO,EAAE,OAAO;KACjB;IACD,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,GAAG;CACX,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAA;AAEzE,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexCol.stories.js","sourceRoot":"","sources":["../../../src/components/FlexBox/FlexCol.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FlexCol.stories.js","sourceRoot":"","sources":["../../../src/components/FlexBox/FlexCol.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAE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AmB,EAAE,CAAA;AAE1E,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexRow.stories.js","sourceRoot":"","sources":["../../../src/components/FlexBox/FlexRow.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FlexRow.stories.js","sourceRoot":"","sources":["../../../src/components/FlexBox/FlexRow.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,oBAAoB;CACK,CAAA;AAElC,MAAM,QAAQ,GAAmC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,OAAO,oBAAK,IAAI,UAAY,CAAA;AAExF,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,CACR,8BACE,KAAC,OAAO,kBAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,MAAM,wCAEpC,EACV,KAAC,OAAO,kBAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,MAAM,wCAEpC,EACV,KAAC,OAAO,kBAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAC,MAAM,0CAEpC,YACT,CACJ;CACF,CAAA;AAED,MAAM,4BAA4B,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACtD,4BAA4B,CAAC,IAAI,mCAC5B,WAAW,KACd,cAAc,EAAE,eAAe,EAC/B,KAAK,EAAE,8BAA8B,GACtC,CAAA;AAED,MAAM,2BAA2B,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrD,2BAA2B,CAAC,IAAI,mCAC3B,WAAW,KACd,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,6BAA6B,GACrC,CAAA;AAED,MAAM,2BAA2B,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrD,2BAA2B,CAAC,IAAI,mCAC3B,WAAW,KACd,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,6BAA6B,GACrC,CAAA;AAED,MAAM,yBAAyB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACnD,yBAAyB,CAAC,IAAI,mCACzB,WAAW,KACd,cAAc,EAAE,YAAY,EAC5B,KAAK,EAAE,2BAA2B,GACnC,CAAA;AAED,MAAM,uBAAuB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjD,uBAAuB,CAAC,IAAI,mCACvB,WAAW,KACd,cAAc,EAAE,UAAU,EAC1B,KAAK,EAAE,yBAAyB,GACjC,CAAA;AAED,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,GAC5B,CAAA;AAED,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvertableThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableThemeProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAE7E,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"InvertableThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableThemeProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAE7E,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAsCnE,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -4,23 +4,22 @@ import { createTheme } from '@mui/material/styles';
|
|
|
4
4
|
import clone from 'lodash/clone';
|
|
5
5
|
import { useContext } from 'react';
|
|
6
6
|
import { InvertableThemeContext } from './InvertableThemeContext';
|
|
7
|
-
const InvertableThemeProvider = (
|
|
8
|
-
var _a;
|
|
7
|
+
const InvertableThemeProvider = ({ options, children, dark, scoped = false, invert = false, noResponsiveFonts, }) => {
|
|
8
|
+
var _a, _b;
|
|
9
9
|
const contextInvertableTheme = useContext(InvertableThemeContext);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
options.palette = (_a = options.palette) !== null && _a !== void 0 ? _a : {};
|
|
10
|
+
const clonedOptions = clone((_a = options !== null && options !== void 0 ? options : contextInvertableTheme.options) !== null && _a !== void 0 ? _a : {});
|
|
11
|
+
clonedOptions.palette = (_b = clonedOptions.palette) !== null && _b !== void 0 ? _b : {};
|
|
13
12
|
if (invert) {
|
|
14
|
-
|
|
13
|
+
clonedOptions.palette.mode = clonedOptions.palette.mode === 'dark' ? 'light' : 'dark';
|
|
15
14
|
}
|
|
16
15
|
if (dark !== undefined) {
|
|
17
|
-
|
|
16
|
+
clonedOptions.palette.mode = dark ? 'dark' : 'light';
|
|
18
17
|
}
|
|
19
|
-
let theme = createTheme(
|
|
18
|
+
let theme = createTheme(clonedOptions);
|
|
20
19
|
if (!noResponsiveFonts) {
|
|
21
20
|
theme = responsiveFontSizes(theme);
|
|
22
21
|
}
|
|
23
|
-
return scoped ? (_jsx(ScopedCssBaseline, { children: _jsx(InvertableThemeContext.Provider, Object.assign({ value: { options } }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (_jsx(InvertableThemeContext.Provider, Object.assign({ value: { options } }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0));
|
|
22
|
+
return scoped ? (_jsx(ScopedCssBaseline, { children: _jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (_jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: _jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0));
|
|
24
23
|
};
|
|
25
24
|
export { InvertableThemeProvider };
|
|
26
25
|
//# sourceMappingURL=InvertableThemeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvertableThemeProvider.js","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableThemeProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,MAAM,cAAc,CAAA;AAChC,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAGjE,MAAM,uBAAuB,GAA2C,CAAC,
|
|
1
|
+
{"version":3,"file":"InvertableThemeProvider.js","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableTheme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AAQ,kBAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,gBAChE,KAAC,aAAa,kBAAC,KAAK,EAAE,KAAK,gBAAG,QAAQ,YAAiB,YACvB,WAChB,CACrB,CAAC,CAAC,CAAC,CACF,KAAC,sBAAsB,CAAC,QAAQ,kBAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,gBAChE,KAAC,aAAa,kBAAC,KAAK,EAAE,KAAK,gBAAG,QAAQ,YAAiB,YACvB,CACnC,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -8,7 +8,7 @@ const StorybookEntry = {
|
|
|
8
8
|
page: null,
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
-
title: 'InvertableThemeProvider',
|
|
11
|
+
title: 'Components/InvertableThemeProvider',
|
|
12
12
|
};
|
|
13
13
|
const Template = (args) => (_jsx(InvertableThemeProvider, Object.assign({}, args), void 0));
|
|
14
14
|
const Default = Template.bind({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvertableThemeProvider.stories.js","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableThemeProvider.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,uBAAuB;IAClC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"InvertableThemeProvider.stories.js","sourceRoot":"","sources":["../../../src/components/InvertableThemeProvider/InvertableThemeProvider.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,uBAAuB;IAClC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,oCAAoC;CACK,CAAA;AAElD,MAAM,QAAQ,GAAmD,CAAC,IAAI,EAAE,EAAE,CAAC,CACzE,KAAC,uBAAuB,oBAAK,IAAI,UAA4B,CAC9D,CAAA;AAED,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA;AAEjB,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,oDAAoD;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberStatus.stories.js","sourceRoot":"","sources":["../../../src/components/NumberStatus/NumberStatus.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NumberStatus.stories.js","sourceRoot":"","sources":["../../../src/components/NumberStatus/NumberStatus.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI;SACX;KACF;IACD,KAAK,EAAE,yBAAyB;CACK,CAAA;AAEvC,MAAM,oBAAoB,GAAwC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,YAAY,oBAAK,IAAI,UAAiB,CAAA;AAEnH,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAA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