@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,118 @@
1
+ import * as React from "react";
2
+ import { type DateValue } from "react-aria-components";
3
+ import { type CalendarDate, type CalendarDateTime } from "@internationalized/date";
4
+ import type { RequiredValidation } from "../form/validation.js";
5
+ import { type DateMarker, type FirstDayOfWeek } from "./calendar.js";
6
+ import { type DateFieldProps } from "./fields.js";
7
+ export type DatePickerProps = Omit<DateFieldProps, "granularity" | "hideYear" | "value"> & {
8
+ /**
9
+ * A calendar date, no time zone; with `granularity="month"` the month's first day.
10
+ *
11
+ * While the user leaves a date typed in part or impossible ("31.aa.2026", "31.11.2026"), the field reports
12
+ * `onChange(null)` and keeps the typed parts on screen, so setting `null` changes nothing: the value already is null.
13
+ * To clear the field (an app's own "Temizle" or form reset), give it a new `key` along with the value: React remounts
14
+ * it empty, or at the value given.
15
+ */
16
+ value?: CalendarDate | null;
17
+ isDateUnavailable?: (date: CalendarDate) => boolean;
18
+ unavailableReason?: (date: CalendarDate) => string | undefined;
19
+ getDateMarkers?: (date: CalendarDate) => DateMarker | undefined;
20
+ firstDayOfWeek?: FirstDayOfWeek;
21
+ /** "Today" in the calendar and the Today action: the location's zone; the device's by default. */
22
+ timeZone?: string;
23
+ /** Close the calendar once a day is picked (default). */
24
+ shouldCloseOnSelect?: boolean;
25
+ /**
26
+ * `month`: a year and a month, for a report or history range. The field types month and year
27
+ * (as DateField `granularity="month"`), the value is that month's first day, and the popover is a grid of the
28
+ * twelve months under a year stepper, with "This month" and "Clear"; `minValue` and `maxValue` count by month.
29
+ * The day-only props (unavailable days, markers, first day of the week) do not apply. Default `day`.
30
+ */
31
+ granularity?: "day" | "month";
32
+ };
33
+ /**
34
+ * A DateField with a calendar popover: type when you know the date, pick when you are browsing. The label
35
+ * names the field and the calendar button; picking fills the field and closes (unless
36
+ * `shouldCloseOnSelect={false}`). For a period (a stay, a trip) use DateRangePicker; for a birth date, DateField. For a
37
+ * year and a month (a history from–to filter), `granularity="month"`: a month grid instead of the days.
38
+ */
39
+ export declare function DatePicker({ label, description, errorMessage, isOptional, validate, onBlur, onChange, value, defaultValue, isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, shouldCloseOnSelect, granularity, requiredValidation, id, ...rest }: DatePickerProps): React.JSX.Element;
40
+ type Span<T extends DateValue = CalendarDate> = {
41
+ start: T;
42
+ end: T;
43
+ };
44
+ /** Start and end: both calendar dates (`granularity="day"`) or both date-times (`"hour"`). */
45
+ export type DateRangePickerValue = Span<CalendarDate> | Span<CalendarDateTime>;
46
+ export type DateRangePickerProps = {
47
+ /** "Trip dates". */
48
+ label: React.ReactNode;
49
+ description?: React.ReactNode;
50
+ errorMessage?: React.ReactNode;
51
+ /**
52
+ * Start and end: calendar dates (`day`) or date-times (`hour`) in the location's time zone.
53
+ *
54
+ * While the user leaves a half typed in part or impossible ("14.aa.2026", "10:––", "31.11.2026"), or one half empty
55
+ * while the other stands, the field reports `onChange(null)` and keeps the typed parts on screen, so setting `null`
56
+ * changes nothing: the value already is null. To clear the field (an app's own "Temizle" or form reset), give it a new
57
+ * `key` along with the value: React remounts it empty, or at the value given.
58
+ */
59
+ value?: DateRangePickerValue | null;
60
+ defaultValue?: DateRangePickerValue | null;
61
+ onChange?: (value: DateRangePickerValue | null) => void;
62
+ /** `hour` adds start and end times. */
63
+ granularity?: "day" | "hour";
64
+ /** Now plus the lead time. */
65
+ minValue?: DateValue;
66
+ maxValue?: DateValue;
67
+ /** Fleet availability: those days stay visible, struck through, and say why (`unavailableReason`). */
68
+ isDateUnavailable?: (date: CalendarDate) => boolean;
69
+ unavailableReason?: (date: CalendarDate) => string | undefined;
70
+ allowsNonContiguousRanges?: boolean;
71
+ /** Overline labels of the two halves; "Start" and "End" by default. */
72
+ startLabel?: string;
73
+ endLabel?: string;
74
+ /** Week start and month names; the provider locale by default. */
75
+ firstDayOfWeek?: FirstDayOfWeek;
76
+ /** The location's zone, for "today" in the calendar. */
77
+ timeZone?: string;
78
+ /** Right of the duration under the calendar: the price total (`metric-small`). */
79
+ footer?: React.ReactNode;
80
+ isRequired?: boolean;
81
+ /**
82
+ * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
83
+ * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
84
+ * {@link RequiredValidation} for the whole contract.
85
+ */
86
+ requiredValidation?: RequiredValidation;
87
+ isDisabled?: boolean;
88
+ isReadOnly?: boolean;
89
+ isInvalid?: boolean;
90
+ isOptional?: boolean;
91
+ /**
92
+ * The id of the start half's first typed segment, the element that takes focus, as on DateField:
93
+ * `document.getElementById(id).focus()` puts the user in the field. Left out, the DOM is as before.
94
+ */
95
+ id?: string;
96
+ /** Form field names for the two halves (ISO strings). */
97
+ startName?: string;
98
+ endName?: string;
99
+ validate?: (value: Span<DateValue> | null) => string | string[] | true | null | undefined;
100
+ onBlur?: (event: React.FocusEvent) => void;
101
+ };
102
+ /**
103
+ * Duration in started 24-hour blocks: 14 Eki 10:00 → 18 Eki 10:00 is 4 days, 10:00 → 10:30 four days
104
+ * later is 5. Dates alone count nights (14 → 18 is 4).
105
+ */
106
+ export declare function rangeDuration(start: DateValue, end: DateValue): {
107
+ days: number;
108
+ hours?: number;
109
+ };
110
+ /**
111
+ * Start and end in one control: two labelled halves over one calendar (two months from 720px). Type a
112
+ * half or pick in the calendar; the footer counts the days (started 24-hour blocks) beside your `footer`.
113
+ * Dates are the location's, never the browser's. `isDisabled`, `isRequired`, `id` and the error work as on
114
+ * every field. With hours, a half too narrow for its date and time on one line (a phone column) puts the
115
+ * time under the date, so the field fits a 320px screen in every locale.
116
+ */
117
+ export declare function DateRangePicker({ label, description, errorMessage, isOptional, granularity, isDateUnavailable, unavailableReason, allowsNonContiguousRanges, startLabel, endLabel, firstDayOfWeek, timeZone, footer, validate, onBlur, onChange, value, defaultValue, requiredValidation, id, ...rest }: DateRangePickerProps): React.JSX.Element;
118
+ export {};
@@ -0,0 +1,176 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button as AriaButton, ButtonContext, DatePicker as AriaDatePicker, DatePickerStateContext, DateRangePicker as AriaDateRangePicker, DateRangePickerStateContext, Dialog, Popover, useLocale, } from "react-aria-components";
5
+ import { getLocalTimeZone, toCalendarDate, today as todayIn } from "@internationalized/date";
6
+ import { cn } from "../utils.js";
7
+ import { Button } from "../action/index.js";
8
+ import { IconGlyph } from "../display/icon.js";
9
+ import { FieldDescription, FieldError, FieldLabel } from "../form/field-parts.js";
10
+ import { InputGroup } from "../form/input-group.js";
11
+ import { FIELD_STACK, INLINE_ACTION } from "../form/styles.js";
12
+ import { clearLabel, dateMaxLabel, formatDateTime, dateMinLabel, dateUnavailableLabel, hasDsStrings, rangeStartLabel, rangeStartTimeLabel, rangeEndLabel, rangeEndTimeLabel, thisMonthLabel, todayLabel } from "../i18n.js";
13
+ import { POPOVER } from "../selection/listbox.js";
14
+ import { Calendar, CalendarInPopoverContext, RangeCalendar } from "./calendar.js";
15
+ import { TimeField, fixedSegments, formValue, invalidProps, useDateValidation } from "./fields.js";
16
+ import { MonthGrid, monthRange } from "./month-grid.js";
17
+ import { Segments } from "./segments.js";
18
+ // Scrolls rather than clips when the viewport is short (times under the calendar).
19
+ const PICKER_POPOVER = cn(POPOVER, "min-w-0 gap-ds-100 overflow-auto p-ds-200");
20
+ /** The calendar button at the end of the field (24px, like the other inline actions). */
21
+ function CalendarButton() {
22
+ return (_jsx(AriaButton, { "data-slot": "date-picker-button", className: INLINE_ACTION, children: _jsx(IconGlyph, { name: "calendar" }) }));
23
+ }
24
+ const MONTH_ONLY = fixedSegments("month");
25
+ /** React Aria's bound format for a calendar date (numeric day, month, year), and a month's ("March 2026"). */
26
+ const DAY_FORMAT = { year: "numeric", month: "numeric", day: "numeric", timeZone: "UTC" };
27
+ const MONTH_FORMAT = { year: "numeric", month: "long", timeZone: "UTC" };
28
+ /**
29
+ * The bounds and unavailable-day messages React Aria shows on its own, in the provider locale.
30
+ * React Aria words them after the browser's language (navigator.language) on purpose, to match the browser's own
31
+ * form messages, so a Turkish app in an English browser said "Value must be 3/1/2026 or later." These are returned
32
+ * as the field's own validation, which React Aria shows in place of its built-in text; the conditions, the order
33
+ * (lower bound, upper bound, unavailable) and the timing are React Aria's. A month picker names the month.
34
+ * Only locales the app registered strings for: in any other locale this returns nothing, so React
35
+ * Aria's own text stays, as it was before.
36
+ */
37
+ function boundsErrors(value, bounds, locale, month) {
38
+ if (value == null || !hasDsStrings(locale))
39
+ return null;
40
+ const format = (date) => formatDateTime(locale, month ? MONTH_FORMAT : DAY_FORMAT, date.toDate("UTC"));
41
+ const errors = [];
42
+ if (bounds.minValue && value.compare(bounds.minValue) < 0)
43
+ errors.push(dateMinLabel(locale, format(bounds.minValue), month));
44
+ if (bounds.maxValue && value.compare(bounds.maxValue) > 0)
45
+ errors.push(dateMaxLabel(locale, format(bounds.maxValue), month));
46
+ if (bounds.isDateUnavailable?.(value))
47
+ errors.push(dateUnavailableLabel(locale));
48
+ return errors.length ? errors : null;
49
+ }
50
+ /** A validate result that is an error (React Aria's reading: a non-empty string or list). */
51
+ const isError = (result) => Array.isArray(result) ? result.length > 0 : typeof result === "string" && result !== "";
52
+ /**
53
+ * Today and Clear under the calendar; the picker's own button context must not reach them. A month picker
54
+ * says "This month" and picks this month's first day, and cannot pick it when it is outside the bounds.
55
+ */
56
+ function PickerActions({ timeZone, month }) {
57
+ const state = React.useContext(DatePickerStateContext);
58
+ const { locale } = useLocale();
59
+ if (!state)
60
+ return null;
61
+ if (month) {
62
+ const now = todayIn(timeZone ?? getLocalTimeZone()).set({ day: 1 });
63
+ return (_jsx(ButtonContext.Provider, { value: null, children: _jsxs("div", { "data-slot": "date-picker-actions", className: "flex items-center justify-between gap-ds-100", children: [_jsx(Button, { variant: "link", size: "small", isDisabled: !monthRange(month.minValue, month.maxValue).contains(now.year * 12 + now.month - 1), onPress: () => { state.setValue(now); state.close(); }, children: thisMonthLabel(locale) }), _jsx(Button, { variant: "subtle", size: "small", onPress: () => { state.setValue(null); state.close(); }, children: clearLabel(locale) })] }) }));
64
+ }
65
+ return (_jsx(ButtonContext.Provider, { value: null, children: _jsxs("div", { "data-slot": "date-picker-actions", className: "flex items-center justify-between gap-ds-100", children: [_jsx(Button, { variant: "link", size: "small", onPress: () => { state.setValue(todayIn(timeZone ?? getLocalTimeZone())); state.close(); }, children: todayLabel(locale) }), _jsx(Button, { variant: "subtle", size: "small", onPress: () => { state.setValue(null); state.close(); }, children: clearLabel(locale) })] }) }));
66
+ }
67
+ /**
68
+ * A DateField with a calendar popover: type when you know the date, pick when you are browsing. The label
69
+ * names the field and the calendar button; picking fills the field and closes (unless
70
+ * `shouldCloseOnSelect={false}`). For a period (a stay, a trip) use DateRangePicker; for a birth date, DateField. For a
71
+ * year and a month (a history from–to filter), `granularity="month"`: a month grid instead of the days.
72
+ */
73
+ export function DatePicker({ label, description, errorMessage, isOptional, validate, onBlur, onChange, value, defaultValue, isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, shouldCloseOnSelect = true, granularity = "day", requiredValidation, id, ...rest }) {
74
+ const month = granularity === "month";
75
+ const { locale } = useLocale();
76
+ const { timing, reporter, emptyError, value: held, reported } = useDateValidation({ validate, value, defaultValue, isRequired: rest.isRequired, requiredValidation, onBlur, onChange });
77
+ const invalid = invalidProps(emptyError, rest.isInvalid, errorMessage);
78
+ // A month's value is its first day: a minimum later in its month still lets that month through.
79
+ const minValue = month && rest.minValue ? rest.minValue.set({ day: 1 }) : rest.minValue;
80
+ const ownValidate = timing.validate;
81
+ const frame = React.useRef(null);
82
+ // Picking in the calendar returns focus to the field (its first segment), not to the calendar button.
83
+ // Only a change made while the calendar is open counts: typing and then Escape leaves focus alone.
84
+ const picked = React.useRef(false);
85
+ const open = React.useRef(false);
86
+ return (_jsx(AriaDatePicker, { onOpenChange: (isOpen) => {
87
+ open.current = isOpen;
88
+ if (isOpen) {
89
+ picked.current = false;
90
+ return;
91
+ }
92
+ if (!picked.current)
93
+ return;
94
+ picked.current = false;
95
+ requestAnimationFrame(() => frame.current?.querySelector("[role='spinbutton'][tabindex]")?.focus());
96
+ }, ...rest, ...(month && minValue ? { minValue } : {}), isInvalid: invalid.isInvalid, value: held, defaultValue: defaultValue, granularity: "day", isDateUnavailable: isDateUnavailable, firstDayOfWeek: firstDayOfWeek, shouldCloseOnSelect: shouldCloseOnSelect, validationBehavior: timing.validationBehavior,
97
+ // The field's own check first (it wins over the built-in one, as in React Aria), then the bounds in the app's locale.
98
+ validate: (next) => {
99
+ const own = ownValidate?.(next);
100
+ return isError(own) ? own : boundsErrors(next, { minValue, maxValue: rest.maxValue, isDateUnavailable: isDateUnavailable }, locale, month);
101
+ }, onBlur: timing.onBlur, onChange: (next) => {
102
+ if (open.current)
103
+ picked.current = true;
104
+ timing.onChange(next);
105
+ }, "data-slot": "date-picker", "data-granularity": month ? "month" : undefined, className: FIELD_STACK, children: ({ isInvalid, isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(FieldLabel, { isRequired: rest.isRequired, isOptional: isOptional, children: label }), _jsx("div", { ref: frame, className: "contents", children: _jsxs(InputGroup, { isDisabled: isDisabled, isInvalid: isInvalid, children: [_jsx(Segments, { fixed: month ? MONTH_ONLY : undefined, onReport: reporter("date"), id: id, formValue: formValue(reported) }), _jsx(CalendarButton, {})] }) }), description && _jsx(FieldDescription, { children: description }), _jsx(FieldError, { children: invalid.errorMessage }), _jsx(Popover, { "data-slot": "date-picker-popover", placement: "bottom start", offset: 4, className: PICKER_POPOVER, children: _jsx(Dialog, { "data-slot": "date-picker-dialog", className: "flex flex-col gap-ds-100 outline-hidden", children: month ? (_jsxs(_Fragment, { children: [_jsx(MonthGrid, { minValue: rest.minValue, maxValue: rest.maxValue, timeZone: timeZone, shouldCloseOnSelect: shouldCloseOnSelect }), _jsx(PickerActions, { timeZone: timeZone, month: { minValue: rest.minValue, maxValue: rest.maxValue } })] })) : (_jsxs(_Fragment, { children: [_jsx(CalendarInPopoverContext.Provider, { value: true, children: _jsx(Calendar, { isDateUnavailable: isDateUnavailable, unavailableReason: unavailableReason, getDateMarkers: getDateMarkers, firstDayOfWeek: firstDayOfWeek, timeZone: timeZone }) }), _jsx(PickerActions, { timeZone: timeZone })] })) }) })] })) }));
106
+ }
107
+ /** Two months from 720px, one on phones (after mount; the server renders one). */
108
+ function useWide() {
109
+ return React.useSyncExternalStore((notify) => {
110
+ if (typeof window.matchMedia !== "function")
111
+ return () => { };
112
+ const query = window.matchMedia("(min-width: 720px)");
113
+ query.addEventListener("change", notify);
114
+ return () => query.removeEventListener("change", notify);
115
+ }, () => typeof window.matchMedia === "function" && window.matchMedia("(min-width: 720px)").matches, () => false);
116
+ }
117
+ /**
118
+ * Duration in started 24-hour blocks: 14 Eki 10:00 → 18 Eki 10:00 is 4 days, 10:00 → 10:30 four days
119
+ * later is 5. Dates alone count nights (14 → 18 is 4).
120
+ */
121
+ export function rangeDuration(start, end) {
122
+ if (!("hour" in start) || !("hour" in end))
123
+ return { days: toCalendarDate(end).compare(toCalendarDate(start)) };
124
+ const hours = Math.ceil((end.toDate("UTC").getTime() - start.toDate("UTC").getTime()) / 3_600_000);
125
+ return { days: Math.max(1, Math.ceil(hours / 24)), hours };
126
+ }
127
+ function Duration({ footer }) {
128
+ const state = React.useContext(DateRangePickerStateContext);
129
+ const { locale } = useLocale();
130
+ const range = state?.value;
131
+ let text = "";
132
+ if (range?.start && range.end) {
133
+ const { days, hours } = rangeDuration(range.start, range.end);
134
+ const unit = (n, u) => new Intl.NumberFormat(locale, { style: "unit", unit: u, unitDisplay: "long" }).format(n);
135
+ text = hours === undefined ? unit(days, "day") : `${unit(days, "day")} · ${unit(hours, "hour")}`;
136
+ }
137
+ if (!text && footer == null)
138
+ return null;
139
+ return (_jsxs("div", { "data-slot": "date-range-footer", className: "flex items-center justify-between gap-ds-200 border-t border-ds-border pt-ds-150", children: [_jsx("span", { "data-slot": "date-range-duration", "aria-live": "polite", className: "text-body-small text-ds-text-subtle tabular-nums", children: text }), footer != null && _jsx("span", { "data-slot": "date-range-price", className: "text-metric-small tabular-nums", children: footer })] }));
140
+ }
141
+ /** Start and end times under the calendar when the range has hours. */
142
+ function RangeTimes({ timeZone }) {
143
+ const state = React.useContext(DateRangePickerStateContext);
144
+ const { locale } = useLocale();
145
+ if (!state)
146
+ return null;
147
+ return (_jsxs("div", { "data-slot": "date-range-times", className: "grid grid-cols-2 gap-ds-200", children: [_jsx(TimeField, { label: rangeStartTimeLabel(locale), value: state.timeRange?.start ?? null, timeZone: timeZone, onChange: (time) => time && state.setTime("start", time) }), _jsx(TimeField, { label: rangeEndTimeLabel(locale), value: state.timeRange?.end ?? null, timeZone: timeZone, onChange: (time) => time && state.setTime("end", time) })] }));
148
+ }
149
+ /** One half: its overline ("Start") over the typed date; the half being edited is underlined. */
150
+ const HALF =
151
+ // `flex-auto`, not `flex-1`: each half starts from its own content, so a field sized to its content never cuts the
152
+ // longer date ("3/18/2026" beside "3/2/2026"); on a narrow column both still shrink (min-w-0).
153
+ "relative flex min-w-0 flex-auto flex-col justify-center py-ds-050 " +
154
+ "after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-ds-full after:bg-transparent " +
155
+ "focus-within:after:bg-ds-border-selected";
156
+ const OVERLINE = "text-heading-xxsmall text-ds-text-subtle group-data-[disabled]/range:text-ds-text-disabled";
157
+ /**
158
+ * Start and end in one control: two labelled halves over one calendar (two months from 720px). Type a
159
+ * half or pick in the calendar; the footer counts the days (started 24-hour blocks) beside your `footer`.
160
+ * Dates are the location's, never the browser's. `isDisabled`, `isRequired`, `id` and the error work as on
161
+ * every field. With hours, a half too narrow for its date and time on one line (a phone column) puts the
162
+ * time under the date, so the field fits a 320px screen in every locale.
163
+ */
164
+ export function DateRangePicker({ label, description, errorMessage, isOptional, granularity = "day", isDateUnavailable, unavailableReason, allowsNonContiguousRanges, startLabel, endLabel, firstDayOfWeek, timeZone, footer, validate, onBlur, onChange, value, defaultValue, requiredValidation, id, ...rest }) {
165
+ const { locale } = useLocale();
166
+ const wide = useWide();
167
+ const { timing, reporter, emptyError, value: held, reported } = useDateValidation({
168
+ validate, value: value, defaultValue: defaultValue,
169
+ isRequired: rest.isRequired, requiredValidation, onBlur, onChange: onChange,
170
+ });
171
+ const invalid = invalidProps(emptyError, rest.isInvalid, errorMessage);
172
+ return (_jsx(AriaDateRangePicker, { ...rest, isInvalid: invalid.isInvalid, value: held, defaultValue: defaultValue,
173
+ // "hour" means "with a time": the halves show hours and minutes (React Aria's "hour" would drop the minutes).
174
+ granularity: granularity === "hour" ? "minute" : "day", isDateUnavailable: isDateUnavailable, allowsNonContiguousRanges: allowsNonContiguousRanges, firstDayOfWeek: firstDayOfWeek, shouldCloseOnSelect: granularity === "day", validationBehavior: timing.validationBehavior, validate: timing.validate, onBlur: timing.onBlur, onChange: timing.onChange, "data-slot": "date-range-picker", className: cn("group/range", FIELD_STACK), children: ({ isInvalid, isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(FieldLabel, { isRequired: rest.isRequired, isOptional: isOptional, children: label }), _jsxs(InputGroup, { isDisabled: isDisabled, isInvalid: isInvalid, children: [_jsxs("div", { "data-slot": "date-range-start", "data-field-part": true, className: HALF, children: [_jsx("span", { "aria-hidden": true, "data-slot": "date-range-overline", className: OVERLINE, children: startLabel ?? rangeStartLabel(locale) }), _jsx(Segments, { slot: "start", onReport: reporter("start"), id: id, formValue: formValue(reported?.start) })] }), _jsx("span", { "aria-hidden": true, "data-slot": "date-range-separator", className: "w-px self-stretch bg-ds-border my-ds-100" }), _jsxs("div", { "data-slot": "date-range-end", "data-field-part": true, className: HALF, children: [_jsx("span", { "aria-hidden": true, "data-slot": "date-range-overline", className: OVERLINE, children: endLabel ?? rangeEndLabel(locale) }), _jsx(Segments, { slot: "end", onReport: reporter("end"), formValue: formValue(reported?.end) })] }), _jsx(CalendarButton, {})] }), description && _jsx(FieldDescription, { children: description }), _jsx(FieldError, { children: invalid.errorMessage }), _jsx(Popover, { "data-slot": "date-range-popover", placement: "bottom start", offset: 4, className: PICKER_POPOVER, children: _jsxs(Dialog, { "data-slot": "date-range-dialog", className: "flex flex-col gap-ds-150 outline-hidden", children: [_jsx(CalendarInPopoverContext.Provider, { value: true, children: _jsx(RangeCalendar, { visibleMonths: wide ? 2 : 1, isDateUnavailable: isDateUnavailable, unavailableReason: unavailableReason, allowsNonContiguousRanges: allowsNonContiguousRanges, firstDayOfWeek: firstDayOfWeek, timeZone: timeZone }) }), granularity === "hour" && _jsx(RangeTimes, { timeZone: timeZone }), _jsx(Duration, { footer: footer })] }) })] })) }));
175
+ }
176
+ //# sourceMappingURL=pickers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickers.js","sourceRoot":"","sources":["../../src/date/pickers.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,aAAa,EACb,UAAU,IAAI,cAAc,EAC5B,sBAAsB,EACtB,eAAe,IAAI,mBAAmB,EACtC,2BAA2B,EAC3B,MAAM,EACN,OAAO,EACP,SAAS,GAGV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,IAAI,OAAO,EAA4C,MAAM,yBAAyB,CAAC;AAEvI,OAAO,EAAE,EA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AyC,aACvF,KAAC,wBAAwB,CAAC,QAAQ,IAAC,KAAK,kBACtC,KAAC,aAAa,IACZ,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3B,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,yBAAyB,EAAE,yBAAyB,EACpD,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,GAClB,GACgC,EACnC,WAAW,KAAK,MAAM,IAAI,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,GAAI,EAC7D,KAAC,QAAQ,IAAC,MAAM,EAAE,MAAM,GAAI,IACrB,GACD,IACT,CACJ,GACmB,CACvB,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n ButtonContext,\n DatePicker as AriaDatePicker,\n DatePickerStateContext,\n DateRangePicker as AriaDateRangePicker,\n DateRangePickerStateContext,\n Dialog,\n Popover,\n useLocale,\n type DateValue,\n type TimeValue,\n} from \"react-aria-components\";\nimport { getLocalTimeZone, toCalendarDate, today as todayIn, type CalendarDate, type CalendarDateTime } from \"@internationalized/date\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"../action/index\";\nimport { IconGlyph } from \"../display/icon\";\nimport { FieldDescription, FieldError, FieldLabel } from \"../form/field-parts\";\nimport { InputGroup } from \"../form/input-group\";\nimport type { RequiredValidation } from \"../form/validation\";\nimport { FIELD_STACK, INLINE_ACTION } from \"../form/styles\";\nimport { clearLabel, dateMaxLabel, formatDateTime, dateMinLabel, dateUnavailableLabel, hasDsStrings, rangeStartLabel, rangeStartTimeLabel, rangeEndLabel, rangeEndTimeLabel, thisMonthLabel, todayLabel } from \"../i18n\";\nimport { POPOVER } from \"../selection/listbox\";\nimport { Calendar, CalendarInPopoverContext, RangeCalendar, type DateMarker, type FirstDayOfWeek } from \"./calendar\";\nimport { TimeField, fixedSegments, formValue, invalidProps, useDateValidation, type DateFieldProps } from \"./fields\";\nimport { MonthGrid, monthRange } from \"./month-grid\";\nimport { Segments } from \"./segments\";\n\n// Scrolls rather than clips when the viewport is short (times under the calendar).\nconst PICKER_POPOVER = cn(POPOVER, \"min-w-0 gap-ds-100 overflow-auto p-ds-200\");\n\n/** The calendar button at the end of the field (24px, like the other inline actions). */\nfunction CalendarButton() {\n return (\n <AriaButton data-slot=\"date-picker-button\" className={INLINE_ACTION}>\n <IconGlyph name=\"calendar\" />\n </AriaButton>\n );\n}\n\nexport type DatePickerProps = Omit<DateFieldProps, \"granularity\" | \"hideYear\" | \"value\"> & {\n /**\n * A calendar date, no time zone; with `granularity=\"month\"` the month's first day.\n *\n * While the user leaves a date typed in part or impossible (\"31.aa.2026\", \"31.11.2026\"), the field reports\n * `onChange(null)` and keeps the typed parts on screen, so setting `null` changes nothing: the value already is null.\n * To clear the field (an app's own \"Temizle\" or form reset), give it a new `key` along with the value: React remounts\n * it empty, or at the value given.\n */\n value?: CalendarDate | null;\n isDateUnavailable?: (date: CalendarDate) => boolean;\n unavailableReason?: (date: CalendarDate) => string | undefined;\n getDateMarkers?: (date: CalendarDate) => DateMarker | undefined;\n firstDayOfWeek?: FirstDayOfWeek;\n /** \"Today\" in the calendar and the Today action: the location's zone; the device's by default. */\n timeZone?: string;\n /** Close the calendar once a day is picked (default). */\n shouldCloseOnSelect?: boolean;\n /**\n * `month`: a year and a month, for a report or history range. The field types month and year\n * (as DateField `granularity=\"month\"`), the value is that month's first day, and the popover is a grid of the\n * twelve months under a year stepper, with \"This month\" and \"Clear\"; `minValue` and `maxValue` count by month.\n * The day-only props (unavailable days, markers, first day of the week) do not apply. Default `day`.\n */\n granularity?: \"day\" | \"month\";\n};\n\nconst MONTH_ONLY = fixedSegments(\"month\");\n\n/** React Aria's bound format for a calendar date (numeric day, month, year), and a month's (\"March 2026\"). */\nconst DAY_FORMAT: Intl.DateTimeFormatOptions = { year: \"numeric\", month: \"numeric\", day: \"numeric\", timeZone: \"UTC\" };\nconst MONTH_FORMAT: Intl.DateTimeFormatOptions = { year: \"numeric\", month: \"long\", timeZone: \"UTC\" };\n\n/**\n * The bounds and unavailable-day messages React Aria shows on its own, in the provider locale.\n * React Aria words them after the browser's language (navigator.language) on purpose, to match the browser's own\n * form messages, so a Turkish app in an English browser said \"Value must be 3/1/2026 or later.\" These are returned\n * as the field's own validation, which React Aria shows in place of its built-in text; the conditions, the order\n * (lower bound, upper bound, unavailable) and the timing are React Aria's. A month picker names the month.\n * Only locales the app registered strings for: in any other locale this returns nothing, so React\n * Aria's own text stays, as it was before.\n */\nfunction boundsErrors(\n value: DateValue | null,\n bounds: { minValue?: DateValue; maxValue?: DateValue; isDateUnavailable?: (date: DateValue) => boolean },\n locale: string,\n month: boolean,\n): string[] | null {\n if (value == null || !hasDsStrings(locale)) return null;\n const format = (date: DateValue) => formatDateTime(locale, month ? MONTH_FORMAT : DAY_FORMAT, date.toDate(\"UTC\"));\n const errors: string[] = [];\n if (bounds.minValue && value.compare(bounds.minValue) < 0) errors.push(dateMinLabel(locale, format(bounds.minValue), month));\n if (bounds.maxValue && value.compare(bounds.maxValue) > 0) errors.push(dateMaxLabel(locale, format(bounds.maxValue), month));\n if (bounds.isDateUnavailable?.(value)) errors.push(dateUnavailableLabel(locale));\n return errors.length ? errors : null;\n}\n\n/** A validate result that is an error (React Aria's reading: a non-empty string or list). */\nconst isError = (result: string | string[] | true | null | undefined): result is string | string[] =>\n Array.isArray(result) ? result.length > 0 : typeof result === \"string\" && result !== \"\";\n\n/**\n * Today and Clear under the calendar; the picker's own button context must not reach them. A month picker\n * says \"This month\" and picks this month's first day, and cannot pick it when it is outside the bounds.\n */\nfunction PickerActions({ timeZone, month }: { timeZone?: string; month?: { minValue?: CalendarDate; maxValue?: CalendarDate } }) {\n const state = React.useContext(DatePickerStateContext);\n const { locale } = useLocale();\n if (!state) return null;\n if (month) {\n const now = todayIn(timeZone ?? getLocalTimeZone()).set({ day: 1 });\n return (\n <ButtonContext.Provider value={null}>\n <div data-slot=\"date-picker-actions\" className=\"flex items-center justify-between gap-ds-100\">\n <Button\n variant=\"link\"\n size=\"small\"\n isDisabled={!monthRange(month.minValue, month.maxValue).contains(now.year * 12 + now.month - 1)}\n onPress={() => { state.setValue(now); state.close(); }}\n >\n {thisMonthLabel(locale)}\n </Button>\n <Button variant=\"subtle\" size=\"small\" onPress={() => { state.setValue(null); state.close(); }}>\n {clearLabel(locale)}\n </Button>\n </div>\n </ButtonContext.Provider>\n );\n }\n return (\n <ButtonContext.Provider value={null}>\n <div data-slot=\"date-picker-actions\" className=\"flex items-center justify-between gap-ds-100\">\n <Button variant=\"link\" size=\"small\" onPress={() => { state.setValue(todayIn(timeZone ?? getLocalTimeZone())); state.close(); }}>\n {todayLabel(locale)}\n </Button>\n <Button variant=\"subtle\" size=\"small\" onPress={() => { state.setValue(null); state.close(); }}>\n {clearLabel(locale)}\n </Button>\n </div>\n </ButtonContext.Provider>\n );\n}\n\n/**\n * A DateField with a calendar popover: type when you know the date, pick when you are browsing. The label\n * names the field and the calendar button; picking fills the field and closes (unless\n * `shouldCloseOnSelect={false}`). For a period (a stay, a trip) use DateRangePicker; for a birth date, DateField. For a\n * year and a month (a history from–to filter), `granularity=\"month\"`: a month grid instead of the days.\n */\nexport function DatePicker({\n label, description, errorMessage, isOptional, validate, onBlur, onChange, value, defaultValue,\n isDateUnavailable, unavailableReason, getDateMarkers, firstDayOfWeek, timeZone, shouldCloseOnSelect = true, granularity = \"day\", requiredValidation, id, ...rest\n}: DatePickerProps) {\n const month = granularity === \"month\";\n const { locale } = useLocale();\n const { timing, reporter, emptyError, value: held, reported } = useDateValidation<CalendarDate>({ validate, value, defaultValue, isRequired: rest.isRequired, requiredValidation, onBlur, onChange });\n const invalid = invalidProps(emptyError, rest.isInvalid, errorMessage);\n // A month's value is its first day: a minimum later in its month still lets that month through.\n const minValue = month && rest.minValue ? rest.minValue.set({ day: 1 }) : rest.minValue;\n const ownValidate = timing.validate as ((value: DateValue | null) => string | string[] | true | null | undefined) | undefined;\n const frame = React.useRef<HTMLDivElement>(null);\n // Picking in the calendar returns focus to the field (its first segment), not to the calendar button.\n // Only a change made while the calendar is open counts: typing and then Escape leaves focus alone.\n const picked = React.useRef(false);\n const open = React.useRef(false);\n return (\n <AriaDatePicker<CalendarDate>\n onOpenChange={(isOpen) => {\n open.current = isOpen;\n if (isOpen) {\n picked.current = false;\n return;\n }\n if (!picked.current) return;\n picked.current = false;\n requestAnimationFrame(() => frame.current?.querySelector<HTMLElement>(\"[role='spinbutton'][tabindex]\")?.focus());\n }}\n {...rest}\n {...(month && minValue ? { minValue } : {})}\n isInvalid={invalid.isInvalid}\n value={held}\n defaultValue={defaultValue}\n granularity=\"day\"\n isDateUnavailable={isDateUnavailable as ((date: DateValue) => boolean) | undefined}\n firstDayOfWeek={firstDayOfWeek}\n shouldCloseOnSelect={shouldCloseOnSelect}\n validationBehavior={timing.validationBehavior}\n // The field's own check first (it wins over the built-in one, as in React Aria), then the bounds in the app's locale.\n validate={(next) => {\n const own = ownValidate?.(next);\n return isError(own) ? own : boundsErrors(next, { minValue, maxValue: rest.maxValue, isDateUnavailable: isDateUnavailable as ((date: DateValue) => boolean) | undefined }, locale, month);\n }}\n onBlur={timing.onBlur}\n onChange={(next) => {\n if (open.current) picked.current = true;\n (timing.onChange as (value: CalendarDate | null) => void)(next);\n }}\n data-slot=\"date-picker\"\n data-granularity={month ? \"month\" : undefined}\n className={FIELD_STACK}\n >\n {({ isInvalid, isDisabled }) => (\n <>\n <FieldLabel isRequired={rest.isRequired} isOptional={isOptional}>{label}</FieldLabel>\n <div ref={frame} className=\"contents\">\n <InputGroup isDisabled={isDisabled} isInvalid={isInvalid}>\n <Segments fixed={month ? MONTH_ONLY : undefined} onReport={reporter(\"date\")} id={id} formValue={formValue(reported)} />\n <CalendarButton />\n </InputGroup>\n </div>\n {description && <FieldDescription>{description}</FieldDescription>}\n <FieldError>{invalid.errorMessage}</FieldError>\n <Popover data-slot=\"date-picker-popover\" placement=\"bottom start\" offset={4} className={PICKER_POPOVER}>\n <Dialog data-slot=\"date-picker-dialog\" className=\"flex flex-col gap-ds-100 outline-hidden\">\n {month ? (\n <>\n <MonthGrid minValue={rest.minValue} maxValue={rest.maxValue} timeZone={timeZone} shouldCloseOnSelect={shouldCloseOnSelect} />\n <PickerActions timeZone={timeZone} month={{ minValue: rest.minValue, maxValue: rest.maxValue }} />\n </>\n ) : (\n <>\n <CalendarInPopoverContext.Provider value>\n <Calendar\n isDateUnavailable={isDateUnavailable}\n unavailableReason={unavailableReason}\n getDateMarkers={getDateMarkers}\n firstDayOfWeek={firstDayOfWeek}\n timeZone={timeZone}\n />\n </CalendarInPopoverContext.Provider>\n <PickerActions timeZone={timeZone} />\n </>\n )}\n </Dialog>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n );\n}\n\ntype Span<T extends DateValue = CalendarDate> = { start: T; end: T };\n/** Start and end: both calendar dates (`granularity=\"day\"`) or both date-times (`\"hour\"`). */\nexport type DateRangePickerValue = Span<CalendarDate> | Span<CalendarDateTime>;\n\nexport type DateRangePickerProps = {\n /** \"Trip dates\". */\n label: React.ReactNode;\n description?: React.ReactNode;\n errorMessage?: React.ReactNode;\n /**\n * Start and end: calendar dates (`day`) or date-times (`hour`) in the location's time zone.\n *\n * While the user leaves a half typed in part or impossible (\"14.aa.2026\", \"10:––\", \"31.11.2026\"), or one half empty\n * while the other stands, the field reports `onChange(null)` and keeps the typed parts on screen, so setting `null`\n * changes nothing: the value already is null. To clear the field (an app's own \"Temizle\" or form reset), give it a new\n * `key` along with the value: React remounts it empty, or at the value given.\n */\n value?: DateRangePickerValue | null;\n defaultValue?: DateRangePickerValue | null;\n onChange?: (value: DateRangePickerValue | null) => void;\n /** `hour` adds start and end times. */\n granularity?: \"day\" | \"hour\";\n /** Now plus the lead time. */\n minValue?: DateValue;\n maxValue?: DateValue;\n /** Fleet availability: those days stay visible, struck through, and say why (`unavailableReason`). */\n isDateUnavailable?: (date: CalendarDate) => boolean;\n unavailableReason?: (date: CalendarDate) => string | undefined;\n allowsNonContiguousRanges?: boolean;\n /** Overline labels of the two halves; \"Start\" and \"End\" by default. */\n startLabel?: string;\n endLabel?: string;\n /** Week start and month names; the provider locale by default. */\n firstDayOfWeek?: FirstDayOfWeek;\n /** The location's zone, for \"today\" in the calendar. */\n timeZone?: string;\n /** Right of the duration under the calendar: the price total (`metric-small`). */\n footer?: React.ReactNode;\n isRequired?: boolean;\n /**\n * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS\n * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See\n * {@link RequiredValidation} for the whole contract.\n */\n requiredValidation?: RequiredValidation;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n isOptional?: boolean;\n /**\n * The id of the start half's first typed segment, the element that takes focus, as on DateField:\n * `document.getElementById(id).focus()` puts the user in the field. Left out, the DOM is as before.\n */\n id?: string;\n /** Form field names for the two halves (ISO strings). */\n startName?: string;\n endName?: string;\n validate?: (value: Span<DateValue> | null) => string | string[] | true | null | undefined;\n onBlur?: (event: React.FocusEvent) => void;\n};\n\n/** Two months from 720px, one on phones (after mount; the server renders one). */\nfunction useWide() {\n return React.useSyncExternalStore(\n (notify) => {\n if (typeof window.matchMedia !== \"function\") return () => {};\n const query = window.matchMedia(\"(min-width: 720px)\");\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n },\n () => typeof window.matchMedia === \"function\" && window.matchMedia(\"(min-width: 720px)\").matches,\n () => false,\n );\n}\n\n/**\n * Duration in started 24-hour blocks: 14 Eki 10:00 → 18 Eki 10:00 is 4 days, 10:00 → 10:30 four days\n * later is 5. Dates alone count nights (14 → 18 is 4).\n */\nexport function rangeDuration(start: DateValue, end: DateValue): { days: number; hours?: number } {\n if (!(\"hour\" in start) || !(\"hour\" in end)) return { days: toCalendarDate(end).compare(toCalendarDate(start)) };\n const hours = Math.ceil((end.toDate(\"UTC\").getTime() - start.toDate(\"UTC\").getTime()) / 3_600_000);\n return { days: Math.max(1, Math.ceil(hours / 24)), hours };\n}\n\nfunction Duration({ footer }: { footer?: React.ReactNode }) {\n const state = React.useContext(DateRangePickerStateContext);\n const { locale } = useLocale();\n const range = state?.value;\n let text = \"\";\n if (range?.start && range.end) {\n const { days, hours } = rangeDuration(range.start, range.end);\n const unit = (n: number, u: \"day\" | \"hour\") => new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"long\" }).format(n);\n text = hours === undefined ? unit(days, \"day\") : `${unit(days, \"day\")} · ${unit(hours, \"hour\")}`;\n }\n if (!text && footer == null) return null;\n return (\n <div data-slot=\"date-range-footer\" className=\"flex items-center justify-between gap-ds-200 border-t border-ds-border pt-ds-150\">\n <span data-slot=\"date-range-duration\" aria-live=\"polite\" className=\"text-body-small text-ds-text-subtle tabular-nums\">{text}</span>\n {footer != null && <span data-slot=\"date-range-price\" className=\"text-metric-small tabular-nums\">{footer}</span>}\n </div>\n );\n}\n\n/** Start and end times under the calendar when the range has hours. */\nfunction RangeTimes({ timeZone }: { timeZone?: string }) {\n const state = React.useContext(DateRangePickerStateContext);\n const { locale } = useLocale();\n if (!state) return null;\n return (\n <div data-slot=\"date-range-times\" className=\"grid grid-cols-2 gap-ds-200\">\n <TimeField label={rangeStartTimeLabel(locale)} value={state.timeRange?.start ?? null} timeZone={timeZone}\n onChange={(time) => time && state.setTime(\"start\", time as TimeValue)} />\n <TimeField label={rangeEndTimeLabel(locale)} value={state.timeRange?.end ?? null} timeZone={timeZone}\n onChange={(time) => time && state.setTime(\"end\", time as TimeValue)} />\n </div>\n );\n}\n\n/** One half: its overline (\"Start\") over the typed date; the half being edited is underlined. */\nconst HALF =\n // `flex-auto`, not `flex-1`: each half starts from its own content, so a field sized to its content never cuts the\n // longer date (\"3/18/2026\" beside \"3/2/2026\"); on a narrow column both still shrink (min-w-0).\n \"relative flex min-w-0 flex-auto flex-col justify-center py-ds-050 \" +\n \"after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-ds-full after:bg-transparent \" +\n \"focus-within:after:bg-ds-border-selected\";\nconst OVERLINE = \"text-heading-xxsmall text-ds-text-subtle group-data-[disabled]/range:text-ds-text-disabled\";\n\n/**\n * Start and end in one control: two labelled halves over one calendar (two months from 720px). Type a\n * half or pick in the calendar; the footer counts the days (started 24-hour blocks) beside your `footer`.\n * Dates are the location's, never the browser's. `isDisabled`, `isRequired`, `id` and the error work as on\n * every field. With hours, a half too narrow for its date and time on one line (a phone column) puts the\n * time under the date, so the field fits a 320px screen in every locale.\n */\nexport function DateRangePicker({\n label, description, errorMessage, isOptional, granularity = \"day\", isDateUnavailable, unavailableReason, allowsNonContiguousRanges,\n startLabel, endLabel, firstDayOfWeek, timeZone, footer, validate, onBlur, onChange, value, defaultValue, requiredValidation, id, ...rest\n}: DateRangePickerProps) {\n const { locale } = useLocale();\n const wide = useWide();\n const { timing, reporter, emptyError, value: held, reported } = useDateValidation<Span<DateValue>>({\n validate, value: value as Span<DateValue> | null | undefined, defaultValue: defaultValue as Span<DateValue> | null | undefined,\n isRequired: rest.isRequired, requiredValidation, onBlur, onChange: onChange as ((value: Span<DateValue> | null) => void) | undefined,\n });\n const invalid = invalidProps(emptyError, rest.isInvalid, errorMessage);\n return (\n <AriaDateRangePicker\n {...rest}\n isInvalid={invalid.isInvalid}\n value={held as Span<DateValue> | null | undefined}\n defaultValue={defaultValue as Span<DateValue> | null | undefined}\n // \"hour\" means \"with a time\": the halves show hours and minutes (React Aria's \"hour\" would drop the minutes).\n granularity={granularity === \"hour\" ? \"minute\" : \"day\"}\n isDateUnavailable={isDateUnavailable as ((date: DateValue) => boolean) | undefined}\n allowsNonContiguousRanges={allowsNonContiguousRanges}\n firstDayOfWeek={firstDayOfWeek}\n shouldCloseOnSelect={granularity === \"day\"}\n validationBehavior={timing.validationBehavior}\n validate={timing.validate as (value: Span<DateValue> | null) => string | string[] | true | null | undefined}\n onBlur={timing.onBlur}\n onChange={timing.onChange as (value: Span<DateValue> | null) => void}\n data-slot=\"date-range-picker\"\n className={cn(\"group/range\", FIELD_STACK)}\n >\n {({ isInvalid, isDisabled }) => (\n <>\n <FieldLabel isRequired={rest.isRequired} isOptional={isOptional}>{label}</FieldLabel>\n <InputGroup isDisabled={isDisabled} isInvalid={isInvalid}>\n <div data-slot=\"date-range-start\" data-field-part className={HALF}>\n <span aria-hidden data-slot=\"date-range-overline\" className={OVERLINE}>{startLabel ?? rangeStartLabel(locale)}</span>\n <Segments slot=\"start\" onReport={reporter(\"start\")} id={id} formValue={formValue(reported?.start)} />\n </div>\n <span aria-hidden data-slot=\"date-range-separator\" className=\"w-px self-stretch bg-ds-border my-ds-100\" />\n <div data-slot=\"date-range-end\" data-field-part className={HALF}>\n <span aria-hidden data-slot=\"date-range-overline\" className={OVERLINE}>{endLabel ?? rangeEndLabel(locale)}</span>\n <Segments slot=\"end\" onReport={reporter(\"end\")} formValue={formValue(reported?.end)} />\n </div>\n <CalendarButton />\n </InputGroup>\n {description && <FieldDescription>{description}</FieldDescription>}\n <FieldError>{invalid.errorMessage}</FieldError>\n <Popover data-slot=\"date-range-popover\" placement=\"bottom start\" offset={4} className={PICKER_POPOVER}>\n <Dialog data-slot=\"date-range-dialog\" className=\"flex flex-col gap-ds-150 outline-hidden\">\n <CalendarInPopoverContext.Provider value>\n <RangeCalendar\n visibleMonths={wide ? 2 : 1}\n isDateUnavailable={isDateUnavailable}\n unavailableReason={unavailableReason}\n allowsNonContiguousRanges={allowsNonContiguousRanges}\n firstDayOfWeek={firstDayOfWeek}\n timeZone={timeZone}\n />\n </CalendarInPopoverContext.Provider>\n {granularity === \"hour\" && <RangeTimes timeZone={timeZone} />}\n <Duration footer={footer} />\n </Dialog>\n </Popover>\n </>\n )}\n </AriaDateRangePicker>\n );\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { type CalendarProps as SingleCalendarProps, type RangeCalendarProps } from "./calendar.js";
3
+ import { type DatePickerProps as SingleDatePickerProps, type DateRangePickerProps } from "./pickers.js";
4
+ export type CalendarSingleProps = SingleCalendarProps & {
5
+ /** `single` (default): one day. */
6
+ selectionMode?: "single";
7
+ };
8
+ export type CalendarRangeProps = RangeCalendarProps & {
9
+ /** `range`: a start and an end, picked with two presses. */
10
+ selectionMode: "range";
11
+ };
12
+ export type CalendarProps = CalendarSingleProps | CalendarRangeProps;
13
+ /** A month grid to pick a day, or with `selectionMode="range"` a start and an end (as Mantine, Chakra, shadcn). */
14
+ export declare function Calendar(props: CalendarProps): React.JSX.Element;
15
+ export type DatePickerSingleProps = SingleDatePickerProps & {
16
+ /** `single` (default): one date (and time with `granularity="hour"`). */
17
+ selectionMode?: "single";
18
+ };
19
+ export type DatePickerRangeProps = DateRangePickerProps & {
20
+ /** `range`: a start and an end in one control, over one calendar (two months on wide screens). */
21
+ selectionMode: "range";
22
+ };
23
+ export type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
24
+ /** A typed date with a calendar popover; `selectionMode="range"` for a period (start and end in one control). */
25
+ export declare function DatePicker(props: DatePickerProps): React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Calendar as SingleCalendar, RangeCalendar } from "./calendar.js";
5
+ import { DatePicker as SingleDatePicker, DateRangePicker } from "./pickers.js";
6
+ /** A month grid to pick a day, or with `selectionMode="range"` a start and an end (as Mantine, Chakra, shadcn). */
7
+ export function Calendar(props) {
8
+ if (props.selectionMode === "range") {
9
+ const { selectionMode: _mode, ...rest } = props;
10
+ return _jsx(RangeCalendar, { ...rest });
11
+ }
12
+ const { selectionMode: _mode, ...rest } = props;
13
+ return _jsx(SingleCalendar, { ...rest });
14
+ }
15
+ /** A typed date with a calendar popover; `selectionMode="range"` for a period (start and end in one control). */
16
+ export function DatePicker(props) {
17
+ if (props.selectionMode === "range") {
18
+ const { selectionMode: _mode, ...rest } = props;
19
+ return _jsx(DateRangePicker, { ...rest });
20
+ }
21
+ const { selectionMode: _mode, ...rest } = props;
22
+ return _jsx(SingleDatePicker, { ...rest });
23
+ }
24
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/date/public.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,aAAa,EAAsE,MAAM,YAAY,CAAC;AAC3I,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,eAAe,EAA4E,MAAM,WAAW,CAAC;AAYtJ,mHAAmH;AACnH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,IAAI,KAAK,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;QACpC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAChD,OAAO,KAAC,aAAa,OAAK,IAAI,GAAI,CAAC;IACrC,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAChD,OAAO,KAAC,cAAc,OAAK,IAAI,GAAI,CAAC;AACtC,CAAC;AAYD,iHAAiH;AACjH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,IAAI,KAAK,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;QACpC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAChD,OAAO,KAAC,eAAe,OAAK,IAAI,GAAI,CAAC;IACvC,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAChD,OAAO,KAAC,gBAAgB,OAAK,IAAI,GAAI,CAAC;AACxC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Calendar as SingleCalendar, RangeCalendar, type CalendarProps as SingleCalendarProps, type RangeCalendarProps } from \"./calendar\";\nimport { DatePicker as SingleDatePicker, DateRangePicker, type DatePickerProps as SingleDatePickerProps, type DateRangePickerProps } from \"./pickers\";\n\nexport type CalendarSingleProps = SingleCalendarProps & {\n /** `single` (default): one day. */\n selectionMode?: \"single\";\n};\nexport type CalendarRangeProps = RangeCalendarProps & {\n /** `range`: a start and an end, picked with two presses. */\n selectionMode: \"range\";\n};\nexport type CalendarProps = CalendarSingleProps | CalendarRangeProps;\n\n/** A month grid to pick a day, or with `selectionMode=\"range\"` a start and an end (as Mantine, Chakra, shadcn). */\nexport function Calendar(props: CalendarProps) {\n if (props.selectionMode === \"range\") {\n const { selectionMode: _mode, ...rest } = props;\n return <RangeCalendar {...rest} />;\n }\n const { selectionMode: _mode, ...rest } = props;\n return <SingleCalendar {...rest} />;\n}\n\nexport type DatePickerSingleProps = SingleDatePickerProps & {\n /** `single` (default): one date (and time with `granularity=\"hour\"`). */\n selectionMode?: \"single\";\n};\nexport type DatePickerRangeProps = DateRangePickerProps & {\n /** `range`: a start and an end in one control, over one calendar (two months on wide screens). */\n selectionMode: \"range\";\n};\nexport type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;\n\n/** A typed date with a calendar popover; `selectionMode=\"range\"` for a period (start and end in one control). */\nexport function DatePicker(props: DatePickerProps) {\n if (props.selectionMode === \"range\") {\n const { selectionMode: _mode, ...rest } = props;\n return <DateRangePicker {...rest} />;\n }\n const { selectionMode: _mode, ...rest } = props;\n return <SingleDatePicker {...rest} />;\n}\n"]}
@@ -0,0 +1,153 @@
1
+ import * as React from "react";
2
+ import { DateFieldStateContext } from "react-aria-components";
3
+ import { type Calendar } from "@internationalized/date";
4
+ import { type DatePartName } from "../i18n.js";
5
+ type DateFieldState = NonNullable<React.ContextType<typeof DateFieldStateContext>>;
6
+ type SegmentState = DateFieldState["segments"][number];
7
+ /**
8
+ * A segment the field keeps out of sight with a fixed value: the year of a month–day, the day of a month. The year is a
9
+ * Gregorian one (2000): the field holds it as the same year in its own calendar, era and all (see {@link heldYear}).
10
+ */
11
+ export type FixedSegments = Partial<Record<"year" | "day", number>>;
12
+ /**
13
+ * The segments kept out of sight for `fixed`: its own, and with a hidden year its era too (a Japanese "H", a ROC
14
+ * "Minguo"), which names a year that is not shown.
15
+ */
16
+ export declare function hiddenSegments(fixed?: FixedSegments): Set<string>;
17
+ /**
18
+ * The Gregorian year `gregorianYear` as the field's calendar counts it: Gregorian 2000 is 2543 in the
19
+ * Buddhist calendar, Heisei 12 in the Japanese and Minguo 89 in the ROC one, each a leap year with the same months, so
20
+ * 29 February exists. Set as 2000 in those calendars it was 1457 CE, Reiwa 2000 (4018 CE) and 3911 CE, none of them
21
+ * leap, and a valid 29.02 was refused.
22
+ */
23
+ export declare function heldYear(calendar: Calendar, gregorianYear: number): {
24
+ era: string;
25
+ year: number;
26
+ };
27
+ /**
28
+ * Which of React Aria's segments show when some are hidden. A hidden segment takes one separator with it:
29
+ * the one before it when no shown part follows it (the year of a month–day: "dd. mm. yyyy." → "dd. mm."; with its
30
+ * era after it, "mm/dd/yyyy Minguo" → "mm/dd"), otherwise the one after it (the day of a month: "dd.mm.yyyy г." →
31
+ * "mm.yyyy г."). Leading and closing literals ("." in me, " г." in bg) stay, so every locale keeps its own full-date
32
+ * style.
33
+ */
34
+ export declare function visibleIndexes(segments: readonly SegmentState[], hidden: ReadonlySet<string>): Set<number>;
35
+ export type SegmentsProps = {
36
+ /** Kept out of sight with a fixed value (month–day: `{ year: 2000 }`; month: `{ day: 1 }`). */
37
+ fixed?: FixedSegments;
38
+ minuteStep?: number;
39
+ slot?: "start" | "end";
40
+ className?: string;
41
+ /**
42
+ * Told, in the commit that changes it, what the typed parts amount to: what is wrong with them (a day
43
+ * past the month's end, or a value typed in part, "Incomplete date: enter the month, or clear the field."), whether they are
44
+ * all empty, partly filled or all filled, and the message naming every part (said when a whole half of a range is
45
+ * left empty while the other half stands). Told from a layout effect, so it reaches the field before the field's
46
+ * own effects in that commit read it: the value the field reports always matches the parts on screen.
47
+ */
48
+ onReport?: (report: SegmentsReport) => void;
49
+ /**
50
+ * The field's `id`, put on its first segment that takes typing, so `getElementById(id).focus()`
51
+ * lands in the field. Left out, the segments are as before.
52
+ */
53
+ id?: string;
54
+ /**
55
+ * What the field's form input holds: the value the field reports, as an ISO string, or "" while it
56
+ * reports none (a date typed in part, impossible, or emptied around a hidden part). See {@link FormValue}.
57
+ */
58
+ formValue?: string;
59
+ };
60
+ /** The typed segments of a date or time field, in the locale's order and with its separators. */
61
+ export declare function Segments({ fixed, minuteStep, slot, className, onReport, id, formValue }: SegmentsProps): React.JSX.Element;
62
+ /**
63
+ * The first segment the user types in, in DOM order (the locale's): not a separator, not a hidden one (the year of a
64
+ * month–day, the day of a month). The field's `id` goes on it, so focusing that id reaches the field.
65
+ */
66
+ export declare function firstTypedIndex(segments: readonly SegmentState[], hidden: ReadonlySet<string>): number;
67
+ /**
68
+ * Whether the segment at `index` is the separator between the date and the time of a date-time: a
69
+ * literal with a space to break at (", ", " ", "، "; not the bidi isolate React Aria puts before a time as a literal of
70
+ * its own), a date part on one side and a time part on the other, in the locale's order (time first works too). Only
71
+ * there may the segments wrap (see `LITERAL_BREAK`); a date alone, a time alone, and the AM/PM beside its hour never do.
72
+ */
73
+ export declare function isDateTimeBreak(segments: readonly Pick<SegmentState, "type" | "text">[], index: number): boolean;
74
+ /**
75
+ * The date–time separator with only its last space left to break at: the
76
+ * earlier ones become no-break spaces, so a time that goes under its date starts the line with its hour, not with the
77
+ * rest of the separator (". u " in bs, " г., " in bg and mk, " klo " in fi left "u 10:00" or "г., 10:00" below).
78
+ */
79
+ export declare function breakAtLastSpace(text: string): string;
80
+ /**
81
+ * A segment's props with the app's `id` in place of React Aria's own, and every reference to the old id swapped
82
+ * too: the segment is named by `aria-labelledby="<its own id> <field label id>"` ("day, Start date"), and a
83
+ * reference to an id no element has would drop the segment's name.
84
+ *
85
+ * React Aria's `useLabels` puts that self-reference first whenever a segment has both `aria-label` (its own name)
86
+ * and `aria-labelledby`. Until its ids settle (on the server, and in the first client render) the self-reference is
87
+ * a second id of React Aria's that is not the element's, so the first token is swapped as well: the server HTML
88
+ * then names the segment fully, and hydration sees the same attribute.
89
+ */
90
+ export declare function withId<P extends {
91
+ id?: string;
92
+ "aria-label"?: string;
93
+ "aria-labelledby"?: string;
94
+ }>(props: P, id: string): P;
95
+ /** Calendars whose months are the Gregorian ones, so the DS's month names fit them (and a month–day is typed in them). */
96
+ export declare const GREGORIAN_MONTHS: ReadonlySet<string>;
97
+ /**
98
+ * A day past the month's end (31.11) stays on screen as typed and the value stays empty, so the field can
99
+ * say why ("November has 30 days."). React Aria would clamp it to 30.11 when focus leaves the field
100
+ * (`confirmPlaceholder`) and report that date as if the user had typed it; for an impossible date that
101
+ * step is skipped. So it is for a part typed out of its range: a month left at "00" would become
102
+ * January, a day "00" the 1st and a 12-hour "0" one o'clock; it stays as typed, with what is missing. Every other use
103
+ * of it (filling an untouched AM/PM) still runs.
104
+ */
105
+ export declare function OverflowWatcher({ fixed, onReport }: {
106
+ fixed?: FixedSegments;
107
+ onReport?: (report: SegmentsReport) => void;
108
+ }): null;
109
+ /** What a field's typed parts amount to, told to the field. */
110
+ export type SegmentsReport = {
111
+ /** A day past the month's end, or what a value typed in part is missing; null when nothing is wrong. */
112
+ message: string | null;
113
+ /** The parts are all filled but name no date (31.11): React Aria keeps its old value, so the field holds none. */
114
+ overflowing: boolean;
115
+ shape: DateShape;
116
+ /** The message naming every visible part. */
117
+ whole: string;
118
+ };
119
+ /**
120
+ * Whether a part holds a value React Aria can use. A first digit can leave a part out of its range while
121
+ * the user is still typing it: a first "0" shows "00" in a month or a day, "0" in a year and "0" in the hour of a
122
+ * 12-hour clock (which runs 1–12), none of them a value and none with its placeholder (React Aria keeps the old date
123
+ * until they are one). Such a part is as good as missing.
124
+ */
125
+ export declare function isFilled(segment: SegmentState): boolean;
126
+ /** Whether a date's or time's visible parts are all empty, partly filled or all filled. */
127
+ export type DateShape = "empty" | "incomplete" | "complete";
128
+ /** What a field types: a date, a date and a time (a range with hours), or a time (TimeField). */
129
+ export type FieldKind = "date" | "dateTime" | "time";
130
+ /**
131
+ * The shape of a field's visible parts: day, month and year, less the hidden ones (a month–day's year, a
132
+ * month's day), and hour, minute and second. `parts` is every visible part and `missing` the empty ones, both in the
133
+ * field's (the locale's) order, as the message names them.
134
+ *
135
+ * A part typed out of its range ("00" for a month) is missing too (see {@link isFilled}).
136
+ *
137
+ * The AM/PM of a 12-hour clock goes with its hour: React Aria fills it when the hour is typed, so it counts as missing
138
+ * only when the hour is typed and it is not ("10:30 ––"), and an AM/PM left over in a field emptied of everything else
139
+ * is an empty field (React Aria would keep the old time until it is cleared too).
140
+ */
141
+ export declare function dateShape(segments: readonly SegmentState[], fixed?: FixedSegments): {
142
+ shape: DateShape;
143
+ missing: DatePartName[];
144
+ parts: DatePartName[];
145
+ kind: FieldKind;
146
+ };
147
+ /**
148
+ * "Incomplete date: enter the day and month, or clear the field.": the missing parts in the field's order, each in the form the
149
+ * sentence takes (DS strings, not Intl's nominative names), in the locale's sentence for a date, a date and time or a
150
+ * time. A locale without DS words reads the English sentence with the English names.
151
+ */
152
+ export declare function incompleteMessage(missing: readonly DatePartName[], locale: string, kind?: FieldKind): string;
153
+ export {};