@yamada-ui/react 2.2.5-dev-20260727050304 → 2.2.5-dev-20260727071034

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 (302) hide show
  1. package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
  2. package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
  3. package/dist/cjs/components/airy/airy.cjs.map +1 -1
  4. package/dist/cjs/components/alert/alert.cjs.map +1 -1
  5. package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
  6. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  7. package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
  8. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  9. package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
  10. package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
  11. package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
  12. package/dist/cjs/components/button/button-group.cjs.map +1 -1
  13. package/dist/cjs/components/button/button.cjs.map +1 -1
  14. package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
  15. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
  17. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  18. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  19. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  21. package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
  22. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
  24. package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
  25. package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
  26. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  27. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  28. package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
  29. package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
  30. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  31. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  32. package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
  33. package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
  34. package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
  35. package/dist/cjs/components/editable/editable.cjs.map +1 -1
  36. package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
  37. package/dist/cjs/components/fade/fade.cjs.map +1 -1
  38. package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
  39. package/dist/cjs/components/field/field.cjs.map +1 -1
  40. package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
  41. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  42. package/dist/cjs/components/flip/flip.cjs.map +1 -1
  43. package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
  44. package/dist/cjs/components/form/form.cjs.map +1 -1
  45. package/dist/cjs/components/format/format-byte.cjs.map +1 -1
  46. package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
  47. package/dist/cjs/components/format/format-number.cjs.map +1 -1
  48. package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
  49. package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
  50. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
  51. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
  52. package/dist/cjs/components/icon/icons/index.cjs +9 -3
  53. package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
  54. package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
  55. package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
  56. package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
  57. package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
  58. package/dist/cjs/components/icon/index.cjs +6 -2
  59. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  60. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
  61. package/dist/cjs/components/input/input-group.cjs.map +1 -1
  62. package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
  63. package/dist/cjs/components/list/list.cjs.map +1 -1
  64. package/dist/cjs/components/loading/audio.cjs.map +1 -1
  65. package/dist/cjs/components/loading/background.cjs.map +1 -1
  66. package/dist/cjs/components/loading/circles.cjs.map +1 -1
  67. package/dist/cjs/components/loading/dots.cjs.map +1 -1
  68. package/dist/cjs/components/loading/grid.cjs.map +1 -1
  69. package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
  70. package/dist/cjs/components/loading/oval.cjs.map +1 -1
  71. package/dist/cjs/components/loading/page.cjs.map +1 -1
  72. package/dist/cjs/components/loading/puff.cjs.map +1 -1
  73. package/dist/cjs/components/loading/rings.cjs.map +1 -1
  74. package/dist/cjs/components/loading/screen.cjs.map +1 -1
  75. package/dist/cjs/components/loading/suspense.cjs.map +1 -1
  76. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  77. package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
  78. package/dist/cjs/components/modal/modal.cjs.map +1 -1
  79. package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
  80. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  81. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  82. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  83. package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
  84. package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
  85. package/dist/cjs/components/notice/notice.cjs.map +1 -1
  86. package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
  87. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  88. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  89. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  90. package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
  91. package/dist/cjs/components/picture/picture.cjs.map +1 -1
  92. package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
  93. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  94. package/dist/cjs/components/progress/progress.cjs.map +1 -1
  95. package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
  96. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  97. package/dist/cjs/components/radio/radio.cjs.map +1 -1
  98. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  99. package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
  100. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  101. package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
  102. package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
  103. package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
  104. package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
  105. package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
  106. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
  107. package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
  108. package/dist/cjs/components/select/select.cjs.map +1 -1
  109. package/dist/cjs/components/select/use-select.cjs.map +1 -1
  110. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  111. package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
  112. package/dist/cjs/components/slide/slide.cjs.map +1 -1
  113. package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
  114. package/dist/cjs/components/slider/slider.cjs.map +1 -1
  115. package/dist/cjs/components/slot/slot.cjs.map +1 -1
  116. package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
  117. package/dist/cjs/components/stack/stack.cjs.map +1 -1
  118. package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
  119. package/dist/cjs/components/stat/stat.cjs.map +1 -1
  120. package/dist/cjs/components/status/status.cjs.map +1 -1
  121. package/dist/cjs/components/steps/steps.cjs.map +1 -1
  122. package/dist/cjs/components/switch/switch.cjs.map +1 -1
  123. package/dist/cjs/components/table/table.cjs.map +1 -1
  124. package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
  125. package/dist/cjs/components/tag/tag.cjs.map +1 -1
  126. package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
  127. package/dist/cjs/components/tip/tip.cjs.map +1 -1
  128. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  129. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  130. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  131. package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
  132. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  133. package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
  134. package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
  135. package/dist/cjs/core/system/styled.cjs.map +1 -1
  136. package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
  137. package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
  138. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
  139. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  140. package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
  141. package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
  142. package/dist/cjs/index.cjs +9 -3
  143. package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
  144. package/dist/cjs/utils/store.cjs.map +1 -1
  145. package/dist/esm/components/accordion/accordion.js.map +1 -1
  146. package/dist/esm/components/action-bar/action-bar.js.map +1 -1
  147. package/dist/esm/components/airy/airy.js.map +1 -1
  148. package/dist/esm/components/alert/alert.js.map +1 -1
  149. package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
  150. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  151. package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
  152. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  153. package/dist/esm/components/avatar/avatar.js.map +1 -1
  154. package/dist/esm/components/blockquote/blockquote.js.map +1 -1
  155. package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
  156. package/dist/esm/components/button/button-group.js.map +1 -1
  157. package/dist/esm/components/button/button.js.map +1 -1
  158. package/dist/esm/components/calendar/calendar.js.map +1 -1
  159. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  160. package/dist/esm/components/carousel/carousel.js.map +1 -1
  161. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  162. package/dist/esm/components/chart/chart.js.map +1 -1
  163. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  164. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  165. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  166. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  167. package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
  168. package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
  169. package/dist/esm/components/collapse/collapse.js.map +1 -1
  170. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  171. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  172. package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
  173. package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
  174. package/dist/esm/components/data-list/data-list.js.map +1 -1
  175. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  176. package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
  177. package/dist/esm/components/drawer/drawer.js.map +1 -1
  178. package/dist/esm/components/dropzone/dropzone.js.map +1 -1
  179. package/dist/esm/components/editable/editable.js.map +1 -1
  180. package/dist/esm/components/empty-state/empty-state.js.map +1 -1
  181. package/dist/esm/components/fade/fade.js.map +1 -1
  182. package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
  183. package/dist/esm/components/field/field.js.map +1 -1
  184. package/dist/esm/components/fieldset/fieldset.js.map +1 -1
  185. package/dist/esm/components/file-input/file-input.js.map +1 -1
  186. package/dist/esm/components/flip/flip.js.map +1 -1
  187. package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
  188. package/dist/esm/components/form/form.js.map +1 -1
  189. package/dist/esm/components/format/format-byte.js.map +1 -1
  190. package/dist/esm/components/format/format-date-time.js.map +1 -1
  191. package/dist/esm/components/format/format-number.js.map +1 -1
  192. package/dist/esm/components/highlight/highlight.js.map +1 -1
  193. package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
  194. package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
  195. package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
  196. package/dist/esm/components/icon/icons/index.js +7 -3
  197. package/dist/esm/components/icon/icons/index.js.map +1 -1
  198. package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
  199. package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
  200. package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
  201. package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
  202. package/dist/esm/components/icon/index.js +4 -2
  203. package/dist/esm/components/indicator/indicator.js.map +1 -1
  204. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
  205. package/dist/esm/components/input/input-group.js.map +1 -1
  206. package/dist/esm/components/link-box/link-box.js.map +1 -1
  207. package/dist/esm/components/list/list.js.map +1 -1
  208. package/dist/esm/components/loading/audio.js.map +1 -1
  209. package/dist/esm/components/loading/background.js.map +1 -1
  210. package/dist/esm/components/loading/circles.js.map +1 -1
  211. package/dist/esm/components/loading/dots.js.map +1 -1
  212. package/dist/esm/components/loading/grid.js.map +1 -1
  213. package/dist/esm/components/loading/loading-provider.js.map +1 -1
  214. package/dist/esm/components/loading/oval.js.map +1 -1
  215. package/dist/esm/components/loading/page.js.map +1 -1
  216. package/dist/esm/components/loading/puff.js.map +1 -1
  217. package/dist/esm/components/loading/rings.js.map +1 -1
  218. package/dist/esm/components/loading/screen.js.map +1 -1
  219. package/dist/esm/components/loading/suspense.js.map +1 -1
  220. package/dist/esm/components/menu/menu.js.map +1 -1
  221. package/dist/esm/components/menu/use-menu.js.map +1 -1
  222. package/dist/esm/components/modal/modal.js.map +1 -1
  223. package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
  224. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  225. package/dist/esm/components/native-select/native-select.js.map +1 -1
  226. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  227. package/dist/esm/components/native-table/native-table.js.map +1 -1
  228. package/dist/esm/components/notice/notice-provider.js.map +1 -1
  229. package/dist/esm/components/notice/notice.js.map +1 -1
  230. package/dist/esm/components/notice/use-notice.js.map +1 -1
  231. package/dist/esm/components/number-input/number-input.js.map +1 -1
  232. package/dist/esm/components/pagination/pagination.js.map +1 -1
  233. package/dist/esm/components/password-input/password-input.js.map +1 -1
  234. package/dist/esm/components/password-input/strength-meter.js.map +1 -1
  235. package/dist/esm/components/picture/picture.js.map +1 -1
  236. package/dist/esm/components/pin-input/pin-input.js.map +1 -1
  237. package/dist/esm/components/popover/popover.js.map +1 -1
  238. package/dist/esm/components/progress/progress.js.map +1 -1
  239. package/dist/esm/components/qr-code/qr-code.js.map +1 -1
  240. package/dist/esm/components/radio/radio-group.js.map +1 -1
  241. package/dist/esm/components/radio/radio.js.map +1 -1
  242. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  243. package/dist/esm/components/radio-card/radio-card.js.map +1 -1
  244. package/dist/esm/components/rating/rating.js.map +1 -1
  245. package/dist/esm/components/reorder/reorder.js.map +1 -1
  246. package/dist/esm/components/resizable/resizable.js.map +1 -1
  247. package/dist/esm/components/ripple/ripple.js.map +1 -1
  248. package/dist/esm/components/rotate/rotate.js.map +1 -1
  249. package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
  250. package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
  251. package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
  252. package/dist/esm/components/select/select.js.map +1 -1
  253. package/dist/esm/components/select/use-select.js.map +1 -1
  254. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  255. package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
  256. package/dist/esm/components/slide/slide.js.map +1 -1
  257. package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
  258. package/dist/esm/components/slider/slider.js.map +1 -1
  259. package/dist/esm/components/slot/slot.js.map +1 -1
  260. package/dist/esm/components/snacks/snacks.js.map +1 -1
  261. package/dist/esm/components/stack/stack.js.map +1 -1
  262. package/dist/esm/components/stack/z-stack.js.map +1 -1
  263. package/dist/esm/components/stat/stat.js.map +1 -1
  264. package/dist/esm/components/status/status.js.map +1 -1
  265. package/dist/esm/components/steps/steps.js.map +1 -1
  266. package/dist/esm/components/switch/switch.js.map +1 -1
  267. package/dist/esm/components/table/table.js.map +1 -1
  268. package/dist/esm/components/tabs/tabs.js.map +1 -1
  269. package/dist/esm/components/tag/tag.js.map +1 -1
  270. package/dist/esm/components/timeline/timeline.js.map +1 -1
  271. package/dist/esm/components/tip/tip.js.map +1 -1
  272. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  273. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  274. package/dist/esm/components/tree/tree.js.map +1 -1
  275. package/dist/esm/components/tree/use-tree.js.map +1 -1
  276. package/dist/esm/core/components/create-component.js.map +1 -1
  277. package/dist/esm/core/system/breakpoint.js.map +1 -1
  278. package/dist/esm/core/system/environment-provider.js.map +1 -1
  279. package/dist/esm/core/system/styled.js.map +1 -1
  280. package/dist/esm/core/system/theme-provider.js.map +1 -1
  281. package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
  282. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  283. package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
  284. package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
  285. package/dist/esm/index.js +7 -3
  286. package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
  287. package/dist/esm/utils/store.js.map +1 -1
  288. package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
  289. package/dist/types/components/icon/icons/index.d.ts +5 -3
  290. package/dist/types/components/icon/icons/index.types.d.ts +1 -1
  291. package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
  292. package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
  293. package/dist/types/components/icon/index.d.ts +4 -2
  294. package/dist/types/components/menu/use-menu.d.ts +1 -1
  295. package/dist/types/components/number-input/number-input.style.d.ts +1 -1
  296. package/dist/types/index.d.ts +5 -3
  297. package/package.json +5 -5
  298. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
  299. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
  300. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
  301. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
  302. package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"button.cjs","names":["createComponent","buttonStyle","useRipple","styled","mergeRefs","Ripple","getClassName","isLoadingScheme","getLoadingComponent","mergeCSS","Children"],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n\n if (isLoadingScheme(loadingIcon)) {\n const Component = getLoadingComponent(loadingIcon)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(loadingIcon))\n return cloneElement(loadingIcon, {\n ...props,\n ...loadingIcon.props,\n css: mergeCSS(css, props.css, loadingIcon.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...children.props,\n })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName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AAY;CACpE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"button.cjs","names":["createComponent","buttonStyle","useRipple","styled","mergeRefs","Ripple","getClassName","isLoadingScheme","getLoadingComponent","mergeCSS","Children"],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n\n if (isLoadingScheme(loadingIcon)) {\n const Component = getLoadingComponent(loadingIcon)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(loadingIcon))\n return cloneElement(loadingIcon, {\n ...props,\n ...loadingIcon.props,\n css: mergeCSS(css, props.css, loadingIcon.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...children.props,\n })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"end\")),\n})()\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAAwB;CAC7C,MAAM,aAAA,GAAA,MAAA,OAAA,CAAmB,CAAC,KAAK;CAQ/B,OAAO;EAAE,MAAA,GAAA,MAAA,YAAA,EANgB,SAA6B;GACpD,IAAI,MAAM,UAAU,UAAU,KAAK,YAAY;EACjD,GAAG,CAAC,CAIO;EAAG,MAFD,UAAU,UAAU,WAAW,KAAA;CAEzB;AACrB;AAoEA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,gBACEA,yBAAAA,gBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,SAAS,aACnB,EACC,KACA,IAC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AAS,CAAC;AAAE,CAC7E,CAAC,CAAC;AAEF,MAAM,qBAAqB,UAAqC,eAAe;CAC7E,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,WAAW,OAAO,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,UAAqC,eAAe;CAC3E,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,WAAW,KAAK,CAAC;AACzD,CAAC,CAAC,CAAC;AAIH,MAAM,aAAa,WAChB,EAAE,UAAU,GAAG,WAAW;CACzB,KAAA,GAAA,MAAA,eAAA,CAAqC,QAAQ,GAC3C,QAAA,GAAA,MAAA,aAAA,CAAoB,UAAU;EAC5B,eAAe;EACf,MAAM;EACN,GAAG;EACH,GAAG,SAAS;CACd,CAAC;CAEH,OAAOI,MAAAA,SAAS,MAAM,QAAQ,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC9D,GACA;CAAE,MAAM;CAAc,WAAWJ,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,MAAM,CAAC;AAAE,CACvE,CAAC,CAAC;AAEF,MAAM,kBAAkB,UAAkC,YAAY;CACpE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAAA,IAAAA,CAAiB,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","CalendarDescendantsContext","CalendarContext","styled","mergeProps","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\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 } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,KAAK;CACrB,MAAM,mBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,oBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,G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O,MAAM,CAAC,CAAC,CAAC;AAKxD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgBK,qBAAAA,eAAe,KAAK;CAE5C,OAAO,YAAY;AACrB,CACF"}
1
+ {"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","CalendarDescendantsContext","CalendarContext","styled","mergeProps","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\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 } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,KAAK;CACrB,MAAM,mBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,oBAAA,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GAExB,GANN,MAAM,aAAa,CAMb,CACd;EACW,GAXK,KAWL,CACf;CACY,CAAA,CACf,EAAA,CAAA;CAGJ,OAAO;EACL,GAAG,cAAcC,cAAAA,WAAW,YAAY,IAAI,CAAC,CAAC,CAAC;EAC/C;CACF;AACF,CAAC;AAED,MAAM,mBAAmB,YAAY,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAEhE,MAAM,kBAAkB,YAAY,MAAM,CAAC,QAAQ,SAAS,CAAC,CAAC,CAAC;AAE/D,MAAM,gBAAgB,YAAY,SAAS,OAAO,CAAC,CAAC;AAEpD,MAAM,eAAe,YAAY,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAKxD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgBK,qBAAAA,eAAe,KAAK;CAE5C,OAAO,YAAY;AACrB,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-calendar.cjs","names":["createDescendants","createContext","useI18n","useDateTimeFormat","useControllableState","mergeProps","visuallyHiddenAttributes","mergeRefs","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 { mergeProps, 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 return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\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) return [...prev, value]\n else return prev\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) return { end: undefined, start: value }\n else if (isSameDate(start, value))\n return { end: undefined, start: undefined }\n else if (isBeforeDate(value, start)) return { end: start, start: value }\n else return { end: value, start }\n } else {\n if (isSameDate(prev, value)) return undefined\n else return value\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) month = dayjs(value.end).set(\"date\", 1).toDate()\n else if (value.start) month = dayjs(value.start).set(\"date\", 1).toDate()\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 return value.getDate().toString()\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) defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n else if (defaultValue)\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\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 [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 } 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 mergeProps({ \"data-disabled\": dataAttr(disabled) }, rest, props)(),\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)) 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 }, [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 onFocusDescendant(descendant)\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 onFocusDescendant(descendant)\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 onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n },\n PageUp: (ev) => {\n if (ev.shiftKey)\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n else onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\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 ({ \"aria-label\": ariaLabel, ...props } = {}) => {\n let resolvedAriaLabel = ariaLabel\n if (!resolvedAriaLabel) {\n resolvedAriaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) resolvedAriaLabel = `${t(\"Today\")}, ${resolvedAriaLabel}`\n }\n\n return mergeProps(\n {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": resolvedAriaLabel,\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 },\n rest,\n props,\n {\n ref: mergeRefs(cellRef, outside ? null : register),\n onBlur,\n onClick,\n onFocus: (ev) => ev.preventDefault(),\n onKeyDown,\n },\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,MAAa,mBAA2B,CAAC;AACzC,MAAa,uBAAiC,CAAC,GAAG,CAAC;AACnD,MAAa,4BAA4C;AACzD,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAC3D,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAmB3D,MAAa,kBACX,MACA,oBAAA,GAAA,MAAA,QAAA,CAEM,IAAI,CAAC,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CACpD,QAAQ,MAAM,CAAC,CACf,IAAI,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CAC/C,OAAO;AAEZ,MAAa,gBACX,MACA,oBAAA,GAAA,MAAA,QAAA,CAEM,I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ACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAG0B;CAAE;AAChC;AAIA,MAAM,gBAA4C;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,oBAMX,OACA,aACG;CACH,OAAOC,cAAAA,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
1
+ {"version":3,"file":"use-calendar.cjs","names":["createDescendants","createContext","useI18n","useDateTimeFormat","useControllableState","mergeProps","visuallyHiddenAttributes","mergeRefs","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 { mergeProps, 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 return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\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) return [...prev, value]\n else return prev\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) return { end: undefined, start: value }\n else if (isSameDate(start, value))\n return { end: undefined, start: undefined }\n else if (isBeforeDate(value, start)) return { end: start, start: value }\n else return { end: value, start }\n } else {\n if (isSameDate(prev, value)) return undefined\n else return value\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) month = dayjs(value.end).set(\"date\", 1).toDate()\n else if (value.start) month = dayjs(value.start).set(\"date\", 1).toDate()\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 return value.getDate().toString()\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) defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n else if (defaultValue)\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\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 [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 } 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 mergeProps({ \"data-disabled\": dataAttr(disabled) }, rest, props)(),\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)) 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 }, [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 onFocusDescendant(descendant)\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 onFocusDescendant(descendant)\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 onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n },\n PageUp: (ev) => {\n if (ev.shiftKey)\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n else onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\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 ({ \"aria-label\": ariaLabel, ...props } = {}) => {\n let resolvedAriaLabel = ariaLabel\n if (!resolvedAriaLabel) {\n resolvedAriaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) resolvedAriaLabel = `${t(\"Today\")}, ${resolvedAriaLabel}`\n }\n\n return mergeProps(\n {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": resolvedAriaLabel,\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 },\n rest,\n props,\n {\n ref: mergeRefs(cellRef, outside ? null : register),\n onBlur,\n onClick,\n onFocus: (ev) => ev.preventDefault(),\n onKeyDown,\n },\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,MAAa,mBAA2B,CAAC;AACzC,MAAa,uBAAiC,CAAC,GAAG,CAAC;AACnD,MAAa,4BAA4C;AACzD,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAC3D,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAmB3D,MAAa,kBACX,MACA,oBAAA,GAAA,MAAA,QAAA,CAEM,IAAI,CAAC,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CACpD,QAAQ,MAAM,CAAC,CACf,IAAI,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CAC/C,OAAO;AAEZ,MAAa,gBACX,MACA,oBAAA,GAAA,MAAA,QAAA,CAEM,IAAI,CAAC,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CACpD,MAAM,MAAM,CAAC,CACb,IAAI,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CAC/C,OAAO;AAEZ,MAAa,eACX,gBACA,WACuC;CACvC,IAAI,WAA+C,CAAC;CAEpD,MAAM,OAAO,+BAAe,IAAI,KAAK,GAAG,cAAc;CAEtD,KAAK,IAAI,IAAI,GAAG,IAAI,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G;CACH,OAAOC,cAAAA,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.cjs","names":["createSlotComponent","carouselStyle","useCarousel","CarouselContext","styled","varAttr","useCarouselContext","IconButton","ChevronLeftIcon","ChevronRightIcon"],"sources":["../../../../src/components/carousel/carousel.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type {\n CSSProps,\n HTMLProps,\n HTMLStyledProps,\n Orientation,\n ThemeProps,\n} from \"../../core\"\nimport type { IconButtonProps } from \"../button\"\nimport type { CarouselStyle } from \"./carousel.style\"\nimport type {\n CarouselAlign,\n CarouselContainScroll,\n CarouselInViewThreshold,\n UseCarouselProps,\n} from \"./use-carousel\"\nimport { cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { dataAttr } from \"../../utils\"\nimport { IconButton } from \"../button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { carouselStyle } from \"./carousel.style\"\nimport {\n CarouselContext,\n useCarousel,\n useCarouselContext,\n} from \"./use-carousel\"\n\ninterface ComponentContext extends Pick<\n CarouselRootProps,\n \"includeGapInSize\"\n> {}\n\nexport interface CarouselRootProps\n extends\n Omit<HTMLStyledProps<\"section\">, \"draggable\" | \"onChange\">,\n Omit<\n UseCarouselProps,\n | \"align\"\n | \"autoplay\"\n | \"containScroll\"\n | \"delay\"\n | \"dragFree\"\n | \"draggable\"\n | \"duration\"\n | \"inViewThreshold\"\n | \"loop\"\n | \"orientation\"\n | \"skipSnaps\"\n | \"slidesToScroll\"\n | \"stopMouseEnterAutoplay\"\n >,\n ThemeProps<CarouselStyle> {\n /**\n * The alignment of the carousel.\n *\n * @default 'center'\n */\n align?: CarouselAlign\n /**\n * If `true`, the carousel will be autoplay.\n *\n * @default false\n */\n autoplay?: boolean\n /**\n * Clear leading and trailing empty space that causes excessive scrolling.\n * Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.\n *\n * @default false\n */\n containScroll?: CarouselContainScroll\n /**\n * The number for the autoplay interval of the carousel.\n *\n * @default 4000\n */\n delay?: number\n /**\n * If `true`, momentum scrolling will be enabled.\n *\n * @default false\n */\n dragFree?: boolean\n /**\n * If `true`, carousel can be scrolled with mouse and touch interactions.\n *\n * @default true\n */\n draggable?: boolean\n /**\n * Set scroll duration when triggered by any of the API methods.\n * Higher numbers enables slower scrolling.\n * Drag interactions are not affected because duration is then determined by the drag force.\n *\n * @default 25\n */\n duration?: number\n /**\n * If `true`, gap will be treated as part of the carousel slide size.\n *\n * @default true\n */\n includeGapInSize?: boolean\n /**\n * Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.\n *\n * @default 0\n */\n inViewThreshold?: CarouselInViewThreshold\n /**\n * If `true`, infinite looping.\n * Automatically falls back to false if slide content isn't enough to loop.\n *\n * @default true\n */\n loop?: boolean\n /**\n * The orientation of the carousel.\n *\n * @default 'horizontal'\n */\n orientation?: Orientation\n /**\n * If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.\n * Note that this option will be ignored if the dragFree option is set to true.\n *\n * @default false\n */\n skipSnaps?: boolean\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n /**\n * The number of slides that should be scrolled with next or previous buttons.\n *\n * @default 1\n */\n slidesToScroll?: number\n /**\n * If `true`, autoplay will pause when the mouse entries over.\n *\n * @default true\n */\n stopMouseEnterAutoplay?: boolean\n}\n\nconst {\n ComponentContext,\n PropsContext: CarouselPropsContext,\n useComponentContext,\n usePropsContext: useCarouselPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CarouselRootProps, CarouselStyle>(\n \"carousel\",\n carouselStyle,\n)\n\nexport { CarouselPropsContext, useCarouselPropsContext }\n\n/**\n * `Carousel` is a component that displays multiple elements like a slideshow.\n *\n * @see https://yamada-ui.com/docs/components/carousel\n */\nexport const CarouselRoot = withProvider<\"section\", CarouselRootProps>(\n ({ includeGapInSize = true, ...rest }) => {\n const {\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n } = useCarousel(rest)\n const componentContext = useMemo(\n () => ({ includeGapInSize }),\n [includeGapInSize],\n )\n const carouselContext = useMemo(\n () => ({\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n }),\n [\n carousel,\n total,\n index,\n setIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n ],\n )\n\n return (\n <CarouselContext value={carouselContext}>\n <ComponentContext value={componentContext}>\n <styled.section {...getRootProps()} />\n </ComponentContext>\n </CarouselContext>\n )\n },\n \"root\",\n)(undefined, ({ gap, slideSize, ...rest }) => {\n return {\n ...rest,\n \"--slide-gap\": varAttr(gap, \"spaces\"),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n }\n})\n\nexport interface CarouselListProps extends HTMLStyledProps {}\n\nexport const CarouselList = withContext<\"div\", CarouselListProps>(\n \"div\",\n \"list\",\n)(undefined, (props) => {\n const { includeGapInSize } = useComponentContext()\n const { getListProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n ...getListProps(props),\n }\n})\n\nexport interface CarouselItemProps extends HTMLStyledProps {\n /**\n * The index of the carousel item.\n */\n index: number\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n}\n\nexport const CarouselItem = withContext<\"div\", CarouselItemProps>(\n \"div\",\n \"item\",\n)(undefined, ({ slideSize, ...rest }) => {\n const { includeGapInSize } = useComponentContext()\n const { getItemProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n ...getItemProps(rest),\n }\n})\n\nexport interface CarouselPrevTriggerProps extends IconButtonProps {}\n\nexport const CarouselPrevTrigger = withContext<\n \"button\",\n CarouselPrevTriggerProps\n>(IconButton, { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] })(\n undefined,\n (props) => {\n const { getPrevTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronLeftIcon />,\n ...getPrevTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselNextTriggerProps extends IconButtonProps {}\n\nexport const CarouselNextTrigger = withContext<\n \"button\",\n CarouselNextTriggerProps\n>(IconButton, { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] })(\n undefined,\n (props) => {\n const { getNextTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronRightIcon />,\n ...getNextTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselIndicatorsProps extends HTMLStyledProps {\n /**\n * The function used to generate children.\n * it will be called with `{ index: number; selected: boolean }`.\n */\n render?: (props: { index: number; selected: boolean }) => ReactNode\n}\n\nexport const CarouselIndicators = withContext<\"div\", CarouselIndicatorsProps>(\n \"div\",\n \"indicators\",\n)(undefined, ({ children, render, ...rest }) => {\n const {\n index: selectedIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n } = useCarouselContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return Array.from({ length: snapCount }, (_, index) => {\n if (render) {\n const component = render({ index, selected: index === selectedIndex })\n\n if (isValidElement<HTMLProps<\"button\">>(component))\n return cloneElement(component, {\n ...getIndicatorProps({ key: index, index }),\n })\n else return component\n } else {\n return <CarouselIndicator key={index} index={index} />\n }\n })\n }, [children, getIndicatorProps, render, selectedIndex, snapCount])\n\n return {\n children: computedChildren,\n ...getIndicatorsProps(rest),\n }\n})\n\nexport interface CarouselIndicatorProps extends HTMLStyledProps<\"button\"> {\n /**\n * The index of the carousel indicator.\n */\n index: number\n}\n\nexport const CarouselIndicator = withContext<\"button\", CarouselIndicatorProps>(\n \"button\",\n \"indicator\",\n)(undefined, (props) => {\n const { getIndicatorProps } = useCarouselContext()\n\n return getIndicatorProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;AAsJA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EAAE,mBAAmB,MAAM,GAAG,WAAW;CACxC,MAAM,EACJ,UACA,OACA,UACA,WACA,OACA,mBACA,oBACA,cACA,cACA,qBACA,qBACA,iBACEC,qBAAAA,YAAY,IAAI;CACpB,MAAM,oBAAA,GAAA,MAAA,QAAA,QACG,EAAE,iBAAiB,IAC1B,CAAC,gBAAgB,CACnB;CA8BA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,iBAAD;EAAiB,QAAA,GAAA,MAAA,QAAA,QA7BV;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAIsC;YACpC,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;GAAkB,OAAO;aACvB,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,SAAR,EAAgB,GAAI,aAAa,EAAI,CAAA;EACrB,CAAA;CACH,CAAA;AAErB,GACA,MACF,CAAC,CAAC,KAAA,IAAY,EAAE,KAAK,WAAW,GAAG,WAAW;CAC5C,OAAO;EACL,GAAG;EACH,eAAeC,YAAAA,QAAQ,KAAK,QAAQ;EACpC,gBAAgBA,YAAAA,QAAQ,WAAW,OAAO;CAC5C;AACF,CAAC;AAID,MAAa,eAAe,YAC1B,OACA,MACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,qBAAqB,oBAAoB;CACjD,MAAM,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BvB,OAAO;EACL,WAAA,GAAA,MAAA,QAAA,OAnBqC;GACrC,IAAI,UAAU,OAAO;QAEnB,OAAO,MAAM,KAAK,EAAE,QAAQ,UAAU,IAAI,GAAG,UAAU;IACrD,IAAI,QAAQ;KACV,MAAM,YAAY,OAAO;MAAE;MAAO,UAAU,UAAU;KAAc,CAAC;KAErE,KAAA,GAAA,MAAA,eAAA,CAAwC,SAAS,GAC/C,QAAA,GAAA,MAAA,aAAA,CAAoB,WAAW,EAC7B,GAAG,kBAAkB;MAAE,KAAK;MAAO;KAAM,CAAC,EAC5C,CAAC;UACE,OAAO;IACd,OACE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAD,EAAsC,MAAQ,GAAtB,KAAsB;GAEzD,CAAC;EACL,GAAG;GAAC;GAAU;GAAmB;GAAQ;GAAe;EAAS,CAGtC;EACzB,GAAG,mBAAmB,IAAI;CAC5B;AACF,CAAC;AASD,MAAa,oBAAoB,YAC/B,UACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,sBAAsBA,qBAAAA,mBAAmB;CAEjD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
1
+ {"version":3,"file":"carousel.cjs","names":["createSlotComponent","carouselStyle","useCarousel","CarouselContext","styled","varAttr","useCarouselContext","IconButton","ChevronLeftIcon","ChevronRightIcon"],"sources":["../../../../src/components/carousel/carousel.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type {\n CSSProps,\n HTMLProps,\n HTMLStyledProps,\n Orientation,\n ThemeProps,\n} from \"../../core\"\nimport type { IconButtonProps } from \"../button\"\nimport type { CarouselStyle } from \"./carousel.style\"\nimport type {\n CarouselAlign,\n CarouselContainScroll,\n CarouselInViewThreshold,\n UseCarouselProps,\n} from \"./use-carousel\"\nimport { cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { dataAttr } from \"../../utils\"\nimport { IconButton } from \"../button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { carouselStyle } from \"./carousel.style\"\nimport {\n CarouselContext,\n useCarousel,\n useCarouselContext,\n} from \"./use-carousel\"\n\ninterface ComponentContext extends Pick<\n CarouselRootProps,\n \"includeGapInSize\"\n> {}\n\nexport interface CarouselRootProps\n extends\n Omit<HTMLStyledProps<\"section\">, \"draggable\" | \"onChange\">,\n Omit<\n UseCarouselProps,\n | \"align\"\n | \"autoplay\"\n | \"containScroll\"\n | \"delay\"\n | \"dragFree\"\n | \"draggable\"\n | \"duration\"\n | \"inViewThreshold\"\n | \"loop\"\n | \"orientation\"\n | \"skipSnaps\"\n | \"slidesToScroll\"\n | \"stopMouseEnterAutoplay\"\n >,\n ThemeProps<CarouselStyle> {\n /**\n * The alignment of the carousel.\n *\n * @default 'center'\n */\n align?: CarouselAlign\n /**\n * If `true`, the carousel will be autoplay.\n *\n * @default false\n */\n autoplay?: boolean\n /**\n * Clear leading and trailing empty space that causes excessive scrolling.\n * Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.\n *\n * @default false\n */\n containScroll?: CarouselContainScroll\n /**\n * The number for the autoplay interval of the carousel.\n *\n * @default 4000\n */\n delay?: number\n /**\n * If `true`, momentum scrolling will be enabled.\n *\n * @default false\n */\n dragFree?: boolean\n /**\n * If `true`, carousel can be scrolled with mouse and touch interactions.\n *\n * @default true\n */\n draggable?: boolean\n /**\n * Set scroll duration when triggered by any of the API methods.\n * Higher numbers enables slower scrolling.\n * Drag interactions are not affected because duration is then determined by the drag force.\n *\n * @default 25\n */\n duration?: number\n /**\n * If `true`, gap will be treated as part of the carousel slide size.\n *\n * @default true\n */\n includeGapInSize?: boolean\n /**\n * Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.\n *\n * @default 0\n */\n inViewThreshold?: CarouselInViewThreshold\n /**\n * If `true`, infinite looping.\n * Automatically falls back to false if slide content isn't enough to loop.\n *\n * @default true\n */\n loop?: boolean\n /**\n * The orientation of the carousel.\n *\n * @default 'horizontal'\n */\n orientation?: Orientation\n /**\n * If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.\n * Note that this option will be ignored if the dragFree option is set to true.\n *\n * @default false\n */\n skipSnaps?: boolean\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n /**\n * The number of slides that should be scrolled with next or previous buttons.\n *\n * @default 1\n */\n slidesToScroll?: number\n /**\n * If `true`, autoplay will pause when the mouse entries over.\n *\n * @default true\n */\n stopMouseEnterAutoplay?: boolean\n}\n\nconst {\n ComponentContext,\n PropsContext: CarouselPropsContext,\n useComponentContext,\n usePropsContext: useCarouselPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CarouselRootProps, CarouselStyle>(\n \"carousel\",\n carouselStyle,\n)\n\nexport { CarouselPropsContext, useCarouselPropsContext }\n\n/**\n * `Carousel` is a component that displays multiple elements like a slideshow.\n *\n * @see https://yamada-ui.com/docs/components/carousel\n */\nexport const CarouselRoot = withProvider<\"section\", CarouselRootProps>(\n ({ includeGapInSize = true, ...rest }) => {\n const {\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n } = useCarousel(rest)\n const componentContext = useMemo(\n () => ({ includeGapInSize }),\n [includeGapInSize],\n )\n const carouselContext = useMemo(\n () => ({\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n }),\n [\n carousel,\n total,\n index,\n setIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n ],\n )\n\n return (\n <CarouselContext value={carouselContext}>\n <ComponentContext value={componentContext}>\n <styled.section {...getRootProps()} />\n </ComponentContext>\n </CarouselContext>\n )\n },\n \"root\",\n)(undefined, ({ gap, slideSize, ...rest }) => {\n return {\n ...rest,\n \"--slide-gap\": varAttr(gap, \"spaces\"),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n }\n})\n\nexport interface CarouselListProps extends HTMLStyledProps {}\n\nexport const CarouselList = withContext<\"div\", CarouselListProps>(\n \"div\",\n \"list\",\n)(undefined, (props) => {\n const { includeGapInSize } = useComponentContext()\n const { getListProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n ...getListProps(props),\n }\n})\n\nexport interface CarouselItemProps extends HTMLStyledProps {\n /**\n * The index of the carousel item.\n */\n index: number\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n}\n\nexport const CarouselItem = withContext<\"div\", CarouselItemProps>(\n \"div\",\n \"item\",\n)(undefined, ({ slideSize, ...rest }) => {\n const { includeGapInSize } = useComponentContext()\n const { getItemProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n ...getItemProps(rest),\n }\n})\n\nexport interface CarouselPrevTriggerProps extends IconButtonProps {}\n\nexport const CarouselPrevTrigger = withContext<\n \"button\",\n CarouselPrevTriggerProps\n>(IconButton, { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] })(\n undefined,\n (props) => {\n const { getPrevTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronLeftIcon />,\n ...getPrevTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselNextTriggerProps extends IconButtonProps {}\n\nexport const CarouselNextTrigger = withContext<\n \"button\",\n CarouselNextTriggerProps\n>(IconButton, { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] })(\n undefined,\n (props) => {\n const { getNextTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronRightIcon />,\n ...getNextTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselIndicatorsProps extends HTMLStyledProps {\n /**\n * The function used to generate children.\n * it will be called with `{ index: number; selected: boolean }`.\n */\n render?: (props: { index: number; selected: boolean }) => ReactNode\n}\n\nexport const CarouselIndicators = withContext<\"div\", CarouselIndicatorsProps>(\n \"div\",\n \"indicators\",\n)(undefined, ({ children, render, ...rest }) => {\n const {\n index: selectedIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n } = useCarouselContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return Array.from({ length: snapCount }, (_, index) => {\n if (render) {\n const component = render({ index, selected: index === selectedIndex })\n\n if (isValidElement<HTMLProps<\"button\">>(component))\n return cloneElement(component, {\n ...getIndicatorProps({ key: index, index }),\n })\n else return component\n } else {\n return <CarouselIndicator key={index} index={index} />\n }\n })\n }, [children, getIndicatorProps, render, selectedIndex, snapCount])\n\n return {\n children: computedChildren,\n ...getIndicatorsProps(rest),\n }\n})\n\nexport interface CarouselIndicatorProps extends HTMLStyledProps<\"button\"> {\n /**\n * The index of the carousel indicator.\n */\n index: number\n}\n\nexport const CarouselIndicator = withContext<\"button\", CarouselIndicatorProps>(\n \"button\",\n \"indicator\",\n)(undefined, (props) => {\n const { getIndicatorProps } = useCarouselContext()\n\n return getIndicatorProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;AAsJA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EAAE,mBAAmB,MAAM,GAAG,WAAW;CACxC,MAAM,EACJ,UACA,OACA,UACA,WACA,OACA,mBACA,oBACA,cACA,cACA,qBACA,qBACA,iBACEC,qBAAAA,YAAY,IAAI;CACpB,MAAM,oBAAA,GAAA,MAAA,QAAA,QACG,EAAE,iBAAiB,IAC1B,CAAC,gBAAgB,CACnB;CA8BA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,iBAAD;EAAiB,QAAA,GAAA,MAAA,Q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