@yamada-ui/number-input 0.3.19 → 0.3.21
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.
|
@@ -27,12 +27,7 @@ import {
|
|
|
27
27
|
useSafeLayoutEffect,
|
|
28
28
|
useUpdateEffect
|
|
29
29
|
} from "@yamada-ui/utils";
|
|
30
|
-
import {
|
|
31
|
-
useCallback,
|
|
32
|
-
useEffect,
|
|
33
|
-
useRef,
|
|
34
|
-
useState
|
|
35
|
-
} from "react";
|
|
30
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
36
31
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
32
|
var isDefaultValidCharacter = (character) => /^[Ee0-9+\-.]$/.test(character);
|
|
38
33
|
var isValidNumericKeyboardEvent = ({ key, ctrlKey, altKey, metaKey }, isValid) => {
|
package/dist/index.mjs
CHANGED
package/dist/number-input.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { UseCounterProps } from '@yamada-ui/use-counter';
|
|
|
5
5
|
import { PropGetter } from '@yamada-ui/utils';
|
|
6
6
|
import { InputHTMLAttributes } from 'react';
|
|
7
7
|
|
|
8
|
-
type ValidityState =
|
|
8
|
+
type ValidityState = "rangeUnderflow" | "rangeOverflow";
|
|
9
9
|
type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterProps & {
|
|
10
10
|
/**
|
|
11
11
|
* The HTML `name` attribute used for forms.
|
|
@@ -17,13 +17,13 @@ type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterPro
|
|
|
17
17
|
*
|
|
18
18
|
* @default 'decimal'
|
|
19
19
|
*/
|
|
20
|
-
inputMode?: InputHTMLAttributes<any>[
|
|
20
|
+
inputMode?: InputHTMLAttributes<any>["inputMode"];
|
|
21
21
|
/**
|
|
22
22
|
* The pattern used to check the <input> element's value against on form submission.
|
|
23
23
|
*
|
|
24
24
|
* @default '[0-9]*(.[0-9]+)?'
|
|
25
25
|
*/
|
|
26
|
-
pattern?: InputHTMLAttributes<any>[
|
|
26
|
+
pattern?: InputHTMLAttributes<any>["pattern"];
|
|
27
27
|
/**
|
|
28
28
|
* If `true`, the input will be focused as you increment or decrement the value with the stepper.
|
|
29
29
|
*
|
|
@@ -89,11 +89,11 @@ type NumberInputOptions = {
|
|
|
89
89
|
/**
|
|
90
90
|
* Props for container element.
|
|
91
91
|
*/
|
|
92
|
-
containerProps?: HTMLUIProps<
|
|
92
|
+
containerProps?: HTMLUIProps<"div">;
|
|
93
93
|
/**
|
|
94
94
|
* Props for addon component.
|
|
95
95
|
*/
|
|
96
|
-
addonProps?: HTMLUIProps<
|
|
96
|
+
addonProps?: HTMLUIProps<"div">;
|
|
97
97
|
/**
|
|
98
98
|
* Props for increment component.
|
|
99
99
|
*/
|
|
@@ -105,15 +105,15 @@ type NumberInputOptions = {
|
|
|
105
105
|
/**
|
|
106
106
|
* The border color when the input is focused.
|
|
107
107
|
*/
|
|
108
|
-
focusBorderColor?: ColorModeToken<CSS.Property.BorderColor,
|
|
108
|
+
focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, "colors">;
|
|
109
109
|
/**
|
|
110
110
|
* The border color when the input is invalid.
|
|
111
111
|
*/
|
|
112
|
-
errorBorderColor?: ColorModeToken<CSS.Property.BorderColor,
|
|
112
|
+
errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, "colors">;
|
|
113
113
|
};
|
|
114
|
-
type NumberInputProps = Omit<HTMLUIProps<
|
|
114
|
+
type NumberInputProps = Omit<HTMLUIProps<"input">, "disabled" | "required" | "readOnly" | "size" | "onChange"> & ThemeProps<"NumberInput"> & Omit<UseNumberInputProps, "disabled" | "required" | "readOnly"> & NumberInputOptions;
|
|
115
115
|
declare const NumberInput: _yamada_ui_core.Component<"input", NumberInputProps>;
|
|
116
|
-
type NumberIncrementStepperProps = HTMLUIProps<
|
|
117
|
-
type NumberDecrementStepperProps = HTMLUIProps<
|
|
116
|
+
type NumberIncrementStepperProps = HTMLUIProps<"div">;
|
|
117
|
+
type NumberDecrementStepperProps = HTMLUIProps<"div">;
|
|
118
118
|
|
|
119
119
|
export { NumberInput, NumberInputProps, UseNumberInputProps, UseNumberInputReturn, useNumberInput };
|
package/dist/number-input.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { UseCounterProps } from '@yamada-ui/use-counter';
|
|
|
5
5
|
import { PropGetter } from '@yamada-ui/utils';
|
|
6
6
|
import { InputHTMLAttributes } from 'react';
|
|
7
7
|
|
|
8
|
-
type ValidityState =
|
|
8
|
+
type ValidityState = "rangeUnderflow" | "rangeOverflow";
|
|
9
9
|
type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterProps & {
|
|
10
10
|
/**
|
|
11
11
|
* The HTML `name` attribute used for forms.
|
|
@@ -17,13 +17,13 @@ type UseNumberInputProps = UseFormControlProps<HTMLInputElement> & UseCounterPro
|
|
|
17
17
|
*
|
|
18
18
|
* @default 'decimal'
|
|
19
19
|
*/
|
|
20
|
-
inputMode?: InputHTMLAttributes<any>[
|
|
20
|
+
inputMode?: InputHTMLAttributes<any>["inputMode"];
|
|
21
21
|
/**
|
|
22
22
|
* The pattern used to check the <input> element's value against on form submission.
|
|
23
23
|
*
|
|
24
24
|
* @default '[0-9]*(.[0-9]+)?'
|
|
25
25
|
*/
|
|
26
|
-
pattern?: InputHTMLAttributes<any>[
|
|
26
|
+
pattern?: InputHTMLAttributes<any>["pattern"];
|
|
27
27
|
/**
|
|
28
28
|
* If `true`, the input will be focused as you increment or decrement the value with the stepper.
|
|
29
29
|
*
|
|
@@ -89,11 +89,11 @@ type NumberInputOptions = {
|
|
|
89
89
|
/**
|
|
90
90
|
* Props for container element.
|
|
91
91
|
*/
|
|
92
|
-
containerProps?: HTMLUIProps<
|
|
92
|
+
containerProps?: HTMLUIProps<"div">;
|
|
93
93
|
/**
|
|
94
94
|
* Props for addon component.
|
|
95
95
|
*/
|
|
96
|
-
addonProps?: HTMLUIProps<
|
|
96
|
+
addonProps?: HTMLUIProps<"div">;
|
|
97
97
|
/**
|
|
98
98
|
* Props for increment component.
|
|
99
99
|
*/
|
|
@@ -105,15 +105,15 @@ type NumberInputOptions = {
|
|
|
105
105
|
/**
|
|
106
106
|
* The border color when the input is focused.
|
|
107
107
|
*/
|
|
108
|
-
focusBorderColor?: ColorModeToken<CSS.Property.BorderColor,
|
|
108
|
+
focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, "colors">;
|
|
109
109
|
/**
|
|
110
110
|
* The border color when the input is invalid.
|
|
111
111
|
*/
|
|
112
|
-
errorBorderColor?: ColorModeToken<CSS.Property.BorderColor,
|
|
112
|
+
errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, "colors">;
|
|
113
113
|
};
|
|
114
|
-
type NumberInputProps = Omit<HTMLUIProps<
|
|
114
|
+
type NumberInputProps = Omit<HTMLUIProps<"input">, "disabled" | "required" | "readOnly" | "size" | "onChange"> & ThemeProps<"NumberInput"> & Omit<UseNumberInputProps, "disabled" | "required" | "readOnly"> & NumberInputOptions;
|
|
115
115
|
declare const NumberInput: _yamada_ui_core.Component<"input", NumberInputProps>;
|
|
116
|
-
type NumberIncrementStepperProps = HTMLUIProps<
|
|
117
|
-
type NumberDecrementStepperProps = HTMLUIProps<
|
|
116
|
+
type NumberIncrementStepperProps = HTMLUIProps<"div">;
|
|
117
|
+
type NumberDecrementStepperProps = HTMLUIProps<"div">;
|
|
118
118
|
|
|
119
119
|
export { NumberInput, NumberInputProps, UseNumberInputProps, UseNumberInputReturn, useNumberInput };
|
package/dist/number-input.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/number-input",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "Yamada UI number input component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.12.
|
|
38
|
+
"@yamada-ui/core": "0.12.7",
|
|
39
39
|
"@yamada-ui/utils": "0.3.3",
|
|
40
|
-
"@yamada-ui/form-control": "0.3.
|
|
41
|
-
"@yamada-ui/icon": "0.3.
|
|
40
|
+
"@yamada-ui/form-control": "0.3.20",
|
|
41
|
+
"@yamada-ui/icon": "0.3.17",
|
|
42
42
|
"@yamada-ui/use-counter": "0.3.5",
|
|
43
43
|
"@yamada-ui/use-interval": "0.2.5",
|
|
44
44
|
"@yamada-ui/use-event-listener": "0.2.5"
|