@webority/ui-react 0.6.9 → 0.6.10

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.
@@ -18,6 +18,18 @@ import '@webority/ui-elements';
18
18
  * @param {(value: string) => void} [props.onChange]
19
19
  * @param {(value: string) => void} [props.onComplete] Fires once, when the last character
20
20
  * lands — so a form can submit itself without polling the value.
21
+ *
22
+ * It receives the CODE, not a DOM event. With react-hook-form that matters:
23
+ * `onComplete={handleSubmit(onSubmit)}` hands a string to a handler that expects an event
24
+ * and calls `preventDefault` on it. RHF v7 guards against it so the short form happens to
25
+ * work — by accident, and not something to rely on. Wrap it instead:
26
+ *
27
+ * ```jsx
28
+ * <AppOtpInput onComplete={() => handleSubmit(onSubmit)()} />
29
+ * ```
30
+ *
31
+ * The component is also CONTROLLED, so with RHF it wants `<Controller>` rather than
32
+ * `register`.
21
33
  * @param {number} [props.length=6] Characters in the code. TOTP is 6; backup codes are often 8.
22
34
  * @param {"numeric"|"alphanumeric"} [props.mode="numeric"] Drives the on-screen keyboard and
23
35
  * what the field will accept.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
31
  "react-toastify": "^11.1.0",
32
- "@webority/theme": "^0.6.9",
33
- "@webority/ui-elements": "^0.6.9"
32
+ "@webority/theme": "^0.6.10",
33
+ "@webority/ui-elements": "^0.6.10"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "bootstrap": "5.3.3",