@astral/features 3.222.2 → 3.222.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/node/productSwitcher/components/IdentityProductSwitcher/IdentityProductSwitcher.js +1 -1
- package/node/productSwitcher/components/IdentityProductSwitcher/styles.d.ts +2 -4
- package/node/productSwitcher/components/IdentityProductSwitcher/styles.js +4 -1
- package/package.json +2 -2
- package/productSwitcher/components/IdentityProductSwitcher/IdentityProductSwitcher.js +1 -1
- package/productSwitcher/components/IdentityProductSwitcher/styles.d.ts +2 -4
- package/productSwitcher/components/IdentityProductSwitcher/styles.js +5 -2
|
@@ -11,7 +11,7 @@ const IdentityProductSwitcher = ({ identityUrl, }) => {
|
|
|
11
11
|
const { isLoading, isError, tenantId, tenants, productList, handleChangeTenant, handleShowProducts, isShowToggleButton, } = (0, hooks_1.useLogic)(identityUrl, handleOpenMenu);
|
|
12
12
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.IconButton, { ref: anchorRef, selected: open, variant: "text", onClick: handleShowProducts, children: (0, jsx_runtime_1.jsx)(ui_1.ProductsFillMd, {}) }), (0, jsx_runtime_1.jsx)(styles_1.StyledMenu, { open: open, anchorEl: anchorRef.current, onClose: handleCloseMenu, children: (0, jsx_runtime_1.jsx)(ui_1.MenuGroup, { label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u044B \u044D\u043A\u043E\u0441\u0438\u0441\u0442\u0435\u043C\u044B", children: (0, jsx_runtime_1.jsxs)(ui_1.ContentState, { isLoading: isLoading, isCustom: isError, customState: {
|
|
13
13
|
imgAlt: 'Что-то пошло не так',
|
|
14
|
-
title: ((0, jsx_runtime_1.jsxs)(styles_1.ErrorContainer, { container: true,
|
|
14
|
+
title: ((0, jsx_runtime_1.jsxs)(styles_1.ErrorContainer, { container: true, component: "span", children: [(0, jsx_runtime_1.jsx)(ui_1.ErrorFillSm, { color: "inherit" }), (0, jsx_runtime_1.jsx)(ui_1.Typography, { variant: "h6", color: "grey", colorIntensity: "900", children: "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A" })] })),
|
|
15
15
|
description: 'Произошла ошибка. Повторите попытку позже.',
|
|
16
16
|
}, children: [isShowToggleButton && ((0, jsx_runtime_1.jsx)(styles_1.TenantsToggleButtonGroup, { exclusive: true, onChange: handleChangeTenant, value: tenantId, children: tenants === null || tenants === void 0 ? void 0 : tenants.map(({ id, name }) => ((0, jsx_runtime_1.jsx)(styles_1.TenantToggleButton, { value: id, children: name }, id))) })), productList === null || productList === void 0 ? void 0 : productList.map((product) => {
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)(styles_1.StyledMenuItem, { component: "a", href: product.url, children: [(0, jsx_runtime_1.jsx)(styles_1.Logo, { src: product.logoUrl, color: product.color }), (0, jsx_runtime_1.jsx)(ui_1.Typography, { variant: "ui", color: "grey", colorIntensity: "900", children: product.name })] }) }, product.id));
|
|
@@ -15,11 +15,9 @@ export declare const Logo: import("@emotion/styled").StyledComponent<{
|
|
|
15
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
16
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
17
|
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
18
|
-
export declare const ErrorContainer: import("@emotion/styled").StyledComponent<import("@astral/
|
|
19
|
-
children?: import("react").ReactNode;
|
|
20
|
-
} & import("react").RefAttributes<HTMLElement> & {
|
|
18
|
+
export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/components/src/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
21
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
22
|
-
}, {}, {}>;
|
|
20
|
+
} & import("@astral/components/src/Grid/styles").StyledGridProps, {}, {}>;
|
|
23
21
|
export declare const TenantsToggleButtonGroup: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
24
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
25
23
|
}, {}, {}>;
|
|
@@ -29,8 +29,11 @@ exports.Logo = (0, ui_1.styled)('img', {
|
|
|
29
29
|
background-color: ${({ color }) => color};
|
|
30
30
|
border-radius: ${({ theme }) => theme.shape.small};
|
|
31
31
|
`;
|
|
32
|
-
exports.ErrorContainer = (0, ui_1.styled)(ui_1.
|
|
32
|
+
exports.ErrorContainer = (0, ui_1.styled)(ui_1.Grid) `
|
|
33
|
+
grid-auto-flow: column;
|
|
33
34
|
column-gap: ${({ theme }) => theme.spacing(2)};
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
34
37
|
|
|
35
38
|
color: ${({ theme }) => theme.palette.error.dark};
|
|
36
39
|
`;
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@astral/features",
|
|
3
3
|
"browser": "./index.js",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
|
-
"version": "3.222.
|
|
5
|
+
"version": "3.222.4",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@astral/ui": "3.222.
|
|
7
|
+
"@astral/ui": "3.222.4",
|
|
8
8
|
"mobx": "^6.8.0",
|
|
9
9
|
"mobx-react-lite": "^3.4.0",
|
|
10
10
|
"@astral/cryptopro-cades": "^1.5.1"
|
|
@@ -8,7 +8,7 @@ export const IdentityProductSwitcher = ({ identityUrl, }) => {
|
|
|
8
8
|
const { isLoading, isError, tenantId, tenants, productList, handleChangeTenant, handleShowProducts, isShowToggleButton, } = useLogic(identityUrl, handleOpenMenu);
|
|
9
9
|
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { ref: anchorRef, selected: open, variant: "text", onClick: handleShowProducts, children: _jsx(ProductsFillMd, {}) }), _jsx(StyledMenu, { open: open, anchorEl: anchorRef.current, onClose: handleCloseMenu, children: _jsx(MenuGroup, { label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442\u044B \u044D\u043A\u043E\u0441\u0438\u0441\u0442\u0435\u043C\u044B", children: _jsxs(ContentState, { isLoading: isLoading, isCustom: isError, customState: {
|
|
10
10
|
imgAlt: 'Что-то пошло не так',
|
|
11
|
-
title: (_jsxs(ErrorContainer, { container: true,
|
|
11
|
+
title: (_jsxs(ErrorContainer, { container: true, component: "span", children: [_jsx(ErrorFillSm, { color: "inherit" }), _jsx(Typography, { variant: "h6", color: "grey", colorIntensity: "900", children: "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A" })] })),
|
|
12
12
|
description: 'Произошла ошибка. Повторите попытку позже.',
|
|
13
13
|
}, children: [isShowToggleButton && (_jsx(TenantsToggleButtonGroup, { exclusive: true, onChange: handleChangeTenant, value: tenantId, children: tenants === null || tenants === void 0 ? void 0 : tenants.map(({ id, name }) => (_jsx(TenantToggleButton, { value: id, children: name }, id))) })), productList === null || productList === void 0 ? void 0 : productList.map((product) => {
|
|
14
14
|
return (_jsx("li", { children: _jsxs(StyledMenuItem, { component: "a", href: product.url, children: [_jsx(Logo, { src: product.logoUrl, color: product.color }), _jsx(Typography, { variant: "ui", color: "grey", colorIntensity: "900", children: product.name })] }) }, product.id));
|
|
@@ -15,11 +15,9 @@ export declare const Logo: import("@emotion/styled").StyledComponent<{
|
|
|
15
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
16
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
17
|
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
18
|
-
export declare const ErrorContainer: import("@emotion/styled").StyledComponent<import("@astral/
|
|
19
|
-
children?: import("react").ReactNode;
|
|
20
|
-
} & import("react").RefAttributes<HTMLElement> & {
|
|
18
|
+
export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/components/src/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
21
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
22
|
-
}, {}, {}>;
|
|
20
|
+
} & import("@astral/components/src/Grid/styles").StyledGridProps, {}, {}>;
|
|
23
21
|
export declare const TenantsToggleButtonGroup: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
24
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
25
23
|
}, {}, {}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Grid, Menu, MenuItem, ToggleButton, ToggleButtonGroup, styled, } from '@astral/ui';
|
|
2
2
|
export const StyledMenu = styled(Menu) `
|
|
3
3
|
.MuiPaper-root > .MuiList-root {
|
|
4
4
|
display: flex;
|
|
@@ -26,8 +26,11 @@ export const Logo = styled('img', {
|
|
|
26
26
|
background-color: ${({ color }) => color};
|
|
27
27
|
border-radius: ${({ theme }) => theme.shape.small};
|
|
28
28
|
`;
|
|
29
|
-
export const ErrorContainer = styled(
|
|
29
|
+
export const ErrorContainer = styled(Grid) `
|
|
30
|
+
grid-auto-flow: column;
|
|
30
31
|
column-gap: ${({ theme }) => theme.spacing(2)};
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
31
34
|
|
|
32
35
|
color: ${({ theme }) => theme.palette.error.dark};
|
|
33
36
|
`;
|