@synerise/ds-input 1.6.8 → 1.6.10

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +86 -24
  3. package/dist/AutosizeInput/AutosizeInput.d.ts +2 -2
  4. package/dist/AutosizeInput/AutosizeInput.js +80 -95
  5. package/dist/AutosizeInput/AutosizeInput.types.d.ts +1 -1
  6. package/dist/AutosizeInput/AutosizeInput.types.js +1 -1
  7. package/dist/AutosizeInput/utils/calculateInputWidth.d.ts +1 -1
  8. package/dist/AutosizeInput/utils/calculateInputWidth.js +13 -11
  9. package/dist/AutosizeInput/utils/index.js +4 -1
  10. package/dist/Input.d.ts +5 -7
  11. package/dist/Input.js +117 -174
  12. package/dist/Input.styles.d.ts +22 -22
  13. package/dist/Input.styles.js +98 -122
  14. package/dist/Input.types.d.ts +5 -5
  15. package/dist/Input.types.js +1 -1
  16. package/dist/InputGroup.d.ts +2 -2
  17. package/dist/InputGroup.js +21 -38
  18. package/dist/InputGroup.styles.d.ts +2 -2
  19. package/dist/InputGroup.styles.js +8 -8
  20. package/dist/InputGroup.types.d.ts +2 -2
  21. package/dist/InputGroup.types.js +1 -1
  22. package/dist/InputMultivalue/Elements/Value.d.ts +2 -2
  23. package/dist/InputMultivalue/Elements/Value.js +22 -34
  24. package/dist/InputMultivalue/Elements/Value.types.d.ts +2 -2
  25. package/dist/InputMultivalue/Elements/Value.types.js +1 -1
  26. package/dist/InputMultivalue/InputMultivalue.d.ts +2 -2
  27. package/dist/InputMultivalue/InputMultivalue.js +52 -74
  28. package/dist/InputMultivalue/InputMultivalue.styles.d.ts +10 -10
  29. package/dist/InputMultivalue/InputMultivalue.styles.js +48 -67
  30. package/dist/InputMultivalue/InputMultivalue.types.d.ts +1 -1
  31. package/dist/InputMultivalue/InputMultivalue.types.js +1 -1
  32. package/dist/PasswordInput.d.ts +2 -2
  33. package/dist/PasswordInput.js +31 -45
  34. package/dist/PasswordInput.types.d.ts +2 -2
  35. package/dist/PasswordInput.types.js +1 -1
  36. package/dist/TextArea.d.ts +4 -6
  37. package/dist/TextArea.js +53 -75
  38. package/dist/TextArea.types.d.ts +2 -2
  39. package/dist/TextArea.types.js +1 -1
  40. package/dist/Textarea/Textarea.d.ts +4 -4
  41. package/dist/Textarea/Textarea.js +32 -51
  42. package/dist/Textarea/Textarea.styles.d.ts +2 -2
  43. package/dist/Textarea/Textarea.styles.js +10 -9
  44. package/dist/Textarea/Textarea.types.d.ts +3 -3
  45. package/dist/Textarea/Textarea.types.js +1 -1
  46. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  47. package/dist/components/AutosizeWrapper.d.ts +2 -2
  48. package/dist/components/AutosizeWrapper.js +16 -18
  49. package/dist/components/ElementIcons.d.ts +2 -2
  50. package/dist/components/ElementIcons.js +37 -51
  51. package/dist/components/ExpandableWrapper.d.ts +3 -3
  52. package/dist/components/ExpandableWrapper.js +20 -21
  53. package/dist/components/index.js +8 -3
  54. package/dist/hooks/index.js +6 -2
  55. package/dist/hooks/useCounterLimit.d.ts +2 -2
  56. package/dist/hooks/useCounterLimit.js +19 -14
  57. package/dist/hooks/useElementFocus.d.ts +2 -2
  58. package/dist/hooks/useElementFocus.js +6 -3
  59. package/dist/hooks/useInputAddonHeight.d.ts +2 -2
  60. package/dist/hooks/useInputAddonHeight.js +10 -10
  61. package/dist/index.js +24 -12
  62. package/dist/modules.d.js +1 -1
  63. package/dist/modules.d.ts +0 -0
  64. package/dist/utils/getCharCount.d.ts +2 -2
  65. package/dist/utils/getCharCount.js +5 -2
  66. package/dist/utils/index.js +4 -1
  67. package/package.json +9 -9
@@ -1,52 +1,33 @@
1
- var _excluded = ["disabled", "error", "rows", "wrapperStyle", "onBlur", "onFocus", "resize", "autoSize", "readOnly"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { forwardRef, useState } from 'react';
5
- import Scrollbar from '@synerise/ds-scrollbar';
6
- import * as InputStyles from '../Input.styles';
7
- import * as S from './Textarea.styles';
8
- export var RawTextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
9
- var disabled = _ref.disabled,
10
- error = _ref.error,
11
- _ref$rows = _ref.rows,
12
- rows = _ref$rows === void 0 ? 4 : _ref$rows,
13
- wrapperStyle = _ref.wrapperStyle,
14
- _onBlur = _ref.onBlur,
15
- _onFocus = _ref.onFocus,
16
- resize = _ref.resize,
17
- autoSize = _ref.autoSize,
18
- readOnly = _ref.readOnly,
19
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
- var _useState = useState(false),
21
- focus = _useState[0],
22
- setFocus = _useState[1];
23
- return /*#__PURE__*/React.createElement(S.TextareaWrapper, {
24
- className: "ds-textarea",
25
- isDisabled: Boolean(disabled),
26
- isFocused: focus,
27
- isReadOnly: readOnly,
28
- hasError: Boolean(error),
29
- resize: resize,
30
- style: _extends({
31
- height: autoSize ? 'auto' : rows * 17 + "px"
32
- }, wrapperStyle)
33
- }, /*#__PURE__*/React.createElement(Scrollbar, {
34
- absolute: true,
35
- classes: "textarea-scrollbar"
36
- }, /*#__PURE__*/React.createElement(InputStyles.AntdTextArea, _extends({
37
- autoSize: autoSize
38
- }, props, {
39
- ref: ref,
40
- disabled: disabled,
41
- readOnly: readOnly,
42
- onFocus: function onFocus(e) {
43
- _onFocus && _onFocus(e);
44
- setFocus(true);
45
- },
46
- onBlur: function onBlur(e) {
47
- _onBlur && _onBlur(e);
48
- setFocus(false);
49
- }
50
- }))));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from "react";
3
+ import Scrollbar from "@synerise/ds-scrollbar";
4
+ import { AntdTextArea } from "../Input.styles.js";
5
+ import { TextareaWrapper } from "./Textarea.styles.js";
6
+ const RawTextArea = forwardRef(({
7
+ disabled,
8
+ error,
9
+ rows = 4,
10
+ wrapperStyle,
11
+ onBlur,
12
+ onFocus,
13
+ resize,
14
+ autoSize,
15
+ readOnly,
16
+ ...props
17
+ }, ref) => {
18
+ const [focus, setFocus] = useState(false);
19
+ return /* @__PURE__ */ jsx(TextareaWrapper, { className: "ds-textarea", isDisabled: Boolean(disabled), isFocused: focus, isReadOnly: readOnly, hasError: Boolean(error), resize, style: {
20
+ height: autoSize ? "auto" : `${rows * 17}px`,
21
+ ...wrapperStyle
22
+ }, children: /* @__PURE__ */ jsx(Scrollbar, { absolute: true, classes: "textarea-scrollbar", children: /* @__PURE__ */ jsx(AntdTextArea, { autoSize, ...props, ref, disabled, readOnly, onFocus: (e) => {
23
+ onFocus && onFocus(e);
24
+ setFocus(true);
25
+ }, onBlur: (e) => {
26
+ onBlur && onBlur(e);
27
+ setFocus(false);
28
+ } }) }) });
51
29
  });
52
- export default RawTextArea;
30
+ export {
31
+ RawTextArea,
32
+ RawTextArea as default
33
+ };
@@ -1,5 +1,5 @@
1
- import { type ResizeProperty } from 'csstype';
2
- export declare const TextareaWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ import { ResizeProperty } from 'csstype';
2
+ export declare const TextareaWrapper: import('styled-components').StyledComponent<"div", any, {
3
3
  resize?: ResizeProperty;
4
4
  isDisabled: boolean;
5
5
  isFocused: boolean;
@@ -1,21 +1,22 @@
1
- import styled, { css } from 'styled-components';
2
- export var TextareaWrapper = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ const TextareaWrapper = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "Textareastyles__TextareaWrapper",
4
4
  componentId: "sc-23480t-0"
5
- })(["position:relative;overflow:hidden;resize:", ";border-radius:3px;transition:background-color 0.3s ease-in-out,border 0.3s ease-in-out,box-shadow 0.3s ease-in-out;", " .scrollbar-container{height:100%;top:1px;bottom:0;right:1px;.ps__rail-y,.ps__thumb-x,.ps__rail-x{height:calc(100% - 1px);max-height:9px;}& > .textarea-scrollbar{&,& > div{height:calc(100% - 2px);}}}&&&{textarea{position:relative;min-height:100%;resize:none;background:transparent;border:0;box-shadow:none;outline:0;word-wrap:break-word;overflow-wrap:break-word;font-variant-numeric:normal;::placeholder,::-webkit-input-placeholder{line-height:1.38;}:-ms-input-placeholder{line-height:1.38;}}.ant-input-textarea{height:100%;}}"], function (props) {
6
- return props.resize ? props.resize : 'vertical';
7
- }, function (props) {
5
+ })(["position:relative;overflow:hidden;resize:", ";border-radius:3px;transition:background-color 0.3s ease-in-out,border 0.3s ease-in-out,box-shadow 0.3s ease-in-out;", " .scrollbar-container{height:100%;top:1px;bottom:0;right:1px;.ps__rail-y,.ps__thumb-x,.ps__rail-x{height:calc(100% - 1px);max-height:9px;}& > .textarea-scrollbar{&,& > div{height:calc(100% - 2px);}}}&&&{textarea{position:relative;min-height:100%;resize:none;background:transparent;border:0;box-shadow:none;outline:0;word-wrap:break-word;overflow-wrap:break-word;font-variant-numeric:normal;::placeholder,::-webkit-input-placeholder{line-height:1.38;}:-ms-input-placeholder{line-height:1.38;}}.ant-input-textarea{height:100%;}}"], (props) => props.resize ? props.resize : "vertical", (props) => {
8
6
  if (props.isReadOnly) {
9
- return css(["border:1px solid ", ";background-color:", ";"], props.theme.palette['grey-300'], props.theme.palette['grey-050']);
7
+ return css(["border:1px solid ", ";background-color:", ";"], props.theme.palette["grey-300"], props.theme.palette["grey-050"]);
10
8
  }
11
9
  if (props.isDisabled) {
12
10
  return css(["border:1px solid #dbe0e3;background-color:#f9fafb;cursor:not-allowed;"]);
13
11
  }
14
12
  if (props.isFocused) {
15
- return css(["box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";background-color:", ";&&&{textarea{&::-webkit-scrollbar-thumb{background-color:#e1e3e6;border:4px solid ", " !important;}}}"], props.theme.palette['blue-600'], props.theme.palette['blue-600'], props.theme.palette['blue-050'], props.theme.palette['blue-050']);
13
+ return css(["box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";background-color:", ";&&&{textarea{&::-webkit-scrollbar-thumb{background-color:#e1e3e6;border:4px solid ", " !important;}}}"], props.theme.palette["blue-600"], props.theme.palette["blue-600"], props.theme.palette["blue-050"], props.theme.palette["blue-050"]);
16
14
  }
17
15
  if (props.hasError) {
18
- return css(["background-color:", ";box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";"], props.theme.palette['red-050'], props.theme.palette['red-600'], props.theme.palette['red-600']);
16
+ return css(["background-color:", ";box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";"], props.theme.palette["red-050"], props.theme.palette["red-600"], props.theme.palette["red-600"]);
19
17
  }
20
18
  return css(["border:1px solid #dbe0e3;background-color:#fff;"]);
21
- });
19
+ });
20
+ export {
21
+ TextareaWrapper
22
+ };
@@ -1,6 +1,6 @@
1
- import { type TextAreaProps as AntdTextAreaProps } from 'antd/lib/input';
2
- import { type ResizeProperty } from 'csstype';
3
- import type React from 'react';
1
+ import { TextAreaProps as AntdTextAreaProps } from 'antd/lib/input';
2
+ import { ResizeProperty } from 'csstype';
3
+ import { default as React } from 'react';
4
4
  /**
5
5
  * @deprecated Use RawTextAreaProps instead.
6
6
  */
@@ -1 +1 @@
1
- export {};
1
+
File without changes
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { AutosizeInputRefType } from '../AutosizeInput/AutosizeInput.types';
1
+ import { default as React } from 'react';
2
+ import { AutosizeInputRefType } from '../AutosizeInput/AutosizeInput.types';
3
3
  export declare const AutosizeWrapper: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
4
4
  placeholderIsMinWidth?: boolean;
5
5
  wrapperClassName?: string;
@@ -1,20 +1,18 @@
1
- var _excluded = ["autoResize", "extraWidth", "children"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { forwardRef } from 'react';
5
- import AutosizeInput from '../AutosizeInput/AutosizeInput';
6
- var AUTOSIZE_EXTRA_WIDTH = 2;
7
- export var AutosizeWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
8
- var autoResize = _ref.autoResize,
9
- _ref$extraWidth = _ref.extraWidth,
10
- extraWidth = _ref$extraWidth === void 0 ? AUTOSIZE_EXTRA_WIDTH : _ref$extraWidth,
11
- children = _ref.children,
12
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import AutosizeInput from "../AutosizeInput/AutosizeInput.js";
4
+ const AUTOSIZE_EXTRA_WIDTH = 2;
5
+ const AutosizeWrapper = forwardRef(({
6
+ autoResize,
7
+ extraWidth = AUTOSIZE_EXTRA_WIDTH,
8
+ children,
9
+ ...props
10
+ }, ref) => {
13
11
  if (autoResize) {
14
- return /*#__PURE__*/React.createElement(AutosizeInput, _extends({
15
- ref: ref,
16
- extraWidth: extraWidth
17
- }, props), children);
12
+ return /* @__PURE__ */ jsx(AutosizeInput, { ref, extraWidth, ...props, children });
18
13
  }
19
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
20
- });
14
+ return /* @__PURE__ */ jsx(Fragment, { children });
15
+ });
16
+ export {
17
+ AutosizeWrapper
18
+ };
@@ -1,5 +1,5 @@
1
- import React, { type MouseEvent } from 'react';
2
- import { type BaseProps } from '../Input.types';
1
+ import { default as React, MouseEvent } from 'react';
2
+ import { BaseProps } from '../Input.types';
3
3
  type IconProps = Pick<BaseProps, 'icon1' | 'icon1Tooltip' | 'icon2' | 'icon2Tooltip' | 'className' | 'expandable' | 'expandableTooltip'> & {
4
4
  disabled?: boolean;
5
5
  handleIconsClick: () => void;
@@ -1,51 +1,37 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { cloneElement } from 'react';
3
- import Icon, { ResizeArrowM } from '@synerise/ds-icon';
4
- import Tooltip from '@synerise/ds-tooltip';
5
- import * as S from '../Input.styles';
6
- export var ElementIcons = function ElementIcons(_ref) {
7
- var handleIconsClick = _ref.handleIconsClick,
8
- disabled = _ref.disabled,
9
- icon1Tooltip = _ref.icon1Tooltip,
10
- icon1 = _ref.icon1,
11
- icon2 = _ref.icon2,
12
- icon2Tooltip = _ref.icon2Tooltip,
13
- className = _ref.className,
14
- type = _ref.type,
15
- expandable = _ref.expandable,
16
- overflown = _ref.overflown,
17
- expandableTooltip = _ref.expandableTooltip,
18
- handleExpandIconClick = _ref.handleExpandIconClick;
19
- return icon1 || icon2 || expandable ? /*#__PURE__*/React.createElement(S.IconsWrapper, {
20
- onClick: handleIconsClick,
21
- disabled: disabled
22
- }, /*#__PURE__*/React.createElement(S.IconsFlexContainer, {
23
- type: type
24
- }, expandable && /*#__PURE__*/React.createElement(Tooltip, {
25
- title: expandableTooltip
26
- }, /*#__PURE__*/React.createElement(S.IconWrapper, {
27
- onClick: handleExpandIconClick,
28
- className: className
29
- }, expandable && overflown && /*#__PURE__*/React.createElement(Icon, {
30
- className: "icon icon3",
31
- component: /*#__PURE__*/React.createElement(ResizeArrowM, {
32
- "data-testid": "ds-input-icon-expand"
33
- })
34
- }))), /*#__PURE__*/React.createElement(Tooltip, {
35
- title: icon1Tooltip
36
- }, /*#__PURE__*/React.createElement(S.IconWrapper, {
37
- className: className
38
- }, icon1 && /*#__PURE__*/cloneElement(icon1, _extends({
39
- className: 'icon icon1'
40
- }, icon2 && {
41
- style: {
42
- marginRight: '4px'
43
- }
44
- })))), /*#__PURE__*/React.createElement(Tooltip, {
45
- title: icon2Tooltip
46
- }, /*#__PURE__*/React.createElement(S.IconWrapper, {
47
- className: className
48
- }, icon2 && /*#__PURE__*/cloneElement(icon2, {
49
- className: 'icon icon2'
50
- }))))) : /*#__PURE__*/React.createElement(React.Fragment, null);
51
- };
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { cloneElement } from "react";
3
+ import Icon, { ResizeArrowM } from "@synerise/ds-icon";
4
+ import Tooltip from "@synerise/ds-tooltip";
5
+ import { IconsWrapper, IconsFlexContainer, IconWrapper } from "../Input.styles.js";
6
+ const ElementIcons = ({
7
+ handleIconsClick,
8
+ disabled,
9
+ icon1Tooltip,
10
+ icon1,
11
+ icon2,
12
+ icon2Tooltip,
13
+ className,
14
+ type,
15
+ expandable,
16
+ overflown,
17
+ expandableTooltip,
18
+ handleExpandIconClick
19
+ }) => {
20
+ return icon1 || icon2 || expandable ? /* @__PURE__ */ jsx(IconsWrapper, { onClick: handleIconsClick, disabled, children: /* @__PURE__ */ jsxs(IconsFlexContainer, { type, children: [
21
+ expandable && /* @__PURE__ */ jsx(Tooltip, { title: expandableTooltip, children: /* @__PURE__ */ jsx(IconWrapper, { onClick: handleExpandIconClick, className, children: expandable && overflown && /* @__PURE__ */ jsx(Icon, { className: "icon icon3", component: /* @__PURE__ */ jsx(ResizeArrowM, { "data-testid": "ds-input-icon-expand" }) }) }) }),
22
+ /* @__PURE__ */ jsx(Tooltip, { title: icon1Tooltip, children: /* @__PURE__ */ jsx(IconWrapper, { className, children: icon1 && cloneElement(icon1, {
23
+ className: "icon icon1",
24
+ ...icon2 && {
25
+ style: {
26
+ marginRight: "4px"
27
+ }
28
+ }
29
+ }) }) }),
30
+ /* @__PURE__ */ jsx(Tooltip, { title: icon2Tooltip, children: /* @__PURE__ */ jsx(IconWrapper, { className, children: icon2 && cloneElement(icon2, {
31
+ className: "icon icon2"
32
+ }) }) })
33
+ ] }) }) : /* @__PURE__ */ jsx(Fragment, {});
34
+ };
35
+ export {
36
+ ElementIcons
37
+ };
@@ -1,6 +1,6 @@
1
- import type { TextAreaRef } from 'antd/lib/input/TextArea';
2
- import React, { type ChangeEvent, type FocusEvent, type ReactNode } from 'react';
3
- import { type InputProps } from '../Input.types';
1
+ import { TextAreaRef } from 'antd/lib/input/TextArea';
2
+ import { default as React, ChangeEvent, FocusEvent, ReactNode } from 'react';
3
+ import { InputProps } from '../Input.types';
4
4
  export declare const ExpandableWrapper: React.ForwardRefExoticComponent<Pick<InputProps, "value"> & {
5
5
  children: ReactNode;
6
6
  expanded: boolean;
@@ -1,23 +1,22 @@
1
- import React, { forwardRef } from 'react';
2
- import * as S from '../Input.styles';
3
- import Textarea from '../Textarea/Textarea';
4
- export var ExpandableWrapper = /*#__PURE__*/forwardRef(function (_ref, expandableTextAreaRef) {
5
- var children = _ref.children,
6
- value = _ref.value,
7
- expanded = _ref.expanded,
8
- onChange = _ref.onChange,
9
- onBlur = _ref.onBlur;
10
- return /*#__PURE__*/React.createElement(S.ExpandableWrapper, {
11
- expanded: expanded
12
- }, children, /*#__PURE__*/React.createElement(Textarea, {
13
- "data-testid": "inputExpandTextarea",
14
- onChange: onChange,
15
- autoSize: {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { ExpandableWrapper as ExpandableWrapper$1 } from "../Input.styles.js";
4
+ import { RawTextArea } from "../Textarea/Textarea.js";
5
+ const ExpandableWrapper = forwardRef(({
6
+ children,
7
+ value,
8
+ expanded,
9
+ onChange,
10
+ onBlur
11
+ }, expandableTextAreaRef) => {
12
+ return /* @__PURE__ */ jsxs(ExpandableWrapper$1, { expanded, children: [
13
+ children,
14
+ /* @__PURE__ */ jsx(RawTextArea, { "data-testid": "inputExpandTextarea", onChange, autoSize: {
16
15
  minRows: 2,
17
16
  maxRows: 6
18
- },
19
- onBlur: onBlur,
20
- ref: expandableTextAreaRef,
21
- value: value
22
- }));
23
- });
17
+ }, onBlur, ref: expandableTextAreaRef, value })
18
+ ] });
19
+ });
20
+ export {
21
+ ExpandableWrapper
22
+ };
@@ -1,3 +1,8 @@
1
- export { ElementIcons } from './ElementIcons';
2
- export { ExpandableWrapper } from './ExpandableWrapper';
3
- export { AutosizeWrapper } from './AutosizeWrapper';
1
+ import { ElementIcons } from "./ElementIcons.js";
2
+ import { ExpandableWrapper } from "./ExpandableWrapper.js";
3
+ import { AutosizeWrapper } from "./AutosizeWrapper.js";
4
+ export {
5
+ AutosizeWrapper,
6
+ ElementIcons,
7
+ ExpandableWrapper
8
+ };
@@ -1,2 +1,6 @@
1
- export { useElementFocus } from './useElementFocus';
2
- export { useInputAddonHeight } from './useInputAddonHeight';
1
+ import { useElementFocus } from "./useElementFocus.js";
2
+ import { useInputAddonHeight } from "./useInputAddonHeight.js";
3
+ export {
4
+ useElementFocus,
5
+ useInputAddonHeight
6
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type InputProps } from '../Input.types';
1
+ import { default as React } from 'react';
2
+ import { InputProps } from '../Input.types';
3
3
  type UseCounterLimitOptions = Pick<InputProps, 'counterLimit' | 'renderCustomCounter'> & {
4
4
  charCount?: number;
5
5
  };
@@ -1,17 +1,22 @@
1
- import React, { useMemo } from 'react';
2
- import * as S from '../Input.styles';
3
- export var useCounterLimit = function useCounterLimit(_ref) {
4
- var charCount = _ref.charCount,
5
- counterLimit = _ref.counterLimit,
6
- renderCustomCounter = _ref.renderCustomCounter;
7
- return useMemo(function () {
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { Counter } from "../Input.styles.js";
4
+ const useCounterLimit = ({
5
+ charCount,
6
+ counterLimit,
7
+ renderCustomCounter
8
+ }) => {
9
+ return useMemo(() => {
8
10
  if (renderCustomCounter) {
9
- return /*#__PURE__*/React.createElement(S.Counter, {
10
- "data-testid": "custom-counter"
11
- }, renderCustomCounter(charCount));
11
+ return /* @__PURE__ */ jsx(Counter, { "data-testid": "custom-counter", children: renderCustomCounter(charCount) });
12
12
  }
13
- return counterLimit ? /*#__PURE__*/React.createElement(S.Counter, {
14
- "data-testid": "counter"
15
- }, charCount, "/", counterLimit) : undefined;
13
+ return counterLimit ? /* @__PURE__ */ jsxs(Counter, { "data-testid": "counter", children: [
14
+ charCount,
15
+ "/",
16
+ counterLimit
17
+ ] }) : void 0;
16
18
  }, [charCount, counterLimit, renderCustomCounter]);
17
- };
19
+ };
20
+ export {
21
+ useCounterLimit
22
+ };
@@ -1,3 +1,3 @@
1
- import type { InputRef } from 'antd/lib/input';
2
- import { type MutableRefObject } from 'react';
1
+ import { InputRef } from 'antd/lib/input';
2
+ import { MutableRefObject } from 'react';
3
3
  export declare const useElementFocus: (ref: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | InputRef | null>) => () => void;
@@ -1,5 +1,8 @@
1
- export var useElementFocus = function useElementFocus(ref) {
2
- return function () {
1
+ const useElementFocus = (ref) => {
2
+ return () => {
3
3
  ref.current && ref.current.focus();
4
4
  };
5
- };
5
+ };
6
+ export {
7
+ useElementFocus
8
+ };
@@ -1,5 +1,5 @@
1
- import type { InputRef } from 'antd/lib/input';
2
- import { type MutableRefObject } from 'react';
1
+ import { InputRef } from 'antd/lib/input';
2
+ import { MutableRefObject } from 'react';
3
3
  export declare const useInputAddonHeight: (inputRef: MutableRefObject<InputRef | null>) => {
4
4
  inputAddonHeight: number;
5
5
  };
@@ -1,13 +1,13 @@
1
- import { useEffect, useState } from 'react';
2
- export var useInputAddonHeight = function useInputAddonHeight(inputRef) {
3
- var _useState = useState(0),
4
- inputAddonHeight = _useState[0],
5
- setInputAddonHeight = _useState[1];
6
- useEffect(function () {
7
- var _inputRef$current$inp, _inputRef$current$inp2;
8
- inputRef.current && ((_inputRef$current$inp = inputRef.current.input) == null ? void 0 : _inputRef$current$inp.offsetHeight) && setInputAddonHeight((_inputRef$current$inp2 = inputRef.current.input) == null ? void 0 : _inputRef$current$inp2.offsetHeight);
1
+ import { useState, useEffect } from "react";
2
+ const useInputAddonHeight = (inputRef) => {
3
+ const [inputAddonHeight, setInputAddonHeight] = useState(0);
4
+ useEffect(() => {
5
+ inputRef.current && inputRef.current.input?.offsetHeight && setInputAddonHeight(inputRef.current.input?.offsetHeight);
9
6
  }, [inputRef]);
10
7
  return {
11
- inputAddonHeight: inputAddonHeight
8
+ inputAddonHeight
12
9
  };
13
- };
10
+ };
11
+ export {
12
+ useInputAddonHeight
13
+ };
package/dist/index.js CHANGED
@@ -1,12 +1,24 @@
1
- /**
2
- * @deprecated - import { FormFieldLabel } from '@synerise/ds-form-field';
3
- */
4
- export { FormFieldLabel as Label } from '@synerise/ds-form-field';
5
- export { Input, RawInput, InputGroup, InputMultivalue } from './Input';
6
- export { TextArea, RawTextArea } from './TextArea';
7
- export { RawTextArea as DSRawTextArea } from './Textarea/Textarea';
8
- import * as _InputStyles from './Input.styles';
9
- export { _InputStyles as InputStyles };
10
- export { default as AutosizeInput } from './AutosizeInput/AutosizeInput';
11
- export { AutosizeWrapper } from './components/AutosizeWrapper';
12
- export { PasswordInput } from './PasswordInput';
1
+ import { FormFieldLabel } from "@synerise/ds-form-field";
2
+ import { Input, RawInput } from "./Input.js";
3
+ import { RawTextArea, TextArea } from "./TextArea.js";
4
+ import { RawTextArea as RawTextArea2 } from "./Textarea/Textarea.js";
5
+ import * as Input_styles from "./Input.styles.js";
6
+ import { default as default2 } from "./AutosizeInput/AutosizeInput.js";
7
+ import { AutosizeWrapper } from "./components/AutosizeWrapper.js";
8
+ import { PasswordInput } from "./PasswordInput.js";
9
+ import { default as default3 } from "./InputGroup.js";
10
+ import { default as default4 } from "./InputMultivalue/InputMultivalue.js";
11
+ export {
12
+ default2 as AutosizeInput,
13
+ AutosizeWrapper,
14
+ RawTextArea2 as DSRawTextArea,
15
+ Input,
16
+ default3 as InputGroup,
17
+ default4 as InputMultivalue,
18
+ Input_styles as InputStyles,
19
+ FormFieldLabel as Label,
20
+ PasswordInput,
21
+ RawInput,
22
+ RawTextArea,
23
+ TextArea
24
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
@@ -1,3 +1,3 @@
1
- import { type InputProps as AntdInputProps } from 'antd/lib/input';
2
- import { type TextareaProps } from '../TextArea.types';
1
+ import { InputProps as AntdInputProps } from 'antd/lib/input';
2
+ import { TextareaProps } from '../TextArea.types';
3
3
  export declare const getCharCount: (value?: AntdInputProps["value"] | TextareaProps["value"], limit?: number) => number;
@@ -1,6 +1,9 @@
1
- export var getCharCount = function getCharCount(value, limit) {
1
+ const getCharCount = (value, limit) => {
2
2
  if (limit && value && value.toString().length > limit) {
3
3
  return limit;
4
4
  }
5
5
  return value ? value.toString().length : 0;
6
- };
6
+ };
7
+ export {
8
+ getCharCount
9
+ };
@@ -1 +1,4 @@
1
- export { getCharCount } from './getCharCount';
1
+ import { getCharCount } from "./getCharCount.js";
2
+ export {
3
+ getCharCount
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-input",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "description": "Input UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -16,10 +16,10 @@
16
16
  "access": "public"
17
17
  },
18
18
  "scripts": {
19
- "build": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --watch",
22
+ "build:watch": "vite build --watch",
23
23
  "defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
24
24
  "pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
25
25
  "prepublish": "pnpm run build",
@@ -36,11 +36,11 @@
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
38
  "@floating-ui/react": "^0.27.16",
39
- "@synerise/ds-form-field": "^1.3.8",
40
- "@synerise/ds-icon": "^1.14.1",
41
- "@synerise/ds-scrollbar": "^1.2.15",
42
- "@synerise/ds-tooltip": "^1.4.8",
43
- "@synerise/ds-utils": "^1.6.0",
39
+ "@synerise/ds-form-field": "^1.3.10",
40
+ "@synerise/ds-icon": "^1.15.1",
41
+ "@synerise/ds-scrollbar": "^1.2.17",
42
+ "@synerise/ds-tooltip": "^1.4.10",
43
+ "@synerise/ds-utils": "^1.7.1",
44
44
  "classnames": "^2.3.2",
45
45
  "csstype": "^2.6.9",
46
46
  "uuid": "^8.3.2"
@@ -55,5 +55,5 @@
55
55
  "react-intl": ">= 3.12.0 <= 6.8",
56
56
  "styled-components": "^5.3.3"
57
57
  },
58
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
58
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
59
59
  }