@synerise/ds-input 1.6.9 → 1.6.11

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 (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/AutosizeInput/AutosizeInput.d.ts +2 -2
  3. package/dist/AutosizeInput/AutosizeInput.js +80 -95
  4. package/dist/AutosizeInput/AutosizeInput.types.d.ts +1 -1
  5. package/dist/AutosizeInput/AutosizeInput.types.js +1 -1
  6. package/dist/AutosizeInput/utils/calculateInputWidth.d.ts +1 -1
  7. package/dist/AutosizeInput/utils/calculateInputWidth.js +13 -11
  8. package/dist/AutosizeInput/utils/index.js +4 -1
  9. package/dist/Input.d.ts +5 -7
  10. package/dist/Input.js +117 -174
  11. package/dist/Input.styles.d.ts +22 -22
  12. package/dist/Input.styles.js +98 -122
  13. package/dist/Input.types.d.ts +5 -5
  14. package/dist/Input.types.js +1 -1
  15. package/dist/InputGroup.d.ts +2 -2
  16. package/dist/InputGroup.js +21 -38
  17. package/dist/InputGroup.styles.d.ts +2 -2
  18. package/dist/InputGroup.styles.js +8 -8
  19. package/dist/InputGroup.types.d.ts +2 -2
  20. package/dist/InputGroup.types.js +1 -1
  21. package/dist/InputMultivalue/Elements/Value.d.ts +2 -2
  22. package/dist/InputMultivalue/Elements/Value.js +22 -34
  23. package/dist/InputMultivalue/Elements/Value.types.d.ts +2 -2
  24. package/dist/InputMultivalue/Elements/Value.types.js +1 -1
  25. package/dist/InputMultivalue/InputMultivalue.d.ts +2 -2
  26. package/dist/InputMultivalue/InputMultivalue.js +52 -74
  27. package/dist/InputMultivalue/InputMultivalue.styles.d.ts +10 -10
  28. package/dist/InputMultivalue/InputMultivalue.styles.js +48 -67
  29. package/dist/InputMultivalue/InputMultivalue.types.d.ts +1 -1
  30. package/dist/InputMultivalue/InputMultivalue.types.js +1 -1
  31. package/dist/PasswordInput.d.ts +2 -2
  32. package/dist/PasswordInput.js +31 -45
  33. package/dist/PasswordInput.types.d.ts +2 -2
  34. package/dist/PasswordInput.types.js +1 -1
  35. package/dist/TextArea.d.ts +4 -6
  36. package/dist/TextArea.js +53 -75
  37. package/dist/TextArea.types.d.ts +2 -2
  38. package/dist/TextArea.types.js +1 -1
  39. package/dist/Textarea/Textarea.d.ts +4 -4
  40. package/dist/Textarea/Textarea.js +32 -51
  41. package/dist/Textarea/Textarea.styles.d.ts +2 -2
  42. package/dist/Textarea/Textarea.styles.js +10 -9
  43. package/dist/Textarea/Textarea.types.d.ts +3 -3
  44. package/dist/Textarea/Textarea.types.js +1 -1
  45. package/dist/assets/style/index-tn0RQdqM.css +0 -0
  46. package/dist/components/AutosizeWrapper.d.ts +2 -2
  47. package/dist/components/AutosizeWrapper.js +16 -18
  48. package/dist/components/ElementIcons.d.ts +2 -2
  49. package/dist/components/ElementIcons.js +37 -51
  50. package/dist/components/ExpandableWrapper.d.ts +3 -3
  51. package/dist/components/ExpandableWrapper.js +20 -21
  52. package/dist/components/index.js +8 -3
  53. package/dist/hooks/index.js +6 -2
  54. package/dist/hooks/useCounterLimit.d.ts +2 -2
  55. package/dist/hooks/useCounterLimit.js +19 -14
  56. package/dist/hooks/useElementFocus.d.ts +2 -2
  57. package/dist/hooks/useElementFocus.js +6 -3
  58. package/dist/hooks/useInputAddonHeight.d.ts +2 -2
  59. package/dist/hooks/useInputAddonHeight.js +10 -10
  60. package/dist/index.js +24 -12
  61. package/dist/modules.d.js +1 -1
  62. package/dist/modules.d.ts +0 -0
  63. package/dist/utils/getCharCount.d.ts +2 -2
  64. package/dist/utils/getCharCount.js +5 -2
  65. package/dist/utils/index.js +4 -1
  66. package/package.json +9 -9
@@ -1,174 +1,150 @@
1
- var _excluded = ["error"],
2
- _excluded2 = ["error"];
3
- 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); }
4
- 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; }
5
- import BaseAntInput from 'antd/lib/input';
6
- import TextArea from 'antd/lib/input/TextArea';
7
- import React, { forwardRef } from 'react';
8
- import styled, { css } from 'styled-components';
9
- import { TextareaWrapper } from './Textarea/Textarea.styles';
10
- var errorInputStyle = function errorInputStyle(props) {
11
- return "\n &&&, && .ant-input {\n border-color: " + props.theme.palette['red-600'] + ";\n box-shadow: inset 0 0 0 1px " + props.theme.palette['red-600'] + ";\n background: " + props.theme.palette['red-050'] + ";\n }\n";
12
- };
13
- var INPUT_PADDING = 12;
14
- var INPUT_BORDER = 1;
15
- var ICON_SIZE = 24;
16
- var getIconsWidth = function getIconsWidth(iconCount) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import BaseAntInput from "antd/lib/input";
3
+ import TextArea from "antd/lib/input/TextArea";
4
+ import { forwardRef } from "react";
5
+ import styled, { css } from "styled-components";
6
+ import { TextareaWrapper } from "./Textarea/Textarea.styles.js";
7
+ const errorInputStyle = (props) => `
8
+ &&&, && .ant-input {
9
+ border-color: ${props.theme.palette["red-600"]};
10
+ box-shadow: inset 0 0 0 1px ${props.theme.palette["red-600"]};
11
+ background: ${props.theme.palette["red-050"]};
12
+ }
13
+ `;
14
+ const INPUT_PADDING = 12;
15
+ const INPUT_BORDER = 1;
16
+ const ICON_SIZE = 24;
17
+ const getIconsWidth = (iconCount) => {
17
18
  return iconCount > 0 ? iconCount * ICON_SIZE + (iconCount - 1) * 4 : 0;
18
19
  };
19
- export function autoresizeConfObjToCss(_ref) {
20
- var autoResize = _ref.autoResize,
21
- iconCount = _ref.iconCount,
22
- _ref$boxSizing = _ref.boxSizing,
23
- boxSizing = _ref$boxSizing === void 0 ? 'content-box' : _ref$boxSizing;
24
- // autosized inputs have box-sizing set to content-box!
25
- var elementPadding = boxSizing === 'content-box' ? 2 * (INPUT_PADDING + INPUT_BORDER) : 0;
26
- var finalPadding = getIconsWidth(iconCount || 0) + elementPadding;
20
+ function autoresizeConfObjToCss({
21
+ autoResize,
22
+ iconCount,
23
+ boxSizing = "content-box"
24
+ }) {
25
+ const elementPadding = boxSizing === "content-box" ? 2 * (INPUT_PADDING + INPUT_BORDER) : 0;
26
+ const finalPadding = getIconsWidth(iconCount || 0) + elementPadding;
27
27
  if (!autoResize) {
28
- return '';
28
+ return "";
29
29
  }
30
- if (typeof autoResize === 'object') {
31
- return css(["", " min-width:calc(", " - ", "px);"], autoResize.maxWidth ? "max-width: calc(" + autoResize.maxWidth + " - " + finalPadding + "px);" : '', autoResize.minWidth, finalPadding);
30
+ if (typeof autoResize === "object") {
31
+ return css(["", " min-width:calc(", " - ", "px);"], autoResize.maxWidth ? `max-width: calc(${autoResize.maxWidth} - ${finalPadding}px);` : "", autoResize.minWidth, finalPadding);
32
32
  }
33
33
  return css(["max-width:calc(400px - ", "px);min-width:calc(150px - ", "px);"], finalPadding, finalPadding);
34
34
  }
35
- export var Wrapper = styled.div.withConfig({
35
+ const Wrapper = /* @__PURE__ */ styled.div.withConfig({
36
36
  displayName: "Inputstyles__Wrapper",
37
37
  componentId: "sc-dc57an-0"
38
38
  })(["margin-bottom:24px;"]);
39
- export var InputWrapper = styled.div.withConfig({
39
+ const InputWrapper = /* @__PURE__ */ styled.div.withConfig({
40
40
  displayName: "Inputstyles__InputWrapper",
41
41
  componentId: "sc-dc57an-1"
42
- })(["position:relative;&& .ant-input{padding-right:", ";&::placeholder{line-height:1.29;}}.ant-input-group-addon{height:100%;}"], function (props) {
43
- return getIconsWidth(props.iconCount || 0) + INPUT_PADDING + "px";
42
+ })(["position:relative;&& .ant-input{padding-right:", ";&::placeholder{line-height:1.29;}}.ant-input-group-addon{height:100%;}"], (props) => {
43
+ return `${getIconsWidth(props.iconCount || 0) + INPUT_PADDING}px`;
44
44
  });
45
- export var OuterWrapper = styled.div.withConfig({
45
+ const OuterWrapper = /* @__PURE__ */ styled.div.withConfig({
46
46
  displayName: "Inputstyles__OuterWrapper",
47
47
  componentId: "sc-dc57an-2"
48
- })(["margin:", ";&.active{&&{input{box-shadow:inset 0 0 0 1px ", ";border-color:", ";background-color:", ";}}}input{padding:7px ", "px;", "}", ""], function (props) {
49
- return props.resetMargin ? '0' : '0 0 16px 0';
50
- }, function (props) {
51
- return props.theme.palette['blue-600'];
52
- }, function (props) {
53
- return props.theme.palette['blue-600'];
54
- }, function (props) {
55
- return props.theme.palette['blue-050'];
56
- }, INPUT_PADDING, function (props) {
57
- return autoresizeConfObjToCss(props);
58
- }, function (props) {
59
- return props.autoResize && "\n " + InputWrapper + " {\n display: inline-block;\n }";
60
- });
61
- export var IconsWrapper = styled.div.withConfig({
48
+ })(["margin:", ";&.active{&&{input{box-shadow:inset 0 0 0 1px ", ";border-color:", ";background-color:", ";}}}input{padding:7px ", "px;", "}", ""], (props) => props.resetMargin ? "0" : "0 0 16px 0", (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-050"], INPUT_PADDING, (props) => autoresizeConfObjToCss(props), (props) => props.autoResize && `
49
+ ${InputWrapper} {
50
+ display: inline-block;
51
+ }`);
52
+ const IconsWrapper = /* @__PURE__ */ styled.div.withConfig({
62
53
  displayName: "Inputstyles__IconsWrapper",
63
54
  componentId: "sc-dc57an-3"
64
- })(["position:absolute;right:8px;top:0;z-index:2;height:100%;.icon{svg{transition:0.3s all;fill:", ";opacity:", ";}}"], function (props) {
65
- return props.theme.palette['grey-600'];
66
- }, function (props) {
67
- return props.disabled ? '0.4' : '';
68
- });
69
- export var IconsFlexContainer = styled.div.withConfig({
55
+ })(["position:absolute;right:8px;top:0;z-index:2;height:100%;.icon{svg{transition:0.3s all;fill:", ";opacity:", ";}}"], (props) => props.theme.palette["grey-600"], (props) => props.disabled ? "0.4" : "");
56
+ const IconsFlexContainer = /* @__PURE__ */ styled.div.withConfig({
70
57
  displayName: "Inputstyles__IconsFlexContainer",
71
58
  componentId: "sc-dc57an-4"
72
- })(["", ""], function (props) {
73
- if (props.type === 'input') {
59
+ })(["", ""], (props) => {
60
+ if (props.type === "input") {
74
61
  return css(["display:flex;align-items:center;height:100%;"]);
75
62
  }
76
63
  return css(["display:flex;align-items:flex-end;height:100%;padding-bottom:8px;"]);
77
64
  });
78
- export var IconWrapper = styled.div.withConfig({
65
+ const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
79
66
  displayName: "Inputstyles__IconWrapper",
80
67
  componentId: "sc-dc57an-5"
81
- })([".icon:hover{svg{fill:", ";cursor:pointer;}}"], function (props) {
82
- return props.theme.palette['blue-600'];
83
- });
84
- export var AntdInput = styled(/*#__PURE__*/forwardRef(function (_ref2, ref) {
85
- var error = _ref2.error,
86
- props = _objectWithoutPropertiesLoose(_ref2, _excluded);
87
- return /*#__PURE__*/React.createElement(BaseAntInput, _extends({
88
- autoComplete: "off"
89
- }, props, {
90
- ref: ref
91
- }));
92
- })).withConfig({
68
+ })([".icon:hover{svg{fill:", ";cursor:pointer;}}"], (props) => props.theme.palette["blue-600"]);
69
+ const AntdInput = /* @__PURE__ */ styled(forwardRef(({
70
+ error,
71
+ ...props
72
+ }, ref) => /* @__PURE__ */ jsx(BaseAntInput, { autoComplete: "off", ...props, ref }))).withConfig({
93
73
  displayName: "Inputstyles__AntdInput",
94
74
  componentId: "sc-dc57an-6"
95
- })(["", ";&&&{min-height:", "px;transition:all 0.3s,width 0ms,min-width 0ms,max-width 0ms;grid-area:1 / 1;color:", ";z-index:1;&::placeholder{color:", ";}&::-moz-placeholder{line-height:", ";}.ds-input-prefix{border-top-left-radius:3px;border-bottom-left-radius:3px;}.ds-input-suffix{border-top-right-radius:3px;border-bottom-right-radius:3px;}", "}"], function (props) {
96
- return props.error ? errorInputStyle(props) : '';
97
- }, function (props) {
98
- return props.autoResize ? '16' : '32';
99
- }, function (props) {
100
- return props.disabled ? props.theme.palette['grey-500'] : props.theme.palette['grey-700'];
101
- }, function (props) {
102
- return props.theme.palette['grey-500'];
103
- }, function (props) {
104
- return props.size === 'large' ? "2.49" : "1.29";
105
- }, function (_ref3) {
106
- var readOnly = _ref3.readOnly,
107
- theme = _ref3.theme;
108
- return readOnly ? "\n &:hover {\n border-color: " + theme.palette['grey-300'] + ";\n }\n &:focus {\n border-color: " + theme.palette['grey-300'] + ";\n box-shadow: none;\n background: #fff;\n }\n " : '';
109
- });
110
- export var AntdTextArea = styled(/*#__PURE__*/forwardRef(function (_ref4, ref) {
111
- var error = _ref4.error,
112
- props = _objectWithoutPropertiesLoose(_ref4, _excluded2);
113
- return /*#__PURE__*/React.createElement(TextArea, _extends({
114
- autoComplete: "off"
115
- }, props, {
116
- ref: ref
117
- }));
118
- })).withConfig({
75
+ })(["", ";&&&{min-height:", "px;transition:all 0.3s,width 0ms,min-width 0ms,max-width 0ms;grid-area:1 / 1;color:", ";z-index:1;&::placeholder{color:", ";}&::-moz-placeholder{line-height:", ";}.ds-input-prefix{border-top-left-radius:3px;border-bottom-left-radius:3px;}.ds-input-suffix{border-top-right-radius:3px;border-bottom-right-radius:3px;}", "}"], (props) => props.error ? errorInputStyle(props) : "", (props) => props.autoResize ? "16" : "32", (props) => props.disabled ? props.theme.palette["grey-500"] : props.theme.palette["grey-700"], (props) => props.theme.palette["grey-500"], (props) => props.size === "large" ? `2.49` : `1.29`, ({
76
+ readOnly,
77
+ theme
78
+ }) => readOnly ? `
79
+ &:hover {
80
+ border-color: ${theme.palette["grey-300"]};
81
+ }
82
+ &:focus {
83
+ border-color: ${theme.palette["grey-300"]};
84
+ box-shadow: none;
85
+ background: #fff;
86
+ }
87
+ ` : "");
88
+ const AntdTextArea = /* @__PURE__ */ styled(forwardRef(({
89
+ error,
90
+ ...props
91
+ }, ref) => /* @__PURE__ */ jsx(TextArea, { autoComplete: "off", ...props, ref }))).withConfig({
119
92
  displayName: "Inputstyles__AntdTextArea",
120
93
  componentId: "sc-dc57an-7"
121
- })(["", ";&&{color:", ";}"], function (props) {
122
- return props.error ? errorInputStyle(props) : '';
123
- }, function (props) {
124
- return props.theme.palette['grey-700'];
125
- });
126
- export var ExpandableWrapper = styled.div.withConfig({
94
+ })(["", ";&&{color:", ";}"], (props) => props.error ? errorInputStyle(props) : "", (props) => props.theme.palette["grey-700"]);
95
+ const ExpandableWrapper = /* @__PURE__ */ styled.div.withConfig({
127
96
  displayName: "Inputstyles__ExpandableWrapper",
128
97
  componentId: "sc-dc57an-8"
129
- })(["position:relative;overflow:visible;", "{position:absolute;top:0;left:0;right:0;z-index:999;resize:none;max-height:124px;min-height:65px;min-width:282px;", "}"], TextareaWrapper, function (props) {
98
+ })(["position:relative;overflow:visible;", "{position:absolute;top:0;left:0;right:0;z-index:999;resize:none;max-height:124px;min-height:65px;min-width:282px;", "}"], TextareaWrapper, (props) => {
130
99
  if (props.expanded) {
131
100
  return css(["pointer-events:initial;display:block;"]);
132
101
  }
133
102
  return css(["pointer-events:none;display:none;"]);
134
103
  });
135
- export var ContentBelow = styled.div.withConfig({
104
+ const ContentBelow = /* @__PURE__ */ styled.div.withConfig({
136
105
  displayName: "Inputstyles__ContentBelow",
137
106
  componentId: "sc-dc57an-9"
138
107
  })(["margin-top:8px;"]);
139
- export var ErrorText = styled.div.withConfig({
108
+ const ErrorText = /* @__PURE__ */ styled.div.withConfig({
140
109
  displayName: "Inputstyles__ErrorText",
141
110
  componentId: "sc-dc57an-10"
142
- })(["color:", ";margin-bottom:4px;"], function (props) {
143
- return props.theme.palette['red-600'];
144
- });
145
- export var Label = styled.label.withConfig({
111
+ })(["color:", ";margin-bottom:4px;"], (props) => props.theme.palette["red-600"]);
112
+ const Label = /* @__PURE__ */ styled.label.withConfig({
146
113
  displayName: "Inputstyles__Label",
147
114
  componentId: "sc-dc57an-11"
148
- })(["color:", ";font-weight:500;display:block;"], function (props) {
149
- return props.theme.palette['grey-800'];
150
- });
151
- export var Counter = styled.div.withConfig({
115
+ })(["color:", ";font-weight:500;display:block;"], (props) => props.theme.palette["grey-800"]);
116
+ const Counter = /* @__PURE__ */ styled.div.withConfig({
152
117
  displayName: "Inputstyles__Counter",
153
118
  componentId: "sc-dc57an-12"
154
- })(["font-weight:500;flex:1 0 auto;text-align:end;color:", ";"], function (props) {
155
- return props.theme.palette['grey-500'];
156
- });
157
- export var Description = styled.div.withConfig({
119
+ })(["font-weight:500;flex:1 0 auto;text-align:end;color:", ";"], (props) => props.theme.palette["grey-500"]);
120
+ const Description = /* @__PURE__ */ styled.div.withConfig({
158
121
  displayName: "Inputstyles__Description",
159
122
  componentId: "sc-dc57an-13"
160
- })(["color:", ";"], function (props) {
161
- return props.theme.palette['grey-600'];
162
- });
163
- export var ContentAbove = styled.div.withConfig({
123
+ })(["color:", ";"], (props) => props.theme.palette["grey-600"]);
124
+ const ContentAbove = /* @__PURE__ */ styled.div.withConfig({
164
125
  displayName: "Inputstyles__ContentAbove",
165
126
  componentId: "sc-dc57an-14"
166
127
  })(["display:flex;justify-content:space-between;margin-bottom:8px;min-height:18px;"]);
167
- export var AddonWrapper = styled.div.withConfig({
128
+ const AddonWrapper = /* @__PURE__ */ styled.div.withConfig({
168
129
  displayName: "Inputstyles__AddonWrapper",
169
130
  componentId: "sc-dc57an-15"
170
- })(["background:", ";display:flex;align-items:center;height:", ";"], function (props) {
171
- return props.theme.palette['grey-050'];
172
- }, function (props) {
173
- return props.height ? props.height + "px" : '30px';
174
- });
131
+ })(["background:", ";display:flex;align-items:center;height:", ";"], (props) => props.theme.palette["grey-050"], (props) => props.height ? `${props.height}px` : "30px");
132
+ export {
133
+ AddonWrapper,
134
+ AntdInput,
135
+ AntdTextArea,
136
+ ContentAbove,
137
+ ContentBelow,
138
+ Counter,
139
+ Description,
140
+ ErrorText,
141
+ ExpandableWrapper,
142
+ IconWrapper,
143
+ IconsFlexContainer,
144
+ IconsWrapper,
145
+ InputWrapper,
146
+ Label,
147
+ OuterWrapper,
148
+ Wrapper,
149
+ autoresizeConfObjToCss
150
+ };
@@ -1,8 +1,8 @@
1
- import type { InputProps as AntdInputProps, TextAreaProps as AntdTextAreaProps } from 'antd/lib/input';
2
- import type { ForwardRefExoticComponent, MutableRefObject, ReactElement, ReactNode, RefAttributes } from 'react';
3
- import { type StyledComponent } from 'styled-components';
4
- import type { FormFieldCommonProps } from '@synerise/ds-form-field';
5
- import type { AutosizeInputProps } from './AutosizeInput/AutosizeInput.types';
1
+ import { InputProps as AntdInputProps, TextAreaProps as AntdTextAreaProps } from 'antd/lib/input';
2
+ import { ForwardRefExoticComponent, MutableRefObject, ReactElement, ReactNode, RefAttributes } from 'react';
3
+ import { StyledComponent } from 'styled-components';
4
+ import { FormFieldCommonProps } from '@synerise/ds-form-field';
5
+ import { AutosizeInputProps } from './AutosizeInput/AutosizeInput.types';
6
6
  export type AutoResizeProp = boolean | {
7
7
  minWidth: string;
8
8
  maxWidth?: string;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type Props } from './InputGroup.types';
1
+ import { default as React } from 'react';
2
+ import { Props } from './InputGroup.types';
3
3
  declare const InputGroup: ({ children, label, errors, description, resetMargin, tooltip, tooltipConfig, ...antdInputGroupProps }: Props) => React.JSX.Element;
4
4
  export default InputGroup;
@@ -1,39 +1,22 @@
1
- var _excluded = ["children", "label", "errors", "description", "resetMargin", "tooltip", "tooltipConfig"];
2
- 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; }
3
- import Input from 'antd/lib/input';
4
- import React, { Children } from 'react';
5
- import FormField from '@synerise/ds-form-field';
6
- import * as InputStyles from './Input.styles';
7
- import * as S from './InputGroup.styles';
8
- var InputGroup = function InputGroup(_ref) {
9
- var children = _ref.children,
10
- label = _ref.label,
11
- errors = _ref.errors,
12
- description = _ref.description,
13
- resetMargin = _ref.resetMargin,
14
- tooltip = _ref.tooltip,
15
- tooltipConfig = _ref.tooltipConfig,
16
- antdInputGroupProps = _objectWithoutPropertiesLoose(_ref, _excluded);
17
- var childrenArray = Children.toArray(children);
18
- return /*#__PURE__*/React.createElement(InputStyles.OuterWrapper, {
19
- className: "ds-input-group-outer-wrapper",
20
- resetMargin: resetMargin
21
- }, /*#__PURE__*/React.createElement(FormField, {
22
- label: label,
23
- tooltip: tooltip,
24
- tooltipConfig: tooltipConfig,
25
- description: description,
26
- errorText: errors && errors.map(function (error) {
27
- return /*#__PURE__*/React.createElement(InputStyles.ErrorText, {
28
- key: error
29
- }, error);
30
- })
31
- }, /*#__PURE__*/React.createElement(Input.Group, antdInputGroupProps, /*#__PURE__*/React.createElement(S.InputGroupWrapper, {
32
- compact: antdInputGroupProps.compact
33
- }, Children.map(childrenArray, function (child, index) {
34
- return /*#__PURE__*/React.createElement(S.InputGroupItem, {
35
- className: "ds-input-group-item ds-input-group-item-" + index
36
- }, child);
37
- })))));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import BaseAntInput from "antd/lib/input";
3
+ import { Children } from "react";
4
+ import FormField from "@synerise/ds-form-field";
5
+ import { OuterWrapper, ErrorText } from "./Input.styles.js";
6
+ import { InputGroupWrapper, InputGroupItem } from "./InputGroup.styles.js";
7
+ const InputGroup = ({
8
+ children,
9
+ label,
10
+ errors,
11
+ description,
12
+ resetMargin,
13
+ tooltip,
14
+ tooltipConfig,
15
+ ...antdInputGroupProps
16
+ }) => {
17
+ const childrenArray = Children.toArray(children);
18
+ return /* @__PURE__ */ jsx(OuterWrapper, { className: "ds-input-group-outer-wrapper", resetMargin, children: /* @__PURE__ */ jsx(FormField, { label, tooltip, tooltipConfig, description, errorText: errors && errors.map((error) => /* @__PURE__ */ jsx(ErrorText, { children: error }, error)), children: /* @__PURE__ */ jsx(BaseAntInput.Group, { ...antdInputGroupProps, children: /* @__PURE__ */ jsx(InputGroupWrapper, { compact: antdInputGroupProps.compact, children: Children.map(childrenArray, (child, index) => /* @__PURE__ */ jsx(InputGroupItem, { className: `ds-input-group-item ds-input-group-item-${index}`, children: child })) }) }) }) });
19
+ };
20
+ export {
21
+ InputGroup as default
38
22
  };
39
- export default InputGroup;
@@ -1,4 +1,4 @@
1
- export declare const InputGroupItem: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const InputGroupWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const InputGroupItem: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const InputGroupWrapper: import('styled-components').StyledComponent<"div", any, {
3
3
  compact?: boolean;
4
4
  }, never>;
@@ -1,13 +1,13 @@
1
- import styled, { css } from 'styled-components';
2
- export var InputGroupItem = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ const InputGroupItem = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "InputGroupstyles__InputGroupItem",
4
4
  componentId: "sc-1cn2cc5-0"
5
5
  })([""]);
6
- export var InputGroupWrapper = styled.div.withConfig({
6
+ const InputGroupWrapper = /* @__PURE__ */ styled.div.withConfig({
7
7
  displayName: "InputGroupstyles__InputGroupWrapper",
8
8
  componentId: "sc-1cn2cc5-1"
9
- })(["&&&{", "{.ds-select-container{margin-bottom:0;}}.ant-input.ant-input{float:none;}display:flex;min-width:0;", ";", "}"], InputGroupItem, function (props) {
10
- return props.compact ? '' : 'align-items: stretch';
11
- }, function (props) {
12
- return props.compact ? css(["", "{&:only-child{flex-grow:1;}&:not(:only-child){&:not(:last-child){margin-right:-1px;.ant-input,.ant-input-number,.ant-select-selector{border-top-right-radius:0px;border-bottom-right-radius:0px;}}&:last-child{.ant-input,.ant-input-number,.ant-select-selector{border-top-left-radius:0px;border-bottom-left-radius:0px;}flex:auto;}}"], InputGroupItem) : css(["", ":last-child{flex-grow:1;}", ":not(:last-child){margin-right:12px;}"], InputGroupItem, InputGroupItem);
13
- });
9
+ })(["&&&{", "{.ds-select-container{margin-bottom:0;}}.ant-input.ant-input{float:none;}display:flex;min-width:0;", ";", "}"], InputGroupItem, (props) => props.compact ? "" : "align-items: stretch", (props) => props.compact ? css(["", "{&:only-child{flex-grow:1;}&:not(:only-child){&:not(:last-child){margin-right:-1px;.ant-input,.ant-input-number,.ant-select-selector{border-top-right-radius:0px;border-bottom-right-radius:0px;}}&:last-child{.ant-input,.ant-input-number,.ant-select-selector{border-top-left-radius:0px;border-bottom-left-radius:0px;}flex:auto;}}"], InputGroupItem) : css(["", ":last-child{flex-grow:1;}", ":not(:last-child){margin-right:12px;}"], InputGroupItem, InputGroupItem));
10
+ export {
11
+ InputGroupItem,
12
+ InputGroupWrapper
13
+ };
@@ -1,5 +1,5 @@
1
- import type { GroupProps } from 'antd/es/input';
2
- import { type FormFieldCommonProps } from '@synerise/ds-form-field';
1
+ import { GroupProps } from 'antd/es/input';
2
+ import { FormFieldCommonProps } from '@synerise/ds-form-field';
3
3
  export type Props = GroupProps & {
4
4
  errors?: string[];
5
5
  resetMargin?: boolean;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import type { ValueProps } from './Value.types';
1
+ import { default as React } from 'react';
2
+ import { ValueProps } from './Value.types';
3
3
  declare const Value: ({ disabled, key, onRemoveClick, value, focused, className, ...rest }: ValueProps) => React.JSX.Element;
4
4
  export default Value;
@@ -1,35 +1,23 @@
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; }
4
- import classnames from 'classnames';
5
- import React from 'react';
6
- import Icon, { CloseS } from '@synerise/ds-icon';
7
- import Tooltip from '@synerise/ds-tooltip';
8
- import * as S from '../InputMultivalue.styles';
9
- var Value = function Value(_ref) {
10
- var disabled = _ref.disabled,
11
- key = _ref.key,
12
- onRemoveClick = _ref.onRemoveClick,
13
- value = _ref.value,
14
- focused = _ref.focused,
15
- className = _ref.className,
16
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
17
- var mergedClassName = classnames('ds-input-value-wrapper', className);
18
- return /*#__PURE__*/React.createElement(Tooltip, {
19
- offset: "small",
20
- title: value
21
- }, /*#__PURE__*/React.createElement(S.ValueWrapper, _extends({
22
- "data-testid": "ds-input-value-wrapper",
23
- className: mergedClassName,
24
- disabled: disabled,
25
- key: key
26
- }, rest), /*#__PURE__*/React.createElement(S.ValueText, {
27
- disabled: disabled
28
- }, value), /*#__PURE__*/React.createElement(S.IconWrapper, {
29
- onClick: onRemoveClick
30
- }, /*#__PURE__*/React.createElement(Icon, {
31
- className: "remove",
32
- component: /*#__PURE__*/React.createElement(CloseS, null)
33
- }))));
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import Icon, { CloseS } from "@synerise/ds-icon";
4
+ import Tooltip from "@synerise/ds-tooltip";
5
+ import { ValueWrapper, ValueText, IconWrapper } from "../InputMultivalue.styles.js";
6
+ const Value = ({
7
+ disabled,
8
+ key,
9
+ onRemoveClick,
10
+ value,
11
+ focused,
12
+ className,
13
+ ...rest
14
+ }) => {
15
+ const mergedClassName = classnames("ds-input-value-wrapper", className);
16
+ return /* @__PURE__ */ jsx(Tooltip, { offset: "small", title: value, children: /* @__PURE__ */ jsxs(ValueWrapper, { "data-testid": "ds-input-value-wrapper", className: mergedClassName, disabled, ...rest, children: [
17
+ /* @__PURE__ */ jsx(ValueText, { disabled, children: value }),
18
+ /* @__PURE__ */ jsx(IconWrapper, { onClick: onRemoveClick, children: /* @__PURE__ */ jsx(Icon, { className: "remove", component: /* @__PURE__ */ jsx(CloseS, {}) }) })
19
+ ] }, key) });
20
+ };
21
+ export {
22
+ Value as default
34
23
  };
35
- export default Value;
@@ -1,5 +1,5 @@
1
- import type React from 'react';
2
- import { type WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { default as React } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
3
  export type ValueProps = WithHTMLAttributes<HTMLDivElement, {
4
4
  disabled?: boolean;
5
5
  key?: string;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type InputMultivalueProps } from './InputMultivalue.types';
1
+ import { default as React } from 'react';
2
+ import { InputMultivalueProps } from './InputMultivalue.types';
3
3
  declare const InputMultivalue: (props: InputMultivalueProps) => React.JSX.Element;
4
4
  export default InputMultivalue;