@synerise/ds-input 1.3.12 → 1.4.0
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 +22 -0
- package/dist/InputGroup.styles.js +1 -1
- package/dist/PasswordInput.d.ts +3 -0
- package/dist/PasswordInput.js +52 -0
- package/dist/PasswordInput.types.d.ts +9 -0
- package/dist/PasswordInput.types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.4.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.3.13...@synerise/ds-input@1.4.0) (2025-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **input:** add PasswordInput ([a9e9466](https://github.com/synerise/synerise-design/commit/a9e9466491246857a24807b1ac3a72f442de50d5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.3.13](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.3.12...@synerise/ds-input@1.3.13) (2025-10-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **input:** fixes styles to input-group ([7f6932b](https://github.com/synerise/synerise-design/commit/7f6932b0ad5ac8c6384b3804b8614aeff795d6a8))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [1.3.12](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.3.11...@synerise/ds-input@1.3.12) (2025-09-25)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @synerise/ds-input
|
|
@@ -6,7 +6,7 @@ export var InputGroupItem = styled.div.withConfig({
|
|
|
6
6
|
export var InputGroupWrapper = styled.div.withConfig({
|
|
7
7
|
displayName: "InputGroupstyles__InputGroupWrapper",
|
|
8
8
|
componentId: "sc-1cn2cc5-1"
|
|
9
|
-
})(["&&&{", "{.ds-select-container{margin-bottom:0;}}display:flex;min-width:0;", ";", "}"], InputGroupItem, function (props) {
|
|
9
|
+
})(["&&&{", "{.ds-select-container{margin-bottom:0;}}.ant-input.ant-input{float:none;}display:flex;min-width:0;", ";", "}"], InputGroupItem, function (props) {
|
|
10
10
|
return props.compact ? '' : 'align-items: stretch';
|
|
11
11
|
}, function (props) {
|
|
12
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);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var _excluded = ["texts"];
|
|
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, { useState } from 'react';
|
|
5
|
+
import { FormattedMessage } from 'react-intl';
|
|
6
|
+
import Icon, { HideM, ShowM } from '@synerise/ds-icon';
|
|
7
|
+
import { Input } from './Input';
|
|
8
|
+
export var PasswordInput = function PasswordInput(_ref) {
|
|
9
|
+
var texts = _ref.texts,
|
|
10
|
+
inputProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
|
+
var _useState = useState(false),
|
|
12
|
+
isVisible = _useState[0],
|
|
13
|
+
setIsVisible = _useState[1];
|
|
14
|
+
var allTexts = _extends({
|
|
15
|
+
showText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
16
|
+
id: "DS.INPUT.SHOW-PASSWORD",
|
|
17
|
+
defaultMessage: "Show password"
|
|
18
|
+
}),
|
|
19
|
+
hideText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
20
|
+
id: "DS.INPUT.HIDE-PASSWORD",
|
|
21
|
+
defaultMessage: "Hide password"
|
|
22
|
+
})
|
|
23
|
+
}, texts);
|
|
24
|
+
var inputConfig = {
|
|
25
|
+
text: {
|
|
26
|
+
type: 'text',
|
|
27
|
+
icon: /*#__PURE__*/React.createElement(HideM, null),
|
|
28
|
+
tooltip: allTexts.hideText
|
|
29
|
+
},
|
|
30
|
+
password: {
|
|
31
|
+
type: 'password',
|
|
32
|
+
icon: /*#__PURE__*/React.createElement(ShowM, null),
|
|
33
|
+
tooltip: allTexts.showText
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var inputState = isVisible ? inputConfig.text : inputConfig.password;
|
|
37
|
+
var passwordIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
38
|
+
onClick: function onClick(event) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
setIsVisible(function (value) {
|
|
42
|
+
return !value;
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
component: inputState.icon
|
|
46
|
+
});
|
|
47
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, inputProps, {
|
|
48
|
+
type: inputState.type,
|
|
49
|
+
icon1: passwordIcon,
|
|
50
|
+
icon1Tooltip: /*#__PURE__*/React.createElement(React.Fragment, null, inputState.tooltip)
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type InputProps } from './Input.types';
|
|
3
|
+
export type PasswordInputTexts = {
|
|
4
|
+
showText: ReactNode;
|
|
5
|
+
hideText: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type PasswordInputProps = Omit<InputProps, 'icon1' | 'icon1Tooltip' | 'icon2' | 'icon2Tooltip' | 'suffixel' | 'prefixel' | 'type' | 'expandableTooltip'> & {
|
|
8
|
+
texts?: Partial<PasswordInputTexts>;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -12,3 +12,5 @@ export type { BaseProps, EnhancedProps, InputProps, AutoResizeProp, } from './In
|
|
|
12
12
|
export { default as AutosizeInput } from './AutosizeInput/AutosizeInput';
|
|
13
13
|
export type { AutosizeInputProps, AutosizeWrapperProps, AutosizeInputRefType, } from './AutosizeInput/AutosizeInput.types';
|
|
14
14
|
export { AutosizeWrapper } from './components/AutosizeWrapper';
|
|
15
|
+
export { PasswordInput } from './PasswordInput';
|
|
16
|
+
export type { PasswordInputProps, PasswordInputTexts, } from './PasswordInput.types';
|
package/dist/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { RawTextArea as DSRawTextArea } from './Textarea/Textarea';
|
|
|
8
8
|
import * as _InputStyles from './Input.styles';
|
|
9
9
|
export { _InputStyles as InputStyles };
|
|
10
10
|
export { default as AutosizeInput } from './AutosizeInput/AutosizeInput';
|
|
11
|
-
export { AutosizeWrapper } from './components/AutosizeWrapper';
|
|
11
|
+
export { AutosizeWrapper } from './components/AutosizeWrapper';
|
|
12
|
+
export { PasswordInput } from './PasswordInput';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Input UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-form-field": "^1.1.
|
|
39
|
-
"@synerise/ds-icon": "^1.7.
|
|
40
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
41
|
-
"@synerise/ds-tooltip": "^1.2.
|
|
42
|
-
"@synerise/ds-utils": "^1.
|
|
38
|
+
"@synerise/ds-form-field": "^1.1.17",
|
|
39
|
+
"@synerise/ds-icon": "^1.7.3",
|
|
40
|
+
"@synerise/ds-scrollbar": "^1.1.9",
|
|
41
|
+
"@synerise/ds-tooltip": "^1.2.1",
|
|
42
|
+
"@synerise/ds-utils": "^1.5.0",
|
|
43
43
|
"classnames": "^2.3.2",
|
|
44
44
|
"csstype": "^2.6.9",
|
|
45
45
|
"uuid": "^8.3.2"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"react": ">=16.9.0 <= 18.3.1",
|
|
51
51
|
"styled-components": "^5.3.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "4e09fc37fa21ff2e27655e7bb305b136db0ca199"
|
|
54
54
|
}
|