kui-complex 0.0.97 → 0.0.99

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 (92) hide show
  1. package/Avatar/cjs/index.js +4 -4
  2. package/Avatar/cjs/index.js.map +1 -1
  3. package/Avatar/index.js +4 -4
  4. package/Avatar/index.js.map +1 -1
  5. package/ButtonSelect/cjs/index.js +16 -59
  6. package/ButtonSelect/cjs/index.js.map +1 -1
  7. package/ButtonSelect/index.js +1 -26
  8. package/ButtonSelect/index.js.map +1 -1
  9. package/ButtonsPanel/cjs/index.js +2 -22
  10. package/ButtonsPanel/cjs/index.js.map +1 -1
  11. package/ButtonsPanel/index.js +1 -21
  12. package/ButtonsPanel/index.js.map +1 -1
  13. package/CalendarHeaderWithSelect/cjs/index.js +18 -61
  14. package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
  15. package/CalendarHeaderWithSelect/index.js +1 -26
  16. package/CalendarHeaderWithSelect/index.js.map +1 -1
  17. package/FileItem/cjs/index.js +2 -22
  18. package/FileItem/cjs/index.js.map +1 -1
  19. package/FileItem/index.js +1 -21
  20. package/FileItem/index.js.map +1 -1
  21. package/InputFile/cjs/index.js +2 -22
  22. package/InputFile/cjs/index.js.map +1 -1
  23. package/InputFile/index.js +1 -21
  24. package/InputFile/index.js.map +1 -1
  25. package/InputMultiSelect/cjs/index.js +14 -57
  26. package/InputMultiSelect/cjs/index.js.map +1 -1
  27. package/InputMultiSelect/index.js +1 -26
  28. package/InputMultiSelect/index.js.map +1 -1
  29. package/InputPassword/cjs/index.js +4 -7
  30. package/InputPassword/cjs/index.js.map +1 -1
  31. package/InputPassword/index.js +1 -4
  32. package/InputPassword/index.js.map +1 -1
  33. package/InputPhoneWithForm/cjs/index.js +4 -48
  34. package/InputPhoneWithForm/cjs/index.js.map +1 -1
  35. package/InputPhoneWithForm/index.js +1 -26
  36. package/InputPhoneWithForm/index.js.map +1 -1
  37. package/InputSelect/cjs/index.js +15 -58
  38. package/InputSelect/cjs/index.js.map +1 -1
  39. package/InputSelect/index.js +1 -26
  40. package/InputSelect/index.js.map +1 -1
  41. package/InputSelectBase/cjs/index.js +12 -55
  42. package/InputSelectBase/cjs/index.js.map +1 -1
  43. package/InputSelectBase/index.js +1 -26
  44. package/InputSelectBase/index.js.map +1 -1
  45. package/InputSelectWithController/cjs/index.js +16 -59
  46. package/InputSelectWithController/cjs/index.js.map +1 -1
  47. package/InputSelectWithController/index.js +1 -26
  48. package/InputSelectWithController/index.js.map +1 -1
  49. package/InputWithAutocomplete/cjs/index.js +13 -68
  50. package/InputWithAutocomplete/cjs/index.js.map +1 -1
  51. package/InputWithAutocomplete/index.js +1 -38
  52. package/InputWithAutocomplete/index.js.map +1 -1
  53. package/InputWithDatePicker/cjs/index.js +28 -85
  54. package/InputWithDatePicker/cjs/index.js.map +1 -1
  55. package/InputWithDatePicker/index.js +1 -40
  56. package/InputWithDatePicker/index.js.map +1 -1
  57. package/InputWithMonthPicker/cjs/index.js +3 -16
  58. package/InputWithMonthPicker/cjs/index.js.map +1 -1
  59. package/InputWithMonthPicker/index.js +1 -14
  60. package/InputWithMonthPicker/index.js.map +1 -1
  61. package/Link/cjs/index.js +2 -22
  62. package/Link/cjs/index.js.map +1 -1
  63. package/Link/index.js +1 -21
  64. package/Link/index.js.map +1 -1
  65. package/MenuPanel/cjs/index.js +2 -17
  66. package/MenuPanel/cjs/index.js.map +1 -1
  67. package/MenuPanel/cjs/package.json +0 -1
  68. package/MenuPanel/index.js +2 -16
  69. package/MenuPanel/index.js.map +1 -1
  70. package/MenuPanel/package.json +0 -1
  71. package/MobileInputWithMonthPicker/cjs/index.js +3 -16
  72. package/MobileInputWithMonthPicker/cjs/index.js.map +1 -1
  73. package/MobileInputWithMonthPicker/index.js +1 -14
  74. package/MobileInputWithMonthPicker/index.js.map +1 -1
  75. package/SelectMonth/cjs/index.js +16 -59
  76. package/SelectMonth/cjs/index.js.map +1 -1
  77. package/SelectMonth/index.js +1 -26
  78. package/SelectMonth/index.js.map +1 -1
  79. package/SelectYear/cjs/index.js +16 -59
  80. package/SelectYear/cjs/index.js.map +1 -1
  81. package/SelectYear/index.js +1 -26
  82. package/SelectYear/index.js.map +1 -1
  83. package/TestForm/cjs/index.js +50 -92
  84. package/TestForm/cjs/index.js.map +1 -1
  85. package/TestForm/index.js +1 -43
  86. package/TestForm/index.js.map +1 -1
  87. package/cjs/index.js +21 -145
  88. package/cjs/index.js.map +1 -1
  89. package/index.d.ts +8 -32
  90. package/index.js +6 -115
  91. package/index.js.map +1 -1
  92. package/package.json +1 -1
@@ -4,11 +4,12 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var reactHookForm = require('react-hook-form');
5
5
  var yup = require('yup');
6
6
  var yup$1 = require('@hookform/resolvers/yup');
7
- var React = require('react');
7
+ var react = require('react');
8
8
  var kuiBasic = require('kui-basic');
9
9
  var jsxRuntime$1 = require('@emotion/react/jsx-runtime');
10
10
  var styled = require('@emotion/styled');
11
11
  var kuiIcon = require('kui-icon');
12
+ var kuiUtils = require('kui-utils');
12
13
  var DatePicker = require('react-datepicker');
13
14
  var luxon = require('luxon');
14
15
  var _ = require('lodash');
@@ -35,7 +36,6 @@ function _interopNamespace(e) {
35
36
  }
36
37
 
37
38
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
38
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
39
39
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
40
40
  var DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
41
41
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
@@ -84,7 +84,7 @@ function __makeTemplateObject(cooked, raw) {
84
84
  return cooked;
85
85
  }
86
86
 
87
- var InputWithController = React.forwardRef(function (_a, ref) {
87
+ var InputWithController = react.forwardRef(function (_a, ref) {
88
88
  var form = _a.form, name = _a.name, error = _a.error, value = _a.value, type = _a.type, inputProps = __rest(_a, ["form", "name", "error", "value", "type"]);
89
89
  var handleChange = function (e, field) {
90
90
  var _a;
@@ -108,10 +108,10 @@ var InputWithController = React.forwardRef(function (_a, ref) {
108
108
  } }));
109
109
  });
110
110
 
111
- var InputDropdown = React.forwardRef(function (props, ref) {
111
+ var InputDropdown = react.forwardRef(function (props, ref) {
112
112
  var isOpen = props.isOpen, handleClose = props.handleClose, buttonRef = props.buttonRef, children = props.children, endComponent = props.endComponent, otherProps = __rest(props, ["isOpen", "handleClose", "buttonRef", "children", "endComponent"]);
113
- var _a = React.useState(false), isScrollable = _a[0], setIsScrollable = _a[1];
114
- var dropdownRef = React.useRef(null);
113
+ var _a = react.useState(false), isScrollable = _a[0], setIsScrollable = _a[1];
114
+ var dropdownRef = react.useRef(null);
115
115
  var closePopUp = function (e) {
116
116
  if (dropdownRef.current && buttonRef && buttonRef.current) {
117
117
  if (!dropdownRef.current.contains(e.target) &&
@@ -120,13 +120,13 @@ var InputDropdown = React.forwardRef(function (props, ref) {
120
120
  }
121
121
  }
122
122
  };
123
- React.useEffect(function () {
123
+ react.useEffect(function () {
124
124
  document.addEventListener("click", closePopUp);
125
125
  return function () {
126
126
  document.removeEventListener("click", closePopUp);
127
127
  };
128
128
  });
129
- React.useEffect(function () {
129
+ react.useEffect(function () {
130
130
  var _a;
131
131
  if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
132
132
  if (isOpen) {
@@ -168,7 +168,7 @@ var ScrollingContainer = styled__default["default"].div(templateObject_3$3 || (t
168
168
  }, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.grey.thirty);
169
169
  var templateObject_1$e, templateObject_2$7, templateObject_3$3;
170
170
 
171
- var InputSelectDropdown = React.forwardRef(function (_a, ref) {
171
+ var InputSelectDropdown = react.forwardRef(function (_a, ref) {
172
172
  var options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue, renderOption = _a.renderOption;
173
173
  var handleClick = function (option) {
174
174
  if (!option.disabled) {
@@ -187,37 +187,12 @@ var OptionWrapper = styled__default["default"].div(templateObject_1$d || (templa
187
187
  var StyledDropdown = styled__default["default"](InputDropdown)(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"], ["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"])));
188
188
  var templateObject_1$d, templateObject_2$6;
189
189
 
190
- function setRef(ref, value) {
191
- if (typeof ref === "function") {
192
- ref(value);
193
- }
194
- else if (ref) {
195
- ref.current = value;
196
- }
197
- }
198
- function useForkRef() {
199
- var refs = [];
200
- for (var _i = 0; _i < arguments.length; _i++) {
201
- refs[_i] = arguments[_i];
202
- }
203
- return React__namespace.useMemo(function () {
204
- if (refs.every(function (ref) { return ref == null; })) {
205
- return null;
206
- }
207
- return function (instance) {
208
- refs.forEach(function (ref) {
209
- setRef(ref, instance);
210
- });
211
- };
212
- }, refs);
213
- }
214
-
215
- var InputSelectBase = React.forwardRef(function (_a, ref) {
190
+ var InputSelectBase = react.forwardRef(function (_a, ref) {
216
191
  var _b;
217
192
  var options = _a.options, name = _a.name, disabled = _a.disabled, handleChange = _a.handleChange, iconProps = _a.iconProps, renderOption = _a.renderOption, selectedLabel = _a.selectedLabel, selectedValue = _a.selectedValue, error = _a.error, inputProps = __rest(_a, ["options", "name", "disabled", "handleChange", "iconProps", "renderOption", "selectedLabel", "selectedValue", "error"]);
218
- var _c = React.useState(false), isDropdownOpen = _c[0], setIsDropdownOpen = _c[1];
219
- var inputRef = React.useRef(null);
220
- var forwardedRef = useForkRef(inputRef, ref);
193
+ var _c = react.useState(false), isDropdownOpen = _c[0], setIsDropdownOpen = _c[1];
194
+ var inputRef = react.useRef(null);
195
+ var forwardedRef = kuiUtils.useForkRef(inputRef, ref);
221
196
  var handleOpenDropdown = function () {
222
197
  var _a, _b, _c, _d;
223
198
  if ((_b = (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) {
@@ -257,10 +232,10 @@ var StyledOption = styled__default["default"].div(templateObject_1$b || (templat
257
232
  }, kuiBasic.theme.palette.background.light1);
258
233
  var templateObject_1$b;
259
234
 
260
- var InputSelect = React.forwardRef(function (_a, ref) {
235
+ var InputSelect = react.forwardRef(function (_a, ref) {
261
236
  var _b;
262
237
  var options = _a.options, name = _a.name, handleChange = _a.handleChange; _a.form; var valueProp = _a.value, inputProps = __rest(_a, ["options", "name", "handleChange", "form", "value"]);
263
- var _c = React.useState(valueProp), value = _c[0], setValue = _c[1];
238
+ var _c = react.useState(valueProp), value = _c[0], setValue = _c[1];
264
239
  var selectedLabel = (_b = options.find(function (option) { return String(option.value) === String(value); })) === null || _b === void 0 ? void 0 : _b.label;
265
240
  var handleSelect = function (option) {
266
241
  setValue(option.value);
@@ -268,14 +243,14 @@ var InputSelect = React.forwardRef(function (_a, ref) {
268
243
  handleChange(option.value);
269
244
  }
270
245
  };
271
- React.useEffect(function () {
246
+ react.useEffect(function () {
272
247
  if (typeof valueProp !== "undefined")
273
248
  setValue(valueProp);
274
249
  }, [valueProp]);
275
250
  return (jsxRuntime.jsx(InputSelectBase, __assign({ options: options, handleChange: handleSelect, selectedLabel: selectedLabel, selectedValue: value, name: name, renderOption: function (option, selectedValue) { return (jsxRuntime.jsx(InputSelectOption, { option: option, selectedValue: selectedValue })); }, ref: ref }, inputProps)));
276
251
  });
277
252
 
278
- var InputForDatepicker = React.forwardRef(function (props, ref) {
253
+ var InputForDatepicker = react.forwardRef(function (props, ref) {
279
254
  var onClick = props.onClick, disabled = props.disabled, handleClick = props.handleClick, startIcon = props.startIcon, other = __rest(props, ["onClick", "disabled", "handleClick", "startIcon"]);
280
255
  var handleIconClick = function () {
281
256
  if (handleClick) {
@@ -291,27 +266,10 @@ var InputForDatepicker = React.forwardRef(function (props, ref) {
291
266
  var IconWrapper = styled__default["default"].div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"])));
292
267
  var templateObject_1$a;
293
268
 
294
- var useToggle = function (isModalOpen) {
295
- if (isModalOpen === void 0) { isModalOpen = false; }
296
- var _a = React.useState(isModalOpen), isOpen = _a[0], setIsOpen = _a[1];
297
- var handleClose = function () {
298
- setIsOpen(false);
299
- };
300
- var handleOpen = function () {
301
- setIsOpen(true);
302
- };
303
- return [isOpen, handleOpen, handleClose];
304
- };
305
-
306
- var isValidWithMaskExp = /^[^_]+$/;
307
- var simplePasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,}$/;
308
- var mediumPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/;
309
- var strongPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/;
310
-
311
269
  var checkDisabled$1 = function (year, min, max) {
312
270
  return (min && year <= min) || (max && year >= max);
313
271
  };
314
- var SelectYear = React.forwardRef(function (_a, ref) {
272
+ var SelectYear = react.forwardRef(function (_a, ref) {
315
273
  var yearOptions = _a.yearOptions; _a.options; var min = _a.min, max = _a.max, props = __rest(_a, ["yearOptions", "options", "min", "max"]);
316
274
  var formattedYearOptions = yearOptions.map(function (year) { return (__assign(__assign({}, year), { disabled: checkDisabled$1(Number(year.value), min, max) })); });
317
275
  return (jsxRuntime.jsx(InputSelect, __assign({ ref: ref, label: "Year", options: formattedYearOptions }, props)));
@@ -332,13 +290,13 @@ var monthValues = [
332
290
  { value: 10, label: "November" },
333
291
  { value: 11, label: "December" },
334
292
  ];
335
- var SelectMonth = React.forwardRef(function (props, ref) {
293
+ var SelectMonth = react.forwardRef(function (props, ref) {
336
294
  var min = props.min, max = props.max; props.options; var other = __rest(props, ["min", "max", "options"]);
337
295
  var formattedMonths = monthValues.map(function (month) { return (__assign(__assign({}, month), { disabled: checkDisabled(month.value, min, max) })); });
338
296
  return (jsxRuntime.jsx(InputSelect, __assign({ ref: ref, label: "Month", options: formattedMonths }, other)));
339
297
  });
340
298
 
341
- var CalendarHeaderWithSelect = React.forwardRef(function (_a, ref) {
299
+ var CalendarHeaderWithSelect = react.forwardRef(function (_a, ref) {
342
300
  var changeMonth = _a.changeMonth, changeYear = _a.changeYear, date = _a.date, yearOptions = _a.yearOptions, max = _a.max, min = _a.min;
343
301
  var year = date.getFullYear();
344
302
  var month = date.getMonth();
@@ -350,7 +308,7 @@ var CalendarHeaderWithSelect = React.forwardRef(function (_a, ref) {
350
308
  var Wrapper$3 = styled__default["default"].div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n margin-bottom: 24px;\n @media (max-width: 900px) {\n padding: 0 18px;\n margin-bottom: 20px;\n }\n"], ["\n margin-bottom: 24px;\n @media (max-width: 900px) {\n padding: 0 18px;\n margin-bottom: 20px;\n }\n"])));
351
309
  var templateObject_1$9;
352
310
 
353
- var ModalFooter = React.forwardRef(function (_a, ref) {
311
+ var ModalFooter = react.forwardRef(function (_a, ref) {
354
312
  var label = _a.label, button = _a.button, otherProps = __rest(_a, ["label", "button"]);
355
313
  return (jsxRuntime.jsxs(StyledFooter, __assign({ ref: ref }, { children: [jsxRuntime.jsx(kuiBasic.Divider, {}), jsxRuntime.jsx(ButtonWrapper, { children: button || (jsxRuntime.jsx(ButtonStyled, __assign({ fullWidth: true, size: "s", endIcon: jsxRuntime.jsx(kuiIcon.CheckIcon, {}) }, otherProps, { children: label }))) })] })));
356
314
  });
@@ -359,7 +317,7 @@ var ButtonWrapper = styled__default["default"].div(templateObject_2$4 || (templa
359
317
  var ButtonStyled = styled__default["default"](kuiBasic.Button)(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n @media (max-width: 600px) {\n width: 100%;\n }\n"], ["\n @media (max-width: 600px) {\n width: 100%;\n }\n"])));
360
318
  var templateObject_1$8, templateObject_2$4, templateObject_3$2;
361
319
 
362
- var CalendarStandardContainer = React.forwardRef(function (_a, ref) {
320
+ var CalendarStandardContainer = react.forwardRef(function (_a, ref) {
363
321
  _a.arrowProps; _a.showPopperArrow; var props = __rest(_a, ["arrowProps", "showPopperArrow"]);
364
322
  return jsxRuntime.jsx(DatePickerContainer, __assign({ ref: ref }, props));
365
323
  });
@@ -378,7 +336,7 @@ var generateYearRange = function (offsetFromCurrent, maxYearCount) {
378
336
  };
379
337
  });
380
338
  };
381
- var InputWithDatePicker = React.forwardRef(function (_a, ref) {
339
+ var InputWithDatePicker = react.forwardRef(function (_a, ref) {
382
340
  var _b;
383
341
  var title = _a.title, description = _a.description, name = _a.name, form = _a.form, disabled = _a.disabled, yearParams = _a.yearParams, onChange = _a.onChange, max = _a.max, min = _a.min, footerLabel = _a.footerLabel, datePickerProps = _a.datePickerProps, alignTitle = _a.alignTitle, props = __rest(_a, ["title", "description", "name", "form", "disabled", "yearParams", "onChange", "max", "min", "footerLabel", "datePickerProps", "alignTitle"]);
384
342
  var _c = reactHookForm.useController({
@@ -388,11 +346,11 @@ var InputWithDatePicker = React.forwardRef(function (_a, ref) {
388
346
  var error = (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
389
347
  var formattedValue = field.value ? field.value.toFormat("dd.MM.yyyy") : "";
390
348
  var formattedDate = field.value ? field.value.toJSDate() : null;
391
- var _d = useToggle(), isModalOpen = _d[0], handleModalOpen = _d[1], handleModalClose = _d[2];
392
- var _e = React.useState(formattedDate), date = _e[0], setDate = _e[1];
393
- var _f = React.useState(formattedValue), value = _f[0], setValue = _f[1];
349
+ var _d = kuiUtils.useToggle(), isModalOpen = _d[0], handleModalOpen = _d[1], handleModalClose = _d[2];
350
+ var _e = react.useState(formattedDate), date = _e[0], setDate = _e[1];
351
+ var _f = react.useState(formattedValue), value = _f[0], setValue = _f[1];
394
352
  var yearList = generateYearRange(yearParams === null || yearParams === void 0 ? void 0 : yearParams.min, yearParams === null || yearParams === void 0 ? void 0 : yearParams.max);
395
- React.useEffect(function () {
353
+ react.useEffect(function () {
396
354
  if (!isModalOpen) {
397
355
  setDate(null);
398
356
  }
@@ -403,7 +361,7 @@ var InputWithDatePicker = React.forwardRef(function (_a, ref) {
403
361
  var handleChange = function (e) {
404
362
  var targetValue = e.target.value;
405
363
  setValue(targetValue);
406
- if (targetValue.length !== 0 && isValidWithMaskExp.test(targetValue)) {
364
+ if (targetValue.length !== 0 && kuiUtils.isValidWithMaskExp.test(targetValue)) {
407
365
  var targetDate = luxon.DateTime.fromFormat(targetValue, "dd.MM.yyyy");
408
366
  setDate(targetDate.toJSDate());
409
367
  field === null || field === void 0 ? void 0 : field.onChange({ target: { value: targetDate, name: name }, type: "change" });
@@ -433,7 +391,7 @@ var InputWithDatePicker = React.forwardRef(function (_a, ref) {
433
391
  var handleDateChange = function (newDate) {
434
392
  setDate(newDate);
435
393
  };
436
- var forwardedRef = useForkRef(ref, field.ref);
394
+ var forwardedRef = kuiUtils.useForkRef(ref, field.ref);
437
395
  return (jsxRuntime$1.jsxs(jsxRuntime$1.Fragment, { children: [jsxRuntime$1.jsx(InputForDatepicker, __assign({ mask: "00.00.0000", name: name, handleClick: handleModalOpen, value: formattedValue || value, onChange: handleChange, disabled: disabled, message: error, ref: forwardedRef }, props)), jsxRuntime$1.jsxs(StyledModal, __assign({ title: title, description: description, isOpen: isModalOpen, handleClose: handleModalClose, alignTitle: alignTitle }, { children: [jsxRuntime$1.jsx(ContentWrapper$1, { children: jsxRuntime$1.jsx(DatePicker__default["default"], __assign({ inline: true, selected: date || formattedDate, onChange: handleDateChange, calendarContainer: StyledCalendarStandardContainer, renderCustomHeader: function (headProps) { return (jsxRuntime$1.jsx(CalendarHeaderWithSelect, __assign({ yearOptions: yearList, max: max, min: min }, headProps))); }, renderDayContents: function (day) { return (jsxRuntime$1.jsx(DayContent, { children: day })); }, maxDate: max === null || max === void 0 ? void 0 : max.toJSDate(), minDate: min === null || min === void 0 ? void 0 : min.toJSDate() }, datePickerProps)) }), jsxRuntime$1.jsx(ModalFooter, { fullWidth: true, disabled: !formattedDate && !date, onClick: acceptWithDateSelected, label: footerLabel })] }))] }));
438
396
  });
439
397
  InputWithDatePicker.defaultProps = {
@@ -452,14 +410,14 @@ var StyledModal = styled__default["default"](kuiBasic.Modal)(templateObject_4$1
452
410
  });
453
411
  var templateObject_1$6, templateObject_2$3, templateObject_3$1, templateObject_4$1;
454
412
 
455
- var MonthPickerContainer = React.forwardRef(function (_a, ref) {
413
+ var MonthPickerContainer = react.forwardRef(function (_a, ref) {
456
414
  _a.arrowProps; _a.showPopperArrow; var props = __rest(_a, ["arrowProps", "showPopperArrow"]);
457
415
  return jsxRuntime.jsx(StyledContainer, __assign({ ref: ref }, props));
458
416
  });
459
417
  var StyledContainer = styled__default["default"].div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n border-radius: 12px !important;\n border: 1px solid ", " !important;\n background: #fff;\n overflow: hidden;\n z-index: 5;\n .react-datepicker-wrapper,\n .react-datepicker__input-container {\n display: block;\n width: 100%;\n }\n .react-datepicker__header,\n .react-datepicker__header:not(.react-datepicker__header--has-time-select) {\n padding: 0;\n border: none;\n background-color: #fff;\n }\n .react-datepicker__month {\n margin: 0px 8px 8px !important;\n border-radius: 12px;\n border: 1px solid ", ";\n width: 238px;\n height: 169px;\n display: flex;\n flex-direction: column;\n }\n .react-datepicker__month-text {\n margin: 4px !important;\n /*width: auto !important;*/\n width: calc(100% / 3) !important;\n position: relative;\n display: flex !important;\n justify-content: center;\n align-items: center;\n }\n\n .react-datepicker__month-wrapper {\n height: calc(100% / 4);\n display: flex;\n }\n\n .react-datepicker__month-text:after {\n content: \"\";\n display: block;\n height: calc(100% + 8px);\n width: 1px;\n position: absolute;\n top: -4px;\n right: -4px;\n background: ", ";\n }\n\n .react-datepicker__month-text:nth-child(3n):after {\n content: none;\n }\n\n .react-datepicker__month--selected,\n .react-datepicker__month-text--keyboard-selected {\n background-color: ", " !important;\n border-radius: 8px !important;\n color: white !important;\n }\n .react-datepicker__month-wrapper {\n border-bottom: 1px solid ", ";\n }\n\n .react-datepicker__month-wrapper:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 600px) {\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__month {\n margin: 0px 16px 16px !important;\n height: calc(100% - 58px);\n text-align: center;\n width: auto;\n }\n .react-datepicker__month-text {\n margin: 8px !important;\n }\n .react-datepicker__month-text:after {\n height: calc(100% + 16px);\n top: -8px;\n right: -8px;\n }\n .react-datepicker__month-text:nth-child(3n):after {\n content: none;\n }\n }\n @media (max-width: 600px) {\n width: 100%;\n height: 262px;\n box-shadow: 0px 5px 16px rgba(0, 0, 0, 0.1);\n }\n"], ["\n box-shadow: 0px 26px 34px rgba(0, 0, 0, 0.1);\n border-radius: 12px !important;\n border: 1px solid ", " !important;\n background: #fff;\n overflow: hidden;\n z-index: 5;\n .react-datepicker-wrapper,\n .react-datepicker__input-container {\n display: block;\n width: 100%;\n }\n .react-datepicker__header,\n .react-datepicker__header:not(.react-datepicker__header--has-time-select) {\n padding: 0;\n border: none;\n background-color: #fff;\n }\n .react-datepicker__month {\n margin: 0px 8px 8px !important;\n border-radius: 12px;\n border: 1px solid ", ";\n width: 238px;\n height: 169px;\n display: flex;\n flex-direction: column;\n }\n .react-datepicker__month-text {\n margin: 4px !important;\n /*width: auto !important;*/\n width: calc(100% / 3) !important;\n position: relative;\n display: flex !important;\n justify-content: center;\n align-items: center;\n }\n\n .react-datepicker__month-wrapper {\n height: calc(100% / 4);\n display: flex;\n }\n\n .react-datepicker__month-text:after {\n content: \"\";\n display: block;\n height: calc(100% + 8px);\n width: 1px;\n position: absolute;\n top: -4px;\n right: -4px;\n background: ", ";\n }\n\n .react-datepicker__month-text:nth-child(3n):after {\n content: none;\n }\n\n .react-datepicker__month--selected,\n .react-datepicker__month-text--keyboard-selected {\n background-color: ", " !important;\n border-radius: 8px !important;\n color: white !important;\n }\n .react-datepicker__month-wrapper {\n border-bottom: 1px solid ", ";\n }\n\n .react-datepicker__month-wrapper:last-child {\n border-bottom: none;\n }\n\n @media (max-width: 600px) {\n .react-datepicker__month-container {\n width: 100%;\n height: 100%;\n }\n .react-datepicker__month {\n margin: 0px 16px 16px !important;\n height: calc(100% - 58px);\n text-align: center;\n width: auto;\n }\n .react-datepicker__month-text {\n margin: 8px !important;\n }\n .react-datepicker__month-text:after {\n height: calc(100% + 16px);\n top: -8px;\n right: -8px;\n }\n .react-datepicker__month-text:nth-child(3n):after {\n content: none;\n }\n }\n @media (max-width: 600px) {\n width: 100%;\n height: 262px;\n box-shadow: 0px 5px 16px rgba(0, 0, 0, 0.1);\n }\n"])), kuiBasic.theme.palette.background.light1, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.grey.fifteenB, kuiBasic.theme.palette.brand.main, kuiBasic.theme.palette.grey.fifteenB);
460
418
  var templateObject_1$5;
461
419
 
462
- var MonthPickerHeader = React.forwardRef(function (_a, ref) {
420
+ var MonthPickerHeader = react.forwardRef(function (_a, ref) {
463
421
  var decreaseYear = _a.decreaseYear, increaseYear = _a.increaseYear, nextYearButtonDisabled = _a.nextYearButtonDisabled, prevYearButtonDisabled = _a.prevYearButtonDisabled, date = _a.date;
464
422
  return (jsxRuntime.jsxs(StyledHeader, __assign({ container: true, alignItems: "center", justify: "space-between", ref: ref }, { children: [jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true }, { children: jsxRuntime.jsx(StyledIconButton, __assign({ disabled: prevYearButtonDisabled, onClick: decreaseYear, type: "button" }, { children: jsxRuntime.jsx(kuiIcon.ArrowBackIcon, { width: 14, height: 12 }) })) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true }, { children: jsxRuntime.jsx(kuiBasic.Caption, __assign({ size: "sm", weight: 600 }, { children: date.getFullYear() })) })), jsxRuntime.jsx(kuiBasic.Grid, __assign({ item: true }, { children: jsxRuntime.jsx(StyledIconButton, __assign({ disabled: nextYearButtonDisabled, onClick: increaseYear, type: "button" }, { children: jsxRuntime.jsx(kuiIcon.ArrowNextIcon, { width: 14, height: 12 }) })) }))] })));
465
423
  });
@@ -467,9 +425,9 @@ var StyledIconButton = styled__default["default"](kuiBasic.IconButton)(templateO
467
425
  var StyledHeader = styled__default["default"](kuiBasic.Grid)(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n background: #fff;\n padding: 4px 16px;\n border-radius: 12px 12px 0 0;\n"], ["\n background: #fff;\n padding: 4px 16px;\n border-radius: 12px 12px 0 0;\n"])));
468
426
  var templateObject_1$4, templateObject_2$2;
469
427
 
470
- var DesktopInputWithMonthPicker = React.forwardRef(function (_a, ref) {
428
+ var DesktopInputWithMonthPicker = react.forwardRef(function (_a, ref) {
471
429
  var name = _a.name, form = _a.form, disabled = _a.disabled, datePickerProps = _a.datePickerProps, onChange = _a.onChange, otherProps = __rest(_a, ["name", "form", "disabled", "datePickerProps", "onChange"]);
472
- var _b = React.useState(), changedValue = _b[0], setChangedValue = _b[1];
430
+ var _b = react.useState(), changedValue = _b[0], setChangedValue = _b[1];
473
431
  var handleChange = function (date, field) {
474
432
  field.onChange(date);
475
433
  setChangedValue(date);
@@ -508,7 +466,7 @@ var ruCustom = __assign(__assign({}, ru__default["default"]), { localize: {
508
466
  dayPeriod: function () { return ""; },
509
467
  day: function () { return ""; },
510
468
  } });
511
- var MobileInputWithMonthPicker = React.forwardRef(function (_a, ref) {
469
+ var MobileInputWithMonthPicker = react.forwardRef(function (_a, ref) {
512
470
  var _b;
513
471
  var title = _a.title, name = _a.name, form = _a.form, disabled = _a.disabled, datePickerProps = _a.datePickerProps, props = __rest(_a, ["title", "name", "form", "disabled", "datePickerProps"]);
514
472
  var _c = reactHookForm.useController({
@@ -516,15 +474,15 @@ var MobileInputWithMonthPicker = React.forwardRef(function (_a, ref) {
516
474
  control: form.control,
517
475
  }), field = _c.field, fieldState = _c.fieldState;
518
476
  var error = (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
519
- var _d = useToggle(), isModalOpen = _d[0], handleModalOpen = _d[1], handleModalClose = _d[2];
520
- var _e = React.useState(field.value
477
+ var _d = kuiUtils.useToggle(), isModalOpen = _d[0], handleModalOpen = _d[1], handleModalClose = _d[2];
478
+ var _e = react.useState(field.value
521
479
  ? luxon.DateTime.fromJSDate(new Date(String(field.value))).toFormat("MM.yyyy")
522
480
  : null), value = _e[0], setValue = _e[1];
523
- var _f = React.useState(value ? luxon.DateTime.fromFormat(value, "MM.yyyy").toJSDate() : null), date = _f[0], setDate = _f[1];
481
+ var _f = react.useState(value ? luxon.DateTime.fromFormat(value, "MM.yyyy").toJSDate() : null), date = _f[0], setDate = _f[1];
524
482
  var handleChange = function (e) {
525
483
  var targetValue = e.target.value;
526
484
  setValue(targetValue);
527
- if (targetValue.length !== 0 && isValidWithMaskExp.test(targetValue)) {
485
+ if (targetValue.length !== 0 && kuiUtils.isValidWithMaskExp.test(targetValue)) {
528
486
  var jsDate = luxon.DateTime.fromFormat(targetValue, "MM.yyyy").toJSDate();
529
487
  setDate(jsDate);
530
488
  field === null || field === void 0 ? void 0 : field.onChange({ target: { value: jsDate, name: name }, type: "change" });
@@ -552,7 +510,7 @@ var templateObject_1$2, templateObject_2$1;
552
510
 
553
511
  var InputWithMonthPicker = function (props) { return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DesktopInputWithMonthPicker, __assign({}, props)), jsxRuntime.jsx(MobileInputWithMonthPicker, __assign({}, props))] })); };
554
512
 
555
- var InputPhoneWithForm = React.forwardRef(function (props, ref) {
513
+ var InputPhoneWithForm = react.forwardRef(function (props, ref) {
556
514
  var _a;
557
515
  var form = props.form, name = props.name, hiddenInputProps = props.hiddenInputProps, error = props.error, other = __rest(props, ["form", "name", "hiddenInputProps", "error"]);
558
516
  var codeRegister = reactHookForm.useController({
@@ -585,7 +543,7 @@ var InputPhoneWithForm = React.forwardRef(function (props, ref) {
585
543
  other.onChange(e);
586
544
  }
587
545
  };
588
- var forwardedRef = useForkRef(ref, phoneRegister.field.ref);
546
+ var forwardedRef = kuiUtils.useForkRef(ref, phoneRegister.field.ref);
589
547
  return (jsxRuntime.jsx(kuiBasic.InputWithCountryDropdown, __assign({ message: errorMessage,
590
548
  // @ts-ignore
591
549
  hiddenInputProps: __assign(__assign({}, codeRegister.field), hiddenInputProps), onSelectCountry: handleCountryChange }, phoneRegister.field, other, { onChange: handleChange, ref: forwardedRef, autoComplete: "false" })));
@@ -594,7 +552,7 @@ InputPhoneWithForm.defaultProps = {
594
552
  name: "phone",
595
553
  };
596
554
 
597
- var Switch = React.forwardRef(function (_a, ref) {
555
+ var Switch = react.forwardRef(function (_a, ref) {
598
556
  var form = _a.form, name = _a.name, props = __rest(_a, ["form", "name"]);
599
557
  return (jsxRuntime$1.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
600
558
  var field = _a.field;
@@ -620,7 +578,7 @@ var strengthTexts = {
620
578
  medium: "Средний",
621
579
  hard: "Сложный",
622
580
  };
623
- var PassportStrengthBar = React.forwardRef(function (_a, ref) {
581
+ var PassportStrengthBar = react.forwardRef(function (_a, ref) {
624
582
  var strength = _a.strength;
625
583
  var color = strength
626
584
  ? strengthColors[strength]
@@ -651,9 +609,9 @@ var getFormValue = function (name, form) {
651
609
  return fieldValue;
652
610
  };
653
611
 
654
- var InputPassword = React.forwardRef(function (props, ref) {
655
- var _a = React.useState(false), showPassword = _a[0], setShowPassword = _a[1];
656
- var _b = React.useState(null), strength = _b[0], setStrength = _b[1];
612
+ var InputPassword = react.forwardRef(function (props, ref) {
613
+ var _a = react.useState(false), showPassword = _a[0], setShowPassword = _a[1];
614
+ var _b = react.useState(null), strength = _b[0], setStrength = _b[1];
657
615
  var handleShowChange = function () {
658
616
  setShowPassword(function (prev) { return !prev; });
659
617
  };
@@ -662,13 +620,13 @@ var InputPassword = React.forwardRef(function (props, ref) {
662
620
  setStrength(null);
663
621
  return;
664
622
  }
665
- if (strongPasswordRegExp.test(value)) {
623
+ if (kuiUtils.strongPasswordRegExp.test(value)) {
666
624
  setStrength("hard");
667
625
  }
668
- else if (mediumPasswordRegExp.test(value)) {
626
+ else if (kuiUtils.mediumPasswordRegExp.test(value)) {
669
627
  setStrength("medium");
670
628
  }
671
- else if (simplePasswordRegExp.test(value)) {
629
+ else if (kuiUtils.simplePasswordRegExp.test(value)) {
672
630
  setStrength("simple");
673
631
  }
674
632
  else {
@@ -679,7 +637,7 @@ var InputPassword = React.forwardRef(function (props, ref) {
679
637
  var targetValue = e.target.value;
680
638
  checkPasswordStrength(targetValue);
681
639
  };
682
- React.useEffect(function () {
640
+ react.useEffect(function () {
683
641
  var form = props.form, name = props.name;
684
642
  var fieldValue = getFormValue(name, form);
685
643
  if (typeof fieldValue === "string") {
@@ -691,7 +649,7 @@ var InputPassword = React.forwardRef(function (props, ref) {
691
649
  var EyeIconWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 18px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"], ["\n height: 18px;\n display: flex;\n align-items: center;\n cursor: pointer;\n"])));
692
650
  var templateObject_1;
693
651
 
694
- var InputWithMask = React.forwardRef(function (_a, ref) {
652
+ var InputWithMask = react.forwardRef(function (_a, ref) {
695
653
  var form = _a.form, name = _a.name, error = _a.error, inputProps = __rest(_a, ["form", "name", "error"]);
696
654
  var handleChange = function (e, field) {
697
655
  field.onChange(e);