@akinon/pz-otp 1.105.0 → 1.106.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 +6 -0
- package/package.json +1 -1
- package/readme.md +20 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -12,13 +12,29 @@ npx @akinon/projectzero@latest --plugins
|
|
|
12
12
|
|
|
13
13
|
### Props
|
|
14
14
|
|
|
15
|
-
| Property | Type | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| `customUIRender` | `React.ReactNode` | Optional function to fully customize the otp. Receives closeHandler, resendHandler, otp, setOtp, hasError, error, canResend, time, codeLength, setHasError and onSubmit props. |
|
|
15
|
+
| Property | Type | Required | Description |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| `customUIRender` | `React.ReactNode` | `Optional` | function to fully customize the otp. Receives closeHandler, resendHandler, otp, setOtp, hasError, error, canResend, time, codeLength, setHasError and onSubmit props. |
|
|
18
|
+
| `submitAction` | `SubmitHandler<{ [key: string]: any }>` | `Required` | A submit handler function triggered when OTP form is submitted. |
|
|
19
|
+
| `data` | `{ [key: string]: any }` | `Required` | Data object containing required fields like phone number. OTP code will be appended here before submission |
|
|
20
|
+
|
|
21
|
+
### Default Usage
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
25
|
+
|
|
26
|
+
<PluginModule
|
|
27
|
+
component={Component.Otp}
|
|
28
|
+
props={{
|
|
29
|
+
data: getValues(),
|
|
30
|
+
submitAction: registerHandler
|
|
31
|
+
}}
|
|
32
|
+
/>;
|
|
33
|
+
```
|
|
18
34
|
|
|
19
35
|
### Customizing OTP
|
|
20
36
|
|
|
21
|
-
```
|
|
37
|
+
```js
|
|
22
38
|
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
23
39
|
|
|
24
40
|
<PluginModule
|