@proyecto-viviana/solidaria-components 0.5.0 → 0.7.0-rc.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 (561) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/README.md +4 -7
  4. package/dist/ActionBar.d.ts +2 -10
  5. package/dist/ActionBar.d.ts.map +1 -1
  6. package/dist/ActionBar.js +95 -59
  7. package/dist/ActionBar.js.map +1 -1
  8. package/dist/ActionBar.jsx +42 -15
  9. package/dist/ActionBar.jsx.map +1 -1
  10. package/dist/ActionGroup.d.ts +1 -12
  11. package/dist/ActionGroup.d.ts.map +1 -1
  12. package/dist/ActionGroup.js +66 -44
  13. package/dist/ActionGroup.js.map +1 -1
  14. package/dist/ActionGroup.jsx +25 -10
  15. package/dist/ActionGroup.jsx.map +1 -1
  16. package/dist/Alert.d.ts +4 -1
  17. package/dist/Alert.d.ts.map +1 -1
  18. package/dist/Alert.js +25 -17
  19. package/dist/Alert.js.map +1 -1
  20. package/dist/Alert.jsx +9 -5
  21. package/dist/Alert.jsx.map +1 -1
  22. package/dist/Autocomplete.d.ts +2 -9
  23. package/dist/Autocomplete.d.ts.map +1 -1
  24. package/dist/Autocomplete.js +18 -5
  25. package/dist/Autocomplete.js.map +1 -1
  26. package/dist/Autocomplete.jsx +20 -7
  27. package/dist/Autocomplete.jsx.map +1 -1
  28. package/dist/Breadcrumbs.d.ts +2 -7
  29. package/dist/Breadcrumbs.d.ts.map +1 -1
  30. package/dist/Breadcrumbs.js +71 -51
  31. package/dist/Breadcrumbs.js.map +1 -1
  32. package/dist/Breadcrumbs.jsx +25 -12
  33. package/dist/Breadcrumbs.jsx.map +1 -1
  34. package/dist/Button.d.ts +1 -7
  35. package/dist/Button.d.ts.map +1 -1
  36. package/dist/Button.js +125 -72
  37. package/dist/Button.js.map +1 -1
  38. package/dist/Button.jsx +105 -43
  39. package/dist/Button.jsx.map +1 -1
  40. package/dist/Calendar.d.ts +1 -7
  41. package/dist/Calendar.d.ts.map +1 -1
  42. package/dist/Calendar.js +297 -221
  43. package/dist/Calendar.js.map +1 -1
  44. package/dist/Calendar.jsx +52 -32
  45. package/dist/Calendar.jsx.map +1 -1
  46. package/dist/CalendarPicker.d.ts +1 -10
  47. package/dist/CalendarPicker.d.ts.map +1 -1
  48. package/dist/CalendarPicker.js +12 -0
  49. package/dist/CalendarPicker.js.map +1 -1
  50. package/dist/CalendarPicker.jsx +12 -0
  51. package/dist/CalendarPicker.jsx.map +1 -1
  52. package/dist/Checkbox.d.ts +2 -7
  53. package/dist/Checkbox.d.ts.map +1 -1
  54. package/dist/Checkbox.js +332 -270
  55. package/dist/Checkbox.js.map +1 -1
  56. package/dist/Checkbox.jsx +70 -77
  57. package/dist/Checkbox.jsx.map +1 -1
  58. package/dist/Collection.d.ts +33 -7
  59. package/dist/Collection.d.ts.map +1 -1
  60. package/dist/Collection.js +128 -74
  61. package/dist/Collection.js.map +1 -1
  62. package/dist/Collection.jsx +46 -7
  63. package/dist/Collection.jsx.map +1 -1
  64. package/dist/Color.d.ts +15 -20
  65. package/dist/Color.d.ts.map +1 -1
  66. package/dist/Color.js +572 -334
  67. package/dist/Color.js.map +1 -1
  68. package/dist/Color.jsx +205 -85
  69. package/dist/Color.jsx.map +1 -1
  70. package/dist/ColorEditor.d.ts +3 -1
  71. package/dist/ColorEditor.d.ts.map +1 -1
  72. package/dist/ColorEditor.js +147 -124
  73. package/dist/ColorEditor.js.map +1 -1
  74. package/dist/ColorEditor.jsx +4 -1
  75. package/dist/ColorEditor.jsx.map +1 -1
  76. package/dist/ComboBox.d.ts +31 -10
  77. package/dist/ComboBox.d.ts.map +1 -1
  78. package/dist/ComboBox.js +539 -274
  79. package/dist/ComboBox.js.map +1 -1
  80. package/dist/ComboBox.jsx +213 -70
  81. package/dist/ComboBox.jsx.map +1 -1
  82. package/dist/ContextualHelpTrigger.d.ts +1 -7
  83. package/dist/ContextualHelpTrigger.d.ts.map +1 -1
  84. package/dist/ContextualHelpTrigger.js +102 -72
  85. package/dist/ContextualHelpTrigger.js.map +1 -1
  86. package/dist/ContextualHelpTrigger.jsx +36 -16
  87. package/dist/ContextualHelpTrigger.jsx.map +1 -1
  88. package/dist/DateField.d.ts +2 -7
  89. package/dist/DateField.d.ts.map +1 -1
  90. package/dist/DateField.js +0 -2
  91. package/dist/DateField.jsx +0 -2
  92. package/dist/DateField2.js +194 -179
  93. package/dist/DateField2.js.map +1 -1
  94. package/dist/DateField2.jsx +58 -55
  95. package/dist/DateField2.jsx.map +1 -1
  96. package/dist/DatePicker.d.ts +7 -7
  97. package/dist/DatePicker.d.ts.map +1 -1
  98. package/dist/DatePicker.js +2 -2
  99. package/dist/DatePicker.jsx +2 -2
  100. package/dist/DatePicker2.js +357 -435
  101. package/dist/DatePicker2.js.map +1 -1
  102. package/dist/DatePicker2.jsx +109 -178
  103. package/dist/DatePicker2.jsx.map +1 -1
  104. package/dist/DateRangePickerContext.d.ts +7 -0
  105. package/dist/DateRangePickerContext.d.ts.map +1 -1
  106. package/dist/Dialog.d.ts +4 -9
  107. package/dist/Dialog.d.ts.map +1 -1
  108. package/dist/Dialog.js +168 -101
  109. package/dist/Dialog.js.map +1 -1
  110. package/dist/Dialog.jsx +75 -27
  111. package/dist/Dialog.jsx.map +1 -1
  112. package/dist/Disclosure.d.ts +1 -9
  113. package/dist/Disclosure.d.ts.map +1 -1
  114. package/dist/Disclosure.js +121 -79
  115. package/dist/Disclosure.js.map +1 -1
  116. package/dist/Disclosure.jsx +32 -19
  117. package/dist/Disclosure.jsx.map +1 -1
  118. package/dist/DragAndDrop.d.ts +9 -6
  119. package/dist/DragAndDrop.d.ts.map +1 -1
  120. package/dist/DragAndDrop.js +37 -22
  121. package/dist/DragAndDrop.js.map +1 -1
  122. package/dist/DragAndDrop.jsx +20 -4
  123. package/dist/DragAndDrop.jsx.map +1 -1
  124. package/dist/DragPreview.d.ts +1 -1
  125. package/dist/DragPreview.d.ts.map +1 -1
  126. package/dist/DropZone.d.ts +1 -7
  127. package/dist/DropZone.d.ts.map +1 -1
  128. package/dist/DropZone.js +74 -40
  129. package/dist/DropZone.js.map +1 -1
  130. package/dist/DropZone.jsx +24 -8
  131. package/dist/DropZone.jsx.map +1 -1
  132. package/dist/ElementTag.d.ts +9 -20
  133. package/dist/ElementTag.d.ts.map +1 -1
  134. package/dist/ElementTag.js +8 -210
  135. package/dist/ElementTag.js.map +1 -1
  136. package/dist/ElementTag.jsx +8 -57
  137. package/dist/ElementTag.jsx.map +1 -1
  138. package/dist/FieldError.d.ts +8 -7
  139. package/dist/FieldError.d.ts.map +1 -1
  140. package/dist/FieldError.js +33 -13
  141. package/dist/FieldError.js.map +1 -1
  142. package/dist/FieldError.jsx +20 -5
  143. package/dist/FieldError.jsx.map +1 -1
  144. package/dist/FileTrigger.d.ts +1 -7
  145. package/dist/FileTrigger.d.ts.map +1 -1
  146. package/dist/FileTrigger.js +30 -12
  147. package/dist/FileTrigger.js.map +1 -1
  148. package/dist/FileTrigger.jsx +15 -2
  149. package/dist/FileTrigger.jsx.map +1 -1
  150. package/dist/Focusable.d.ts +2 -8
  151. package/dist/Focusable.d.ts.map +1 -1
  152. package/dist/Focusable.js +23 -6
  153. package/dist/Focusable.js.map +1 -1
  154. package/dist/Focusable.jsx +22 -5
  155. package/dist/Focusable.jsx.map +1 -1
  156. package/dist/Form.d.ts +9 -8
  157. package/dist/Form.d.ts.map +1 -1
  158. package/dist/Form.js +66 -43
  159. package/dist/Form.js.map +1 -1
  160. package/dist/Form.jsx +36 -16
  161. package/dist/Form.jsx.map +1 -1
  162. package/dist/GridList.d.ts +5 -10
  163. package/dist/GridList.d.ts.map +1 -1
  164. package/dist/GridList.js +372 -243
  165. package/dist/GridList.js.map +1 -1
  166. package/dist/GridList.jsx +177 -99
  167. package/dist/GridList.jsx.map +1 -1
  168. package/dist/HiddenDateInput.d.ts +1 -7
  169. package/dist/HiddenDateInput.d.ts.map +1 -1
  170. package/dist/Icon.d.ts +4 -1
  171. package/dist/Icon.d.ts.map +1 -1
  172. package/dist/Icon.js +41 -37
  173. package/dist/Icon.js.map +1 -1
  174. package/dist/Icon.jsx +7 -3
  175. package/dist/Icon.jsx.map +1 -1
  176. package/dist/Keyboard.d.ts +1 -7
  177. package/dist/Keyboard.d.ts.map +1 -1
  178. package/dist/Keyboard.js +24 -11
  179. package/dist/Keyboard.js.map +1 -1
  180. package/dist/Keyboard.jsx +15 -2
  181. package/dist/Keyboard.jsx.map +1 -1
  182. package/dist/Label.d.ts +20 -0
  183. package/dist/Label.d.ts.map +1 -0
  184. package/dist/Label.js +60 -0
  185. package/dist/Label.js.map +1 -0
  186. package/dist/Label.jsx +47 -0
  187. package/dist/Label.jsx.map +1 -0
  188. package/dist/Landmark.d.ts +4 -1
  189. package/dist/Landmark.d.ts.map +1 -1
  190. package/dist/Landmark.js +10 -4
  191. package/dist/Landmark.js.map +1 -1
  192. package/dist/Landmark.jsx +5 -1
  193. package/dist/Landmark.jsx.map +1 -1
  194. package/dist/Link.d.ts +2 -7
  195. package/dist/Link.d.ts.map +1 -1
  196. package/dist/Link.js +56 -36
  197. package/dist/Link.js.map +1 -1
  198. package/dist/Link.jsx +52 -10
  199. package/dist/Link.jsx.map +1 -1
  200. package/dist/ListBox.d.ts +17 -13
  201. package/dist/ListBox.d.ts.map +1 -1
  202. package/dist/ListBox.js +647 -348
  203. package/dist/ListBox.js.map +1 -1
  204. package/dist/ListBox.jsx +339 -236
  205. package/dist/ListBox.jsx.map +1 -1
  206. package/dist/ListDropTargetDelegate.d.ts +3 -0
  207. package/dist/ListDropTargetDelegate.d.ts.map +1 -1
  208. package/dist/Menu.d.ts +39 -30
  209. package/dist/Menu.d.ts.map +1 -1
  210. package/dist/Menu.js +547 -368
  211. package/dist/Menu.js.map +1 -1
  212. package/dist/Menu.jsx +328 -230
  213. package/dist/Menu.jsx.map +1 -1
  214. package/dist/Meter.d.ts +6 -13
  215. package/dist/Meter.d.ts.map +1 -1
  216. package/dist/Meter.js +55 -18
  217. package/dist/Meter.js.map +1 -1
  218. package/dist/Meter.jsx +33 -8
  219. package/dist/Meter.jsx.map +1 -1
  220. package/dist/Modal.d.ts +1 -7
  221. package/dist/Modal.d.ts.map +1 -1
  222. package/dist/Modal.js +104 -56
  223. package/dist/Modal.js.map +1 -1
  224. package/dist/Modal.jsx +68 -38
  225. package/dist/Modal.jsx.map +1 -1
  226. package/dist/NumberField.d.ts +4 -7
  227. package/dist/NumberField.d.ts.map +1 -1
  228. package/dist/NumberField.js +243 -124
  229. package/dist/NumberField.js.map +1 -1
  230. package/dist/NumberField.jsx +115 -26
  231. package/dist/NumberField.jsx.map +1 -1
  232. package/dist/Popover.d.ts +15 -7
  233. package/dist/Popover.d.ts.map +1 -1
  234. package/dist/Popover.js +370 -181
  235. package/dist/Popover.js.map +1 -1
  236. package/dist/Popover.jsx +215 -82
  237. package/dist/Popover.jsx.map +1 -1
  238. package/dist/Pressable.d.ts +2 -8
  239. package/dist/Pressable.d.ts.map +1 -1
  240. package/dist/Pressable.js +23 -6
  241. package/dist/Pressable.js.map +1 -1
  242. package/dist/Pressable.jsx +22 -5
  243. package/dist/Pressable.jsx.map +1 -1
  244. package/dist/PreviewTrigger.d.ts +24 -0
  245. package/dist/PreviewTrigger.d.ts.map +1 -0
  246. package/dist/PreviewTrigger.js +128 -0
  247. package/dist/PreviewTrigger.js.map +1 -0
  248. package/dist/PreviewTrigger.jsx +117 -0
  249. package/dist/PreviewTrigger.jsx.map +1 -0
  250. package/dist/ProgressBar.d.ts +1 -7
  251. package/dist/ProgressBar.d.ts.map +1 -1
  252. package/dist/ProgressBar.js +34 -14
  253. package/dist/ProgressBar.js.map +1 -1
  254. package/dist/ProgressBar.jsx +17 -3
  255. package/dist/ProgressBar.jsx.map +1 -1
  256. package/dist/RadioGroup.d.ts +2 -7
  257. package/dist/RadioGroup.d.ts.map +1 -1
  258. package/dist/RadioGroup.js +388 -269
  259. package/dist/RadioGroup.js.map +1 -1
  260. package/dist/RadioGroup.jsx +110 -99
  261. package/dist/RadioGroup.jsx.map +1 -1
  262. package/dist/RangeCalendar.d.ts +3 -7
  263. package/dist/RangeCalendar.d.ts.map +1 -1
  264. package/dist/RangeCalendar.js +271 -202
  265. package/dist/RangeCalendar.js.map +1 -1
  266. package/dist/RangeCalendar.jsx +56 -37
  267. package/dist/RangeCalendar.jsx.map +1 -1
  268. package/dist/RouterProvider.d.ts +3 -9
  269. package/dist/RouterProvider.d.ts.map +1 -1
  270. package/dist/RouterProvider.js +15 -14
  271. package/dist/RouterProvider.js.map +1 -1
  272. package/dist/RouterProvider.jsx +14 -13
  273. package/dist/RouterProvider.jsx.map +1 -1
  274. package/dist/SearchField.d.ts +4 -7
  275. package/dist/SearchField.d.ts.map +1 -1
  276. package/dist/SearchField.js +191 -164
  277. package/dist/SearchField.js.map +1 -1
  278. package/dist/SearchField.jsx +69 -62
  279. package/dist/SearchField.jsx.map +1 -1
  280. package/dist/Select.d.ts +5 -10
  281. package/dist/Select.d.ts.map +1 -1
  282. package/dist/Select.js +565 -359
  283. package/dist/Select.js.map +1 -1
  284. package/dist/Select.jsx +281 -161
  285. package/dist/Select.jsx.map +1 -1
  286. package/dist/SelectionIndicator.d.ts +1 -4
  287. package/dist/SelectionIndicator.d.ts.map +1 -1
  288. package/dist/SelectionIndicator.js +29 -13
  289. package/dist/SelectionIndicator.js.map +1 -1
  290. package/dist/SelectionIndicator.jsx +18 -4
  291. package/dist/SelectionIndicator.jsx.map +1 -1
  292. package/dist/Separator.d.ts +1 -7
  293. package/dist/Separator.d.ts.map +1 -1
  294. package/dist/Separator.js +22 -6
  295. package/dist/Separator.js.map +1 -1
  296. package/dist/Separator.jsx +16 -3
  297. package/dist/Separator.jsx.map +1 -1
  298. package/dist/SharedElementTransition.d.ts +1 -10
  299. package/dist/SharedElementTransition.d.ts.map +1 -1
  300. package/dist/SharedElementTransition.js +68 -40
  301. package/dist/SharedElementTransition.js.map +1 -1
  302. package/dist/SharedElementTransition.jsx +49 -25
  303. package/dist/SharedElementTransition.jsx.map +1 -1
  304. package/dist/Slider.d.ts +2 -8
  305. package/dist/Slider.d.ts.map +1 -1
  306. package/dist/Slider.js +155 -97
  307. package/dist/Slider.js.map +1 -1
  308. package/dist/Slider.jsx +25 -12
  309. package/dist/Slider.jsx.map +1 -1
  310. package/dist/StepList.d.ts +1 -7
  311. package/dist/StepList.d.ts.map +1 -1
  312. package/dist/StepList.js +112 -68
  313. package/dist/StepList.js.map +1 -1
  314. package/dist/StepList.jsx +58 -20
  315. package/dist/StepList.jsx.map +1 -1
  316. package/dist/Switch.d.ts +2 -9
  317. package/dist/Switch.d.ts.map +1 -1
  318. package/dist/Switch.js +164 -114
  319. package/dist/Switch.js.map +1 -1
  320. package/dist/Switch.jsx +26 -13
  321. package/dist/Switch.jsx.map +1 -1
  322. package/dist/Table.d.ts +2 -1
  323. package/dist/Table.d.ts.map +1 -1
  324. package/dist/Table.js +689 -592
  325. package/dist/Table.js.map +1 -1
  326. package/dist/Table.jsx +317 -237
  327. package/dist/Table.jsx.map +1 -1
  328. package/dist/Tabs.d.ts +2 -7
  329. package/dist/Tabs.d.ts.map +1 -1
  330. package/dist/Tabs.js +278 -293
  331. package/dist/Tabs.js.map +1 -1
  332. package/dist/Tabs.jsx +68 -66
  333. package/dist/Tabs.jsx.map +1 -1
  334. package/dist/TagGroup.d.ts +4 -11
  335. package/dist/TagGroup.d.ts.map +1 -1
  336. package/dist/TagGroup.js +153 -115
  337. package/dist/TagGroup.js.map +1 -1
  338. package/dist/TagGroup.jsx +37 -24
  339. package/dist/TagGroup.jsx.map +1 -1
  340. package/dist/Text.d.ts +3 -3
  341. package/dist/Text.d.ts.map +1 -1
  342. package/dist/Text.js +24 -7
  343. package/dist/Text.js.map +1 -1
  344. package/dist/Text.jsx +17 -5
  345. package/dist/Text.jsx.map +1 -1
  346. package/dist/TextField.d.ts +3 -16
  347. package/dist/TextField.d.ts.map +1 -1
  348. package/dist/TextField.js +104 -129
  349. package/dist/TextField.js.map +1 -1
  350. package/dist/TextField.jsx +76 -102
  351. package/dist/TextField.jsx.map +1 -1
  352. package/dist/TimeField.d.ts +2 -15
  353. package/dist/TimeField.d.ts.map +1 -1
  354. package/dist/TimeField.js +86 -102
  355. package/dist/TimeField.js.map +1 -1
  356. package/dist/TimeField.jsx +32 -49
  357. package/dist/TimeField.jsx.map +1 -1
  358. package/dist/Toast.d.ts +10 -13
  359. package/dist/Toast.d.ts.map +1 -1
  360. package/dist/Toast.js +209 -108
  361. package/dist/Toast.js.map +1 -1
  362. package/dist/Toast.jsx +127 -22
  363. package/dist/Toast.jsx.map +1 -1
  364. package/dist/ToggleButton.d.ts +1 -7
  365. package/dist/ToggleButton.d.ts.map +1 -1
  366. package/dist/ToggleButton.js +57 -35
  367. package/dist/ToggleButton.js.map +1 -1
  368. package/dist/ToggleButton.jsx +26 -12
  369. package/dist/ToggleButton.jsx.map +1 -1
  370. package/dist/ToggleButtonGroup.d.ts +1 -7
  371. package/dist/ToggleButtonGroup.d.ts.map +1 -1
  372. package/dist/ToggleButtonGroup.js +59 -44
  373. package/dist/ToggleButtonGroup.js.map +1 -1
  374. package/dist/ToggleButtonGroup.jsx +25 -12
  375. package/dist/ToggleButtonGroup.jsx.map +1 -1
  376. package/dist/TokenField.d.ts +52 -0
  377. package/dist/TokenField.d.ts.map +1 -0
  378. package/dist/TokenField.js +301 -0
  379. package/dist/TokenField.js.map +1 -0
  380. package/dist/TokenField.jsx +197 -0
  381. package/dist/TokenField.jsx.map +1 -0
  382. package/dist/Toolbar.d.ts +2 -7
  383. package/dist/Toolbar.d.ts.map +1 -1
  384. package/dist/Toolbar.js +35 -16
  385. package/dist/Toolbar.js.map +1 -1
  386. package/dist/Toolbar.jsx +15 -2
  387. package/dist/Toolbar.jsx.map +1 -1
  388. package/dist/Tooltip.d.ts +2 -7
  389. package/dist/Tooltip.d.ts.map +1 -1
  390. package/dist/Tooltip.js +105 -68
  391. package/dist/Tooltip.js.map +1 -1
  392. package/dist/Tooltip.jsx +60 -36
  393. package/dist/Tooltip.jsx.map +1 -1
  394. package/dist/Tree.d.ts +8 -11
  395. package/dist/Tree.d.ts.map +1 -1
  396. package/dist/Tree.js +486 -339
  397. package/dist/Tree.js.map +1 -1
  398. package/dist/Tree.jsx +155 -107
  399. package/dist/Tree.jsx.map +1 -1
  400. package/dist/Virtualizer.d.ts +39 -9
  401. package/dist/Virtualizer.d.ts.map +1 -1
  402. package/dist/Virtualizer.js +2 -2
  403. package/dist/Virtualizer.jsx +2 -2
  404. package/dist/Virtualizer2.js +491 -136
  405. package/dist/Virtualizer2.js.map +1 -1
  406. package/dist/Virtualizer2.jsx +455 -122
  407. package/dist/Virtualizer2.jsx.map +1 -1
  408. package/dist/VirtualizerLayouts.d.ts +55 -2
  409. package/dist/VirtualizerLayouts.d.ts.map +1 -1
  410. package/dist/VisuallyHidden.d.ts +4 -3
  411. package/dist/VisuallyHidden.d.ts.map +1 -1
  412. package/dist/VisuallyHidden.js +18 -11
  413. package/dist/VisuallyHidden.js.map +1 -1
  414. package/dist/VisuallyHidden.jsx +15 -9
  415. package/dist/VisuallyHidden.jsx.map +1 -1
  416. package/dist/contexts.d.ts +25 -0
  417. package/dist/contexts.d.ts.map +1 -1
  418. package/dist/contexts.js +3 -0
  419. package/dist/contexts.js.map +1 -1
  420. package/dist/contexts.jsx +3 -0
  421. package/dist/contexts.jsx.map +1 -1
  422. package/dist/index.d.ts +11 -9
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +14 -11
  425. package/dist/index.jsx +14 -11
  426. package/dist/intl/index.d.ts +16 -0
  427. package/dist/intl/index.d.ts.map +1 -0
  428. package/dist/intl.js +212 -0
  429. package/dist/intl.js.map +1 -0
  430. package/dist/intl.jsx +212 -0
  431. package/dist/intl.jsx.map +1 -0
  432. package/dist/useDragAndDrop.d.ts +4 -2
  433. package/dist/useDragAndDrop.d.ts.map +1 -1
  434. package/dist/useDragAndDrop2.js +39 -21
  435. package/dist/useDragAndDrop2.js.map +1 -1
  436. package/dist/useDragAndDrop2.jsx +39 -21
  437. package/dist/useDragAndDrop2.jsx.map +1 -1
  438. package/dist/utils.d.ts +28 -9
  439. package/dist/utils.d.ts.map +1 -1
  440. package/dist/utils.js +96 -24
  441. package/dist/utils.js.map +1 -1
  442. package/dist/utils.jsx +81 -24
  443. package/dist/utils.jsx.map +1 -1
  444. package/dist/virtualizer/Layout.d.ts +9 -0
  445. package/dist/virtualizer/Layout.d.ts.map +1 -1
  446. package/dist/virtualizer/Layout.js +23 -2
  447. package/dist/virtualizer/Layout.js.map +1 -1
  448. package/dist/virtualizer/Layout.jsx +23 -2
  449. package/dist/virtualizer/Layout.jsx.map +1 -1
  450. package/package.json +29 -10
  451. package/src/ActionBar.tsx +50 -24
  452. package/src/ActionGroup.tsx +31 -19
  453. package/src/Alert.tsx +10 -4
  454. package/src/Autocomplete.tsx +24 -15
  455. package/src/Breadcrumbs.tsx +32 -16
  456. package/src/Button.tsx +182 -67
  457. package/src/Calendar.tsx +65 -47
  458. package/src/CalendarPicker.tsx +16 -1
  459. package/src/Checkbox.tsx +84 -116
  460. package/src/Collection.tsx +84 -3
  461. package/src/Color.tsx +282 -104
  462. package/src/ColorEditor.tsx +5 -1
  463. package/src/ComboBox.tsx +384 -109
  464. package/src/ContextualHelpTrigger.tsx +47 -41
  465. package/src/DateField.tsx +74 -106
  466. package/src/DatePicker.tsx +156 -352
  467. package/src/DateRangePickerContext.tsx +8 -0
  468. package/src/Dialog.tsx +105 -38
  469. package/src/Disclosure.tsx +29 -19
  470. package/src/DragAndDrop.tsx +43 -8
  471. package/src/DragPreview.tsx +20 -1
  472. package/src/DropZone.tsx +32 -18
  473. package/src/ElementTag.tsx +14 -104
  474. package/src/FieldError.tsx +39 -7
  475. package/src/FileTrigger.tsx +18 -3
  476. package/src/Focusable.tsx +27 -6
  477. package/src/Form.tsx +57 -11
  478. package/src/GridList.tsx +233 -141
  479. package/src/HiddenDateInput.tsx +19 -3
  480. package/src/Icon.tsx +8 -2
  481. package/src/Keyboard.tsx +18 -2
  482. package/src/Label.tsx +77 -0
  483. package/src/Landmark.tsx +6 -1
  484. package/src/Link.tsx +65 -19
  485. package/src/ListBox.tsx +645 -468
  486. package/src/ListDropTargetDelegate.ts +4 -0
  487. package/src/Menu.tsx +512 -349
  488. package/src/Meter.tsx +42 -8
  489. package/src/Modal.tsx +85 -42
  490. package/src/NumberField.tsx +161 -48
  491. package/src/Popover.tsx +424 -148
  492. package/src/Pressable.tsx +27 -6
  493. package/src/PreviewTrigger.tsx +171 -0
  494. package/src/ProgressBar.tsx +25 -3
  495. package/src/RadioGroup.tsx +230 -161
  496. package/src/RangeCalendar.tsx +75 -63
  497. package/src/RouterProvider.tsx +24 -14
  498. package/src/SearchField.tsx +118 -121
  499. package/src/Select.tsx +454 -274
  500. package/src/SelectionIndicator.tsx +21 -3
  501. package/src/Separator.tsx +17 -1
  502. package/src/SharedElementTransition.tsx +115 -97
  503. package/src/Slider.tsx +35 -17
  504. package/src/StepList.tsx +71 -32
  505. package/src/Switch.tsx +45 -29
  506. package/src/Table.tsx +446 -380
  507. package/src/Tabs.tsx +132 -155
  508. package/src/TagGroup.tsx +53 -40
  509. package/src/Text.tsx +23 -6
  510. package/src/TextField.tsx +118 -159
  511. package/src/TimeField.tsx +34 -95
  512. package/src/Toast.tsx +141 -67
  513. package/src/ToggleButton.tsx +33 -15
  514. package/src/ToggleButtonGroup.tsx +27 -9
  515. package/src/TokenField.tsx +379 -0
  516. package/src/Toolbar.tsx +19 -9
  517. package/src/Tooltip.tsx +126 -84
  518. package/src/Tree.tsx +233 -173
  519. package/src/Virtualizer.tsx +400 -138
  520. package/src/VirtualizerLayouts.ts +211 -26
  521. package/src/VisuallyHidden.tsx +22 -8
  522. package/src/contexts.ts +13 -0
  523. package/src/index.ts +32 -11
  524. package/src/intl/ar-AE.json +6 -0
  525. package/src/intl/bg-BG.json +6 -0
  526. package/src/intl/cs-CZ.json +6 -0
  527. package/src/intl/da-DK.json +6 -0
  528. package/src/intl/de-DE.json +6 -0
  529. package/src/intl/el-GR.json +6 -0
  530. package/src/intl/en-US.json +6 -0
  531. package/src/intl/es-ES.json +6 -0
  532. package/src/intl/et-EE.json +6 -0
  533. package/src/intl/fi-FI.json +6 -0
  534. package/src/intl/fr-FR.json +6 -0
  535. package/src/intl/he-IL.json +6 -0
  536. package/src/intl/hr-HR.json +6 -0
  537. package/src/intl/hu-HU.json +6 -0
  538. package/src/intl/index.ts +125 -0
  539. package/src/intl/it-IT.json +6 -0
  540. package/src/intl/ja-JP.json +6 -0
  541. package/src/intl/ko-KR.json +6 -0
  542. package/src/intl/lt-LT.json +6 -0
  543. package/src/intl/lv-LV.json +6 -0
  544. package/src/intl/nb-NO.json +6 -0
  545. package/src/intl/nl-NL.json +6 -0
  546. package/src/intl/pl-PL.json +6 -0
  547. package/src/intl/pt-BR.json +6 -0
  548. package/src/intl/pt-PT.json +6 -0
  549. package/src/intl/ro-RO.json +6 -0
  550. package/src/intl/ru-RU.json +6 -0
  551. package/src/intl/sk-SK.json +6 -0
  552. package/src/intl/sl-SI.json +6 -0
  553. package/src/intl/sr-SP.json +6 -0
  554. package/src/intl/sv-SE.json +6 -0
  555. package/src/intl/tr-TR.json +6 -0
  556. package/src/intl/uk-UA.json +6 -0
  557. package/src/intl/zh-CN.json +6 -0
  558. package/src/intl/zh-TW.json +6 -0
  559. package/src/useDragAndDrop.ts +30 -32
  560. package/src/utils.tsx +124 -68
  561. package/src/virtualizer/Layout.ts +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"RangeCalendar.js","names":["JSX","Accessor","createContext","createMemo","createSignal","splitProps","useContext","For","Index","Show","createRangeCalendar","createCalendarGrid","createRangeCalendarCell","createHover","AriaRangeCalendarProps","AriaCalendarGridProps","createRangeCalendarState","RangeCalendarState","RangeCalendarStateProps","CalendarDate","DateValue","RangeValue","endOfMonth","isSameMonth","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","dataAttr","useIsHydrated","VisuallyHidden","RefLike","el","T","current","assignRef","ref","RangeCalendarRenderProps","isDisabled","isReadOnly","isInvalid","isDragging","RangeCalendarProps","Omit","children","Element","class","style","locale","HTMLDivElement","RangeCalendarGridRenderProps","RangeCalendarGridProps","date","headerCellClass","headerCellStyle","CSSProperties","offset","months","RangeCalendarCellRenderProps","isSelected","isSelectionStart","isSelectionEnd","isFocused","isUnavailable","isOutsideMonth","isToday","isPressed","isHovered","isFirstChild","isLastChild","isFirstWeek","isLastWeek","formattedDate","RangeCalendarCellProps","cellClass","cellStyle","RangeCalendarContext","RangeCalendarStateContext","RangeCalendarGridMonthContext","RangeCalendarGridCellPositionContext","weekIndex","dayIndex","lastWeekIndex","useRangeCalendarContext","context","Error","RangeCalendar","props","inheritedState","isHydrated","_$createComponent","when","fallback","_$getNextElement","_tmpl$","RangeCalendarInner","RangeCalendarWithState","_$mergeProps","state","local","rest","calendarAria","renderValues","isValueInvalid","renderProps","defaultClassName","Provider","value","_el$2","_tmpl$4","_el$5","firstChild","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_el$9","_el$0","_co$3","_$use","_$spread","calendarProps","data-disabled","data-readonly","data-invalid","data-dragging","_$insert","_el$3","_tmpl$2","String","_el$4","_tmpl$3","$$click","focusNextPage","_$effect","_p$","_v$","nextButtonProps","_v$2","Boolean","disabled","e","_$setAttribute","t","_$setProperty","undefined","_$runHydrationEvents","stateProps","_el$1","_el$12","_el$13","_co$4","_el$14","_el$15","_co$5","_el$16","_el$17","_co$6","_el$10","_el$11","_v$3","_v$4","RangeCalendarHeadingProps","RangeCalendarHeading","_el$18","_tmpl$5","title","_v$5","_v$6","_$className","_$style","RangeCalendarButtonProps","slot","RangeCalendarButton","buttonProps","prevButtonProps","_el$19","_tmpl$6","tabindex","RangeCalendarGrid","gridRef","setGridRef","HTMLTableElement","startDate","offsetMonths","baseStart","visibleRange","start","add","gridAria","endDate","weekdayStyle","Parameters","allDates","monthStart","numWeeks","getWeeksInMonth","weekDates","push","getDatesInWeek","_el$20","_tmpl$7","_el$21","_el$22","_el$23","gridProps","headerProps","each","weekDays","day","_el$24","_tmpl$8","_v$7","_v$8","_el$25","_tmpl$9","_tmpl$0","length","RangeCalendarCell","currentMonthStart","cellPosition","cellRef","setCellRef","position","cellAria","hoverProps","cellRenderProps","getChildren","renderChildren","_el$27","_tmpl$1","_el$28","cellProps","data-selected","data-selection-start","data-selection-end","data-focused","data-unavailable","data-outside-month","data-today","data-pressed","data-hovered","_$delegateEvents"],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState\n state={inheritedState as RangeCalendarState<DateValue>}\n {...props}\n />\n </Show>\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n\n const calendarAria = createRangeCalendar(rest, state());\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state()}>\n <RangeCalendarContext.Provider value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;;;AAkDA,SAASoC,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KACH;CAGF,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAqGA,MAAa4C,uBAAuB3E,cAAoD,IAAI;AAC5F,MAAa4E,4BAA4B5E,cAAoD,IAAI;AACjG,MAAM6E,gCAAgC7E,cAA6C,IAAI;AACvF,MAAM8E,uCAAuC9E,cAIlC,IAAI;AAEf,SAAgBkF,0BAAyD;CACvE,MAAMC,UAAU/E,WAAWuE,oBAAoB;CAC/C,IAAI,CAACQ,SACH,MAAM,IAAIC,MAAM,8DAA8D;CAEhF,OAAOD;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgBE,cACdC,OACa;CAMb,MAAMC,iBAAiBnF,WAAWuE,oBAAoB;CAGtD,MAAMa,aAAa5D,cAAc;CAEjC,OAAA6D,gBACGlF,MAAI;EAAA,IACHmF,OAAI;GAAA,OAAEF,WAAW;EAAC;EAAA,IAClBG,WAAQ;GAAA,OAAAC,eAAAC,MAAA;EAAA;EAAA,IAAAlD,WAAA;GAAA,OAAA8C,gBAOPlF,MAAI;IAACmF,MAAMH;IAAc,IAAEI,WAAQ;KAAA,OAAAF,gBAAGK,oBAAuBR,KAAK;IAAA;IAAA,IAAA3C,WAAA;KAAA,OAAA8C,gBAChEM,wBAAsBC,WAAA,EACrBC,OAAOV,eAA+C,GAClDD,KAAK,CAAA;IAAA;GAAA,CAAA;EAAA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K,cAAc;GAAC;GAAA,KAAA,kBAAA;IAAA,OACvCjC,SAASuM,SAASrK,SAAS;GAAC;GAAA,KAAA,mBAAA;IAAA,OAC3BlC,SAASuM,SAAS7L,UAAU;GAAC;GAAA,KAAA,sBAAA;IAAA,OAC1BV,SAASuM,SAASpK,aAAa;GAAC;GAAA,KAAA,kBAAA;IAAA,OACpCnC,SAASuM,SAAS3L,SAAS;GAAC;GAAA,KAAA,wBAAA;IAAA,OACtBZ,SAASuM,SAASnK,cAAc;GAAC;GAAA,KAAA,gBAAA;IAAA,OACzCpC,SAASuM,SAASlK,OAAO;GAAC;GAAA,KAAA,kBAAA;IAAA,OACxBrC,SAASuM,SAASjK,SAAS;GAAC;GAAA,KAAA,kBAAA;IAAA,OAC5BtC,SAASuC,UAAU,CAAC;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAA8D,OAAAyG,QAElCJ,WAAW;EAAAjF,mBAAA;EAAA,OAAAmF;CAAA,EAAA,CAAA;AAIpB;AAE+Ca,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"RangeCalendar.js","names":["<Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>","when={inheritedState}","<RangeCalendarInner {...props} />","<RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />","state={inheritedState as RangeCalendarState<DateValue>}","<RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>","<RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>","ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}","<VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>","{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}","<h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>","<div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>","{props.children}","<VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>","disabled={Boolean(calendarAria.nextButtonProps.disabled)}","<button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />","<RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>","value={state as unknown as RangeCalendarState<DateValue>}","<RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>","<div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>","<VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>","<button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />","{state.title()}","style={props.style}","<h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>","<button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>","<RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>","value={startDate}","ref={setGridRef}","<For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>","style={props.headerCellStyle}","<For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>","keyed={false}","<For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>","<Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>","<td />","<RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>","value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}","<table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>","ref={setCellRef}","{getChildren()}","<td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>"],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 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// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Calendar.tsx\n\n/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Solid adaptation of the pinned RangeCalendar implementation.\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n mergeProps,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell should display a keyboard focus ring. */\n isFocusVisible: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(rest, state(), calendarEl);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(\n rest,\n state as unknown as RangeCalendarState<DateValue>,\n calendarEl,\n );\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isFocusVisible: cellAria.isFocusVisible,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility.\n // `renderChildrenStable` keeps the inner fill node across isFocusVisible flips\n // so Chromium interpolates selected-default → isFocusVisible (D2 open-enter).\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildrenStable();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAS,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAuGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAAoD,IAAI;AACjG,MAAM,gCAAgC,cAA6C,IAAI;AACvF,MAAM,uCAAuC,cAIlC,IAAI;AAEf,SAAgB,0BAAyD;CACvE,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,8DAA8D;CAEhF,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cACd,OACa;CAMb,MAAM,iBAAiB,WAAW,oBAAoB;CAEtD,OACEA,gBAAAA,MAAAA;EAAMC,MAAM;EAAgB,IAAA,WAAA;GAAUC,OAAAA,gBAAAA,oBAAwB,KAAQ;EAAC;EAAvE,IAAA,WAAA;GAC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AAA,kBAAA;GAAe,OAAA,SAAS,SAAS,UAAU;EAAC;EAC5C,IAAA,yBAAA;GAAsB,OAAA,SAAS,SAAS,gBAAgB;EAAC;EACzD,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,kBAAA;GAAe,OAAA,SAAS,SAAS,UAAU;EAAC;EAC5C,IAAA,qBAAA;GAAkB,OAAA,SAAS,SAAS,aAAa;EAAC;EAClD,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,uBAAA;GAAoB,OAAA,SAAS,SAAS,cAAc;EAAC;EACrD,IAAA,eAAA;GAAY,OAAA,SAAS,SAAS,OAAO;EAAC;EACtC,IAAA,iBAAA;GAAc,OAAA,SAAS,SAAS,SAAS;EAAC;EAC1C,IAAA,iBAAA;GAAc,OAAA,SAAS,UAAU,CAAC;EAAC;;CAhBrC,OAAA,QAkBEC,YAAAA;EAAC,OAAA,YAAa;CACX,CAAA,CAAA;CAxBP,mBAyBI;CA1BN,OACEC;AA2BJ"}
@@ -1,16 +1,29 @@
1
- import { dataAttr, useIsHydrated, useRenderProps } from "./utils.jsx";
1
+ /*
2
+ * Copyright 2022 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Calendar.tsx
13
+ import { coerceDomRecord, dataAttr, useRenderProps } from "./utils.jsx";
2
14
  import { VisuallyHidden } from "./VisuallyHidden.jsx";
3
- import { For, Index, Show, createContext, createMemo, createSignal, splitProps, useContext } from "solid-js";
4
- import { createCalendarGrid, createHover, createRangeCalendar, createRangeCalendarCell } from "@proyecto-viviana/solidaria";
15
+ import { For, Show, createContext, createMemo, createSignal, useContext } from "solid-js";
16
+ import { createCalendarGrid, createHover, createRangeCalendar, createRangeCalendarCell, mergeProps } from "@proyecto-viviana/solidaria";
17
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
18
  import { createRangeCalendarState, endOfMonth, isSameMonth } from "@proyecto-viviana/solid-stately";
6
19
  //#region src/RangeCalendar.tsx
7
20
  /**
8
21
  * RangeCalendar component for solidaria-components
9
22
  *
10
23
  * Pre-wired headless range calendar component that combines aria hooks.
11
- * Port of react-aria-components/src/RangeCalendar.tsx
24
+ * Solid adaptation of the pinned RangeCalendar implementation.
12
25
  */
13
- function assignRef(ref, el) {
26
+ function assignRef$1(ref, el) {
14
27
  if (!ref) return;
15
28
  if (typeof ref === "function") ref(el);
16
29
  else ref.current = el;
@@ -43,11 +56,8 @@ function useRangeCalendarContext() {
43
56
  */
44
57
  function RangeCalendar(props) {
45
58
  const inheritedState = useContext(RangeCalendarContext);
46
- const isHydrated = useIsHydrated();
47
- return <Show when={isHydrated()} fallback={<div class="solidaria-RangeCalendar solidaria-RangeCalendar--placeholder" aria-hidden="true" />}>
48
- <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>
49
- <RangeCalendarWithState state={inheritedState} {...props} />
50
- </Show>
59
+ return <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>
60
+ <RangeCalendarWithState state={inheritedState} {...props} />
51
61
  </Show>;
52
62
  }
53
63
  /**
@@ -86,7 +96,8 @@ function RangeCalendarWithState(props) {
86
96
  "firstDayOfWeek"
87
97
  ]);
88
98
  const state = () => props.state;
89
- const calendarAria = createRangeCalendar(rest, state());
99
+ const [calendarEl, setCalendarEl] = createSignal(null);
100
+ const calendarAria = createRangeCalendar(rest, state(), calendarEl);
90
101
  const renderValues = createMemo(() => ({
91
102
  isDisabled: state().isDisabled(),
92
103
  isReadOnly: state().isReadOnly(),
@@ -98,20 +109,23 @@ function RangeCalendarWithState(props) {
98
109
  style: local.style,
99
110
  defaultClassName: "solidaria-RangeCalendar"
100
111
  }, renderValues);
101
- return <RangeCalendarStateContext.Provider value={state()}>
102
- <RangeCalendarContext.Provider value={state()}>
103
- <div {...calendarAria.calendarProps} ref={(el) => assignRef(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state().isDisabled())} data-readonly={dataAttr(state().isReadOnly())} data-invalid={dataAttr(state().isValueInvalid())} data-dragging={dataAttr(state().isDragging())}>
112
+ return <RangeCalendarStateContext value={state()}>
113
+ <RangeCalendarContext value={state()}>
114
+ <div {...calendarAria.calendarProps} ref={(el) => {
115
+ setCalendarEl(el ?? null);
116
+ assignRef$1(local.ref, el);
117
+ }} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state().isDisabled())} data-readonly={dataAttr(state().isReadOnly())} data-invalid={dataAttr(state().isValueInvalid())} data-dragging={dataAttr(state().isDragging())}>
104
118
  <VisuallyHidden>
105
119
  <h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
106
120
  </VisuallyHidden>
107
121
  {props.children}
108
122
  {}
109
123
  <VisuallyHidden>
110
- <button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()} tabIndex={-1} />
124
+ <button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state().focusNextPage()} tabindex={-1} />
111
125
  </VisuallyHidden>
112
126
  </div>
113
- </RangeCalendarContext.Provider>
114
- </RangeCalendarStateContext.Provider>;
127
+ </RangeCalendarContext>
128
+ </RangeCalendarStateContext>;
115
129
  }
116
130
  /**
117
131
  * Internal RangeCalendar component that renders after client mount.
@@ -146,7 +160,8 @@ function RangeCalendarInner(props) {
146
160
  "firstDayOfWeek"
147
161
  ]);
148
162
  const state = createRangeCalendarState(stateProps);
149
- const calendarAria = createRangeCalendar(rest, state);
163
+ const [calendarEl, setCalendarEl] = createSignal(null);
164
+ const calendarAria = createRangeCalendar(rest, state, calendarEl);
150
165
  const renderValues = createMemo(() => ({
151
166
  isDisabled: state.isDisabled(),
152
167
  isReadOnly: state.isReadOnly(),
@@ -158,20 +173,23 @@ function RangeCalendarInner(props) {
158
173
  style: local.style,
159
174
  defaultClassName: "solidaria-RangeCalendar"
160
175
  }, renderValues);
161
- return <RangeCalendarStateContext.Provider value={state}>
162
- <RangeCalendarContext.Provider value={state}>
163
- <div {...calendarAria.calendarProps} ref={(el) => assignRef(local.ref, el)} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-invalid={dataAttr(state.isValueInvalid())} data-dragging={dataAttr(state.isDragging())}>
176
+ return <RangeCalendarStateContext value={state}>
177
+ <RangeCalendarContext value={state}>
178
+ <div {...calendarAria.calendarProps} ref={(el) => {
179
+ setCalendarEl(el ?? null);
180
+ assignRef$1(local.ref, el);
181
+ }} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-invalid={dataAttr(state.isValueInvalid())} data-dragging={dataAttr(state.isDragging())}>
164
182
  <VisuallyHidden>
165
183
  <h2>{String(calendarAria.calendarProps["aria-label"] ?? "")}</h2>
166
184
  </VisuallyHidden>
167
185
  {props.children}
168
186
  {}
169
187
  <VisuallyHidden>
170
- <button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()} tabIndex={-1} />
188
+ <button aria-label={String(calendarAria.nextButtonProps["aria-label"] ?? "")} disabled={Boolean(calendarAria.nextButtonProps.disabled)} onClick={() => state.focusNextPage()} tabindex={-1} />
171
189
  </VisuallyHidden>
172
190
  </div>
173
- </RangeCalendarContext.Provider>
174
- </RangeCalendarStateContext.Provider>;
191
+ </RangeCalendarContext>
192
+ </RangeCalendarStateContext>;
175
193
  }
176
194
  /**
177
195
  * Displays the current month and year in the range calendar.
@@ -226,9 +244,9 @@ function RangeCalendarGrid(props) {
226
244
  for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) weekDates.push(state.getDatesInWeek(weekIndex, monthStart));
227
245
  return weekDates;
228
246
  });
229
- return <RangeCalendarGridMonthContext.Provider value={startDate}>
230
- <table ref={setGridRef} {...gridAria.gridProps} class={renderProps.class()} style={renderProps.style()}>
231
- <thead {...gridAria.headerProps}>
247
+ return <RangeCalendarGridMonthContext value={startDate}>
248
+ <table ref={setGridRef} {...coerceDomRecord(gridAria.gridProps)} class={renderProps.class()} style={renderProps.style()}>
249
+ <thead {...coerceDomRecord(gridAria.headerProps)}>
232
250
  <tr>
233
251
  <For each={gridAria.weekDays}>
234
252
  {(day) => <th scope="col" class={props.headerCellClass ?? "solidaria-RangeCalendarHeaderCell"} style={props.headerCellStyle}>
@@ -238,24 +256,24 @@ function RangeCalendarGrid(props) {
238
256
  </tr>
239
257
  </thead>
240
258
  <tbody>
241
- <Index each={allDates()}>
259
+ <For each={allDates()} keyed={false}>
242
260
  {(weekDates, weekIndex) => <tr>
243
- <Index each={weekDates()}>
261
+ <For each={weekDates()} keyed={false}>
244
262
  {(date, dayIndex) => <Show when={date()} fallback={<td />}>
245
- <RangeCalendarGridCellPositionContext.Provider value={() => ({
263
+ <RangeCalendarGridCellPositionContext value={() => ({
246
264
  weekIndex,
247
265
  dayIndex,
248
266
  lastWeekIndex: allDates().length - 1
249
267
  })}>
250
268
  {props.children?.(date())}
251
- </RangeCalendarGridCellPositionContext.Provider>
269
+ </RangeCalendarGridCellPositionContext>
252
270
  </Show>}
253
- </Index>
271
+ </For>
254
272
  </tr>}
255
- </Index>
273
+ </For>
256
274
  </tbody>
257
275
  </table>
258
- </RangeCalendarGridMonthContext.Provider>;
276
+ </RangeCalendarGridMonthContext>;
259
277
  }
260
278
  /**
261
279
  * A cell in the range calendar grid representing a single day.
@@ -281,6 +299,7 @@ function RangeCalendarCell(props) {
281
299
  isSelectionStart: cellAria.isSelectionStart,
282
300
  isSelectionEnd: cellAria.isSelectionEnd,
283
301
  isFocused: cellAria.isFocused,
302
+ isFocusVisible: cellAria.isFocusVisible,
284
303
  isDisabled: cellAria.isDisabled,
285
304
  isUnavailable: cellAria.isUnavailable,
286
305
  isInvalid: cellAria.isInvalid,
@@ -308,11 +327,11 @@ function RangeCalendarCell(props) {
308
327
  defaultClassName: "solidaria-RangeCalendarCellWrapper"
309
328
  }, renderValues);
310
329
  const getChildren = () => {
311
- if (typeof props.children === "function") return renderProps.renderChildren();
330
+ if (typeof props.children === "function") return renderProps.renderChildrenStable();
312
331
  return cellAria.formattedDate;
313
332
  };
314
- return <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>
315
- <div ref={setCellRef} {...cellAria.buttonProps} {...hoverProps} class={renderProps.class()} style={renderProps.style()} data-selected={dataAttr(cellAria.isSelected)} data-selection-start={dataAttr(cellAria.isSelectionStart)} data-selection-end={dataAttr(cellAria.isSelectionEnd)} data-focused={dataAttr(cellAria.isFocused)} data-disabled={dataAttr(cellAria.isDisabled)} data-unavailable={dataAttr(cellAria.isUnavailable)} data-invalid={dataAttr(cellAria.isInvalid)} data-outside-month={dataAttr(cellAria.isOutsideMonth)} data-today={dataAttr(cellAria.isToday)} data-pressed={dataAttr(cellAria.isPressed)} data-hovered={dataAttr(isHovered())}>
333
+ return <td {...coerceDomRecord(cellAria.cellProps)} class={cellRenderProps.class()} style={cellRenderProps.style()}>
334
+ <div ref={setCellRef} {...mergeProps(cellAria.buttonProps, hoverProps)} class={renderProps.class()} style={renderProps.style()} data-selected={dataAttr(cellAria.isSelected)} data-selection-start={dataAttr(cellAria.isSelectionStart)} data-selection-end={dataAttr(cellAria.isSelectionEnd)} data-focused={dataAttr(cellAria.isFocused)} data-focus-visible={dataAttr(cellAria.isFocusVisible)} data-disabled={dataAttr(cellAria.isDisabled)} data-unavailable={dataAttr(cellAria.isUnavailable)} data-invalid={dataAttr(cellAria.isInvalid)} data-outside-month={dataAttr(cellAria.isOutsideMonth)} data-today={dataAttr(cellAria.isToday)} data-pressed={dataAttr(cellAria.isPressed)} data-hovered={dataAttr(isHovered())}>
316
335
  {getChildren()}
317
336
  </div>
318
337
  </td>;
@@ -1 +1 @@
1
- {"version":3,"file":"RangeCalendar.jsx","names":[],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Port of react-aria-components/src/RangeCalendar.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Index,\n Show,\n} from \"solid-js\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div\n class=\"solidaria-RangeCalendar solidaria-RangeCalendar--placeholder\"\n aria-hidden=\"true\"\n />\n }\n >\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState\n state={inheritedState as RangeCalendarState<DateValue>}\n {...props}\n />\n </Show>\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n\n const calendarAria = createRangeCalendar(rest, state());\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state()}>\n <RangeCalendarContext.Provider value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n\n const calendarAria = createRangeCalendar(rest, state as unknown as RangeCalendarState<DateValue>);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext.Provider value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => assignRef(local.ref, el)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Mirrors react-aria-components\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabIndex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext.Provider>\n </RangeCalendarStateContext.Provider>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext.Provider value={startDate}>\n <table\n ref={setGridRef}\n {...gridAria.gridProps}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...gridAria.headerProps}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Index each={allDates()}>\n {(weekDates, weekIndex) => (\n <tr>\n <Index each={weekDates()}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext.Provider\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext.Provider>\n </Show>\n )}\n </Index>\n </tr>\n )}\n </Index>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext.Provider>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td {...cellAria.cellProps} class={cellRenderProps.class()} style={cellRenderProps.style()}>\n <div\n ref={setCellRef}\n {...cellAria.buttonProps}\n {...hoverProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAqGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAAoD,IAAI;AACjG,MAAM,gCAAgC,cAA6C,IAAI;AACvF,MAAM,uCAAuC,cAIlC,IAAI;AAEf,SAAgB,0BAAyD;CACvE,MAAM,UAAU,WAAW,oBAAoB;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,8DAA8D;CAEhF,OAAO;AACT;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,cACd,OACa;CAMb,MAAM,iBAAiB,WAAW,oBAAoB;CAGtD,MAAM,aAAa,cAAc;CAEjC,OACE,CAAC,KACC,MAAM,WAAW,GACjB,UACE,CAAC,IACC,qEACA,uBAGL;MACC,CAAC,KAAK,MAAM,gBAAgB,UAAU,CAAC,uBAAuB,WAAW;QACvE,CAAC,uBACC,OAAO,oBACH,SACJ;MACJ,EAAE,KAAK;IACT,EAAE;AAEN;;;;;;AAOA,SAAS,uBACP,OACa;CACb,MAAM,CAAC,SAAS,QAAQ,WACtB,OACA;EAAC;EAAY;EAAS;EAAS;EAAQ;EAAS;CAAK,GACrD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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U,GAC3C,sBAAsB,SAAS,SAAS,gBAAgB,GACxD,oBAAoB,SAAS,SAAS,cAAc,GACpD,cAAc,SAAS,SAAS,SAAS,GACzC,eAAe,SAAS,SAAS,UAAU,GAC3C,kBAAkB,SAAS,SAAS,aAAa,GACjD,cAAc,SAAS,SAAS,SAAS,GACzC,oBAAoB,SAAS,SAAS,cAAc,GACpD,YAAY,SAAS,SAAS,OAAO,GACrC,cAAc,SAAS,SAAS,SAAS,GACzC,cAAc,SAAS,UAAU,CAAC,GACnC;SACE,YAAY,EAAE;MACjB,EAAE,IAAI;IACR,EAAE;AAEN"}
1
+ {"version":3,"file":"RangeCalendar.jsx","names":["assignRef"],"sources":["../src/RangeCalendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 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// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Calendar.tsx\n\n/**\n * RangeCalendar component for solidaria-components\n *\n * Pre-wired headless range calendar component that combines aria hooks.\n * Solid adaptation of the pinned RangeCalendar implementation.\n */\n\nimport { createContext, createMemo, createSignal, useContext, For, Show } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createRangeCalendar,\n createCalendarGrid,\n createRangeCalendarCell,\n createHover,\n mergeProps,\n type AriaRangeCalendarProps,\n type AriaCalendarGridProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createRangeCalendarState,\n type RangeCalendarState,\n type RangeCalendarStateProps,\n type CalendarDate,\n type DateValue,\n type RangeValue,\n endOfMonth,\n isSameMonth,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface RangeCalendarRenderProps {\n /** Whether the calendar is disabled. */\n isDisabled: boolean;\n /** Whether the calendar is read-only. */\n isReadOnly: boolean;\n /** Whether the current selection is invalid. */\n isInvalid: boolean;\n /** Whether the user is currently selecting a range. */\n isDragging: boolean;\n}\n\nexport interface RangeCalendarProps<T extends DateValue = DateValue>\n extends\n Omit<AriaRangeCalendarProps, \"id\" | \"isDisabled\" | \"isReadOnly\">,\n Omit<RangeCalendarStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n /** Ref for the range calendar root element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface RangeCalendarGridRenderProps {\n /** Whether the grid is disabled. */\n isDisabled: boolean;\n}\n\nexport interface RangeCalendarGridProps\n extends Omit<AriaCalendarGridProps, \"startDate\" | \"endDate\">, SlotProps {\n /** The children of the component (render function receiving dates). */\n children?: (date: CalendarDate) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarGridRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarGridRenderProps>;\n /** Class name for weekday header cells. */\n headerCellClass?: string;\n /** Inline style for weekday header cells. */\n headerCellStyle?: JSX.CSSProperties;\n /** Number of months to offset from the start. */\n offset?: { months?: number };\n}\n\nexport interface RangeCalendarCellRenderProps {\n /** Whether the cell is within the selected range. */\n isSelected: boolean;\n /** Whether the cell is the start of the selection. */\n isSelectionStart: boolean;\n /** Whether the cell is the end of the selection. */\n isSelectionEnd: boolean;\n /** Whether the cell is focused. */\n isFocused: boolean;\n /** Whether the cell should display a keyboard focus ring. */\n isFocusVisible: boolean;\n /** Whether the cell is disabled. */\n isDisabled: boolean;\n /** Whether the cell is unavailable. */\n isUnavailable: boolean;\n /** Whether the cell is part of an invalid selection. */\n isInvalid: boolean;\n /** Whether the cell is outside the visible month. */\n isOutsideMonth: boolean;\n /** Whether the cell represents today. */\n isToday: boolean;\n /** Whether the cell is pressed. */\n isPressed: boolean;\n /** Whether the cell is hovered. */\n isHovered: boolean;\n /** Whether the cell is the first day slot in its row. */\n isFirstChild: boolean;\n /** Whether the cell is the last day slot in its row. */\n isLastChild: boolean;\n /** Whether the cell is in the first rendered week row. */\n isFirstWeek: boolean;\n /** Whether the cell is in the last rendered week row. */\n isLastWeek: boolean;\n /** The formatted date string. */\n formattedDate: string;\n}\n\nexport interface RangeCalendarCellProps extends SlotProps {\n /** The date for this cell. */\n date: CalendarDate;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<RangeCalendarCellRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<RangeCalendarCellRenderProps>;\n /** Class name for the table cell wrapper. */\n cellClass?: ClassNameOrFunction<RangeCalendarCellRenderProps>;\n /** Inline style for the table cell wrapper. */\n cellStyle?: StyleOrFunction<RangeCalendarCellRenderProps>;\n}\n\nexport const RangeCalendarContext = createContext<RangeCalendarState<DateValue> | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState<DateValue> | null>(null);\nconst RangeCalendarGridMonthContext = createContext<Accessor<CalendarDate> | null>(null);\nconst RangeCalendarGridCellPositionContext = createContext<Accessor<{\n weekIndex: number;\n dayIndex: number;\n lastWeekIndex: number;\n}> | null>(null);\n\nexport function useRangeCalendarContext(): RangeCalendarState<DateValue> {\n const context = useContext(RangeCalendarContext);\n if (!context) {\n throw new Error(\"RangeCalendar components must be used within a RangeCalendar\");\n }\n return context;\n}\n\n/**\n * A range calendar displays a grid of days and allows users to select a contiguous range of dates.\n *\n * @example\n * ```tsx\n * <RangeCalendar aria-label=\"Date range\">\n * <header>\n * <RangeCalendarButton slot=\"previous\">◀</RangeCalendarButton>\n * <RangeCalendarHeading />\n * <RangeCalendarButton slot=\"next\">▶</RangeCalendarButton>\n * </header>\n * <RangeCalendarGrid>\n * {(date) => <RangeCalendarCell date={date} />}\n * </RangeCalendarGrid>\n * </RangeCalendar>\n * ```\n */\nexport function RangeCalendar<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n // When rendered inside a composite that owns the range state (e.g.\n // DateRangePicker provides `RangeCalendarContext`), reuse that shared state\n // instead of minting a fresh one — otherwise the composite's focus/anchor\n // flags (e.g. the popover-open `setFocused(true)`) drive a different state\n // instance than the one this grid renders. Mirrors the single `Calendar`.\n const inheritedState = useContext(RangeCalendarContext);\n\n return (\n <Show when={inheritedState} fallback={<RangeCalendarInner {...props} />}>\n <RangeCalendarWithState state={inheritedState as RangeCalendarState<DateValue>} {...props} />\n </Show>\n );\n}\n\n/**\n * RangeCalendar variant that renders against an externally-owned state (from\n * `RangeCalendarContext`) rather than creating its own. Mirrors the single\n * `CalendarWithState`.\n */\nfunction RangeCalendarWithState<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T> & { state: RangeCalendarState<DateValue> },\n): JSX.Element {\n const [local, , rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"state\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = () => props.state;\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(rest, state(), calendarEl);\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state().isDisabled(),\n isReadOnly: state().isReadOnly(),\n isInvalid: state().isValueInvalid(),\n isDragging: state().isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state()}>\n <RangeCalendarContext value={state()}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state().isDisabled())}\n data-readonly={dataAttr(state().isReadOnly())}\n data-invalid={dataAttr(state().isValueInvalid())}\n data-dragging={dataAttr(state().isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state().focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\n/**\n * Internal RangeCalendar component that renders after client mount.\n */\nfunction RangeCalendarInner<T extends DateValue = CalendarDate>(\n props: RangeCalendarProps<T>,\n): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isDisabled\",\n \"isReadOnly\",\n \"focusedValue\",\n \"defaultFocusedValue\",\n \"onFocusChange\",\n \"locale\",\n \"createCalendar\",\n \"isDateUnavailable\",\n \"visibleMonths\",\n \"pageBehavior\",\n \"selectionAlignment\",\n \"isDateDisabled\",\n \"validationState\",\n \"allowsNonContiguousRanges\",\n \"firstDayOfWeek\",\n ],\n );\n\n const state = createRangeCalendarState(stateProps);\n const [calendarEl, setCalendarEl] = createSignal<HTMLDivElement | null>(null);\n\n const calendarAria = createRangeCalendar(\n rest,\n state as unknown as RangeCalendarState<DateValue>,\n calendarEl,\n );\n\n const renderValues = createMemo<RangeCalendarRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isInvalid: state.isValueInvalid(),\n isDragging: state.isDragging(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-RangeCalendar\",\n },\n renderValues,\n );\n\n return (\n <RangeCalendarStateContext value={state as unknown as RangeCalendarState<DateValue>}>\n <RangeCalendarContext value={state as unknown as RangeCalendarState<DateValue>}>\n <div\n {...calendarAria.calendarProps}\n ref={(el) => {\n setCalendarEl(el ?? null);\n assignRef(local.ref, el);\n }}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-invalid={dataAttr(state.isValueInvalid())}\n data-dragging={dataAttr(state.isDragging())}\n >\n <VisuallyHidden>\n <h2>{String(calendarAria.calendarProps[\"aria-label\"] ?? \"\")}</h2>\n </VisuallyHidden>\n {props.children}\n {/* For touch screen readers, a visually hidden next button after the\n * month grid so it's easy to navigate after reaching the end without\n * going all the way back to the start. Matches the upstream component\n * Calendar (and the headless Calendar). */}\n <VisuallyHidden>\n <button\n aria-label={String(calendarAria.nextButtonProps[\"aria-label\"] ?? \"\")}\n disabled={Boolean(calendarAria.nextButtonProps.disabled)}\n onClick={() => state.focusNextPage()}\n tabindex={-1}\n />\n </VisuallyHidden>\n </div>\n </RangeCalendarContext>\n </RangeCalendarStateContext>\n );\n}\n\nexport interface RangeCalendarHeadingProps extends SlotProps {\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\n/**\n * Displays the current month and year in the range calendar.\n */\nexport function RangeCalendarHeading(props: RangeCalendarHeadingProps): JSX.Element {\n const state = useRangeCalendarContext();\n\n return (\n <h2\n class={props.class ?? \"solidaria-RangeCalendarHeading\"}\n style={props.style}\n aria-live=\"polite\"\n >\n {state.title()}\n </h2>\n );\n}\n\nexport interface RangeCalendarButtonProps extends SlotProps {\n /** The slot for this button (previous or next). */\n slot?: \"previous\" | \"next\";\n /** The children of the component. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n /** Whether the button is disabled. */\n isDisabled?: boolean;\n}\n\n/**\n * A button for navigating the range calendar.\n */\nexport function RangeCalendarButton(props: RangeCalendarButtonProps): JSX.Element {\n const state = useRangeCalendarContext();\n const calendarAria = createRangeCalendar({}, state);\n\n const buttonProps = createMemo(() => {\n if (props.slot === \"previous\") {\n return calendarAria.prevButtonProps;\n }\n return calendarAria.nextButtonProps;\n });\n const isDisabled = createMemo(\n () => props.isDisabled || Boolean(buttonProps().disabled) || state.isDisabled(),\n );\n\n return (\n <button\n {...buttonProps()}\n class={props.class ?? \"solidaria-RangeCalendarButton\"}\n style={props.style}\n disabled={isDisabled()}\n // Mirror useFocusable (same as CalendarButton): always set an explicit\n // tabIndex on an enabled focusable nav button (0), and drop it entirely\n // when disabled — so the prev/next buttons appear in the roving tab order\n // exactly as the S2 oracle does.\n tabindex={isDisabled() ? undefined : 0}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * Displays a grid of range calendar cells.\n */\nexport function RangeCalendarGrid(props: RangeCalendarGridProps): JSX.Element {\n const state = useRangeCalendarContext();\n const [gridRef, setGridRef] = createSignal<HTMLTableElement | null>(null);\n const startDate = createMemo(() => {\n const offsetMonths = props.offset?.months ?? 0;\n const baseStart = state.visibleRange().start;\n return offsetMonths ? baseStart.add({ months: offsetMonths }) : baseStart;\n });\n\n const gridAria = createCalendarGrid(\n {\n startDate: startDate(),\n endDate: endOfMonth(startDate()),\n weekdayStyle: props.weekdayStyle,\n },\n state as unknown as Parameters<typeof createCalendarGrid>[1],\n gridRef,\n );\n\n const renderValues = createMemo<RangeCalendarGridRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarGrid\",\n },\n renderValues,\n );\n\n // Memoize all dates for the grid to avoid reactive loops in render paths.\n const allDates = createMemo(() => {\n const monthStart = startDate();\n const numWeeks = state.getWeeksInMonth(monthStart);\n const weekDates: (CalendarDate | null)[][] = [];\n\n for (let weekIndex = 0; weekIndex < numWeeks; weekIndex++) {\n weekDates.push(state.getDatesInWeek(weekIndex, monthStart));\n }\n\n return weekDates;\n });\n\n return (\n <RangeCalendarGridMonthContext value={startDate}>\n <table\n ref={setGridRef}\n {...coerceDomRecord(gridAria.gridProps as Record<string, unknown>)}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n <thead {...coerceDomRecord(gridAria.headerProps as Record<string, unknown>)}>\n <tr>\n <For each={gridAria.weekDays}>\n {(day) => (\n <th\n scope=\"col\"\n class={props.headerCellClass ?? \"solidaria-RangeCalendarHeaderCell\"}\n style={props.headerCellStyle}\n >\n {day}\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={allDates()} keyed={false}>\n {(weekDates, weekIndex) => (\n <tr>\n <For each={weekDates()} keyed={false}>\n {(date, dayIndex) => (\n <Show when={date()} fallback={<td />}>\n <RangeCalendarGridCellPositionContext\n value={() => ({\n weekIndex,\n dayIndex,\n lastWeekIndex: allDates().length - 1,\n })}\n >\n {props.children?.(date()!)}\n </RangeCalendarGridCellPositionContext>\n </Show>\n )}\n </For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n </RangeCalendarGridMonthContext>\n );\n}\n\n/**\n * A cell in the range calendar grid representing a single day.\n */\nexport function RangeCalendarCell(props: RangeCalendarCellProps): JSX.Element {\n const state = useRangeCalendarContext();\n const currentMonthStart = useContext(RangeCalendarGridMonthContext);\n const cellPosition = useContext(RangeCalendarGridCellPositionContext);\n const [cellRef, setCellRef] = createSignal<HTMLDivElement | null>(null);\n const isOutsideMonth = createMemo(\n () => currentMonthStart != null && !isSameMonth(currentMonthStart(), props.date),\n );\n const position = createMemo(\n () =>\n cellPosition?.() ?? {\n weekIndex: 0,\n dayIndex: 0,\n lastWeekIndex: 0,\n },\n );\n\n const cellAria = createRangeCalendarCell(\n () => ({\n date: props.date,\n isOutsideMonth: isOutsideMonth(),\n }),\n state,\n cellRef,\n );\n const { hoverProps, isHovered } = createHover(() => ({\n isDisabled: cellAria.isDisabled || cellAria.isUnavailable,\n }));\n\n const renderValues = createMemo<RangeCalendarCellRenderProps>(() => ({\n isSelected: cellAria.isSelected,\n isSelectionStart: cellAria.isSelectionStart,\n isSelectionEnd: cellAria.isSelectionEnd,\n isFocused: cellAria.isFocused,\n isFocusVisible: cellAria.isFocusVisible,\n isDisabled: cellAria.isDisabled,\n isUnavailable: cellAria.isUnavailable,\n isInvalid: cellAria.isInvalid,\n isOutsideMonth: cellAria.isOutsideMonth,\n isToday: cellAria.isToday,\n isPressed: cellAria.isPressed,\n isHovered: isHovered(),\n isFirstChild: position().dayIndex === 0,\n isLastChild: position().dayIndex === 6,\n isFirstWeek: position().weekIndex === 0,\n isLastWeek: position().weekIndex === position().lastWeekIndex,\n formattedDate: cellAria.formattedDate,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-RangeCalendarCell\",\n },\n renderValues,\n );\n const cellRenderProps = useRenderProps(\n {\n class: props.cellClass,\n style: props.cellStyle,\n defaultClassName: \"solidaria-RangeCalendarCellWrapper\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility.\n // `renderChildrenStable` keeps the inner fill node across isFocusVisible flips\n // so Chromium interpolates selected-default → isFocusVisible (D2 open-enter).\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildrenStable();\n }\n return cellAria.formattedDate;\n };\n\n return (\n <td\n {...coerceDomRecord(cellAria.cellProps as Record<string, unknown>)}\n class={cellRenderProps.class()}\n style={cellRenderProps.style()}\n >\n <div\n ref={setCellRef}\n {...mergeProps(cellAria.buttonProps, hoverProps)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(cellAria.isSelected)}\n data-selection-start={dataAttr(cellAria.isSelectionStart)}\n data-selection-end={dataAttr(cellAria.isSelectionEnd)}\n data-focused={dataAttr(cellAria.isFocused)}\n data-focus-visible={dataAttr(cellAria.isFocusVisible)}\n data-disabled={dataAttr(cellAria.isDisabled)}\n data-unavailable={dataAttr(cellAria.isUnavailable)}\n data-invalid={dataAttr(cellAria.isInvalid)}\n data-outside-month={dataAttr(cellAria.isOutsideMonth)}\n data-today={dataAttr(cellAria.isToday)}\n data-pressed={dataAttr(cellAria.isPressed)}\n data-hovered={dataAttr(isHovered())}\n >\n {getChildren()}\n </div>\n </td>\n );\n}\n\nexport type { RangeCalendarState, RangeValue };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAASA,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KACH;CAGF,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AAuGA,MAAa,uBAAuB,cAAoD,IAAI;AAC5F,MAAa,4BAA4B,cAA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,UAAU;EACrB,cAAc,SAAS,CAAC,CAAC,aAAa;EACtC,aAAa,SAAS,CAAC,CAAC,aAAa;EACrC,aAAa,SAAS,CAAC,CAAC,cAAc;EACtC,YAAY,SAAS,CAAC,CAAC,cAAc,SAAS,CAAC,CAAC;EAChD,eAAe,SAAS;CAC1B,EAAE;CAEF,MAAM,cAAc,eAClB;EACE,IAAI,WAAW;GACb,OAAO,MAAM;EACf;EACA,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,GACA,YACF;CACA,MAAM,kBAAkB,eACtB;EACE,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,GACA,YACF;CAKA,MAAM,oBAAoB;EACxB,IAAI,OAAO,MAAM,aAAa,YAC5B,OAAO,YAAY,qBAAqB;EAE1C,OAAO,SAAS;CAClB;CAEA,OACE,CAAC,OACK,gBAAgB,SAAS,SAAoC,GACjE,OAAO,gBAAgB,MAAM,GAC7B,OAAO,gBAAgB,MAAM,GAC9B;MACC,CAAC,IACC,KAAK,gBACD,WAAW,SAAS,aAAa,UAAU,GAC/C,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,eAAe,SAAS,SAAS,UAAU,GAC3C,sBAAsB,SAAS,SAAS,gBAAgB,GACxD,oBAAoB,SAAS,SAAS,cAAc,GACpD,cAAc,SAAS,SAAS,SAAS,GACzC,oBAAoB,SAAS,SAAS,cAAc,GACpD,eAAe,SAAS,SAAS,UAAU,GAC3C,kBAAkB,SAAS,SAAS,aAAa,GACjD,cAAc,SAAS,SAAS,SAAS,GACzC,oBAAoB,SAAS,SAAS,cAAc,GACpD,YAAY,SAAS,SAAS,OAAO,GACrC,cAAc,SAAS,SAAS,SAAS,GACzC,cAAc,SAAS,UAAU,CAAC,GACnC;SACE,YAAY,EAAE;MACjB,EAAE,IAAI;IACR,EAAE;AAEN"}
@@ -1,11 +1,5 @@
1
- /**
2
- * RouterProvider for solidaria-components
3
- *
4
- * A context provider for client-side router integration.
5
- * SolidJS apps typically use TanStack Router or SolidRouter directly;
6
- * this provides API compatibility with React Aria's RouterProvider.
7
- */
8
- import { type JSX } from "solid-js";
1
+ import { openLink } from "@proyecto-viviana/solidaria/utils";
2
+ import type { JSX } from "@solidjs/web";
9
3
  export interface RouterClickModifiers {
10
4
  metaKey?: boolean;
11
5
  ctrlKey?: boolean;
@@ -46,7 +40,7 @@ export interface LinkDOMProps {
46
40
  referrerPolicy?: "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
47
41
  }
48
42
  export declare function shouldClientNavigate(link: HTMLAnchorElement, modifiers: RouterClickModifiers): boolean;
49
- export declare function openLink(target: HTMLAnchorElement, modifiers: RouterClickModifiers): void;
43
+ export { openLink };
50
44
  export declare function useLinkProps(props?: LinkDOMProps): LinkDOMProps;
51
45
  export declare function handleLinkClick(event: MouseEvent, router: RouterContextValue, href: string | undefined, routerOptions?: RouterOptions): void;
52
46
  /**