@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
@@ -17,11 +17,14 @@ const { ComponentContext, PropsContext: DataListPropsContext, useComponentContex
17
17
  const DataListRoot = withProvider(({ style, children, items = [], descriptionProps, termProps, ...rest }) => {
18
18
  const col = useMemo(() => {
19
19
  let col = 0;
20
- if (children) pickChildren(getValidChildren(children), DataListItem).forEach(({ props }) => {
21
- const pickedChildren = pickChildren(getValidChildren(props.children), DataListTerm, DataListDescription);
22
- col = Math.max(col, pickedChildren.length);
23
- });
24
- else items.forEach(({ description, term }) => {
20
+ if (children) {
21
+ const validChildren = getValidChildren(children);
22
+ pickChildren(validChildren, DataListItem).forEach(({ props }) => {
23
+ const validChildren = getValidChildren(props.children);
24
+ const pickedChildren = pickChildren(validChildren, DataListTerm, DataListDescription);
25
+ col = Math.max(col, pickedChildren.length);
26
+ });
27
+ } else items.forEach(({ description, term }) => {
25
28
  const termCount = !term ? 0 : (0, utils_exports.isArray)(term) ? term.length : 1;
26
29
  const descriptionCount = !description ? 0 : (0, utils_exports.isArray)(description) ? description.length : 1;
27
30
  col = Math.max(col, termCount + descriptionCount);
@@ -1 +1 @@
1
- {"version":3,"file":"data-list.js","names":[],"sources":["../../../../src/components/data-list/data-list.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { DataListStyle } from \"./data-list.style\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport {\n getValidChildren,\n isArray,\n isEmpty,\n omitChildren,\n pickChildren,\n} from \"../../utils\"\nimport { dataListStyle } from \"./data-list.style\"\n\nexport interface DataListItem extends DataListItemProps {}\n\nexport interface DataListRootProps\n extends HTMLStyledProps<\"dl\">, ThemeProps<DataListStyle> {\n /**\n * If provided, generate elements based on items.\n */\n items?: DataListItem[]\n /**\n * The props for the data list description component.\n */\n descriptionProps?: DataListDescriptionProps\n /**\n * The props for the data list term component.\n */\n termProps?: DataListTermProps\n}\n\ninterface ComponentContext extends Pick<\n DataListRootProps,\n \"descriptionProps\" | \"termProps\"\n> {}\n\nconst {\n ComponentContext,\n PropsContext: DataListPropsContext,\n useComponentContext,\n usePropsContext: useDataListPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DataListRootProps, DataListStyle, ComponentContext>(\n \"data-list\",\n dataListStyle,\n)\n\nexport { DataListPropsContext, useDataListPropsContext }\n\n/**\n * `DataList` is used to display a list of data items.\n *\n * @see https://yamada-ui.com/docs/components/data-list\n */\nexport const DataListRoot = withProvider<\"dl\", DataListRootProps>(\n ({ style, children, items = [], descriptionProps, termProps, ...rest }) => {\n const col = useMemo(() => {\n let col = 0\n\n if (children) {\n const validChildren = getValidChildren(children)\n const dataListItems = pickChildren(validChildren, DataListItem)\n\n dataListItems.forEach(({ props }) => {\n const validChildren = getValidChildren(props.children)\n const pickedChildren = pickChildren(\n validChildren,\n DataListTerm,\n DataListDescription,\n )\n\n col = Math.max(col, pickedChildren.length)\n })\n } else {\n items.forEach(({ description, term }) => {\n const termCount = !term ? 0 : isArray(term) ? term.length : 1\n const descriptionCount = !description\n ? 0\n : isArray(description)\n ? description.length\n : 1\n\n col = Math.max(col, termCount + descriptionCount)\n })\n }\n\n return col\n }, [children, items])\n const computedChildren = useMemo(\n () =>\n items.map((props, index) => <DataListItem key={index} {...props} />),\n [items],\n )\n const context = useMemo(\n () => ({\n descriptionProps,\n termProps,\n }),\n [descriptionProps, termProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.dl style={{ \"--col\": col, ...style }} {...rest}>\n {children ?? computedChildren}\n </styled.dl>\n </ComponentContext>\n )\n },\n \"root\",\n)()\n\nexport interface DataListItemProps extends HTMLStyledProps {\n /**\n * The data list description to use.\n */\n description?: ReactNode | ReactNode[]\n /**\n * The data list term to use.\n */\n term?: ReactNode | ReactNode[]\n /**\n * The props for the data list description component.\n */\n descriptionProps?: DataListDescriptionProps\n /**\n * The props for the data list term component.\n */\n termProps?: DataListTermProps\n}\n\nexport const DataListItem = withContext<\"div\", DataListItemProps>(\n ({\n children,\n description,\n term,\n descriptionProps: customDescriptionProps,\n termProps: customTermProps,\n ...rest\n }) => {\n const { descriptionProps, termProps } = useComponentContext()\n\n const [omittedChildren, customTerms, customDescriptions] = useMemo(() => {\n const validChildren = getValidChildren(children)\n\n if (isEmpty(validChildren)) return [children]\n\n const customTerms = pickChildren(validChildren, DataListTerm)\n const customDescriptions = pickChildren(\n validChildren,\n DataListDescription,\n )\n const omittedChildren = omitChildren(\n validChildren,\n DataListTerm,\n DataListDescription,\n )\n\n return [omittedChildren, customTerms, customDescriptions] as const\n }, [children])\n\n return (\n <styled.div {...rest}>\n {!isEmpty(customTerms) ? (\n customTerms\n ) : isArray(term) ? (\n term.map((item, index) => (\n <DataListTerm\n key={index}\n {...mergeProps(termProps, customTermProps)()}\n >\n {item}\n </DataListTerm>\n ))\n ) : (\n <DataListTerm {...mergeProps(termProps, customTermProps)()}>\n {term}\n </DataListTerm>\n )}\n\n {!isEmpty(customDescriptions) ? (\n customDescriptions\n ) : isArray(description) ? (\n description.map((item, index) => (\n <DataListDescription\n key={index}\n {...mergeProps(descriptionProps, customDescriptionProps)()}\n >\n {item}\n </DataListDescription>\n ))\n ) : (\n <DataListDescription\n {...mergeProps(descriptionProps, customDescriptionProps)()}\n >\n {description}\n </DataListDescription>\n )}\n\n {omittedChildren}\n </styled.div>\n )\n },\n \"item\",\n)()\n\nexport interface DataListTermProps extends HTMLStyledProps<\"dt\"> {}\n\nexport const DataListTerm = withContext<\"dt\", DataListTermProps>(\"dt\", \"term\")()\n\nexport interface DataListDescriptionProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const DataListDescription = withContext<\"dd\", DataListDescriptionProps>(\n \"dd\",\n \"description\",\n)()\n"],"mappings":";;;;;;;;;;AAuCA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,aACA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EAAE,OAAO,UAAU,QAAQ,CAAC,GAAG,kBAAkB,WAAW,GAAG,WAAW;CAC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M,cAAc,aAAa,eAAe,YAAY;EAC5D,MAAM,qBAAqB,aACzB,eACA,mBACF;EAOA,OAAO;GANiB,aACtB,eACA,cACA,mBAGoB;GAAG;GAAa;EAAkB;CAC1D,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,qBAAC,OAAO,KAAR;EAAY,GAAI;EAAhB,UAAA;GACG,EAAA,GAAA,cAAA,QAAA,CAAS,WAAW,IACnB,eAAA,GAAA,cAAA,QAAA,CACU,IAAI,IACd,KAAK,KAAK,MAAM,UACd,oBAAC,cAAD;IAEE,GAAI,WAAW,WAAW,eAAe,CAAC,CAAC;IAE1C,UAAA;GACW,GAJP,KAIO,CACf,IAED,oBAAC,cAAD;IAAc,GAAI,WAAW,WAAW,eAAe,CAAC,CAAC;IACtD,UAAA;GACW,CAAA;GAGf,EAAA,GAAA,cAAA,QAAA,CAAS,kBAAkB,IAC1B,sBAAA,GAAA,cAAA,QAAA,CACU,WAAW,IACrB,YAAY,KAAK,MAAM,UACrB,oBAAC,qBAAD;IAEE,GAAI,WAAW,kBAAkB,sBAAsB,CAAC,CAAC;IAExD,UAAA;GACkB,GAJd,KAIc,CACtB,IAED,oBAAC,qBAAD;IACE,GAAI,WAAW,kBAAkB,sBAAsB,CAAC,CAAC;IAExD,UAAA;GACkB,CAAA;GAGtB;EACS;;AAEhB,GACA,MACF,CAAC,CAAC;AAIF,MAAa,eAAe,YAAqC,MAAM,MAAM,CAAC,CAAC;AAI/E,MAAa,sBAAsB,YACjC,MACA,aACF,CAAC,CAAC"}
1
+ {"version":3,"file":"data-list.js","names":["isArray","isEmpty"],"sources":["../../../../src/components/data-list/data-list.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { DataListStyle } from \"./data-list.style\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport {\n getValidChildren,\n isArray,\n isEmpty,\n omitChildren,\n pickChildren,\n} from \"../../utils\"\nimport { dataListStyle } from \"./data-list.style\"\n\nexport interface DataListItem extends DataListItemProps {}\n\nexport interface DataListRootProps\n extends HTMLStyledProps<\"dl\">, ThemeProps<DataListStyle> {\n /**\n * If provided, generate elements based on items.\n */\n items?: DataListItem[]\n /**\n * The props for the data list description component.\n */\n descriptionProps?: DataListDescriptionProps\n /**\n * The props for the data list term component.\n */\n termProps?: DataListTermProps\n}\n\ninterface ComponentContext extends Pick<\n DataListRootProps,\n \"descriptionProps\" | \"termProps\"\n> {}\n\nconst {\n ComponentContext,\n PropsContext: DataListPropsContext,\n useComponentContext,\n usePropsContext: useDataListPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DataListRootProps, DataListStyle, ComponentContext>(\n \"data-list\",\n dataListStyle,\n)\n\nexport { DataListPropsContext, useDataListPropsContext }\n\n/**\n * `DataList` is used to display a list of data items.\n *\n * @see https://yamada-ui.com/docs/components/data-list\n */\nexport const DataListRoot = withProvider<\"dl\", DataListRootProps>(\n ({ style, children, items = [], descriptionProps, termProps, ...rest }) => {\n const col = useMemo(() => {\n let col = 0\n\n if (children) {\n const validChildren = getValidChildren(children)\n const dataListItems = pickChildren(validChildren, DataListItem)\n\n dataListItems.forEach(({ props }) => {\n const validChildren = getValidChildren(props.children)\n const pickedChildren = pickChildren(\n validChildren,\n DataListTerm,\n DataListDescription,\n )\n\n col = Math.max(col, pickedChildren.length)\n })\n } else {\n items.forEach(({ description, term }) => {\n const termCount = !term ? 0 : isArray(term) ? term.length : 1\n const descriptionCount = !description\n ? 0\n : isArray(description)\n ? description.length\n : 1\n\n col = Math.max(col, termCount + descriptionCount)\n })\n }\n\n return col\n }, [children, items])\n const computedChildren = useMemo(\n () =>\n items.map((props, index) => <DataListItem key={index} {...props} />),\n [items],\n )\n const context = useMemo(\n () => ({\n descriptionProps,\n termProps,\n }),\n [descriptionProps, termProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.dl style={{ \"--col\": col, ...style }} {...rest}>\n {children ?? computedChildren}\n </styled.dl>\n </ComponentContext>\n )\n },\n \"root\",\n)()\n\nexport interface DataListItemProps extends HTMLStyledProps {\n /**\n * The data list description to use.\n */\n description?: ReactNode | ReactNode[]\n /**\n * The data list term to use.\n */\n term?: ReactNode | ReactNode[]\n /**\n * The props for the data list description component.\n */\n descriptionProps?: DataListDescriptionProps\n /**\n * The props for the data list term component.\n */\n termProps?: DataListTermProps\n}\n\nexport const DataListItem = withContext<\"div\", DataListItemProps>(\n ({\n children,\n description,\n term,\n descriptionProps: customDescriptionProps,\n termProps: customTermProps,\n ...rest\n }) => {\n const { descriptionProps, termProps } = useComponentContext()\n\n const [omittedChildren, customTerms, customDescriptions] = useMemo(() => {\n const validChildren = getValidChildren(children)\n\n if (isEmpty(validChildren)) return [children]\n\n const customTerms = pickChildren(validChildren, DataListTerm)\n const customDescriptions = pickChildren(\n validChildren,\n DataListDescription,\n )\n const omittedChildren = omitChildren(\n validChildren,\n DataListTerm,\n DataListDescription,\n )\n\n return [omittedChildren, customTerms, customDescriptions] as const\n }, [children])\n\n return (\n <styled.div {...rest}>\n {!isEmpty(customTerms) ? (\n customTerms\n ) : isArray(term) ? (\n term.map((item, index) => (\n <DataListTerm\n key={index}\n {...mergeProps(termProps, customTermProps)()}\n >\n {item}\n </DataListTerm>\n ))\n ) : (\n <DataListTerm {...mergeProps(termProps, customTermProps)()}>\n {term}\n </DataListTerm>\n )}\n\n {!isEmpty(customDescriptions) ? (\n customDescriptions\n ) : isArray(description) ? (\n description.map((item, index) => (\n <DataListDescription\n key={index}\n {...mergeProps(descriptionProps, customDescriptionProps)()}\n >\n {item}\n </DataListDescription>\n ))\n ) : (\n <DataListDescription\n {...mergeProps(descriptionProps, customDescriptionProps)()}\n >\n {description}\n </DataListDescription>\n )}\n\n {omittedChildren}\n </styled.div>\n )\n },\n \"item\",\n)()\n\nexport interface DataListTermProps extends HTMLStyledProps<\"dt\"> {}\n\nexport const DataListTerm = withContext<\"dt\", DataListTermProps>(\"dt\", \"term\")()\n\nexport interface DataListDescriptionProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const DataListDescription = withContext<\"dd\", DataListDescriptionProps>(\n \"dd\",\n \"description\",\n)()\n"],"mappings":";;;;;;;;;;AAuCA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,aACA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EAAE,OAAO,UAAU,QAAQ,CAAC,GAAG,kBAAkB,WAAW,GAAG,WAAW;CACzE,MAAM,MAAM,cAAc;EACxB,IAAI,MAAM;EAEV,IAAI,UAAU;GACZ,MAAM,gBAAgB,iBAAiB,QAAQ;GAG/C,aAFmC,eAAe,YAEtC,CAAC,CAAC,SAAS,EAAE,YAAY;IACnC,MAAM,gBAAgB,iBAAiB,MAAM,QAAQ;IACrD,MAAM,iBAAiB,aACrB,eACA,cACA,mBACF;IAEA,MAAM,KAAK,IAAI,KAAK,eAAe,MAAM;GAC3C,CAAC;EACH,OACE,MAAM,SAAS,EAAE,aAAa,WAAW;GACvC,MAAM,YAAY,CAAC,OAAO,KAAA,GAAIA,cAAAA,QAAAA,CAAQ,IAAI,IAAI,KAAK,SAAS;GAC5D,MAAM,mBAAmB,CAAC,cACtB,KAAA,GACAA,cAAAA,QAAAA,CAAQ,WAAW,IACjB,YAAY,SACZ;GAEN,MAAM,KAAK,IAAI,KAAK,YAAY,gBAAgB;EAClD,CAAC;EAGH,OAAO;CACT,GAAG,CAAC,UAAU,KAAK,CAAC;CACpB,MAAM,mBAAmB,cAErB,MAAM,KAAK,OAAO,UAAU,oBAAC,cAAD,EAA0B,GAAI,MAAQ,GAAnB,KAAmB,CAAC,GACrE,CAAC,KAAK,CACR;CACA,MAAM,UAAU,eACP;EACL;EACA;CACF,IACA,CAAC,kBAAkB,SAAS,CAC9B;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,oBAAC,OAAO,IAAR;GAAW,OAAO;IAAE,SAAS;IA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MACF,CAAC,CAAC;AAIF,MAAa,eAAe,YAAqC,MAAM,MAAM,CAAC,CAAC;AAI/E,MAAa,sBAAsB,YACjC,MACA,aACF,CAAC,CAAC"}
@@ -96,7 +96,8 @@ const DatePicker = withProvider((props) => {
96
96
  })
97
97
  });
98
98
  }, "root", { transferProps: ["size"] })((props) => {
99
- return mergeProps(useInputPropsContext(), props)();
99
+ const context = useInputPropsContext();
100
+ return mergeProps(context, props)();
100
101
  });
101
102
  const DatePickerField = withContext("div", "field")({ "data-group-propagate": "" }, ({ children, ...rest }) => {
102
103
  const { range, separator, getInputProps, inputProps } = useComponentContext();
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","names":["Popover.Root","InputGroup.Root","Popover.Trigger","InputGroup.Element","Calendar.Root","Popover.Content"],"sources":["../../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { DatePickerStyle } from \"./date-picker.style\"\nimport type { UseDatePickerProps, UseDatePickerReturn } from \"./use-date-picker\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useFieldSizing } from \"../../hooks/use-field-sizing\"\nimport { cast, isArray, isDate, isObject, mergeRefs } from \"../../utils\"\nimport { Calendar } from \"../calendar\"\nimport { useGroupItemProps } from \"../group\"\nimport { CalendarIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { datePickerStyle } from \"./date-picker.style\"\nimport { useDatePicker } from \"./use-date-picker\"\n\ninterface ComponentContext\n extends\n Pick<UseDatePickerReturn, \"getInputProps\" | \"range\" | \"separator\">,\n Pick<DatePickerProps, \"inputProps\"> {}\n\nexport interface DatePickerProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<\n HTMLStyledProps,\n \"defaultValue\" | \"offset\" | \"onChange\" | \"ref\" | \"value\"\n >,\n Merge<UseDatePickerProps<Multiple, Range>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<DatePickerStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default true\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the date picker.\n */\n icon?: ReactNode\n /**\n * The placement of the popper relative to its reference.\n *\n * @default 'end-start'\n */\n placement?: Popover.RootProps[\"placement\"]\n /**\n * The size of the calendar component.\n */\n calendarProps?: Calendar.RootProps<Multiple, Range>\n /**\n * Props for content element.\n */\n contentProps?: DatePickerContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for icon element.\n */\n iconProps?: DatePickerIconProps\n /**\n * The props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: DatePickerPropsContext,\n useComponentContext,\n usePropsContext: useDatePickerPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DatePickerProps, DatePickerStyle, ComponentContext>(\n \"date-picker\",\n datePickerStyle,\n)\n\nexport { DatePickerPropsContext, useDatePickerPropsContext }\n\n/**\n * `DatePicker` is a component used for users to select a date.\n *\n * @see https://yamada-ui.com/docs/components/date-picker\n */\nexport const DatePicker = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: DatePickerProps<Multiple, Range>,\n ) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n size,\n animationScheme = \"block-start\",\n children,\n clearable = true,\n clearIcon = <XIcon />,\n duration,\n errorBorderColor,\n focusBorderColor,\n icon,\n calendarProps,\n contentProps,\n elementProps,\n iconProps,\n inputProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const {\n children: fieldChildren,\n range,\n separator,\n value,\n getCalendarProps,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n popoverProps,\n } = useDatePicker({ ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const selectProps = useMemo<Calendar.RootProps[\"selectProps\"]>(\n () => ({ contentProps: { portalProps: { disabled: true } } }),\n [],\n )\n const componentContext = useMemo(\n () => ({ range, separator, getInputProps, inputProps }),\n [getInputProps, inputProps, range, separator],\n )\n const hasValue = isArray(value)\n ? !!value.length\n : isObject(value) && !isDate(value)\n ? !!value.end || !!value.start\n : !!value\n\n return (\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <InputGroup.Root\n {...mergeProps(\n { className, css, colorScheme },\n getRootProps(groupItemProps),\n rootProps,\n )()}\n >\n <Popover.Trigger>\n <DatePickerField {...getFieldProps({ ...varProps })}>\n {fieldChildren}\n </DatePickerField>\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <DatePickerIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <DatePickerIcon icon={icon} {...getIconProps(iconProps)} />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <DatePickerContent\n {...cast<DatePickerContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n <Calendar.Root\n colorScheme={colorScheme}\n size={size}\n fixed={false}\n selectProps={selectProps}\n {...getCalendarProps(calendarProps)}\n >\n {children}\n </Calendar.Root>\n </DatePickerContent>\n </Popover.Root>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"size\"] },\n)((props) => {\n const context = useInputPropsContext()\n\n return mergeProps(context, props)()\n}) as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: DatePickerProps<Multiple, Range>,\n ): ReactElement\n}>\n\ninterface DatePickerFieldProps extends HTMLStyledProps {}\n\nconst DatePickerField = withContext<\"div\", DatePickerFieldProps>(\n \"div\",\n \"field\",\n)({ \"data-group-propagate\": \"\" }, ({ children, ...rest }) => {\n const { range, separator, getInputProps, inputProps } = useComponentContext()\n const computedChildren = useMemo(() => {\n if (range)\n return (\n <>\n <DatePickerAdjustInput\n {...getInputProps({ align: \"start\", ...inputProps })}\n />\n <DatePickerSeparator>{separator}</DatePickerSeparator>\n <DatePickerAdjustInput\n {...getInputProps({ align: \"end\", ...inputProps })}\n />\n </>\n )\n else\n return (\n <>\n {children}\n <DatePickerInput {...getInputProps(inputProps)} />\n </>\n )\n }, [children, getInputProps, inputProps, range, separator])\n\n return {\n ...rest,\n children: computedChildren,\n }\n})\n\ninterface DatePickerInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst DatePickerInput = withContext<\"input\", DatePickerInputProps>(\n \"input\",\n \"input\",\n)()\n\ninterface DatePickerAdjustInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst DatePickerAdjustInput = withContext<\"input\", DatePickerAdjustInputProps>(\n ({ ref, placeholder, value, ...rest }) => {\n const { ref: inputRef, text } = useFieldSizing({\n value: value?.toString() || placeholder,\n })\n\n return (\n <>\n {text}\n\n <styled.input\n ref={mergeRefs(ref, inputRef)}\n placeholder={placeholder}\n value={value}\n {...rest}\n />\n </>\n )\n },\n [\"input\", \"adjust\"],\n)()\n\ninterface DatePickerSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nconst DatePickerSeparator = withContext<\"span\", DatePickerSeparatorProps>(\n \"span\",\n \"separator\",\n)()\n\ninterface DatePickerIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst DatePickerIcon = withContext<\"div\", DatePickerIconProps>(\"div\", \"icon\")(\n undefined,\n ({ children, icon, ...rest }) => ({\n children: icon || children || <CalendarIcon />,\n ...rest,\n }),\n)\n\ninterface DatePickerContentProps extends Popover.ContentProps {}\n\nconst DatePickerContent = withContext<\"div\", DatePickerContentProps>(\n Popover.Content,\n \"content\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0FA,MAAM,EACJ,kBACA,cAAc,wBACd,qBACA,iBAAiB,2BACjB,aACA,iBACE,oBACF,eACA,eACF;;;;;;AASA,MAAa,aAAa,cAEtB,UACG;CACH,MAAM,CACJ,gBACA,EACE,WACA,KACA,aACA,MACA,kBAAkB,eAClB,UACA,YAAY,MACZ,YAAY,oBAAC,OAAD,CAAQ,CAAA,GACpB,UACA,kBACA,kBACA,MACA,eACA,cACA,cACA,WACA,YACA,WACA,GAAG,UAEH,kBAAkB,KAAK;CAC3B,MAAM,oBAAoB,qBAAqB,IAAI;CACnD,MAAM,EACJ,UAAU,eACV,OACA,WACA,OACA,kBACA,mBACA,iBACA,eACA,cACA,eACA,cACA,iBACE,cAAc;EAAE,GAAG;EAAM,GAAG;CAAkB,CAAC;CACnD,MAAM,qBAAqB,eAClB;EACL;EACA;EACA,GAAG;CACL,IACA;EAAC;EAAiB;EAAU;CAAY,CAC1C;CACA,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,cAAc,eACX,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,IAC3D,CAAC,CACH;CACA,MAAM,mBAAmB,eAChB;EAAE;EAAO;EAAW;EAAe;CAAW,IACrD;EAAC;EAAe;EAAY;EAAO;CAAS,CAC9C;CACA,MAAM,YAAA,GAAA,cAAA,QAAA,CAAmB,KAAK,IAC1B,CAAC,CAAC,MAAM,UAAA,GAAA,cAAA,SAAA,CACC,KAAK,KAAK,EAAA,GAAA,cAAA,OAAA,CAAQ,KAAK,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EACE,GAAI,cAAc;IAAE,OAAO;IAAS,GAAG;GAAW,CAAC,EACpD,CAAA;GACD,oBAAC,qBAAD,EAAA,UAAsB,UAA+B,CAAA;GACrD,oBAAC,uBAAD,EACE,GAAI,cAAc;IAAE,OAAO;IAAO,GAAG;GAAW,CAAC,EAClD,CAAA;EACD,EAAA,CAAA;OAGJ,OACE,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,iBAAD,EAAiB,GAAI,cAAc,UAAU,EAAI,CAAA,CACjD,EAAA,CAAA;CAER,GAAG;EAAC;EAAU;EAAe;EAAY;EAAO;CAAS,CAAC;CAE1D,OAAO;EACL,GAAG;EACH,UAAU;CACZ;AACF,CAAC;AAID,MAAM,kBAAkB,YACtB,SACA,OACF,CAAC,CAAC;AAIF,MAAM,wBAAwB,aAC3B,EAAE,KAAK,aAAa,OAAO,GAAG,WAAW;CACxC,MAAM,EAAE,KAAK,UAAU,SAAS,eAAe,EAC7C,OAAO,OAAO,SAAS,KAAK,YAC9B,CAAC;CAED,OACE,qBAAA,YAAA,EAAA,UAAA,CACG,MAED,oBAAC,OAAO,OAAR;EACE,KAAK,UAAU,KAAK,QAAQ;EACf;EACN;EACP,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,GACA,CAAC,SAAS,QAAQ,CACpB,CAAC,CAAC;AAIF,MAAM,sBAAsB,YAC1B,QACA,WACF,CAAC,CAAC;AAMF,MAAM,iBAAiB,YAAwC,OAAO,MAAM,CAAC,CAC3E,KAAA,IACC,EAAE,UAAU,MAAM,GAAG,YAAY;CAChC,UAAU,QAAQ,YAAY,oBAAC,cAAD,CAAe,CAAA;CAC7C,GAAG;AACL,EACF;AAIA,MAAM,oBAAoB,YACxBC,gBACA,SACF,CAAC,CAAC"}
1
+ {"version":3,"file":"date-picker.js","names":["isArray","isObject","isDate","Popover.Root","InputGroup.Root","Popover.Trigger","InputGroup.Element","cast","Calendar.Root","Popover.Content"],"sources":["../../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { DatePickerStyle } from \"./date-picker.style\"\nimport type { UseDatePickerProps, UseDatePickerReturn } from \"./use-date-picker\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useFieldSizing } from \"../../hooks/use-field-sizing\"\nimport { cast, isArray, isDate, isObject, mergeRefs } from \"../../utils\"\nimport { Calendar } from \"../calendar\"\nimport { useGroupItemProps } from \"../group\"\nimport { CalendarIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { datePickerStyle } from \"./date-picker.style\"\nimport { useDatePicker } from \"./use-date-picker\"\n\ninterface ComponentContext\n extends\n Pick<UseDatePickerReturn, \"getInputProps\" | \"range\" | \"separator\">,\n Pick<DatePickerProps, \"inputProps\"> {}\n\nexport interface DatePickerProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<\n HTMLStyledProps,\n \"defaultValue\" | \"offset\" | \"onChange\" | \"ref\" | \"value\"\n >,\n Merge<UseDatePickerProps<Multiple, Range>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<DatePickerStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default true\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the date picker.\n */\n icon?: ReactNode\n /**\n * The placement of the popper relative to its reference.\n *\n * @default 'end-start'\n */\n placement?: Popover.RootProps[\"placement\"]\n /**\n * The size of the calendar component.\n */\n calendarProps?: Calendar.RootProps<Multiple, Range>\n /**\n * Props for content element.\n */\n contentProps?: DatePickerContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for icon element.\n */\n iconProps?: DatePickerIconProps\n /**\n * The props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: DatePickerPropsContext,\n useComponentContext,\n usePropsContext: useDatePickerPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DatePickerProps, DatePickerStyle, ComponentContext>(\n \"date-picker\",\n datePickerStyle,\n)\n\nexport { DatePickerPropsContext, useDatePickerPropsContext }\n\n/**\n * `DatePicker` is a component used for users to select a date.\n *\n * @see https://yamada-ui.com/docs/components/date-picker\n */\nexport const DatePicker = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: DatePickerProps<Multiple, Range>,\n ) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n size,\n animationScheme = \"block-start\",\n children,\n clearable = true,\n clearIcon = <XIcon />,\n duration,\n errorBorderColor,\n focusBorderColor,\n icon,\n calendarProps,\n contentProps,\n elementProps,\n iconProps,\n inputProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const {\n children: fieldChildren,\n range,\n separator,\n value,\n getCalendarProps,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n popoverProps,\n } = useDatePicker({ ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const selectProps = useMemo<Calendar.RootProps[\"selectProps\"]>(\n () => ({ contentProps: { portalProps: { disabled: true } } }),\n [],\n )\n const componentContext = useMemo(\n () => ({ range, separator, getInputProps, inputProps }),\n [getInputProps, inputProps, range, separator],\n )\n const hasValue = isArray(value)\n ? !!value.length\n : isObject(value) && !isDate(value)\n ? !!value.end || !!value.start\n : !!value\n\n return (\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <InputGroup.Root\n {...mergeProps(\n { className, css, colorScheme },\n getRootProps(groupItemProps),\n rootProps,\n )()}\n >\n <Popover.Trigger>\n <DatePickerField {...getFieldProps({ ...varProps })}>\n {fieldChildren}\n </DatePickerField>\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <DatePickerIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <DatePickerIcon icon={icon} {...getIconProps(iconProps)} />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <DatePickerContent\n {...cast<DatePickerContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n <Calendar.Root\n colorScheme={colorScheme}\n size={size}\n fixed={false}\n selectProps={selectProps}\n {...getCalendarProps(calendarProps)}\n >\n {children}\n </Calendar.Root>\n </DatePickerContent>\n </Popover.Root>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"size\"] },\n)((props) => {\n const context = useInputPropsContext()\n\n return mergeProps(context, props)()\n}) as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: DatePickerProps<Multiple, Range>,\n ): ReactElement\n}>\n\ninterface DatePickerFieldProps extends HTMLStyledProps {}\n\nconst DatePickerField = withContext<\"div\", DatePickerFieldProps>(\n \"div\",\n \"field\",\n)({ \"data-group-propagate\": \"\" }, ({ children, ...rest }) => {\n const { range, separator, getInputProps, inputProps } = useComponentContext()\n const computedChildren = useMemo(() => {\n if (range)\n return (\n <>\n <DatePickerAdjustInput\n {...getInputProps({ align: \"start\", ...inputProps })}\n />\n <DatePickerSeparator>{separator}</DatePickerSeparator>\n <DatePickerAdjustInput\n {...getInputProps({ align: \"end\", ...inputProps })}\n />\n </>\n )\n else\n return (\n <>\n {children}\n <DatePickerInput {...getInputProps(inputProps)} />\n </>\n )\n }, [children, getInputProps, inputProps, range, separator])\n\n return {\n ...rest,\n children: computedChildren,\n }\n})\n\ninterface DatePickerInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst DatePickerInput = withContext<\"input\", DatePickerInputProps>(\n \"input\",\n \"input\",\n)()\n\ninterface DatePickerAdjustInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst DatePickerAdjustInput = withContext<\"input\", DatePickerAdjustInputProps>(\n ({ ref, placeholder, value, ...rest }) => {\n const { ref: inputRef, text } = useFieldSizing({\n value: value?.toString() || placeholder,\n })\n\n return (\n <>\n {text}\n\n <styled.input\n ref={mergeRefs(ref, inputRef)}\n placeholder={placeholder}\n value={value}\n {...rest}\n />\n </>\n )\n },\n [\"input\", \"adjust\"],\n)()\n\ninterface DatePickerSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nconst DatePickerSeparator = withContext<\"span\", DatePickerSeparatorProps>(\n \"span\",\n \"separator\",\n)()\n\ninterface DatePickerIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst DatePickerIcon = withContext<\"div\", DatePickerIconProps>(\"div\", \"icon\")(\n undefined,\n ({ children, icon, ...rest }) => ({\n children: icon || children || <CalendarIcon />,\n ...rest,\n }),\n)\n\ninterface DatePickerContentProps extends Popover.ContentProps {}\n\nconst DatePickerContent = withContext<\"div\", DatePickerContentProps>(\n Popover.Content,\n \"content\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0FA,MAAM,EACJ,kBACA,cAAc,wBACd,qBACA,iBAAiB,2BACjB,aACA,iBACE,oBACF,eACA,eACF;;;;;;AASA,MAAa,aAAa,cAEtB,UACG;CACH,MAAM,CACJ,gBACA,EACE,WACA,KACA,aACA,MACA,kBAAkB,eAClB,UACA,YAAY,MACZ,YAAY,oBAAC,OAAD,CAAQ,CAAA,GACpB,UACA,kBACA,kBACA,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AAM,wBAAwB,aAC3B,EAAE,KAAK,aAAa,OAAO,GAAG,WAAW;CACxC,MAAM,EAAE,KAAK,UAAU,SAAS,eAAe,EAC7C,OAAO,OAAO,SAAS,KAAK,YAC9B,CAAC;CAED,OACE,qBAAA,YAAA,EAAA,UAAA,CACG,MAED,oBAAC,OAAO,OAAR;EACE,KAAK,UAAU,KAAK,QAAQ;EACf;EACN;EACP,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,GACA,CAAC,SAAS,QAAQ,CACpB,CAAC,CAAC;AAIF,MAAM,sBAAsB,YAC1B,QACA,WACF,CAAC,CAAC;AAMF,MAAM,iBAAiB,YAAwC,OAAO,MAAM,CAAC,CAC3E,KAAA,IACC,EAAE,UAAU,MAAM,GAAG,YAAY;CAChC,UAAU,QAAQ,YAAY,oBAAC,cAAD,CAAe,CAAA;CAC7C,GAAG;AACL,EACF;AAIA,MAAM,oBAAoB,YACxBC,gBACA,SACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-date-picker.js","names":[],"sources":["../../../../src/components/date-picker/use-date-picker.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n ChangeEvent,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n} from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { UseComboboxProps } from \"../../hooks/use-combobox\"\nimport type { Dict } from \"../../utils\"\nimport type {\n CalendarFormat,\n MaybeDateValue,\n UseCalendarProps,\n} from \"../calendar\"\nimport type { FieldProps } from \"../field\"\nimport dayjs from \"dayjs\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useEnvironment } from \"../../core\"\nimport { useCombobox } from \"../../hooks/use-combobox\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n cast,\n contains,\n dataAttr,\n focusTransfer,\n handlerAll,\n isActiveElement,\n isArray,\n isComposing,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runIfFn,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport {\n DEFAULT_MAX_DATE,\n DEFAULT_MIN_DATE,\n getAdjustedMonth,\n isAfterDate,\n isBeforeDate,\n isIncludeDates,\n updateMaybeDateValue,\n useCalendarProps,\n} from \"../calendar\"\nimport { useFieldProps } from \"../field\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport interface DatePickerFormat extends CalendarFormat {\n input?: Intl.DateTimeFormatOptions | null\n}\n\ntype InputAlign = \"end\" | \"start\"\ntype MaybeInputValue<Range extends boolean = false> = Range extends true\n ? { end?: string; start?: string }\n : string | undefined\n\ninterface DatePickerRenderProps {\n count: number\n date: Date\n focused: boolean\n index: number\n separator: string\n value: string\n onClear: () => void\n max?: number\n}\n\nexport interface DatePickerRender {\n (props: DatePickerRenderProps): ReactNode\n}\n\nconst defaultRender: DatePickerRender = ({\n count,\n focused,\n index,\n max,\n separator,\n value,\n}) => {\n const last = count - 1 === index\n\n return (\n <span style={{ marginInlineEnd: \"var(--gap)\" }}>\n {value}\n {((!isNumber(max) || count < max) && focused) || !last ? separator : null}\n </span>\n )\n}\n\nexport interface UseDatePickerProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<UseCalendarProps<Multiple, Range>, \"format\" | \"ref\">,\n Omit<\n UseComboboxProps,\n \"defaultValue\" | \"initialFocusValue\" | \"onChange\" | \"ref\" | \"value\"\n >,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * If `true`, allows input.\n *\n * @default true\n */\n allowInput?: boolean\n /**\n * If `true`, allows input of dates beyond the `minDate` and `maxDate` restrictions.\n *\n * @default true\n */\n allowInputBeyond?: boolean\n /**\n * If `true`, the date picker will be closed when the input value changes.\n *\n * @default false\n */\n closeOnChange?: ((ev: ChangeEvent<HTMLInputElement>) => boolean) | boolean\n /**\n * The initial value of the input.\n */\n defaultInputValue?: MaybeInputValue<Range>\n /**\n * If `true`, the input will be focused when the clear icon is clicked.\n *\n * @default true\n */\n focusOnClear?: 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?: DatePickerFormat\n /**\n * The `id` attribute of the input element.\n */\n id?: string\n /**\n * The value of the input.\n */\n inputValue?: MaybeInputValue<Range>\n /**\n * The `name` attribute of the input element.\n */\n name?: string\n /**\n * If `true`, the date picker will be opened when the input value changes.\n *\n * @default true\n */\n openOnChange?: ((ev: ChangeEvent<HTMLInputElement>) => boolean) | boolean\n /**\n * If `true`, the date picker will be opened when the input is focused.\n *\n * @default true\n */\n openOnFocus?: boolean\n /**\n * The pattern used to check the input element.\n */\n pattern?: RegExp\n /**\n * The placeholder for date picker.\n */\n placeholder?: string\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The callback invoked when input value state changes.\n */\n onInputChange?: (value: MaybeInputValue<Range>) => void\n /**\n * Function that converts the input value to Date type.\n */\n parseDate?: (value: string) => Date | undefined\n /**\n * The function to render the selected date.\n */\n render?: (props: DatePickerRenderProps) => ReactNode\n}\n\nexport const useDatePicker = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n ...props\n}: UseDatePickerProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { getDocument } = useEnvironment()\n const { locale: defaultLocale, t } = useI18n(\"datePicker\")\n const {\n props: {\n id,\n ref,\n name,\n allowInput = true,\n allowInputBeyond = false,\n closeOnChange = false,\n multiple = false,\n closeOnSelect = !multiple,\n defaultInputValue,\n defaultMonth = new Date(),\n range = false,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled,\n focusOnClear = true,\n format,\n inputValue: inputValueProp,\n locale = defaultLocale,\n max,\n month: monthProp,\n openOnChange = true,\n openOnClick = true,\n openOnFocus = true,\n parseDate,\n pattern,\n placeholder: placeholderProp,\n placement = \"end-start\",\n readOnly,\n render = defaultRender,\n required,\n separator = range ? \"-\" : \",\",\n value: valueProp,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n onInputChange: onInputChangeProp,\n ...computedProps\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const dateTimeFormat = useDateTimeFormat({ locale })\n const { calendarFormat, inputFormat } = useMemo(() => {\n const { input: inputFormat, ...calendarFormat } = format ?? {}\n const defaultInputFormat: Intl.DateTimeFormatOptions = {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n }\n\n return {\n calendarFormat,\n inputFormat:\n inputFormat !== null ? (inputFormat ?? defaultInputFormat) : undefined,\n }\n }, [format])\n const [calendarProps, rest] = useCalendarProps<Multiple, Range>(computedProps)\n const { excludeDate } = calendarProps\n const fieldRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const startInputRef = useRef<HTMLInputElement>(null)\n const endInputRef = useRef<HTMLInputElement>(null)\n const focusByClickRef = useRef<boolean>(false)\n const [focused, setFocused] = useState(false)\n const [value, setValue] = useControllableState({\n defaultValue: defaultValue as MaybeDateValue<Multiple, Range>,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n let value = defaultMonth\n\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n value = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) value = getAdjustedMonth(valueProp, value)\n else if (defaultValue) value = getAdjustedMonth(defaultValue, value)\n\n return value\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const stringToDate = useCallback(\n (value: string, start: Date = minDate, end: Date = maxDate) => {\n let date = parseDate?.(value)\n\n if (!date && dayjs(value).isValid())\n date = dayjs(value).locale(locale).toDate()\n\n if (date == null) return undefined\n if (excludeDate?.(date)) return undefined\n\n if (!allowInputBeyond) {\n if (isBeforeDate(date, start)) date = start\n if (isAfterDate(date, end)) date = end\n }\n\n return date\n },\n [allowInputBeyond, excludeDate, locale, maxDate, minDate, parseDate],\n )\n const dateToString = useCallback(\n (date?: Date) => {\n if (date == null) return \"\"\n\n return dateTimeFormat(date, inputFormat)\n },\n [dateTimeFormat, inputFormat],\n )\n const [inputValue, setInputValue] = useControllableState({\n defaultValue: () => {\n if (defaultInputValue)\n if (isObject(defaultInputValue)) {\n if (dayjs(defaultInputValue.start).isValid())\n defaultInputValue.start = dateTimeFormat(\n dayjs(defaultInputValue.start).toDate(),\n inputFormat,\n )\n\n if (dayjs(defaultInputValue.end).isValid())\n defaultInputValue.end = dateTimeFormat(\n dayjs(defaultInputValue.end).toDate(),\n inputFormat,\n )\n\n return defaultInputValue\n } else {\n if (dayjs(defaultInputValue).isValid())\n return dateTimeFormat(\n dayjs(defaultInputValue).toDate(),\n inputFormat,\n ) as MaybeInputValue<Range>\n else return defaultInputValue\n }\n else if (isDate(value))\n return dateToString(value) as MaybeInputValue<Range>\n else if (isObject(value) && !isArray(value))\n return {\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>\n else return \"\" as MaybeInputValue<Range>\n },\n value: inputValueProp,\n onChange: onInputChangeProp,\n })\n const {\n interactive,\n open,\n getContentProps: getComboboxContentProps,\n getTriggerProps,\n popoverProps,\n onClose,\n onOpen,\n } = useCombobox({\n disabled,\n matchWidth: false,\n openOnClick: false,\n openOnEnter: !allowInput,\n openOnSpace: !allowInput,\n placement,\n readOnly,\n transferFocus: false,\n ...ariaProps,\n ...dataProps,\n ...eventProps,\n ...rest,\n })\n const children = useMemo<ReactNode>(() => {\n if (!isArray(value)) return null\n\n const count = value.length\n\n return value.map((date, index) => {\n const value = dateToString(date)\n\n const onClear = (ev?: MouseEvent<HTMLElement>) => {\n ev?.preventDefault()\n ev?.stopPropagation()\n\n setValue(\n (prev) =>\n updateMaybeDateValue(date, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n }\n\n const component = render({\n count,\n date,\n focused,\n index,\n max,\n separator,\n value,\n onClear,\n })\n\n if (isValidElement<Dict>(component))\n return cloneElement(component, { ...component.props, key: index })\n else return component\n })\n }, [dateToString, focused, max, render, separator, setValue, value])\n const { endPlaceholder, startPlaceholder } = useMemo(() => {\n if (range) {\n const startPlaceholder =\n placeholderProp ?? dateTimeFormat(new Date(), inputFormat)\n const endPlaceholder =\n placeholderProp ??\n dateTimeFormat(dayjs().add(1, \"day\").toDate(), inputFormat)\n\n return { endPlaceholder, startPlaceholder }\n } else {\n const placeholder =\n placeholderProp ?? dateTimeFormat(new Date(), inputFormat)\n\n return { endPlaceholder: placeholder, startPlaceholder: placeholder }\n }\n }, [dateTimeFormat, inputFormat, placeholderProp, range])\n\n const onChange = useCallback(\n (value: MaybeDateValue<Multiple, Range>) => {\n setValue(value)\n\n if (isArray(value)) setInputValue(\"\" as MaybeInputValue<Range>)\n else if (isObject(value) && !isDate(value))\n setInputValue({\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>)\n else setInputValue(dateToString(value) as MaybeInputValue<Range>)\n\n if (!closeOnSelect) return\n\n if (isObject(value) && !isArray(value) && !isDate(value)) {\n if (value.end && value.start) onClose()\n } else {\n onClose()\n }\n },\n [setValue, closeOnSelect, setInputValue, dateToString, onClose],\n )\n\n const onInputChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!allowInput) return\n if (isArray(value) && value.length === max) return\n\n if (runIfFn(closeOnChange, ev)) onClose()\n else if (runIfFn(openOnChange, ev)) onOpen()\n\n let inputValue = ev.target.value\n\n if (pattern) inputValue = inputValue.replace(pattern, \"\")\n\n if (isArray(value)) {\n const date = stringToDate(inputValue)\n\n setInputValue(inputValue as MaybeInputValue<Range>)\n\n if (date) setMonth(dayjs(date).set(\"date\", 1).toDate())\n } else if (isObject(value) && !isDate(value)) {\n const align = contains(endInputRef.current, ev.target) ? \"end\" : \"start\"\n const minDate =\n value.start && align === \"end\"\n ? dayjs(value.start).add(1, \"day\").toDate()\n : undefined\n const maxDate =\n value.end && align === \"start\"\n ? dayjs(value.end).subtract(1, \"day\").toDate()\n : undefined\n const date = stringToDate(inputValue, minDate, maxDate)\n\n setInputValue((prev) =>\n isObject(prev)\n ? Object.assign({}, prev, { [align]: inputValue })\n : prev,\n )\n setValue((prev) =>\n isObject(prev) && !isDate(prev) ? { ...prev, [align]: date } : prev,\n )\n } else {\n const date = stringToDate(inputValue)\n\n setInputValue(inputValue as MaybeInputValue<Range>)\n setValue(date as MaybeDateValue<Multiple, Range>)\n }\n },\n [\n allowInput,\n closeOnChange,\n max,\n onClose,\n onOpen,\n openOnChange,\n pattern,\n setInputValue,\n setMonth,\n setValue,\n stringToDate,\n value,\n ],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLInputElement>) => {\n if (disabled || isComposing(ev)) return\n\n const inputValue = cast<HTMLInputElement>(ev.target).value\n\n runKeyAction(\n ev,\n {\n Backspace: (ev) => {\n if (isArray(value)) {\n if (inputValue.length) return\n\n ev.preventDefault()\n\n setValue((prev) =>\n isArray(prev)\n ? (prev.slice(0, -1) as MaybeDateValue<Multiple, Range>)\n : prev,\n )\n } else if (isObject(value) && !isDate(value)) {\n if (inputValue.length) return\n if (!contains(endInputRef.current, ev.target)) return\n\n ev.preventDefault()\n\n setInputValue({ end: \"\", start: \"\" } as MaybeInputValue<Range>)\n setValue({ end: undefined, start: undefined } as MaybeDateValue<\n Multiple,\n Range\n >)\n\n startInputRef.current?.focus()\n }\n },\n Enter: (ev) => {\n if (!open || !inputValue.length) return\n\n if (isObject(value) && !isArray(value) && !isDate(value)) {\n const align = contains(endInputRef.current, ev.target)\n ? \"end\"\n : \"start\"\n const minDate =\n value.start && align === \"end\"\n ? dayjs(value.start).add(1, \"day\").toDate()\n : undefined\n const maxDate =\n value.end && align === \"start\"\n ? dayjs(value.end).subtract(1, \"day\").toDate()\n : undefined\n const date = stringToDate(inputValue, minDate, maxDate)\n\n if (!date) return\n\n ev.preventDefault()\n\n setInputValue((prev) =>\n isObject(prev)\n ? Object.assign({}, prev, { [align]: dateToString(date) })\n : prev,\n )\n setValue((prev) =>\n isObject(prev) && !isDate(prev)\n ? { ...prev, [align]: date }\n : prev,\n )\n\n if (align === \"start\") endInputRef.current?.focus()\n } else {\n const date = stringToDate(inputValue)\n\n if (!date) return\n\n ev.preventDefault()\n\n if (isArray(value)) {\n setInputValue(\"\" as MaybeInputValue<Range>)\n\n setValue((prev) =>\n isArray(prev) &&\n !isIncludeDates(date, prev) &&\n (!isNumber(max) || prev.length < max)\n ? ([...prev, date] as MaybeDateValue<Multiple, Range>)\n : prev,\n )\n } else {\n setInputValue(dateToString(date) as MaybeInputValue<Range>)\n setValue(date as MaybeDateValue<Multiple, Range>)\n }\n }\n },\n },\n { preventDefault: false },\n )\n },\n [\n dateToString,\n disabled,\n max,\n open,\n setInputValue,\n setValue,\n stringToDate,\n value,\n ],\n )\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n if (!interactive) return\n\n focusByClickRef.current = true\n\n if (allowInput)\n if (isObject(value) && !isArray(value) && !isDate(value))\n if (\n startInputRef.current &&\n contains(startInputRef.current, ev.target)\n ) {\n if (!isActiveElement(startInputRef.current, getDocument()!))\n ev.defaultPrevented = true\n\n startInputRef.current.focus()\n } else if (\n endInputRef.current &&\n contains(endInputRef.current, ev.target)\n ) {\n if (!isActiveElement(endInputRef.current, getDocument()!))\n ev.defaultPrevented = true\n\n endInputRef.current.focus()\n } else {\n startInputRef.current?.focus()\n }\n else startInputRef.current?.focus()\n\n if (openOnClick) onOpen()\n },\n [allowInput, interactive, onOpen, openOnClick, value, getDocument],\n )\n\n const onMouseDown = useCallback(\n (ev: MouseEvent<HTMLDivElement | HTMLInputElement>) => {\n if (!openOnFocus) return\n\n ev.preventDefault()\n ev.stopPropagation()\n },\n [openOnFocus],\n )\n\n const onFieldFocus = useCallback(() => {\n if (allowInput) return\n\n if (openOnFocus) onOpen()\n\n focusByClickRef.current = false\n }, [allowInput, onOpen, openOnFocus])\n\n const onInputFocus = useCallback(\n (ev: FocusEvent<HTMLInputElement>) => {\n ev.preventDefault()\n ev.stopPropagation()\n\n setFocused(true)\n\n if (openOnFocus && !focusByClickRef.current) onOpen()\n\n focusByClickRef.current = false\n },\n [onOpen, openOnFocus],\n )\n\n const onBlur = useCallback(\n (ev: FocusEvent<HTMLInputElement>) => {\n setFocused(false)\n\n if (\n contains(fieldRef.current, ev.relatedTarget) ||\n contains(contentRef.current, ev.relatedTarget)\n )\n ev.preventDefault()\n else if (isArray(value)) setInputValue(\"\" as MaybeInputValue<Range>)\n else if (isObject(value) && !isDate(value))\n setInputValue((prev) =>\n isObject(prev)\n ? ({\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>)\n : prev,\n )\n else setInputValue(dateToString(value) as MaybeInputValue<Range>)\n },\n [dateToString, setInputValue, value],\n )\n\n const onClear = useCallback(() => {\n if (!interactive) return\n\n setValue((prev) => {\n if (isDate(prev)) return undefined as MaybeDateValue<Multiple, Range>\n else if (isArray(prev))\n return [] as unknown as MaybeDateValue<Multiple, Range>\n else if (isObject(prev))\n return { end: undefined, start: undefined } as MaybeDateValue<\n Multiple,\n Range\n >\n else return prev\n })\n\n setInputValue(\n (range ? { end: \"\", start: \"\" } : \"\") as MaybeInputValue<Range>,\n )\n\n if (focusOnClear)\n if (allowInput) startInputRef.current?.focus()\n else fieldRef.current?.focus()\n }, [allowInput, focusOnClear, interactive, range, setInputValue, setValue])\n\n useEffect(() => {\n if (!open) return\n\n return focusTransfer(\n contentRef.current,\n allowInput ? startInputRef.current : fieldRef.current,\n )\n }, [allowInput, open])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value, range])\n\n useUpdateEffect(() => {\n if (isArray(valueProp)) return\n\n if (isObject(valueProp) && !isDate(valueProp))\n setInputValue({\n end: dateToString(valueProp.end),\n start: dateToString(valueProp.start),\n } as MaybeInputValue<Range>)\n else setInputValue(dateToString(valueProp) as MaybeInputValue<Range>)\n }, [valueProp])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({\n \"data-range\": dataAttr(range),\n ...dataProps,\n ...props,\n }),\n [dataProps, range],\n )\n\n const getFieldProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) =>\n getTriggerProps({\n ref: mergeRefs(ref, fieldRef),\n \"aria-haspopup\": \"dialog\",\n tabIndex: !allowInput ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFieldFocus),\n onMouseDown: handlerAll(props.onMouseDown, onMouseDown),\n }),\n\n [allowInput, getTriggerProps, onClick, onFieldFocus, onMouseDown],\n )\n\n const getInputProps: PropGetter<\"input\", { align?: InputAlign }> =\n useCallback(\n ({ align = \"start\", ...props } = {}) => {\n const inputProps: HTMLProps<\"input\"> = {\n style: {\n ...(!allowInput ? { pointerEvents: \"none\" } : {}),\n ...props.style,\n },\n autoComplete: \"off\",\n disabled,\n readOnly,\n required,\n tabIndex: allowInput ? 0 : -1,\n ...dataProps,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onChange: handlerAll(props.onChange, onInputChange),\n onFocus: handlerAll(props.onFocus, onInputFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onMouseDown: handlerAll(props.onMouseDown, onMouseDown),\n }\n\n if (isObject(inputValue)) {\n if (align === \"start\") {\n inputProps.ref = mergeRefs(props.ref, ref, startInputRef)\n inputProps.value = inputValue.start\n inputProps.placeholder = startPlaceholder\n } else {\n inputProps.ref = mergeRefs(props.ref, ref, endInputRef)\n inputProps.value = inputValue.end\n inputProps.placeholder = endPlaceholder\n }\n\n if (!inputValue.start && align === \"start\") {\n inputProps.id = id\n inputProps.name = name\n }\n\n if (!!inputValue.start && align === \"end\") {\n inputProps.id = id\n inputProps.name = name\n }\n } else {\n inputProps.ref = mergeRefs(props.ref, ref, startInputRef)\n inputProps.value = inputValue\n inputProps.id = id\n inputProps.name = name\n\n if (isArray(value)) {\n inputProps.style = {\n ...(!focused && !!value.length\n ? visuallyHiddenAttributes.style\n : {}),\n ...inputProps.style,\n }\n inputProps.placeholder = !value.length\n ? startPlaceholder\n : undefined\n inputProps[\"data-max\"] = dataAttr(\n isNumber(max) && value.length >= max,\n )\n } else {\n inputProps.placeholder = startPlaceholder\n }\n }\n\n return inputProps\n },\n [\n allowInput,\n dataProps,\n disabled,\n endPlaceholder,\n focused,\n id,\n inputValue,\n max,\n name,\n onBlur,\n onInputFocus,\n onInputChange,\n onKeyDown,\n onMouseDown,\n readOnly,\n ref,\n required,\n startPlaceholder,\n value,\n ],\n )\n\n const getContentProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) =>\n getComboboxContentProps({\n ref: mergeRefs(ref, contentRef),\n role: \"dialog\",\n ...props,\n }),\n [getComboboxContentProps],\n )\n\n const getCalendarProps: PropGetter<UseCalendarProps<Multiple, Range>> =\n useCallback(\n (props) =>\n ({\n disabled: !interactive,\n format: calendarFormat,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n value,\n onChange,\n onChangeMonth: setMonth,\n ...calendarProps,\n ...props,\n }) as UseCalendarProps<Multiple, Range>,\n [\n interactive,\n calendarFormat,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n value,\n onChange,\n setMonth,\n calendarProps,\n ],\n )\n\n const getIconProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getClearIconProps: PropGetter = useCallback(\n (props = {}) =>\n getIconProps({\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-label\": t(\"Clear value\"),\n role: \"button\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClear),\n onKeyDown: handlerAll(props.onKeyDown, (ev) =>\n runKeyAction(ev, { Enter: onClear, Space: onClear }),\n ),\n }),\n [getIconProps, interactive, onClear, t],\n )\n\n return {\n children,\n dateToString,\n inputValue,\n interactive,\n month,\n open,\n range,\n separator,\n setInputValue,\n setMonth,\n setValue,\n stringToDate,\n value,\n getCalendarProps,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n popoverProps,\n onChange,\n onClose,\n onInputChange,\n onOpen,\n }\n}\n\nexport type UseDatePickerReturn = ReturnType<typeof useDatePicker>\n"],"mappings":";;;;;;;;;;;;;;;;AAwFA,MAAM,iBAAmC,EACvC,OACA,SACA,OACA,KACA,WACA,YACI;CACJ,MAAM,OAAO,QAAQ,MAAM;CAE3B,OACE,qBAAC,QAAD;EAAM,OAAO,EAAE,iBAAiB,aAAa;EAA7C,UAAA,CACG,QACE,EAAA,GAAA,cAAA,SAAA,CAAU,GAAG,KAAK,QAAQ,QAAQ,WAAY,CAAC,OAAO,YAAY,IACjE;;AAEV;AAqGA,MAAa,iBAGX,EACA,UAAU,kBACV,UAAU,kBACV,GAAG,UACoC,CAAC,MAAM;CAC9C,IAAI,MAAM,OAAO,CAAC,CAAC,QAAQ,MAAM,OAAO,CAAC,GAAG,UAAU;CAEtD,MAAM,EAAE,gBAAgB,eAAe;CACvC,MAAM,EAAE,QAAQ,eAAe,MAAM,QAAQ,YAAY;CACzD,MAAM,EACJ,OAAO,EACL,IACA,KACA,MACA,aAAa,MACb,mBAAmB,OACnB,gBAAgB,OAChB,WAAW,OACX,gBAAgB,CAAC,UACjB,mBACA,+BAAe,IAAI,KAAK,GACxB,QAAQ,OACR,eAAgB,QACZ;EAAE,KAAK,KAAA;EAAW,OAAO,KAAA;CAAU,IACnC,WACE,CAAC,IACD,KAAA,GACN,UACA,eAAe,MACf,QACA,YAAY,gBACZ,SAAS,eACT,KACA,OAAO,WACP,eAAe,MACf,cAAc,MACd,cAAc,MACd,WACA,SACA,aAAa,iBACb,YAAY,aAC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Ac;GAAa;GAAS;EAAC,CAkBtB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-date-picker.js","names":["isNumber","isObject","isDate","isArray","runIfFn","contains","cast","isActiveElement","focusTransfer","dataAttr","handlerAll","ariaAttr"],"sources":["../../../../src/components/date-picker/use-date-picker.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n ChangeEvent,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n} from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { UseComboboxProps } from \"../../hooks/use-combobox\"\nimport type { Dict } from \"../../utils\"\nimport type {\n CalendarFormat,\n MaybeDateValue,\n UseCalendarProps,\n} from \"../calendar\"\nimport type { FieldProps } from \"../field\"\nimport dayjs from \"dayjs\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { useEnvironment } from \"../../core\"\nimport { useCombobox } from \"../../hooks/use-combobox\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n cast,\n contains,\n dataAttr,\n focusTransfer,\n handlerAll,\n isActiveElement,\n isArray,\n isComposing,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runIfFn,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport {\n DEFAULT_MAX_DATE,\n DEFAULT_MIN_DATE,\n getAdjustedMonth,\n isAfterDate,\n isBeforeDate,\n isIncludeDates,\n updateMaybeDateValue,\n useCalendarProps,\n} from \"../calendar\"\nimport { useFieldProps } from \"../field\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport interface DatePickerFormat extends CalendarFormat {\n input?: Intl.DateTimeFormatOptions | null\n}\n\ntype InputAlign = \"end\" | \"start\"\ntype MaybeInputValue<Range extends boolean = false> = Range extends true\n ? { end?: string; start?: string }\n : string | undefined\n\ninterface DatePickerRenderProps {\n count: number\n date: Date\n focused: boolean\n index: number\n separator: string\n value: string\n onClear: () => void\n max?: number\n}\n\nexport interface DatePickerRender {\n (props: DatePickerRenderProps): ReactNode\n}\n\nconst defaultRender: DatePickerRender = ({\n count,\n focused,\n index,\n max,\n separator,\n value,\n}) => {\n const last = count - 1 === index\n\n return (\n <span style={{ marginInlineEnd: \"var(--gap)\" }}>\n {value}\n {((!isNumber(max) || count < max) && focused) || !last ? separator : null}\n </span>\n )\n}\n\nexport interface UseDatePickerProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<UseCalendarProps<Multiple, Range>, \"format\" | \"ref\">,\n Omit<\n UseComboboxProps,\n \"defaultValue\" | \"initialFocusValue\" | \"onChange\" | \"ref\" | \"value\"\n >,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * If `true`, allows input.\n *\n * @default true\n */\n allowInput?: boolean\n /**\n * If `true`, allows input of dates beyond the `minDate` and `maxDate` restrictions.\n *\n * @default true\n */\n allowInputBeyond?: boolean\n /**\n * If `true`, the date picker will be closed when the input value changes.\n *\n * @default false\n */\n closeOnChange?: ((ev: ChangeEvent<HTMLInputElement>) => boolean) | boolean\n /**\n * The initial value of the input.\n */\n defaultInputValue?: MaybeInputValue<Range>\n /**\n * If `true`, the input will be focused when the clear icon is clicked.\n *\n * @default true\n */\n focusOnClear?: 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?: DatePickerFormat\n /**\n * The `id` attribute of the input element.\n */\n id?: string\n /**\n * The value of the input.\n */\n inputValue?: MaybeInputValue<Range>\n /**\n * The `name` attribute of the input element.\n */\n name?: string\n /**\n * If `true`, the date picker will be opened when the input value changes.\n *\n * @default true\n */\n openOnChange?: ((ev: ChangeEvent<HTMLInputElement>) => boolean) | boolean\n /**\n * If `true`, the date picker will be opened when the input is focused.\n *\n * @default true\n */\n openOnFocus?: boolean\n /**\n * The pattern used to check the input element.\n */\n pattern?: RegExp\n /**\n * The placeholder for date picker.\n */\n placeholder?: string\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The callback invoked when input value state changes.\n */\n onInputChange?: (value: MaybeInputValue<Range>) => void\n /**\n * Function that converts the input value to Date type.\n */\n parseDate?: (value: string) => Date | undefined\n /**\n * The function to render the selected date.\n */\n render?: (props: DatePickerRenderProps) => ReactNode\n}\n\nexport const useDatePicker = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n ...props\n}: UseDatePickerProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { getDocument } = useEnvironment()\n const { locale: defaultLocale, t } = useI18n(\"datePicker\")\n const {\n props: {\n id,\n ref,\n name,\n allowInput = true,\n allowInputBeyond = false,\n closeOnChange = false,\n multiple = false,\n closeOnSelect = !multiple,\n defaultInputValue,\n defaultMonth = new Date(),\n range = false,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled,\n focusOnClear = true,\n format,\n inputValue: inputValueProp,\n locale = defaultLocale,\n max,\n month: monthProp,\n openOnChange = true,\n openOnClick = true,\n openOnFocus = true,\n parseDate,\n pattern,\n placeholder: placeholderProp,\n placement = \"end-start\",\n readOnly,\n render = defaultRender,\n required,\n separator = range ? \"-\" : \",\",\n value: valueProp,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n onInputChange: onInputChangeProp,\n ...computedProps\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const dateTimeFormat = useDateTimeFormat({ locale })\n const { calendarFormat, inputFormat } = useMemo(() => {\n const { input: inputFormat, ...calendarFormat } = format ?? {}\n const defaultInputFormat: Intl.DateTimeFormatOptions = {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n }\n\n return {\n calendarFormat,\n inputFormat:\n inputFormat !== null ? (inputFormat ?? defaultInputFormat) : undefined,\n }\n }, [format])\n const [calendarProps, rest] = useCalendarProps<Multiple, Range>(computedProps)\n const { excludeDate } = calendarProps\n const fieldRef = useRef<HTMLDivElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const startInputRef = useRef<HTMLInputElement>(null)\n const endInputRef = useRef<HTMLInputElement>(null)\n const focusByClickRef = useRef<boolean>(false)\n const [focused, setFocused] = useState(false)\n const [value, setValue] = useControllableState({\n defaultValue: defaultValue as MaybeDateValue<Multiple, Range>,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n let value = defaultMonth\n\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n value = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) value = getAdjustedMonth(valueProp, value)\n else if (defaultValue) value = getAdjustedMonth(defaultValue, value)\n\n return value\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const stringToDate = useCallback(\n (value: string, start: Date = minDate, end: Date = maxDate) => {\n let date = parseDate?.(value)\n\n if (!date && dayjs(value).isValid())\n date = dayjs(value).locale(locale).toDate()\n\n if (date == null) return undefined\n if (excludeDate?.(date)) return undefined\n\n if (!allowInputBeyond) {\n if (isBeforeDate(date, start)) date = start\n if (isAfterDate(date, end)) date = end\n }\n\n return date\n },\n [allowInputBeyond, excludeDate, locale, maxDate, minDate, parseDate],\n )\n const dateToString = useCallback(\n (date?: Date) => {\n if (date == null) return \"\"\n\n return dateTimeFormat(date, inputFormat)\n },\n [dateTimeFormat, inputFormat],\n )\n const [inputValue, setInputValue] = useControllableState({\n defaultValue: () => {\n if (defaultInputValue)\n if (isObject(defaultInputValue)) {\n if (dayjs(defaultInputValue.start).isValid())\n defaultInputValue.start = dateTimeFormat(\n dayjs(defaultInputValue.start).toDate(),\n inputFormat,\n )\n\n if (dayjs(defaultInputValue.end).isValid())\n defaultInputValue.end = dateTimeFormat(\n dayjs(defaultInputValue.end).toDate(),\n inputFormat,\n )\n\n return defaultInputValue\n } else {\n if (dayjs(defaultInputValue).isValid())\n return dateTimeFormat(\n dayjs(defaultInputValue).toDate(),\n inputFormat,\n ) as MaybeInputValue<Range>\n else return defaultInputValue\n }\n else if (isDate(value))\n return dateToString(value) as MaybeInputValue<Range>\n else if (isObject(value) && !isArray(value))\n return {\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>\n else return \"\" as MaybeInputValue<Range>\n },\n value: inputValueProp,\n onChange: onInputChangeProp,\n })\n const {\n interactive,\n open,\n getContentProps: getComboboxContentProps,\n getTriggerProps,\n popoverProps,\n onClose,\n onOpen,\n } = useCombobox({\n disabled,\n matchWidth: false,\n openOnClick: false,\n openOnEnter: !allowInput,\n openOnSpace: !allowInput,\n placement,\n readOnly,\n transferFocus: false,\n ...ariaProps,\n ...dataProps,\n ...eventProps,\n ...rest,\n })\n const children = useMemo<ReactNode>(() => {\n if (!isArray(value)) return null\n\n const count = value.length\n\n return value.map((date, index) => {\n const value = dateToString(date)\n\n const onClear = (ev?: MouseEvent<HTMLElement>) => {\n ev?.preventDefault()\n ev?.stopPropagation()\n\n setValue(\n (prev) =>\n updateMaybeDateValue(date, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n }\n\n const component = render({\n count,\n date,\n focused,\n index,\n max,\n separator,\n value,\n onClear,\n })\n\n if (isValidElement<Dict>(component))\n return cloneElement(component, { ...component.props, key: index })\n else return component\n })\n }, [dateToString, focused, max, render, separator, setValue, value])\n const { endPlaceholder, startPlaceholder } = useMemo(() => {\n if (range) {\n const startPlaceholder =\n placeholderProp ?? dateTimeFormat(new Date(), inputFormat)\n const endPlaceholder =\n placeholderProp ??\n dateTimeFormat(dayjs().add(1, \"day\").toDate(), inputFormat)\n\n return { endPlaceholder, startPlaceholder }\n } else {\n const placeholder =\n placeholderProp ?? dateTimeFormat(new Date(), inputFormat)\n\n return { endPlaceholder: placeholder, startPlaceholder: placeholder }\n }\n }, [dateTimeFormat, inputFormat, placeholderProp, range])\n\n const onChange = useCallback(\n (value: MaybeDateValue<Multiple, Range>) => {\n setValue(value)\n\n if (isArray(value)) setInputValue(\"\" as MaybeInputValue<Range>)\n else if (isObject(value) && !isDate(value))\n setInputValue({\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>)\n else setInputValue(dateToString(value) as MaybeInputValue<Range>)\n\n if (!closeOnSelect) return\n\n if (isObject(value) && !isArray(value) && !isDate(value)) {\n if (value.end && value.start) onClose()\n } else {\n onClose()\n }\n },\n [setValue, closeOnSelect, setInputValue, dateToString, onClose],\n )\n\n const onInputChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!allowInput) return\n if (isArray(value) && value.length === max) return\n\n if (runIfFn(closeOnChange, ev)) onClose()\n else if (runIfFn(openOnChange, ev)) onOpen()\n\n let inputValue = ev.target.value\n\n if (pattern) inputValue = inputValue.replace(pattern, \"\")\n\n if (isArray(value)) {\n const date = stringToDate(inputValue)\n\n setInputValue(inputValue as MaybeInputValue<Range>)\n\n if (date) setMonth(dayjs(date).set(\"date\", 1).toDate())\n } else if (isObject(value) && !isDate(value)) {\n const align = contains(endInputRef.current, ev.target) ? \"end\" : \"start\"\n const minDate =\n value.start && align === \"end\"\n ? dayjs(value.start).add(1, \"day\").toDate()\n : undefined\n const maxDate =\n value.end && align === \"start\"\n ? dayjs(value.end).subtract(1, \"day\").toDate()\n : undefined\n const date = stringToDate(inputValue, minDate, maxDate)\n\n setInputValue((prev) =>\n isObject(prev)\n ? Object.assign({}, prev, { [align]: inputValue })\n : prev,\n )\n setValue((prev) =>\n isObject(prev) && !isDate(prev) ? { ...prev, [align]: date } : prev,\n )\n } else {\n const date = stringToDate(inputValue)\n\n setInputValue(inputValue as MaybeInputValue<Range>)\n setValue(date as MaybeDateValue<Multiple, Range>)\n }\n },\n [\n allowInput,\n closeOnChange,\n max,\n onClose,\n onOpen,\n openOnChange,\n pattern,\n setInputValue,\n setMonth,\n setValue,\n stringToDate,\n value,\n ],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLInputElement>) => {\n if (disabled || isComposing(ev)) return\n\n const inputValue = cast<HTMLInputElement>(ev.target).value\n\n runKeyAction(\n ev,\n {\n Backspace: (ev) => {\n if (isArray(value)) {\n if (inputValue.length) return\n\n ev.preventDefault()\n\n setValue((prev) =>\n isArray(prev)\n ? (prev.slice(0, -1) as MaybeDateValue<Multiple, Range>)\n : prev,\n )\n } else if (isObject(value) && !isDate(value)) {\n if (inputValue.length) return\n if (!contains(endInputRef.current, ev.target)) return\n\n ev.preventDefault()\n\n setInputValue({ end: \"\", start: \"\" } as MaybeInputValue<Range>)\n setValue({ end: undefined, start: undefined } as MaybeDateValue<\n Multiple,\n Range\n >)\n\n startInputRef.current?.focus()\n }\n },\n Enter: (ev) => {\n if (!open || !inputValue.length) return\n\n if (isObject(value) && !isArray(value) && !isDate(value)) {\n const align = contains(endInputRef.current, ev.target)\n ? \"end\"\n : \"start\"\n const minDate =\n value.start && align === \"end\"\n ? dayjs(value.start).add(1, \"day\").toDate()\n : undefined\n const maxDate =\n value.end && align === \"start\"\n ? dayjs(value.end).subtract(1, \"day\").toDate()\n : undefined\n const date = stringToDate(inputValue, minDate, maxDate)\n\n if (!date) return\n\n ev.preventDefault()\n\n setInputValue((prev) =>\n isObject(prev)\n ? Object.assign({}, prev, { [align]: dateToString(date) })\n : prev,\n )\n setValue((prev) =>\n isObject(prev) && !isDate(prev)\n ? { ...prev, [align]: date }\n : prev,\n )\n\n if (align === \"start\") endInputRef.current?.focus()\n } else {\n const date = stringToDate(inputValue)\n\n if (!date) return\n\n ev.preventDefault()\n\n if (isArray(value)) {\n setInputValue(\"\" as MaybeInputValue<Range>)\n\n setValue((prev) =>\n isArray(prev) &&\n !isIncludeDates(date, prev) &&\n (!isNumber(max) || prev.length < max)\n ? ([...prev, date] as MaybeDateValue<Multiple, Range>)\n : prev,\n )\n } else {\n setInputValue(dateToString(date) as MaybeInputValue<Range>)\n setValue(date as MaybeDateValue<Multiple, Range>)\n }\n }\n },\n },\n { preventDefault: false },\n )\n },\n [\n dateToString,\n disabled,\n max,\n open,\n setInputValue,\n setValue,\n stringToDate,\n value,\n ],\n )\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n if (!interactive) return\n\n focusByClickRef.current = true\n\n if (allowInput)\n if (isObject(value) && !isArray(value) && !isDate(value))\n if (\n startInputRef.current &&\n contains(startInputRef.current, ev.target)\n ) {\n if (!isActiveElement(startInputRef.current, getDocument()!))\n ev.defaultPrevented = true\n\n startInputRef.current.focus()\n } else if (\n endInputRef.current &&\n contains(endInputRef.current, ev.target)\n ) {\n if (!isActiveElement(endInputRef.current, getDocument()!))\n ev.defaultPrevented = true\n\n endInputRef.current.focus()\n } else {\n startInputRef.current?.focus()\n }\n else startInputRef.current?.focus()\n\n if (openOnClick) onOpen()\n },\n [allowInput, interactive, onOpen, openOnClick, value, getDocument],\n )\n\n const onMouseDown = useCallback(\n (ev: MouseEvent<HTMLDivElement | HTMLInputElement>) => {\n if (!openOnFocus) return\n\n ev.preventDefault()\n ev.stopPropagation()\n },\n [openOnFocus],\n )\n\n const onFieldFocus = useCallback(() => {\n if (allowInput) return\n\n if (openOnFocus) onOpen()\n\n focusByClickRef.current = false\n }, [allowInput, onOpen, openOnFocus])\n\n const onInputFocus = useCallback(\n (ev: FocusEvent<HTMLInputElement>) => {\n ev.preventDefault()\n ev.stopPropagation()\n\n setFocused(true)\n\n if (openOnFocus && !focusByClickRef.current) onOpen()\n\n focusByClickRef.current = false\n },\n [onOpen, openOnFocus],\n )\n\n const onBlur = useCallback(\n (ev: FocusEvent<HTMLInputElement>) => {\n setFocused(false)\n\n if (\n contains(fieldRef.current, ev.relatedTarget) ||\n contains(contentRef.current, ev.relatedTarget)\n )\n ev.preventDefault()\n else if (isArray(value)) setInputValue(\"\" as MaybeInputValue<Range>)\n else if (isObject(value) && !isDate(value))\n setInputValue((prev) =>\n isObject(prev)\n ? ({\n end: dateToString(value.end),\n start: dateToString(value.start),\n } as MaybeInputValue<Range>)\n : prev,\n )\n else setInputValue(dateToString(value) as MaybeInputValue<Range>)\n },\n [dateToString, setInputValue, value],\n )\n\n const onClear = useCallback(() => {\n if (!interactive) return\n\n setValue((prev) => {\n if (isDate(prev)) return undefined as MaybeDateValue<Multiple, Range>\n else if (isArray(prev))\n return [] as unknown as MaybeDateValue<Multiple, Range>\n else if (isObject(prev))\n return { end: undefined, start: undefined } as MaybeDateValue<\n Multiple,\n Range\n >\n else return prev\n })\n\n setInputValue(\n (range ? { end: \"\", start: \"\" } : \"\") as MaybeInputValue<Range>,\n )\n\n if (focusOnClear)\n if (allowInput) startInputRef.current?.focus()\n else fieldRef.current?.focus()\n }, [allowInput, focusOnClear, interactive, range, setInputValue, setValue])\n\n useEffect(() => {\n if (!open) return\n\n return focusTransfer(\n contentRef.current,\n allowInput ? startInputRef.current : fieldRef.current,\n )\n }, [allowInput, open])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value, range])\n\n useUpdateEffect(() => {\n if (isArray(valueProp)) return\n\n if (isObject(valueProp) && !isDate(valueProp))\n setInputValue({\n end: dateToString(valueProp.end),\n start: dateToString(valueProp.start),\n } as MaybeInputValue<Range>)\n else setInputValue(dateToString(valueProp) as MaybeInputValue<Range>)\n }, [valueProp])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({\n \"data-range\": dataAttr(range),\n ...dataProps,\n ...props,\n }),\n [dataProps, range],\n )\n\n const getFieldProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) =>\n getTriggerProps({\n ref: mergeRefs(ref, fieldRef),\n \"aria-haspopup\": \"dialog\",\n tabIndex: !allowInput ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClick),\n onFocus: handlerAll(props.onFocus, onFieldFocus),\n onMouseDown: handlerAll(props.onMouseDown, onMouseDown),\n }),\n\n [allowInput, getTriggerProps, onClick, onFieldFocus, onMouseDown],\n )\n\n const getInputProps: PropGetter<\"input\", { align?: InputAlign }> =\n useCallback(\n ({ align = \"start\", ...props } = {}) => {\n const inputProps: HTMLProps<\"input\"> = {\n style: {\n ...(!allowInput ? { pointerEvents: \"none\" } : {}),\n ...props.style,\n },\n autoComplete: \"off\",\n disabled,\n readOnly,\n required,\n tabIndex: allowInput ? 0 : -1,\n ...dataProps,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onChange: handlerAll(props.onChange, onInputChange),\n onFocus: handlerAll(props.onFocus, onInputFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n onMouseDown: handlerAll(props.onMouseDown, onMouseDown),\n }\n\n if (isObject(inputValue)) {\n if (align === \"start\") {\n inputProps.ref = mergeRefs(props.ref, ref, startInputRef)\n inputProps.value = inputValue.start\n inputProps.placeholder = startPlaceholder\n } else {\n inputProps.ref = mergeRefs(props.ref, ref, endInputRef)\n inputProps.value = inputValue.end\n inputProps.placeholder = endPlaceholder\n }\n\n if (!inputValue.start && align === \"start\") {\n inputProps.id = id\n inputProps.name = name\n }\n\n if (!!inputValue.start && align === \"end\") {\n inputProps.id = id\n inputProps.name = name\n }\n } else {\n inputProps.ref = mergeRefs(props.ref, ref, startInputRef)\n inputProps.value = inputValue\n inputProps.id = id\n inputProps.name = name\n\n if (isArray(value)) {\n inputProps.style = {\n ...(!focused && !!value.length\n ? visuallyHiddenAttributes.style\n : {}),\n ...inputProps.style,\n }\n inputProps.placeholder = !value.length\n ? startPlaceholder\n : undefined\n inputProps[\"data-max\"] = dataAttr(\n isNumber(max) && value.length >= max,\n )\n } else {\n inputProps.placeholder = startPlaceholder\n }\n }\n\n return inputProps\n },\n [\n allowInput,\n dataProps,\n disabled,\n endPlaceholder,\n focused,\n id,\n inputValue,\n max,\n name,\n onBlur,\n onInputFocus,\n onInputChange,\n onKeyDown,\n onMouseDown,\n readOnly,\n ref,\n required,\n startPlaceholder,\n value,\n ],\n )\n\n const getContentProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) =>\n getComboboxContentProps({\n ref: mergeRefs(ref, contentRef),\n role: \"dialog\",\n ...props,\n }),\n [getComboboxContentProps],\n )\n\n const getCalendarProps: PropGetter<UseCalendarProps<Multiple, Range>> =\n useCallback(\n (props) =>\n ({\n disabled: !interactive,\n format: calendarFormat,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n value,\n onChange,\n onChangeMonth: setMonth,\n ...calendarProps,\n ...props,\n }) as UseCalendarProps<Multiple, Range>,\n [\n interactive,\n calendarFormat,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n value,\n onChange,\n setMonth,\n calendarProps,\n ],\n )\n\n const getIconProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getClearIconProps: PropGetter = useCallback(\n (props = {}) =>\n getIconProps({\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-label\": t(\"Clear value\"),\n role: \"button\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClear),\n onKeyDown: handlerAll(props.onKeyDown, (ev) =>\n runKeyAction(ev, { Enter: onClear, Space: onClear }),\n ),\n }),\n [getIconProps, interactive, onClear, t],\n )\n\n return {\n children,\n dateToString,\n inputValue,\n interactive,\n month,\n open,\n range,\n separator,\n setInputValue,\n setMonth,\n setValue,\n stringToDate,\n value,\n getCalendarProps,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n popoverProps,\n onChange,\n onClose,\n onInputChange,\n onOpen,\n }\n}\n\nexport type UseDatePickerReturn = ReturnType<typeof useDatePicker>\n"],"mappings":";;;;;;;;;;;;;;;;AAwFA,MAAM,iBAAmC,EACvC,OACA,SACA,OACA,KACA,WACA,YACI;CACJ,MAAM,OAAO,QAAQ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ACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEF,MAAM,kBAA8B,aACjC,EAAE,KAAK,GAAG,UAAU,CAAC,MACpB,wBAAwB;EACtB,KAAK,UAAU,KAAK,UAAU;EAC9B,MAAM;EACN,GAAG;CACL,CAAC,GACH,CAAC,uBAAuB,CAC1B;CAEA,MAAM,mBACJ,aACG,WACE;EACC,UAAU,CAAC;EACX,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;EACf,GAAG;EACH,GAAG;CACL,IACF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEF,MAAM,eAA2B,aAC9B,WAAW;EAAE,GAAG;EAAW,GAAG;CAAM,IACrC,CAAC,SAAS,CACZ;CAkBA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBA/BoC,aACnC,QAAQ,CAAC,MACR,aAAa;GACX,kBAAA,GAAiBW,cAAAA,SAAAA,CAAS,CAAC,WAAW;GACtC,cAAc,EAAE,aAAa;GAC7B,MAAM;GACN,UAAU,cAAc,IAAI;GAC5B,GAAG;GACH,UAAA,GAASD,cAAAA,WAAAA,CAAW,MAAM,SAAS,OAAO;GAC1C,YAAA,GAAWA,cAAAA,WAAAA,CAAW,MAAM,YAAY,OACtC,aAAa,IAAI;IAAE,OAAO;IAAS,OAAO;GAAQ,CAAC,CACrD;EACF,CAAC,GACH;GAAC;GAAc;GAAa;GAAS;EAAC,CAkBtB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["motion"],"sources":["../../../../src/components/drawer/drawer.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ButtonProps } from \"../button\"\nimport type { CloseButtonProps } from \"../close-button\"\nimport type { FocusLockProps } from \"../focus-lock\"\nimport type { HTMLMotionProps, MotionTransitionProps } from \"../motion\"\nimport type { PortalProps } from \"../portal\"\nimport type { SlideProps } from \"../slide\"\nimport type { DrawerStyle } from \"./drawer.style\"\nimport type { UseDrawerProps, UseDrawerReturn } from \"./use-drawer\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { RemoveScroll } from \"react-remove-scroll\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { cast, isArray, useSplitChildren, wrapOrPassProps } from \"../../utils\"\nimport { Button } from \"../button\"\nimport { CloseButton } from \"../close-button\"\nimport { fadeVariants } from \"../fade\"\nimport { FocusLock } from \"../focus-lock\"\nimport { motion } from \"../motion\"\nimport { Portal } from \"../portal\"\nimport { Slide } from \"../slide\"\nimport { drawerStyle } from \"./drawer.style\"\nimport { useDrawer } from \"./use-drawer\"\n\ninterface ComponentContext\n extends\n Omit<UseDrawerReturn, \"getRootProps\">,\n Pick<\n DrawerRootProps,\n \"duration\" | \"placement\" | \"withCloseButton\" | \"withDragBar\"\n > {}\n\nexport interface DrawerRootProps\n extends\n ThemeProps<DrawerStyle>,\n Omit<UseDrawerProps, \"placement\" | \"title\">,\n Pick<\n FocusLockProps,\n | \"autoFocus\"\n | \"finalFocusRef\"\n | \"initialFocusRef\"\n | \"lockFocusAcrossFrames\"\n | \"restoreFocus\"\n >,\n ShorthandDrawerContentProps {\n /**\n * Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.\n *\n * @default false.\n */\n allowPinchZoom?: boolean\n /**\n * If `true`, scrolling will be disabled on the `body` when the drawer opens.\n *\n * @default true\n */\n blockScrollOnMount?: boolean\n /**\n * The animation duration.\n */\n duration?: MotionTransitionProps[\"duration\"]\n /**\n * The modal trigger to use.\n */\n trigger?: ReactNode\n /**\n * If `true`, display the drawer close button.\n *\n * @default true\n */\n withCloseButton?: boolean\n /**\n * If `true`, display the drag bar when `closeOnDrag` is `true`.\n *\n * @default true\n */\n withDragBar?: boolean\n /**\n * If `true`, display the drawer overlay.\n *\n * @default true\n */\n withOverlay?: boolean\n /**\n * Props to be forwarded to the portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Callback function to run side effects after the drawer has closed.\n */\n onCloseComplete?: () => void\n}\n\nconst {\n ComponentContext,\n PropsContext: DrawerPropsContext,\n useComponentContext,\n usePropsContext: useDrawerPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DrawerRootProps, DrawerStyle, ComponentContext>(\n \"drawer\",\n drawerStyle,\n)\n\nexport { DrawerPropsContext, useDrawerPropsContext }\n\n/**\n * `Drawer` is a component for a panel that appears from the edge of the screen.\n *\n * @see https://yamada-ui.com/docs/components/drawer\n */\nexport const DrawerRoot = withProvider<\"div\", DrawerRootProps, \"placement\">(\n ({\n allowPinchZoom = false,\n autoFocus,\n blockScrollOnMount = true,\n body,\n cancel,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n duration = { enter: 0.4, exit: 0.3 },\n finalFocusRef,\n footer,\n header,\n initialFocusRef,\n lockFocusAcrossFrames = true,\n middle,\n placement: placementProp,\n restoreFocus,\n success,\n title,\n trigger,\n withCloseButton = !closeOnDrag,\n withDragBar = true,\n withOverlay = true,\n portalProps,\n onCancel,\n onCloseComplete,\n onMiddle,\n onSuccess,\n ...props\n }) => {\n const placement = useValue(placementProp)\n const [omittedChildren, openTrigger, customOverlay] = useSplitChildren(\n children,\n DrawerOpenTrigger,\n DrawerOverlay,\n )\n const hasChildren = isArray(omittedChildren) && !!omittedChildren.length\n const { open, getRootProps, ...rest } = useDrawer({\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement,\n ...props,\n })\n const customOpenTrigger = trigger ? (\n <DrawerOpenTrigger>{trigger}</DrawerOpenTrigger>\n ) : null\n\n const context = useMemo(\n () => ({\n duration,\n open,\n placement,\n withCloseButton,\n withDragBar,\n ...rest,\n }),\n [duration, open, withDragBar, placement, withCloseButton, rest],\n )\n\n return (\n <ComponentContext value={context}>\n {openTrigger ?? customOpenTrigger}\n\n <AnimatePresence onExitComplete={onCloseComplete}>\n {open ? (\n <Portal {...portalProps}>\n <FocusLock\n autoFocus={autoFocus}\n finalFocusRef={finalFocusRef}\n initialFocusRef={initialFocusRef}\n lockFocusAcrossFrames={lockFocusAcrossFrames}\n restoreFocus={restoreFocus}\n >\n <RemoveScroll\n allowPinchZoom={allowPinchZoom}\n enabled={blockScrollOnMount}\n forwardProps\n >\n <styled.div {...getRootProps()}>\n {customOverlay ?? (withOverlay ? <DrawerOverlay /> : null)}\n\n {hasChildren ? (\n omittedChildren\n ) : (\n <ShorthandDrawerContent\n body={body}\n cancel={cancel}\n footer={footer}\n header={header}\n middle={middle}\n success={success}\n title={title}\n onCancel={onCancel}\n onMiddle={onMiddle}\n onSuccess={onSuccess}\n />\n )}\n </styled.div>\n </RemoveScroll>\n </FocusLock>\n </Portal>\n ) : null}\n </AnimatePresence>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"placement\"] },\n)()\n\nexport interface DrawerOpenTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const DrawerOpenTrigger = withContext<\"button\", DrawerOpenTriggerProps>(\n \"button\",\n { name: \"OpenTrigger\", slot: [\"trigger\", \"open\"] },\n)(undefined, (props) => {\n const { getOpenTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getOpenTriggerProps(props) }\n})\n\nexport interface DrawerCloseTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const DrawerCloseTrigger = withContext<\n \"button\",\n DrawerCloseTriggerProps\n>(\"button\", { name: \"CloseTrigger\", slot: [\"trigger\", \"close\"] })(\n undefined,\n (props) => {\n const { getCloseTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getCloseTriggerProps(props) }\n },\n)\n\nexport interface DrawerCloseButtonProps extends CloseButtonProps {}\n\nexport const DrawerCloseButton = withContext<\"button\", DrawerCloseButtonProps>(\n CloseButton,\n \"closeButton\",\n)(undefined, (props) => {\n const { getCloseButtonProps } = useComponentContext()\n\n return { ...getCloseButtonProps(props) }\n})\n\nexport interface DrawerOverlayProps extends HTMLMotionProps {}\n\nexport const DrawerOverlay = withContext<\"div\", DrawerOverlayProps>((props) => {\n const { duration, getOverlayProps } = useComponentContext()\n\n return (\n <motion.div\n animate=\"enter\"\n custom={{ duration }}\n exit=\"exit\"\n initial=\"exit\"\n variants={fadeVariants}\n {...cast<HTMLMotionProps>(getOverlayProps(cast<HTMLProps>(props)))}\n />\n )\n}, \"overlay\")()\n\nexport interface DrawerContentProps\n extends Omit<HTMLMotionProps<\"section\">, \"children\">, PropsWithChildren {}\n\nexport const DrawerContent = withContext<\"div\", DrawerContentProps>(\n ({ children, ...rest }) => {\n const {\n closeOnDrag,\n duration,\n open,\n placement,\n withCloseButton,\n withDragBar,\n getContentProps,\n } = useComponentContext()\n const [omittedChildren, customCloseButton, customDragBar] =\n useSplitChildren(children, DrawerCloseButton, DrawerDragBar)\n\n return (\n <Slide\n as=\"section\"\n duration={duration}\n open={open}\n placement={placement}\n {...(getContentProps(rest) as SlideProps)}\n >\n {customCloseButton ?? (withCloseButton ? <DrawerCloseButton /> : null)}\n {customDragBar ??\n (withDragBar && closeOnDrag ? <DrawerDragBar /> : null)}\n\n {omittedChildren}\n </Slide>\n )\n },\n \"content\",\n)()\n\ninterface ShorthandDrawerContentProps {\n /**\n * The drawer body to use.\n */\n body?: DrawerBodyProps | ReactNode\n /**\n * The drawer cancel button to use.\n */\n cancel?: ButtonProps | ReactNode\n /**\n * The drawer footer to use.\n */\n footer?: DrawerFooterProps | ReactNode\n /**\n * The drawer header to use.\n */\n header?: DrawerHeaderProps | ReactNode\n /**\n * The drawer middle button to use.\n */\n middle?: ButtonProps | ReactNode\n /**\n * The drawer success button to use.\n */\n success?: ButtonProps | ReactNode\n /**\n * The drawer title to use.\n */\n title?: DrawerTitleProps | ReactNode\n /**\n * The callback invoked when cancel button clicked.\n */\n onCancel?: (onClose: () => void) => void\n /**\n * The callback invoked when middle button clicked.\n */\n onMiddle?: (onClose: () => void) => void\n /**\n * The callback invoked when success button clicked.\n */\n onSuccess?: (onClose: () => void) => void\n}\n\nexport const ShorthandDrawerContent: FC<ShorthandDrawerContentProps> = ({\n body,\n cancel,\n footer,\n header,\n middle,\n success,\n title,\n onCancel,\n onMiddle,\n onSuccess,\n}) => {\n const { onClose } = useComponentContext()\n const customHeader = wrapOrPassProps(DrawerHeader, header)\n const customTitle = wrapOrPassProps(DrawerTitle, title)\n const customBody = wrapOrPassProps(DrawerBody, body)\n const customFooter = wrapOrPassProps(DrawerFooter, footer)\n const customCancel = wrapOrPassProps(Button, cancel, {\n colorScheme: \"mono\",\n variant: \"ghost\",\n onClick: () => (onCancel ? onCancel(onClose) : onClose()),\n })\n const customMiddle = wrapOrPassProps(Button, middle, {\n colorScheme: \"secondary\",\n onClick: () => (onMiddle ? onMiddle(onClose) : onClose()),\n })\n const customSuccess = wrapOrPassProps(Button, success, {\n colorScheme: \"primary\",\n onClick: () => (onSuccess ? onSuccess(onClose) : onClose()),\n })\n\n return (\n <DrawerContent>\n {customHeader ??\n (customTitle ? <DrawerHeader>{customTitle}</DrawerHeader> : null)}\n {customBody}\n {customFooter ??\n (customCancel || customMiddle || customSuccess ? (\n <DrawerFooter>\n {customCancel}\n {customMiddle}\n {customSuccess}\n </DrawerFooter>\n ) : null)}\n </DrawerContent>\n )\n}\n\nexport interface DrawerDragBarProps extends HTMLStyledProps {}\n\nexport const DrawerDragBar = withContext<\"div\", DrawerDragBarProps>(\n \"div\",\n \"dragBar\",\n)(undefined, (props) => {\n const { getDragBarProps } = useComponentContext()\n\n return { ...getDragBarProps(props) }\n})\n\nexport interface DrawerHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const DrawerHeader = withContext<\"header\", DrawerHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n\n return { ...getHeaderProps(props) }\n})\n\nexport interface DrawerTitleProps extends HTMLStyledProps<\"h2\"> {}\n\nexport const DrawerTitle = withContext<\"h2\", DrawerTitleProps>(\"h2\", \"title\")(\n undefined,\n (props) => {\n const { getTitleProps } = useComponentContext()\n\n return { ...getTitleProps(props) }\n },\n)\n\nexport interface DrawerBodyProps extends HTMLStyledProps {}\n\nexport const DrawerBody = withContext<\"div\", DrawerBodyProps>(\"div\", \"body\")(\n undefined,\n (props) => {\n const { getBodyProps } = useComponentContext()\n\n return { ...getBodyProps(props) }\n },\n)\n\nexport interface DrawerFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const DrawerFooter = withContext<\"footer\", DrawerFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n\n return { ...getFooterProps(props) }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAAa,aAAa,cACvB,EACC,iBAAiB,OACjB,WACA,qBAAqB,MACrB,MACA,QACA,UACA,aACA,iBACA,aACA,YACA,cACA,WAAW;CAAE,OAAO;CAAK,MAAM;AAAI,GACnC,eACA,QACA,QACA,iBACA,wBAAwB,MACxB,QACA,WAAW,eACX,cACA,SACA,OACA,SACA,kBAAkB,CAAC,aACnB,cAAc,MACd,cAAc,MACd,aACA,UACA,iBACA,UACA,WACA,GAAG,YACC;CACJ,MAAM,YAAY,SAAS,aAAa;CACxC,MAAM,CAAC,iBAAiB,aAAa,iBAAiB,iBACpD,UACA,mBACA,aACF;CACA,MAAM,eAAA,GAAA,cAAA,QAAA,CAAsB,eAAe,KAAK,CAAC,CAAC,gBAAgB;CAClE,MAAM,EAAE,M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Y,UAAU;CACtB,MAAM,EAAE,mBAAmB,oBAAoB;CAE/C,OAAO,EAAE,GAAG,eAAe,KAAK,EAAE;AACpC,CAAC"}
1
+ {"version":3,"file":"drawer.js","names":["isArray","motion","cast"],"sources":["../../../../src/components/drawer/drawer.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ButtonProps } from \"../button\"\nimport type { CloseButtonProps } from \"../close-button\"\nimport type { FocusLockProps } from \"../focus-lock\"\nimport type { HTMLMotionProps, MotionTransitionProps } from \"../motion\"\nimport type { PortalProps } from \"../portal\"\nimport type { SlideProps } from \"../slide\"\nimport type { DrawerStyle } from \"./drawer.style\"\nimport type { UseDrawerProps, UseDrawerReturn } from \"./use-drawer\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { RemoveScroll } from \"react-remove-scroll\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { cast, isArray, useSplitChildren, wrapOrPassProps } from \"../../utils\"\nimport { Button } from \"../button\"\nimport { CloseButton } from \"../close-button\"\nimport { fadeVariants } from \"../fade\"\nimport { FocusLock } from \"../focus-lock\"\nimport { motion } from \"../motion\"\nimport { Portal } from \"../portal\"\nimport { Slide } from \"../slide\"\nimport { drawerStyle } from \"./drawer.style\"\nimport { useDrawer } from \"./use-drawer\"\n\ninterface ComponentContext\n extends\n Omit<UseDrawerReturn, \"getRootProps\">,\n Pick<\n DrawerRootProps,\n \"duration\" | \"placement\" | \"withCloseButton\" | \"withDragBar\"\n > {}\n\nexport interface DrawerRootProps\n extends\n ThemeProps<DrawerStyle>,\n Omit<UseDrawerProps, \"placement\" | \"title\">,\n Pick<\n FocusLockProps,\n | \"autoFocus\"\n | \"finalFocusRef\"\n | \"initialFocusRef\"\n | \"lockFocusAcrossFrames\"\n | \"restoreFocus\"\n >,\n ShorthandDrawerContentProps {\n /**\n * Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.\n *\n * @default false.\n */\n allowPinchZoom?: boolean\n /**\n * If `true`, scrolling will be disabled on the `body` when the drawer opens.\n *\n * @default true\n */\n blockScrollOnMount?: boolean\n /**\n * The animation duration.\n */\n duration?: MotionTransitionProps[\"duration\"]\n /**\n * The modal trigger to use.\n */\n trigger?: ReactNode\n /**\n * If `true`, display the drawer close button.\n *\n * @default true\n */\n withCloseButton?: boolean\n /**\n * If `true`, display the drag bar when `closeOnDrag` is `true`.\n *\n * @default true\n */\n withDragBar?: boolean\n /**\n * If `true`, display the drawer overlay.\n *\n * @default true\n */\n withOverlay?: boolean\n /**\n * Props to be forwarded to the portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Callback function to run side effects after the drawer has closed.\n */\n onCloseComplete?: () => void\n}\n\nconst {\n ComponentContext,\n PropsContext: DrawerPropsContext,\n useComponentContext,\n usePropsContext: useDrawerPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DrawerRootProps, DrawerStyle, ComponentContext>(\n \"drawer\",\n drawerStyle,\n)\n\nexport { DrawerPropsContext, useDrawerPropsContext }\n\n/**\n * `Drawer` is a component for a panel that appears from the edge of the screen.\n *\n * @see https://yamada-ui.com/docs/components/drawer\n */\nexport const DrawerRoot = withProvider<\"div\", DrawerRootProps, \"placement\">(\n ({\n allowPinchZoom = false,\n autoFocus,\n blockScrollOnMount = true,\n body,\n cancel,\n children,\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n duration = { enter: 0.4, exit: 0.3 },\n finalFocusRef,\n footer,\n header,\n initialFocusRef,\n lockFocusAcrossFrames = true,\n middle,\n placement: placementProp,\n restoreFocus,\n success,\n title,\n trigger,\n withCloseButton = !closeOnDrag,\n withDragBar = true,\n withOverlay = true,\n portalProps,\n onCancel,\n onCloseComplete,\n onMiddle,\n onSuccess,\n ...props\n }) => {\n const placement = useValue(placementProp)\n const [omittedChildren, openTrigger, customOverlay] = useSplitChildren(\n children,\n DrawerOpenTrigger,\n DrawerOverlay,\n )\n const hasChildren = isArray(omittedChildren) && !!omittedChildren.length\n const { open, getRootProps, ...rest } = useDrawer({\n closeOnDrag,\n dragConstraints,\n dragElastic,\n dragOffset,\n dragVelocity,\n placement,\n ...props,\n })\n const customOpenTrigger = trigger ? (\n <DrawerOpenTrigger>{trigger}</DrawerOpenTrigger>\n ) : null\n\n const context = useMemo(\n () => ({\n duration,\n open,\n placement,\n withCloseButton,\n withDragBar,\n ...rest,\n }),\n [duration, open, withDragBar, placement, withCloseButton, rest],\n )\n\n return (\n <ComponentContext value={context}>\n {openTrigger ?? customOpenTrigger}\n\n <AnimatePresence onExitComplete={onCloseComplete}>\n {open ? (\n <Portal {...portalProps}>\n <FocusLock\n autoFocus={autoFocus}\n finalFocusRef={finalFocusRef}\n initialFocusRef={initialFocusRef}\n lockFocusAcrossFrames={lockFocusAcrossFrames}\n restoreFocus={restoreFocus}\n >\n <RemoveScroll\n allowPinchZoom={allowPinchZoom}\n enabled={blockScrollOnMount}\n forwardProps\n >\n <styled.div {...getRootProps()}>\n {customOverlay ?? (withOverlay ? <DrawerOverlay /> : null)}\n\n {hasChildren ? (\n omittedChildren\n ) : (\n <ShorthandDrawerContent\n body={body}\n cancel={cancel}\n footer={footer}\n header={header}\n middle={middle}\n success={success}\n title={title}\n onCancel={onCancel}\n onMiddle={onMiddle}\n onSuccess={onSuccess}\n />\n )}\n </styled.div>\n </RemoveScroll>\n </FocusLock>\n </Portal>\n ) : null}\n </AnimatePresence>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"placement\"] },\n)()\n\nexport interface DrawerOpenTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const DrawerOpenTrigger = withContext<\"button\", DrawerOpenTriggerProps>(\n \"button\",\n { name: \"OpenTrigger\", slot: [\"trigger\", \"open\"] },\n)(undefined, (props) => {\n const { getOpenTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getOpenTriggerProps(props) }\n})\n\nexport interface DrawerCloseTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const DrawerCloseTrigger = withContext<\n \"button\",\n DrawerCloseTriggerProps\n>(\"button\", { name: \"CloseTrigger\", slot: [\"trigger\", \"close\"] })(\n undefined,\n (props) => {\n const { getCloseTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getCloseTriggerProps(props) }\n },\n)\n\nexport interface DrawerCloseButtonProps extends CloseButtonProps {}\n\nexport const DrawerCloseButton = withContext<\"button\", DrawerCloseButtonProps>(\n CloseButton,\n \"closeButton\",\n)(undefined, (props) => {\n const { getCloseButtonProps } = useComponentContext()\n\n return { ...getCloseButtonProps(props) }\n})\n\nexport interface DrawerOverlayProps extends HTMLMotionProps {}\n\nexport const DrawerOverlay = withContext<\"div\", DrawerOverlayProps>((props) => {\n const { duration, getOverlayProps } = useComponentContext()\n\n return (\n <motion.div\n animate=\"enter\"\n custom={{ duration }}\n exit=\"exit\"\n initial=\"exit\"\n variants={fadeVariants}\n {...cast<HTMLMotionProps>(getOverlayProps(cast<HTMLProps>(props)))}\n />\n )\n}, \"overlay\")()\n\nexport interface DrawerContentProps\n extends Omit<HTMLMotionProps<\"section\">, \"children\">, PropsWithChildren {}\n\nexport const DrawerContent = withContext<\"div\", DrawerContentProps>(\n ({ children, ...rest }) => {\n const {\n closeOnDrag,\n duration,\n open,\n placement,\n withCloseButton,\n withDragBar,\n getContentProps,\n } = useComponentContext()\n const [omittedChildren, customCloseButton, customDragBar] =\n useSplitChildren(children, DrawerCloseButton, DrawerDragBar)\n\n return (\n <Slide\n as=\"section\"\n duration={duration}\n open={open}\n placement={placement}\n {...(getContentProps(rest) as SlideProps)}\n >\n {customCloseButton ?? (withCloseButton ? <DrawerCloseButton /> : null)}\n {customDragBar ??\n (withDragBar && closeOnDrag ? <DrawerDragBar /> : null)}\n\n {omittedChildren}\n </Slide>\n )\n },\n \"content\",\n)()\n\ninterface ShorthandDrawerContentProps {\n /**\n * The drawer body to use.\n */\n body?: DrawerBodyProps | ReactNode\n /**\n * The drawer cancel button to use.\n */\n cancel?: ButtonProps | ReactNode\n /**\n * The drawer footer to use.\n */\n footer?: DrawerFooterProps | ReactNode\n /**\n * The drawer header to use.\n */\n header?: DrawerHeaderProps | ReactNode\n /**\n * The drawer middle button to use.\n */\n middle?: ButtonProps | ReactNode\n /**\n * The drawer success button to use.\n */\n success?: ButtonProps | ReactNode\n /**\n * The drawer title to use.\n */\n title?: DrawerTitleProps | ReactNode\n /**\n * The callback invoked when cancel button clicked.\n */\n onCancel?: (onClose: () => void) => void\n /**\n * The callback invoked when middle button clicked.\n */\n onMiddle?: (onClose: () => void) => void\n /**\n * The callback invoked when success button clicked.\n */\n onSuccess?: (onClose: () => void) => void\n}\n\nexport const ShorthandDrawerContent: FC<ShorthandDrawerContentProps> = ({\n body,\n cancel,\n footer,\n header,\n middle,\n success,\n title,\n onCancel,\n onMiddle,\n onSuccess,\n}) => {\n const { onClose } = useComponentContext()\n const customHeader = wrapOrPassProps(DrawerHeader, header)\n const customTitle = wrapOrPassProps(DrawerTitle, title)\n const customBody = wrapOrPassProps(DrawerBody, body)\n const customFooter = wrapOrPassProps(DrawerFooter, footer)\n const customCancel = wrapOrPassProps(Button, cancel, {\n colorScheme: \"mono\",\n variant: \"ghost\",\n onClick: () => (onCancel ? onCancel(onClose) : onClose()),\n })\n const customMiddle = wrapOrPassProps(Button, middle, {\n colorScheme: \"secondary\",\n onClick: () => (onMiddle ? onMiddle(onClose) : onClose()),\n })\n const customSuccess = wrapOrPassProps(Button, success, {\n colorScheme: \"primary\",\n onClick: () => (onSuccess ? onSuccess(onClose) : onClose()),\n })\n\n return (\n <DrawerContent>\n {customHeader ??\n (customTitle ? <DrawerHeader>{customTitle}</DrawerHeader> : null)}\n {customBody}\n {customFooter ??\n (customCancel || customMiddle || customSuccess ? (\n <DrawerFooter>\n {customCancel}\n {customMiddle}\n {customSuccess}\n </DrawerFooter>\n ) : null)}\n </DrawerContent>\n )\n}\n\nexport interface DrawerDragBarProps extends HTMLStyledProps {}\n\nexport const DrawerDragBar = withContext<\"div\", DrawerDragBarProps>(\n \"div\",\n \"dragBar\",\n)(undefined, (props) => {\n const { getDragBarProps } = useComponentContext()\n\n return { ...getDragBarProps(props) }\n})\n\nexport interface DrawerHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const DrawerHeader = withContext<\"header\", DrawerHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n\n return { ...getHeaderProps(props) }\n})\n\nexport interface DrawerTitleProps extends HTMLStyledProps<\"h2\"> {}\n\nexport const DrawerTitle = withContext<\"h2\", DrawerTitleProps>(\"h2\", \"title\")(\n undefined,\n (props) => {\n const { getTitleProps } = useComponentContext()\n\n return { ...getTitleProps(props) }\n },\n)\n\nexport interface DrawerBodyProps extends HTMLStyledProps {}\n\nexport const DrawerBody = withContext<\"div\", DrawerBodyProps>(\"div\", \"body\")(\n undefined,\n (props) => {\n const { getBodyProps } = useComponentContext()\n\n return { ...getBodyProps(props) }\n },\n)\n\nexport interface DrawerFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const DrawerFooter = withContext<\"footer\", DrawerFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n\n return { ...getFooterProps(props) }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAAa,aAAa,cACvB,EACC,iBAAiB,OACjB,WACA,qBAAqB,MACrB,MACA,QACA,UACA,aACA,iBACA,aACA,YACA,cACA,WAAW;CAAE,OAAO;CAAK,MAAM;AAAI,GACnC,eACA,QACA,QACA,iBACA,wBAAwB,MACxB,QACA,WAAW,eACX,cACA,SACA,OACA,SACA,kBAAkB,CAAC,aACnB,cAAc,MACd,cAAc,MACd,a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KAAK,EAAE;AACnC,CACF;AAIA,MAAa,aAAa,YAAoC,OAAO,MAAM,CAAC,CAC1E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,iBAAiB,oBAAoB;CAE7C,OAAO,EAAE,GAAG,aAAa,KAAK,EAAE;AAClC,CACF;AAIA,MAAa,eAAe,YAC1B,UACA,QACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,oBAAoB;CAE/C,OAAO,EAAE,GAAG,eAAe,KAAK,EAAE;AACpC,CAAC"}
@@ -38,9 +38,7 @@ const useDrawer = ({ closeOnDrag = false, closeOnEsc, closeOnOverlay, dragConstr
38
38
  case "inline-start":
39
39
  if (info.velocity.x <= dragVelocity * -1 || info.offset.x <= dragOffset * -1) onClose();
40
40
  break;
41
- case "inline-end":
42
- if (info.velocity.x >= dragVelocity || info.offset.x >= dragOffset) onClose();
43
- break;
41
+ case "inline-end": if (info.velocity.x >= dragVelocity || info.offset.x >= dragOffset) onClose();
44
42
  }
45
43
  }, [
46
44
  placement,
@@ -1 +1 @@
1
- {"version":3,"file":"use-drawer.js","names":[],"sources":["../../../../src/components/drawer/use-drawer.ts"],"sourcesContent":["\"use client\"\n\nimport type { HTMLProps, PropGetter, SimplePlacement } from \"../../core\"\nimport type { UseModalProps } from \"../modal\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport { useCallback, useMemo } from \"react\"\nimport { cast, handlerAll } from \"../../utils\"\nimport { useModal } from \"../modal\"\n\ntype DragEndEventHandler = Required<HTMLMotionProps>[\"onDragEnd\"]\n\nexport interface UseDrawerProps extends UseModalProps {\n /**\n * If `true`, then the drawer will close on drag.\n *\n * @default false\n */\n closeOnDrag?: boolean\n /**\n * Applies constraints on the permitted draggable area.\n *\n * @default 0\n */\n dragConstraints?: number\n /**\n * The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.\n *\n * @default 0.1\n */\n dragElastic?: number\n /**\n * Offset from being dragged to closing.\n *\n * @default 80\n */\n dragOffset?: number\n /**\n * Velocity of the drag that triggers close.\n *\n * @default 100\n */\n dragVelocity?: number\n /**\n * The placement of the drawer.\n *\n * @default 'inline-end'\n */\n placement?: SimplePlacement\n}\n\nexport const useDrawer = ({\n closeOnDrag = false,\n closeOnEsc,\n closeOnOverlay,\n dragConstraints = 0,\n dragElastic = 0.1,\n dragOffset = 80,\n dragVelocity = 100,\n placement = \"inline-end\",\n onEsc,\n ...rest\n}: UseDrawerProps = {}) => {\n const {\n getContentProps: getModalContentProps,\n onClose,\n ...modalProps\n } = useModal({\n closeOnEsc,\n closeOnOverlay,\n onEsc,\n ...rest,\n })\n\n const drag = useMemo<HTMLMotionProps[\"drag\"]>(() => {\n if (!closeOnDrag) return false\n\n switch (placement) {\n case \"block-start\":\n case \"block-end\":\n return \"y\"\n case \"inline-start\":\n case \"inline-end\":\n return \"x\"\n }\n }, [placement, closeOnDrag])\n\n const getDragRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"block-start\":\n return { bottom: value }\n case \"block-end\":\n return { top: value }\n case \"inline-start\":\n return { right: value }\n case \"inline-end\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const onDragEnd: DragEndEventHandler = useCallback(\n (_, info) => {\n switch (placement) {\n case \"block-start\":\n if (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n onClose()\n break\n\n case \"block-end\":\n if (info.velocity.y >= dragVelocity || info.offset.y >= dragOffset)\n onClose()\n break\n\n case \"inline-start\":\n if (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n onClose()\n break\n\n case \"inline-end\":\n if (info.velocity.x >= dragVelocity || info.offset.x >= dragOffset)\n onClose()\n break\n }\n },\n [placement, dragVelocity, dragOffset, onClose],\n )\n\n const getContentProps: PropGetter<HTMLMotionProps<\"section\">> = useCallback(\n (props = {}) => ({\n drag,\n dragConstraints: getDragRestriction(dragConstraints),\n dragElastic: getDragRestriction(dragElastic),\n dragMomentum: false,\n dragSnapToOrigin: true,\n ...cast<HTMLMotionProps<\"section\">>(\n getModalContentProps(cast<HTMLProps<\"section\">>(props)),\n ),\n onDragEnd: handlerAll(\n (ev, info) => props.onDragEnd?.(ev, info),\n onDragEnd,\n ),\n }),\n [\n drag,\n getDragRestriction,\n dragConstraints,\n dragElastic,\n onDragEnd,\n getModalContentProps,\n ],\n )\n\n const getDragBarProps: PropGetter = useCallback(\n (props) => ({\n ...props,\n }),\n [],\n )\n\n return {\n ...modalProps,\n closeOnDrag,\n getContentProps,\n getDragBarProps,\n onClose,\n }\n}\n\nexport type UseDrawerReturn = ReturnType<typeof useDrawer>\n"],"mappings":";;;;;AAkDA,MAAa,aAAa,EACxB,cAAc,OACd,YACA,gBACA,kBAAkB,GAClB,cAAc,IACd,aAAa,IACb,eAAe,KACf,YAAY,cACZ,OACA,GAAG,SACe,CAAC,MAAM;CACzB,MAAM,EACJ,iBAAiB,sBACjB,SACA,GAAG,eACD,SAAS;EACX;EACA;EACA;EACA,GAAG;CACL,CAAC;CAED,MAAM,OAAO,cAAuC;EAClD,IAAI,CAAC,aAAa,OAAO;EAEzB,QAAQ,WAAR;GACE,KAAK;GACL,KAAK,aACH,OAAO;GACT,KAAK;GACL,KAAK,cACH,OAAO;EACX;CACF,GAAG,CAAC,WAAW,WAAW,CAAC;CAE3B,MAAM,qBAAqB,aACxB,UAAkB;EACjB,QAAQ,WAAR;GACE,KAAK,eACH,OAAO,EAAE,QAAQ,MAAM;GACzB,KAAK,aACH,OAAO,EAAE,KAAK,MAAM;GACtB,KAAK,gBACH,OAAO,EAAE,OAAO,MAAM;GACxB,KAAK,cACH,OAAO,EAAE,MAAM,MAAM;EACzB;CACF,GACA,CAAC,SAAS,CACZ;CAEA,MAAM,YAAiC,aACpC,GAAG,SAAS;EACX,QAAQ,WAAR;GACE,KAAK;IACH,IACE,KAAK,SAAS,KAAK,eAAe,MAClC,KAAK,OAAO,KAAK,aAAa,IAE9B,QAAQ;IACV;GAEF,KAAK;IACH,IAAI,KAAK,SAAS,KAAK,gBAAgB,KAAK,OAAO,KAAK,YACtD,QAAQ;IACV;GAEF,KAAK;IACH,IACE,KAAK,SAAS,KAAK,eAAe,MAClC,KAAK,OAAO,KAAK,aAAa,IAE9B,QAAQ;IACV;GAEF,KAAK;IACH,IAAI,KAAK,SAAS,KAAK,gBAAgB,KAAK,OAAO,KAAK,YACtD,QAAQ;IACV;EACJ;CACF,GACA;EAAC;EAAW;EAAc;EAAY;CAAO,CAC/C;CAEA,MAAM,kBAA0D,aAC7D,QAAQ,CAAC,OAAO;EACf;EACA,iBAAiB,mBAAmB,eAAe;EACnD,aAAa,mBAAmB,WAAW;EAC3C,cAAc;EACd,kBAAkB;EAClB,IAAA,GAAA,cAAA,KAAA,CACE,sBAAA,GAAA,cAAA,KAAA,CAAgD,KAAK,CAAC,CACxD;EACA,YAAA,GAAA,cAAA,WAAA,EACG,IAAI,SAAS,MAAM,YAAY,IAAI,IAAI,GACxC,SACF;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,kBAA8B,aACjC,WAAW,EACV,GAAG,MACL,IACA,CAAC,CACH;CAEA,OAAO;EACL,GAAG;EACH;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-drawer.js","names":["cast","handlerAll"],"sources":["../../../../src/components/drawer/use-drawer.ts"],"sourcesContent":["\"use client\"\n\nimport type { HTMLProps, PropGetter, SimplePlacement } from \"../../core\"\nimport type { UseModalProps } from \"../modal\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport { useCallback, useMemo } from \"react\"\nimport { cast, handlerAll } from \"../../utils\"\nimport { useModal } from \"../modal\"\n\ntype DragEndEventHandler = Required<HTMLMotionProps>[\"onDragEnd\"]\n\nexport interface UseDrawerProps extends UseModalProps {\n /**\n * If `true`, then the drawer will close on drag.\n *\n * @default false\n */\n closeOnDrag?: boolean\n /**\n * Applies constraints on the permitted draggable area.\n *\n * @default 0\n */\n dragConstraints?: number\n /**\n * The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.\n *\n * @default 0.1\n */\n dragElastic?: number\n /**\n * Offset from being dragged to closing.\n *\n * @default 80\n */\n dragOffset?: number\n /**\n * Velocity of the drag that triggers close.\n *\n * @default 100\n */\n dragVelocity?: number\n /**\n * The placement of the drawer.\n *\n * @default 'inline-end'\n */\n placement?: SimplePlacement\n}\n\nexport const useDrawer = ({\n closeOnDrag = false,\n closeOnEsc,\n closeOnOverlay,\n dragConstraints = 0,\n dragElastic = 0.1,\n dragOffset = 80,\n dragVelocity = 100,\n placement = \"inline-end\",\n onEsc,\n ...rest\n}: UseDrawerProps = {}) => {\n const {\n getContentProps: getModalContentProps,\n onClose,\n ...modalProps\n } = useModal({\n closeOnEsc,\n closeOnOverlay,\n onEsc,\n ...rest,\n })\n\n const drag = useMemo<HTMLMotionProps[\"drag\"]>(() => {\n if (!closeOnDrag) return false\n\n switch (placement) {\n case \"block-start\":\n case \"block-end\":\n return \"y\"\n case \"inline-start\":\n case \"inline-end\":\n return \"x\"\n }\n }, [placement, closeOnDrag])\n\n const getDragRestriction = useCallback(\n (value: number) => {\n switch (placement) {\n case \"block-start\":\n return { bottom: value }\n case \"block-end\":\n return { top: value }\n case \"inline-start\":\n return { right: value }\n case \"inline-end\":\n return { left: value }\n }\n },\n [placement],\n )\n\n const onDragEnd: DragEndEventHandler = useCallback(\n (_, info) => {\n switch (placement) {\n case \"block-start\":\n if (\n info.velocity.y <= dragVelocity * -1 ||\n info.offset.y <= dragOffset * -1\n )\n onClose()\n break\n\n case \"block-end\":\n if (info.velocity.y >= dragVelocity || info.offset.y >= dragOffset)\n onClose()\n break\n\n case \"inline-start\":\n if (\n info.velocity.x <= dragVelocity * -1 ||\n info.offset.x <= dragOffset * -1\n )\n onClose()\n break\n\n case \"inline-end\":\n if (info.velocity.x >= dragVelocity || info.offset.x >= dragOffset)\n onClose()\n break\n }\n },\n [placement, dragVelocity, dragOffset, onClose],\n )\n\n const getContentProps: PropGetter<HTMLMotionProps<\"section\">> = useCallback(\n (props = {}) => ({\n drag,\n dragConstraints: getDragRestriction(dragConstraints),\n dragElastic: getDragRestriction(dragElastic),\n dragMomentum: false,\n dragSnapToOrigin: true,\n ...cast<HTMLMotionProps<\"section\">>(\n getModalContentProps(cast<HTMLProps<\"section\">>(props)),\n ),\n onDragEnd: handlerAll(\n (ev, info) => props.onDragEnd?.(ev, info),\n onDragEnd,\n ),\n }),\n [\n drag,\n getDragRestriction,\n dragConstraints,\n dragElastic,\n onDragEnd,\n getModalContentProps,\n ],\n )\n\n const getDragBarProps: PropGetter = useCallback(\n (props) => ({\n ...props,\n }),\n [],\n )\n\n return {\n ...modalProps,\n closeOnDrag,\n getContentProps,\n getDragBarProps,\n onClose,\n }\n}\n\nexport type UseDrawerReturn = ReturnType<typeof useDrawer>\n"],"mappings":";;;;;AAkDA,MAAa,aAAa,EACxB,cAAc,OACd,YACA,gBACA,kBAAkB,GAClB,cAAc,IACd,aAAa,IACb,eAAe,KACf,YAAY,cACZ,OACA,GAAG,SACe,CAAC,MAAM;CACzB,MAAM,EACJ,iBAAiB,sBACjB,SACA,GAAG,eACD,SAAS;EACX;EACA;EACA;EACA,GAAG;CACL,CAAC;CAED,MAAM,OAAO,cAAuC;EAClD,IAAI,CAAC,aAAa,OAAO;EAEzB,QAAQ,WAAR;GACE,KAAK;GACL,KAAK,aACH,OAAO;GACT,KAAK;GACL,KAAK,cACH,OAAO;EACX;CACF,GAAG,CAAC,WAAW,WAAW,CAAC;CAE3B,MAAM,qBAAqB,aACxB,UAAkB;EACjB,QAAQ,WAAR;GACE,KAAK,eACH,OAAO,EAAE,QAAQ,MAAM;GACzB,KAAK,aACH,OAAO,EAAE,KAAK,MAAM;GACtB,KAAK,gBACH,OAAO,EAAE,OAAO,MAAM;GACxB,KAAK,cACH,OAAO,EAAE,MAAM,MAAM;EACzB;CACF,GACA,CAAC,SAAS,CACZ;CAEA,MAAM,YAAiC,aACpC,GAAG,SAAS;EACX,QAAQ,WAAR;GACE,KAAK;IACH,IACE,KAAK,SAAS,KAAK,eAAe,MAClC,KAAK,OAAO,KAAK,aAAa,IAE9B,QAAQ;IACV;GAEF,KAAK;IACH,IAAI,KAAK,SAAS,KAAK,gBAAgB,KAAK,OAAO,KAAK,YACtD,QAAQ;IACV;GAEF,KAAK;IACH,IACE,KAAK,SAAS,KAAK,eAAe,MAClC,KAAK,OAAO,KAAK,aAAa,IAE9B,QAAQ;IACV;GAEF,KAAK,cACH,IAAI,KAAK,SAAS,KAAK,gBAAgB,KAAK,OAAO,KAAK,YACtD,QAAQ;EAEd;CACF,GACA;EAAC;EAAW;EAAc;EAAY;CAAO,CAC/C;CAEA,MAAM,kBAA0D,aAC7D,QAAQ,CAAC,OAAO;EACf;EACA,iBAAiB,mBAAmB,eAAe;EACnD,aAAa,mBAAmB,WAAW;EAC3C,cAAc;EACd,kBAAkB;EAClB,IAAA,GAAGA,cAAAA,KAAAA,CACD,sBAAA,GAAqBA,cAAAA,KAAAA,CAA2B,KAAK,CAAC,CACxD;EACA,YAAA,GAAWC,cAAAA,WAAAA,EACR,IAAI,SAAS,MAAM,YAAY,IAAI,IAAI,GACxC,SACF;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,kBAA8B,aACjC,WAAW,EACV,GAAG,MACL,IACA,CAAC,CACH;CAEA,OAAO;EACL,GAAG;EACH;EACA;EACA;EACA;CACF;AACF"}
@@ -61,7 +61,8 @@ const DropzoneOverlay = withContext(Fade, "overlay")(void 0, (props) => {
61
61
  };
62
62
  });
63
63
  const DropzoneLoading = withContext(({ loadingScheme = "oval", ...rest }) => {
64
- return /* @__PURE__ */ jsx(useLoadingComponent(loadingScheme), { ...rest });
64
+ const Component = useLoadingComponent(loadingScheme);
65
+ return /* @__PURE__ */ jsx(Component, { ...rest });
65
66
  }, "loading")();
66
67
  const DropzoneAccept = ({ children }) => {
67
68
  const { dragAccept } = useComponentContext();
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone.js","names":[],"sources":["../../../../src/components/dropzone/dropzone.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { FadeProps } from \"../fade\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { Loading } from \"../loading\"\nimport type { DropzoneStyle } from \"./dropzone.style\"\nimport type { UseDropzoneProps, UseDropzoneReturn } from \"./use-dropzone\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { Fade } from \"../fade\"\nimport { useInputBorder } from \"../input\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Portal } from \"../portal\"\nimport { dropzoneStyle } from \"./dropzone.style\"\nimport { useDropzone } from \"./use-dropzone\"\n\ninterface ComponentContext extends Pick<\n UseDropzoneReturn,\n \"dragAccept\" | \"dragIdle\" | \"dragReject\" | \"loading\"\n> {}\n\nexport interface DropzoneRootProps\n extends\n Merge<HTMLStyledProps, UseDropzoneProps>,\n UseInputBorderProps,\n ThemeProps<DropzoneStyle>,\n Pick<DropzoneLoadingProps, \"loadingScheme\"> {\n /**\n * Props for dropzone input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for dropzone loading icon element.\n */\n loadingProps?: DropzoneLoadingProps\n /**\n * Props for dropzone overlay element.\n */\n overlayProps?: DropzoneOverlayProps\n}\n\nconst {\n ComponentContext,\n PropsContext: DropzonePropsContext,\n useComponentContext,\n usePropsContext: useDropzonePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DropzoneRootProps, DropzoneStyle>(\n \"dropzone\",\n dropzoneStyle,\n)\n\nexport { DropzonePropsContext, useDropzonePropsContext }\n\n/**\n * `Dropzone` is a component used for uploading files via drag and drop.\n *\n * @see https://yamada-ui.com/docs/components/dropzone\n */\nexport const DropzoneRoot = withProvider(\n ({\n children,\n errorBorderColor,\n focusBorderColor,\n loadingScheme,\n inputProps,\n loadingProps,\n overlayProps,\n ...rest\n }) => {\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const {\n dragAccept,\n dragIdle,\n dragReject,\n loading,\n getInputProps,\n getRootProps,\n } = useDropzone(rest)\n const context = useMemo(\n () => ({\n dragAccept,\n dragIdle,\n dragReject,\n loading,\n }),\n [dragAccept, dragIdle, dragReject, loading],\n )\n\n return (\n <ComponentContext value={context}>\n <Portal>\n <styled.input {...getInputProps(inputProps)} />\n </Portal>\n\n <styled.div data-group {...varProps} {...getRootProps()}>\n <DropzoneOverlay {...overlayProps}>\n <DropzoneLoading loadingScheme={loadingScheme} {...loadingProps} />\n </DropzoneOverlay>\n\n {children}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n)()\n\nexport interface DropzoneIconProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const DropzoneIcon = withContext<\"svg\", DropzoneIconProps>(\n \"svg\",\n \"icon\",\n)()\n\nexport interface DropzoneTitleProps extends HTMLStyledProps<\"p\"> {}\n\nexport const DropzoneTitle = withContext<\"p\", DropzoneTitleProps>(\n \"p\",\n \"title\",\n)()\n\nexport interface DropzoneDescriptionProps extends HTMLStyledProps<\"p\"> {}\n\nexport const DropzoneDescription = withContext<\"p\", DropzoneDescriptionProps>(\n \"p\",\n \"description\",\n)()\n\ninterface DropzoneOverlayProps extends FadeProps {\n loadingProps?: DropzoneLoadingProps\n}\n\nconst DropzoneOverlay = withContext<\"div\", DropzoneOverlayProps>(\n Fade,\n \"overlay\",\n)(undefined, (props) => {\n const { loading } = useComponentContext()\n\n return { open: loading, unmountOnExit: true, ...props }\n})\n\ninterface DropzoneLoadingProps extends Loading.Props {\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n}\n\nconst DropzoneLoading = withContext<\"svg\", DropzoneLoadingProps>(\n ({ loadingScheme = \"oval\", ...rest }) => {\n const Component = useLoadingComponent(loadingScheme)\n\n return <Component {...rest} />\n },\n \"loading\",\n)()\n\nexport interface DropzoneAcceptProps extends PropsWithChildren {}\n\nexport const DropzoneAccept: FC<DropzoneAcceptProps> = ({ children }) => {\n const { dragAccept } = useComponentContext()\n\n return dragAccept ? children : null\n}\n\nexport interface DropzoneRejectProps extends PropsWithChildren {}\n\nexport const DropzoneReject: FC<DropzoneRejectProps> = ({ children }) => {\n const { dragReject } = useComponentContext()\n\n return dragReject ? children : null\n}\n\nexport interface DropzoneIdleProps extends PropsWithChildren {}\n\nexport const DropzoneIdle: FC<DropzoneIdleProps> = ({ children }) => {\n const { dragIdle } = useComponentContext()\n\n return dragIdle ? children : null\n}\n"],"mappings":";;;;;;;;;;;;AA4CA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EACC,UACA,kBACA,kBACA,eACA,YACA,cACA,cACA,GAAG,WACC;CACJ,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,EACJ,YACA,UACA,YACA,SACA,eACA,iBACE,YAAY,IAAI;CACpB,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;CACF,IACA;EAAC;EAAY;EAAU;EAAY;CAAO,CAC5C;CAEA,OACE,qBAAC,kBAAD;EAAkB,OAAO;EAAzB,UAAA,CACE,oBAAC,QAAD,EAAA,UACE,oBAAC,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA,EACxC,CAAA,GAER,qBAAC,OAAO,KAAR;GAAY,cAAA;GAAW,GAAI;GAAU,GAAI,aAAa;GAAtD,UAAA,CACE,oBAAC,iBAAD;IAAiB,GAAI;IACnB,UAAA,oBAAC,iBAAD;KAAgC;KAAe,GAAI;IAAe,CAAA;GACnD,CAAA,GAEhB,QACS;EACI,CAAA,CAAA;;AAEtB,GACA,MACF,CAAC,CAAC;AAIF,MAAa,eAAe,YAC1B,OACA,MACF,CAAC,CAAC;AAIF,MAAa,gBAAgB,YAC3B,KACA,OACF,CAAC,CAAC;AAIF,MAAa,sBAAsB,YACjC,KACA,aACF,CAAC,CAAC;AAMF,MAAM,kBAAkB,YACtB,MACA,SACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,YAAY,oBAAoB;CAExC,OAAO;EAAE,MAAM;EAAS,eAAe;EAAM,GAAG;CAAM;AACxD,CAAC;AAWD,MAAM,kBAAkB,aACrB,EAAE,gBAAgB,QAAQ,GAAG,WAAW;CAGvC,OAAO,oBAFW,oBAAoB,aAEtB,GAAT,EAAW,GAAI,KAAO,CAAA;AAC/B,GACA,SACF,CAAC,CAAC;AAIF,MAAa,kBAA2C,EAAE,eAAe;CACvE,MAAM,EAAE,eAAe,oBAAoB;CAE3C,OAAO,aAAa,WAAW;AACjC;AAIA,MAAa,kBAA2C,EAAE,eAAe;CACvE,MAAM,EAAE,eAAe,oBAAoB;CAE3C,OAAO,aAAa,WAAW;AACjC;AAIA,MAAa,gBAAuC,EAAE,eAAe;CACnE,MAAM,EAAE,aAAa,oBAAoB;CAEzC,OAAO,WAAW,WAAW;AAC/B"}
1
+ {"version":3,"file":"dropzone.js","names":[],"sources":["../../../../src/components/dropzone/dropzone.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { FadeProps } from \"../fade\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { Loading } from \"../loading\"\nimport type { DropzoneStyle } from \"./dropzone.style\"\nimport type { UseDropzoneProps, UseDropzoneReturn } from \"./use-dropzone\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { Fade } from \"../fade\"\nimport { useInputBorder } from \"../input\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Portal } from \"../portal\"\nimport { dropzoneStyle } from \"./dropzone.style\"\nimport { useDropzone } from \"./use-dropzone\"\n\ninterface ComponentContext extends Pick<\n UseDropzoneReturn,\n \"dragAccept\" | \"dragIdle\" | \"dragReject\" | \"loading\"\n> {}\n\nexport interface DropzoneRootProps\n extends\n Merge<HTMLStyledProps, UseDropzoneProps>,\n UseInputBorderProps,\n ThemeProps<DropzoneStyle>,\n Pick<DropzoneLoadingProps, \"loadingScheme\"> {\n /**\n * Props for dropzone input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for dropzone loading icon element.\n */\n loadingProps?: DropzoneLoadingProps\n /**\n * Props for dropzone overlay element.\n */\n overlayProps?: DropzoneOverlayProps\n}\n\nconst {\n ComponentContext,\n PropsContext: DropzonePropsContext,\n useComponentContext,\n usePropsContext: useDropzonePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<DropzoneRootProps, DropzoneStyle>(\n \"dropzone\",\n dropzoneStyle,\n)\n\nexport { DropzonePropsContext, useDropzonePropsContext }\n\n/**\n * `Dropzone` is a component used for uploading files via drag and drop.\n *\n * @see https://yamada-ui.com/docs/components/dropzone\n */\nexport const DropzoneRoot = withProvider(\n ({\n children,\n errorBorderColor,\n focusBorderColor,\n loadingScheme,\n inputProps,\n loadingProps,\n overlayProps,\n ...rest\n }) => {\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const {\n dragAccept,\n dragIdle,\n dragReject,\n loading,\n getInputProps,\n getRootProps,\n } = useDropzone(rest)\n const context = useMemo(\n () => ({\n dragAccept,\n dragIdle,\n dragReject,\n loading,\n }),\n [dragAccept, dragIdle, dragReject, loading],\n )\n\n return (\n <ComponentContext value={context}>\n <Portal>\n <styled.input {...getInputProps(inputProps)} />\n </Portal>\n\n <styled.div data-group {...varProps} {...getRootProps()}>\n <DropzoneOverlay {...overlayProps}>\n <DropzoneLoading loadingScheme={loadingScheme} {...loadingProps} />\n </DropzoneOverlay>\n\n {children}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n)()\n\nexport interface DropzoneIconProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const DropzoneIcon = withContext<\"svg\", DropzoneIconProps>(\n \"svg\",\n \"icon\",\n)()\n\nexport interface DropzoneTitleProps extends HTMLStyledProps<\"p\"> {}\n\nexport const DropzoneTitle = withContext<\"p\", DropzoneTitleProps>(\n \"p\",\n \"title\",\n)()\n\nexport interface DropzoneDescriptionProps extends HTMLStyledProps<\"p\"> {}\n\nexport const DropzoneDescription = withContext<\"p\", DropzoneDescriptionProps>(\n \"p\",\n \"description\",\n)()\n\ninterface DropzoneOverlayProps extends FadeProps {\n loadingProps?: DropzoneLoadingProps\n}\n\nconst DropzoneOverlay = withContext<\"div\", DropzoneOverlayProps>(\n Fade,\n \"overlay\",\n)(undefined, (props) => {\n const { loading } = useComponentContext()\n\n return { open: loading, unmountOnExit: true, ...props }\n})\n\ninterface DropzoneLoadingProps extends Loading.Props {\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n}\n\nconst DropzoneLoading = withContext<\"svg\", DropzoneLoadingProps>(\n ({ loadingScheme = \"oval\", ...rest }) => {\n const Component = useLoadingComponent(loadingScheme)\n\n return <Component {...rest} />\n },\n \"loading\",\n)()\n\nexport interface DropzoneAcceptProps extends PropsWithChildren {}\n\nexport const DropzoneAccept: FC<DropzoneAcceptProps> = ({ children }) => {\n const { dragAccept } = useComponentContext()\n\n return dragAccept ? children : null\n}\n\nexport interface DropzoneRejectProps extends PropsWithChildren {}\n\nexport const DropzoneReject: FC<DropzoneRejectProps> = ({ children }) => {\n const { dragReject } = useComponentContext()\n\n return dragReject ? children : null\n}\n\nexport interface DropzoneIdleProps extends PropsWithChildren {}\n\nexport const DropzoneIdle: FC<DropzoneIdleProps> = ({ children }) => {\n const { dragIdle } = useComponentContext()\n\n return dragIdle ? children : null\n}\n"],"mappings":";;;;;;;;;;;;AA4CA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EACC,UACA,kBACA,kBACA,eACA,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AM,EAAE,eAAe,oBAAoB;CAE3C,OAAO,aAAa,WAAW;AACjC;AAIA,MAAa,gBAAuC,EAAE,eAAe;CACnE,MAAM,EAAE,aAAa,oBAAoB;CAEzC,OAAO,WAAW,WAAW;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-dropzone.js","names":["useDropzone","useOriginalDropzone"],"sources":["../../../../src/components/dropzone/use-dropzone.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Accept, DropzoneOptions } from \"react-dropzone\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { fromEvent } from \"file-selector\"\nimport { useCallback, useId } from \"react\"\nimport { useDropzone as useOriginalDropzone } from \"react-dropzone\"\nimport { mergeProps } from \"../../core\"\nimport {\n ariaAttr,\n assignRef,\n cx,\n dataAttr,\n isArray,\n mergeRefs,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\nexport interface UseDropzoneProps\n extends Omit<HTMLProps, \"onDrop\" | \"onError\">, FieldProps {\n /**\n * Set accepted file types.\n */\n accept?: Accept | string[]\n /**\n * Set to true to focus the root element on render.\n *\n * @default false\n */\n autoFocus?: boolean\n /**\n * Use this to provide a custom file aggregator.\n */\n getFilesFromEvent?: DropzoneOptions[\"getFilesFromEvent\"]\n /**\n * If `true`, display the dropzone loading icon.\n *\n * @default false\n */\n loading?: boolean\n /**\n * Maximum accepted number of files.\n * The default value is 0 which means there is no limitation to how many files are accepted.\n *\n * @default 0\n */\n maxFiles?: number\n /**\n * Maximum file size (in bytes).\n *\n * @default Infinity\n */\n maxSize?: number\n /**\n * Minimum file size (in bytes).\n *\n * @default 0\n */\n minSize?: number\n /**\n * Allow drag and drop (or selection from the file dialog) of multiple files.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * If true, disables click to open the native file selection dialog.\n *\n * @default false\n */\n noClick?: boolean\n /**\n * If true, disables drag and drop.\n *\n * @default false\n */\n noDrag?: boolean\n /**\n * If true, stops drag event propagation to parents.\n *\n * @default false\n */\n noDragEventsBubbling?: boolean\n /**\n * If true, disables `space` and `enter` to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n *\n * @default false\n */\n noKeyboard?: boolean\n /**\n * Ref to a open function.\n */\n openRef?: RefObject<() => void>\n /**\n * If false, allow dropped items to take over the current browser window.\n *\n * @default true\n */\n preventDropOnDocument?: boolean\n /**\n * If true, use the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API) to read files.\n *\n * @default false\n */\n useFsAccessApi?: boolean\n /**\n * Custom validation function.\n * It must return null if there's no errors.\n */\n validator?: DropzoneOptions[\"validator\"]\n /**\n * Callback for when the dragenter event occurs.\n */\n onDragEnter?: DropzoneOptions[\"onDragEnter\"]\n /**\n * Callback for when the dragleave event occurs.\n */\n onDragLeave?: DropzoneOptions[\"onDragLeave\"]\n /**\n * Callback for when the dragover event occurs.\n */\n onDragOver?: DropzoneOptions[\"onDragOver\"]\n /**\n * Callback for when the drop event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n */\n onDrop?: DropzoneOptions[\"onDrop\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n */\n onDropAccepted?: DropzoneOptions[\"onDropAccepted\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n */\n onDropRejected?: DropzoneOptions[\"onDropRejected\"]\n /**\n * Callback for when there's some error from any of the promises.\n */\n onError?: DropzoneOptions[\"onError\"]\n /**\n * Callback for when closing the file dialog with no selection.\n */\n onFileDialogCancel?: DropzoneOptions[\"onFileDialogCancel\"]\n /**\n * Callback for when opening the file dialog.\n */\n onFileDialogOpen?: DropzoneOptions[\"onFileDialogOpen\"]\n}\n\nexport const useDropzone = (props: UseDropzoneProps = {}) => {\n const {\n props: {\n id,\n name,\n accept,\n autoFocus = false,\n disabled,\n getFilesFromEvent = fromEvent,\n loading,\n maxFiles = 0,\n maxSize = Infinity,\n minSize = 0,\n multiple = false,\n noClick = false,\n noDrag = false,\n noDragEventsBubbling = false,\n noKeyboard = false,\n openRef,\n preventDropOnDocument = true,\n readOnly,\n useFsAccessApi = false,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const labelledbyId = useId()\n const interactive = !(loading || readOnly || disabled)\n const {\n acceptedFiles,\n fileRejections,\n isDragAccept: dragAccept,\n isDragActive: dragActive,\n isDragReject: dragReject,\n isFocused: focused,\n open,\n getInputProps: getOriginalInputProps,\n getRootProps: getOriginalRootProps,\n } = useOriginalDropzone({\n accept: isArray(accept)\n ? accept.reduce((prev, current) => ({ ...prev, [current]: [] }), {})\n : accept,\n autoFocus,\n disabled: !interactive,\n getFilesFromEvent,\n maxFiles,\n maxSize,\n minSize,\n multiple,\n noClick,\n noDrag,\n noDragEventsBubbling,\n noKeyboard,\n preventDropOnDocument,\n useFsAccessApi,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n })\n const dragIdle = !dragAccept && !dragReject\n\n assignRef(openRef, open)\n\n const getRootProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => {\n const { ref: restRef, ...restProps } = rest\n const { ref: rootRef, ...rootProps } = getOriginalRootProps(\n mergeProps(\n {\n id: labelledbyId,\n ...dataProps,\n ...eventProps,\n \"aria-disabled\": ariaAttr(!interactive),\n \"data-accept\": dataAttr(dragAccept),\n \"data-idle\": dataAttr(dragIdle),\n \"data-loading\": dataAttr(loading),\n \"data-reject\": dataAttr(dragReject),\n },\n restProps,\n props,\n )(),\n ) as HTMLProps\n\n return {\n ...rootProps,\n ref: mergeRefs(restRef, ref, rootRef),\n }\n },\n [\n getOriginalRootProps,\n labelledbyId,\n dataProps,\n eventProps,\n interactive,\n dragAccept,\n dragIdle,\n loading,\n dragReject,\n rest,\n ],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n getOriginalInputProps({\n id,\n name,\n disabled,\n readOnly,\n ...ariaProps,\n ...dataProps,\n ...props,\n \"aria-labelledby\": cx(ariaLabelledby, labelledbyId),\n }),\n [\n getOriginalInputProps,\n id,\n name,\n disabled,\n readOnly,\n ariaProps,\n dataProps,\n labelledbyId,\n ],\n )\n\n return {\n acceptedFiles,\n dragAccept,\n dragActive,\n dragIdle,\n dragReject,\n fileRejections,\n focused,\n loading,\n open,\n getInputProps,\n getRootProps,\n }\n}\n\nexport type UseDropzoneReturn = ReturnType<typeof useDropzone>\n"],"mappings":";;;;;;;;;AA8JA,MAAaA,iBAAe,QAA0B,CAAC,MAAM;CAC3D,MAAM,EACJ,OAAO,EACL,IACA,MACA,QACA,YAAY,OACZ,UACA,oBAAoB,WACpB,SACA,WAAW,GACX,UAAU,UACV,UAAU,GACV,WAAW,OACX,UAAU,OACV,SAAS,OACT,uBAAuB,OACvB,aAAa,OACb,SACA,wBAAwB,MACxB,UACA,iBAAiB,OACjB,WACA,aACA,aACA,YACA,QACA,gBACA,gBACA,SACA,oBACA,kBACA,GAAG,QAEL,WACA,WACA,eACE,cAAc,KAAK;CACvB,MAAM,eAAe,MAAM;CAC3B,MAAM,cAAc,EAAE,WAAW,YAAY;CAC7C,MAAM,EACJ,eACA,gBACA,cAAc,YACd,cAAc,YACd,cAAc,YACd,WAAW,SACX,MACA,eAAe,uBACf,cAAc,yBACZC,YAAoB;EACtB,SAAA,GAAA,cAAA,QAAA,CAAgB,MAAM,IAClB,OAAO,QAAQ,MAAM,aAAa;GAAE,GAAG;IAAO,UAAU,CAAC;EAAE,IAAI,CAAC,CAAC,IACjE;EACJ;EACA,UAAU,CAAC;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,WAAW,CAAC,cAAc,CAAC;CAEjC,UAAU,SAAS,IAAI;CAEvB,MAAM,eAA2B,aAC9B,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM;EAC1B,MAAM,EAAE,KAAK,SAAS,GAAG,cAAc;EACvC,MAAM,EAAE,KAAK,SAAS,GAAG,cAAc,qBACrC,WACE;GACE,IAAI;GACJ,GAAG;GACH,GAAG;GACH,kBAAA,GAAA,cAAA,SAAA,CAA0B,CAAC,WAAW;GACtC,gBAAA,GAAA,cAAA,SAAA,CAAwB,UAAU;GAClC,cAAA,GAAA,cAAA,SAAA,CAAsB,QAAQ;GAC9B,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;GAChC,gBAAA,GAAA,cAAA,SAAA,CAAwB,UAAU;EACpC,GACA,WACA,KACF,CAAC,CAAC,CACJ;EAEA,OAAO;GACL,GAAG;GACH,KAAK,UAAU,SAAS,KAAK,OAAO;EACtC;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CA0BA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAlCyC,aACxC,EAAE,mBAAmB,gBAAgB,GAAG,UAAU,CAAC,MAClD,sBAAsB;GACpB;GACA;GACA;GACA;GACA,GAAG;GACH,GAAG;GACH,GAAG;GACH,oBAAA,GAAA,cAAA,GAAA,CAAsB,gBAAgB,YAAY;EACpD,CAAC,GACH;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAaY;EACZ;CACF;AACF"}
1
+ {"version":3,"file":"use-dropzone.js","names":["useDropzone","useOriginalDropzone","isArray","ariaAttr","dataAttr","cx"],"sources":["../../../../src/components/dropzone/use-dropzone.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Accept, DropzoneOptions } from \"react-dropzone\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { fromEvent } from \"file-selector\"\nimport { useCallback, useId } from \"react\"\nimport { useDropzone as useOriginalDropzone } from \"react-dropzone\"\nimport { mergeProps } from \"../../core\"\nimport {\n ariaAttr,\n assignRef,\n cx,\n dataAttr,\n isArray,\n mergeRefs,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\nexport interface UseDropzoneProps\n extends Omit<HTMLProps, \"onDrop\" | \"onError\">, FieldProps {\n /**\n * Set accepted file types.\n */\n accept?: Accept | string[]\n /**\n * Set to true to focus the root element on render.\n *\n * @default false\n */\n autoFocus?: boolean\n /**\n * Use this to provide a custom file aggregator.\n */\n getFilesFromEvent?: DropzoneOptions[\"getFilesFromEvent\"]\n /**\n * If `true`, display the dropzone loading icon.\n *\n * @default false\n */\n loading?: boolean\n /**\n * Maximum accepted number of files.\n * The default value is 0 which means there is no limitation to how many files are accepted.\n *\n * @default 0\n */\n maxFiles?: number\n /**\n * Maximum file size (in bytes).\n *\n * @default Infinity\n */\n maxSize?: number\n /**\n * Minimum file size (in bytes).\n *\n * @default 0\n */\n minSize?: number\n /**\n * Allow drag and drop (or selection from the file dialog) of multiple files.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * If true, disables click to open the native file selection dialog.\n *\n * @default false\n */\n noClick?: boolean\n /**\n * If true, disables drag and drop.\n *\n * @default false\n */\n noDrag?: boolean\n /**\n * If true, stops drag event propagation to parents.\n *\n * @default false\n */\n noDragEventsBubbling?: boolean\n /**\n * If true, disables `space` and `enter` to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n *\n * @default false\n */\n noKeyboard?: boolean\n /**\n * Ref to a open function.\n */\n openRef?: RefObject<() => void>\n /**\n * If false, allow dropped items to take over the current browser window.\n *\n * @default true\n */\n preventDropOnDocument?: boolean\n /**\n * If true, use the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API) to read files.\n *\n * @default false\n */\n useFsAccessApi?: boolean\n /**\n * Custom validation function.\n * It must return null if there's no errors.\n */\n validator?: DropzoneOptions[\"validator\"]\n /**\n * Callback for when the dragenter event occurs.\n */\n onDragEnter?: DropzoneOptions[\"onDragEnter\"]\n /**\n * Callback for when the dragleave event occurs.\n */\n onDragLeave?: DropzoneOptions[\"onDragLeave\"]\n /**\n * Callback for when the dragover event occurs.\n */\n onDragOver?: DropzoneOptions[\"onDragOver\"]\n /**\n * Callback for when the drop event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n */\n onDrop?: DropzoneOptions[\"onDrop\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n */\n onDropAccepted?: DropzoneOptions[\"onDropAccepted\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n */\n onDropRejected?: DropzoneOptions[\"onDropRejected\"]\n /**\n * Callback for when there's some error from any of the promises.\n */\n onError?: DropzoneOptions[\"onError\"]\n /**\n * Callback for when closing the file dialog with no selection.\n */\n onFileDialogCancel?: DropzoneOptions[\"onFileDialogCancel\"]\n /**\n * Callback for when opening the file dialog.\n */\n onFileDialogOpen?: DropzoneOptions[\"onFileDialogOpen\"]\n}\n\nexport const useDropzone = (props: UseDropzoneProps = {}) => {\n const {\n props: {\n id,\n name,\n accept,\n autoFocus = false,\n disabled,\n getFilesFromEvent = fromEvent,\n loading,\n maxFiles = 0,\n maxSize = Infinity,\n minSize = 0,\n multiple = false,\n noClick = false,\n noDrag = false,\n noDragEventsBubbling = false,\n noKeyboard = false,\n openRef,\n preventDropOnDocument = true,\n readOnly,\n useFsAccessApi = false,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const labelledbyId = useId()\n const interactive = !(loading || readOnly || disabled)\n const {\n acceptedFiles,\n fileRejections,\n isDragAccept: dragAccept,\n isDragActive: dragActive,\n isDragReject: dragReject,\n isFocused: focused,\n open,\n getInputProps: getOriginalInputProps,\n getRootProps: getOriginalRootProps,\n } = useOriginalDropzone({\n accept: isArray(accept)\n ? accept.reduce((prev, current) => ({ ...prev, [current]: [] }), {})\n : accept,\n autoFocus,\n disabled: !interactive,\n getFilesFromEvent,\n maxFiles,\n maxSize,\n minSize,\n multiple,\n noClick,\n noDrag,\n noDragEventsBubbling,\n noKeyboard,\n preventDropOnDocument,\n useFsAccessApi,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n })\n const dragIdle = !dragAccept && !dragReject\n\n assignRef(openRef, open)\n\n const getRootProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => {\n const { ref: restRef, ...restProps } = rest\n const { ref: rootRef, ...rootProps } = getOriginalRootProps(\n mergeProps(\n {\n id: labelledbyId,\n ...dataProps,\n ...eventProps,\n \"aria-disabled\": ariaAttr(!interactive),\n \"data-accept\": dataAttr(dragAccept),\n \"data-idle\": dataAttr(dragIdle),\n \"data-loading\": dataAttr(loading),\n \"data-reject\": dataAttr(dragReject),\n },\n restProps,\n props,\n )(),\n ) as HTMLProps\n\n return {\n ...rootProps,\n ref: mergeRefs(restRef, ref, rootRef),\n }\n },\n [\n getOriginalRootProps,\n labelledbyId,\n dataProps,\n eventProps,\n interactive,\n dragAccept,\n dragIdle,\n loading,\n dragReject,\n rest,\n ],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n getOriginalInputProps({\n id,\n name,\n disabled,\n readOnly,\n ...ariaProps,\n ...dataProps,\n ...props,\n \"aria-labelledby\": cx(ariaLabelledby, labelledbyId),\n }),\n [\n getOriginalInputProps,\n id,\n name,\n disabled,\n readOnly,\n ariaProps,\n dataProps,\n labelledbyId,\n ],\n )\n\n return {\n acceptedFiles,\n dragAccept,\n dragActive,\n dragIdle,\n dragReject,\n fileRejections,\n focused,\n loading,\n open,\n getInputProps,\n getRootProps,\n }\n}\n\nexport type UseDropzoneReturn = ReturnType<typeof useDropzone>\n"],"mappings":";;;;;;;;;AA8JA,MAAaA,iBAAe,QAA0B,CAAC,MAAM;CAC3D,MAAM,EACJ,OAAO,EACL,IACA,MACA,QACA,YAAY,OACZ,UACA,oBAAoB,WACpB,SACA,WAAW,GACX,UAAU,UACV,UAAU,GACV,WAAW,OACX,UAAU,OACV,SAAS,OACT,uBAAuB,OACvB,aAAa,OACb,SACA,wBAAwB,MACxB,UACA,iBAAiB,OACjB,WACA,aACA,aACA,YACA,QACA,gBACA,gBACA,SACA,oBACA,kBACA,GAAG,QAEL,WACA,WACA,eACE,cAAc,KAAK;CACvB,MAAM,eAAe,MAAM;CAC3B,MAAM,cAAc,EAAE,WAAW,YAAY;CAC7C,MAAM,EACJ,eACA,gBACA,cAAc,YACd,cAAc,YACd,cAAc,YACd,WAAW,SACX,MACA,eAAe,uBACf,cAAc,yBACZC,YAAoB;EACtB,SAAA,GAAQC,cAAAA,QAAAA,CAAQ,MAAM,IAClB,OAAO,QAAQ,MAAM,aAAa;GAAE,GAAG;IAAO,UAAU,CAAC;EAAE,IAAI,CAAC,CAAC,IACjE;EACJ;EACA,UAAU,CAAC;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,WAAW,CAAC,cAAc,CAAC;CAEjC,UAAU,SAAS,IAAI;CAEvB,MAAM,eAA2B,aAC9B,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM;EAC1B,MAAM,EAAE,KAAK,SAAS,GAAG,cAAc;EACvC,MAAM,EAAE,KAAK,SAAS,GAAG,cAAc,qB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