@typeolymp/ui-components 1.19.17 → 1.19.18

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.
@@ -9,6 +9,7 @@ export declare type PropsType = {
9
9
  autoComplete?: string;
10
10
  autoFocus?: boolean;
11
11
  disabled?: boolean;
12
+ size?: "small" | "medium";
12
13
  onChange?(value: string): void;
13
14
  onBlur?(): void;
14
15
  };
package/build/index.es.js CHANGED
@@ -4290,14 +4290,50 @@ var StyledParagraph = styled.p(templateObject_1$P || (templateObject_1$P = __mak
4290
4290
  var templateObject_1$P;
4291
4291
 
4292
4292
  var Container$q = styled.div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject$1(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
4293
- var InputIconWrapper = styled.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) {
4293
+ var InputIconWrapper = styled.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: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\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: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\n }\n"])), function (_a) {
4294
4294
  var isChanged = _a.isChanged;
4295
4295
  return !isChanged ? theme.colors.lightGray.darker : "";
4296
+ }, function (_a) {
4297
+ var size = _a.size;
4298
+ switch (size) {
4299
+ case "small":
4300
+ return "7px";
4301
+ default:
4302
+ case "medium":
4303
+ return "12px";
4304
+ }
4305
+ }, function (_a) {
4306
+ var size = _a.size;
4307
+ switch (size) {
4308
+ case "small":
4309
+ return "10px";
4310
+ default:
4311
+ case "medium":
4312
+ return "14px";
4313
+ }
4296
4314
  }, function (_a) {
4297
4315
  var disabled = _a.disabled;
4298
4316
  return (disabled ? "not-allowed" : "pointer");
4317
+ }, function (_a) {
4318
+ var size = _a.size;
4319
+ switch (size) {
4320
+ case "small":
4321
+ return "20px";
4322
+ default:
4323
+ case "medium":
4324
+ return "24px";
4325
+ }
4299
4326
  });
4300
- var StyledInput = styled.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) {
4327
+ var StyledInput = styled.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) {
4328
+ var size = _a.size;
4329
+ switch (size) {
4330
+ case "small":
4331
+ return "40px";
4332
+ default:
4333
+ case "medium":
4334
+ return "50px";
4335
+ }
4336
+ }, function (_a) {
4301
4337
  var disabled = _a.disabled;
4302
4338
  return disabled ? theme.colors.lightGray.dark : theme.colors.lightGray.light;
4303
4339
  }, function (_a) {
@@ -4479,7 +4515,7 @@ var PasswordInput = function (props) {
4479
4515
  if (props.onKeyPress)
4480
4516
  props.onKeyPress(e);
4481
4517
  };
4482
- return (jsxs(Container$q, { children: [jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsx$1(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsx$1(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxs(HelperContainer, { children: [jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
4518
+ return (jsxs(Container$q, { children: [jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsx$1(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsx$1(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxs(HelperContainer, { children: [jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
4483
4519
  };
4484
4520
 
4485
4521
  function toInteger$2(dirtyNumber) {
@@ -7956,7 +7992,7 @@ var DateInput = function (props) {
7956
7992
  if (isBefore(new Date(inputRef.current.value), new Date(props.min)))
7957
7993
  inputRef.current.value = props.min;
7958
7994
  };
7959
- return (jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, isChanged: isChanged }, { children: [jsx$1(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsx$1(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
7995
+ return (jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size, isChanged: isChanged }, { children: [jsx$1(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsx$1(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
7960
7996
  };
7961
7997
 
7962
7998
  var SearchInput = function (props) {
@@ -7966,11 +8002,15 @@ var SearchInput = function (props) {
7966
8002
  if (!props.disabled && !!props.onChange)
7967
8003
  props.onChange(e.target.value);
7968
8004
  };
8005
+ var onKeyPress = function (e) {
8006
+ if (e.key === "Enter")
8007
+ onSearch();
8008
+ };
7969
8009
  var onSearch = function () {
7970
8010
  if (props.onSearch)
7971
8011
  props.onSearch(value);
7972
8012
  };
7973
- return (jsx$1(Container$q, { children: jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsx$1(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsx$1(StyledInput, __assign$2({ type: "text" }, props, { onChange: onChange }))] })) }));
8013
+ return (jsx$1(Container$q, { children: jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsx$1(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsx$1(StyledInput, __assign$2({ type: "text" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })) }));
7974
8014
  };
7975
8015
 
7976
8016
  var Input = function (props) {