From a236cc614e680f651047437f6f03dc11769d1aa5 Mon Sep 17 00:00:00 2001 From: PKulkoRaccoonGang Date: Wed, 20 Sep 2023 16:48:31 +0300 Subject: [PATCH] refactor: refactoring after review --- src/Form/FormControl.jsx | 10 +++++----- src/Form/form-control.mdx | 16 ++++++++-------- src/Form/tests/FormControl.test.jsx | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Form/FormControl.jsx b/src/Form/FormControl.jsx index 0ec3977c056..54fc69fca73 100644 --- a/src/Form/FormControl.jsx +++ b/src/Form/FormControl.jsx @@ -18,7 +18,7 @@ const FormControl = React.forwardRef(({ floatingLabel, autoResize, onChange, - hasInputMask, + inputMask, ...props }, ref) => { const { @@ -73,7 +73,7 @@ const FormControl = React.forwardRef(({ className={className} > @@ -126,7 +126,7 @@ FormControl.propTypes = { /** Only for `as="textarea"`. Specifies whether the input can be resized according to the height of content. */ autoResize: PropTypes.bool, /** Specifies what format to use for the input mask. */ - hasInputMask: PropTypes.string, + inputMask: PropTypes.string, }; FormControl.defaultProps = { @@ -145,7 +145,7 @@ FormControl.defaultProps = { isValid: undefined, isInvalid: undefined, autoResize: false, - hasInputMask: undefined, + inputMask: undefined, }; export default FormControl; diff --git a/src/Form/form-control.mdx b/src/Form/form-control.mdx index ec8510670b2..7fb34b3c55b 100644 --- a/src/Form/form-control.mdx +++ b/src/Form/form-control.mdx @@ -165,7 +165,7 @@ or [select attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element ## Input masks Paragon uses the [react-imask](https://www.npmjs.com/package/react-imask) library, which allows you to add masks of different types for inputs. -To create your own mask, you need to pass the required mask pattern (`+{1}(000)000-00-00`) to the `hasInputMask` property.
+To create your own mask, you need to pass the required mask pattern (`+{1}(000)000-00-00`) to the `inputMask` property.
See [react-imask](https://imask.js.org) for documentation on available props. ```jsx live @@ -180,7 +180,7 @@ See [react-imask](https://imask.js.org) for documentation on available props.

Phone

} @@ -193,7 +193,7 @@ See [react-imask](https://imask.js.org) for documentation on available props.

Credit card

} @@ -205,7 +205,7 @@ See [react-imask](https://imask.js.org) for documentation on available props.

Date

} @@ -217,7 +217,7 @@ See [react-imask](https://imask.js.org) for documentation on available props.

Secure password

OTP password } @@ -249,7 +249,7 @@ See [react-imask](https://imask.js.org) for documentation on available props.

Course prise

} trailingElement={} floatingLabel="What is your phone number?" diff --git a/src/Form/tests/FormControl.test.jsx b/src/Form/tests/FormControl.test.jsx index 9964268a4b1..8eb430213c8 100644 --- a/src/Form/tests/FormControl.test.jsx +++ b/src/Form/tests/FormControl.test.jsx @@ -17,7 +17,7 @@ function Component({ isClearValue }) { return ( setInputValue(e.target.value)} onAccept={isClearValue ? onChangeFunc : (value) => setInputValue(value)}