kui-complex 0.0.102 → 0.0.104

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
@@ -288,14 +288,14 @@ declare const TableCell: _emotion_styled.StyledComponent<{
288
288
 
289
289
  declare const TableRow: React.ForwardRefExoticComponent<Pick<React.ClassAttributes<HTMLTableRowElement> & React.HTMLAttributes<HTMLTableRowElement>, "key" | keyof React.HTMLAttributes<HTMLTableRowElement>> & React.RefAttributes<HTMLTableRowElement>>;
290
290
 
291
- type PopperPlacements =
292
- | "right"
293
- | "left"
294
- | "topStart"
295
- | "topMiddle"
296
- | "topEnd"
297
- | "bottomStart"
298
- | "bottomMiddle"
291
+ type PopperPlacements =
292
+ | "right"
293
+ | "left"
294
+ | "topStart"
295
+ | "topMiddle"
296
+ | "topEnd"
297
+ | "bottomStart"
298
+ | "bottomMiddle"
299
299
  | "bottomEnd"
300
300
 
301
301
  interface TooltipProps
@@ -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
  "ЯНВ",
@@ -938,11 +938,14 @@ var placementsPositions = {
938
938
 
939
939
  var PopperBase = forwardRef(function (props, ref) {
940
940
  props.placement; var open = props.open, children = props.children, spacing = props.spacing, className = props.className, style = props.style, other = __rest(props, ["placement", "open", "children", "spacing", "className", "style"]);
941
- return (jsx(StyledPopperWrapper, __assign({ ref: ref, className: classNames("KUI-Popper", className), spacing: spacing, style: style }, { children: jsx(StyledPopper, __assign({ open: !!open }, other, { children: children })) })));
941
+ return (jsx(StyledPopperWrapper, __assign({ ref: ref, className: classNames("KUI-Popper", className), spacing: spacing, style: style, open: !!open }, { children: jsx(StyledPopper, __assign({ open: !!open }, other, { children: children })) })));
942
942
  });
943
- var StyledPopperWrapper = styled.div(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n position: absolute;\n max-width: 215px;\n width: max-content;\n padding: ", ";\n z-index: 10;\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"], ["\n position: absolute;\n max-width: 215px;\n width: max-content;\n padding: ", ";\n z-index: 10;\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"])), function (_a) {
943
+ var StyledPopperWrapper = styled.div(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n position: absolute;\n max-width: 215px;\n width: max-content;\n padding: ", ";\n z-index: ", ";\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"], ["\n position: absolute;\n max-width: 215px;\n width: max-content;\n padding: ", ";\n z-index: ", ";\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"])), function (_a) {
944
944
  var spacing = _a.spacing;
945
945
  return spacing || 0;
946
+ }, function (_a) {
947
+ var open = _a.open;
948
+ return (open ? 10 : -1);
946
949
  }, theme.breakpoints.xxs);
947
950
  var StyledPopper = styled.div(templateObject_2$a || (templateObject_2$a = __makeTemplateObject(["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n"], ["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n"])), function (_a) {
948
951
  var open = _a.open;
@@ -1084,8 +1087,8 @@ var StyledContentWrapper = styled.div(templateObject_3$5 || (templateObject_3$5
1084
1087
  var cursor = _a.cursor;
1085
1088
  return cursor;
1086
1089
  });
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;
1090
+ 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);
1091
+ var templateObject_1$d, templateObject_2$9, templateObject_3$5, templateObject_4$4;
1089
1092
 
1090
1093
  var ButtonSelect = forwardRef(function (props, ref) {
1091
1094
  var _a;
@@ -1249,7 +1252,7 @@ var rowDirectionCSS = function (_a) {
1249
1252
  };
1250
1253
  var StyledWrapper$6 = styled(Grid, {
1251
1254
  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) {
1255
+ })(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n border: 1px solid\n ", ";\n ", ";\n"], ["\n border: 1px solid\n ", ";\n ", ";\n"])), function (_a) {
1253
1256
  var hasError = _a.hasError;
1254
1257
  return hasError ? theme.palette.red.fiftyP : theme.palette.grey.fifteenB;
1255
1258
  }, function (_a) {
@@ -1262,7 +1265,7 @@ var StyledTitle = styled(Caption)(templateObject_5$2 || (templateObject_5$2 = __
1262
1265
  var direction = _a.direction;
1263
1266
  return (direction === "vertical" ? 8 : 0);
1264
1267
  });
1265
- var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$2, templateObject_5$2;
1268
+ var templateObject_1$a, templateObject_2$7, templateObject_3$4, templateObject_4$3, templateObject_5$2;
1266
1269
 
1267
1270
  var Loading = forwardRef(function (_a) {
1268
1271
  var height = _a.height, className = _a.className, otherProps = __rest(_a, ["height", "className"]);
@@ -1288,7 +1291,7 @@ function CreatingEntityFromDropdown(_a) {
1288
1291
  }
1289
1292
  var handleModalWrapperClick = function (e) { return e.stopPropagation(); };
1290
1293
  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,
1294
+ open: isModalOpen,
1292
1295
  handleClose: handleModalClose,
1293
1296
  }) }))] }));
1294
1297
  }
@@ -1337,6 +1340,9 @@ function InputWithAutocomplete(_a) {
1337
1340
  var handleCloseDropdown = function () {
1338
1341
  setIsOpenDropDown(false);
1339
1342
  };
1343
+ var handleDropdownToggle = function () {
1344
+ setIsOpenDropDown(function (prev) { return !prev; });
1345
+ };
1340
1346
  var handleSelect = function (option) {
1341
1347
  var _a;
1342
1348
  onSelectItem(option);
@@ -1349,21 +1355,20 @@ function InputWithAutocomplete(_a) {
1349
1355
  var handleSearch = function (e) {
1350
1356
  if (onSearchItem) {
1351
1357
  onSearchItem(e.target.value);
1352
- form.setValue(hideName, null);
1358
+ if (hideName)
1359
+ form.setValue(hideName, null);
1353
1360
  }
1354
1361
  if (!e.target.value && hideName) {
1355
- form.setValue(hideName, null);
1362
+ if (hideName)
1363
+ form.setValue(hideName, null);
1356
1364
  form.setValue(name, null);
1357
1365
  onSelectItem(null);
1358
1366
  }
1359
1367
  handleOpenDropdown();
1360
1368
  };
1361
1369
  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: {
1370
+ 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 ||
1371
+ (!disabled && (jsx$1(StyledIcon, { width: 12, height: 13, css: [isOpenDropdown && { transform: "rotate(180deg)" }] })))] }))) })), jsx$1(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
1367
1372
  current: (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
1368
1373
  }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, isLoading: isLoading, handleScrollEnd: handleScrollEnd, creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal })] }));
1369
1374
  }
@@ -1373,7 +1378,8 @@ var StyledInput$2 = styled(InputWithController)(templateObject_3$2 || (templateO
1373
1378
  var isDropdownOpen = _a.isDropdownOpen;
1374
1379
  return (isDropdownOpen ? 0 : 1);
1375
1380
  });
1376
- var templateObject_1$5, templateObject_2$3, templateObject_3$2;
1381
+ 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"])));
1382
+ var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2;
1377
1383
 
1378
1384
  function AutocompleteOption(_a) {
1379
1385
  var label = _a.label;