@react-spectrum/numberfield 3.8.2 → 3.9.0
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/import.mjs +8 -10
- package/dist/main.css +1 -1104
- package/dist/main.js +8 -10
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -10
- package/dist/module.js.map +1 -1
- package/package.json +16 -16
- package/src/NumberField.tsx +8 -8
- package/src/StepButton.tsx +9 -7
- package/dist/main.css.map +0 -1
package/dist/import.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import "./main.css";
|
|
4
2
|
import {useStyleProps as $k6K00$useStyleProps, useFocusableRef as $k6K00$useFocusableRef, classNames as $k6K00$classNames} from "@react-spectrum/utils";
|
|
5
3
|
import {Field as $k6K00$Field} from "@react-spectrum/label";
|
|
@@ -215,13 +213,14 @@ function $7f00b388e0d3b2f6$var$StepButton(props, ref) {
|
|
|
215
213
|
props = (0, $k6K00$useProviderProps)(props);
|
|
216
214
|
let { scale: scale } = (0, $k6K00$useProvider)();
|
|
217
215
|
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
216
|
+
let domRef = (0, $k6K00$useFocusableRef)(ref);
|
|
218
217
|
/**
|
|
219
218
|
* Must use div for now because Safari pointer event bugs on disabled form elements.
|
|
220
219
|
* Link https://bugs.webkit.org/show_bug.cgi?id=219188.
|
|
221
220
|
*/ let { buttonProps: buttonProps, isPressed: isPressed } = (0, $k6K00$useButton)({
|
|
222
221
|
...props,
|
|
223
222
|
elementType: "div"
|
|
224
|
-
},
|
|
223
|
+
}, domRef);
|
|
225
224
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $k6K00$useHover)(props);
|
|
226
225
|
return /*#__PURE__*/ (0, $k6K00$react).createElement((0, $k6K00$FocusRing), {
|
|
227
226
|
focusRingClass: (0, $k6K00$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba58a329f3e1a776$exports))), "focus-ring")
|
|
@@ -235,7 +234,7 @@ function $7f00b388e0d3b2f6$var$StepButton(props, ref) {
|
|
|
235
234
|
"is-disabled": isDisabled
|
|
236
235
|
}),
|
|
237
236
|
...(0, $k6K00$mergeProps)(hoverProps, buttonProps),
|
|
238
|
-
ref:
|
|
237
|
+
ref: domRef
|
|
239
238
|
}, direction === "up" && scale === "large" && /*#__PURE__*/ (0, $k6K00$react).createElement((0, $k6K00$spectrumiconsworkflowAdd), {
|
|
240
239
|
UNSAFE_className: (0, $k6K00$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba58a329f3e1a776$exports))), "spectrum-Stepper-button-icon", "spectrum-Stepper-stepUpIcon"),
|
|
241
240
|
size: "S"
|
|
@@ -271,7 +270,7 @@ function $48b879bdd771eb85$var$NumberField(props, ref) {
|
|
|
271
270
|
...props,
|
|
272
271
|
locale: locale
|
|
273
272
|
});
|
|
274
|
-
let inputRef = (0, $k6K00$useRef)();
|
|
273
|
+
let inputRef = (0, $k6K00$useRef)(null);
|
|
275
274
|
let domRef = (0, $k6K00$useFocusableRef)(ref, inputRef);
|
|
276
275
|
let { groupProps: groupProps, labelProps: labelProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $k6K00$useNumberField)(props, state, inputRef);
|
|
277
276
|
let isMobile = provider.scale === "large";
|
|
@@ -279,17 +278,16 @@ function $48b879bdd771eb85$var$NumberField(props, ref) {
|
|
|
279
278
|
let { isHovered: isHovered, hoverProps: hoverProps } = (0, $k6K00$useHover)({
|
|
280
279
|
isDisabled: isDisabled
|
|
281
280
|
});
|
|
282
|
-
let validationState = props.validationState || (isInvalid ? "invalid" :
|
|
283
|
-
let className = (0, $k6K00$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba58a329f3e1a776$exports))), "spectrum-Stepper",
|
|
281
|
+
let validationState = props.validationState || (isInvalid ? "invalid" : undefined);
|
|
282
|
+
let className = (0, $k6K00$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ba58a329f3e1a776$exports))), "spectrum-Stepper", // because FocusRing won't pass along the className from Field, we have to handle that ourselves
|
|
283
|
+
!props.label && style.className ? style.className : "", {
|
|
284
284
|
"spectrum-Stepper--isQuiet": isQuiet,
|
|
285
285
|
"is-disabled": isDisabled,
|
|
286
286
|
"spectrum-Stepper--readonly": isReadOnly,
|
|
287
287
|
"is-invalid": validationState === "invalid" && !isDisabled,
|
|
288
288
|
"spectrum-Stepper--showStepper": showStepper,
|
|
289
289
|
"spectrum-Stepper--isMobile": isMobile,
|
|
290
|
-
"is-hovered": isHovered
|
|
291
|
-
// because FocusRing won't pass along the className from Field, we have to handle that ourselves
|
|
292
|
-
[style.className]: !props.label && style.className
|
|
290
|
+
"is-hovered": isHovered
|
|
293
291
|
});
|
|
294
292
|
return /*#__PURE__*/ (0, $k6K00$react).createElement((0, $k6K00$Field), {
|
|
295
293
|
...props,
|