@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
@@ -18,18 +18,19 @@ const AvatarGroupRoot = component((props) => {
18
18
  "shape"
19
19
  ] });
20
20
  const { children, excess, getRootProps } = useAvatarGroup(rest);
21
+ const context = useMemo(() => ({
22
+ colorScheme,
23
+ size,
24
+ variant,
25
+ shape
26
+ }), [
27
+ variant,
28
+ size,
29
+ colorScheme,
30
+ shape
31
+ ]);
21
32
  return /* @__PURE__ */ jsx(AvatarPropsContext, {
22
- value: useMemo(() => ({
23
- colorScheme,
24
- size,
25
- variant,
26
- shape
27
- }), [
28
- variant,
29
- size,
30
- colorScheme,
31
- shape
32
- ]),
33
+ value: context,
33
34
  children: /* @__PURE__ */ jsxs(styled.div, {
34
35
  ...getRootProps(),
35
36
  children: [excess > 0 ? /* @__PURE__ */ jsx(Avatar, { fallback: `+${excess}` }) : null, children]
@@ -1 +1 @@
1
- {"version":3,"file":"avatar-group.js","names":[],"sources":["../../../../src/components/avatar/avatar-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { AvatarStyle } from \"./avatar.style\"\nimport type { UseAvatarGroupProps } from \"./use-avatar-group\"\nimport { useMemo } from \"react\"\nimport { styled } from \"../../core\"\nimport {\n Avatar,\n AvatarPropsContext,\n component,\n useRootComponentProps,\n} from \"./avatar\"\nimport { useAvatarGroup } from \"./use-avatar-group\"\n\nexport interface AvatarGroupRootProps\n extends HTMLStyledProps, ThemeProps<AvatarStyle>, UseAvatarGroupProps {}\n\n/**\n * `Avatar` is a component that displays a profile picture or an icon with initials representing a user.\n *\n * @see https://yamada-ui.com/docs/components/avatar\n */\nexport const AvatarGroupRoot = component<\"div\", AvatarGroupRootProps>(\n (props) => {\n const [, { colorScheme, size, variant, shape, ...rest }] =\n useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { children, excess, getRootProps } = useAvatarGroup(rest)\n const context = useMemo(\n () => ({ colorScheme, size, variant, shape }),\n [variant, size, colorScheme, shape],\n )\n\n return (\n <AvatarPropsContext value={context}>\n <styled.div {...getRootProps()}>\n {excess > 0 ? <Avatar fallback={`+${excess}`} /> : null}\n {children}\n </styled.div>\n </AvatarPropsContext>\n )\n },\n \"group\",\n)()\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,kBAAkB,WAC5B,UAAU;CACT,MAAM,GAAG,EAAE,aAAa,MAAM,SAAS,OAAO,GAAG,UAC/C,sBAAsB,OAAO,SAAS,EACpC,eAAe;EAAC;EAAW;EAAe;EAAQ;CAAO,EAC3D,CAAC;CACH,MAAM,EAAE,UAAU,QAAQ,iBAAiB,eAAe,IAAI;CAM9D,OACE,oBAAC,oBAAD;EAAoB,OANN,eACP;GAAE;GAAa;GAAM;GAAS;EAAM,IAC3C;GAAC;GAAS;GAAM;GAAa;EAAK,CAID;EAC/B,UAAA,qBAAC,OAAO,KAAR;GAAY,GAAI,aAAa;GAA7B,UAAA,CACG,SAAS,IAAI,oBAAC,QAAD,EAAQ,UAAU,IAAI,SAAW,CAAA,IAAI,MAClD,QACS;;CACM,CAAA;AAExB,GACA,OACF,CAAC,CAAC"}
1
+ {"version":3,"file":"avatar-group.js","names":[],"sources":["../../../../src/components/avatar/avatar-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { AvatarStyle } from \"./avatar.style\"\nimport type { UseAvatarGroupProps } from \"./use-avatar-group\"\nimport { useMemo } from \"react\"\nimport { styled } from \"../../core\"\nimport {\n Avatar,\n AvatarPropsContext,\n component,\n useRootComponentProps,\n} from \"./avatar\"\nimport { useAvatarGroup } from \"./use-avatar-group\"\n\nexport interface AvatarGroupRootProps\n extends HTMLStyledProps, ThemeProps<AvatarStyle>, UseAvatarGroupProps {}\n\n/**\n * `Avatar` is a component that displays a profile picture or an icon with initials representing a user.\n *\n * @see https://yamada-ui.com/docs/components/avatar\n */\nexport const AvatarGroupRoot = component<\"div\", AvatarGroupRootProps>(\n (props) => {\n const [, { colorScheme, size, variant, shape, ...rest }] =\n useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { children, excess, getRootProps } = useAvatarGroup(rest)\n const context = useMemo(\n () => ({ colorScheme, size, variant, shape }),\n [variant, size, colorScheme, shape],\n )\n\n return (\n <AvatarPropsContext value={context}>\n <styled.div {...getRootProps()}>\n {excess > 0 ? <Avatar fallback={`+${excess}`} /> : null}\n {children}\n </styled.div>\n </AvatarPropsContext>\n )\n },\n \"group\",\n)()\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,kBAAkB,WAC5B,UAAU;CACT,MAAM,GAAG,EAAE,aAAa,MAAM,SAAS,OAAO,GAAG,UAC/C,sBAAsB,OAAO,SAAS,EACpC,eAAe;EAAC;EAAW;EAAe;EAAQ;CAAO,EAC3D,CAAC;CACH,MAAM,EAAE,UAAU,QAAQ,iBAAiB,eAAe,IAAI;CAC9D,MAAM,UAAU,eACP;EAAE;EAAa;EAAM;EAAS;CAAM,IAC3C;EAAC;EAAS;EAAM;EAAa;CAAK,CACpC;CAEA,OACE,oBAAC,oBAAD;EAAoB,OAAO;EACzB,UAAA,qBAAC,OAAO,KAAR;GAAY,GAAI,aAAa;GAA7B,UAAA,CACG,SAAS,IAAI,oBAAC,QAAD,EAAQ,UAAU,IAAI,SAAW,CAAA,IAAI,MAClD,QACS;;CACM,CAAA;AAExB,GACA,OACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-avatar-group.js","names":[],"sources":["../../../../src/components/avatar/use-avatar-group.ts"],"sourcesContent":["import type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { isUndefined, useValidChildren } from \"../../utils\"\n\nexport interface UseAvatarGroupProps extends HTMLProps {\n /**\n * The maximum number of visible avatars.\n */\n max?: number\n /**\n * Whether to reverse the order of the avatars.\n */\n reverse?: boolean\n}\n\nexport const useAvatarGroup = ({\n children,\n max,\n reverse,\n ...rest\n}: UseAvatarGroupProps = {}) => {\n const validChildren = useValidChildren(children)\n const excess = !isUndefined(max) ? validChildren.length - max : 0\n\n const getRootProps: PropGetter = useCallback(\n (props) => mergeProps(rest, props, { role: \"group\" })(),\n [rest],\n )\n\n const cloneChildren = useMemo(() => {\n const omittedChildren = !isUndefined(max)\n ? validChildren.slice(0, max)\n : [...validChildren]\n\n return reverse ? omittedChildren.reverse() : omittedChildren\n }, [max, validChildren, reverse])\n\n return {\n children: cloneChildren,\n excess,\n getRootProps,\n }\n}\n\nexport type UseAvatarGroupReturn = ReturnType<typeof useAvatarGroup>\n"],"mappings":";;;;;AAgBA,MAAa,kBAAkB,EAC7B,UACA,KACA,SACA,GAAG,SACoB,CAAC,MAAM;CAC9B,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,SAAS,EAAA,GAAA,cAAA,YAAA,CAAa,GAAG,IAAI,cAAc,SAAS,MAAM;CAEhE,MAAM,eAA2B,aAC9B,UAAU,WAAW,MAAM,OAAO,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,GACtD,CAAC,IAAI,CACP;CAUA,OAAO;EACL,UAToB,cAAc;GAClC,MAAM,kBAAkB,EAAA,GAAA,cAAA,YAAA,CAAa,GAAG,IACpC,cAAc,MAAM,GAAG,GAAG,IAC1B,CAAC,GAAG,aAAa;GAErB,OAAO,UAAU,gBAAgB,QAAQ,IAAI;EAC/C,GAAG;GAAC;GAAK;GAAe;EAAO,CAGP;EACtB;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-avatar-group.js","names":["isUndefined"],"sources":["../../../../src/components/avatar/use-avatar-group.ts"],"sourcesContent":["import type { HTMLProps, PropGetter } from \"../../core\"\nimport { useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { isUndefined, useValidChildren } from \"../../utils\"\n\nexport interface UseAvatarGroupProps extends HTMLProps {\n /**\n * The maximum number of visible avatars.\n */\n max?: number\n /**\n * Whether to reverse the order of the avatars.\n */\n reverse?: boolean\n}\n\nexport const useAvatarGroup = ({\n children,\n max,\n reverse,\n ...rest\n}: UseAvatarGroupProps = {}) => {\n const validChildren = useValidChildren(children)\n const excess = !isUndefined(max) ? validChildren.length - max : 0\n\n const getRootProps: PropGetter = useCallback(\n (props) => mergeProps(rest, props, { role: \"group\" })(),\n [rest],\n )\n\n const cloneChildren = useMemo(() => {\n const omittedChildren = !isUndefined(max)\n ? validChildren.slice(0, max)\n : [...validChildren]\n\n return reverse ? omittedChildren.reverse() : omittedChildren\n }, [max, validChildren, reverse])\n\n return {\n children: cloneChildren,\n excess,\n getRootProps,\n }\n}\n\nexport type UseAvatarGroupReturn = ReturnType<typeof useAvatarGroup>\n"],"mappings":";;;;;AAgBA,MAAa,kBAAkB,EAC7B,UACA,KACA,SACA,GAAG,SACoB,CAAC,MAAM;CAC9B,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,SAAS,EAAA,GAACA,cAAAA,YAAAA,CAAY,GAAG,IAAI,cAAc,SAAS,MAAM;CAEhE,MAAM,eAA2B,aAC9B,UAAU,WAAW,MAAM,OAAO,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,GACtD,CAAC,IAAI,CACP;CAUA,OAAO;EACL,UAToB,cAAc;GAClC,MAAM,kBAAkB,EAAA,GAACA,cAAAA,YAAAA,CAAY,GAAG,IACpC,cAAc,MAAM,GAAG,GAAG,IAC1B,CAAC,GAAG,aAAa;GAErB,OAAO,UAAU,gBAAgB,QAAQ,IAAI;EAC/C,GAAG;GAAC;GAAK;GAAe;EAAO,CAGP;EACtB;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-avatar.js","names":[],"sources":["../../../../src/components/avatar/use-avatar.ts"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport { type HTMLProps, mergeProps, type PropGetter } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { dataAttr, handlerAll, mergeRefs } from \"../../utils\"\n\nconst defaultFormat = (name: string) => {\n const names = name.trim().split(\" \")\n const firstName = names[0] ?? \"\"\n const lastName = names.length > 1 ? names[names.length - 1] : \"\"\n\n return firstName && lastName\n ? `${firstName.charAt(0)}${lastName.charAt(0)}`\n : firstName.charAt(0)\n}\n\nexport interface UseAvatarProps extends HTMLProps {\n /**\n * The `HTMLImageElement` property `alt`.\n */\n alt?: HTMLProps<\"img\">[\"alt\"]\n /**\n * The `HTMLImageElement` property `crossOrigin`.\n */\n crossOrigin?: HTMLProps<\"img\">[\"crossOrigin\"]\n /**\n * The fallback text to display if the image is not provided.\n */\n fallback?: ReactNode\n /**\n * The avatar icon to use.\n */\n icon?: ReactElement\n /**\n * Defines loading strategy.\n */\n loading?: HTMLProps<\"img\">[\"loading\"]\n /**\n * The name of the person in the avatar.\n *\n * - If `src` has loaded, the name will be used as the `alt` attribute of the `img`\n * - If `src` is not loaded, the name will be used to create the initials\n */\n name?: string\n /**\n * Defining which referrer is sent when fetching the resource.\n *\n * @default 'no-referrer'\n */\n referrerPolicy?: HTMLProps<\"img\">[\"referrerPolicy\"]\n /**\n * The image url of the avatar.\n */\n src?: HTMLProps<\"img\">[\"src\"]\n /**\n * List of sources to use for different screen resolutions.\n */\n srcSet?: HTMLProps<\"img\">[\"srcSet\"]\n /**\n * Function to get the initials to display.\n */\n format?: (name: string) => string\n}\n\nexport const useAvatar = ({\n name,\n src,\n srcSet,\n alt,\n crossOrigin,\n fallback: fallbackMessage,\n format = defaultFormat,\n icon,\n loading,\n referrerPolicy = \"no-referrer\",\n ...rest\n}: UseAvatarProps = {}) => {\n const imageRef = useRef<HTMLImageElement>(null)\n const initials = name ? format(name) : undefined\n const [loaded, setLoaded] = useState<boolean>(false)\n const fallback = !src || !loaded\n const { t } = useI18n(\"avatar\")\n\n useEffect(() => {\n if (!imageRef.current) return\n\n if (!!imageRef.current.src && imageRef.current.complete) setLoaded(true)\n }, [])\n\n const getGroupProps: PropGetter = useCallback((props) => ({ ...props }), [])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({\n ...mergeProps(rest, props)(),\n \"data-fallback\": dataAttr(!!fallbackMessage),\n \"data-loaded\": dataAttr(loaded),\n }),\n [loaded, fallbackMessage, rest],\n )\n\n const getImageProps: PropGetter<\"img\"> = useCallback(\n ({ ref, onLoad, ...props } = {}) => ({\n ...props,\n ref: mergeRefs(ref, imageRef),\n src,\n srcSet,\n alt: name || alt,\n crossOrigin,\n draggable: false,\n hidden: fallback,\n loading,\n referrerPolicy,\n onLoad: handlerAll(onLoad, () => setLoaded(true)),\n }),\n [src, srcSet, alt, crossOrigin, loading, referrerPolicy, fallback, name],\n )\n\n const getFallbackProps: PropGetter = useCallback(\n (props) => ({\n ...props,\n \"aria-label\": !fallbackMessage\n ? name || alt || t(\"Avatar Icon\")\n : undefined,\n children: fallbackMessage || initials || icon,\n hidden: !fallback,\n role: !fallbackMessage ? \"img\" : undefined,\n }),\n [name, initials, fallback, icon, fallbackMessage, alt, t],\n )\n\n return {\n name,\n loaded,\n getFallbackProps,\n getGroupProps,\n getImageProps,\n getRootProps,\n }\n}\n\nexport type UseAvatarReturn = ReturnType<typeof useAvatar>\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB,SAAiB;CACtC,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,GAAG;CACnC,MAAM,YAAY,MAAM,MAAM;CAC9B,MAAM,WAAW,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,KAAK;CAE9D,OAAO,aAAa,WAChB,GAAG,UAAU,OAAO,CAAC,IAAI,SAAS,OAAO,CAAC,MAC1C,UAAU,OAAO,CAAC;AACxB;AAkDA,MAAa,aAAa,EACxB,MACA,KACA,QACA,KACA,aACA,UAAU,iBACV,SAAS,eACT,MACA,SACA,iBAAiB,eACjB,GAAG,SACe,CAAC,MAAM;CACzB,MAAM,WAAW,OAAyB,IAAI;CAC9C,MAAM,WAAW,OAAO,OAAO,IAAI,IAAI,KAAA;CACvC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ar.ts"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport { type HTMLProps, mergeProps, type PropGetter } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { dataAttr, handlerAll, mergeRefs } from \"../../utils\"\n\nconst defaultFormat = (name: string) => {\n const names = name.trim().split(\" \")\n const firstName = names[0] ?? \"\"\n const lastName = names.length > 1 ? names[names.length - 1] : \"\"\n\n return firstName && lastName\n ? `${firstName.charAt(0)}${lastName.charAt(0)}`\n : firstName.charAt(0)\n}\n\nexport interface UseAvatarProps extends HTMLProps {\n /**\n * The `HTMLImageElement` property `alt`.\n */\n alt?: HTMLProps<\"img\">[\"alt\"]\n /**\n * The `HTMLImageElement` property `crossOrigin`.\n */\n crossOrigin?: HTMLProps<\"img\">[\"crossOrigin\"]\n /**\n * The fallback text to display if the image is not provided.\n */\n fallback?: ReactNode\n /**\n * The avatar icon to use.\n */\n icon?: ReactElement\n /**\n * Defines loading strategy.\n */\n loading?: HTMLProps<\"img\">[\"loading\"]\n /**\n * The name of the person in the avatar.\n *\n * - If `src` has loaded, the name will be used as the `alt` attribute of the `img`\n * - If `src` is not loaded, the name will be used to create the initials\n */\n name?: string\n /**\n * Defining which referrer is sent when fetching the resource.\n *\n * @default 'no-referrer'\n */\n referrerPolicy?: HTMLProps<\"img\">[\"referrerPolicy\"]\n /**\n * The image url of the avatar.\n */\n src?: HTMLProps<\"img\">[\"src\"]\n /**\n * List of sources to use for different screen resolutions.\n */\n srcSet?: HTMLProps<\"img\">[\"srcSet\"]\n /**\n * Function to get the initials to display.\n */\n format?: (name: string) => string\n}\n\nexport const useAvatar = ({\n name,\n src,\n srcSet,\n alt,\n crossOrigin,\n fallback: fallbackMessage,\n format = defaultFormat,\n icon,\n loading,\n referrerPolicy = \"no-referrer\",\n ...rest\n}: UseAvatarProps = {}) => {\n const imageRef = useRef<HTMLImageElement>(null)\n const initials = name ? format(name) : undefined\n const [loaded, setLoaded] = useState<boolean>(false)\n const fallback = !src || !loaded\n const { t } = useI18n(\"avatar\")\n\n useEffect(() => {\n if (!imageRef.current) return\n\n if (!!imageRef.current.src && imageRef.current.complete) setLoaded(true)\n }, [])\n\n const getGroupProps: PropGetter = useCallback((props) => ({ ...props }), [])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({\n ...mergeProps(rest, props)(),\n \"data-fallback\": dataAttr(!!fallbackMessage),\n \"data-loaded\": dataAttr(loaded),\n }),\n [loaded, fallbackMessage, rest],\n )\n\n const getImageProps: PropGetter<\"img\"> = useCallback(\n ({ ref, onLoad, ...props } = {}) => ({\n ...props,\n ref: mergeRefs(ref, imageRef),\n src,\n srcSet,\n alt: name || alt,\n crossOrigin,\n draggable: false,\n hidden: fallback,\n loading,\n referrerPolicy,\n onLoad: handlerAll(onLoad, () => setLoaded(true)),\n }),\n [src, srcSet, alt, crossOrigin, loading, referrerPolicy, fallback, name],\n )\n\n const getFallbackProps: PropGetter = useCallback(\n (props) => ({\n ...props,\n \"aria-label\": !fallbackMessage\n ? name || alt || t(\"Avatar Icon\")\n : undefined,\n children: fallbackMessage || initials || icon,\n hidden: !fallback,\n role: !fallbackMessage ? \"img\" : undefined,\n }),\n [name, initials, fallback, icon, fallbackMessage, alt, t],\n )\n\n return {\n name,\n loaded,\n getFallbackProps,\n getGroupProps,\n getImageProps,\n getRootProps,\n }\n}\n\nexport type UseAvatarReturn = ReturnType<typeof useAvatar>\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB,SAAiB;CACtC,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,GAAG;CACnC,MAAM,YAAY,MAAM,MAAM;CAC9B,MAAM,WAAW,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,KAAK;CAE9D,OAAO,aAAa,WAChB,GAAG,UAAU,OAAO,CAAC,IAAI,SAAS,OAAO,CAAC,MAC1C,UAAU,OAAO,CAAC;AACxB;AAkDA,MAAa,aAAa,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,CAAC,kBAAkB,QAAQ,KAAA;EACnC,IACA;GAAC;GAAM;GAAU;GAAU;GAAM;GAAiB;GAAK;EAAC,CAMzC;EACf;EACA;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-breadcrumb.js","names":[],"sources":["../../../../src/components/breadcrumb/use-breadcrumb.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport { cloneElement, useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { runIfFn, useValidChildren } from \"../../utils\"\n\nexport interface BreadcrumbItem extends HTMLProps<\"a\"> {\n currentPage?: boolean\n label?: ReactNode\n}\n\nexport interface UseBreadcrumbProps extends HTMLProps<\"nav\"> {\n /**\n * The icon to be used in the ellipsis.\n */\n ellipsis?: ReactNodeOrFunction<{ items: BreadcrumbItem[] }>\n /**\n * Number of elements visible on the end(right) edges.\n *\n * @default 0\n */\n endBoundaries?: number\n /**\n * If provided, generate breadcrumb items based on items.\n */\n items?: BreadcrumbItem[]\n /**\n * The component to be used for the link.\n */\n link?: ReactElement<any>\n /**\n * Number of elements visible on the start(left) edges.\n *\n * @default 0\n */\n startBoundaries?: number\n}\n\nexport const useBreadcrumb = ({\n children,\n ellipsis,\n endBoundaries = 0,\n items = [],\n link,\n startBoundaries = 0,\n ...rest\n}: UseBreadcrumbProps = {}) => {\n const validChildren = useValidChildren(children)\n const length = validChildren.length || items.length\n const { t } = useI18n(\"breadcrumb\")\n\n const hasBoundaries =\n startBoundaries + endBoundaries > 0 &&\n length > startBoundaries + endBoundaries\n\n const renderLink = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!link) return []\n\n return items.map(({ label, ...rest }) =>\n cloneElement<any>(link, { ...link.props, children: label, ...rest }),\n )\n },\n [link],\n )\n\n const renderEllipsis = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!ellipsis) return null\n\n return runIfFn(ellipsis, { items })\n },\n [ellipsis],\n )\n\n const splitItems = useCallback(\n (items: BreadcrumbItem[]) => {\n const length = items.length\n const firstItems = items.slice(0, startBoundaries)\n const ellipsisItems = items.slice(startBoundaries, length - endBoundaries)\n const lastItems = items.slice(length - endBoundaries)\n\n return [firstItems, ellipsisItems, lastItems] as const\n },\n [startBoundaries, endBoundaries],\n )\n\n const cloneChildren = useMemo(() => {\n const hasChildren = !!validChildren.length\n\n if (hasChildren) {\n return validChildren\n } else if (hasBoundaries) {\n const [firstItems, ellipsisItems, lastItems] = splitItems(items)\n\n return [\n ...renderLink(firstItems),\n renderEllipsis(ellipsisItems),\n ...renderLink(lastItems),\n ]\n } else {\n return renderLink(items)\n }\n }, [\n validChildren,\n items,\n hasBoundaries,\n renderEllipsis,\n renderLink,\n splitItems,\n ])\n\n const getRootProps: PropGetter<\"nav\"> = useCallback(\n (props) => mergeProps({ \"aria-label\": t(\"Breadcrumb\") }, rest, props)(),\n [rest, t],\n )\n\n const getListProps: PropGetter<\"ol\"> = useCallback(\n (props) => ({ ...props }),\n [],\n )\n\n const getLinkProps: PropGetter<\"a\", { currentPage?: boolean }> = useCallback(\n ({ href, currentPage, ...props } = {}) => ({\n href: !currentPage ? href : undefined,\n \"aria-current\": currentPage ? \"page\" : undefined,\n ...props,\n }),\n [],\n )\n\n const getEllipsisProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-label\": t(\"Ellipsis\"),\n role: \"presentation\",\n ...props,\n }),\n [t],\n )\n\n return {\n children: cloneChildren,\n getEllipsisProps,\n getLinkProps,\n getListProps,\n getRootProps,\n }\n}\n\nexport type UseBreadcrumbReturn = ReturnType<typeof useBreadcrumb>\n"],"mappings":";;;;;;;AA0CA,MAAa,iBAAiB,EAC5B,UACA,UACA,gBAAgB,GAChB,QAAQ,CAAC,GACT,MACA,kBAAkB,GAClB,GAAG,SACmB,CAAC,MAAM;CAC7B,M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vB,CAAC,CACH;CAEA,MAAM,eAA2D,aAC9D,EAAE,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO;EACzC,MAAM,CAAC,cAAc,OAAO,KAAA;EAC5B,gBAAgB,cAAc,SAAS,KAAA;EACvC,GAAG;CACL,IACA,CAAC,CACH;CAWA,OAAO;EACL,UAAU;EACV,kBAX0C,aACzC,WAAW;GACV,cAAc,EAAE,UAAU;GAC1B,MAAM;GACN,GAAG;EACL,IACA,CAAC,CAAC,CAKa;EACf;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-breadcrumb.js","names":["runIfFn"],"sources":["../../../../src/components/breadcrumb/use-breadcrumb.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport { cloneElement, useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { runIfFn, useValidChildren } from \"../../utils\"\n\nexport interface BreadcrumbItem extends HTMLProps<\"a\"> {\n currentPage?: boolean\n label?: ReactNode\n}\n\nexport interface UseBreadcrumbProps extends HTMLProps<\"nav\"> {\n /**\n * The icon to be used in the ellipsis.\n */\n ellipsis?: ReactNodeOrFunction<{ items: BreadcrumbItem[] }>\n /**\n * Number of elements visible on the end(right) edges.\n *\n * @default 0\n */\n endBoundaries?: number\n /**\n * If provided, generate breadcrumb items based on items.\n */\n items?: BreadcrumbItem[]\n /**\n * The component to be used for the link.\n */\n link?: ReactElement<any>\n /**\n * Number of elements visible on the start(left) edges.\n *\n * @default 0\n */\n startBoundaries?: number\n}\n\nexport const useBreadcrumb = ({\n children,\n ellipsis,\n endBoundaries = 0,\n items = [],\n link,\n startBoundaries = 0,\n ...rest\n}: UseBreadcrumbProps = {}) => {\n const validChildren = useValidChildren(children)\n const length = validChildren.length || items.length\n const { t } = useI18n(\"breadcrumb\")\n\n const hasBoundaries =\n startBoundaries + endBoundaries > 0 &&\n length > startBoundaries + endBoundaries\n\n const renderLink = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!link) return []\n\n return items.map(({ label, ...rest }) =>\n cloneElement<any>(link, { ...link.props, children: label, ...rest }),\n )\n },\n [link],\n )\n\n const renderEllipsis = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!ellipsis) return null\n\n return runIfFn(ellipsis, { items })\n },\n [ellipsis],\n )\n\n const splitItems = useCallback(\n (items: BreadcrumbItem[]) => {\n const length = items.length\n const firstItems = items.slice(0, startBoundaries)\n const ellipsisItems = items.slice(startBoundaries, length - endBoundaries)\n const lastItems = items.slice(length - endBoundaries)\n\n return [firstItems, ellipsisItems, lastItems] as const\n },\n [startBoundaries, endBoundaries],\n )\n\n const cloneChildren = useMemo(() => {\n const hasChildren = !!validChildren.length\n\n if (hasChildren) {\n return validChildren\n } else if (hasBoundaries) {\n const [firstItems, ellipsisItems, lastItems] = splitItems(items)\n\n return [\n ...renderLink(firstItems),\n renderEllipsis(ellipsisItems),\n ...renderLink(lastItems),\n ]\n } else {\n return renderLink(items)\n }\n }, [\n validChildren,\n items,\n hasBoundaries,\n renderEllipsis,\n renderLink,\n splitItems,\n ])\n\n const getRootProps: PropGetter<\"nav\"> = useCallback(\n (props) => mergeProps({ \"aria-label\": t(\"Breadcrumb\") }, rest, props)(),\n [rest, t],\n )\n\n const getListProps: PropGetter<\"ol\"> = useCallback(\n (props) => ({ ...props }),\n [],\n )\n\n const getLinkProps: PropGetter<\"a\", { currentPage?: boolean }> = useCallback(\n ({ href, currentPage, ...props } = {}) => ({\n href: !currentPage ? href : undefined,\n \"aria-current\": currentPage ? \"page\" : undefined,\n ...props,\n }),\n [],\n )\n\n const getEllipsisProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-label\": t(\"Ellipsis\"),\n role: \"presentation\",\n ...props,\n }),\n [t],\n )\n\n return {\n children: cloneChildren,\n getEllipsisProps,\n getLinkProps,\n getListProps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ACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,eAAkC,aACrC,UAAU,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,GACtE,CAAC,MAAM,CAAC,CACV;CAEA,MAAM,eAAiC,aACpC,WAAW,EAAE,GAAG,MAAM,IACvB,CAAC,CACH;CAEA,MAAM,eAA2D,aAC9D,EAAE,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO;EACzC,MAAM,CAAC,cAAc,OAAO,KAAA;EAC5B,gBAAgB,cAAc,SAAS,KAAA;EACvC,GAAG;CACL,IACA,CAAC,CACH;CAWA,OAAO;EACL,UAAU;EACV,kBAX0C,aACzC,WAAW;GACV,cAAc,EAAE,UAAU;GAC1B,MAAM;GACN,GAAG;EACL,IACA,CAAC,CAAC,CAKa;EACf;EACA;EACA;CACF;AACF"}
@@ -92,11 +92,14 @@ const ButtonContent = component(({ children }) => {
92
92
  const ButtonLoading = component((props) => {
93
93
  const { loadingIcon, loadingMessage } = useComponentContext();
94
94
  const css = useMemo(() => ({ position: loadingMessage ? "relative" : "absolute" }), [loadingMessage]);
95
- if (isLoadingScheme(loadingIcon)) return /* @__PURE__ */ jsx(getLoadingComponent(loadingIcon), {
96
- color: "currentColor",
97
- ...props,
98
- css: mergeCSS(css, props.css)
99
- });
95
+ if (isLoadingScheme(loadingIcon)) {
96
+ const Component = getLoadingComponent(loadingIcon);
97
+ return /* @__PURE__ */ jsx(Component, {
98
+ color: "currentColor",
99
+ ...props,
100
+ css: mergeCSS(css, props.css)
101
+ });
102
+ }
100
103
  if (isValidElement(loadingIcon)) return cloneElement(loadingIcon, {
101
104
  ...props,
102
105
  ...loadingIcon.props,
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":[],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n\n if (isLoadingScheme(loadingIcon)) {\n const Component = getLoadingComponent(loadingIcon)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(loadingIcon))\n return cloneElement(loadingIcon, {\n ...props,\n ...loadingIcon.props,\n css: mergeCSS(css, props.css, loadingIcon.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...children.props,\n })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"end\")),\n})()\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAAwB;CAC7C,MAAM,YAAY,OAAO,CAAC,KAAK;CAQ/B,OAAO;EAAE,KANG,aAAa,SAA6B;GACpD,IAAI,MAAM,UAAU,UAAU,KAAK,YAAY;EACjD,GAAG,CAAC,CAIO;EAAG,MAFD,UAAU,UAAU,WAAW,KAAA;CAEzB;AACrB;AAoEA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,gBACE,gBACF,UACA,WACF;;;;;;AASA,MAAa,SAAS,aACnB,EACC,KACA,IACA,QACA,UACA,UACA,eACA,UAAU,MACV,SACA,cAAc,QACd,gBACA,mBAAmB,SACnB,YAAY,MACZ,WACA,cACA,GAAG,WACC;CACJ,MAAM,gBAAgB,YAAY;CAClC,MAAM,EAAE,KAAK,WAAW,SAAS,cAAc,EAAE;CACjD,MAAM,EAAE,SAAS,GAAG,gBAAgB,UAAU;EAC5C,GAAG;EACH,UAAU,iBAAiB;CAC7B,CAAC;CACD,MAAM,eAAe,WAAW,qBAAqB;CACrD,MAAM,aAAa,WAAW,qBAAqB;CAEnD,MAAM,UAAU,eACP;EAAE;EAAS;EAAa;EAAgB;EAAW;CAAU,IACpE;EAAC;EAAa;EAAgB;EAAW;EAAS;CAAS,CAC7D;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,qBAAC,OAAO,QAAR;GACE,KAAK,UAAU,KAAK,SAAS;GACzB;GACE;GACN,gBAAA,GAAA,cAAA,SAAA,CAAsB,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KAAK,YAAY,MAAM,GAAG;CACrD,CAAC;CAEH,OAAO;AACT,GACA;CAAE,MAAM;CAAiB,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,SAAS,CAAC;AAAE,CAC7E,CAAC,CAAC;AAEF,MAAM,qBAAqB,UAAqC,eAAe;CAC7E,MAAM;CACN,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,WAAW,OAAO,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,UAAqC,eAAe;CAC3E,MAAM;CACN,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,WAAW,KAAK,CAAC;AACzD,CAAC,CAAC,CAAC;AAIH,MAAM,aAAa,WAChB,EAAE,UAAU,GAAG,WAAW;CACzB,IAAI,eAAiC,QAAQ,GAC3C,OAAO,aAAa,UAAU;EAC5B,eAAe;EACf,MAAM;EACN,GAAG;EACH,GAAG,SAAS;CACd,CAAC;CAEH,OAAO,SAAS,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI;AAC9D,GACA;CAAE,MAAM;CAAc,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,MAAM,CAAC;AAAE,CACvE,CAAC,CAAC;AAEF,MAAM,kBAAkB,UAAkC,YAAY;CACpE,MAAM;CACN,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAW,cAAA,GAAA,cAAA,IAAA,CAAiB,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"button.js","names":["dataAttr","bem"],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n\n if (isLoadingScheme(loadingIcon)) {\n const Component = getLoadingComponent(loadingIcon)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(loadingIcon))\n return cloneElement(loadingIcon, {\n ...props,\n ...loadingIcon.props,\n css: mergeCSS(css, props.css, loadingIcon.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...children.props,\n })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"end\")),\n})()\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAAwB;CAC7C,MAAM,YAAY,OAAO,CAAC,KAAK;CAQ/B,OAAO;EAAE,KANG,aAAa,SAA6B;GACpD,IAAI,MAAM,UAAU,UAAU,KAAK,YAAY;EACjD,GAAG,CAAC,CAIO;EAAG,MAFD,UAAU,UAAU,WAAW,KAAA;CAEzB;AACrB;AAoEA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,gBACE,gBACF,UACA,WACF;;;;;;AASA,MAAa,SAAS,aACnB,EACC,KACA,IACA,QACA,UACA,UACA,eACA,UAAU,MACV,SACA,cAAc,QACd,gBACA,mBAAmB,SACnB,YAAY,MACZ,WACA,cACA,GAAG,WACC;CACJ,MAAM,gBAAgB,YAAY;CAClC,MAAM,EAAE,KAAK,WAAW,SAAS,cAAc,EAAE;CACjD,MAAM,EAAE,SAAS,GAAG,gBAAgB,UAAU;EAC5C,GAAG;EACH,UAAU,iBAAiB;CAC7B,CAAC;CACD,MAAM,eAAe,WAAW,qBAAqB;CACrD,MAAM,aAAa,WAAW,qBAAqB;CAEnD,MAAM,UAAU,eACP;EAAE;EAAS;EAAa;EAAgB;EAAW;CAAU,IACpE;EAAC;EAAa;EAAgB;EAAW;EAAS;CAAS,CAC7D;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,qBAAC,OAAO,QAAR;GACE,KAAK,UAAU,KAAK,SAAS;GACzB;GACE;GACN,gBAAA,GAAaA,cAAAA,SAAAA,CAAS,MAAM;GAC5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AK,SAAS,KAAK,MAAM,KAAK,YAAY,MAAM,GAAG;CACrD,CAAC;CAEH,OAAO;AACT,GACA;CAAE,MAAM;CAAiB,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,SAAS,CAAC;AAAE,CAC7E,CAAC,CAAC;AAEF,MAAM,qBAAqB,UAAqC,eAAe;CAC7E,MAAM;CACN,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,WAAW,OAAO,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,UAAqC,eAAe;CAC3E,MAAM;CACN,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,WAAW,KAAK,CAAC;AACzD,CAAC,CAAC,CAAC;AAIH,MAAM,aAAa,WAChB,EAAE,UAAU,GAAG,WAAW;CACzB,IAAI,eAAiC,QAAQ,GAC3C,OAAO,aAAa,UAAU;EAC5B,eAAe;EACf,MAAM;EACN,GAAG;EACH,GAAG,SAAS;CACd,CAAC;CAEH,OAAO,SAAS,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI;AAC9D,GACA;CAAE,MAAM;CAAc,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,MAAM,CAAC;AAAE,CACvE,CAAC,CAAC;AAEF,MAAM,kBAAkB,UAAkC,YAAY;CACpE,MAAM;CACN,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAW,cAAA,GAAaA,cAAAA,IAAAA,CAAI,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":["Select.Root"],"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,iBACE,oBACF,YACA,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,gBACE,YAAY,KAAK;CACrB,MAAM,kBAAkB,eACf;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,mBAAmB,eAChB;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,oBAAC,4BAAD;EAA4B,OAAO;EACjC,UAAA,oBAAC,iBAAD;GAAiB,OAAO;GACtB,UAAA,oBAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,oBAAC,OAAO,KAAR;KAAY,GAAI,aAAa;KAC1B,UAAA,YACC,qBAAA,YA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,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,gBAAgB,eAAe,KAAK;CAE5C,OAAO,YAAY;AACrB,CACF"}
1
+ {"version":3,"file":"calendar.js","names":["runIfFn","Select.Root"],"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,iBACE,oBACF,YACA,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,gBACE,YAAY,KAAK;CACrB,MAAM,kBAAkB,eACf;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;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B;EACe,CAAA;CACN,CAAA,GAEd,oBAAC,eAAD;EAAe,GAAI;EAChB,UAAA,UAAU,KAAK,MAAM,UACpB,oBAAC,cAAD;GAA0B,GAAI;GAC3B,UAAA,KAAK,KAAK,EAAE,OAAO,YAClB,oBAAC,aAAD;IAEQ,GAAG;IAAU;IAElBD,WAAAA,GAAAA,cAAAA,QAAAA,CAAQ,SAAS,EAAE,MAAM,CAAC,KACzB,oBAAC,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,cAAc,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,gBAAgB,eAAe,KAAK;CAE5C,OAAO,YAAY;AACrB,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-calendar.js","names":["createContext"],"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,mBAEA,MAAM,IAAI,C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0B,QAAQ;IAClC,eAAA,GAAA,cAAA,SAAA,CAAuB,UAAU;IACjC,eAAA,GAAA,cAAA,SAAA,CAAuB,KAAK;IAC5B,cAAc,MAAM,KAAK,CAAC,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAK,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,OAAO,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
1
+ {"version":3,"file":"use-calendar.js","names":["isArray","isNumber","isObject","isDate","createContext","contains","dataAttr","handlerAll","ariaAttr"],"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,mBAEA,MAAM,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,mBAEA,MAAM,IAAI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