@senvenli/react 0.0.0-stage → 0.2.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 (636) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -2
  3. package/dist/action/button-group.d.ts +26 -0
  4. package/dist/action/button-group.js +12 -0
  5. package/dist/action/button-group.js.map +1 -0
  6. package/dist/action/button.d.ts +42 -0
  7. package/dist/action/button.js +58 -0
  8. package/dist/action/button.js.map +1 -0
  9. package/dist/action/close-button.d.ts +12 -0
  10. package/dist/action/close-button.js +13 -0
  11. package/dist/action/close-button.js.map +1 -0
  12. package/dist/action/copy-button.d.ts +21 -0
  13. package/dist/action/copy-button.js +38 -0
  14. package/dist/action/copy-button.js.map +1 -0
  15. package/dist/action/fab.d.ts +29 -0
  16. package/dist/action/fab.js +57 -0
  17. package/dist/action/fab.js.map +1 -0
  18. package/dist/action/files.d.ts +70 -0
  19. package/dist/action/files.js +156 -0
  20. package/dist/action/files.js.map +1 -0
  21. package/dist/action/index.d.ts +23 -0
  22. package/dist/action/index.js +16 -0
  23. package/dist/action/index.js.map +1 -0
  24. package/dist/action/language-names.d.ts +19 -0
  25. package/dist/action/language-names.js +79 -0
  26. package/dist/action/language-names.js.map +1 -0
  27. package/dist/action/language-switcher.d.ts +57 -0
  28. package/dist/action/language-switcher.js +53 -0
  29. package/dist/action/language-switcher.js.map +1 -0
  30. package/dist/action/link-button.d.ts +57 -0
  31. package/dist/action/link-button.js +48 -0
  32. package/dist/action/link-button.js.map +1 -0
  33. package/dist/action/link.d.ts +24 -0
  34. package/dist/action/link.js +18 -0
  35. package/dist/action/link.js.map +1 -0
  36. package/dist/action/pressable.d.ts +40 -0
  37. package/dist/action/pressable.js +65 -0
  38. package/dist/action/pressable.js.map +1 -0
  39. package/dist/action/styles.d.ts +60 -0
  40. package/dist/action/styles.js +109 -0
  41. package/dist/action/styles.js.map +1 -0
  42. package/dist/action/theme-script.d.ts +12 -0
  43. package/dist/action/theme-script.js +23 -0
  44. package/dist/action/theme-script.js.map +1 -0
  45. package/dist/action/theme-switcher.d.ts +43 -0
  46. package/dist/action/theme-switcher.js +260 -0
  47. package/dist/action/theme-switcher.js.map +1 -0
  48. package/dist/action/theme-toggle.d.ts +43 -0
  49. package/dist/action/theme-toggle.js +259 -0
  50. package/dist/action/theme-toggle.js.map +1 -0
  51. package/dist/action/toggle.d.ts +44 -0
  52. package/dist/action/toggle.js +28 -0
  53. package/dist/action/toggle.js.map +1 -0
  54. package/dist/action/touch-target.d.ts +9 -0
  55. package/dist/action/touch-target.js +14 -0
  56. package/dist/action/touch-target.js.map +1 -0
  57. package/dist/charts/axis-width.d.ts +186 -0
  58. package/dist/charts/axis-width.js +1262 -0
  59. package/dist/charts/axis-width.js.map +1 -0
  60. package/dist/charts/bar-public.d.ts +16 -0
  61. package/dist/charts/bar-public.js +16 -0
  62. package/dist/charts/bar-public.js.map +1 -0
  63. package/dist/charts/chart-parts.d.ts +136 -0
  64. package/dist/charts/chart-parts.js +160 -0
  65. package/dist/charts/chart-parts.js.map +1 -0
  66. package/dist/charts/core-charts.d.ts +157 -0
  67. package/dist/charts/core-charts.js +505 -0
  68. package/dist/charts/core-charts.js.map +1 -0
  69. package/dist/charts/index.d.ts +12 -0
  70. package/dist/charts/index.js +8 -0
  71. package/dist/charts/index.js.map +1 -0
  72. package/dist/charts/list-charts.d.ts +124 -0
  73. package/dist/charts/list-charts.js +308 -0
  74. package/dist/charts/list-charts.js.map +1 -0
  75. package/dist/charts/more-charts.d.ts +138 -0
  76. package/dist/charts/more-charts.js +284 -0
  77. package/dist/charts/more-charts.js.map +1 -0
  78. package/dist/charts/report-charts.d.ts +138 -0
  79. package/dist/charts/report-charts.js +370 -0
  80. package/dist/charts/report-charts.js.map +1 -0
  81. package/dist/charts/value-tick.d.ts +178 -0
  82. package/dist/charts/value-tick.js +240 -0
  83. package/dist/charts/value-tick.js.map +1 -0
  84. package/dist/collection/data-table-url-hook.d.ts +34 -0
  85. package/dist/collection/data-table-url-hook.js +70 -0
  86. package/dist/collection/data-table-url-hook.js.map +1 -0
  87. package/dist/collection/data-table-url.d.ts +30 -0
  88. package/dist/collection/data-table-url.js +48 -0
  89. package/dist/collection/data-table-url.js.map +1 -0
  90. package/dist/collection/data-table.d.ts +112 -0
  91. package/dist/collection/data-table.js +188 -0
  92. package/dist/collection/data-table.js.map +1 -0
  93. package/dist/collection/grid-list-public.d.ts +18 -0
  94. package/dist/collection/grid-list-public.js +19 -0
  95. package/dist/collection/grid-list-public.js.map +1 -0
  96. package/dist/collection/grid-list.d.ts +73 -0
  97. package/dist/collection/grid-list.js +46 -0
  98. package/dist/collection/grid-list.js.map +1 -0
  99. package/dist/collection/index.d.ts +14 -0
  100. package/dist/collection/index.js +8 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/list.d.ts +61 -0
  103. package/dist/collection/list.js +38 -0
  104. package/dist/collection/list.js.map +1 -0
  105. package/dist/collection/selection-checkbox.d.ts +5 -0
  106. package/dist/collection/selection-checkbox.js +13 -0
  107. package/dist/collection/selection-checkbox.js.map +1 -0
  108. package/dist/collection/table.d.ts +91 -0
  109. package/dist/collection/table.js +183 -0
  110. package/dist/collection/table.js.map +1 -0
  111. package/dist/collection/tree.d.ts +31 -0
  112. package/dist/collection/tree.js +22 -0
  113. package/dist/collection/tree.js.map +1 -0
  114. package/dist/color/color.d.ts +87 -0
  115. package/dist/color/color.js +200 -0
  116. package/dist/color/color.js.map +1 -0
  117. package/dist/color/contrast.d.ts +34 -0
  118. package/dist/color/contrast.js +44 -0
  119. package/dist/color/contrast.js.map +1 -0
  120. package/dist/color/index.d.ts +4 -0
  121. package/dist/color/index.js +5 -0
  122. package/dist/color/index.js.map +1 -0
  123. package/dist/date/calendar.d.ts +71 -0
  124. package/dist/date/calendar.js +291 -0
  125. package/dist/date/calendar.js.map +1 -0
  126. package/dist/date/fields.d.ts +174 -0
  127. package/dist/date/fields.js +250 -0
  128. package/dist/date/fields.js.map +1 -0
  129. package/dist/date/index.d.ts +7 -0
  130. package/dist/date/index.js +6 -0
  131. package/dist/date/index.js.map +1 -0
  132. package/dist/date/month-grid.d.ts +31 -0
  133. package/dist/date/month-grid.js +115 -0
  134. package/dist/date/month-grid.js.map +1 -0
  135. package/dist/date/pickers.d.ts +118 -0
  136. package/dist/date/pickers.js +176 -0
  137. package/dist/date/pickers.js.map +1 -0
  138. package/dist/date/public.d.ts +25 -0
  139. package/dist/date/public.js +24 -0
  140. package/dist/date/public.js.map +1 -0
  141. package/dist/date/segments.d.ts +153 -0
  142. package/dist/date/segments.js +433 -0
  143. package/dist/date/segments.js.map +1 -0
  144. package/dist/defaults.d.ts +74 -0
  145. package/dist/defaults.js +100 -0
  146. package/dist/defaults.js.map +1 -0
  147. package/dist/density.d.ts +2 -0
  148. package/dist/density.js +2 -0
  149. package/dist/density.js.map +1 -0
  150. package/dist/display/avatar.d.ts +29 -0
  151. package/dist/display/avatar.js +71 -0
  152. package/dist/display/avatar.js.map +1 -0
  153. package/dist/display/badge.d.ts +65 -0
  154. package/dist/display/badge.js +99 -0
  155. package/dist/display/badge.js.map +1 -0
  156. package/dist/display/card.d.ts +72 -0
  157. package/dist/display/card.js +91 -0
  158. package/dist/display/card.js.map +1 -0
  159. package/dist/display/carousel.d.ts +47 -0
  160. package/dist/display/carousel.js +214 -0
  161. package/dist/display/carousel.js.map +1 -0
  162. package/dist/display/description-list.d.ts +25 -0
  163. package/dist/display/description-list.js +36 -0
  164. package/dist/display/description-list.js.map +1 -0
  165. package/dist/display/icon-aliases.d.ts +1 -0
  166. package/dist/display/icon-aliases.js +259 -0
  167. package/dist/display/icon-aliases.js.map +1 -0
  168. package/dist/display/icon-names.d.ts +4 -0
  169. package/dist/display/icon-names.js +2 -0
  170. package/dist/display/icon-names.js.map +1 -0
  171. package/dist/display/icon.d.ts +51 -0
  172. package/dist/display/icon.js +96 -0
  173. package/dist/display/icon.js.map +1 -0
  174. package/dist/display/image-crop.d.ts +106 -0
  175. package/dist/display/image-crop.js +117 -0
  176. package/dist/display/image-crop.js.map +1 -0
  177. package/dist/display/image-cropper.d.ts +68 -0
  178. package/dist/display/image-cropper.js +284 -0
  179. package/dist/display/image-cropper.js.map +1 -0
  180. package/dist/display/image-viewer.d.ts +54 -0
  181. package/dist/display/image-viewer.js +84 -0
  182. package/dist/display/image-viewer.js.map +1 -0
  183. package/dist/display/image.d.ts +26 -0
  184. package/dist/display/image.js +17 -0
  185. package/dist/display/image.js.map +1 -0
  186. package/dist/display/index.d.ts +29 -0
  187. package/dist/display/index.js +16 -0
  188. package/dist/display/index.js.map +1 -0
  189. package/dist/display/iso-chip.d.ts +19 -0
  190. package/dist/display/iso-chip.js +21 -0
  191. package/dist/display/iso-chip.js.map +1 -0
  192. package/dist/display/kbd.d.ts +11 -0
  193. package/dist/display/kbd.js +33 -0
  194. package/dist/display/kbd.js.map +1 -0
  195. package/dist/display/lozenge.d.ts +30 -0
  196. package/dist/display/lozenge.js +55 -0
  197. package/dist/display/lozenge.js.map +1 -0
  198. package/dist/display/scroll-area.d.ts +29 -0
  199. package/dist/display/scroll-area.js +95 -0
  200. package/dist/display/scroll-area.js.map +1 -0
  201. package/dist/display/separator.d.ts +13 -0
  202. package/dist/display/separator.js +24 -0
  203. package/dist/display/separator.js.map +1 -0
  204. package/dist/display/stat.d.ts +35 -0
  205. package/dist/display/stat.js +41 -0
  206. package/dist/display/stat.js.map +1 -0
  207. package/dist/display/timeline.d.ts +44 -0
  208. package/dist/display/timeline.js +111 -0
  209. package/dist/display/timeline.js.map +1 -0
  210. package/dist/display/typography.d.ts +37 -0
  211. package/dist/display/typography.js +53 -0
  212. package/dist/display/typography.js.map +1 -0
  213. package/dist/display/visually-hidden.d.ts +14 -0
  214. package/dist/display/visually-hidden.js +10 -0
  215. package/dist/display/visually-hidden.js.map +1 -0
  216. package/dist/feedback/banner.d.ts +46 -0
  217. package/dist/feedback/banner.js +157 -0
  218. package/dist/feedback/banner.js.map +1 -0
  219. package/dist/feedback/cooldown.d.ts +17 -0
  220. package/dist/feedback/cooldown.js +59 -0
  221. package/dist/feedback/cooldown.js.map +1 -0
  222. package/dist/feedback/empty-state.d.ts +35 -0
  223. package/dist/feedback/empty-state.js +39 -0
  224. package/dist/feedback/empty-state.js.map +1 -0
  225. package/dist/feedback/index.d.ts +12 -0
  226. package/dist/feedback/index.js +11 -0
  227. package/dist/feedback/index.js.map +1 -0
  228. package/dist/feedback/meter.d.ts +33 -0
  229. package/dist/feedback/meter.js +42 -0
  230. package/dist/feedback/meter.js.map +1 -0
  231. package/dist/feedback/motion.d.ts +9 -0
  232. package/dist/feedback/motion.js +57 -0
  233. package/dist/feedback/motion.js.map +1 -0
  234. package/dist/feedback/progress.d.ts +39 -0
  235. package/dist/feedback/progress.js +68 -0
  236. package/dist/feedback/progress.js.map +1 -0
  237. package/dist/feedback/skeleton.d.ts +48 -0
  238. package/dist/feedback/skeleton.js +61 -0
  239. package/dist/feedback/skeleton.js.map +1 -0
  240. package/dist/feedback/spinner.d.ts +19 -0
  241. package/dist/feedback/spinner.js +29 -0
  242. package/dist/feedback/spinner.js.map +1 -0
  243. package/dist/feedback/status-dot.d.ts +23 -0
  244. package/dist/feedback/status-dot.js +37 -0
  245. package/dist/feedback/status-dot.js.map +1 -0
  246. package/dist/form/countries.d.ts +34 -0
  247. package/dist/form/countries.js +273 -0
  248. package/dist/form/countries.js.map +1 -0
  249. package/dist/form/data-attributes.d.ts +11 -0
  250. package/dist/form/data-attributes.js +22 -0
  251. package/dist/form/data-attributes.js.map +1 -0
  252. package/dist/form/field-parts.d.ts +113 -0
  253. package/dist/form/field-parts.js +178 -0
  254. package/dist/form/field-parts.js.map +1 -0
  255. package/dist/form/field.d.ts +36 -0
  256. package/dist/form/field.js +65 -0
  257. package/dist/form/field.js.map +1 -0
  258. package/dist/form/files.d.ts +70 -0
  259. package/dist/form/files.js +156 -0
  260. package/dist/form/files.js.map +1 -0
  261. package/dist/form/form.d.ts +40 -0
  262. package/dist/form/form.js +74 -0
  263. package/dist/form/form.js.map +1 -0
  264. package/dist/form/image-crop.d.ts +106 -0
  265. package/dist/form/image-crop.js +117 -0
  266. package/dist/form/image-crop.js.map +1 -0
  267. package/dist/form/image-cropper.d.ts +68 -0
  268. package/dist/form/image-cropper.js +284 -0
  269. package/dist/form/image-cropper.js.map +1 -0
  270. package/dist/form/index.d.ts +24 -0
  271. package/dist/form/index.js +15 -0
  272. package/dist/form/index.js.map +1 -0
  273. package/dist/form/input-group.d.ts +63 -0
  274. package/dist/form/input-group.js +63 -0
  275. package/dist/form/input-group.js.map +1 -0
  276. package/dist/form/input-otp.d.ts +35 -0
  277. package/dist/form/input-otp.js +83 -0
  278. package/dist/form/input-otp.js.map +1 -0
  279. package/dist/form/input.d.ts +36 -0
  280. package/dist/form/input.js +41 -0
  281. package/dist/form/input.js.map +1 -0
  282. package/dist/form/number-field.d.ts +84 -0
  283. package/dist/form/number-field.js +81 -0
  284. package/dist/form/number-field.js.map +1 -0
  285. package/dist/form/otp-field.d.ts +37 -0
  286. package/dist/form/otp-field.js +116 -0
  287. package/dist/form/otp-field.js.map +1 -0
  288. package/dist/form/password-field.d.ts +61 -0
  289. package/dist/form/password-field.js +61 -0
  290. package/dist/form/password-field.js.map +1 -0
  291. package/dist/form/phone-field.d.ts +104 -0
  292. package/dist/form/phone-field.js +275 -0
  293. package/dist/form/phone-field.js.map +1 -0
  294. package/dist/form/phone-paste.d.ts +24 -0
  295. package/dist/form/phone-paste.js +40 -0
  296. package/dist/form/phone-paste.js.map +1 -0
  297. package/dist/form/phone.d.ts +159 -0
  298. package/dist/form/phone.js +309 -0
  299. package/dist/form/phone.js.map +1 -0
  300. package/dist/form/search-field.d.ts +29 -0
  301. package/dist/form/search-field.js +23 -0
  302. package/dist/form/search-field.js.map +1 -0
  303. package/dist/form/styles.d.ts +31 -0
  304. package/dist/form/styles.js +43 -0
  305. package/dist/form/styles.js.map +1 -0
  306. package/dist/form/text-area.d.ts +70 -0
  307. package/dist/form/text-area.js +93 -0
  308. package/dist/form/text-area.js.map +1 -0
  309. package/dist/form/text-field.d.ts +131 -0
  310. package/dist/form/text-field.js +59 -0
  311. package/dist/form/text-field.js.map +1 -0
  312. package/dist/form/validation.d.ts +145 -0
  313. package/dist/form/validation.js +136 -0
  314. package/dist/form/validation.js.map +1 -0
  315. package/dist/i18n.d.ts +438 -0
  316. package/dist/i18n.js +948 -0
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/index.d.ts +9 -0
  319. package/dist/index.js +7 -0
  320. package/dist/index.js.map +1 -0
  321. package/dist/intl-locale.d.ts +30 -0
  322. package/dist/intl-locale.js +83 -0
  323. package/dist/intl-locale.js.map +1 -0
  324. package/dist/layers.d.ts +32 -0
  325. package/dist/layers.js +33 -0
  326. package/dist/layers.js.map +1 -0
  327. package/dist/layout/auth-form-layout.d.ts +71 -0
  328. package/dist/layout/auth-form-layout.js +61 -0
  329. package/dist/layout/auth-form-layout.js.map +1 -0
  330. package/dist/layout/auth-layout.d.ts +59 -0
  331. package/dist/layout/auth-layout.js +26 -0
  332. package/dist/layout/auth-layout.js.map +1 -0
  333. package/dist/layout/box.d.ts +26 -0
  334. package/dist/layout/box.js +16 -0
  335. package/dist/layout/box.js.map +1 -0
  336. package/dist/layout/grid.d.ts +27 -0
  337. package/dist/layout/grid.js +26 -0
  338. package/dist/layout/grid.js.map +1 -0
  339. package/dist/layout/index.d.ts +16 -0
  340. package/dist/layout/index.js +12 -0
  341. package/dist/layout/index.js.map +1 -0
  342. package/dist/layout/pressable.d.ts +40 -0
  343. package/dist/layout/pressable.js +65 -0
  344. package/dist/layout/pressable.js.map +1 -0
  345. package/dist/layout/reset-sent-card.d.ts +39 -0
  346. package/dist/layout/reset-sent-card.js +22 -0
  347. package/dist/layout/reset-sent-card.js.map +1 -0
  348. package/dist/layout/scroll-area.d.ts +29 -0
  349. package/dist/layout/scroll-area.js +95 -0
  350. package/dist/layout/scroll-area.js.map +1 -0
  351. package/dist/layout/section.d.ts +41 -0
  352. package/dist/layout/section.js +22 -0
  353. package/dist/layout/section.js.map +1 -0
  354. package/dist/layout/split.d.ts +50 -0
  355. package/dist/layout/split.js +35 -0
  356. package/dist/layout/split.js.map +1 -0
  357. package/dist/layout/stack.d.ts +44 -0
  358. package/dist/layout/stack.js +36 -0
  359. package/dist/layout/stack.js.map +1 -0
  360. package/dist/layout/tokens.d.ts +33 -0
  361. package/dist/layout/tokens.js +85 -0
  362. package/dist/layout/tokens.js.map +1 -0
  363. package/dist/layout/toolbar.d.ts +37 -0
  364. package/dist/layout/toolbar.js +334 -0
  365. package/dist/layout/toolbar.js.map +1 -0
  366. package/dist/navigate-context.d.ts +12 -0
  367. package/dist/navigate-context.js +13 -0
  368. package/dist/navigate-context.js.map +1 -0
  369. package/dist/navigation/accordion.d.ts +40 -0
  370. package/dist/navigation/accordion.js +33 -0
  371. package/dist/navigation/accordion.js.map +1 -0
  372. package/dist/navigation/bottom-nav.d.ts +29 -0
  373. package/dist/navigation/bottom-nav.js +48 -0
  374. package/dist/navigation/bottom-nav.js.map +1 -0
  375. package/dist/navigation/brand-link-context.d.ts +8 -0
  376. package/dist/navigation/brand-link-context.js +9 -0
  377. package/dist/navigation/brand-link-context.js.map +1 -0
  378. package/dist/navigation/breadcrumbs.d.ts +36 -0
  379. package/dist/navigation/breadcrumbs.js +51 -0
  380. package/dist/navigation/breadcrumbs.js.map +1 -0
  381. package/dist/navigation/dock.d.ts +27 -0
  382. package/dist/navigation/dock.js +47 -0
  383. package/dist/navigation/dock.js.map +1 -0
  384. package/dist/navigation/footer.d.ts +43 -0
  385. package/dist/navigation/footer.js +43 -0
  386. package/dist/navigation/footer.js.map +1 -0
  387. package/dist/navigation/index.d.ts +22 -0
  388. package/dist/navigation/index.js +17 -0
  389. package/dist/navigation/index.js.map +1 -0
  390. package/dist/navigation/language-names.d.ts +19 -0
  391. package/dist/navigation/language-names.js +79 -0
  392. package/dist/navigation/language-names.js.map +1 -0
  393. package/dist/navigation/language-switcher.d.ts +55 -0
  394. package/dist/navigation/language-switcher.js +53 -0
  395. package/dist/navigation/language-switcher.js.map +1 -0
  396. package/dist/navigation/nav-panel.d.ts +18 -0
  397. package/dist/navigation/nav-panel.js +51 -0
  398. package/dist/navigation/nav-panel.js.map +1 -0
  399. package/dist/navigation/navbar.d.ts +73 -0
  400. package/dist/navigation/navbar.js +64 -0
  401. package/dist/navigation/navbar.js.map +1 -0
  402. package/dist/navigation/page-header.d.ts +37 -0
  403. package/dist/navigation/page-header.js +50 -0
  404. package/dist/navigation/page-header.js.map +1 -0
  405. package/dist/navigation/pagination.d.ts +25 -0
  406. package/dist/navigation/pagination.js +51 -0
  407. package/dist/navigation/pagination.js.map +1 -0
  408. package/dist/navigation/panel-header.d.ts +37 -0
  409. package/dist/navigation/panel-header.js +50 -0
  410. package/dist/navigation/panel-header.js.map +1 -0
  411. package/dist/navigation/sidebar-script.d.ts +12 -0
  412. package/dist/navigation/sidebar-script.js +20 -0
  413. package/dist/navigation/sidebar-script.js.map +1 -0
  414. package/dist/navigation/sidebar.d.ts +149 -0
  415. package/dist/navigation/sidebar.js +332 -0
  416. package/dist/navigation/sidebar.js.map +1 -0
  417. package/dist/navigation/skip-link.d.ts +12 -0
  418. package/dist/navigation/skip-link.js +30 -0
  419. package/dist/navigation/skip-link.js.map +1 -0
  420. package/dist/navigation/stepper.d.ts +50 -0
  421. package/dist/navigation/stepper.js +96 -0
  422. package/dist/navigation/stepper.js.map +1 -0
  423. package/dist/navigation/tabs.d.ts +84 -0
  424. package/dist/navigation/tabs.js +118 -0
  425. package/dist/navigation/tabs.js.map +1 -0
  426. package/dist/navigation/toolbar.d.ts +37 -0
  427. package/dist/navigation/toolbar.js +334 -0
  428. package/dist/navigation/toolbar.js.map +1 -0
  429. package/dist/overlay/alert-dialog.d.ts +63 -0
  430. package/dist/overlay/alert-dialog.js +76 -0
  431. package/dist/overlay/alert-dialog.js.map +1 -0
  432. package/dist/overlay/command-palette.d.ts +53 -0
  433. package/dist/overlay/command-palette.js +130 -0
  434. package/dist/overlay/command-palette.js.map +1 -0
  435. package/dist/overlay/command.d.ts +53 -0
  436. package/dist/overlay/command.js +129 -0
  437. package/dist/overlay/command.js.map +1 -0
  438. package/dist/overlay/context-menu.d.ts +29 -0
  439. package/dist/overlay/context-menu.js +58 -0
  440. package/dist/overlay/context-menu.js.map +1 -0
  441. package/dist/overlay/dialog.d.ts +162 -0
  442. package/dist/overlay/dialog.js +174 -0
  443. package/dist/overlay/dialog.js.map +1 -0
  444. package/dist/overlay/drawer.d.ts +41 -0
  445. package/dist/overlay/drawer.js +114 -0
  446. package/dist/overlay/drawer.js.map +1 -0
  447. package/dist/overlay/floating.d.ts +142 -0
  448. package/dist/overlay/floating.js +226 -0
  449. package/dist/overlay/floating.js.map +1 -0
  450. package/dist/overlay/hover-card.d.ts +19 -0
  451. package/dist/overlay/hover-card.js +31 -0
  452. package/dist/overlay/hover-card.js.map +1 -0
  453. package/dist/overlay/index.d.ts +18 -0
  454. package/dist/overlay/index.js +12 -0
  455. package/dist/overlay/index.js.map +1 -0
  456. package/dist/overlay/overlay-base.d.ts +105 -0
  457. package/dist/overlay/overlay-base.js +250 -0
  458. package/dist/overlay/overlay-base.js.map +1 -0
  459. package/dist/overlay/overlay.d.ts +299 -0
  460. package/dist/overlay/overlay.js +558 -0
  461. package/dist/overlay/overlay.js.map +1 -0
  462. package/dist/overlay/toast.d.ts +58 -0
  463. package/dist/overlay/toast.js +145 -0
  464. package/dist/overlay/toast.js.map +1 -0
  465. package/dist/provider.d.ts +26 -0
  466. package/dist/provider.js +30 -0
  467. package/dist/provider.js.map +1 -0
  468. package/dist/selection/autocomplete.d.ts +54 -0
  469. package/dist/selection/autocomplete.js +122 -0
  470. package/dist/selection/autocomplete.js.map +1 -0
  471. package/dist/selection/checkbox.d.ts +56 -0
  472. package/dist/selection/checkbox.js +49 -0
  473. package/dist/selection/checkbox.js.map +1 -0
  474. package/dist/selection/choice-size.d.ts +26 -0
  475. package/dist/selection/choice-size.js +50 -0
  476. package/dist/selection/choice-size.js.map +1 -0
  477. package/dist/selection/choice-text.d.ts +21 -0
  478. package/dist/selection/choice-text.js +33 -0
  479. package/dist/selection/choice-text.js.map +1 -0
  480. package/dist/selection/combobox.d.ts +173 -0
  481. package/dist/selection/combobox.js +410 -0
  482. package/dist/selection/combobox.js.map +1 -0
  483. package/dist/selection/index.d.ts +20 -0
  484. package/dist/selection/index.js +13 -0
  485. package/dist/selection/index.js.map +1 -0
  486. package/dist/selection/list-box.d.ts +30 -0
  487. package/dist/selection/list-box.js +16 -0
  488. package/dist/selection/list-box.js.map +1 -0
  489. package/dist/selection/listbox.d.ts +44 -0
  490. package/dist/selection/listbox.js +49 -0
  491. package/dist/selection/listbox.js.map +1 -0
  492. package/dist/selection/match.d.ts +20 -0
  493. package/dist/selection/match.js +57 -0
  494. package/dist/selection/match.js.map +1 -0
  495. package/dist/selection/multi-select.d.ts +72 -0
  496. package/dist/selection/multi-select.js +138 -0
  497. package/dist/selection/multi-select.js.map +1 -0
  498. package/dist/selection/radio-card.d.ts +31 -0
  499. package/dist/selection/radio-card.js +29 -0
  500. package/dist/selection/radio-card.js.map +1 -0
  501. package/dist/selection/radio.d.ts +72 -0
  502. package/dist/selection/radio.js +64 -0
  503. package/dist/selection/radio.js.map +1 -0
  504. package/dist/selection/select-public.d.ts +19 -0
  505. package/dist/selection/select-public.js +24 -0
  506. package/dist/selection/select-public.js.map +1 -0
  507. package/dist/selection/select.d.ts +72 -0
  508. package/dist/selection/select.js +69 -0
  509. package/dist/selection/select.js.map +1 -0
  510. package/dist/selection/slider.d.ts +16 -0
  511. package/dist/selection/slider.js +44 -0
  512. package/dist/selection/slider.js.map +1 -0
  513. package/dist/selection/styles.d.ts +26 -0
  514. package/dist/selection/styles.js +78 -0
  515. package/dist/selection/styles.js.map +1 -0
  516. package/dist/selection/switch.d.ts +24 -0
  517. package/dist/selection/switch.js +27 -0
  518. package/dist/selection/switch.js.map +1 -0
  519. package/dist/selection/tag-group.d.ts +38 -0
  520. package/dist/selection/tag-group.js +45 -0
  521. package/dist/selection/tag-group.js.map +1 -0
  522. package/dist/tone.d.ts +6 -0
  523. package/dist/tone.js +2 -0
  524. package/dist/tone.js.map +1 -0
  525. package/dist/utils.d.ts +9 -0
  526. package/dist/utils.js +42 -0
  527. package/dist/utils.js.map +1 -0
  528. package/manifest/component.full.schema.json +391 -0
  529. package/manifest/component.schema.json +279 -0
  530. package/manifests/accordion.json +299 -0
  531. package/manifests/alert-dialog.json +261 -0
  532. package/manifests/area-chart.json +338 -0
  533. package/manifests/autocomplete.json +299 -0
  534. package/manifests/avatar.json +253 -0
  535. package/manifests/badge.json +288 -0
  536. package/manifests/banner.json +185 -0
  537. package/manifests/bar-chart.json +454 -0
  538. package/manifests/bar-list.json +262 -0
  539. package/manifests/bottom-nav.json +139 -0
  540. package/manifests/box.json +3450 -0
  541. package/manifests/breadcrumbs.json +199 -0
  542. package/manifests/button-group.json +2294 -0
  543. package/manifests/button.json +1211 -0
  544. package/manifests/calendar-heatmap.json +218 -0
  545. package/manifests/calendar.json +299 -0
  546. package/manifests/card.json +308 -0
  547. package/manifests/carousel.json +263 -0
  548. package/manifests/chart-parts.json +309 -0
  549. package/manifests/checkbox.json +998 -0
  550. package/manifests/close-button.json +1000 -0
  551. package/manifests/color-field.json +276 -0
  552. package/manifests/color-picker.json +161 -0
  553. package/manifests/color-swatch-picker.json +220 -0
  554. package/manifests/color-swatch.json +140 -0
  555. package/manifests/combobox.json +581 -0
  556. package/manifests/command.json +275 -0
  557. package/manifests/composed-chart.json +287 -0
  558. package/manifests/context-menu.json +148 -0
  559. package/manifests/copy-button.json +192 -0
  560. package/manifests/data-table.json +334 -0
  561. package/manifests/date-field.json +302 -0
  562. package/manifests/date-picker.json +472 -0
  563. package/manifests/description-list.json +201 -0
  564. package/manifests/dialog.json +322 -0
  565. package/manifests/donut-chart.json +264 -0
  566. package/manifests/drawer.json +211 -0
  567. package/manifests/empty-state.json +185 -0
  568. package/manifests/fab.json +172 -0
  569. package/manifests/field.json +209 -0
  570. package/manifests/file-upload.json +791 -0
  571. package/manifests/form.json +829 -0
  572. package/manifests/funnel-chart.json +223 -0
  573. package/manifests/gauge-chart.json +252 -0
  574. package/manifests/grid-list.json +335 -0
  575. package/manifests/grid.json +3482 -0
  576. package/manifests/heading.json +183 -0
  577. package/manifests/heatmap.json +265 -0
  578. package/manifests/hover-card.json +172 -0
  579. package/manifests/icon.json +201 -0
  580. package/manifests/image-cropper.json +295 -0
  581. package/manifests/image-viewer.json +198 -0
  582. package/manifests/image.json +193 -0
  583. package/manifests/index.json +2035 -0
  584. package/manifests/input-group.json +3571 -0
  585. package/manifests/input.json +1557 -0
  586. package/manifests/kbd.json +98 -0
  587. package/manifests/language-switcher.json +274 -0
  588. package/manifests/line-chart.json +342 -0
  589. package/manifests/link.json +867 -0
  590. package/manifests/list-box.json +213 -0
  591. package/manifests/menu.json +453 -0
  592. package/manifests/meter.json +145 -0
  593. package/manifests/navbar.json +281 -0
  594. package/manifests/otp-field.json +1029 -0
  595. package/manifests/page-header.json +164 -0
  596. package/manifests/pagination.json +181 -0
  597. package/manifests/popover.json +205 -0
  598. package/manifests/pressable.json +367 -0
  599. package/manifests/progress.json +282 -0
  600. package/manifests/radar-chart.json +229 -0
  601. package/manifests/radial-chart.json +195 -0
  602. package/manifests/radio.json +975 -0
  603. package/manifests/scatter-chart.json +277 -0
  604. package/manifests/scroll-area.json +127 -0
  605. package/manifests/section.json +169 -0
  606. package/manifests/select.json +474 -0
  607. package/manifests/separator.json +119 -0
  608. package/manifests/sidebar.json +584 -0
  609. package/manifests/skeleton.json +235 -0
  610. package/manifests/skip-link.json +89 -0
  611. package/manifests/slider.json +706 -0
  612. package/manifests/sparkline.json +208 -0
  613. package/manifests/spinner.json +105 -0
  614. package/manifests/split.json +6618 -0
  615. package/manifests/stack.json +3541 -0
  616. package/manifests/stat.json +192 -0
  617. package/manifests/stepper.json +279 -0
  618. package/manifests/switch.json +205 -0
  619. package/manifests/table.json +375 -0
  620. package/manifests/tabs.json +438 -0
  621. package/manifests/tag-group.json +264 -0
  622. package/manifests/text-area.json +1136 -0
  623. package/manifests/text.json +244 -0
  624. package/manifests/theme-switcher.json +152 -0
  625. package/manifests/time-field.json +284 -0
  626. package/manifests/timeline.json +196 -0
  627. package/manifests/toast.json +87 -0
  628. package/manifests/toggle-button.json +1489 -0
  629. package/manifests/toolbar.json +145 -0
  630. package/manifests/tooltip.json +181 -0
  631. package/manifests/tracker.json +192 -0
  632. package/manifests/tree.json +245 -0
  633. package/manifests/visually-hidden.json +114 -0
  634. package/package.json +117 -3
  635. package/styles/base.css +56 -0
  636. package/styles/theme.css +154 -0
@@ -0,0 +1,291 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button as AriaButton, ButtonContext, Calendar as AriaCalendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, CalendarStateContext, I18nProvider, RangeCalendar as AriaRangeCalendar, RangeCalendarContext, RangeCalendarStateContext, useSlottedContext, useLocale, } from "react-aria-components";
5
+ import { getLocalTimeZone, isToday, toCalendarDate, today as todayIn } from "@internationalized/date";
6
+ import { hasLocalWords, localWords } from "../intl-locale.js";
7
+ import { cn } from "../utils.js";
8
+ import { IconGlyph } from "../display/icon.js";
9
+ import { formatDateTime, intlLocale, nextMonthLabel, previousMonthLabel, rangeCrossesClosedLabel, rangeTooLongLabel, rangeTooShortLabel } from "../i18n.js";
10
+ const CELL_BASE = "relative grid size-ds-control cursor-pointer place-items-center rounded-ds-control-medium text-body tabular-nums text-ds-text outline-hidden select-none " +
11
+ "data-[hovered]:bg-ds-background-neutral-subtle-hovered " +
12
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused " +
13
+ "data-[outside-month]:text-ds-text-disabled " +
14
+ "data-[unavailable]:cursor-not-allowed data-[unavailable]:text-ds-text-disabled " +
15
+ "data-[disabled]:cursor-default data-[disabled]:text-ds-text-disabled";
16
+ /**
17
+ * A chevron that points the other way in RTL, also turned back inside a calendar laid out LTR on an RTL page
18
+ *. IconGlyph now applies it to every directional icon; kept here for callers.
19
+ */
20
+ export { MIRROR_IN_RTL } from "../display/icon.js";
21
+ /**
22
+ * An LTR locale's calendar is laid out left to right on an RTL page too: its weekdays, its days and its
23
+ * "novembar 2026" heading read in the locale's order, as its arrow keys already move. An RTL locale's follows the page.
24
+ */
25
+ function useLtrDir() {
26
+ return useLocale().direction === "ltr" ? "ltr" : undefined;
27
+ }
28
+ /** Wraps the calendar in its own locale when one is given. */
29
+ function WithLocale({ locale, children }) {
30
+ return locale ? _jsx(I18nProvider, { locale: intlLocale(locale), children: children }) : _jsx(_Fragment, { children: children });
31
+ }
32
+ /** One month's header: previous on the first month, next on the last, the month and year from Intl. */
33
+ function MonthHeader({ offset, months, range }) {
34
+ const { locale } = useLocale();
35
+ const single = React.useContext(CalendarStateContext);
36
+ const ranged = React.useContext(RangeCalendarStateContext);
37
+ const state = range ? ranged : single;
38
+ const start = state?.visibleRange.start.add({ months: offset });
39
+ const title = start
40
+ ? formatDateTime(locale, { month: "long", year: "numeric", timeZone: state?.timeZone }, start.toDate(state.timeZone))
41
+ : "";
42
+ const nav = "grid size-ds-control-compact cursor-pointer place-items-center rounded-ds-control-medium text-ds-icon outline-hidden data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:cursor-default data-[disabled]:opacity-40";
43
+ return (_jsxs("div", { "data-slot": "calendar-header", className: "flex items-center justify-between gap-ds-100", children: [offset === 0 ? (_jsx(AriaButton, { slot: "previous", "aria-label": previousMonthLabel(locale), "data-slot": "calendar-previous", className: nav, children: _jsx(IconGlyph, { name: "chevron-left" }) })) : (_jsx("span", { className: "size-ds-control-compact" })), _jsx("span", { "data-slot": "calendar-title", className: "text-heading-xsmall", "aria-hidden": true, children: title }), offset === months - 1 ? (_jsx(AriaButton, { slot: "next", "aria-label": nextMonthLabel(locale), "data-slot": "calendar-next", className: nav, children: _jsx(IconGlyph, { name: "chevron-right" }) })) : (_jsx("span", { className: "size-ds-control-compact" }))] }));
44
+ }
45
+ /** "Pzt", "Mon"; where Intl's short names are whole words (Arabic), the narrow ones keep the 36px columns apart. */
46
+ function useWeekdayStyle() {
47
+ const { locale } = useLocale();
48
+ return React.useMemo(() => {
49
+ const format = new Intl.DateTimeFormat(locale, { weekday: "short", timeZone: "UTC" });
50
+ // 2026-01-01 is a Thursday; seven days cover the week.
51
+ const longest = Math.max(...Array.from({ length: 7 }, (_, i) => format.format(Date.UTC(2026, 0, 1 + i)).length));
52
+ return longest > 4 ? "narrow" : "short";
53
+ }, [locale]);
54
+ }
55
+ /**
56
+ * Today in the given zone (the device's by default), known only after mount: the server's clock and zone
57
+ * would underline a different day than the browser, and the mismatch would break hydration.
58
+ */
59
+ function useToday(timeZone) {
60
+ const [zone, setZone] = React.useState(null);
61
+ React.useEffect(() => setZone(timeZone ?? getLocalTimeZone()), [timeZone]);
62
+ return (date) => zone !== null && isToday(date, zone);
63
+ }
64
+ /**
65
+ * The app's own words in what React Aria says itself (see `registerLocalWords`): the calendar's name and its hidden
66
+ * heading, each grid's name, every day's label and the live announcements of a new month or a picked day, which a
67
+ * screen reader reads instead of the visible text. React Aria sets them on every render of its own components, so
68
+ * they are rewritten as they change. Only React Aria's words change: the caller's own `aria-label` at the start of
69
+ * the calendar's name stays as given. Without a registered hook nothing runs.
70
+ */
71
+ function useLocalAriaLabels(ref, locale, own) {
72
+ React.useLayoutEffect(() => {
73
+ const root = ref.current;
74
+ if (!root || !hasLocalWords())
75
+ return;
76
+ const words = (text) => localWords(locale, text);
77
+ // The calendar's name and hidden heading are the caller's label, ", ", then React Aria's month range.
78
+ const after = (text) => {
79
+ const lead = own ? `${own}, ` : "";
80
+ return lead && text.startsWith(lead) ? lead + words(text.slice(lead.length)) : own === text ? text : words(text);
81
+ };
82
+ const fixLabel = (element, rewrite) => {
83
+ const label = element.getAttribute("aria-label");
84
+ if (!label)
85
+ return;
86
+ const local = rewrite(label);
87
+ if (local !== label)
88
+ element.setAttribute("aria-label", local);
89
+ };
90
+ const fixText = (element, rewrite) => {
91
+ for (const node of Array.from(element.childNodes)) {
92
+ if (node.nodeType !== Node.TEXT_NODE || !node.nodeValue)
93
+ continue;
94
+ const local = rewrite(node.nodeValue);
95
+ if (local !== node.nodeValue)
96
+ node.nodeValue = local;
97
+ }
98
+ };
99
+ const fixAll = () => {
100
+ fixLabel(root, after);
101
+ root.querySelectorAll("h2").forEach((heading) => fixText(heading, after));
102
+ root.querySelectorAll('[role="grid"]').forEach((grid) => fixLabel(grid, words));
103
+ root.querySelectorAll('[role="gridcell"] [aria-label], [role="gridcell"][aria-label]').forEach((cell) => fixLabel(cell, words));
104
+ };
105
+ // React Aria announces a new month and a picked day in one live region at the end of the body.
106
+ const fixAnnouncements = () => {
107
+ document.querySelectorAll('[data-live-announcer="true"] *').forEach((element) => fixText(element, words));
108
+ };
109
+ fixAll();
110
+ const observer = new MutationObserver(fixAll);
111
+ observer.observe(root, { attributes: true, attributeFilter: ["aria-label"], subtree: true, childList: true, characterData: true });
112
+ const announcements = new MutationObserver(fixAnnouncements);
113
+ announcements.observe(document.body, { subtree: true, childList: true, characterData: true });
114
+ return () => {
115
+ observer.disconnect();
116
+ announcements.disconnect();
117
+ };
118
+ }, [ref, locale, own]);
119
+ }
120
+ /**
121
+ * Attaches a note (why a day is unavailable, what a marker means) to the day's button as its description.
122
+ * React Aria names the button with aria-label, which hides any text inside it, and CalendarCell drops an
123
+ * aria-describedby prop; so the id is added to the button here, beside any React Aria sets itself.
124
+ */
125
+ function CellNote({ children }) {
126
+ const id = React.useId();
127
+ const ref = React.useRef(null);
128
+ React.useLayoutEffect(() => {
129
+ const button = ref.current?.parentElement;
130
+ if (!button)
131
+ return;
132
+ const ids = (button.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
133
+ if (!ids.includes(id))
134
+ button.setAttribute("aria-describedby", [...ids, id].join(" "));
135
+ return () => {
136
+ const rest = (button.getAttribute("aria-describedby") ?? "").split(" ").filter((x) => x && x !== id);
137
+ if (rest.length)
138
+ button.setAttribute("aria-describedby", rest.join(" "));
139
+ else
140
+ button.removeAttribute("aria-describedby");
141
+ };
142
+ });
143
+ return _jsx("span", { ref: ref, id: id, hidden: true, "data-slot": "calendar-day-note", children: children });
144
+ }
145
+ const FRAME = "inline-flex w-fit max-w-full flex-col gap-ds-100 rounded-ds-large bg-ds-surface-raised p-ds-200 text-ds-text shadow-ds-raised";
146
+ /** Inside a picker's popover the popover is the surface; the calendar only lays out its months. */
147
+ const BARE = "flex flex-col gap-ds-100 text-ds-text outline-hidden";
148
+ /** Set by DatePicker and DateRangePicker around their calendar (internal; not exported from the package). */
149
+ export const CalendarInPopoverContext = React.createContext(false);
150
+ /**
151
+ * One month (or two) to pick a single date: the grid inside DatePicker, and on its own for a fleet
152
+ * day view or holidays. Month and weekday names and the first day of the week follow the
153
+ * locale. Arrow keys move by day, Page Up/Down by month, Home/End to the week's edges.
154
+ */
155
+ export function Calendar({ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers, locale, firstDayOfWeek, timeZone, visibleMonths = 1, defaultFocusedValue, "aria-label": ariaLabel, }) {
156
+ return (_jsx(WithLocale, { locale: locale, children: _jsx(CalendarBody, { value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, visibleMonths, defaultFocusedValue, ariaLabel }) }));
157
+ }
158
+ function CalendarBody({ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, visibleMonths, defaultFocusedValue, ariaLabel, }) {
159
+ const today = useToday(timeZone);
160
+ const weekdayStyle = useWeekdayStyle();
161
+ const inPopover = React.useContext(CalendarInPopoverContext);
162
+ const dir = useLtrDir();
163
+ const { locale } = useLocale();
164
+ const root = React.useRef(null);
165
+ useLocalAriaLabels(root, locale, ariaLabel);
166
+ return (_jsx(AriaCalendar, { ref: root, dir: dir, "aria-label": ariaLabel, value: value, defaultValue: defaultValue,
167
+ // With a time zone and no date yet, open on that zone's month, the one "today" is underlined in.
168
+ defaultFocusedValue: value || defaultValue ? undefined : (defaultFocusedValue ?? (timeZone ? todayIn(timeZone) : undefined)), onChange: onChange, minValue: minValue, maxValue: maxValue, isDateUnavailable: isDateUnavailable, firstDayOfWeek: firstDayOfWeek, visibleDuration: { months: visibleMonths }, "data-slot": "calendar", className: inPopover ? BARE : FRAME, children: _jsx("div", { className: cn("flex gap-ds-400", inPopover ? "flex-nowrap" : "flex-wrap"), children: Array.from({ length: visibleMonths }, (_, offset) => (_jsxs("div", { "data-slot": "calendar-month", className: "flex flex-col gap-ds-100", children: [_jsx(MonthHeader, { offset: offset, months: visibleMonths }), _jsxs(CalendarGrid, { offset: { months: offset }, weekdayStyle: weekdayStyle, className: "border-separate border-spacing-x-0 border-spacing-y-0.5", children: [_jsx(CalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { "data-slot": "calendar-weekday", className: "h-6 text-body-small font-normal text-ds-text-subtlest", children: day })) }), _jsx(CalendarGridBody, { children: (date) => {
169
+ const marker = getDateMarkers?.(date);
170
+ const closed = isDateUnavailable?.(date) ?? false;
171
+ const reason = closed ? unavailableReason?.(date) : undefined;
172
+ const note = [typeof marker === "string" ? marker : undefined, reason].filter(Boolean).join(", ");
173
+ return (_jsx(CalendarCell, { date: date, "data-slot": "calendar-day", className: cn(CELL_BASE, today(date) && "underline underline-offset-3", closed && "line-through", "data-[selected]:bg-ds-background-brand-bold data-[selected]:font-medium data-[selected]:text-ds-text-on-brand"), children: ({ formattedDate, isSelected }) => (_jsxs(_Fragment, { children: [formattedDate, marker && (_jsx("span", { "data-slot": "calendar-marker", "aria-hidden": true, className: cn("absolute bottom-[5px] start-1/2 size-1 -translate-x-1/2 rounded-ds-full rtl:translate-x-1/2 [&:dir(ltr)]:-translate-x-1/2", isSelected ? "bg-ds-text-on-brand" : "bg-ds-icon-brand") })), note && _jsx(CellNote, { children: note })] })) }));
174
+ } })] })] }, offset))) }) }));
175
+ }
176
+ /** Keeps the parent informed of the day picked first, so durations can limit the second pick. */
177
+ function AnchorWatcher({ onAnchor }) {
178
+ const state = React.useContext(RangeCalendarStateContext);
179
+ const anchor = (state?.anchorDate ?? null);
180
+ const key = anchor?.toString() ?? "";
181
+ React.useEffect(() => onAnchor(anchor), [key]);
182
+ return null;
183
+ }
184
+ /**
185
+ * A start and an end across two months: the grid inside DateRangePicker and range flows. The ends
186
+ * sit on the brand fill, rounded on their outer side; the days between form one square band on
187
+ * ds-background-selected that runs across week rows and month edges, joined to both ends.
188
+ */
189
+ export function RangeCalendar({ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges = false, minDuration, maxDuration, locale, firstDayOfWeek, timeZone, visibleMonths = 2, action, defaultFocusedValue, "aria-label": ariaLabel, }) {
190
+ return (_jsx(WithLocale, { locale: locale, children: _jsx(RangeCalendarBody, { value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges, minDuration, maxDuration, firstDayOfWeek, timeZone, visibleMonths, action, defaultFocusedValue, ariaLabel }) }));
191
+ }
192
+ function RangeCalendarBody({ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges, minDuration, maxDuration, firstDayOfWeek, timeZone, visibleMonths, action, defaultFocusedValue, ariaLabel, }) {
193
+ const { locale } = useLocale();
194
+ const dir = useLtrDir();
195
+ const today = useToday(timeZone);
196
+ const weekdayStyle = useWeekdayStyle();
197
+ const rangeRoot = React.useRef(null);
198
+ useLocalAriaLabels(rangeRoot, locale, ariaLabel);
199
+ const [anchor, setAnchor] = React.useState(null);
200
+ const inPopover = React.useContext(CalendarInPopoverContext);
201
+ // Inside DateRangePicker the picker owns the value; the calendar reads and reports through it.
202
+ const picker = useSlottedContext(RangeCalendarContext);
203
+ const [own, setOwn] = React.useState(defaultValue ?? null);
204
+ const range = picker ? (picker.value ?? null) : value === undefined ? own : value;
205
+ // React Aria cuts the end pick at the first unavailable day around the start, so a minDuration gap would
206
+ // cut off every later day. Contiguity is kept here instead: past the first day the caller marks
207
+ // unavailable (each side of the start), nothing can be the end. Worked out on every render, so a
208
+ // callback that changes mid-pick (availability loading in) is always the one obeyed.
209
+ const contiguous = !allowsNonContiguousRanges && !!isDateUnavailable;
210
+ const edges = {};
211
+ const edge = (side) => {
212
+ if (edges[side] === undefined) {
213
+ const step = side === "before" ? -1 : 1;
214
+ const limit = maxDuration ?? 731;
215
+ edges[side] = Infinity;
216
+ for (let i = 1; i <= limit; i++) {
217
+ if (isDateUnavailable(anchor.add({ days: i * step }))) {
218
+ edges[side] = i;
219
+ break;
220
+ }
221
+ }
222
+ }
223
+ return edges[side];
224
+ };
225
+ /** Why the length limits or contiguity close a day while the end is picked (not booked, so not struck through). */
226
+ const outOfReach = (day) => {
227
+ if (!anchor)
228
+ return undefined;
229
+ const offset = day.compare(anchor);
230
+ const length = Math.abs(offset);
231
+ if (contiguous && length >= edge(offset < 0 ? "before" : "after"))
232
+ return rangeCrossesClosedLabel(locale);
233
+ if (minDuration !== undefined && length > 0 && length < minDuration)
234
+ return rangeTooShortLabel(locale);
235
+ if (maxDuration !== undefined && length > maxDuration)
236
+ return rangeTooLongLabel(locale);
237
+ return undefined;
238
+ };
239
+ const unavailable = (date) => !!isDateUnavailable?.(date) || outOfReach(date) !== undefined;
240
+ /** Backstop for a range that reaches React Aria some other way: it may not hold a day the caller closed. */
241
+ const crossesClosedDay = (next) => {
242
+ if (!contiguous)
243
+ return false;
244
+ const end = toCalendarDate(next.end);
245
+ for (let day = toCalendarDate(next.start); day.compare(end) <= 0; day = day.add({ days: 1 }))
246
+ if (isDateUnavailable(day))
247
+ return true;
248
+ return false;
249
+ };
250
+ const formatDay = (day) => formatDateTime(locale, { day: "numeric", month: "short", timeZone: "UTC" }, toCalendarDate(day).toDate("UTC"));
251
+ // While the end is picked the footer follows the start, not the range it is replacing.
252
+ const summary = anchor
253
+ ? `${formatDay(anchor)} – …`
254
+ : range
255
+ ? `${formatDay(range.start)} – ${formatDay(range.end)} · ${new Intl.NumberFormat(locale, { style: "unit", unit: "day", unitDisplay: "long" }).format(toCalendarDate(range.end).compare(toCalendarDate(range.start)))}`
256
+ : "";
257
+ // React Aria would chain the picker's own onChange with ours and commit before our checks run; without it
258
+ // in the context, ours is the only path and it forwards to the picker once the range passes.
259
+ const pickerContext = picker ? { ...picker, onChange: undefined } : null;
260
+ const calendar = (_jsxs(AriaRangeCalendar, { ref: rangeRoot, dir: dir, "aria-label": ariaLabel, value: range,
261
+ // With a time zone and no range yet, open on that zone's month, the one "today" is underlined in.
262
+ defaultFocusedValue: range ? undefined : (defaultFocusedValue ?? (timeZone ? todayIn(timeZone) : undefined)), onChange: (next) => {
263
+ // Picking the start again ends a zero-day range; below minDuration it is not taken.
264
+ if (minDuration !== undefined && toCalendarDate(next.end).compare(toCalendarDate(next.start)) < minDuration)
265
+ return;
266
+ if (crossesClosedDay(next))
267
+ return;
268
+ if (picker)
269
+ return picker.onChange?.(next);
270
+ if (value === undefined)
271
+ setOwn(next);
272
+ onChange?.(next);
273
+ }, minValue: minValue, maxValue: maxValue, isDateUnavailable: unavailable, allowsNonContiguousRanges: true, firstDayOfWeek: firstDayOfWeek, visibleDuration: { months: visibleMonths }, "data-slot": "range-calendar", className: inPopover ? BARE : FRAME, children: [_jsx(AnchorWatcher, { onAnchor: setAnchor }), _jsx("div", { className: cn("flex gap-ds-400", inPopover ? "flex-nowrap" : "flex-wrap"), children: Array.from({ length: visibleMonths }, (_, offset) => (_jsxs("div", { "data-slot": "calendar-month", className: "flex flex-col gap-ds-100", children: [_jsx(MonthHeader, { offset: offset, months: visibleMonths, range: true }), _jsxs(CalendarGrid, { offset: { months: offset }, weekdayStyle: weekdayStyle, className: "border-separate border-spacing-x-0 border-spacing-y-0.5", children: [_jsx(CalendarGridHeader, { children: (day) => (_jsx(CalendarHeaderCell, { "data-slot": "calendar-weekday", className: "h-6 text-body-small font-normal text-ds-text-subtlest", children: day })) }), _jsx(CalendarGridBody, { children: (date) => {
274
+ const closed = isDateUnavailable?.(date) ?? false;
275
+ const limit = closed ? undefined : outOfReach(date);
276
+ const reason = closed ? unavailableReason?.(date) : limit;
277
+ return (_jsx(CalendarCell, { date: date, "data-slot": "calendar-day", "data-out-of-reach": limit !== undefined || undefined, className: ({ isSelected, isSelectionStart, isSelectionEnd, isOutsideMonth }) => {
278
+ const end = isSelectionStart || isSelectionEnd;
279
+ const band = isSelected && !isOutsideMonth;
280
+ return cn(CELL_BASE, today(date) && "underline underline-offset-3",
281
+ // Struck through only when the caller closed the day; length limits just dim it.
282
+ closed && "line-through",
283
+ // The band: square, so it reads as one shape across rows and months.
284
+ band && !end && "rounded-none bg-ds-background-selected data-[hovered]:bg-ds-background-selected-hovered",
285
+ // The ends: brand fill, rounded on the outer side only; the square inner side meets the band.
286
+ band && end && "bg-ds-background-brand-bold font-medium text-ds-text-on-brand data-[hovered]:bg-ds-background-brand-bold-hovered", band && isSelectionStart && !isSelectionEnd && "rounded-e-none", band && isSelectionEnd && !isSelectionStart && "rounded-s-none");
287
+ }, children: ({ formattedDate }) => (_jsxs(_Fragment, { children: [formattedDate, reason && _jsx(CellNote, { children: reason })] })) }));
288
+ } })] })] }, offset))) }), action != null && (_jsxs("div", { "data-slot": "range-calendar-footer", className: "flex items-center justify-between gap-ds-200 border-t border-ds-border pt-ds-150", children: [_jsx("span", { "data-slot": "range-calendar-summary", "aria-live": "polite", className: "text-body-small text-ds-text-subtle tabular-nums", children: summary }), _jsx(ButtonContext.Provider, { value: null, children: action })] }))] }));
289
+ return pickerContext ? _jsx(RangeCalendarContext.Provider, { value: pickerContext, children: calendar }) : calendar;
290
+ }
291
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","source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,CAAC,CACtB,8BACG,aAAa,EACb,MAAM,IAAI,KAAC,QAAQ,cAAE,MAAM,GAAY,IACvC,CACJ,GACY,CAChB,CAAC;oCACJ,CAAC,GACgB,IACN,KA/CP,MAAM,CAgDV,CACP,CAAC,GACE,EACL,MAAM,IAAI,IAAI,IAAI,CACjB,4BAAe,uBAAuB,EAAC,SAAS,EAAC,kFAAkF,aACjI,4BAAgB,wBAAwB,eAAW,QAAQ,EAAC,SAAS,EAAC,kDAAkD,YAAE,OAAO,GAAQ,EAEzI,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,MAAM,GAA0B,IAClE,CACP,IACiB,CACrB,CAAC;IACF,OAAO,aAAa,CAAC,CAAC,CAAC,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAAG,QAAQ,GAAiC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpI,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n ButtonContext,\n Calendar as AriaCalendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n CalendarStateContext,\n I18nProvider,\n RangeCalendar as AriaRangeCalendar,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useSlottedContext,\n useLocale,\n type DateValue,\n} from \"react-aria-components\";\nimport { getLocalTimeZone, isToday, toCalendarDate, today as todayIn, type CalendarDate } from \"@internationalized/date\";\n\nimport { hasLocalWords, localWords } from \"../intl-locale\";\nimport { cn } from \"../utils\";\nimport { IconGlyph } from \"../display/icon\";\nimport { formatDateTime, intlLocale, nextMonthLabel, previousMonthLabel, rangeCrossesClosedLabel, rangeTooLongLabel, rangeTooShortLabel } from \"../i18n\";\n\nexport type FirstDayOfWeek = \"sun\" | \"mon\" | \"tue\" | \"wed\" | \"thu\" | \"fri\" | \"sat\";\n\n/** A marker on a day: `true` for a dot, or a phrase that screen readers hear (\"Fully booked\"). */\nexport type DateMarker = boolean | string;\n\ntype CommonProps = {\n minValue?: CalendarDate;\n maxValue?: CalendarDate;\n /** Days that cannot be picked; they stay focusable and say why (`unavailableReason`). */\n isDateUnavailable?: (date: CalendarDate) => boolean;\n /** Why a day is unavailable (\"Closed\", \"Sold out\"); read with the day. */\n unavailableReason?: (date: CalendarDate) => string | undefined;\n /** Locale override; the DesignSystemProvider locale by default. Month and weekday names come from Intl. */\n locale?: string;\n /** Overrides the locale's first day of the week. */\n firstDayOfWeek?: FirstDayOfWeek;\n /** The time zone \"today\" is computed in (the location's); the device's by default. */\n timeZone?: string;\n /** Names the calendar (\"Start date\"). */\n \"aria-label\"?: string;\n /**\n * The month that opens while nothing is chosen (any day in it). A prerendered page passes a fixed one, so the HTML\n * does not depend on the build day; left out, the month of \"today\" (in `timeZone` when given).\n */\n defaultFocusedValue?: CalendarDate;\n};\n\nexport type CalendarProps = CommonProps & {\n value?: CalendarDate | null;\n defaultValue?: CalendarDate | null;\n onChange?: (value: CalendarDate) => void;\n /** A dot under a day (events on it); a string is also said to screen readers. */\n getDateMarkers?: (date: CalendarDate) => DateMarker | undefined;\n visibleMonths?: 1 | 2;\n};\n\nexport type DateRange = { start: CalendarDate; end: CalendarDate };\n\nexport type RangeCalendarProps = CommonProps & {\n value?: DateRange | null;\n defaultValue?: DateRange | null;\n onChange?: (value: DateRange) => void;\n /** Keep this false when a range may not cross an unavailable day (stays, trips, equipment hire). */\n allowsNonContiguousRanges?: boolean;\n /** Shortest and longest range in days (end − start). */\n minDuration?: number;\n maxDuration?: number;\n /** Two months side by side (from 720px), one below on narrow screens; default 2. */\n visibleMonths?: 1 | 2;\n /** In a popover: the footer shows the chosen range and its length beside this action (\"Apply dates\"). */\n action?: React.ReactNode;\n};\n\nconst CELL_BASE =\n \"relative grid size-ds-control cursor-pointer place-items-center rounded-ds-control-medium text-body tabular-nums text-ds-text outline-hidden select-none \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n \"data-[outside-month]:text-ds-text-disabled \" +\n \"data-[unavailable]:cursor-not-allowed data-[unavailable]:text-ds-text-disabled \" +\n \"data-[disabled]:cursor-default data-[disabled]:text-ds-text-disabled\";\n\n/**\n * A chevron that points the other way in RTL, also turned back inside a calendar laid out LTR on an RTL page\n *. IconGlyph now applies it to every directional icon; kept here for callers.\n */\nexport { MIRROR_IN_RTL } from \"../display/icon\";\n\n/**\n * An LTR locale's calendar is laid out left to right on an RTL page too: its weekdays, its days and its\n * \"novembar 2026\" heading read in the locale's order, as its arrow keys already move. An RTL locale's follows the page.\n */\nfunction useLtrDir(): \"ltr\" | undefined {\n return useLocale().direction === \"ltr\" ? \"ltr\" : undefined;\n}\n\n/** Wraps the calendar in its own locale when one is given. */\nfunction WithLocale({ locale, children }: { locale?: string; children: React.ReactNode }) {\n return locale ? <I18nProvider locale={intlLocale(locale)}>{children}</I18nProvider> : <>{children}</>;\n}\n\n/** One month's header: previous on the first month, next on the last, the month and year from Intl. */\nfunction MonthHeader({ offset, months, range }: { offset: number; months: number; range?: boolean }) {\n const { locale } = useLocale();\n const single = React.useContext(CalendarStateContext);\n const ranged = React.useContext(RangeCalendarStateContext);\n const state = range ? ranged : single;\n const start = state?.visibleRange.start.add({ months: offset });\n const title = start\n ? formatDateTime(locale, { month: \"long\", year: \"numeric\", timeZone: state?.timeZone }, start.toDate(state!.timeZone))\n : \"\";\n const nav = \"grid size-ds-control-compact cursor-pointer place-items-center rounded-ds-control-medium text-ds-icon outline-hidden data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:cursor-default data-[disabled]:opacity-40\";\n return (\n <div data-slot=\"calendar-header\" className=\"flex items-center justify-between gap-ds-100\">\n {offset === 0 ? (\n <AriaButton slot=\"previous\" aria-label={previousMonthLabel(locale)} data-slot=\"calendar-previous\" className={nav}>\n <IconGlyph name=\"chevron-left\" />\n </AriaButton>\n ) : (\n <span className=\"size-ds-control-compact\" />\n )}\n <span data-slot=\"calendar-title\" className=\"text-heading-xsmall\" aria-hidden>\n {title}\n </span>\n {offset === months - 1 ? (\n <AriaButton slot=\"next\" aria-label={nextMonthLabel(locale)} data-slot=\"calendar-next\" className={nav}>\n <IconGlyph name=\"chevron-right\" />\n </AriaButton>\n ) : (\n <span className=\"size-ds-control-compact\" />\n )}\n </div>\n );\n}\n\n/** \"Pzt\", \"Mon\"; where Intl's short names are whole words (Arabic), the narrow ones keep the 36px columns apart. */\nfunction useWeekdayStyle(): \"short\" | \"narrow\" {\n const { locale } = useLocale();\n return React.useMemo(() => {\n const format = new Intl.DateTimeFormat(locale, { weekday: \"short\", timeZone: \"UTC\" });\n // 2026-01-01 is a Thursday; seven days cover the week.\n const longest = Math.max(...Array.from({ length: 7 }, (_, i) => format.format(Date.UTC(2026, 0, 1 + i)).length));\n return longest > 4 ? \"narrow\" : \"short\";\n }, [locale]);\n}\n\n/**\n * Today in the given zone (the device's by default), known only after mount: the server's clock and zone\n * would underline a different day than the browser, and the mismatch would break hydration.\n */\nfunction useToday(timeZone?: string) {\n const [zone, setZone] = React.useState<string | null>(null);\n React.useEffect(() => setZone(timeZone ?? getLocalTimeZone()), [timeZone]);\n return (date: DateValue) => zone !== null && isToday(date, zone);\n}\n\n/**\n * The app's own words in what React Aria says itself (see `registerLocalWords`): the calendar's name and its hidden\n * heading, each grid's name, every day's label and the live announcements of a new month or a picked day, which a\n * screen reader reads instead of the visible text. React Aria sets them on every render of its own components, so\n * they are rewritten as they change. Only React Aria's words change: the caller's own `aria-label` at the start of\n * the calendar's name stays as given. Without a registered hook nothing runs.\n */\nfunction useLocalAriaLabels(ref: React.RefObject<HTMLElement | null>, locale: string, own?: string) {\n React.useLayoutEffect(() => {\n const root = ref.current;\n if (!root || !hasLocalWords()) return;\n const words = (text: string) => localWords(locale, text);\n // The calendar's name and hidden heading are the caller's label, \", \", then React Aria's month range.\n const after = (text: string) => {\n const lead = own ? `${own}, ` : \"\";\n return lead && text.startsWith(lead) ? lead + words(text.slice(lead.length)) : own === text ? text : words(text);\n };\n const fixLabel = (element: Element, rewrite: (text: string) => string) => {\n const label = element.getAttribute(\"aria-label\");\n if (!label) return;\n const local = rewrite(label);\n if (local !== label) element.setAttribute(\"aria-label\", local);\n };\n const fixText = (element: Element, rewrite: (text: string) => string) => {\n for (const node of Array.from(element.childNodes)) {\n if (node.nodeType !== Node.TEXT_NODE || !node.nodeValue) continue;\n const local = rewrite(node.nodeValue);\n if (local !== node.nodeValue) node.nodeValue = local;\n }\n };\n const fixAll = () => {\n fixLabel(root, after);\n root.querySelectorAll(\"h2\").forEach((heading) => fixText(heading, after));\n root.querySelectorAll('[role=\"grid\"]').forEach((grid) => fixLabel(grid, words));\n root.querySelectorAll('[role=\"gridcell\"] [aria-label], [role=\"gridcell\"][aria-label]').forEach((cell) => fixLabel(cell, words));\n };\n // React Aria announces a new month and a picked day in one live region at the end of the body.\n const fixAnnouncements = () => {\n document.querySelectorAll('[data-live-announcer=\"true\"] *').forEach((element) => fixText(element, words));\n };\n fixAll();\n const observer = new MutationObserver(fixAll);\n observer.observe(root, { attributes: true, attributeFilter: [\"aria-label\"], subtree: true, childList: true, characterData: true });\n const announcements = new MutationObserver(fixAnnouncements);\n announcements.observe(document.body, { subtree: true, childList: true, characterData: true });\n return () => {\n observer.disconnect();\n announcements.disconnect();\n };\n }, [ref, locale, own]);\n}\n\n/**\n * Attaches a note (why a day is unavailable, what a marker means) to the day's button as its description.\n * React Aria names the button with aria-label, which hides any text inside it, and CalendarCell drops an\n * aria-describedby prop; so the id is added to the button here, beside any React Aria sets itself.\n */\nfunction CellNote({ children }: { children: string }) {\n const id = React.useId();\n const ref = React.useRef<HTMLSpanElement>(null);\n React.useLayoutEffect(() => {\n const button = ref.current?.parentElement;\n if (!button) return;\n const ids = (button.getAttribute(\"aria-describedby\") ?? \"\").split(\" \").filter(Boolean);\n if (!ids.includes(id)) button.setAttribute(\"aria-describedby\", [...ids, id].join(\" \"));\n return () => {\n const rest = (button.getAttribute(\"aria-describedby\") ?? \"\").split(\" \").filter((x) => x && x !== id);\n if (rest.length) button.setAttribute(\"aria-describedby\", rest.join(\" \"));\n else button.removeAttribute(\"aria-describedby\");\n };\n });\n return <span ref={ref} id={id} hidden data-slot=\"calendar-day-note\">{children}</span>;\n}\n\nconst FRAME = \"inline-flex w-fit max-w-full flex-col gap-ds-100 rounded-ds-large bg-ds-surface-raised p-ds-200 text-ds-text shadow-ds-raised\";\n/** Inside a picker's popover the popover is the surface; the calendar only lays out its months. */\nconst BARE = \"flex flex-col gap-ds-100 text-ds-text outline-hidden\";\n\n/** Set by DatePicker and DateRangePicker around their calendar (internal; not exported from the package). */\nexport const CalendarInPopoverContext = React.createContext(false);\n\n/**\n * One month (or two) to pick a single date: the grid inside DatePicker, and on its own for a fleet\n * day view or holidays. Month and weekday names and the first day of the week follow the\n * locale. Arrow keys move by day, Page Up/Down by month, Home/End to the week's edges.\n */\nexport function Calendar({\n value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers,\n locale, firstDayOfWeek, timeZone, visibleMonths = 1, defaultFocusedValue, \"aria-label\": ariaLabel,\n}: CalendarProps) {\n return (\n <WithLocale locale={locale}>\n <CalendarBody\n {...{ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, visibleMonths, defaultFocusedValue, ariaLabel }}\n />\n </WithLocale>\n );\n}\n\nfunction CalendarBody({\n value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, getDateMarkers,\n firstDayOfWeek, timeZone, visibleMonths, defaultFocusedValue, ariaLabel,\n}: Omit<CalendarProps, \"locale\" | \"aria-label\"> & { ariaLabel?: string; visibleMonths: 1 | 2 }) {\n const today = useToday(timeZone);\n const weekdayStyle = useWeekdayStyle();\n const inPopover = React.useContext(CalendarInPopoverContext);\n const dir = useLtrDir();\n const { locale } = useLocale();\n const root = React.useRef<HTMLDivElement>(null);\n useLocalAriaLabels(root, locale, ariaLabel);\n return (\n <AriaCalendar<CalendarDate>\n ref={root}\n dir={dir}\n aria-label={ariaLabel}\n value={value}\n defaultValue={defaultValue}\n // With a time zone and no date yet, open on that zone's month, the one \"today\" is underlined in.\n defaultFocusedValue={value || defaultValue ? undefined : (defaultFocusedValue ?? (timeZone ? todayIn(timeZone) : undefined))}\n onChange={onChange}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable as ((date: DateValue) => boolean) | undefined}\n firstDayOfWeek={firstDayOfWeek}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"calendar\"\n className={inPopover ? BARE : FRAME}\n >\n {/* In a popover the months stay side by side (the picker asks for two only from 720px), so the popover\n grows and React Aria shifts it into view instead of the months wrapping under each other. */}\n <div className={cn(\"flex gap-ds-400\", inPopover ? \"flex-nowrap\" : \"flex-wrap\")}>\n {Array.from({ length: visibleMonths }, (_, offset) => (\n <div key={offset} data-slot=\"calendar-month\" className=\"flex flex-col gap-ds-100\">\n <MonthHeader offset={offset} months={visibleMonths} />\n <CalendarGrid offset={{ months: offset }} weekdayStyle={weekdayStyle} className=\"border-separate border-spacing-x-0 border-spacing-y-0.5\">\n <CalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell data-slot=\"calendar-weekday\" className=\"h-6 text-body-small font-normal text-ds-text-subtlest\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => {\n const marker = getDateMarkers?.(date as CalendarDate);\n const closed = isDateUnavailable?.(date as CalendarDate) ?? false;\n const reason = closed ? unavailableReason?.(date as CalendarDate) : undefined;\n const note = [typeof marker === \"string\" ? marker : undefined, reason].filter(Boolean).join(\", \");\n return (\n <CalendarCell\n date={date}\n data-slot=\"calendar-day\"\n className={cn(\n CELL_BASE,\n today(date) && \"underline underline-offset-3\",\n closed && \"line-through\",\n \"data-[selected]:bg-ds-background-brand-bold data-[selected]:font-medium data-[selected]:text-ds-text-on-brand\",\n )}\n >\n {({ formattedDate, isSelected }) => (\n <>\n {formattedDate}\n {marker && (\n <span\n data-slot=\"calendar-marker\"\n aria-hidden\n className={cn(\"absolute bottom-[5px] start-1/2 size-1 -translate-x-1/2 rounded-ds-full rtl:translate-x-1/2 [&:dir(ltr)]:-translate-x-1/2\", isSelected ? \"bg-ds-text-on-brand\" : \"bg-ds-icon-brand\")}\n />\n )}\n {note && <CellNote>{note}</CellNote>}\n </>\n )}\n </CalendarCell>\n );\n }}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n ))}\n </div>\n </AriaCalendar>\n );\n}\n\n/** Keeps the parent informed of the day picked first, so durations can limit the second pick. */\nfunction AnchorWatcher({ onAnchor }: { onAnchor: (date: CalendarDate | null) => void }) {\n const state = React.useContext(RangeCalendarStateContext);\n const anchor = (state?.anchorDate ?? null) as CalendarDate | null;\n const key = anchor?.toString() ?? \"\";\n React.useEffect(() => onAnchor(anchor), [key]);\n return null;\n}\n\n/**\n * A start and an end across two months: the grid inside DateRangePicker and range flows. The ends\n * sit on the brand fill, rounded on their outer side; the days between form one square band on\n * ds-background-selected that runs across week rows and month edges, joined to both ends.\n */\nexport function RangeCalendar({\n value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges = false,\n minDuration, maxDuration, locale, firstDayOfWeek, timeZone, visibleMonths = 2, action, defaultFocusedValue, \"aria-label\": ariaLabel,\n}: RangeCalendarProps) {\n return (\n <WithLocale locale={locale}>\n <RangeCalendarBody\n {...{ value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges, minDuration, maxDuration, firstDayOfWeek, timeZone, visibleMonths, action, defaultFocusedValue, ariaLabel }}\n />\n </WithLocale>\n );\n}\n\nfunction RangeCalendarBody({\n value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, unavailableReason, allowsNonContiguousRanges,\n minDuration, maxDuration, firstDayOfWeek, timeZone, visibleMonths, action, defaultFocusedValue, ariaLabel,\n}: Omit<RangeCalendarProps, \"locale\" | \"aria-label\"> & { ariaLabel?: string; visibleMonths: 1 | 2 }) {\n const { locale } = useLocale();\n const dir = useLtrDir();\n const today = useToday(timeZone);\n const weekdayStyle = useWeekdayStyle();\n const rangeRoot = React.useRef<HTMLDivElement>(null);\n useLocalAriaLabels(rangeRoot, locale, ariaLabel);\n const [anchor, setAnchor] = React.useState<CalendarDate | null>(null);\n const inPopover = React.useContext(CalendarInPopoverContext);\n // Inside DateRangePicker the picker owns the value; the calendar reads and reports through it.\n const picker = useSlottedContext(RangeCalendarContext) as { value?: DateRange | null; onChange?: (value: DateRange) => void } | null;\n const [own, setOwn] = React.useState<DateRange | null>(defaultValue ?? null);\n const range = picker ? (picker.value ?? null) : value === undefined ? own : value;\n\n // React Aria cuts the end pick at the first unavailable day around the start, so a minDuration gap would\n // cut off every later day. Contiguity is kept here instead: past the first day the caller marks\n // unavailable (each side of the start), nothing can be the end. Worked out on every render, so a\n // callback that changes mid-pick (availability loading in) is always the one obeyed.\n const contiguous = !allowsNonContiguousRanges && !!isDateUnavailable;\n const edges: { before?: number; after?: number } = {};\n const edge = (side: \"before\" | \"after\") => {\n if (edges[side] === undefined) {\n const step = side === \"before\" ? -1 : 1;\n const limit = maxDuration ?? 731;\n edges[side] = Infinity;\n for (let i = 1; i <= limit; i++) {\n if (isDateUnavailable!(anchor!.add({ days: i * step }))) {\n edges[side] = i;\n break;\n }\n }\n }\n return edges[side]!;\n };\n\n /** Why the length limits or contiguity close a day while the end is picked (not booked, so not struck through). */\n const outOfReach = (day: CalendarDate): string | undefined => {\n if (!anchor) return undefined;\n const offset = day.compare(anchor);\n const length = Math.abs(offset);\n if (contiguous && length >= edge(offset < 0 ? \"before\" : \"after\")) return rangeCrossesClosedLabel(locale);\n if (minDuration !== undefined && length > 0 && length < minDuration) return rangeTooShortLabel(locale);\n if (maxDuration !== undefined && length > maxDuration) return rangeTooLongLabel(locale);\n return undefined;\n };\n const unavailable = (date: DateValue) => !!isDateUnavailable?.(date as CalendarDate) || outOfReach(date as CalendarDate) !== undefined;\n\n /** Backstop for a range that reaches React Aria some other way: it may not hold a day the caller closed. */\n const crossesClosedDay = (next: DateRange) => {\n if (!contiguous) return false;\n const end = toCalendarDate(next.end);\n for (let day = toCalendarDate(next.start); day.compare(end) <= 0; day = day.add({ days: 1 })) if (isDateUnavailable!(day)) return true;\n return false;\n };\n\n const formatDay = (day: CalendarDate) => formatDateTime(locale, { day: \"numeric\", month: \"short\", timeZone: \"UTC\" }, toCalendarDate(day).toDate(\"UTC\"));\n // While the end is picked the footer follows the start, not the range it is replacing.\n const summary = anchor\n ? `${formatDay(anchor)} – …`\n : range\n ? `${formatDay(range.start)} – ${formatDay(range.end)} · ${new Intl.NumberFormat(locale, { style: \"unit\", unit: \"day\", unitDisplay: \"long\" }).format(toCalendarDate(range.end).compare(toCalendarDate(range.start)))}`\n : \"\";\n\n // React Aria would chain the picker's own onChange with ours and commit before our checks run; without it\n // in the context, ours is the only path and it forwards to the picker once the range passes.\n const pickerContext = picker ? { ...picker, onChange: undefined } : null;\n const calendar = (\n <AriaRangeCalendar<CalendarDate>\n ref={rangeRoot}\n dir={dir}\n aria-label={ariaLabel}\n value={range}\n // With a time zone and no range yet, open on that zone's month, the one \"today\" is underlined in.\n defaultFocusedValue={range ? undefined : (defaultFocusedValue ?? (timeZone ? todayIn(timeZone) : undefined))}\n onChange={(next) => {\n // Picking the start again ends a zero-day range; below minDuration it is not taken.\n if (minDuration !== undefined && toCalendarDate(next.end).compare(toCalendarDate(next.start)) < minDuration) return;\n if (crossesClosedDay(next)) return;\n if (picker) return picker.onChange?.(next);\n if (value === undefined) setOwn(next);\n onChange?.(next);\n }}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={unavailable}\n allowsNonContiguousRanges\n firstDayOfWeek={firstDayOfWeek}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"range-calendar\"\n className={inPopover ? BARE : FRAME}\n >\n <AnchorWatcher onAnchor={setAnchor} />\n {/* In a popover the months stay side by side (the picker asks for two only from 720px), so the popover\n grows and React Aria shifts it into view instead of the months wrapping under each other. */}\n <div className={cn(\"flex gap-ds-400\", inPopover ? \"flex-nowrap\" : \"flex-wrap\")}>\n {Array.from({ length: visibleMonths }, (_, offset) => (\n <div key={offset} data-slot=\"calendar-month\" className=\"flex flex-col gap-ds-100\">\n <MonthHeader offset={offset} months={visibleMonths} range />\n <CalendarGrid offset={{ months: offset }} weekdayStyle={weekdayStyle} className=\"border-separate border-spacing-x-0 border-spacing-y-0.5\">\n <CalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell data-slot=\"calendar-weekday\" className=\"h-6 text-body-small font-normal text-ds-text-subtlest\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => {\n const closed = isDateUnavailable?.(date as CalendarDate) ?? false;\n const limit = closed ? undefined : outOfReach(date as CalendarDate);\n const reason = closed ? unavailableReason?.(date as CalendarDate) : limit;\n return (\n <CalendarCell\n date={date}\n data-slot=\"calendar-day\"\n data-out-of-reach={limit !== undefined || undefined}\n className={({ isSelected, isSelectionStart, isSelectionEnd, isOutsideMonth }) => {\n const end = isSelectionStart || isSelectionEnd;\n const band = isSelected && !isOutsideMonth;\n return cn(\n CELL_BASE,\n today(date) && \"underline underline-offset-3\",\n // Struck through only when the caller closed the day; length limits just dim it.\n closed && \"line-through\",\n // The band: square, so it reads as one shape across rows and months.\n band && !end && \"rounded-none bg-ds-background-selected data-[hovered]:bg-ds-background-selected-hovered\",\n // The ends: brand fill, rounded on the outer side only; the square inner side meets the band.\n band && end && \"bg-ds-background-brand-bold font-medium text-ds-text-on-brand data-[hovered]:bg-ds-background-brand-bold-hovered\",\n band && isSelectionStart && !isSelectionEnd && \"rounded-e-none\",\n band && isSelectionEnd && !isSelectionStart && \"rounded-s-none\",\n );\n }}\n >\n {({ formattedDate }) => (\n <>\n {formattedDate}\n {reason && <CellNote>{reason}</CellNote>}\n </>\n )}\n </CalendarCell>\n );\n }}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n ))}\n </div>\n {action != null && (\n <div data-slot=\"range-calendar-footer\" className=\"flex items-center justify-between gap-ds-200 border-t border-ds-border pt-ds-150\">\n <span data-slot=\"range-calendar-summary\" aria-live=\"polite\" className=\"text-body-small text-ds-text-subtle tabular-nums\">{summary}</span>\n {/* The calendar's button slots (previous/next) must not reach the caller's action. */}\n <ButtonContext.Provider value={null}>{action}</ButtonContext.Provider>\n </div>\n )}\n </AriaRangeCalendar>\n );\n return pickerContext ? <RangeCalendarContext.Provider value={pickerContext}>{calendar}</RangeCalendarContext.Provider> : calendar;\n}\n"]}
@@ -0,0 +1,174 @@
1
+ import * as React from "react";
2
+ import { type TimeValue } from "react-aria-components";
3
+ import { type CalendarDate } from "@internationalized/date";
4
+ import { type RequiredValidation } from "../form/validation.js";
5
+ import { type FixedSegments, type SegmentsReport } from "./segments.js";
6
+ type FieldCommon = {
7
+ /** Always given; the label sits above the field and names its segments. */
8
+ label: React.ReactNode;
9
+ description?: React.ReactNode;
10
+ /** What happened and what to do; shown when the field is invalid. */
11
+ errorMessage?: React.ReactNode;
12
+ isRequired?: boolean;
13
+ /**
14
+ * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
15
+ * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
16
+ * {@link RequiredValidation} for the whole contract.
17
+ */
18
+ requiredValidation?: RequiredValidation;
19
+ /** Shows "(optional)" when most of the form is required. */
20
+ isOptional?: boolean;
21
+ isDisabled?: boolean;
22
+ isReadOnly?: boolean;
23
+ /** Marks the field invalid from outside (a server error); `errorMessage` says why. */
24
+ isInvalid?: boolean;
25
+ /**
26
+ * The id of the field's first typed segment (day, or the locale's first part), the element that takes focus
27
+ *: `document.getElementById(id).focus()` puts the user in the field, as a focus-on-error does. The
28
+ * field's group gets an id of its own. Left out, the DOM is as before.
29
+ */
30
+ id?: string;
31
+ /** The form field name; the value is submitted as an ISO string. */
32
+ name?: string;
33
+ autoFocus?: boolean;
34
+ onBlur?: (event: React.FocusEvent) => void;
35
+ };
36
+ export type DateFieldProps = FieldCommon & {
37
+ /**
38
+ * A calendar date, no time zone. With `hideYear` its year is 2000 (a leap year, so 29 February exists; see `hideYear`);
39
+ * with `granularity="month"` it is the month's first day.
40
+ *
41
+ * While the user leaves a date typed in part or impossible ("31.aa.2026", "31.11.2026"), the field reports
42
+ * `onChange(null)` and keeps the typed parts on screen, so setting `null` changes nothing: the value already is null.
43
+ * To clear the field (an app's own "Temizle" or form reset), give it a new `key` along with the value: React remounts
44
+ * it empty, or at the value given.
45
+ */
46
+ value?: CalendarDate | null;
47
+ defaultValue?: CalendarDate | null;
48
+ onChange?: (value: CalendarDate | null) => void;
49
+ /** `day` types day, month and year; `month` types month and year (a card's expiry) and the day is 1. */
50
+ granularity?: "day" | "month";
51
+ /**
52
+ * Day and month only: a yearly date (a campaign day, a birthday reminder). The value is that day in the Gregorian
53
+ * year 2000, a leap year, so 29 February exists, whatever calendar the locale writes dates in:
54
+ * - A calendar with the Gregorian months (the Buddhist one of th-TH, ROC, Japanese): the day and month are typed as
55
+ * the locale writes them, and the hidden year is 2000 as that calendar counts it (2543, Minguo 89, Heisei 12), its
56
+ * era hidden with it.
57
+ * - A calendar with months of its own (Hebrew, Islamic, Persian, Indian, Ethiopic, Coptic, Chinese): one of its days
58
+ * falls on another Gregorian day every year, so no month–day of it is a yearly date the value can hold. The field
59
+ * types the Gregorian day and month instead, in the locale's language and digits.
60
+ *
61
+ * Give `value` and `defaultValue` in 2000 (`new CalendarDate(2000, month, day)`). The field never changes the year it
62
+ * is given: a value in another year keeps it, an edit reports in it, and the day is judged in it, so 29 February typed
63
+ * over a 2023 value says "February has 28 days." and reports null.
64
+ */
65
+ hideYear?: boolean;
66
+ minValue?: CalendarDate;
67
+ maxValue?: CalendarDate;
68
+ /** Your own check; return the message to show, or nothing when the date is fine. */
69
+ validate?: (value: CalendarDate | null) => string | string[] | true | null | undefined;
70
+ };
71
+ /**
72
+ * Hidden segments per mode: month–day keeps the year at Gregorian 2000 (29 February exists; held as the field's calendar
73
+ * counts it), month keeps the day at 1.
74
+ */
75
+ export declare function fixedSegments(granularity: "day" | "month", hideYear?: boolean): FixedSegments | undefined;
76
+ /**
77
+ * The locale a month–day field (`hideYear`) types in: the app's, unless its calendar has months of its own
78
+ * (fa-IR's Persian, an `-u-ca-islamic-umalqura` or `-u-ca-hebrew` tag); then the same locale in the Gregorian calendar, as a
79
+ * month–day is a Gregorian one (see `hideYear`). Null when the app's locale is the one. The calendar is found as React
80
+ * Aria finds it.
81
+ */
82
+ export declare function monthDayLocale(locale: string): string | null;
83
+ /**
84
+ * Validation for a typed date or time: the form's timing (errors on blur and submit) plus the ones React Aria leaves
85
+ * silent, a day past the month's end, which keeps the value empty but must still say why, and a value
86
+ * typed in part.
87
+ *
88
+ * A date typed in part is no date, and a time typed in part no time. React Aria keeps its last complete value until
89
+ * every segment is cleared, and a hidden year (`hideYear`) is never cleared, so "mm/1" or "aa/1/2026" would still hold
90
+ * the old month, and "10:––" (a TimeField, a range with hours) the old minutes, and the form would save it. Here, as
91
+ * soon as the visible parts are partly empty (or, with a hidden part, all empty) the field reports `onChange(null)`,
92
+ * the value it holds; partly empty, it is also invalid, with what is missing ("Incomplete date: enter the
93
+ * month, or clear the field.", "Incomplete time: enter the minutes…"), on the form's timing, so a DS Form blocks its submit and
94
+ * `validationBehavior` "native" blocks the browser's. React Aria still holds the old date underneath, so the typed parts stay on screen
95
+ * (a controlled `null` would wipe them) and, if the user types that same date again, `onChange` reports it again. A
96
+ * date whose parts are all typed but name no day (31.11, edited from a saved 31.10) holds none either.
97
+ *
98
+ * The value reported always matches the parts on screen, once per change: the parts tell the field what they amount
99
+ * to from a layout effect (see `Segments`' `onReport`), into a ref read by the field's own layout effect in the same
100
+ * commit, so a value React Aria reports is never followed by a null judged on the parts of the render before.
101
+ */
102
+ export declare function useDateValidation<T>(props: {
103
+ validate?: (value: T | null) => string | string[] | true | null | undefined;
104
+ value?: T | null;
105
+ defaultValue?: T | null;
106
+ isRequired?: boolean;
107
+ requiredValidation?: RequiredValidation;
108
+ onBlur?: (event: React.FocusEvent) => void;
109
+ onChange?: (value: T | null) => void;
110
+ }): {
111
+ timing: {
112
+ validationBehavior: "native";
113
+ validate: ((value: T | null) => string | true | string[] | null | undefined) | undefined;
114
+ onBlur: ((event: React.FocusEvent) => void) | undefined;
115
+ onChange: ((value: T | null) => void) | undefined;
116
+ } | {
117
+ validationBehavior: "aria";
118
+ validate: (value: T | null) => string | string[] | null;
119
+ onChange: (value: T | null) => void;
120
+ onBlur: (event: React.FocusEvent) => void;
121
+ };
122
+ reporter: (part: string) => (report: SegmentsReport) => void;
123
+ emptyError: string | null;
124
+ value: T | null | undefined;
125
+ reported: T | null;
126
+ };
127
+ /**
128
+ * What a field's form input holds for the value it reports: React Aria's string for that value (an ISO
129
+ * date, or date and time), "" for none. See Segments' `formValue`.
130
+ */
131
+ export declare function formValue(value: {
132
+ toString(): string;
133
+ } | null | undefined): string;
134
+ /** Props that mark a field invalid with the empty-value message, keeping the caller's own `isInvalid`. */
135
+ declare function invalidProps(emptyError: string | null, isInvalid: boolean | undefined, errorMessage: React.ReactNode): {
136
+ isInvalid: boolean | undefined;
137
+ errorMessage: React.ReactNode;
138
+ };
139
+ export { invalidProps };
140
+ /**
141
+ * Types a date in segments (day, month, year) in the locale's order, without a calendar: for dates far
142
+ * from today (birth, licence). Typing moves to the next segment, Backspace clears and moves back, arrows
143
+ * step a segment. An impossible date (31.11) stays as typed with an error; it is never moved to another day.
144
+ */
145
+ export declare function DateField({ label, description, errorMessage, isOptional, granularity, hideYear, validate, onBlur, onChange, value, defaultValue, requiredValidation, id, ...rest }: DateFieldProps): React.JSX.Element;
146
+ export type TimeFieldProps = FieldCommon & {
147
+ /**
148
+ * A time, or a zoned date-time when a location's zone travels with it.
149
+ *
150
+ * While the user leaves a time typed in part ("10:––"), the field reports `onChange(null)` and keeps the typed parts
151
+ * on screen, so setting `null` changes nothing: the value already is null. To clear the field (an app's own "Temizle"
152
+ * or form reset), give it a new `key` along with the value: React remounts it empty, or at the value given
153
+ *.
154
+ */
155
+ value?: TimeValue | null;
156
+ defaultValue?: TimeValue | null;
157
+ onChange?: (value: TimeValue | null) => void;
158
+ /** 24-hour in tr and me, 12-hour in en-US; from the locale unless set. */
159
+ hourCycle?: 12 | 24;
160
+ granularity?: "minute" | "hour";
161
+ /** Arrow keys step the minutes by this much (15 or 30). */
162
+ minuteStep?: number;
163
+ /** The location's zone (IANA, "Europe/Lisbon"). Named after the time when it differs from the user's. */
164
+ timeZone?: string;
165
+ minValue?: TimeValue;
166
+ maxValue?: TimeValue;
167
+ validate?: (value: TimeValue | null) => string | string[] | true | null | undefined;
168
+ };
169
+ /**
170
+ * Types a time in segments in the locale's clock (24-hour in most of Europe). Times are the location's: when the
171
+ * user is in another zone, the zone is named at the end of the field ("Podgorica (GMT+2)"). A time typed in part
172
+ * ("10:––") is no time, as on DateField: `onChange(null)` and, on blur or submit, what is missing.
173
+ */
174
+ export declare function TimeField({ label, description, errorMessage, isOptional, minuteStep, timeZone, validate, onBlur, onChange, value, defaultValue, requiredValidation, id, ...rest }: TimeFieldProps): React.JSX.Element;