@astral/ui 4.87.1 → 4.88.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 (51) hide show
  1. package/components/Alert/Alert.js +9 -5
  2. package/components/Alert/constants.d.ts +2 -0
  3. package/components/Alert/constants.js +2 -0
  4. package/components/Alert/styles.d.ts +1 -1
  5. package/components/Alert/styles.js +47 -193
  6. package/components/Alert/types.d.ts +7 -0
  7. package/components/Alert/useLogic/useLogic.d.ts +3 -2
  8. package/components/Alert/useLogic/useLogic.js +4 -2
  9. package/components/CollapsableAlert/CollapsableAlert.d.ts +6 -1
  10. package/components/CollapsableAlert/CollapsableAlert.js +1 -1
  11. package/components/DashboardAlert/DashboardAlert.d.ts +4 -0
  12. package/components/DashboardAlert/DashboardAlert.js +5 -1
  13. package/components/DashboardAlert/styles.js +13 -15
  14. package/components/DashboardAlert/types.d.ts +4 -1
  15. package/components/DashboardLayout/Main/Main.js +2 -2
  16. package/components/DashboardLayout/Main/styles.d.ts +4 -0
  17. package/components/DashboardLayout/Main/styles.js +7 -0
  18. package/components/PageAlert/PageAlert.d.ts +7 -0
  19. package/components/PageAlert/PageAlert.js +6 -2
  20. package/components/PageLayout/styles.js +4 -0
  21. package/components/fileUploading/FileUploader/faker.d.ts +1 -1
  22. package/components/fileUploading/PreviewFileUploader/faker.d.ts +1 -1
  23. package/hook-form/EditableText/EditingForm/useLogic/useLogic.d.ts +1 -1
  24. package/node/components/Alert/Alert.js +8 -4
  25. package/node/components/Alert/constants.d.ts +2 -0
  26. package/node/components/Alert/constants.js +2 -0
  27. package/node/components/Alert/styles.d.ts +1 -1
  28. package/node/components/Alert/styles.js +48 -194
  29. package/node/components/Alert/types.d.ts +7 -0
  30. package/node/components/Alert/useLogic/useLogic.d.ts +3 -2
  31. package/node/components/Alert/useLogic/useLogic.js +4 -2
  32. package/node/components/CollapsableAlert/CollapsableAlert.d.ts +6 -1
  33. package/node/components/CollapsableAlert/CollapsableAlert.js +1 -1
  34. package/node/components/DashboardAlert/DashboardAlert.d.ts +4 -0
  35. package/node/components/DashboardAlert/DashboardAlert.js +5 -1
  36. package/node/components/DashboardAlert/styles.js +13 -15
  37. package/node/components/DashboardAlert/types.d.ts +4 -1
  38. package/node/components/DashboardLayout/Main/Main.js +1 -1
  39. package/node/components/DashboardLayout/Main/styles.d.ts +4 -0
  40. package/node/components/DashboardLayout/Main/styles.js +8 -1
  41. package/node/components/PageAlert/PageAlert.d.ts +7 -0
  42. package/node/components/PageAlert/PageAlert.js +6 -2
  43. package/node/components/PageLayout/styles.js +4 -0
  44. package/node/components/fileUploading/FileUploader/faker.d.ts +1 -1
  45. package/node/components/fileUploading/PreviewFileUploader/faker.d.ts +1 -1
  46. package/node/hook-form/EditableText/EditingForm/useLogic/useLogic.d.ts +1 -1
  47. package/package.json +39 -39
  48. package/components/PageAlert/styles.d.ts +0 -7
  49. package/components/PageAlert/styles.js +0 -10
  50. package/node/components/PageAlert/styles.d.ts +0 -7
  51. package/node/components/PageAlert/styles.js +0 -13
@@ -4,7 +4,9 @@ export declare const alertClassnames: {
4
4
  title: string;
5
5
  closeButton: string;
6
6
  contentWrapper: string;
7
+ bodyWrapper: string;
7
8
  content: string;
9
+ actions: string;
8
10
  hasTitle: string;
9
11
  hasCloseButton: string;
10
12
  hasActions: string;
@@ -8,7 +8,9 @@ exports.alertClassnames = {
8
8
  title: (0, createUIKitClassname_1.createUIKitClassname)('alert__title'),
9
9
  closeButton: (0, createUIKitClassname_1.createUIKitClassname)('alert__close-button'),
10
10
  contentWrapper: (0, createUIKitClassname_1.createUIKitClassname)('alert__content-wrapper'),
11
+ bodyWrapper: (0, createUIKitClassname_1.createUIKitClassname)('alert__body-wrapper'),
11
12
  content: (0, createUIKitClassname_1.createUIKitClassname)('alert__content'),
13
+ actions: (0, createUIKitClassname_1.createUIKitClassname)('alert__actions'),
12
14
  hasTitle: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-title'),
13
15
  hasCloseButton: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-close-button'),
14
16
  hasActions: (0, createUIKitClassname_1.createUIKitClassname)('alert_has-actions'),
@@ -20,7 +20,7 @@ export declare const IconWrapper: import("@emotion/styled/dist/declarations/src/
20
20
  theme?: import("@emotion/react").Theme | undefined;
21
21
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
22
22
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
- export declare const Content: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
23
+ export declare const BodyWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
24
24
  theme?: import("@emotion/react").Theme | undefined;
25
25
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
26
26
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Title = exports.StyledTypography = exports.Content = exports.IconWrapper = exports.Wrapper = exports.StyledIconButton = exports.StyledGrid = void 0;
3
+ exports.Title = exports.StyledTypography = exports.BodyWrapper = exports.IconWrapper = exports.Wrapper = exports.StyledIconButton = exports.StyledGrid = void 0;
4
4
  const Grid_1 = require("../Grid");
5
5
  const IconButton_1 = require("../IconButton");
6
6
  const SvgIcon_1 = require("../SvgIcon");
@@ -9,23 +9,29 @@ const Typography_1 = require("../Typography");
9
9
  const constants_1 = require("./constants");
10
10
  exports.StyledGrid = (0, styled_1.styled)(Grid_1.Grid) `
11
11
  grid-auto-flow: column;
12
- grid-column: 2 / -1;
13
12
  justify-content: flex-start;
14
13
  `;
15
14
  exports.StyledIconButton = (0, styled_1.styled)(IconButton_1.IconButton) `
16
- grid-column: 3;
17
- grid-row: 1;
15
+ flex-shrink: 0;
16
+ align-self: flex-start;
17
+
18
+ /* Центрируем кнопку по ее строке, как и иконку:
19
+ отступ строки сверху + половина разницы высот кнопки и строки */
20
+ margin-top: ${({ theme }) => `calc(${theme.microSpacing(3)} + (20px - 32px) / 2)`};
21
+
22
+ ${({ theme }) => theme.breakpoints.down('sm')} {
23
+ margin-top: ${({ theme }) => `calc(${theme.microSpacing(3)} + (20px - 40px) / 2)`};
24
+ }
18
25
 
19
26
  &:hover {
20
27
  background-color: rgb(0 0 0 / 4%);
21
28
  }
22
29
  `;
23
30
  exports.Wrapper = styled_1.styled.div `
24
- display: grid;
25
- grid-template-columns: 20px 1fr 32px;
26
- gap: ${({ theme }) => theme.microSpacing(7, 4)};
31
+ display: flex;
32
+ align-items: flex-start;
27
33
 
28
- padding: ${({ theme }) => theme.microSpacing(9, 8, 9, 8)};
34
+ padding: ${({ theme }) => theme.spacing(3, 4)};
29
35
 
30
36
  border: 1px solid transparent;
31
37
  border-radius: ${({ theme }) => theme.shape.medium};
@@ -65,179 +71,17 @@ exports.Wrapper = styled_1.styled.div `
65
71
  color: ${({ theme }) => theme.palette.warning[800]};
66
72
  }
67
73
  }
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
-
155
- ${({ theme }) => theme.breakpoints.down('sm')} {
156
- grid-row-gap: ${({ theme }) => theme.spacing(4)};
157
- grid-template-columns: 24px 1fr 40px;
158
-
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
- }
237
- }
238
74
  `;
239
75
  exports.IconWrapper = styled_1.styled.div `
76
+ display: flex;
77
+ flex-shrink: 0;
78
+ align-items: center;
79
+
80
+ /* Высота строки текста (line-height body1): иконка центрируется по первой строке,
81
+ а не по собственному боксу, поэтому высота не зависит от размера иконки */
240
82
  height: 20px;
83
+ margin-right: ${({ theme }) => theme.spacing(2)};
84
+ margin-block: ${({ theme }) => theme.microSpacing(3)};
241
85
 
242
86
  color: inherit;
243
87
 
@@ -248,30 +92,40 @@ exports.IconWrapper = styled_1.styled.div `
248
92
  font-size: 24px;
249
93
  }
250
94
  }
95
+ `;
96
+ exports.BodyWrapper = styled_1.styled.div `
97
+ display: flex;
98
+ flex: 1;
99
+ flex-direction: column;
100
+ align-items: flex-start;
251
101
 
252
- ${({ theme }) => theme.breakpoints.down('sm')} {
253
- height: 24px;
102
+ min-width: 0;
103
+ margin-block: ${({ theme }) => theme.microSpacing(3)};
104
+
105
+ .${constants_1.alertClassnames.hasCloseButton} & {
106
+ margin-right: ${({ theme }) => theme.spacing(1)};
254
107
  }
255
- `;
256
- exports.Content = styled_1.styled.div `
257
- display: grid;
258
- grid-column: 1 / -1;
259
- grid-gap: ${({ theme }) => theme.microSpacing(1, 4)};
260
- grid-template-columns: 20px 1fr 32px;
261
- grid-template-rows: minmax(20px, auto);
262
- align-items: unset;
263
108
 
109
+ & > .${constants_1.alertClassnames.title} + .${constants_1.alertClassnames.content} {
110
+ margin-top: ${({ theme }) => theme.spacing(1)};
111
+ }
112
+
113
+ & > .${constants_1.alertClassnames.actions} {
114
+ margin-top: ${({ theme }) => theme.spacing(2)};
115
+ }
264
116
  `;
265
117
  exports.StyledTypography = (0, styled_1.styled)(Typography_1.Typography) `
266
- grid-column: 2 / -1;
267
- grid-row: 1;
118
+ align-self: stretch;
268
119
 
120
+ min-width: 0;
121
+ margin: 0;
269
122
  padding: 0;
270
123
 
271
- .${constants_1.alertClassnames.hasTitle} & {
272
- grid-row: 2;
273
- }
124
+ overflow-wrap: break-word;
274
125
  `;
275
126
  exports.Title = (0, styled_1.styled)(Typography_1.Typography) `
276
- grid-column: 2 / -1;
127
+ min-width: 0;
128
+ margin: 0;
129
+
130
+ overflow-wrap: break-word;
277
131
  `;
@@ -20,9 +20,16 @@ export type AlertProps = {
20
20
  * Используется для отображения набора действий
21
21
  */
22
22
  actions?: ReactNode;
23
+ /**
24
+ * @example <Alert isShow={false}>Сообщение</Alert>
25
+ * Флаг для отображения/скрытия компонента Alert
26
+ */
27
+ isShow?: boolean;
23
28
  /**
24
29
  * @example <Alert display={false}>Сообщение</Alert>
25
30
  * Флаг для отображения/скрытия компонента Alert
31
+ *
32
+ * @deprecated Используйте `isShow`. Проп будет удалён в следующей major версии пакета.
26
33
  */
27
34
  display?: boolean;
28
35
  /**
@@ -1,6 +1,7 @@
1
1
  import { type AlertProps } from '../types';
2
- type UseLogicParams = Pick<AlertProps, 'children'>;
3
- export declare const useLogic: ({ children }: UseLogicParams) => {
2
+ type UseLogicParams = Pick<AlertProps, 'children' | 'isShow' | 'display'>;
3
+ export declare const useLogic: ({ children, isShow, display }: UseLogicParams) => {
4
4
  shouldRenderParagraph: boolean;
5
+ isVisible: boolean;
5
6
  };
6
7
  export {};
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
- const useLogic = ({ children }) => {
4
+ const useLogic = ({ children, isShow, display }) => {
5
5
  const shouldRenderParagraph = typeof children === 'string' || typeof children === 'number';
6
- return { shouldRenderParagraph };
6
+ // display - deprecated проп, поддерживается для обратной совместимости, приоритет у isShow
7
+ const isVisible = isShow ?? display ?? true;
8
+ return { shouldRenderParagraph, isVisible };
7
9
  };
8
10
  exports.useLogic = useLogic;
@@ -1,7 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { type AccordionProps } from '../Accordion';
3
3
  import { type AlertProps } from '../Alert';
4
- export declare const CollapsableAlert: import("react").ForwardRefExoticComponent<Pick<AlertProps, "display" | "icon" | "actions" | "severity"> & Omit<AccordionProps, "onChange" | "summary" | "startAdornment"> & {
4
+ export declare const CollapsableAlert: import("react").ForwardRefExoticComponent<Pick<AlertProps, "icon" | "actions" | "severity"> & Omit<AccordionProps, "onChange" | "summary" | "startAdornment"> & {
5
5
  title: AccordionProps['summary'];
6
6
  onExpandedChange?: AccordionProps['onChange'];
7
+ /**
8
+ * @example <CollapsableAlert display={false}>Сообщение</CollapsableAlert>
9
+ * Флаг для отображения/скрытия компонента
10
+ */
11
+ display?: boolean | undefined;
7
12
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -6,5 +6,5 @@ const react_1 = require("react");
6
6
  const Accordion_1 = require("../Accordion");
7
7
  const Alert_1 = require("../Alert");
8
8
  exports.CollapsableAlert = (0, react_1.forwardRef)(({ title, icon, severity = 'info', actions, display = true, children, isExpanded, onExpandedChange, subtitle, summaryVariant, }, ref) => {
9
- return ((0, jsx_runtime_1.jsx)(Alert_1.Alert, { ref: ref, severity: severity, icon: icon, display: display, actions: actions, children: (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { summary: title, isExpanded: isExpanded, onChange: onExpandedChange, subtitle: subtitle, summaryVariant: summaryVariant, children: children }) }));
9
+ return ((0, jsx_runtime_1.jsx)(Alert_1.Alert, { ref: ref, severity: severity, icon: icon, isShow: display, actions: actions, children: (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { summary: title, isExpanded: isExpanded, onChange: onExpandedChange, subtitle: subtitle, summaryVariant: summaryVariant, children: children }) }));
10
10
  });
@@ -1,5 +1,9 @@
1
1
  import type { DashboardAlertProps } from './types';
2
2
  /**
3
3
  * Компонент отображения уведомления на всех страницах приложения
4
+ *
5
+ * @deprecated Компонент будет удалён — планируется полный переход на {@link Alert}.
6
+ * Не используйте `DashboardAlert` в новом коде, вместо него используйте `Alert`.
7
+ * Подробнее — в разделе «DashboardAlert / PageAlert» V5 Migration Guide.
4
8
  */
5
9
  export declare const DashboardAlert: (props: DashboardAlertProps) => import("react/jsx-runtime").JSX.Element;
@@ -8,10 +8,14 @@ const constants_1 = require("./constants");
8
8
  const styles_1 = require("./styles");
9
9
  /**
10
10
  * Компонент отображения уведомления на всех страницах приложения
11
+ *
12
+ * @deprecated Компонент будет удалён — планируется полный переход на {@link Alert}.
13
+ * Не используйте `DashboardAlert` в новом коде, вместо него используйте `Alert`.
14
+ * Подробнее — в разделе «DashboardAlert / PageAlert» V5 Migration Guide.
11
15
  */
12
16
  const DashboardAlert = (props) => {
13
17
  const { linkButtonProps, children, isShow, className, ...restProps } = props;
14
18
  const { name, color: linkButtonColor, ...restButtonProps } = linkButtonProps || {};
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 }))] }) }));
19
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledAlert, { className: (0, classNames_1.classNames)(constants_1.dashboardAlertClassnames.root, className), isShow: 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 }))] }) }));
16
20
  };
17
21
  exports.DashboardAlert = DashboardAlert;
@@ -8,25 +8,13 @@ const styled_1 = require("../styled");
8
8
  const constants_1 = require("./constants");
9
9
  exports.StyledAlert = (0, styled_1.styled)(Alert_1.Alert) `
10
10
  &.${Alert_1.alertClassnames.root}.${constants_1.dashboardAlertClassnames.root}.${constants_1.dashboardAlertClassnames.root} {
11
- grid-template-columns: 24px 1fr 32px;
11
+ align-items: center;
12
12
 
13
- margin-bottom: ${({ theme }) => theme.spacing(4)};
14
13
  padding: ${({ theme }) => theme.spacing(3, 4)};
15
14
 
16
-
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
- }
25
- }
26
-
27
15
  .${Alert_1.alertClassnames.iconWrapper} {
28
16
  height: 24px;
29
- padding: 0;
17
+ margin-block: 0;
30
18
 
31
19
  & .${SvgIcon_1.svgIconClassnames.root} {
32
20
  font-size: 24px;
@@ -38,7 +26,17 @@ exports.StyledAlert = (0, styled_1.styled)(Alert_1.Alert) `
38
26
  }
39
27
 
40
28
  ${({ theme }) => theme.breakpoints.down('sm')} {
41
- margin: ${({ theme }) => theme.spacing(3, 4, 1)};
29
+ align-items: flex-start;
30
+
31
+ /* иконка 24px, выравниваем текст к ней, как в старой вёрстке */
32
+ .${Alert_1.alertClassnames.bodyWrapper} {
33
+ margin-block: ${({ theme }) => theme.microSpacing(1, 0)};
34
+ }
35
+
36
+ /* и кнопку закрытия к ней же: половина разницы высот кнопки и иконки */
37
+ .${Alert_1.alertClassnames.closeButton} {
38
+ margin-top: calc((24px - 40px) / 2);
39
+ }
42
40
  }
43
41
  }
44
42
  `;
@@ -4,7 +4,10 @@ import type { ButtonProps } from '../Button';
4
4
  export type LinkButtonProps<TComponent extends ElementType = ElementType> = Omit<ButtonProps<TComponent>, 'children' | 'size' | 'color' | 'key'> & {
5
5
  name?: string;
6
6
  } & Omit<ComponentProps<TComponent>, ''>;
7
- export type DashboardAlertProps = Omit<AlertProps, 'actions' | 'slotProps' | 'slots' | 'title' | 'display'> & {
7
+ /**
8
+ * @deprecated Тип будет удалён вместе с `DashboardAlert` — переход на {@link Alert} / `AlertProps`.
9
+ */
10
+ export type DashboardAlertProps = Omit<AlertProps, 'actions' | 'slotProps' | 'slots' | 'title' | 'display' | 'isShow'> & {
8
11
  /**
9
12
  * Параметры ссылки
10
13
  */
@@ -11,5 +11,5 @@ const useLogic_1 = require("./useLogic");
11
11
  */
12
12
  exports.Main = (0, react_1.forwardRef)(({ children, alert }, ref) => {
13
13
  const { onAnimationEnd, alertContainerRef } = (0, useLogic_1.useLogic)();
14
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.AlertWrapper, { ref: alertContainerRef, className: constants_1.dashboardLayoutMainClassnames.alert, children: alert }), (0, jsx_runtime_1.jsx)(styles_1.MainRoot, { className: constants_1.dashboardLayoutMainClassnames.main, ref: ref, onAnimationEnd: onAnimationEnd, children: children })] }));
14
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.AlertWrapper, { ref: alertContainerRef, className: constants_1.dashboardLayoutMainClassnames.alert, children: alert && (0, jsx_runtime_1.jsx)(styles_1.AlertContainer, { children: alert }) }), (0, jsx_runtime_1.jsx)(styles_1.MainRoot, { className: constants_1.dashboardLayoutMainClassnames.main, ref: ref, onAnimationEnd: onAnimationEnd, children: children })] }));
15
15
  });
@@ -7,3 +7,7 @@ export declare const AlertWrapper: import("@emotion/styled/dist/declarations/src
7
7
  theme?: import("@emotion/react").Theme | undefined;
8
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
9
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const AlertContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlertWrapper = exports.MainRoot = void 0;
3
+ exports.AlertContainer = exports.AlertWrapper = exports.MainRoot = void 0;
4
4
  const styled_1 = require("../../styled");
5
5
  exports.MainRoot = styled_1.styled.main `
6
6
  overflow: hidden;
@@ -23,3 +23,10 @@ exports.AlertWrapper = styled_1.styled.div `
23
23
  background-color: ${({ theme }) => theme.palette.background.default};
24
24
  }
25
25
  `;
26
+ exports.AlertContainer = styled_1.styled.div `
27
+ margin-bottom: ${({ theme }) => theme.spacing(4)};
28
+
29
+ ${({ theme }) => theme.breakpoints.down('sm')} {
30
+ margin: ${({ theme }) => theme.spacing(3, 4, 1)};
31
+ }
32
+ `;
@@ -1,6 +1,13 @@
1
1
  import { type DashboardAlertProps } from '../DashboardAlert';
2
+ /**
3
+ * @deprecated Тип будет удалён вместе с `PageAlert` — переход на {@link Alert} / `AlertProps`.
4
+ */
2
5
  export type PageAlertProps = DashboardAlertProps;
3
6
  /**
4
7
  * Компонент отображения уведомления на странице приложения
8
+ *
9
+ * @deprecated Компонент будет удалён — планируется полный переход на {@link Alert}.
10
+ * Не используйте `PageAlert` в новом коде, вместо него используйте `Alert`.
11
+ * Подробнее — в разделе «DashboardAlert / PageAlert» V5 Migration Guide.
5
12
  */
6
13
  export declare const PageAlert: (props: PageAlertProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageAlert = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const styles_1 = require("./styles");
5
+ const DashboardAlert_1 = require("../DashboardAlert");
6
6
  /**
7
7
  * Компонент отображения уведомления на странице приложения
8
+ *
9
+ * @deprecated Компонент будет удалён — планируется полный переход на {@link Alert}.
10
+ * Не используйте `PageAlert` в новом коде, вместо него используйте `Alert`.
11
+ * Подробнее — в разделе «DashboardAlert / PageAlert» V5 Migration Guide.
8
12
  */
9
13
  const PageAlert = (props) => {
10
- return (0, jsx_runtime_1.jsx)(styles_1.StyledDashboardAlert, { ...props });
14
+ return (0, jsx_runtime_1.jsx)(DashboardAlert_1.DashboardAlert, { ...props });
11
15
  };
12
16
  exports.PageAlert = PageAlert;
@@ -7,12 +7,16 @@ exports.MobileAlertWrapper = styled_1.styled.div `
7
7
  ${({ theme }) => theme.breakpoints.down('sm')} {
8
8
  display: block;
9
9
 
10
+ margin: ${({ theme }) => theme.spacing(3, 4, 0, 4)};
11
+
10
12
  background-color: ${({ theme }) => theme.palette.background.default};
11
13
  }
12
14
  `;
13
15
  exports.DesktopAlertWrapper = styled_1.styled.div `
14
16
  display: block;
15
17
 
18
+ margin-bottom: ${({ theme }) => theme.spacing(4)};
19
+
16
20
  ${({ theme }) => theme.breakpoints.down('sm')} {
17
21
  display: none;
18
22
  }
@@ -1,2 +1,2 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- export declare const fakeFileUploadQuery: (formData: FormData, options?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
2
+ export declare const fakeFileUploadQuery: (formData: FormData, options?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
@@ -1,2 +1,2 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- export declare const fakePreviewFileUploadQuery: (formData: FormData, options?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}>>;
2
+ export declare const fakePreviewFileUploadQuery: (formData: FormData, options?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
@@ -5,7 +5,7 @@ type UseLogicParams<TValue> = EditingFormProps<TValue>;
5
5
  export declare const useLogic: <TValue>({ initialValue, children, validate, onClose, onSubmit, }: UseLogicParams<TValue>) => {
6
6
  formProps: {
7
7
  form: import("react-hook-form").UseFormReturn<FormValues, any>;
8
- onSubmit: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void>;
8
+ onSubmit: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void | undefined>;
9
9
  };
10
10
  };
11
11
  export {};