@astral/features 4.0.0-alpha.8 → 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.
Files changed (63) hide show
  1. package/node/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.d.ts +1 -6
  2. package/node/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.js +3 -10
  3. package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
  4. package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +10 -0
  5. package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
  6. package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +14 -0
  7. package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
  8. package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +19 -0
  9. package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
  10. package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +14 -0
  11. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
  12. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +18 -0
  13. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
  14. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +119 -0
  15. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
  16. package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +54 -0
  17. package/node/productSwitcher/components/AstralProductSwitcher/utils/getFilteredProducts/getFilteredProducts.d.ts +1 -1
  18. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
  19. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +9 -0
  20. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
  21. package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +16 -0
  22. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
  23. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +18 -0
  24. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
  25. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +119 -0
  26. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
  27. package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +58 -0
  28. package/node/productSwitcher/components/IdentityProductSwitcher/styles.d.ts +3 -3
  29. package/node/productSwitcher/components/IdentityProductSwitcher/styles.js +7 -4
  30. package/node/productSwitcher/utils/getGroupsProducts/getGroupsProducts.d.ts +1 -1
  31. package/node/productSwitcher/utils/getIdentityProducts/getIdentityProducts.d.ts +1 -1
  32. package/package.json +2 -2
  33. package/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.d.ts +1 -6
  34. package/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.js +1 -8
  35. package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
  36. package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +6 -0
  37. package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
  38. package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +10 -0
  39. package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
  40. package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +16 -0
  41. package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
  42. package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +10 -0
  43. package/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
  44. package/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +2 -0
  45. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
  46. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +116 -0
  47. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
  48. package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +50 -0
  49. package/productSwitcher/components/AstralProductSwitcher/utils/getFilteredProducts/getFilteredProducts.d.ts +1 -1
  50. package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
  51. package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +5 -0
  52. package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
  53. package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +13 -0
  54. package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
  55. package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +2 -0
  56. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
  57. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +116 -0
  58. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
  59. package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +54 -0
  60. package/productSwitcher/components/IdentityProductSwitcher/styles.d.ts +3 -3
  61. package/productSwitcher/components/IdentityProductSwitcher/styles.js +7 -4
  62. package/productSwitcher/utils/getGroupsProducts/getGroupsProducts.d.ts +1 -1
  63. package/productSwitcher/utils/getIdentityProducts/getIdentityProducts.d.ts +1 -1
@@ -0,0 +1,116 @@
1
+ export const IDENTITY_URL = 'https://identity';
2
+ export const MOCK_IMAGE = 'data:image/svg+xml;base64, PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxl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wMDVDMTQuMzM4NyAyMy42MjMzIDE0LjExNDEgMjMuMTYwNCAxNC4zMTYxIDIyLjc3MTRDMTYuMTk1MiAxOS4xNTI1IDIxLjAxNzMgMTYuMzkxNiAyMy4zMzkzIDE1LjIyNTNDMjMuMzc5IDE1LjU0NTMgMjMuMzk5NiAxNS44NzE2IDIzLjM5OTYgMTYuMjAyOFoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik04LjUgOC41QzguNSA5LjMyODQzIDcuODI4NDMgMTAgNyAxMEM2LjE3MTU3IDEwIDUuNSA5LjMyODQzIDUuNSA4LjVDNS41IDcuNjcxNTcgNi4xNzE1NyA3IDcgN0M3LjgyODQzIDcgOC41IDcuNjcxNTcgOC41IDguNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=';
3
+ export const ASTRAL_PRODUCTS = [
4
+ {
5
+ id: '1',
6
+ name: 'Астрал Отчет 5.0',
7
+ productUrl: 'https://product1',
8
+ description: 'Астрал.Продукт 1',
9
+ shortDescription: 'Астрал.Продукт 1',
10
+ iconFileId: '1',
11
+ logoUrl: MOCK_IMAGE,
12
+ backgroundHexColor: '#2e77ff',
13
+ tenantId: 'astral',
14
+ },
15
+ {
16
+ id: '2',
17
+ name: 'Астрал.ЭДО',
18
+ productUrl: 'https://product2',
19
+ description: 'Астрал.Продукт2',
20
+ shortDescription: 'Астрал.Продукт2',
21
+ iconFileId: '2',
22
+ logoUrl: MOCK_IMAGE,
23
+ backgroundHexColor: '#33adf2',
24
+ tenantId: 'astral',
25
+ },
26
+ {
27
+ id: '3',
28
+ name: 'Астрал iKЭДО',
29
+ productUrl: 'https://product3',
30
+ description: 'Астрал.Продукт3',
31
+ shortDescription: 'Астрал.Продукт3',
32
+ iconFileId: '3',
33
+ logoUrl: MOCK_IMAGE,
34
+ backgroundHexColor: '#755afd',
35
+ tenantId: 'astral',
36
+ },
37
+ {
38
+ id: '4',
39
+ name: 'Астрал.ОФД',
40
+ productUrl: 'https://product4',
41
+ description: 'Астрал.Продукт4',
42
+ shortDescription: 'Астрал.Продукт4',
43
+ iconFileId: '4',
44
+ logoUrl: MOCK_IMAGE,
45
+ backgroundHexColor: '#00b2ff',
46
+ tenantId: 'astral',
47
+ },
48
+ {
49
+ id: '5',
50
+ name: 'Астрал Доверенность',
51
+ productUrl: 'https://product5',
52
+ description: 'Астрал.Продукт5',
53
+ shortDescription: 'Астрал.Продукт5',
54
+ iconFileId: '5',
55
+ logoUrl: MOCK_IMAGE,
56
+ backgroundHexColor: '#7856ff',
57
+ tenantId: 'astral',
58
+ },
59
+ {
60
+ id: '6',
61
+ name: 'Личный Кабинет',
62
+ productUrl: 'https://product4',
63
+ description: 'Астрал.Продукт6',
64
+ shortDescription: 'Астрал.Продукт6',
65
+ iconFileId: '6',
66
+ logoUrl: MOCK_IMAGE,
67
+ backgroundHexColor: '#00b2ff',
68
+ tenantId: 'astral',
69
+ },
70
+ {
71
+ id: '7',
72
+ name: 'Личный Кабинет Партнёра',
73
+ productUrl: 'https://product5',
74
+ description: 'Астрал.Продукт7',
75
+ shortDescription: 'Астрал.Продукт7',
76
+ iconFileId: '7',
77
+ logoUrl: MOCK_IMAGE,
78
+ backgroundHexColor: '#7856ff',
79
+ tenantId: 'astral',
80
+ },
81
+ ];
82
+ export const ECO_PRODUCTS = [
83
+ {
84
+ id: '6',
85
+ name: 'Экосистема-Продукт 1',
86
+ productUrl: 'https://eco1',
87
+ description: 'Экосистема-Продукт1',
88
+ shortDescription: 'Экосистема-Продукт1',
89
+ iconFileId: 'test',
90
+ logoUrl: MOCK_IMAGE,
91
+ backgroundHexColor: '#2e77ff',
92
+ tenantId: 'eco',
93
+ },
94
+ {
95
+ id: '7',
96
+ name: 'Экосистема-Продукт 2',
97
+ productUrl: 'https://eco2',
98
+ description: 'Экосистема-Продукт2',
99
+ shortDescription: 'Экосистема-Продукт2',
100
+ iconFileId: 'test',
101
+ logoUrl: MOCK_IMAGE,
102
+ backgroundHexColor: '#7756FF',
103
+ tenantId: 'eco',
104
+ },
105
+ {
106
+ id: '8',
107
+ name: 'Экосистема-Продукт 3',
108
+ productUrl: 'https://eco3',
109
+ description: 'Экосистема-Продукт3',
110
+ shortDescription: 'Экосистема-Продукт3',
111
+ iconFileId: 'test',
112
+ logoUrl: MOCK_IMAGE,
113
+ backgroundHexColor: '#0397b3',
114
+ tenantId: 'eco',
115
+ },
116
+ ];
@@ -0,0 +1,47 @@
1
+ import type { MockRequest } from './mockData';
2
+ export declare const createProductsMockResponse: ({ searchParams }: MockRequest) => {
3
+ data: {
4
+ id: string;
5
+ name: string;
6
+ productUrl: string;
7
+ description: string;
8
+ shortDescription: string;
9
+ iconFileId: string;
10
+ logoUrl: string;
11
+ backgroundHexColor: string;
12
+ tenantId: string;
13
+ }[];
14
+ meta: {
15
+ totalCount: number;
16
+ };
17
+ };
18
+ export declare const MOCK_FETCH_IDENTITY_PRODUCTS: {
19
+ url: string;
20
+ method: string;
21
+ status: number;
22
+ response: ({ searchParams }: MockRequest) => {
23
+ data: {
24
+ id: string;
25
+ name: string;
26
+ productUrl: string;
27
+ description: string;
28
+ shortDescription: string;
29
+ iconFileId: string;
30
+ logoUrl: string;
31
+ backgroundHexColor: string;
32
+ tenantId: string;
33
+ }[];
34
+ meta: {
35
+ totalCount: number;
36
+ };
37
+ };
38
+ }[];
39
+ export declare const MOCK_FETCH_IDENTITY_TENANTS: {
40
+ url: string;
41
+ method: string;
42
+ status: number;
43
+ response: {
44
+ id: string;
45
+ name: string;
46
+ }[];
47
+ }[];
@@ -0,0 +1,54 @@
1
+ import { ASTRAL_PRODUCTS, ECO_PRODUCTS, IDENTITY_URL } from './mockData';
2
+ export const createProductsMockResponse = ({ searchParams }) => {
3
+ switch (searchParams.tenantId) {
4
+ case 'astral': {
5
+ return {
6
+ data: ASTRAL_PRODUCTS,
7
+ meta: {
8
+ totalCount: ASTRAL_PRODUCTS.length,
9
+ },
10
+ };
11
+ }
12
+ case 'eco': {
13
+ return {
14
+ data: ECO_PRODUCTS,
15
+ meta: {
16
+ totalCount: ECO_PRODUCTS.length,
17
+ },
18
+ };
19
+ }
20
+ default: {
21
+ return {
22
+ data: [],
23
+ meta: {
24
+ totalCount: 0,
25
+ },
26
+ };
27
+ }
28
+ }
29
+ };
30
+ export const MOCK_FETCH_IDENTITY_PRODUCTS = [
31
+ {
32
+ url: `${IDENTITY_URL}/api/products/widget?tenantId=*`,
33
+ method: 'GET',
34
+ status: 200,
35
+ response: createProductsMockResponse,
36
+ },
37
+ ];
38
+ export const MOCK_FETCH_IDENTITY_TENANTS = [
39
+ {
40
+ url: `${IDENTITY_URL}/api/tenants/widget`,
41
+ method: 'GET',
42
+ status: 200,
43
+ response: [
44
+ {
45
+ id: 'astral',
46
+ name: 'Астрал',
47
+ },
48
+ {
49
+ id: 'eco',
50
+ name: 'Экосистема',
51
+ },
52
+ ],
53
+ },
54
+ ];
@@ -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[]>;