@yamada-ui/pin-input 0.2.4 → 0.2.7

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.
@@ -0,0 +1,3 @@
1
+ export { PinInput, PinInputField, PinInputFieldProps, PinInputProps } from './pin-input.mjs';
2
+ import '@yamada-ui/core';
3
+ import '@yamada-ui/form-control';
@@ -0,0 +1,79 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps, ThemeProps, CSSUIProps } from '@yamada-ui/core';
3
+ import { FormControlOptions } from '@yamada-ui/form-control';
4
+
5
+ type PinInputOptions = {
6
+ /**
7
+ * The top-level id string that will be applied to the input fields.
8
+ * The index of the input will be appended to this top-level id.
9
+ */
10
+ id?: string;
11
+ /**
12
+ * The type of values the pin-input should allow.
13
+ *
14
+ * @default 'number'
15
+ */
16
+ type?: 'alphanumeric' | 'number';
17
+ /**
18
+ * The placeholder for the pin input.
19
+ *
20
+ * @default '○'
21
+ */
22
+ placeholder?: string;
23
+ /**
24
+ * The value of the pin input.
25
+ */
26
+ value?: string;
27
+ /**
28
+ * The initial value of the pin input.
29
+ */
30
+ defaultValue?: string;
31
+ /**
32
+ * If `true`, the pin input receives focus on mount.
33
+ *
34
+ * @default false
35
+ */
36
+ autoFocus?: boolean;
37
+ /**
38
+ * If `true`, focus will move automatically to the next input once filled.
39
+ *
40
+ * @default true
41
+ */
42
+ manageFocus?: boolean;
43
+ /**
44
+ * If `true`, the pin input component signals to its fields that they should.
45
+ */
46
+ otp?: boolean;
47
+ /**
48
+ * If `true`, the input's value will be masked just like `type=password`.
49
+ */
50
+ mask?: boolean;
51
+ /**
52
+ * Function called on input change.
53
+ */
54
+ onChange?: (value: string) => void;
55
+ /**
56
+ * Function called when all inputs have valid values.
57
+ */
58
+ onComplete?: (value: string) => void;
59
+ /**
60
+ * The number of inputs to display.
61
+ *
62
+ * @default 4
63
+ */
64
+ fileds?: number;
65
+ /**
66
+ * The border color when the input is focused.
67
+ */
68
+ focusBorderColor?: CSSUIProps<'unresponsive'>['borderColor'];
69
+ /**
70
+ * The border color when the input is invalid.
71
+ */
72
+ errorBorderColor?: CSSUIProps<'unresponsive'>['borderColor'];
73
+ };
74
+ type PinInputProps = Omit<HTMLUIProps<'div'>, 'onChange'> & ThemeProps<'PinInput'> & FormControlOptions & PinInputOptions;
75
+ declare const PinInput: _yamada_ui_core.Component<"div", PinInputProps>;
76
+ type PinInputFieldProps = HTMLUIProps<'input'> & FormControlOptions;
77
+ declare const PinInputField: _yamada_ui_core.Component<"input", PinInputFieldProps>;
78
+
79
+ export { PinInput, PinInputField, PinInputFieldProps, PinInputProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/pin-input",
3
- "version": "0.2.4",
3
+ "version": "0.2.7",
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.4.3",
39
- "@yamada-ui/utils": "0.1.2",
40
- "@yamada-ui/form-control": "0.2.4",
41
- "@yamada-ui/use-descendant": "0.1.2",
42
- "@yamada-ui/use-controllable-state": "0.1.3"
38
+ "@yamada-ui/core": "0.5.1",
39
+ "@yamada-ui/utils": "0.1.3",
40
+ "@yamada-ui/form-control": "0.2.6",
41
+ "@yamada-ui/use-descendant": "0.1.4",
42
+ "@yamada-ui/use-controllable-state": "0.1.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "react": "^18.0.0",