@true-engineering/true-react-common-ui-kit 4.0.0-alpha20 → 4.0.0-alpha22

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.
@@ -1,9 +1,7 @@
1
1
  import { ITweakStyles } from '../../theme';
2
2
  import { IInputStyles } from '../Input';
3
- export declare const BUTTONS_WIDTH = 36;
4
- export declare const BUTTONS_GAP = 2;
5
- export declare const useStyles: import("../../theme").IUseStyles<"root" | "button" | "buttons" | "disabledButton" | "errorButton", unknown>;
6
3
  export declare const inputStyles: IInputStyles;
4
+ export declare const useStyles: import("../../theme").IUseStyles<"button" | "icon" | "buttons" | "disabledButton" | "errorButton", unknown>;
7
5
  export type IIncrementInputStyles = ITweakStyles<typeof useStyles, {
8
6
  tweakInput: IInputStyles;
9
7
  }>;
@@ -4,7 +4,7 @@ import { ICommonProps } from '../../types';
4
4
  import { IControlWrapperProps } from '../ControlWrapper';
5
5
  import { IChangeInputEvent } from './types';
6
6
  import { IInputStyles } from './Input.styles';
7
- export interface IInputBaseProps extends ICommonProps<IInputStyles>, Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'>, Pick<IControlWrapperProps, 'label' | 'icon' | 'groupPlacement' | 'isInvalid' | 'isRequired' | 'isLoading' | 'isDisabled' | 'onIconClick' | 'size'>, Pick<Partial<ReactInputMaskBaseProps>, 'mask' | 'maskPlaceholder' | 'alwaysShowMask' | 'beforeMaskedStateChange'> {
7
+ export interface IInputBaseProps extends ICommonProps<IInputStyles>, Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'>, Pick<IControlWrapperProps, 'label' | 'icon' | 'size' | 'groupPlacement' | 'isInvalid' | 'isRequired' | 'isLoading' | 'isDisabled' | 'onIconClick'>, Pick<Partial<ReactInputMaskBaseProps>, 'mask' | 'maskPlaceholder' | 'alwaysShowMask' | 'beforeMaskedStateChange'> {
8
8
  value?: string;
9
9
  units?: ReactNode;
10
10
  /** @default false */
@@ -2,10 +2,12 @@ import { FormEvent, TextareaHTMLAttributes } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
3
  import { IControlWrapperProps } from '../ControlWrapper';
4
4
  import { IWithMessagesProps } from '../WithMessages';
5
+ import { ITextAreaCounterPosition } from './types';
5
6
  import { ITextAreaStyles } from './TextArea.styles';
6
7
  export interface ITextAreaProps extends ICommonProps<ITextAreaStyles>, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'>, Pick<IControlWrapperProps, 'label' | 'isInvalid' | 'isRequired' | 'isDisabled' | 'size' | 'groupPlacement'>, Pick<IWithMessagesProps, 'infoMessage' | 'errorMessage'> {
7
8
  value?: string;
8
9
  placeholder?: string;
10
+ counterPosition?: ITextAreaCounterPosition;
9
11
  /** @default false */
10
12
  isActive?: boolean;
11
13
  /**
@@ -1,8 +1,10 @@
1
1
  import { ITweakStyles } from '../../theme';
2
+ import { IWithPrefix } from '../../types';
2
3
  import { IControlWrapperStyles } from '../ControlWrapper';
3
4
  import { IWithMessagesStyles } from '../WithMessages';
4
- export declare const useStyles: import("../../theme").IUseStyles<"textarea" | "autoSized" | "withLabel" | "wrapper" | "symbolsCount" | "symbolsCountError", unknown>;
5
+ import { ITextAreaCounterPositions } from './types';
6
+ export declare const useStyles: import("../../theme").IUseStyles<"root" | "textarea" | "autoSized" | "withLabel" | "wrapper" | "symbolsCount" | "symbolsCountError" | "symbolsCountActive" | "counter-default", unknown>;
5
7
  export type ITextAreaStyles = ITweakStyles<typeof useStyles, {
6
8
  tweakWithMessages: IWithMessagesStyles;
7
9
  tweakControlWrapper: IControlWrapperStyles;
8
- }>;
10
+ } & IWithPrefix<ITextAreaCounterPositions, 'counter-'>>;
@@ -0,0 +1,4 @@
1
+ import { IExtendableProps } from '../../types';
2
+ export interface ITextAreaCounterPositions extends IExtendableProps<'default'> {
3
+ }
4
+ export type ITextAreaCounterPosition = keyof ITextAreaCounterPositions;
@@ -10485,7 +10485,7 @@ function _ts_generator$5(thisArg, body) {
10485
10485
  }
10486
10486
  }
10487
10487
  var InputBase = /* @__PURE__ */ forwardRef(function(_param, ref) {
10488
- var _param_value = _param.value, value = _param_value === void 0 ? "" : _param_value, placeholder = _param.placeholder, label = _param.label, _param_type = _param.type, type = _param_type === void 0 ? "text" : _param_type, isDisabled = _param.isDisabled, autoComplete = _param.autoComplete, initialInputMode = _param.inputMode, isReadonly = _param.isReadonly, isInvalid = _param.isInvalid, isActive = _param.isActive, isClearable = _param.isClearable, isAutoSized = _param.isAutoSized, name = _param.name, tweakStyles = _param.tweakStyles, maxLength = _param.maxLength, shouldFocusOnMount = _param.shouldFocusOnMount, units = _param.units, testId = _param.testId, tabIndex = _param.tabIndex, shouldAlwaysShowPlaceholder = _param.shouldAlwaysShowPlaceholder, onChange = _param.onChange, onPaste = _param.onPaste, onFocus = _param.onFocus, onBlur = _param.onBlur, onKeyDown = _param.onKeyDown, mask = _param.mask, maskPlaceholder = _param.maskPlaceholder, alwaysShowMask = _param.alwaysShowMask, beforeMaskedStateChange = _param.beforeMaskedStateChange, data = _param.data, groupPlacement = _param.groupPlacement, icon = _param.icon, isLoading = _param.isLoading, isRequired = _param.isRequired, size2 = _param.size, onIconClick = _param.onIconClick, inputProps = _object_without_properties$i(_param, [
10488
+ var _param_value = _param.value, value = _param_value === void 0 ? "" : _param_value, placeholder = _param.placeholder, label = _param.label, _param_type = _param.type, type = _param_type === void 0 ? "text" : _param_type, isDisabled = _param.isDisabled, autoComplete = _param.autoComplete, initialInputMode = _param.inputMode, isReadonly = _param.isReadonly, isInvalid = _param.isInvalid, isActive = _param.isActive, isClearable = _param.isClearable, isAutoSized = _param.isAutoSized, name = _param.name, tweakStyles = _param.tweakStyles, maxLength = _param.maxLength, shouldFocusOnMount = _param.shouldFocusOnMount, units = _param.units, testId = _param.testId, tabIndex = _param.tabIndex, shouldAlwaysShowPlaceholder = _param.shouldAlwaysShowPlaceholder, onChange = _param.onChange, onPaste = _param.onPaste, onFocus = _param.onFocus, onBlur = _param.onBlur, onKeyDown = _param.onKeyDown, mask = _param.mask, maskPlaceholder = _param.maskPlaceholder, alwaysShowMask = _param.alwaysShowMask, beforeMaskedStateChange = _param.beforeMaskedStateChange, data = _param.data, groupPlacement = _param.groupPlacement, icon = _param.icon, isLoading = _param.isLoading, isRequired = _param.isRequired, size2 = _param.size, onIconClick = _param.onIconClick, children = _param.children, inputProps = _object_without_properties$i(_param, [
10489
10489
  "value",
10490
10490
  "placeholder",
10491
10491
  "label",
@@ -10521,7 +10521,8 @@ var InputBase = /* @__PURE__ */ forwardRef(function(_param, ref) {
10521
10521
  "isLoading",
10522
10522
  "isRequired",
10523
10523
  "size",
10524
- "onIconClick"
10524
+ "onIconClick",
10525
+ "children"
10525
10526
  ]);
10526
10527
  var classes = useStyles$G({
10527
10528
  theme: tweakStyles
@@ -10636,7 +10637,7 @@ var InputBase = /* @__PURE__ */ forwardRef(function(_param, ref) {
10636
10637
  })
10637
10638
  ]
10638
10639
  });
10639
- return /* @__PURE__ */ jsx(ControlWrapper, {
10640
+ return /* @__PURE__ */ jsxs(ControlWrapper, {
10640
10641
  label,
10641
10642
  isDisabled,
10642
10643
  isFocused: hasFocus,
@@ -10652,10 +10653,13 @@ var InputBase = /* @__PURE__ */ forwardRef(function(_param, ref) {
10652
10653
  isRequired,
10653
10654
  onIconClick,
10654
10655
  size: size2,
10655
- children: hasUnits || isAutoSized ? /* @__PURE__ */ jsx("div", {
10656
- className: classes.autoSizeWrapper,
10657
- children: inputContent
10658
- }) : inputContent
10656
+ children: [
10657
+ hasUnits || isAutoSized ? /* @__PURE__ */ jsx("div", {
10658
+ className: classes.autoSizeWrapper,
10659
+ children: inputContent
10660
+ }) : inputContent,
10661
+ children
10662
+ ]
10659
10663
  });
10660
10664
  });
10661
10665
  function _define_property$S(obj, key, value) {
@@ -27892,71 +27896,62 @@ function FlexibleTable(_param) {
27892
27896
  }))
27893
27897
  });
27894
27898
  }
27895
- var BUTTONS_WIDTH = 36;
27896
- var BUTTONS_GAP = 2;
27899
+ var inputStyles$2 = {
27900
+ tweakControlWrapper: {
27901
+ controlWrapper: {
27902
+ "--increment-buttons-width": "36px",
27903
+ "--increment-buttons-gap": "1px",
27904
+ "--increment-buttons-margin": "1px",
27905
+ "--increment-button-icon-size": "16px"
27906
+ }
27907
+ }
27908
+ };
27897
27909
  var useStyles$g = createThemedStyles("IncrementInput", {
27898
- root: {
27899
- display: "flex",
27900
- alignItems: "center",
27901
- position: "relative"
27902
- },
27903
27910
  buttons: {
27904
27911
  display: "flex",
27905
27912
  flexDirection: "column",
27906
- width: BUTTONS_WIDTH,
27907
- position: "absolute",
27908
- right: BUTTONS_GAP,
27909
- top: BUTTONS_GAP,
27910
- bottom: BUTTONS_GAP,
27913
+ height: "calc(100% - var(--increment-buttons-margin) * 2)",
27914
+ margin: "var(--increment-buttons-margin)",
27915
+ gap: "var(--increment-buttons-gap)",
27916
+ flexShrink: 0,
27917
+ order: 1e3,
27918
+ // сдвигаем кнопки на самый конец
27911
27919
  zIndex: dimensions.Z_INDEX.CONTROL_FOCUS + 1
27912
27920
  },
27913
27921
  button: {
27914
- width: "100%",
27915
- height: (dimensions.CONTROL.HEIGHT - 5) / 2,
27922
+ display: "flex",
27923
+ alignItems: "center",
27924
+ justifyContent: "center",
27925
+ width: "var(--increment-buttons-width)",
27926
+ flexGrow: 1,
27927
+ cursor: "pointer",
27916
27928
  border: "none",
27917
27929
  outline: "none",
27930
+ color: colors.FONT_MEDIUM,
27918
27931
  backgroundColor: colors.GREY_BACKGROUND,
27919
27932
  transition: animations.defaultTransition,
27920
- transitionProperty: "background-color",
27921
- color: colors.FONT_MEDIUM,
27922
- cursor: "pointer",
27923
- display: "flex",
27924
- alignItems: "center",
27925
- justifyContent: "center",
27926
- padding: [
27927
- 0,
27928
- 10
27929
- ],
27933
+ transitionProperty: "background-color, color",
27930
27934
  "&:hover, &:focus": {
27931
27935
  backgroundColor: colors.GREY_HOVER
27932
27936
  },
27933
27937
  "&:active": {
27934
27938
  backgroundColor: colors.GREY_ACTIVE
27935
- },
27936
- "&:first-child": {
27937
- marginBottom: 1
27938
27939
  }
27939
27940
  },
27940
27941
  disabledButton: {
27941
- backgroundColor: colors.CLASSIC_WHITE,
27942
- color: colors.FONT_DISABLED,
27943
27942
  cursor: "default",
27943
+ color: colors.FONT_DISABLED,
27944
+ backgroundColor: colors.CLASSIC_WHITE,
27944
27945
  "&:hover": {
27945
27946
  backgroundColor: colors.CLASSIC_WHITE
27946
27947
  }
27947
27948
  },
27948
- errorButton: {}
27949
- });
27950
- var inputStyles$2 = {
27951
- input: {
27952
- paddingRight: BUTTONS_WIDTH + BUTTONS_GAP
27953
- },
27954
- tweakControlWrapper: {
27955
- controls: {
27956
- paddingRight: BUTTONS_WIDTH + BUTTONS_GAP
27957
- }
27949
+ errorButton: {},
27950
+ icon: {
27951
+ width: "var(--increment-button-icon-size)",
27952
+ height: "var(--increment-button-icon-size)"
27958
27953
  }
27959
- };
27954
+ });
27960
27955
  function _define_property$k(obj, key, value) {
27961
27956
  if (key in obj) {
27962
27957
  Object.defineProperty(obj, key, {
@@ -28042,15 +28037,13 @@ function _object_without_properties_loose$7(source, excluded) {
28042
28037
  return target;
28043
28038
  }
28044
28039
  var IncrementInput = function(_param) {
28045
- var value = _param.value, onChange = _param.onChange, min2 = _param.min, max2 = _param.max, _param_step = _param.step, step = _param_step === void 0 ? 1 : _param_step, intPartPrecision = _param.intPartPrecision, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, isDisabled = _param.isDisabled, isReadonly = _param.isReadonly, isInvalid = _param.isInvalid, props = _object_without_properties$7(_param, [
28040
+ var value = _param.value, onChange = _param.onChange, min2 = _param.min, max2 = _param.max, _param_step = _param.step, step = _param_step === void 0 ? 1 : _param_step, intPartPrecision = _param.intPartPrecision, tweakStyles = _param.tweakStyles, isDisabled = _param.isDisabled, isReadonly = _param.isReadonly, isInvalid = _param.isInvalid, props = _object_without_properties$7(_param, [
28046
28041
  "value",
28047
28042
  "onChange",
28048
28043
  "min",
28049
28044
  "max",
28050
28045
  "step",
28051
28046
  "intPartPrecision",
28052
- "data",
28053
- "testId",
28054
28047
  "tweakStyles",
28055
28048
  "isDisabled",
28056
28049
  "isReadonly",
@@ -28065,8 +28058,9 @@ var IncrementInput = function(_param) {
28065
28058
  var classes = useStyles$g({
28066
28059
  theme: tweakStyles
28067
28060
  });
28068
- var isIncreaseDisabled = isDisabled || isReadonly || intPartPrecision !== void 0 && getNumberLength((value !== null && value !== void 0 ? value : 0) + step) > intPartPrecision || max2 !== void 0 && value !== void 0 && value >= max2;
28069
- var isDecreaseDisabled = isDisabled || isReadonly || (min2 !== void 0 && value !== void 0 ? value <= min2 : false);
28061
+ var isEditDisabled = isDisabled || isReadonly;
28062
+ var isIncreaseDisabled = isEditDisabled || isNotEmpty(intPartPrecision) && getNumberLength((value !== null && value !== void 0 ? value : 0) + step) > intPartPrecision || isNotEmpty(max2) && isNotEmpty(value) && value >= max2;
28063
+ var isDecreaseDisabled = isEditDisabled || isNotEmpty(min2) && isNotEmpty(value) && value <= min2;
28070
28064
  var increment = function() {
28071
28065
  onChange(getNumberInRange((value !== null && value !== void 0 ? value : 0) + step, min2, max2));
28072
28066
  };
@@ -28081,45 +28075,45 @@ var IncrementInput = function(_param) {
28081
28075
  step
28082
28076
  ]);
28083
28077
  var _obj2, _obj1;
28084
- return /* @__PURE__ */ jsxs("div", _object_spread_props$i(_object_spread$j({
28085
- className: classes.root
28086
- }, addDataTestId(testId), addDataAttributes(data)), {
28087
- children: [
28088
- /* @__PURE__ */ jsx(NumberInput, _object_spread_props$i(_object_spread$j({}, props), {
28089
- isInvalid,
28090
- isDisabled,
28091
- isReadonly,
28092
- min: min2,
28093
- max: max2,
28094
- intPartPrecision,
28095
- onChange,
28096
- value,
28097
- tweakStyles: tweakInputStyles
28098
- })),
28099
- /* @__PURE__ */ jsxs("div", {
28100
- className: classes.buttons,
28101
- children: [
28102
- /* @__PURE__ */ jsx("button", {
28103
- className: clsx(classes.button, (_obj2 = {}, _define_property$k(_obj2, classes.disabledButton, isIncreaseDisabled), _define_property$k(_obj2, classes.errorButton, isInvalid), _obj2)),
28104
- type: "button",
28105
- disabled: isIncreaseDisabled,
28106
- onClick: increment,
28078
+ return /* @__PURE__ */ jsx(NumberInput, _object_spread_props$i(_object_spread$j({}, props), {
28079
+ isInvalid,
28080
+ isDisabled,
28081
+ isReadonly,
28082
+ min: min2,
28083
+ max: max2,
28084
+ intPartPrecision,
28085
+ onChange,
28086
+ value,
28087
+ tweakStyles: tweakInputStyles,
28088
+ children: /* @__PURE__ */ jsxs("div", {
28089
+ className: classes.buttons,
28090
+ children: [
28091
+ /* @__PURE__ */ jsx("button", {
28092
+ className: clsx(classes.button, (_obj2 = {}, _define_property$k(_obj2, classes.disabledButton, isIncreaseDisabled), _define_property$k(_obj2, classes.errorButton, isInvalid), _obj2)),
28093
+ type: "button",
28094
+ disabled: isIncreaseDisabled,
28095
+ onClick: increment,
28096
+ children: /* @__PURE__ */ jsx("div", {
28097
+ className: classes.icon,
28107
28098
  children: /* @__PURE__ */ jsx(Icon, {
28108
28099
  type: "plus"
28109
28100
  })
28110
- }),
28111
- /* @__PURE__ */ jsx("button", {
28112
- className: clsx(classes.button, (_obj1 = {}, _define_property$k(_obj1, classes.disabledButton, isDecreaseDisabled), _define_property$k(_obj1, classes.errorButton, isInvalid), _obj1)),
28113
- type: "button",
28114
- disabled: isDecreaseDisabled,
28115
- onClick: decrement,
28101
+ })
28102
+ }),
28103
+ /* @__PURE__ */ jsx("button", {
28104
+ className: clsx(classes.button, (_obj1 = {}, _define_property$k(_obj1, classes.disabledButton, isDecreaseDisabled), _define_property$k(_obj1, classes.errorButton, isInvalid), _obj1)),
28105
+ type: "button",
28106
+ disabled: isDecreaseDisabled,
28107
+ onClick: decrement,
28108
+ children: /* @__PURE__ */ jsx("div", {
28109
+ className: classes.icon,
28116
28110
  children: /* @__PURE__ */ jsx(Icon, {
28117
28111
  type: "minus"
28118
28112
  })
28119
28113
  })
28120
- ]
28121
- })
28122
- ]
28114
+ })
28115
+ ]
28116
+ })
28123
28117
  }));
28124
28118
  };
28125
28119
  var VERTICAL_OVERLAY_PADDING = 50;
@@ -29674,7 +29668,7 @@ var PhoneInputCountryList = function(param) {
29674
29668
  ]
29675
29669
  });
29676
29670
  };
29677
- var DEFAULT_VALUE$1 = {
29671
+ var DEFAULT_VALUE = {
29678
29672
  phoneNumber: "",
29679
29673
  dialCode: ""
29680
29674
  };
@@ -29892,7 +29886,7 @@ function _unsupported_iterable_to_array$2(o, minLen) {
29892
29886
  return _array_like_to_array$2(o, minLen);
29893
29887
  }
29894
29888
  var PhoneInput = function(_param) {
29895
- var _param_locale = _param.locale, locale = _param_locale === void 0 ? "ru" : _param_locale, _param_value = _param.value, value = _param_value === void 0 ? DEFAULT_VALUE$1 : _param_value, onChange = _param.onChange, data = _param.data, testId = _param.testId, isDisabled = _param.isDisabled, isInvalid = _param.isInvalid, isActive = _param.isActive, tweakStyles = _param.tweakStyles, _param_codeSearchPlaceholder = _param.codeSearchPlaceholder, codeSearchPlaceholder = _param_codeSearchPlaceholder === void 0 ? "Поиск" : _param_codeSearchPlaceholder, _param_noMatchesLabel = _param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Ничего не найдено" : _param_noMatchesLabel, inputProps = _object_without_properties$5(_param, [
29889
+ var _param_locale = _param.locale, locale = _param_locale === void 0 ? "ru" : _param_locale, _param_value = _param.value, value = _param_value === void 0 ? DEFAULT_VALUE : _param_value, onChange = _param.onChange, data = _param.data, testId = _param.testId, isDisabled = _param.isDisabled, isInvalid = _param.isInvalid, isActive = _param.isActive, tweakStyles = _param.tweakStyles, _param_codeSearchPlaceholder = _param.codeSearchPlaceholder, codeSearchPlaceholder = _param_codeSearchPlaceholder === void 0 ? "Поиск" : _param_codeSearchPlaceholder, _param_noMatchesLabel = _param.noMatchesLabel, noMatchesLabel = _param_noMatchesLabel === void 0 ? "Ничего не найдено" : _param_noMatchesLabel, inputProps = _object_without_properties$5(_param, [
29896
29890
  "locale",
29897
29891
  "value",
29898
29892
  "onChange",
@@ -31335,6 +31329,9 @@ function _object_spread_props$6(target, source) {
31335
31329
  return target;
31336
31330
  }
31337
31331
  var useStyles$4 = createThemedStyles("TextArea", {
31332
+ root: {
31333
+ width: "100%"
31334
+ },
31338
31335
  textarea: _object_spread_props$6(_object_spread$6({}, helpers.withScrollBar), {
31339
31336
  width: "100%",
31340
31337
  height: "100%",
@@ -31394,6 +31391,8 @@ var useStyles$4 = createThemedStyles("TextArea", {
31394
31391
  symbolsCountError: {
31395
31392
  color: "red"
31396
31393
  },
31394
+ symbolsCountActive: {},
31395
+ "counter-default": {},
31397
31396
  withLabel: {}
31398
31397
  });
31399
31398
  function _array_like_to_array(arr, len) {
@@ -31538,12 +31537,12 @@ function _unsupported_iterable_to_array(o, minLen) {
31538
31537
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
31539
31538
  return _array_like_to_array(o, minLen);
31540
31539
  }
31541
- var DEFAULT_VALUE = "";
31542
31540
  var TextArea = /* @__PURE__ */ forwardRef(function(_param, ref) {
31543
- var _param_value = _param.value, value = _param_value === void 0 ? DEFAULT_VALUE : _param_value, placeholder = _param.placeholder, name = _param.name, shouldFocusOnMount = _param.shouldFocusOnMount, _param_hasCounter = _param.hasCounter, hasCounter = _param_hasCounter === void 0 ? true : _param_hasCounter, shouldTrimAfterMaxLength = _param.shouldTrimAfterMaxLength, _param_isAutoSized = _param.isAutoSized, isAutoSized = _param_isAutoSized === void 0 ? true : _param_isAutoSized, shouldAlwaysShowPlaceholder = _param.shouldAlwaysShowPlaceholder, isActive = _param.isActive, maxLength = _param.maxLength, rows = _param.rows, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, onChange = _param.onChange, onPaste = _param.onPaste, onFocus = _param.onFocus, onBlur = _param.onBlur, infoMessage = _param.infoMessage, errorMessage = _param.errorMessage, label = _param.label, isDisabled = _param.isDisabled, isInvalid = _param.isInvalid, isRequired = _param.isRequired, size2 = _param.size, groupPlacement = _param.groupPlacement, textAreaProps = _object_without_properties$3(_param, [
31541
+ var _param_value = _param.value, value = _param_value === void 0 ? "" : _param_value, placeholder = _param.placeholder, name = _param.name, _param_counterPosition = _param.counterPosition, counterPosition = _param_counterPosition === void 0 ? "default" : _param_counterPosition, shouldFocusOnMount = _param.shouldFocusOnMount, _param_hasCounter = _param.hasCounter, hasCounter = _param_hasCounter === void 0 ? true : _param_hasCounter, shouldTrimAfterMaxLength = _param.shouldTrimAfterMaxLength, _param_isAutoSized = _param.isAutoSized, isAutoSized = _param_isAutoSized === void 0 ? true : _param_isAutoSized, shouldAlwaysShowPlaceholder = _param.shouldAlwaysShowPlaceholder, isActive = _param.isActive, maxLength = _param.maxLength, rows = _param.rows, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, onChange = _param.onChange, onPaste = _param.onPaste, onFocus = _param.onFocus, onBlur = _param.onBlur, infoMessage = _param.infoMessage, errorMessage = _param.errorMessage, label = _param.label, isDisabled = _param.isDisabled, isInvalid = _param.isInvalid, isRequired = _param.isRequired, size2 = _param.size, groupPlacement = _param.groupPlacement, textAreaProps = _object_without_properties$3(_param, [
31544
31542
  "value",
31545
31543
  "placeholder",
31546
31544
  "name",
31545
+ "counterPosition",
31547
31546
  "shouldFocusOnMount",
31548
31547
  "hasCounter",
31549
31548
  "shouldTrimAfterMaxLength",
@@ -31571,6 +31570,8 @@ var TextArea = /* @__PURE__ */ forwardRef(function(_param, ref) {
31571
31570
  var classes = useStyles$4({
31572
31571
  theme: tweakStyles
31573
31572
  });
31573
+ var shouldShowCounter = hasCounter && isNotEmpty(maxLength);
31574
+ var counterString = "".concat(value.length, " / ").concat(maxLength);
31574
31575
  var tweakWithMessagesStyles = useTweakStyles({
31575
31576
  tweakStyles,
31576
31577
  className: "tweakWithMessages",
@@ -31597,14 +31598,18 @@ var TextArea = /* @__PURE__ */ forwardRef(function(_param, ref) {
31597
31598
  setFocused(false);
31598
31599
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
31599
31600
  };
31600
- var _obj2;
31601
- return /* @__PURE__ */ jsxs(WithMessages, {
31602
- errorMessage,
31603
- infoMessage,
31604
- tweakStyles: tweakWithMessagesStyles,
31605
- testId: getTestId(testId, "wrapper"),
31606
- children: [
31607
- /* @__PURE__ */ jsx(ControlWrapper, {
31601
+ var _obj2, _obj1;
31602
+ return /* @__PURE__ */ jsx("div", {
31603
+ className: classes.root,
31604
+ style: {
31605
+ "--counter-length": counterString.length
31606
+ },
31607
+ children: /* @__PURE__ */ jsx(WithMessages, {
31608
+ errorMessage,
31609
+ infoMessage,
31610
+ tweakStyles: tweakWithMessagesStyles,
31611
+ testId: getTestId(testId, "wrapper"),
31612
+ children: /* @__PURE__ */ jsx(ControlWrapper, {
31608
31613
  label,
31609
31614
  tweakStyles: tweakControlWrapperStyles,
31610
31615
  isFocused: hasFocus,
@@ -31615,37 +31620,38 @@ var TextArea = /* @__PURE__ */ forwardRef(function(_param, ref) {
31615
31620
  groupPlacement,
31616
31621
  size: size2,
31617
31622
  isFullWidth: true,
31618
- children: /* @__PURE__ */ jsx("div", _object_spread_props$5(_object_spread$5({
31619
- className: clsx(classes.wrapper, (_obj2 = {}, _define_property$5(_obj2, classes.autoSized, isAutoSized), _define_property$5(_obj2, classes.withLabel, hasLabel), _obj2))
31623
+ children: /* @__PURE__ */ jsxs("div", _object_spread_props$5(_object_spread$5({
31624
+ className: clsx(classes.wrapper, isNotEmpty(size2) && classes[size2], (_obj2 = {}, _define_property$5(_obj2, classes.autoSized, isAutoSized), _define_property$5(_obj2, classes.withLabel, hasLabel), _obj2))
31620
31625
  }, isAutoSized && {
31621
31626
  "data-value": value
31622
31627
  }), {
31623
- children: /* @__PURE__ */ jsx("textarea", _object_spread$5({
31624
- ref,
31625
- className: classes.textarea,
31626
- value,
31627
- disabled: isDisabled,
31628
- placeholder: hasPlaceholder ? placeholder : void 0,
31629
- maxLength: shouldTrimAfterMaxLength ? maxLength : void 0,
31630
- name,
31631
- rows,
31632
- onPaste,
31633
- onFocus: handleFocus,
31634
- onBlur: handleBlur,
31635
- onChange: handleChange,
31636
- autoFocus: shouldFocusOnMount
31637
- }, addDataAttributes$1(data, testId), textAreaProps))
31628
+ children: [
31629
+ /* @__PURE__ */ jsx("textarea", _object_spread$5({
31630
+ ref,
31631
+ className: classes.textarea,
31632
+ value,
31633
+ disabled: isDisabled,
31634
+ placeholder: hasPlaceholder ? placeholder : void 0,
31635
+ maxLength: shouldTrimAfterMaxLength ? maxLength : void 0,
31636
+ name,
31637
+ rows,
31638
+ onPaste,
31639
+ onFocus: handleFocus,
31640
+ onBlur: handleBlur,
31641
+ onChange: handleChange,
31642
+ autoFocus: shouldFocusOnMount
31643
+ }, addDataAttributes$1(data, testId), textAreaProps)),
31644
+ shouldShowCounter && /* @__PURE__ */ jsx("span", _object_spread_props$5(_object_spread$5({
31645
+ className: clsx(classes.symbolsCount, classes["counter-".concat(counterPosition)], (_obj1 = {}, _define_property$5(_obj1, classes.symbolsCountError, value.length > maxLength), _define_property$5(_obj1, classes.symbolsCountActive, hasFocus || hasValue), _obj1))
31646
+ }, addDataAttributes$1({
31647
+ counterPosition
31648
+ })), {
31649
+ children: counterString
31650
+ }))
31651
+ ]
31638
31652
  }))
31639
- }),
31640
- hasCounter && isNotEmpty(maxLength) && /* @__PURE__ */ jsxs("span", {
31641
- className: clsx(classes.symbolsCount, _define_property$5({}, classes.symbolsCountError, value.length > maxLength)),
31642
- children: [
31643
- value.length,
31644
- " / ",
31645
- maxLength
31646
- ]
31647
31653
  })
31648
- ]
31654
+ })
31649
31655
  });
31650
31656
  });
31651
31657
  var useStyles$3 = createThemedStyles("TextButton", {