@react-aria/progress 3.3.3 → 3.3.4

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
@@ -7,37 +7,57 @@ function $parcel$export(e, n, v, s) {
7
7
  }
8
8
 
9
9
  $parcel$export(module.exports, "useProgressBar", () => $c6bb999a3b4eb4f3$export$ed5abd763a836edc);
10
-
10
+ /*
11
+ * Copyright 2020 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */ /*
21
+ * Copyright 2020 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */
11
31
 
12
32
 
13
33
  function $c6bb999a3b4eb4f3$export$ed5abd763a836edc(props) {
14
34
  let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
15
- style: 'percent'
35
+ style: "percent"
16
36
  } } = props;
17
- let domProps = $jaqU8$reactariautils.filterDOMProps(props, {
37
+ let domProps = (0, $jaqU8$reactariautils.filterDOMProps)(props, {
18
38
  labelable: true
19
39
  });
20
- let { labelProps: labelProps , fieldProps: fieldProps } = $jaqU8$reactarialabel.useLabel({
40
+ let { labelProps: labelProps , fieldProps: fieldProps } = (0, $jaqU8$reactarialabel.useLabel)({
21
41
  ...props,
22
42
  // Progress bar is not an HTML input element so it
23
43
  // shouldn't be labeled by a <label> element.
24
- labelElementType: 'span'
44
+ labelElementType: "span"
25
45
  });
26
- value = $jaqU8$reactariautils.clamp(value, minValue, maxValue);
46
+ value = (0, $jaqU8$reactariautils.clamp)(value, minValue, maxValue);
27
47
  let percentage = (value - minValue) / (maxValue - minValue);
28
- let formatter = $jaqU8$reactariai18n.useNumberFormatter(formatOptions);
48
+ let formatter = (0, $jaqU8$reactariai18n.useNumberFormatter)(formatOptions);
29
49
  if (!isIndeterminate && !valueLabel) {
30
- let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
50
+ let valueToFormat = formatOptions.style === "percent" ? percentage : value;
31
51
  valueLabel = formatter.format(valueToFormat);
32
52
  }
33
53
  return {
34
- progressBarProps: $jaqU8$reactariautils.mergeProps(domProps, {
54
+ progressBarProps: (0, $jaqU8$reactariautils.mergeProps)(domProps, {
35
55
  ...fieldProps,
36
- 'aria-valuenow': isIndeterminate ? undefined : value,
37
- 'aria-valuemin': minValue,
38
- 'aria-valuemax': maxValue,
39
- 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
40
- role: 'progressbar'
56
+ "aria-valuenow": isIndeterminate ? undefined : value,
57
+ "aria-valuemin": minValue,
58
+ "aria-valuemax": maxValue,
59
+ "aria-valuetext": isIndeterminate ? undefined : valueLabel,
60
+ role: "progressbar"
41
61
  }),
42
62
  labelProps: labelProps
43
63
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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 */\nexport {useProgressBar} from './useProgressBar';\nexport type {AriaProgressBarProps} from '@react-types/progress';\nexport type {ProgressBarAria} 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 {DOMAttributes} from '@react-types/shared';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\nexport interface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: DOMAttributes,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: DOMAttributes\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"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAkBO,SAAS,0CAAe,KAA2B,EAAmB;IAC3E,IAAI,SACF,QAAQ,cACR,WAAW,cACX,WAAW,kBACX,WAAU,mBACV,gBAAe,iBACf,gBAAgB;QACd,OAAO;IACT,IACD,GAAG;IAEJ,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,WAAW,IAAI;IAAA;IACrD,IAAI,cAAC,WAAU,cAAE,WAAU,EAAC,GAAG,CAAA,GAAA,8BAAQ,AAAD,EAAE;QACtC,GAAG,KAAK;QACR,kDAAkD;QAClD,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,QAAQ,CAAA,GAAA,2BAAK,AAAD,EAAE,OAAO,UAAU;IAC/B,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO;IACzD,IAAI,YAAY,CAAA,GAAA,uCAAiB,EAAE;IAEnC,IAAI,CAAC,mBAAmB,CAAC,YAAY;QACnC,IAAI,gBAAgB,cAAc,KAAK,KAAK,YAAY,aAAa,KAAK;QAC1E,aAAa,UAAU,MAAM,CAAC;IAChC,CAAC;IAED,OAAO;QACL,kBAAkB,CAAA,GAAA,gCAAU,AAAD,EAAE,UAAU;YACrC,GAAG,UAAU;YACb,iBAAiB,kBAAkB,YAAY,KAAK;YACpD,iBAAiB;YACjB,iBAAiB;YACjB,kBAAkB,kBAAkB,YAAY,UAAoB;YACpE,MAAM;QACR;oBACA;IACF;AACF;;CD5DC,GACD","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 */\nexport {useProgressBar} from './useProgressBar';\nexport type {AriaProgressBarProps} from '@react-types/progress';\nexport type {ProgressBarAria} 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 {DOMAttributes} from '@react-types/shared';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\nexport interface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: DOMAttributes,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: DOMAttributes\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
@@ -2,37 +2,57 @@ import {filterDOMProps as $e3Dei$filterDOMProps, clamp as $e3Dei$clamp, mergePro
2
2
  import {useLabel as $e3Dei$useLabel} from "@react-aria/label";
3
3
  import {useNumberFormatter as $e3Dei$useNumberFormatter} from "@react-aria/i18n";
4
4
 
5
-
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */
6
26
 
7
27
 
8
28
  function $204d9ebcedfb8806$export$ed5abd763a836edc(props) {
9
29
  let { value: value = 0 , minValue: minValue = 0 , maxValue: maxValue = 100 , valueLabel: valueLabel , isIndeterminate: isIndeterminate , formatOptions: formatOptions = {
10
- style: 'percent'
30
+ style: "percent"
11
31
  } } = props;
12
- let domProps = $e3Dei$filterDOMProps(props, {
32
+ let domProps = (0, $e3Dei$filterDOMProps)(props, {
13
33
  labelable: true
14
34
  });
15
- let { labelProps: labelProps , fieldProps: fieldProps } = $e3Dei$useLabel({
35
+ let { labelProps: labelProps , fieldProps: fieldProps } = (0, $e3Dei$useLabel)({
16
36
  ...props,
17
37
  // Progress bar is not an HTML input element so it
18
38
  // shouldn't be labeled by a <label> element.
19
- labelElementType: 'span'
39
+ labelElementType: "span"
20
40
  });
21
- value = $e3Dei$clamp(value, minValue, maxValue);
41
+ value = (0, $e3Dei$clamp)(value, minValue, maxValue);
22
42
  let percentage = (value - minValue) / (maxValue - minValue);
23
- let formatter = $e3Dei$useNumberFormatter(formatOptions);
43
+ let formatter = (0, $e3Dei$useNumberFormatter)(formatOptions);
24
44
  if (!isIndeterminate && !valueLabel) {
25
- let valueToFormat = formatOptions.style === 'percent' ? percentage : value;
45
+ let valueToFormat = formatOptions.style === "percent" ? percentage : value;
26
46
  valueLabel = formatter.format(valueToFormat);
27
47
  }
28
48
  return {
29
- progressBarProps: $e3Dei$mergeProps(domProps, {
49
+ progressBarProps: (0, $e3Dei$mergeProps)(domProps, {
30
50
  ...fieldProps,
31
- 'aria-valuenow': isIndeterminate ? undefined : value,
32
- 'aria-valuemin': minValue,
33
- 'aria-valuemax': maxValue,
34
- 'aria-valuetext': isIndeterminate ? undefined : valueLabel,
35
- role: 'progressbar'
51
+ "aria-valuenow": isIndeterminate ? undefined : value,
52
+ "aria-valuemin": minValue,
53
+ "aria-valuemax": maxValue,
54
+ "aria-valuetext": isIndeterminate ? undefined : valueLabel,
55
+ role: "progressbar"
36
56
  }),
37
57
  labelProps: labelProps
38
58
  };
@@ -1 +1 @@
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 */\nexport {useProgressBar} from './useProgressBar';\nexport type {AriaProgressBarProps} from '@react-types/progress';\nexport type {ProgressBarAria} 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 {DOMAttributes} from '@react-types/shared';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\nexport interface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: DOMAttributes,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: DOMAttributes\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
+ {"mappings":";;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;;AAkBO,SAAS,0CAAe,KAA2B,EAAmB;IAC3E,IAAI,SACF,QAAQ,cACR,WAAW,cACX,WAAW,kBACX,WAAU,mBACV,gBAAe,iBACf,gBAAgB;QACd,OAAO;IACT,IACD,GAAG;IAEJ,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW,IAAI;IAAA;IACrD,IAAI,cAAC,WAAU,cAAE,WAAU,EAAC,GAAG,CAAA,GAAA,eAAQ,AAAD,EAAE;QACtC,GAAG,KAAK;QACR,kDAAkD;QAClD,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,QAAQ,CAAA,GAAA,YAAK,AAAD,EAAE,OAAO,UAAU;IAC/B,IAAI,aAAa,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO;IACzD,IAAI,YAAY,CAAA,GAAA,yBAAiB,EAAE;IAEnC,IAAI,CAAC,mBAAmB,CAAC,YAAY;QACnC,IAAI,gBAAgB,cAAc,KAAK,KAAK,YAAY,aAAa,KAAK;QAC1E,aAAa,UAAU,MAAM,CAAC;IAChC,CAAC;IAED,OAAO;QACL,kBAAkB,CAAA,GAAA,iBAAU,AAAD,EAAE,UAAU;YACrC,GAAG,UAAU;YACb,iBAAiB,kBAAkB,YAAY,KAAK;YACpD,iBAAiB;YACjB,iBAAiB;YACjB,kBAAkB,kBAAkB,YAAY,UAAoB;YACpE,MAAM;QACR;oBACA;IACF;AACF;;CD5DC,GACD","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 */\nexport {useProgressBar} from './useProgressBar';\nexport type {AriaProgressBarProps} from '@react-types/progress';\nexport type {ProgressBarAria} 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 {DOMAttributes} from '@react-types/shared';\nimport {useLabel} from '@react-aria/label';\nimport {useNumberFormatter} from '@react-aria/i18n';\n\nexport interface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: DOMAttributes,\n /** Props for the progress bar's visual label element (if any). */\n labelProps: DOMAttributes\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/progress",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -17,12 +17,12 @@
17
17
  "url": "https://github.com/adobe/react-spectrum"
18
18
  },
19
19
  "dependencies": {
20
- "@babel/runtime": "^7.6.2",
21
- "@react-aria/i18n": "^3.6.2",
22
- "@react-aria/label": "^3.4.3",
23
- "@react-aria/utils": "^3.14.1",
20
+ "@react-aria/i18n": "^3.6.3",
21
+ "@react-aria/label": "^3.4.4",
22
+ "@react-aria/utils": "^3.14.2",
24
23
  "@react-types/progress": "^3.2.5",
25
- "@react-types/shared": "^3.16.0"
24
+ "@react-types/shared": "^3.16.0",
25
+ "@swc/helpers": "^0.4.14"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "2954307ddbefe149241685440c81f80ece6b2c83"
33
+ "gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
34
34
  }