@yamada-ui/react 2.2.6 → 2.2.7-dev-20260804111744

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 (811) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -1
  2. package/dist/cjs/components/accordion/accordion.cjs +4 -2
  3. package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/use-accordion.cjs +1 -0
  5. package/dist/cjs/components/accordion/use-accordion.cjs.map +1 -1
  6. package/dist/cjs/components/action-bar/action-bar.cjs +1 -0
  7. package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
  8. package/dist/cjs/components/action-bar/use-action-bar.cjs +1 -0
  9. package/dist/cjs/components/action-bar/use-action-bar.cjs.map +1 -1
  10. package/dist/cjs/components/airy/airy.cjs +1 -0
  11. package/dist/cjs/components/airy/airy.cjs.map +1 -1
  12. package/dist/cjs/components/alert/alert.cjs +5 -2
  13. package/dist/cjs/components/alert/alert.cjs.map +1 -1
  14. package/dist/cjs/components/alpha-slider/alpha-slider.cjs +1 -0
  15. package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
  16. package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs +1 -0
  17. package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
  18. package/dist/cjs/components/autocomplete/autocomplete.cjs +14 -10
  19. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  20. package/dist/cjs/components/autocomplete/use-autocomplete.cjs +1 -0
  21. package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
  22. package/dist/cjs/components/avatar/avatar-group.cjs +13 -11
  23. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  24. package/dist/cjs/components/avatar/use-avatar-group.cjs +1 -0
  25. package/dist/cjs/components/avatar/use-avatar-group.cjs.map +1 -1
  26. package/dist/cjs/components/avatar/use-avatar.cjs +1 -0
  27. package/dist/cjs/components/avatar/use-avatar.cjs.map +1 -1
  28. package/dist/cjs/components/blockquote/blockquote.cjs +1 -0
  29. package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
  30. package/dist/cjs/components/breadcrumb/breadcrumb.cjs +1 -0
  31. package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
  32. package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs +1 -0
  33. package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs.map +1 -1
  34. package/dist/cjs/components/button/button-group.cjs +1 -0
  35. package/dist/cjs/components/button/button-group.cjs.map +1 -1
  36. package/dist/cjs/components/button/button.cjs +9 -5
  37. package/dist/cjs/components/button/button.cjs.map +1 -1
  38. package/dist/cjs/components/calendar/calendar.cjs +1 -0
  39. package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
  40. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  41. package/dist/cjs/components/carousel/carousel.cjs +27 -25
  42. package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
  43. package/dist/cjs/components/carousel/use-carousel.cjs.map +1 -1
  44. package/dist/cjs/components/chart/area-chart.cjs +6 -4
  45. package/dist/cjs/components/chart/area-chart.cjs.map +1 -1
  46. package/dist/cjs/components/chart/bar-chart.cjs +6 -4
  47. package/dist/cjs/components/chart/bar-chart.cjs.map +1 -1
  48. package/dist/cjs/components/chart/cartesian-chart.cjs +146 -139
  49. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  50. package/dist/cjs/components/chart/chart.cjs +3 -1
  51. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  52. package/dist/cjs/components/chart/composed-chart.cjs +16 -14
  53. package/dist/cjs/components/chart/composed-chart.cjs.map +1 -1
  54. package/dist/cjs/components/chart/donut-chart.cjs +8 -5
  55. package/dist/cjs/components/chart/donut-chart.cjs.map +1 -1
  56. package/dist/cjs/components/chart/line-chart.cjs +6 -4
  57. package/dist/cjs/components/chart/line-chart.cjs.map +1 -1
  58. package/dist/cjs/components/chart/pie-chart.cjs +8 -5
  59. package/dist/cjs/components/chart/pie-chart.cjs.map +1 -1
  60. package/dist/cjs/components/chart/polar-chart.cjs +119 -111
  61. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  62. package/dist/cjs/components/chart/radar-chart.cjs +6 -4
  63. package/dist/cjs/components/chart/radar-chart.cjs.map +1 -1
  64. package/dist/cjs/components/chart/radial-chart.cjs +1 -0
  65. package/dist/cjs/components/chart/radial-chart.cjs.map +1 -1
  66. package/dist/cjs/components/chart/use-cartesian-chart.cjs +1 -0
  67. package/dist/cjs/components/chart/use-cartesian-chart.cjs.map +1 -1
  68. package/dist/cjs/components/chart/use-chart.cjs +1 -0
  69. package/dist/cjs/components/chart/use-chart.cjs.map +1 -1
  70. package/dist/cjs/components/chart/use-polar-chart.cjs +1 -0
  71. package/dist/cjs/components/chart/use-polar-chart.cjs.map +1 -1
  72. package/dist/cjs/components/checkbox/checkbox-group.cjs +39 -36
  73. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  74. package/dist/cjs/components/checkbox/checkbox.cjs +1 -0
  75. package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
  76. package/dist/cjs/components/checkbox/use-checkbox-group.cjs +1 -0
  77. package/dist/cjs/components/checkbox/use-checkbox-group.cjs.map +1 -1
  78. package/dist/cjs/components/checkbox/use-checkbox.cjs +3 -1
  79. package/dist/cjs/components/checkbox/use-checkbox.cjs.map +1 -1
  80. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs +43 -40
  81. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  82. package/dist/cjs/components/checkbox-card/checkbox-card.cjs +1 -0
  83. package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
  84. package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
  85. package/dist/cjs/components/client-only/client-only.cjs +2 -1
  86. package/dist/cjs/components/client-only/client-only.cjs.map +1 -1
  87. package/dist/cjs/components/collapse/collapse.cjs +1 -0
  88. package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
  89. package/dist/cjs/components/color-picker/color-picker.cjs +3 -1
  90. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  91. package/dist/cjs/components/color-picker/use-color-picker.cjs +1 -0
  92. package/dist/cjs/components/color-picker/use-color-picker.cjs.map +1 -1
  93. package/dist/cjs/components/color-selector/color-selector.cjs +3 -1
  94. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  95. package/dist/cjs/components/color-selector/use-color-selector.cjs +1 -0
  96. package/dist/cjs/components/color-selector/use-color-selector.cjs.map +1 -1
  97. package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
  98. package/dist/cjs/components/data-list/data-list.cjs +9 -5
  99. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  100. package/dist/cjs/components/date-picker/date-picker.cjs +3 -1
  101. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  102. package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
  103. package/dist/cjs/components/drawer/drawer.cjs +1 -0
  104. package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
  105. package/dist/cjs/components/drawer/use-drawer.cjs +2 -3
  106. package/dist/cjs/components/drawer/use-drawer.cjs.map +1 -1
  107. package/dist/cjs/components/dropzone/dropzone.cjs +3 -1
  108. package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
  109. package/dist/cjs/components/dropzone/use-dropzone.cjs +1 -0
  110. package/dist/cjs/components/dropzone/use-dropzone.cjs.map +1 -1
  111. package/dist/cjs/components/editable/editable.cjs.map +1 -1
  112. package/dist/cjs/components/editable/use-editable.cjs +1 -0
  113. package/dist/cjs/components/editable/use-editable.cjs.map +1 -1
  114. package/dist/cjs/components/fade/fade.cjs +1 -0
  115. package/dist/cjs/components/fade/fade.cjs.map +1 -1
  116. package/dist/cjs/components/fade-scale/fade-scale.cjs +1 -0
  117. package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
  118. package/dist/cjs/components/field/field.cjs +1 -0
  119. package/dist/cjs/components/field/field.cjs.map +1 -1
  120. package/dist/cjs/components/field/use-field-props.cjs +1 -0
  121. package/dist/cjs/components/field/use-field-props.cjs.map +1 -1
  122. package/dist/cjs/components/fieldset/fieldset.cjs +1 -0
  123. package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
  124. package/dist/cjs/components/file-button/use-file-button.cjs +1 -0
  125. package/dist/cjs/components/file-button/use-file-button.cjs.map +1 -1
  126. package/dist/cjs/components/file-input/file-input.cjs +3 -1
  127. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  128. package/dist/cjs/components/file-input/use-file-input.cjs +1 -0
  129. package/dist/cjs/components/file-input/use-file-input.cjs.map +1 -1
  130. package/dist/cjs/components/flip/flip.cjs +1 -0
  131. package/dist/cjs/components/flip/flip.cjs.map +1 -1
  132. package/dist/cjs/components/float/float.cjs.map +1 -1
  133. package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
  134. package/dist/cjs/components/for/for.cjs.map +1 -1
  135. package/dist/cjs/components/form/form.cjs +1 -0
  136. package/dist/cjs/components/form/form.cjs.map +1 -1
  137. package/dist/cjs/components/format/use-format-byte.cjs +1 -0
  138. package/dist/cjs/components/format/use-format-byte.cjs.map +1 -1
  139. package/dist/cjs/components/format/use-format-date-time.cjs +1 -0
  140. package/dist/cjs/components/format/use-format-date-time.cjs.map +1 -1
  141. package/dist/cjs/components/format/use-format-number.cjs +1 -0
  142. package/dist/cjs/components/format/use-format-number.cjs.map +1 -1
  143. package/dist/cjs/components/grid/grid-item.cjs.map +1 -1
  144. package/dist/cjs/components/group/group.cjs.map +1 -1
  145. package/dist/cjs/components/group/use-group.cjs +1 -0
  146. package/dist/cjs/components/group/use-group.cjs.map +1 -1
  147. package/dist/cjs/components/highlight/highlight.cjs +1 -0
  148. package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
  149. package/dist/cjs/components/highlight/use-highlight.cjs +1 -0
  150. package/dist/cjs/components/highlight/use-highlight.cjs.map +1 -1
  151. package/dist/cjs/components/hue-slider/hue-slider.cjs +1 -0
  152. package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
  153. package/dist/cjs/components/icon/icons/index.cjs +30 -6
  154. package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
  155. package/dist/cjs/components/icon/icons/layout-freeform-icon.cjs +14 -0
  156. package/dist/cjs/components/icon/icons/layout-freeform-icon.cjs.map +1 -0
  157. package/dist/cjs/components/icon/icons/mic-audio-lines-icon.cjs +14 -0
  158. package/dist/cjs/components/icon/icons/mic-audio-lines-icon.cjs.map +1 -0
  159. package/dist/cjs/components/icon/icons/mic-signal-icon.cjs +14 -0
  160. package/dist/cjs/components/icon/icons/mic-signal-icon.cjs.map +1 -0
  161. package/dist/cjs/components/icon/icons/mosque-icon.cjs +14 -0
  162. package/dist/cjs/components/icon/icons/mosque-icon.cjs.map +1 -0
  163. package/dist/cjs/components/icon/icons/rotate-ccw-clock-icon.cjs +14 -0
  164. package/dist/cjs/components/icon/icons/rotate-ccw-clock-icon.cjs.map +1 -0
  165. package/dist/cjs/components/icon/icons/rotate-cw-fading-clock-icon.cjs +14 -0
  166. package/dist/cjs/components/icon/icons/rotate-cw-fading-clock-icon.cjs.map +1 -0
  167. package/dist/cjs/components/icon/icons/scan-square-icon.cjs +14 -0
  168. package/dist/cjs/components/icon/icons/scan-square-icon.cjs.map +1 -0
  169. package/dist/cjs/components/icon/icons/shield-keyhole-icon.cjs +14 -0
  170. package/dist/cjs/components/icon/icons/shield-keyhole-icon.cjs.map +1 -0
  171. package/dist/cjs/components/icon/icons/square-off-icon.cjs +14 -0
  172. package/dist/cjs/components/icon/icons/square-off-icon.cjs.map +1 -0
  173. package/dist/cjs/components/icon/icons/user-shield-icon.cjs +14 -0
  174. package/dist/cjs/components/icon/icons/user-shield-icon.cjs.map +1 -0
  175. package/dist/cjs/components/icon/index.cjs +20 -4
  176. package/dist/cjs/components/indicator/indicator.cjs +1 -0
  177. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  178. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs +3 -1
  179. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
  180. package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs +1 -0
  181. package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs.map +1 -1
  182. package/dist/cjs/components/input/input-group.cjs +14 -12
  183. package/dist/cjs/components/input/input-group.cjs.map +1 -1
  184. package/dist/cjs/components/input/input.style.cjs.map +1 -1
  185. package/dist/cjs/components/input/use-input-border.cjs +1 -0
  186. package/dist/cjs/components/input/use-input-border.cjs.map +1 -1
  187. package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
  188. package/dist/cjs/components/list/list.cjs +1 -0
  189. package/dist/cjs/components/list/list.cjs.map +1 -1
  190. package/dist/cjs/components/loading/audio.cjs.map +1 -1
  191. package/dist/cjs/components/loading/background.cjs +1 -0
  192. package/dist/cjs/components/loading/background.cjs.map +1 -1
  193. package/dist/cjs/components/loading/circles.cjs.map +1 -1
  194. package/dist/cjs/components/loading/dots.cjs.map +1 -1
  195. package/dist/cjs/components/loading/grid.cjs.map +1 -1
  196. package/dist/cjs/components/loading/loading-provider.cjs +1 -0
  197. package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
  198. package/dist/cjs/components/loading/oval.cjs.map +1 -1
  199. package/dist/cjs/components/loading/page.cjs +1 -0
  200. package/dist/cjs/components/loading/page.cjs.map +1 -1
  201. package/dist/cjs/components/loading/puff.cjs.map +1 -1
  202. package/dist/cjs/components/loading/rings.cjs.map +1 -1
  203. package/dist/cjs/components/loading/screen.cjs +1 -0
  204. package/dist/cjs/components/loading/screen.cjs.map +1 -1
  205. package/dist/cjs/components/loading/suspense.cjs +1 -0
  206. package/dist/cjs/components/loading/suspense.cjs.map +1 -1
  207. package/dist/cjs/components/loading/use-loading-component.cjs +1 -0
  208. package/dist/cjs/components/loading/use-loading-component.cjs.map +1 -1
  209. package/dist/cjs/components/menu/menu.cjs +13 -10
  210. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  211. package/dist/cjs/components/menu/use-menu.cjs +1 -0
  212. package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
  213. package/dist/cjs/components/modal/modal.cjs +1 -0
  214. package/dist/cjs/components/modal/modal.cjs.map +1 -1
  215. package/dist/cjs/components/modal/use-modal.cjs +1 -0
  216. package/dist/cjs/components/modal/use-modal.cjs.map +1 -1
  217. package/dist/cjs/components/motion/motion.cjs +1 -0
  218. package/dist/cjs/components/motion/motion.cjs.map +1 -1
  219. package/dist/cjs/components/motion/transition.cjs.map +1 -1
  220. package/dist/cjs/components/native-accordion/native-accordion.cjs +1 -0
  221. package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
  222. package/dist/cjs/components/native-accordion/use-native-accordion.cjs +1 -0
  223. package/dist/cjs/components/native-accordion/use-native-accordion.cjs.map +1 -1
  224. package/dist/cjs/components/native-popover/native-popover.cjs +1 -0
  225. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  226. package/dist/cjs/components/native-popover/use-native-popover.cjs +1 -0
  227. package/dist/cjs/components/native-popover/use-native-popover.cjs.map +1 -1
  228. package/dist/cjs/components/native-select/native-select.cjs +2 -1
  229. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  230. package/dist/cjs/components/native-select/use-native-select.cjs +1 -0
  231. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  232. package/dist/cjs/components/notice/notice-provider.cjs +1 -0
  233. package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
  234. package/dist/cjs/components/notice/notice.cjs +1 -0
  235. package/dist/cjs/components/notice/notice.cjs.map +1 -1
  236. package/dist/cjs/components/notice/use-notice.cjs +1 -0
  237. package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
  238. package/dist/cjs/components/number-input/number-input.cjs +2 -1
  239. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  240. package/dist/cjs/components/number-input/use-number-counter.cjs +1 -0
  241. package/dist/cjs/components/number-input/use-number-counter.cjs.map +1 -1
  242. package/dist/cjs/components/number-input/use-number-input.cjs +1 -0
  243. package/dist/cjs/components/number-input/use-number-input.cjs.map +1 -1
  244. package/dist/cjs/components/number-input/use-spinner.cjs +1 -0
  245. package/dist/cjs/components/number-input/use-spinner.cjs.map +1 -1
  246. package/dist/cjs/components/pagination/pagination.cjs +1 -0
  247. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  248. package/dist/cjs/components/pagination/use-pagination.cjs +1 -0
  249. package/dist/cjs/components/pagination/use-pagination.cjs.map +1 -1
  250. package/dist/cjs/components/password-input/password-input.cjs +2 -1
  251. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  252. package/dist/cjs/components/password-input/use-password-input.cjs +1 -0
  253. package/dist/cjs/components/password-input/use-password-input.cjs.map +1 -1
  254. package/dist/cjs/components/password-input/use-strength-meter.cjs +1 -0
  255. package/dist/cjs/components/password-input/use-strength-meter.cjs.map +1 -1
  256. package/dist/cjs/components/picture/picture.cjs +1 -0
  257. package/dist/cjs/components/picture/picture.cjs.map +1 -1
  258. package/dist/cjs/components/pin-input/pin-input.cjs +1 -0
  259. package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
  260. package/dist/cjs/components/pin-input/use-pin-input.cjs +1 -0
  261. package/dist/cjs/components/pin-input/use-pin-input.cjs.map +1 -1
  262. package/dist/cjs/components/popover/popover.cjs +1 -0
  263. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  264. package/dist/cjs/components/popover/use-popover.cjs +1 -0
  265. package/dist/cjs/components/popover/use-popover.cjs.map +1 -1
  266. package/dist/cjs/components/portal/portal.cjs +1 -0
  267. package/dist/cjs/components/portal/portal.cjs.map +1 -1
  268. package/dist/cjs/components/progress/progress.cjs.map +1 -1
  269. package/dist/cjs/components/progress/use-progress.cjs +1 -0
  270. package/dist/cjs/components/progress/use-progress.cjs.map +1 -1
  271. package/dist/cjs/components/qr-code/qr-code.cjs +1 -0
  272. package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
  273. package/dist/cjs/components/qr-code/use-qr-code.cjs +1 -0
  274. package/dist/cjs/components/qr-code/use-qr-code.cjs.map +1 -1
  275. package/dist/cjs/components/radio/radio-group.cjs +37 -34
  276. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  277. package/dist/cjs/components/radio/radio.cjs +1 -0
  278. package/dist/cjs/components/radio/radio.cjs.map +1 -1
  279. package/dist/cjs/components/radio/use-radio-group.cjs +1 -0
  280. package/dist/cjs/components/radio/use-radio-group.cjs.map +1 -1
  281. package/dist/cjs/components/radio/use-radio.cjs +3 -1
  282. package/dist/cjs/components/radio/use-radio.cjs.map +1 -1
  283. package/dist/cjs/components/radio-card/radio-card-group.cjs +41 -38
  284. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  285. package/dist/cjs/components/radio-card/radio-card.cjs +1 -0
  286. package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
  287. package/dist/cjs/components/rating/rating.cjs +1 -0
  288. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  289. package/dist/cjs/components/rating/use-rating.cjs +1 -0
  290. package/dist/cjs/components/rating/use-rating.cjs.map +1 -1
  291. package/dist/cjs/components/reorder/use-reorder.cjs +1 -0
  292. package/dist/cjs/components/reorder/use-reorder.cjs.map +1 -1
  293. package/dist/cjs/components/resizable/resizable.cjs +13 -10
  294. package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
  295. package/dist/cjs/components/resizable/use-resizable.cjs +1 -0
  296. package/dist/cjs/components/resizable/use-resizable.cjs.map +1 -1
  297. package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
  298. package/dist/cjs/components/ripple/use-ripple.cjs +1 -0
  299. package/dist/cjs/components/ripple/use-ripple.cjs.map +1 -1
  300. package/dist/cjs/components/rotate/rotate.cjs +1 -0
  301. package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
  302. package/dist/cjs/components/saturation-slider/saturation-slider.cjs +1 -0
  303. package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
  304. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs +1 -0
  305. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
  306. package/dist/cjs/components/scroll-area/use-scroll-area.cjs +1 -0
  307. package/dist/cjs/components/scroll-area/use-scroll-area.cjs.map +1 -1
  308. package/dist/cjs/components/segmented-control/segmented-control.cjs +3 -1
  309. package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
  310. package/dist/cjs/components/segmented-control/use-segmented-control.cjs +1 -0
  311. package/dist/cjs/components/segmented-control/use-segmented-control.cjs.map +1 -1
  312. package/dist/cjs/components/select/select.cjs +14 -10
  313. package/dist/cjs/components/select/select.cjs.map +1 -1
  314. package/dist/cjs/components/select/use-select.cjs +1 -0
  315. package/dist/cjs/components/select/use-select.cjs.map +1 -1
  316. package/dist/cjs/components/show/show.cjs +1 -0
  317. package/dist/cjs/components/show/show.cjs.map +1 -1
  318. package/dist/cjs/components/sidebar/sidebar.cjs +6 -3
  319. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  320. package/dist/cjs/components/sidebar/use-sidebar.cjs +1 -0
  321. package/dist/cjs/components/sidebar/use-sidebar.cjs.map +1 -1
  322. package/dist/cjs/components/simple-grid/simple-grid.cjs +1 -0
  323. package/dist/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
  324. package/dist/cjs/components/skeleton/skeleton.cjs.map +1 -1
  325. package/dist/cjs/components/slide/slide.cjs +1 -0
  326. package/dist/cjs/components/slide/slide.cjs.map +1 -1
  327. package/dist/cjs/components/slide-fade/slide-fade.cjs +1 -0
  328. package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
  329. package/dist/cjs/components/slider/slider.cjs +3 -1
  330. package/dist/cjs/components/slider/slider.cjs.map +1 -1
  331. package/dist/cjs/components/slider/use-slider.cjs +3 -1
  332. package/dist/cjs/components/slider/use-slider.cjs.map +1 -1
  333. package/dist/cjs/components/slot/slot.cjs +1 -0
  334. package/dist/cjs/components/slot/slot.cjs.map +1 -1
  335. package/dist/cjs/components/snacks/snacks.cjs +1 -0
  336. package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
  337. package/dist/cjs/components/snacks/use-snacks.cjs +1 -0
  338. package/dist/cjs/components/snacks/use-snacks.cjs.map +1 -1
  339. package/dist/cjs/components/stack/stack.cjs +1 -0
  340. package/dist/cjs/components/stack/stack.cjs.map +1 -1
  341. package/dist/cjs/components/stack/z-stack.cjs +5 -2
  342. package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
  343. package/dist/cjs/components/steps/steps.cjs +51 -47
  344. package/dist/cjs/components/steps/steps.cjs.map +1 -1
  345. package/dist/cjs/components/steps/use-steps.cjs +1 -0
  346. package/dist/cjs/components/steps/use-steps.cjs.map +1 -1
  347. package/dist/cjs/components/switch/switch.cjs.map +1 -1
  348. package/dist/cjs/components/switch/use-switch.cjs +1 -0
  349. package/dist/cjs/components/switch/use-switch.cjs.map +1 -1
  350. package/dist/cjs/components/table/table.cjs +51 -49
  351. package/dist/cjs/components/table/table.cjs.map +1 -1
  352. package/dist/cjs/components/tabs/tabs.cjs +23 -20
  353. package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
  354. package/dist/cjs/components/tabs/use-tabs.cjs +1 -0
  355. package/dist/cjs/components/tabs/use-tabs.cjs.map +1 -1
  356. package/dist/cjs/components/tag/tag.cjs +1 -0
  357. package/dist/cjs/components/tag/tag.cjs.map +1 -1
  358. package/dist/cjs/components/textarea/use-autosize.cjs +1 -0
  359. package/dist/cjs/components/textarea/use-autosize.cjs.map +1 -1
  360. package/dist/cjs/components/textarea/use-textarea.cjs +1 -0
  361. package/dist/cjs/components/textarea/use-textarea.cjs.map +1 -1
  362. package/dist/cjs/components/timeline/timeline.cjs +1 -0
  363. package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
  364. package/dist/cjs/components/tip/tip.cjs.map +1 -1
  365. package/dist/cjs/components/toggle/toggle-group.cjs +27 -24
  366. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  367. package/dist/cjs/components/toggle/use-toggle-group.cjs +1 -0
  368. package/dist/cjs/components/toggle/use-toggle-group.cjs.map +1 -1
  369. package/dist/cjs/components/toggle/use-toggle.cjs +1 -0
  370. package/dist/cjs/components/toggle/use-toggle.cjs.map +1 -1
  371. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  372. package/dist/cjs/components/tooltip/use-tooltip.cjs +1 -0
  373. package/dist/cjs/components/tooltip/use-tooltip.cjs.map +1 -1
  374. package/dist/cjs/components/tree/tree.cjs +1 -0
  375. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  376. package/dist/cjs/components/tree/use-tree.cjs +1 -0
  377. package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
  378. package/dist/cjs/core/components/create-component.cjs +5 -2
  379. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  380. package/dist/cjs/core/components/props.cjs.map +1 -1
  381. package/dist/cjs/core/components/use-component-style.cjs +11 -6
  382. package/dist/cjs/core/components/use-component-style.cjs.map +1 -1
  383. package/dist/cjs/core/components/utils.cjs.map +1 -1
  384. package/dist/cjs/core/css/animation.cjs.map +1 -1
  385. package/dist/cjs/core/css/at-rule.cjs.map +1 -1
  386. package/dist/cjs/core/css/calc.cjs.map +1 -1
  387. package/dist/cjs/core/css/color-mix.cjs.map +1 -1
  388. package/dist/cjs/core/css/color-scheme.cjs.map +1 -1
  389. package/dist/cjs/core/css/config.cjs.map +1 -1
  390. package/dist/cjs/core/css/css.cjs +5 -3
  391. package/dist/cjs/core/css/css.cjs.map +1 -1
  392. package/dist/cjs/core/css/gradient.cjs.map +1 -1
  393. package/dist/cjs/core/css/merge-css.cjs.map +1 -1
  394. package/dist/cjs/core/css/style.cjs.map +1 -1
  395. package/dist/cjs/core/css/use-css.cjs +1 -0
  396. package/dist/cjs/core/css/use-css.cjs.map +1 -1
  397. package/dist/cjs/core/css/use-inject-vars.cjs +1 -0
  398. package/dist/cjs/core/css/use-inject-vars.cjs.map +1 -1
  399. package/dist/cjs/core/css/utils.cjs.map +1 -1
  400. package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
  401. package/dist/cjs/core/system/color-mode-provider.cjs +1 -0
  402. package/dist/cjs/core/system/color-mode-provider.cjs.map +1 -1
  403. package/dist/cjs/core/system/create-system.cjs.map +1 -1
  404. package/dist/cjs/core/system/environment-provider.cjs +1 -0
  405. package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
  406. package/dist/cjs/core/system/layer.cjs.map +1 -1
  407. package/dist/cjs/core/system/storage-script.cjs.map +1 -1
  408. package/dist/cjs/core/system/styled.cjs.map +1 -1
  409. package/dist/cjs/core/system/system-provider.cjs +1 -0
  410. package/dist/cjs/core/system/system-provider.cjs.map +1 -1
  411. package/dist/cjs/core/system/theme-provider.cjs +5 -3
  412. package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
  413. package/dist/cjs/core/system/use-system-color-mode.cjs +1 -0
  414. package/dist/cjs/core/system/use-system-color-mode.cjs.map +1 -1
  415. package/dist/cjs/core/system/var.cjs +2 -1
  416. package/dist/cjs/core/system/var.cjs.map +1 -1
  417. package/dist/cjs/hooks/use-animation/index.cjs +4 -2
  418. package/dist/cjs/hooks/use-animation/index.cjs.map +1 -1
  419. package/dist/cjs/hooks/use-async/index.cjs +1 -0
  420. package/dist/cjs/hooks/use-async/index.cjs.map +1 -1
  421. package/dist/cjs/hooks/use-async-callback/index.cjs +1 -0
  422. package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
  423. package/dist/cjs/hooks/use-boolean/index.cjs +1 -0
  424. package/dist/cjs/hooks/use-boolean/index.cjs.map +1 -1
  425. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-effect.cjs +1 -0
  426. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-effect.cjs.map +1 -1
  427. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-state.cjs +3 -1
  428. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-state.cjs.map +1 -1
  429. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-value.cjs +1 -0
  430. package/dist/cjs/hooks/use-breakpoint/use-breakpoint-value.cjs.map +1 -1
  431. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs +1 -0
  432. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
  433. package/dist/cjs/hooks/use-clickable/index.cjs +1 -0
  434. package/dist/cjs/hooks/use-clickable/index.cjs.map +1 -1
  435. package/dist/cjs/hooks/use-clipboard/index.cjs.map +1 -1
  436. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  437. package/dist/cjs/hooks/use-controllable-state/index.cjs +1 -0
  438. package/dist/cjs/hooks/use-controllable-state/index.cjs.map +1 -1
  439. package/dist/cjs/hooks/use-counter/index.cjs +1 -0
  440. package/dist/cjs/hooks/use-counter/index.cjs.map +1 -1
  441. package/dist/cjs/hooks/use-descendants/index.cjs +1 -0
  442. package/dist/cjs/hooks/use-descendants/index.cjs.map +1 -1
  443. package/dist/cjs/hooks/use-disclosure/use-disclosure.cjs +1 -0
  444. package/dist/cjs/hooks/use-disclosure/use-disclosure.cjs.map +1 -1
  445. package/dist/cjs/hooks/use-disclosure/use-promise-disclosure.cjs +1 -0
  446. package/dist/cjs/hooks/use-disclosure/use-promise-disclosure.cjs.map +1 -1
  447. package/dist/cjs/hooks/use-event-listener/index.cjs +1 -0
  448. package/dist/cjs/hooks/use-event-listener/index.cjs.map +1 -1
  449. package/dist/cjs/hooks/use-eye-dropper/index.cjs +1 -0
  450. package/dist/cjs/hooks/use-eye-dropper/index.cjs.map +1 -1
  451. package/dist/cjs/hooks/use-field-sizing/index.cjs +1 -0
  452. package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
  453. package/dist/cjs/hooks/use-focus/index.cjs +3 -1
  454. package/dist/cjs/hooks/use-focus/index.cjs.map +1 -1
  455. package/dist/cjs/hooks/use-hover/index.cjs +1 -0
  456. package/dist/cjs/hooks/use-hover/index.cjs.map +1 -1
  457. package/dist/cjs/hooks/use-idle/index.cjs +1 -0
  458. package/dist/cjs/hooks/use-idle/index.cjs.map +1 -1
  459. package/dist/cjs/hooks/use-interval/index.cjs +1 -0
  460. package/dist/cjs/hooks/use-interval/index.cjs.map +1 -1
  461. package/dist/cjs/hooks/use-lazy-mount/index.cjs +1 -0
  462. package/dist/cjs/hooks/use-lazy-mount/index.cjs.map +1 -1
  463. package/dist/cjs/hooks/use-local-storage/index.cjs +1 -0
  464. package/dist/cjs/hooks/use-local-storage/index.cjs.map +1 -1
  465. package/dist/cjs/hooks/use-media-query/index.cjs +1 -0
  466. package/dist/cjs/hooks/use-media-query/index.cjs.map +1 -1
  467. package/dist/cjs/hooks/use-mounted/index.cjs +1 -0
  468. package/dist/cjs/hooks/use-mounted/index.cjs.map +1 -1
  469. package/dist/cjs/hooks/use-online/index.cjs +1 -0
  470. package/dist/cjs/hooks/use-online/index.cjs.map +1 -1
  471. package/dist/cjs/hooks/use-os/index.cjs.map +1 -1
  472. package/dist/cjs/hooks/use-outside-click/index.cjs +1 -0
  473. package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
  474. package/dist/cjs/hooks/use-pan-event/index.cjs +1 -0
  475. package/dist/cjs/hooks/use-pan-event/index.cjs.map +1 -1
  476. package/dist/cjs/hooks/use-popper/index.cjs +1 -0
  477. package/dist/cjs/hooks/use-popper/index.cjs.map +1 -1
  478. package/dist/cjs/hooks/use-previous/index.cjs +1 -0
  479. package/dist/cjs/hooks/use-previous/index.cjs.map +1 -1
  480. package/dist/cjs/hooks/use-processing/index.cjs +1 -0
  481. package/dist/cjs/hooks/use-processing/index.cjs.map +1 -1
  482. package/dist/cjs/hooks/use-resize-observer/index.cjs +1 -0
  483. package/dist/cjs/hooks/use-resize-observer/index.cjs.map +1 -1
  484. package/dist/cjs/hooks/use-timeout/index.cjs +1 -0
  485. package/dist/cjs/hooks/use-timeout/index.cjs.map +1 -1
  486. package/dist/cjs/hooks/use-value/index.cjs +1 -0
  487. package/dist/cjs/hooks/use-value/index.cjs.map +1 -1
  488. package/dist/cjs/hooks/use-window-event/index.cjs +1 -0
  489. package/dist/cjs/hooks/use-window-event/index.cjs.map +1 -1
  490. package/dist/cjs/index.cjs +30 -6
  491. package/dist/cjs/providers/i18n-provider/i18n-provider.cjs.map +1 -1
  492. package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
  493. package/dist/cjs/utils/children.cjs.map +1 -1
  494. package/dist/cjs/utils/context.cjs.map +1 -1
  495. package/dist/cjs/utils/dom.cjs.map +1 -1
  496. package/dist/cjs/utils/ref.cjs.map +1 -1
  497. package/dist/cjs/utils/ssr.cjs +1 -0
  498. package/dist/cjs/utils/ssr.cjs.map +1 -1
  499. package/dist/cjs/utils/store.cjs +1 -0
  500. package/dist/cjs/utils/store.cjs.map +1 -1
  501. package/dist/esm/components/accordion/accordion.js +3 -2
  502. package/dist/esm/components/accordion/accordion.js.map +1 -1
  503. package/dist/esm/components/accordion/use-accordion.js.map +1 -1
  504. package/dist/esm/components/action-bar/action-bar.js.map +1 -1
  505. package/dist/esm/components/action-bar/use-action-bar.js.map +1 -1
  506. package/dist/esm/components/airy/airy.js.map +1 -1
  507. package/dist/esm/components/alert/alert.js +4 -2
  508. package/dist/esm/components/alert/alert.js.map +1 -1
  509. package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
  510. package/dist/esm/components/aspect-ratio/aspect-ratio.js.map +1 -1
  511. package/dist/esm/components/autocomplete/autocomplete.js +13 -10
  512. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  513. package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
  514. package/dist/esm/components/avatar/avatar-group.js +12 -11
  515. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  516. package/dist/esm/components/avatar/use-avatar-group.js.map +1 -1
  517. package/dist/esm/components/avatar/use-avatar.js.map +1 -1
  518. package/dist/esm/components/breadcrumb/use-breadcrumb.js.map +1 -1
  519. package/dist/esm/components/button/button.js +8 -5
  520. package/dist/esm/components/button/button.js.map +1 -1
  521. package/dist/esm/components/calendar/calendar.js.map +1 -1
  522. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  523. package/dist/esm/components/carousel/carousel.js +26 -25
  524. package/dist/esm/components/carousel/carousel.js.map +1 -1
  525. package/dist/esm/components/carousel/use-carousel.js.map +1 -1
  526. package/dist/esm/components/chart/area-chart.js +5 -4
  527. package/dist/esm/components/chart/area-chart.js.map +1 -1
  528. package/dist/esm/components/chart/bar-chart.js +5 -4
  529. package/dist/esm/components/chart/bar-chart.js.map +1 -1
  530. package/dist/esm/components/chart/cartesian-chart.js +145 -139
  531. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  532. package/dist/esm/components/chart/chart.js +2 -1
  533. package/dist/esm/components/chart/chart.js.map +1 -1
  534. package/dist/esm/components/chart/composed-chart.js +15 -14
  535. package/dist/esm/components/chart/composed-chart.js.map +1 -1
  536. package/dist/esm/components/chart/donut-chart.js +7 -5
  537. package/dist/esm/components/chart/donut-chart.js.map +1 -1
  538. package/dist/esm/components/chart/line-chart.js +5 -4
  539. package/dist/esm/components/chart/line-chart.js.map +1 -1
  540. package/dist/esm/components/chart/pie-chart.js +7 -5
  541. package/dist/esm/components/chart/pie-chart.js.map +1 -1
  542. package/dist/esm/components/chart/polar-chart.js +118 -111
  543. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  544. package/dist/esm/components/chart/radar-chart.js +5 -4
  545. package/dist/esm/components/chart/radar-chart.js.map +1 -1
  546. package/dist/esm/components/chart/use-cartesian-chart.js.map +1 -1
  547. package/dist/esm/components/chart/use-chart.js.map +1 -1
  548. package/dist/esm/components/chart/use-polar-chart.js.map +1 -1
  549. package/dist/esm/components/checkbox/checkbox-group.js +38 -36
  550. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  551. package/dist/esm/components/checkbox/use-checkbox-group.js.map +1 -1
  552. package/dist/esm/components/checkbox/use-checkbox.js +2 -1
  553. package/dist/esm/components/checkbox/use-checkbox.js.map +1 -1
  554. package/dist/esm/components/checkbox-card/checkbox-card-group.js +42 -40
  555. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  556. package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
  557. package/dist/esm/components/client-only/client-only.js +2 -1
  558. package/dist/esm/components/client-only/client-only.js.map +1 -1
  559. package/dist/esm/components/collapse/collapse.js.map +1 -1
  560. package/dist/esm/components/color-picker/color-picker.js +2 -1
  561. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  562. package/dist/esm/components/color-picker/use-color-picker.js.map +1 -1
  563. package/dist/esm/components/color-selector/color-selector.js +2 -1
  564. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  565. package/dist/esm/components/color-selector/use-color-selector.js.map +1 -1
  566. package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
  567. package/dist/esm/components/data-list/data-list.js +8 -5
  568. package/dist/esm/components/data-list/data-list.js.map +1 -1
  569. package/dist/esm/components/date-picker/date-picker.js +2 -1
  570. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  571. package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
  572. package/dist/esm/components/drawer/drawer.js.map +1 -1
  573. package/dist/esm/components/drawer/use-drawer.js +1 -3
  574. package/dist/esm/components/drawer/use-drawer.js.map +1 -1
  575. package/dist/esm/components/dropzone/dropzone.js +2 -1
  576. package/dist/esm/components/dropzone/dropzone.js.map +1 -1
  577. package/dist/esm/components/dropzone/use-dropzone.js.map +1 -1
  578. package/dist/esm/components/editable/editable.js.map +1 -1
  579. package/dist/esm/components/editable/use-editable.js.map +1 -1
  580. package/dist/esm/components/field/field.js.map +1 -1
  581. package/dist/esm/components/field/use-field-props.js.map +1 -1
  582. package/dist/esm/components/fieldset/fieldset.js.map +1 -1
  583. package/dist/esm/components/file-input/file-input.js +2 -1
  584. package/dist/esm/components/file-input/file-input.js.map +1 -1
  585. package/dist/esm/components/file-input/use-file-input.js.map +1 -1
  586. package/dist/esm/components/flip/flip.js.map +1 -1
  587. package/dist/esm/components/float/float.js.map +1 -1
  588. package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
  589. package/dist/esm/components/for/for.js.map +1 -1
  590. package/dist/esm/components/form/form.js.map +1 -1
  591. package/dist/esm/components/grid/grid-item.js.map +1 -1
  592. package/dist/esm/components/group/group.js.map +1 -1
  593. package/dist/esm/components/group/use-group.js.map +1 -1
  594. package/dist/esm/components/highlight/use-highlight.js.map +1 -1
  595. package/dist/esm/components/icon/icons/index.js +21 -5
  596. package/dist/esm/components/icon/icons/index.js.map +1 -1
  597. package/dist/esm/components/icon/icons/layout-freeform-icon.js +14 -0
  598. package/dist/esm/components/icon/icons/layout-freeform-icon.js.map +1 -0
  599. package/dist/esm/components/icon/icons/mic-audio-lines-icon.js +14 -0
  600. package/dist/esm/components/icon/icons/mic-audio-lines-icon.js.map +1 -0
  601. package/dist/esm/components/icon/icons/mic-signal-icon.js +14 -0
  602. package/dist/esm/components/icon/icons/mic-signal-icon.js.map +1 -0
  603. package/dist/esm/components/icon/icons/mosque-icon.js +14 -0
  604. package/dist/esm/components/icon/icons/mosque-icon.js.map +1 -0
  605. package/dist/esm/components/icon/icons/rotate-ccw-clock-icon.js +14 -0
  606. package/dist/esm/components/icon/icons/rotate-ccw-clock-icon.js.map +1 -0
  607. package/dist/esm/components/icon/icons/rotate-cw-fading-clock-icon.js +14 -0
  608. package/dist/esm/components/icon/icons/rotate-cw-fading-clock-icon.js.map +1 -0
  609. package/dist/esm/components/icon/icons/scan-square-icon.js +14 -0
  610. package/dist/esm/components/icon/icons/scan-square-icon.js.map +1 -0
  611. package/dist/esm/components/icon/icons/shield-keyhole-icon.js +14 -0
  612. package/dist/esm/components/icon/icons/shield-keyhole-icon.js.map +1 -0
  613. package/dist/esm/components/icon/icons/square-off-icon.js +14 -0
  614. package/dist/esm/components/icon/icons/square-off-icon.js.map +1 -0
  615. package/dist/esm/components/icon/icons/user-shield-icon.js +14 -0
  616. package/dist/esm/components/icon/icons/user-shield-icon.js.map +1 -0
  617. package/dist/esm/components/icon/index.js +11 -3
  618. package/dist/esm/components/indicator/indicator.js.map +1 -1
  619. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js +2 -1
  620. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
  621. package/dist/esm/components/input/input-group.js +13 -12
  622. package/dist/esm/components/input/input-group.js.map +1 -1
  623. package/dist/esm/components/input/input.style.js.map +1 -1
  624. package/dist/esm/components/link-box/link-box.js.map +1 -1
  625. package/dist/esm/components/loading/audio.js.map +1 -1
  626. package/dist/esm/components/loading/circles.js.map +1 -1
  627. package/dist/esm/components/loading/dots.js.map +1 -1
  628. package/dist/esm/components/loading/grid.js.map +1 -1
  629. package/dist/esm/components/loading/loading-provider.js.map +1 -1
  630. package/dist/esm/components/loading/oval.js.map +1 -1
  631. package/dist/esm/components/loading/puff.js.map +1 -1
  632. package/dist/esm/components/loading/rings.js.map +1 -1
  633. package/dist/esm/components/loading/use-loading-component.js.map +1 -1
  634. package/dist/esm/components/menu/menu.js +12 -10
  635. package/dist/esm/components/menu/menu.js.map +1 -1
  636. package/dist/esm/components/menu/use-menu.js.map +1 -1
  637. package/dist/esm/components/modal/modal.js.map +1 -1
  638. package/dist/esm/components/modal/use-modal.js.map +1 -1
  639. package/dist/esm/components/motion/motion.js.map +1 -1
  640. package/dist/esm/components/motion/transition.js.map +1 -1
  641. package/dist/esm/components/native-accordion/use-native-accordion.js.map +1 -1
  642. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  643. package/dist/esm/components/native-popover/use-native-popover.js.map +1 -1
  644. package/dist/esm/components/native-select/native-select.js +2 -1
  645. package/dist/esm/components/native-select/native-select.js.map +1 -1
  646. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  647. package/dist/esm/components/notice/notice.js.map +1 -1
  648. package/dist/esm/components/notice/use-notice.js.map +1 -1
  649. package/dist/esm/components/number-input/number-input.js +2 -1
  650. package/dist/esm/components/number-input/number-input.js.map +1 -1
  651. package/dist/esm/components/number-input/use-number-counter.js.map +1 -1
  652. package/dist/esm/components/number-input/use-number-input.js.map +1 -1
  653. package/dist/esm/components/pagination/pagination.js.map +1 -1
  654. package/dist/esm/components/pagination/use-pagination.js.map +1 -1
  655. package/dist/esm/components/password-input/password-input.js +2 -1
  656. package/dist/esm/components/password-input/password-input.js.map +1 -1
  657. package/dist/esm/components/password-input/use-password-input.js.map +1 -1
  658. package/dist/esm/components/password-input/use-strength-meter.js.map +1 -1
  659. package/dist/esm/components/picture/picture.js.map +1 -1
  660. package/dist/esm/components/pin-input/use-pin-input.js.map +1 -1
  661. package/dist/esm/components/popover/popover.js.map +1 -1
  662. package/dist/esm/components/popover/use-popover.js.map +1 -1
  663. package/dist/esm/components/portal/portal.js.map +1 -1
  664. package/dist/esm/components/progress/progress.js.map +1 -1
  665. package/dist/esm/components/progress/use-progress.js.map +1 -1
  666. package/dist/esm/components/radio/radio-group.js +36 -34
  667. package/dist/esm/components/radio/radio-group.js.map +1 -1
  668. package/dist/esm/components/radio/use-radio-group.js.map +1 -1
  669. package/dist/esm/components/radio/use-radio.js +2 -1
  670. package/dist/esm/components/radio/use-radio.js.map +1 -1
  671. package/dist/esm/components/radio-card/radio-card-group.js +40 -38
  672. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  673. package/dist/esm/components/rating/rating.js.map +1 -1
  674. package/dist/esm/components/rating/use-rating.js.map +1 -1
  675. package/dist/esm/components/reorder/use-reorder.js.map +1 -1
  676. package/dist/esm/components/resizable/resizable.js +12 -10
  677. package/dist/esm/components/resizable/resizable.js.map +1 -1
  678. package/dist/esm/components/resizable/use-resizable.js.map +1 -1
  679. package/dist/esm/components/ripple/ripple.js.map +1 -1
  680. package/dist/esm/components/ripple/use-ripple.js.map +1 -1
  681. package/dist/esm/components/rotate/rotate.js.map +1 -1
  682. package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
  683. package/dist/esm/components/scroll-area/use-scroll-area.js.map +1 -1
  684. package/dist/esm/components/segmented-control/segmented-control.js +2 -1
  685. package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
  686. package/dist/esm/components/segmented-control/use-segmented-control.js.map +1 -1
  687. package/dist/esm/components/select/select.js +13 -10
  688. package/dist/esm/components/select/select.js.map +1 -1
  689. package/dist/esm/components/select/use-select.js.map +1 -1
  690. package/dist/esm/components/show/show.js.map +1 -1
  691. package/dist/esm/components/sidebar/sidebar.js +5 -3
  692. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  693. package/dist/esm/components/sidebar/use-sidebar.js.map +1 -1
  694. package/dist/esm/components/simple-grid/simple-grid.js.map +1 -1
  695. package/dist/esm/components/skeleton/skeleton.js.map +1 -1
  696. package/dist/esm/components/slider/slider.js +2 -1
  697. package/dist/esm/components/slider/slider.js.map +1 -1
  698. package/dist/esm/components/slider/use-slider.js +2 -1
  699. package/dist/esm/components/slider/use-slider.js.map +1 -1
  700. package/dist/esm/components/snacks/snacks.js.map +1 -1
  701. package/dist/esm/components/stack/stack.js.map +1 -1
  702. package/dist/esm/components/stack/z-stack.js +4 -2
  703. package/dist/esm/components/stack/z-stack.js.map +1 -1
  704. package/dist/esm/components/steps/steps.js +50 -47
  705. package/dist/esm/components/steps/steps.js.map +1 -1
  706. package/dist/esm/components/steps/use-steps.js.map +1 -1
  707. package/dist/esm/components/switch/switch.js.map +1 -1
  708. package/dist/esm/components/switch/use-switch.js.map +1 -1
  709. package/dist/esm/components/table/table.js +50 -49
  710. package/dist/esm/components/table/table.js.map +1 -1
  711. package/dist/esm/components/tabs/tabs.js +22 -20
  712. package/dist/esm/components/tabs/tabs.js.map +1 -1
  713. package/dist/esm/components/tabs/use-tabs.js.map +1 -1
  714. package/dist/esm/components/tag/tag.js.map +1 -1
  715. package/dist/esm/components/textarea/use-autosize.js.map +1 -1
  716. package/dist/esm/components/timeline/timeline.js.map +1 -1
  717. package/dist/esm/components/tip/tip.js.map +1 -1
  718. package/dist/esm/components/toggle/toggle-group.js +26 -24
  719. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  720. package/dist/esm/components/toggle/use-toggle-group.js.map +1 -1
  721. package/dist/esm/components/toggle/use-toggle.js.map +1 -1
  722. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  723. package/dist/esm/components/tooltip/use-tooltip.js.map +1 -1
  724. package/dist/esm/components/tree/tree.js.map +1 -1
  725. package/dist/esm/components/tree/use-tree.js.map +1 -1
  726. package/dist/esm/core/components/create-component.js +4 -2
  727. package/dist/esm/core/components/create-component.js.map +1 -1
  728. package/dist/esm/core/components/props.js.map +1 -1
  729. package/dist/esm/core/components/use-component-style.js +10 -6
  730. package/dist/esm/core/components/use-component-style.js.map +1 -1
  731. package/dist/esm/core/components/utils.js.map +1 -1
  732. package/dist/esm/core/css/animation.js.map +1 -1
  733. package/dist/esm/core/css/at-rule.js.map +1 -1
  734. package/dist/esm/core/css/calc.js.map +1 -1
  735. package/dist/esm/core/css/color-mix.js.map +1 -1
  736. package/dist/esm/core/css/color-scheme.js.map +1 -1
  737. package/dist/esm/core/css/config.js.map +1 -1
  738. package/dist/esm/core/css/css.js +5 -3
  739. package/dist/esm/core/css/css.js.map +1 -1
  740. package/dist/esm/core/css/gradient.js.map +1 -1
  741. package/dist/esm/core/css/merge-css.js.map +1 -1
  742. package/dist/esm/core/css/style.js.map +1 -1
  743. package/dist/esm/core/css/use-css.js.map +1 -1
  744. package/dist/esm/core/css/utils.js.map +1 -1
  745. package/dist/esm/core/system/breakpoint.js.map +1 -1
  746. package/dist/esm/core/system/color-mode-provider.js.map +1 -1
  747. package/dist/esm/core/system/create-system.js.map +1 -1
  748. package/dist/esm/core/system/environment-provider.js.map +1 -1
  749. package/dist/esm/core/system/layer.js.map +1 -1
  750. package/dist/esm/core/system/storage-script.js.map +1 -1
  751. package/dist/esm/core/system/styled.js.map +1 -1
  752. package/dist/esm/core/system/theme-provider.js +4 -3
  753. package/dist/esm/core/system/theme-provider.js.map +1 -1
  754. package/dist/esm/core/system/use-system-color-mode.js.map +1 -1
  755. package/dist/esm/core/system/var.js +2 -1
  756. package/dist/esm/core/system/var.js.map +1 -1
  757. package/dist/esm/hooks/use-animation/index.js +3 -2
  758. package/dist/esm/hooks/use-animation/index.js.map +1 -1
  759. package/dist/esm/hooks/use-breakpoint/use-breakpoint-state.js +2 -1
  760. package/dist/esm/hooks/use-breakpoint/use-breakpoint-state.js.map +1 -1
  761. package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
  762. package/dist/esm/hooks/use-clickable/index.js.map +1 -1
  763. package/dist/esm/hooks/use-clipboard/index.js.map +1 -1
  764. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  765. package/dist/esm/hooks/use-controllable-state/index.js.map +1 -1
  766. package/dist/esm/hooks/use-counter/index.js.map +1 -1
  767. package/dist/esm/hooks/use-descendants/index.js.map +1 -1
  768. package/dist/esm/hooks/use-event-listener/index.js.map +1 -1
  769. package/dist/esm/hooks/use-focus/index.js +2 -1
  770. package/dist/esm/hooks/use-focus/index.js.map +1 -1
  771. package/dist/esm/hooks/use-local-storage/index.js.map +1 -1
  772. package/dist/esm/hooks/use-os/index.js.map +1 -1
  773. package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
  774. package/dist/esm/hooks/use-pan-event/index.js.map +1 -1
  775. package/dist/esm/hooks/use-resize-observer/index.js.map +1 -1
  776. package/dist/esm/hooks/use-value/index.js.map +1 -1
  777. package/dist/esm/index.js +21 -5
  778. package/dist/esm/providers/i18n-provider/i18n-provider.js.map +1 -1
  779. package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
  780. package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
  781. package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
  782. package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
  783. package/dist/types/components/drawer/drawer.style.d.ts +2 -2
  784. package/dist/types/components/file-input/file-input.style.d.ts +1 -1
  785. package/dist/types/components/icon/icons/index.d.ts +12 -4
  786. package/dist/types/components/icon/icons/index.types.d.ts +1 -1
  787. package/dist/types/components/icon/icons/layout-freeform-icon.d.ts +13 -0
  788. package/dist/types/components/icon/icons/mic-audio-lines-icon.d.ts +13 -0
  789. package/dist/types/components/icon/icons/mic-signal-icon.d.ts +13 -0
  790. package/dist/types/components/icon/icons/mosque-icon.d.ts +13 -0
  791. package/dist/types/components/icon/icons/rotate-ccw-clock-icon.d.ts +13 -0
  792. package/dist/types/components/icon/icons/rotate-cw-fading-clock-icon.d.ts +13 -0
  793. package/dist/types/components/icon/icons/scan-square-icon.d.ts +13 -0
  794. package/dist/types/components/icon/icons/shield-keyhole-icon.d.ts +13 -0
  795. package/dist/types/components/icon/icons/{history-icon.d.ts → square-off-icon.d.ts} +5 -5
  796. package/dist/types/components/icon/icons/user-shield-icon.d.ts +13 -0
  797. package/dist/types/components/icon/index.d.ts +11 -3
  798. package/dist/types/components/modal/modal.style.d.ts +2 -2
  799. package/dist/types/components/notice/notice.style.d.ts +1 -1
  800. package/dist/types/components/tag/tag.style.d.ts +1 -1
  801. package/dist/types/index.d.ts +12 -4
  802. package/package.json +9 -9
  803. package/dist/cjs/components/icon/icons/history-icon.cjs +0 -14
  804. package/dist/cjs/components/icon/icons/history-icon.cjs.map +0 -1
  805. package/dist/cjs/components/icon/icons/podcast-icon.cjs +0 -14
  806. package/dist/cjs/components/icon/icons/podcast-icon.cjs.map +0 -1
  807. package/dist/esm/components/icon/icons/history-icon.js +0 -14
  808. package/dist/esm/components/icon/icons/history-icon.js.map +0 -1
  809. package/dist/esm/components/icon/icons/podcast-icon.js +0 -14
  810. package/dist/esm/components/icon/icons/podcast-icon.js.map +0 -1
  811. package/dist/types/components/icon/icons/podcast-icon.d.ts +0 -13
@@ -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;EAC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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
+ {"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","useMemo","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,GAAkBC,MAAAA,QAAAA,QACf;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,GAAmBA,MAAAA,QAAAA,QAChB;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,GAAA,kBAAA,IAAA,CAACC,qBAAAA,4BAAD;EAA4B,OAAO;EACjC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,iBAAD;GAAiB,OAAO;GACtB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;KAAY,GAAI,aAAa;KAC1B,UAAA,YACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,oBAAD,CAAqB,CAAA,GACrB,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,CAAgB,CAAA,CAChB,EAAA,CAAA;IAEM,CAAA;GACI,CAAA;EACH,CAAA;CACS,CAAA;AAEhC,GACA,MACF,CAAC,CAAC;AAQF,MAAa,qBAAqB,YAChC,OACA,CAAC,OAAO,YAAY,CACtB,CAAC,CAAC,KAAA,IAAY,EAAE,UAAU,GAAG,WAAW;CACtC,MAAM,EAAE,oBAAoB,oBAAoB,oBA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AAO,YAClB,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;IAEQ,GAAG;IAAU;IAElB,WAAA,GAAA,oBAAA,cAAA,QAAA,CAAQ,SAAS,EAAE,MAAM,CAAC,KACzB,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,OAAO,MAAR,EAAA,UAAc,MAAmB,CAAA;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,MA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A,MAAA,QAAA,CAAoB,KAAK,CAAC,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,oBAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAKE,YAAAA,UAAU,SAAS,UAAU,OAAO,QAAQ;IACjD;IACA;IACA,UAAU,OAAO,GAAG,eAAe;IACnC;GACF,CACF,CAAC,CAAC;EACJ,GACA;GACE;GACA;GACA;GACA;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","useCallback","useRef","useControllableState","useMemo","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,GAEA,MAAA,QAAA,CAAM,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,GAEA,MAAA,QAAA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,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAKE,YAAAA,UAAU,SAAS,UAAU,OAAO,QAAQ;IACjD;IACA;IACA,UAAU,OAAO,GAAG,eAAe;IACnC;GACF,CACF,CAAC,CAAC;EACJ,GACA;GACE;GACA;GACA;GACA;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,4 +1,5 @@
1
1
  "use client";
2
+ require("../../_virtual/_rolldown/runtime.cjs");
2
3
  const require_utils_index = require("../../utils/index.cjs");
3
4
  const require_var = require("../../core/system/var.cjs");
4
5
  const require_factory = require("../../core/system/factory.cjs");
@@ -20,32 +21,33 @@ const { ComponentContext, PropsContext: CarouselPropsContext, useComponentContex
20
21
  const CarouselRoot = withProvider(({ includeGapInSize = true, ...rest }) => {
21
22
  const { carousel, index, setIndex, snapCount, total, getIndicatorProps, getIndicatorsProps, getItemProps, getListProps, getNextTriggerProps, getPrevTriggerProps, getRootProps } = require_use_carousel.useCarousel(rest);
22
23
  const componentContext = (0, react.useMemo)(() => ({ includeGapInSize }), [includeGapInSize]);
24
+ const carouselContext = (0, react.useMemo)(() => ({
25
+ carousel,
26
+ index,
27
+ setIndex,
28
+ snapCount,
29
+ total,
30
+ getIndicatorProps,
31
+ getIndicatorsProps,
32
+ getItemProps,
33
+ getListProps,
34
+ getNextTriggerProps,
35
+ getPrevTriggerProps
36
+ }), [
37
+ carousel,
38
+ total,
39
+ index,
40
+ setIndex,
41
+ snapCount,
42
+ getIndicatorProps,
43
+ getIndicatorsProps,
44
+ getItemProps,
45
+ getListProps,
46
+ getNextTriggerProps,
47
+ getPrevTriggerProps
48
+ ]);
23
49
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_carousel.CarouselContext, {
24
- value: (0, react.useMemo)(() => ({
25
- carousel,
26
- index,
27
- setIndex,
28
- snapCount,
29
- total,
30
- getIndicatorProps,
31
- getIndicatorsProps,
32
- getItemProps,
33
- getListProps,
34
- getNextTriggerProps,
35
- getPrevTriggerProps
36
- }), [
37
- carousel,
38
- total,
39
- index,
40
- setIndex,
41
- snapCount,
42
- getIndicatorProps,
43
- getIndicatorsProps,
44
- getItemProps,
45
- getListProps,
46
- getNextTriggerProps,
47
- getPrevTriggerProps
48
- ]),
50
+ value: carouselContext,
49
51
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentContext, {
50
52
  value: componentContext,
51
53
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.section, { ...getRootProps() })
@@ -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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EAAE,sBAAsBA,qBAAAA,mBAAmB;CAEjD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
1
+ {"version":3,"file":"carousel.cjs","names":["createSlotComponent","carouselStyle","useCarousel","useMemo","CarouselContext","styled","varAttr","useCarouselContext","IconButton","ChevronLeftIcon","ChevronRightIcon","isValidElement","cloneElement"],"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,GAAmBC,MAAAA,QAAAA,QAChB,EAAE,iBAAiB,IAC1B,CAAC,gBAAgB,CACnB;CACA,MAAM,mBAAA,GAAkBA,MAAAA,QAAAA,QACf;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,iBAAD;EAAiB,OAAO;EACtB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;GAAkB,OAAO;GACvB,UAAA,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,o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BAAAA,mBAAmB;CAmBvB,OAAO;EACL,WAAA,GAnBuBJ,MAAAA,QAAAA,OAAc;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,GAAIQ,MAAAA,eAAAA,CAAoC,SAAS,GAC/C,QAAA,GAAOC,MAAAA,aAAAA,CAAa,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,sBAAsBL,qBAAAA,mBAAmB;CAEjD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-carousel.cjs","names":["createContext","useI18n","useControllableState","useIds","useBoolean","mergeProps","mergeRefs"],"sources":["../../../../src/components/carousel/use-carousel.ts"],"sourcesContent":["\"use client\"\n\nimport type {\n EmblaCarouselType,\n EmblaOptionsType,\n EmblaPluginType,\n} from \"embla-carousel\"\nimport type { KeyboardEvent, RefObject } from \"react\"\nimport useEmblaCarousel from \"embla-carousel-react\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport {\n type HTMLProps,\n mergeProps,\n type Orientation,\n type PropGetter,\n type RequiredPropGetter,\n} from \"../../core\"\nimport { useBoolean } from \"../../hooks/use-boolean\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n assignRef,\n createContext,\n dataAttr,\n handlerAll,\n isFunction,\n mergeRefs,\n runKeyAction,\n useIds,\n useUpdateEffect,\n} from \"../../utils\"\n\ntype EmblaOptions = Required<EmblaOptionsType>\nexport type CarouselAlign = EmblaOptions[\"align\"]\nexport type CarouselContainScroll = EmblaOptions[\"containScroll\"]\nexport type CarouselInViewThreshold = EmblaOptions[\"inViewThreshold\"]\nexport type CarouselWatchDrag = EmblaOptions[\"watchDrag\"]\nexport type CarouselWatchResize = EmblaOptions[\"watchResize\"]\nexport type CarouselWatchSlides = EmblaOptions[\"watchSlides\"]\nexport type CarouselControl = EmblaCarouselType\nexport type CarouselPlugin = EmblaPluginType\n\nexport interface CarouselContext extends Omit<\n UseCarouselReturn,\n \"getRootProps\"\n> {}\n\nconst [CarouselContext, useCarouselContext] = createContext<CarouselContext>({\n name: \"CarouselContext\",\n})\n\nexport { CarouselContext, useCarouselContext }\n\nexport interface UseCarouselProps extends Omit<\n HTMLProps<\"section\">,\n \"onChange\"\n> {\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 * Ref of the resizable item callback.\n */\n controlRef?: RefObject<CarouselControl | null>\n /**\n * The initial index of the carousel slide.\n *\n * @default 0\n */\n defaultIndex?: number\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 * The index of the carousel slide.\n */\n index?: number\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 * Embla plugins to use.\n */\n plugins?: CarouselPlugin[]\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 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 * Enables for scrolling the carousel with mouse and touch interactions.\n * Set this to `false` to disable drag events or pass a custom callback to add your own drag logic.\n *\n * @default true\n */\n watchDrag?: CarouselWatchDrag\n /**\n * Embla automatically watches the container and slides for size changes and runs `reInit` when any size has changed.\n * Set this to `false` to disable this behaviour or pass a custom callback to add your own resize logic.\n *\n * @default true\n */\n watchResize?: CarouselWatchResize\n /**\n * Embla automatically watches the container for added and/or removed slides and runs `reInit` if needed.\n * Set this to `false` to disable this behaviour or pass a custom callback to add your own slides changed logic.\n *\n * @default true\n */\n watchSlides?: CarouselWatchSlides\n /**\n * The callback invoked when carousel slide selected.\n */\n onChange?: (index: number) => void\n /**\n * A callback that return the current scroll amount when the carousel is scrolled.\n */\n onScrollProgress?: (progress: number) => void\n}\n\nexport const useCarousel = ({\n id,\n align = \"center\",\n autoplay = false,\n containScroll = false,\n controlRef,\n defaultIndex = 0,\n delay = 4000,\n dragFree = false,\n draggable = true,\n duration = 25,\n index: indexProp,\n inViewThreshold = 0,\n loop = true,\n orientation = \"horizontal\",\n plugins = [],\n skipSnaps = false,\n slidesToScroll = 1,\n stopMouseEnterAutoplay = true,\n watchDrag = draggable,\n watchResize: watchResizeProp = true,\n watchSlides = true,\n onChange,\n onScrollProgress,\n ...rest\n}: UseCarouselProps = {}) => {\n const { t } = useI18n(\"carousel\")\n const [index, setIndex] = useControllableState({\n defaultValue: defaultIndex,\n value: indexProp,\n onChange,\n })\n const [rootId, listId] = useIds()\n const [hover, { off: onMouseLeave, on: onMouseEnter }] = useBoolean()\n const timeoutId = useRef<NodeJS.Timeout | null>(null)\n const indicatorMapRef = useRef<Map<number, HTMLButtonElement | null>>(\n new Map(),\n )\n const listRef = useRef<HTMLDivElement>(null)\n const horizontal = orientation === \"horizontal\"\n const axis = horizontal ? \"x\" : \"y\"\n const [snapCount, setSnapCount] = useState(0)\n const [total, setTotal] = useState(0)\n const watchResize = useCallback<Extract<CarouselWatchResize, Function>>(\n (methods, entries) => {\n const result = isFunction(watchResizeProp)\n ? watchResizeProp(methods, entries)\n : true\n const snapCount = methods.scrollSnapList().length\n const total = methods.slideNodes().length\n\n setSnapCount(snapCount)\n setTotal(total)\n\n return result\n },\n [watchResizeProp],\n )\n const [carouselRef, carousel] = useEmblaCarousel(\n {\n align,\n axis,\n container: listRef.current,\n containScroll,\n dragFree,\n duration,\n inViewThreshold,\n loop,\n skipSnaps,\n slidesToScroll,\n startIndex: defaultIndex,\n watchDrag,\n watchResize,\n watchSlides,\n },\n plugins,\n )\n\n id ??= rootId\n\n const onInit = useCallback((methods: CarouselControl) => {\n const snapCount = methods.scrollSnapList().length\n const total = methods.slideNodes().length\n\n setSnapCount(snapCount)\n setTotal(total)\n }, [])\n\n const onScroll = useCallback(() => {\n if (!carousel) return\n\n const progress = Math.round(\n Math.max(0, Math.min(1, carousel.scrollProgress())) * 100,\n )\n\n onScrollProgress?.(progress)\n }, [carousel, onScrollProgress])\n\n const onSelect = useCallback(() => {\n if (!carousel) return\n\n const index = carousel.selectedScrollSnap()\n\n setIndex(index)\n }, [carousel, setIndex])\n\n const onFocusIndicator = useCallback(\n (index: number) => {\n const el = indicatorMapRef.current.get(index)\n\n el?.focus()\n carousel?.scrollTo(index)\n },\n [carousel],\n )\n\n const onKeyDown = useCallback(\n (index: number) => (ev: KeyboardEvent<HTMLButtonElement>) => {\n const lastIndex = snapCount - 1\n\n runKeyAction(ev, {\n ArrowDown: () => {\n if (horizontal) return\n\n index = index === lastIndex ? 0 : index + 1\n\n onFocusIndicator(index)\n },\n ArrowLeft: () => {\n if (!horizontal) return\n\n index = index === 0 ? lastIndex : index - 1\n\n onFocusIndicator(index)\n },\n ArrowRight: () => {\n if (!horizontal) return\n\n index = index === lastIndex ? 0 : index + 1\n\n onFocusIndicator(index)\n },\n ArrowUp: () => {\n if (horizontal) return\n\n index = index === 0 ? lastIndex : index - 1\n\n onFocusIndicator(index)\n },\n End: () => {\n onFocusIndicator(lastIndex)\n },\n Home: () => {\n onFocusIndicator(0)\n },\n })\n },\n [snapCount, horizontal, onFocusIndicator],\n )\n\n assignRef(controlRef, carousel)\n\n useEffect(() => {\n if (carousel) {\n carousel.on(\"reInit\", onInit)\n carousel.on(\"select\", onSelect)\n carousel.on(\"scroll\", onScroll)\n\n onScroll()\n\n return () => {\n carousel.off(\"reInit\", onInit)\n carousel.off(\"select\", onSelect)\n carousel.off(\"scroll\", onScroll)\n }\n }\n }, [carousel, onInit, onScroll, onSelect])\n\n useEffect(() => {\n const stop = hover && stopMouseEnterAutoplay\n const last = !carousel?.canScrollNext()\n\n if (carousel && autoplay && !stop && !last) {\n timeoutId.current = setInterval(() => {\n carousel.scrollNext()\n }, delay)\n } else {\n if (timeoutId.current) clearInterval(timeoutId.current)\n\n timeoutId.current = null\n }\n\n return () => {\n if (timeoutId.current) clearInterval(timeoutId.current)\n }\n }, [autoplay, carousel, delay, hover, stopMouseEnterAutoplay])\n\n useUpdateEffect(() => {\n if (!carousel) return\n\n if (indexProp === undefined) return\n\n carousel.scrollTo(indexProp)\n }, [indexProp])\n\n useUpdateEffect(() => {\n if (!carousel) return\n\n carousel.reInit()\n }, [\n carousel,\n total,\n align,\n axis,\n containScroll,\n dragFree,\n duration,\n inViewThreshold,\n loop,\n skipSnaps,\n slidesToScroll,\n ])\n\n const getRootProps: PropGetter<\"section\"> = useCallback(\n ({ ref, ...props } = {}) =>\n mergeProps(\n {\n id,\n \"aria-roledescription\": \"carousel\",\n \"data-orientation\": orientation,\n },\n rest,\n {\n ref,\n onMouseEnter,\n onMouseLeave,\n },\n props,\n )(),\n [id, onMouseEnter, onMouseLeave, rest, orientation],\n )\n\n const getListProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => ({\n id: listId,\n \"aria-live\": autoplay ? \"off\" : \"polite\",\n \"data-orientation\": orientation,\n ...props,\n ref: mergeRefs(ref, listRef, carouselRef),\n }),\n [autoplay, listId, orientation, carouselRef],\n )\n\n const getItemProps: RequiredPropGetter<\"div\", { index: number }> =\n useCallback(\n ({ index: indexProp, ...props }) => {\n const page = indexProp + 1\n const selected = index === indexProp\n\n return {\n id: `${listId}-${indexProp}`,\n \"aria-label\": t(\"{page} of {total}\", { page, total }),\n \"aria-roledescription\": \"slide\",\n \"data-index\": indexProp.toString(),\n \"data-orientation\": orientation,\n \"data-selected\": dataAttr(selected),\n role: \"tabpanel\",\n ...props,\n }\n },\n [index, listId, total, orientation, t],\n )\n\n const getPrevTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": listId,\n \"aria-label\": t(\"Go to previous slide\"),\n \"data-orientation\": orientation,\n disabled: !carousel?.canScrollPrev(),\n ...props,\n onClick: handlerAll(props.onClick, () => carousel?.scrollPrev()),\n }),\n [carousel, listId, orientation, t],\n )\n\n const getNextTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": listId,\n \"aria-label\": t(\"Go to next slide\"),\n \"data-orientation\": orientation,\n disabled: !carousel?.canScrollNext(),\n ...props,\n onClick: handlerAll(props.onClick, () => carousel?.scrollNext()),\n }),\n [carousel, listId, orientation, t],\n )\n\n const getIndicatorsProps: PropGetter = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Slides\"),\n \"aria-orientation\": orientation,\n role: \"tablist\",\n ...props,\n }),\n [orientation, t],\n )\n\n const getIndicatorProps: RequiredPropGetter<\"button\", { index: number }> =\n useCallback(\n ({ ref, index: indexProp, ...props }) => {\n const page = indexProp + 1\n const selected = index === indexProp\n\n return {\n type: \"button\" as const,\n \"aria-controls\": `${listId}-${indexProp}`,\n \"aria-label\": t(\"Go to {page} slide\", { page }),\n \"aria-selected\": selected,\n \"data-index\": indexProp.toString(),\n \"data-orientation\": orientation,\n \"data-selected\": dataAttr(selected),\n role: \"tab\",\n tabIndex: selected ? 0 : -1,\n ...props,\n ref: mergeRefs(ref, (node) => {\n indicatorMapRef.current.set(indexProp, node)\n }),\n onClick: handlerAll(props.onClick, () =>\n carousel?.scrollTo(indexProp),\n ),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown(indexProp)),\n }\n },\n [index, listId, t, orientation, onKeyDown, carousel],\n )\n\n return {\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 }\n}\n\nexport type UseCarouselReturn = ReturnType<typeof useCarousel>\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,MAAM,CAAC,iBAAiB,sBAAsBA,gBAAAA,cAA+B,EAC3E,MAAM,kBACR,CAAC;AA4ID,MAAa,eAAe,EAC1B,IACA,QAAQ,UACR,WAAW,OACX,gBAAgB,OAChB,YACA,eAAe,GACf,QAAQ,KACR,WAAW,OACX,YAAY,MACZ,WAAW,IACX,OAAO,WACP,kBAAkB,GAClB,OAAO,MACP,cAAc,cACd,UAAU,CAAC,GACX,YAAY,OACZ,iBAAiB,GACjB,yBAAyB,MACzB,YAAY,WACZ,aAAa,kBAAkB,MAC/B,cAAc,MACd,UACA,kBACA,GAAG,SACiB,CAAC,MAAM;C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A,EACH,QAAQ,CAAC,OAAO;EACf,cAAc,EAAE,QAAQ;EACxB,oBAAoB;EACpB,MAAM;EACN,GAAG;CACL,IACA,CAAC,aAAa,CAAC,CACjB;CA+BA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,oBAAA,GAAA,MAAA,YAAA,EAjCG,EAAE,KAAK,OAAO,WAAW,GAAG,YAAY;GACvC,MAAM,OAAO,YAAY;GACzB,MAAM,WAAW,UAAU;GAE3B,OAAO;IACL,MAAM;IACN,iBAAiB,GAAG,OAAO,GAAG;IAC9B,cAAc,EAAE,sBAAsB,EAAE,KAAK,CAAC;IAC9C,iBAAiB;IACjB,cAAc,UAAU,SAAS;IACjC,oBAAoB;IACpB,kBAAA,GAAA,oBAAA,cAAA,SAAA,CAA0B,QAAQ;IAClC,MAAM;IACN,UAAU,WAAW,IAAI;IACzB,GAAG;IACH,KAAKA,YAAAA,UAAU,MAAM,SAAS;KAC5B,gBAAgB,QAAQ,IAAI,WAAW,IAAI;IAC7C,CAAC;IACD,UAAA,GAAA,oBAAA,cAAA,WAAA,CAAoB,MAAM,eACxB,UAAU,SAAS,SAAS,CAC9B;IACA,YAAA,GAAA,oBAAA,cAAA,WAAA,CAAsB,MAAM,WAAW,UAAU,SAAS,CAAC;GAC7D;EACF,GACA;GAAC;GAAO;GAAQ;GAAG;GAAa;GAAW;EAAQ,CASrC;EAChB;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-carousel.cjs","names":["createContext","useI18n","useControllableState","useIds","useBoolean","useRef","useState","useCallback","useEmblaCarousel","mergeProps","mergeRefs"],"sources":["../../../../src/components/carousel/use-carousel.ts"],"sourcesContent":["\"use client\"\n\nimport type {\n EmblaCarouselType,\n EmblaOptionsType,\n EmblaPluginType,\n} from \"embla-carousel\"\nimport type { KeyboardEvent, RefObject } from \"react\"\nimport useEmblaCarousel from \"embla-carousel-react\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport {\n type HTMLProps,\n mergeProps,\n type Orientation,\n type PropGetter,\n type RequiredPropGetter,\n} from \"../../core\"\nimport { useBoolean } from \"../../hooks/use-boolean\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n assignRef,\n createContext,\n dataAttr,\n handlerAll,\n isFunction,\n mergeRefs,\n runKeyAction,\n useIds,\n useUpdateEffect,\n} from \"../../utils\"\n\ntype EmblaOptions = Required<EmblaOptionsType>\nexport type CarouselAlign = EmblaOptions[\"align\"]\nexport type CarouselContainScroll = EmblaOptions[\"containScroll\"]\nexport type CarouselInViewThreshold = EmblaOptions[\"inViewThreshold\"]\nexport type CarouselWatchDrag = EmblaOptions[\"watchDrag\"]\nexport type CarouselWatchResize = EmblaOptions[\"watchResize\"]\nexport type CarouselWatchSlides = EmblaOptions[\"watchSlides\"]\nexport type CarouselControl = EmblaCarouselType\nexport type CarouselPlugin = EmblaPluginType\n\nexport interface CarouselContext extends Omit<\n UseCarouselReturn,\n \"getRootProps\"\n> {}\n\nconst [CarouselContext, useCarouselContext] = createContext<CarouselContext>({\n name: \"CarouselContext\",\n})\n\nexport { CarouselContext, useCarouselContext }\n\nexport interface UseCarouselProps extends Omit<\n HTMLProps<\"section\">,\n \"onChange\"\n> {\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 * Ref of the resizable item callback.\n */\n controlRef?: RefObject<CarouselControl | null>\n /**\n * The initial index of the carousel slide.\n *\n * @default 0\n */\n defaultIndex?: number\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 * The index of the carousel slide.\n */\n index?: number\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 * Embla plugins to use.\n */\n plugins?: CarouselPlugin[]\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 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 * Enables for scrolling the carousel with mouse and touch interactions.\n * Set this to `false` to disable drag events or pass a custom callback to add your own drag logic.\n *\n * @default true\n */\n watchDrag?: CarouselWatchDrag\n /**\n * Embla automatically watches the container and slides for size changes and runs `reInit` when any size has changed.\n * Set this to `false` to disable this behaviour or pass a custom callback to add your own resize logic.\n *\n * @default true\n */\n watchResize?: CarouselWatchResize\n /**\n * Embla automatically watches the container for added and/or removed slides and runs `reInit` if needed.\n * Set this to `false` to disable this behaviour or pass a custom callback to add your own slides changed logic.\n *\n * @default true\n */\n watchSlides?: CarouselWatchSlides\n /**\n * The callback invoked when carousel slide selected.\n */\n onChange?: (index: number) => void\n /**\n * A callback that return the current scroll amount when the carousel is scrolled.\n */\n onScrollProgress?: (progress: number) => void\n}\n\nexport const useCarousel = ({\n id,\n align = \"center\",\n autoplay = false,\n containScroll = false,\n controlRef,\n defaultIndex = 0,\n delay = 4000,\n dragFree = false,\n draggable = true,\n duration = 25,\n index: indexProp,\n inViewThreshold = 0,\n loop = true,\n orientation = \"horizontal\",\n plugins = [],\n skipSnaps = false,\n slidesToScroll = 1,\n stopMouseEnterAutoplay = true,\n watchDrag = draggable,\n watchResize: watchResizeProp = true,\n watchSlides = true,\n onChange,\n onScrollProgress,\n ...rest\n}: UseCarouselProps = {}) => {\n const { t } = useI18n(\"carousel\")\n const [index, setIndex] = useControllableState({\n defaultValue: defaultIndex,\n value: indexProp,\n onChange,\n })\n const [rootId, listId] = useIds()\n const [hover, { off: onMouseLeave, on: onMouseEnter }] = useBoolean()\n const timeoutId = useRef<NodeJS.Timeout | null>(null)\n const indicatorMapRef = useRef<Map<number, HTMLButtonElement | null>>(\n new Map(),\n )\n const listRef = useRef<HTMLDivElement>(null)\n const horizontal = orientation === \"horizontal\"\n const axis = horizontal ? \"x\" : \"y\"\n const [snapCount, setSnapCount] = useState(0)\n const [total, setTotal] = useState(0)\n const watchResize = useCallback<Extract<CarouselWatchResize, Function>>(\n (methods, entries) => {\n const result = isFunction(watchResizeProp)\n ? watchResizeProp(methods, entries)\n : true\n const snapCount = methods.scrollSnapList().length\n const total = methods.slideNodes().length\n\n setSnapCount(snapCount)\n setTotal(total)\n\n return result\n },\n [watchResizeProp],\n )\n const [carouselRef, carousel] = useEmblaCarousel(\n {\n align,\n axis,\n container: listRef.current,\n containScroll,\n dragFree,\n duration,\n inViewThreshold,\n loop,\n skipSnaps,\n slidesToScroll,\n startIndex: defaultIndex,\n watchDrag,\n watchResize,\n watchSlides,\n },\n plugins,\n )\n\n id ??= rootId\n\n const onInit = useCallback((methods: CarouselControl) => {\n const snapCount = methods.scrollSnapList().length\n const total = methods.slideNodes().length\n\n setSnapCount(snapCount)\n setTotal(total)\n }, [])\n\n const onScroll = useCallback(() => {\n if (!carousel) return\n\n const progress = Math.round(\n Math.max(0, Math.min(1, carousel.scrollProgress())) * 100,\n )\n\n onScrollProgress?.(progress)\n }, [carousel, onScrollProgress])\n\n const onSelect = useCallback(() => {\n if (!carousel) return\n\n const index = carousel.selectedScrollSnap()\n\n setIndex(index)\n }, [carousel, setIndex])\n\n const onFocusIndicator = useCallback(\n (index: number) => {\n const el = indicatorMapRef.current.get(index)\n\n el?.focus()\n carousel?.scrollTo(index)\n },\n [carousel],\n )\n\n const onKeyDown = useCallback(\n (index: number) => (ev: KeyboardEvent<HTMLButtonElement>) => {\n const lastIndex = snapCount - 1\n\n runKeyAction(ev, {\n ArrowDown: () => {\n if (horizontal) return\n\n index = index === lastIndex ? 0 : index + 1\n\n onFocusIndicator(index)\n },\n ArrowLeft: () => {\n if (!horizontal) return\n\n index = index === 0 ? lastIndex : index - 1\n\n onFocusIndicator(index)\n },\n ArrowRight: () => {\n if (!horizontal) return\n\n index = index === lastIndex ? 0 : index + 1\n\n onFocusIndicator(index)\n },\n ArrowUp: () => {\n if (horizontal) return\n\n index = index === 0 ? lastIndex : index - 1\n\n onFocusIndicator(index)\n },\n End: () => {\n onFocusIndicator(lastIndex)\n },\n Home: () => {\n onFocusIndicator(0)\n },\n })\n },\n [snapCount, horizontal, onFocusIndicator],\n )\n\n assignRef(controlRef, carousel)\n\n useEffect(() => {\n if (carousel) {\n carousel.on(\"reInit\", onInit)\n carousel.on(\"select\", onSelect)\n carousel.on(\"scroll\", onScroll)\n\n onScroll()\n\n return () => {\n carousel.off(\"reInit\", onInit)\n carousel.off(\"select\", onSelect)\n carousel.off(\"scroll\", onScroll)\n }\n }\n }, [carousel, onInit, onScroll, onSelect])\n\n useEffect(() => {\n const stop = hover && stopMouseEnterAutoplay\n const last = !carousel?.canScrollNext()\n\n if (carousel && autoplay && !stop && !last) {\n timeoutId.current = setInterval(() => {\n carousel.scrollNext()\n }, delay)\n } else {\n if (timeoutId.current) clearInterval(timeoutId.current)\n\n timeoutId.current = null\n }\n\n return () => {\n if (timeoutId.current) clearInterval(timeoutId.current)\n }\n }, [autoplay, carousel, delay, hover, stopMouseEnterAutoplay])\n\n useUpdateEffect(() => {\n if (!carousel) return\n\n if (indexProp === undefined) return\n\n carousel.scrollTo(indexProp)\n }, [indexProp])\n\n useUpdateEffect(() => {\n if (!carousel) return\n\n carousel.reInit()\n }, [\n carousel,\n total,\n align,\n axis,\n containScroll,\n dragFree,\n duration,\n inViewThreshold,\n loop,\n skipSnaps,\n slidesToScroll,\n ])\n\n const getRootProps: PropGetter<\"section\"> = useCallback(\n ({ ref, ...props } = {}) =>\n mergeProps(\n {\n id,\n \"aria-roledescription\": \"carousel\",\n \"data-orientation\": orientation,\n },\n rest,\n {\n ref,\n onMouseEnter,\n onMouseLeave,\n },\n props,\n )(),\n [id, onMouseEnter, onMouseLeave, rest, orientation],\n )\n\n const getListProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => ({\n id: listId,\n \"aria-live\": autoplay ? \"off\" : \"polite\",\n \"data-orientation\": orientation,\n ...props,\n ref: mergeRefs(ref, listRef, carouselRef),\n }),\n [autoplay, listId, orientation, carouselRef],\n )\n\n const getItemProps: RequiredPropGetter<\"div\", { index: number }> =\n useCallback(\n ({ index: indexProp, ...props }) => {\n const page = indexProp + 1\n const selected = index === indexProp\n\n return {\n id: `${listId}-${indexProp}`,\n \"aria-label\": t(\"{page} of {total}\", { page, total }),\n \"aria-roledescription\": \"slide\",\n \"data-index\": indexProp.toString(),\n \"data-orientation\": orientation,\n \"data-selected\": dataAttr(selected),\n role: \"tabpanel\",\n ...props,\n }\n },\n [index, listId, total, orientation, t],\n )\n\n const getPrevTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": listId,\n \"aria-label\": t(\"Go to previous slide\"),\n \"data-orientation\": orientation,\n disabled: !carousel?.canScrollPrev(),\n ...props,\n onClick: handlerAll(props.onClick, () => carousel?.scrollPrev()),\n }),\n [carousel, listId, orientation, t],\n )\n\n const getNextTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": listId,\n \"aria-label\": t(\"Go to next slide\"),\n \"data-orientation\": orientation,\n disabled: !carousel?.canScrollNext(),\n ...props,\n onClick: handlerAll(props.onClick, () => carousel?.scrollNext()),\n }),\n [carousel, listId, orientation, t],\n )\n\n const getIndicatorsProps: PropGetter = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Slides\"),\n \"aria-orientation\": orientation,\n role: \"tablist\",\n ...props,\n }),\n [orientation, t],\n )\n\n const getIndicatorProps: RequiredPropGetter<\"button\", { index: number }> =\n useCallback(\n ({ ref, index: indexProp, ...props }) => {\n const page = indexProp + 1\n const selected = index === indexProp\n\n return {\n type: \"button\" as const,\n \"aria-controls\": `${listId}-${indexProp}`,\n \"aria-label\": t(\"Go to {page} slide\", { page }),\n \"aria-selected\": selected,\n \"data-index\": indexProp.toString(),\n \"data-orientation\": orientation,\n \"data-selected\": dataAttr(selected),\n role: \"tab\",\n tabIndex: selected ? 0 : -1,\n ...props,\n ref: mergeRefs(ref, (node) => {\n indicatorMapRef.current.set(indexProp, node)\n }),\n onClick: handlerAll(props.onClick, () =>\n carousel?.scrollTo(indexProp),\n ),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown(indexProp)),\n }\n },\n [index, listId, t, orientation, onKeyDown, carousel],\n )\n\n return {\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 }\n}\n\nexport type UseCarouselReturn = ReturnType<typeof useCarousel>\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,MAAM,CAAC,iBAAiB,sBAAsBA,gBAAAA,cAA+B,EAC3E,MAAM,kBACR,CAAC;AA4ID,MAAa,eAAe,EAC1B,IACA,QAAQ,UACR,WAAW,OACX,gBAAgB,OAChB,YACA,eAAe,GACf,QAAQ,KACR,WAAW,OACX,YAAY,MACZ,WAAW,IACX,OAAO,WACP,kBAAkB,GAClB,OAAO,MACP,cAAc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