kui-complex 0.0.102 → 0.0.103

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.
package/cjs/index.js CHANGED
@@ -171,14 +171,14 @@ var largeAvatarCSS = function (_a) {
171
171
  };
172
172
  var StyledUndefinedAvatar = styled__default["default"](UndefinedAvatar, {
173
173
  shouldForwardProp: function (prop) { return prop !== "size"; },
174
- })(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), largeAvatarCSS);
174
+ })(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), largeAvatarCSS);
175
175
  var sizeStyles = {
176
176
  xs: react.css(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject(["\n min-width: 24px;\n width: 24px;\n height: 24px;\n p {\n font-size: 10px;\n }\n "], ["\n min-width: 24px;\n width: 24px;\n height: 24px;\n p {\n font-size: 10px;\n }\n "]))),
177
177
  s: react.css(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n min-width: 32px;\n width: 32px;\n height: 32px;\n "], ["\n min-width: 32px;\n width: 32px;\n height: 32px;\n "]))),
178
178
  md: react.css(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n min-width: 40px;\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n min-width: 32px;\n width: 32px;\n height: 32px;\n }\n "], ["\n min-width: 40px;\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n min-width: 32px;\n width: 32px;\n height: 32px;\n }\n "]))),
179
179
  lg: react.css(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n min-width: 80px;\n width: 80px;\n height: 80px;\n "], ["\n min-width: 80px;\n width: 80px;\n height: 80px;\n "]))),
180
180
  };
181
- var templateObject_1$G, templateObject_2$q, templateObject_3$c, templateObject_4$6, templateObject_5$4, templateObject_6$1, templateObject_7$1, templateObject_8$1;
181
+ var templateObject_1$G, templateObject_2$q, templateObject_3$c, templateObject_4$7, templateObject_5$4, templateObject_6$1, templateObject_7$1, templateObject_8$1;
182
182
 
183
183
  var ButtonTab = React.forwardRef(function (_a, ref) {
184
184
  var index = _a.index, onClick = _a.onClick, isActive = _a.isActive, label = _a.label;
@@ -585,12 +585,12 @@ var PassportStrengthBar = React.forwardRef(function (_a, ref) {
585
585
  var Wrapper$2 = styled__default["default"].div(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n margin-top: 16px;\n min-height: 86px;\n @media (max-width: 900px) {\n min-height: unset;\n }\n &.hidden {\n opacity: 0;\n @media (max-width: 900px) {\n display: none;\n }\n }\n"], ["\n margin-top: 16px;\n min-height: 86px;\n @media (max-width: 900px) {\n min-height: unset;\n }\n &.hidden {\n opacity: 0;\n @media (max-width: 900px) {\n display: none;\n }\n }\n"])));
586
586
  var ReliabilityLevelWrapper = styled__default["default"].div(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n display: flex;\n margin-bottom: 8px;\n"], ["\n display: flex;\n margin-bottom: 8px;\n"])));
587
587
  var ReliabilityLevel = styled__default["default"].div(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n width: calc(100% / 4);\n margin-right: 16px;\n &:last-of-type {\n margin-right: 0;\n }\n"], ["\n width: calc(100% / 4);\n margin-right: 16px;\n &:last-of-type {\n margin-right: 0;\n }\n"])));
588
- var StyledLinearProgress = styled__default["default"](kuiBasic.LinearProgress)(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n height: 8px;\n border-radius: 8px;\n background-color: ", ";\n & .KUI-LinearProgress_bar {\n background-color: ", ";\n width: 102%;\n }\n"], ["\n height: 8px;\n border-radius: 8px;\n background-color: ", ";\n & .KUI-LinearProgress_bar {\n background-color: ", ";\n width: 102%;\n }\n"])), kuiBasic.theme.palette.grey.fifteenB, function (_a) {
588
+ var StyledLinearProgress = styled__default["default"](kuiBasic.LinearProgress)(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n height: 8px;\n border-radius: 8px;\n background-color: ", ";\n & .KUI-LinearProgress_bar {\n background-color: ", ";\n width: 102%;\n }\n"], ["\n height: 8px;\n border-radius: 8px;\n background-color: ", ";\n & .KUI-LinearProgress_bar {\n background-color: ", ";\n width: 102%;\n }\n"])), kuiBasic.theme.palette.grey.fifteenB, function (_a) {
589
589
  var color = _a.color;
590
590
  return color;
591
591
  });
592
592
  var Description = styled__default["default"](kuiBasic.Caption)(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n margin-top: 16px;\n @media (max-width: 900px) {\n margin-top: 8px;\n font-size: 12px;\n }\n"], ["\n margin-top: 16px;\n @media (max-width: 900px) {\n margin-top: 8px;\n font-size: 12px;\n }\n"])));
593
- var templateObject_1$q, templateObject_2$h, templateObject_3$8, templateObject_4$5, templateObject_5$3;
593
+ var templateObject_1$q, templateObject_2$h, templateObject_3$8, templateObject_4$6, templateObject_5$3;
594
594
 
595
595
  var getFormValue = function (name, form) {
596
596
  var names = name === null || name === void 0 ? void 0 : name.split(".");
@@ -748,11 +748,11 @@ InputWithDatePicker.defaultProps = {
748
748
  var ContentWrapper$2 = styled__default["default"].div(templateObject_1$m || (templateObject_1$m = __makeTemplateObject(["\n padding: 0px 40px 24px;\n @media (max-width: 600px) {\n padding: 20px 0 0;\n }\n"], ["\n padding: 0px 40px 24px;\n @media (max-width: 600px) {\n padding: 20px 0 0;\n }\n"])));
749
749
  var StyledCalendarStandardContainer = styled__default["default"](CalendarStandardContainer)(templateObject_2$e || (templateObject_2$e = __makeTemplateObject(["\n height: 410px;\n .react-datepicker__header {\n padding: 0 !important;\n }\n .react-datepicker__day-names {\n padding: 35px 22px 0;\n background-color: ", ";\n border-radius: 16px 16px 0 0;\n @media (max-width: 900px) {\n padding: 24px 16px 0;\n }\n }\n .react-datepicker__month {\n justify-content: space-between;\n height: calc(100% - 124px);\n background-color: ", ";\n border-radius: 0 0 16px 16px;\n padding: 20px 22px 24px;\n margin: 0 !important;\n box-sizing: border-box;\n @media (max-width: 900px) {\n padding: 20px 16px 24px;\n }\n }\n @media (max-width: 600px) {\n height: auto;\n margin-bottom: -4px;\n }\n"], ["\n height: 410px;\n .react-datepicker__header {\n padding: 0 !important;\n }\n .react-datepicker__day-names {\n padding: 35px 22px 0;\n background-color: ", ";\n border-radius: 16px 16px 0 0;\n @media (max-width: 900px) {\n padding: 24px 16px 0;\n }\n }\n .react-datepicker__month {\n justify-content: space-between;\n height: calc(100% - 124px);\n background-color: ", ";\n border-radius: 0 0 16px 16px;\n padding: 20px 22px 24px;\n margin: 0 !important;\n box-sizing: border-box;\n @media (max-width: 900px) {\n padding: 20px 16px 24px;\n }\n }\n @media (max-width: 600px) {\n height: auto;\n margin-bottom: -4px;\n }\n"])), kuiBasic.theme.palette.background.light1, kuiBasic.theme.palette.background.light1);
750
750
  var DayContent = styled__default["default"].span(templateObject_3$6 || (templateObject_3$6 = __makeTemplateObject(["\n padding-top: 1px;\n font-family: Inter, sans-serif;\n @media (max-width: 600px) {\n font-weight: 400;\n }\n"], ["\n padding-top: 1px;\n font-family: Inter, sans-serif;\n @media (max-width: 600px) {\n font-weight: 400;\n }\n"])));
751
- var StyledModal = styled__default["default"](kuiBasic.Modal)(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n .KUI-Modal_title {\n font-size: 24px;\n line-height: 32px;\n text-align: ", ";\n }\n .KUI-Modal_description {\n margin-bottom: 36px;\n }\n"], ["\n .KUI-Modal_title {\n font-size: 24px;\n line-height: 32px;\n text-align: ", ";\n }\n .KUI-Modal_description {\n margin-bottom: 36px;\n }\n"])), function (_a) {
751
+ var StyledModal = styled__default["default"](kuiBasic.Modal)(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n .KUI-Modal_title {\n font-size: 24px;\n line-height: 32px;\n text-align: ", ";\n }\n .KUI-Modal_description {\n margin-bottom: 36px;\n }\n"], ["\n .KUI-Modal_title {\n font-size: 24px;\n line-height: 32px;\n text-align: ", ";\n }\n .KUI-Modal_description {\n margin-bottom: 36px;\n }\n"])), function (_a) {
752
752
  var alignTitle = _a.alignTitle;
753
753
  return alignTitle || "center";
754
754
  });
755
- var templateObject_1$m, templateObject_2$e, templateObject_3$6, templateObject_4$4;
755
+ var templateObject_1$m, templateObject_2$e, templateObject_3$6, templateObject_4$5;
756
756
 
757
757
  var shortMonths = [
758
758
  "ЯНВ",
@@ -1116,8 +1116,8 @@ var StyledContentWrapper = styled__default["default"].div(templateObject_3$5 ||
1116
1116
  var cursor = _a.cursor;
1117
1117
  return cursor;
1118
1118
  });
1119
- var StyledContent$1 = styled__default["default"].div(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n ", ";\n z-index: -1;\n"], ["\n ", ";\n z-index: -1;\n"])), containerCSS);
1120
- var templateObject_1$d, templateObject_2$9, templateObject_3$5, templateObject_4$3;
1119
+ var StyledContent$1 = styled__default["default"].div(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n ", ";\n z-index: -1;\n"], ["\n ", ";\n z-index: -1;\n"])), containerCSS);
1120
+ var templateObject_1$d, templateObject_2$9, templateObject_3$5, templateObject_4$4;
1121
1121
 
1122
1122
  var ButtonSelect = React.forwardRef(function (props, ref) {
1123
1123
  var _a;
@@ -1281,7 +1281,7 @@ var rowDirectionCSS = function (_a) {
1281
1281
  };
1282
1282
  var StyledWrapper$6 = styled__default["default"](kuiBasic.Grid, {
1283
1283
  shouldForwardProp: function (prop) { return prop !== "hasError" && prop !== "withTitle"; },
1284
- })(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n border: 1px solid\n ", ";\n ", ";\n"], ["\n border: 1px solid\n ", ";\n ", ";\n"])), function (_a) {
1284
+ })(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n border: 1px solid\n ", ";\n ", ";\n"], ["\n border: 1px solid\n ", ";\n ", ";\n"])), function (_a) {
1285
1285
  var hasError = _a.hasError;
1286
1286
  return hasError ? kuiBasic.theme.palette.red.fiftyP : kuiBasic.theme.palette.grey.fifteenB;
1287
1287
  }, function (_a) {
@@ -1294,7 +1294,7 @@ var StyledTitle = styled__default["default"](kuiBasic.Caption)(templateObject_5$
1294
1294
  var direction = _a.direction;
1295
1295
  return (direction === "vertical" ? 8 : 0);
1296
1296
  });
1297
- var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$2, templateObject_5$2;
1297
+ var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$3, templateObject_5$2;
1298
1298
 
1299
1299
  var Loading = React.forwardRef(function (_a) {
1300
1300
  var height = _a.height, className = _a.className, otherProps = __rest(_a, ["height", "className"]);
@@ -1320,7 +1320,7 @@ function CreatingEntityFromDropdown(_a) {
1320
1320
  }
1321
1321
  var handleModalWrapperClick = function (e) { return e.stopPropagation(); };
1322
1322
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(StyledWrapper$4, __assign({ container: true, onClick: handleModalOpen, alignItems: "center" }, { children: [jsxRuntime.jsx(StyledPlusIcon, { width: 12, height: 12 }), jsxRuntime.jsx(kuiBasic.Caption, __assign({ color: "fiftyP", size: "xs", weight: 500 }, { children: creatingLabel }))] })), jsxRuntime.jsx(StyledModalWrapper, __assign({ onClick: handleModalWrapperClick }, { children: renderCreatingModal({
1323
- isOpen: isModalOpen,
1323
+ open: isModalOpen,
1324
1324
  handleClose: handleModalClose,
1325
1325
  }) }))] }));
1326
1326
  }
@@ -1369,6 +1369,9 @@ function InputWithAutocomplete(_a) {
1369
1369
  var handleCloseDropdown = function () {
1370
1370
  setIsOpenDropDown(false);
1371
1371
  };
1372
+ var handleDropdownToggle = function () {
1373
+ setIsOpenDropDown(function (prev) { return !prev; });
1374
+ };
1372
1375
  var handleSelect = function (option) {
1373
1376
  var _a;
1374
1377
  onSelectItem(option);
@@ -1381,21 +1384,20 @@ function InputWithAutocomplete(_a) {
1381
1384
  var handleSearch = function (e) {
1382
1385
  if (onSearchItem) {
1383
1386
  onSearchItem(e.target.value);
1384
- form.setValue(hideName, null);
1387
+ if (hideName)
1388
+ form.setValue(hideName, null);
1385
1389
  }
1386
1390
  if (!e.target.value && hideName) {
1387
- form.setValue(hideName, null);
1391
+ if (hideName)
1392
+ form.setValue(hideName, null);
1388
1393
  form.setValue(name, null);
1389
1394
  onSelectItem(null);
1390
1395
  }
1391
1396
  handleOpenDropdown();
1392
1397
  };
1393
1398
  var forwardRef = kuiUtils.useForkRef(inputRef, inputRefProps);
1394
- return (jsxRuntime$1.jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsxRuntime$1.jsx(StyledLoadingWrapper, { children: jsxRuntime$1.jsx(Loading, { height: "100%" }) })), jsxRuntime$1.jsx(StyledInput$2, __assign({ form: form, onInput: handleSearch, onFocus: handleOpenDropdown, name: name, disabled: disabled, ref: forwardRef, isDropdownOpen: isOpenDropdown }, inputProps, { endIcon: !disabled && (jsxRuntime$1.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center" }, { children: [jsxRuntime$1.jsx(kuiBasic.Box, __assign({ mr: 2 }, { children: endComponent })), inputProps.endIcon ||
1395
- (!disabled && (jsxRuntime$1.jsx(kuiIcon.HalfArrowIcon, { width: 12, height: 13, css: [
1396
- { transition: "all linear .2s" },
1397
- isOpenDropdown && { transform: "rotate(180deg)" },
1398
- ] })))] }))) })), jsxRuntime$1.jsx(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
1399
+ return (jsxRuntime$1.jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsxRuntime$1.jsx(StyledLoadingWrapper, { children: jsxRuntime$1.jsx(Loading, { height: "100%" }) })), jsxRuntime$1.jsx(StyledInput$2, __assign({ form: form, onInput: handleSearch, onFocus: handleOpenDropdown, name: name, disabled: disabled, ref: forwardRef, isDropdownOpen: isOpenDropdown }, inputProps, { endIcon: !disabled && (jsxRuntime$1.jsxs(kuiBasic.Grid, __assign({ container: true, alignItems: "center", onClick: handleDropdownToggle }, { children: [jsxRuntime$1.jsx(kuiBasic.Box, __assign({ mr: 2 }, { children: endComponent })), inputProps.endIcon ||
1400
+ (!disabled && (jsxRuntime$1.jsx(StyledIcon, { width: 12, height: 13, css: [isOpenDropdown && { transform: "rotate(180deg)" }] })))] }))) })), jsxRuntime$1.jsx(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
1399
1401
  current: (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
1400
1402
  }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, isLoading: isLoading, handleScrollEnd: handleScrollEnd, creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal })] }));
1401
1403
  }
@@ -1405,7 +1407,8 @@ var StyledInput$2 = styled__default["default"](InputWithController)(templateObje
1405
1407
  var isDropdownOpen = _a.isDropdownOpen;
1406
1408
  return (isDropdownOpen ? 0 : 1);
1407
1409
  });
1408
- var templateObject_1$5, templateObject_2$3, templateObject_3$2;
1410
+ var StyledIcon = styled__default["default"](kuiIcon.HalfArrowIcon)(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n transition: all ease-out 0.3s;\n cursor: pointer;\n"], ["\n transition: all ease-out 0.3s;\n cursor: pointer;\n"])));
1411
+ var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2;
1409
1412
 
1410
1413
  function AutocompleteOption(_a) {
1411
1414
  var label = _a.label;