@synerise/ds-input 1.2.1 → 1.3.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.3.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.3.0...@synerise/ds-input@1.3.1) (2025-06-26)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-input
9
+
10
+
11
+
12
+
13
+
14
+ # [1.3.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.2.1...@synerise/ds-input@1.3.0) (2025-06-24)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **input:** textarea props - omit unused ([f34c307](https://github.com/synerise/synerise-design/commit/f34c307c3e5fcad48dd6174473d57e3d7fbb64fb))
20
+
21
+
22
+ ### Features
23
+
24
+ * **factors:** array factor type ([195d328](https://github.com/synerise/synerise-design/commit/195d3286e98b5f07fc9c1e56001e6ae844b7a080))
25
+
26
+
27
+
28
+
29
+
6
30
  ## [1.2.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.2.0...@synerise/ds-input@1.2.1) (2025-06-12)
7
31
 
8
32
 
@@ -7,6 +7,9 @@ export type AutoResizeProp = boolean | {
7
7
  maxWidth?: string;
8
8
  stretchToFit?: boolean;
9
9
  };
10
+ /**
11
+ * @deprecated use `InputProps`, `TextareaProps` instead
12
+ */
10
13
  export type Props = BaseProps<HTMLInputElement | HTMLTextAreaElement>;
11
14
  export type BaseProps<RefElementType extends HTMLTextAreaElement | HTMLInputElement = HTMLInputElement> = {
12
15
  error?: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { Props } from './Value.types';
3
- declare const Value: ({ disabled, key, onRemoveClick, value, focused }: Props) => React.JSX.Element;
2
+ import type { ValueProps } from './Value.types';
3
+ declare const Value: ({ disabled, key, onRemoveClick, value, focused, className, ...rest }: ValueProps) => React.JSX.Element;
4
4
  export default Value;
@@ -1,4 +1,8 @@
1
+ var _excluded = ["disabled", "key", "onRemoveClick", "value", "focused", "className"];
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; }
1
4
  import React, { useState } from 'react';
5
+ import classnames from 'classnames';
2
6
  import Icon, { CloseS } from '@synerise/ds-icon';
3
7
  import Tooltip from '@synerise/ds-tooltip';
4
8
  import * as S from '../InputMultivalue.styles';
@@ -7,16 +11,19 @@ var Value = function Value(_ref) {
7
11
  key = _ref.key,
8
12
  onRemoveClick = _ref.onRemoveClick,
9
13
  value = _ref.value,
10
- focused = _ref.focused;
14
+ focused = _ref.focused,
15
+ className = _ref.className,
16
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
11
17
  var _useState = useState(false),
12
18
  hovered = _useState[0],
13
19
  setHovered = _useState[1];
20
+ var mergedClassName = classnames('ds-input-value-wrapper', className);
14
21
  return (
15
22
  /*#__PURE__*/
16
23
  // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
17
- React.createElement(S.ValueWrapper, {
24
+ React.createElement(S.ValueWrapper, _extends({
18
25
  "data-testid": "ds-input-value-wrapper",
19
- className: "ds-input-value-wrapper",
26
+ className: mergedClassName,
20
27
  onMouseOver: function onMouseOver() {
21
28
  focused && setHovered(true);
22
29
  },
@@ -26,7 +33,7 @@ var Value = function Value(_ref) {
26
33
  disabled: disabled,
27
34
  key: key,
28
35
  shrink: hovered
29
- }, /*#__PURE__*/React.createElement(Tooltip, {
36
+ }, rest), /*#__PURE__*/React.createElement(Tooltip, {
30
37
  align: {
31
38
  offset: [8, 0]
32
39
  },
@@ -1,8 +1,9 @@
1
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
1
2
  import React from 'react';
2
- export interface Props {
3
+ export type ValueProps = WithHTMLAttributes<HTMLDivElement, {
3
4
  disabled?: boolean;
4
5
  key?: string;
5
6
  onRemoveClick: () => void;
6
7
  value: React.ReactText;
7
8
  focused?: boolean;
8
- }
9
+ }>;
@@ -43,7 +43,7 @@ export var ContentAbove = styled.div.withConfig({
43
43
  export var IconWrapper = styled.div.withConfig({
44
44
  displayName: "InputMultivaluestyles__IconWrapper",
45
45
  componentId: "sc-1vmqtuf-5"
46
- })(["overflow:hidden;width:24px;margin-left:-16px;display:none;.remove{svg{fill:", ";}}"], function (props) {
46
+ })(["overflow:hidden;width:24px;margin-left:-16px;display:none;color:", ";"], function (props) {
47
47
  return props.theme.palette['red-600'];
48
48
  });
49
49
  export var ValueText = styled.div.withConfig({
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
3
  import './style/index.less';
4
4
  import { TextareaProps } from './TextArea.types';
5
- export declare const TextArea: ({ className, errorText, label, description, counterLimit, tooltip, tooltipConfig, icon1, icon1Tooltip, autoResize, icon2, icon2Tooltip, resetMargin, handleInputRef, prefixel, suffixel, error, renderCustomCounter, ...antdTextareaProps }: TextareaProps) => React.JSX.Element;
5
+ export declare const TextArea: ({ className, errorText, label, description, counterLimit, tooltip, tooltipConfig, icon1, icon1Tooltip, icon2, icon2Tooltip, resetMargin, handleInputRef, prefixel, suffixel, error, renderCustomCounter, ...antdTextareaProps }: TextareaProps) => React.JSX.Element;
6
6
  export declare const RawTextArea: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("antd/lib/input").TextAreaProps & {
7
7
  error?: boolean | undefined;
8
8
  } & React.RefAttributes<import("antd/lib/input/TextArea").TextAreaRef>>, any, {
package/dist/TextArea.js CHANGED
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "errorText", "label", "description", "counterLimit", "tooltip", "tooltipConfig", "icon1", "icon1Tooltip", "autoResize", "icon2", "icon2Tooltip", "resetMargin", "handleInputRef", "prefixel", "suffixel", "error", "renderCustomCounter"];
1
+ var _excluded = ["className", "errorText", "label", "description", "counterLimit", "tooltip", "tooltipConfig", "icon1", "icon1Tooltip", "icon2", "icon2Tooltip", "resetMargin", "handleInputRef", "prefixel", "suffixel", "error", "renderCustomCounter"];
2
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
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
4
  import React, { useEffect, useRef, useCallback, useMemo } from 'react';
@@ -8,7 +8,7 @@ import '@synerise/ds-core/dist/js/style';
8
8
  import "./style/index.css";
9
9
  import * as S from './Input.styles';
10
10
  import { ElementIcons } from './components';
11
- import Textarea from './Textarea/Textarea';
11
+ import DSTextArea from './Textarea/Textarea';
12
12
  import { useElementFocus } from './hooks';
13
13
  import { getCharCount } from './utils';
14
14
  import { useCounterLimit } from './hooks/useCounterLimit';
@@ -22,7 +22,6 @@ export var TextArea = function TextArea(_ref) {
22
22
  tooltipConfig = _ref.tooltipConfig,
23
23
  icon1 = _ref.icon1,
24
24
  icon1Tooltip = _ref.icon1Tooltip,
25
- autoResize = _ref.autoResize,
26
25
  icon2 = _ref.icon2,
27
26
  icon2Tooltip = _ref.icon2Tooltip,
28
27
  resetMargin = _ref.resetMargin,
@@ -55,7 +54,6 @@ export var TextArea = function TextArea(_ref) {
55
54
  charCount: charCount
56
55
  });
57
56
  return /*#__PURE__*/React.createElement(S.OuterWrapper, {
58
- autoResize: autoResize,
59
57
  className: className,
60
58
  resetMargin: resetMargin
61
59
  }, /*#__PURE__*/React.createElement(FormField, {
@@ -75,7 +73,7 @@ export var TextArea = function TextArea(_ref) {
75
73
  icon2Tooltip: icon2Tooltip,
76
74
  className: className,
77
75
  type: "textArea"
78
- }), /*#__PURE__*/React.createElement(Textarea, _extends({}, antdTextareaProps, {
76
+ }), /*#__PURE__*/React.createElement(DSTextArea, _extends({}, antdTextareaProps, {
79
77
  className: hasErrorMessage || error ? 'error' : undefined,
80
78
  error: hasErrorMessage || error,
81
79
  onChange: handleChange,
@@ -1,3 +1,3 @@
1
1
  import type { BaseProps } from './Input.types';
2
- import type { TextAreaProps } from './Textarea/Textarea.types';
3
- export type TextareaProps = BaseProps<HTMLTextAreaElement> & TextAreaProps;
2
+ import type { RawTextAreaProps } from './Textarea/Textarea.types';
3
+ export type TextareaProps = RawTextAreaProps & Omit<BaseProps<HTMLTextAreaElement>, 'expandable' | 'expandableTooltip' | 'autoResize' | 'autoResizeProps'>;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { TextAreaRef } from 'antd/lib/input/TextArea';
3
- declare const Textarea: React.ForwardRefExoticComponent<import("antd/lib/input/TextArea").TextAreaProps & {
3
+ export declare const RawTextArea: React.ForwardRefExoticComponent<import("antd/lib/input/TextArea").TextAreaProps & {
4
4
  error?: boolean | undefined;
5
5
  errorText?: React.ReactNode;
6
6
  wrapperStyle?: React.CSSProperties | undefined;
7
7
  resize?: import("csstype").ResizeProperty | undefined;
8
8
  } & React.RefAttributes<TextAreaRef>>;
9
- export default Textarea;
9
+ export default RawTextArea;
@@ -5,7 +5,7 @@ import React, { forwardRef, useState } from 'react';
5
5
  import Scrollbar from '@synerise/ds-scrollbar';
6
6
  import * as S from './Textarea.styles';
7
7
  import * as InputStyles from '../Input.styles';
8
- var Textarea = /*#__PURE__*/forwardRef(function (_ref, ref) {
8
+ export var RawTextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
9
9
  var disabled = _ref.disabled,
10
10
  error = _ref.error,
11
11
  _ref$rows = _ref.rows,
@@ -49,4 +49,4 @@ var Textarea = /*#__PURE__*/forwardRef(function (_ref, ref) {
49
49
  }
50
50
  }))));
51
51
  });
52
- export default Textarea;
52
+ export default RawTextArea;
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import { TextAreaProps as AntdTextAreaProps } from 'antd/lib/input';
3
3
  import { ResizeProperty } from 'csstype';
4
- export type TextAreaProps = AntdTextAreaProps & {
4
+ /**
5
+ * @deprecated Use RawTextAreaProps instead.
6
+ */
7
+ export type TextAreaProps = RawTextAreaProps;
8
+ export type RawTextAreaProps = AntdTextAreaProps & {
5
9
  error?: boolean;
6
10
  errorText?: string | React.ReactNode;
7
11
  wrapperStyle?: React.CSSProperties;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  export { FormFieldLabel as Label } from '@synerise/ds-form-field';
5
5
  export { Input, RawInput, InputGroup, InputMultivalue } from './Input';
6
6
  export { TextArea, RawTextArea } from './TextArea';
7
+ export { RawTextArea as DSRawTextArea } from './Textarea/Textarea';
7
8
  export type { TextareaProps } from './TextArea.types';
8
9
  export type { InputMultivalueProps } from './InputMultivalue/InputMultivalue.types';
9
10
  export * as InputStyles from './Input.styles';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
  export { FormFieldLabel as Label } from '@synerise/ds-form-field';
5
5
  export { Input, RawInput, InputGroup, InputMultivalue } from './Input';
6
6
  export { TextArea, RawTextArea } from './TextArea';
7
+ export { RawTextArea as DSRawTextArea } from './Textarea/Textarea';
7
8
  import * as _InputStyles from './Input.styles';
8
9
  export { _InputStyles as InputStyles };
9
10
  export { default as AutosizeInput } from './AutosizeInput/AutosizeInput';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-input",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Input UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,12 +34,13 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-form-field": "^1.1.5",
38
- "@synerise/ds-icon": "^1.5.2",
39
- "@synerise/ds-scrollbar": "^1.0.10",
40
- "@synerise/ds-tooltip": "^1.1.9",
41
- "@synerise/ds-utils": "^1.2.0",
42
- "csstype": "2.6.9",
37
+ "@synerise/ds-form-field": "^1.1.7",
38
+ "@synerise/ds-icon": "^1.5.3",
39
+ "@synerise/ds-scrollbar": "^1.1.1",
40
+ "@synerise/ds-tooltip": "^1.1.11",
41
+ "@synerise/ds-utils": "^1.3.0",
42
+ "classnames": "^2.3.2",
43
+ "csstype": "^2.6.9",
43
44
  "uuid": "^8.3.2"
44
45
  },
45
46
  "peerDependencies": {
@@ -48,5 +49,5 @@
48
49
  "react": ">=16.9.0 <= 18.3.1",
49
50
  "styled-components": "^5.3.3"
50
51
  },
51
- "gitHead": "275b6d6fdd81f5576a95e516ac12c810da8c1519"
52
+ "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
52
53
  }