@toptal/picasso-password-input 2.0.12 → 3.0.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/dist-package/src/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist-package/src/PasswordInput/PasswordInput.js +4 -9
- package/dist-package/src/PasswordInput/PasswordInput.js.map +1 -1
- package/package.json +7 -7
- package/src/PasswordInput/PasswordInput.tsx +5 -12
- package/dist-package/src/PasswordInput/styles.d.ts +0 -3
- package/dist-package/src/PasswordInput/styles.d.ts.map +0 -1
- package/dist-package/src/PasswordInput/styles.js +0 -17
- package/dist-package/src/PasswordInput/styles.js.map +0 -1
- package/src/PasswordInput/styles.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../src/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,KAA4C,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../src/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,KAA4C,MAAM,OAAO,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAM1E,OAAO,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGjF,MAAM,WAAW,KACf,SAAQ,IAAI,CACR,iBAAiB,CAAC,kBAAkB,CAAC,EACnC,cAAc,GACd,MAAM,GACN,MAAM,GACN,SAAS,GACT,WAAW,GACX,gBAAgB,GAChB,cAAc,CACjB,EACD,SAAS;IACX,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACzD,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,GAAG;QACxC,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,gFA4EzB,CAAA;AAUD,eAAe,aAAa,CAAA"}
|
|
@@ -10,17 +10,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import React, { forwardRef, useState, useCallback } from 'react';
|
|
13
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
14
|
-
import cx from 'classnames';
|
|
15
13
|
import { OutlinedInput } from '@toptal/picasso-outlined-input';
|
|
16
14
|
import { InputAdornment } from '@toptal/picasso-input-adornment';
|
|
17
15
|
import { Eye16, EyeHidden16 } from '@toptal/picasso-icons';
|
|
18
16
|
import { ButtonCircular } from '@toptal/picasso-button';
|
|
19
17
|
import { usePropDeprecationWarning } from '@toptal/picasso-utils';
|
|
20
|
-
import
|
|
21
|
-
const useStyles = makeStyles(styles, {
|
|
22
|
-
name: 'PicassoPasswordInput',
|
|
23
|
-
});
|
|
18
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge';
|
|
24
19
|
export const PasswordInput = forwardRef(function PasswordInput(props, ref) {
|
|
25
20
|
const { value, onChange, disabled, error, status, size, width, style, className, testIds, enableReset, onResetClick, highlight } = props, rest = __rest(props
|
|
26
21
|
// TODO: [FX-4715]
|
|
@@ -33,14 +28,14 @@ export const PasswordInput = forwardRef(function PasswordInput(props, ref) {
|
|
|
33
28
|
description: 'Use the `status` prop instead. `error` is deprecated and will be removed in the next major release.',
|
|
34
29
|
});
|
|
35
30
|
const [showPassword, setShowPassword] = useState(false);
|
|
36
|
-
const classes = useStyles();
|
|
37
31
|
const handleToggleVisibilityClick = useCallback(() => {
|
|
38
32
|
setShowPassword(previousState => !previousState);
|
|
39
33
|
}, []);
|
|
40
34
|
const endAdornment = (React.createElement(InputAdornment, { position: 'end' },
|
|
41
35
|
React.createElement(ButtonCircular, { className: 'mr-2', variant: 'flat', icon: showPassword ? React.createElement(Eye16, null) : React.createElement(EyeHidden16, null), onClick: handleToggleVisibilityClick, "data-testid": testIds === null || testIds === void 0 ? void 0 : testIds.toggle, disabled: disabled })));
|
|
42
|
-
return (React.createElement(OutlinedInput, { style: style, className:
|
|
43
|
-
|
|
36
|
+
return (React.createElement(OutlinedInput, { style: style, className: twMerge('pr-0 cursor-text', className), highlight: highlight, classes: {
|
|
37
|
+
// removes up/down arrows in browsers based on WebKit and Blink (https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-inner-spin-button)
|
|
38
|
+
input: '[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 ',
|
|
44
39
|
}, inputProps: Object.assign(Object.assign({}, rest), { 'data-testid': testIds === null || testIds === void 0 ? void 0 : testIds.input }), size: size, width: width, status: error ? 'error' : status, inputRef: ref, type: showPassword ? 'text' : 'password', value: value, disabled: disabled, onChange: onChange, endAdornment: endAdornment, testIds: testIds, onResetClick: onResetClick, enableReset: enableReset }));
|
|
45
40
|
});
|
|
46
41
|
PasswordInput.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sourceRoot":"","sources":["../../../src/PasswordInput/PasswordInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sourceR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6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-password-input",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Toptal UI components library - PasswordInput",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@toptal/picasso-button": "
|
|
25
|
+
"@toptal/picasso-button": "3.0.0",
|
|
26
26
|
"@toptal/picasso-icons": "1.5.0",
|
|
27
|
-
"@toptal/picasso-input-adornment": "
|
|
28
|
-
"@toptal/picasso-outlined-input": "
|
|
29
|
-
"@toptal/picasso-utils": "1.0.3"
|
|
30
|
-
"classnames": "^2.5.1"
|
|
27
|
+
"@toptal/picasso-input-adornment": "2.0.0",
|
|
28
|
+
"@toptal/picasso-outlined-input": "2.0.0",
|
|
29
|
+
"@toptal/picasso-utils": "1.0.3"
|
|
31
30
|
},
|
|
32
31
|
"sideEffects": [
|
|
33
32
|
"**/styles.ts",
|
|
34
33
|
"**/styles.js"
|
|
35
34
|
],
|
|
36
35
|
"peerDependencies": {
|
|
37
|
-
"@material-ui/core": "4.12.4",
|
|
38
36
|
"react": ">=16.12.0 < 19.0.0",
|
|
37
|
+
"@toptal/picasso-tailwind-merge": "^1.0.1",
|
|
39
38
|
"@toptal/picasso-tailwind": ">=2.5.0"
|
|
40
39
|
},
|
|
41
40
|
"exports": {
|
|
42
41
|
".": "./dist-package/src/index.js"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
44
|
+
"@toptal/picasso-tailwind-merge": "1.2.0",
|
|
45
45
|
"@toptal/picasso-test-utils": "1.1.1"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import type { ChangeEvent } from 'react'
|
|
2
2
|
import React, { forwardRef, useState, useCallback } from 'react'
|
|
3
|
-
import type { Theme } from '@material-ui/core/styles'
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
5
3
|
import type { BaseProps, OmitInternalProps } from '@toptal/picasso-shared'
|
|
6
|
-
import cx from 'classnames'
|
|
7
4
|
import { OutlinedInput } from '@toptal/picasso-outlined-input'
|
|
8
5
|
import { InputAdornment } from '@toptal/picasso-input-adornment'
|
|
9
6
|
import { Eye16, EyeHidden16 } from '@toptal/picasso-icons'
|
|
10
7
|
import { ButtonCircular } from '@toptal/picasso-button'
|
|
11
8
|
import { usePropDeprecationWarning } from '@toptal/picasso-utils'
|
|
12
9
|
import type { Props as OutlinedInputProps } from '@toptal/picasso-outlined-input'
|
|
13
|
-
|
|
14
|
-
import styles from './styles'
|
|
10
|
+
import { twMerge } from '@toptal/picasso-tailwind-merge'
|
|
15
11
|
|
|
16
12
|
export interface Props
|
|
17
13
|
extends Omit<
|
|
@@ -38,10 +34,6 @@ export interface Props
|
|
|
38
34
|
highlight?: 'autofill'
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
const useStyles = makeStyles<Theme>(styles, {
|
|
42
|
-
name: 'PicassoPasswordInput',
|
|
43
|
-
})
|
|
44
|
-
|
|
45
37
|
export const PasswordInput = forwardRef<HTMLInputElement, Props>(
|
|
46
38
|
function PasswordInput(props, ref) {
|
|
47
39
|
const {
|
|
@@ -71,7 +63,6 @@ export const PasswordInput = forwardRef<HTMLInputElement, Props>(
|
|
|
71
63
|
})
|
|
72
64
|
|
|
73
65
|
const [showPassword, setShowPassword] = useState(false)
|
|
74
|
-
const classes = useStyles()
|
|
75
66
|
|
|
76
67
|
const handleToggleVisibilityClick = useCallback(() => {
|
|
77
68
|
setShowPassword(previousState => !previousState)
|
|
@@ -93,10 +84,12 @@ export const PasswordInput = forwardRef<HTMLInputElement, Props>(
|
|
|
93
84
|
return (
|
|
94
85
|
<OutlinedInput
|
|
95
86
|
style={style}
|
|
96
|
-
className={
|
|
87
|
+
className={twMerge('pr-0 cursor-text', className)}
|
|
97
88
|
highlight={highlight}
|
|
98
89
|
classes={{
|
|
99
|
-
|
|
90
|
+
// removes up/down arrows in browsers based on WebKit and Blink (https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-inner-spin-button)
|
|
91
|
+
input:
|
|
92
|
+
'[&::-webkit-outer-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 ',
|
|
100
93
|
}}
|
|
101
94
|
inputProps={{
|
|
102
95
|
...rest,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PasswordInput/styles.ts"],"names":[],"mappings":";AAEA,wBAcC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createStyles } from '@material-ui/core/styles';
|
|
2
|
-
export default () => {
|
|
3
|
-
return createStyles({
|
|
4
|
-
root: {
|
|
5
|
-
paddingRight: 0,
|
|
6
|
-
cursor: 'text',
|
|
7
|
-
},
|
|
8
|
-
input: {
|
|
9
|
-
'&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
10
|
-
'-webkit-appearance': 'none',
|
|
11
|
-
appearance: 'none',
|
|
12
|
-
margin: 0,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PasswordInput/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,GAAG,EAAE;IAClB,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE;YACJ,YAAY,EAAE,CAAC;YACf,MAAM,EAAE,MAAM;SACf;QACD,KAAK,EAAE;YACL,4DAA4D,EAAE;gBAC5D,oBAAoB,EAAE,MAAM;gBAC5B,UAAU,EAAE,MAAM;gBAClB,MAAM,EAAE,CAAC;aACV;SACF;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createStyles } from '@material-ui/core/styles'
|
|
2
|
-
|
|
3
|
-
export default () => {
|
|
4
|
-
return createStyles({
|
|
5
|
-
root: {
|
|
6
|
-
paddingRight: 0,
|
|
7
|
-
cursor: 'text',
|
|
8
|
-
},
|
|
9
|
-
input: {
|
|
10
|
-
'&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
11
|
-
'-webkit-appearance': 'none',
|
|
12
|
-
appearance: 'none',
|
|
13
|
-
margin: 0,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
}
|