@react-spectrum/calendar 3.7.10 → 3.8.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 (222) hide show
  1. package/dist/import.mjs +3 -3
  2. package/dist/main.js +4 -4
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +3 -3
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +4 -0
  7. package/package.json +12 -40
  8. package/src/index.ts +5 -3
  9. package/dist/Calendar.main.js +0 -75
  10. package/dist/Calendar.main.js.map +0 -1
  11. package/dist/Calendar.mjs +0 -66
  12. package/dist/Calendar.module.js +0 -66
  13. package/dist/Calendar.module.js.map +0 -1
  14. package/dist/CalendarBase.main.js +0 -121
  15. package/dist/CalendarBase.main.js.map +0 -1
  16. package/dist/CalendarBase.mjs +0 -116
  17. package/dist/CalendarBase.module.js +0 -116
  18. package/dist/CalendarBase.module.js.map +0 -1
  19. package/dist/CalendarCell.main.js +0 -95
  20. package/dist/CalendarCell.main.js.map +0 -1
  21. package/dist/CalendarCell.mjs +0 -90
  22. package/dist/CalendarCell.module.js +0 -90
  23. package/dist/CalendarCell.module.js.map +0 -1
  24. package/dist/CalendarMonth.main.js +0 -65
  25. package/dist/CalendarMonth.main.js.map +0 -1
  26. package/dist/CalendarMonth.mjs +0 -60
  27. package/dist/CalendarMonth.module.js +0 -60
  28. package/dist/CalendarMonth.module.js.map +0 -1
  29. package/dist/RangeCalendar.main.js +0 -75
  30. package/dist/RangeCalendar.main.js.map +0 -1
  31. package/dist/RangeCalendar.mjs +0 -66
  32. package/dist/RangeCalendar.module.js +0 -66
  33. package/dist/RangeCalendar.module.js.map +0 -1
  34. package/dist/ar-AE.main.js +0 -9
  35. package/dist/ar-AE.main.js.map +0 -1
  36. package/dist/ar-AE.mjs +0 -11
  37. package/dist/ar-AE.module.js +0 -11
  38. package/dist/ar-AE.module.js.map +0 -1
  39. package/dist/bg-BG.main.js +0 -9
  40. package/dist/bg-BG.main.js.map +0 -1
  41. package/dist/bg-BG.mjs +0 -11
  42. package/dist/bg-BG.module.js +0 -11
  43. package/dist/bg-BG.module.js.map +0 -1
  44. package/dist/calendar.e1e61a27.css +0 -924
  45. package/dist/calendar.e1e61a27.css.map +0 -1
  46. package/dist/calendar_vars_css.main.js +0 -116
  47. package/dist/calendar_vars_css.main.js.map +0 -1
  48. package/dist/calendar_vars_css.mjs +0 -118
  49. package/dist/calendar_vars_css.module.js +0 -118
  50. package/dist/calendar_vars_css.module.js.map +0 -1
  51. package/dist/cs-CZ.main.js +0 -9
  52. package/dist/cs-CZ.main.js.map +0 -1
  53. package/dist/cs-CZ.mjs +0 -11
  54. package/dist/cs-CZ.module.js +0 -11
  55. package/dist/cs-CZ.module.js.map +0 -1
  56. package/dist/da-DK.main.js +0 -9
  57. package/dist/da-DK.main.js.map +0 -1
  58. package/dist/da-DK.mjs +0 -11
  59. package/dist/da-DK.module.js +0 -11
  60. package/dist/da-DK.module.js.map +0 -1
  61. package/dist/de-DE.main.js +0 -9
  62. package/dist/de-DE.main.js.map +0 -1
  63. package/dist/de-DE.mjs +0 -11
  64. package/dist/de-DE.module.js +0 -11
  65. package/dist/de-DE.module.js.map +0 -1
  66. package/dist/el-GR.main.js +0 -9
  67. package/dist/el-GR.main.js.map +0 -1
  68. package/dist/el-GR.mjs +0 -11
  69. package/dist/el-GR.module.js +0 -11
  70. package/dist/el-GR.module.js.map +0 -1
  71. package/dist/en-US.main.js +0 -9
  72. package/dist/en-US.main.js.map +0 -1
  73. package/dist/en-US.mjs +0 -11
  74. package/dist/en-US.module.js +0 -11
  75. package/dist/en-US.module.js.map +0 -1
  76. package/dist/es-ES.main.js +0 -9
  77. package/dist/es-ES.main.js.map +0 -1
  78. package/dist/es-ES.mjs +0 -11
  79. package/dist/es-ES.module.js +0 -11
  80. package/dist/es-ES.module.js.map +0 -1
  81. package/dist/et-EE.main.js +0 -9
  82. package/dist/et-EE.main.js.map +0 -1
  83. package/dist/et-EE.mjs +0 -11
  84. package/dist/et-EE.module.js +0 -11
  85. package/dist/et-EE.module.js.map +0 -1
  86. package/dist/fi-FI.main.js +0 -9
  87. package/dist/fi-FI.main.js.map +0 -1
  88. package/dist/fi-FI.mjs +0 -11
  89. package/dist/fi-FI.module.js +0 -11
  90. package/dist/fi-FI.module.js.map +0 -1
  91. package/dist/fr-FR.main.js +0 -9
  92. package/dist/fr-FR.main.js.map +0 -1
  93. package/dist/fr-FR.mjs +0 -11
  94. package/dist/fr-FR.module.js +0 -11
  95. package/dist/fr-FR.module.js.map +0 -1
  96. package/dist/he-IL.main.js +0 -9
  97. package/dist/he-IL.main.js.map +0 -1
  98. package/dist/he-IL.mjs +0 -11
  99. package/dist/he-IL.module.js +0 -11
  100. package/dist/he-IL.module.js.map +0 -1
  101. package/dist/hr-HR.main.js +0 -9
  102. package/dist/hr-HR.main.js.map +0 -1
  103. package/dist/hr-HR.mjs +0 -11
  104. package/dist/hr-HR.module.js +0 -11
  105. package/dist/hr-HR.module.js.map +0 -1
  106. package/dist/hu-HU.main.js +0 -9
  107. package/dist/hu-HU.main.js.map +0 -1
  108. package/dist/hu-HU.mjs +0 -11
  109. package/dist/hu-HU.module.js +0 -11
  110. package/dist/hu-HU.module.js.map +0 -1
  111. package/dist/intlStrings.main.js +0 -108
  112. package/dist/intlStrings.main.js.map +0 -1
  113. package/dist/intlStrings.mjs +0 -110
  114. package/dist/intlStrings.module.js +0 -110
  115. package/dist/intlStrings.module.js.map +0 -1
  116. package/dist/it-IT.main.js +0 -9
  117. package/dist/it-IT.main.js.map +0 -1
  118. package/dist/it-IT.mjs +0 -11
  119. package/dist/it-IT.module.js +0 -11
  120. package/dist/it-IT.module.js.map +0 -1
  121. package/dist/ja-JP.main.js +0 -9
  122. package/dist/ja-JP.main.js.map +0 -1
  123. package/dist/ja-JP.mjs +0 -11
  124. package/dist/ja-JP.module.js +0 -11
  125. package/dist/ja-JP.module.js.map +0 -1
  126. package/dist/ko-KR.main.js +0 -9
  127. package/dist/ko-KR.main.js.map +0 -1
  128. package/dist/ko-KR.mjs +0 -11
  129. package/dist/ko-KR.module.js +0 -11
  130. package/dist/ko-KR.module.js.map +0 -1
  131. package/dist/lt-LT.main.js +0 -9
  132. package/dist/lt-LT.main.js.map +0 -1
  133. package/dist/lt-LT.mjs +0 -11
  134. package/dist/lt-LT.module.js +0 -11
  135. package/dist/lt-LT.module.js.map +0 -1
  136. package/dist/lv-LV.main.js +0 -9
  137. package/dist/lv-LV.main.js.map +0 -1
  138. package/dist/lv-LV.mjs +0 -11
  139. package/dist/lv-LV.module.js +0 -11
  140. package/dist/lv-LV.module.js.map +0 -1
  141. package/dist/nb-NO.main.js +0 -9
  142. package/dist/nb-NO.main.js.map +0 -1
  143. package/dist/nb-NO.mjs +0 -11
  144. package/dist/nb-NO.module.js +0 -11
  145. package/dist/nb-NO.module.js.map +0 -1
  146. package/dist/nl-NL.main.js +0 -9
  147. package/dist/nl-NL.main.js.map +0 -1
  148. package/dist/nl-NL.mjs +0 -11
  149. package/dist/nl-NL.module.js +0 -11
  150. package/dist/nl-NL.module.js.map +0 -1
  151. package/dist/pl-PL.main.js +0 -9
  152. package/dist/pl-PL.main.js.map +0 -1
  153. package/dist/pl-PL.mjs +0 -11
  154. package/dist/pl-PL.module.js +0 -11
  155. package/dist/pl-PL.module.js.map +0 -1
  156. package/dist/pt-BR.main.js +0 -9
  157. package/dist/pt-BR.main.js.map +0 -1
  158. package/dist/pt-BR.mjs +0 -11
  159. package/dist/pt-BR.module.js +0 -11
  160. package/dist/pt-BR.module.js.map +0 -1
  161. package/dist/pt-PT.main.js +0 -9
  162. package/dist/pt-PT.main.js.map +0 -1
  163. package/dist/pt-PT.mjs +0 -11
  164. package/dist/pt-PT.module.js +0 -11
  165. package/dist/pt-PT.module.js.map +0 -1
  166. package/dist/ro-RO.main.js +0 -9
  167. package/dist/ro-RO.main.js.map +0 -1
  168. package/dist/ro-RO.mjs +0 -11
  169. package/dist/ro-RO.module.js +0 -11
  170. package/dist/ro-RO.module.js.map +0 -1
  171. package/dist/ru-RU.main.js +0 -9
  172. package/dist/ru-RU.main.js.map +0 -1
  173. package/dist/ru-RU.mjs +0 -11
  174. package/dist/ru-RU.module.js +0 -11
  175. package/dist/ru-RU.module.js.map +0 -1
  176. package/dist/sk-SK.main.js +0 -9
  177. package/dist/sk-SK.main.js.map +0 -1
  178. package/dist/sk-SK.mjs +0 -11
  179. package/dist/sk-SK.module.js +0 -11
  180. package/dist/sk-SK.module.js.map +0 -1
  181. package/dist/sl-SI.main.js +0 -9
  182. package/dist/sl-SI.main.js.map +0 -1
  183. package/dist/sl-SI.mjs +0 -11
  184. package/dist/sl-SI.module.js +0 -11
  185. package/dist/sl-SI.module.js.map +0 -1
  186. package/dist/sr-SP.main.js +0 -9
  187. package/dist/sr-SP.main.js.map +0 -1
  188. package/dist/sr-SP.mjs +0 -11
  189. package/dist/sr-SP.module.js +0 -11
  190. package/dist/sr-SP.module.js.map +0 -1
  191. package/dist/sv-SE.main.js +0 -9
  192. package/dist/sv-SE.main.js.map +0 -1
  193. package/dist/sv-SE.mjs +0 -11
  194. package/dist/sv-SE.module.js +0 -11
  195. package/dist/sv-SE.module.js.map +0 -1
  196. package/dist/tr-TR.main.js +0 -9
  197. package/dist/tr-TR.main.js.map +0 -1
  198. package/dist/tr-TR.mjs +0 -11
  199. package/dist/tr-TR.module.js +0 -11
  200. package/dist/tr-TR.module.js.map +0 -1
  201. package/dist/types.d.ts +0 -18
  202. package/dist/types.d.ts.map +0 -1
  203. package/dist/uk-UA.main.js +0 -9
  204. package/dist/uk-UA.main.js.map +0 -1
  205. package/dist/uk-UA.mjs +0 -11
  206. package/dist/uk-UA.module.js +0 -11
  207. package/dist/uk-UA.module.js.map +0 -1
  208. package/dist/zh-CN.main.js +0 -9
  209. package/dist/zh-CN.main.js.map +0 -1
  210. package/dist/zh-CN.mjs +0 -11
  211. package/dist/zh-CN.module.js +0 -11
  212. package/dist/zh-CN.module.js.map +0 -1
  213. package/dist/zh-TW.main.js +0 -9
  214. package/dist/zh-TW.main.js.map +0 -1
  215. package/dist/zh-TW.mjs +0 -11
  216. package/dist/zh-TW.module.js +0 -11
  217. package/dist/zh-TW.module.js.map +0 -1
  218. package/src/Calendar.tsx +0 -61
  219. package/src/CalendarBase.tsx +0 -160
  220. package/src/CalendarCell.tsx +0 -89
  221. package/src/CalendarMonth.tsx +0 -80
  222. package/src/RangeCalendar.tsx +0 -61
package/dist/import.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import {Calendar as $d2b8d4577dd88671$export$e1aef45b828286de} from "./Calendar.mjs";
2
- import {RangeCalendar as $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d} from "./RangeCalendar.mjs";
1
+ import {Calendar as $8e33bf01bae2fd9a$re_export$Calendar} from "@adobe/react-spectrum/Calendar";
2
+ import {RangeCalendar as $8e33bf01bae2fd9a$re_export$RangeCalendar} from "@adobe/react-spectrum/RangeCalendar";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {RangeCalendar as $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d} from "./Rang
16
16
 
17
17
 
18
18
 
19
- export {$d2b8d4577dd88671$export$e1aef45b828286de as Calendar, $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d as RangeCalendar};
19
+ export {$8e33bf01bae2fd9a$re_export$Calendar as Calendar, $8e33bf01bae2fd9a$re_export$RangeCalendar as RangeCalendar};
20
20
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,13 +1,13 @@
1
- var $d9490b77e8681e44$exports = require("./Calendar.main.js");
2
- var $4d045066f2092e3b$exports = require("./RangeCalendar.main.js");
1
+ var $fY6Q3$adobereactspectrumCalendar = require("@adobe/react-spectrum/Calendar");
2
+ var $fY6Q3$adobereactspectrumRangeCalendar = require("@adobe/react-spectrum/RangeCalendar");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {
6
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
7
  }
8
8
 
9
- $parcel$export(module.exports, "Calendar", () => $d9490b77e8681e44$exports.Calendar);
10
- $parcel$export(module.exports, "RangeCalendar", () => $4d045066f2092e3b$exports.RangeCalendar);
9
+ $parcel$export(module.exports, "Calendar", function () { return $fY6Q3$adobereactspectrumCalendar.Calendar; });
10
+ $parcel$export(module.exports, "RangeCalendar", function () { return $fY6Q3$adobereactspectrumRangeCalendar.RangeCalendar; });
11
11
  /*
12
12
  * Copyright 2020 Adobe. All rights reserved.
13
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/calendar/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Calendar} from './Calendar';\nexport {RangeCalendar} from './RangeCalendar';\nexport type {SpectrumCalendarProps, SpectrumRangeCalendarProps} from '@react-types/calendar';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/calendar/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Calendar} from '@adobe/react-spectrum/Calendar';\n\nexport {RangeCalendar} from '@adobe/react-spectrum/RangeCalendar';\nexport type {SpectrumCalendarProps} from '@adobe/react-spectrum/Calendar';\nexport type {SpectrumRangeCalendarProps} from '@adobe/react-spectrum/RangeCalendar';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import {Calendar as $d2b8d4577dd88671$export$e1aef45b828286de} from "./Calendar.module.js";
2
- import {RangeCalendar as $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d} from "./RangeCalendar.module.js";
1
+ import {Calendar as $8e33bf01bae2fd9a$re_export$Calendar} from "@adobe/react-spectrum/Calendar";
2
+ import {RangeCalendar as $8e33bf01bae2fd9a$re_export$RangeCalendar} from "@adobe/react-spectrum/RangeCalendar";
3
3
 
4
4
  /*
5
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -16,5 +16,5 @@ import {RangeCalendar as $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d} from "./Rang
16
16
 
17
17
 
18
18
 
19
- export {$d2b8d4577dd88671$export$e1aef45b828286de as Calendar, $8b1e8eddbf3b15de$export$a4f5c8b89d277a8d as RangeCalendar};
19
+ export {$8e33bf01bae2fd9a$re_export$Calendar as Calendar, $8e33bf01bae2fd9a$re_export$RangeCalendar as RangeCalendar};
20
20
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/calendar/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Calendar} from './Calendar';\nexport {RangeCalendar} from './RangeCalendar';\nexport type {SpectrumCalendarProps, SpectrumRangeCalendarProps} from '@react-types/calendar';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/calendar/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Calendar} from '@adobe/react-spectrum/Calendar';\n\nexport {RangeCalendar} from '@adobe/react-spectrum/RangeCalendar';\nexport type {SpectrumCalendarProps} from '@adobe/react-spectrum/Calendar';\nexport type {SpectrumRangeCalendarProps} from '@adobe/react-spectrum/RangeCalendar';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,4 @@
1
+ export { Calendar } from '@adobe/react-spectrum/Calendar';
2
+ export { RangeCalendar } from '@adobe/react-spectrum/RangeCalendar';
3
+ export type { SpectrumCalendarProps } from '@adobe/react-spectrum/Calendar';
4
+ export type { SpectrumRangeCalendarProps } from '@adobe/react-spectrum/RangeCalendar';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/calendar",
3
- "version": "3.7.10",
3
+ "version": "3.8.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,50 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@internationalized/date": "^3.11.0",
44
- "@react-aria/calendar": "^3.9.4",
45
- "@react-aria/focus": "^3.21.4",
46
- "@react-aria/i18n": "^3.12.15",
47
- "@react-aria/interactions": "^3.27.0",
48
- "@react-aria/utils": "^3.33.0",
49
- "@react-aria/visually-hidden": "^3.8.30",
50
- "@react-spectrum/button": "^3.17.6",
51
- "@react-spectrum/label": "^3.16.21",
52
- "@react-spectrum/utils": "^3.12.11",
53
- "@react-stately/calendar": "^3.9.2",
54
- "@react-types/button": "^3.15.0",
55
- "@react-types/calendar": "^3.8.2",
56
- "@react-types/shared": "^3.33.0",
57
- "@spectrum-icons/ui": "^3.6.22",
34
+ "@adobe/react-spectrum": "3.47.0",
58
35
  "@swc/helpers": "^0.5.0"
59
36
  },
60
- "devDependencies": {
61
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
62
- "@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
63
- },
64
37
  "peerDependencies": {
65
- "@react-spectrum/provider": "^3.0.0",
66
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
67
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
68
40
  },
69
41
  "publishConfig": {
70
42
  "access": "public"
71
43
  },
72
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
73
45
  }
package/src/index.ts CHANGED
@@ -12,6 +12,8 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export {Calendar} from './Calendar';
16
- export {RangeCalendar} from './RangeCalendar';
17
- export type {SpectrumCalendarProps, SpectrumRangeCalendarProps} from '@react-types/calendar';
15
+ export {Calendar} from '@adobe/react-spectrum/Calendar';
16
+
17
+ export {RangeCalendar} from '@adobe/react-spectrum/RangeCalendar';
18
+ export type {SpectrumCalendarProps} from '@adobe/react-spectrum/Calendar';
19
+ export type {SpectrumRangeCalendarProps} from '@adobe/react-spectrum/RangeCalendar';
@@ -1,75 +0,0 @@
1
- var $6d416018158e3a26$exports = require("./CalendarBase.main.js");
2
- var $jdfnP$internationalizeddate = require("@internationalized/date");
3
- var $jdfnP$reactspectrumutils = require("@react-spectrum/utils");
4
- var $jdfnP$react = require("react");
5
- var $jdfnP$reactariacalendar = require("@react-aria/calendar");
6
- var $jdfnP$reactstatelycalendar = require("@react-stately/calendar");
7
- var $jdfnP$reactariai18n = require("@react-aria/i18n");
8
- var $jdfnP$reactspectrumprovider = require("@react-spectrum/provider");
9
-
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
-
15
- function $parcel$export(e, n, v, s) {
16
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
- }
18
-
19
- $parcel$export(module.exports, "Calendar", () => $d9490b77e8681e44$export$e1aef45b828286de);
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
- */
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
- const $d9490b77e8681e44$export$e1aef45b828286de = /*#__PURE__*/ (0, ($parcel$interopDefault($jdfnP$react))).forwardRef(function Calendar(props, ref) {
39
- props = (0, $jdfnP$reactspectrumprovider.useProviderProps)(props);
40
- let { visibleMonths: visibleMonths = 1 } = props;
41
- visibleMonths = Math.max(visibleMonths, 1);
42
- let visibleDuration = (0, $jdfnP$react.useMemo)(()=>({
43
- months: visibleMonths
44
- }), [
45
- visibleMonths
46
- ]);
47
- let { locale: locale } = (0, $jdfnP$reactariai18n.useLocale)();
48
- let state = (0, $jdfnP$reactstatelycalendar.useCalendarState)({
49
- ...props,
50
- locale: locale,
51
- visibleDuration: visibleDuration,
52
- createCalendar: props.createCalendar || (0, $jdfnP$internationalizeddate.createCalendar)
53
- });
54
- let domRef = (0, $jdfnP$react.useRef)(null);
55
- (0, $jdfnP$react.useImperativeHandle)(ref, ()=>({
56
- ...(0, $jdfnP$reactspectrumutils.createDOMRef)(domRef),
57
- focus () {
58
- state.setFocused(true);
59
- }
60
- }));
61
- let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps } = (0, $jdfnP$reactariacalendar.useCalendar)(props, state);
62
- return /*#__PURE__*/ (0, ($parcel$interopDefault($jdfnP$react))).createElement((0, $6d416018158e3a26$exports.CalendarBase), {
63
- ...props,
64
- visibleMonths: visibleMonths,
65
- state: state,
66
- calendarRef: domRef,
67
- calendarProps: calendarProps,
68
- prevButtonProps: prevButtonProps,
69
- nextButtonProps: nextButtonProps,
70
- errorMessageProps: errorMessageProps
71
- });
72
- });
73
-
74
-
75
- //# sourceMappingURL=Calendar.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAgBM,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAA8B,KAA+B,EAAE,GAA8B;IAC7I,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,iBAAC,gBAAgB,GAAE,GAAG;IAC1B,gBAAgB,KAAK,GAAG,CAAC,eAAe;IACxC,IAAI,kBAAkB,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;YAAC,QAAQ;QAAa,CAAA,GAAI;QAAC;KAAc;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,4CAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;yBACA;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,2CAAa;IACvD;IAEA,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IACpB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;YACvB;gBACE,MAAM,UAAU,CAAC;YACnB;QACF,CAAA;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,oCAAU,EAAE,OAAO;IAE9F,qBACE,0DAAC,CAAA,GAAA,sCAAW;QACT,GAAG,KAAK;QACT,eAAe;QACf,OAAO;QACP,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;;AAEzB","sources":["packages/@react-spectrum/calendar/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarBase} from './CalendarBase';\nimport {createCalendar} from '@internationalized/date';\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {DateValue, SpectrumCalendarProps} from '@react-types/calendar';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {ReactElement, useImperativeHandle, useMemo, useRef} from 'react';\nimport {useCalendar} from '@react-aria/calendar';\nimport {useCalendarState} from '@react-stately/calendar';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n */\nexport const Calendar = React.forwardRef(function Calendar<T extends DateValue>(props: SpectrumCalendarProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n let {visibleMonths = 1} = props;\n visibleMonths = Math.max(visibleMonths, 1);\n let visibleDuration = useMemo(() => ({months: visibleMonths}), [visibleMonths]);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n visibleDuration,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let domRef = useRef(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n state.setFocused(true);\n }\n }));\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps} = useCalendar(props, state);\n\n return (\n <CalendarBase\n {...props}\n visibleMonths={visibleMonths}\n state={state}\n calendarRef={domRef}\n calendarProps={calendarProps}\n prevButtonProps={prevButtonProps}\n nextButtonProps={nextButtonProps}\n errorMessageProps={errorMessageProps} />\n );\n}) as <T extends DateValue>(props: SpectrumCalendarProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
package/dist/Calendar.mjs DELETED
@@ -1,66 +0,0 @@
1
- import {CalendarBase as $62cd1e80f0dffb66$export$bfd52a43017368fe} from "./CalendarBase.mjs";
2
- import {createCalendar as $fF0AO$createCalendar} from "@internationalized/date";
3
- import {createDOMRef as $fF0AO$createDOMRef} from "@react-spectrum/utils";
4
- import $fF0AO$react, {useMemo as $fF0AO$useMemo, useRef as $fF0AO$useRef, useImperativeHandle as $fF0AO$useImperativeHandle} from "react";
5
- import {useCalendar as $fF0AO$useCalendar} from "@react-aria/calendar";
6
- import {useCalendarState as $fF0AO$useCalendarState} from "@react-stately/calendar";
7
- import {useLocale as $fF0AO$useLocale} from "@react-aria/i18n";
8
- import {useProviderProps as $fF0AO$useProviderProps} from "@react-spectrum/provider";
9
-
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
-
22
-
23
-
24
-
25
-
26
-
27
-
28
- const $d2b8d4577dd88671$export$e1aef45b828286de = /*#__PURE__*/ (0, $fF0AO$react).forwardRef(function Calendar(props, ref) {
29
- props = (0, $fF0AO$useProviderProps)(props);
30
- let { visibleMonths: visibleMonths = 1 } = props;
31
- visibleMonths = Math.max(visibleMonths, 1);
32
- let visibleDuration = (0, $fF0AO$useMemo)(()=>({
33
- months: visibleMonths
34
- }), [
35
- visibleMonths
36
- ]);
37
- let { locale: locale } = (0, $fF0AO$useLocale)();
38
- let state = (0, $fF0AO$useCalendarState)({
39
- ...props,
40
- locale: locale,
41
- visibleDuration: visibleDuration,
42
- createCalendar: props.createCalendar || (0, $fF0AO$createCalendar)
43
- });
44
- let domRef = (0, $fF0AO$useRef)(null);
45
- (0, $fF0AO$useImperativeHandle)(ref, ()=>({
46
- ...(0, $fF0AO$createDOMRef)(domRef),
47
- focus () {
48
- state.setFocused(true);
49
- }
50
- }));
51
- let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps } = (0, $fF0AO$useCalendar)(props, state);
52
- return /*#__PURE__*/ (0, $fF0AO$react).createElement((0, $62cd1e80f0dffb66$export$bfd52a43017368fe), {
53
- ...props,
54
- visibleMonths: visibleMonths,
55
- state: state,
56
- calendarRef: domRef,
57
- calendarProps: calendarProps,
58
- prevButtonProps: prevButtonProps,
59
- nextButtonProps: nextButtonProps,
60
- errorMessageProps: errorMessageProps
61
- });
62
- });
63
-
64
-
65
- export {$d2b8d4577dd88671$export$e1aef45b828286de as Calendar};
66
- //# sourceMappingURL=Calendar.module.js.map
@@ -1,66 +0,0 @@
1
- import {CalendarBase as $62cd1e80f0dffb66$export$bfd52a43017368fe} from "./CalendarBase.module.js";
2
- import {createCalendar as $fF0AO$createCalendar} from "@internationalized/date";
3
- import {createDOMRef as $fF0AO$createDOMRef} from "@react-spectrum/utils";
4
- import $fF0AO$react, {useMemo as $fF0AO$useMemo, useRef as $fF0AO$useRef, useImperativeHandle as $fF0AO$useImperativeHandle} from "react";
5
- import {useCalendar as $fF0AO$useCalendar} from "@react-aria/calendar";
6
- import {useCalendarState as $fF0AO$useCalendarState} from "@react-stately/calendar";
7
- import {useLocale as $fF0AO$useLocale} from "@react-aria/i18n";
8
- import {useProviderProps as $fF0AO$useProviderProps} from "@react-spectrum/provider";
9
-
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
-
22
-
23
-
24
-
25
-
26
-
27
-
28
- const $d2b8d4577dd88671$export$e1aef45b828286de = /*#__PURE__*/ (0, $fF0AO$react).forwardRef(function Calendar(props, ref) {
29
- props = (0, $fF0AO$useProviderProps)(props);
30
- let { visibleMonths: visibleMonths = 1 } = props;
31
- visibleMonths = Math.max(visibleMonths, 1);
32
- let visibleDuration = (0, $fF0AO$useMemo)(()=>({
33
- months: visibleMonths
34
- }), [
35
- visibleMonths
36
- ]);
37
- let { locale: locale } = (0, $fF0AO$useLocale)();
38
- let state = (0, $fF0AO$useCalendarState)({
39
- ...props,
40
- locale: locale,
41
- visibleDuration: visibleDuration,
42
- createCalendar: props.createCalendar || (0, $fF0AO$createCalendar)
43
- });
44
- let domRef = (0, $fF0AO$useRef)(null);
45
- (0, $fF0AO$useImperativeHandle)(ref, ()=>({
46
- ...(0, $fF0AO$createDOMRef)(domRef),
47
- focus () {
48
- state.setFocused(true);
49
- }
50
- }));
51
- let { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, errorMessageProps: errorMessageProps } = (0, $fF0AO$useCalendar)(props, state);
52
- return /*#__PURE__*/ (0, $fF0AO$react).createElement((0, $62cd1e80f0dffb66$export$bfd52a43017368fe), {
53
- ...props,
54
- visibleMonths: visibleMonths,
55
- state: state,
56
- calendarRef: domRef,
57
- calendarProps: calendarProps,
58
- prevButtonProps: prevButtonProps,
59
- nextButtonProps: nextButtonProps,
60
- errorMessageProps: errorMessageProps
61
- });
62
- });
63
-
64
-
65
- export {$d2b8d4577dd88671$export$e1aef45b828286de as Calendar};
66
- //# sourceMappingURL=Calendar.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAgBM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAA8B,KAA+B,EAAE,GAA8B;IAC7I,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,iBAAC,gBAAgB,GAAE,GAAG;IAC1B,gBAAgB,KAAK,GAAG,CAAC,eAAe;IACxC,IAAI,kBAAkB,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;YAAC,QAAQ;QAAa,CAAA,GAAI;QAAC;KAAc;IAC9E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;yBACA;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,qBAAa;IACvD;IAEA,IAAI,SAAS,CAAA,GAAA,aAAK,EAAE;IACpB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,mBAAW,EAAE,OAAO;YACvB;gBACE,MAAM,UAAU,CAAC;YACnB;QACF,CAAA;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO;IAE9F,qBACE,gCAAC,CAAA,GAAA,yCAAW;QACT,GAAG,KAAK;QACT,eAAe;QACf,OAAO;QACP,aAAa;QACb,eAAe;QACf,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;;AAEzB","sources":["packages/@react-spectrum/calendar/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CalendarBase} from './CalendarBase';\nimport {createCalendar} from '@internationalized/date';\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {DateValue, SpectrumCalendarProps} from '@react-types/calendar';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {ReactElement, useImperativeHandle, useMemo, useRef} from 'react';\nimport {useCalendar} from '@react-aria/calendar';\nimport {useCalendarState} from '@react-stately/calendar';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n */\nexport const Calendar = React.forwardRef(function Calendar<T extends DateValue>(props: SpectrumCalendarProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n let {visibleMonths = 1} = props;\n visibleMonths = Math.max(visibleMonths, 1);\n let visibleDuration = useMemo(() => ({months: visibleMonths}), [visibleMonths]);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n visibleDuration,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let domRef = useRef(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n state.setFocused(true);\n }\n }));\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps} = useCalendar(props, state);\n\n return (\n <CalendarBase\n {...props}\n visibleMonths={visibleMonths}\n state={state}\n calendarRef={domRef}\n calendarProps={calendarProps}\n prevButtonProps={prevButtonProps}\n nextButtonProps={nextButtonProps}\n errorMessageProps={errorMessageProps} />\n );\n}) as <T extends DateValue>(props: SpectrumCalendarProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
@@ -1,121 +0,0 @@
1
- var $02c19eea15a72a7b$exports = require("./CalendarMonth.main.js");
2
- var $7e7c3b1f5233ce23$exports = require("./intlStrings.main.js");
3
- require("./calendar.e1e61a27.css");
4
- var $915891ae6206caad$exports = require("./calendar_vars_css.main.js");
5
- var $6ckm4$reactspectrumbutton = require("@react-spectrum/button");
6
- var $6ckm4$spectrumiconsuiChevronLeftLarge = require("@spectrum-icons/ui/ChevronLeftLarge");
7
- var $6ckm4$spectrumiconsuiChevronRightLarge = require("@spectrum-icons/ui/ChevronRightLarge");
8
- var $6ckm4$reactspectrumutils = require("@react-spectrum/utils");
9
- var $6ckm4$reactspectrumlabel = require("@react-spectrum/label");
10
- var $6ckm4$react = require("react");
11
- var $6ckm4$reactariai18n = require("@react-aria/i18n");
12
- var $6ckm4$reactariavisuallyhidden = require("@react-aria/visually-hidden");
13
-
14
-
15
- function $parcel$interopDefault(a) {
16
- return a && a.__esModule ? a.default : a;
17
- }
18
-
19
- function $parcel$export(e, n, v, s) {
20
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
- }
22
-
23
- $parcel$export(module.exports, "CalendarBase", () => $6d416018158e3a26$export$bfd52a43017368fe);
24
- /*
25
- * Copyright 2020 Adobe. All rights reserved.
26
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
- * you may not use this file except in compliance with the License. You may obtain a copy
28
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
- *
30
- * Unless required by applicable law or agreed to in writing, software distributed under
31
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
- * OF ANY KIND, either express or implied. See the License for the specific language
33
- * governing permissions and limitations under the License.
34
- */
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- function $6d416018158e3a26$export$bfd52a43017368fe(props) {
46
- let { state: state, calendarProps: calendarProps, nextButtonProps: nextButtonProps, prevButtonProps: prevButtonProps, errorMessageProps: errorMessageProps, calendarRef: ref, visibleMonths: visibleMonths = 1, firstDayOfWeek: firstDayOfWeek } = props;
47
- let { styleProps: styleProps } = (0, $6ckm4$reactspectrumutils.useStyleProps)(props);
48
- let stringFormatter = (0, $6ckm4$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7e7c3b1f5233ce23$exports))), '@react-spectrum/calendar');
49
- let { direction: direction } = (0, $6ckm4$reactariai18n.useLocale)();
50
- let currentMonth = state.visibleRange.start;
51
- let monthDateFormatter = (0, $6ckm4$reactariai18n.useDateFormatter)({
52
- month: 'long',
53
- year: 'numeric',
54
- era: currentMonth.calendar.identifier === 'gregory' && currentMonth.era === 'BC' ? 'short' : undefined,
55
- calendar: currentMonth.calendar.identifier,
56
- timeZone: state.timeZone
57
- });
58
- let titles = [];
59
- let calendars = [];
60
- for(let i = 0; i < visibleMonths; i++){
61
- let d = currentMonth.add({
62
- months: i
63
- });
64
- titles.push(/*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("div", {
65
- key: i,
66
- className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-monthHeader')
67
- }, i === 0 && /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $6ckm4$reactspectrumbutton.ActionButton), {
68
- ...prevButtonProps,
69
- UNSAFE_className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-prevMonth'),
70
- isQuiet: true
71
- }, direction === 'rtl' ? /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, ($parcel$interopDefault($6ckm4$spectrumiconsuiChevronRightLarge))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, ($parcel$interopDefault($6ckm4$spectrumiconsuiChevronLeftLarge))), null)), /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("h2", {
72
- // We have a visually hidden heading describing the entire visible range,
73
- // and the calendar itself describes the individual month
74
- // so we don't need to repeat that here for screen reader users.
75
- "aria-hidden": true,
76
- className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-title')
77
- }, $6d416018158e3a26$var$getCurrentMonthName(d, state.timeZone, monthDateFormatter)), i === visibleMonths - 1 && /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $6ckm4$reactspectrumbutton.ActionButton), {
78
- ...nextButtonProps,
79
- UNSAFE_className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-nextMonth'),
80
- isQuiet: true
81
- }, direction === 'rtl' ? /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, ($parcel$interopDefault($6ckm4$spectrumiconsuiChevronLeftLarge))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, ($parcel$interopDefault($6ckm4$spectrumiconsuiChevronRightLarge))), null))));
82
- calendars.push(/*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $02c19eea15a72a7b$exports.CalendarMonth), {
83
- ...props,
84
- key: i,
85
- state: state,
86
- startDate: d,
87
- firstDayOfWeek: firstDayOfWeek
88
- }));
89
- }
90
- return /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("div", {
91
- ...styleProps,
92
- ...calendarProps,
93
- ref: ref,
94
- className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar', styleProps.className)
95
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $6ckm4$reactariavisuallyhidden.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("h2", null, calendarProps['aria-label'])), /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("div", {
96
- className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-header')
97
- }, titles), /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("div", {
98
- className: (0, $6ckm4$reactspectrumutils.classNames)((0, ($parcel$interopDefault($915891ae6206caad$exports))), 'spectrum-Calendar-months')
99
- }, calendars), /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $6ckm4$reactariavisuallyhidden.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement("button", {
100
- "aria-label": nextButtonProps['aria-label'],
101
- disabled: nextButtonProps.isDisabled,
102
- onClick: ()=>state.focusNextPage(),
103
- tabIndex: -1
104
- })), state.isValueInvalid && /*#__PURE__*/ (0, ($parcel$interopDefault($6ckm4$react))).createElement((0, $6ckm4$reactspectrumlabel.HelpText), {
105
- showErrorIcon: true,
106
- errorMessage: props.errorMessage || stringFormatter.format('invalidSelection', {
107
- selectedCount: 'highlightedRange' in state ? 2 : 1
108
- }),
109
- errorMessageProps: errorMessageProps,
110
- isInvalid: true,
111
- // Intentionally a global class name so it can be targeted in DatePicker CSS...
112
- UNSAFE_className: "spectrum-Calendar-helpText"
113
- }));
114
- }
115
- function $6d416018158e3a26$var$getCurrentMonthName(date, timezone, monthDateFormatter) {
116
- if (date.calendar.getFormattableMonth) date = date.calendar.getFormattableMonth(date);
117
- return monthDateFormatter.format(date.toDate(timezone));
118
- }
119
-
120
-
121
- //# sourceMappingURL=CalendarBase.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"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","sources":["packages/@react-spectrum/calendar/src/CalendarBase.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '@react-spectrum/button';\nimport {AriaButtonProps} from '@react-types/button';\nimport {CalendarDate} from '@internationalized/date';\nimport {CalendarMonth} from './CalendarMonth';\nimport {CalendarPropsBase} from '@react-types/calendar';\nimport {CalendarState, RangeCalendarState} from '@react-stately/calendar';\nimport ChevronLeft from '@spectrum-icons/ui/ChevronLeftLarge';\nimport ChevronRight from '@spectrum-icons/ui/ChevronRightLarge';\nimport {classNames, useStyleProps} from '@react-spectrum/utils';\nimport {DOMProps, RefObject, StyleProps} from '@react-types/shared';\nimport {HelpText} from '@react-spectrum/label';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React, {HTMLAttributes, JSX} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useDateFormatter, useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\ninterface CalendarBaseProps<T extends CalendarState | RangeCalendarState> extends CalendarPropsBase, DOMProps, StyleProps {\n state: T,\n visibleMonths?: number,\n calendarProps: HTMLAttributes<HTMLElement>,\n nextButtonProps: AriaButtonProps,\n prevButtonProps: AriaButtonProps,\n errorMessageProps: HTMLAttributes<HTMLElement>,\n calendarRef: RefObject<HTMLDivElement | null>\n}\n\nexport function CalendarBase<T extends CalendarState | RangeCalendarState>(props: CalendarBaseProps<T>): JSX.Element {\n let {\n state,\n calendarProps,\n nextButtonProps,\n prevButtonProps,\n errorMessageProps,\n calendarRef: ref,\n visibleMonths = 1,\n firstDayOfWeek\n } = props;\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/calendar');\n let {direction} = useLocale();\n let currentMonth = state.visibleRange.start;\n let monthDateFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n era: currentMonth.calendar.identifier === 'gregory' && currentMonth.era === 'BC' ? 'short' : undefined,\n calendar: currentMonth.calendar.identifier,\n timeZone: state.timeZone\n });\n\n let titles: JSX.Element[] = [];\n let calendars: JSX.Element[] = [];\n for (let i = 0; i < visibleMonths; i++) {\n let d = currentMonth.add({months: i});\n titles.push(\n <div key={i} className={classNames(styles, 'spectrum-Calendar-monthHeader')}>\n {i === 0 &&\n <ActionButton\n {...prevButtonProps}\n UNSAFE_className={classNames(styles, 'spectrum-Calendar-prevMonth')}\n isQuiet>\n {direction === 'rtl' ? <ChevronRight /> : <ChevronLeft />}\n </ActionButton>\n }\n <h2\n // We have a visually hidden heading describing the entire visible range,\n // and the calendar itself describes the individual month\n // so we don't need to repeat that here for screen reader users.\n aria-hidden\n className={classNames(styles, 'spectrum-Calendar-title')}>\n {getCurrentMonthName(d, state.timeZone, monthDateFormatter)}\n </h2>\n {i === visibleMonths - 1 &&\n <ActionButton\n {...nextButtonProps}\n UNSAFE_className={classNames(styles, 'spectrum-Calendar-nextMonth')}\n isQuiet>\n {direction === 'rtl' ? <ChevronLeft /> : <ChevronRight />}\n </ActionButton>\n }\n </div>\n );\n\n calendars.push(\n <CalendarMonth\n {...props}\n key={i}\n state={state}\n startDate={d}\n firstDayOfWeek={firstDayOfWeek} />\n );\n }\n\n return (\n <div\n {...styleProps}\n {...calendarProps}\n ref={ref}\n className={\n classNames(styles,\n 'spectrum-Calendar',\n styleProps.className\n )\n }>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n <div className={classNames(styles, 'spectrum-Calendar-header')}>\n {titles}\n </div>\n <div className={classNames(styles, 'spectrum-Calendar-months')}>\n {calendars}\n </div>\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n {state.isValueInvalid &&\n <HelpText\n showErrorIcon\n errorMessage={props.errorMessage || stringFormatter.format('invalidSelection', {selectedCount: 'highlightedRange' in state ? 2 : 1})}\n errorMessageProps={errorMessageProps}\n isInvalid\n // Intentionally a global class name so it can be targeted in DatePicker CSS...\n UNSAFE_className=\"spectrum-Calendar-helpText\" />\n }\n </div>\n );\n}\n\nfunction getCurrentMonthName(date: CalendarDate, timezone: string, monthDateFormatter: ReturnType<typeof useDateFormatter>): string {\n if (date.calendar.getFormattableMonth) {\n date = date.calendar.getFormattableMonth(date);\n }\n return monthDateFormatter.format(date.toDate(timezone));\n}\n"],"names":[],"version":3,"file":"CalendarBase.main.js.map"}