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/index.d.ts CHANGED
@@ -476,7 +476,7 @@ declare type VisibilitySettings = {
476
476
  landlord: boolean;
477
477
  };
478
478
  declare type DocumentVisibilityVariants = "everybody" | "tenant" | "landlord" | "nobody";
479
- declare const getVisibility: ({ landlord, tenant }: VisibilitySettings) => "everybody" | "tenant" | "landlord" | "nobody";
479
+ declare const getVisibility: ({ landlord, tenant }: VisibilitySettings) => "everybody" | "nobody" | "tenant" | "landlord";
480
480
  declare const getVisibilitySettings: (visibility?: DocumentVisibilityVariants | undefined) => {
481
481
  tenant: boolean;
482
482
  landlord: boolean;
package/index.js CHANGED
@@ -139,14 +139,14 @@ var largeAvatarCSS = function (_a) {
139
139
  };
140
140
  var StyledUndefinedAvatar = styled(UndefinedAvatar, {
141
141
  shouldForwardProp: function (prop) { return prop !== "size"; },
142
- })(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), largeAvatarCSS);
142
+ })(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), largeAvatarCSS);
143
143
  var sizeStyles = {
144
144
  xs: 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 "]))),
145
145
  s: 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 "]))),
146
146
  md: 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 "]))),
147
147
  lg: 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 "]))),
148
148
  };
149
- 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;
149
+ 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;
150
150
 
151
151
  var ButtonTab = forwardRef(function (_a, ref) {
152
152
  var index = _a.index, onClick = _a.onClick, isActive = _a.isActive, label = _a.label;
@@ -553,12 +553,12 @@ var PassportStrengthBar = forwardRef(function (_a, ref) {
553
553
  var Wrapper$2 = styled.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"])));
554
554
  var ReliabilityLevelWrapper = styled.div(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n display: flex;\n margin-bottom: 8px;\n"], ["\n display: flex;\n margin-bottom: 8px;\n"])));
555
555
  var ReliabilityLevel = styled.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"])));
556
- var StyledLinearProgress = styled(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"])), theme.palette.grey.fifteenB, function (_a) {
556
+ var StyledLinearProgress = styled(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"])), theme.palette.grey.fifteenB, function (_a) {
557
557
  var color = _a.color;
558
558
  return color;
559
559
  });
560
560
  var Description = styled(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"])));
561
- var templateObject_1$q, templateObject_2$h, templateObject_3$8, templateObject_4$5, templateObject_5$3;
561
+ var templateObject_1$q, templateObject_2$h, templateObject_3$8, templateObject_4$6, templateObject_5$3;
562
562
 
563
563
  var getFormValue = function (name, form) {
564
564
  var names = name === null || name === void 0 ? void 0 : name.split(".");
@@ -716,11 +716,11 @@ InputWithDatePicker.defaultProps = {
716
716
  var ContentWrapper$2 = styled.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"])));
717
717
  var StyledCalendarStandardContainer = styled(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"])), theme.palette.background.light1, theme.palette.background.light1);
718
718
  var DayContent = styled.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"])));
719
- var StyledModal = styled(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) {
719
+ var StyledModal = styled(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) {
720
720
  var alignTitle = _a.alignTitle;
721
721
  return alignTitle || "center";
722
722
  });
723
- var templateObject_1$m, templateObject_2$e, templateObject_3$6, templateObject_4$4;
723
+ var templateObject_1$m, templateObject_2$e, templateObject_3$6, templateObject_4$5;
724
724
 
725
725
  var shortMonths = [
726
726
  "ЯНВ",
@@ -1084,8 +1084,8 @@ var StyledContentWrapper = styled.div(templateObject_3$5 || (templateObject_3$5
1084
1084
  var cursor = _a.cursor;
1085
1085
  return cursor;
1086
1086
  });
1087
- var StyledContent$1 = styled.div(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n ", ";\n z-index: -1;\n"], ["\n ", ";\n z-index: -1;\n"])), containerCSS);
1088
- var templateObject_1$d, templateObject_2$9, templateObject_3$5, templateObject_4$3;
1087
+ var StyledContent$1 = styled.div(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n ", ";\n z-index: -1;\n"], ["\n ", ";\n z-index: -1;\n"])), containerCSS);
1088
+ var templateObject_1$d, templateObject_2$9, templateObject_3$5, templateObject_4$4;
1089
1089
 
1090
1090
  var ButtonSelect = forwardRef(function (props, ref) {
1091
1091
  var _a;
@@ -1249,7 +1249,7 @@ var rowDirectionCSS = function (_a) {
1249
1249
  };
1250
1250
  var StyledWrapper$6 = styled(Grid, {
1251
1251
  shouldForwardProp: function (prop) { return prop !== "hasError" && prop !== "withTitle"; },
1252
- })(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n border: 1px solid\n ", ";\n ", ";\n"], ["\n border: 1px solid\n ", ";\n ", ";\n"])), function (_a) {
1252
+ })(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n border: 1px solid\n ", ";\n ", ";\n"], ["\n border: 1px solid\n ", ";\n ", ";\n"])), function (_a) {
1253
1253
  var hasError = _a.hasError;
1254
1254
  return hasError ? theme.palette.red.fiftyP : theme.palette.grey.fifteenB;
1255
1255
  }, function (_a) {
@@ -1262,7 +1262,7 @@ var StyledTitle = styled(Caption)(templateObject_5$2 || (templateObject_5$2 = __
1262
1262
  var direction = _a.direction;
1263
1263
  return (direction === "vertical" ? 8 : 0);
1264
1264
  });
1265
- var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$2, templateObject_5$2;
1265
+ var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$3, templateObject_5$2;
1266
1266
 
1267
1267
  var Loading = forwardRef(function (_a) {
1268
1268
  var height = _a.height, className = _a.className, otherProps = __rest(_a, ["height", "className"]);
@@ -1288,7 +1288,7 @@ function CreatingEntityFromDropdown(_a) {
1288
1288
  }
1289
1289
  var handleModalWrapperClick = function (e) { return e.stopPropagation(); };
1290
1290
  return (jsxs$1(Fragment$1, { children: [jsxs$1(StyledWrapper$4, __assign({ container: true, onClick: handleModalOpen, alignItems: "center" }, { children: [jsx(StyledPlusIcon, { width: 12, height: 12 }), jsx(Caption, __assign({ color: "fiftyP", size: "xs", weight: 500 }, { children: creatingLabel }))] })), jsx(StyledModalWrapper, __assign({ onClick: handleModalWrapperClick }, { children: renderCreatingModal({
1291
- isOpen: isModalOpen,
1291
+ open: isModalOpen,
1292
1292
  handleClose: handleModalClose,
1293
1293
  }) }))] }));
1294
1294
  }
@@ -1337,6 +1337,9 @@ function InputWithAutocomplete(_a) {
1337
1337
  var handleCloseDropdown = function () {
1338
1338
  setIsOpenDropDown(false);
1339
1339
  };
1340
+ var handleDropdownToggle = function () {
1341
+ setIsOpenDropDown(function (prev) { return !prev; });
1342
+ };
1340
1343
  var handleSelect = function (option) {
1341
1344
  var _a;
1342
1345
  onSelectItem(option);
@@ -1349,21 +1352,20 @@ function InputWithAutocomplete(_a) {
1349
1352
  var handleSearch = function (e) {
1350
1353
  if (onSearchItem) {
1351
1354
  onSearchItem(e.target.value);
1352
- form.setValue(hideName, null);
1355
+ if (hideName)
1356
+ form.setValue(hideName, null);
1353
1357
  }
1354
1358
  if (!e.target.value && hideName) {
1355
- form.setValue(hideName, null);
1359
+ if (hideName)
1360
+ form.setValue(hideName, null);
1356
1361
  form.setValue(name, null);
1357
1362
  onSelectItem(null);
1358
1363
  }
1359
1364
  handleOpenDropdown();
1360
1365
  };
1361
1366
  var forwardRef = useForkRef(inputRef, inputRefProps);
1362
- return (jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsx$1(StyledLoadingWrapper, { children: jsx$1(Loading, { height: "100%" }) })), jsx$1(StyledInput$2, __assign({ form: form, onInput: handleSearch, onFocus: handleOpenDropdown, name: name, disabled: disabled, ref: forwardRef, isDropdownOpen: isOpenDropdown }, inputProps, { endIcon: !disabled && (jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [jsx$1(Box, __assign({ mr: 2 }, { children: endComponent })), inputProps.endIcon ||
1363
- (!disabled && (jsx$1(HalfArrowIcon, { width: 12, height: 13, css: [
1364
- { transition: "all linear .2s" },
1365
- isOpenDropdown && { transform: "rotate(180deg)" },
1366
- ] })))] }))) })), jsx$1(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
1367
+ return (jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsx$1(StyledLoadingWrapper, { children: jsx$1(Loading, { height: "100%" }) })), jsx$1(StyledInput$2, __assign({ form: form, onInput: handleSearch, onFocus: handleOpenDropdown, name: name, disabled: disabled, ref: forwardRef, isDropdownOpen: isOpenDropdown }, inputProps, { endIcon: !disabled && (jsxs(Grid, __assign({ container: true, alignItems: "center", onClick: handleDropdownToggle }, { children: [jsx$1(Box, __assign({ mr: 2 }, { children: endComponent })), inputProps.endIcon ||
1368
+ (!disabled && (jsx$1(StyledIcon, { width: 12, height: 13, css: [isOpenDropdown && { transform: "rotate(180deg)" }] })))] }))) })), jsx$1(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
1367
1369
  current: (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
1368
1370
  }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, isLoading: isLoading, handleScrollEnd: handleScrollEnd, creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal })] }));
1369
1371
  }
@@ -1373,7 +1375,8 @@ var StyledInput$2 = styled(InputWithController)(templateObject_3$2 || (templateO
1373
1375
  var isDropdownOpen = _a.isDropdownOpen;
1374
1376
  return (isDropdownOpen ? 0 : 1);
1375
1377
  });
1376
- var templateObject_1$5, templateObject_2$3, templateObject_3$2;
1378
+ var StyledIcon = styled(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"])));
1379
+ var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2;
1377
1380
 
1378
1381
  function AutocompleteOption(_a) {
1379
1382
  var label = _a.label;