@yamada-ui/pin-input 0.3.22 → 0.4.1

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.
@@ -22,12 +22,7 @@ import {
22
22
  filterUndefined,
23
23
  getValidChildren
24
24
  } from "@yamada-ui/utils";
25
- import {
26
- useCallback,
27
- useEffect,
28
- useId,
29
- useState
30
- } from "react";
25
+ import { useCallback, useEffect, useId, useState } from "react";
31
26
  import { jsx } from "react/jsx-runtime";
32
27
  var toArray = (value) => value == null ? void 0 : value.split("");
33
28
  var validate = (value, type) => {
@@ -61,11 +56,11 @@ var PinInput = forwardRef(
61
56
  mask,
62
57
  onChange,
63
58
  onComplete,
64
- fileds = 4,
59
+ items = 4,
65
60
  children,
66
61
  ...rest
67
62
  } = useFormControlProps(omitThemeProps(mergedProps));
68
- id = id != null ? id : useId();
63
+ id != null ? id : id = useId();
69
64
  const descendants = useDescendants();
70
65
  const [moveFocus, setMoveFocus] = useState(true);
71
66
  const [focusedIndex, setFocusedIndex] = useState(-1);
@@ -212,7 +207,7 @@ var PinInput = forwardRef(
212
207
  };
213
208
  let cloneChildren = getValidChildren(children);
214
209
  if (!cloneChildren.length)
215
- for (let i = 0; i < fileds; i++) {
210
+ for (let i = 0; i < items; i++) {
216
211
  cloneChildren.push(/* @__PURE__ */ jsx(PinInputField, {}, i));
217
212
  }
218
213
  return /* @__PURE__ */ jsx(DescendantsContextProvider, { value: descendants, children: /* @__PURE__ */ jsx(PinInputProvider, { value: { getInputProps, styles }, children: /* @__PURE__ */ jsx(
package/dist/index.js CHANGED
@@ -66,11 +66,11 @@ var PinInput = (0, import_core.forwardRef)(
66
66
  mask,
67
67
  onChange,
68
68
  onComplete,
69
- fileds = 4,
69
+ items = 4,
70
70
  children,
71
71
  ...rest
72
72
  } = (0, import_form_control.useFormControlProps)((0, import_core.omitThemeProps)(mergedProps));
73
- id = id != null ? id : (0, import_react.useId)();
73
+ id != null ? id : id = (0, import_react.useId)();
74
74
  const descendants = useDescendants();
75
75
  const [moveFocus, setMoveFocus] = (0, import_react.useState)(true);
76
76
  const [focusedIndex, setFocusedIndex] = (0, import_react.useState)(-1);
@@ -217,7 +217,7 @@ var PinInput = (0, import_core.forwardRef)(
217
217
  };
218
218
  let cloneChildren = (0, import_utils.getValidChildren)(children);
219
219
  if (!cloneChildren.length)
220
- for (let i = 0; i < fileds; i++) {
220
+ for (let i = 0; i < items; i++) {
221
221
  cloneChildren.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PinInputField, {}, i));
222
222
  }
223
223
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescendantsContextProvider, { value: descendants, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PinInputProvider, { value: { getInputProps, styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  PinInput,
4
4
  PinInputField
5
- } from "./chunk-S3HGITC7.mjs";
5
+ } from "./chunk-UYIAVDTA.mjs";
6
6
  export {
7
7
  PinInput,
8
8
  PinInputField
@@ -61,7 +61,7 @@ type PinInputOptions = {
61
61
  *
62
62
  * @default 4
63
63
  */
64
- fileds?: number;
64
+ items?: number;
65
65
  /**
66
66
  * The border color when the input is focused.
67
67
  */
@@ -61,7 +61,7 @@ type PinInputOptions = {
61
61
  *
62
62
  * @default 4
63
63
  */
64
- fileds?: number;
64
+ items?: number;
65
65
  /**
66
66
  * The border color when the input is focused.
67
67
  */
package/dist/pin-input.js CHANGED
@@ -64,11 +64,11 @@ var PinInput = (0, import_core.forwardRef)(
64
64
  mask,
65
65
  onChange,
66
66
  onComplete,
67
- fileds = 4,
67
+ items = 4,
68
68
  children,
69
69
  ...rest
70
70
  } = (0, import_form_control.useFormControlProps)((0, import_core.omitThemeProps)(mergedProps));
71
- id = id != null ? id : (0, import_react.useId)();
71
+ id != null ? id : id = (0, import_react.useId)();
72
72
  const descendants = useDescendants();
73
73
  const [moveFocus, setMoveFocus] = (0, import_react.useState)(true);
74
74
  const [focusedIndex, setFocusedIndex] = (0, import_react.useState)(-1);
@@ -215,7 +215,7 @@ var PinInput = (0, import_core.forwardRef)(
215
215
  };
216
216
  let cloneChildren = (0, import_utils.getValidChildren)(children);
217
217
  if (!cloneChildren.length)
218
- for (let i = 0; i < fileds; i++) {
218
+ for (let i = 0; i < items; i++) {
219
219
  cloneChildren.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PinInputField, {}, i));
220
220
  }
221
221
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescendantsContextProvider, { value: descendants, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PinInputProvider, { value: { getInputProps, styles }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  PinInput,
4
4
  PinInputField
5
- } from "./chunk-S3HGITC7.mjs";
5
+ } from "./chunk-UYIAVDTA.mjs";
6
6
  export {
7
7
  PinInput,
8
8
  PinInputField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/pin-input",
3
- "version": "0.3.22",
3
+ "version": "0.4.1",
4
4
  "description": "Yamada UI pin input component",
5
5
  "keywords": [
6
6
  "yamada",
@@ -35,11 +35,11 @@
35
35
  "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@yamada-ui/core": "0.12.6",
38
+ "@yamada-ui/core": "0.12.7",
39
39
  "@yamada-ui/utils": "0.3.3",
40
- "@yamada-ui/form-control": "0.3.19",
41
- "@yamada-ui/use-descendant": "0.2.5",
42
- "@yamada-ui/use-controllable-state": "0.3.1"
40
+ "@yamada-ui/form-control": "0.3.20",
41
+ "@yamada-ui/use-descendant": "0.2.6",
42
+ "@yamada-ui/use-controllable-state": "0.3.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "react": "^18.0.0",