@ozen-ui/kit 0.73.0 → 0.75.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 (179) hide show
  1. package/__inner__/cjs/components/Calendar/Calendar.js +26 -2
  2. package/__inner__/cjs/components/Calendar/CalendarContext.d.ts +8 -1
  3. package/__inner__/cjs/components/Calendar/CalendarContext.js +10 -1
  4. package/__inner__/cjs/components/Calendar/__tests__/utils.d.ts +11 -0
  5. package/__inner__/cjs/components/Calendar/__tests__/utils.js +58 -0
  6. package/__inner__/cjs/components/Calendar/components/CalendarGrid/CalendarGrid.js +4 -3
  7. package/__inner__/cjs/components/Calendar/components/CalendarItem/CalendarItem.js +25 -2
  8. package/__inner__/cjs/components/Calendar/components/CalendarItem/CalendarItemContext.d.ts +1 -0
  9. package/__inner__/cjs/components/Calendar/components/CalendarItem/CalendarItemContext.js +1 -0
  10. package/__inner__/cjs/components/Calendar/components/CalendarModeRange/CalendarModeRange.js +68 -13
  11. package/__inner__/cjs/components/Calendar/components/CalendarModeSingle/CalendarModeSingle.js +62 -16
  12. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/CalendarSwitcher.js +6 -7
  13. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/CalendarSwitcherText.d.ts +3 -0
  14. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/CalendarSwitcherText.js +13 -0
  15. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/index.d.ts +2 -0
  16. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/index.js +5 -0
  17. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/types.d.ts +4 -0
  18. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/types.js +2 -0
  19. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/index.d.ts +1 -0
  20. package/__inner__/cjs/components/Calendar/components/CalendarSwitcher/components/index.js +4 -0
  21. package/__inner__/cjs/components/Calendar/constants.d.ts +2 -0
  22. package/__inner__/cjs/components/Calendar/constants.js +7 -1
  23. package/__inner__/cjs/components/Calendar/index.d.ts +1 -0
  24. package/__inner__/cjs/components/Calendar/index.js +1 -0
  25. package/__inner__/cjs/components/Calendar/types.d.ts +13 -5
  26. package/__inner__/cjs/components/Calendar/utils.d.ts +10 -1
  27. package/__inner__/cjs/components/Calendar/utils.js +12 -1
  28. package/__inner__/cjs/components/DatePicker/components/DateInput/DateInput.js +4 -3
  29. package/__inner__/cjs/components/DatePicker/components/DateInput/types.d.ts +6 -2
  30. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -1
  31. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +67 -7
  32. package/__inner__/cjs/components/DatePicker/components/DatePickerModeDate/DatePickerModeDate.js +32 -20
  33. package/__inner__/cjs/components/DatePicker/components/DatePickerModeDateRange/DatePickerModeDateRange.js +74 -51
  34. package/__inner__/cjs/components/DatePicker/constants.d.ts +2 -0
  35. package/__inner__/cjs/components/DatePicker/constants.js +4 -1
  36. package/__inner__/cjs/components/DatePicker/types.d.ts +10 -6
  37. package/__inner__/cjs/components/DatePicker/types.js +3 -1
  38. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +2 -1
  39. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.js +18 -5
  40. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +2 -1
  41. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +6 -5
  42. package/__inner__/cjs/components/DatePicker/utils/getCommonCalendarProps/getCommonCalendarProps.js +2 -2
  43. package/__inner__/cjs/components/DatePicker/utils/index.d.ts +2 -0
  44. package/__inner__/cjs/components/DatePicker/utils/index.js +2 -0
  45. package/__inner__/cjs/components/DatePicker/utils/isValidDateString/isValidDateString.d.ts +2 -1
  46. package/__inner__/cjs/components/DatePicker/utils/isValidDateString/isValidDateString.js +9 -8
  47. package/__inner__/cjs/components/DatePicker/utils/maskPastedDate/index.d.ts +1 -0
  48. package/__inner__/cjs/components/DatePicker/utils/maskPastedDate/index.js +4 -0
  49. package/__inner__/cjs/components/DatePicker/utils/maskPastedDate/maskPastedDate.d.ts +6 -0
  50. package/__inner__/cjs/components/DatePicker/utils/maskPastedDate/maskPastedDate.js +43 -0
  51. package/__inner__/cjs/components/DatePicker/utils/parseDateString/index.d.ts +1 -0
  52. package/__inner__/cjs/components/DatePicker/utils/parseDateString/index.js +4 -0
  53. package/__inner__/cjs/components/DatePicker/utils/parseDateString/parseDateString.d.ts +6 -0
  54. package/__inner__/cjs/components/DatePicker/utils/parseDateString/parseDateString.js +66 -0
  55. package/__inner__/cjs/components/Grid/Grid.d.ts +2 -1
  56. package/__inner__/cjs/components/Grid/GridItem.d.ts +2 -1
  57. package/__inner__/cjs/components/ListCardItem/hooks/useListCardItemRatio.js +10 -14
  58. package/__inner__/cjs/components/SectionMessage/SectionMessage.css +6 -0
  59. package/__inner__/cjs/components/SectionMessage/SectionMessage.js +8 -5
  60. package/__inner__/cjs/components/SectionMessage/config.d.ts +2 -3
  61. package/__inner__/cjs/components/SectionMessage/config.js +6 -22
  62. package/__inner__/cjs/components/SectionMessage/constants.d.ts +3 -0
  63. package/__inner__/cjs/components/SectionMessage/constants.js +7 -1
  64. package/__inner__/cjs/components/SectionMessage/types.d.ts +6 -1
  65. package/__inner__/cjs/components/SectionMessage/types.js +1 -0
  66. package/__inner__/cjs/components/Stack/Stack.css +3 -0
  67. package/__inner__/cjs/components/Stack/Stack.js +2 -1
  68. package/__inner__/cjs/components/Stack/constants.d.ts +1 -0
  69. package/__inner__/cjs/components/Stack/constants.js +2 -1
  70. package/__inner__/cjs/components/Stack/types.d.ts +4 -0
  71. package/__inner__/cjs/components/Stack/types.js +2 -1
  72. package/__inner__/cjs/hooks/useDevEffect/index.d.ts +1 -0
  73. package/__inner__/cjs/hooks/useDevEffect/index.js +4 -0
  74. package/__inner__/cjs/hooks/useDevEffect/useDevEffect.d.ts +3 -0
  75. package/__inner__/cjs/hooks/useDevEffect/useDevEffect.js +13 -0
  76. package/__inner__/cjs/hooks/useIntersectionObserver/index.d.ts +2 -0
  77. package/__inner__/cjs/hooks/useIntersectionObserver/index.js +5 -0
  78. package/__inner__/cjs/hooks/useIntersectionObserver/types.d.ts +29 -0
  79. package/__inner__/cjs/hooks/useIntersectionObserver/types.js +2 -0
  80. package/__inner__/cjs/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +6 -0
  81. package/__inner__/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +80 -0
  82. package/__inner__/cjs/locale/locale.js +39 -3
  83. package/__inner__/cjs/utils/array/createFilled/createFilledArray.d.ts +1 -1
  84. package/__inner__/cjs/utils/array/createFilled/createFilledArray.js +6 -1
  85. package/__inner__/cjs/utils/react/extractRef.d.ts +2 -0
  86. package/__inner__/cjs/utils/react/extractRef.js +11 -0
  87. package/__inner__/cjs/utils/react/index.d.ts +1 -0
  88. package/__inner__/cjs/utils/react/index.js +1 -0
  89. package/__inner__/esm/components/Calendar/Calendar.js +27 -3
  90. package/__inner__/esm/components/Calendar/CalendarContext.d.ts +8 -1
  91. package/__inner__/esm/components/Calendar/CalendarContext.js +10 -1
  92. package/__inner__/esm/components/Calendar/__tests__/utils.d.ts +11 -0
  93. package/__inner__/esm/components/Calendar/__tests__/utils.js +45 -0
  94. package/__inner__/esm/components/Calendar/components/CalendarGrid/CalendarGrid.js +4 -3
  95. package/__inner__/esm/components/Calendar/components/CalendarItem/CalendarItem.js +25 -2
  96. package/__inner__/esm/components/Calendar/components/CalendarItem/CalendarItemContext.d.ts +1 -0
  97. package/__inner__/esm/components/Calendar/components/CalendarItem/CalendarItemContext.js +1 -0
  98. package/__inner__/esm/components/Calendar/components/CalendarModeRange/CalendarModeRange.js +70 -15
  99. package/__inner__/esm/components/Calendar/components/CalendarModeSingle/CalendarModeSingle.js +64 -18
  100. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/CalendarSwitcher.js +6 -7
  101. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/CalendarSwitcherText.d.ts +3 -0
  102. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/CalendarSwitcherText.js +9 -0
  103. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/index.d.ts +2 -0
  104. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/index.js +2 -0
  105. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/types.d.ts +4 -0
  106. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/CalendarSwitcherText/types.js +1 -0
  107. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/index.d.ts +1 -0
  108. package/__inner__/esm/components/Calendar/components/CalendarSwitcher/components/index.js +1 -0
  109. package/__inner__/esm/components/Calendar/constants.d.ts +2 -0
  110. package/__inner__/esm/components/Calendar/constants.js +6 -0
  111. package/__inner__/esm/components/Calendar/index.d.ts +1 -0
  112. package/__inner__/esm/components/Calendar/index.js +1 -0
  113. package/__inner__/esm/components/Calendar/types.d.ts +13 -5
  114. package/__inner__/esm/components/Calendar/utils.d.ts +10 -1
  115. package/__inner__/esm/components/Calendar/utils.js +9 -0
  116. package/__inner__/esm/components/DatePicker/components/DateInput/DateInput.js +3 -2
  117. package/__inner__/esm/components/DatePicker/components/DateInput/types.d.ts +6 -2
  118. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -1
  119. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +67 -7
  120. package/__inner__/esm/components/DatePicker/components/DatePickerModeDate/DatePickerModeDate.js +33 -21
  121. package/__inner__/esm/components/DatePicker/components/DatePickerModeDateRange/DatePickerModeDateRange.js +68 -45
  122. package/__inner__/esm/components/DatePicker/constants.d.ts +2 -0
  123. package/__inner__/esm/components/DatePicker/constants.js +3 -0
  124. package/__inner__/esm/components/DatePicker/types.d.ts +10 -6
  125. package/__inner__/esm/components/DatePicker/types.js +2 -0
  126. package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +2 -1
  127. package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.js +18 -5
  128. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +2 -1
  129. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +6 -5
  130. package/__inner__/esm/components/DatePicker/utils/getCommonCalendarProps/getCommonCalendarProps.js +2 -2
  131. package/__inner__/esm/components/DatePicker/utils/index.d.ts +2 -0
  132. package/__inner__/esm/components/DatePicker/utils/index.js +2 -0
  133. package/__inner__/esm/components/DatePicker/utils/isValidDateString/isValidDateString.d.ts +2 -1
  134. package/__inner__/esm/components/DatePicker/utils/isValidDateString/isValidDateString.js +8 -7
  135. package/__inner__/esm/components/DatePicker/utils/maskPastedDate/index.d.ts +1 -0
  136. package/__inner__/esm/components/DatePicker/utils/maskPastedDate/index.js +1 -0
  137. package/__inner__/esm/components/DatePicker/utils/maskPastedDate/maskPastedDate.d.ts +6 -0
  138. package/__inner__/esm/components/DatePicker/utils/maskPastedDate/maskPastedDate.js +39 -0
  139. package/__inner__/esm/components/DatePicker/utils/parseDateString/index.d.ts +1 -0
  140. package/__inner__/esm/components/DatePicker/utils/parseDateString/index.js +1 -0
  141. package/__inner__/esm/components/DatePicker/utils/parseDateString/parseDateString.d.ts +6 -0
  142. package/__inner__/esm/components/DatePicker/utils/parseDateString/parseDateString.js +62 -0
  143. package/__inner__/esm/components/Grid/Grid.d.ts +2 -1
  144. package/__inner__/esm/components/Grid/GridItem.d.ts +2 -1
  145. package/__inner__/esm/components/ListCardItem/hooks/useListCardItemRatio.js +10 -14
  146. package/__inner__/esm/components/SectionMessage/SectionMessage.css +6 -0
  147. package/__inner__/esm/components/SectionMessage/SectionMessage.js +8 -5
  148. package/__inner__/esm/components/SectionMessage/config.d.ts +2 -3
  149. package/__inner__/esm/components/SectionMessage/config.js +6 -21
  150. package/__inner__/esm/components/SectionMessage/constants.d.ts +3 -0
  151. package/__inner__/esm/components/SectionMessage/constants.js +6 -0
  152. package/__inner__/esm/components/SectionMessage/types.d.ts +6 -1
  153. package/__inner__/esm/components/SectionMessage/types.js +1 -0
  154. package/__inner__/esm/components/Stack/Stack.css +3 -0
  155. package/__inner__/esm/components/Stack/Stack.js +3 -2
  156. package/__inner__/esm/components/Stack/constants.d.ts +1 -0
  157. package/__inner__/esm/components/Stack/constants.js +1 -0
  158. package/__inner__/esm/components/Stack/types.d.ts +4 -0
  159. package/__inner__/esm/components/Stack/types.js +1 -0
  160. package/__inner__/esm/hooks/useDevEffect/index.d.ts +1 -0
  161. package/__inner__/esm/hooks/useDevEffect/index.js +1 -0
  162. package/__inner__/esm/hooks/useDevEffect/useDevEffect.d.ts +3 -0
  163. package/__inner__/esm/hooks/useDevEffect/useDevEffect.js +9 -0
  164. package/__inner__/esm/hooks/useIntersectionObserver/index.d.ts +2 -0
  165. package/__inner__/esm/hooks/useIntersectionObserver/index.js +2 -0
  166. package/__inner__/esm/hooks/useIntersectionObserver/types.d.ts +29 -0
  167. package/__inner__/esm/hooks/useIntersectionObserver/types.js +1 -0
  168. package/__inner__/esm/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +6 -0
  169. package/__inner__/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +77 -0
  170. package/__inner__/esm/locale/locale.js +39 -3
  171. package/__inner__/esm/utils/array/createFilled/createFilledArray.d.ts +1 -1
  172. package/__inner__/esm/utils/array/createFilled/createFilledArray.js +6 -1
  173. package/__inner__/esm/utils/react/extractRef.d.ts +2 -0
  174. package/__inner__/esm/utils/react/extractRef.js +7 -0
  175. package/__inner__/esm/utils/react/index.d.ts +1 -0
  176. package/__inner__/esm/utils/react/index.js +1 -0
  177. package/package.json +4 -4
  178. package/useDevEffect/package.json +5 -0
  179. package/useIntersectionObserver/package.json +5 -0
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DATE_PICKER_DEFAULT_MODE = exports.DATE_PICKER_DEFAULT_SIZE = void 0;
3
+ exports.DATE_PICKER_DEFAULT_INITIAL_STEP = exports.DATE_PICKER_DEFAULT_STEPS = exports.DATE_PICKER_DEFAULT_MODE = exports.DATE_PICKER_DEFAULT_SIZE = void 0;
4
+ var Calendar_1 = require("../Calendar");
4
5
  exports.DATE_PICKER_DEFAULT_SIZE = 'm';
5
6
  exports.DATE_PICKER_DEFAULT_MODE = 'date';
7
+ exports.DATE_PICKER_DEFAULT_STEPS = Calendar_1.CALENDAR_DEFAULT_STEPS;
8
+ exports.DATE_PICKER_DEFAULT_INITIAL_STEP = Calendar_1.CALENDAR_DEFAULT_INITIAL_STEP;
@@ -1,11 +1,11 @@
1
1
  import type { ChangeEvent, ComponentRef, ReactNode } from 'react';
2
2
  import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
3
3
  import type { WithDisplayName } from '../../types/react';
4
- import type { CalendarProps } from '../Calendar';
4
+ import type { CalendarPropCalendars, CalendarProps, CalendarSteps } from '../Calendar';
5
5
  import type { FieldHintProps } from '../FieldHint';
6
6
  import type { FieldInputProps } from '../FieldInput';
7
7
  import type { FieldLabelProps } from '../FieldLabel';
8
- import type { InputProps, InputSizeVariant } from '../Input';
8
+ import type { InputProps } from '../Input';
9
9
  import type { PopoverBaseProps } from '../Popover';
10
10
  import type { StackProps } from '../Stack';
11
11
  import type { DATE_PICKER_DEFAULT_MODE } from './constants';
@@ -19,7 +19,11 @@ export type DatePickerPropOnChange<MODE extends DatePickerModeVariant> = (date:
19
19
  type InputPropLabel = InputProps['label'];
20
20
  type InputPropRenderLeft = InputProps['renderLeft'];
21
21
  type InputPropRenderRight = InputProps['renderRight'];
22
- type InputPropPlaceholder = InputProps['placeholder'];
22
+ type InputPropPlaceholderString = InputProps['placeholder'];
23
+ type InputPropPlaceholderFunction = (steps: CalendarSteps) => InputPropPlaceholderString;
24
+ export type InputPropPlaceholder = InputPropPlaceholderString | InputPropPlaceholderFunction;
25
+ export declare const datePickerSizeVariant: readonly ["2xs", "xs", "s", "m", "l"];
26
+ export type DatePickerSizeVariant = (typeof datePickerSizeVariant)[number];
23
27
  export type DatePickerPropLabel<MODE> = MODE extends Range ? [InputPropLabel?, InputPropLabel?] | InputPropLabel : InputPropLabel;
24
28
  export type DatePickerPropRenderLeft<MODE> = MODE extends Range ? [InputPropRenderLeft?, InputPropRenderLeft?] | InputPropRenderLeft : InputPropRenderLeft;
25
29
  export type DatePickerPropRenderRight<MODE> = MODE extends Range ? [InputPropRenderRight?, InputPropRenderRight?] | InputPropRenderRight : InputPropRenderRight;
@@ -96,7 +100,7 @@ export type DatePickerProps<MODE extends DatePickerModeVariant = typeof DATE_PIC
96
100
  /** Cвойства FieldHint */
97
101
  hintProps?: Omit<FieldHintProps, 'children'>;
98
102
  /** Размер компонента */
99
- size?: InputSizeVariant;
103
+ size?: DatePickerSizeVariant;
100
104
  /** Если `true` растягивает поле на всю ширину */
101
105
  fullWidth?: boolean;
102
106
  /** Если `true` делает элемент обязательным к заполнению */
@@ -108,8 +112,8 @@ export type DatePickerProps<MODE extends DatePickerModeVariant = typeof DATE_PIC
108
112
  /** Свойства обертки для текстовых полей. Принимает свойства компонента [Stack](https://ozen-ui.bereke.tech/?path=/docs/components-stack--docs) */
109
113
  fieldsProps?: DatePickerPropFieldsProps<MODE>;
110
114
  /** Количество отображаемых календарей в компоненте: один или два */
111
- calendars?: 1 | 2;
112
- } & Pick<CalendarProps, 'minDate' | 'maxDate' | 'exclude'> & Pick<InputProps, 'onKeyDown'>, 'div'>;
115
+ calendars?: CalendarPropCalendars;
116
+ } & Pick<CalendarProps, 'minDate' | 'maxDate' | 'exclude' | 'steps' | 'initialStep'> & Pick<InputProps, 'onKeyDown'>, 'div'>;
113
117
  export type DatePickerComponent = WithDisplayName<(<MODE extends DatePickerModeVariant = typeof DATE_PICKER_DEFAULT_MODE>(props: DatePickerProps<MODE>) => ReactNode)>;
114
118
  export type DatePickerModeComponent<MODE extends DatePickerModeVariant> = WithDisplayName<(props: Omit<DatePickerProps<MODE>, 'mode'>) => ReactNode>;
115
119
  export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.datePickerModeVariant = void 0;
3
+ exports.datePickerSizeVariant = exports.datePickerModeVariant = void 0;
4
+ var types_1 = require("../../types");
4
5
  exports.datePickerModeVariant = ['date', 'date-range'];
6
+ exports.datePickerSizeVariant = types_1.formElementSizeVariant;
@@ -1 +1,2 @@
1
- export declare const formatDateToString: (date: Date | undefined | null) => string;
1
+ import type { CalendarSteps } from '../../../Calendar';
2
+ export declare const formatDateToString: (date: Date | undefined | null, steps: CalendarSteps) => string;
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatDateToString = void 0;
4
- var formatDateToString = function (date) {
4
+ var formatDateToString = function (date, steps) {
5
5
  if (!date) {
6
6
  return '';
7
7
  }
8
- var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
9
- var month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date);
10
- var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
11
- return "".concat(day, ".").concat(month, ".").concat(year);
8
+ var hasYearsStep = steps.includes('years');
9
+ var hasMonthsStep = steps.includes('months');
10
+ var hasDaysStep = steps.includes('days');
11
+ var parts = [];
12
+ if (hasDaysStep) {
13
+ var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
14
+ parts.push(day);
15
+ }
16
+ if (hasMonthsStep) {
17
+ var month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date);
18
+ parts.push(month);
19
+ }
20
+ if (hasYearsStep) {
21
+ var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
22
+ parts.push(year);
23
+ }
24
+ return parts.join('.');
12
25
  };
13
26
  exports.formatDateToString = formatDateToString;
@@ -1 +1,2 @@
1
- export declare const formatStringToDate: (value: string) => Date | null;
1
+ import type { CalendarSteps } from '../../../Calendar';
2
+ export declare const formatStringToDate: (value: string, steps: CalendarSteps) => Date | null;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatStringToDate = void 0;
4
- var tslib_1 = require("tslib");
5
- var formatStringToDate = function (value) {
6
- var _a = tslib_1.__read(value.split('.'), 3), date = _a[0], month = _a[1], year = _a[2];
7
- if (!(date && month && year)) {
4
+ var parseDateString_1 = require("../parseDateString");
5
+ var formatStringToDate = function (value, steps) {
6
+ var parsedDate = (0, parseDateString_1.parseDateString)(value, steps);
7
+ if (!parsedDate) {
8
8
  return null;
9
9
  }
10
- return new Date(+year, +month - 1, +date);
10
+ var day = parsedDate.day, month = parsedDate.month, year = parsedDate.year;
11
+ return new Date(+year, +month - 1, +day);
11
12
  };
12
13
  exports.formatStringToDate = formatStringToDate;
@@ -4,13 +4,13 @@ exports.getCommonCalendarProps = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var getCalendarSizeToFormElement_1 = require("../getCalendarSizeToFormElement");
6
6
  var getCommonCalendarProps = function (props) {
7
- var minDate = props.minDate, maxDate = props.maxDate, exclude = props.exclude, _a = props.size, size = _a === void 0 ? 'm' : _a, ref = props.ref, calendarProps = props.calendarProps;
7
+ var minDate = props.minDate, maxDate = props.maxDate, exclude = props.exclude, _a = props.size, size = _a === void 0 ? 'm' : _a, ref = props.ref, calendarProps = props.calendarProps, steps = props.steps, initialStep = props.initialStep;
8
8
  /** Соотношение размера календаря к размеру элемента контроля */
9
9
  var calendarSize = (0, getCalendarSizeToFormElement_1.getCalendarSizeToFormElement)(size);
10
10
  /** Предотвращаем переход фокуса с текстового поля на интерактивные элементы календаря */
11
11
  var handleMouseDownCalendar = function (e) {
12
12
  e.preventDefault();
13
13
  };
14
- return tslib_1.__assign(tslib_1.__assign({ minDate: minDate, maxDate: maxDate, exclude: exclude, size: calendarSize }, calendarProps), { ref: ref, onMouseDown: handleMouseDownCalendar });
14
+ return tslib_1.__assign(tslib_1.__assign({ minDate: minDate, maxDate: maxDate, exclude: exclude, size: calendarSize }, calendarProps), { ref: ref, onMouseDown: handleMouseDownCalendar, steps: steps, initialStep: initialStep });
15
15
  };
16
16
  exports.getCommonCalendarProps = getCommonCalendarProps;
@@ -6,4 +6,6 @@ export * from './isInExclude';
6
6
  export * from './getCommonPopoverProps';
7
7
  export * from './getCommonCalendarProps';
8
8
  export * from './isValidDateString';
9
+ export * from './maskPastedDate';
10
+ export * from './parseDateString';
9
11
  export * from './useCalendarKeyboard';
@@ -9,4 +9,6 @@ tslib_1.__exportStar(require("./isInExclude"), exports);
9
9
  tslib_1.__exportStar(require("./getCommonPopoverProps"), exports);
10
10
  tslib_1.__exportStar(require("./getCommonCalendarProps"), exports);
11
11
  tslib_1.__exportStar(require("./isValidDateString"), exports);
12
+ tslib_1.__exportStar(require("./maskPastedDate"), exports);
13
+ tslib_1.__exportStar(require("./parseDateString"), exports);
12
14
  tslib_1.__exportStar(require("./useCalendarKeyboard"), exports);
@@ -1 +1,2 @@
1
- export declare const isValidDateString: (value: string | null | undefined) => boolean;
1
+ import type { CalendarSteps } from '../../../Calendar';
2
+ export declare const isValidDateString: (value: string | null | undefined, steps: CalendarSteps) => boolean;
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidDateString = void 0;
4
- var tslib_1 = require("tslib");
5
- var date_1 = require("../../../../utils/date");
6
- var isNotNil_1 = require("../../../../utils/isNotNil");
7
- var isValidDateString = function (value) {
8
- if (!(0, isNotNil_1.isNotNil)(value)) {
4
+ var utils_1 = require("../../../../utils");
5
+ var parseDateString_1 = require("../parseDateString");
6
+ var isValidDateString = function (value, steps) {
7
+ if (!(0, utils_1.isNotNil)(value)) {
9
8
  return false;
10
9
  }
11
- var _a = tslib_1.__read(value.split('.'), 3), date = _a[0], month = _a[1], year = _a[2];
12
- return (value === '' ||
13
- (value.length === 10 && (0, date_1.isValidDate)("".concat(year, "-").concat(month, "-").concat(date))));
10
+ if (value === '') {
11
+ return true;
12
+ }
13
+ var parsedDate = (0, parseDateString_1.parseDateString)(value, steps);
14
+ return !!parsedDate;
14
15
  };
15
16
  exports.isValidDateString = isValidDateString;
@@ -0,0 +1 @@
1
+ export * from './maskPastedDate';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./maskPastedDate"), exports);
@@ -0,0 +1,6 @@
1
+ import type { CalendarSteps } from '../../../Calendar';
2
+ /**
3
+ * Функция для обработки вставленного значения.
4
+ * Умеет обрабатывать форматы DD.MM.YYYY/DDMMYYYY, либо сочетания вида DDMM/DD.MM.
5
+ */
6
+ export declare const maskPastedDate: (value: string, steps: CalendarSteps) => string;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maskPastedDate = void 0;
4
+ /**
5
+ * Функция для обработки вставленного значения.
6
+ * Умеет обрабатывать форматы DD.MM.YYYY/DDMMYYYY, либо сочетания вида DDMM/DD.MM.
7
+ */
8
+ var maskPastedDate = function (value, steps) {
9
+ var digits = value.replace(/\D/g, '').slice(0, 8); // максимум 8 цифр
10
+ var hasYearsStep = steps.includes('years');
11
+ var hasMonthsStep = steps.includes('months');
12
+ var hasDaysStep = steps.includes('days');
13
+ // DD
14
+ if (hasDaysStep && !hasMonthsStep && !hasYearsStep) {
15
+ return digits.slice(0, 2);
16
+ }
17
+ // MM
18
+ if (!hasDaysStep && hasMonthsStep && !hasYearsStep) {
19
+ return digits.slice(0, 2);
20
+ }
21
+ // YYYY
22
+ if (!hasDaysStep && !hasMonthsStep && hasYearsStep) {
23
+ return digits.slice(0, 4);
24
+ }
25
+ // DD.MM.YYYY
26
+ if (hasDaysStep && hasMonthsStep && hasYearsStep) {
27
+ return "".concat(digits.slice(0, 2), ".").concat(digits.slice(2, 4), ".").concat(digits.slice(4, 8));
28
+ }
29
+ // DD.MM
30
+ if (hasDaysStep && hasMonthsStep && !hasYearsStep) {
31
+ return "".concat(digits.slice(0, 2), ".").concat(digits.slice(2, 4));
32
+ }
33
+ // DD.YYYY
34
+ if (hasDaysStep && !hasMonthsStep && hasYearsStep) {
35
+ return "".concat(digits.slice(0, 2), ".").concat(digits.slice(2, 6));
36
+ }
37
+ // MM.YYYY
38
+ if (!hasDaysStep && hasMonthsStep && hasYearsStep) {
39
+ return "".concat(digits.slice(0, 2), ".").concat(digits.slice(2, 6));
40
+ }
41
+ throw new Error('Не удалось сделать маску для значения');
42
+ };
43
+ exports.maskPastedDate = maskPastedDate;
@@ -0,0 +1 @@
1
+ export * from './parseDateString';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./parseDateString"), exports);
@@ -0,0 +1,6 @@
1
+ import type { CalendarSteps } from '../../../Calendar';
2
+ export declare const parseDateString: (value: string | null | undefined, steps: CalendarSteps) => {
3
+ year: string;
4
+ month: string;
5
+ day: string;
6
+ } | null;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDateString = void 0;
4
+ var utils_1 = require("../../../../utils");
5
+ var parseDateString = function (value, steps) {
6
+ if (!(0, utils_1.isNotNil)(value)) {
7
+ return null;
8
+ }
9
+ if (value === '') {
10
+ return null;
11
+ }
12
+ var hasYearsSteps = steps.includes('years');
13
+ var hasMonthsSteps = steps.includes('months');
14
+ var hasDaysSteps = steps.includes('days');
15
+ var splitted = value.split('.');
16
+ var day;
17
+ var month;
18
+ var year;
19
+ var offset = 0;
20
+ if (hasDaysSteps) {
21
+ day = splitted[offset];
22
+ offset += 1;
23
+ }
24
+ if (hasMonthsSteps) {
25
+ month = splitted[offset];
26
+ offset += 1;
27
+ }
28
+ if (hasYearsSteps) {
29
+ year = splitted[offset];
30
+ }
31
+ var parts = [];
32
+ if (hasYearsSteps) {
33
+ parts.push(year);
34
+ }
35
+ else {
36
+ var now = new Date();
37
+ parts.push(now.getFullYear().toString());
38
+ }
39
+ if (hasMonthsSteps) {
40
+ parts.push(month);
41
+ }
42
+ else {
43
+ // 3 месяц для кейса, где пользователь вводит 31 день месяца
44
+ parts.push('03');
45
+ }
46
+ if (hasDaysSteps) {
47
+ parts.push(day);
48
+ }
49
+ else {
50
+ parts.push('01');
51
+ }
52
+ var filteredParts = parts.filter(function (part) { return part !== undefined; });
53
+ if (filteredParts.length !== 3) {
54
+ return null;
55
+ }
56
+ var stringDate = filteredParts.join('-');
57
+ if (stringDate.length !== 10 || !(0, utils_1.isValidDate)(stringDate)) {
58
+ return null;
59
+ }
60
+ return {
61
+ year: parts[0],
62
+ month: parts[1],
63
+ day: parts[2],
64
+ };
65
+ };
66
+ exports.parseDateString = parseDateString;
@@ -1,5 +1,5 @@
1
1
  import './Grid.css';
2
- import type { ReactNode, ElementType } from 'react';
2
+ import type { ReactNode, ElementType, ComponentRef } from 'react';
3
3
  import type { ResponsiveValue } from '../../types/ResponsiveValue';
4
4
  import { type PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
5
5
  export declare const gridColsVariant: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
@@ -30,4 +30,5 @@ export type GridBaseProps = {
30
30
  className?: string;
31
31
  };
32
32
  export type GridProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<GridBaseProps, As>;
33
+ export type GridRef<As extends ElementType = 'div'> = ComponentRef<As>;
33
34
  export declare const Grid: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<GridBaseProps, "div", "as">;
@@ -1,5 +1,5 @@
1
1
  import './Grid.css';
2
- import type { ReactNode, ElementType } from 'react';
2
+ import type { ReactNode, ElementType, ComponentRef } from 'react';
3
3
  import type { ResponsiveValue } from '../../types/ResponsiveValue';
4
4
  import { type PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
5
5
  export declare const gridItemColVariant: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
@@ -22,4 +22,5 @@ export type GridItemBaseProps = {
22
22
  className?: string;
23
23
  };
24
24
  export type GridItemProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<GridItemBaseProps, As>;
25
+ export type GridItemRef<As extends ElementType = 'div'> = ComponentRef<As>;
25
26
  export declare const GridItem: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<GridItemBaseProps, "div", "as">;
@@ -1,22 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useListCardItemRatio = void 0;
4
- var react_1 = require("react");
5
4
  var logger_1 = require("@ozen-ui/logger");
6
- var environment_1 = require("../../../constants/environment");
5
+ var useDevEffect_1 = require("../../../hooks/useDevEffect");
7
6
  var useListCardItemRatio = function (contentTrailingRatio) {
8
- if (environment_1.isDev) {
9
- // eslint-disable-next-line react-hooks/rules-of-hooks
10
- (0, react_1.useEffect)(function () {
11
- if (contentTrailingRatio < 0) {
12
- logger_1.logger.error('Свойство «contentTrailingRatio» у компонента ListCardItem не может быть меньше 0');
13
- return;
14
- }
15
- if (contentTrailingRatio > 1) {
16
- logger_1.logger.error('Свойство «contentTrailingRatio» у компонента ListCardItem не может быть больше 1');
17
- }
18
- }, [contentTrailingRatio]);
19
- }
7
+ (0, useDevEffect_1.useDevEffect)(function () {
8
+ if (contentTrailingRatio < 0) {
9
+ logger_1.logger.error('Свойство «contentTrailingRatio» у компонента ListCardItem не может быть меньше 0');
10
+ return;
11
+ }
12
+ if (contentTrailingRatio > 1) {
13
+ logger_1.logger.error('Свойство «contentTrailingRatio» у компонента ListCardItem не может быть больше 1');
14
+ }
15
+ }, [contentTrailingRatio]);
20
16
  var contentRatio = contentTrailingRatio * 100;
21
17
  var trailingRatio = 100 - contentRatio;
22
18
  return { content: contentRatio, trailing: trailingRatio };
@@ -42,6 +42,12 @@
42
42
  --section-message-button-color: var(--color-content-error);
43
43
  --section-message-button-color-hover: var(--color-content-error-dark);
44
44
  }
45
+ .SectionMessage_status_action {
46
+ --section-message-icon-color: var(--color-content-action);
47
+ --section-message-background-color: var(--color-background-action-light);
48
+ --section-message-button-color: var(--color-content-action);
49
+ --section-message-button-color-hover: var(--color-content-action-dark);
50
+ }
45
51
  .SectionMessage_size_xs {
46
52
  --section-message-padding: 12px;
47
53
  --section-message-column-gap: var(--spacing-2xs);
@@ -6,18 +6,21 @@ require("./modules/SectionMessageButton/SectionMessageButton.css");
6
6
  require("./SectionMessage.css");
7
7
  var react_1 = tslib_1.__importStar(require("react"));
8
8
  var useThemeProps_1 = require("../../hooks/useThemeProps");
9
- var classname_1 = require("../../utils/classname");
9
+ var utils_1 = require("../../utils");
10
10
  var config_1 = require("./config");
11
11
  var constants_1 = require("./constants");
12
12
  var SectionMessageContext_1 = require("./SectionMessageContext");
13
- exports.cnSectionMessage = (0, classname_1.cn)('SectionMessage');
13
+ exports.cnSectionMessage = (0, utils_1.cn)('SectionMessage');
14
14
  exports.SectionMessage = (0, react_1.forwardRef)(function (inProps, ref) {
15
15
  var props = (0, useThemeProps_1.useThemeProps)({
16
16
  props: inProps,
17
17
  name: 'SectionMessage',
18
18
  });
19
- var _a = props.status, status = _a === void 0 ? constants_1.SECTION_MESSAGE_DEFAULT_STATUS : _a, _b = props.size, size = _b === void 0 ? constants_1.SECTION_MESSAGE_DEFAULT_SIZE : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, children = props.children, action = props.action, title = props.title, className = props.className, otherProps = tslib_1.__rest(props, ["status", "size", "showIcon", "children", "action", "title", "className"]);
20
- var iconSize = size === 'm' || size === 'l' ? 'm' : 's';
19
+ var _a = props.status, status = _a === void 0 ? constants_1.SECTION_MESSAGE_DEFAULT_STATUS : _a, _b = props.size, size = _b === void 0 ? constants_1.SECTION_MESSAGE_DEFAULT_SIZE : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, iconProp = props.icon, children = props.children, action = props.action, title = props.title, className = props.className, otherProps = tslib_1.__rest(props, ["status", "size", "showIcon", "icon", "children", "action", "title", "className"]);
20
+ var icon = (0, utils_1.renderContent)({
21
+ content: iconProp !== null && iconProp !== void 0 ? iconProp : config_1.SECTION_MESSAGE_ICON_BY_STATUS[status],
22
+ props: { size: constants_1.SECTION_MESSAGE_SIZE_TO_ICON_SIZE[size] },
23
+ });
21
24
  var resolveAction = function (action) {
22
25
  var actionProps = {
23
26
  variant: 'function',
@@ -36,7 +39,7 @@ exports.SectionMessage = (0, react_1.forwardRef)(function (inProps, ref) {
36
39
  size: size,
37
40
  } },
38
41
  react_1.default.createElement("div", tslib_1.__assign({ className: (0, exports.cnSectionMessage)({ status: status, size: size }, [className]), role: "alert" }, otherProps, { ref: ref }),
39
- showIcon && (react_1.default.createElement("div", { className: (0, exports.cnSectionMessage)('Icon') }, config_1.SECTION_MESSAGE_ICON_BY_STATUS[status][iconSize])),
42
+ showIcon && react_1.default.createElement("div", { className: (0, exports.cnSectionMessage)('Icon') }, icon),
40
43
  react_1.default.createElement("div", { className: (0, exports.cnSectionMessage)('Content') },
41
44
  title && react_1.default.createElement("div", { className: (0, exports.cnSectionMessage)('Title') }, title),
42
45
  children && (react_1.default.createElement("div", { className: (0, exports.cnSectionMessage)('Body') }, children)),
@@ -1,3 +1,2 @@
1
- import type { ReactNode } from 'react';
2
- import type { SectionMessageStatusVariant } from './types';
3
- export declare const SECTION_MESSAGE_ICON_BY_STATUS: Readonly<Record<SectionMessageStatusVariant, Record<'s' | 'm', ReactNode>>>;
1
+ import type { SectionMessageIconType, SectionMessageStatusVariant } from './types';
2
+ export declare const SECTION_MESSAGE_ICON_BY_STATUS: Readonly<Record<SectionMessageStatusVariant, SectionMessageIconType>>;
@@ -1,28 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SECTION_MESSAGE_ICON_BY_STATUS = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = tslib_1.__importDefault(require("react"));
6
4
  var icons_1 = require("@ozen-ui/icons");
7
5
  exports.SECTION_MESSAGE_ICON_BY_STATUS = {
8
- neutral: {
9
- m: react_1.default.createElement(icons_1.InfoCircleOutlineIcon, { size: "m" }),
10
- s: react_1.default.createElement(icons_1.InfoCircleOutlineIcon, { size: "s" }),
11
- },
12
- info: {
13
- m: react_1.default.createElement(icons_1.InfoCircleOutlineIcon, { size: "m" }),
14
- s: react_1.default.createElement(icons_1.InfoCircleOutlineIcon, { size: "s" }),
15
- },
16
- warning: {
17
- m: react_1.default.createElement(icons_1.WarningTriangleOutlineIcon, { size: "m" }),
18
- s: react_1.default.createElement(icons_1.WarningTriangleOutlineIcon, { size: "s" }),
19
- },
20
- success: {
21
- m: react_1.default.createElement(icons_1.CheckCircleOutlineIcon, { size: "m" }),
22
- s: react_1.default.createElement(icons_1.CheckCircleOutlineIcon, { size: "s" }),
23
- },
24
- error: {
25
- m: react_1.default.createElement(icons_1.WarningCircleOutlineIcon, { size: "m" }),
26
- s: react_1.default.createElement(icons_1.WarningCircleOutlineIcon, { size: "s" }),
27
- },
6
+ neutral: icons_1.InfoCircleOutlineIcon,
7
+ info: icons_1.InfoCircleOutlineIcon,
8
+ warning: icons_1.WarningTriangleOutlineIcon,
9
+ success: icons_1.CheckCircleOutlineIcon,
10
+ error: icons_1.WarningCircleOutlineIcon,
11
+ action: icons_1.InfoCircleOutlineIcon,
28
12
  };
@@ -1,2 +1,5 @@
1
+ import type { IconSize } from '@ozen-ui/icons';
2
+ import type { SectionMessageSizeVariant } from './types';
1
3
  export declare const SECTION_MESSAGE_DEFAULT_STATUS = "info";
2
4
  export declare const SECTION_MESSAGE_DEFAULT_SIZE = "m";
5
+ export declare const SECTION_MESSAGE_SIZE_TO_ICON_SIZE: Readonly<Record<SectionMessageSizeVariant, IconSize>>;
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SECTION_MESSAGE_DEFAULT_SIZE = exports.SECTION_MESSAGE_DEFAULT_STATUS = void 0;
3
+ exports.SECTION_MESSAGE_SIZE_TO_ICON_SIZE = exports.SECTION_MESSAGE_DEFAULT_SIZE = exports.SECTION_MESSAGE_DEFAULT_STATUS = void 0;
4
4
  exports.SECTION_MESSAGE_DEFAULT_STATUS = 'info';
5
5
  exports.SECTION_MESSAGE_DEFAULT_SIZE = 'm';
6
+ exports.SECTION_MESSAGE_SIZE_TO_ICON_SIZE = {
7
+ xs: 's',
8
+ s: 's',
9
+ m: 'm',
10
+ l: 'm',
11
+ };
@@ -1,10 +1,13 @@
1
1
  import type { ComponentRef, ReactElement, ReactNode } from 'react';
2
+ import type { IconProps } from '@ozen-ui/icons';
2
3
  import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
4
+ import type { RenderContentType } from '../../utils';
3
5
  import type { ButtonProps } from '../ButtonNext';
4
- export declare const sectionMessageStatusVariant: readonly ["success", "error", "warning", "info", "neutral"];
6
+ export declare const sectionMessageStatusVariant: readonly ["success", "error", "warning", "info", "neutral", "action"];
5
7
  export type SectionMessageStatusVariant = (typeof sectionMessageStatusVariant)[number];
6
8
  export declare const sectionMessageSizeVariant: readonly ["xs", "s", "m", "l"];
7
9
  export type SectionMessageSizeVariant = (typeof sectionMessageSizeVariant)[number];
10
+ export type SectionMessageIconType = RenderContentType<IconProps>['content'];
8
11
  export type SectionMessageRef = ComponentRef<'div'>;
9
12
  export type SectionMessageProps = ExtendableComponentPropsWithRef<{
10
13
  /**
@@ -17,6 +20,8 @@ export type SectionMessageProps = ExtendableComponentPropsWithRef<{
17
20
  * @default true
18
21
  */
19
22
  showIcon?: boolean;
23
+ /** Кастомная иконка */
24
+ icon?: SectionMessageIconType;
20
25
  /**
21
26
  * Размер
22
27
  * @default m
@@ -7,5 +7,6 @@ exports.sectionMessageStatusVariant = [
7
7
  'warning',
8
8
  'info',
9
9
  'neutral',
10
+ 'action',
10
11
  ];
11
12
  exports.sectionMessageSizeVariant = ['xs', 's', 'm', 'l'];
@@ -9,6 +9,9 @@
9
9
  .Stack-Item {
10
10
  display: inline-block;
11
11
  }
12
+ .Stack_display_block {
13
+ display: flex;
14
+ }
12
15
  .Stack_direction_row {
13
16
  flex-direction: row;
14
17
  }
@@ -16,7 +16,7 @@ exports.Stack = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(f
16
16
  props: inProps,
17
17
  name: 'Stack',
18
18
  });
19
- var _a = props.as, Tag = _a === void 0 ? constants_1.STACK_DEFAULT_TAG : _a, _b = props.direction, direction = _b === void 0 ? 'row' : _b, divider = props.divider, _c = props.shouldWrapChildren, shouldWrapChildren = _c === void 0 ? false : _c, fullWidth = props.fullWidth, children = props.children, align = props.align, justify = props.justify, gap = props.gap, wrap = props.wrap, className = props.className, other = tslib_1.__rest(props, ["as", "direction", "divider", "shouldWrapChildren", "fullWidth", "children", "align", "justify", "gap", "wrap", "className"]);
19
+ var _a = props.as, Tag = _a === void 0 ? constants_1.STACK_DEFAULT_TAG : _a, _b = props.direction, direction = _b === void 0 ? 'row' : _b, divider = props.divider, _c = props.shouldWrapChildren, shouldWrapChildren = _c === void 0 ? false : _c, _d = props.display, display = _d === void 0 ? constants_1.STACK_DEFAULT_DISPLAY : _d, fullWidth = props.fullWidth, children = props.children, align = props.align, justify = props.justify, gap = props.gap, wrap = props.wrap, className = props.className, other = tslib_1.__rest(props, ["as", "direction", "divider", "shouldWrapChildren", "display", "fullWidth", "children", "align", "justify", "gap", "wrap", "className"]);
20
20
  var childNodes = react_1.Children.toArray(children);
21
21
  if (!childNodes.length) {
22
22
  return null;
@@ -38,6 +38,7 @@ exports.Stack = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(f
38
38
  justify: justify,
39
39
  fullWidth: fullWidth,
40
40
  wrap: wrap,
41
+ display: display === 'inline' ? undefined : display,
41
42
  }), (0, utils_1.generateDirectionCn)(exports.cnStack, direction), (0, utils_1.generateGapCn)(exports.cnStack, gap), className), ref: ref }), resolveChildren()));
42
43
  });
43
44
  exports.Stack.displayName = 'Stack';
@@ -1 +1,2 @@
1
1
  export declare const STACK_DEFAULT_TAG = "div";
2
+ export declare const STACK_DEFAULT_DISPLAY = "inline";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STACK_DEFAULT_TAG = void 0;
3
+ exports.STACK_DEFAULT_DISPLAY = exports.STACK_DEFAULT_TAG = void 0;
4
4
  exports.STACK_DEFAULT_TAG = 'div';
5
+ exports.STACK_DEFAULT_DISPLAY = 'inline';
@@ -3,6 +3,7 @@ import type { ResponsiveValue } from '../../types/ResponsiveValue';
3
3
  import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
4
4
  import type { STACK_DEFAULT_TAG } from './constants';
5
5
  export declare const stackGapVariant: readonly ["0", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "8xl"];
6
+ export declare const stackDisplayVariant: readonly ["inline", "block"];
6
7
  export declare const stackDirectionVariant: readonly ["row", "column", "rowReverse", "columnReverse"];
7
8
  export declare const stackAlignVariant: readonly ["center", "start", "end", "baseline"];
8
9
  export declare const stackJustifyVariant: readonly ["start", "center", "end", "spaceBetween", "spaceAround"];
@@ -10,9 +11,12 @@ export type StackGapVariant = (typeof stackGapVariant)[number];
10
11
  export type StackDirectionVariant = (typeof stackDirectionVariant)[number];
11
12
  export type StackAlignVariant = (typeof stackAlignVariant)[number];
12
13
  export type StackJustifyVariant = (typeof stackJustifyVariant)[number];
14
+ export type StackDisplayVariant = (typeof stackDisplayVariant)[number];
13
15
  export type StackBaseProps = {
14
16
  /** Направление */
15
17
  direction?: ResponsiveValue<StackDirectionVariant>;
18
+ /** Display */
19
+ display?: StackDisplayVariant;
16
20
  /** Выравнивание */
17
21
  align?: StackAlignVariant;
18
22
  /** Пространство между элементами */