@react-aria/progress 3.1.1 → 3.1.5

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/index.js CHANGED
@@ -1,70 +1,67 @@
1
- var {
2
- useNumberFormatter
3
- } = require("@react-aria/i18n");
1
+ var $duZvW$reactariautils = require("@react-aria/utils");
2
+ var $duZvW$reactarialabel = require("@react-aria/label");
3
+ var $duZvW$reactariai18n = require("@react-aria/i18n");
4
4
 
5
- var {
6
- useLabel
7
- } = require("@react-aria/label");
8
-
9
- var {
10
- clamp,
11
- filterDOMProps,
12
- mergeProps
13
- } = require("@react-aria/utils");
5
+ function $parcel$exportWildcard(dest, source) {
6
+ Object.keys(source).forEach(function(key) {
7
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
8
+ return;
9
+ }
14
10
 
15
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
11
+ Object.defineProperty(dest, key, {
12
+ enumerable: true,
13
+ get: function get() {
14
+ return source[key];
15
+ }
16
+ });
17
+ });
16
18
 
17
- function $parcel$interopDefault(a) {
18
- return a && a.__esModule ? a.default : a;
19
+ return dest;
19
20
  }
21
+ function $parcel$export(e, n, v, s) {
22
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
23
+ }
24
+ var $0a93f89481d2e8b4$exports = {};
20
25
 
21
- /**
22
- * Provides the accessibility implementation for a progress bar component.
23
- * Progress bars show either determinate or indeterminate progress of an operation
24
- * over time.
25
- */
26
- function useProgressBar(props) {
27
- let {
28
- value = 0,
29
- minValue = 0,
30
- maxValue = 100,
31
- valueLabel,
32
- isIndeterminate,
33
- formatOptions = {
34
- style: 'percent'
35
- }
36
- } = props;
37
- let domProps = filterDOMProps(props, {
38
- labelable: true
39
- });
40
- let {
41
- labelProps,
42
- fieldProps
43
- } = useLabel(_babelRuntimeHelpersExtends({}, props, {
44
- // Progress bar is not an HTML input element so it
45
- // shouldn't be labeled by a <label> element.
46
- labelElementType: 'span'
47
- }));
48
- value = clamp(value, minValue, maxValue);
49
- let percentage = (value - minValue) / (maxValue - minValue);
50
- let formatter = useNumberFormatter(formatOptions);
26
+ $parcel$export($0a93f89481d2e8b4$exports, "useProgressBar", () => $0a93f89481d2e8b4$export$ed5abd763a836edc);
51
27
 
52
- if (!isIndeterminate && !valueLabel) {
53
- let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
54
- valueLabel = formatter.format(valueToFormat);
55
- }
56
28
 
57
- return {
58
- progressBarProps: mergeProps(domProps, _babelRuntimeHelpersExtends({}, fieldProps, {
59
- 'aria-valuenow': isIndeterminate ? undefined : value,
60
- 'aria-valuemin': minValue,
61
- 'aria-valuemax': maxValue,
62
- 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
63
- role: 'progressbar'
64
- })),
65
- labelProps
66
- };
29
+
30
+ function $0a93f89481d2e8b4$export$ed5abd763a836edc(props) {
31
+ let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
32
+ style: 'percent'
33
+ } } = props;
34
+ let domProps = $duZvW$reactariautils.filterDOMProps(props, {
35
+ labelable: true
36
+ });
37
+ let { labelProps: labelProps , fieldProps: fieldProps } = $duZvW$reactarialabel.useLabel({
38
+ ...props,
39
+ // Progress bar is not an HTML input element so it
40
+ // shouldn't be labeled by a <label> element.
41
+ labelElementType: 'span'
42
+ });
43
+ value = $duZvW$reactariautils.clamp(value, minValue, maxValue);
44
+ let percentage = (value - minValue) / (maxValue - minValue);
45
+ let formatter = $duZvW$reactariai18n.useNumberFormatter(formatOptions);
46
+ if (!isIndeterminate && !valueLabel) {
47
+ let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
48
+ valueLabel = formatter.format(valueToFormat);
49
+ }
50
+ return {
51
+ progressBarProps: $duZvW$reactariautils.mergeProps(domProps, {
52
+ ...fieldProps,
53
+ 'aria-valuenow': isIndeterminate ? undefined : value,
54
+ 'aria-valuemin': minValue,
55
+ 'aria-valuemax': maxValue,
56
+ 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
57
+ role: 'progressbar'
58
+ }),
59
+ labelProps: labelProps
60
+ };
67
61
  }
68
62
 
69
- exports.useProgressBar = useProgressBar;
63
+
64
+ $parcel$exportWildcard(module.exports, $0a93f89481d2e8b4$exports);
65
+
66
+
70
67
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACuBD;;;;;AAKO,SAASG,cAAT,CAAwBC,KAAxB,EAAsE;AAC3E,MAAI;AACFC,IAAAA,KAAK,GAAG,CADN;AAEFC,IAAAA,QAAQ,GAAG,CAFT;AAGFC,IAAAA,QAAQ,GAAG,GAHT;AAIFC,IAAAA,UAJE;AAKFC,IAAAA,eALE;AAMFC,IAAAA,aAAa,GAAG;AACdC,MAAAA,KAAK,EAAE;AADO;AANd,MASAP,KATJ;AAWA,MAAIQ,QAAQ,GAAGC,cAAc,CAACT,KAAD,EAAQ;AAACU,IAAAA,SAAS,EAAE;AAAZ,GAAR,CAA7B;AACA,MAAI;AAACC,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA2BC,QAAQ,iCAClCb,KADkC;AAErC;AACA;AACAc,IAAAA,gBAAgB,EAAE;AAJmB,KAAvC;AAOAb,EAAAA,KAAK,GAAGc,KAAK,CAACd,KAAD,EAAQC,QAAR,EAAkBC,QAAlB,CAAb;AACA,MAAIa,UAAU,GAAG,CAACf,KAAK,GAAGC,QAAT,KAAsBC,QAAQ,GAAGD,QAAjC,CAAjB;AACA,MAAIe,SAAS,GAAGC,kBAAkB,CAACZ,aAAD,CAAlC;;AAEA,MAAI,CAACD,eAAD,IAAoB,CAACD,UAAzB,EAAqC;AACnC,QAAIe,aAAa,GAAGb,aAAa,CAACC,KAAd,KAAwB,SAAxB,GAAoCS,UAApC,GAAiDf,KAArE;AACAG,IAAAA,UAAU,GAAGa,SAAS,CAACG,MAAV,CAAiBD,aAAjB,CAAb;AACD;;AAED,SAAO;AACLE,IAAAA,gBAAgB,EAAEC,UAAU,CAACd,QAAD,kCACvBI,UADuB;AAE1B,uBAAiBP,eAAe,GAAGkB,SAAH,GAAetB,KAFrB;AAG1B,uBAAiBC,QAHS;AAI1B,uBAAiBC,QAJS;AAK1B,wBAAkBE,eAAe,GAAGkB,SAAH,GAAenB,UALtB;AAM1BoB,MAAAA,IAAI,EAAE;AANoB,OADvB;AASLb,IAAAA;AATK,GAAP;AAWD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/progress/src/useProgressBar.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\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 {AriaProgressBarProps} from '@react-types/progress';\nimport {clamp, filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\ninterface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: HTMLAttributes<HTMLElement>,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport function useProgressBar(props: AriaProgressBarProps): ProgressBarAria {\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n valueLabel,\n isIndeterminate,\n formatOptions = {\n style: 'percent'\n }\n } = props;\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Progress bar is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n value = clamp(value, minValue, maxValue);\n let percentage = (value - minValue) / (maxValue - minValue);\n let formatter = useNumberFormatter(formatOptions);\n\n if (!isIndeterminate && !valueLabel) {\n let valueToFormat = formatOptions.style === 'percent' ? percentage : value;\n valueLabel = formatter.format(valueToFormat);\n }\n\n return {\n progressBarProps: mergeProps(domProps, {\n ...fieldProps,\n 'aria-valuenow': isIndeterminate ? undefined : value,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-valuetext': isIndeterminate ? undefined : valueLabel as string,\n role: 'progressbar'\n }),\n labelProps\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","useProgressBar","props","value","minValue","maxValue","valueLabel","isIndeterminate","formatOptions","style","domProps","filterDOMProps","labelable","labelProps","fieldProps","useLabel","labelElementType","clamp","percentage","formatter","useNumberFormatter","valueToFormat","format","progressBarProps","mergeProps","undefined","role"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;SC8BgB,yCAAc,CAAC,KAA2B,EAAmB,CAAC;IAC5E,GAAG,CAAC,CAAC,QACH,KAAK,GAAG,CAAC,aACT,QAAQ,GAAG,CAAC,aACZ,QAAQ,GAAG,GAAG,eACd,UAAU,oBACV,eAAe,kBACf,aAAa,GAAG,CAAC;QACf,KAAK,EAAE,CAAS;IAClB,CAAC,EACH,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,QAAQ,GAAG,oCAAc,CAAC,KAAK,EAAE,CAAC;QAAA,SAAS,EAAE,IAAI;IAAA,CAAC;IACtD,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,EAAA,CAAC,GAAG,8BAAQ,CAAC,CAAC;WACpC,KAAK;QACR,EAAkD,AAAlD,gDAAkD;QAClD,EAA6C,AAA7C,2CAA6C;QAC7C,gBAAgB,EAAE,CAAM;IAC1B,CAAC;IAED,KAAK,GAAG,2BAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ;IACvC,GAAG,CAAC,UAAU,IAAI,KAAK,GAAG,QAAQ,KAAK,QAAQ,GAAG,QAAQ;IAC1D,GAAG,CAAC,SAAS,GAAG,uCAAkB,CAAC,aAAa;IAEhD,EAAE,GAAG,eAAe,KAAK,UAAU,EAAE,CAAC;QACpC,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,CAAS,WAAG,UAAU,GAAG,KAAK;QAC1E,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa;IAC7C,CAAC;IAED,MAAM,CAAC,CAAC;QACN,gBAAgB,EAAE,gCAAU,CAAC,QAAQ,EAAE,CAAC;eACnC,UAAU;YACb,CAAe,gBAAE,eAAe,GAAG,SAAS,GAAG,KAAK;YACpD,CAAe,gBAAE,QAAQ;YACzB,CAAe,gBAAE,QAAQ;YACzB,CAAgB,iBAAE,eAAe,GAAG,SAAS,GAAG,UAAU;YAC1D,IAAI,EAAE,CAAa;QACrB,CAAC;oBACD,UAAU;IACZ,CAAC;AACH,CAAC","sources":["packages/@react-aria/progress/src/index.ts","packages/@react-aria/progress/src/useProgressBar.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\nexport * from './useProgressBar';\n","/*\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 {AriaProgressBarProps} from '@react-types/progress';\nimport {clamp, filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\ninterface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: HTMLAttributes<HTMLElement>,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport function useProgressBar(props: AriaProgressBarProps): ProgressBarAria {\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n valueLabel,\n isIndeterminate,\n formatOptions = {\n style: 'percent'\n }\n } = props;\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Progress bar is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n value = clamp(value, minValue, maxValue);\n let percentage = (value - minValue) / (maxValue - minValue);\n let formatter = useNumberFormatter(formatOptions);\n\n if (!isIndeterminate && !valueLabel) {\n let valueToFormat = formatOptions.style === 'percent' ? percentage : value;\n valueLabel = formatter.format(valueToFormat);\n }\n\n return {\n progressBarProps: mergeProps(domProps, {\n ...fieldProps,\n 'aria-valuenow': isIndeterminate ? undefined : value,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-valuetext': isIndeterminate ? undefined : valueLabel as string,\n role: 'progressbar'\n }),\n labelProps\n };\n}\n"],"names":[],"version":3,"file":"index.js.map"}
package/dist/module.js CHANGED
@@ -1,53 +1,51 @@
1
- import { useNumberFormatter } from "@react-aria/i18n";
2
- import { useLabel } from "@react-aria/label";
3
- import { clamp, filterDOMProps, mergeProps } from "@react-aria/utils";
4
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
5
-
6
- /**
7
- * Provides the accessibility implementation for a progress bar component.
8
- * Progress bars show either determinate or indeterminate progress of an operation
9
- * over time.
10
- */
11
- export function useProgressBar(props) {
12
- let {
13
- value = 0,
14
- minValue = 0,
15
- maxValue = 100,
16
- valueLabel,
17
- isIndeterminate,
18
- formatOptions = {
19
- style: 'percent'
1
+ import {filterDOMProps as $dU4mp$filterDOMProps, clamp as $dU4mp$clamp, mergeProps as $dU4mp$mergeProps} from "@react-aria/utils";
2
+ import {useLabel as $dU4mp$useLabel} from "@react-aria/label";
3
+ import {useNumberFormatter as $dU4mp$useNumberFormatter} from "@react-aria/i18n";
4
+
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
+ }
8
+ var $bfde0caba5aedf6c$exports = {};
9
+
10
+ $parcel$export($bfde0caba5aedf6c$exports, "useProgressBar", () => $bfde0caba5aedf6c$export$ed5abd763a836edc);
11
+
12
+
13
+
14
+ function $bfde0caba5aedf6c$export$ed5abd763a836edc(props) {
15
+ let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
16
+ style: 'percent'
17
+ } } = props;
18
+ let domProps = $dU4mp$filterDOMProps(props, {
19
+ labelable: true
20
+ });
21
+ let { labelProps: labelProps , fieldProps: fieldProps } = $dU4mp$useLabel({
22
+ ...props,
23
+ // Progress bar is not an HTML input element so it
24
+ // shouldn't be labeled by a <label> element.
25
+ labelElementType: 'span'
26
+ });
27
+ value = $dU4mp$clamp(value, minValue, maxValue);
28
+ let percentage = (value - minValue) / (maxValue - minValue);
29
+ let formatter = $dU4mp$useNumberFormatter(formatOptions);
30
+ if (!isIndeterminate && !valueLabel) {
31
+ let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
32
+ valueLabel = formatter.format(valueToFormat);
20
33
  }
21
- } = props;
22
- let domProps = filterDOMProps(props, {
23
- labelable: true
24
- });
25
- let {
26
- labelProps,
27
- fieldProps
28
- } = useLabel(_babelRuntimeHelpersEsmExtends({}, props, {
29
- // Progress bar is not an HTML input element so it
30
- // shouldn't be labeled by a <label> element.
31
- labelElementType: 'span'
32
- }));
33
- value = clamp(value, minValue, maxValue);
34
- let percentage = (value - minValue) / (maxValue - minValue);
35
- let formatter = useNumberFormatter(formatOptions);
36
-
37
- if (!isIndeterminate && !valueLabel) {
38
- let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
39
- valueLabel = formatter.format(valueToFormat);
40
- }
41
-
42
- return {
43
- progressBarProps: mergeProps(domProps, _babelRuntimeHelpersEsmExtends({}, fieldProps, {
44
- 'aria-valuenow': isIndeterminate ? undefined : value,
45
- 'aria-valuemin': minValue,
46
- 'aria-valuemax': maxValue,
47
- 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
48
- role: 'progressbar'
49
- })),
50
- labelProps
51
- };
34
+ return {
35
+ progressBarProps: $dU4mp$mergeProps(domProps, {
36
+ ...fieldProps,
37
+ 'aria-valuenow': isIndeterminate ? undefined : value,
38
+ 'aria-valuemin': minValue,
39
+ 'aria-valuemax': maxValue,
40
+ 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
41
+ role: 'progressbar'
42
+ }),
43
+ labelProps: labelProps
44
+ };
52
45
  }
46
+
47
+
48
+
49
+
50
+ export {$bfde0caba5aedf6c$export$ed5abd763a836edc as useProgressBar};
53
51
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;AAyBA;;;;;OAKO,SAASA,cAAT,CAAwBC,KAAxB,EAAsE;AAC3E,MAAI;AACFC,IAAAA,KAAK,GAAG,CADN;AAEFC,IAAAA,QAAQ,GAAG,CAFT;AAGFC,IAAAA,QAAQ,GAAG,GAHT;AAIFC,IAAAA,UAJE;AAKFC,IAAAA,eALE;AAMFC,IAAAA,aAAa,GAAG;AACdC,MAAAA,KAAK,EAAE;AADO;AANd,MASAP,KATJ;AAWA,MAAIQ,QAAQ,GAAGC,cAAc,CAACT,KAAD,EAAQ;AAACU,IAAAA,SAAS,EAAE;AAAZ,GAAR,CAA7B;AACA,MAAI;AAACC,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA2BC,QAAQ,oCAClCb,KADkC;AAErC;AACA;AACAc,IAAAA,gBAAgB,EAAE;AAJmB,KAAvC;AAOAb,EAAAA,KAAK,GAAGc,KAAK,CAACd,KAAD,EAAQC,QAAR,EAAkBC,QAAlB,CAAb;AACA,MAAIa,UAAU,GAAG,CAACf,KAAK,GAAGC,QAAT,KAAsBC,QAAQ,GAAGD,QAAjC,CAAjB;AACA,MAAIe,SAAS,GAAGC,kBAAkB,CAACZ,aAAD,CAAlC;;AAEA,MAAI,CAACD,eAAD,IAAoB,CAACD,UAAzB,EAAqC;AACnC,QAAIe,aAAa,GAAGb,aAAa,CAACC,KAAd,KAAwB,SAAxB,GAAoCS,UAApC,GAAiDf,KAArE;AACAG,IAAAA,UAAU,GAAGa,SAAS,CAACG,MAAV,CAAiBD,aAAjB,CAAb;AACD;;AAED,SAAO;AACLE,IAAAA,gBAAgB,EAAEC,UAAU,CAACd,QAAD,qCACvBI,UADuB;AAE1B,uBAAiBP,eAAe,GAAGkB,SAAH,GAAetB,KAFrB;AAG1B,uBAAiBC,QAHS;AAI1B,uBAAiBC,QAJS;AAK1B,wBAAkBE,eAAe,GAAGkB,SAAH,GAAenB,UALtB;AAM1BoB,MAAAA,IAAI,EAAE;AANoB,OADvB;AASLb,IAAAA;AATK,GAAP;AAWD","sources":["./packages/@react-aria/progress/src/useProgressBar.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\nimport {AriaProgressBarProps} from '@react-types/progress';\nimport {clamp, filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\ninterface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: HTMLAttributes<HTMLElement>,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport function useProgressBar(props: AriaProgressBarProps): ProgressBarAria {\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n valueLabel,\n isIndeterminate,\n formatOptions = {\n style: 'percent'\n }\n } = props;\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Progress bar is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n value = clamp(value, minValue, maxValue);\n let percentage = (value - minValue) / (maxValue - minValue);\n let formatter = useNumberFormatter(formatOptions);\n\n if (!isIndeterminate && !valueLabel) {\n let valueToFormat = formatOptions.style === 'percent' ? percentage : value;\n valueLabel = formatter.format(valueToFormat);\n }\n\n return {\n progressBarProps: mergeProps(domProps, {\n ...fieldProps,\n 'aria-valuenow': isIndeterminate ? undefined : value,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-valuetext': isIndeterminate ? undefined : valueLabel as string,\n role: 'progressbar'\n }),\n labelProps\n };\n}\n"],"names":["useProgressBar","props","value","minValue","maxValue","valueLabel","isIndeterminate","formatOptions","style","domProps","filterDOMProps","labelable","labelProps","fieldProps","useLabel","labelElementType","clamp","percentage","formatter","useNumberFormatter","valueToFormat","format","progressBarProps","mergeProps","undefined","role"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;SC8BgB,yCAAc,CAAC,KAA2B,EAAmB,CAAC;IAC5E,GAAG,CAAC,CAAC,QACH,KAAK,GAAG,CAAC,aACT,QAAQ,GAAG,CAAC,aACZ,QAAQ,GAAG,GAAG,eACd,UAAU,oBACV,eAAe,kBACf,aAAa,GAAG,CAAC;QACf,KAAK,EAAE,CAAS;IAClB,CAAC,EACH,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,QAAQ,GAAG,qBAAc,CAAC,KAAK,EAAE,CAAC;QAAA,SAAS,EAAE,IAAI;IAAA,CAAC;IACtD,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,EAAA,CAAC,GAAG,eAAQ,CAAC,CAAC;WACpC,KAAK;QACR,EAAkD,AAAlD,gDAAkD;QAClD,EAA6C,AAA7C,2CAA6C;QAC7C,gBAAgB,EAAE,CAAM;IAC1B,CAAC;IAED,KAAK,GAAG,YAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ;IACvC,GAAG,CAAC,UAAU,IAAI,KAAK,GAAG,QAAQ,KAAK,QAAQ,GAAG,QAAQ;IAC1D,GAAG,CAAC,SAAS,GAAG,yBAAkB,CAAC,aAAa;IAEhD,EAAE,GAAG,eAAe,KAAK,UAAU,EAAE,CAAC;QACpC,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC,KAAK,KAAK,CAAS,WAAG,UAAU,GAAG,KAAK;QAC1E,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa;IAC7C,CAAC;IAED,MAAM,CAAC,CAAC;QACN,gBAAgB,EAAE,iBAAU,CAAC,QAAQ,EAAE,CAAC;eACnC,UAAU;YACb,CAAe,gBAAE,eAAe,GAAG,SAAS,GAAG,KAAK;YACpD,CAAe,gBAAE,QAAQ;YACzB,CAAe,gBAAE,QAAQ;YACzB,CAAgB,iBAAE,eAAe,GAAG,SAAS,GAAG,UAAU;YAC1D,IAAI,EAAE,CAAa;QACrB,CAAC;oBACD,UAAU;IACZ,CAAC;AACH,CAAC","sources":["packages/@react-aria/progress/src/index.ts","packages/@react-aria/progress/src/useProgressBar.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\nexport * from './useProgressBar';\n","/*\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 {AriaProgressBarProps} from '@react-types/progress';\nimport {clamp, filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {HTMLAttributes} from 'react';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\ninterface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: HTMLAttributes<HTMLElement>,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport function useProgressBar(props: AriaProgressBarProps): ProgressBarAria {\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n valueLabel,\n isIndeterminate,\n formatOptions = {\n style: 'percent'\n }\n } = props;\n\n let domProps = filterDOMProps(props, {labelable: true});\n let {labelProps, fieldProps} = useLabel({\n ...props,\n // Progress bar is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n value = clamp(value, minValue, maxValue);\n let percentage = (value - minValue) / (maxValue - minValue);\n let formatter = useNumberFormatter(formatOptions);\n\n if (!isIndeterminate && !valueLabel) {\n let valueToFormat = formatOptions.style === 'percent' ? percentage : value;\n valueLabel = formatter.format(valueToFormat);\n }\n\n return {\n progressBarProps: mergeProps(domProps, {\n ...fieldProps,\n 'aria-valuenow': isIndeterminate ? undefined : value,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-valuetext': isIndeterminate ? undefined : valueLabel as string,\n role: 'progressbar'\n }),\n labelProps\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":"A;A;AAkBA;IACE,oDAAoD;IACpD,gBAAgB,EAAE,eAAe,WAAW,CAAC,CAAC;IAC9C,kEAAkE;IAClE,UAAU,EAAE,eAAe,WAAW,CAAC,CAAA;CACxC;AAED;A;A;A;GAIG;AACH,+BAA+B,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAwC3E","sources":["./packages/@react-aria/progress/src/packages/@react-aria/progress/src/useProgressBar.ts","./packages/@react-aria/progress/src/packages/@react-aria/progress/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAkBA;IACE,oDAAoD;IACpD,gBAAgB,EAAE,eAAe,WAAW,CAAC,CAAC;IAC9C,kEAAkE;IAClE,UAAU,EAAE,eAAe,WAAW,CAAC,CAAA;CACxC;AAED;;;;GAIG;AACH,+BAA+B,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAwC3E","sources":["packages/@react-aria/progress/src/packages/@react-aria/progress/src/useProgressBar.ts","packages/@react-aria/progress/src/packages/@react-aria/progress/src/index.ts","packages/@react-aria/progress/src/index.ts"],"sourcesContent":[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\nexport * from './useProgressBar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/progress",
3
- "version": "3.1.1",
3
+ "version": "3.1.5",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/i18n": "^3.1.2",
22
- "@react-aria/label": "^3.1.1",
23
- "@react-aria/utils": "^3.3.0",
24
- "@react-types/progress": "^3.1.1",
25
- "@react-types/shared": "^3.2.1"
21
+ "@react-aria/i18n": "^3.3.6",
22
+ "@react-aria/label": "^3.2.3",
23
+ "@react-aria/utils": "^3.11.2",
24
+ "@react-types/progress": "^3.1.4",
25
+ "@react-types/shared": "^3.11.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "0778f71a3c13e1e24388a23b6d525e3b9f5b98f1"
33
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
34
34
  }