@astral/features 4.0.0-alpha.9 → 4.0.0

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.
@@ -10,14 +10,9 @@ export type AstralProductSwitcherType = {
10
10
  filterBy?: ProductFilterType;
11
11
  /** Код для фильтрации */
12
12
  code?: string;
13
- /**
14
- * Идентификатор экосистемы
15
- * @deprecated
16
- * */
17
- tenantId?: string;
18
13
  /**
19
14
  * Альтернативная функция для фильтрации продуктов
20
15
  */
21
16
  filter?: ProductSwitcherProps['filter'];
22
17
  };
23
- export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, tenantId, }: AstralProductSwitcherType) => JSX.Element;
18
+ export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, }: AstralProductSwitcherType) => JSX.Element;
@@ -13,22 +13,15 @@ exports.AstralProductSwitcher = void 0;
13
13
  const jsx_runtime_1 = require("react/jsx-runtime");
14
14
  const ui_1 = require("@astral/ui");
15
15
  const react_1 = require("react");
16
- const utils_1 = require("../../utils");
17
16
  const enums_1 = require("./enums");
18
- const utils_2 = require("./utils");
19
- const AstralProductSwitcher = ({ identityUrl, filterBy = enums_1.ProductFilterType.Tenant, code = 'astral', filter, tenantId, }) => {
17
+ const utils_1 = require("./utils");
18
+ const AstralProductSwitcher = ({ identityUrl, filterBy = enums_1.ProductFilterType.Tenant, code = 'astral', filter, }) => {
20
19
  const [products, setProducts] = (0, react_1.useState)([]);
21
20
  const handleGetProducts = () => __awaiter(void 0, void 0, void 0, function* () {
22
21
  if (products.length) {
23
22
  return products;
24
23
  }
25
- // Это заглушка для обратной совместимости, убрать после релиза мажорной версии
26
- if (tenantId) {
27
- const productsList = yield (0, utils_1.getIdentityProducts)(identityUrl, tenantId);
28
- setProducts(productsList);
29
- return productsList;
30
- }
31
- const filteredProductsList = yield (0, utils_2.getFilteredProducts)(identityUrl, filterBy, code);
24
+ const filteredProductsList = yield (0, utils_1.getFilteredProducts)(identityUrl, filterBy, code);
32
25
  setProducts(filteredProductsList);
33
26
  return filteredProductsList;
34
27
  });
@@ -4,4 +4,4 @@
4
4
  * @param filterBy - тип фильтрации продуктов
5
5
  * @param code - код-значение для фильтрации
6
6
  */
7
- export declare const getFilteredProducts: (identityUrl: string, filterBy: string, code: string) => Promise<import("@astral/components").WidgetProduct[]>;
7
+ export declare const getFilteredProducts: (identityUrl: string, filterBy: string, code: string) => Promise<import("@astral/ui").WidgetProduct[]>;
@@ -15,12 +15,12 @@ export declare const Logo: import("@emotion/styled").StyledComponent<{
15
15
  theme?: import("@emotion/react").Theme | undefined;
16
16
  as?: import("react").ElementType<any> | undefined;
17
17
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
18
- export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/components/src/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
18
+ export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui/src/components/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
19
19
  theme?: import("@emotion/react").Theme | undefined;
20
- } & import("@astral/components/src/Grid/styles").StyledGridProps, {}, {}>;
20
+ } & import("@astral/ui/src/components/Grid/styles").StyledGridProps, {}, {}>;
21
21
  export declare const TenantsToggleButtonGroup: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
22
22
  theme?: import("@emotion/react").Theme | undefined;
23
23
  }, {}, {}>;
24
- export declare const TenantToggleButton: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
24
+ export declare const TenantToggleButton: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui/src/components/ToggleButton/types").ToggleButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
25
25
  theme?: import("@emotion/react").Theme | undefined;
26
26
  }, {}, {}>;
@@ -17,14 +17,17 @@ exports.StyledMenu = (0, ui_1.styled)(ui_1.Menu) `
17
17
  // as typeof MenuItem необходим для возможности прокинуть component
18
18
  // https://github.com/mui/material-ui/issues/15695
19
19
  exports.StyledMenuItem = (0, ui_1.styled)(ui_1.MenuItem) `
20
- padding-left: ${({ theme }) => theme.spacing(6)};
20
+ &.MuiMenuItem-gutters {
21
+ min-height: 56px;
22
+ padding-left: ${({ theme }) => theme.spacing(4)};
23
+ }
21
24
  `;
22
25
  exports.Logo = (0, ui_1.styled)('img', {
23
26
  shouldForwardProp: (prop) => prop !== 'color',
24
27
  }) `
25
- width: 40px;
26
- height: 40px;
27
- margin-right: ${({ theme }) => theme.spacing(4)};
28
+ width: 32px;
29
+ height: 32px;
30
+ margin-right: ${({ theme }) => theme.spacing(2)};
28
31
 
29
32
  background-color: ${({ color }) => color};
30
33
  border-radius: ${({ theme }) => theme.shape.small};
@@ -3,4 +3,4 @@
3
3
  * @param identityUrl - адрес identity
4
4
  * @param group - код группы
5
5
  */
6
- export declare const getGroupsProducts: (identityUrl: string, group: string) => Promise<import("@astral/components").WidgetProduct[]>;
6
+ export declare const getGroupsProducts: (identityUrl: string, group: string) => Promise<import("@astral/ui").WidgetProduct[]>;
@@ -3,4 +3,4 @@
3
3
  * @param identityUrl - адрес identity
4
4
  * @param tenant - код экосистемы
5
5
  */
6
- export declare const getIdentityProducts: (identityUrl: string, tenant?: string) => Promise<import("@astral/components").WidgetProduct[]>;
6
+ export declare const getIdentityProducts: (identityUrl: string, tenant?: string) => Promise<import("@astral/ui").WidgetProduct[]>;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@astral/features",
3
3
  "main": "./node/index.js",
4
- "version": "4.0.0-alpha.9",
4
+ "version": "4.0.0",
5
5
  "dependencies": {
6
- "@astral/ui": "4.0.0-alpha.9",
6
+ "@astral/ui": "4.0.0",
7
7
  "mobx": "^6.8.0",
8
8
  "mobx-react-lite": "^3.4.0",
9
9
  "@astral/cryptopro-cades": "^1.5.1"
@@ -10,14 +10,9 @@ export type AstralProductSwitcherType = {
10
10
  filterBy?: ProductFilterType;
11
11
  /** Код для фильтрации */
12
12
  code?: string;
13
- /**
14
- * Идентификатор экосистемы
15
- * @deprecated
16
- * */
17
- tenantId?: string;
18
13
  /**
19
14
  * Альтернативная функция для фильтрации продуктов
20
15
  */
21
16
  filter?: ProductSwitcherProps['filter'];
22
17
  };
23
- export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, tenantId, }: AstralProductSwitcherType) => JSX.Element;
18
+ export declare const AstralProductSwitcher: ({ identityUrl, filterBy, code, filter, }: AstralProductSwitcherType) => JSX.Element;
@@ -10,21 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { ProductSwitcher, } from '@astral/ui';
12
12
  import { useState } from 'react';
13
- import { getIdentityProducts } from '../../utils';
14
13
  import { ProductFilterType } from './enums';
15
14
  import { getFilteredProducts } from './utils';
16
- export const AstralProductSwitcher = ({ identityUrl, filterBy = ProductFilterType.Tenant, code = 'astral', filter, tenantId, }) => {
15
+ export const AstralProductSwitcher = ({ identityUrl, filterBy = ProductFilterType.Tenant, code = 'astral', filter, }) => {
17
16
  const [products, setProducts] = useState([]);
18
17
  const handleGetProducts = () => __awaiter(void 0, void 0, void 0, function* () {
19
18
  if (products.length) {
20
19
  return products;
21
20
  }
22
- // Это заглушка для обратной совместимости, убрать после релиза мажорной версии
23
- if (tenantId) {
24
- const productsList = yield getIdentityProducts(identityUrl, tenantId);
25
- setProducts(productsList);
26
- return productsList;
27
- }
28
21
  const filteredProductsList = yield getFilteredProducts(identityUrl, filterBy, code);
29
22
  setProducts(filteredProductsList);
30
23
  return filteredProductsList;
@@ -4,4 +4,4 @@
4
4
  * @param filterBy - тип фильтрации продуктов
5
5
  * @param code - код-значение для фильтрации
6
6
  */
7
- export declare const getFilteredProducts: (identityUrl: string, filterBy: string, code: string) => Promise<import("@astral/components").WidgetProduct[]>;
7
+ export declare const getFilteredProducts: (identityUrl: string, filterBy: string, code: string) => Promise<import("@astral/ui").WidgetProduct[]>;
@@ -15,12 +15,12 @@ export declare const Logo: import("@emotion/styled").StyledComponent<{
15
15
  theme?: import("@emotion/react").Theme | undefined;
16
16
  as?: import("react").ElementType<any> | undefined;
17
17
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
18
- export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/components/src/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
18
+ export declare const ErrorContainer: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui/src/components/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
19
19
  theme?: import("@emotion/react").Theme | undefined;
20
- } & import("@astral/components/src/Grid/styles").StyledGridProps, {}, {}>;
20
+ } & import("@astral/ui/src/components/Grid/styles").StyledGridProps, {}, {}>;
21
21
  export declare const TenantsToggleButtonGroup: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
22
22
  theme?: import("@emotion/react").Theme | undefined;
23
23
  }, {}, {}>;
24
- export declare const TenantToggleButton: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui").ToggleButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
24
+ export declare const TenantToggleButton: import("@emotion/styled").StyledComponent<Omit<import("@astral/ui/src/components/ToggleButton/types").ToggleButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
25
25
  theme?: import("@emotion/react").Theme | undefined;
26
26
  }, {}, {}>;
@@ -14,14 +14,17 @@ export const StyledMenu = styled(Menu) `
14
14
  // as typeof MenuItem необходим для возможности прокинуть component
15
15
  // https://github.com/mui/material-ui/issues/15695
16
16
  export const StyledMenuItem = styled(MenuItem) `
17
- padding-left: ${({ theme }) => theme.spacing(6)};
17
+ &.MuiMenuItem-gutters {
18
+ min-height: 56px;
19
+ padding-left: ${({ theme }) => theme.spacing(4)};
20
+ }
18
21
  `;
19
22
  export const Logo = styled('img', {
20
23
  shouldForwardProp: (prop) => prop !== 'color',
21
24
  }) `
22
- width: 40px;
23
- height: 40px;
24
- margin-right: ${({ theme }) => theme.spacing(4)};
25
+ width: 32px;
26
+ height: 32px;
27
+ margin-right: ${({ theme }) => theme.spacing(2)};
25
28
 
26
29
  background-color: ${({ color }) => color};
27
30
  border-radius: ${({ theme }) => theme.shape.small};
@@ -3,4 +3,4 @@
3
3
  * @param identityUrl - адрес identity
4
4
  * @param group - код группы
5
5
  */
6
- export declare const getGroupsProducts: (identityUrl: string, group: string) => Promise<import("@astral/components").WidgetProduct[]>;
6
+ export declare const getGroupsProducts: (identityUrl: string, group: string) => Promise<import("@astral/ui").WidgetProduct[]>;
@@ -3,4 +3,4 @@
3
3
  * @param identityUrl - адрес identity
4
4
  * @param tenant - код экосистемы
5
5
  */
6
- export declare const getIdentityProducts: (identityUrl: string, tenant?: string) => Promise<import("@astral/components").WidgetProduct[]>;
6
+ export declare const getIdentityProducts: (identityUrl: string, tenant?: string) => Promise<import("@astral/ui").WidgetProduct[]>;