@synerise/ds-input 1.3.13 → 1.4.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,25 @@
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.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@1.4.0...@synerise/ds-input@1.4.1) (2025-10-22)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-input
9
+
10
+
11
+
12
+
13
+
14
+ # [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)
15
+
16
+
17
+ ### Features
18
+
19
+ * **input:** add PasswordInput ([a9e9466](https://github.com/synerise/synerise-design/commit/a9e9466491246857a24807b1ac3a72f442de50d5))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [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)
7
26
 
8
27
 
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { PasswordInputProps } from './PasswordInput.types';
3
+ export declare const PasswordInput: ({ texts, ...inputProps }: PasswordInputProps) => React.JSX.Element;
@@ -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.13",
3
+ "version": "1.4.1",
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.16",
39
- "@synerise/ds-icon": "^1.7.2",
40
- "@synerise/ds-scrollbar": "^1.1.8",
41
- "@synerise/ds-tooltip": "^1.2.0",
42
- "@synerise/ds-utils": "^1.4.2",
38
+ "@synerise/ds-form-field": "^1.1.18",
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": "1f909e1fc4174f1c05c148338e64652a893ef926"
53
+ "gitHead": "a40fca2cc78eda64afa96d18dc4d177538a22404"
54
54
  }