@xyo-network/react-shared 2.25.39 → 2.25.42
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/cjs/components/Footer/Copyright.js.map +1 -1
- package/dist/cjs/components/ListItemButtonEx.d.ts +10 -0
- package/dist/cjs/components/ListItemButtonEx.js +30 -0
- package/dist/cjs/components/ListItemButtonEx.js.map +1 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/docs.json +24148 -14188
- package/dist/esm/components/Footer/Copyright.js.map +1 -1
- package/dist/esm/components/ListItemButtonEx.d.ts +10 -0
- package/dist/esm/components/ListItemButtonEx.js +22 -0
- package/dist/esm/components/ListItemButtonEx.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/package.json +11 -11
- package/src/components/Footer/Copyright.tsx +1 -1
- package/src/components/JsonRouteWrapper/JsonFromUrl.stories.tsx +5 -7
- package/src/components/JsonRouteWrapper/JsonRouteWrapper.stories.tsx +1 -3
- package/src/components/ListItemButtonEx.tsx +29 -0
- package/src/components/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Copyright.js","sourceRoot":"","sources":["../../../../src/components/Footer/Copyright.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"Copyright.js","sourceRoot":"","sources":["../../../../src/components/Footer/Copyright.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAgB,OAAO,EAAe,MAAM,mBAAmB,CAAA;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAMnC,MAAM,WAAW,GAAkB;IACjC;QACE,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,eAAe,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,gBAAgB;KAC/D;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,gBAAgB;KACxB;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,KAAK,EAAE,SAAS;KACjB;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,KAAK,EAAE,OAAO;KACf;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE,SAAS;KACjB;CACF,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CAClF,MAAC,OAAO,IAAC,QAAQ,EAAC,MAAM,EAAC,aAAa,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,KAAM,KAAK,aAC5F,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,CACtC,KAAC,UAAU,IAAC,MAAM,QAAa,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAM,UAAU,YACnE,0BAAQ,UAAU,CAAC,KAAK,GAAS,IADX,KAAK,CAEhB,CACd,CAAC,EACD,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,OAAO,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,YACnE,KAAC,aAAa,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,GAAG,GAC1C,CACX,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ListItemButtonProps } from '@mui/material';
|
|
3
|
+
import { NavigateOptions, To } from 'react-router-dom';
|
|
4
|
+
export interface ListItemButtonExProps extends ListItemButtonProps {
|
|
5
|
+
target?: string;
|
|
6
|
+
to?: To;
|
|
7
|
+
toOptions?: NavigateOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare const ListItemButtonExTo: React.FC<ListItemButtonExProps>;
|
|
10
|
+
export declare const ListItemButtonEx: React.FC<ListItemButtonExProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemButton } from '@mui/material';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
export const ListItemButtonExTo = ({ to, toOptions, onClick, ...props }) => {
|
|
5
|
+
const navigate = useNavigate();
|
|
6
|
+
const localOnClick = (event) => {
|
|
7
|
+
onClick?.(event);
|
|
8
|
+
if (to) {
|
|
9
|
+
navigate(to, toOptions);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
return _jsx(ListItemButton, { onClick: localOnClick, ...props });
|
|
13
|
+
};
|
|
14
|
+
export const ListItemButtonEx = ({ to, ...props }) => {
|
|
15
|
+
if (to) {
|
|
16
|
+
return _jsx(ListItemButtonExTo, { to: to, ...props });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return _jsx(ListItemButtonEx, { ...props });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=ListItemButtonEx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemButtonEx.js","sourceRoot":"","sources":["../../../src/components/ListItemButtonEx.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAA;AAEnE,OAAO,EAAuB,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAQnE,MAAM,CAAC,MAAM,kBAAkB,GAAoC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC1G,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,YAAY,GAAG,CAAC,KAAiC,EAAE,EAAE;QACzD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;QAChB,IAAI,EAAE,EAAE;YACN,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;SACxB;IACH,CAAC,CAAA;IAED,OAAO,KAAC,cAAc,IAAC,OAAO,EAAE,YAAY,KAAM,KAAK,GAAI,CAAA;AAC7D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACpF,IAAI,EAAE,EAAE;QACN,OAAO,KAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,KAAM,KAAK,GAAI,CAAA;KACjD;SAAM;QACL,OAAO,KAAC,gBAAgB,OAAK,KAAK,GAAI,CAAA;KACvC;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"@xylabs/pixel": "^1.3.9",
|
|
20
20
|
"@xylabs/sdk-js": "^2.5.7",
|
|
21
21
|
"@xylabs/sdk-react": "^2.13.7",
|
|
22
|
-
"@xyo-network/api": "^2.20.
|
|
23
|
-
"@xyo-network/core": "^2.20.
|
|
24
|
-
"@xyo-network/network": "^2.20.
|
|
25
|
-
"@xyo-network/react-theme": "^2.25.
|
|
22
|
+
"@xyo-network/api": "^2.20.44",
|
|
23
|
+
"@xyo-network/core": "^2.20.44",
|
|
24
|
+
"@xyo-network/network": "^2.20.44",
|
|
25
|
+
"@xyo-network/react-theme": "^2.25.42",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"luxon": "^2.4.0",
|
|
28
28
|
"react": "^18.1.0",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/core": "^7.18.2",
|
|
40
40
|
"@babel/preset-env": "^7.18.2",
|
|
41
|
-
"@storybook/addons": "^6.5.
|
|
42
|
-
"@storybook/api": "^6.5.
|
|
43
|
-
"@storybook/components": "^6.5.
|
|
44
|
-
"@storybook/core-events": "^6.5.
|
|
45
|
-
"@storybook/react": "^6.5.
|
|
46
|
-
"@storybook/theming": "^6.5.
|
|
41
|
+
"@storybook/addons": "^6.5.8",
|
|
42
|
+
"@storybook/api": "^6.5.8",
|
|
43
|
+
"@storybook/components": "^6.5.8",
|
|
44
|
+
"@storybook/core-events": "^6.5.8",
|
|
45
|
+
"@storybook/react": "^6.5.8",
|
|
46
|
+
"@storybook/theming": "^6.5.8",
|
|
47
47
|
"@types/lodash": "^4.14.182",
|
|
48
48
|
"@types/react-helmet": "^6.1.5",
|
|
49
49
|
"@xylabs/pixel": "^1.3.9",
|
|
@@ -113,6 +113,6 @@
|
|
|
113
113
|
},
|
|
114
114
|
"sideEffects": false,
|
|
115
115
|
"types": "dist/esm/index.d.ts",
|
|
116
|
-
"version": "2.25.
|
|
116
|
+
"version": "2.25.42",
|
|
117
117
|
"packageManager": "yarn@3.1.1"
|
|
118
118
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/* eslint-disable deprecation/deprecation */
|
|
2
2
|
/* eslint-disable import/no-deprecated */
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentStory, Meta } from '@storybook/react'
|
|
4
4
|
import { FlexCol } from '@xylabs/sdk-react'
|
|
5
5
|
import { BrowserRouter } from 'react-router-dom'
|
|
6
6
|
|
|
7
7
|
import { DeprecateStory } from '../../../../../.storybook'
|
|
8
8
|
import { JsonFromUrl } from './JsonFromUrl'
|
|
9
9
|
|
|
10
|
-
const StorybookEntry = {
|
|
11
|
-
|
|
12
|
-
apiDomain:
|
|
13
|
-
defaultValue: 'http://localhost:8081',
|
|
14
|
-
},
|
|
10
|
+
const StorybookEntry: Meta = {
|
|
11
|
+
args: {
|
|
12
|
+
apiDomain: 'http://localhost:8081',
|
|
15
13
|
},
|
|
16
14
|
component: JsonFromUrl,
|
|
17
15
|
parameters: {
|
|
@@ -20,7 +18,7 @@ const StorybookEntry = {
|
|
|
20
18
|
},
|
|
21
19
|
},
|
|
22
20
|
title: 'shared/JsonRouteWrapper/JsonFromUrl',
|
|
23
|
-
}
|
|
21
|
+
}
|
|
24
22
|
|
|
25
23
|
const Template: ComponentStory<typeof JsonFromUrl> = (props) => {
|
|
26
24
|
return (
|
|
@@ -13,9 +13,7 @@ const JsonDecorator: DecoratorFn = (Story) => (
|
|
|
13
13
|
|
|
14
14
|
const StorybookEntry = {
|
|
15
15
|
argTypes: {
|
|
16
|
-
apiDomain:
|
|
17
|
-
defaultValue: 'https://beta.api.archivist.xyo.network',
|
|
18
|
-
},
|
|
16
|
+
apiDomain: 'https://beta.api.archivist.xyo.network',
|
|
19
17
|
},
|
|
20
18
|
component: JsonRouteWrapper,
|
|
21
19
|
decorators: [JsonDecorator],
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ListItemButton, ListItemButtonProps } from '@mui/material'
|
|
2
|
+
import { MouseEvent } from 'react'
|
|
3
|
+
import { NavigateOptions, To, useNavigate } from 'react-router-dom'
|
|
4
|
+
|
|
5
|
+
export interface ListItemButtonExProps extends ListItemButtonProps {
|
|
6
|
+
target?: string
|
|
7
|
+
to?: To
|
|
8
|
+
toOptions?: NavigateOptions
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ListItemButtonExTo: React.FC<ListItemButtonExProps> = ({ to, toOptions, onClick, ...props }) => {
|
|
12
|
+
const navigate = useNavigate()
|
|
13
|
+
const localOnClick = (event: MouseEvent<HTMLDivElement>) => {
|
|
14
|
+
onClick?.(event)
|
|
15
|
+
if (to) {
|
|
16
|
+
navigate(to, toOptions)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return <ListItemButton onClick={localOnClick} {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ListItemButtonEx: React.FC<ListItemButtonExProps> = ({ to, ...props }) => {
|
|
24
|
+
if (to) {
|
|
25
|
+
return <ListItemButtonExTo to={to} {...props} />
|
|
26
|
+
} else {
|
|
27
|
+
return <ListItemButtonEx {...props} />
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/components/index.ts
CHANGED