@react-spectrum/numberfield 3.10.4 → 3.11.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 +2 -2
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +12 -41
- package/src/index.ts +3 -2
- package/dist/NumberField.main.js +0 -147
- package/dist/NumberField.main.js.map +0 -1
- package/dist/NumberField.mjs +0 -142
- package/dist/NumberField.module.js +0 -142
- package/dist/NumberField.module.js.map +0 -1
- package/dist/StepButton.main.js +0 -87
- package/dist/StepButton.main.js.map +0 -1
- package/dist/StepButton.mjs +0 -82
- package/dist/StepButton.module.js +0 -82
- package/dist/StepButton.module.js.map +0 -1
- package/dist/numberfield.df6f415e.css +0 -864
- package/dist/numberfield.df6f415e.css.map +0 -1
- package/dist/stepper_vars_css.main.js +0 -146
- package/dist/stepper_vars_css.main.js.map +0 -1
- package/dist/stepper_vars_css.mjs +0 -148
- package/dist/stepper_vars_css.module.js +0 -148
- package/dist/stepper_vars_css.module.js.map +0 -1
- package/dist/types.d.ts +0 -10
- package/dist/types.d.ts.map +0 -1
- package/src/NumberField.tsx +0 -196
- package/src/StepButton.tsx +0 -81
package/dist/StepButton.main.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
require("./numberfield.df6f415e.css");
|
|
2
|
-
var $3649bcbba015c4d7$exports = require("./stepper_vars_css.main.js");
|
|
3
|
-
var $3rHYV$spectrumiconsworkflowAdd = require("@spectrum-icons/workflow/Add");
|
|
4
|
-
var $3rHYV$spectrumiconsuiChevronDownSmall = require("@spectrum-icons/ui/ChevronDownSmall");
|
|
5
|
-
var $3rHYV$spectrumiconsuiChevronUpSmall = require("@spectrum-icons/ui/ChevronUpSmall");
|
|
6
|
-
var $3rHYV$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
|
-
var $3rHYV$reactariafocus = require("@react-aria/focus");
|
|
8
|
-
var $3rHYV$reactariautils = require("@react-aria/utils");
|
|
9
|
-
var $3rHYV$react = require("react");
|
|
10
|
-
var $3rHYV$spectrumiconsworkflowRemove = require("@spectrum-icons/workflow/Remove");
|
|
11
|
-
var $3rHYV$reactariabutton = require("@react-aria/button");
|
|
12
|
-
var $3rHYV$reactariainteractions = require("@react-aria/interactions");
|
|
13
|
-
var $3rHYV$reactspectrumprovider = require("@react-spectrum/provider");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function $parcel$interopDefault(a) {
|
|
17
|
-
return a && a.__esModule ? a.default : a;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function $parcel$export(e, n, v, s) {
|
|
21
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
$parcel$export(module.exports, "StepButton", () => $2f3cded204daae76$export$b2f6b60c1d32d6aa);
|
|
25
|
-
/*
|
|
26
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
27
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
28
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
29
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
30
|
-
*
|
|
31
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
32
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
33
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
34
|
-
* governing permissions and limitations under the License.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const $2f3cded204daae76$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).forwardRef(function StepButton(props, ref) {
|
|
48
|
-
props = (0, $3rHYV$reactspectrumprovider.useProviderProps)(props);
|
|
49
|
-
let { scale: scale } = (0, $3rHYV$reactspectrumprovider.useProvider)();
|
|
50
|
-
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
51
|
-
let domRef = (0, $3rHYV$reactspectrumutils.useFocusableRef)(ref);
|
|
52
|
-
/**
|
|
53
|
-
* Must use div for now because Safari pointer event bugs on disabled form elements.
|
|
54
|
-
* Link https://bugs.webkit.org/show_bug.cgi?id=219188.
|
|
55
|
-
*/ let { buttonProps: buttonProps, isPressed: isPressed } = (0, $3rHYV$reactariabutton.useButton)({
|
|
56
|
-
...props,
|
|
57
|
-
elementType: 'div'
|
|
58
|
-
}, domRef);
|
|
59
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3rHYV$reactariainteractions.useHover)(props);
|
|
60
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, $3rHYV$reactariafocus.FocusRing), {
|
|
61
|
-
focusRingClass: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'focus-ring')
|
|
62
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement("div", {
|
|
63
|
-
className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button', {
|
|
64
|
-
'spectrum-Stepper-button--stepUp': direction === 'up',
|
|
65
|
-
'spectrum-Stepper-button--stepDown': direction === 'down',
|
|
66
|
-
'spectrum-Stepper-button--isQuiet': isQuiet,
|
|
67
|
-
'is-hovered': isHovered,
|
|
68
|
-
'is-active': isPressed,
|
|
69
|
-
'is-disabled': isDisabled
|
|
70
|
-
}),
|
|
71
|
-
...(0, $3rHYV$reactariautils.mergeProps)(hoverProps, buttonProps),
|
|
72
|
-
ref: domRef
|
|
73
|
-
}, direction === 'up' && scale === 'large' && /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, ($parcel$interopDefault($3rHYV$spectrumiconsworkflowAdd))), {
|
|
74
|
-
UNSAFE_className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon'),
|
|
75
|
-
size: "S"
|
|
76
|
-
}), direction === 'up' && scale === 'medium' && /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, ($parcel$interopDefault($3rHYV$spectrumiconsuiChevronUpSmall))), {
|
|
77
|
-
UNSAFE_className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')
|
|
78
|
-
}), direction === 'down' && scale === 'large' && /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, ($parcel$interopDefault($3rHYV$spectrumiconsworkflowRemove))), {
|
|
79
|
-
UNSAFE_className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon'),
|
|
80
|
-
size: "S"
|
|
81
|
-
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, ($parcel$interopDefault($3rHYV$react))).createElement((0, ($parcel$interopDefault($3rHYV$spectrumiconsuiChevronDownSmall))), {
|
|
82
|
-
UNSAFE_className: (0, $3rHYV$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
83
|
-
})));
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//# sourceMappingURL=StepButton.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA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CAAS,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
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import "./numberfield.df6f415e.css";
|
|
2
|
-
import $3dAkq$stepper_vars_cssmodulejs from "./stepper_vars_css.mjs";
|
|
3
|
-
import $3dAkq$spectrumiconsworkflowAdd from "@spectrum-icons/workflow/Add";
|
|
4
|
-
import $3dAkq$spectrumiconsuiChevronDownSmall from "@spectrum-icons/ui/ChevronDownSmall";
|
|
5
|
-
import $3dAkq$spectrumiconsuiChevronUpSmall from "@spectrum-icons/ui/ChevronUpSmall";
|
|
6
|
-
import {useFocusableRef as $3dAkq$useFocusableRef, classNames as $3dAkq$classNames} from "@react-spectrum/utils";
|
|
7
|
-
import {FocusRing as $3dAkq$FocusRing} from "@react-aria/focus";
|
|
8
|
-
import {mergeProps as $3dAkq$mergeProps} from "@react-aria/utils";
|
|
9
|
-
import $3dAkq$react from "react";
|
|
10
|
-
import $3dAkq$spectrumiconsworkflowRemove from "@spectrum-icons/workflow/Remove";
|
|
11
|
-
import {useButton as $3dAkq$useButton} from "@react-aria/button";
|
|
12
|
-
import {useHover as $3dAkq$useHover} from "@react-aria/interactions";
|
|
13
|
-
import {useProviderProps as $3dAkq$useProviderProps, useProvider as $3dAkq$useProvider} from "@react-spectrum/provider";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function $parcel$interopDefault(a) {
|
|
17
|
-
return a && a.__esModule ? a.default : a;
|
|
18
|
-
}
|
|
19
|
-
/*
|
|
20
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
-
* governing permissions and limitations under the License.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef(function StepButton(props, ref) {
|
|
42
|
-
props = (0, $3dAkq$useProviderProps)(props);
|
|
43
|
-
let { scale: scale } = (0, $3dAkq$useProvider)();
|
|
44
|
-
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
45
|
-
let domRef = (0, $3dAkq$useFocusableRef)(ref);
|
|
46
|
-
/**
|
|
47
|
-
* Must use div for now because Safari pointer event bugs on disabled form elements.
|
|
48
|
-
* Link https://bugs.webkit.org/show_bug.cgi?id=219188.
|
|
49
|
-
*/ let { buttonProps: buttonProps, isPressed: isPressed } = (0, $3dAkq$useButton)({
|
|
50
|
-
...props,
|
|
51
|
-
elementType: 'div'
|
|
52
|
-
}, domRef);
|
|
53
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3dAkq$useHover)(props);
|
|
54
|
-
return /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$FocusRing), {
|
|
55
|
-
focusRingClass: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'focus-ring')
|
|
56
|
-
}, /*#__PURE__*/ (0, $3dAkq$react).createElement("div", {
|
|
57
|
-
className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button', {
|
|
58
|
-
'spectrum-Stepper-button--stepUp': direction === 'up',
|
|
59
|
-
'spectrum-Stepper-button--stepDown': direction === 'down',
|
|
60
|
-
'spectrum-Stepper-button--isQuiet': isQuiet,
|
|
61
|
-
'is-hovered': isHovered,
|
|
62
|
-
'is-active': isPressed,
|
|
63
|
-
'is-disabled': isDisabled
|
|
64
|
-
}),
|
|
65
|
-
...(0, $3dAkq$mergeProps)(hoverProps, buttonProps),
|
|
66
|
-
ref: domRef
|
|
67
|
-
}, direction === 'up' && scale === 'large' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsworkflowAdd), {
|
|
68
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon'),
|
|
69
|
-
size: "S"
|
|
70
|
-
}), direction === 'up' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronUpSmall), {
|
|
71
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')
|
|
72
|
-
}), direction === 'down' && scale === 'large' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsworkflowRemove), {
|
|
73
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon'),
|
|
74
|
-
size: "S"
|
|
75
|
-
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronDownSmall), {
|
|
76
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
77
|
-
})));
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export {$7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa as StepButton};
|
|
82
|
-
//# sourceMappingURL=StepButton.module.js.map
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import "./numberfield.df6f415e.css";
|
|
2
|
-
import $3dAkq$stepper_vars_cssmodulejs from "./stepper_vars_css.module.js";
|
|
3
|
-
import $3dAkq$spectrumiconsworkflowAdd from "@spectrum-icons/workflow/Add";
|
|
4
|
-
import $3dAkq$spectrumiconsuiChevronDownSmall from "@spectrum-icons/ui/ChevronDownSmall";
|
|
5
|
-
import $3dAkq$spectrumiconsuiChevronUpSmall from "@spectrum-icons/ui/ChevronUpSmall";
|
|
6
|
-
import {useFocusableRef as $3dAkq$useFocusableRef, classNames as $3dAkq$classNames} from "@react-spectrum/utils";
|
|
7
|
-
import {FocusRing as $3dAkq$FocusRing} from "@react-aria/focus";
|
|
8
|
-
import {mergeProps as $3dAkq$mergeProps} from "@react-aria/utils";
|
|
9
|
-
import $3dAkq$react from "react";
|
|
10
|
-
import $3dAkq$spectrumiconsworkflowRemove from "@spectrum-icons/workflow/Remove";
|
|
11
|
-
import {useButton as $3dAkq$useButton} from "@react-aria/button";
|
|
12
|
-
import {useHover as $3dAkq$useHover} from "@react-aria/interactions";
|
|
13
|
-
import {useProviderProps as $3dAkq$useProviderProps, useProvider as $3dAkq$useProvider} from "@react-spectrum/provider";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function $parcel$interopDefault(a) {
|
|
17
|
-
return a && a.__esModule ? a.default : a;
|
|
18
|
-
}
|
|
19
|
-
/*
|
|
20
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
-
* governing permissions and limitations under the License.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa = /*#__PURE__*/ (0, $3dAkq$react).forwardRef(function StepButton(props, ref) {
|
|
42
|
-
props = (0, $3dAkq$useProviderProps)(props);
|
|
43
|
-
let { scale: scale } = (0, $3dAkq$useProvider)();
|
|
44
|
-
let { direction: direction, isDisabled: isDisabled, isQuiet: isQuiet } = props;
|
|
45
|
-
let domRef = (0, $3dAkq$useFocusableRef)(ref);
|
|
46
|
-
/**
|
|
47
|
-
* Must use div for now because Safari pointer event bugs on disabled form elements.
|
|
48
|
-
* Link https://bugs.webkit.org/show_bug.cgi?id=219188.
|
|
49
|
-
*/ let { buttonProps: buttonProps, isPressed: isPressed } = (0, $3dAkq$useButton)({
|
|
50
|
-
...props,
|
|
51
|
-
elementType: 'div'
|
|
52
|
-
}, domRef);
|
|
53
|
-
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3dAkq$useHover)(props);
|
|
54
|
-
return /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$FocusRing), {
|
|
55
|
-
focusRingClass: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'focus-ring')
|
|
56
|
-
}, /*#__PURE__*/ (0, $3dAkq$react).createElement("div", {
|
|
57
|
-
className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button', {
|
|
58
|
-
'spectrum-Stepper-button--stepUp': direction === 'up',
|
|
59
|
-
'spectrum-Stepper-button--stepDown': direction === 'down',
|
|
60
|
-
'spectrum-Stepper-button--isQuiet': isQuiet,
|
|
61
|
-
'is-hovered': isHovered,
|
|
62
|
-
'is-active': isPressed,
|
|
63
|
-
'is-disabled': isDisabled
|
|
64
|
-
}),
|
|
65
|
-
...(0, $3dAkq$mergeProps)(hoverProps, buttonProps),
|
|
66
|
-
ref: domRef
|
|
67
|
-
}, direction === 'up' && scale === 'large' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsworkflowAdd), {
|
|
68
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon'),
|
|
69
|
-
size: "S"
|
|
70
|
-
}), direction === 'up' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronUpSmall), {
|
|
71
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepUpIcon')
|
|
72
|
-
}), direction === 'down' && scale === 'large' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsworkflowRemove), {
|
|
73
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon'),
|
|
74
|
-
size: "S"
|
|
75
|
-
}), direction === 'down' && scale === 'medium' && /*#__PURE__*/ (0, $3dAkq$react).createElement((0, $3dAkq$spectrumiconsuiChevronDownSmall), {
|
|
76
|
-
UNSAFE_className: (0, $3dAkq$classNames)((0, ($parcel$interopDefault($3dAkq$stepper_vars_cssmodulejs))), 'spectrum-Stepper-button-icon', 'spectrum-Stepper-stepDownIcon')
|
|
77
|
-
})));
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export {$7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa as StepButton};
|
|
82
|
-
//# sourceMappingURL=StepButton.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAyBM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAAsB,EAAE,GAAiC;IACt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kB,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"}
|