@react-aria/calendar 3.9.4 → 3.10.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.
Files changed (221) hide show
  1. package/dist/import.mjs +3 -7
  2. package/dist/main.js +6 -10
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +3 -7
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +6 -0
  7. package/package.json +16 -20
  8. package/src/index.ts +6 -8
  9. package/dist/ar-AE.main.js +0 -17
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -19
  12. package/dist/ar-AE.module.js +0 -19
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -17
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -19
  17. package/dist/bg-BG.module.js +0 -19
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -17
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -19
  22. package/dist/cs-CZ.module.js +0 -19
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -17
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -19
  27. package/dist/da-DK.module.js +0 -19
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -17
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -19
  32. package/dist/de-DE.module.js +0 -19
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -17
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -19
  37. package/dist/el-GR.module.js +0 -19
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -17
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -19
  42. package/dist/en-US.module.js +0 -19
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -17
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -19
  47. package/dist/es-ES.module.js +0 -19
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -17
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -19
  52. package/dist/et-EE.module.js +0 -19
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -17
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -19
  57. package/dist/fi-FI.module.js +0 -19
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -17
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -19
  62. package/dist/fr-FR.module.js +0 -19
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -17
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -19
  67. package/dist/he-IL.module.js +0 -19
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -17
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -19
  72. package/dist/hr-HR.module.js +0 -19
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -17
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -19
  77. package/dist/hu-HU.module.js +0 -19
  78. package/dist/hu-HU.module.js.map +0 -1
  79. package/dist/intlStrings.main.js +0 -108
  80. package/dist/intlStrings.main.js.map +0 -1
  81. package/dist/intlStrings.mjs +0 -110
  82. package/dist/intlStrings.module.js +0 -110
  83. package/dist/intlStrings.module.js.map +0 -1
  84. package/dist/it-IT.main.js +0 -17
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -19
  87. package/dist/it-IT.module.js +0 -19
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -17
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -19
  92. package/dist/ja-JP.module.js +0 -19
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -17
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -19
  97. package/dist/ko-KR.module.js +0 -19
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -17
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -19
  102. package/dist/lt-LT.module.js +0 -19
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -17
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -19
  107. package/dist/lv-LV.module.js +0 -19
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -17
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -19
  112. package/dist/nb-NO.module.js +0 -19
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -17
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -19
  117. package/dist/nl-NL.module.js +0 -19
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -17
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -19
  122. package/dist/pl-PL.module.js +0 -19
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -17
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -19
  127. package/dist/pt-BR.module.js +0 -19
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -17
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -19
  132. package/dist/pt-PT.module.js +0 -19
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -17
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -19
  137. package/dist/ro-RO.module.js +0 -19
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -17
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -19
  142. package/dist/ru-RU.module.js +0 -19
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -17
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -19
  147. package/dist/sk-SK.module.js +0 -19
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -17
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -19
  152. package/dist/sl-SI.module.js +0 -19
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -17
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -19
  157. package/dist/sr-SP.module.js +0 -19
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -17
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -19
  162. package/dist/sv-SE.module.js +0 -19
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -17
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -19
  167. package/dist/tr-TR.module.js +0 -19
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -124
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -17
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -19
  174. package/dist/uk-UA.module.js +0 -19
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useCalendar.main.js +0 -25
  177. package/dist/useCalendar.main.js.map +0 -1
  178. package/dist/useCalendar.mjs +0 -20
  179. package/dist/useCalendar.module.js +0 -20
  180. package/dist/useCalendar.module.js.map +0 -1
  181. package/dist/useCalendarBase.main.js +0 -113
  182. package/dist/useCalendarBase.main.js.map +0 -1
  183. package/dist/useCalendarBase.mjs +0 -108
  184. package/dist/useCalendarBase.module.js +0 -108
  185. package/dist/useCalendarBase.module.js.map +0 -1
  186. package/dist/useCalendarCell.main.js +0 -280
  187. package/dist/useCalendarCell.main.js.map +0 -1
  188. package/dist/useCalendarCell.mjs +0 -275
  189. package/dist/useCalendarCell.module.js +0 -275
  190. package/dist/useCalendarCell.module.js.map +0 -1
  191. package/dist/useCalendarGrid.main.js +0 -142
  192. package/dist/useCalendarGrid.main.js.map +0 -1
  193. package/dist/useCalendarGrid.mjs +0 -137
  194. package/dist/useCalendarGrid.module.js +0 -137
  195. package/dist/useCalendarGrid.module.js.map +0 -1
  196. package/dist/useRangeCalendar.main.js +0 -66
  197. package/dist/useRangeCalendar.main.js.map +0 -1
  198. package/dist/useRangeCalendar.mjs +0 -61
  199. package/dist/useRangeCalendar.module.js +0 -61
  200. package/dist/useRangeCalendar.module.js.map +0 -1
  201. package/dist/utils.main.js +0 -143
  202. package/dist/utils.main.js.map +0 -1
  203. package/dist/utils.mjs +0 -135
  204. package/dist/utils.module.js +0 -135
  205. package/dist/utils.module.js.map +0 -1
  206. package/dist/zh-CN.main.js +0 -17
  207. package/dist/zh-CN.main.js.map +0 -1
  208. package/dist/zh-CN.mjs +0 -19
  209. package/dist/zh-CN.module.js +0 -19
  210. package/dist/zh-CN.module.js.map +0 -1
  211. package/dist/zh-TW.main.js +0 -17
  212. package/dist/zh-TW.main.js.map +0 -1
  213. package/dist/zh-TW.mjs +0 -19
  214. package/dist/zh-TW.module.js +0 -19
  215. package/dist/zh-TW.module.js.map +0 -1
  216. package/src/useCalendar.ts +0 -23
  217. package/src/useCalendarBase.ts +0 -116
  218. package/src/useCalendarCell.ts +0 -364
  219. package/src/useCalendarGrid.ts +0 -174
  220. package/src/useRangeCalendar.ts +0 -82
  221. package/src/utils.ts +0 -147
@@ -1,20 +0,0 @@
1
- import {useCalendarBase as $c4acc1de3ab169cf$export$d652b3ea2d672d5b} from "./useCalendarBase.module.js";
2
-
3
- /*
4
- * Copyright 2020 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $9942cad8a072a530$export$3ee915f8151bd4f1(props, state) {
15
- return (0, $c4acc1de3ab169cf$export$d652b3ea2d672d5b)(props, state);
16
- }
17
-
18
-
19
- export {$9942cad8a072a530$export$3ee915f8151bd4f1 as useCalendar};
20
- //# sourceMappingURL=useCalendar.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiC,KAA2B,EAAE,KAAoB;IAChG,OAAO,CAAA,GAAA,yCAAc,EAAE,OAAO;AAChC","sources":["packages/@react-aria/calendar/src/useCalendar.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 {AriaCalendarProps, DateValue} from '@react-types/calendar';\nimport {CalendarAria, useCalendarBase} from './useCalendarBase';\nimport {CalendarState} from '@react-stately/calendar';\n\n/**\n * Provides the behavior and accessibility implementation for a calendar component.\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport function useCalendar<T extends DateValue>(props: AriaCalendarProps<T>, state: CalendarState): CalendarAria {\n return useCalendarBase(props, state);\n}\n"],"names":[],"version":3,"file":"useCalendar.module.js.map"}
@@ -1,113 +0,0 @@
1
- var $df1d8e967e73ec8e$exports = require("./utils.main.js");
2
- var $bd6dc95a3c5ee5cd$exports = require("./intlStrings.main.js");
3
- var $dPWPO$reactarialiveannouncer = require("@react-aria/live-announcer");
4
- var $dPWPO$reactariautils = require("@react-aria/utils");
5
- var $dPWPO$reactariai18n = require("@react-aria/i18n");
6
- var $dPWPO$react = require("react");
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
-
13
- function $parcel$export(e, n, v, s) {
14
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
- }
16
-
17
- $parcel$export(module.exports, "useCalendarBase", () => $02ef492a56b91cb2$export$d652b3ea2d672d5b);
18
- /*
19
- * Copyright 2020 Adobe. All rights reserved.
20
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License. You may obtain a copy
22
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
- *
24
- * Unless required by applicable law or agreed to in writing, software distributed under
25
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
- * OF ANY KIND, either express or implied. See the License for the specific language
27
- * governing permissions and limitations under the License.
28
- */
29
-
30
-
31
-
32
-
33
-
34
- function $02ef492a56b91cb2$export$d652b3ea2d672d5b(props, state) {
35
- let stringFormatter = (0, $dPWPO$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))), '@react-aria/calendar');
36
- let domProps = (0, $dPWPO$reactariautils.filterDOMProps)(props);
37
- let title = (0, $df1d8e967e73ec8e$exports.useVisibleRangeDescription)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
38
- let visibleRangeDescription = (0, $df1d8e967e73ec8e$exports.useVisibleRangeDescription)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
39
- // Announce when the visible date range changes
40
- (0, $dPWPO$reactariautils.useUpdateEffect)(()=>{
41
- // only when pressing the Previous or Next button
42
- if (!state.isFocused) (0, $dPWPO$reactarialiveannouncer.announce)(visibleRangeDescription);
43
- }, [
44
- visibleRangeDescription
45
- ]);
46
- // Announce when the selected value changes
47
- let selectedDateDescription = (0, $df1d8e967e73ec8e$exports.useSelectedDateDescription)(state);
48
- (0, $dPWPO$reactariautils.useUpdateEffect)(()=>{
49
- if (selectedDateDescription) (0, $dPWPO$reactarialiveannouncer.announce)(selectedDateDescription, 'polite', 4000);
50
- // handle an update to the caption that describes the currently selected range, to announce the new value
51
- }, [
52
- selectedDateDescription
53
- ]);
54
- let errorMessageId = (0, $dPWPO$reactariautils.useSlotId)([
55
- Boolean(props.errorMessage),
56
- props.isInvalid,
57
- props.validationState
58
- ]);
59
- // Pass the label to the child grid elements.
60
- (0, $df1d8e967e73ec8e$exports.hookData).set(state, {
61
- ariaLabel: props['aria-label'],
62
- ariaLabelledBy: props['aria-labelledby'],
63
- errorMessageId: errorMessageId,
64
- selectedDateDescription: selectedDateDescription
65
- });
66
- // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
67
- let [nextFocused, setNextFocused] = (0, $dPWPO$react.useState)(false);
68
- let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
69
- if (nextDisabled && nextFocused) {
70
- setNextFocused(false);
71
- state.setFocused(true);
72
- }
73
- let [previousFocused, setPreviousFocused] = (0, $dPWPO$react.useState)(false);
74
- let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
75
- if (previousDisabled && previousFocused) {
76
- setPreviousFocused(false);
77
- state.setFocused(true);
78
- }
79
- let labelProps = (0, $dPWPO$reactariautils.useLabels)({
80
- id: props['id'],
81
- 'aria-label': [
82
- props['aria-label'],
83
- visibleRangeDescription
84
- ].filter(Boolean).join(', '),
85
- 'aria-labelledby': props['aria-labelledby']
86
- });
87
- return {
88
- calendarProps: (0, $dPWPO$reactariautils.mergeProps)(domProps, labelProps, {
89
- role: 'application',
90
- 'aria-details': props['aria-details'] || undefined,
91
- 'aria-describedby': props['aria-describedby'] || undefined
92
- }),
93
- nextButtonProps: {
94
- onPress: ()=>state.focusNextPage(),
95
- 'aria-label': stringFormatter.format('next'),
96
- isDisabled: nextDisabled,
97
- onFocusChange: setNextFocused
98
- },
99
- prevButtonProps: {
100
- onPress: ()=>state.focusPreviousPage(),
101
- 'aria-label': stringFormatter.format('previous'),
102
- isDisabled: previousDisabled,
103
- onFocusChange: setPreviousFocused
104
- },
105
- errorMessageProps: {
106
- id: errorMessageId
107
- },
108
- title: title
109
- };
110
- }
111
-
112
-
113
- //# sourceMappingURL=useCalendarBase.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA2BM,SAAS,0CAAgB,KAAuD,EAAE,KAAyC;IAChI,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,IAAI,QAAQ,CAAA,GAAA,oDAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IACzG,IAAI,0BAA0B,CAAA,GAAA,oDAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IAE3H,+CAA+C;IAC/C,CAAA,GAAA,qCAAc,EAAE;QACd,iDAAiD;QACjD,IAAI,CAAC,MAAM,SAAS,EAClB,CAAA,GAAA,sCAAO,EAAE;IAEb,GAAG;QAAC;KAAwB;IAE5B,2CAA2C;IAC3C,IAAI,0BAA0B,CAAA,GAAA,oDAAyB,EAAE;IACzD,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,yBACF,CAAA,GAAA,sCAAO,EAAE,yBAAyB,UAAU;IAE9C,yGAAyG;IAC3G,GAAG;QAAC;KAAwB;IAE5B,IAAI,iBAAiB,CAAA,GAAA,+BAAQ,EAAE;QAAC,QAAQ,MAAM,YAAY;QAAG,MAAM,SAAS;QAAE,MAAM,eAAe;KAAC;IAEpG,6CAA6C;IAC7C,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC,OAAO;QAClB,WAAW,KAAK,CAAC,aAAa;QAC9B,gBAAgB,KAAK,CAAC,kBAAkB;wBACxC;iCACA;IACF;IAEA,2GAA2G;IAC3G,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC7C,IAAI,eAAe,MAAM,UAAU,IAAI,MAAM,yBAAyB;IACtE,IAAI,gBAAgB,aAAa;QAC/B,eAAe;QACf,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAA,GAAA,qBAAO,EAAE;IACrD,IAAI,mBAAmB,MAAM,UAAU,IAAI,MAAM,6BAA6B;IAC9E,IAAI,oBAAoB,iBAAiB;QACvC,mBAAmB;QACnB,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,aAAa,CAAA,GAAA,+BAAQ,EAAE;QACzB,IAAI,KAAK,CAAC,KAAK;QACf,cAAc;YAAC,KAAK,CAAC,aAAa;YAAE;SAAwB,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QAClF,mBAAmB,KAAK,CAAC,kBAAkB;IAC7C;IAEA,OAAO;QACL,eAAe,CAAA,GAAA,gCAAS,EAAE,UAAU,YAAY;YAC9C,MAAM;YACN,gBAAgB,KAAK,CAAC,eAAe,IAAI;YACzC,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;QACnD;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,aAAa;YAClC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,iBAAiB;YACtC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,mBAAmB;YACjB,IAAI;QACN;eACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarBase.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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';\nimport {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useState} from 'react';\n\nexport interface CalendarAria {\n /** Props for the calendar grouping element. */\n calendarProps: DOMAttributes,\n /** Props for the next button. */\n nextButtonProps: AriaButtonProps,\n /** Props for the previous button. */\n prevButtonProps: AriaButtonProps,\n /** Props for the error message element, if any. */\n errorMessageProps: DOMAttributes,\n /** A description of the visible date range, for use in the calendar title. */\n title: string\n}\n\nexport function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let domProps = filterDOMProps(props);\n\n let title = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);\n let visibleRangeDescription = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);\n\n // Announce when the visible date range changes\n useUpdateEffect(() => {\n // only when pressing the Previous or Next button\n if (!state.isFocused) {\n announce(visibleRangeDescription);\n }\n }, [visibleRangeDescription]);\n\n // Announce when the selected value changes\n let selectedDateDescription = useSelectedDateDescription(state);\n useUpdateEffect(() => {\n if (selectedDateDescription) {\n announce(selectedDateDescription, 'polite', 4000);\n }\n // handle an update to the caption that describes the currently selected range, to announce the new value\n }, [selectedDateDescription]);\n\n let errorMessageId = useSlotId([Boolean(props.errorMessage), props.isInvalid, props.validationState]);\n\n // Pass the label to the child grid elements.\n hookData.set(state, {\n ariaLabel: props['aria-label'],\n ariaLabelledBy: props['aria-labelledby'],\n errorMessageId,\n selectedDateDescription\n });\n\n // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.\n let [nextFocused, setNextFocused] = useState(false);\n let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();\n if (nextDisabled && nextFocused) {\n setNextFocused(false);\n state.setFocused(true);\n }\n\n let [previousFocused, setPreviousFocused] = useState(false);\n let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();\n if (previousDisabled && previousFocused) {\n setPreviousFocused(false);\n state.setFocused(true);\n }\n\n let labelProps = useLabels({\n id: props['id'],\n 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),\n 'aria-labelledby': props['aria-labelledby']\n });\n\n return {\n calendarProps: mergeProps(domProps, labelProps, {\n role: 'application',\n 'aria-details': props['aria-details'] || undefined,\n 'aria-describedby': props['aria-describedby'] || undefined\n }),\n nextButtonProps: {\n onPress: () => state.focusNextPage(),\n 'aria-label': stringFormatter.format('next'),\n isDisabled: nextDisabled,\n onFocusChange: setNextFocused\n },\n prevButtonProps: {\n onPress: () => state.focusPreviousPage(),\n 'aria-label': stringFormatter.format('previous'),\n isDisabled: previousDisabled,\n onFocusChange: setPreviousFocused\n },\n errorMessageProps: {\n id: errorMessageId\n },\n title\n };\n}\n"],"names":[],"version":3,"file":"useCalendarBase.main.js.map"}
@@ -1,108 +0,0 @@
1
- import {hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a, useSelectedDateDescription as $a074e1e2d0f0a665$export$b6df97c887c38e1a, useVisibleRangeDescription as $a074e1e2d0f0a665$export$31afe65d91ef6e8} from "./utils.mjs";
2
- import $g2t6q$intlStringsmodulejs from "./intlStrings.mjs";
3
- import {announce as $g2t6q$announce} from "@react-aria/live-announcer";
4
- import {filterDOMProps as $g2t6q$filterDOMProps, useUpdateEffect as $g2t6q$useUpdateEffect, useSlotId as $g2t6q$useSlotId, useLabels as $g2t6q$useLabels, mergeProps as $g2t6q$mergeProps} from "@react-aria/utils";
5
- import {useLocalizedStringFormatter as $g2t6q$useLocalizedStringFormatter} from "@react-aria/i18n";
6
- import {useState as $g2t6q$useState} from "react";
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
- /*
13
- * Copyright 2020 Adobe. All rights reserved.
14
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
- * you may not use this file except in compliance with the License. You may obtain a copy
16
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software distributed under
19
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
- * OF ANY KIND, either express or implied. See the License for the specific language
21
- * governing permissions and limitations under the License.
22
- */
23
-
24
-
25
-
26
-
27
-
28
- function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
29
- let stringFormatter = (0, $g2t6q$useLocalizedStringFormatter)((0, ($parcel$interopDefault($g2t6q$intlStringsmodulejs))), '@react-aria/calendar');
30
- let domProps = (0, $g2t6q$filterDOMProps)(props);
31
- let title = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
32
- let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
33
- // Announce when the visible date range changes
34
- (0, $g2t6q$useUpdateEffect)(()=>{
35
- // only when pressing the Previous or Next button
36
- if (!state.isFocused) (0, $g2t6q$announce)(visibleRangeDescription);
37
- }, [
38
- visibleRangeDescription
39
- ]);
40
- // Announce when the selected value changes
41
- let selectedDateDescription = (0, $a074e1e2d0f0a665$export$b6df97c887c38e1a)(state);
42
- (0, $g2t6q$useUpdateEffect)(()=>{
43
- if (selectedDateDescription) (0, $g2t6q$announce)(selectedDateDescription, 'polite', 4000);
44
- // handle an update to the caption that describes the currently selected range, to announce the new value
45
- }, [
46
- selectedDateDescription
47
- ]);
48
- let errorMessageId = (0, $g2t6q$useSlotId)([
49
- Boolean(props.errorMessage),
50
- props.isInvalid,
51
- props.validationState
52
- ]);
53
- // Pass the label to the child grid elements.
54
- (0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).set(state, {
55
- ariaLabel: props['aria-label'],
56
- ariaLabelledBy: props['aria-labelledby'],
57
- errorMessageId: errorMessageId,
58
- selectedDateDescription: selectedDateDescription
59
- });
60
- // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
61
- let [nextFocused, setNextFocused] = (0, $g2t6q$useState)(false);
62
- let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
63
- if (nextDisabled && nextFocused) {
64
- setNextFocused(false);
65
- state.setFocused(true);
66
- }
67
- let [previousFocused, setPreviousFocused] = (0, $g2t6q$useState)(false);
68
- let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
69
- if (previousDisabled && previousFocused) {
70
- setPreviousFocused(false);
71
- state.setFocused(true);
72
- }
73
- let labelProps = (0, $g2t6q$useLabels)({
74
- id: props['id'],
75
- 'aria-label': [
76
- props['aria-label'],
77
- visibleRangeDescription
78
- ].filter(Boolean).join(', '),
79
- 'aria-labelledby': props['aria-labelledby']
80
- });
81
- return {
82
- calendarProps: (0, $g2t6q$mergeProps)(domProps, labelProps, {
83
- role: 'application',
84
- 'aria-details': props['aria-details'] || undefined,
85
- 'aria-describedby': props['aria-describedby'] || undefined
86
- }),
87
- nextButtonProps: {
88
- onPress: ()=>state.focusNextPage(),
89
- 'aria-label': stringFormatter.format('next'),
90
- isDisabled: nextDisabled,
91
- onFocusChange: setNextFocused
92
- },
93
- prevButtonProps: {
94
- onPress: ()=>state.focusPreviousPage(),
95
- 'aria-label': stringFormatter.format('previous'),
96
- isDisabled: previousDisabled,
97
- onFocusChange: setPreviousFocused
98
- },
99
- errorMessageProps: {
100
- id: errorMessageId
101
- },
102
- title: title
103
- };
104
- }
105
-
106
-
107
- export {$c4acc1de3ab169cf$export$d652b3ea2d672d5b as useCalendarBase};
108
- //# sourceMappingURL=useCalendarBase.module.js.map
@@ -1,108 +0,0 @@
1
- import {hookData as $a074e1e2d0f0a665$export$653eddfc964b0f8a, useSelectedDateDescription as $a074e1e2d0f0a665$export$b6df97c887c38e1a, useVisibleRangeDescription as $a074e1e2d0f0a665$export$31afe65d91ef6e8} from "./utils.module.js";
2
- import $g2t6q$intlStringsmodulejs from "./intlStrings.module.js";
3
- import {announce as $g2t6q$announce} from "@react-aria/live-announcer";
4
- import {filterDOMProps as $g2t6q$filterDOMProps, useUpdateEffect as $g2t6q$useUpdateEffect, useSlotId as $g2t6q$useSlotId, useLabels as $g2t6q$useLabels, mergeProps as $g2t6q$mergeProps} from "@react-aria/utils";
5
- import {useLocalizedStringFormatter as $g2t6q$useLocalizedStringFormatter} from "@react-aria/i18n";
6
- import {useState as $g2t6q$useState} from "react";
7
-
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
- /*
13
- * Copyright 2020 Adobe. All rights reserved.
14
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
- * you may not use this file except in compliance with the License. You may obtain a copy
16
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software distributed under
19
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
- * OF ANY KIND, either express or implied. See the License for the specific language
21
- * governing permissions and limitations under the License.
22
- */
23
-
24
-
25
-
26
-
27
-
28
- function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
29
- let stringFormatter = (0, $g2t6q$useLocalizedStringFormatter)((0, ($parcel$interopDefault($g2t6q$intlStringsmodulejs))), '@react-aria/calendar');
30
- let domProps = (0, $g2t6q$filterDOMProps)(props);
31
- let title = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
32
- let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
33
- // Announce when the visible date range changes
34
- (0, $g2t6q$useUpdateEffect)(()=>{
35
- // only when pressing the Previous or Next button
36
- if (!state.isFocused) (0, $g2t6q$announce)(visibleRangeDescription);
37
- }, [
38
- visibleRangeDescription
39
- ]);
40
- // Announce when the selected value changes
41
- let selectedDateDescription = (0, $a074e1e2d0f0a665$export$b6df97c887c38e1a)(state);
42
- (0, $g2t6q$useUpdateEffect)(()=>{
43
- if (selectedDateDescription) (0, $g2t6q$announce)(selectedDateDescription, 'polite', 4000);
44
- // handle an update to the caption that describes the currently selected range, to announce the new value
45
- }, [
46
- selectedDateDescription
47
- ]);
48
- let errorMessageId = (0, $g2t6q$useSlotId)([
49
- Boolean(props.errorMessage),
50
- props.isInvalid,
51
- props.validationState
52
- ]);
53
- // Pass the label to the child grid elements.
54
- (0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).set(state, {
55
- ariaLabel: props['aria-label'],
56
- ariaLabelledBy: props['aria-labelledby'],
57
- errorMessageId: errorMessageId,
58
- selectedDateDescription: selectedDateDescription
59
- });
60
- // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
61
- let [nextFocused, setNextFocused] = (0, $g2t6q$useState)(false);
62
- let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
63
- if (nextDisabled && nextFocused) {
64
- setNextFocused(false);
65
- state.setFocused(true);
66
- }
67
- let [previousFocused, setPreviousFocused] = (0, $g2t6q$useState)(false);
68
- let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
69
- if (previousDisabled && previousFocused) {
70
- setPreviousFocused(false);
71
- state.setFocused(true);
72
- }
73
- let labelProps = (0, $g2t6q$useLabels)({
74
- id: props['id'],
75
- 'aria-label': [
76
- props['aria-label'],
77
- visibleRangeDescription
78
- ].filter(Boolean).join(', '),
79
- 'aria-labelledby': props['aria-labelledby']
80
- });
81
- return {
82
- calendarProps: (0, $g2t6q$mergeProps)(domProps, labelProps, {
83
- role: 'application',
84
- 'aria-details': props['aria-details'] || undefined,
85
- 'aria-describedby': props['aria-describedby'] || undefined
86
- }),
87
- nextButtonProps: {
88
- onPress: ()=>state.focusNextPage(),
89
- 'aria-label': stringFormatter.format('next'),
90
- isDisabled: nextDisabled,
91
- onFocusChange: setNextFocused
92
- },
93
- prevButtonProps: {
94
- onPress: ()=>state.focusPreviousPage(),
95
- 'aria-label': stringFormatter.format('previous'),
96
- isDisabled: previousDisabled,
97
- onFocusChange: setPreviousFocused
98
- },
99
- errorMessageProps: {
100
- id: errorMessageId
101
- },
102
- title: title
103
- };
104
- }
105
-
106
-
107
- export {$c4acc1de3ab169cf$export$d652b3ea2d672d5b as useCalendarBase};
108
- //# sourceMappingURL=useCalendarBase.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA2BM,SAAS,0CAAgB,KAAuD,EAAE,KAAyC;IAChI,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAE9B,IAAI,QAAQ,CAAA,GAAA,wCAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IACzG,IAAI,0BAA0B,CAAA,GAAA,wCAAyB,EAAE,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,QAAQ,EAAE;IAE3H,+CAA+C;IAC/C,CAAA,GAAA,sBAAc,EAAE;QACd,iDAAiD;QACjD,IAAI,CAAC,MAAM,SAAS,EAClB,CAAA,GAAA,eAAO,EAAE;IAEb,GAAG;QAAC;KAAwB;IAE5B,2CAA2C;IAC3C,IAAI,0BAA0B,CAAA,GAAA,yCAAyB,EAAE;IACzD,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,yBACF,CAAA,GAAA,eAAO,EAAE,yBAAyB,UAAU;IAE9C,yGAAyG;IAC3G,GAAG;QAAC;KAAwB;IAE5B,IAAI,iBAAiB,CAAA,GAAA,gBAAQ,EAAE;QAAC,QAAQ,MAAM,YAAY;QAAG,MAAM,SAAS;QAAE,MAAM,eAAe;KAAC;IAEpG,6CAA6C;IAC7C,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;QAClB,WAAW,KAAK,CAAC,aAAa;QAC9B,gBAAgB,KAAK,CAAC,kBAAkB;wBACxC;iCACA;IACF;IAEA,2GAA2G;IAC3G,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,eAAO,EAAE;IAC7C,IAAI,eAAe,MAAM,UAAU,IAAI,MAAM,yBAAyB;IACtE,IAAI,gBAAgB,aAAa;QAC/B,eAAe;QACf,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,CAAC,iBAAiB,mBAAmB,GAAG,CAAA,GAAA,eAAO,EAAE;IACrD,IAAI,mBAAmB,MAAM,UAAU,IAAI,MAAM,6BAA6B;IAC9E,IAAI,oBAAoB,iBAAiB;QACvC,mBAAmB;QACnB,MAAM,UAAU,CAAC;IACnB;IAEA,IAAI,aAAa,CAAA,GAAA,gBAAQ,EAAE;QACzB,IAAI,KAAK,CAAC,KAAK;QACf,cAAc;YAAC,KAAK,CAAC,aAAa;YAAE;SAAwB,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC;QAClF,mBAAmB,KAAK,CAAC,kBAAkB;IAC7C;IAEA,OAAO;QACL,eAAe,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY;YAC9C,MAAM;YACN,gBAAgB,KAAK,CAAC,eAAe,IAAI;YACzC,oBAAoB,KAAK,CAAC,mBAAmB,IAAI;QACnD;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,aAAa;YAClC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,iBAAiB;YACf,SAAS,IAAM,MAAM,iBAAiB;YACtC,cAAc,gBAAgB,MAAM,CAAC;YACrC,YAAY;YACZ,eAAe;QACjB;QACA,mBAAmB;YACjB,IAAI;QACN;eACA;IACF;AACF","sources":["packages/@react-aria/calendar/src/useCalendarBase.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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport {filterDOMProps, mergeProps, useLabels, useSlotId, useUpdateEffect} from '@react-aria/utils';\nimport {hookData, useSelectedDateDescription, useVisibleRangeDescription} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useState} from 'react';\n\nexport interface CalendarAria {\n /** Props for the calendar grouping element. */\n calendarProps: DOMAttributes,\n /** Props for the next button. */\n nextButtonProps: AriaButtonProps,\n /** Props for the previous button. */\n prevButtonProps: AriaButtonProps,\n /** Props for the error message element, if any. */\n errorMessageProps: DOMAttributes,\n /** A description of the visible date range, for use in the calendar title. */\n title: string\n}\n\nexport function useCalendarBase(props: CalendarPropsBase & DOMProps & AriaLabelingProps, state: CalendarState | RangeCalendarState): CalendarAria {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/calendar');\n let domProps = filterDOMProps(props);\n\n let title = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);\n let visibleRangeDescription = useVisibleRangeDescription(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);\n\n // Announce when the visible date range changes\n useUpdateEffect(() => {\n // only when pressing the Previous or Next button\n if (!state.isFocused) {\n announce(visibleRangeDescription);\n }\n }, [visibleRangeDescription]);\n\n // Announce when the selected value changes\n let selectedDateDescription = useSelectedDateDescription(state);\n useUpdateEffect(() => {\n if (selectedDateDescription) {\n announce(selectedDateDescription, 'polite', 4000);\n }\n // handle an update to the caption that describes the currently selected range, to announce the new value\n }, [selectedDateDescription]);\n\n let errorMessageId = useSlotId([Boolean(props.errorMessage), props.isInvalid, props.validationState]);\n\n // Pass the label to the child grid elements.\n hookData.set(state, {\n ariaLabel: props['aria-label'],\n ariaLabelledBy: props['aria-labelledby'],\n errorMessageId,\n selectedDateDescription\n });\n\n // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.\n let [nextFocused, setNextFocused] = useState(false);\n let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();\n if (nextDisabled && nextFocused) {\n setNextFocused(false);\n state.setFocused(true);\n }\n\n let [previousFocused, setPreviousFocused] = useState(false);\n let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();\n if (previousDisabled && previousFocused) {\n setPreviousFocused(false);\n state.setFocused(true);\n }\n\n let labelProps = useLabels({\n id: props['id'],\n 'aria-label': [props['aria-label'], visibleRangeDescription].filter(Boolean).join(', '),\n 'aria-labelledby': props['aria-labelledby']\n });\n\n return {\n calendarProps: mergeProps(domProps, labelProps, {\n role: 'application',\n 'aria-details': props['aria-details'] || undefined,\n 'aria-describedby': props['aria-describedby'] || undefined\n }),\n nextButtonProps: {\n onPress: () => state.focusNextPage(),\n 'aria-label': stringFormatter.format('next'),\n isDisabled: nextDisabled,\n onFocusChange: setNextFocused\n },\n prevButtonProps: {\n onPress: () => state.focusPreviousPage(),\n 'aria-label': stringFormatter.format('previous'),\n isDisabled: previousDisabled,\n onFocusChange: setPreviousFocused\n },\n errorMessageProps: {\n id: errorMessageId\n },\n title\n };\n}\n"],"names":[],"version":3,"file":"useCalendarBase.module.js.map"}