@npm_leadtech/legal-lib-components 5.43.6 → 5.43.8

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.
@@ -9,7 +9,7 @@ export const MidBannerRatafiaSampleStyled = styled.div `
9
9
  img {
10
10
  border-radius: 8px 8px 0 0;
11
11
  box-shadow: var(--box-shadow-small);
12
- width: 727px;
12
+ max-width: $sm;
13
13
  }
14
14
  }
15
15
  &__sumarized-tag {
@@ -10,7 +10,7 @@ export const MidBannerRatafiaSampleStyled = styled.div`
10
10
  img {
11
11
  border-radius: 8px 8px 0 0;
12
12
  box-shadow: var(--box-shadow-small);
13
- width: 727px;
13
+ max-width: $sm;
14
14
  }
15
15
  }
16
16
  &__sumarized-tag {
@@ -3,7 +3,7 @@ interface InputProps {
3
3
  name: string;
4
4
  placeholder: string;
5
5
  maxLength: number;
6
- value: string;
6
+ value: any;
7
7
  type: 'password' | 'text' | 'number' | 'tel';
8
8
  disabled: boolean;
9
9
  className: string;
@@ -1,21 +1,16 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useCallback, useState } from 'react';
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
4
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
5
+ import React, { useState } from 'react';
3
6
  import eyeCloseIcon from '../../../../images/svg/eye-close.svg';
4
7
  import eyeIcon from '../../../../images/svg/eye-24-px.svg';
5
8
  export const Input = React.forwardRef(({ value, name, placeholder, className, onChange, onClick, onBlur, onKeyDown, onKeyUp, disabled, type = 'text', maxLength }, ref) => {
6
- const [currentValue, setCurrentValue] = useState(value);
7
9
  const [hidden, setHidden] = useState(true);
8
10
  const showPassword = () => {
9
11
  if (value !== null)
10
12
  setHidden(!hidden);
11
13
  };
12
- const handleChange = useCallback((event) => {
13
- setCurrentValue(event.target.value);
14
- onChange(event);
15
- }, [currentValue]);
16
- return (_jsxs(_Fragment, { children: [_jsx("input", { type: !hidden && type === 'password' ? 'text' : type, name: name, id: name, className: className, maxLength: maxLength, placeholder: placeholder, onChange: handleChange, onClick: onClick, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onBlur: onBlur, value: currentValue, "data-qa": name, disabled: disabled, ref: ref }), type === 'password' && (_jsx("button", { className: 'input-icon-password', onClick: showPassword, onKeyDown: (e) => {
17
- if (e.key === 'Enter')
18
- showPassword();
19
- }, children: _jsx("img", { src: hidden ? eyeIcon : eyeCloseIcon, alt: '' }) }))] }));
14
+ return (_jsxs(_Fragment, { children: [_jsx("input", { type: !hidden && type === 'password' ? 'text' : type, name: name, id: name, className: className, maxLength: maxLength, placeholder: placeholder, onChange: onChange, onClick: onClick, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onBlur: onBlur, value: value, "data-qa": name, disabled: disabled, ref: ref }), type === 'password' && (_jsx("img", { className: 'input-icon-password', src: hidden ? eyeIcon : eyeCloseIcon, onClick: showPassword, alt: '' }))] }));
20
15
  });
21
16
  Input.displayName = 'Input';
@@ -1,4 +1,8 @@
1
- import React, { useCallback, useState } from 'react'
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+
3
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
4
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
5
+ import React, { useState } from 'react'
2
6
 
3
7
  import eyeCloseIcon from '../../../../images/svg/eye-close.svg'
4
8
  import eyeIcon from '../../../../images/svg/eye-24-px.svg'
@@ -7,7 +11,7 @@ interface InputProps {
7
11
  name: string
8
12
  placeholder: string
9
13
  maxLength: number
10
- value: string
14
+ value: any
11
15
  type: 'password' | 'text' | 'number' | 'tel'
12
16
  disabled: boolean
13
17
  className: string
@@ -36,21 +40,12 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
36
40
  }: InputProps,
37
41
  ref
38
42
  ) => {
39
- const [currentValue, setCurrentValue] = useState(value)
40
43
  const [hidden, setHidden] = useState(true)
41
44
 
42
- const showPassword = (): void => {
45
+ const showPassword = (): any => {
43
46
  if (value !== null) setHidden(!hidden)
44
47
  }
45
48
 
46
- const handleChange = useCallback(
47
- (event: React.ChangeEvent<HTMLInputElement>) => {
48
- setCurrentValue(event.target.value)
49
- onChange(event)
50
- },
51
- [currentValue]
52
- )
53
-
54
49
  return (
55
50
  <>
56
51
  <input
@@ -60,26 +55,18 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
60
55
  className={className}
61
56
  maxLength={maxLength}
62
57
  placeholder={placeholder}
63
- onChange={handleChange}
58
+ onChange={onChange}
64
59
  onClick={onClick}
65
60
  onKeyDown={onKeyDown}
66
61
  onKeyUp={onKeyUp}
67
62
  onBlur={onBlur}
68
- value={currentValue}
63
+ value={value}
69
64
  data-qa={name}
70
65
  disabled={disabled}
71
66
  ref={ref}
72
67
  />
73
68
  {type === 'password' && (
74
- <button
75
- className='input-icon-password'
76
- onClick={showPassword}
77
- onKeyDown={(e) => {
78
- if (e.key === 'Enter') showPassword()
79
- }}
80
- >
81
- <img src={hidden ? eyeIcon : eyeCloseIcon} alt='' />
82
- </button>
69
+ <img className='input-icon-password' src={hidden ? eyeIcon : eyeCloseIcon} onClick={showPassword} alt='' />
83
70
  )}
84
71
  </>
85
72
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "5.43.6",
3
+ "version": "5.43.8",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",