@yamada-ui/react 2.3.0-next-20260412110753 → 2.3.0-next-20260421164002

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 (334) hide show
  1. package/dist/cjs/components/autocomplete/autocomplete.cjs +10 -21
  2. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  3. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  4. package/dist/cjs/components/chart/cartesian-chart.cjs +5 -20
  5. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  6. package/dist/cjs/components/chart/chart.cjs +2 -4
  7. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  8. package/dist/cjs/components/chart/polar-chart.cjs +10 -38
  9. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  10. package/dist/cjs/components/color-picker/color-picker.cjs +9 -16
  11. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  12. package/dist/cjs/components/color-selector/color-selector.cjs +7 -25
  13. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  14. package/dist/cjs/components/data-list/data-list.cjs +5 -8
  15. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  16. package/dist/cjs/components/date-picker/date-picker.cjs +8 -12
  17. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  18. package/dist/cjs/components/drawer/use-drawer.cjs +1 -1
  19. package/dist/cjs/components/drawer/use-drawer.cjs.map +1 -1
  20. package/dist/cjs/components/file-input/file-input.cjs +2 -4
  21. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  22. package/dist/cjs/components/format/namespace.cjs.map +1 -1
  23. package/dist/cjs/components/group/use-group.cjs +1 -1
  24. package/dist/cjs/components/group/use-group.cjs.map +1 -1
  25. package/dist/cjs/components/indicator/indicator.cjs +4 -3
  26. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  27. package/dist/cjs/components/input/use-input-border.cjs +4 -2
  28. package/dist/cjs/components/input/use-input-border.cjs.map +1 -1
  29. package/dist/cjs/components/native-select/native-select.cjs +8 -12
  30. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  31. package/dist/cjs/components/native-select/use-native-select.cjs +1 -1
  32. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  33. package/dist/cjs/components/number-input/number-input.cjs +2 -2
  34. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  35. package/dist/cjs/components/number-input/number-input.style.cjs +1 -1
  36. package/dist/cjs/components/number-input/number-input.style.cjs.map +1 -1
  37. package/dist/cjs/components/pagination/pagination.cjs +5 -8
  38. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  39. package/dist/cjs/components/password-input/password-input.cjs +3 -6
  40. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  41. package/dist/cjs/components/password-input/password-input.style.cjs +1 -1
  42. package/dist/cjs/components/password-input/password-input.style.cjs.map +1 -1
  43. package/dist/cjs/components/rating/rating.cjs +2 -2
  44. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  45. package/dist/cjs/components/select/select.cjs +10 -20
  46. package/dist/cjs/components/select/select.cjs.map +1 -1
  47. package/dist/cjs/components/sidebar/sidebar.cjs +1 -1
  48. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  49. package/dist/cjs/components/table/table.cjs +0 -3
  50. package/dist/cjs/components/table/table.cjs.map +1 -1
  51. package/dist/cjs/core/css/at-rule.cjs.map +1 -1
  52. package/dist/cjs/core/css/color-mix.cjs +1 -1
  53. package/dist/cjs/core/css/color-mix.cjs.map +1 -1
  54. package/dist/cjs/core/css/color-scheme.cjs.map +1 -1
  55. package/dist/cjs/core/css/styles.cjs +92 -92
  56. package/dist/cjs/core/css/styles.cjs.map +1 -1
  57. package/dist/cjs/core/system/var.cjs.map +1 -1
  58. package/dist/cjs/hooks/use-combobox/index.cjs +1 -1
  59. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  60. package/dist/cjs/hooks/use-local-storage/index.cjs +1 -1
  61. package/dist/cjs/hooks/use-local-storage/index.cjs.map +1 -1
  62. package/dist/cjs/utils/ref.cjs +1 -1
  63. package/dist/cjs/utils/ref.cjs.map +1 -1
  64. package/dist/esm/components/autocomplete/autocomplete.js +10 -21
  65. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  66. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  67. package/dist/esm/components/chart/cartesian-chart.js +6 -21
  68. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  69. package/dist/esm/components/chart/chart.js +2 -4
  70. package/dist/esm/components/chart/chart.js.map +1 -1
  71. package/dist/esm/components/chart/polar-chart.js +11 -39
  72. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  73. package/dist/esm/components/color-picker/color-picker.js +9 -16
  74. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  75. package/dist/esm/components/color-selector/color-selector.js +7 -25
  76. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  77. package/dist/esm/components/data-list/data-list.js +5 -8
  78. package/dist/esm/components/data-list/data-list.js.map +1 -1
  79. package/dist/esm/components/date-picker/date-picker.js +8 -12
  80. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  81. package/dist/esm/components/drawer/use-drawer.js +1 -1
  82. package/dist/esm/components/drawer/use-drawer.js.map +1 -1
  83. package/dist/esm/components/file-input/file-input.js +2 -4
  84. package/dist/esm/components/file-input/file-input.js.map +1 -1
  85. package/dist/esm/components/format/namespace.js.map +1 -1
  86. package/dist/esm/components/group/use-group.js +1 -1
  87. package/dist/esm/components/group/use-group.js.map +1 -1
  88. package/dist/esm/components/indicator/indicator.js +4 -3
  89. package/dist/esm/components/indicator/indicator.js.map +1 -1
  90. package/dist/esm/components/input/use-input-border.js +4 -2
  91. package/dist/esm/components/input/use-input-border.js.map +1 -1
  92. package/dist/esm/components/native-select/native-select.js +8 -12
  93. package/dist/esm/components/native-select/native-select.js.map +1 -1
  94. package/dist/esm/components/native-select/use-native-select.js +1 -1
  95. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  96. package/dist/esm/components/number-input/number-input.js +2 -2
  97. package/dist/esm/components/number-input/number-input.js.map +1 -1
  98. package/dist/esm/components/number-input/number-input.style.js +1 -1
  99. package/dist/esm/components/number-input/number-input.style.js.map +1 -1
  100. package/dist/esm/components/pagination/pagination.js +5 -8
  101. package/dist/esm/components/pagination/pagination.js.map +1 -1
  102. package/dist/esm/components/password-input/password-input.js +3 -6
  103. package/dist/esm/components/password-input/password-input.js.map +1 -1
  104. package/dist/esm/components/password-input/password-input.style.js +1 -1
  105. package/dist/esm/components/password-input/password-input.style.js.map +1 -1
  106. package/dist/esm/components/rating/rating.js +2 -2
  107. package/dist/esm/components/rating/rating.js.map +1 -1
  108. package/dist/esm/components/select/select.js +10 -20
  109. package/dist/esm/components/select/select.js.map +1 -1
  110. package/dist/esm/components/sidebar/sidebar.js +1 -1
  111. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  112. package/dist/esm/components/table/table.js +0 -3
  113. package/dist/esm/components/table/table.js.map +1 -1
  114. package/dist/esm/core/css/at-rule.js.map +1 -1
  115. package/dist/esm/core/css/color-mix.js +1 -1
  116. package/dist/esm/core/css/color-mix.js.map +1 -1
  117. package/dist/esm/core/css/color-scheme.js.map +1 -1
  118. package/dist/esm/core/css/styles.js +92 -92
  119. package/dist/esm/core/css/styles.js.map +1 -1
  120. package/dist/esm/core/system/var.js.map +1 -1
  121. package/dist/esm/hooks/use-combobox/index.js +1 -1
  122. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  123. package/dist/esm/hooks/use-local-storage/index.js +1 -1
  124. package/dist/esm/hooks/use-local-storage/index.js.map +1 -1
  125. package/dist/esm/utils/ref.js +1 -1
  126. package/dist/esm/utils/ref.js.map +1 -1
  127. package/dist/types/components/accordion/accordion.d.ts +2 -2
  128. package/dist/types/components/accordion/accordion.style.d.ts +1 -1
  129. package/dist/types/components/accordion/use-accordion.d.ts +11 -11
  130. package/dist/types/components/action-bar/action-bar.d.ts +2 -2
  131. package/dist/types/components/airy/airy.d.ts +2 -2
  132. package/dist/types/components/alert/alert.d.ts +2 -2
  133. package/dist/types/components/alpha-slider/alpha-slider.d.ts +2 -2
  134. package/dist/types/components/aspect-ratio/aspect-ratio.d.ts +2 -2
  135. package/dist/types/components/autocomplete/autocomplete.d.ts +2 -2
  136. package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
  137. package/dist/types/components/autocomplete/use-autocomplete.d.ts +5 -5
  138. package/dist/types/components/avatar/avatar.d.ts +3 -3
  139. package/dist/types/components/avatar/use-avatar-group.d.ts +2 -2
  140. package/dist/types/components/badge/badge.d.ts +2 -2
  141. package/dist/types/components/bleed/bleed.d.ts +2 -2
  142. package/dist/types/components/blockquote/blockquote.d.ts +2 -2
  143. package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
  144. package/dist/types/components/breadcrumb/breadcrumb.style.d.ts +1 -1
  145. package/dist/types/components/breadcrumb/use-breadcrumb.d.ts +2 -2
  146. package/dist/types/components/button/button.d.ts +2 -2
  147. package/dist/types/components/button/icon-button.d.ts +2 -2
  148. package/dist/types/components/calendar/calendar.d.ts +2 -2
  149. package/dist/types/components/calendar/calendar.style.d.ts +2 -2
  150. package/dist/types/components/calendar/use-calendar.d.ts +9 -9
  151. package/dist/types/components/card/card.d.ts +2 -2
  152. package/dist/types/components/carousel/carousel.d.ts +2 -2
  153. package/dist/types/components/carousel/carousel.style.d.ts +2 -2
  154. package/dist/types/components/carousel/use-carousel.d.ts +3 -3
  155. package/dist/types/components/center/center.d.ts +2 -2
  156. package/dist/types/components/chart/chart.d.ts +11 -9
  157. package/dist/types/components/chart/composed-chart.d.ts +2 -2
  158. package/dist/types/components/chart/donut-chart.d.ts +2 -2
  159. package/dist/types/components/chart/line-chart.d.ts +2 -2
  160. package/dist/types/components/chart/radar-chart.d.ts +2 -2
  161. package/dist/types/components/chart/radial-chart.d.ts +2 -2
  162. package/dist/types/components/chart/use-chart.d.ts +2 -2
  163. package/dist/types/components/checkbox/checkbox.d.ts +4 -4
  164. package/dist/types/components/checkbox/use-checkbox-group.d.ts +2 -2
  165. package/dist/types/components/checkbox-card/checkbox-card.d.ts +5 -5
  166. package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
  167. package/dist/types/components/circle-progress/circle-progress.d.ts +2 -2
  168. package/dist/types/components/close-button/close-button.d.ts +2 -2
  169. package/dist/types/components/code/code.d.ts +2 -2
  170. package/dist/types/components/collapse/collapse.d.ts +2 -2
  171. package/dist/types/components/color-picker/color-picker.d.ts +2 -2
  172. package/dist/types/components/color-picker/use-color-picker.d.ts +2 -2
  173. package/dist/types/components/color-selector/color-selector.d.ts +2 -2
  174. package/dist/types/components/color-selector/use-color-selector.d.ts +3 -3
  175. package/dist/types/components/color-swatch/color-swatch.d.ts +2 -2
  176. package/dist/types/components/container/container.d.ts +2 -2
  177. package/dist/types/components/data-list/data-list.d.ts +2 -2
  178. package/dist/types/components/data-list/data-list.style.d.ts +1 -1
  179. package/dist/types/components/date-picker/date-picker.d.ts +2 -2
  180. package/dist/types/components/date-picker/use-date-picker.d.ts +4 -4
  181. package/dist/types/components/drawer/drawer.d.ts +2 -2
  182. package/dist/types/components/dropzone/dropzone.d.ts +4 -4
  183. package/dist/types/components/editable/editable.d.ts +4 -4
  184. package/dist/types/components/editable/use-editable.d.ts +2 -2
  185. package/dist/types/components/em/em.d.ts +2 -2
  186. package/dist/types/components/empty-state/empty-state.d.ts +2 -2
  187. package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
  188. package/dist/types/components/fade/fade.d.ts +2 -2
  189. package/dist/types/components/field/field.d.ts +3 -3
  190. package/dist/types/components/field/use-field-props.d.ts +3 -3
  191. package/dist/types/components/fieldset/fieldset.d.ts +3 -3
  192. package/dist/types/components/file-button/file-button.d.ts +2 -2
  193. package/dist/types/components/file-button/use-file-button.d.ts +18 -18
  194. package/dist/types/components/file-input/file-input.d.ts +2 -2
  195. package/dist/types/components/file-input/use-file-input.d.ts +15 -15
  196. package/dist/types/components/flex/flex.d.ts +2 -2
  197. package/dist/types/components/flip/flip.d.ts +4 -4
  198. package/dist/types/components/flip/flip.style.d.ts +1 -1
  199. package/dist/types/components/float/float.d.ts +2 -2
  200. package/dist/types/components/form/form.d.ts +3 -3
  201. package/dist/types/components/format/format-byte.d.ts +4 -4
  202. package/dist/types/components/format/format-date-time.d.ts +4 -4
  203. package/dist/types/components/format/format-number.d.ts +2 -2
  204. package/dist/types/components/grid/grid-item.d.ts +2 -2
  205. package/dist/types/components/grid/grid.d.ts +2 -2
  206. package/dist/types/components/group/group.d.ts +2 -2
  207. package/dist/types/components/group/use-group.d.ts +2 -2
  208. package/dist/types/components/heading/heading.d.ts +2 -2
  209. package/dist/types/components/hue-slider/hue-slider.d.ts +3 -3
  210. package/dist/types/components/icon/icon.d.ts +5 -5
  211. package/dist/types/components/image/image.d.ts +2 -2
  212. package/dist/types/components/indicator/indicator.d.ts +4 -4
  213. package/dist/types/components/infinite-scroll-area/infinite-scroll-area.d.ts +2 -2
  214. package/dist/types/components/input/input-addon.d.ts +2 -2
  215. package/dist/types/components/input/input-element.d.ts +2 -2
  216. package/dist/types/components/input/input.d.ts +2 -2
  217. package/dist/types/components/input/use-input-border.d.ts +2 -5
  218. package/dist/types/components/kbd/kbd.d.ts +2 -2
  219. package/dist/types/components/link/link.d.ts +2 -2
  220. package/dist/types/components/link-box/link-box.d.ts +2 -2
  221. package/dist/types/components/list/list.d.ts +2 -2
  222. package/dist/types/components/list/list.style.d.ts +2 -2
  223. package/dist/types/components/loading/loading-provider.d.ts +2 -2
  224. package/dist/types/components/loading/loading.d.ts +3 -3
  225. package/dist/types/components/mark/mark.d.ts +2 -2
  226. package/dist/types/components/menu/menu.d.ts +2 -2
  227. package/dist/types/components/menu/menu.style.d.ts +2 -2
  228. package/dist/types/components/menu/use-menu.d.ts +11 -11
  229. package/dist/types/components/modal/modal.d.ts +2 -2
  230. package/dist/types/components/native-accordion/native-accordion.d.ts +2 -2
  231. package/dist/types/components/native-accordion/native-accordion.style.d.ts +2 -2
  232. package/dist/types/components/native-accordion/use-native-accordion.d.ts +2 -2
  233. package/dist/types/components/native-popover/native-popover.d.ts +2 -2
  234. package/dist/types/components/native-select/native-select.d.ts +2 -2
  235. package/dist/types/components/native-table/native-table.d.ts +4 -4
  236. package/dist/types/components/notice/notice.style.d.ts +1 -1
  237. package/dist/types/components/number-input/number-input.d.ts +2 -2
  238. package/dist/types/components/number-input/number-input.style.d.ts +1 -1
  239. package/dist/types/components/pagination/pagination.d.ts +2 -2
  240. package/dist/types/components/pagination/pagination.style.d.ts +1 -1
  241. package/dist/types/components/pagination/use-pagination.d.ts +2 -2
  242. package/dist/types/components/password-input/password-input.d.ts +2 -2
  243. package/dist/types/components/password-input/strength-meter.d.ts +2 -2
  244. package/dist/types/components/password-input/use-password-input.d.ts +2 -2
  245. package/dist/types/components/pin-input/pin-input.d.ts +2 -2
  246. package/dist/types/components/pin-input/use-pin-input.d.ts +7 -7
  247. package/dist/types/components/popover/popover.d.ts +2 -2
  248. package/dist/types/components/progress/progress.d.ts +4 -4
  249. package/dist/types/components/progress/use-progress.d.ts +706 -706
  250. package/dist/types/components/qr-code/qr-code.d.ts +2 -2
  251. package/dist/types/components/radio/radio.d.ts +4 -4
  252. package/dist/types/components/radio/use-radio-group.d.ts +2 -2
  253. package/dist/types/components/radio-card/radio-card.d.ts +5 -5
  254. package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
  255. package/dist/types/components/rating/rating.style.d.ts +2 -2
  256. package/dist/types/components/rating/use-rating.d.ts +7 -7
  257. package/dist/types/components/reorder/reorder.d.ts +2 -2
  258. package/dist/types/components/reorder/reorder.style.d.ts +1 -1
  259. package/dist/types/components/reorder/use-reorder.d.ts +3 -3
  260. package/dist/types/components/resizable/resizable.d.ts +2 -2
  261. package/dist/types/components/resizable/resizable.style.d.ts +2 -2
  262. package/dist/types/components/resizable/use-resizable.d.ts +2 -2
  263. package/dist/types/components/ripple/ripple.d.ts +2 -2
  264. package/dist/types/components/ripple/use-ripple.d.ts +2 -2
  265. package/dist/types/components/rotate/rotate.d.ts +2 -2
  266. package/dist/types/components/saturation-slider/saturation-slider.d.ts +2 -2
  267. package/dist/types/components/saturation-slider/use-saturation-slider.d.ts +2 -2
  268. package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
  269. package/dist/types/components/segmented-control/segmented-control.d.ts +2 -2
  270. package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
  271. package/dist/types/components/segmented-control/use-segmented-control.d.ts +9 -9
  272. package/dist/types/components/select/select.d.ts +2 -2
  273. package/dist/types/components/select/use-select.d.ts +4 -4
  274. package/dist/types/components/separator/separator.d.ts +2 -2
  275. package/dist/types/components/sidebar/sidebar.d.ts +2 -2
  276. package/dist/types/components/sidebar/sidebar.style.d.ts +1 -1
  277. package/dist/types/components/sidebar/use-sidebar.d.ts +9 -9
  278. package/dist/types/components/simple-grid/simple-grid.d.ts +2 -2
  279. package/dist/types/components/skeleton/skeleton.d.ts +2 -2
  280. package/dist/types/components/slide/slide.d.ts +2 -2
  281. package/dist/types/components/slide-fade/slide-fade.d.ts +2 -2
  282. package/dist/types/components/slider/slider.d.ts +2 -2
  283. package/dist/types/components/slider/use-slider.d.ts +2 -2
  284. package/dist/types/components/stack/h-stack.d.ts +2 -2
  285. package/dist/types/components/stack/stack.d.ts +2 -2
  286. package/dist/types/components/stack/v-stack.d.ts +2 -2
  287. package/dist/types/components/stack/z-stack.d.ts +2 -2
  288. package/dist/types/components/stat/stat.d.ts +2 -2
  289. package/dist/types/components/status/status.d.ts +2 -2
  290. package/dist/types/components/steps/steps.d.ts +2 -2
  291. package/dist/types/components/steps/steps.style.d.ts +1 -1
  292. package/dist/types/components/steps/use-steps.d.ts +10 -10
  293. package/dist/types/components/switch/switch.d.ts +2 -2
  294. package/dist/types/components/table/table.d.ts +2 -2
  295. package/dist/types/components/tabs/tabs.d.ts +2 -2
  296. package/dist/types/components/tabs/use-tabs.d.ts +16 -16
  297. package/dist/types/components/tag/tag.d.ts +2 -2
  298. package/dist/types/components/text/text.d.ts +2 -2
  299. package/dist/types/components/textarea/textarea.d.ts +2 -2
  300. package/dist/types/components/textarea/use-autosize.d.ts +2 -2
  301. package/dist/types/components/timeline/timeline.d.ts +5 -5
  302. package/dist/types/components/timeline/timeline.style.d.ts +1 -1
  303. package/dist/types/components/toggle/toggle.d.ts +5 -5
  304. package/dist/types/components/toggle/use-toggle-group.d.ts +2 -2
  305. package/dist/types/components/toggle/use-toggle.d.ts +2 -2
  306. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  307. package/dist/types/components/tree/tree.d.ts +2 -2
  308. package/dist/types/components/tree/tree.style.d.ts +1 -1
  309. package/dist/types/components/tree/use-tree.d.ts +182 -182
  310. package/dist/types/components/visually-hidden/visually-hidden.d.ts +2 -2
  311. package/dist/types/components/wrap/wrap.d.ts +2 -2
  312. package/dist/types/core/components/create-component.d.ts +9 -9
  313. package/dist/types/core/css/index.d.ts +2 -2
  314. package/dist/types/core/css/index.types.d.ts +2 -1
  315. package/dist/types/core/css/styles.d.ts +44 -44
  316. package/dist/types/core/generated-theme-tokens.types.d.ts +17 -17
  317. package/dist/types/core/index.d.ts +2 -2
  318. package/dist/types/core/system/color-mode-provider.d.ts +2 -2
  319. package/dist/types/core/system/storage-script.d.ts +3 -3
  320. package/dist/types/core/system/styled.d.ts +2 -2
  321. package/dist/types/core/system/system-provider.d.ts +2 -2
  322. package/dist/types/hooks/use-breakpoint/use-breakpoint-state.d.ts +2 -2
  323. package/dist/types/hooks/use-clickable/index.d.ts +7 -7
  324. package/dist/types/hooks/use-clipboard/index.d.ts +2 -2
  325. package/dist/types/hooks/use-descendants/index.d.ts +2 -2
  326. package/dist/types/hooks/use-field-sizing/index.d.ts +2 -2
  327. package/dist/types/hooks/use-hover/index.d.ts +2 -2
  328. package/dist/types/hooks/use-popper/index.d.ts +2 -2
  329. package/dist/types/hooks/use-resize-observer/index.d.ts +3 -3
  330. package/dist/types/index.d.ts +3 -3
  331. package/dist/types/providers/i18n-provider/i18n-provider.d.ts +3 -3
  332. package/dist/types/providers/ui-provider/ui-provider.d.ts +2 -2
  333. package/dist/types/utils/children.d.ts +2 -2
  334. package/package.json +8 -8
@@ -3,6 +3,7 @@
3
3
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
4
4
  const require_utils_index = require('../../utils/index.cjs');
5
5
  const require_factory = require('../../core/system/factory.cjs');
6
+ const require_props = require('../../core/components/props.cjs');
6
7
  const require_create_component = require('../../core/components/create-component.cjs');
7
8
  require('../../core/index.cjs');
8
9
  const require_check_icon = require('../icon/icons/check-icon.cjs');
@@ -107,15 +108,13 @@ const AutocompleteRoot = withProvider((props) => {
107
108
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_popover.PopoverRoot, {
108
109
  ...mergedPopoverProps,
109
110
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_input_group.InputGroupRoot, {
110
- className,
111
- css,
112
111
  colorScheme,
113
- ...getRootProps({
114
- ...groupItemProps,
115
- ...rootProps
116
- }),
112
+ ...require_props.mergeProps({
113
+ className,
114
+ css
115
+ }, getRootProps(groupItemProps), rootProps)(),
117
116
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.PopoverTrigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutocompleteField, {
118
- ...getFieldProps(varProps),
117
+ ...getFieldProps({ ...varProps }),
119
118
  children: fieldChildren
120
119
  }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_element.InputElement, {
121
120
  clickable: clearable && hasValue,
@@ -138,10 +137,7 @@ const AutocompleteRoot = withProvider((props) => {
138
137
  })
139
138
  });
140
139
  }, "root")((props) => {
141
- return {
142
- ...require_input.useInputPropsContext(),
143
- ...props
144
- };
140
+ return require_props.mergeProps(require_input.useInputPropsContext(), props)();
145
141
  });
146
142
  const AutocompleteField = withContext("div", "field")({ "data-group-propagate": "" }, ({ children, ...rest }) => {
147
143
  const { getInputProps, inputProps } = useComponentContext();
@@ -162,10 +158,7 @@ const AutocompleteLabel = withContext("span", "label")(void 0, (props) => {
162
158
  });
163
159
  const AutocompleteGroup = withContext(({ children, label, labelProps, ...rest }) => {
164
160
  const { groupProps } = useComponentContext();
165
- const { getGroupProps, getLabelProps } = require_hooks_use_combobox_index.useComboboxGroup({
166
- ...groupProps,
167
- ...rest
168
- });
161
+ const { getGroupProps, getLabelProps } = require_hooks_use_combobox_index.useComboboxGroup(require_props.mergeProps(groupProps, rest)());
169
162
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_hooks_use_combobox_index.ComboboxGroupContext, {
170
163
  value: (0, react.useMemo)(() => ({ getLabelProps }), [getLabelProps]),
171
164
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
@@ -179,10 +172,7 @@ const AutocompleteGroup = withContext(({ children, label, labelProps, ...rest })
179
172
  }, "group")();
180
173
  const AutocompleteOption = withContext(({ children, icon: iconProp, ...rest }) => {
181
174
  const { optionProps: { icon, ...optionProps } = {} } = useComponentContext();
182
- const { getIndicatorProps, getOptionProps } = require_use_autocomplete.useAutocompleteOption({
183
- ...optionProps,
184
- ...rest
185
- });
175
+ const { getIndicatorProps, getOptionProps } = require_use_autocomplete.useAutocompleteOption(require_props.mergeProps(optionProps, rest)());
186
176
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
187
177
  ...getOptionProps(),
188
178
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutocompleteIndicator, {
@@ -194,8 +184,7 @@ const AutocompleteOption = withContext(({ children, icon: iconProp, ...rest }) =
194
184
  const AutocompleteEmpty = withContext(({ children, icon, ...rest }) => {
195
185
  const { emptyIcon, emptyProps } = useComponentContext();
196
186
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
197
- ...emptyProps,
198
- ...rest,
187
+ ...require_props.mergeProps(emptyProps, rest)(),
199
188
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutocompleteIndicator, { children: icon ?? emptyIcon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_minus_icon.MinusIcon, {}) }), children]
200
189
  });
201
190
  }, "empty")();
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.cjs","names":["createSlotComponent","autocompleteStyle","XIcon","useGroupItemProps","usePopoverStyleProps","useAutocomplete","createComboboxItem","createComboboxChildren","useInputBorder","ComboboxDescendantsContext","ComboboxContext","AutocompleteContext","useInputPropsContext","ChevronDownIcon","useComboboxGroupContext","useComboboxGroup","ComboboxGroupContext","styled","useAutocompleteOption","CheckIcon","MinusIcon"],"sources":["../../../../src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type {\n ComboboxItem,\n UseComboboxGroupProps,\n} from \"../../hooks/use-combobox\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { AutocompleteStyle } from \"./autocomplete.style\"\nimport type {\n UseAutocompleteOptionProps,\n UseAutocompleteProps,\n UseAutocompleteReturn,\n} from \"./use-autocomplete\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport {\n ComboboxContext,\n ComboboxDescendantsContext,\n ComboboxGroupContext,\n createComboboxChildren,\n createComboboxItem,\n useComboboxGroup,\n useComboboxGroupContext,\n} from \"../../hooks/use-combobox\"\nimport { cast, isArray } from \"../../utils\"\nimport { useGroupItemProps } from \"../group\"\nimport { CheckIcon, ChevronDownIcon, MinusIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { autocompleteStyle } from \"./autocomplete.style\"\nimport {\n AutocompleteContext,\n useAutocomplete,\n useAutocompleteOption,\n} from \"./use-autocomplete\"\n\ninterface ComponentContext\n extends\n Pick<UseAutocompleteReturn, \"getInputProps\" | \"getSeparatorProps\">,\n Pick<\n AutocompleteRootProps,\n \"emptyIcon\" | \"emptyProps\" | \"groupProps\" | \"inputProps\" | \"optionProps\"\n > {}\n\nexport interface AutocompleteRootProps<Multiple extends boolean = false>\n extends\n Omit<\n HTMLStyledProps,\n \"defaultValue\" | \"filter\" | \"offset\" | \"onChange\" | \"ref\" | \"value\"\n >,\n Merge<UseAutocompleteProps<Multiple>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<AutocompleteStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default true\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the empty element.\n */\n emptyIcon?: ReactNode\n /**\n * The icon to be used in the autocomplete.\n */\n icon?: ReactNode\n /**\n * Props for content element.\n */\n contentProps?: AutocompleteContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for empty element.\n */\n emptyProps?: AutocompleteEmptyProps\n /**\n * Props for group element.\n */\n groupProps?: Omit<AutocompleteGroupProps, \"children\" | \"label\">\n /**\n * Props for icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * The props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for option element.\n */\n optionProps?: Omit<AutocompleteOptionProps, \"children\" | \"value\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: AutocompletePropsContext,\n useComponentContext,\n usePropsContext: useAutocompletePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n AutocompleteRootProps,\n AutocompleteStyle,\n ComponentContext\n>(\"autocomplete\", autocompleteStyle)\n\nexport { AutocompletePropsContext, useAutocompletePropsContext }\n\n/**\n * `Autocomplete` is a component used to display suggestions in response to user text input.\n *\n * @see https://yamada-ui.com/docs/components/autocomplete\n */\nexport const AutocompleteRoot = withProvider(\n <Multiple extends boolean = false>(\n props: AutocompleteRootProps<Multiple>,\n ) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n animationScheme = \"block-start\",\n children,\n clearable = true,\n clearIcon = <XIcon />,\n duration,\n emptyIcon,\n errorBorderColor,\n focusBorderColor,\n icon,\n items: itemsProp,\n contentProps,\n elementProps,\n emptyProps,\n groupProps,\n iconProps,\n inputProps,\n optionProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const items = useMemo<ComboboxItem[]>(() => {\n if (itemsProp) return itemsProp\n\n return createComboboxItem(children, {\n Group: AutocompleteGroup,\n Label: AutocompleteLabel,\n Option: AutocompleteOption,\n })\n }, [itemsProp, children])\n const {\n children: fieldChildren,\n descendants,\n items: computedItems,\n max,\n value,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onClose,\n onSelect,\n } = useAutocomplete({ items, ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const computedChildren = useMemo(\n () =>\n createComboboxChildren(computedItems, {\n Empty: AutocompleteEmpty,\n Group: AutocompleteGroup,\n Option: AutocompleteOption,\n }),\n [computedItems],\n )\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const comboboxContext = useMemo(\n () => ({ onActiveDescendant, onClose, onSelect }),\n [onActiveDescendant, onClose, onSelect],\n )\n const autocompleteContext = useMemo(() => ({ max, value }), [value, max])\n const componentContext = useMemo(\n () => ({\n emptyIcon,\n emptyProps,\n getInputProps,\n getSeparatorProps,\n groupProps,\n inputProps,\n optionProps,\n }),\n [\n emptyIcon,\n emptyProps,\n getInputProps,\n getSeparatorProps,\n groupProps,\n inputProps,\n optionProps,\n ],\n )\n const hasValue = isArray(value) ? !!value.length : !!value\n\n return (\n <ComboboxDescendantsContext value={descendants}>\n <ComboboxContext value={comboboxContext}>\n <AutocompleteContext value={autocompleteContext}>\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <InputGroup.Root\n className={className}\n css={css}\n colorScheme={colorScheme}\n {...getRootProps({ ...groupItemProps, ...rootProps })}\n >\n <Popover.Trigger>\n <AutocompleteField {...getFieldProps(varProps)}>\n {fieldChildren}\n </AutocompleteField>\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <AutocompleteIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <AutocompleteIcon\n icon={icon}\n {...getIconProps(iconProps)}\n />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <AutocompleteContent\n {...cast<AutocompleteContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {computedChildren}\n </AutocompleteContent>\n </Popover.Root>\n </ComponentContext>\n </AutocompleteContext>\n </ComboboxContext>\n </ComboboxDescendantsContext>\n )\n },\n \"root\",\n)((props) => {\n const context = useInputPropsContext()\n\n return { ...context, ...props }\n}) as GenericsComponent<{\n <Multiple extends boolean = false>(\n props: AutocompleteRootProps<Multiple>,\n ): ReactElement\n}>\n\ninterface AutocompleteFieldProps extends HTMLStyledProps {}\n\nconst AutocompleteField = withContext<\"div\", AutocompleteFieldProps>(\n \"div\",\n \"field\",\n)({ \"data-group-propagate\": \"\" }, ({ children, ...rest }) => {\n const { getInputProps, inputProps } = useComponentContext()\n\n return {\n ...rest,\n children: (\n <>\n {children}\n <AutocompleteInput {...getInputProps(inputProps)} />\n </>\n ),\n }\n})\n\ninterface AutocompleteInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst AutocompleteInput = withContext<\"input\", AutocompleteInputProps>(\n \"input\",\n \"input\",\n)()\n\ninterface AutocompleteIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst AutocompleteIcon = withContext<\"div\", AutocompleteIconProps>(\n \"div\",\n \"icon\",\n)(undefined, ({ children, icon, ...rest }) => ({\n children: icon || children || <ChevronDownIcon />,\n ...rest,\n}))\n\ninterface AutocompleteContentProps extends Popover.ContentProps {}\n\nconst AutocompleteContent = withContext<\"div\", AutocompleteContentProps>(\n Popover.Content,\n \"content\",\n)()\n\nexport interface AutocompleteLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const AutocompleteLabel = withContext<\"span\", AutocompleteLabelProps>(\n \"span\",\n \"label\",\n)(undefined, (props) => {\n const { getLabelProps } = useComboboxGroupContext()\n\n return getLabelProps(props)\n})\n\nexport interface AutocompleteGroupProps\n extends UseComboboxGroupProps, HTMLStyledProps {\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the label component.\n */\n labelProps?: AutocompleteLabelProps\n}\n\nexport const AutocompleteGroup = withContext<\"div\", AutocompleteGroupProps>(\n ({ children, label, labelProps, ...rest }) => {\n const { groupProps } = useComponentContext()\n const { getGroupProps, getLabelProps } = useComboboxGroup({\n ...groupProps,\n ...rest,\n })\n const context = useMemo(() => ({ getLabelProps }), [getLabelProps])\n\n return (\n <ComboboxGroupContext value={context}>\n <styled.div {...getGroupProps()}>\n {label ? (\n <AutocompleteLabel {...labelProps}>{label}</AutocompleteLabel>\n ) : null}\n {children}\n </styled.div>\n </ComboboxGroupContext>\n )\n },\n \"group\",\n)()\n\nexport interface AutocompleteOptionProps\n extends UseAutocompleteOptionProps, HTMLStyledProps {\n /**\n * The icon to be used in the autocomplete option.\n */\n icon?: ReactNode\n}\n\nexport const AutocompleteOption = withContext<\"div\", AutocompleteOptionProps>(\n ({ children, icon: iconProp, ...rest }) => {\n const { optionProps: { icon, ...optionProps } = {} } = useComponentContext()\n const { getIndicatorProps, getOptionProps } = useAutocompleteOption({\n ...optionProps,\n ...rest,\n })\n\n return (\n <styled.div {...getOptionProps()}>\n <AutocompleteIndicator {...getIndicatorProps()}>\n {iconProp ?? icon ?? <CheckIcon />}\n </AutocompleteIndicator>\n {children}\n </styled.div>\n )\n },\n \"option\",\n)()\n\ninterface AutocompleteEmptyProps extends HTMLStyledProps {\n /**\n * The icon to be used in the autocomplete option.\n */\n icon?: ReactNode\n}\n\nconst AutocompleteEmpty = withContext<\"div\", AutocompleteEmptyProps>(\n ({ children, icon, ...rest }) => {\n const { emptyIcon, emptyProps } = useComponentContext()\n\n return (\n <styled.div {...emptyProps} {...rest}>\n <AutocompleteIndicator>\n {icon ?? emptyIcon ?? <MinusIcon />}\n </AutocompleteIndicator>\n {children}\n </styled.div>\n )\n },\n \"empty\",\n)()\n\ninterface AutocompleteIndicatorProps extends HTMLStyledProps {}\n\nconst AutocompleteIndicator = withContext<\"div\", AutocompleteIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAM,EACJ,kBACA,cAAc,0BACd,qBACA,iBAAiB,6BACjB,aACA,iBACEA,6CAIF,gBAAgBC,6CAAkB;;;;;;AASpC,MAAa,mBAAmB,cAE5B,UACG;CACH,MAAM,CACJ,gBACA,EACE,WACA,KACA,aACA,kBAAkB,eAClB,UACA,YAAY,MACZ,YAAY,2CAACC,yBAAQ,EACrB,UACA,WACA,kBACA,kBACA,MACA,OAAO,WACP,cACA,cACA,YACA,YACA,WACA,YACA,aACA,WACA,GAAG,UAEHC,oCAAkB,MAAM;CAC5B,MAAM,oBAAoBC,qCAAqB,KAAK;CAUpD,MAAM,EACJ,UAAU,eACV,aACA,OAAO,eACP,KACA,OACA,mBACA,iBACA,eACA,cACA,eACA,cACA,mBACA,cACA,oBACA,SACA,aACEC,yCAAgB;EAAE,gCA1BsB;AAC1C,OAAI,UAAW,QAAO;AAEtB,UAAOC,oDAAmB,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QACE,4CAACD,uBAAO;EAAI,GAAI,gBAAgB;aAC9B,2CAAC;GAAsB,GAAI,mBAAmB;aAC3C,YAAY,QAAQ,2CAACE,iCAAY;IACZ,EACvB;GACU;GAGjB,SACD,EAAE;AASH,MAAM,oBAAoB,aACvB,EAAE,UAAU,MAAM,GAAG,WAAW;CAC/B,MAAM,EAAE,WAAW,eAAe,qBAAqB;AAEvD,QACE,4CAACF,uBAAO;EAAI,GAAI;EAAY,GAAI;aAC9B,2CAAC,mCACE,QAAQ,aAAa,2CAACG,iCAAY,GACb,EACvB;GACU;GAGjB,QACD,EAAE;AAIH,MAAM,wBAAwB,YAC5B,OACA,YACD,EAAE"}
1
+ {"version":3,"file":"autocomplete.cjs","names":["createSlotComponent","autocompleteStyle","XIcon","useGroupItemProps","usePopoverStyleProps","useAutocomplete","createComboboxItem","createComboboxChildren","useInputBorder","ComboboxDescendantsContext","ComboboxContext","AutocompleteContext","mergeProps","useInputPropsContext","ChevronDownIcon","useComboboxGroupContext","useComboboxGroup","ComboboxGroupContext","styled","useAutocompleteOption","CheckIcon","MinusIcon"],"sources":["../../../../src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type {\n ComboboxItem,\n UseComboboxGroupProps,\n} from \"../../hooks/use-combobox\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { AutocompleteStyle } from \"./autocomplete.style\"\nimport type {\n UseAutocompleteOptionProps,\n UseAutocompleteProps,\n UseAutocompleteReturn,\n} from \"./use-autocomplete\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport {\n ComboboxContext,\n ComboboxDescendantsContext,\n ComboboxGroupContext,\n createComboboxChildren,\n createComboboxItem,\n useComboboxGroup,\n useComboboxGroupContext,\n} from \"../../hooks/use-combobox\"\nimport { cast, isArray } from \"../../utils\"\nimport { useGroupItemProps } from \"../group\"\nimport { CheckIcon, ChevronDownIcon, MinusIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { autocompleteStyle } from \"./autocomplete.style\"\nimport {\n AutocompleteContext,\n useAutocomplete,\n useAutocompleteOption,\n} from \"./use-autocomplete\"\n\ninterface ComponentContext\n extends\n Pick<UseAutocompleteReturn, \"getInputProps\" | \"getSeparatorProps\">,\n Pick<\n AutocompleteRootProps,\n \"emptyIcon\" | \"emptyProps\" | \"groupProps\" | \"inputProps\" | \"optionProps\"\n > {}\n\nexport interface AutocompleteRootProps<Multiple extends boolean = false>\n extends\n Omit<\n HTMLStyledProps,\n \"defaultValue\" | \"filter\" | \"offset\" | \"onChange\" | \"ref\" | \"value\"\n >,\n Merge<UseAutocompleteProps<Multiple>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<AutocompleteStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default true\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the empty element.\n */\n emptyIcon?: ReactNode\n /**\n * The icon to be used in the autocomplete.\n */\n icon?: ReactNode\n /**\n * Props for content element.\n */\n contentProps?: AutocompleteContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for empty element.\n */\n emptyProps?: AutocompleteEmptyProps\n /**\n * Props for group element.\n */\n groupProps?: Omit<AutocompleteGroupProps, \"children\" | \"label\">\n /**\n * Props for icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * The props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for option element.\n */\n optionProps?: Omit<AutocompleteOptionProps, \"children\" | \"value\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: AutocompletePropsContext,\n useComponentContext,\n usePropsContext: useAutocompletePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n AutocompleteRootProps,\n AutocompleteStyle,\n ComponentContext\n>(\"autocomplete\", autocompleteStyle)\n\nexport { AutocompletePropsContext, useAutocompletePropsContext }\n\n/**\n * `Autocomplete` is a component used to display suggestions in response to user text input.\n *\n * @see https://yamada-ui.com/docs/components/autocomplete\n */\nexport const AutocompleteRoot = withProvider(\n <Multiple extends boolean = false>(\n props: AutocompleteRootProps<Multiple>,\n ) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n animationScheme = \"block-start\",\n children,\n clearable = true,\n clearIcon = <XIcon />,\n duration,\n emptyIcon,\n errorBorderColor,\n focusBorderColor,\n icon,\n items: itemsProp,\n contentProps,\n elementProps,\n emptyProps,\n groupProps,\n iconProps,\n inputProps,\n optionProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const items = useMemo<ComboboxItem[]>(() => {\n if (itemsProp) return itemsProp\n\n return createComboboxItem(children, {\n Group: AutocompleteGroup,\n Label: AutocompleteLabel,\n Option: AutocompleteOption,\n })\n }, [itemsProp, children])\n const {\n children: fieldChildren,\n descendants,\n items: computedItems,\n max,\n value,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onClose,\n onSelect,\n } = useAutocomplete({ items, ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const computedChildren = useMemo(\n () =>\n createComboboxChildren(computedItems, {\n Empty: AutocompleteEmpty,\n Group: AutocompleteGroup,\n Option: AutocompleteOption,\n }),\n [computedItems],\n )\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const comboboxContext = useMemo(\n () => ({ onActiveDescendant, onClose, onSelect }),\n [onActiveDescendant, onClose, onSelect],\n )\n const autocompleteContext = useMemo(() => ({ max, value }), [value, max])\n const componentContext = useMemo(\n () => ({\n emptyIcon,\n emptyProps,\n getInputProps,\n getSeparatorProps,\n groupProps,\n inputProps,\n optionProps,\n }),\n [\n emptyIcon,\n emptyProps,\n getInputProps,\n getSeparatorProps,\n groupProps,\n inputProps,\n optionProps,\n ],\n )\n const hasValue = isArray(value) ? !!value.length : !!value\n\n return (\n <ComboboxDescendantsContext value={descendants}>\n <ComboboxContext value={comboboxContext}>\n <AutocompleteContext value={autocompleteContext}>\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <InputGroup.Root\n colorScheme={colorScheme}\n {...mergeProps(\n { className, css },\n getRootProps(groupItemProps),\n rootProps,\n )()}\n >\n <Popover.Trigger>\n <AutocompleteField {...getFieldProps({ ...varProps })}>\n {fieldChildren}\n </AutocompleteField>\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <AutocompleteIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <AutocompleteIcon\n icon={icon}\n {...getIconProps(iconProps)}\n />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <AutocompleteContent\n {...cast<AutocompleteContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {computedChildren}\n </AutocompleteContent>\n </Popover.Root>\n </ComponentContext>\n </AutocompleteContext>\n </ComboboxContext>\n </ComboboxDescendantsContext>\n )\n },\n \"root\",\n)((props) => {\n const context = useInputPropsContext()\n\n return mergeProps(context, props)()\n}) as GenericsComponent<{\n <Multiple extends boolean = false>(\n props: AutocompleteRootProps<Multiple>,\n ): ReactElement\n}>\n\ninterface AutocompleteFieldProps extends HTMLStyledProps {}\n\nconst AutocompleteField = withContext<\"div\", AutocompleteFieldProps>(\n \"div\",\n \"field\",\n)({ \"data-group-propagate\": \"\" }, ({ children, ...rest }) => {\n const { getInputProps, inputProps } = useComponentContext()\n\n return {\n ...rest,\n children: (\n <>\n {children}\n <AutocompleteInput {...getInputProps(inputProps)} />\n </>\n ),\n }\n})\n\ninterface AutocompleteInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst AutocompleteInput = withContext<\"input\", AutocompleteInputProps>(\n \"input\",\n \"input\",\n)()\n\ninterface AutocompleteIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst AutocompleteIcon = withContext<\"div\", AutocompleteIconProps>(\n \"div\",\n \"icon\",\n)(undefined, ({ children, icon, ...rest }) => ({\n children: icon || children || <ChevronDownIcon />,\n ...rest,\n}))\n\ninterface AutocompleteContentProps extends Popover.ContentProps {}\n\nconst AutocompleteContent = withContext<\"div\", AutocompleteContentProps>(\n Popover.Content,\n \"content\",\n)()\n\nexport interface AutocompleteLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const AutocompleteLabel = withContext<\"span\", AutocompleteLabelProps>(\n \"span\",\n \"label\",\n)(undefined, (props) => {\n const { getLabelProps } = useComboboxGroupContext()\n\n return getLabelProps(props)\n})\n\nexport interface AutocompleteGroupProps\n extends UseComboboxGroupProps, HTMLStyledProps {\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the label component.\n */\n labelProps?: AutocompleteLabelProps\n}\n\nexport const AutocompleteGroup = withContext<\"div\", AutocompleteGroupProps>(\n ({ children, label, labelProps, ...rest }) => {\n const { groupProps } = useComponentContext()\n const { getGroupProps, getLabelProps } = useComboboxGroup(\n mergeProps(groupProps, rest)(),\n )\n const context = useMemo(() => ({ getLabelProps }), [getLabelProps])\n\n return (\n <ComboboxGroupContext value={context}>\n <styled.div {...getGroupProps()}>\n {label ? (\n <AutocompleteLabel {...labelProps}>{label}</AutocompleteLabel>\n ) : null}\n {children}\n </styled.div>\n </ComboboxGroupContext>\n )\n },\n \"group\",\n)()\n\nexport interface AutocompleteOptionProps\n extends UseAutocompleteOptionProps, HTMLStyledProps {\n /**\n * The icon to be used in the autocomplete option.\n */\n icon?: ReactNode\n}\n\nexport const AutocompleteOption = withContext<\"div\", AutocompleteOptionProps>(\n ({ children, icon: iconProp, ...rest }) => {\n const { optionProps: { icon, ...optionProps } = {} } = useComponentContext()\n const { getIndicatorProps, getOptionProps } = useAutocompleteOption(\n mergeProps(optionProps, rest)(),\n )\n\n return (\n <styled.div {...getOptionProps()}>\n <AutocompleteIndicator {...getIndicatorProps()}>\n {iconProp ?? icon ?? <CheckIcon />}\n </AutocompleteIndicator>\n {children}\n </styled.div>\n )\n },\n \"option\",\n)()\n\ninterface AutocompleteEmptyProps extends HTMLStyledProps {\n /**\n * The icon to be used in the autocomplete option.\n */\n icon?: ReactNode\n}\n\nconst AutocompleteEmpty = withContext<\"div\", AutocompleteEmptyProps>(\n ({ children, icon, ...rest }) => {\n const { emptyIcon, emptyProps } = useComponentContext()\n\n return (\n <styled.div {...mergeProps(emptyProps, rest)()}>\n <AutocompleteIndicator>\n {icon ?? emptyIcon ?? <MinusIcon />}\n </AutocompleteIndicator>\n {children}\n </styled.div>\n )\n },\n \"empty\",\n)()\n\ninterface AutocompleteIndicatorProps extends HTMLStyledProps {}\n\nconst AutocompleteIndicator = withContext<\"div\", AutocompleteIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAM,EACJ,kBACA,cAAc,0BACd,qBACA,iBAAiB,6BACjB,aACA,iBACEA,6CAIF,gBAAgBC,6CAAkB;;;;;;AASpC,MAAa,mBAAmB,cAE5B,UACG;CACH,MAAM,CACJ,gBACA,EACE,WACA,KACA,aACA,kBAAkB,eAClB,UACA,YAAY,MACZ,YAAY,2CAACC,yBAAQ,EACrB,UACA,WACA,kBACA,kBACA,MACA,OAAO,WACP,cACA,cACA,YACA,YACA,WACA,YACA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AI;cAAa;KAA0B,GAC5D,MACH;IACU;GACQ;GAG3B,QACD,EAAE;AAUH,MAAa,qBAAqB,aAC/B,EAAE,UAAU,MAAM,UAAU,GAAG,WAAW;CACzC,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,gBAAgB,EAAE,KAAK,qBAAqB;CAC5E,MAAM,EAAE,mBAAmB,mBAAmBC,+CAC5CP,yBAAW,aAAa,KAAK,EAAE,CAChC;AAED,QACE,4CAACM,uBAAO;EAAI,GAAI,gBAAgB;aAC9B,2CAAC;GAAsB,GAAI,mBAAmB;aAC3C,YAAY,QAAQ,2CAACE,iCAAY;IACZ,EACvB;GACU;GAGjB,SACD,EAAE;AASH,MAAM,oBAAoB,aACvB,EAAE,UAAU,MAAM,GAAG,WAAW;CAC/B,MAAM,EAAE,WAAW,eAAe,qBAAqB;AAEvD,QACE,4CAACF,uBAAO;EAAI,GAAIN,yBAAW,YAAY,KAAK,EAAE;aAC5C,2CAAC,mCACE,QAAQ,aAAa,2CAACS,iCAAY,GACb,EACvB;GACU;GAGjB,QACD,EAAE;AAIH,MAAM,wBAAwB,YAC5B,OACA,YACD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-calendar.cjs","names":["DEFAULT_HOLIDAYS: Date[]","DEFAULT_WEEKEND_DAYS: number[]","DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek","DEFAULT_MAX_DATE: Date","DEFAULT_MIN_DATE: Date","weekdays: { label: string; value: number }[]","weeks: { label: string; value: Date }[][]","days: { label: string; value: Date }[]","createDescendants","createContext","useI18n","useDateTimeFormat","value","useControllableState","startOfMonth","yearItems: { label: string; value: string }[]","yearItems","monthItems: { label: string; value: string }[]","month","monthItems","index: null | number","descendant: Descendant<HTMLTableCellElement> | undefined","getRootProps: PropGetter","getNavigationProps: PropGetter<\"nav\">","getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n >","getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n >","getStatusProps: PropGetter","visuallyHiddenAttributes","getMonthProps: PropGetter<\"table\">","mergeRefs","getWeekdayProps: RequiredPropGetter<\"th\", { value: number }>","getButtonProps: PropGetter<\"button\">","getPrevButtonProps: PropGetter<\"button\">","getNextButtonProps: PropGetter<\"button\">","holiday","selectedValue","ev","calendarProps: (keyof UseCalendarProps)[]","useSplitProps"],"sources":["../../../../src/components/calendar/use-calendar.ts"],"sourcesContent":["\"use client\"\n\nimport type { FocusEvent, KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter, RequiredPropGetter } from \"../../core\"\nimport type { Descendant } from \"../../hooks/use-descendants\"\nimport type { Locale } from \"../../providers/i18n-provider\"\nimport type { AnyString, Dict } from \"../../utils\"\nimport dayjs from \"dayjs\"\nimport { useCallback, useMemo, useRef } from \"react\"\nimport { useSplitProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n contains,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport const DEFAULT_HOLIDAYS: Date[] = []\nexport const DEFAULT_WEEKEND_DAYS: number[] = [0, 6]\nexport const DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek = \"sunday\"\nexport const DEFAULT_MAX_DATE: Date = new Date(\"2099-12-31\")\nexport const DEFAULT_MIN_DATE: Date = new Date(\"1900-01-01\")\n\nexport type MaybeDate = Date | Date[] | undefined | { end?: Date; start?: Date }\nexport type MaybeDateValue<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> = Range extends true\n ? { end?: Date; start?: Date }\n : Multiple extends true\n ? Date[]\n : Date | undefined\nexport type StartDayOfWeek = \"monday\" | \"sunday\"\nexport interface CalendarFormat {\n day?: Intl.DateTimeFormatOptions[\"day\"] | null\n month?: Intl.DateTimeFormatOptions[\"month\"] | null\n weekday?: Intl.DateTimeFormatOptions[\"weekday\"] | null\n year?: Intl.DateTimeFormatOptions[\"year\"] | null\n}\n\nexport const getStartOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .startOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getEndOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .endOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getWeekdays = (\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: number }[] => {\n let weekdays: { label: string; value: number }[] = []\n\n const date = getStartOfWeek(new Date(), startDayOfWeek)\n\n for (let i = 0; i < 7; i += 1) {\n const label = format(date)\n const value = date.getDay()\n\n weekdays = [...weekdays, { label, value }]\n\n date.setDate(date.getDate() + 1)\n }\n\n return weekdays\n}\n\nexport const getMonthDays = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: Date }[][] => {\n const currentMonth = date.getMonth()\n const startOfMonth = new Date(date.getFullYear(), currentMonth, 1)\n const endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n const startDate = getStartOfWeek(startOfMonth, startDayOfWeek)\n const endDate = getEndOfWeek(endOfMonth, startDayOfWeek)\n\n const weeks: { label: string; value: Date }[][] = []\n\n while (startDate <= endDate) {\n const days: { label: string; value: Date }[] = []\n\n for (let i = 0; i < 7; i += 1) {\n const value = new Date(startDate)\n const label = format(value)\n\n days.push({ label, value })\n\n startDate.setDate(startDate.getDate() + 1)\n }\n\n weeks.push(days)\n }\n\n return weeks\n}\n\nexport const isSameYear = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"year\")\n\nexport const isSameMonth = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"month\")\n\nexport const isSameDate = (\n date: Date | undefined,\n comparison: Date | undefined,\n) =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"date\")\n\nexport const isAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"date\")\n\nexport const isBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"date\")\n\nexport const isSameAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isAfter(date, \"date\"))\n\nexport const isSameBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isBefore(date, \"date\"))\n\nexport const isAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"month\")\n\nexport const isBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"month\")\n\nexport const isSameAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isAfter(date, \"month\"))\n\nexport const isSameBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isBefore(date, \"month\"))\n\nexport const isAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"year\")\n\nexport const isBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"year\")\n\nexport const isSameAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isAfter(date, \"year\"))\n\nexport const isSameBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isBefore(date, \"year\"))\n\nexport const isIncludeDates = (comparison: Date, dates: Date[]) =>\n dates.some((date) => dayjs(date).isSame(comparison, \"date\"))\n\nexport const isInRange = (date: Date, minDate?: Date, maxDate?: Date) => {\n const hasMinDate = minDate instanceof Date\n const hasMaxDate = maxDate instanceof Date\n\n if (!hasMaxDate && !hasMinDate) return false\n\n const minInRange = hasMinDate ? isAfterDate(date, minDate) : false\n const maxInRange = hasMaxDate ? isBeforeDate(date, maxDate) : false\n\n return maxInRange && minInRange\n}\n\nexport const sortDates = (dates: Date[], type: \"asc\" | \"desc\" = \"asc\") => {\n if (type === \"asc\") {\n return dates.sort((a, b) => (dayjs(a).isAfter(b, \"date\") ? 1 : -1))\n } else {\n return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\n }\n}\n\nexport const updateMaybeDateValue =\n (value: Date, max?: number) =>\n (prev: MaybeDate): MaybeDate => {\n if (isArray(prev)) {\n if (isIncludeDates(value, prev)) {\n return prev.filter((prevValue) => !isSameDate(prevValue, value))\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, value]\n } else {\n return prev\n }\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) {\n return { end: undefined, start: value }\n } else {\n if (isSameDate(start, value)) {\n return { end: undefined, start: undefined }\n } else if (isBeforeDate(value, start)) {\n return { end: start, start: value }\n } else {\n return { end: value, start }\n }\n }\n } else {\n if (isSameDate(prev, value)) {\n return undefined\n } else {\n return value\n }\n }\n }\n\nexport const getAdjustedMonth = (value: MaybeDate, month: Date) => {\n if (isDate(value)) {\n if (!isSameMonth(value, month)) month = dayjs(value).set(\"date\", 1).toDate()\n } else if (isArray(value)) {\n const lastValue = value.at(-1)\n\n if (lastValue && !isSameMonth(lastValue, month))\n month = dayjs(lastValue).set(\"date\", 1).toDate()\n } else if (isObject(value)) {\n if (value.end) {\n month = dayjs(value.end).set(\"date\", 1).toDate()\n } else if (value.start) {\n month = dayjs(value.start).set(\"date\", 1).toDate()\n }\n }\n\n return month\n}\n\nconst {\n DescendantsContext: CalendarDescendantsContext,\n useDescendant: useCalendarDescendant,\n useDescendants: useCalendarDescendants,\n} = createDescendants<HTMLTableCellElement>()\n\nexport {\n CalendarDescendantsContext,\n useCalendarDescendant,\n useCalendarDescendants,\n}\n\ninterface CalendarContext extends Omit<\n UseCalendarReturn,\n | \"descendants\"\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getRootProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n> {}\n\nconst [CalendarContext, useCalendarContext] = createContext<CalendarContext>({\n name: \"CalendarContext\",\n})\n\nexport { CalendarContext, useCalendarContext }\n\nexport interface UseCalendarProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> extends Omit<HTMLProps, \"defaultValue\" | \"onChange\"> {\n /**\n * The initial month of the calendar.\n *\n * @default new Date()\n */\n defaultMonth?: Date\n /**\n * The initial value of the calendar.\n */\n defaultValue?: MaybeDateValue<Multiple, Range>\n /**\n * If `true`, disables the calendar.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The format used for conversion.\n * Check the docs to see the format of possible modifiers you can pass.\n *\n * @see https://day.js.org/docs/en/display/format#list-of-localized-formats\n */\n format?: CalendarFormat\n /**\n * Define holidays.\n */\n holidays?: Date[]\n /**\n * The locale of the calendar.\n *\n * @default 'en-US'\n */\n locale?: AnyString | Locale\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * The maximum possible date.\n *\n * @default new Date(2099, 11, 31)\n */\n maxDate?: Date\n /**\n * The minimum possible date.\n *\n * @default new Date(1900, 0, 1)\n */\n minDate?: Date\n /**\n * The month of the calendar.\n */\n month?: Date\n /**\n * If `true`, the calendar will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * If `true`, enables date range selection.\n *\n * @default false\n */\n range?: Range\n /**\n * Define the start day of the week.\n *\n * @default 'monday'\n */\n startDayOfWeek?: StartDayOfWeek\n /**\n * If `true`, highlight today.\n *\n * @default true\n */\n today?: boolean\n /**\n * The value of the calendar.\n */\n value?: MaybeDateValue<Multiple, Range>\n /**\n * Define weekend days.\n *\n * @default [0, 6]\n */\n weekendDays?: number[]\n /**\n * Callback function to determine whether the day should be disabled.\n */\n excludeDate?: (date: Date) => boolean\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: MaybeDateValue<Multiple, Range>) => void\n /**\n * The callback invoked when month state changes.\n */\n onChangeMonth?: (value: Date) => void\n}\n\nexport const useCalendar = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n defaultMonth = new Date(),\n multiple = false as Multiple,\n range = false as Range,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled = false,\n excludeDate,\n format: format = {},\n holidays = DEFAULT_HOLIDAYS,\n locale: localeProp,\n max,\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n month: monthProp,\n startDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,\n today = true,\n value: valueProp,\n weekendDays = DEFAULT_WEEKEND_DAYS,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n ...rest\n}: UseCalendarProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { locale: defaultLocale, t } = useI18n(\"calendar\")\n const locale = localeProp ?? defaultLocale\n const dateTimeFormat = useDateTimeFormat({ locale })\n const yearFormat = useCallback(\n (value: Date) => {\n if (format.year === null) {\n return value.getFullYear().toString()\n } else {\n const year = format.year ?? \"numeric\"\n\n return dateTimeFormat(value, { year })\n }\n },\n [dateTimeFormat, format.year],\n )\n const monthFormat = useCallback(\n (value: Date) => {\n if (format.month === null) {\n return (value.getMonth() + 1).toString()\n } else {\n const month = format.month ?? \"short\"\n\n return dateTimeFormat(value, { month })\n }\n },\n [dateTimeFormat, format.month],\n )\n const weekdayFormat = useCallback(\n (value: Date) => {\n return dateTimeFormat(value, {\n weekday: format.weekday ?? \"short\",\n })\n },\n [dateTimeFormat, format.weekday],\n )\n const dayFormat = useCallback(\n (value: Date) => {\n if (format.day) {\n return dateTimeFormat(value, {\n day: format.day,\n })\n } else {\n return value.getDate().toString()\n }\n },\n [dateTimeFormat, format.day],\n )\n const descendants = useCalendarDescendants()\n const monthRef = useRef<HTMLTableElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n defaultMonth = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) {\n defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n } else if (defaultValue) {\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\n }\n\n return defaultMonth\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const { endOfMonth, startOfMonth } = useMemo(() => {\n const startOfMonth = dayjs(month).startOf(\"month\").toDate()\n const endOfMonth = dayjs(month).endOf(\"month\").toDate()\n\n return { endOfMonth, startOfMonth }\n }, [month])\n const weekdays = useMemo(\n () => getWeekdays(startDayOfWeek, weekdayFormat),\n [startDayOfWeek, weekdayFormat],\n )\n const monthDays = useMemo(\n () => getMonthDays(month, startDayOfWeek, dayFormat),\n [month, startDayOfWeek, dayFormat],\n )\n const yearItems = useMemo(() => {\n const minYear = dayjs(minDate).year()\n const maxYear = dayjs(maxDate).year()\n const yearItems: { label: string; value: string }[] = []\n\n for (let year = minYear; year <= maxYear; year++) {\n const label = yearFormat(dayjs().set(\"year\", year).toDate())\n const value = year.toString()\n\n yearItems.push({ label, value })\n }\n\n return yearItems\n }, [maxDate, minDate, yearFormat])\n const monthItems = useMemo(() => {\n const monthItems: { label: string; value: string }[] = []\n const date = dayjs(month).toDate()\n\n for (let month = 0; month < 12; month++) {\n date.setMonth(month)\n\n if (isAfterMonth(date, maxDate)) continue\n if (isBeforeMonth(date, minDate)) continue\n\n const label = monthFormat(dayjs().set(\"month\", month).toDate())\n const value = month.toString()\n\n monthItems.push({ label, value })\n }\n\n return monthItems\n }, [month, maxDate, minDate, monthFormat])\n\n const onChange = useCallback(\n (value: Date) => {\n if (isBeforeDate(value, minDate)) return\n if (isAfterDate(value, maxDate)) return\n\n setValue(\n (prev) =>\n updateMaybeDateValue(value, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n },\n [max, maxDate, minDate, setValue],\n )\n\n const onMonthChange = useCallback(\n (month: Date) => {\n if (isAfterMonth(month, maxDate)) {\n setMonth(dayjs(maxDate).set(\"date\", 1).toDate())\n } else if (isBeforeMonth(month, minDate)) {\n setMonth(dayjs(minDate).set(\"date\", 1).toDate())\n } else {\n setMonth((prev) => {\n if (isSameMonth(prev, month)) return prev\n\n return month\n })\n }\n },\n [maxDate, minDate, setMonth],\n )\n\n const onPrevMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, minDate)) return prev\n\n return dayjs(prev).subtract(1, \"month\").toDate()\n })\n }, [minDate, setMonth])\n\n const onNextMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, maxDate)) return prev\n\n return dayjs(prev).add(1, \"month\").toDate()\n })\n }, [maxDate, setMonth])\n\n const onFocus = useCallback(() => {\n let index: null | number = null\n let descendant: Descendant<HTMLTableCellElement> | undefined\n\n if (value) {\n if (isDate(value)) {\n if (isSameMonth(month, new Date())) index = new Date().getDate() - 1\n } else if (isArray(value)) {\n const firstValue = value[0]\n\n if (firstValue && isSameMonth(month, firstValue))\n index = firstValue.getDate() - 1\n } else if (isObject(value)) {\n if (value.start && isSameMonth(month, value.start)) {\n index = value.start.getDate() - 1\n } else if (value.end && isSameMonth(month, value.end)) {\n index = value.end.getDate() - 1\n }\n }\n } else if (isSameMonth(month, new Date())) {\n index = new Date().getDate() - 1\n }\n\n descendant = descendants.value(index)\n\n if (!descendant) descendant = descendants.enabledFirstValue()\n\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n\n if (monthRef.current) monthRef.current.tabIndex = -1\n }, [descendants, month, value])\n\n const onBlur = useCallback((ev: FocusEvent<HTMLTableElement>) => {\n if (contains(monthRef.current, ev.relatedTarget)) return\n\n if (monthRef.current) monthRef.current.tabIndex = 0\n }, [])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value])\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => ({\n \"data-disabled\": dataAttr(disabled),\n ...rest,\n ...props,\n }),\n [disabled, rest],\n )\n\n const getNavigationProps: PropGetter<\"nav\"> = useCallback(\n (props = {}) => ({ \"data-disabled\": dataAttr(disabled), ...props }),\n [disabled],\n )\n\n const getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the year\"),\n disabled,\n value: dayjs(month).get(\"year\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"year\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the month\"),\n disabled,\n value: dayjs(month).get(\"month\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"month\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getStatusProps: PropGetter = useCallback(\n (props = {}) => ({\n style: visuallyHiddenAttributes.style,\n \"aria-live\": \"polite\",\n children: dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n role: \"status\",\n ...props,\n }),\n [dateTimeFormat, month],\n )\n\n const getMonthProps: PropGetter<\"table\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, monthRef),\n \"aria-label\": dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n \"aria-multiselectable\": ariaAttr(multiple || range),\n \"data-disabled\": dataAttr(disabled),\n role: \"grid\",\n tabIndex: disabled ? -1 : 0,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dateTimeFormat, disabled, month, multiple, onBlur, onFocus, range],\n )\n\n const getWeekdayProps: RequiredPropGetter<\"th\", { value: number }> =\n useCallback(\n ({ value, ...props }) => ({\n \"data-disabled\": dataAttr(disabled),\n \"data-value\": value.toString(),\n abbr: dateTimeFormat(dayjs().set(\"day\", value).toDate(), {\n weekday: \"long\",\n }),\n ...props,\n }),\n [dateTimeFormat, disabled],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n (props) => ({\n type: \"button\",\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [disabled],\n )\n\n const getPrevButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the previous month\"),\n disabled: isSameBeforeMonth(month, minDate),\n ...props,\n onClick: handlerAll(props.onClick, onPrevMonth),\n }),\n [getButtonProps, minDate, month, onPrevMonth, t],\n )\n\n const getNextButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the next month\"),\n disabled: isSameAfterMonth(month, maxDate),\n ...props,\n onClick: handlerAll(props.onClick, onNextMonth),\n }),\n [getButtonProps, maxDate, month, onNextMonth, t],\n )\n\n return {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }\n}\n\nexport type UseCalendarReturn = ReturnType<typeof useCalendar>\n\nexport interface UseCalendarDayProps extends Omit<HTMLProps<\"td\">, \"value\"> {\n value: Date\n}\n\nexport const useCalendarDay = ({ value, ...rest }: UseCalendarDayProps) => {\n const { t } = useI18n(\"calendar\")\n const {\n disabled: rootDisabled,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n startDayOfWeek,\n today: highlightToday,\n value: selectedValue,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendarContext()\n const dateTimeFormat = useDateTimeFormat({ locale })\n const cellRef = useRef<HTMLTableCellElement>(null)\n const outside = useMemo(() => !isSameMonth(month, value), [month, value])\n const holiday = useMemo(\n () => holidays.some((holiday) => isSameDate(holiday, value)),\n [holidays, value],\n )\n const weekend = useMemo(\n () => weekendDays.includes(value.getDay()),\n [weekendDays, value],\n )\n const today = useMemo(\n () => highlightToday && isSameDate(value, new Date()),\n [highlightToday, value],\n )\n const selected = useMemo(() => {\n if (isDate(selectedValue)) {\n return isSameDate(selectedValue, value)\n } else if (isArray(selectedValue)) {\n return selectedValue.some((selectedValue) =>\n isSameDate(selectedValue, value),\n )\n } else if (isObject(selectedValue)) {\n return (\n isSameDate(selectedValue.start, value) ||\n isSameDate(selectedValue.end, value)\n )\n }\n }, [selectedValue, value])\n const disabled = useMemo(() => {\n if (rootDisabled) return true\n if (isAfterDate(value, maxDate)) return true\n if (isBeforeDate(value, minDate)) return true\n if (excludeDate?.(value)) return true\n if (\n isArray(selectedValue) &&\n isNumber(max) &&\n selectedValue.length >= max &&\n !isIncludeDates(value, selectedValue)\n )\n return true\n\n return false\n }, [excludeDate, max, maxDate, minDate, rootDisabled, selectedValue, value])\n const between = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n return isInRange(value, selectedValue?.start, selectedValue?.end)\n }, [selectedValue, value])\n const startValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, start)\n }, [selectedValue, value])\n const endValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, end)\n }, [selectedValue, value])\n const { descendants, register } = useCalendarDescendant({\n disabled: disabled,\n })\n\n const onFocusDescendant = useCallback(\n (descendant?: Descendant<HTMLTableCellElement>) => {\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n },\n [],\n )\n\n const onBlur = useCallback(() => {\n if (cellRef.current) cellRef.current.tabIndex = -1\n }, [])\n\n const onClick = useCallback(() => {\n if (disabled) return\n\n onChange(value)\n }, [disabled, onChange, value])\n\n const onPrevDate = useCallback(() => {\n const descendant = descendants.enabledPrevValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameBeforeDate(value, minDate)) {\n onPrevMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledLastValue()))\n }\n }, [descendants, minDate, onFocusDescendant, onPrevMonth, value])\n\n const onNextDate = useCallback(() => {\n const descendant = descendants.enabledNextValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameAfterDate(value, maxDate)) {\n onNextMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledFirstValue()))\n }\n }, [descendants, maxDate, onFocusDescendant, onNextMonth, value])\n\n const onPrevTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isBeforeDate(date, minDate)\n ? descendants.enabledFirstValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled) {\n onFocusDescendant(descendants.enabledNextValue(descendant, false))\n } else {\n onFocusDescendant(descendant)\n }\n })\n },\n [descendants, minDate, onFocusDescendant, onMonthChange],\n )\n\n const onNextTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isAfterDate(date, maxDate)\n ? descendants.enabledLastValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled) {\n onFocusDescendant(descendants.enabledPrevValue(descendant, false))\n } else {\n onFocusDescendant(descendant)\n }\n })\n },\n [descendants, maxDate, onFocusDescendant, onMonthChange],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLTableCellElement>) => {\n runKeyAction(ev, {\n ArrowDown: () =>\n onNextTraverseDate(dayjs(value).add(1, \"week\").toDate()),\n ArrowLeft: onPrevDate,\n ArrowRight: onNextDate,\n ArrowUp: () =>\n onPrevTraverseDate(dayjs(value).subtract(1, \"week\").toDate()),\n End: () => onNextTraverseDate(getEndOfWeek(value, startDayOfWeek)),\n Enter: onClick,\n Home: () => onPrevTraverseDate(getStartOfWeek(value, startDayOfWeek)),\n PageDown: (ev) => {\n if (ev.shiftKey) {\n onNextTraverseDate(dayjs(value).add(1, \"year\").toDate())\n } else {\n onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n }\n },\n PageUp: (ev) => {\n if (ev.shiftKey) {\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n } else {\n onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\n }\n },\n Space: onClick,\n })\n },\n [\n onClick,\n onNextDate,\n onNextTraverseDate,\n onPrevDate,\n onPrevTraverseDate,\n startDayOfWeek,\n value,\n ],\n )\n\n const getDayProps: PropGetter<\"td\"> = useCallback(\n ({ ref, \"aria-label\": ariaLabel, ...props } = {}) => {\n if (!ariaLabel) {\n ariaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) ariaLabel = `${t(\"Today\")}, ${ariaLabel}`\n }\n\n return {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": ariaLabel,\n \"aria-selected\": ariaAttr(selected),\n \"data-between\": dataAttr(between),\n \"data-disabled\": dataAttr(disabled),\n \"data-end\": dataAttr(endValue),\n \"data-holiday\": dataAttr(holiday),\n \"data-outside\": dataAttr(outside),\n \"data-selected\": dataAttr(selected),\n \"data-start\": dataAttr(startValue),\n \"data-today\": dataAttr(today),\n \"data-value\": dayjs(value).format(\"YYYY-MM-DD\"),\n \"data-weekend\": dataAttr(weekend),\n tabIndex: -1,\n ...rest,\n ...props,\n ref: mergeRefs(ref, cellRef, outside ? null : register),\n onBlur: handlerAll(props.onBlur, onBlur),\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, (ev) => ev.preventDefault()),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n between,\n dateTimeFormat,\n disabled,\n endValue,\n holiday,\n onBlur,\n onClick,\n onKeyDown,\n outside,\n register,\n rest,\n selected,\n startValue,\n t,\n today,\n value,\n weekend,\n ],\n )\n\n return { outside, getDayProps }\n}\n\nexport type UseCalendarDayReturn = ReturnType<typeof useCalendarDay>\n\nconst calendarProps: (keyof UseCalendarProps)[] = [\n \"defaultMonth\",\n \"defaultValue\",\n \"disabled\",\n \"excludeDate\",\n \"format\",\n \"holidays\",\n \"locale\",\n \"max\",\n \"maxDate\",\n \"minDate\",\n \"month\",\n \"range\",\n \"startDayOfWeek\",\n \"today\",\n \"value\",\n \"weekendDays\",\n \"onChange\",\n \"onChangeMonth\",\n]\n\nexport const useCalendarProps = <\n Y extends boolean = false,\n M extends boolean = false,\n D extends Dict = Dict,\n H extends keyof UseCalendarProps<Y, M> = keyof UseCalendarProps<Y, M>,\n>(\n props: D,\n omitKeys?: H[],\n) => {\n return useSplitProps(\n props,\n calendarProps.filter((key) => !omitKeys?.includes(key as H)),\n ) as unknown as [\n keyof UseCalendarProps<Y, M> extends H\n ? UseCalendarProps<Y, M>\n : Omit<UseCalendarProps<Y, M>, H>,\n Omit<\n M,\n keyof UseCalendarProps<Y, M> extends H\n ? keyof UseCalendarProps<Y, M>\n : Exclude<keyof UseCalendarProps<Y, M>, H>\n >,\n ]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAaA,mBAA2B,EAAE;AAC1C,MAAaC,uBAAiC,CAAC,GAAG,EAAE;AACpD,MAAaC,4BAA4C;AACzD,MAAaC,mCAAyB,IAAI,KAAK,aAAa;AAC5D,MAAaC,mCAAyB,IAAI,KAAK,aAAa;AAmB5D,MAAa,kBACX,MACA,sCAEM,KAAK,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,MAAM,CACpD,QAAQ,OAAO,CACf,IAAI,mBAAmB,WAAW,IAAI,GAAG,MAAM,CAC/C,QAAQ;AAEb,MAAa,gBACX,MACA,sCAEM,KAAK,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,MAAM,CACpD,MAAM,OAAO,CACb,IAAI,mBAAmB,WAAW,IAAI,GAAG,MAAM,CAC/C,QAAQ;AAEb,MAAa,eACX,gBACA,WACuC;CACvC,IAAIC,WAA+C,EAAE;CAErD,MAAM,OAAO,+BAAe,IAAI,MAAM,EAAE,eAAe;AAEvD,MAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG;EAC7B,MAAM,QAAQ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ACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,oBAMX,OACA,aACG;AACH,QAAOC,4BACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,IAAS,CAAC,CAC7D"}
1
+ {"version":3,"file":"use-calendar.cjs","names":["DEFAULT_HOLIDAYS: Date[]","DEFAULT_WEEKEND_DAYS: number[]","DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek","DEFAULT_MAX_DATE: Date","DEFAULT_MIN_DATE: Date","weekdays: { label: string; value: number }[]","weeks: { label: string; value: Date }[][]","days: { label: string; value: Date }[]","createDescendants","createContext","useI18n","useDateTimeFormat","value","useControllableState","startOfMonth","yearItems: { label: string; value: string }[]","yearItems","monthItems: { label: string; value: string }[]","month","monthItems","index: null | number","descendant: Descendant<HTMLTableCellElement> | undefined","getRootProps: PropGetter","getNavigationProps: PropGetter<\"nav\">","getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n >","getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n >","getStatusProps: PropGetter","visuallyHiddenAttributes","getMonthProps: PropGetter<\"table\">","mergeRefs","getWeekdayProps: RequiredPropGetter<\"th\", { value: number }>","getButtonProps: PropGetter<\"button\">","getPrevButtonProps: PropGetter<\"button\">","getNextButtonProps: PropGetter<\"button\">","holiday","selectedValue","ev","calendarProps: (keyof UseCalendarProps)[]","useSplitProps"],"sources":["../../../../src/components/calendar/use-calendar.ts"],"sourcesContent":["\"use client\"\n\nimport type { FocusEvent, KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter, RequiredPropGetter } from \"../../core\"\nimport type { Descendant } from \"../../hooks/use-descendants\"\nimport type { Locale } from \"../../providers/i18n-provider\"\nimport type { AnyString, Dict } from \"../../utils\"\nimport dayjs from \"dayjs\"\nimport { useCallback, useMemo, useRef } from \"react\"\nimport { useSplitProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n contains,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport const DEFAULT_HOLIDAYS: Date[] = []\nexport const DEFAULT_WEEKEND_DAYS: number[] = [0, 6]\nexport const DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek = \"sunday\"\nexport const DEFAULT_MAX_DATE: Date = new Date(\"2099-12-31\")\nexport const DEFAULT_MIN_DATE: Date = new Date(\"1900-01-01\")\n\nexport type MaybeDate = Date | Date[] | undefined | { end?: Date; start?: Date }\nexport type MaybeDateValue<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> = Range extends true\n ? { end?: Date; start?: Date }\n : Multiple extends true\n ? Date[]\n : Date | undefined\nexport type StartDayOfWeek = \"monday\" | \"sunday\"\nexport interface CalendarFormat {\n day?: Intl.DateTimeFormatOptions[\"day\"] | null\n month?: Intl.DateTimeFormatOptions[\"month\"] | null\n weekday?: Intl.DateTimeFormatOptions[\"weekday\"] | null\n year?: Intl.DateTimeFormatOptions[\"year\"] | null\n}\n\nexport const getStartOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .startOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getEndOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .endOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getWeekdays = (\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: number }[] => {\n let weekdays: { label: string; value: number }[] = []\n\n const date = getStartOfWeek(new Date(), startDayOfWeek)\n\n for (let i = 0; i < 7; i += 1) {\n const label = format(date)\n const value = date.getDay()\n\n weekdays = [...weekdays, { label, value }]\n\n date.setDate(date.getDate() + 1)\n }\n\n return weekdays\n}\n\nexport const getMonthDays = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: Date }[][] => {\n const currentMonth = date.getMonth()\n const startOfMonth = new Date(date.getFullYear(), currentMonth, 1)\n const endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n const startDate = getStartOfWeek(startOfMonth, startDayOfWeek)\n const endDate = getEndOfWeek(endOfMonth, startDayOfWeek)\n\n const weeks: { label: string; value: Date }[][] = []\n\n while (startDate <= endDate) {\n const days: { label: string; value: Date }[] = []\n\n for (let i = 0; i < 7; i += 1) {\n const value = new Date(startDate)\n const label = format(value)\n\n days.push({ label, value })\n\n startDate.setDate(startDate.getDate() + 1)\n }\n\n weeks.push(days)\n }\n\n return weeks\n}\n\nexport const isSameYear = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"year\")\n\nexport const isSameMonth = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"month\")\n\nexport const isSameDate = (\n date: Date | undefined,\n comparison: Date | undefined,\n) =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"date\")\n\nexport const isAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"date\")\n\nexport const isBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"date\")\n\nexport const isSameAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isAfter(date, \"date\"))\n\nexport const isSameBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isBefore(date, \"date\"))\n\nexport const isAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"month\")\n\nexport const isBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"month\")\n\nexport const isSameAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isAfter(date, \"month\"))\n\nexport const isSameBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isBefore(date, \"month\"))\n\nexport const isAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"year\")\n\nexport const isBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"year\")\n\nexport const isSameAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isAfter(date, \"year\"))\n\nexport const isSameBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isBefore(date, \"year\"))\n\nexport const isIncludeDates = (comparison: Date, dates: Date[]) =>\n dates.some((date) => dayjs(date).isSame(comparison, \"date\"))\n\nexport const isInRange = (date: Date, minDate?: Date, maxDate?: Date) => {\n const hasMinDate = minDate instanceof Date\n const hasMaxDate = maxDate instanceof Date\n\n if (!hasMaxDate && !hasMinDate) return false\n\n const minInRange = hasMinDate ? isAfterDate(date, minDate) : false\n const maxInRange = hasMaxDate ? isBeforeDate(date, maxDate) : false\n\n return maxInRange && minInRange\n}\n\nexport const sortDates = (dates: Date[], type: \"asc\" | \"desc\" = \"asc\") => {\n if (type === \"asc\") {\n return dates.sort((a, b) => (dayjs(a).isAfter(b, \"date\") ? 1 : -1))\n } else {\n return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\n }\n}\n\nexport const updateMaybeDateValue =\n (value: Date, max?: number) =>\n (prev: MaybeDate): MaybeDate => {\n if (isArray(prev)) {\n if (isIncludeDates(value, prev)) {\n return prev.filter((prevValue) => !isSameDate(prevValue, value))\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, value]\n } else {\n return prev\n }\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) {\n return { end: undefined, start: value }\n } else {\n if (isSameDate(start, value)) {\n return { end: undefined, start: undefined }\n } else if (isBeforeDate(value, start)) {\n return { end: start, start: value }\n } else {\n return { end: value, start }\n }\n }\n } else {\n if (isSameDate(prev, value)) {\n return undefined\n } else {\n return value\n }\n }\n }\n\nexport const getAdjustedMonth = (value: MaybeDate, month: Date) => {\n if (isDate(value)) {\n if (!isSameMonth(value, month)) month = dayjs(value).set(\"date\", 1).toDate()\n } else if (isArray(value)) {\n const lastValue = value.at(-1)\n\n if (lastValue && !isSameMonth(lastValue, month))\n month = dayjs(lastValue).set(\"date\", 1).toDate()\n } else if (isObject(value)) {\n if (value.end) {\n month = dayjs(value.end).set(\"date\", 1).toDate()\n } else if (value.start) {\n month = dayjs(value.start).set(\"date\", 1).toDate()\n }\n }\n\n return month\n}\n\nconst {\n DescendantsContext: CalendarDescendantsContext,\n useDescendant: useCalendarDescendant,\n useDescendants: useCalendarDescendants,\n} = createDescendants<HTMLTableCellElement>()\n\nexport {\n CalendarDescendantsContext,\n useCalendarDescendant,\n useCalendarDescendants,\n}\n\ninterface CalendarContext extends Omit<\n UseCalendarReturn,\n | \"descendants\"\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getRootProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n> {}\n\nconst [CalendarContext, useCalendarContext] = createContext<CalendarContext>({\n name: \"CalendarContext\",\n})\n\nexport { CalendarContext, useCalendarContext }\n\nexport interface UseCalendarProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> extends Omit<HTMLProps, \"defaultValue\" | \"onChange\"> {\n /**\n * The initial month of the calendar.\n *\n * @default new Date()\n */\n defaultMonth?: Date\n /**\n * The initial value of the calendar.\n */\n defaultValue?: MaybeDateValue<Multiple, Range>\n /**\n * If `true`, disables the calendar.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The format used for conversion.\n * Check the docs to see the format of possible modifiers you can pass.\n *\n * @see https://day.js.org/docs/en/display/format#list-of-localized-formats\n */\n format?: CalendarFormat\n /**\n * Define holidays.\n */\n holidays?: Date[]\n /**\n * The locale of the calendar.\n *\n * @default 'en-US'\n */\n locale?: AnyString | Locale\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * The maximum possible date.\n *\n * @default new Date(2099, 11, 31)\n */\n maxDate?: Date\n /**\n * The minimum possible date.\n *\n * @default new Date(1900, 0, 1)\n */\n minDate?: Date\n /**\n * The month of the calendar.\n */\n month?: Date\n /**\n * If `true`, the calendar will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * If `true`, enables date range selection.\n *\n * @default false\n */\n range?: Range\n /**\n * Define the start day of the week.\n *\n * @default 'monday'\n */\n startDayOfWeek?: StartDayOfWeek\n /**\n * If `true`, highlight today.\n *\n * @default true\n */\n today?: boolean\n /**\n * The value of the calendar.\n */\n value?: MaybeDateValue<Multiple, Range>\n /**\n * Define weekend days.\n *\n * @default [0, 6]\n */\n weekendDays?: number[]\n /**\n * Callback function to determine whether the day should be disabled.\n */\n excludeDate?: (date: Date) => boolean\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: MaybeDateValue<Multiple, Range>) => void\n /**\n * The callback invoked when month state changes.\n */\n onChangeMonth?: (value: Date) => void\n}\n\nexport const useCalendar = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n defaultMonth = new Date(),\n multiple = false as Multiple,\n range = false as Range,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled = false,\n excludeDate,\n format = {},\n holidays = DEFAULT_HOLIDAYS,\n locale: localeProp,\n max,\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n month: monthProp,\n startDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,\n today = true,\n value: valueProp,\n weekendDays = DEFAULT_WEEKEND_DAYS,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n ...rest\n}: UseCalendarProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { locale: defaultLocale, t } = useI18n(\"calendar\")\n const locale = localeProp ?? defaultLocale\n const dateTimeFormat = useDateTimeFormat({ locale })\n const yearFormat = useCallback(\n (value: Date) => {\n if (format.year === null) {\n return value.getFullYear().toString()\n } else {\n const year = format.year ?? \"numeric\"\n\n return dateTimeFormat(value, { year })\n }\n },\n [dateTimeFormat, format.year],\n )\n const monthFormat = useCallback(\n (value: Date) => {\n if (format.month === null) {\n return (value.getMonth() + 1).toString()\n } else {\n const month = format.month ?? \"short\"\n\n return dateTimeFormat(value, { month })\n }\n },\n [dateTimeFormat, format.month],\n )\n const weekdayFormat = useCallback(\n (value: Date) => {\n return dateTimeFormat(value, {\n weekday: format.weekday ?? \"short\",\n })\n },\n [dateTimeFormat, format.weekday],\n )\n const dayFormat = useCallback(\n (value: Date) => {\n if (format.day) {\n return dateTimeFormat(value, {\n day: format.day,\n })\n } else {\n return value.getDate().toString()\n }\n },\n [dateTimeFormat, format.day],\n )\n const descendants = useCalendarDescendants()\n const monthRef = useRef<HTMLTableElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n defaultMonth = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) {\n defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n } else if (defaultValue) {\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\n }\n\n return defaultMonth\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const { endOfMonth, startOfMonth } = useMemo(() => {\n const startOfMonth = dayjs(month).startOf(\"month\").toDate()\n const endOfMonth = dayjs(month).endOf(\"month\").toDate()\n\n return { endOfMonth, startOfMonth }\n }, [month])\n const weekdays = useMemo(\n () => getWeekdays(startDayOfWeek, weekdayFormat),\n [startDayOfWeek, weekdayFormat],\n )\n const monthDays = useMemo(\n () => getMonthDays(month, startDayOfWeek, dayFormat),\n [month, startDayOfWeek, dayFormat],\n )\n const yearItems = useMemo(() => {\n const minYear = dayjs(minDate).year()\n const maxYear = dayjs(maxDate).year()\n const yearItems: { label: string; value: string }[] = []\n\n for (let year = minYear; year <= maxYear; year++) {\n const label = yearFormat(dayjs().set(\"year\", year).toDate())\n const value = year.toString()\n\n yearItems.push({ label, value })\n }\n\n return yearItems\n }, [maxDate, minDate, yearFormat])\n const monthItems = useMemo(() => {\n const monthItems: { label: string; value: string }[] = []\n const date = dayjs(month).toDate()\n\n for (let month = 0; month < 12; month++) {\n date.setMonth(month)\n\n if (isAfterMonth(date, maxDate)) continue\n if (isBeforeMonth(date, minDate)) continue\n\n const label = monthFormat(dayjs().set(\"month\", month).toDate())\n const value = month.toString()\n\n monthItems.push({ label, value })\n }\n\n return monthItems\n }, [month, maxDate, minDate, monthFormat])\n\n const onChange = useCallback(\n (value: Date) => {\n if (isBeforeDate(value, minDate)) return\n if (isAfterDate(value, maxDate)) return\n\n setValue(\n (prev) =>\n updateMaybeDateValue(value, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n },\n [max, maxDate, minDate, setValue],\n )\n\n const onMonthChange = useCallback(\n (month: Date) => {\n if (isAfterMonth(month, maxDate)) {\n setMonth(dayjs(maxDate).set(\"date\", 1).toDate())\n } else if (isBeforeMonth(month, minDate)) {\n setMonth(dayjs(minDate).set(\"date\", 1).toDate())\n } else {\n setMonth((prev) => {\n if (isSameMonth(prev, month)) return prev\n\n return month\n })\n }\n },\n [maxDate, minDate, setMonth],\n )\n\n const onPrevMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, minDate)) return prev\n\n return dayjs(prev).subtract(1, \"month\").toDate()\n })\n }, [minDate, setMonth])\n\n const onNextMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, maxDate)) return prev\n\n return dayjs(prev).add(1, \"month\").toDate()\n })\n }, [maxDate, setMonth])\n\n const onFocus = useCallback(() => {\n let index: null | number = null\n let descendant: Descendant<HTMLTableCellElement> | undefined\n\n if (value) {\n if (isDate(value)) {\n if (isSameMonth(month, new Date())) index = new Date().getDate() - 1\n } else if (isArray(value)) {\n const firstValue = value[0]\n\n if (firstValue && isSameMonth(month, firstValue))\n index = firstValue.getDate() - 1\n } else if (isObject(value)) {\n if (value.start && isSameMonth(month, value.start)) {\n index = value.start.getDate() - 1\n } else if (value.end && isSameMonth(month, value.end)) {\n index = value.end.getDate() - 1\n }\n }\n } else if (isSameMonth(month, new Date())) {\n index = new Date().getDate() - 1\n }\n\n descendant = descendants.value(index)\n\n if (!descendant) descendant = descendants.enabledFirstValue()\n\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n\n if (monthRef.current) monthRef.current.tabIndex = -1\n }, [descendants, month, value])\n\n const onBlur = useCallback((ev: FocusEvent<HTMLTableElement>) => {\n if (contains(monthRef.current, ev.relatedTarget)) return\n\n if (monthRef.current) monthRef.current.tabIndex = 0\n }, [])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value])\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => ({\n \"data-disabled\": dataAttr(disabled),\n ...rest,\n ...props,\n }),\n [disabled, rest],\n )\n\n const getNavigationProps: PropGetter<\"nav\"> = useCallback(\n (props = {}) => ({ \"data-disabled\": dataAttr(disabled), ...props }),\n [disabled],\n )\n\n const getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the year\"),\n disabled,\n value: dayjs(month).get(\"year\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"year\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the month\"),\n disabled,\n value: dayjs(month).get(\"month\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"month\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getStatusProps: PropGetter = useCallback(\n (props = {}) => ({\n style: visuallyHiddenAttributes.style,\n \"aria-live\": \"polite\",\n children: dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n role: \"status\",\n ...props,\n }),\n [dateTimeFormat, month],\n )\n\n const getMonthProps: PropGetter<\"table\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, monthRef),\n \"aria-label\": dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n \"aria-multiselectable\": ariaAttr(multiple || range),\n \"data-disabled\": dataAttr(disabled),\n role: \"grid\",\n tabIndex: disabled ? -1 : 0,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dateTimeFormat, disabled, month, multiple, onBlur, onFocus, range],\n )\n\n const getWeekdayProps: RequiredPropGetter<\"th\", { value: number }> =\n useCallback(\n ({ value, ...props }) => ({\n \"data-disabled\": dataAttr(disabled),\n \"data-value\": value.toString(),\n abbr: dateTimeFormat(dayjs().set(\"day\", value).toDate(), {\n weekday: \"long\",\n }),\n ...props,\n }),\n [dateTimeFormat, disabled],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n (props) => ({\n type: \"button\",\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [disabled],\n )\n\n const getPrevButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the previous month\"),\n disabled: isSameBeforeMonth(month, minDate),\n ...props,\n onClick: handlerAll(props.onClick, onPrevMonth),\n }),\n [getButtonProps, minDate, month, onPrevMonth, t],\n )\n\n const getNextButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the next month\"),\n disabled: isSameAfterMonth(month, maxDate),\n ...props,\n onClick: handlerAll(props.onClick, onNextMonth),\n }),\n [getButtonProps, maxDate, month, onNextMonth, t],\n )\n\n return {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }\n}\n\nexport type UseCalendarReturn = ReturnType<typeof useCalendar>\n\nexport interface UseCalendarDayProps extends Omit<HTMLProps<\"td\">, \"value\"> {\n value: Date\n}\n\nexport const useCalendarDay = ({ value, ...rest }: UseCalendarDayProps) => {\n const { t } = useI18n(\"calendar\")\n const {\n disabled: rootDisabled,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n startDayOfWeek,\n today: highlightToday,\n value: selectedValue,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendarContext()\n const dateTimeFormat = useDateTimeFormat({ locale })\n const cellRef = useRef<HTMLTableCellElement>(null)\n const outside = useMemo(() => !isSameMonth(month, value), [month, value])\n const holiday = useMemo(\n () => holidays.some((holiday) => isSameDate(holiday, value)),\n [holidays, value],\n )\n const weekend = useMemo(\n () => weekendDays.includes(value.getDay()),\n [weekendDays, value],\n )\n const today = useMemo(\n () => highlightToday && isSameDate(value, new Date()),\n [highlightToday, value],\n )\n const selected = useMemo(() => {\n if (isDate(selectedValue)) {\n return isSameDate(selectedValue, value)\n } else if (isArray(selectedValue)) {\n return selectedValue.some((selectedValue) =>\n isSameDate(selectedValue, value),\n )\n } else if (isObject(selectedValue)) {\n return (\n isSameDate(selectedValue.start, value) ||\n isSameDate(selectedValue.end, value)\n )\n }\n }, [selectedValue, value])\n const disabled = useMemo(() => {\n if (rootDisabled) return true\n if (isAfterDate(value, maxDate)) return true\n if (isBeforeDate(value, minDate)) return true\n if (excludeDate?.(value)) return true\n if (\n isArray(selectedValue) &&\n isNumber(max) &&\n selectedValue.length >= max &&\n !isIncludeDates(value, selectedValue)\n )\n return true\n\n return false\n }, [excludeDate, max, maxDate, minDate, rootDisabled, selectedValue, value])\n const between = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n return isInRange(value, selectedValue?.start, selectedValue?.end)\n }, [selectedValue, value])\n const startValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, start)\n }, [selectedValue, value])\n const endValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, end)\n }, [selectedValue, value])\n const { descendants, register } = useCalendarDescendant({\n disabled: disabled,\n })\n\n const onFocusDescendant = useCallback(\n (descendant?: Descendant<HTMLTableCellElement>) => {\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n },\n [],\n )\n\n const onBlur = useCallback(() => {\n if (cellRef.current) cellRef.current.tabIndex = -1\n }, [])\n\n const onClick = useCallback(() => {\n if (disabled) return\n\n onChange(value)\n }, [disabled, onChange, value])\n\n const onPrevDate = useCallback(() => {\n const descendant = descendants.enabledPrevValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameBeforeDate(value, minDate)) {\n onPrevMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledLastValue()))\n }\n }, [descendants, minDate, onFocusDescendant, onPrevMonth, value])\n\n const onNextDate = useCallback(() => {\n const descendant = descendants.enabledNextValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameAfterDate(value, maxDate)) {\n onNextMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledFirstValue()))\n }\n }, [descendants, maxDate, onFocusDescendant, onNextMonth, value])\n\n const onPrevTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isBeforeDate(date, minDate)\n ? descendants.enabledFirstValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled) {\n onFocusDescendant(descendants.enabledNextValue(descendant, false))\n } else {\n onFocusDescendant(descendant)\n }\n })\n },\n [descendants, minDate, onFocusDescendant, onMonthChange],\n )\n\n const onNextTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isAfterDate(date, maxDate)\n ? descendants.enabledLastValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled) {\n onFocusDescendant(descendants.enabledPrevValue(descendant, false))\n } else {\n onFocusDescendant(descendant)\n }\n })\n },\n [descendants, maxDate, onFocusDescendant, onMonthChange],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLTableCellElement>) => {\n runKeyAction(ev, {\n ArrowDown: () =>\n onNextTraverseDate(dayjs(value).add(1, \"week\").toDate()),\n ArrowLeft: onPrevDate,\n ArrowRight: onNextDate,\n ArrowUp: () =>\n onPrevTraverseDate(dayjs(value).subtract(1, \"week\").toDate()),\n End: () => onNextTraverseDate(getEndOfWeek(value, startDayOfWeek)),\n Enter: onClick,\n Home: () => onPrevTraverseDate(getStartOfWeek(value, startDayOfWeek)),\n PageDown: (ev) => {\n if (ev.shiftKey) {\n onNextTraverseDate(dayjs(value).add(1, \"year\").toDate())\n } else {\n onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n }\n },\n PageUp: (ev) => {\n if (ev.shiftKey) {\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n } else {\n onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\n }\n },\n Space: onClick,\n })\n },\n [\n onClick,\n onNextDate,\n onNextTraverseDate,\n onPrevDate,\n onPrevTraverseDate,\n startDayOfWeek,\n value,\n ],\n )\n\n const getDayProps: PropGetter<\"td\"> = useCallback(\n ({ ref, \"aria-label\": ariaLabel, ...props } = {}) => {\n if (!ariaLabel) {\n ariaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) ariaLabel = `${t(\"Today\")}, ${ariaLabel}`\n }\n\n return {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": ariaLabel,\n \"aria-selected\": ariaAttr(selected),\n \"data-between\": dataAttr(between),\n \"data-disabled\": dataAttr(disabled),\n \"data-end\": dataAttr(endValue),\n \"data-holiday\": dataAttr(holiday),\n \"data-outside\": dataAttr(outside),\n \"data-selected\": dataAttr(selected),\n \"data-start\": dataAttr(startValue),\n \"data-today\": dataAttr(today),\n \"data-value\": dayjs(value).format(\"YYYY-MM-DD\"),\n \"data-weekend\": dataAttr(weekend),\n tabIndex: -1,\n ...rest,\n ...props,\n ref: mergeRefs(ref, cellRef, outside ? null : register),\n onBlur: handlerAll(props.onBlur, onBlur),\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, (ev) => ev.preventDefault()),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n between,\n dateTimeFormat,\n disabled,\n endValue,\n holiday,\n onBlur,\n onClick,\n onKeyDown,\n outside,\n register,\n rest,\n selected,\n startValue,\n t,\n today,\n value,\n weekend,\n ],\n )\n\n return { outside, getDayProps }\n}\n\nexport type UseCalendarDayReturn = ReturnType<typeof useCalendarDay>\n\nconst calendarProps: (keyof UseCalendarProps)[] = [\n \"defaultMonth\",\n \"defaultValue\",\n \"disabled\",\n \"excludeDate\",\n \"format\",\n \"holidays\",\n \"locale\",\n \"max\",\n \"maxDate\",\n \"minDate\",\n \"month\",\n \"range\",\n \"startDayOfWeek\",\n \"today\",\n \"value\",\n \"weekendDays\",\n \"onChange\",\n \"onChangeMonth\",\n]\n\nexport const useCalendarProps = <\n Y extends boolean = false,\n M extends boolean = false,\n D extends Dict = Dict,\n H extends keyof UseCalendarProps<Y, M> = keyof UseCalendarProps<Y, M>,\n>(\n props: D,\n omitKeys?: H[],\n) => {\n return useSplitProps(\n props,\n calendarProps.filter((key) => !omitKeys?.includes(key as H)),\n ) as unknown as [\n keyof UseCalendarProps<Y, M> extends H\n ? UseCalendarProps<Y, M>\n : Omit<UseCalendarProps<Y, M>, H>,\n Omit<\n M,\n keyof UseCalendarProps<Y, M> extends H\n ? keyof UseCalendarProps<Y, M>\n : Exclude<keyof UseCalendarProps<Y, M>, H>\n >,\n ]\n}\n"],"mappings":";;;;;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IACL,iEAA0B,SAAS;IACnC,cAAc;IACd,iEAA0B,SAAS;IACnC,gEAAyB,QAAQ;IACjC,iEAA0B,SAAS;IACnC,4DAAqB,SAAS;IAC9B,gEAAyB,QAAQ;IACjC,gEAAyB,QAAQ;IACjC,iEAA0B,SAAS;IACnC,8DAAuB,WAAW;IAClC,8DAAuB,MAAM;IAC7B,iCAAoB,MAAM,CAAC,OAAO,aAAa;IAC/C,gEAAyB,QAAQ;IACjC,UAAU;IACV,GAAG;IACH,GAAG;IACH,KAAKP,sBAAU,KAAK,SAAS,UAAU,OAAO,SAAS;IACvD,0DAAmB,MAAM,QAAQ,OAAO;IACxC,2DAAoB,MAAM,SAAS,QAAQ;IAC3C,2DAAoB,MAAM,UAAU,OAAO,GAAG,gBAAgB,CAAC;IAC/D,6DAAsB,MAAM,WAAW,UAAU;IAClD;KAEH;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;EAE8B;;AAKjC,MAAMQ,gBAA4C;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,oBAMX,OACA,aACG;AACH,QAAOC,4BACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,IAAS,CAAC,CAC7D"}
@@ -109,10 +109,7 @@ const CartesianChart = withProvider(({ components: componentsProp, render, withG
109
109
  }));
110
110
  const ChartXAxis = withContext((props) => {
111
111
  const { xAxisProps } = useComponentContext();
112
- const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
113
- ...xAxisProps,
114
- ...props
115
- };
112
+ const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = require_props.mergeProps(xAxisProps, props)();
116
113
  const system = require_system_provider.useSystem();
117
114
  const { theme } = require_theme_provider.useTheme();
118
115
  const tickProps = useSlotComponentProps({}, "xAxisTick");
@@ -196,10 +193,7 @@ const ChartXAxis = withContext((props) => {
196
193
  }, "xAxis")();
197
194
  const ChartYAxis = withContext((props) => {
198
195
  const { yAxisProps } = useComponentContext();
199
- const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
200
- ...yAxisProps,
201
- ...props
202
- };
196
+ const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = require_props.mergeProps(yAxisProps, props)();
203
197
  const system = require_system_provider.useSystem();
204
198
  const { theme } = require_theme_provider.useTheme();
205
199
  const tickProps = useSlotComponentProps({}, "yAxisTick");
@@ -295,10 +289,7 @@ const ChartGrid = withContext((props) => {
295
289
  }, "grid")();
296
290
  const ChartLine = withContext((props) => {
297
291
  const { lineProps } = useComponentContext();
298
- const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, label: labelProp = false, stroke: strokeProp, ...rest } = {
299
- ...lineProps,
300
- ...props
301
- };
292
+ const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, label: labelProp = false, stroke: strokeProp, ...rest } = require_props.mergeProps(lineProps, props)();
302
293
  const system = require_system_provider.useSystem();
303
294
  const { theme } = require_theme_provider.useTheme();
304
295
  const color = strokeProp ?? rest.color;
@@ -395,10 +386,7 @@ const ChartLine = withContext((props) => {
395
386
  }, "line")();
396
387
  const ChartArea = withContext((props) => {
397
388
  const { areaProps } = useComponentContext();
398
- const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, gradient, label: labelProp = false, stroke: strokeProp, withGradient, ...rest } = {
399
- ...areaProps,
400
- ...props
401
- };
389
+ const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, gradient, label: labelProp = false, stroke: strokeProp, withGradient, ...rest } = require_props.mergeProps(areaProps, props)();
402
390
  const id = (0, react.useId)();
403
391
  const system = require_system_provider.useSystem();
404
392
  const { theme } = require_theme_provider.useTheme();
@@ -526,10 +514,7 @@ const ChartArea = withContext((props) => {
526
514
  }, "area")();
527
515
  const ChartBar = withContext((props) => {
528
516
  const { barProps } = useComponentContext();
529
- const { children, dataKey, fill: fillProp, label: labelProp = false, ...rest } = {
530
- ...barProps,
531
- ...props
532
- };
517
+ const { children, dataKey, fill: fillProp, label: labelProp = false, ...rest } = require_props.mergeProps(barProps, props)();
533
518
  const system = require_system_provider.useSystem();
534
519
  const { theme } = require_theme_provider.useTheme();
535
520
  const color = fillProp ?? rest.color;