@react-spectrum/numberfield 3.9.7 → 3.9.9
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/dist/NumberField.main.js +3 -6
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.module.js +3 -6
- package/dist/NumberField.module.js.map +1 -1
- package/dist/StepButton.main.js +3 -6
- package/dist/StepButton.main.js.map +1 -1
- package/dist/StepButton.mjs +3 -6
- package/dist/StepButton.module.js +3 -6
- package/dist/StepButton.module.js.map +1 -1
- package/dist/stepper_vars_css.main.js.map +1 -1
- package/dist/stepper_vars_css.module.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.6253cb24.css → vars.8d25eb32.css} +5 -5
- package/dist/{vars.6253cb24.css.map → vars.8d25eb32.css.map} +1 -1
- package/package.json +20 -20
- package/src/NumberField.tsx +5 -8
- package/src/StepButton.tsx +5 -8
package/dist/NumberField.main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $2f3cded204daae76$exports = require("./StepButton.main.js");
|
|
2
|
-
require("./vars.
|
|
2
|
+
require("./vars.8d25eb32.css");
|
|
3
3
|
var $3649bcbba015c4d7$exports = require("./stepper_vars_css.main.js");
|
|
4
4
|
var $3d7oE$reactspectrumutils = require("@react-spectrum/utils");
|
|
5
5
|
var $3d7oE$reactspectrumlabel = require("@react-spectrum/label");
|
|
@@ -48,7 +48,7 @@ $parcel$export(module.exports, "NumberField", () => $9b3df9c012d62e52$export$63c
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
const $9b3df9c012d62e52$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).forwardRef(function NumberField(props, ref) {
|
|
52
52
|
props = (0, $3d7oE$reactspectrumprovider.useProviderProps)(props);
|
|
53
53
|
props = (0, $3d7oE$reactspectrumform.useFormProps)(props);
|
|
54
54
|
let provider = (0, $3d7oE$reactspectrumprovider.useProvider)();
|
|
@@ -102,7 +102,7 @@ function $9b3df9c012d62e52$var$NumberField(props, ref) {
|
|
|
102
102
|
state: state,
|
|
103
103
|
validationState: validationState
|
|
104
104
|
}));
|
|
105
|
-
}
|
|
105
|
+
});
|
|
106
106
|
const $9b3df9c012d62e52$var$NumberFieldInput = /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).forwardRef(function NumberFieldInput(props, ref) {
|
|
107
107
|
let { groupProps: groupProps, inputProps: inputProps, inputRef: inputRef, incrementProps: incrementProps, decrementProps: decrementProps, className: className, style: style, autoFocus: autoFocus, isQuiet: isQuiet, isDisabled: isDisabled, hideStepper: hideStepper, validationState: validationState, name: name, state: state } = props;
|
|
108
108
|
let showStepper = !hideStepper;
|
|
@@ -141,9 +141,6 @@ const $9b3df9c012d62e52$var$NumberFieldInput = /*#__PURE__*/ (0, ($parcel$intero
|
|
|
141
141
|
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
142
142
|
})));
|
|
143
143
|
});
|
|
144
|
-
/**
|
|
145
|
-
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
146
|
-
*/ let $9b3df9c012d62e52$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).forwardRef($9b3df9c012d62e52$var$NumberField);
|
|
147
144
|
|
|
148
145
|
|
|
149
146
|
//# sourceMappingURL=NumberField.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuBM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAA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AAA,oCAAS;QAAE,WAAU;QAAK,SAAS;QAAU,GAAG,cAAc;sBAC/D,0DAAC,CAAA,GAAA,oCAAS;QAAE,WAAU;QAAO,SAAS;QAAU,GAAG,cAAc;SAGlE,sBAAQ,0DAAC;QAAM,MAAK;QAAS,MAAM;QAAM,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAI1G","sources":["packages/@react-spectrum/numberfield/src/NumberField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef, RefObject} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {NumberFieldState, useNumberFieldState} from '@react-stately/numberfield';\nimport React, {HTMLAttributes, InputHTMLAttributes, Ref, useRef} from 'react';\nimport {SpectrumNumberFieldProps} from '@react-types/numberfield';\nimport {StepButton} from './StepButton';\nimport stepperStyle from '@adobe/spectrum-css-temp/components/stepper/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useNumberField} from '@react-aria/numberfield';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport const NumberField = React.forwardRef(function NumberField(props: SpectrumNumberFieldProps, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let provider = useProvider();\n let {\n isQuiet,\n isReadOnly,\n isDisabled,\n hideStepper\n } = props;\n\n let {styleProps: style} = useStyleProps(props);\n\n let {locale} = useLocale();\n let state = useNumberFieldState({...props, locale});\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef<HTMLElement>(ref, inputRef);\n let {\n groupProps,\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useNumberField(props, state, inputRef);\n let isMobile = provider.scale === 'large';\n let showStepper = !hideStepper;\n\n let {isHovered, hoverProps} = useHover({isDisabled});\n\n let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);\n let className =\n classNames(\n stepperStyle,\n 'spectrum-Stepper',\n // because FocusRing won't pass along the className from Field, we have to handle that ourselves\n !props.label && style.className ? style.className : '',\n {\n 'spectrum-Stepper--isQuiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-Stepper--readonly': isReadOnly,\n 'is-invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Stepper--showStepper': showStepper,\n 'spectrum-Stepper--isMobile': isMobile,\n 'is-hovered': isHovered\n }\n );\n\n return (\n <Field\n {...props as Omit<SpectrumNumberFieldProps, 'onChange'>}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}\n wrapperClassName={classNames(\n stepperStyle,\n 'spectrum-Stepper-container',\n {\n 'spectrum-Stepper-container--isMobile': isMobile\n }\n )}>\n <NumberFieldInput\n {...props}\n groupProps={mergeProps(groupProps, hoverProps)}\n inputProps={inputProps}\n inputRef={inputRef}\n incrementProps={incrementButtonProps}\n decrementProps={decrementButtonProps}\n className={className}\n style={style}\n state={state}\n validationState={validationState} />\n </Field>\n );\n});\n\n\ninterface NumberFieldInputProps extends SpectrumNumberFieldProps {\n groupProps: HTMLAttributes<HTMLDivElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n incrementProps: AriaButtonProps,\n decrementProps: AriaButtonProps,\n className?: string,\n style?: React.CSSProperties,\n state: NumberFieldState\n}\n\nconst NumberFieldInput = React.forwardRef(function NumberFieldInput(props: NumberFieldInputProps, ref: Ref<HTMLDivElement>) {\n let {\n groupProps,\n inputProps,\n inputRef,\n incrementProps,\n decrementProps,\n className,\n style,\n autoFocus,\n isQuiet,\n isDisabled,\n hideStepper,\n validationState,\n name,\n state\n } = props;\n let showStepper = !hideStepper;\n\n return (\n <FocusRing\n within\n isTextInput\n focusClass={classNames(stepperStyle, 'is-focused')}\n focusRingClass={classNames(stepperStyle, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...groupProps}\n ref={ref}\n style={style}\n className={className}>\n <TextFieldBase\n UNSAFE_className={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-field'\n )\n }\n inputClassName={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-input'\n )\n }\n validationIconClassName={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-icon'\n )\n }\n isQuiet={isQuiet}\n inputRef={inputRef}\n validationState={validationState}\n inputProps={inputProps}\n isDisabled={isDisabled}\n disableFocusRing />\n {showStepper &&\n <>\n <StepButton direction=\"up\" isQuiet={isQuiet} {...incrementProps} />\n <StepButton direction=\"down\" isQuiet={isQuiet} {...decrementProps} />\n </>\n }\n {name && <input type=\"hidden\" name={name} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </div>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.main.js.map"}
|
package/dist/NumberField.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {StepButton as $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa} from "./StepButton.mjs";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.8d25eb32.css";
|
|
3
3
|
import $5I0aR$stepper_vars_cssmodulejs from "./stepper_vars_css.mjs";
|
|
4
4
|
import {useStyleProps as $5I0aR$useStyleProps, useFocusableRef as $5I0aR$useFocusableRef, classNames as $5I0aR$classNames} from "@react-spectrum/utils";
|
|
5
5
|
import {Field as $5I0aR$Field} from "@react-spectrum/label";
|
|
@@ -42,7 +42,7 @@ function $parcel$interopDefault(a) {
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberField(props, ref) {
|
|
46
46
|
props = (0, $5I0aR$useProviderProps)(props);
|
|
47
47
|
props = (0, $5I0aR$useFormProps)(props);
|
|
48
48
|
let provider = (0, $5I0aR$useProvider)();
|
|
@@ -96,7 +96,7 @@ function $48b879bdd771eb85$var$NumberField(props, ref) {
|
|
|
96
96
|
state: state,
|
|
97
97
|
validationState: validationState
|
|
98
98
|
}));
|
|
99
|
-
}
|
|
99
|
+
});
|
|
100
100
|
const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberFieldInput(props, ref) {
|
|
101
101
|
let { groupProps: groupProps, inputProps: inputProps, inputRef: inputRef, incrementProps: incrementProps, decrementProps: decrementProps, className: className, style: style, autoFocus: autoFocus, isQuiet: isQuiet, isDisabled: isDisabled, hideStepper: hideStepper, validationState: validationState, name: name, state: state } = props;
|
|
102
102
|
let showStepper = !hideStepper;
|
|
@@ -135,9 +135,6 @@ const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).f
|
|
|
135
135
|
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
136
136
|
})));
|
|
137
137
|
});
|
|
138
|
-
/**
|
|
139
|
-
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
140
|
-
*/ let $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef($48b879bdd771eb85$var$NumberField);
|
|
141
138
|
|
|
142
139
|
|
|
143
140
|
export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {StepButton as $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa} from "./StepButton.module.js";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.8d25eb32.css";
|
|
3
3
|
import $5I0aR$stepper_vars_cssmodulejs from "./stepper_vars_css.module.js";
|
|
4
4
|
import {useStyleProps as $5I0aR$useStyleProps, useFocusableRef as $5I0aR$useFocusableRef, classNames as $5I0aR$classNames} from "@react-spectrum/utils";
|
|
5
5
|
import {Field as $5I0aR$Field} from "@react-spectrum/label";
|
|
@@ -42,7 +42,7 @@ function $parcel$interopDefault(a) {
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberField(props, ref) {
|
|
46
46
|
props = (0, $5I0aR$useProviderProps)(props);
|
|
47
47
|
props = (0, $5I0aR$useFormProps)(props);
|
|
48
48
|
let provider = (0, $5I0aR$useProvider)();
|
|
@@ -96,7 +96,7 @@ function $48b879bdd771eb85$var$NumberField(props, ref) {
|
|
|
96
96
|
state: state,
|
|
97
97
|
validationState: validationState
|
|
98
98
|
}));
|
|
99
|
-
}
|
|
99
|
+
});
|
|
100
100
|
const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberFieldInput(props, ref) {
|
|
101
101
|
let { groupProps: groupProps, inputProps: inputProps, inputRef: inputRef, incrementProps: incrementProps, decrementProps: decrementProps, className: className, style: style, autoFocus: autoFocus, isQuiet: isQuiet, isDisabled: isDisabled, hideStepper: hideStepper, validationState: validationState, name: name, state: state } = props;
|
|
102
102
|
let showStepper = !hideStepper;
|
|
@@ -135,9 +135,6 @@ const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).f
|
|
|
135
135
|
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
136
136
|
})));
|
|
137
137
|
});
|
|
138
|
-
/**
|
|
139
|
-
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
140
|
-
*/ let $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef($48b879bdd771eb85$var$NumberField);
|
|
141
138
|
|
|
142
139
|
|
|
143
140
|
export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuBM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAA8B;IAC9H,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,WAAW,CAAA,GAAA,kBAAU;IACzB,IAAI,WACF,OAAO,cACP,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG;IAEJ,IAAI,EAAC,YAAY,KAAK,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAExC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;QAAC,GAAG,KAAK;gBAAE;IAAM;IACjD,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAe,KAAK;IAC/C,IAAI,cACF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BACd,cAAc,aACd,SAAS,SACT,KAAK,aACL,SAAS,WACT,OAAO,cACP,UAAU,eACV,WAAW,mBACX,eAAe,QACf,IAAI,SACJ,KAAK,EACN,GAAG;IACJ,IAAI,cAAc,CAAC;IAEnB,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QACP,QAAA;QACA,aAAA;QACA,YAAY,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG;QACrC,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG;QACzC,WAAW;qBACX,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,OAAO;QACP,WAAW;qBACX,gCAAC,CAAA,GAAA,oBAAY;QACX,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAW,GACX;QAGJ,gBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAW,GACX;QAGJ,yBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAW,GACX;QAGJ,SAAS;QACT,UAAU;QACV,iBAAiB;QACjB,YAAY;QACZ,YAAY;QACZ,kBAAA;QACD,6BACD,gFACE,gCAAC,CAAA,GAAA,yCAAS;QAAE,WAAU;QAAK,SAAS;QAAU,GAAG,cAAc;sBAC/D,gCAAC,CAAA,GAAA,yCAAS;QAAE,WAAU;QAAO,SAAS;QAAU,GAAG,cAAc;SAGlE,sBAAQ,gCAAC;QAAM,MAAK;QAAS,MAAM;QAAM,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAI1G","sources":["packages/@react-spectrum/numberfield/src/NumberField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef, RefObject} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {NumberFieldState, useNumberFieldState} from '@react-stately/numberfield';\nimport React, {HTMLAttributes, InputHTMLAttributes, Ref, useRef} from 'react';\nimport {SpectrumNumberFieldProps} from '@react-types/numberfield';\nimport {StepButton} from './StepButton';\nimport stepperStyle from '@adobe/spectrum-css-temp/components/stepper/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useNumberField} from '@react-aria/numberfield';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport const NumberField = React.forwardRef(function NumberField(props: SpectrumNumberFieldProps, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let provider = useProvider();\n let {\n isQuiet,\n isReadOnly,\n isDisabled,\n hideStepper\n } = props;\n\n let {styleProps: style} = useStyleProps(props);\n\n let {locale} = useLocale();\n let state = useNumberFieldState({...props, locale});\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef<HTMLElement>(ref, inputRef);\n let {\n groupProps,\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useNumberField(props, state, inputRef);\n let isMobile = provider.scale === 'large';\n let showStepper = !hideStepper;\n\n let {isHovered, hoverProps} = useHover({isDisabled});\n\n let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);\n let className =\n classNames(\n stepperStyle,\n 'spectrum-Stepper',\n // because FocusRing won't pass along the className from Field, we have to handle that ourselves\n !props.label && style.className ? style.className : '',\n {\n 'spectrum-Stepper--isQuiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-Stepper--readonly': isReadOnly,\n 'is-invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Stepper--showStepper': showStepper,\n 'spectrum-Stepper--isMobile': isMobile,\n 'is-hovered': isHovered\n }\n );\n\n return (\n <Field\n {...props as Omit<SpectrumNumberFieldProps, 'onChange'>}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}\n wrapperClassName={classNames(\n stepperStyle,\n 'spectrum-Stepper-container',\n {\n 'spectrum-Stepper-container--isMobile': isMobile\n }\n )}>\n <NumberFieldInput\n {...props}\n groupProps={mergeProps(groupProps, hoverProps)}\n inputProps={inputProps}\n inputRef={inputRef}\n incrementProps={incrementButtonProps}\n decrementProps={decrementButtonProps}\n className={className}\n style={style}\n state={state}\n validationState={validationState} />\n </Field>\n );\n});\n\n\ninterface NumberFieldInputProps extends SpectrumNumberFieldProps {\n groupProps: HTMLAttributes<HTMLDivElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n incrementProps: AriaButtonProps,\n decrementProps: AriaButtonProps,\n className?: string,\n style?: React.CSSProperties,\n state: NumberFieldState\n}\n\nconst NumberFieldInput = React.forwardRef(function NumberFieldInput(props: NumberFieldInputProps, ref: Ref<HTMLDivElement>) {\n let {\n groupProps,\n inputProps,\n inputRef,\n incrementProps,\n decrementProps,\n className,\n style,\n autoFocus,\n isQuiet,\n isDisabled,\n hideStepper,\n validationState,\n name,\n state\n } = props;\n let showStepper = !hideStepper;\n\n return (\n <FocusRing\n within\n isTextInput\n focusClass={classNames(stepperStyle, 'is-focused')}\n focusRingClass={classNames(stepperStyle, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...groupProps}\n ref={ref}\n style={style}\n className={className}>\n <TextFieldBase\n UNSAFE_className={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-field'\n )\n }\n inputClassName={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-input'\n )\n }\n validationIconClassName={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-icon'\n )\n }\n isQuiet={isQuiet}\n inputRef={inputRef}\n validationState={validationState}\n inputProps={inputProps}\n isDisabled={isDisabled}\n disableFocusRing />\n {showStepper &&\n <>\n <StepButton direction=\"up\" isQuiet={isQuiet} {...incrementProps} />\n <StepButton direction=\"down\" isQuiet={isQuiet} {...decrementProps} />\n </>\n }\n {name && <input type=\"hidden\" name={name} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </div>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.module.js.map"}
|
package/dist/StepButton.main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./vars.
|
|
1
|
+
require("./vars.8d25eb32.css");
|
|
2
2
|
var $3649bcbba015c4d7$exports = require("./stepper_vars_css.main.js");
|
|
3
3
|
var $3rHYV$spectrumiconsworkflowAdd = require("@spectrum-icons/workflow/Add");
|
|
4
4
|
var $3rHYV$spectrumiconsuiChevronDownSmall = require("@spectrum-icons/ui/ChevronDownSmall");
|
|
@@ -44,7 +44,7 @@ $parcel$export(module.exports, "StepButton", () => $2f3cded204daae76$export$b2f6
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
const $2f3cded204daae76$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).forwardRef(function StepButton(props, ref) {
|
|
48
48
|
props = (0, $3rHYV$reactspectrumprovider.useProviderProps)(props);
|
|
49
49
|
let { scale: scale } = (0, $3rHYV$reactspectrumprovider.useProvider)();
|
|
50
50
|
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
@@ -81,10 +81,7 @@ function $2f3cded204daae76$var$StepButton(props, ref) {
|
|
|
81
81
|
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, ($parcel$interopDefault($3rHYV$spectrumiconsuiChevronDownSmall))), {
|
|
82
82
|
UNSAFE_className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
83
83
|
})));
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Buttons for NumberField.
|
|
87
|
-
*/ let $2f3cded204daae76$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).forwardRef($2f3cded204daae76$var$StepButton);
|
|
84
|
+
});
|
|
88
85
|
|
|
89
86
|
|
|
90
87
|
//# sourceMappingURL=StepButton.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAyBM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAAsB,EAAE,GAAiC;IACtH,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,wCAAU;IACxB,IAAI,aAAC,SAAS,cAAE,UAAU,WAAE,OAAO,EAAC,GAAG;IACvC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B;;;GAGC,GACD,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAK,GAAG;IACzE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;IACvC,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;qBAClD,0DAAC;QACC,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX,2BACA;YACE,mCAAmC,cAAc;YACjD,qCAAqC,cAAc;YACnD,oCAAoC;YACpC,cAAc;YACd,aAAa;YACb,eAAe;QACjB;QAGH,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,YAAY;QACvC,KAAK;OACJ,cAAc,QAAQ,UAAU,yBAC/B,0DAAC,CAAA,GAAA,yDAAE;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG,gCAAgC;QAAgC,MAAK;QAEtH,cAAc,QAAQ,UAAU,0BAC/B,0DAAC,CAAA,GAAA,8DAAa;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG,gCAAgC;QAE5F,cAAc,UAAU,UAAU,yBACjC,0DAAC,CAAA,GAAA,4DAAK;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG,gCAAgC;QAAkC,MAAK;QAE3H,cAAc,UAAU,UAAU,0BACjC,0DAAC,CAAA,GAAA,gEAAe;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG,gCAAgC;;AAKvG","sources":["packages/@react-spectrum/numberfield/src/StepButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Add from '@spectrum-icons/workflow/Add';\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownSmall from '@spectrum-icons/ui/ChevronDownSmall';\nimport ChevronUpSmall from '@spectrum-icons/ui/ChevronUpSmall';\nimport {classNames, useFocusableRef} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport Remove from '@spectrum-icons/workflow/Remove';\nimport stepperStyle from '@adobe/spectrum-css-temp/components/stepper/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\ninterface StepButtonProps extends AriaButtonProps {\n isQuiet?: boolean,\n direction: 'up' | 'down'\n}\n\n/**\n * Buttons for NumberField.\n */\nexport const StepButton = React.forwardRef(function StepButton(props: StepButtonProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {scale} = useProvider();\n let {direction, isDisabled, isQuiet} = props;\n let domRef = useFocusableRef(ref);\n /**\n * Must use div for now because Safari pointer event bugs on disabled form elements.\n * Link https://bugs.webkit.org/show_bug.cgi?id=219188.\n */\n let {buttonProps, isPressed} = useButton({...props, elementType: 'div'}, domRef);\n let {hoverProps, isHovered} = useHover(props);\n return (\n <FocusRing focusRingClass={classNames(stepperStyle, 'focus-ring')}>\n <div\n className={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-button',\n {\n 'spectrum-Stepper-button--stepUp': direction === 'up',\n 'spectrum-Stepper-button--stepDown': direction === 'down',\n 'spectrum-Stepper-button--isQuiet': isQuiet,\n 'is-hovered': isHovered,\n 'is-active': isPressed,\n 'is-disabled': isDisabled\n }\n )\n }\n {...mergeProps(hoverProps, buttonProps)}\n ref={domRef}>\n {direction === 'up' && scale === 'large' &&\n <Add UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')} size=\"S\" />\n }\n {direction === 'up' && scale === 'medium' &&\n <ChevronUpSmall UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')} />\n }\n {direction === 'down' && scale === 'large' &&\n <Remove UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')} size=\"S\" />\n }\n {direction === 'down' && scale === 'medium' &&\n <ChevronDownSmall UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')} />\n }\n </div>\n </FocusRing>\n );\n}) as (props: StepButtonProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"StepButton.main.js.map"}
|
package/dist/StepButton.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./vars.
|
|
1
|
+
import "./vars.8d25eb32.css";
|
|
2
2
|
import $3dAkq$stepper_vars_cssmodulejs from "./stepper_vars_css.mjs";
|
|
3
3
|
import $3dAkq$spectrumiconsworkflowAdd from "@spectrum-icons/workflow/Add";
|
|
4
4
|
import $3dAkq$spectrumiconsuiChevronDownSmall from "@spectrum-icons/ui/ChevronDownSmall";
|
|
@@ -38,7 +38,7 @@ function $parcel$interopDefault(a) {
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef(function StepButton(props, ref) {
|
|
42
42
|
props = (0, $3dAkq$useProviderProps)(props);
|
|
43
43
|
let { scale: scale } = (0, $3dAkq$useProvider)();
|
|
44
44
|
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
@@ -75,10 +75,7 @@ function $7f00b388e0d3b2f6$var$StepButton(props, ref) {
|
|
|
75
75
|
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronDownSmall), {
|
|
76
76
|
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
77
77
|
})));
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Buttons for NumberField.
|
|
81
|
-
*/ let $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef($7f00b388e0d3b2f6$var$StepButton);
|
|
78
|
+
});
|
|
82
79
|
|
|
83
80
|
|
|
84
81
|
export {$7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa as StepButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./vars.
|
|
1
|
+
import "./vars.8d25eb32.css";
|
|
2
2
|
import $3dAkq$stepper_vars_cssmodulejs from "./stepper_vars_css.module.js";
|
|
3
3
|
import $3dAkq$spectrumiconsworkflowAdd from "@spectrum-icons/workflow/Add";
|
|
4
4
|
import $3dAkq$spectrumiconsuiChevronDownSmall from "@spectrum-icons/ui/ChevronDownSmall";
|
|
@@ -38,7 +38,7 @@ function $parcel$interopDefault(a) {
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef(function StepButton(props, ref) {
|
|
42
42
|
props = (0, $3dAkq$useProviderProps)(props);
|
|
43
43
|
let { scale: scale } = (0, $3dAkq$useProvider)();
|
|
44
44
|
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
@@ -75,10 +75,7 @@ function $7f00b388e0d3b2f6$var$StepButton(props, ref) {
|
|
|
75
75
|
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronDownSmall), {
|
|
76
76
|
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
77
77
|
})));
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Buttons for NumberField.
|
|
81
|
-
*/ let $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef($7f00b388e0d3b2f6$var$StepButton);
|
|
78
|
+
});
|
|
82
79
|
|
|
83
80
|
|
|
84
81
|
export {$7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa as StepButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAyBM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAAsB,EAAE,GAAiC;IACtH,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,IAAI,aAAC,SAAS,cAAE,UAAU,WAAE,OAAO,EAAC,GAAG;IACvC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B;;;GAGC,GACD,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,GAAG,KAAK;QAAE,aAAa;IAAK,GAAG;IACzE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG;qBAClD,gCAAC;QACC,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAW,GACX,2BACA;YACE,mCAAmC,cAAc;YACjD,qCAAqC,cAAc;YACnD,oCAAoC;YACpC,cAAc;YACd,aAAa;YACb,eAAe;QACjB;QAGH,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY;QACvC,KAAK;OACJ,cAAc,QAAQ,UAAU,yBAC/B,gCAAC,CAAA,GAAA,+BAAE;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG,gCAAgC;QAAgC,MAAK;QAEtH,cAAc,QAAQ,UAAU,0BAC/B,gCAAC,CAAA,GAAA,oCAAa;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG,gCAAgC;QAE5F,cAAc,UAAU,UAAU,yBACjC,gCAAC,CAAA,GAAA,kCAAK;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG,gCAAgC;QAAkC,MAAK;QAE3H,cAAc,UAAU,UAAU,0BACjC,gCAAC,CAAA,GAAA,sCAAe;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yDAAW,GAAG,gCAAgC;;AAKvG","sources":["packages/@react-spectrum/numberfield/src/StepButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Add from '@spectrum-icons/workflow/Add';\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownSmall from '@spectrum-icons/ui/ChevronDownSmall';\nimport ChevronUpSmall from '@spectrum-icons/ui/ChevronUpSmall';\nimport {classNames, useFocusableRef} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport Remove from '@spectrum-icons/workflow/Remove';\nimport stepperStyle from '@adobe/spectrum-css-temp/components/stepper/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\ninterface StepButtonProps extends AriaButtonProps {\n isQuiet?: boolean,\n direction: 'up' | 'down'\n}\n\n/**\n * Buttons for NumberField.\n */\nexport const StepButton = React.forwardRef(function StepButton(props: StepButtonProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {scale} = useProvider();\n let {direction, isDisabled, isQuiet} = props;\n let domRef = useFocusableRef(ref);\n /**\n * Must use div for now because Safari pointer event bugs on disabled form elements.\n * Link https://bugs.webkit.org/show_bug.cgi?id=219188.\n */\n let {buttonProps, isPressed} = useButton({...props, elementType: 'div'}, domRef);\n let {hoverProps, isHovered} = useHover(props);\n return (\n <FocusRing focusRingClass={classNames(stepperStyle, 'focus-ring')}>\n <div\n className={\n classNames(\n stepperStyle,\n 'spectrum-Stepper-button',\n {\n 'spectrum-Stepper-button--stepUp': direction === 'up',\n 'spectrum-Stepper-button--stepDown': direction === 'down',\n 'spectrum-Stepper-button--isQuiet': isQuiet,\n 'is-hovered': isHovered,\n 'is-active': isPressed,\n 'is-disabled': isDisabled\n }\n )\n }\n {...mergeProps(hoverProps, buttonProps)}\n ref={domRef}>\n {direction === 'up' && scale === 'large' &&\n <Add UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')} size=\"S\" />\n }\n {direction === 'up' && scale === 'medium' &&\n <ChevronUpSmall UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')} />\n }\n {direction === 'down' && scale === 'large' &&\n <Remove UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')} size=\"S\" />\n }\n {direction === 'down' && scale === 'medium' &&\n <ChevronDownSmall UNSAFE_className={classNames(stepperStyle, 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')} />\n }\n </div>\n </FocusRing>\n );\n}) as (props: StepButtonProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"StepButton.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5CA,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAAgC,CAAC,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AC1E,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/stepper/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"stepper_vars_css.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5CA,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA8B,CAAC,gBAAgB,C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AyD,CAAC,2CAA2C,CAAC;AACtG,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/stepper/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"stepper_vars_css.module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { FocusableRefValue } from "@react-types/shared";
|
|
|
4
4
|
/**
|
|
5
5
|
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export const NumberField: React.ForwardRefExoticComponent<SpectrumNumberFieldProps & React.RefAttributes<FocusableRefValue<HTMLElement, HTMLElement>>>;
|
|
8
8
|
export type { SpectrumNumberFieldProps } from '@react-types/numberfield';
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
1
|
+
{"mappings":";;;AC8BA;;GAEG;AACH,OAAO,MAAM,yIAkFX,CAAC;ACpGH,YAAY,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC","sources":["packages/@react-spectrum/numberfield/src/packages/@react-spectrum/numberfield/src/StepButton.tsx","packages/@react-spectrum/numberfield/src/packages/@react-spectrum/numberfield/src/NumberField.tsx","packages/@react-spectrum/numberfield/src/packages/@react-spectrum/numberfield/src/index.ts","packages/@react-spectrum/numberfield/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {NumberField} from './NumberField';\nexport type {SpectrumNumberFieldProps} from '@react-types/numberfield';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
|
@@ -130,23 +130,23 @@ button.WWhV7q_spectrum-BaseButton {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.WWhV7q_spectrum-BaseButton .WWhV7q_spectrum-Icon {
|
|
133
|
+
max-block-size: 100%;
|
|
133
134
|
transition: background var(--spectrum-global-animation-duration-100, .13s) ease-out, fill var(--spectrum-global-animation-duration-100, .13s) ease-out;
|
|
134
135
|
box-sizing: initial;
|
|
135
136
|
flex-shrink: 0;
|
|
136
137
|
order: 0;
|
|
137
|
-
max-block-size: 100%;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.WWhV7q_spectrum-Button {
|
|
141
141
|
--spectrum-button-border-radius: var(--spectrum-button-primary-border-radius, var(--spectrum-alias-border-radius-large));
|
|
142
142
|
--spectrum-button-border-width: var(--spectrum-button-primary-border-size, var(--spectrum-alias-border-size-thick));
|
|
143
143
|
min-block-size: var(--spectrum-button-primary-height, var(--spectrum-alias-single-line-height));
|
|
144
|
+
block-size: 0%;
|
|
144
145
|
min-inline-size: var(--spectrum-button-primary-min-width);
|
|
145
146
|
padding: var(--spectrum-global-dimension-size-50) calc(var(--spectrum-button-primary-padding-x, var(--spectrum-global-dimension-size-200)) - var(--spectrum-button-primary-border-size, var(--spectrum-alias-border-size-thick)));
|
|
146
147
|
font-size: var(--spectrum-button-primary-text-size, var(--spectrum-alias-pill-button-text-size));
|
|
147
148
|
font-weight: var(--spectrum-button-primary-text-font-weight, var(--spectrum-global-font-weight-bold));
|
|
148
149
|
border-style: solid;
|
|
149
|
-
block-size: 0%;
|
|
150
150
|
padding-block-start: calc(var(--spectrum-global-dimension-size-50) - 1px);
|
|
151
151
|
padding-block-end: calc(var(--spectrum-global-dimension-size-50) + 1px);
|
|
152
152
|
}
|
|
@@ -357,9 +357,9 @@ a.WWhV7q_spectrum-Button, a.WWhV7q_spectrum-ActionButton {
|
|
|
357
357
|
|
|
358
358
|
.WWhV7q_spectrum-Stepper {
|
|
359
359
|
--spectrum-stepper-width: calc(var(--spectrum-alias-single-line-height, var(--spectrum-global-dimension-size-400)) * 4);
|
|
360
|
+
block-size: max-content;
|
|
360
361
|
inline-size: var(--spectrum-stepper-width);
|
|
361
362
|
transition: border-color var(--spectrum-global-animation-duration-100, .13s) ease-in-out, box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
|
|
362
|
-
block-size: max-content;
|
|
363
363
|
line-height: 0;
|
|
364
364
|
display: inline-grid;
|
|
365
365
|
position: relative;
|
|
@@ -628,10 +628,10 @@ a.WWhV7q_spectrum-Button, a.WWhV7q_spectrum-ActionButton {
|
|
|
628
628
|
}
|
|
629
629
|
|
|
630
630
|
.WWhV7q_spectrum-Stepper-button .WWhV7q_spectrum-Stepper-button-icon {
|
|
631
|
+
max-block-size: 100%;
|
|
631
632
|
transition: background var(--spectrum-global-animation-duration-100, .13s) ease-out, fill var(--spectrum-global-animation-duration-100, .13s) ease-out;
|
|
632
633
|
box-sizing: initial;
|
|
633
634
|
flex-shrink: 0;
|
|
634
|
-
max-block-size: 100%;
|
|
635
635
|
}
|
|
636
636
|
|
|
637
637
|
.WWhV7q_spectrum-Stepper .WWhV7q_spectrum-Stepper-button-icon {
|
|
@@ -837,4 +837,4 @@ a.WWhV7q_spectrum-Button, a.WWhV7q_spectrum-ActionButton {
|
|
|
837
837
|
border-color: var(--spectrum-textfield-quiet-border-color-key-focus, var(--spectrum-alias-border-color-focus));
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
/*# sourceMappingURL=vars.
|
|
840
|
+
/*# sourceMappingURL=vars.8d25eb32.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAkBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BE;;;;AA2BA;;;;AAGA;;;;AAKA;;;;;;AAYA;;;;AAKA;;;;;;;;AAWF;;;;;;;;;;;;;;AAoBE;;;;AAMA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;;;;;AAWE;;;;AAOJ;;;;;;;AASA;;;;;;;;;;;AAiBE;;;;AAKA;;;;AAKA;;;;AAIA;;;;AAKA;;;;AAMA;;;;AAKA;;;;AAKF;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMA;;;;AAIA;;;;;;;AAYE;;;;AAKF;;;;;;AAMA;;;;;;;AAQA;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;AAkCE;;;;;AAMA;;;;AAKF;;;;;;;;AAWI;;;;AAMJ;;;;;;;;;;AAcE;;;;;AAOF;EAEI;;;;;AAOJ;;;;;AAKA;;;;;;;;;;AAkBE;;;;;;AAME;;;;;AAIA;;;;;AAKF;;;;;;AAUA;;;;;;AAMA;;;;AAIA;;;;AAGA;;;;AAIA;;;;AAEE;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOI;;;;;AASA;;;;;AAUA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAIA;;;;;;AAKA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMA;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOA;;;;AAGA;;;;;AAIA;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAOA;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAWJ;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOI;;;;;AAIA;;;;AAOA;;;;;;AAYA;;;;;AAIA;;;;AAOA;;;;;;AAoBN;;;;AAKA;;;;AAKF;;;;AAKE;;;;AAKA;;;;;;;AAoEA;;;;AAKE;;;;AAGA;;;;;;AAME;;;;AAQA;;;;AAgBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAOA;;;;AAWJ;;;;AAGA;;;;;;AAME;;;;AAQA;;;;AAwBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAOA;;;;AAiBJ;;;;AAIE;;;;AAKF;;;;AAGE;;;;AAKF;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAOA;;;;;AAKA;;;;AAIA;;;;AAQA;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAQR;EACE;;;;;;;;;;;;;;EAaI;;;;EAME;;;;EAMF;;;;;EAME;;;;;EANF;;;;;EAME;;;;;EAAA;;;;;EANF;;;;;EAME;;;;;EAWA","sources":["packages/@adobe/spectrum-css-temp/components/stepper/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.
|
|
1
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A;;;;AAAA;;;;AAOI;;;;;AAIA;;;;AAOA;;;;;;AAYA;;;;;AAIA;;;;AAOA;;;;;;AAoBN;;;;AAKA;;;;AAKF;;;;AAKE;;;;AAKA;;;;;;;AAoEA;;;;AAKE;;;;AAGA;;;;;;AAME;;;;AAQA;;;;AAgBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAOA;;;;AAWJ;;;;AAGA;;;;;;AAME;;;;AAQA;;;;AAwBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAOA;;;;AAiBJ;;;;AAIE;;;;AAKF;;;;AAGE;;;;AAKF;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAOA;;;;;AAKA;;;;AAIA;;;;AAQA;;;;AAIE;;;;AAJF;;;;AAIE;;;;AAQR;EACE;;;;;;;;;;;;;;EAaI;;;;EAME;;;;EAMF;;;;;EAME;;;;;EANF;;;;;EAME;;;;;EAAA;;;;;EANF;;;;;EAME;;;;;EAWA","sources":["packages/@adobe/spectrum-css-temp/components/stepper/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.8d25eb32.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/numberfield",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.9",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/button": "^3.
|
|
40
|
-
"@react-aria/focus": "^3.
|
|
41
|
-
"@react-aria/i18n": "^3.12.
|
|
42
|
-
"@react-aria/interactions": "^3.
|
|
43
|
-
"@react-aria/numberfield": "^3.11.
|
|
44
|
-
"@react-aria/utils": "^3.
|
|
45
|
-
"@react-spectrum/form": "^3.7.
|
|
46
|
-
"@react-spectrum/label": "^3.16.
|
|
47
|
-
"@react-spectrum/textfield": "^3.12.
|
|
48
|
-
"@react-spectrum/utils": "^3.
|
|
49
|
-
"@react-stately/numberfield": "^3.9.
|
|
50
|
-
"@react-types/button": "^3.10.
|
|
51
|
-
"@react-types/numberfield": "^3.8.
|
|
52
|
-
"@react-types/shared": "^3.
|
|
53
|
-
"@spectrum-icons/ui": "^3.6.
|
|
54
|
-
"@spectrum-icons/workflow": "^4.2.
|
|
39
|
+
"@react-aria/button": "^3.11.1",
|
|
40
|
+
"@react-aria/focus": "^3.19.1",
|
|
41
|
+
"@react-aria/i18n": "^3.12.5",
|
|
42
|
+
"@react-aria/interactions": "^3.23.0",
|
|
43
|
+
"@react-aria/numberfield": "^3.11.10",
|
|
44
|
+
"@react-aria/utils": "^3.27.0",
|
|
45
|
+
"@react-spectrum/form": "^3.7.11",
|
|
46
|
+
"@react-spectrum/label": "^3.16.11",
|
|
47
|
+
"@react-spectrum/textfield": "^3.12.8",
|
|
48
|
+
"@react-spectrum/utils": "^3.12.1",
|
|
49
|
+
"@react-stately/numberfield": "^3.9.9",
|
|
50
|
+
"@react-types/button": "^3.10.2",
|
|
51
|
+
"@react-types/numberfield": "^3.8.8",
|
|
52
|
+
"@react-types/shared": "^3.27.0",
|
|
53
|
+
"@spectrum-icons/ui": "^3.6.12",
|
|
54
|
+
"@spectrum-icons/workflow": "^4.2.17",
|
|
55
55
|
"@swc/helpers": "^0.5.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@react-spectrum/provider": "^3.0.0",
|
|
63
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
64
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
63
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
64
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
|
|
70
70
|
}
|
package/src/NumberField.tsx
CHANGED
|
@@ -28,7 +28,10 @@ import {useLocale} from '@react-aria/i18n';
|
|
|
28
28
|
import {useNumberField} from '@react-aria/numberfield';
|
|
29
29
|
import {useProvider, useProviderProps} from '@react-spectrum/provider';
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
33
|
+
*/
|
|
34
|
+
export const NumberField = React.forwardRef(function NumberField(props: SpectrumNumberFieldProps, ref: FocusableRef<HTMLElement>) {
|
|
32
35
|
props = useProviderProps(props);
|
|
33
36
|
props = useFormProps(props);
|
|
34
37
|
let provider = useProvider();
|
|
@@ -110,7 +113,7 @@ function NumberField(props: SpectrumNumberFieldProps, ref: FocusableRef<HTMLElem
|
|
|
110
113
|
validationState={validationState} />
|
|
111
114
|
</Field>
|
|
112
115
|
);
|
|
113
|
-
}
|
|
116
|
+
});
|
|
114
117
|
|
|
115
118
|
|
|
116
119
|
interface NumberFieldInputProps extends SpectrumNumberFieldProps {
|
|
@@ -191,9 +194,3 @@ const NumberFieldInput = React.forwardRef(function NumberFieldInput(props: Numbe
|
|
|
191
194
|
</FocusRing>
|
|
192
195
|
);
|
|
193
196
|
});
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* NumberFields allow users to enter a number, and increment or decrement the value using stepper buttons.
|
|
197
|
-
*/
|
|
198
|
-
let _NumberField = React.forwardRef(NumberField);
|
|
199
|
-
export {_NumberField as NumberField};
|
package/src/StepButton.tsx
CHANGED
|
@@ -30,7 +30,10 @@ interface StepButtonProps extends AriaButtonProps {
|
|
|
30
30
|
direction: 'up' | 'down'
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Buttons for NumberField.
|
|
35
|
+
*/
|
|
36
|
+
export const StepButton = React.forwardRef(function StepButton(props: StepButtonProps, ref: FocusableRef<HTMLDivElement>) {
|
|
34
37
|
props = useProviderProps(props);
|
|
35
38
|
let {scale} = useProvider();
|
|
36
39
|
let {direction, isDisabled, isQuiet} = props;
|
|
@@ -75,10 +78,4 @@ function StepButton(props: StepButtonProps, ref: FocusableRef<HTMLDivElement>) {
|
|
|
75
78
|
</div>
|
|
76
79
|
</FocusRing>
|
|
77
80
|
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Buttons for NumberField.
|
|
82
|
-
*/
|
|
83
|
-
let _StepButton = React.forwardRef(StepButton) as (props: StepButtonProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;
|
|
84
|
-
export {_StepButton as StepButton};
|
|
81
|
+
}) as (props: StepButtonProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;
|