@synerise/ds-input 0.18.23 → 0.18.24
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 +15 -0
- package/dist/Input.d.ts +15 -0
- package/dist/Input.js +6 -5
- package/dist/Input.styles.d.ts +10 -0
- package/dist/Input.styles.js +52 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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
|
+
## [0.18.24](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.23...@synerise/ds-input@0.18.24) (2022-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **input:** add draft of test ([e15bcf3](https://github.com/synerise/synerise-design/commit/e15bcf339837e76f15450056cf361463a3e833f3))
|
|
12
|
+
* **input:** add new component input autoresize ([c330c02](https://github.com/synerise/synerise-design/commit/c330c02f67f61352304497e5b0e84b3f95c3e6ee))
|
|
13
|
+
* **input:** fix style of animation in input ([0b5dd2a](https://github.com/synerise/synerise-design/commit/0b5dd2ad40189ae1f9ef540cc6534925747e050b))
|
|
14
|
+
* **input:** fix style of text in input ([28bc966](https://github.com/synerise/synerise-design/commit/28bc966a5c62200bbc4ccdfc6dfdbaecf40a6107))
|
|
15
|
+
* **input:** fixes styles ([8b19c28](https://github.com/synerise/synerise-design/commit/8b19c28b8031f9dda6d6392446ca4d167c576868))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [0.18.23](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.22...@synerise/ds-input@0.18.23) (2022-09-28)
|
|
7
22
|
|
|
8
23
|
|
package/dist/Input.d.ts
CHANGED
|
@@ -49,6 +49,21 @@ export declare const MaskedInput: (React.ComponentClass<(object & Props & InputP
|
|
|
49
49
|
}) | (object & Props & TextAreaProps)> & {
|
|
50
50
|
displayName: string;
|
|
51
51
|
});
|
|
52
|
+
export declare const AutoResizeInput: (React.ComponentClass<(object & Props & InputProps) | (object & Props & InputProps & {
|
|
53
|
+
mask: string;
|
|
54
|
+
formatCharacters?: object | undefined;
|
|
55
|
+
placeholderChar?: string | undefined;
|
|
56
|
+
value?: string | undefined;
|
|
57
|
+
}) | (object & Props & TextAreaProps), any> & {
|
|
58
|
+
displayName: string;
|
|
59
|
+
}) | (React.FunctionComponent<(object & Props & InputProps) | (object & Props & InputProps & {
|
|
60
|
+
mask: string;
|
|
61
|
+
formatCharacters?: object | undefined;
|
|
62
|
+
placeholderChar?: string | undefined;
|
|
63
|
+
value?: string | undefined;
|
|
64
|
+
}) | (object & Props & TextAreaProps)> & {
|
|
65
|
+
displayName: string;
|
|
66
|
+
});
|
|
52
67
|
export declare const RawMaskedInput: StyledComponent<React.ForwardRefExoticComponent<{
|
|
53
68
|
error?: boolean | undefined;
|
|
54
69
|
mask: string;
|
package/dist/Input.js
CHANGED
|
@@ -113,11 +113,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
113
113
|
className: className
|
|
114
114
|
}, icon2 && React.cloneElement(icon2, {
|
|
115
115
|
className: 'icon icon2'
|
|
116
|
-
}))))), /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, antdInputProps, autoResize
|
|
117
|
-
style: {
|
|
118
|
-
width: (antdInputProps.value && antdInputProps.value.toString().length + 1) + "3px"
|
|
119
|
-
}
|
|
120
|
-
} : {}, {
|
|
116
|
+
}))))), /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, antdInputProps, autoResize, {
|
|
121
117
|
className: hasErrorMessage || error ? 'error' : undefined,
|
|
122
118
|
addonBefore: !!prefixel && /*#__PURE__*/React.createElement(S.AddonWrapper, {
|
|
123
119
|
className: "ds-input-prefix",
|
|
@@ -152,6 +148,11 @@ export var MaskedInput = Object.assign(enhancedInput(S.AntdMaskedInput, {
|
|
|
152
148
|
}), {
|
|
153
149
|
displayName: 'MaskedInput'
|
|
154
150
|
});
|
|
151
|
+
export var AutoResizeInput = Object.assign(enhancedInput(S.AutoResizeInput, {
|
|
152
|
+
type: 'input'
|
|
153
|
+
}), {
|
|
154
|
+
displayName: 'AutoResizeInput'
|
|
155
|
+
});
|
|
155
156
|
export var RawMaskedInput = S.AntdMaskedInput;
|
|
156
157
|
export { default as InputGroup } from './InputGroup';
|
|
157
158
|
export var RawInput = function RawInput(props) {
|
package/dist/Input.styles.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import TextArea from 'antd/lib/input/TextArea';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import MaskedInput from 'antd-mask-input';
|
|
5
5
|
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
6
|
+
import AutosizeInput from 'react-input-autosize';
|
|
6
7
|
export declare type AutoResizeProps = {
|
|
7
8
|
autoResize?: boolean | {
|
|
8
9
|
minWidth: string;
|
|
@@ -46,6 +47,15 @@ export declare const AntdTextArea: import("styled-components").StyledComponent<R
|
|
|
46
47
|
} & React.RefAttributes<TextArea>>, any, {
|
|
47
48
|
error?: boolean | undefined;
|
|
48
49
|
}, never>;
|
|
50
|
+
export declare const AutoResizeInput: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<{
|
|
51
|
+
error?: boolean | undefined;
|
|
52
|
+
} & React.RefAttributes<AutosizeInput>>, any, {
|
|
53
|
+
error?: boolean | undefined;
|
|
54
|
+
autoResize?: boolean | {
|
|
55
|
+
minWidth: string;
|
|
56
|
+
maxWidth: string;
|
|
57
|
+
} | undefined;
|
|
58
|
+
}, never>;
|
|
49
59
|
export declare const ContentBelow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
50
60
|
export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
51
61
|
export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
|
package/dist/Input.styles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _excluded = ["error"],
|
|
2
2
|
_excluded2 = ["error", "mask"],
|
|
3
|
-
_excluded3 = ["error"]
|
|
3
|
+
_excluded3 = ["error"],
|
|
4
|
+
_excluded4 = ["error"];
|
|
4
5
|
|
|
5
6
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
7
|
|
|
@@ -10,11 +11,26 @@ import styled, { css } from 'styled-components';
|
|
|
10
11
|
import BaseAntInput from 'antd/lib/input';
|
|
11
12
|
import * as React from 'react';
|
|
12
13
|
import MaskedInput from 'antd-mask-input';
|
|
14
|
+
import AutosizeInput from 'react-input-autosize';
|
|
13
15
|
|
|
14
16
|
var errorInputStyle = function errorInputStyle(props) {
|
|
15
17
|
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";
|
|
16
18
|
};
|
|
17
19
|
|
|
20
|
+
var errorAutoSizeInputStyle = function errorAutoSizeInputStyle(props) {
|
|
21
|
+
return "\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";
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var active = function active() {
|
|
25
|
+
return css(["transition:box-shadow 0.2s ease-in-out;box-shadow:inset 0 0 0 1px ", ";border:1px solid ", ";background-color:", ";"], function (props) {
|
|
26
|
+
return props.theme.palette['blue-600'];
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return props.theme.palette['blue-600'];
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.theme.palette['blue-050'];
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
18
34
|
function autoresizeConfObjToCss(_ref) {
|
|
19
35
|
var autoResize = _ref.autoResize;
|
|
20
36
|
if (!autoResize) return '';
|
|
@@ -150,39 +166,67 @@ function (_ref4, ref) {
|
|
|
150
166
|
}, function (props) {
|
|
151
167
|
return props.theme.palette['grey-700'];
|
|
152
168
|
});
|
|
169
|
+
export var AutoResizeInput = styled(React.forwardRef( // eslint-disable-next-line
|
|
170
|
+
function (_ref5) {
|
|
171
|
+
var error = _ref5.error,
|
|
172
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded4);
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
/*#__PURE__*/
|
|
176
|
+
// eslint-disable-next-line
|
|
177
|
+
React.createElement(AutosizeInput, props)
|
|
178
|
+
);
|
|
179
|
+
})).withConfig({
|
|
180
|
+
displayName: "Inputstyles__AutoResizeInput",
|
|
181
|
+
componentId: "dc57an-9"
|
|
182
|
+
})(["input{border:1px solid ", ";", ";border-radius:3px;font-size:13px;line-height:17px;", " padding:7px 12px 6px;color:", ";::placeholder{color:", ";}&:hover{border:1px solid ", ";&:disabled{cursor:not-allowed;border:1px solid ", ";}}&.active{", "}&:focus{", " &:hover{", "}}}"], function (props) {
|
|
183
|
+
return props.theme.palette['grey-300'];
|
|
184
|
+
}, function (props) {
|
|
185
|
+
return props.error ? errorAutoSizeInputStyle(props) : '';
|
|
186
|
+
}, function (props) {
|
|
187
|
+
return autoresizeConfObjToCss(props);
|
|
188
|
+
}, function (props) {
|
|
189
|
+
return props.theme.palette['grey-600'];
|
|
190
|
+
}, function (props) {
|
|
191
|
+
return props.theme.palette['grey-500'];
|
|
192
|
+
}, function (props) {
|
|
193
|
+
return props.theme.palette['grey-400'];
|
|
194
|
+
}, function (props) {
|
|
195
|
+
return props.theme.palette['grey-300'];
|
|
196
|
+
}, active(), active(), active());
|
|
153
197
|
export var ContentBelow = styled.div.withConfig({
|
|
154
198
|
displayName: "Inputstyles__ContentBelow",
|
|
155
|
-
componentId: "dc57an-
|
|
199
|
+
componentId: "dc57an-10"
|
|
156
200
|
})(["margin-top:8px;"]);
|
|
157
201
|
export var ErrorText = styled.div.withConfig({
|
|
158
202
|
displayName: "Inputstyles__ErrorText",
|
|
159
|
-
componentId: "dc57an-
|
|
203
|
+
componentId: "dc57an-11"
|
|
160
204
|
})(["color:", ";margin-bottom:4px;"], function (props) {
|
|
161
205
|
return props.theme.palette['red-600'];
|
|
162
206
|
});
|
|
163
207
|
export var Label = styled.label.withConfig({
|
|
164
208
|
displayName: "Inputstyles__Label",
|
|
165
|
-
componentId: "dc57an-
|
|
209
|
+
componentId: "dc57an-12"
|
|
166
210
|
})(["color:", ";font-weight:500;display:block;"], function (props) {
|
|
167
211
|
return props.theme.palette['grey-800'];
|
|
168
212
|
});
|
|
169
213
|
export var Counter = styled.div.withConfig({
|
|
170
214
|
displayName: "Inputstyles__Counter",
|
|
171
|
-
componentId: "dc57an-
|
|
215
|
+
componentId: "dc57an-13"
|
|
172
216
|
})(["font-weight:500;"]);
|
|
173
217
|
export var Description = styled.div.withConfig({
|
|
174
218
|
displayName: "Inputstyles__Description",
|
|
175
|
-
componentId: "dc57an-
|
|
219
|
+
componentId: "dc57an-14"
|
|
176
220
|
})(["color:", ";"], function (props) {
|
|
177
221
|
return props.theme.palette['grey-600'];
|
|
178
222
|
});
|
|
179
223
|
export var ContentAbove = styled.div.withConfig({
|
|
180
224
|
displayName: "Inputstyles__ContentAbove",
|
|
181
|
-
componentId: "dc57an-
|
|
225
|
+
componentId: "dc57an-15"
|
|
182
226
|
})(["display:flex;justify-content:space-between;margin-bottom:8px;min-height:18px;"]);
|
|
183
227
|
export var AddonWrapper = styled.div.withConfig({
|
|
184
228
|
displayName: "Inputstyles__AddonWrapper",
|
|
185
|
-
componentId: "dc57an-
|
|
229
|
+
componentId: "dc57an-16"
|
|
186
230
|
})(["background:", ";display:flex;align-items:center;height:", ";"], function (props) {
|
|
187
231
|
return props.theme.palette['grey-050'];
|
|
188
232
|
}, function (props) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EnhancedProps } from './Input.types';
|
|
2
2
|
export { default as Label } from './Label/Label';
|
|
3
|
-
export { Input, TextArea, RawInput, RawTextArea, InputGroup, MaskedInput, InputMultivalue, RawMaskedInput, } from './Input';
|
|
3
|
+
export { Input, TextArea, RawInput, RawTextArea, InputGroup, MaskedInput, InputMultivalue, RawMaskedInput, AutoResizeInput, } from './Input';
|
|
4
4
|
export type { EnhancedProps };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Label } from './Label/Label';
|
|
2
|
-
export { Input, TextArea, RawInput, RawTextArea, InputGroup, MaskedInput, InputMultivalue, RawMaskedInput } from './Input';
|
|
2
|
+
export { Input, TextArea, RawInput, RawTextArea, InputGroup, MaskedInput, InputMultivalue, RawMaskedInput, AutoResizeInput } from './Input';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.24",
|
|
4
4
|
"description": "Input UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"antd": "^4",
|
|
46
46
|
"react": ">=16.9.0 < 17.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "41d417bdee4ee513979582394f0b4cdcdb2fed2f"
|
|
49
49
|
}
|