@astral/ui 4.53.1 → 4.54.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 (49) hide show
  1. package/components/Alert/Alert.js +27 -2
  2. package/components/Alert/constants.d.ts +7 -0
  3. package/components/Alert/constants.js +7 -0
  4. package/components/Alert/styles.d.ts +0 -19
  5. package/components/Alert/styles.js +219 -112
  6. package/components/ComplianceStatus/styles.js +0 -1
  7. package/components/DashboardAlert/DashboardAlert.js +4 -2
  8. package/components/DashboardAlert/constants.d.ts +3 -0
  9. package/components/DashboardAlert/constants.js +4 -0
  10. package/components/DashboardAlert/styles.js +22 -20
  11. package/icons/MaxFillMd/MaxFillMd.d.ts +3 -0
  12. package/icons/MaxFillMd/MaxFillMd.js +3 -0
  13. package/icons/MaxFillMd/index.d.ts +1 -0
  14. package/icons/MaxFillMd/index.js +1 -0
  15. package/icons/MaxFillMd/public.d.ts +1 -0
  16. package/icons/MaxFillMd/public.js +1 -0
  17. package/icons/MaxMonochromeFillMd/MaxMonochromeFillMd.d.ts +3 -0
  18. package/icons/MaxMonochromeFillMd/MaxMonochromeFillMd.js +3 -0
  19. package/icons/MaxMonochromeFillMd/index.d.ts +1 -0
  20. package/icons/MaxMonochromeFillMd/index.js +1 -0
  21. package/icons/MaxMonochromeFillMd/public.d.ts +1 -0
  22. package/icons/MaxMonochromeFillMd/public.js +1 -0
  23. package/icons/index.d.ts +2 -0
  24. package/icons/index.js +2 -0
  25. package/node/components/Alert/Alert.js +27 -2
  26. package/node/components/Alert/constants.d.ts +7 -0
  27. package/node/components/Alert/constants.js +7 -0
  28. package/node/components/Alert/styles.d.ts +0 -19
  29. package/node/components/Alert/styles.js +219 -112
  30. package/node/components/ComplianceStatus/styles.js +0 -1
  31. package/node/components/DashboardAlert/DashboardAlert.js +4 -2
  32. package/node/components/DashboardAlert/constants.d.ts +3 -0
  33. package/node/components/DashboardAlert/constants.js +7 -0
  34. package/node/components/DashboardAlert/styles.js +22 -20
  35. package/node/icons/MaxFillMd/MaxFillMd.d.ts +3 -0
  36. package/node/icons/MaxFillMd/MaxFillMd.js +7 -0
  37. package/node/icons/MaxFillMd/index.d.ts +1 -0
  38. package/node/icons/MaxFillMd/index.js +5 -0
  39. package/node/icons/MaxFillMd/public.d.ts +1 -0
  40. package/node/icons/MaxFillMd/public.js +5 -0
  41. package/node/icons/MaxMonochromeFillMd/MaxMonochromeFillMd.d.ts +3 -0
  42. package/node/icons/MaxMonochromeFillMd/MaxMonochromeFillMd.js +7 -0
  43. package/node/icons/MaxMonochromeFillMd/index.d.ts +1 -0
  44. package/node/icons/MaxMonochromeFillMd/index.js +5 -0
  45. package/node/icons/MaxMonochromeFillMd/public.d.ts +1 -0
  46. package/node/icons/MaxMonochromeFillMd/public.js +5 -0
  47. package/node/icons/index.d.ts +2 -0
  48. package/node/icons/index.js +9 -5
  49. package/package.json +1 -1
package/icons/index.js CHANGED
@@ -65,6 +65,8 @@ export { FacebookFillMd } from './FacebookFillMd';
65
65
  export { GoogleFillMd } from './GoogleFillMd';
66
66
  export { GoogleMonochromeFillMd } from './GoogleMonochromeFillMd';
67
67
  export { JacartaFillMd } from './JacartaFillMd';
68
+ export { MaxFillMd } from './MaxFillMd';
69
+ export { MaxMonochromeFillMd } from './MaxMonochromeFillMd';
68
70
  export { OkFillMd } from './OkFillMd';
69
71
  export { OkMonochromeFillMd } from './OkMonochromeFillMd';
70
72
  export { RutokenFillMd } from './RutokenFillMd';
@@ -10,9 +10,29 @@ const SuccessFillMd_1 = require("../../icons/SuccessFillMd");
10
10
  const WarningFillMd_1 = require("../../icons/WarningFillMd");
11
11
  const Collapse_1 = require("../Collapse");
12
12
  const classNames_1 = require("../utils/classNames");
13
+ const cva_1 = require("../utils/cva");
13
14
  const constants_1 = require("./constants");
14
15
  const styles_1 = require("./styles");
15
16
  const useLogic_1 = require("./useLogic");
17
+ const alertCva = (0, cva_1.cva)(constants_1.alertClassnames.root, {
18
+ variants: {
19
+ hasTitle: {
20
+ true: constants_1.alertClassnames.hasTitle,
21
+ },
22
+ hasCloseButton: {
23
+ true: constants_1.alertClassnames.hasCloseButton,
24
+ },
25
+ hasActions: {
26
+ true: constants_1.alertClassnames.hasActions,
27
+ },
28
+ severity: {
29
+ info: constants_1.alertClassnames.severityInfo,
30
+ error: constants_1.alertClassnames.severityError,
31
+ success: constants_1.alertClassnames.severitySuccess,
32
+ warning: constants_1.alertClassnames.severityWarning,
33
+ },
34
+ },
35
+ });
16
36
  exports.Alert = (0, react_1.forwardRef)(({ children, title, closeText = 'Скрыть', display = true, actions, onClose, severity = 'info', style, className, icon, unmountOnExit, }, ref) => {
17
37
  const { shouldRenderParagraph } = (0, useLogic_1.useLogic)({ children });
18
38
  const renderCloseButton = () => {
@@ -25,7 +45,12 @@ exports.Alert = (0, react_1.forwardRef)(({ children, title, closeText = 'Скр
25
45
  success: (0, jsx_runtime_1.jsx)(SuccessFillMd_1.SuccessFillMd, {}),
26
46
  warning: (0, jsx_runtime_1.jsx)(WarningFillMd_1.WarningFillMd, {}),
27
47
  };
28
- return ((0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { "$hasTitle": Boolean(title), "$severity": severity, "$hasCloseButton": Boolean(onClose), className: constants_1.alertClassnames.iconWrapper, children: icon ?? iconMapping[severity] }));
48
+ return ((0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.alertClassnames.iconWrapper, children: icon ?? iconMapping[severity] }));
29
49
  };
30
- return ((0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { in: display, unmountOnExit: unmountOnExit, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { style: style, className: (0, classNames_1.classNames)(className, constants_1.alertClassnames.root), role: "alert", ref: ref, "$severity": severity, "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), "$hasActions": Boolean(actions), children: [(0, jsx_runtime_1.jsxs)(styles_1.Content, { "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), className: constants_1.alertClassnames.contentWrapper, children: [renderIcon(), title && ((0, jsx_runtime_1.jsx)(styles_1.Title, { variant: "h5", "$hasCloseButton": Boolean(onClose), className: constants_1.alertClassnames.title, children: title })), onClose && renderCloseButton(), (0, jsx_runtime_1.jsx)(styles_1.StyledTypography, { component: shouldRenderParagraph ? 'p' : 'div', "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), "$hasActions": Boolean(actions), className: constants_1.alertClassnames.content, children: children })] }), actions && ((0, jsx_runtime_1.jsx)(styles_1.StyledGrid, { container: true, spacing: 4, children: actions }))] }) }));
50
+ return ((0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { in: display, unmountOnExit: unmountOnExit, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { style: style, className: (0, classNames_1.classNames)(alertCva({
51
+ hasTitle: Boolean(title),
52
+ hasCloseButton: Boolean(onClose),
53
+ hasActions: Boolean(actions),
54
+ severity,
55
+ }), className), role: "alert", ref: ref, children: [(0, jsx_runtime_1.jsxs)(styles_1.Content, { className: constants_1.alertClassnames.contentWrapper, children: [renderIcon(), title && ((0, jsx_runtime_1.jsx)(styles_1.Title, { variant: "h5", className: constants_1.alertClassnames.title, children: title })), onClose && renderCloseButton(), (0, jsx_runtime_1.jsx)(styles_1.StyledTypography, { component: shouldRenderParagraph ? 'p' : 'div', className: constants_1.alertClassnames.content, children: children })] }), actions && ((0, jsx_runtime_1.jsx)(styles_1.StyledGrid, { container: true, spacing: 4, children: actions }))] }) }));
31
56
  });
@@ -5,4 +5,11 @@ export declare const alertClassnames: {
5
5
  closeButton: string;
6
6
  contentWrapper: string;
7
7
  content: string;
8
+ hasTitle: string;
9
+ hasCloseButton: string;
10
+ hasActions: string;
11
+ severityInfo: string;
12
+ severityError: string;
13
+ severitySuccess: string;
14
+ severityWarning: string;
8
15
  };
@@ -9,4 +9,11 @@ exports.alertClassnames = {
9
9
  closeButton: (0, createUIKitClassname_1.createUIKitClassname)('alert__close-button'),
10
10
  contentWrapper: (0, createUIKitClassname_1.createUIKitClassname)('alert__content-wrapper'),
11
11
  content: (0, createUIKitClassname_1.createUIKitClassname)('alert__content'),
12
+ hasTitle: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-title'),
13
+ hasCloseButton: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-close-button'),
14
+ hasActions: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-actions'),
15
+ severityInfo: (0, createUIKitClassname_1.createUIKitClassname)('alert_severity_info'),
16
+ severityError: (0, createUIKitClassname_1.createUIKitClassname)('alert_severity_error'),
17
+ severitySuccess: (0, createUIKitClassname_1.createUIKitClassname)('alert_severity_success'),
18
+ severityWarning: (0, createUIKitClassname_1.createUIKitClassname)('alert_severity_warning'),
12
19
  };
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { AlertSeverity } from './types';
3
2
  export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  } & import("../Grid/styles").StyledGridProps, {}, {}>;
@@ -15,26 +14,14 @@ export declare const StyledIconButton: import("@emotion/styled/dist/declarations
15
14
  export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
16
15
  theme?: import("@emotion/react").Theme | undefined;
17
16
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
18
- } & {
19
- $hasTitle?: boolean | undefined;
20
- $severity: AlertSeverity;
21
- $hasCloseButton?: boolean | undefined;
22
- $hasActions?: boolean | undefined;
23
17
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
18
  export declare const IconWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
25
19
  theme?: import("@emotion/react").Theme | undefined;
26
20
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
27
- } & {
28
- $severity: AlertSeverity;
29
- $hasTitle?: boolean | undefined;
30
- $hasCloseButton?: boolean | undefined;
31
21
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
32
22
  export declare const Content: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
33
23
  theme?: import("@emotion/react").Theme | undefined;
34
24
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
35
- } & {
36
- $hasTitle: boolean;
37
- $hasCloseButton?: boolean | undefined;
38
25
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
39
26
  export declare const StyledTypography: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Typography/types").TypographyPropsBase & {
40
27
  color?: import("../Typography").TypographyColor | undefined;
@@ -45,10 +32,6 @@ export declare const StyledTypography: import("@emotion/styled/dist/declarations
45
32
  withoutCalt?: boolean | undefined;
46
33
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
47
34
  theme?: import("@emotion/react").Theme | undefined;
48
- } & {
49
- $hasTitle?: boolean | undefined;
50
- $hasCloseButton?: boolean | undefined;
51
- $hasActions?: boolean | undefined;
52
35
  }, {}, {}>;
53
36
  export declare const Title: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Typography/types").TypographyPropsBase & {
54
37
  color?: import("../Typography").TypographyColor | undefined;
@@ -59,6 +42,4 @@ export declare const Title: import("@emotion/styled/dist/declarations/src/types"
59
42
  withoutCalt?: boolean | undefined;
60
43
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
61
44
  theme?: import("@emotion/react").Theme | undefined;
62
- } & {
63
- $hasCloseButton?: boolean | undefined;
64
45
  }, {}, {}>;
@@ -6,87 +6,7 @@ const IconButton_1 = require("../IconButton");
6
6
  const SvgIcon_1 = require("../SvgIcon");
7
7
  const styled_1 = require("../styled");
8
8
  const Typography_1 = require("../Typography");
9
- const getBgColor = (theme, severity) => {
10
- const bgColors = {
11
- info: theme.palette.primary[100],
12
- success: theme.palette.success[100],
13
- error: theme.palette.error[100],
14
- warning: theme.palette.warning[100],
15
- };
16
- return bgColors[severity];
17
- };
18
- const getBorderColor = (theme, severity) => {
19
- const borderColors = {
20
- info: theme.palette.primary[300],
21
- success: theme.palette.success[300],
22
- error: theme.palette.error[300],
23
- warning: theme.palette.warning[300],
24
- };
25
- return borderColors[severity];
26
- };
27
- const getIconColor = (theme, severity) => {
28
- const iconColor = {
29
- info: theme.palette.primary[800],
30
- success: theme.palette.success[800],
31
- error: theme.palette.error[800],
32
- warning: theme.palette.warning[800],
33
- };
34
- return iconColor[severity];
35
- };
36
- const getPadding = (theme, hasActions = false, hasCloseButton = false, hasTitle = false) => {
37
- const paddingMap = {
38
- '111': [6, 6, 8, 8],
39
- '110': [6, 8, 8, 8],
40
- '101': [6, 6, 6, 8],
41
- '100': [6, 8, 6, 8],
42
- '011': [6, 6, 8, 8],
43
- '010': [9, 8, 8, 8],
44
- '001': [6, 6, 6, 8],
45
- '000': [9, 8, 9, 8],
46
- };
47
- const key = `${hasTitle ? 1 : 0}${hasActions ? 1 : 0}${hasCloseButton ? 1 : 0}`;
48
- const [top, right, bottom, left] = paddingMap[key];
49
- return theme.microSpacing(top, right, bottom, left);
50
- };
51
- const getMobilePadding = (theme, hasActions = false, hasCloseButton = false, hasTitle = false) => {
52
- const mobilePaddingMap = {
53
- '111': [4, 4, 10, 8],
54
- '110': [8, 8, 10, 8],
55
- '101': [4, 4, 8, 8],
56
- '100': [8, 8, 8, 8],
57
- '011': [4, 4, 10, 8],
58
- '010': [8, 8, 10, 8],
59
- '001': [4, 4, 9, 8],
60
- '000': [8, 8, 9, 8],
61
- };
62
- const key = `${hasTitle ? 1 : 0}${hasActions ? 1 : 0}${hasCloseButton ? 1 : 0}`;
63
- const [top, right, bottom, left] = mobilePaddingMap[key];
64
- return theme.microSpacing(top, right, bottom, left);
65
- };
66
- const getMobileContentPadding = (theme, hasTitle, hasCloseButton) => {
67
- if (hasTitle) {
68
- return '0';
69
- }
70
- return hasCloseButton ? theme.microSpacing(5) : theme.microSpacing(1);
71
- };
72
- const getContentPadding = (theme, hasTitle, hasCloseButton, hasActions) => {
73
- if (hasTitle || !hasCloseButton) {
74
- return '0';
75
- }
76
- return hasActions ? theme.microSpacing(3, 0, 0) : theme.microSpacing(3, 0);
77
- };
78
- const getMobileIconPadding = (theme, hasTitle, hasCloseButton) => {
79
- if (hasTitle || !hasCloseButton) {
80
- return '0';
81
- }
82
- return theme.spacing(2);
83
- };
84
- const getContentGridRows = (hasTitle, hasCloseButton) => {
85
- if (hasCloseButton) {
86
- return hasTitle ? 'minmax(32px, auto) auto' : 'minmax(32px, auto)';
87
- }
88
- return hasTitle ? 'minmax(32px, auto) auto' : 'minmax(20px, auto)';
89
- };
9
+ const constants_1 = require("./constants");
90
10
  exports.StyledGrid = (0, styled_1.styled)(Grid_1.Grid) `
91
11
  grid-auto-flow: column;
92
12
  grid-column: 2 / -1;
@@ -103,32 +23,223 @@ exports.StyledIconButton = (0, styled_1.styled)(IconButton_1.IconButton) `
103
23
  exports.Wrapper = styled_1.styled.div `
104
24
  display: grid;
105
25
  grid-template-columns: 20px 1fr 32px;
106
- gap: ${({ theme, $hasTitle }) => $hasTitle ? theme.spacing(3, 2) : theme.microSpacing(7, 4)};
26
+ gap: ${({ theme }) => theme.microSpacing(7, 4)};
107
27
 
108
- padding: ${({ theme, $hasCloseButton, $hasActions, $hasTitle }) => getPadding(theme, $hasActions, $hasCloseButton, $hasTitle)};
28
+ padding: ${({ theme }) => theme.microSpacing(9, 8, 9, 8)};
109
29
 
110
- background-color: ${({ theme, $severity }) => getBgColor(theme, $severity)};
111
- border: 1px solid
112
- ${({ theme, $severity }) => getBorderColor(theme, $severity)};
30
+ border: 1px solid transparent;
113
31
  border-radius: ${({ theme }) => theme.shape.medium};
114
32
 
33
+ &.${constants_1.alertClassnames.severityInfo} {
34
+ background-color: ${({ theme }) => theme.palette.primary[100]};
35
+ border-color: ${({ theme }) => theme.palette.primary[300]};
36
+
37
+ .${constants_1.alertClassnames.iconWrapper} {
38
+ color: ${({ theme }) => theme.palette.primary[800]};
39
+ }
40
+ }
41
+
42
+ &.${constants_1.alertClassnames.severitySuccess} {
43
+ background-color: ${({ theme }) => theme.palette.success[100]};
44
+ border-color: ${({ theme }) => theme.palette.success[300]};
45
+
46
+ .${constants_1.alertClassnames.iconWrapper} {
47
+ color: ${({ theme }) => theme.palette.success[800]};
48
+ }
49
+ }
50
+
51
+ &.${constants_1.alertClassnames.severityError} {
52
+ background-color: ${({ theme }) => theme.palette.error[100]};
53
+ border-color: ${({ theme }) => theme.palette.error[300]};
54
+
55
+ .${constants_1.alertClassnames.iconWrapper} {
56
+ color: ${({ theme }) => theme.palette.error[800]};
57
+ }
58
+ }
59
+
60
+ &.${constants_1.alertClassnames.severityWarning} {
61
+ background-color: ${({ theme }) => theme.palette.warning[100]};
62
+ border-color: ${({ theme }) => theme.palette.warning[300]};
63
+
64
+ .${constants_1.alertClassnames.iconWrapper} {
65
+ color: ${({ theme }) => theme.palette.warning[800]};
66
+ }
67
+ }
68
+
69
+ /* hasCloseButton only */
70
+ &.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasActions}) {
71
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 6, 8)};
72
+ }
73
+
74
+ /* hasActions only */
75
+ &.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasCloseButton}) {
76
+ padding: ${({ theme }) => theme.microSpacing(9, 8, 8, 8)};
77
+ }
78
+
79
+ /* hasActions and hasCloseButton */
80
+ &.${constants_1.alertClassnames.hasActions}.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}) {
81
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 8, 8)};
82
+ }
83
+
84
+ /* hasTitle only */
85
+ &.${constants_1.alertClassnames.hasTitle}:not(.${constants_1.alertClassnames.hasActions}):not(.${constants_1.alertClassnames.hasCloseButton}) {
86
+ padding: ${({ theme }) => theme.microSpacing(6, 8, 6, 8)};
87
+ }
88
+
89
+ /* hasTitle and hasCloseButton */
90
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasActions}) {
91
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 6, 8)};
92
+ }
93
+
94
+ /* hasTitle and hasActions */
95
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasCloseButton}) {
96
+ padding: ${({ theme }) => theme.microSpacing(6, 8, 8, 8)};
97
+ }
98
+
99
+ /* all three */
100
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasActions}.${constants_1.alertClassnames.hasCloseButton} {
101
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 8, 8)};
102
+ }
103
+
104
+ &.${constants_1.alertClassnames.hasTitle} {
105
+ gap: ${({ theme }) => theme.spacing(3, 2)};
106
+
107
+ .${constants_1.alertClassnames.contentWrapper} {
108
+ grid-template-rows: minmax(32px, auto) auto;
109
+ align-items: center;
110
+ }
111
+
112
+ .${constants_1.alertClassnames.content} {
113
+ grid-row: 2;
114
+ }
115
+ }
116
+
117
+ &:not(.${constants_1.alertClassnames.hasTitle}) {
118
+ .${constants_1.alertClassnames.contentWrapper} {
119
+ align-items: flex-start;
120
+ }
121
+ }
122
+
123
+ &.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}) {
124
+ .${constants_1.alertClassnames.iconWrapper} {
125
+ padding-top: ${({ theme }) => theme.microSpacing(3)};
126
+ }
127
+ }
128
+
129
+ &.${constants_1.alertClassnames.hasCloseButton} {
130
+ .${constants_1.alertClassnames.title} {
131
+ grid-column: 2;
132
+ }
133
+
134
+ &:not(.${constants_1.alertClassnames.hasTitle}) {
135
+ .${constants_1.alertClassnames.content} {
136
+ grid-column: 2;
137
+ }
138
+
139
+ .${constants_1.alertClassnames.contentWrapper} {
140
+ grid-template-rows: minmax(32px, auto);
141
+ }
142
+
143
+ .${constants_1.alertClassnames.content} {
144
+ padding: ${({ theme }) => theme.microSpacing(3, 0)};
145
+ }
146
+ }
147
+
148
+ &.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasTitle}) {
149
+ .${constants_1.alertClassnames.content} {
150
+ padding: ${({ theme }) => theme.microSpacing(3, 0, 0)};
151
+ }
152
+ }
153
+ }
154
+
115
155
  ${({ theme }) => theme.breakpoints.down('sm')} {
116
156
  grid-row-gap: ${({ theme }) => theme.spacing(4)};
117
157
  grid-template-columns: 24px 1fr 40px;
118
158
 
119
- padding: ${({ theme, $hasCloseButton, $hasActions, $hasTitle }) => getMobilePadding(theme, $hasActions, $hasCloseButton, $hasTitle)};
159
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 9, 8)};
160
+
161
+ .${constants_1.alertClassnames.contentWrapper} {
162
+ grid-template-columns: 24px 1fr 40px;
163
+ }
164
+
165
+ /* hasCloseButton only */
166
+ &.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasActions}) {
167
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 9, 8)};
168
+ }
169
+
170
+ /* hasActions only */
171
+ &.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasCloseButton}) {
172
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 10, 8)};
173
+ }
174
+
175
+ /* hasActions and hasCloseButton */
176
+ &.${constants_1.alertClassnames.hasCloseButton}.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasTitle}) {
177
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 10, 8)};
178
+ }
179
+
180
+ /* hasTitle only */
181
+ &.${constants_1.alertClassnames.hasTitle}:not(.${constants_1.alertClassnames.hasActions}):not(.${constants_1.alertClassnames.hasCloseButton}) {
182
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 8, 8)};
183
+ }
184
+
185
+ /* hasTitle and hasCloseButton */
186
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasActions}) {
187
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 8, 8)};
188
+ }
189
+
190
+ /* hasTitle and hasActions */
191
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasCloseButton}) {
192
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 10, 8)};
193
+ }
194
+
195
+ /* нет модификаторов */
196
+ &:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasActions}):not(.${constants_1.alertClassnames.hasCloseButton}) {
197
+ .${constants_1.alertClassnames.content} {
198
+ padding-top: ${({ theme }) => theme.microSpacing(1)};
199
+ }
200
+ }
201
+
202
+ /* all three */
203
+ &.${constants_1.alertClassnames.hasTitle}.${constants_1.alertClassnames.hasActions}.${constants_1.alertClassnames.hasCloseButton} {
204
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 10, 8)};
205
+ }
206
+
207
+ /* for close button without title */
208
+ &.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}) {
209
+ .${constants_1.alertClassnames.iconWrapper} {
210
+ padding-top: ${({ theme }) => theme.spacing(2)};
211
+ }
212
+ }
213
+
214
+ /* close button only case */
215
+ &.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasActions}) {
216
+ .${constants_1.alertClassnames.content} {
217
+ padding-top: ${({ theme }) => theme.microSpacing(5)};
218
+ padding-bottom: 0;
219
+ }
220
+ }
221
+
222
+ /* actions only case */
223
+ &.${constants_1.alertClassnames.hasActions}:not(.${constants_1.alertClassnames.hasTitle}):not(.${constants_1.alertClassnames.hasCloseButton}) {
224
+ .${constants_1.alertClassnames.content} {
225
+ padding-top: ${({ theme }) => theme.microSpacing(1)};
226
+ padding-bottom: 0;
227
+ }
228
+ }
229
+
230
+ /* actions + close button case */
231
+ &.${constants_1.alertClassnames.hasActions}.${constants_1.alertClassnames.hasCloseButton}:not(.${constants_1.alertClassnames.hasTitle}) {
232
+ .${constants_1.alertClassnames.content} {
233
+ padding-top: ${({ theme }) => theme.microSpacing(5)};
234
+ padding-bottom: 0;
235
+ }
236
+ }
120
237
  }
121
238
  `;
122
239
  exports.IconWrapper = styled_1.styled.div `
123
240
  height: 20px;
124
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => $hasTitle || !$hasCloseButton ? '0' : theme.microSpacing(3)};
125
-
126
- color: ${({ theme, $severity }) => getIconColor(theme, $severity)};
127
241
 
128
- ${({ theme }) => theme.breakpoints.down('sm')} {
129
- height: 24px;
130
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => getMobileIconPadding(theme, $hasTitle, $hasCloseButton)};
131
- }
242
+ color: inherit;
132
243
 
133
244
  & .${SvgIcon_1.svgIconClassnames.root} {
134
245
  font-size: 20px;
@@ -137,34 +248,30 @@ exports.IconWrapper = styled_1.styled.div `
137
248
  font-size: 24px;
138
249
  }
139
250
  }
251
+
252
+ ${({ theme }) => theme.breakpoints.down('sm')} {
253
+ height: 24px;
254
+ }
140
255
  `;
141
256
  exports.Content = styled_1.styled.div `
142
257
  display: grid;
143
258
  grid-column: 1 / -1;
144
259
  grid-gap: ${({ theme }) => theme.microSpacing(1, 4)};
145
260
  grid-template-columns: 20px 1fr 32px;
146
- grid-template-rows: ${({ $hasTitle, $hasCloseButton }) => getContentGridRows($hasTitle, $hasCloseButton)};
147
- align-items: ${({ $hasTitle }) => ($hasTitle ? 'center' : 'unset')};
261
+ grid-template-rows: minmax(20px, auto);
262
+ align-items: unset;
148
263
 
149
- ${({ theme }) => theme.breakpoints.down('sm')} {
150
- grid-template-columns: 24px 1fr 40px;
151
- }
152
264
  `;
153
- exports.StyledTypography = (0, styled_1.styled)(Typography_1.Typography, {
154
- shouldForwardProp: (prop) => !['$hasTitle', '$hasCloseButton', '$hasActions'].includes(prop),
155
- }) `
156
- grid-column: ${({ $hasTitle, $hasCloseButton }) => $hasTitle || !$hasCloseButton ? '2 / -1' : '2'};
157
- grid-row: ${({ $hasTitle }) => ($hasTitle ? '2' : '1')};
265
+ exports.StyledTypography = (0, styled_1.styled)(Typography_1.Typography) `
266
+ grid-column: 2 / -1;
267
+ grid-row: 1;
158
268
 
159
- padding: ${({ $hasTitle, theme, $hasCloseButton, $hasActions }) => getContentPadding(theme, $hasTitle, $hasCloseButton, $hasActions)};
269
+ padding: 0;
160
270
 
161
- ${({ theme }) => theme.breakpoints.down('sm')} {
162
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => getMobileContentPadding(theme, $hasTitle, $hasCloseButton)};
163
- padding-bottom: 0;
271
+ .${constants_1.alertClassnames.hasTitle} & {
272
+ grid-row: 2;
164
273
  }
165
274
  `;
166
- exports.Title = (0, styled_1.styled)(Typography_1.Typography, {
167
- shouldForwardProp: (prop) => !['$hasTitle', '$hasCloseButton'].includes(prop),
168
- }) `
169
- grid-column: ${({ $hasCloseButton }) => ($hasCloseButton ? '2' : '2 / -1')};
275
+ exports.Title = (0, styled_1.styled)(Typography_1.Typography) `
276
+ grid-column: 2 / -1;
170
277
  `;
@@ -23,7 +23,6 @@ exports.Wrapper = styled_1.styled.article `
23
23
  grid-gap: ${({ theme }) => theme.spacing(2)};
24
24
 
25
25
  background-color: inherit;
26
-
27
26
  border-radius: ${({ theme }) => theme.shape.medium};
28
27
 
29
28
  &.${constants_1.complianceStatusClassnames.contained} {
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DashboardAlert = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Typography_1 = require("../Typography");
6
+ const classNames_1 = require("../utils/classNames");
7
+ const constants_1 = require("./constants");
6
8
  const styles_1 = require("./styles");
7
9
  /**
8
10
  * Компонент отображения уведомления на всех страницах приложения
9
11
  */
10
12
  const DashboardAlert = (props) => {
11
- const { linkButtonProps, children, isShow, ...restProps } = props;
13
+ const { linkButtonProps, children, isShow, className, ...restProps } = props;
12
14
  const { name, color: linkButtonColor, ...restButtonProps } = linkButtonProps || {};
13
- return ((0, jsx_runtime_1.jsx)(styles_1.StyledAlert, { display: isShow, ...restProps, children: (0, jsx_runtime_1.jsxs)(Typography_1.Typography, { variant: "body1", children: [children, "\u00A0", linkButtonProps && ((0, jsx_runtime_1.jsx)(styles_1.StyledButton, { variant: "link", ...restButtonProps, children: name }))] }) }));
15
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledAlert, { className: (0, classNames_1.classNames)(constants_1.dashboardAlertClassnames.root, className), display: isShow, ...restProps, children: (0, jsx_runtime_1.jsxs)(Typography_1.Typography, { variant: "body1", children: [children, "\u00A0", linkButtonProps && ((0, jsx_runtime_1.jsx)(styles_1.StyledButton, { variant: "link", ...restButtonProps, children: name }))] }) }));
14
16
  };
15
17
  exports.DashboardAlert = DashboardAlert;
@@ -0,0 +1,3 @@
1
+ export declare const dashboardAlertClassnames: {
2
+ root: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashboardAlertClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
+ exports.dashboardAlertClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-alert'),
7
+ };
@@ -5,39 +5,41 @@ const Alert_1 = require("../Alert");
5
5
  const Button_1 = require("../Button");
6
6
  const SvgIcon_1 = require("../SvgIcon");
7
7
  const styled_1 = require("../styled");
8
+ const constants_1 = require("./constants");
8
9
  exports.StyledAlert = (0, styled_1.styled)(Alert_1.Alert) `
9
- &.${Alert_1.alertClassnames.root} {
10
+ &.${Alert_1.alertClassnames.root}.${constants_1.dashboardAlertClassnames.root}.${constants_1.dashboardAlertClassnames.root} {
10
11
  grid-template-columns: 24px 1fr 32px;
11
12
 
12
13
  margin-bottom: ${({ theme }) => theme.spacing(4)};
13
14
  padding: ${({ theme }) => theme.spacing(3, 4)};
14
- }
15
15
 
16
- .${Alert_1.alertClassnames.contentWrapper} {
17
- grid-template-columns: 24px 1fr 32px;
18
- grid-template-rows: minmax(32px, auto);
19
- align-items: center;
20
16
 
21
- ${({ theme }) => theme.breakpoints.down('sm')} {
22
- align-items: flex-start;
17
+ .${Alert_1.alertClassnames.contentWrapper} {
18
+ grid-template-columns: 24px 1fr 32px;
19
+ grid-template-rows: minmax(32px, auto);
20
+ align-items: center;
21
+
22
+ ${({ theme }) => theme.breakpoints.down('sm')} {
23
+ align-items: flex-start;
24
+ }
23
25
  }
24
- }
25
26
 
26
- .${Alert_1.alertClassnames.iconWrapper} {
27
- height: 24px;
28
- padding: 0;
27
+ .${Alert_1.alertClassnames.iconWrapper} {
28
+ height: 24px;
29
+ padding: 0;
29
30
 
30
- & .${SvgIcon_1.svgIconClassnames.root} {
31
- font-size: 24px;
31
+ & .${SvgIcon_1.svgIconClassnames.root} {
32
+ font-size: 24px;
33
+ }
32
34
  }
33
- }
34
35
 
35
- .${Alert_1.alertClassnames.content} {
36
- padding: 0;
37
- }
36
+ .${Alert_1.alertClassnames.content} {
37
+ padding: 0;
38
+ }
38
39
 
39
- ${({ theme }) => theme.breakpoints.down('sm')} {
40
- margin: ${({ theme }) => theme.spacing(3, 4, 1)};
40
+ ${({ theme }) => theme.breakpoints.down('sm')} {
41
+ margin: ${({ theme }) => theme.spacing(3, 4, 1)};
42
+ }
41
43
  }
42
44
  `;
43
45
  exports.StyledButton = (0, styled_1.styled)(Button_1.Button) `
@@ -0,0 +1,3 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import { type SvgIconProps } from '../../components/SvgIcon';
3
+ export declare const MaxFillMd: FunctionComponent<SvgIconProps>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaxFillMd = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const SvgIcon_1 = require("../../components/SvgIcon");
6
+ const MaxFillMd = ({ ...props }) => ((0, jsx_runtime_1.jsxs)(SvgIcon_1.SvgIcon, { ...props, children: [(0, jsx_runtime_1.jsxs)("g", { clipPath: "url(#maxFillMd_clip0)", children: [(0, jsx_runtime_1.jsx)("path", { d: "M18.0077 0H5.99234C2.68286 0 0 2.68286 0 5.99234V18.0077C0 21.3171 2.68286 24 5.99234 24H18.0077C21.3171 24 24 21.3171 24 18.0077V5.99234C24 2.68286 21.3171 0 18.0077 0Z", fill: "url(#maxFillMd_paint0_linear)" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.0077 0H5.99234C2.68286 0 0 2.68286 0 5.99234V18.0077C0 21.3171 2.68286 24 5.99234 24H18.0077C21.3171 24 24 21.3171 24 18.0077V5.99234C24 2.68286 21.3171 0 18.0077 0Z", fill: "url(#maxFillMd_paint1_radial)" }), (0, jsx_runtime_1.jsx)("path", { clipRule: "evenodd", d: "M12.1971 21.0799C10.3969 21.0799 9.56037 20.8171 8.10623 19.7659C7.18643 20.9485 4.27377 21.8727 4.14674 20.2915C4.14674 19.1045 3.88394 18.1015 3.5861 17.0065C3.23133 15.6575 2.82837 14.1551 2.82837 11.9783C2.82837 6.7793 7.09447 2.868 12.1489 2.868C17.2078 2.868 21.1717 6.97202 21.1717 12.0265C21.1886 17.0028 17.1734 21.0533 12.1971 21.0799ZM12.2716 7.36183C9.81004 7.23482 7.8916 8.93863 7.46675 11.6104C7.11635 13.8223 7.73831 16.516 8.26828 16.6561C8.52232 16.7174 9.1618 16.2006 9.56037 15.802C10.2194 16.2573 10.9869 16.5308 11.7854 16.5948C14.336 16.7175 16.5153 14.7757 16.6866 12.228C16.7863 9.67483 14.8225 7.51233 12.2716 7.36622V7.36183Z", fill: "white", fillRule: "evenodd" })] }), (0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("linearGradient", { id: "maxFillMd_paint0_linear", gradientUnits: "userSpaceOnUse", x1: "2.82833", x2: "24", y1: "18.2529", y2: "12", children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#44CCFF" }), (0, jsx_runtime_1.jsx)("stop", { offset: "0.662", stopColor: "#5533EE" }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopColor: "#9933DD" })] }), (0, jsx_runtime_1.jsxs)("radialGradient", { id: "maxFillMd_paint1_radial", cx: "0", cy: "0", gradientTransform: "translate(-0.570979 -10.5404) rotate(51.356) scale(29.1244 12)", gradientUnits: "userSpaceOnUse", r: "1", children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#0000FF" }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopOpacity: 0 })] }), (0, jsx_runtime_1.jsx)("clipPath", { id: "maxFillMd_clip0", children: (0, jsx_runtime_1.jsx)("rect", { fill: "white", height: "24", width: "24" }) })] })] }));
7
+ exports.MaxFillMd = MaxFillMd;
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './public';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaxFillMd = void 0;
4
+ var public_1 = require("./public");
5
+ Object.defineProperty(exports, "MaxFillMd", { enumerable: true, get: function () { return public_1.MaxFillMd; } });
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './MaxFillMd';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaxFillMd = void 0;
4
+ var MaxFillMd_1 = require("./MaxFillMd");
5
+ Object.defineProperty(exports, "MaxFillMd", { enumerable: true, get: function () { return MaxFillMd_1.MaxFillMd; } });
@@ -0,0 +1,3 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import { type SvgIconProps } from '../../components/SvgIcon';
3
+ export declare const MaxMonochromeFillMd: FunctionComponent<SvgIconProps>;