@astral/features 3.89.0 → 3.89.1

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.
@@ -11,10 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import { ListItemAvatar, OverflowTypography } from '@astral/ui';
14
- import { AutocompleteListAvatarIcon, AutocompleteListItemContent, AutocompleteListItemIcon, AutocompleteListItemLabel, AutocompleteListItemLabelTitle, AutocompleteListItemSideLabel, GroupMenuItem, } from './styles';
14
+ import { Content, GroupMenuItem, Label, LabelTitle, SideLabel, StyledAvatar, StyledListItemIcon, } from './styles';
15
15
  import { getShortFullName } from './utils';
16
- const AutocompleteListItemLabelGroup = ({ title, subtitle, sidetitle, }) => (_jsxs(_Fragment, { children: [_jsxs(AutocompleteListItemLabel, { children: [_jsx(OverflowTypography, { children: _jsx(AutocompleteListItemLabelTitle, { children: title }) }), _jsx(OverflowTypography, { color: "grey", colorIntensity: "600", children: subtitle })] }), _jsx(AutocompleteListItemSideLabel, { children: _jsx(OverflowTypography, { color: "grey", colorIntensity: "600", children: sidetitle }) })] }));
16
+ const AutocompleteListItemLabelGroup = ({ title, subtitle, sidetitle, }) => (_jsxs(_Fragment, { children: [_jsxs(Label, { children: [_jsx(OverflowTypography, { children: _jsx(LabelTitle, { children: title }) }), _jsx(OverflowTypography, { color: "grey", colorIntensity: "600", children: subtitle })] }), _jsx(SideLabel, { children: _jsx(OverflowTypography, { color: "grey", colorIntensity: "600", children: sidetitle }) })] }));
17
17
  export const AutocompleteListItem = (_a) => {
18
18
  var { title, sidetitle, inn, notAfter, checked, type, disabled = false } = _a, restProps = __rest(_a, ["title", "sidetitle", "inn", "notAfter", "checked", "type", "disabled"]);
19
- return (_jsxs(GroupMenuItem, Object.assign({}, restProps, { disabled: disabled, checked: checked, children: [_jsx(AutocompleteListItemIcon, { children: _jsx(ListItemAvatar, { children: _jsx(AutocompleteListAvatarIcon, { children: type }) }) }), _jsx(AutocompleteListItemContent, { children: _jsx(AutocompleteListItemLabelGroup, { title: title, subtitle: _jsxs(_Fragment, { children: [inn, "\u2022", notAfter] }), sidetitle: getShortFullName(sidetitle) }) })] })));
19
+ return (_jsxs(GroupMenuItem, Object.assign({}, restProps, { disabled: disabled, checked: checked, children: [_jsx(StyledListItemIcon, { children: _jsx(ListItemAvatar, { children: _jsx(StyledAvatar, { children: type }) }) }), _jsx(Content, { children: _jsx(AutocompleteListItemLabelGroup, { title: title, subtitle: _jsxs(_Fragment, { children: [inn, "\u2022", notAfter] }), sidetitle: getShortFullName(sidetitle) }) })] })));
20
20
  };
@@ -1,17 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  /// <reference types="react" />
3
- export declare const AutocompleteListAvatarIcon: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").AvatarProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
+ export declare const StyledAvatar: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").AvatarProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  }, {}, {}>;
6
- export declare const AutocompleteListItemLabel: import("@emotion/styled").StyledComponent<{
6
+ export declare const Label: import("@emotion/styled").StyledComponent<{
7
7
  theme?: import("@emotion/react").Theme | undefined;
8
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
9
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- export declare const AutocompleteListItemSideLabel: import("@emotion/styled").StyledComponent<{
10
+ export declare const SideLabel: import("@emotion/styled").StyledComponent<{
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
12
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
13
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
- export declare const AutocompleteListItemLabelTitle: import("@emotion/styled").StyledComponent<import("@astral/ui").OverflowedProps & {
14
+ export declare const LabelTitle: import("@emotion/styled").StyledComponent<import("@astral/ui").OverflowedProps & {
15
15
  tooltipProps?: Omit<{
16
16
  components?: {
17
17
  Popper?: import("react").ElementType<import("@mui/material").PopperProps, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -347,7 +347,7 @@ export declare const AutocompleteListItemLabelTitle: import("@emotion/styled").S
347
347
  } & import("react").RefAttributes<HTMLElement> & {
348
348
  theme?: import("@emotion/react").Theme | undefined;
349
349
  }, {}, {}>;
350
- export declare const AutocompleteListItemIcon: import("@emotion/styled").StyledComponent<Omit<{
350
+ export declare const StyledListItemIcon: import("@emotion/styled").StyledComponent<Omit<{
351
351
  color?: string | undefined;
352
352
  content?: string | undefined;
353
353
  translate?: "yes" | "no" | undefined;
@@ -652,7 +652,7 @@ export declare const GroupMenuItem: import("@emotion/styled").StyledComponent<{
652
652
  } & {
653
653
  checked?: boolean | undefined;
654
654
  }, {}, {}>;
655
- export declare const AutocompleteListItemContent: import("@emotion/styled").StyledComponent<{
655
+ export declare const Content: import("@emotion/styled").StyledComponent<{
656
656
  autoFocus?: boolean | undefined;
657
657
  classes?: Partial<import("@mui/material").MenuItemClasses> | undefined;
658
658
  dense?: boolean | undefined;
@@ -1,25 +1,25 @@
1
1
  import { Avatar, ListItemIcon, MenuItem, OverflowTypography, styled, } from '@astral/ui';
2
- export const AutocompleteListAvatarIcon = styled(Avatar) `
2
+ export const StyledAvatar = styled(Avatar) `
3
3
  background-color: ${({ theme }) => theme.palette.primary[800]};
4
4
  `;
5
- export const AutocompleteListItemLabel = styled.div `
5
+ export const Label = styled.div `
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
 
9
9
  width: 80%;
10
10
  `;
11
- export const AutocompleteListItemSideLabel = styled.div `
11
+ export const SideLabel = styled.div `
12
12
  display: flex;
13
13
  align-self: start;
14
14
  justify-content: end;
15
15
 
16
16
  width: 20%;
17
17
  `;
18
- export const AutocompleteListItemLabelTitle = styled(OverflowTypography) `
18
+ export const LabelTitle = styled(OverflowTypography) `
19
19
  font-size: ${({ theme }) => theme.typography.fontSize};
20
20
  font-weight: ${({ theme }) => theme.typography.fontWeightBold};
21
21
  `;
22
- export const AutocompleteListItemIcon = styled(ListItemIcon) `
22
+ export const StyledListItemIcon = styled(ListItemIcon) `
23
23
  display: flex;
24
24
  place-self: center center;
25
25
 
@@ -33,7 +33,7 @@ export const GroupMenuItem = styled(MenuItem, {
33
33
 
34
34
  padding: 0;
35
35
  `;
36
- export const AutocompleteListItemContent = styled(MenuItem) `
36
+ export const Content = styled(MenuItem) `
37
37
  justify-content: space-around;
38
38
  justify-items: start;
39
39
 
@@ -2,11 +2,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { Button, Description, Tooltip } from '@astral/ui';
3
3
  import { InfoFillSm, OpenLinkOutlineMd } from '@astral/ui';
4
4
  import { WorkspaceInfoItem } from '../styles';
5
- import { CryptoproviderInfoIconWrapper } from './styles';
5
+ import { IconWrapper } from './styles';
6
6
  export const CryptoproviderInfo = ({ workspaceSetupInfo }) => {
7
7
  const getDescription = () => {
8
8
  if (!workspaceSetupInfo.isPluginInstalled) {
9
- return (_jsxs(_Fragment, { children: ["\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445", _jsx(Tooltip, { title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E \u043A\u0440\u0438\u043F\u0442\u043E\u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435 \n \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u201C\u041A\u0440\u0438\u043F\u0442\u043E\u041F\u0440\u043E \u042D\u0426\u041F Browser plug-in\u201D \u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.", children: _jsx(CryptoproviderInfoIconWrapper, { children: _jsx(InfoFillSm, {}) }) })] }));
9
+ return (_jsxs(_Fragment, { children: ["\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445", _jsx(Tooltip, { title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E \u043A\u0440\u0438\u043F\u0442\u043E\u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435\n \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u201C\u041A\u0440\u0438\u043F\u0442\u043E\u041F\u0440\u043E \u042D\u0426\u041F Browser plug-in\u201D \u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.", children: _jsx(IconWrapper, { children: _jsx(InfoFillSm, {}) }) })] }));
10
10
  }
11
11
  else if (workspaceSetupInfo.hasCryptoProvider) {
12
12
  return 'Установлен';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const CryptoproviderInfoIconWrapper: import("@emotion/styled").StyledComponent<{
2
+ export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,5 @@
1
1
  import { styled } from '@astral/ui';
2
- export const CryptoproviderInfoIconWrapper = styled.span `
2
+ export const IconWrapper = styled.span `
3
3
  display: inline-flex;
4
4
  margin-left: ${({ theme }) => theme.spacing(1)};
5
5
 
package/package.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@astral/features",
3
3
  "browser": "./index.js",
4
4
  "main": "./index.js",
5
- "version": "3.89.0",
5
+ "version": "3.89.1",
6
6
  "dependencies": {
7
- "@astral/ui": "^3.89.0",
7
+ "@astral/ui": "^3.89.1",
8
8
  "mobx": "^6.8.0",
9
9
  "mobx-react-lite": "^3.4.0",
10
10
  "@astral/cryptopro-cades": "^1.5.1"
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { ContentState, ErrorFillSm, IconButton, MenuGroup, ProductsFillMd, Typography, useMenu, } from '@astral/ui';
3
- import { IdentityProductSwitcherErrorContainer, IdentityProductSwitcherItem, IdentityProductSwitcherLogo, IdentityProductSwitcherMenu, TenantToggleButton, TenantsToggleButtonGroup, } from './styles';
3
+ import { ErrorContainer, Logo, StyledMenu, StyledMenuItem, TenantToggleButton, TenantsToggleButtonGroup, } from './styles';
4
4
  import { useLogic } from './hooks';
5
5
  export const ASTRAL_IDENTITY_DEFAULT_TENANT = 'astral';
6
6
  export const IdentityProductSwitcher = ({ identityUrl, }) => {
7
7
  const { open, anchorRef, handleOpenMenu, handleCloseMenu } = useMenu();
8
8
  const { isLoading, isError, tenantId, tenants, productList, handleChangeTenant, handleShowProducts, } = useLogic(identityUrl, handleOpenMenu);
9
- return (_jsxs(_Fragment, { children: [_jsx(IconButton, { ref: anchorRef, selected: open, variant: "text", onClick: handleShowProducts, children: _jsx(ProductsFillMd, {}) }), _jsx(IdentityProductSwitcherMenu, { 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: {
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(IdentityProductSwitcherErrorContainer, { container: true, autoFlow: "column", alignItems: "center", justifyContent: "center", 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" })] })),
11
+ title: (_jsxs(ErrorContainer, { container: true, autoFlow: "column", alignItems: "center", justifyContent: "center", 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: [Boolean(tenants === null || tenants === void 0 ? void 0 : tenants.length) && (_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
- return (_jsx("li", { children: _jsxs(IdentityProductSwitcherItem, { component: "a", href: product.url, children: [_jsx(IdentityProductSwitcherLogo, { src: product.logoUrl, color: product.color }), _jsx(Typography, { variant: "ui", color: "grey", colorIntensity: "900", children: product.name })] }) }, product.id));
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
15
  })] }) }) })] }));
16
16
  };
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
- export declare const IdentityProductSwitcherMenu: import("@emotion/styled").StyledComponent<import("@astral/ui").WithoutEmotionSpecific<import("@mui/material").MenuProps> & {
2
+ export declare const StyledMenu: import("@emotion/styled").StyledComponent<import("@astral/ui").WithoutEmotionSpecific<import("@mui/material").MenuProps> & {
3
3
  title?: string | undefined;
4
4
  } & {
5
5
  theme?: import("@emotion/react").Theme | undefined;
6
6
  }, {}, {}>;
7
- export declare const IdentityProductSwitcherItem: import("@mui/material").ExtendButtonBase<import("@mui/material").MenuItemTypeMap<{}, "li">>;
8
- export declare const IdentityProductSwitcherLogo: import("@emotion/styled").StyledComponent<{
7
+ export declare const StyledMenuItem: import("@mui/material").ExtendButtonBase<import("@mui/material").MenuItemTypeMap<{}, "li">>;
8
+ export declare const Logo: import("@emotion/styled").StyledComponent<{
9
9
  theme?: import("@emotion/react").Theme | undefined;
10
10
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
11
11
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
12
- export declare const IdentityProductSwitcherErrorContainer: import("@emotion/styled").StyledComponent<import("@astral/ui").GridContainerProps & import("@astral/ui").GridElementsProps & {
12
+ export declare const ErrorContainer: import("@emotion/styled").StyledComponent<import("@astral/ui").GridContainerProps & import("@astral/ui").GridElementsProps & {
13
13
  children?: import("react").ReactNode;
14
14
  } & import("react").RefAttributes<HTMLElement> & {
15
15
  theme?: import("@emotion/react").Theme | undefined;
@@ -1,5 +1,5 @@
1
1
  import { LegacyGrid, Menu, MenuItem, ToggleButton, ToggleButtonGroup, styled, } from '@astral/ui';
2
- export const IdentityProductSwitcherMenu = styled(Menu) `
2
+ export const StyledMenu = styled(Menu) `
3
3
  .MuiPaper-root > .MuiList-root {
4
4
  display: flex;
5
5
  flex-direction: column;
@@ -13,10 +13,10 @@ export const IdentityProductSwitcherMenu = styled(Menu) `
13
13
  `;
14
14
  // as typeof MenuItem необходим для возможности прокинуть component
15
15
  // https://github.com/mui/material-ui/issues/15695
16
- export const IdentityProductSwitcherItem = styled(MenuItem) `
16
+ export const StyledMenuItem = styled(MenuItem) `
17
17
  padding-left: ${({ theme }) => theme.spacing(6)};
18
18
  `;
19
- export const IdentityProductSwitcherLogo = styled('img', {
19
+ export const Logo = styled('img', {
20
20
  shouldForwardProp: (prop) => prop !== 'color',
21
21
  }) `
22
22
  width: 40px;
@@ -26,7 +26,7 @@ export const IdentityProductSwitcherLogo = styled('img', {
26
26
  background-color: ${({ color }) => color};
27
27
  border-radius: ${({ theme }) => theme.shape.small};
28
28
  `;
29
- export const IdentityProductSwitcherErrorContainer = styled(LegacyGrid) `
29
+ export const ErrorContainer = styled(LegacyGrid) `
30
30
  column-gap: ${({ theme }) => theme.spacing(2)};
31
31
 
32
32
  color: ${({ theme }) => theme.palette.error.dark};