@typeolymp/ui-components 1.19.17 → 1.19.19

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/build/index.js CHANGED
@@ -4317,14 +4317,68 @@ var StyledParagraph = styled__default["default"].p(templateObject_1$P || (templa
4317
4317
  var templateObject_1$P;
4318
4318
 
4319
4319
  var Container$q = styled__default["default"].div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject$1(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
4320
- var InputIconWrapper = styled__default["default"].div(templateObject_2$B || (templateObject_2$B = __makeTemplateObject$1(["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"])), function (_a) {
4320
+ var InputIconWrapper = styled__default["default"].div(templateObject_2$B || (templateObject_2$B = __makeTemplateObject$1(["\n position: relative;\n width: 100%;\n\n input {\n padding-right: ", ";\n }\n\n input[type=\"search\"] {\n padding-right: ", ";\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n\n input {\n padding-right: ", ";\n }\n\n input[type=\"search\"] {\n padding-right: ", ";\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\n }\n"])), function (_a) {
4321
+ var size = _a.size;
4322
+ switch (size) {
4323
+ case "small":
4324
+ return "38px";
4325
+ default:
4326
+ case "medium":
4327
+ return "43px";
4328
+ }
4329
+ }, function (_a) {
4330
+ var size = _a.size;
4331
+ switch (size) {
4332
+ case "small":
4333
+ return "28px";
4334
+ default:
4335
+ case "medium":
4336
+ return "33px";
4337
+ }
4338
+ }, function (_a) {
4321
4339
  var isChanged = _a.isChanged;
4322
4340
  return !isChanged ? theme.colors.lightGray.darker : "";
4341
+ }, function (_a) {
4342
+ var size = _a.size;
4343
+ switch (size) {
4344
+ case "small":
4345
+ return "7px";
4346
+ default:
4347
+ case "medium":
4348
+ return "12px";
4349
+ }
4350
+ }, function (_a) {
4351
+ var size = _a.size;
4352
+ switch (size) {
4353
+ case "small":
4354
+ return "10px";
4355
+ default:
4356
+ case "medium":
4357
+ return "14px";
4358
+ }
4323
4359
  }, function (_a) {
4324
4360
  var disabled = _a.disabled;
4325
4361
  return (disabled ? "not-allowed" : "pointer");
4362
+ }, function (_a) {
4363
+ var size = _a.size;
4364
+ switch (size) {
4365
+ case "small":
4366
+ return "20px";
4367
+ default:
4368
+ case "medium":
4369
+ return "24px";
4370
+ }
4326
4371
  });
4327
- var StyledInput = styled__default["default"].input(templateObject_3$d || (templateObject_3$d = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 100%;\n min-width: 228px;\n height: 50px;\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
4372
+ var StyledInput = styled__default["default"].input(templateObject_3$d || (templateObject_3$d = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n height: ", ";\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 100%;\n min-width: 228px;\n height: ", ";\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
4373
+ var size = _a.size;
4374
+ switch (size) {
4375
+ case "small":
4376
+ return "40px";
4377
+ default:
4378
+ case "medium":
4379
+ return "50px";
4380
+ }
4381
+ }, function (_a) {
4328
4382
  var disabled = _a.disabled;
4329
4383
  return disabled ? theme.colors.lightGray.dark : theme.colors.lightGray.light;
4330
4384
  }, function (_a) {
@@ -4506,7 +4560,7 @@ var PasswordInput = function (props) {
4506
4560
  if (props.onKeyPress)
4507
4561
  props.onKeyPress(e);
4508
4562
  };
4509
- return (jsxRuntime.jsxs(Container$q, { children: [jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsxRuntime.jsx(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxRuntime.jsxs(HelperContainer, { children: [jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
4563
+ return (jsxRuntime.jsxs(Container$q, { children: [jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsxRuntime.jsx(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxRuntime.jsxs(HelperContainer, { children: [jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
4510
4564
  };
4511
4565
 
4512
4566
  function toInteger$2(dirtyNumber) {
@@ -7983,7 +8037,7 @@ var DateInput = function (props) {
7983
8037
  if (isBefore(new Date(inputRef.current.value), new Date(props.min)))
7984
8038
  inputRef.current.value = props.min;
7985
8039
  };
7986
- return (jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, isChanged: isChanged }, { children: [jsxRuntime.jsx(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
8040
+ return (jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size, isChanged: isChanged }, { children: [jsxRuntime.jsx(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
7987
8041
  };
7988
8042
 
7989
8043
  var SearchInput = function (props) {
@@ -7993,11 +8047,15 @@ var SearchInput = function (props) {
7993
8047
  if (!props.disabled && !!props.onChange)
7994
8048
  props.onChange(e.target.value);
7995
8049
  };
8050
+ var onKeyPress = function (e) {
8051
+ if (e.key === "Enter")
8052
+ onSearch();
8053
+ };
7996
8054
  var onSearch = function () {
7997
8055
  if (props.onSearch)
7998
8056
  props.onSearch(value);
7999
8057
  };
8000
- return (jsxRuntime.jsx(Container$q, { children: jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "text" }, props, { onChange: onChange }))] })) }));
8058
+ return (jsxRuntime.jsx(Container$q, { children: jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsxRuntime.jsx(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "search" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })) }));
8001
8059
  };
8002
8060
 
8003
8061
  var Input = function (props) {