@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
@@ -7,9 +7,29 @@ import { SuccessFillMd } from '../../icons/SuccessFillMd';
7
7
  import { WarningFillMd } from '../../icons/WarningFillMd';
8
8
  import { Collapse } from '../Collapse';
9
9
  import { classNames } from '../utils/classNames';
10
+ import { cva } from '../utils/cva';
10
11
  import { alertClassnames } from './constants';
11
12
  import { Content, IconWrapper, StyledGrid, StyledIconButton, StyledTypography, Title, Wrapper, } from './styles';
12
13
  import { useLogic } from './useLogic';
14
+ const alertCva = cva(alertClassnames.root, {
15
+ variants: {
16
+ hasTitle: {
17
+ true: alertClassnames.hasTitle,
18
+ },
19
+ hasCloseButton: {
20
+ true: alertClassnames.hasCloseButton,
21
+ },
22
+ hasActions: {
23
+ true: alertClassnames.hasActions,
24
+ },
25
+ severity: {
26
+ info: alertClassnames.severityInfo,
27
+ error: alertClassnames.severityError,
28
+ success: alertClassnames.severitySuccess,
29
+ warning: alertClassnames.severityWarning,
30
+ },
31
+ },
32
+ });
13
33
  export const Alert = forwardRef(({ children, title, closeText = 'Скрыть', display = true, actions, onClose, severity = 'info', style, className, icon, unmountOnExit, }, ref) => {
14
34
  const { shouldRenderParagraph } = useLogic({ children });
15
35
  const renderCloseButton = () => {
@@ -22,7 +42,12 @@ export const Alert = forwardRef(({ children, title, closeText = 'Скрыть',
22
42
  success: _jsx(SuccessFillMd, {}),
23
43
  warning: _jsx(WarningFillMd, {}),
24
44
  };
25
- return (_jsx(IconWrapper, { "$hasTitle": Boolean(title), "$severity": severity, "$hasCloseButton": Boolean(onClose), className: alertClassnames.iconWrapper, children: icon ?? iconMapping[severity] }));
45
+ return (_jsx(IconWrapper, { className: alertClassnames.iconWrapper, children: icon ?? iconMapping[severity] }));
26
46
  };
27
- return (_jsx(Collapse, { in: display, unmountOnExit: unmountOnExit, children: _jsxs(Wrapper, { style: style, className: classNames(className, alertClassnames.root), role: "alert", ref: ref, "$severity": severity, "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), "$hasActions": Boolean(actions), children: [_jsxs(Content, { "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), className: alertClassnames.contentWrapper, children: [renderIcon(), title && (_jsx(Title, { variant: "h5", "$hasCloseButton": Boolean(onClose), className: alertClassnames.title, children: title })), onClose && renderCloseButton(), _jsx(StyledTypography, { component: shouldRenderParagraph ? 'p' : 'div', "$hasTitle": Boolean(title), "$hasCloseButton": Boolean(onClose), "$hasActions": Boolean(actions), className: alertClassnames.content, children: children })] }), actions && (_jsx(StyledGrid, { container: true, spacing: 4, children: actions }))] }) }));
47
+ return (_jsx(Collapse, { in: display, unmountOnExit: unmountOnExit, children: _jsxs(Wrapper, { style: style, className: classNames(alertCva({
48
+ hasTitle: Boolean(title),
49
+ hasCloseButton: Boolean(onClose),
50
+ hasActions: Boolean(actions),
51
+ severity,
52
+ }), className), role: "alert", ref: ref, children: [_jsxs(Content, { className: alertClassnames.contentWrapper, children: [renderIcon(), title && (_jsx(Title, { variant: "h5", className: alertClassnames.title, children: title })), onClose && renderCloseButton(), _jsx(StyledTypography, { component: shouldRenderParagraph ? 'p' : 'div', className: alertClassnames.content, children: children })] }), actions && (_jsx(StyledGrid, { container: true, spacing: 4, children: actions }))] }) }));
28
53
  });
@@ -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
  };
@@ -6,4 +6,11 @@ export const alertClassnames = {
6
6
  closeButton: createUIKitClassname('alert__close-button'),
7
7
  contentWrapper: createUIKitClassname('alert__content-wrapper'),
8
8
  content: createUIKitClassname('alert__content'),
9
+ hasTitle: createUIKitClassname('alert_has-title'),
10
+ hasCloseButton: createUIKitClassname('alert_has-close-button'),
11
+ hasActions: createUIKitClassname('alert_has-actions'),
12
+ severityInfo: createUIKitClassname('alert_severity_info'),
13
+ severityError: createUIKitClassname('alert_severity_error'),
14
+ severitySuccess: createUIKitClassname('alert_severity_success'),
15
+ severityWarning: createUIKitClassname('alert_severity_warning'),
9
16
  };
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { AlertSeverity } from './types';
3
2
  export declare const StyledGrid: import("../styled").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("../styled").StyledComponent<Omit<
15
14
  export declare const Wrapper: import("../styled").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("../styled").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("../styled").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("../styled").StyledComponent<import("../Typography/types").TypographyPropsBase & {
40
27
  color?: import("../Typography").TypographyColor | undefined;
@@ -45,10 +32,6 @@ export declare const StyledTypography: import("../styled").StyledComponent<impor
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("../styled").StyledComponent<import("../Typography/types").TypographyPropsBase & {
54
37
  color?: import("../Typography").TypographyColor | undefined;
@@ -59,6 +42,4 @@ export declare const Title: import("../styled").StyledComponent<import("../Typog
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
  }, {}, {}>;
@@ -3,87 +3,7 @@ import { IconButton } from '../IconButton';
3
3
  import { svgIconClassnames } from '../SvgIcon';
4
4
  import { styled } from '../styled';
5
5
  import { Typography } from '../Typography';
6
- const getBgColor = (theme, severity) => {
7
- const bgColors = {
8
- info: theme.palette.primary[100],
9
- success: theme.palette.success[100],
10
- error: theme.palette.error[100],
11
- warning: theme.palette.warning[100],
12
- };
13
- return bgColors[severity];
14
- };
15
- const getBorderColor = (theme, severity) => {
16
- const borderColors = {
17
- info: theme.palette.primary[300],
18
- success: theme.palette.success[300],
19
- error: theme.palette.error[300],
20
- warning: theme.palette.warning[300],
21
- };
22
- return borderColors[severity];
23
- };
24
- const getIconColor = (theme, severity) => {
25
- const iconColor = {
26
- info: theme.palette.primary[800],
27
- success: theme.palette.success[800],
28
- error: theme.palette.error[800],
29
- warning: theme.palette.warning[800],
30
- };
31
- return iconColor[severity];
32
- };
33
- const getPadding = (theme, hasActions = false, hasCloseButton = false, hasTitle = false) => {
34
- const paddingMap = {
35
- '111': [6, 6, 8, 8],
36
- '110': [6, 8, 8, 8],
37
- '101': [6, 6, 6, 8],
38
- '100': [6, 8, 6, 8],
39
- '011': [6, 6, 8, 8],
40
- '010': [9, 8, 8, 8],
41
- '001': [6, 6, 6, 8],
42
- '000': [9, 8, 9, 8],
43
- };
44
- const key = `${hasTitle ? 1 : 0}${hasActions ? 1 : 0}${hasCloseButton ? 1 : 0}`;
45
- const [top, right, bottom, left] = paddingMap[key];
46
- return theme.microSpacing(top, right, bottom, left);
47
- };
48
- const getMobilePadding = (theme, hasActions = false, hasCloseButton = false, hasTitle = false) => {
49
- const mobilePaddingMap = {
50
- '111': [4, 4, 10, 8],
51
- '110': [8, 8, 10, 8],
52
- '101': [4, 4, 8, 8],
53
- '100': [8, 8, 8, 8],
54
- '011': [4, 4, 10, 8],
55
- '010': [8, 8, 10, 8],
56
- '001': [4, 4, 9, 8],
57
- '000': [8, 8, 9, 8],
58
- };
59
- const key = `${hasTitle ? 1 : 0}${hasActions ? 1 : 0}${hasCloseButton ? 1 : 0}`;
60
- const [top, right, bottom, left] = mobilePaddingMap[key];
61
- return theme.microSpacing(top, right, bottom, left);
62
- };
63
- const getMobileContentPadding = (theme, hasTitle, hasCloseButton) => {
64
- if (hasTitle) {
65
- return '0';
66
- }
67
- return hasCloseButton ? theme.microSpacing(5) : theme.microSpacing(1);
68
- };
69
- const getContentPadding = (theme, hasTitle, hasCloseButton, hasActions) => {
70
- if (hasTitle || !hasCloseButton) {
71
- return '0';
72
- }
73
- return hasActions ? theme.microSpacing(3, 0, 0) : theme.microSpacing(3, 0);
74
- };
75
- const getMobileIconPadding = (theme, hasTitle, hasCloseButton) => {
76
- if (hasTitle || !hasCloseButton) {
77
- return '0';
78
- }
79
- return theme.spacing(2);
80
- };
81
- const getContentGridRows = (hasTitle, hasCloseButton) => {
82
- if (hasCloseButton) {
83
- return hasTitle ? 'minmax(32px, auto) auto' : 'minmax(32px, auto)';
84
- }
85
- return hasTitle ? 'minmax(32px, auto) auto' : 'minmax(20px, auto)';
86
- };
6
+ import { alertClassnames } from './constants';
87
7
  export const StyledGrid = styled(Grid) `
88
8
  grid-auto-flow: column;
89
9
  grid-column: 2 / -1;
@@ -100,32 +20,223 @@ export const StyledIconButton = styled(IconButton) `
100
20
  export const Wrapper = styled.div `
101
21
  display: grid;
102
22
  grid-template-columns: 20px 1fr 32px;
103
- gap: ${({ theme, $hasTitle }) => $hasTitle ? theme.spacing(3, 2) : theme.microSpacing(7, 4)};
23
+ gap: ${({ theme }) => theme.microSpacing(7, 4)};
104
24
 
105
- padding: ${({ theme, $hasCloseButton, $hasActions, $hasTitle }) => getPadding(theme, $hasActions, $hasCloseButton, $hasTitle)};
25
+ padding: ${({ theme }) => theme.microSpacing(9, 8, 9, 8)};
106
26
 
107
- background-color: ${({ theme, $severity }) => getBgColor(theme, $severity)};
108
- border: 1px solid
109
- ${({ theme, $severity }) => getBorderColor(theme, $severity)};
27
+ border: 1px solid transparent;
110
28
  border-radius: ${({ theme }) => theme.shape.medium};
111
29
 
30
+ &.${alertClassnames.severityInfo} {
31
+ background-color: ${({ theme }) => theme.palette.primary[100]};
32
+ border-color: ${({ theme }) => theme.palette.primary[300]};
33
+
34
+ .${alertClassnames.iconWrapper} {
35
+ color: ${({ theme }) => theme.palette.primary[800]};
36
+ }
37
+ }
38
+
39
+ &.${alertClassnames.severitySuccess} {
40
+ background-color: ${({ theme }) => theme.palette.success[100]};
41
+ border-color: ${({ theme }) => theme.palette.success[300]};
42
+
43
+ .${alertClassnames.iconWrapper} {
44
+ color: ${({ theme }) => theme.palette.success[800]};
45
+ }
46
+ }
47
+
48
+ &.${alertClassnames.severityError} {
49
+ background-color: ${({ theme }) => theme.palette.error[100]};
50
+ border-color: ${({ theme }) => theme.palette.error[300]};
51
+
52
+ .${alertClassnames.iconWrapper} {
53
+ color: ${({ theme }) => theme.palette.error[800]};
54
+ }
55
+ }
56
+
57
+ &.${alertClassnames.severityWarning} {
58
+ background-color: ${({ theme }) => theme.palette.warning[100]};
59
+ border-color: ${({ theme }) => theme.palette.warning[300]};
60
+
61
+ .${alertClassnames.iconWrapper} {
62
+ color: ${({ theme }) => theme.palette.warning[800]};
63
+ }
64
+ }
65
+
66
+ /* hasCloseButton only */
67
+ &.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasActions}) {
68
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 6, 8)};
69
+ }
70
+
71
+ /* hasActions only */
72
+ &.${alertClassnames.hasActions}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasCloseButton}) {
73
+ padding: ${({ theme }) => theme.microSpacing(9, 8, 8, 8)};
74
+ }
75
+
76
+ /* hasActions and hasCloseButton */
77
+ &.${alertClassnames.hasActions}.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}) {
78
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 8, 8)};
79
+ }
80
+
81
+ /* hasTitle only */
82
+ &.${alertClassnames.hasTitle}:not(.${alertClassnames.hasActions}):not(.${alertClassnames.hasCloseButton}) {
83
+ padding: ${({ theme }) => theme.microSpacing(6, 8, 6, 8)};
84
+ }
85
+
86
+ /* hasTitle and hasCloseButton */
87
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasActions}) {
88
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 6, 8)};
89
+ }
90
+
91
+ /* hasTitle and hasActions */
92
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasActions}:not(.${alertClassnames.hasCloseButton}) {
93
+ padding: ${({ theme }) => theme.microSpacing(6, 8, 8, 8)};
94
+ }
95
+
96
+ /* all three */
97
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasActions}.${alertClassnames.hasCloseButton} {
98
+ padding: ${({ theme }) => theme.microSpacing(6, 6, 8, 8)};
99
+ }
100
+
101
+ &.${alertClassnames.hasTitle} {
102
+ gap: ${({ theme }) => theme.spacing(3, 2)};
103
+
104
+ .${alertClassnames.contentWrapper} {
105
+ grid-template-rows: minmax(32px, auto) auto;
106
+ align-items: center;
107
+ }
108
+
109
+ .${alertClassnames.content} {
110
+ grid-row: 2;
111
+ }
112
+ }
113
+
114
+ &:not(.${alertClassnames.hasTitle}) {
115
+ .${alertClassnames.contentWrapper} {
116
+ align-items: flex-start;
117
+ }
118
+ }
119
+
120
+ &.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}) {
121
+ .${alertClassnames.iconWrapper} {
122
+ padding-top: ${({ theme }) => theme.microSpacing(3)};
123
+ }
124
+ }
125
+
126
+ &.${alertClassnames.hasCloseButton} {
127
+ .${alertClassnames.title} {
128
+ grid-column: 2;
129
+ }
130
+
131
+ &:not(.${alertClassnames.hasTitle}) {
132
+ .${alertClassnames.content} {
133
+ grid-column: 2;
134
+ }
135
+
136
+ .${alertClassnames.contentWrapper} {
137
+ grid-template-rows: minmax(32px, auto);
138
+ }
139
+
140
+ .${alertClassnames.content} {
141
+ padding: ${({ theme }) => theme.microSpacing(3, 0)};
142
+ }
143
+ }
144
+
145
+ &.${alertClassnames.hasActions}:not(.${alertClassnames.hasTitle}) {
146
+ .${alertClassnames.content} {
147
+ padding: ${({ theme }) => theme.microSpacing(3, 0, 0)};
148
+ }
149
+ }
150
+ }
151
+
112
152
  ${({ theme }) => theme.breakpoints.down('sm')} {
113
153
  grid-row-gap: ${({ theme }) => theme.spacing(4)};
114
154
  grid-template-columns: 24px 1fr 40px;
115
155
 
116
- padding: ${({ theme, $hasCloseButton, $hasActions, $hasTitle }) => getMobilePadding(theme, $hasActions, $hasCloseButton, $hasTitle)};
156
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 9, 8)};
157
+
158
+ .${alertClassnames.contentWrapper} {
159
+ grid-template-columns: 24px 1fr 40px;
160
+ }
161
+
162
+ /* hasCloseButton only */
163
+ &.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasActions}) {
164
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 9, 8)};
165
+ }
166
+
167
+ /* hasActions only */
168
+ &.${alertClassnames.hasActions}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasCloseButton}) {
169
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 10, 8)};
170
+ }
171
+
172
+ /* hasActions and hasCloseButton */
173
+ &.${alertClassnames.hasCloseButton}.${alertClassnames.hasActions}:not(.${alertClassnames.hasTitle}) {
174
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 10, 8)};
175
+ }
176
+
177
+ /* hasTitle only */
178
+ &.${alertClassnames.hasTitle}:not(.${alertClassnames.hasActions}):not(.${alertClassnames.hasCloseButton}) {
179
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 8, 8)};
180
+ }
181
+
182
+ /* hasTitle and hasCloseButton */
183
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasActions}) {
184
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 8, 8)};
185
+ }
186
+
187
+ /* hasTitle and hasActions */
188
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasActions}:not(.${alertClassnames.hasCloseButton}) {
189
+ padding: ${({ theme }) => theme.microSpacing(8, 8, 10, 8)};
190
+ }
191
+
192
+ /* нет модификаторов */
193
+ &:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasActions}):not(.${alertClassnames.hasCloseButton}) {
194
+ .${alertClassnames.content} {
195
+ padding-top: ${({ theme }) => theme.microSpacing(1)};
196
+ }
197
+ }
198
+
199
+ /* all three */
200
+ &.${alertClassnames.hasTitle}.${alertClassnames.hasActions}.${alertClassnames.hasCloseButton} {
201
+ padding: ${({ theme }) => theme.microSpacing(4, 4, 10, 8)};
202
+ }
203
+
204
+ /* for close button without title */
205
+ &.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}) {
206
+ .${alertClassnames.iconWrapper} {
207
+ padding-top: ${({ theme }) => theme.spacing(2)};
208
+ }
209
+ }
210
+
211
+ /* close button only case */
212
+ &.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasActions}) {
213
+ .${alertClassnames.content} {
214
+ padding-top: ${({ theme }) => theme.microSpacing(5)};
215
+ padding-bottom: 0;
216
+ }
217
+ }
218
+
219
+ /* actions only case */
220
+ &.${alertClassnames.hasActions}:not(.${alertClassnames.hasTitle}):not(.${alertClassnames.hasCloseButton}) {
221
+ .${alertClassnames.content} {
222
+ padding-top: ${({ theme }) => theme.microSpacing(1)};
223
+ padding-bottom: 0;
224
+ }
225
+ }
226
+
227
+ /* actions + close button case */
228
+ &.${alertClassnames.hasActions}.${alertClassnames.hasCloseButton}:not(.${alertClassnames.hasTitle}) {
229
+ .${alertClassnames.content} {
230
+ padding-top: ${({ theme }) => theme.microSpacing(5)};
231
+ padding-bottom: 0;
232
+ }
233
+ }
117
234
  }
118
235
  `;
119
236
  export const IconWrapper = styled.div `
120
237
  height: 20px;
121
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => $hasTitle || !$hasCloseButton ? '0' : theme.microSpacing(3)};
122
-
123
- color: ${({ theme, $severity }) => getIconColor(theme, $severity)};
124
238
 
125
- ${({ theme }) => theme.breakpoints.down('sm')} {
126
- height: 24px;
127
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => getMobileIconPadding(theme, $hasTitle, $hasCloseButton)};
128
- }
239
+ color: inherit;
129
240
 
130
241
  & .${svgIconClassnames.root} {
131
242
  font-size: 20px;
@@ -134,34 +245,30 @@ export const IconWrapper = styled.div `
134
245
  font-size: 24px;
135
246
  }
136
247
  }
248
+
249
+ ${({ theme }) => theme.breakpoints.down('sm')} {
250
+ height: 24px;
251
+ }
137
252
  `;
138
253
  export const Content = styled.div `
139
254
  display: grid;
140
255
  grid-column: 1 / -1;
141
256
  grid-gap: ${({ theme }) => theme.microSpacing(1, 4)};
142
257
  grid-template-columns: 20px 1fr 32px;
143
- grid-template-rows: ${({ $hasTitle, $hasCloseButton }) => getContentGridRows($hasTitle, $hasCloseButton)};
144
- align-items: ${({ $hasTitle }) => ($hasTitle ? 'center' : 'unset')};
258
+ grid-template-rows: minmax(20px, auto);
259
+ align-items: unset;
145
260
 
146
- ${({ theme }) => theme.breakpoints.down('sm')} {
147
- grid-template-columns: 24px 1fr 40px;
148
- }
149
261
  `;
150
- export const StyledTypography = styled(Typography, {
151
- shouldForwardProp: (prop) => !['$hasTitle', '$hasCloseButton', '$hasActions'].includes(prop),
152
- }) `
153
- grid-column: ${({ $hasTitle, $hasCloseButton }) => $hasTitle || !$hasCloseButton ? '2 / -1' : '2'};
154
- grid-row: ${({ $hasTitle }) => ($hasTitle ? '2' : '1')};
262
+ export const StyledTypography = styled(Typography) `
263
+ grid-column: 2 / -1;
264
+ grid-row: 1;
155
265
 
156
- padding: ${({ $hasTitle, theme, $hasCloseButton, $hasActions }) => getContentPadding(theme, $hasTitle, $hasCloseButton, $hasActions)};
266
+ padding: 0;
157
267
 
158
- ${({ theme }) => theme.breakpoints.down('sm')} {
159
- padding-top: ${({ $hasTitle, theme, $hasCloseButton }) => getMobileContentPadding(theme, $hasTitle, $hasCloseButton)};
160
- padding-bottom: 0;
268
+ .${alertClassnames.hasTitle} & {
269
+ grid-row: 2;
161
270
  }
162
271
  `;
163
- export const Title = styled(Typography, {
164
- shouldForwardProp: (prop) => !['$hasTitle', '$hasCloseButton'].includes(prop),
165
- }) `
166
- grid-column: ${({ $hasCloseButton }) => ($hasCloseButton ? '2' : '2 / -1')};
272
+ export const Title = styled(Typography) `
273
+ grid-column: 2 / -1;
167
274
  `;
@@ -20,7 +20,6 @@ export const Wrapper = styled.article `
20
20
  grid-gap: ${({ theme }) => theme.spacing(2)};
21
21
 
22
22
  background-color: inherit;
23
-
24
23
  border-radius: ${({ theme }) => theme.shape.medium};
25
24
 
26
25
  &.${complianceStatusClassnames.contained} {
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Typography } from '../Typography';
3
+ import { classNames } from '../utils/classNames';
4
+ import { dashboardAlertClassnames } from './constants';
3
5
  import { StyledAlert, StyledButton } from './styles';
4
6
  /**
5
7
  * Компонент отображения уведомления на всех страницах приложения
6
8
  */
7
9
  export const DashboardAlert = (props) => {
8
- const { linkButtonProps, children, isShow, ...restProps } = props;
10
+ const { linkButtonProps, children, isShow, className, ...restProps } = props;
9
11
  const { name, color: linkButtonColor, ...restButtonProps } = linkButtonProps || {};
10
- return (_jsx(StyledAlert, { display: isShow, ...restProps, children: _jsxs(Typography, { variant: "body1", children: [children, "\u00A0", linkButtonProps && (_jsx(StyledButton, { variant: "link", ...restButtonProps, children: name }))] }) }));
12
+ return (_jsx(StyledAlert, { className: classNames(dashboardAlertClassnames.root, className), display: isShow, ...restProps, children: _jsxs(Typography, { variant: "body1", children: [children, "\u00A0", linkButtonProps && (_jsx(StyledButton, { variant: "link", ...restButtonProps, children: name }))] }) }));
11
13
  };
@@ -0,0 +1,3 @@
1
+ export declare const dashboardAlertClassnames: {
2
+ root: string;
3
+ };
@@ -0,0 +1,4 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ export const dashboardAlertClassnames = {
3
+ root: createUIKitClassname('dashboard-alert'),
4
+ };
@@ -2,39 +2,41 @@ import { Alert, alertClassnames } from '../Alert';
2
2
  import { Button } from '../Button';
3
3
  import { svgIconClassnames } from '../SvgIcon';
4
4
  import { styled } from '../styled';
5
+ import { dashboardAlertClassnames } from './constants';
5
6
  export const StyledAlert = styled(Alert) `
6
- &.${alertClassnames.root} {
7
+ &.${alertClassnames.root}.${dashboardAlertClassnames.root}.${dashboardAlertClassnames.root} {
7
8
  grid-template-columns: 24px 1fr 32px;
8
9
 
9
10
  margin-bottom: ${({ theme }) => theme.spacing(4)};
10
11
  padding: ${({ theme }) => theme.spacing(3, 4)};
11
- }
12
12
 
13
- .${alertClassnames.contentWrapper} {
14
- grid-template-columns: 24px 1fr 32px;
15
- grid-template-rows: minmax(32px, auto);
16
- align-items: center;
17
13
 
18
- ${({ theme }) => theme.breakpoints.down('sm')} {
19
- align-items: flex-start;
14
+ .${alertClassnames.contentWrapper} {
15
+ grid-template-columns: 24px 1fr 32px;
16
+ grid-template-rows: minmax(32px, auto);
17
+ align-items: center;
18
+
19
+ ${({ theme }) => theme.breakpoints.down('sm')} {
20
+ align-items: flex-start;
21
+ }
20
22
  }
21
- }
22
23
 
23
- .${alertClassnames.iconWrapper} {
24
- height: 24px;
25
- padding: 0;
24
+ .${alertClassnames.iconWrapper} {
25
+ height: 24px;
26
+ padding: 0;
26
27
 
27
- & .${svgIconClassnames.root} {
28
- font-size: 24px;
28
+ & .${svgIconClassnames.root} {
29
+ font-size: 24px;
30
+ }
29
31
  }
30
- }
31
32
 
32
- .${alertClassnames.content} {
33
- padding: 0;
34
- }
33
+ .${alertClassnames.content} {
34
+ padding: 0;
35
+ }
35
36
 
36
- ${({ theme }) => theme.breakpoints.down('sm')} {
37
- margin: ${({ theme }) => theme.spacing(3, 4, 1)};
37
+ ${({ theme }) => theme.breakpoints.down('sm')} {
38
+ margin: ${({ theme }) => theme.spacing(3, 4, 1)};
39
+ }
38
40
  }
39
41
  `;
40
42
  export const StyledButton = styled(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,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SvgIcon } from '../../components/SvgIcon';
3
+ export const MaxFillMd = ({ ...props }) => (_jsxs(SvgIcon, { ...props, children: [_jsxs("g", { clipPath: "url(#maxFillMd_clip0)", children: [_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)" }), _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)" }), _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" })] }), _jsxs("defs", { children: [_jsxs("linearGradient", { id: "maxFillMd_paint0_linear", gradientUnits: "userSpaceOnUse", x1: "2.82833", x2: "24", y1: "18.2529", y2: "12", children: [_jsx("stop", { stopColor: "#44CCFF" }), _jsx("stop", { offset: "0.662", stopColor: "#5533EE" }), _jsx("stop", { offset: "1", stopColor: "#9933DD" })] }), _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: [_jsx("stop", { stopColor: "#0000FF" }), _jsx("stop", { offset: "1", stopOpacity: 0 })] }), _jsx("clipPath", { id: "maxFillMd_clip0", children: _jsx("rect", { fill: "white", height: "24", width: "24" }) })] })] }));
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './public';
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './public';
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './MaxFillMd';
@@ -0,0 +1 @@
1
+ export { MaxFillMd } from './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>;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SvgIcon } from '../../components/SvgIcon';
3
+ export const MaxMonochromeFillMd = ({ ...props }) => (_jsxs(SvgIcon, { ...props, children: [_jsx("g", { clipPath: "url(#maxMono_clip0)", children: _jsx("path", { d: "M11.68 0.320001C4.72669 0.683334 0.136688 6.13667 0.426688 13.0133C0.553355 16.0233 1.76335 18.6133 2.05002 21.47C2.12335 22.21 1.91002 23.1233 2.76335 23.4467C3.81335 23.8433 5.42335 23.1767 6.30335 22.5667C6.60335 22.3633 6.89002 22.1267 7.11002 21.8333C8.02002 22.4367 8.88335 23.02 9.96669 23.28C14.7367 24.4233 19.9634 21.8067 22.2867 17.6033C26.6534 9.70667 20.75 -0.153332 11.68 0.320001ZM8.98002 16.8C8.60335 17.0933 8.24002 17.4933 7.82335 17.7233C7.22002 18.0467 7.03335 17.71 6.80669 17.1767C6.09335 15.48 6.00669 12.59 6.42335 10.8133C6.98335 8.39667 8.85335 6.27 11.4234 6.04333C14.0234 5.81333 16.4367 7.13333 17.5267 9.51667C19.94 14.82 13.7634 20.0567 8.98002 16.8033V16.8Z" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "maxMono_clip0", children: _jsx("rect", { fill: "white", height: "24", width: "24" }) }) })] }));
@@ -0,0 +1 @@
1
+ export { MaxMonochromeFillMd } from './public';
@@ -0,0 +1 @@
1
+ export { MaxMonochromeFillMd } from './public';
@@ -0,0 +1 @@
1
+ export { MaxMonochromeFillMd } from './MaxMonochromeFillMd';
@@ -0,0 +1 @@
1
+ export { MaxMonochromeFillMd } from './MaxMonochromeFillMd';
package/icons/index.d.ts 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';