@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 CHANGED
@@ -1,4 +1,4 @@
1
- import {NumberField as $48b879bdd771eb85$export$63c5fa0b2fdccd2e} from "./NumberField.mjs";
1
+ import {NumberField as $942d9a2bbeca1ebe$re_export$NumberField} from "@adobe/react-spectrum/NumberField";
2
2
 
3
3
  /*
4
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -14,5 +14,5 @@ import {NumberField as $48b879bdd771eb85$export$63c5fa0b2fdccd2e} from "./Number
14
14
 
15
15
 
16
16
 
17
- export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
17
+ export {$942d9a2bbeca1ebe$re_export$NumberField as NumberField};
18
18
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
- var $9b3df9c012d62e52$exports = require("./NumberField.main.js");
1
+ var $82RHo$adobereactspectrumNumberField = require("@adobe/react-spectrum/NumberField");
2
2
 
3
3
 
4
4
  function $parcel$export(e, n, v, s) {
5
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
6
  }
7
7
 
8
- $parcel$export(module.exports, "NumberField", () => $9b3df9c012d62e52$exports.NumberField);
8
+ $parcel$export(module.exports, "NumberField", function () { return $82RHo$adobereactspectrumNumberField.NumberField; });
9
9
  /*
10
10
  * Copyright 2020 Adobe. All rights reserved.
11
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/numberfield/src/index.ts"],"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/// <reference types=\"css-module-types\" />\n\nexport {NumberField} from './NumberField';\nexport type {SpectrumNumberFieldProps} from '@react-types/numberfield';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/numberfield/src/index.ts"],"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/// <reference types=\"css-module-types\" />\n\nexport {NumberField} from '@adobe/react-spectrum/NumberField';\n\nexport type {SpectrumNumberFieldProps} from '@adobe/react-spectrum/NumberField';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import {NumberField as $48b879bdd771eb85$export$63c5fa0b2fdccd2e} from "./NumberField.module.js";
1
+ import {NumberField as $942d9a2bbeca1ebe$re_export$NumberField} from "@adobe/react-spectrum/NumberField";
2
2
 
3
3
  /*
4
4
  * Copyright 2020 Adobe. All rights reserved.
@@ -14,5 +14,5 @@ import {NumberField as $48b879bdd771eb85$export$63c5fa0b2fdccd2e} from "./Number
14
14
 
15
15
 
16
16
 
17
- export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
17
+ export {$942d9a2bbeca1ebe$re_export$NumberField as NumberField};
18
18
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/numberfield/src/index.ts"],"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/// <reference types=\"css-module-types\" />\n\nexport {NumberField} from './NumberField';\nexport type {SpectrumNumberFieldProps} from '@react-types/numberfield';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/numberfield/src/index.ts"],"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/// <reference types=\"css-module-types\" />\n\nexport {NumberField} from '@adobe/react-spectrum/NumberField';\n\nexport type {SpectrumNumberFieldProps} from '@adobe/react-spectrum/NumberField';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,2 @@
1
+ export { NumberField } from '@adobe/react-spectrum/NumberField';
2
+ export type { SpectrumNumberFieldProps } from '@adobe/react-spectrum/NumberField';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/numberfield",
3
- "version": "3.10.4",
3
+ "version": "3.11.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,51 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/button": "^3.14.4",
44
- "@react-aria/focus": "^3.21.4",
45
- "@react-aria/i18n": "^3.12.15",
46
- "@react-aria/interactions": "^3.27.0",
47
- "@react-aria/numberfield": "^3.12.4",
48
- "@react-aria/utils": "^3.33.0",
49
- "@react-spectrum/form": "^3.7.21",
50
- "@react-spectrum/label": "^3.16.21",
51
- "@react-spectrum/textfield": "^3.14.4",
52
- "@react-spectrum/utils": "^3.12.11",
53
- "@react-stately/numberfield": "^3.10.4",
54
- "@react-types/button": "^3.15.0",
55
- "@react-types/numberfield": "^3.8.17",
56
- "@react-types/shared": "^3.33.0",
57
- "@spectrum-icons/ui": "^3.6.22",
58
- "@spectrum-icons/workflow": "^4.2.27",
34
+ "@adobe/react-spectrum": "3.47.0",
59
35
  "@swc/helpers": "^0.5.0"
60
36
  },
61
- "devDependencies": {
62
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
63
- "@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
64
- },
65
37
  "peerDependencies": {
66
- "@react-spectrum/provider": "^3.0.0",
67
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
68
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
69
40
  },
70
41
  "publishConfig": {
71
42
  "access": "public"
72
43
  },
73
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
74
45
  }
package/src/index.ts CHANGED
@@ -12,5 +12,6 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {NumberField} from './NumberField';
16
- export type {SpectrumNumberFieldProps} from '@react-types/numberfield';
15
+ export {NumberField} from '@adobe/react-spectrum/NumberField';
16
+
17
+ export type {SpectrumNumberFieldProps} from '@adobe/react-spectrum/NumberField';
@@ -1,147 +0,0 @@
1
- var $2f3cded204daae76$exports = require("./StepButton.main.js");
2
- require("./numberfield.df6f415e.css");
3
- var $3649bcbba015c4d7$exports = require("./stepper_vars_css.main.js");
4
- var $3d7oE$reactspectrumutils = require("@react-spectrum/utils");
5
- var $3d7oE$reactspectrumlabel = require("@react-spectrum/label");
6
- var $3d7oE$reactariafocus = require("@react-aria/focus");
7
- var $3d7oE$reactariautils = require("@react-aria/utils");
8
- var $3d7oE$reactstatelynumberfield = require("@react-stately/numberfield");
9
- var $3d7oE$react = require("react");
10
- var $3d7oE$reactspectrumtextfield = require("@react-spectrum/textfield");
11
- var $3d7oE$reactspectrumform = require("@react-spectrum/form");
12
- var $3d7oE$reactariainteractions = require("@react-aria/interactions");
13
- var $3d7oE$reactariai18n = require("@react-aria/i18n");
14
- var $3d7oE$reactarianumberfield = require("@react-aria/numberfield");
15
- var $3d7oE$reactspectrumprovider = require("@react-spectrum/provider");
16
-
17
-
18
- function $parcel$interopDefault(a) {
19
- return a && a.__esModule ? a.default : a;
20
- }
21
-
22
- function $parcel$export(e, n, v, s) {
23
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
- }
25
-
26
- $parcel$export(module.exports, "NumberField", () => $9b3df9c012d62e52$export$63c5fa0b2fdccd2e);
27
- /*
28
- * Copyright 2020 Adobe. All rights reserved.
29
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
30
- * you may not use this file except in compliance with the License. You may obtain a copy
31
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
32
- *
33
- * Unless required by applicable law or agreed to in writing, software distributed under
34
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
35
- * OF ANY KIND, either express or implied. See the License for the specific language
36
- * governing permissions and limitations under the License.
37
- */
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
- const $9b3df9c012d62e52$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).forwardRef(function NumberField(props, ref) {
52
- props = (0, $3d7oE$reactspectrumprovider.useProviderProps)(props);
53
- props = (0, $3d7oE$reactspectrumform.useFormProps)(props);
54
- let provider = (0, $3d7oE$reactspectrumprovider.useProvider)();
55
- let { isQuiet: isQuiet, isReadOnly: isReadOnly, isDisabled: isDisabled, hideStepper: hideStepper } = props;
56
- let { styleProps: style } = (0, $3d7oE$reactspectrumutils.useStyleProps)(props);
57
- let { locale: locale } = (0, $3d7oE$reactariai18n.useLocale)();
58
- let state = (0, $3d7oE$reactstatelynumberfield.useNumberFieldState)({
59
- ...props,
60
- locale: locale
61
- });
62
- let inputRef = (0, $3d7oE$react.useRef)(null);
63
- let domRef = (0, $3d7oE$reactspectrumutils.useFocusableRef)(ref, inputRef);
64
- let { groupProps: groupProps, labelProps: labelProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $3d7oE$reactarianumberfield.useNumberField)(props, state, inputRef);
65
- let isMobile = provider.scale === 'large';
66
- let showStepper = !hideStepper;
67
- let { isHovered: isHovered, hoverProps: hoverProps } = (0, $3d7oE$reactariainteractions.useHover)({
68
- isDisabled: isDisabled
69
- });
70
- let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
71
- let className = (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper', // because FocusRing won't pass along the className from Field, we have to handle that ourselves
72
- !props.label && style.className ? style.className : '', {
73
- 'spectrum-Stepper--isQuiet': isQuiet,
74
- 'is-disabled': isDisabled,
75
- 'spectrum-Stepper--readonly': isReadOnly,
76
- 'is-invalid': validationState === 'invalid' && !isDisabled,
77
- 'spectrum-Stepper--showStepper': showStepper,
78
- 'spectrum-Stepper--isMobile': isMobile,
79
- 'is-hovered': isHovered
80
- });
81
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, $3d7oE$reactspectrumlabel.Field), {
82
- ...props,
83
- descriptionProps: descriptionProps,
84
- errorMessageProps: errorMessageProps,
85
- isInvalid: isInvalid,
86
- validationErrors: validationErrors,
87
- validationDetails: validationDetails,
88
- labelProps: labelProps,
89
- ref: domRef,
90
- wrapperClassName: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-container', {
91
- 'spectrum-Stepper-container--isMobile': isMobile
92
- })
93
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement($9b3df9c012d62e52$var$NumberFieldInput, {
94
- ...props,
95
- groupProps: (0, $3d7oE$reactariautils.mergeProps)(groupProps, hoverProps),
96
- inputProps: inputProps,
97
- inputRef: inputRef,
98
- incrementProps: incrementButtonProps,
99
- decrementProps: decrementButtonProps,
100
- className: className,
101
- style: style,
102
- state: state,
103
- validationState: validationState
104
- }));
105
- });
106
- const $9b3df9c012d62e52$var$NumberFieldInput = /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).forwardRef(function NumberFieldInput(props, ref) {
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
- let showStepper = !hideStepper;
109
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, $3d7oE$reactariafocus.FocusRing), {
110
- within: true,
111
- isTextInput: true,
112
- focusClass: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'is-focused'),
113
- focusRingClass: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'focus-ring'),
114
- autoFocus: autoFocus
115
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement("div", {
116
- ...groupProps,
117
- ref: ref,
118
- style: style,
119
- className: className
120
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, $3d7oE$reactspectrumtextfield.TextFieldBase), {
121
- UNSAFE_className: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-field'),
122
- inputClassName: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-input'),
123
- validationIconClassName: (0, $3d7oE$reactspectrumutils.classNames)((0, ($parcel$interopDefault($3649bcbba015c4d7$exports))), 'spectrum-Stepper-icon'),
124
- isQuiet: isQuiet,
125
- inputRef: inputRef,
126
- validationState: validationState,
127
- inputProps: inputProps,
128
- isDisabled: isDisabled,
129
- disableFocusRing: true
130
- }), showStepper && /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, ($parcel$interopDefault($3d7oE$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, $2f3cded204daae76$exports.StepButton), {
131
- direction: "up",
132
- isQuiet: isQuiet,
133
- ...incrementProps
134
- }), /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement((0, $2f3cded204daae76$exports.StepButton), {
135
- direction: "down",
136
- isQuiet: isQuiet,
137
- ...decrementProps
138
- })), name && /*#__PURE__*/ (0, ($parcel$interopDefault($3d7oE$react))).createElement("input", {
139
- type: "hidden",
140
- name: name,
141
- form: props.form,
142
- value: isNaN(state.numberValue) ? '' : state.numberValue
143
- })));
144
- });
145
-
146
-
147
- //# sourceMappingURL=NumberField.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuBM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAA8B;IAC9H,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,WAAW,CAAA,GAAA,wCAAU;IACzB,IAAI,WACF,OAAO,cACP,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG;IAEJ,IAAI,EAAC,YAAY,KAAK,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAExC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,kDAAkB,EAAE;QAAC,GAAG,KAAK;gBAAE;IAAM;IACjD,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAe,KAAK;IAC/C,IAAI,cACF,UAAU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d,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,0DAAC,CAAA,GAAA,+BAAQ;QACP,QAAA;QACA,aAAA;QACA,YAAY,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QACrC,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QACzC,WAAW;qBACX,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,OAAO;QACP,WAAW;qBACX,0DAAC,CAAA,GAAA,2CAAY;QACX,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;QAGJ,gBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;QAGJ,yBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;QAGJ,SAAS;QACT,UAAU;QACV,iBAAiB;QACjB,YAAY;QACZ,YAAY;QACZ,kBAAA;QACD,6BACD,oIACE,0DAAC,CAAA,GAAA,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,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAI5H","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} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </div>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.main.js.map"}
@@ -1,142 +0,0 @@
1
- import {StepButton as $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa} from "./StepButton.mjs";
2
- import "./numberfield.df6f415e.css";
3
- import $5I0aR$stepper_vars_cssmodulejs from "./stepper_vars_css.mjs";
4
- import {useStyleProps as $5I0aR$useStyleProps, useFocusableRef as $5I0aR$useFocusableRef, classNames as $5I0aR$classNames} from "@react-spectrum/utils";
5
- import {Field as $5I0aR$Field} from "@react-spectrum/label";
6
- import {FocusRing as $5I0aR$FocusRing} from "@react-aria/focus";
7
- import {mergeProps as $5I0aR$mergeProps} from "@react-aria/utils";
8
- import {useNumberFieldState as $5I0aR$useNumberFieldState} from "@react-stately/numberfield";
9
- import $5I0aR$react, {useRef as $5I0aR$useRef} from "react";
10
- import {TextFieldBase as $5I0aR$TextFieldBase} from "@react-spectrum/textfield";
11
- import {useFormProps as $5I0aR$useFormProps} from "@react-spectrum/form";
12
- import {useHover as $5I0aR$useHover} from "@react-aria/interactions";
13
- import {useLocale as $5I0aR$useLocale} from "@react-aria/i18n";
14
- import {useNumberField as $5I0aR$useNumberField} from "@react-aria/numberfield";
15
- import {useProviderProps as $5I0aR$useProviderProps, useProvider as $5I0aR$useProvider} from "@react-spectrum/provider";
16
-
17
-
18
- function $parcel$interopDefault(a) {
19
- return a && a.__esModule ? a.default : a;
20
- }
21
- /*
22
- * Copyright 2020 Adobe. All rights reserved.
23
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
- * you may not use this file except in compliance with the License. You may obtain a copy
25
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
- *
27
- * Unless required by applicable law or agreed to in writing, software distributed under
28
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
- * OF ANY KIND, either express or implied. See the License for the specific language
30
- * governing permissions and limitations under the License.
31
- */
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- const $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberField(props, ref) {
46
- props = (0, $5I0aR$useProviderProps)(props);
47
- props = (0, $5I0aR$useFormProps)(props);
48
- let provider = (0, $5I0aR$useProvider)();
49
- let { isQuiet: isQuiet, isReadOnly: isReadOnly, isDisabled: isDisabled, hideStepper: hideStepper } = props;
50
- let { styleProps: style } = (0, $5I0aR$useStyleProps)(props);
51
- let { locale: locale } = (0, $5I0aR$useLocale)();
52
- let state = (0, $5I0aR$useNumberFieldState)({
53
- ...props,
54
- locale: locale
55
- });
56
- let inputRef = (0, $5I0aR$useRef)(null);
57
- let domRef = (0, $5I0aR$useFocusableRef)(ref, inputRef);
58
- let { groupProps: groupProps, labelProps: labelProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $5I0aR$useNumberField)(props, state, inputRef);
59
- let isMobile = provider.scale === 'large';
60
- let showStepper = !hideStepper;
61
- let { isHovered: isHovered, hoverProps: hoverProps } = (0, $5I0aR$useHover)({
62
- isDisabled: isDisabled
63
- });
64
- let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
65
- let className = (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper', // because FocusRing won't pass along the className from Field, we have to handle that ourselves
66
- !props.label && style.className ? style.className : '', {
67
- 'spectrum-Stepper--isQuiet': isQuiet,
68
- 'is-disabled': isDisabled,
69
- 'spectrum-Stepper--readonly': isReadOnly,
70
- 'is-invalid': validationState === 'invalid' && !isDisabled,
71
- 'spectrum-Stepper--showStepper': showStepper,
72
- 'spectrum-Stepper--isMobile': isMobile,
73
- 'is-hovered': isHovered
74
- });
75
- return /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$Field), {
76
- ...props,
77
- descriptionProps: descriptionProps,
78
- errorMessageProps: errorMessageProps,
79
- isInvalid: isInvalid,
80
- validationErrors: validationErrors,
81
- validationDetails: validationDetails,
82
- labelProps: labelProps,
83
- ref: domRef,
84
- wrapperClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-container', {
85
- 'spectrum-Stepper-container--isMobile': isMobile
86
- })
87
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement($48b879bdd771eb85$var$NumberFieldInput, {
88
- ...props,
89
- groupProps: (0, $5I0aR$mergeProps)(groupProps, hoverProps),
90
- inputProps: inputProps,
91
- inputRef: inputRef,
92
- incrementProps: incrementButtonProps,
93
- decrementProps: decrementButtonProps,
94
- className: className,
95
- style: style,
96
- state: state,
97
- validationState: validationState
98
- }));
99
- });
100
- const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberFieldInput(props, ref) {
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
- let showStepper = !hideStepper;
103
- return /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$FocusRing), {
104
- within: true,
105
- isTextInput: true,
106
- focusClass: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'is-focused'),
107
- focusRingClass: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'focus-ring'),
108
- autoFocus: autoFocus
109
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement("div", {
110
- ...groupProps,
111
- ref: ref,
112
- style: style,
113
- className: className
114
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$TextFieldBase), {
115
- UNSAFE_className: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-field'),
116
- inputClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-input'),
117
- validationIconClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-icon'),
118
- isQuiet: isQuiet,
119
- inputRef: inputRef,
120
- validationState: validationState,
121
- inputProps: inputProps,
122
- isDisabled: isDisabled,
123
- disableFocusRing: true
124
- }), showStepper && /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$react).Fragment, null, /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa), {
125
- direction: "up",
126
- isQuiet: isQuiet,
127
- ...incrementProps
128
- }), /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa), {
129
- direction: "down",
130
- isQuiet: isQuiet,
131
- ...decrementProps
132
- })), name && /*#__PURE__*/ (0, $5I0aR$react).createElement("input", {
133
- type: "hidden",
134
- name: name,
135
- form: props.form,
136
- value: isNaN(state.numberValue) ? '' : state.numberValue
137
- })));
138
- });
139
-
140
-
141
- export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
142
- //# sourceMappingURL=NumberField.module.js.map
@@ -1,142 +0,0 @@
1
- import {StepButton as $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa} from "./StepButton.module.js";
2
- import "./numberfield.df6f415e.css";
3
- import $5I0aR$stepper_vars_cssmodulejs from "./stepper_vars_css.module.js";
4
- import {useStyleProps as $5I0aR$useStyleProps, useFocusableRef as $5I0aR$useFocusableRef, classNames as $5I0aR$classNames} from "@react-spectrum/utils";
5
- import {Field as $5I0aR$Field} from "@react-spectrum/label";
6
- import {FocusRing as $5I0aR$FocusRing} from "@react-aria/focus";
7
- import {mergeProps as $5I0aR$mergeProps} from "@react-aria/utils";
8
- import {useNumberFieldState as $5I0aR$useNumberFieldState} from "@react-stately/numberfield";
9
- import $5I0aR$react, {useRef as $5I0aR$useRef} from "react";
10
- import {TextFieldBase as $5I0aR$TextFieldBase} from "@react-spectrum/textfield";
11
- import {useFormProps as $5I0aR$useFormProps} from "@react-spectrum/form";
12
- import {useHover as $5I0aR$useHover} from "@react-aria/interactions";
13
- import {useLocale as $5I0aR$useLocale} from "@react-aria/i18n";
14
- import {useNumberField as $5I0aR$useNumberField} from "@react-aria/numberfield";
15
- import {useProviderProps as $5I0aR$useProviderProps, useProvider as $5I0aR$useProvider} from "@react-spectrum/provider";
16
-
17
-
18
- function $parcel$interopDefault(a) {
19
- return a && a.__esModule ? a.default : a;
20
- }
21
- /*
22
- * Copyright 2020 Adobe. All rights reserved.
23
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
- * you may not use this file except in compliance with the License. You may obtain a copy
25
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
- *
27
- * Unless required by applicable law or agreed to in writing, software distributed under
28
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
- * OF ANY KIND, either express or implied. See the License for the specific language
30
- * governing permissions and limitations under the License.
31
- */
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- const $48b879bdd771eb85$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberField(props, ref) {
46
- props = (0, $5I0aR$useProviderProps)(props);
47
- props = (0, $5I0aR$useFormProps)(props);
48
- let provider = (0, $5I0aR$useProvider)();
49
- let { isQuiet: isQuiet, isReadOnly: isReadOnly, isDisabled: isDisabled, hideStepper: hideStepper } = props;
50
- let { styleProps: style } = (0, $5I0aR$useStyleProps)(props);
51
- let { locale: locale } = (0, $5I0aR$useLocale)();
52
- let state = (0, $5I0aR$useNumberFieldState)({
53
- ...props,
54
- locale: locale
55
- });
56
- let inputRef = (0, $5I0aR$useRef)(null);
57
- let domRef = (0, $5I0aR$useFocusableRef)(ref, inputRef);
58
- let { groupProps: groupProps, labelProps: labelProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $5I0aR$useNumberField)(props, state, inputRef);
59
- let isMobile = provider.scale === 'large';
60
- let showStepper = !hideStepper;
61
- let { isHovered: isHovered, hoverProps: hoverProps } = (0, $5I0aR$useHover)({
62
- isDisabled: isDisabled
63
- });
64
- let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);
65
- let className = (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper', // because FocusRing won't pass along the className from Field, we have to handle that ourselves
66
- !props.label && style.className ? style.className : '', {
67
- 'spectrum-Stepper--isQuiet': isQuiet,
68
- 'is-disabled': isDisabled,
69
- 'spectrum-Stepper--readonly': isReadOnly,
70
- 'is-invalid': validationState === 'invalid' && !isDisabled,
71
- 'spectrum-Stepper--showStepper': showStepper,
72
- 'spectrum-Stepper--isMobile': isMobile,
73
- 'is-hovered': isHovered
74
- });
75
- return /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$Field), {
76
- ...props,
77
- descriptionProps: descriptionProps,
78
- errorMessageProps: errorMessageProps,
79
- isInvalid: isInvalid,
80
- validationErrors: validationErrors,
81
- validationDetails: validationDetails,
82
- labelProps: labelProps,
83
- ref: domRef,
84
- wrapperClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-container', {
85
- 'spectrum-Stepper-container--isMobile': isMobile
86
- })
87
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement($48b879bdd771eb85$var$NumberFieldInput, {
88
- ...props,
89
- groupProps: (0, $5I0aR$mergeProps)(groupProps, hoverProps),
90
- inputProps: inputProps,
91
- inputRef: inputRef,
92
- incrementProps: incrementButtonProps,
93
- decrementProps: decrementButtonProps,
94
- className: className,
95
- style: style,
96
- state: state,
97
- validationState: validationState
98
- }));
99
- });
100
- const $48b879bdd771eb85$var$NumberFieldInput = /*#__PURE__*/ (0, $5I0aR$react).forwardRef(function NumberFieldInput(props, ref) {
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
- let showStepper = !hideStepper;
103
- return /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$FocusRing), {
104
- within: true,
105
- isTextInput: true,
106
- focusClass: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'is-focused'),
107
- focusRingClass: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'focus-ring'),
108
- autoFocus: autoFocus
109
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement("div", {
110
- ...groupProps,
111
- ref: ref,
112
- style: style,
113
- className: className
114
- }, /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$TextFieldBase), {
115
- UNSAFE_className: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-field'),
116
- inputClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-input'),
117
- validationIconClassName: (0, $5I0aR$classNames)((0, ($parcel$interopDefault($5I0aR$stepper_vars_cssmodulejs))), 'spectrum-Stepper-icon'),
118
- isQuiet: isQuiet,
119
- inputRef: inputRef,
120
- validationState: validationState,
121
- inputProps: inputProps,
122
- isDisabled: isDisabled,
123
- disableFocusRing: true
124
- }), showStepper && /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $5I0aR$react).Fragment, null, /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa), {
125
- direction: "up",
126
- isQuiet: isQuiet,
127
- ...incrementProps
128
- }), /*#__PURE__*/ (0, $5I0aR$react).createElement((0, $7f00b388e0d3b2f6$export$b2f6b60c1d32d6aa), {
129
- direction: "down",
130
- isQuiet: isQuiet,
131
- ...decrementProps
132
- })), name && /*#__PURE__*/ (0, $5I0aR$react).createElement("input", {
133
- type: "hidden",
134
- name: name,
135
- form: props.form,
136
- value: isNaN(state.numberValue) ? '' : state.numberValue
137
- })));
138
- });
139
-
140
-
141
- export {$48b879bdd771eb85$export$63c5fa0b2fdccd2e as NumberField};
142
- //# sourceMappingURL=NumberField.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAuBM,MAAM,0DAAc,CAAA,GAAA,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AY;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,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAI5H","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} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </div>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.module.js.map"}