@yamada-ui/react 2.3.0-dev-20260724085908 → 2.3.0-dev-20260730080927

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 (350) hide show
  1. package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
  2. package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
  3. package/dist/cjs/components/airy/airy.cjs.map +1 -1
  4. package/dist/cjs/components/alert/alert.cjs.map +1 -1
  5. package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
  6. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  7. package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
  8. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  9. package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
  10. package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
  11. package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
  12. package/dist/cjs/components/button/button-group.cjs.map +1 -1
  13. package/dist/cjs/components/button/button.cjs.map +1 -1
  14. package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
  15. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
  17. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  18. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  19. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  21. package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
  22. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
  24. package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
  25. package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
  26. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  27. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  28. package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
  29. package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
  30. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  31. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  32. package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
  33. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  34. package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
  35. package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
  36. package/dist/cjs/components/editable/editable.cjs.map +1 -1
  37. package/dist/cjs/components/editable/use-editable.cjs +4 -5
  38. package/dist/cjs/components/editable/use-editable.cjs.map +1 -1
  39. package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
  40. package/dist/cjs/components/fade/fade.cjs.map +1 -1
  41. package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
  42. package/dist/cjs/components/field/field.cjs.map +1 -1
  43. package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
  44. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  45. package/dist/cjs/components/flip/flip.cjs.map +1 -1
  46. package/dist/cjs/components/focus-lock/focus-lock.cjs +26 -9
  47. package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
  48. package/dist/cjs/components/focus-lock/index.cjs +1 -0
  49. package/dist/cjs/components/form/form.cjs.map +1 -1
  50. package/dist/cjs/components/format/format-byte.cjs.map +1 -1
  51. package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
  52. package/dist/cjs/components/format/format-number.cjs.map +1 -1
  53. package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
  54. package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
  55. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
  56. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
  57. package/dist/cjs/components/icon/icons/index.cjs +9 -3
  58. package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
  59. package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
  60. package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
  61. package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
  62. package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
  63. package/dist/cjs/components/icon/index.cjs +6 -2
  64. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  65. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
  66. package/dist/cjs/components/input/input-group.cjs.map +1 -1
  67. package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
  68. package/dist/cjs/components/list/list.cjs.map +1 -1
  69. package/dist/cjs/components/loading/audio.cjs.map +1 -1
  70. package/dist/cjs/components/loading/background.cjs.map +1 -1
  71. package/dist/cjs/components/loading/circles.cjs.map +1 -1
  72. package/dist/cjs/components/loading/dots.cjs.map +1 -1
  73. package/dist/cjs/components/loading/grid.cjs.map +1 -1
  74. package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
  75. package/dist/cjs/components/loading/oval.cjs.map +1 -1
  76. package/dist/cjs/components/loading/page.cjs.map +1 -1
  77. package/dist/cjs/components/loading/puff.cjs.map +1 -1
  78. package/dist/cjs/components/loading/rings.cjs.map +1 -1
  79. package/dist/cjs/components/loading/screen.cjs.map +1 -1
  80. package/dist/cjs/components/loading/suspense.cjs.map +1 -1
  81. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  82. package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
  83. package/dist/cjs/components/modal/modal.cjs +39 -21
  84. package/dist/cjs/components/modal/modal.cjs.map +1 -1
  85. package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
  86. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  87. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  88. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  89. package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
  90. package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
  91. package/dist/cjs/components/notice/notice.cjs.map +1 -1
  92. package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
  93. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  94. package/dist/cjs/components/number-input/use-number-input.cjs +2 -1
  95. package/dist/cjs/components/number-input/use-number-input.cjs.map +1 -1
  96. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  97. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  98. package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
  99. package/dist/cjs/components/picture/picture.cjs.map +1 -1
  100. package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
  101. package/dist/cjs/components/popover/popover.cjs +66 -24
  102. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  103. package/dist/cjs/components/portal/portal.cjs +16 -0
  104. package/dist/cjs/components/portal/portal.cjs.map +1 -1
  105. package/dist/cjs/components/progress/progress.cjs.map +1 -1
  106. package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
  107. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  108. package/dist/cjs/components/radio/radio.cjs.map +1 -1
  109. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  110. package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
  111. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  112. package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
  113. package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
  114. package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
  115. package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
  116. package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
  117. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
  118. package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
  119. package/dist/cjs/components/select/select.cjs.map +1 -1
  120. package/dist/cjs/components/select/use-select.cjs.map +1 -1
  121. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  122. package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
  123. package/dist/cjs/components/slide/slide.cjs.map +1 -1
  124. package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
  125. package/dist/cjs/components/slider/slider.cjs.map +1 -1
  126. package/dist/cjs/components/slot/slot.cjs.map +1 -1
  127. package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
  128. package/dist/cjs/components/stack/stack.cjs.map +1 -1
  129. package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
  130. package/dist/cjs/components/stat/stat.cjs.map +1 -1
  131. package/dist/cjs/components/status/status.cjs.map +1 -1
  132. package/dist/cjs/components/steps/steps.cjs.map +1 -1
  133. package/dist/cjs/components/switch/switch.cjs.map +1 -1
  134. package/dist/cjs/components/table/table.cjs.map +1 -1
  135. package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
  136. package/dist/cjs/components/tag/tag.cjs.map +1 -1
  137. package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
  138. package/dist/cjs/components/tip/tip.cjs.map +1 -1
  139. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  140. package/dist/cjs/components/tooltip/tooltip.cjs +2 -2
  141. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  142. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  143. package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
  144. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  145. package/dist/cjs/core/css/focus-ring.cjs +4 -1
  146. package/dist/cjs/core/css/focus-ring.cjs.map +1 -1
  147. package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
  148. package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
  149. package/dist/cjs/core/system/styled.cjs.map +1 -1
  150. package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
  151. package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
  152. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
  153. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  154. package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
  155. package/dist/cjs/hooks/use-focus/index.cjs +8 -4
  156. package/dist/cjs/hooks/use-focus/index.cjs.map +1 -1
  157. package/dist/cjs/hooks/use-outside-click/index.cjs +4 -2
  158. package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
  159. package/dist/cjs/index.cjs +12 -4
  160. package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
  161. package/dist/cjs/utils/dom.cjs +4 -1
  162. package/dist/cjs/utils/dom.cjs.map +1 -1
  163. package/dist/cjs/utils/store.cjs.map +1 -1
  164. package/dist/esm/components/accordion/accordion.js.map +1 -1
  165. package/dist/esm/components/action-bar/action-bar.js.map +1 -1
  166. package/dist/esm/components/airy/airy.js.map +1 -1
  167. package/dist/esm/components/alert/alert.js.map +1 -1
  168. package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
  169. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  170. package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
  171. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  172. package/dist/esm/components/avatar/avatar.js.map +1 -1
  173. package/dist/esm/components/blockquote/blockquote.js.map +1 -1
  174. package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
  175. package/dist/esm/components/button/button-group.js.map +1 -1
  176. package/dist/esm/components/button/button.js.map +1 -1
  177. package/dist/esm/components/calendar/calendar.js.map +1 -1
  178. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  179. package/dist/esm/components/carousel/carousel.js.map +1 -1
  180. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  181. package/dist/esm/components/chart/chart.js.map +1 -1
  182. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  183. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  184. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  185. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  186. package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
  187. package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
  188. package/dist/esm/components/collapse/collapse.js.map +1 -1
  189. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  190. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  191. package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
  192. package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
  193. package/dist/esm/components/data-list/data-list.js.map +1 -1
  194. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  195. package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
  196. package/dist/esm/components/drawer/drawer.js +1 -1
  197. package/dist/esm/components/drawer/drawer.js.map +1 -1
  198. package/dist/esm/components/dropzone/dropzone.js.map +1 -1
  199. package/dist/esm/components/editable/editable.js.map +1 -1
  200. package/dist/esm/components/editable/use-editable.js +4 -5
  201. package/dist/esm/components/editable/use-editable.js.map +1 -1
  202. package/dist/esm/components/empty-state/empty-state.js.map +1 -1
  203. package/dist/esm/components/fade/fade.js.map +1 -1
  204. package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
  205. package/dist/esm/components/field/field.js.map +1 -1
  206. package/dist/esm/components/fieldset/fieldset.js.map +1 -1
  207. package/dist/esm/components/file-input/file-input.js.map +1 -1
  208. package/dist/esm/components/flip/flip.js.map +1 -1
  209. package/dist/esm/components/focus-lock/focus-lock.js +27 -11
  210. package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
  211. package/dist/esm/components/focus-lock/index.js +2 -2
  212. package/dist/esm/components/form/form.js.map +1 -1
  213. package/dist/esm/components/format/format-byte.js.map +1 -1
  214. package/dist/esm/components/format/format-date-time.js.map +1 -1
  215. package/dist/esm/components/format/format-number.js.map +1 -1
  216. package/dist/esm/components/highlight/highlight.js.map +1 -1
  217. package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
  218. package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
  219. package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
  220. package/dist/esm/components/icon/icons/index.js +7 -3
  221. package/dist/esm/components/icon/icons/index.js.map +1 -1
  222. package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
  223. package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
  224. package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
  225. package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
  226. package/dist/esm/components/icon/index.js +4 -2
  227. package/dist/esm/components/indicator/indicator.js.map +1 -1
  228. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
  229. package/dist/esm/components/input/input-group.js.map +1 -1
  230. package/dist/esm/components/link-box/link-box.js.map +1 -1
  231. package/dist/esm/components/list/list.js.map +1 -1
  232. package/dist/esm/components/loading/audio.js.map +1 -1
  233. package/dist/esm/components/loading/background.js.map +1 -1
  234. package/dist/esm/components/loading/circles.js.map +1 -1
  235. package/dist/esm/components/loading/dots.js.map +1 -1
  236. package/dist/esm/components/loading/grid.js.map +1 -1
  237. package/dist/esm/components/loading/loading-provider.js.map +1 -1
  238. package/dist/esm/components/loading/oval.js.map +1 -1
  239. package/dist/esm/components/loading/page.js.map +1 -1
  240. package/dist/esm/components/loading/puff.js.map +1 -1
  241. package/dist/esm/components/loading/rings.js.map +1 -1
  242. package/dist/esm/components/loading/screen.js.map +1 -1
  243. package/dist/esm/components/loading/suspense.js.map +1 -1
  244. package/dist/esm/components/menu/menu.js.map +1 -1
  245. package/dist/esm/components/menu/use-menu.js.map +1 -1
  246. package/dist/esm/components/modal/modal.js +40 -21
  247. package/dist/esm/components/modal/modal.js.map +1 -1
  248. package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
  249. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  250. package/dist/esm/components/native-select/native-select.js.map +1 -1
  251. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  252. package/dist/esm/components/native-table/native-table.js.map +1 -1
  253. package/dist/esm/components/notice/notice-provider.js.map +1 -1
  254. package/dist/esm/components/notice/notice.js.map +1 -1
  255. package/dist/esm/components/notice/use-notice.js.map +1 -1
  256. package/dist/esm/components/number-input/number-input.js.map +1 -1
  257. package/dist/esm/components/number-input/use-number-input.js +2 -1
  258. package/dist/esm/components/number-input/use-number-input.js.map +1 -1
  259. package/dist/esm/components/pagination/pagination.js.map +1 -1
  260. package/dist/esm/components/password-input/password-input.js.map +1 -1
  261. package/dist/esm/components/password-input/strength-meter.js.map +1 -1
  262. package/dist/esm/components/picture/picture.js.map +1 -1
  263. package/dist/esm/components/pin-input/pin-input.js.map +1 -1
  264. package/dist/esm/components/popover/popover.js +67 -25
  265. package/dist/esm/components/popover/popover.js.map +1 -1
  266. package/dist/esm/components/portal/portal.js +17 -1
  267. package/dist/esm/components/portal/portal.js.map +1 -1
  268. package/dist/esm/components/progress/progress.js.map +1 -1
  269. package/dist/esm/components/qr-code/qr-code.js.map +1 -1
  270. package/dist/esm/components/radio/radio-group.js.map +1 -1
  271. package/dist/esm/components/radio/radio.js.map +1 -1
  272. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  273. package/dist/esm/components/radio-card/radio-card.js.map +1 -1
  274. package/dist/esm/components/rating/rating.js.map +1 -1
  275. package/dist/esm/components/reorder/reorder.js.map +1 -1
  276. package/dist/esm/components/resizable/resizable.js.map +1 -1
  277. package/dist/esm/components/ripple/ripple.js.map +1 -1
  278. package/dist/esm/components/rotate/rotate.js.map +1 -1
  279. package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
  280. package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
  281. package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
  282. package/dist/esm/components/select/select.js.map +1 -1
  283. package/dist/esm/components/select/use-select.js.map +1 -1
  284. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  285. package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
  286. package/dist/esm/components/slide/slide.js.map +1 -1
  287. package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
  288. package/dist/esm/components/slider/slider.js.map +1 -1
  289. package/dist/esm/components/slot/slot.js.map +1 -1
  290. package/dist/esm/components/snacks/snacks.js.map +1 -1
  291. package/dist/esm/components/stack/stack.js.map +1 -1
  292. package/dist/esm/components/stack/z-stack.js.map +1 -1
  293. package/dist/esm/components/stat/stat.js.map +1 -1
  294. package/dist/esm/components/status/status.js.map +1 -1
  295. package/dist/esm/components/steps/steps.js.map +1 -1
  296. package/dist/esm/components/switch/switch.js.map +1 -1
  297. package/dist/esm/components/table/table.js.map +1 -1
  298. package/dist/esm/components/tabs/tabs.js.map +1 -1
  299. package/dist/esm/components/tag/tag.js.map +1 -1
  300. package/dist/esm/components/timeline/timeline.js.map +1 -1
  301. package/dist/esm/components/tip/tip.js.map +1 -1
  302. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  303. package/dist/esm/components/tooltip/tooltip.js +2 -2
  304. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  305. package/dist/esm/components/tree/tree.js.map +1 -1
  306. package/dist/esm/components/tree/use-tree.js.map +1 -1
  307. package/dist/esm/core/components/create-component.js.map +1 -1
  308. package/dist/esm/core/css/focus-ring.js +4 -1
  309. package/dist/esm/core/css/focus-ring.js.map +1 -1
  310. package/dist/esm/core/system/breakpoint.js.map +1 -1
  311. package/dist/esm/core/system/environment-provider.js.map +1 -1
  312. package/dist/esm/core/system/styled.js.map +1 -1
  313. package/dist/esm/core/system/theme-provider.js.map +1 -1
  314. package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
  315. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  316. package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
  317. package/dist/esm/hooks/use-focus/index.js +8 -4
  318. package/dist/esm/hooks/use-focus/index.js.map +1 -1
  319. package/dist/esm/hooks/use-outside-click/index.js +4 -2
  320. package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
  321. package/dist/esm/index.js +9 -4
  322. package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
  323. package/dist/esm/utils/dom.js +4 -1
  324. package/dist/esm/utils/dom.js.map +1 -1
  325. package/dist/esm/utils/store.js.map +1 -1
  326. package/dist/types/components/avatar/avatar.d.ts +3 -3
  327. package/dist/types/components/avatar/avatar.style.d.ts +1 -1
  328. package/dist/types/components/chart/cartesian-chart.style.d.ts +1 -1
  329. package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
  330. package/dist/types/components/focus-lock/focus-lock.d.ts +2 -1
  331. package/dist/types/components/focus-lock/index.d.ts +2 -2
  332. package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
  333. package/dist/types/components/icon/icons/index.d.ts +5 -3
  334. package/dist/types/components/icon/icons/index.types.d.ts +1 -1
  335. package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
  336. package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
  337. package/dist/types/components/icon/index.d.ts +4 -2
  338. package/dist/types/components/menu/use-menu.d.ts +1 -1
  339. package/dist/types/components/modal/modal.d.ts +37 -1
  340. package/dist/types/components/popover/popover.d.ts +57 -2
  341. package/dist/types/components/tooltip/tooltip.d.ts +8 -1
  342. package/dist/types/core/css/focus-ring.d.ts +1 -0
  343. package/dist/types/index.d.ts +6 -4
  344. package/dist/types/providers/i18n-provider/i18n-provider.d.ts +1 -1
  345. package/package.json +6 -6
  346. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
  347. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
  348. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
  349. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
  350. package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton-text.js","names":[],"sources":["../../../../src/components/skeleton/skeleton-text.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Component, HTMLStyledProps } from \"../../core\"\nimport type { SkeletonProps } from \"./skeleton\"\nimport { mergeCSS, styled } from \"../../core\"\nimport { Skeleton } from \"./skeleton\"\n\nexport interface SkeletonTextProps extends Omit<SkeletonProps, \"lineClamp\"> {\n /**\n * The number of lines to display.\n */\n lineClamp?: number\n /**\n * Props for the root element.\n */\n rootProps?: HTMLStyledProps\n}\n\nexport const SkeletonText = (({\n css,\n children,\n gap = \"2\",\n lineClamp = 3,\n loading = true,\n _loading,\n _notFirst,\n rootProps,\n ...rest\n}: SkeletonTextProps) => {\n return (\n <styled.div w=\"full\" {...rootProps}>\n {Array.from({ length: lineClamp }).map((_, index) => {\n if (!loading && index > 0) return null\n\n return (\n <Skeleton\n key={index}\n css={mergeCSS(css, { \"--height\": \"sizes.4\" })}\n loading={loading}\n _loading={{\n _last: { maxW: lineClamp > 1 ? \"80%\" : \"100%\" },\n ..._loading,\n }}\n _notFirst={{ mt: gap, ..._notFirst }}\n {...rest}\n >\n {!loading && index === 0 ? children : undefined}\n </Skeleton>\n )\n })}\n </styled.div>\n )\n}) as Component<\"div\", SkeletonTextProps>\n"],"mappings":";;;;;;AAkBA,MAAa,iBAAiB,EAC5B,KACA,UACA,MAAM,KACN,YAAY,GACZ,UAAU,MACV,UACA,WACA,WACA,GAAG,WACoB;CACvB,OACE,oBAAC,OAAO,KAAR;EAAY,GAAE;EAAO,GAAI;YACtB,MAAM,KAAK,EAAE,QAAQ,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU;GACnD,IAAI,CAAC,WAAW,QAAQ,GAAG,OAAO;GAElC,OACE,oBAAC,UAAD;IAEE,KAAK,SAAS,KAAK,EAAE,YAAY,UAAU,CAAC;IACnC;IACT,UAAU;KACR,OAAO,EAAE,MAAM,YAAY,IAAI,QAAQ,OAAO;KAC9C,GAAG;IACL;IACA,WAAW;KAAE,IAAI;KAAK,GAAG;IAAU;IACnC,GAAI;cAEH,CAAC,WAAW,UAAU,IAAI,WAAW,KAAA;GAC9B,GAXH,KAWG;EAEd,CAAC;CACS,CAAA;AAEhB"}
1
+ {"version":3,"file":"skeleton-text.js","names":[],"sources":["../../../../src/components/skeleton/skeleton-text.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Component, HTMLStyledProps } from \"../../core\"\nimport type { SkeletonProps } from \"./skeleton\"\nimport { mergeCSS, styled } from \"../../core\"\nimport { Skeleton } from \"./skeleton\"\n\nexport interface SkeletonTextProps extends Omit<SkeletonProps, \"lineClamp\"> {\n /**\n * The number of lines to display.\n */\n lineClamp?: number\n /**\n * Props for the root element.\n */\n rootProps?: HTMLStyledProps\n}\n\nexport const SkeletonText = (({\n css,\n children,\n gap = \"2\",\n lineClamp = 3,\n loading = true,\n _loading,\n _notFirst,\n rootProps,\n ...rest\n}: SkeletonTextProps) => {\n return (\n <styled.div w=\"full\" {...rootProps}>\n {Array.from({ length: lineClamp }).map((_, index) => {\n if (!loading && index > 0) return null\n\n return (\n <Skeleton\n key={index}\n css={mergeCSS(css, { \"--height\": \"sizes.4\" })}\n loading={loading}\n _loading={{\n _last: { maxW: lineClamp > 1 ? \"80%\" : \"100%\" },\n ..._loading,\n }}\n _notFirst={{ mt: gap, ..._notFirst }}\n {...rest}\n >\n {!loading && index === 0 ? children : undefined}\n </Skeleton>\n )\n })}\n </styled.div>\n )\n}) as Component<\"div\", SkeletonTextProps>\n"],"mappings":";;;;;;AAkBA,MAAa,iBAAiB,EAC5B,KACA,UACA,MAAM,KACN,YAAY,GACZ,UAAU,MACV,UACA,WACA,WACA,GAAG,WACoB;CACvB,OACE,oBAAC,OAAO,KAAR;EAAY,GAAE;EAAO,GAAI;EACtB,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,UAAU;GACnD,IAAI,CAAC,WAAW,QAAQ,GAAG,OAAO;GAElC,OACE,oBAAC,UAAD;IAEE,KAAK,SAAS,KAAK,EAAE,YAAY,UAAU,CAAC;IACnC;IACT,UAAU;KACR,OAAO,EAAE,MAAM,YAAY,IAAI,QAAQ,OAAO;KAC9C,GAAG;IACL;IACA,WAAW;KAAE,IAAI;KAAK,GAAG;IAAU;IACnC,GAAI;IAEH,UAAA,CAAC,WAAW,UAAU,IAAI,WAAW,KAAA;GAC9B,GAXH,KAWG;EAEd,CAAC;CACS,CAAA;AAEhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"slide.js","names":["motion"],"sources":["../../../../src/components/slide/slide.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { SlideStyle } from \"./slide.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { createTransition, motion } from \"../motion\"\nimport { slideStyle } from \"./slide.style\"\n\nconst getAnimationProps = (placement: SlideProps[\"placement\"]) => {\n switch (placement) {\n case \"block-start\":\n return { enter: { x: 0, y: 0 }, exit: { x: 0, y: \"-100%\" } }\n case \"inline-end\":\n return { enter: { x: 0, y: 0 }, exit: { x: \"100%\", y: 0 } }\n case \"block-end\":\n return { enter: { x: 0, y: 0 }, exit: { x: 0, y: \"100%\" } }\n case \"inline-start\":\n return { enter: { x: 0, y: 0 }, exit: { x: \"-100%\", y: 0 } }\n default:\n return {}\n }\n}\nexport const slideVariants: Variants = {\n enter: ({\n delay,\n duration,\n enter,\n placement,\n transition,\n transitionEnd,\n } = {}) => ({\n ...getAnimationProps(placement).enter,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n ...enter,\n }),\n exit: ({\n delay,\n duration,\n exit,\n placement,\n transition,\n transitionEnd,\n } = {}) => ({\n ...getAnimationProps(placement).exit,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n ...exit,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface SlideProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<SlideStyle> {}\n\nconst {\n PropsContext: SlidePropsContext,\n usePropsContext: useSlidePropsContext,\n withContext,\n} = createComponent<SlideProps, SlideStyle>(\"slide\", slideStyle)\n\nexport { SlidePropsContext, useSlidePropsContext }\n\n/**\n * `Slide` is a component that shows or hides an element from the corners of the page.\n *\n * @see https://yamada-ui.com/docs/components/slide\n */\nexport const Slide = withContext<\"div\", SlideProps, \"placement\">(\n ({\n delay,\n duration = { enter: 0.4, exit: 0.3 },\n open: openProp,\n placement: placementProp,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp && unmountOnExit : true\n const placement = useValue(placementProp)\n\n const custom = useMemo(\n () => ({\n delay,\n duration,\n placement,\n transition,\n transitionEnd,\n }),\n [delay, duration, placement, transition, transitionEnd],\n )\n\n return (\n <AnimatePresence custom={custom}>\n {open ? (\n <motion.div\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial=\"exit\"\n variants={slideVariants}\n {...rest}\n />\n ) : null}\n </AnimatePresence>\n )\n },\n { transferProps: [\"placement\"] },\n)()\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,qBAAqB,cAAuC;CAChE,QAAQ,WAAR;EACE,KAAK,eACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAG,GAAG;GAAQ;EAAE;EAC7D,KAAK,cACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAQ,GAAG;GAAE;EAAE;EAC5D,KAAK,aAC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AAE,eAAe,CAAC,WAAW,EAAE,CACjC,CAAC,CAAC"}
1
+ {"version":3,"file":"slide.js","names":["motion"],"sources":["../../../../src/components/slide/slide.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { SlideStyle } from \"./slide.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { createTransition, motion } from \"../motion\"\nimport { slideStyle } from \"./slide.style\"\n\nconst getAnimationProps = (placement: SlideProps[\"placement\"]) => {\n switch (placement) {\n case \"block-start\":\n return { enter: { x: 0, y: 0 }, exit: { x: 0, y: \"-100%\" } }\n case \"inline-end\":\n return { enter: { x: 0, y: 0 }, exit: { x: \"100%\", y: 0 } }\n case \"block-end\":\n return { enter: { x: 0, y: 0 }, exit: { x: 0, y: \"100%\" } }\n case \"inline-start\":\n return { enter: { x: 0, y: 0 }, exit: { x: \"-100%\", y: 0 } }\n default:\n return {}\n }\n}\nexport const slideVariants: Variants = {\n enter: ({\n delay,\n duration,\n enter,\n placement,\n transition,\n transitionEnd,\n } = {}) => ({\n ...getAnimationProps(placement).enter,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n ...enter,\n }),\n exit: ({\n delay,\n duration,\n exit,\n placement,\n transition,\n transitionEnd,\n } = {}) => ({\n ...getAnimationProps(placement).exit,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n ...exit,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface SlideProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<SlideStyle> {}\n\nconst {\n PropsContext: SlidePropsContext,\n usePropsContext: useSlidePropsContext,\n withContext,\n} = createComponent<SlideProps, SlideStyle>(\"slide\", slideStyle)\n\nexport { SlidePropsContext, useSlidePropsContext }\n\n/**\n * `Slide` is a component that shows or hides an element from the corners of the page.\n *\n * @see https://yamada-ui.com/docs/components/slide\n */\nexport const Slide = withContext<\"div\", SlideProps, \"placement\">(\n ({\n delay,\n duration = { enter: 0.4, exit: 0.3 },\n open: openProp,\n placement: placementProp,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp && unmountOnExit : true\n const placement = useValue(placementProp)\n\n const custom = useMemo(\n () => ({\n delay,\n duration,\n placement,\n transition,\n transitionEnd,\n }),\n [delay, duration, placement, transition, transitionEnd],\n )\n\n return (\n <AnimatePresence custom={custom}>\n {open ? (\n <motion.div\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial=\"exit\"\n variants={slideVariants}\n {...rest}\n />\n ) : null}\n </AnimatePresence>\n )\n },\n { transferProps: [\"placement\"] },\n)()\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,qBAAqB,cAAuC;CAChE,QAAQ,WAAR;EACE,KAAK,eACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAG,GAAG;GAAQ;EAAE;EAC7D,KAAK,cACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAQ,GAAG;GAAE;EAAE;EAC5D,KAAK,aACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAG,GAAG;GAAO;EAAE;EAC5D,KAAK,gBACH,OAAO;GAAE,OAAO;IAAE,GAAG;IAAG,GAAG;GAAE;GAAG,MAAM;IAAE,GAAG;IAAS,GAAG;GAAE;EAAE;EAC7D,SACE,OAAO,CAAC;CACZ;AACF;AACA,MAAa,gBAA0B;CACrC,QAAQ,EACN,OACA,UACA,OACA,WACA,YACA,kBACE,CAAC,OAAO;EACV,GAAG,kBAAkB,SAAS,CAAC,CAAC;EAChC,YAAY,iBAAiB,MAAM,YAAY,KAAK,CAAC,CAAC,OAAO,QAAQ;EACrE,eAAe,eAAe;EAC9B,GAAG;CACL;CACA,OAAO,EACL,OACA,UACA,MACA,WACA,YACA,kBACE,CAAC,OAAO;EACV,GAAG,kBAAkB,SAAS,CAAC,CAAC;EAChC,YAAY,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,eAAe,eAAe;EAC9B,GAAG;CACL;AACF;AAKA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACE,gBAAwC,SAAS,UAAU;;;;;;AAS/D,MAAa,QAAQ,aAClB,EACC,OACA,WAAW;CAAE,OAAO;CAAK,MAAM;AAAI,GACnC,MAAM,UACN,WAAW,eACX,YACA,eACA,eACA,GAAG,WACC;CACJ,MAAM,UAAU,YAAY,gBAAgB,UAAU;CACtD,MAAM,OAAO,gBAAgB,YAAY,gBAAgB;CACzD,MAAM,YAAY,SAAS,aAAa;CAExC,MAAM,SAAS,eACN;EACL;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAW;EAAY;CAAa,CACxD;CAEA,OACE,oBAAC,iBAAD;EAAyB;EACtB,UAAA,OACC,oBAACA,SAAO,KAAR;GACW;GACD;GACR,MAAK;GACL,SAAQ;GACR,UAAU;GACV,GAAI;EACL,CAAA,IACC;CACW,CAAA;AAErB,GACA,EAAE,eAAe,CAAC,WAAW,EAAE,CACjC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slide-fade.js","names":["motion"],"sources":["../../../../src/components/slide-fade/slide-fade.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { SlideFadeStyle } from \"./slide-fade.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { createTransition, motion } from \"../motion\"\nimport { slideFadeStyle } from \"./slide-fade.style\"\n\nexport const slideFadeVariants: Variants = {\n enter: ({ delay, duration, enter, transition, transitionEnd } = {}) => ({\n opacity: 1,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n x: 0,\n y: 0,\n ...enter,\n }),\n exit: ({\n delay,\n duration,\n exit,\n offsetX,\n offsetY,\n reverse,\n transition,\n transitionEnd,\n } = {}) => ({\n opacity: 0,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n ...(reverse\n ? { transitionEnd: transitionEnd?.exit, x: offsetX, y: offsetY }\n : { transitionEnd: { x: offsetX, y: offsetY, ...transitionEnd?.exit } }),\n ...exit,\n }),\n initial: ({\n delay,\n duration,\n initial,\n offsetX,\n offsetY,\n transition,\n transitionEnd,\n }) => ({\n opacity: 0,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n x: offsetX,\n y: offsetY,\n ...initial,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface SlideFadeProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<SlideFadeStyle> {\n /**\n * The offset on the horizontal or `x` axis.\n *\n * @default 0\n */\n offsetX?: number | string\n /**\n * The offset on the vertical or `y` axis.\n *\n * @default 8\n */\n offsetY?: number | string\n /**\n * If `true`, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out.\n *\n * @default true\n */\n reverse?: boolean\n}\n\nconst {\n PropsContext: SlideFadePropsContext,\n usePropsContext: useSlideFadePropsContext,\n withContext,\n} = createComponent<SlideFadeProps, SlideFadeStyle>(\n \"slide-fade\",\n slideFadeStyle,\n)\n\nexport { SlideFadePropsContext, useSlideFadePropsContext }\n\n/**\n * `SlideFade` is a component that gradually shows or hides an element while moving it from a specified position.\n *\n * @see https://yamada-ui.com/docs/components/slide-fade\n */\nexport const SlideFade = withContext<\"div\", SlideFadeProps>(\n ({\n delay,\n duration,\n offsetX = 0,\n offsetY = 8,\n open: openProp,\n reverse = true,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp && unmountOnExit : true\n\n const custom = useMemo(\n () => ({\n delay,\n duration,\n offsetX,\n offsetY,\n reverse,\n transition,\n transitionEnd,\n }),\n [delay, duration, offsetX, offsetY, reverse, transition, transitionEnd],\n )\n\n return (\n <AnimatePresence custom={custom}>\n {open ? (\n <motion.div\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial=\"exit\"\n variants={slideFadeVariants}\n {...rest}\n />\n ) : null}\n </AnimatePresence>\n )\n },\n)()\n"],"mappings":";;;;;;;;;AAgBA,MAAa,oBAA8B;CACzC,QAAQ,EAAE,OAAO,UAAU,OAAO,YAAY,kBAAkB,CAAC,OAAO;EACtE,SAAS;EACT,YAAY,iBAAiB,MAAM,YAAY,KAAK,CAAC,CAAC,OAAO,QAAQ;EACrE,eAAe,eAAe;EAC9B,GAAG;EACH,GAAG;EACH,GAAG;CACL;CACA,OAAO,EACL,OACA,UACA,MACA,SACA,SACA,SACA,YACA,kBACE,CAAC,OAAO;EACV,SAAS;EACT,YAAY,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,GAAI,UACA;GAAE,eAAe,eAAe;GAAM,GAAG;GAAS,GAAG;EAAQ,IAC7D,EAAE,eAAe;GAAE,GAAG;GAAS,GAAG;GAAS,GAAG,eAAe;EAAK,EAAE;EACxE,GAAG;CACL;CACA,UAAU,EACR,OACA,UACA,SACA,SACA,SACA,YACA,qBACK;EACL,SAAS;EACT,YAAY,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,eAAe,eAAe;EAC9B,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;AAwBA,MAAM,EACJ,cAAc,uBACd,iBAAiB,0BACjB,gBACE,gBACF,cACA,cACF;;;;;;AASA,MAAa,YAAY,aACtB,EACC,OACA,UACA,UAAU,GACV,UAAU,GACV,MAAM,UACN,UAAU,MACV,YACA,eACA,eACA,GAAG,WACC;CACJ,MAAM,UAAU,YAAY,gBAAgB,UAAU;CACtD,MAAM,OAAO,gBAAgB,YAAY,gBAAgB;CAEzD,MAAM,SAAS,eACN;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAS;EAAS;EAAS;EAAY;CAAa,CACxE;CAEA,OACE,oBAAC,iBAAD;EAAyB;YACtB,OACC,oBAACA,SAAO,KAAR;GACW;GACD;GACR,MAAK;GACL,SAAQ;GACR,UAAU;GACV,GAAI;EACL,CAAA,IACC;CACW,CAAA;AAErB,CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"slide-fade.js","names":["motion"],"sources":["../../../../src/components/slide-fade/slide-fade.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { SlideFadeStyle } from \"./slide-fade.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { createTransition, motion } from \"../motion\"\nimport { slideFadeStyle } from \"./slide-fade.style\"\n\nexport const slideFadeVariants: Variants = {\n enter: ({ delay, duration, enter, transition, transitionEnd } = {}) => ({\n opacity: 1,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n x: 0,\n y: 0,\n ...enter,\n }),\n exit: ({\n delay,\n duration,\n exit,\n offsetX,\n offsetY,\n reverse,\n transition,\n transitionEnd,\n } = {}) => ({\n opacity: 0,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n ...(reverse\n ? { transitionEnd: transitionEnd?.exit, x: offsetX, y: offsetY }\n : { transitionEnd: { x: offsetX, y: offsetY, ...transitionEnd?.exit } }),\n ...exit,\n }),\n initial: ({\n delay,\n duration,\n initial,\n offsetX,\n offsetY,\n transition,\n transitionEnd,\n }) => ({\n opacity: 0,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n x: offsetX,\n y: offsetY,\n ...initial,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface SlideFadeProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<SlideFadeStyle> {\n /**\n * The offset on the horizontal or `x` axis.\n *\n * @default 0\n */\n offsetX?: number | string\n /**\n * The offset on the vertical or `y` axis.\n *\n * @default 8\n */\n offsetY?: number | string\n /**\n * If `true`, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out.\n *\n * @default true\n */\n reverse?: boolean\n}\n\nconst {\n PropsContext: SlideFadePropsContext,\n usePropsContext: useSlideFadePropsContext,\n withContext,\n} = createComponent<SlideFadeProps, SlideFadeStyle>(\n \"slide-fade\",\n slideFadeStyle,\n)\n\nexport { SlideFadePropsContext, useSlideFadePropsContext }\n\n/**\n * `SlideFade` is a component that gradually shows or hides an element while moving it from a specified position.\n *\n * @see https://yamada-ui.com/docs/components/slide-fade\n */\nexport const SlideFade = withContext<\"div\", SlideFadeProps>(\n ({\n delay,\n duration,\n offsetX = 0,\n offsetY = 8,\n open: openProp,\n reverse = true,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp && unmountOnExit : true\n\n const custom = useMemo(\n () => ({\n delay,\n duration,\n offsetX,\n offsetY,\n reverse,\n transition,\n transitionEnd,\n }),\n [delay, duration, offsetX, offsetY, reverse, transition, transitionEnd],\n )\n\n return (\n <AnimatePresence custom={custom}>\n {open ? (\n <motion.div\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial=\"exit\"\n variants={slideFadeVariants}\n {...rest}\n />\n ) : null}\n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,UAAU;GACV,GAAI;EACL,CAAA,IACC;CACW,CAAA;AAErB,CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slider.js","names":[],"sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, ReactElement, ReactNode } from \"react\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { SliderStyle } from \"./slider.style\"\nimport type { UseSliderProps, UseSliderReturn } from \"./use-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { dataAttr, isNumber } from \"../../utils\"\nimport { sliderStyle } from \"./slider.style\"\nimport { useSlider } from \"./use-slider\"\n\ninterface ComponentContext extends Pick<\n UseSliderReturn,\n | \"getInputProps\"\n | \"getMarkProps\"\n | \"getRangeProps\"\n | \"getThumbProps\"\n | \"getTrackProps\"\n | \"range\"\n> {}\n\nexport interface SliderRootProps<Y extends [number, number] | number = number>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n Omit<UseSliderProps<Y>, \"orientation\">,\n ThemeProps<SliderStyle> {\n /**\n * The fill color of the indicator.\n */\n indicatorFill?: CSSProps[\"color\"]\n /**\n * The rounded of the indicator.\n */\n indicatorRounded?: CSSProps[\"rounded\"]\n /**\n * The marks to display on the slider.\n */\n marks?: SliderMarksProps[\"marks\"]\n /**\n * The fill color of the range.\n */\n rangeFill?: CSSProps[\"color\"]\n /**\n * The fill color of the thumb.\n */\n thumbFill?: CSSProps[\"color\"]\n /**\n * The rounded of the thumb.\n */\n thumbRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the thumb.\n */\n thumbSize?: CSSProps[\"boxSize\"]\n /**\n * The stroke color of the thumb.\n */\n thumbStroke?: CSSProps[\"color\"]\n /**\n * The fill color of the track.\n */\n trackFill?: CSSProps[\"color\"]\n /**\n * The rounded of the track.\n */\n trackRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the track.\n */\n trackSize?: CSSProps[\"boxSize\"]\n /**\n * Props for the input element.\n */\n inputProps?: SliderInputProps\n /**\n * Props for the marks element.\n */\n marksProps?: Partial<SliderMarksProps>\n /**\n * Props for the range element.\n */\n rangeProps?: SliderRangeProps\n /**\n * Props for the thumb element.\n */\n thumbProps?: SliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SliderPropsContext,\n useComponentContext,\n usePropsContext: useSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SliderRootProps, SliderStyle, ComponentContext>(\n \"slider\",\n sliderStyle,\n)\n\nexport { SliderPropsContext, useSliderPropsContext }\n\n/**\n * `Slider` is a component used for allowing users to select a value from a range.\n *\n * @see https://yamada-ui.com/docs/components/slider\n */\nexport const SliderRoot = withProvider<\"input\", SliderRootProps, \"orientation\">(\n <Y extends [number, number] | number = number>({\n children,\n marks,\n orientation: orientationProp,\n inputProps,\n marksProps,\n rangeProps,\n thumbProps,\n trackProps,\n ...rest\n }: SliderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const {\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSlider<Y>({ orientation, ...rest })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <SliderTrack {...trackProps}>\n <SliderRange {...rangeProps} />\n\n {range ? (\n <SliderThumbs {...thumbProps} />\n ) : (\n <SliderThumb {...thumbProps} />\n )}\n </SliderTrack>\n\n {marks ? <SliderMarks marks={marks} {...marksProps} /> : null}\n </>\n )\n }, [children, marks, marksProps, range, rangeProps, thumbProps, trackProps])\n const context = useMemo(\n () => ({\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n }),\n [\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n ],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <SliderInput {...inputProps} />\n\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)(\n undefined,\n ({\n indicatorFill,\n indicatorRounded,\n rangeFill,\n thumbFill,\n thumbRounded,\n thumbSize,\n thumbStroke,\n trackFill,\n trackRounded,\n trackSize,\n ...rest\n }) => ({\n \"--indicator-fill\": varAttr(indicatorFill, \"colors\"),\n \"--indicator-rounded\": varAttr(indicatorRounded, \"radii\"),\n \"--range-fill\": varAttr(rangeFill, \"colors\"),\n \"--thumb-fill\": varAttr(thumbFill, \"colors\"),\n \"--thumb-rounded\": varAttr(thumbRounded, \"radii\"),\n \"--thumb-size\": varAttr(thumbSize, \"sizes\"),\n \"--thumb-stroke\": varAttr(thumbStroke, \"colors\"),\n \"--track-fill\": varAttr(trackFill, \"colors\"),\n \"--track-rounded\": varAttr(trackRounded, \"radii\"),\n \"--track-size\": varAttr(trackSize, \"sizes\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends [number, number] | number = number>(\n props: SliderRootProps<Y>,\n ): ReactElement\n}>\n\ninterface SliderInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst SliderInput: FC<SliderInputProps> = () => {\n const { range, getInputProps } = useComponentContext()\n\n return range ? (\n Array.from({ length: 2 }).map((_, index) => (\n <styled.input key={index} {...getInputProps({ index })} />\n ))\n ) : (\n <styled.input {...getInputProps()} />\n )\n}\n\nexport interface SliderTrackProps extends HTMLStyledProps {}\n\nexport const SliderTrack = withContext<\"div\", SliderTrackProps>(\"div\", \"track\")(\n undefined,\n (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n },\n)\n\nexport interface SliderRangeProps extends HTMLStyledProps {}\n\nexport const SliderRange = withContext<\"div\", SliderRangeProps>(\"div\", \"range\")(\n undefined,\n (props) => {\n const { getRangeProps } = useComponentContext()\n\n return getRangeProps(props)\n },\n)\n\nexport interface SliderMarkProps extends HTMLStyledProps {\n /**\n * The value of the mark.\n */\n value: number\n /**\n * Whether the mark is an indicator.\n *\n * @default true\n */\n indicator?: boolean\n}\n\nexport const SliderMark = withContext<\"div\", SliderMarkProps>(\"div\", \"mark\")(\n undefined,\n ({ indicator = true, ...props }) => {\n const { getMarkProps } = useComponentContext()\n\n return getMarkProps({ \"data-indicator\": dataAttr(indicator), ...props })\n },\n)\n\nexport interface SliderMarksProps extends Omit<SliderMarkProps, \"value\"> {\n /**\n * The marks to display on the slider.\n */\n marks: (number | { label: ReactNode; value: number; indicator?: boolean })[]\n}\n\nexport const SliderMarks: FC<SliderMarksProps> = ({ marks, ...props }) => {\n return (\n <>\n {marks.map((mark, index) => {\n if (isNumber(mark)) {\n return <SliderMark key={index} value={mark} {...props} />\n } else {\n const { indicator, label, value } = mark\n\n return (\n <SliderMark key={index} indicator={indicator} value={value}>\n {label}\n </SliderMark>\n )\n }\n })}\n </>\n )\n}\n\nexport interface SliderThumbProps extends HTMLStyledProps {\n /**\n * The index of the thumb.\n */\n index?: number\n}\n\nexport const SliderThumb = withContext<\"div\", SliderThumbProps>(\"div\", \"thumb\")(\n undefined,\n (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n },\n)\n\nexport interface SliderThumbsProps extends SliderThumbProps {}\n\nexport const SliderThumbs: FC<SliderThumbsProps> = (props) => {\n return (\n <>\n {Array.from({ length: 2 }).map((_, index) => (\n <SliderThumb key={index} index={index} {...props} />\n ))}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAmGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAAa,aAAa,cACuB,EAC7C,UACA,OACA,aAAa,iBACb,YACA,YACA,YACA,YACA,YACA,GAAG,WACqB;CAExB,MAAM,EACJ,OACA,eACA,cACA,eACA,cACA,eACA,kBACE,UAAa;EAAE,aATC,SAAS,eAS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,OAAO,cAAc,KAAK;AAC5B,CACF;AAIA,MAAa,gBAAuC,UAAU;CAC5D,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,UACjC,oBAAC,aAAD;EAAgC;EAAO,GAAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
1
+ {"version":3,"file":"slider.js","names":[],"sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, ReactElement, ReactNode } from \"react\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { SliderStyle } from \"./slider.style\"\nimport type { UseSliderProps, UseSliderReturn } from \"./use-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { dataAttr, isNumber } from \"../../utils\"\nimport { sliderStyle } from \"./slider.style\"\nimport { useSlider } from \"./use-slider\"\n\ninterface ComponentContext extends Pick<\n UseSliderReturn,\n | \"getInputProps\"\n | \"getMarkProps\"\n | \"getRangeProps\"\n | \"getThumbProps\"\n | \"getTrackProps\"\n | \"range\"\n> {}\n\nexport interface SliderRootProps<Y extends [number, number] | number = number>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n Omit<UseSliderProps<Y>, \"orientation\">,\n ThemeProps<SliderStyle> {\n /**\n * The fill color of the indicator.\n */\n indicatorFill?: CSSProps[\"color\"]\n /**\n * The rounded of the indicator.\n */\n indicatorRounded?: CSSProps[\"rounded\"]\n /**\n * The marks to display on the slider.\n */\n marks?: SliderMarksProps[\"marks\"]\n /**\n * The fill color of the range.\n */\n rangeFill?: CSSProps[\"color\"]\n /**\n * The fill color of the thumb.\n */\n thumbFill?: CSSProps[\"color\"]\n /**\n * The rounded of the thumb.\n */\n thumbRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the thumb.\n */\n thumbSize?: CSSProps[\"boxSize\"]\n /**\n * The stroke color of the thumb.\n */\n thumbStroke?: CSSProps[\"color\"]\n /**\n * The fill color of the track.\n */\n trackFill?: CSSProps[\"color\"]\n /**\n * The rounded of the track.\n */\n trackRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the track.\n */\n trackSize?: CSSProps[\"boxSize\"]\n /**\n * Props for the input element.\n */\n inputProps?: SliderInputProps\n /**\n * Props for the marks element.\n */\n marksProps?: Partial<SliderMarksProps>\n /**\n * Props for the range element.\n */\n rangeProps?: SliderRangeProps\n /**\n * Props for the thumb element.\n */\n thumbProps?: SliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SliderPropsContext,\n useComponentContext,\n usePropsContext: useSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SliderRootProps, SliderStyle, ComponentContext>(\n \"slider\",\n sliderStyle,\n)\n\nexport { SliderPropsContext, useSliderPropsContext }\n\n/**\n * `Slider` is a component used for allowing users to select a value from a range.\n *\n * @see https://yamada-ui.com/docs/components/slider\n */\nexport const SliderRoot = withProvider<\"input\", SliderRootProps, \"orientation\">(\n <Y extends [number, number] | number = number>({\n children,\n marks,\n orientation: orientationProp,\n inputProps,\n marksProps,\n rangeProps,\n thumbProps,\n trackProps,\n ...rest\n }: SliderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const {\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSlider<Y>({ orientation, ...rest })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <SliderTrack {...trackProps}>\n <SliderRange {...rangeProps} />\n\n {range ? (\n <SliderThumbs {...thumbProps} />\n ) : (\n <SliderThumb {...thumbProps} />\n )}\n </SliderTrack>\n\n {marks ? <SliderMarks marks={marks} {...marksProps} /> : null}\n </>\n )\n }, [children, marks, marksProps, range, rangeProps, thumbProps, trackProps])\n const context = useMemo(\n () => ({\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n }),\n [\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n ],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <SliderInput {...inputProps} />\n\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)(\n undefined,\n ({\n indicatorFill,\n indicatorRounded,\n rangeFill,\n thumbFill,\n thumbRounded,\n thumbSize,\n thumbStroke,\n trackFill,\n trackRounded,\n trackSize,\n ...rest\n }) => ({\n \"--indicator-fill\": varAttr(indicatorFill, \"colors\"),\n \"--indicator-rounded\": varAttr(indicatorRounded, \"radii\"),\n \"--range-fill\": varAttr(rangeFill, \"colors\"),\n \"--thumb-fill\": varAttr(thumbFill, \"colors\"),\n \"--thumb-rounded\": varAttr(thumbRounded, \"radii\"),\n \"--thumb-size\": varAttr(thumbSize, \"sizes\"),\n \"--thumb-stroke\": varAttr(thumbStroke, \"colors\"),\n \"--track-fill\": varAttr(trackFill, \"colors\"),\n \"--track-rounded\": varAttr(trackRounded, \"radii\"),\n \"--track-size\": varAttr(trackSize, \"sizes\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends [number, number] | number = number>(\n props: SliderRootProps<Y>,\n ): ReactElement\n}>\n\ninterface SliderInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst SliderInput: FC<SliderInputProps> = () => {\n const { range, getInputProps } = useComponentContext()\n\n return range ? (\n Array.from({ length: 2 }).map((_, index) => (\n <styled.input key={index} {...getInputProps({ index })} />\n ))\n ) : (\n <styled.input {...getInputProps()} />\n )\n}\n\nexport interface SliderTrackProps extends HTMLStyledProps {}\n\nexport const SliderTrack = withContext<\"div\", SliderTrackProps>(\"div\", \"track\")(\n undefined,\n (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n },\n)\n\nexport interface SliderRangeProps extends HTMLStyledProps {}\n\nexport const SliderRange = withContext<\"div\", SliderRangeProps>(\"div\", \"range\")(\n undefined,\n (props) => {\n const { getRangeProps } = useComponentContext()\n\n return getRangeProps(props)\n },\n)\n\nexport interface SliderMarkProps extends HTMLStyledProps {\n /**\n * The value of the mark.\n */\n value: number\n /**\n * Whether the mark is an indicator.\n *\n * @default true\n */\n indicator?: boolean\n}\n\nexport const SliderMark = withContext<\"div\", SliderMarkProps>(\"div\", \"mark\")(\n undefined,\n ({ indicator = true, ...props }) => {\n const { getMarkProps } = useComponentContext()\n\n return getMarkProps({ \"data-indicator\": dataAttr(indicator), ...props })\n },\n)\n\nexport interface SliderMarksProps extends Omit<SliderMarkProps, \"value\"> {\n /**\n * The marks to display on the slider.\n */\n marks: (number | { label: ReactNode; value: number; indicator?: boolean })[]\n}\n\nexport const SliderMarks: FC<SliderMarksProps> = ({ marks, ...props }) => {\n return (\n <>\n {marks.map((mark, index) => {\n if (isNumber(mark)) {\n return <SliderMark key={index} value={mark} {...props} />\n } else {\n const { indicator, label, value } = mark\n\n return (\n <SliderMark key={index} indicator={indicator} value={value}>\n {label}\n </SliderMark>\n )\n }\n })}\n </>\n )\n}\n\nexport interface SliderThumbProps extends HTMLStyledProps {\n /**\n * The index of the thumb.\n */\n index?: number\n}\n\nexport const SliderThumb = withContext<\"div\", SliderThumbProps>(\"div\", \"thumb\")(\n undefined,\n (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n },\n)\n\nexport interface SliderThumbsProps extends SliderThumbProps {}\n\nexport const SliderThumbs: FC<SliderThumbsProps> = (props) => {\n return (\n <>\n {Array.from({ length: 2 }).map((_, index) => (\n <SliderThumb key={index} index={index} {...props} />\n ))}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAmGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAA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AC,YAAD;IAAmC;IAAkB;IAClD,UAAA;GACS,GAFK,KAEL;EAEhB;CACF,CAAC,EACD,CAAA;AAEN;AASA,MAAa,cAAc,YAAqC,OAAO,OAAO,CAAC,CAC7E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CACF;AAIA,MAAa,gBAAuC,UAAU;CAC5D,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,UACjC,oBAAC,aAAD;EAAgC;EAAO,GAAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","names":[],"sources":["../../../../src/components/slot/slot.tsx"],"sourcesContent":["import type {\n FC,\n HTMLAttributes,\n PropsWithChildren,\n RefAttributes,\n} from \"react\"\nimport { Children, cloneElement, isValidElement } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useFindChild, useValidChildren } from \"../../utils\"\n\nexport interface SlotProps\n extends\n HTMLAttributes<HTMLElement>,\n RefAttributes<HTMLElement>,\n PropsWithChildren {}\n\n/**\n * `Slot` is a component that merges its props onto its immediate child.\n *\n * @see https://yamada-ui.com/docs/components/slot\n */\nexport const Slot: FC<SlotProps> = ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const slottable = useFindChild(validChildren, Slottable)\n\n if (slottable) {\n const newElement = slottable.props.children\n\n const newChildren = validChildren.map((child) => {\n if (child === slottable) {\n if (Children.count(newElement) > 1) return Children.only(null)\n return isValidElement<PropsWithChildren>(newElement)\n ? newElement.props.children\n : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...rest}>\n {isValidElement(newElement)\n ? cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n )\n }\n\n return <SlotClone {...rest}>{children}</SlotClone>\n}\n\ninterface SlotCloneProps\n extends RefAttributes<HTMLElement>, PropsWithChildren {}\n\nconst SlotClone: FC<SlotCloneProps> = ({ children, ...rest }) => {\n if (isValidElement<RefAttributes<HTMLElement>>(children))\n return cloneElement(children, mergeProps(rest, children.props)())\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}\n\nexport const Slottable: FC<PropsWithChildren> = ({ children }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>\n}\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,QAAuB,EAAE,UAAU,GAAG,WAAW;CAC5D,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,YAAY,aAAa,eAAe,SAAS;CAEvD,IAAI,WAAW;EACb,MAAM,aAAa,UAAU,MAAM;EAEnC,MAAM,cAAc,cAAc,KAAK,UAAU;GAC/C,IAAI,UAAU,WAAW;IACvB,IAAI,SAAS,MAAM,UAAU,IAAI,GAAG,OAAO,SAAS,KAAK,IAAI;IAC7D,OAAO,eAAkC,UAAU,IAC/C,WAAW,MAAM,WACjB;GACN,OACE,OAAO;EAEX,CAAC;EAED,OACE,oBAAC,WAAD;GAAW,GAAI;aACZ,eAAe,UAAU,IACtB,aAAa,YAAY,KAAA,GAAW,WAAW,IAC/C;EACK,CAAA;CAEf;CAEA,OAAO,oBAAC,WAAD;EAAW,GAAI;EAAO;CAAoB,CAAA;AACnD;AAKA,MAAM,aAAiC,EAAE,UAAU,GAAG,WAAW;CAC/D,IAAI,eAA2C,QAAQ,GACrD,OAAO,aAAa,UAAU,WAAW,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC;CAElE,OAAO,SAAS,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI;AAC9D;AAEA,MAAa,aAAoC,EAAE,eAAe;CAEhE,OAAO,oBAAA,YAAA,EAAG,SAAW,CAAA;AACvB"}
1
+ {"version":3,"file":"slot.js","names":[],"sources":["../../../../src/components/slot/slot.tsx"],"sourcesContent":["import type {\n FC,\n HTMLAttributes,\n PropsWithChildren,\n RefAttributes,\n} from \"react\"\nimport { Children, cloneElement, isValidElement } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useFindChild, useValidChildren } from \"../../utils\"\n\nexport interface SlotProps\n extends\n HTMLAttributes<HTMLElement>,\n RefAttributes<HTMLElement>,\n PropsWithChildren {}\n\n/**\n * `Slot` is a component that merges its props onto its immediate child.\n *\n * @see https://yamada-ui.com/docs/components/slot\n */\nexport const Slot: FC<SlotProps> = ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const slottable = useFindChild(validChildren, Slottable)\n\n if (slottable) {\n const newElement = slottable.props.children\n\n const newChildren = validChildren.map((child) => {\n if (child === slottable) {\n if (Children.count(newElement) > 1) return Children.only(null)\n return isValidElement<PropsWithChildren>(newElement)\n ? newElement.props.children\n : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...rest}>\n {isValidElement(newElement)\n ? cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n )\n }\n\n return <SlotClone {...rest}>{children}</SlotClone>\n}\n\ninterface SlotCloneProps\n extends RefAttributes<HTMLElement>, PropsWithChildren {}\n\nconst SlotClone: FC<SlotCloneProps> = ({ children, ...rest }) => {\n if (isValidElement<RefAttributes<HTMLElement>>(children))\n return cloneElement(children, mergeProps(rest, children.props)())\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}\n\nexport const Slottable: FC<PropsWithChildren> = ({ children }) => {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>\n}\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,QAAuB,EAAE,UAAU,GAAG,WAAW;CAC5D,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,YAAY,aAAa,eAAe,SAAS;CAEvD,IAAI,WAAW;EACb,MAAM,aAAa,UAAU,MAAM;EAEnC,MAAM,cAAc,cAAc,KAAK,UAAU;GAC/C,IAAI,UAAU,WAAW;IACvB,IAAI,SAAS,MAAM,UAAU,IAAI,GAAG,OAAO,SAAS,KAAK,IAAI;IAC7D,OAAO,eAAkC,UAAU,IAC/C,WAAW,MAAM,WACjB;GACN,OACE,OAAO;EAEX,CAAC;EAED,OACE,oBAAC,WAAD;GAAW,GAAI;GACZ,UAAA,eAAe,UAAU,IACtB,aAAa,YAAY,KAAA,GAAW,WAAW,IAC/C;EACK,CAAA;CAEf;CAEA,OAAO,oBAAC,WAAD;EAAW,GAAI;EAAO;CAAoB,CAAA;AACnD;AAKA,MAAM,aAAiC,EAAE,UAAU,GAAG,WAAW;CAC/D,IAAI,eAA2C,QAAQ,GACrD,OAAO,aAAa,UAAU,WAAW,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC;CAElE,OAAO,SAAS,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI;AAC9D;AAEA,MAAa,aAAoC,EAAE,eAAe;CAEhE,OAAO,oBAAA,YAAA,EAAG,SAAW,CAAA;AACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"snacks.js","names":["motion","noop","Alert.Root","Alert.Loading","Alert.Icon","Alert.Title","Alert.Description"],"sources":["../../../../src/components/snacks/snacks.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Dispatch, RefObject, SetStateAction } from \"react\"\nimport type { CSSProps, HTMLStyledProps, SimpleDirection } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { CloseButtonProps } from \"../close-button\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { SnacksStyle } from \"./snacks.style\"\nimport type { Snack, UseSnacksReturn } from \"./use-snacks\"\nimport { AnimatePresence, useIsPresent } from \"motion/react\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport { createSlotComponent, varAttr } from \"../../core\"\nimport { useTimeout } from \"../../hooks/use-timeout\"\nimport { dataAttr, handlerAll, noop, useUpdateEffect } from \"../../utils\"\nimport { Alert } from \"../alert\"\nimport { CloseButton } from \"../close-button\"\nimport { createTransition, motion } from \"../motion\"\nimport { snacksStyle } from \"./snacks.style\"\n\ninterface ComponentContext {\n direction: SimpleDirection\n elMapRef: RefObject<Map<number, HTMLDivElement | null>>\n setExist: Dispatch<SetStateAction<boolean>>\n startIndex: number\n}\n\nexport interface SnacksProps extends HTMLMotionProps {\n /**\n * The snacks created by `useSnacks`.\n */\n snacks: UseSnacksReturn[\"snacks\"]\n /**\n * The CSS `gap` property.\n *\n * @default 'md'\n */\n gap?: CSSProps[\"gap\"]\n /**\n * A property that provides spacing between the top and bottom.\n *\n * @default [0, \"lg\"]\n */\n gutter?: [CSSProps[\"paddingTop\"], CSSProps[\"paddingBottom\"]]\n /**\n * If `true`, apply gutter value to negative margins\n *\n * @default true\n */\n negativeMargins?: boolean\n /**\n * Props for the snacks list element.\n */\n listProps?: HTMLMotionProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SnacksPropsContext,\n useComponentContext,\n usePropsContext: useSnacksPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SnacksProps, SnacksStyle, ComponentContext>(\n \"snacks\",\n snacksStyle,\n)\n\nexport { SnacksPropsContext, useSnacksPropsContext }\n\nexport const Snacks = withProvider<\"div\", SnacksProps>(\n ({\n snacks: { direction = \"start\", items, startIndex = 0 },\n listProps,\n ...rest\n }) => {\n const count = items.length\n const elMapRef = useRef<Map<number, HTMLDivElement | null>>(new Map())\n const [height, setHeight] = useState(0)\n const [exist, setExist] = useState(!!count)\n const show = !!count || exist\n const context = useMemo(\n () => ({ direction, elMapRef, setExist, startIndex }),\n [direction, startIndex],\n )\n\n const onExitComplete = useCallback(() => {\n if (!count) setExist(false)\n }, [count])\n\n useEffect(() => {\n let height = 0\n\n if (!count) return\n\n const els = [...elMapRef.current.values()].slice(0, count)\n\n for (const el of els) {\n if (!el) continue\n\n let { offsetHeight, offsetTop } = el\n\n offsetHeight += offsetTop\n\n if (offsetHeight > height) height = offsetHeight\n }\n\n setHeight(height)\n }, [count, direction])\n\n useUpdateEffect(() => {\n if (count) setExist(true)\n }, [count])\n\n return (\n <ComponentContext value={context}>\n <AnimatePresence initial={false}>\n {show ? (\n <motion.div {...rest}>\n <SnackList custom={{ height }} {...listProps}>\n <AnimatePresence onExitComplete={onExitComplete}>\n {items.map((props, index) => {\n return (\n <Snack\n key={props.id}\n index={index}\n lastIndex={count - index - 1}\n {...props}\n />\n )\n })}\n </AnimatePresence>\n </SnackList>\n </motion.div>\n ) : null}\n </AnimatePresence>\n </ComponentContext>\n )\n },\n \"root\",\n)(\n {\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n variants: {\n animate: {\n padding: \"var(--top) 0 var(--bottom)\",\n transition: { duration: 0.4 },\n },\n exit: { padding: 0 },\n initial: { padding: 0 },\n },\n },\n ({ gap, gutter = [0, \"lg\"], negativeMargins = true, ...rest }) => ({\n \"data-negative\": dataAttr(negativeMargins),\n \"--bottom\": varAttr(gutter[1], \"spaces\", \"0px\"),\n \"--gap\": varAttr(gap, \"spaces\"),\n \"--top\": varAttr(gutter[0], \"spaces\", \"0px\"),\n ...rest,\n }),\n)\n\ninterface SnackListProps extends HTMLMotionProps {}\n\nconst SnackList = withContext<\"div\", SnackListProps>(\n motion.div,\n \"list\",\n)({\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n role: \"list\",\n variants: {\n animate: ({ height }) => ({\n height,\n opacity: 1,\n transition: { duration: 0.4 },\n }),\n exit: { height: 0, opacity: 0 },\n initial: { height: 0, opacity: 1 },\n },\n})\n\ninterface SnackProps extends Merge<\n HTMLMotionProps,\n Merge<Alert.RootProps, Snack>\n> {\n index: number\n lastIndex: number\n}\n\nconst Snack = withContext<\"div\", SnackProps>(\n ({\n variant = \"plain\",\n closable = true,\n description,\n duration: durationProp = null,\n loadingScheme,\n status,\n title,\n withIcon = true,\n closeButtonProps,\n contentProps,\n descriptionProps,\n iconProps,\n loadingProps,\n titleProps,\n onClose: onCloseProp,\n onCloseComplete,\n ...rest\n }) => {\n const [duration, setDuration] = useState(durationProp)\n const present = useIsPresent()\n const onClose = present ? onCloseProp : noop\n\n const onMouseEnter = useCallback(() => {\n setDuration(null)\n }, [])\n\n const onMouseLeave = useCallback(() => {\n setDuration(durationProp)\n }, [durationProp])\n\n useUpdateEffect(() => {\n if (!present) onCloseComplete?.()\n }, [present])\n\n useUpdateEffect(() => {\n setDuration(durationProp)\n }, [durationProp])\n\n useTimeout(onClose, duration)\n\n return (\n <Alert.Root\n as={motion.div}\n variant={variant}\n status={status}\n {...rest}\n onMouseEnter={handlerAll(rest.onMouseEnter, onMouseEnter)}\n onMouseLeave={handlerAll(rest.onMouseLeave, onMouseLeave)}\n >\n {withIcon ? (\n loadingScheme ? (\n <Alert.Loading loadingScheme={loadingScheme} {...loadingProps} />\n ) : (\n <Alert.Icon {...iconProps} />\n )\n ) : null}\n\n <SnackContent data-close-button={dataAttr(closable)} {...contentProps}>\n {title ? (\n <Alert.Title me=\"0\" {...titleProps}>\n {title}\n </Alert.Title>\n ) : null}\n\n {description ? (\n <Alert.Description {...descriptionProps}>\n {description}\n </Alert.Description>\n ) : null}\n </SnackContent>\n\n {closable ? (\n <SnackCloseButton\n data-variant={variant}\n {...closeButtonProps}\n onClick={handlerAll(closeButtonProps?.onClick, onClose)}\n />\n ) : null}\n </Alert.Root>\n )\n },\n \"item\",\n)(\n {\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n layout: true,\n role: \"listitem\",\n variants: {\n animate: ({ index }) => ({\n opacity: 1,\n transition: createTransition.enter()(!index ? 0.2 : 0, 0.4),\n y: 0,\n }),\n exit: {\n opacity: 0,\n transition: createTransition.exit()(undefined, 0.2),\n },\n initial: ({ direction, index }) => ({\n opacity: 0,\n ...(index ? { y: (direction === \"start\" ? -1 : 1) * 16 } : {}),\n }),\n },\n },\n ({ index, lastIndex, ...rest }) => {\n const ref = useRef<HTMLDivElement>(null)\n const { direction, elMapRef, startIndex } = useComponentContext()\n\n useEffect(() => {\n const elMap = elMapRef.current\n\n elMap.set(index, ref.current)\n\n return () => {\n elMap.delete(index)\n }\n }, [elMapRef, index])\n\n return {\n ref,\n \"--index\": direction === \"start\" ? lastIndex : index,\n \"--z-index\": startIndex + index,\n custom: { direction, index },\n ...rest,\n }\n },\n)\n\nexport interface SnackContentProps extends HTMLStyledProps {}\n\nconst SnackContent = withContext<\"div\", SnackContentProps>(\"div\", \"content\")()\n\nexport interface SnackCloseButtonProps extends CloseButtonProps {}\n\nconst SnackCloseButton = withContext<\"button\", SnackCloseButtonProps>(\n CloseButton,\n \"closeButton\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;AAIA,MAAa,SAAS,cACnB,EACC,QAAQ,EAAE,YAAY,SAAS,OAAO,aAAa,KACnD,WACA,GAAG,WACC;CACJ,MAAM,QAAQ,MAAM;CACpB,MAAM,WAAW,uBAA2C,IAAI,IAAI,CAAC;CACrE,MAAM,CAAC,QAAQ,aAAa,SAAS,CAAC;CACtC,MAAM,CAAC,OAAO,YAAY,SAAS,CAAC,CAAC,KAAK;CAC1C,MAAM,OAAO,CAAC,CAAC,SAAS;CACxB,MAAM,UAAU,eACP;EAAE;EAAW;EAAU;EAAU;CAAW,IACnD,CAAC,WAAW,UAAU,CACxB;CAEA,MAAM,iBAAiB,kBAAkB;EACvC,IAAI,CAAC,OAAO,SAAS,KAAK;CAC5B,GAAG,CAAC,KAAK,CAAC;CAEV,gBAAgB;EACd,IAAI,SAAS;EAEb,IAAI,CAAC,OAAO;EAEZ,MAAM,MAAM,CAAC,GAAG,SAAS,QAAQ,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK;EAEzD,KAAK,MAAM,MAAM,KAAK;GACpB,IAAI,CAAC,IAAI;GAET,IAAI,EAAE,cAAc,cAAc;GAElC,gBAAgB;GAEhB,IAAI,eAAe,QAAQ,SAAS;EACtC;EAEA,UAAU,MAAM;CAClB,GAAG,CAAC,OAAO,SAAS,CAAC;CAErB,sBAAsB;EACpB,IAAI,OAAO,SAAS,IAAI;CAC1B,GAAG,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M;CACN,UAAU;EACR,UAAU,EAAE,aAAa;GACvB,SAAS;GACT,YAAY,iBAAiB,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAM,GAAG,EAAG;GAC1D,GAAG;EACL;EACA,MAAM;GACJ,SAAS;GACT,YAAY,iBAAiB,KAAK,CAAC,CAAC,KAAA,GAAW,EAAG;EACpD;EACA,UAAU,EAAE,WAAW,aAAa;GAClC,SAAS;GACT,GAAI,QAAQ,EAAE,IAAI,cAAc,UAAU,KAAK,KAAK,GAAG,IAAI,CAAC;EAC9D;CACF;AACF,IACC,EAAE,OAAO,WAAW,GAAG,WAAW;CACjC,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,EAAE,WAAW,UAAU,eAAe,oBAAoB;CAEhE,gBAAgB;EACd,MAAM,QAAQ,SAAS;EAEvB,MAAM,IAAI,OAAO,IAAI,OAAO;EAE5B,aAAa;GACX,MAAM,OAAO,KAAK;EACpB;CACF,GAAG,CAAC,UAAU,KAAK,CAAC;CAEpB,OAAO;EACL;EACA,WAAW,cAAc,UAAU,YAAY;EAC/C,aAAa,aAAa;EAC1B,QAAQ;GAAE;GAAW;EAAM;EAC3B,GAAG;CACL;AACF,CACF;AAIA,MAAM,eAAe,YAAsC,OAAO,SAAS,CAAC,CAAC;AAI7E,MAAM,mBAAmB,YACvB,aACA,aACF,CAAC,CAAC"}
1
+ {"version":3,"file":"snacks.js","names":["motion","noop","Alert.Root","Alert.Loading","Alert.Icon","Alert.Title","Alert.Description"],"sources":["../../../../src/components/snacks/snacks.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Dispatch, RefObject, SetStateAction } from \"react\"\nimport type { CSSProps, HTMLStyledProps, SimpleDirection } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { CloseButtonProps } from \"../close-button\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { SnacksStyle } from \"./snacks.style\"\nimport type { Snack, UseSnacksReturn } from \"./use-snacks\"\nimport { AnimatePresence, useIsPresent } from \"motion/react\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport { createSlotComponent, varAttr } from \"../../core\"\nimport { useTimeout } from \"../../hooks/use-timeout\"\nimport { dataAttr, handlerAll, noop, useUpdateEffect } from \"../../utils\"\nimport { Alert } from \"../alert\"\nimport { CloseButton } from \"../close-button\"\nimport { createTransition, motion } from \"../motion\"\nimport { snacksStyle } from \"./snacks.style\"\n\ninterface ComponentContext {\n direction: SimpleDirection\n elMapRef: RefObject<Map<number, HTMLDivElement | null>>\n setExist: Dispatch<SetStateAction<boolean>>\n startIndex: number\n}\n\nexport interface SnacksProps extends HTMLMotionProps {\n /**\n * The snacks created by `useSnacks`.\n */\n snacks: UseSnacksReturn[\"snacks\"]\n /**\n * The CSS `gap` property.\n *\n * @default 'md'\n */\n gap?: CSSProps[\"gap\"]\n /**\n * A property that provides spacing between the top and bottom.\n *\n * @default [0, \"lg\"]\n */\n gutter?: [CSSProps[\"paddingTop\"], CSSProps[\"paddingBottom\"]]\n /**\n * If `true`, apply gutter value to negative margins\n *\n * @default true\n */\n negativeMargins?: boolean\n /**\n * Props for the snacks list element.\n */\n listProps?: HTMLMotionProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SnacksPropsContext,\n useComponentContext,\n usePropsContext: useSnacksPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SnacksProps, SnacksStyle, ComponentContext>(\n \"snacks\",\n snacksStyle,\n)\n\nexport { SnacksPropsContext, useSnacksPropsContext }\n\nexport const Snacks = withProvider<\"div\", SnacksProps>(\n ({\n snacks: { direction = \"start\", items, startIndex = 0 },\n listProps,\n ...rest\n }) => {\n const count = items.length\n const elMapRef = useRef<Map<number, HTMLDivElement | null>>(new Map())\n const [height, setHeight] = useState(0)\n const [exist, setExist] = useState(!!count)\n const show = !!count || exist\n const context = useMemo(\n () => ({ direction, elMapRef, setExist, startIndex }),\n [direction, startIndex],\n )\n\n const onExitComplete = useCallback(() => {\n if (!count) setExist(false)\n }, [count])\n\n useEffect(() => {\n let height = 0\n\n if (!count) return\n\n const els = [...elMapRef.current.values()].slice(0, count)\n\n for (const el of els) {\n if (!el) continue\n\n let { offsetHeight, offsetTop } = el\n\n offsetHeight += offsetTop\n\n if (offsetHeight > height) height = offsetHeight\n }\n\n setHeight(height)\n }, [count, direction])\n\n useUpdateEffect(() => {\n if (count) setExist(true)\n }, [count])\n\n return (\n <ComponentContext value={context}>\n <AnimatePresence initial={false}>\n {show ? (\n <motion.div {...rest}>\n <SnackList custom={{ height }} {...listProps}>\n <AnimatePresence onExitComplete={onExitComplete}>\n {items.map((props, index) => {\n return (\n <Snack\n key={props.id}\n index={index}\n lastIndex={count - index - 1}\n {...props}\n />\n )\n })}\n </AnimatePresence>\n </SnackList>\n </motion.div>\n ) : null}\n </AnimatePresence>\n </ComponentContext>\n )\n },\n \"root\",\n)(\n {\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n variants: {\n animate: {\n padding: \"var(--top) 0 var(--bottom)\",\n transition: { duration: 0.4 },\n },\n exit: { padding: 0 },\n initial: { padding: 0 },\n },\n },\n ({ gap, gutter = [0, \"lg\"], negativeMargins = true, ...rest }) => ({\n \"data-negative\": dataAttr(negativeMargins),\n \"--bottom\": varAttr(gutter[1], \"spaces\", \"0px\"),\n \"--gap\": varAttr(gap, \"spaces\"),\n \"--top\": varAttr(gutter[0], \"spaces\", \"0px\"),\n ...rest,\n }),\n)\n\ninterface SnackListProps extends HTMLMotionProps {}\n\nconst SnackList = withContext<\"div\", SnackListProps>(\n motion.div,\n \"list\",\n)({\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n role: \"list\",\n variants: {\n animate: ({ height }) => ({\n height,\n opacity: 1,\n transition: { duration: 0.4 },\n }),\n exit: { height: 0, opacity: 0 },\n initial: { height: 0, opacity: 1 },\n },\n})\n\ninterface SnackProps extends Merge<\n HTMLMotionProps,\n Merge<Alert.RootProps, Snack>\n> {\n index: number\n lastIndex: number\n}\n\nconst Snack = withContext<\"div\", SnackProps>(\n ({\n variant = \"plain\",\n closable = true,\n description,\n duration: durationProp = null,\n loadingScheme,\n status,\n title,\n withIcon = true,\n closeButtonProps,\n contentProps,\n descriptionProps,\n iconProps,\n loadingProps,\n titleProps,\n onClose: onCloseProp,\n onCloseComplete,\n ...rest\n }) => {\n const [duration, setDuration] = useState(durationProp)\n const present = useIsPresent()\n const onClose = present ? onCloseProp : noop\n\n const onMouseEnter = useCallback(() => {\n setDuration(null)\n }, [])\n\n const onMouseLeave = useCallback(() => {\n setDuration(durationProp)\n }, [durationProp])\n\n useUpdateEffect(() => {\n if (!present) onCloseComplete?.()\n }, [present])\n\n useUpdateEffect(() => {\n setDuration(durationProp)\n }, [durationProp])\n\n useTimeout(onClose, duration)\n\n return (\n <Alert.Root\n as={motion.div}\n variant={variant}\n status={status}\n {...rest}\n onMouseEnter={handlerAll(rest.onMouseEnter, onMouseEnter)}\n onMouseLeave={handlerAll(rest.onMouseLeave, onMouseLeave)}\n >\n {withIcon ? (\n loadingScheme ? (\n <Alert.Loading loadingScheme={loadingScheme} {...loadingProps} />\n ) : (\n <Alert.Icon {...iconProps} />\n )\n ) : null}\n\n <SnackContent data-close-button={dataAttr(closable)} {...contentProps}>\n {title ? (\n <Alert.Title me=\"0\" {...titleProps}>\n {title}\n </Alert.Title>\n ) : null}\n\n {description ? (\n <Alert.Description {...descriptionProps}>\n {description}\n </Alert.Description>\n ) : null}\n </SnackContent>\n\n {closable ? (\n <SnackCloseButton\n data-variant={variant}\n {...closeButtonProps}\n onClick={handlerAll(closeButtonProps?.onClick, onClose)}\n />\n ) : null}\n </Alert.Root>\n )\n },\n \"item\",\n)(\n {\n animate: \"animate\",\n exit: \"exit\",\n initial: \"initial\",\n layout: true,\n role: \"listitem\",\n variants: {\n animate: ({ index }) => ({\n opacity: 1,\n transition: createTransition.enter()(!index ? 0.2 : 0, 0.4),\n y: 0,\n }),\n exit: {\n opacity: 0,\n transition: createTransition.exit()(undefined, 0.2),\n },\n initial: ({ direction, index }) => ({\n opacity: 0,\n ...(index ? { y: (direction === \"start\" ? -1 : 1) * 16 } : {}),\n }),\n },\n },\n ({ index, lastIndex, ...rest }) => {\n const ref = useRef<HTMLDivElement>(null)\n const { direction, elMapRef, startIndex } = useComponentContext()\n\n useEffect(() => {\n const elMap = elMapRef.current\n\n elMap.set(index, ref.current)\n\n return () => {\n elMap.delete(index)\n }\n }, [elMapRef, index])\n\n return {\n ref,\n \"--index\": direction === \"start\" ? lastIndex : index,\n \"--z-index\": startIndex + index,\n custom: { direction, index },\n ...rest,\n }\n },\n)\n\nexport interface SnackContentProps extends HTMLStyledProps {}\n\nconst SnackContent = withContext<\"div\", SnackContentProps>(\"div\", \"content\")()\n\nexport interface SnackCloseButtonProps extends CloseButtonProps {}\n\nconst SnackCloseButton = withContext<\"button\", SnackCloseButtonProps>(\n CloseButton,\n \"closeButton\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;AAIA,MAAa,SAAS,cACnB,EACC,QAAQ,EAAE,YAAY,SAAS,OAAO,aAAa,KACnD,WACA,GAAG,WACC;CACJ,MAAM,QAAQ,MAAM;CACpB,MAAM,WAAW,uBAA2C,IAAI,IAAI,CAAC;CACrE,MAAM,CAAC,QAAQ,aAAa,SAAS,CAAC;CACtC,MAAM,CAAC,OAAO,YAAY,SAAS,CAAC,CAAC,KAAK;CAC1C,MAAM,OAAO,CAAC,CAAC,SAAS;CACxB,MAAM,UAAU,eACP;EAAE;EAAW;EAAU;EAAU;CAAW,IACnD,CAAC,WAAW,UAAU,CACxB;CAEA,MAAM,iBAAiB,kBAAkB;EACvC,IAAI,CAAC,OAAO,SAAS,KAAK;CAC5B,GAAG,CAAC,KAAK,CAAC;CAEV,gBAAgB;EACd,IAAI,SAAS;EAEb,IAAI,CAAC,OAAO;EAEZ,MAAM,MAAM,CAAC,GAAG,SAAS,QAAQ,OAAO,CA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/stack/stack.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { CSSProps, HTMLStyledProps } from \"../../core\"\nimport type { StackStyle } from \"./stack.style\"\nimport { cloneElement, Fragment, useMemo } from \"react\"\nimport { createComponent, styled } from \"../../core\"\nimport { replaceObject, useValidChildren } from \"../../utils\"\nimport { stackStyle } from \"./stack.style\"\n\nexport interface StackProps extends Omit<HTMLStyledProps, \"direction\"> {\n /**\n * The CSS `align-items` property.\n */\n align?: CSSProps[\"alignItems\"]\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSProps[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSProps[\"justifyContent\"]\n /**\n * If `true`, each stack item will show a separator.\n */\n separator?: ReactElement\n /**\n * The CSS `flex-wrap` property.\n */\n wrap?: CSSProps[\"flexWrap\"]\n}\n\nconst {\n PropsContext: StackPropsContext,\n usePropsContext: useStackPropsContext,\n withContext,\n} = createComponent<StackProps, StackStyle>(\"stack\", stackStyle)\n\nexport { StackPropsContext, useStackPropsContext }\n\n/**\n * `Stack` is a component that groups elements and provides space between child elements.\n *\n * @see https://yamada-ui.com/docs/components/stack\n */\nexport const Stack = withContext<\"div\", StackProps>(\n ({\n align: alignItems,\n children,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n separator,\n wrap: flexWrap,\n ...rest\n }) => {\n const isColumn = (value: any) =>\n value === \"column\" || value === \"column-reverse\"\n\n const validChildren = useValidChildren(children)\n const cloneChildren = useMemo(\n () =>\n separator\n ? validChildren.map((child, index) => {\n const key = typeof child.key !== \"undefined\" ? child.key : index\n\n const cloneSeparator = cloneElement<any>(separator, {\n borderWidth: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"0 0 1px 0\" : \"0 0 0 1px\",\n ),\n h: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"fit-content\" : \"100%\",\n ),\n w: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"100%\" : \"fit-content\",\n ),\n })\n\n return (\n <Fragment key={key}>\n {index ? cloneSeparator : null}\n {child}\n </Fragment>\n )\n })\n : validChildren,\n [separator, flexDirection, validChildren],\n )\n\n return (\n <styled.div\n alignItems={alignItems}\n flexDirection={flexDirection}\n flexWrap={flexWrap}\n justifyContent={justifyContent}\n {...rest}\n >\n {cloneChildren}\n </styled.div>\n )\n },\n)()\n"],"mappings":";;;;;;;;;AAiCA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACE,gBAAwC,SAAS,UAAU;;;;;;AAS/D,MAAa,QAAQ,aAClB,EACC,OAAO,YACP,UACA,WAAW,gBAAgB,UAC3B,SAAS,gBACT,WACA,MAAM,UACN,GAAG,WACC;CACJ,MAAM,YAAY,UAChB,UAAU,YAAY,UAAU;CAElC,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,gBAAgB,cAElB,YACI,cAAc,KAAK,OAAO,UAAU;EAClC,MAAM,MAAM,OAAO,MAAM,QAAQ,cAAc,MAAM,MAAM;EAE3D,MAAM,iBAAiB,aAAkB,WAAW;GAClD,cAAA,GAAA,cAAA,cAAA,CAA2B,gBAAgB,UACzC,SAAS,KAAK,IAAI,cAAc,WAClC;GACA,IAAA,GAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,gBAAgB,MACpC;GACA,IAAA,GAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,SAAS,aAC7B;EACF,CAAC;EAED,OACE,qBAAC,UAAD,EAAA,UAAA,CACG,QAAQ,iBAAiB,MACzB,KACO,EAAA,GAHK,GAGL;CAEd,CAAC,IACD,eACN;EAAC;EAAW;EAAe;CAAa,CAC1C;CAEA,OACE,oBAAC,OAAO,KAAR;EACc;EACG;EACL;EACM;EAChB,GAAI;YAEH;CACS,CAAA;AAEhB,CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"stack.js","names":[],"sources":["../../../../src/components/stack/stack.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { CSSProps, HTMLStyledProps } from \"../../core\"\nimport type { StackStyle } from \"./stack.style\"\nimport { cloneElement, Fragment, useMemo } from \"react\"\nimport { createComponent, styled } from \"../../core\"\nimport { replaceObject, useValidChildren } from \"../../utils\"\nimport { stackStyle } from \"./stack.style\"\n\nexport interface StackProps extends Omit<HTMLStyledProps, \"direction\"> {\n /**\n * The CSS `align-items` property.\n */\n align?: CSSProps[\"alignItems\"]\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSProps[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSProps[\"justifyContent\"]\n /**\n * If `true`, each stack item will show a separator.\n */\n separator?: ReactElement\n /**\n * The CSS `flex-wrap` property.\n */\n wrap?: CSSProps[\"flexWrap\"]\n}\n\nconst {\n PropsContext: StackPropsContext,\n usePropsContext: useStackPropsContext,\n withContext,\n} = createComponent<StackProps, StackStyle>(\"stack\", stackStyle)\n\nexport { StackPropsContext, useStackPropsContext }\n\n/**\n * `Stack` is a component that groups elements and provides space between child elements.\n *\n * @see https://yamada-ui.com/docs/components/stack\n */\nexport const Stack = withContext<\"div\", StackProps>(\n ({\n align: alignItems,\n children,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n separator,\n wrap: flexWrap,\n ...rest\n }) => {\n const isColumn = (value: any) =>\n value === \"column\" || value === \"column-reverse\"\n\n const validChildren = useValidChildren(children)\n const cloneChildren = useMemo(\n () =>\n separator\n ? validChildren.map((child, index) => {\n const key = typeof child.key !== \"undefined\" ? child.key : index\n\n const cloneSeparator = cloneElement<any>(separator, {\n borderWidth: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"0 0 1px 0\" : \"0 0 0 1px\",\n ),\n h: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"fit-content\" : \"100%\",\n ),\n w: replaceObject(flexDirection, (value) =>\n isColumn(value) ? \"100%\" : \"fit-content\",\n ),\n })\n\n return (\n <Fragment key={key}>\n {index ? cloneSeparator : null}\n {child}\n </Fragment>\n )\n })\n : validChildren,\n [separator, flexDirection, validChildren],\n )\n\n return (\n <styled.div\n alignItems={alignItems}\n flexDirection={flexDirection}\n flexWrap={flexWrap}\n justifyContent={justifyContent}\n {...rest}\n >\n {cloneChildren}\n </styled.div>\n )\n },\n)()\n"],"mappings":";;;;;;;;;AAiCA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACE,gBAAwC,SAAS,UAAU;;;;;;AAS/D,MAAa,QAAQ,aAClB,EACC,OAAO,YACP,UACA,WAAW,gBAAgB,UAC3B,SAAS,gBACT,WACA,MAAM,UACN,GAAG,WACC;CACJ,MAAM,YAAY,UAChB,UAAU,YAAY,UAAU;CAElC,MAAM,gBAAgB,iBAAiB,QAAQ;CAC/C,MAAM,gBAAgB,cAElB,YACI,cAAc,KAAK,OAAO,UAAU;EAClC,MAAM,MAAM,OAAO,MAAM,QAAQ,cAAc,MAAM,MAAM;EAE3D,MAAM,iBAAiB,aAAkB,WAAW;GAClD,cAAA,GAAA,cAAA,cAAA,CAA2B,gBAAgB,UACzC,SAAS,KAAK,IAAI,cAAc,WAClC;GACA,IAAA,GAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,gBAAgB,MACpC;GACA,IAAA,GAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,SAAS,aAC7B;EACF,CAAC;EAED,OACE,qBAAC,UAAD,EAAA,UAAA,CACG,QAAQ,iBAAiB,MACzB,KACO,EAAA,GAHK,GAGL;CAEd,CAAC,IACD,eACN;EAAC;EAAW;EAAe;CAAa,CAC1C;CAEA,OACE,oBAAC,OAAO,KAAR;EACc;EACG;EACL;EACM;EAChB,GAAI;EAEH,UAAA;CACS,CAAA;AAEhB,CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"z-stack.js","names":[],"sources":["../../../../src/components/stack/z-stack.tsx"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type {\n CSSObject,\n Direction,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ZStackStyle } from \"./z-stack.style\"\nimport {\n cloneElement,\n createRef,\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n createComponent,\n mergeCSS,\n styled,\n useInjectVarsIntoCss,\n useInjectVarsIntoProps,\n} from \"../../core\"\nimport { getValidChildren, mergeRefs } from \"../../utils\"\nimport { zStackStyle } from \"./z-stack.style\"\n\nexport interface ZStackProps\n extends Omit<HTMLStyledProps, \"direction\">, ThemeProps<ZStackStyle> {\n /**\n * Stack in the specified direction.\n *\n * @default 'end'\n */\n direction?: Direction\n /**\n * If `true`, calculate the `width` and `height` of the element and assign container.\n *\n * @default true\n */\n fit?: boolean\n /**\n * If `true`, reverse direction.\n *\n * @default false\n */\n reverse?: boolean\n /**\n * If set the stack will start from the given index.\n *\n * @default 0\n */\n startIndex?: number\n}\n\nconst {\n PropsContext: ZStackPropsContext,\n usePropsContext: useZStackPropsContext,\n withContext,\n} = createComponent<ZStackProps, ZStackStyle>(\"stack--depth\", zStackStyle)\n\nexport { useZStackPropsContext, ZStackPropsContext }\n\n/**\n * `ZStack` is a component that groups elements and provides space between child elements.\n *\n * @see https://yamada-ui.com/docs/components/stack\n */\nexport const ZStack = withContext<\"div\", ZStackProps>(\n ({\n css,\n children,\n direction = \"end\",\n fit = true,\n reverse = false,\n startIndex = 0,\n ...rest\n }) => {\n if (direction === \"start-center\") direction = \"start\"\n if (direction === \"end-center\") direction = \"end\"\n\n const refMap = useRef<Map<number, RefObject<HTMLDivElement | null>>>(\n new Map(),\n )\n const [rect, setRect] = useState<{ height: number; width: number }>({\n height: 0,\n width: 0,\n })\n\n const vertical = useCallback(\n (space: string) => {\n if (direction.startsWith(\"start\"))\n return { [!reverse ? \"bottom\" : \"top\"]: space }\n else if (direction.startsWith(\"end\"))\n return { [!reverse ? \"top\" : \"bottom\"]: space }\n else return { [!reverse ? \"top\" : \"bottom\"]: 0 }\n },\n [direction, reverse],\n )\n\n const horizontal = useCallback(\n (space: string) => {\n if (direction.endsWith(\"-start\"))\n return { [!reverse ? \"right\" : \"left\"]: space }\n else if (direction.endsWith(\"-end\"))\n return { [!reverse ? \"left\" : \"right\"]: space }\n else return { [!reverse ? \"left\" : \"right\"]: 0 }\n },\n [direction, reverse],\n )\n\n const cloneChildren = useMemo(() => {\n const validChildren = getValidChildren(children)\n\n const clonedChildren = validChildren.map((child, index) => {\n const ref = createRef<HTMLDivElement>()\n\n refMap.current.set(index, ref)\n\n const key = child.key ?? index\n\n const zIndex = startIndex + index\n const space = `calc({space} * ${index})`\n\n const css: CSSObject = {\n position: \"absolute\",\n zIndex,\n ...vertical(space),\n ...horizontal(space),\n }\n\n const props = {\n ...child.props,\n ref: mergeRefs(child.props.ref, ref),\n css: mergeCSS(child.props.css, css),\n }\n\n const clonedChild = cloneElement(child, props)\n\n return <Fragment key={key}>{clonedChild}</Fragment>\n })\n\n return clonedChildren\n }, [children, startIndex, vertical, horizontal])\n\n useEffect(() => {\n if (!fit) return\n\n let negativeLeft = direction.endsWith(\"-start\")\n let negativeTop = direction.startsWith(\"start\")\n let width = 0\n let height = 0\n\n if (reverse) {\n negativeLeft = !negativeLeft\n negativeTop = !negativeTop\n }\n\n for (const ref of refMap.current.values()) {\n if (!ref.current) continue\n\n let { offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth } =\n ref.current\n\n if (!offsetParent && process.env.NODE_ENV !== \"test\") continue\n\n if (negativeLeft) {\n const offsetParentWidth =\n (offsetParent as HTMLDivElement | null)?.offsetWidth ?? 0\n\n offsetLeft = offsetParentWidth - offsetLeft - offsetWidth\n }\n\n if (negativeTop) {\n const offsetParentHeight =\n (offsetParent as HTMLDivElement | null)?.offsetHeight ?? 0\n\n offsetTop = offsetParentHeight - offsetTop - offsetHeight\n }\n\n offsetWidth += offsetLeft\n offsetHeight += offsetTop\n\n if (offsetWidth > width) width = offsetWidth\n if (offsetHeight > height) height = offsetHeight\n }\n\n setRect({ height, width })\n }, [cloneChildren, direction, reverse, fit])\n\n return (\n <styled.div\n css={css}\n minHeight={fit ? `${rect.height}px` : undefined}\n minWidth={fit ? `${rect.width}px` : undefined}\n {...rest}\n >\n {cloneChildren}\n </styled.div>\n )\n },\n)(undefined, (props) => {\n const css = useInjectVarsIntoCss(props.css, { gap: \"space\" })\n const rest = useInjectVarsIntoProps(props, { gap: \"space\" })\n\n return { ...rest, css }\n})\n"],"mappings":";;;;;;;;;;;AA0DA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACE,gBAA0C,gBAAgB,WAAW;;;;;;AASzE,MAAa,SAAS,aACnB,EACC,KACA,UACA,YAAY,OACZ,MAAM,MACN,UAAU,OACV,aAAa,GACb,GAAG,WACC;CACJ,IAAI,cAAc,gBAAgB,YAAY;CAC9C,IAAI,cAAc,cAAc,YAAY;CAE5C,MAAM,SAAS,uBACb,IAAI,IAAI,CACV;CACA,MAAM,CAAC,MAAM,WAAW,SAA4C;EAClE,QAAQ;EACR,OAAO;CACT,CAAC;CAED,MAAM,WAAW,aACd,UAAkB;EACjB,IAAI,UAAU,WAAW,OAAO,GAC9B,OAAO,GAAG,CAAC,UAAU,WAAW,QAAQ,MAAM;OAC3C,IAAI,UAAU,WAAW,KAAK,GACjC,OAAO,GAAG,CAAC,UAAU,QAAQ,WAAW,MAAM;OAC3C,OAAO,GAAG,CAAC,UAAU,QAAQ,WAAW,EAAE;CACjD,GACA,CAAC,WAAW,OAAO,CACrB;CAEA,MAAM,aAAa,aAChB,UAAkB;EACjB,IAAI,UAAU,SAAS,QAAQ,GAC7B,OAAO,GAAG,CAAC,UAAU,UAAU,SAAS,MAAM;OAC3C,IAAI,UAAU,SAAS,MAAM,GAChC,OAAO,GAAG,CAAC,UAAU,SAAS,UAAU,MAAM;OAC3C,OAAO,GAAG,CAAC,UAAU,SAAS,UAAU,EAAE;CACjD,GACA,CAA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;EAAC;EAAe;EAAW;EAAS;CAAG,CAAC;CAE3C,OACE,oBAAC,OAAO,KAAR;EACO;EACL,WAAW,MAAM,GAAG,KAAK,OAAO,MAAM,KAAA;EACtC,UAAU,MAAM,GAAG,KAAK,MAAM,MAAM,KAAA;EACpC,GAAI;YAEH;CACS,CAAA;AAEhB,CACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,MAAM,qBAAqB,MAAM,KAAK,EAAE,KAAK,QAAQ,CAAC;CAG5D,OAAO;EAAE,GAFI,uBAAuB,OAAO,EAAE,KAAK,QAAQ,CAE3C;EAAG;CAAI;AACxB,CAAC"}
1
+ {"version":3,"file":"z-stack.js","names":[],"sources":["../../../../src/components/stack/z-stack.tsx"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type {\n CSSObject,\n Direction,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ZStackStyle } from \"./z-stack.style\"\nimport {\n cloneElement,\n createRef,\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n createComponent,\n mergeCSS,\n styled,\n useInjectVarsIntoCss,\n useInjectVarsIntoProps,\n} from \"../../core\"\nimport { getValidChildren, mergeRefs } from \"../../utils\"\nimport { zStackStyle } from \"./z-stack.style\"\n\nexport interface ZStackProps\n extends Omit<HTMLStyledProps, \"direction\">, ThemeProps<ZStackStyle> {\n /**\n * Stack in the specified direction.\n *\n * @default 'end'\n */\n direction?: Direction\n /**\n * If `true`, calculate the `width` and `height` of the element and assign container.\n *\n * @default true\n */\n fit?: boolean\n /**\n * If `true`, reverse direction.\n *\n * @default false\n */\n reverse?: boolean\n /**\n * If set the stack will start from the given index.\n *\n * @default 0\n */\n startIndex?: number\n}\n\nconst {\n PropsContext: ZStackPropsContext,\n usePropsContext: useZStackPropsContext,\n withContext,\n} = createComponent<ZStackProps, ZStackStyle>(\"stack--depth\", zStackStyle)\n\nexport { useZStackPropsContext, ZStackPropsContext }\n\n/**\n * `ZStack` is a component that groups elements and provides space between child elements.\n *\n * @see https://yamada-ui.com/docs/components/stack\n */\nexport const ZStack = withContext<\"div\", ZStackProps>(\n ({\n css,\n children,\n direction = \"end\",\n fit = true,\n reverse = false,\n startIndex = 0,\n ...rest\n }) => {\n if (direction === \"start-center\") direction = \"start\"\n if (direction === \"end-center\") direction = \"end\"\n\n const refMap = useRef<Map<number, RefObject<HTMLDivElement | null>>>(\n new Map(),\n )\n const [rect, setRect] = useState<{ height: number; width: number }>({\n height: 0,\n width: 0,\n })\n\n const vertical = useCallback(\n (space: string) => {\n if (direction.startsWith(\"start\"))\n return { [!reverse ? \"bottom\" : \"top\"]: space }\n else if (direction.startsWith(\"end\"))\n return { [!reverse ? \"top\" : \"bottom\"]: space }\n else return { [!reverse ? \"top\" : \"bottom\"]: 0 }\n },\n [direction, reverse],\n )\n\n const horizontal = useCallback(\n (space: string) => {\n if (direction.endsWith(\"-start\"))\n return { [!reverse ? \"right\" : \"left\"]: space }\n else if (direction.endsWith(\"-end\"))\n return { [!reverse ? \"left\" : \"right\"]: space }\n else return { [!reverse ? \"left\" : \"right\"]: 0 }\n },\n [direction, reverse],\n )\n\n const cloneChildren = useMemo(() => {\n const validChildren = getValidChildren(children)\n\n const clonedChildren = validChildren.map((child, index) => {\n const ref = createRef<HTMLDivElement>()\n\n refMap.current.set(index, ref)\n\n const key = child.key ?? index\n\n const zIndex = startIndex + index\n const space = `calc({space} * ${index})`\n\n const css: CSSObject = {\n position: \"absolute\",\n zIndex,\n ...vertical(space),\n ...horizontal(space),\n }\n\n const props = {\n ...child.props,\n ref: mergeRefs(child.props.ref, ref),\n css: mergeCSS(child.props.css, css),\n }\n\n const clonedChild = cloneElement(child, props)\n\n return <Fragment key={key}>{clonedChild}</Fragment>\n })\n\n return clonedChildren\n }, [children, startIndex, vertical, horizontal])\n\n useEffect(() => {\n if (!fit) return\n\n let negativeLeft = direction.endsWith(\"-start\")\n let negativeTop = direction.startsWith(\"start\")\n let width = 0\n let height = 0\n\n if (reverse) {\n negativeLeft = !negativeLeft\n negativeTop = !negativeTop\n }\n\n for (const ref of refMap.current.values()) {\n if (!ref.current) continue\n\n let { offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth } =\n ref.current\n\n if (!offsetParent && process.env.NODE_ENV !== \"test\") continue\n\n if (negativeLeft) {\n const offsetParentWidth =\n (offsetParent as HTMLDivElement | null)?.offsetWidth ?? 0\n\n offsetLeft = offsetParentWidth - offsetLeft - offsetWidth\n }\n\n if (negativeTop) {\n const offsetParentHeight =\n (offsetParent as HTMLDivElement | null)?.offsetHeight ?? 0\n\n offsetTop = offsetParentHeight - offsetTop - offsetHeight\n }\n\n offsetWidth += offsetLeft\n offsetHeight += offsetTop\n\n if (offsetWidth > width) width = offsetWidth\n if (offsetHeight > height) height = offsetHeight\n }\n\n setRect({ height, width })\n }, [cloneChildren, direction, reverse, fit])\n\n return (\n <styled.div\n css={css}\n minHeight={fit ? `${rect.height}px` : undefined}\n minWidth={fit ? `${rect.width}px` : undefined}\n {...rest}\n >\n {cloneChildren}\n </styled.div>\n )\n },\n)(undefined, (props) => {\n const css = useInjectVarsIntoCss(props.css, { gap: \"space\" })\n const rest = useInjectVarsIntoProps(props, { gap: \"space\" })\n\n return { ...rest, css }\n})\n"],"mappings":";;;;;;;;;;;AA0DA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACE,gBAA0C,gBAAgB,WAAW;;;;;;AASzE,MAAa,SAAS,aACnB,EACC,KACA,UACA,YAAY,OACZ,MAAM,MACN,UAAU,OACV,aAAa,GACb,GAAG,WACC;CACJ,IAAI,cAAc,gBAAgB,YAAY;CAC9C,IAAI,cAAc,cAAc,YAAY;CAE5C,MAAM,SAAS,uBACb,IAAI,IAAI,CACV;CACA,MAAM,CAAC,MAAM,WAAW,SAA4C;EAClE,QAAQ;EACR,OAAO;CACT,CAAC;CAED,MAAM,WAAW,aACd,UAAkB;EACjB,IAAI,UAAU,WAAW,OAA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IAAI,SAAS;GACX,eAAe,CAAC;GAChB,cAAc,CAAC;EACjB;EAEA,KAAK,MAAM,OAAO,OAAO,QAAQ,OAAO,GAAG;GACzC,IAAI,CAAC,IAAI,SAAS;GAElB,IAAI,EAAE,cAAc,YAAY,cAAc,WAAW,gBACvD,IAAI;GAEN,IAAI,CAAC,gBAAgB,MAAiC;GAEtD,IAAI,cAIF,cAFG,cAAwC,eAAe,KAEzB,aAAa;GAGhD,IAAI,aAIF,aAFG,cAAwC,gBAAgB,KAE1B,YAAY;GAG/C,eAAe;GACf,gBAAgB;GAEhB,IAAI,cAAc,OAAO,QAAQ;GACjC,IAAI,eAAe,QAAQ,SAAS;EACtC;EAEA,QAAQ;GAAE;GAAQ;EAAM,CAAC;CAC3B,GAAG;EAAC;EAAe;EAAW;EAAS;CAAG,CAAC;CAE3C,OACE,oBAAC,OAAO,KAAR;EACO;EACL,WAAW,MAAM,GAAG,KAAK,OAAO,MAAM,KAAA;EACtC,UAAU,MAAM,GAAG,KAAK,MAAM,MAAM,KAAA;EACpC,GAAI;EAEH,UAAA;CACS,CAAA;AAEhB,CACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,MAAM,qBAAqB,MAAM,KAAK,EAAE,KAAK,QAAQ,CAAC;CAG5D,OAAO;EAAE,GAFI,uBAAuB,OAAO,EAAE,KAAK,QAAQ,CAE3C;EAAG;CAAI;AACxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stat.js","names":[],"sources":["../../../../src/components/stat/stat.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { StatStyle } from \"./stat.style\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { useSplitChildren } from \"../../utils\"\nimport { TriangleIcon } from \"../icon\"\nimport { statStyle } from \"./stat.style\"\n\nexport interface StatRootProps\n extends HTMLStyledProps<\"dl\">, ThemeProps<StatStyle> {\n /**\n * If `true`, container will center its children regardless of their width.\n *\n * @default false\n */\n centerContent?: boolean\n /**\n * The stat helper message to use.\n */\n helperMessage?: ReactNode\n /**\n * The stat icon to use.\n */\n icon?: StatIconProps[\"type\"]\n /**\n * The stat label to use.\n */\n label?: ReactNode\n /**\n * The stat value to use.\n */\n value?: ReactNode\n /**\n * Props for stat helper message component.\n */\n helperMessageProps?: StatHelperMessageProps\n /**\n * Props for stat icon component.\n */\n iconProps?: Omit<StatIconProps, \"type\">\n /**\n * Props for stat label component.\n */\n labelProps?: StatLabelProps\n /**\n * Props for stat value component.\n */\n valueProps?: StatValueProps\n}\n\nconst {\n PropsContext: StatPropsContext,\n usePropsContext: useStatPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StatRootProps, StatStyle>(\"stat\", statStyle)\n\nexport { StatPropsContext, useStatPropsContext }\n\n/**\n * `Stat` is used to show numbers and data in a box.\n *\n * @see https://yamada-ui.com/docs/components/stat\n */\nexport const StatRoot = withProvider<\"dl\", StatRootProps>(\n ({\n children,\n helperMessage,\n icon,\n label,\n value,\n helperMessageProps,\n iconProps,\n labelProps,\n valueProps,\n ...rest\n }) => {\n const [\n omittedChildren,\n customStatLabel,\n customStatValue,\n customStatHelperMessage,\n ] = useSplitChildren(children, StatLabel, StatValue, StatHelperMessage)\n\n return (\n <styled.dl {...rest}>\n {customStatLabel ?? <StatLabel {...labelProps}>{label}</StatLabel>}\n {customStatValue ?? <StatValue {...valueProps}>{value}</StatValue>}\n {customStatHelperMessage ?? (\n <StatHelperMessage {...helperMessageProps}>\n {icon ? <StatIcon type={icon} {...iconProps} /> : null}\n {helperMessage}\n </StatHelperMessage>\n )}\n {omittedChildren}\n </styled.dl>\n )\n },\n \"root\",\n)()\n\nexport interface StatIconProps extends HTMLStyledProps<\"svg\"> {\n /**\n * The type of the icon.\n *\n * @default 'increase'\n */\n type?: \"decrease\" | \"increase\"\n}\n\nexport const StatIcon = withContext<\"svg\", StatIconProps>(\n ({ type = \"increase\", ...rest }) => {\n const { t } = useI18n(\"stat\")\n\n return (\n <TriangleIcon\n aria-label={type === \"increase\" ? t(\"Increased by\") : t(\"Decreased by\")}\n data-type={type}\n {...rest}\n />\n )\n },\n \"icon\",\n)()\n\nexport interface StatLabelProps extends HTMLStyledProps<\"dt\"> {}\n\nexport const StatLabel = withContext<\"dt\", StatLabelProps>(\"dt\", \"label\")()\n\nexport interface StatValueProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const StatValue = withContext<\"dd\", StatValueProps>(\"dd\", \"value\")()\n\nexport interface StatUnitProps extends HTMLStyledProps<\"span\"> {}\n\nexport const StatUnit = withContext<\"span\", StatUnitProps>(\"span\", \"unit\")()\n\nexport interface StatHelperMessageProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const StatHelperMessage = withContext<\"dd\", StatHelperMessageProps>(\n \"dd\",\n \"helperMessage\",\n)()\n"],"mappings":";;;;;;;;;AAqDA,MAAM,EACJ,cAAc,kBACd,iBAAiB,qBACjB,aACA,iBACE,oBAA8C,QAAQ,SAAS;;;;;;AASnE,MAAa,WAAW,cACrB,EACC,UACA,eACA,MACA,OACA,OACA,oBACA,WACA,YACA,YACA,GAAG,WACC;CACJ,MAAM,CACJ,iBACA,iBACA,iBACA,2BACE,iBAAiB,UAAU,WAAW,WAAW,iBAAiB;CAEtE,OACE,qBAAC,OAAO,IAAR;EAAW,GAAI;YAAf;GACG,mBAAmB,oBAAC,WAAD;IAAW,GAAI;cAAa;GAAiB,CAAA;GAChE,mBAAmB,oBAAC,WAAD;IAAW,GAAI;cAAa;GAAiB,CAAA;GAChE,2BACC,qBAAC,mBAAD;IAAmB,GAAI;cAAvB,CACG,OAAO,oBAAC,UAAD;KAAU,MAAM;KAAM,GAAI;IAAY,CAAA,IAAI,MACjD,aACgB;;GAEpB;EACQ;;AAEf,GACA,MACF,CAAC,CAAC;AAWF,MAAa,WAAW,aACrB,EAAE,OAAO,YAAY,GAAG,WAAW;CAClC,MAAM,EAAE,MAAM,QAAQ,MAAM;CAE5B,OACE,oBAAC,cAAD;EACE,cAAY,SAAS,aAAa,EAAE,cAAc,IAAI,EAAE,cAAc;EACtE,aAAW;EACX,GAAI;CACL,CAAA;AAEL,GACA,MACF,CAAC,CAAC;AAIF,MAAa,YAAY,YAAkC,MAAM,OAAO,CAAC,CAAC;AAI1E,MAAa,YAAY,YAAkC,MAAM,OAAO,CAAC,CAAC;AAI1E,MAAa,WAAW,YAAmC,QAAQ,MAAM,CAAC,CAAC;AAI3E,MAAa,oBAAoB,YAC/B,MACA,eACF,CAAC,CAAC"}
1
+ {"version":3,"file":"stat.js","names":[],"sources":["../../../../src/components/stat/stat.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { StatStyle } from \"./stat.style\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { useSplitChildren } from \"../../utils\"\nimport { TriangleIcon } from \"../icon\"\nimport { statStyle } from \"./stat.style\"\n\nexport interface StatRootProps\n extends HTMLStyledProps<\"dl\">, ThemeProps<StatStyle> {\n /**\n * If `true`, container will center its children regardless of their width.\n *\n * @default false\n */\n centerContent?: boolean\n /**\n * The stat helper message to use.\n */\n helperMessage?: ReactNode\n /**\n * The stat icon to use.\n */\n icon?: StatIconProps[\"type\"]\n /**\n * The stat label to use.\n */\n label?: ReactNode\n /**\n * The stat value to use.\n */\n value?: ReactNode\n /**\n * Props for stat helper message component.\n */\n helperMessageProps?: StatHelperMessageProps\n /**\n * Props for stat icon component.\n */\n iconProps?: Omit<StatIconProps, \"type\">\n /**\n * Props for stat label component.\n */\n labelProps?: StatLabelProps\n /**\n * Props for stat value component.\n */\n valueProps?: StatValueProps\n}\n\nconst {\n PropsContext: StatPropsContext,\n usePropsContext: useStatPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StatRootProps, StatStyle>(\"stat\", statStyle)\n\nexport { StatPropsContext, useStatPropsContext }\n\n/**\n * `Stat` is used to show numbers and data in a box.\n *\n * @see https://yamada-ui.com/docs/components/stat\n */\nexport const StatRoot = withProvider<\"dl\", StatRootProps>(\n ({\n children,\n helperMessage,\n icon,\n label,\n value,\n helperMessageProps,\n iconProps,\n labelProps,\n valueProps,\n ...rest\n }) => {\n const [\n omittedChildren,\n customStatLabel,\n customStatValue,\n customStatHelperMessage,\n ] = useSplitChildren(children, StatLabel, StatValue, StatHelperMessage)\n\n return (\n <styled.dl {...rest}>\n {customStatLabel ?? <StatLabel {...labelProps}>{label}</StatLabel>}\n {customStatValue ?? <StatValue {...valueProps}>{value}</StatValue>}\n {customStatHelperMessage ?? (\n <StatHelperMessage {...helperMessageProps}>\n {icon ? <StatIcon type={icon} {...iconProps} /> : null}\n {helperMessage}\n </StatHelperMessage>\n )}\n {omittedChildren}\n </styled.dl>\n )\n },\n \"root\",\n)()\n\nexport interface StatIconProps extends HTMLStyledProps<\"svg\"> {\n /**\n * The type of the icon.\n *\n * @default 'increase'\n */\n type?: \"decrease\" | \"increase\"\n}\n\nexport const StatIcon = withContext<\"svg\", StatIconProps>(\n ({ type = \"increase\", ...rest }) => {\n const { t } = useI18n(\"stat\")\n\n return (\n <TriangleIcon\n aria-label={type === \"increase\" ? t(\"Increased by\") : t(\"Decreased by\")}\n data-type={type}\n {...rest}\n />\n )\n },\n \"icon\",\n)()\n\nexport interface StatLabelProps extends HTMLStyledProps<\"dt\"> {}\n\nexport const StatLabel = withContext<\"dt\", StatLabelProps>(\"dt\", \"label\")()\n\nexport interface StatValueProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const StatValue = withContext<\"dd\", StatValueProps>(\"dd\", \"value\")()\n\nexport interface StatUnitProps extends HTMLStyledProps<\"span\"> {}\n\nexport const StatUnit = withContext<\"span\", StatUnitProps>(\"span\", \"unit\")()\n\nexport interface StatHelperMessageProps extends HTMLStyledProps<\"dd\"> {}\n\nexport const StatHelperMessage = withContext<\"dd\", StatHelperMessageProps>(\n \"dd\",\n \"helperMessage\",\n)()\n"],"mappings":";;;;;;;;;AAqDA,MAAM,EACJ,cAAc,kBACd,iBAAiB,qBACjB,aACA,iBACE,oBAA8C,QAAQ,SAAS;;;;;;AASnE,MAAa,WAAW,cACrB,EACC,UACA,eACA,MACA,OACA,OACA,oBACA,WACA,YACA,YACA,GAAG,WACC;CACJ,MAAM,CACJ,iBACA,iBACA,iBACA,2BACE,iBAAiB,UAAU,WAAW,WAAW,iBAAiB;CAEtE,OACE,qBAAC,OAAO,IAAR;EAAW,GAAI;EAAf,UAAA;GACG,mBAAmB,oBAAC,WAAD;IAAW,GAAI;IAAa,UAAA;GAAiB,CAAA;GAChE,mBAAmB,oBAAC,WAAD;IAAW,GAAI;IAAa,UAAA;GAAiB,CAAA;GAChE,2BACC,qBAAC,mBAAD;IAAmB,GAAI;IAAvB,UAAA,CACG,OAAO,oBAAC,UAAD;KAAU,MAAM;KAAM,GAAI;IAAY,CAAA,IAAI,MACjD,aACgB;;GAEpB;EACQ;;AAEf,GACA,MACF,CAAC,CAAC;AAWF,MAAa,WAAW,aACrB,EAAE,OAAO,YAAY,GAAG,WAAW;CAClC,MAAM,EAAE,MAAM,QAAQ,MAAM;CAE5B,OACE,oBAAC,cAAD;EACE,cAAY,SAAS,aAAa,EAAE,cAAc,IAAI,EAAE,cAAc;EACtE,aAAW;EACX,GAAI;CACL,CAAA;AAEL,GACA,MACF,CAAC,CAAC;AAIF,MAAa,YAAY,YAAkC,MAAM,OAAO,CAAC,CAAC;AAI1E,MAAa,YAAY,YAAkC,MAAM,OAAO,CAAC,CAAC;AAI1E,MAAa,WAAW,YAAmC,QAAQ,MAAM,CAAC,CAAC;AAI3E,MAAa,oBAAoB,YAC/B,MACA,eACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","names":[],"sources":["../../../../src/components/status/status.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { StatusStyle } from \"./status.style\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { statusStyle } from \"./status.style\"\n\nexport type StatusScheme = \"error\" | \"info\" | \"success\" | \"warning\"\n\nexport interface StatusProps extends HTMLStyledProps, ThemeProps<StatusStyle> {\n /**\n * The type of the status\n *\n * @default 'info'\n * */\n value?: StatusScheme\n /**\n * The props for the status indicator component\n */\n indicatorProps?: HTMLStyledProps\n /**\n * The props for the status label component\n */\n labelProps?: HTMLStyledProps\n}\n\nconst {\n PropsContext: StatusPropsContext,\n usePropsContext: useStatusPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StatusProps, StatusStyle>(\"status\", statusStyle)\n\nexport { StatusPropsContext, useStatusPropsContext }\n\n/**\n * `Status` is component that indicate the status of a process or state.\n *\n * @see https://yamada-ui.com/docs/components/status\n */\nexport const Status = withProvider<\"div\", StatusProps>(\n ({ children, indicatorProps, labelProps, ...rest }) => {\n return (\n <styled.div {...rest}>\n <StatusIndicator {...indicatorProps} />\n\n <StatusLabel {...labelProps}>{children}</StatusLabel>\n </styled.div>\n )\n },\n \"root\",\n)(undefined, ({ colorScheme, value = \"info\", ...rest }) => ({\n colorScheme: colorScheme ?? value,\n ...rest,\n}))\n\ninterface StatusIndicatorProps extends HTMLStyledProps {}\n\nconst StatusIndicator = withContext<\"div\", StatusIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n\ninterface StatusLabelProps extends HTMLStyledProps<\"p\"> {}\n\nconst StatusLabel = withContext<\"p\", StatusLabelProps>(\"p\", \"label\")()\n"],"mappings":";;;;;;AA0BA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,aACA,iBACE,oBAA8C,UAAU,WAAW;;;;;;AASvE,MAAa,SAAS,cACnB,EAAE,UAAU,gBAAgB,YAAY,GAAG,WAAW;CACrD,OACE,qBAAC,OAAO,KAAR;EAAY,GAAI;YAAhB,CACE,oBAAC,iBAAD,EAAiB,GAAI,eAAiB,CAAA,GAEtC,oBAAC,aAAD;GAAa,GAAI;GAAa;EAAsB,CAAA,CAC1C;;AAEhB,GACA,MACF,CAAC,CAAC,KAAA,IAAY,EAAE,aAAa,QAAQ,QAAQ,GAAG,YAAY;CAC1D,aAAa,eAAe;CAC5B,GAAG;AACL,EAAE;AAIF,MAAM,kBAAkB,YACtB,OACA,WACF,CAAC,CAAC;AAIF,MAAM,cAAc,YAAmC,KAAK,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"status.js","names":[],"sources":["../../../../src/components/status/status.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { StatusStyle } from \"./status.style\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { statusStyle } from \"./status.style\"\n\nexport type StatusScheme = \"error\" | \"info\" | \"success\" | \"warning\"\n\nexport interface StatusProps extends HTMLStyledProps, ThemeProps<StatusStyle> {\n /**\n * The type of the status\n *\n * @default 'info'\n * */\n value?: StatusScheme\n /**\n * The props for the status indicator component\n */\n indicatorProps?: HTMLStyledProps\n /**\n * The props for the status label component\n */\n labelProps?: HTMLStyledProps\n}\n\nconst {\n PropsContext: StatusPropsContext,\n usePropsContext: useStatusPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StatusProps, StatusStyle>(\"status\", statusStyle)\n\nexport { StatusPropsContext, useStatusPropsContext }\n\n/**\n * `Status` is component that indicate the status of a process or state.\n *\n * @see https://yamada-ui.com/docs/components/status\n */\nexport const Status = withProvider<\"div\", StatusProps>(\n ({ children, indicatorProps, labelProps, ...rest }) => {\n return (\n <styled.div {...rest}>\n <StatusIndicator {...indicatorProps} />\n\n <StatusLabel {...labelProps}>{children}</StatusLabel>\n </styled.div>\n )\n },\n \"root\",\n)(undefined, ({ colorScheme, value = \"info\", ...rest }) => ({\n colorScheme: colorScheme ?? value,\n ...rest,\n}))\n\ninterface StatusIndicatorProps extends HTMLStyledProps {}\n\nconst StatusIndicator = withContext<\"div\", StatusIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n\ninterface StatusLabelProps extends HTMLStyledProps<\"p\"> {}\n\nconst StatusLabel = withContext<\"p\", StatusLabelProps>(\"p\", \"label\")()\n"],"mappings":";;;;;;AA0BA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,aACA,iBACE,oBAA8C,UAAU,WAAW;;;;;;AASvE,MAAa,SAAS,cACnB,EAAE,UAAU,gBAAgB,YAAY,GAAG,WAAW;CACrD,OACE,qBAAC,OAAO,KAAR;EAAY,GAAI;EAAhB,UAAA,CACE,oBAAC,iBAAD,EAAiB,GAAI,eAAiB,CAAA,GAEtC,oBAAC,aAAD;GAAa,GAAI;GAAa;EAAsB,CAAA,CAC1C;;AAEhB,GACA,MACF,CAAC,CAAC,KAAA,IAAY,EAAE,aAAa,QAAQ,QAAQ,GAAG,YAAY;CAC1D,aAAa,eAAe;CAC5B,GAAG;AACL,EAAE;AAIF,MAAM,kBAAkB,YACtB,OACA,WACF,CAAC,CAAC;AAIF,MAAM,cAAc,YAAmC,KAAK,OAAO,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"steps.js","names":[],"sources":["../../../../src/components/steps/steps.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { UseLazyMountProps } from \"../../hooks/use-lazy-mount\"\nimport type { StepsStyle } from \"./steps.style\"\nimport type { UseStepsItemProps, UseStepsProps } from \"./use-steps\"\nimport { Children, useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useLazyMount } from \"../../hooks/use-lazy-mount\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n isNull,\n isUndefined,\n useFindChild,\n useValidChildren,\n} from \"../../utils\"\nimport { CheckIcon } from \"../icon\"\nimport { stepsStyle } from \"./steps.style\"\nimport {\n StepsContext,\n StepsDescendantsContext,\n StepsItemContext,\n useSteps,\n useStepsContext,\n useStepsItem,\n useStepsItemContext,\n} from \"./use-steps\"\n\ninterface ComponentContext extends Pick<\n StepsRootProps,\n \"items\" | \"lazy\" | \"lazyBehavior\"\n> {}\n\nexport interface StepsItem\n extends\n Omit<StepsItemProps, \"content\" | \"index\" | \"title\">,\n Pick<StepsIndicatorProps, \"complete\" | \"current\" | \"incomplete\"> {\n /**\n * The content for step element.\n */\n content?: ReactNode\n /**\n * The description for step element.\n */\n description?: ReactNode\n /**\n * If true, display the step separator.\n *\n * @default true\n */\n hasSeparator?: boolean\n /**\n * The title for step element.\n */\n title?: string\n /**\n * Props for step content element.\n */\n contentProps?: StepsContentProps\n /**\n * Props for step description element.\n */\n descriptionProps?: StepsDescriptionProps\n /**\n * Props for step indicator element.\n */\n indicatorProps?: StepsIndicatorProps\n /**\n * Props for step separator element.\n */\n separatorProps?: StepsSeparatorProps\n /**\n * Props for step title element.\n */\n titleProps?: StepsTitleProps\n}\n\nexport interface StepsRootProps\n extends\n Omit<HTMLStyledProps, \"onChange\">,\n Omit<UseStepsProps, \"count\" | \"orientation\">,\n Pick<UseLazyMountProps, \"lazy\" | \"lazyBehavior\">,\n ThemeProps<StepsStyle> {\n /**\n * If provided, generate step components based on steps.\n */\n items?: StepsItem[]\n}\n\nconst {\n ComponentContext,\n PropsContext: StepsPropsContext,\n useComponentContext,\n usePropsContext: useStepsPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StepsRootProps, StepsStyle, ComponentContext>(\n \"steps\",\n stepsStyle,\n)\n\nexport { StepsPropsContext, useStepsPropsContext }\n\n/**\n * `Steps` is a component that displays the progress of a multi-step process.\n *\n * @see https://yamada-ui.com/docs/components/steps\n */\nexport const StepsRoot = withProvider<\"div\", StepsRootProps, \"orientation\">(\n ({\n children,\n items = [],\n lazy,\n lazyBehavior,\n orientation: orientationProp,\n ...rest\n }) => {\n const computedOrientation = useValue(orientationProp)\n const validChildren = useValidChildren(children)\n const stepsList = useFindChild<StepsListProps>(validChildren, StepsList)\n const {\n id,\n count,\n descendants,\n getStatus,\n index,\n orientation,\n setIndex,\n getContentProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n onNext,\n onPrev,\n } = useSteps({\n count: items.length || Children.count(stepsList?.props.children),\n orientation: computedOrientation,\n ...rest,\n })\n const componentContext = useMemo(\n () => ({ items, lazy, lazyBehavior }),\n [items, lazy, lazyBehavior],\n )\n const stepsContext = useMemo(\n () => ({\n id,\n count,\n getStatus,\n index,\n orientation,\n setIndex,\n getContentProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n onNext,\n onPrev,\n }),\n [\n id,\n count,\n index,\n orientation,\n setIndex,\n getStatus,\n onNext,\n onPrev,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getContentProps,\n ],\n )\n\n return (\n <StepsDescendantsContext value={descendants}>\n <StepsContext value={stepsContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>{children}</styled.div>\n </ComponentContext>\n </StepsContext>\n </StepsDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)()\n\nexport interface StepsListProps extends HTMLStyledProps<\"ol\"> {}\n\nexport const StepsList = withContext<\"ol\", StepsListProps>(\n ({ children, ...rest }) => {\n const { items } = useComponentContext()\n const { getListProps } = useStepsContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return items?.map(\n (\n {\n complete,\n content: _content,\n current,\n description,\n hasSeparator = true,\n incomplete,\n title,\n contentProps: _contentProps,\n descriptionProps,\n indicatorProps,\n separatorProps,\n titleProps,\n ...rest\n },\n index,\n ) => (\n <StepsItem key={index} index={index} title={title} {...rest}>\n <StepsIndicator\n complete={complete}\n current={current}\n incomplete={incomplete}\n {...indicatorProps}\n />\n\n <styled.div>\n {title ? (\n <StepsTitle {...titleProps}>{title}</StepsTitle>\n ) : null}\n {description ? (\n <StepsDescription {...descriptionProps}>\n {description}\n </StepsDescription>\n ) : null}\n </styled.div>\n\n {hasSeparator ? <StepsSeparator {...separatorProps} /> : null}\n </StepsItem>\n ),\n )\n }, [children, items])\n\n return <styled.ol {...getListProps(rest)}>{computedChildren}</styled.ol>\n },\n \"list\",\n)()\n\nexport interface StepsItemProps\n extends HTMLStyledProps<\"li\">, UseStepsItemProps {}\n\nexport const StepsItem = withContext<\"li\", StepsItemProps>((props) => {\n const {\n first,\n index,\n last,\n status,\n getDescriptionProps,\n getIndicatorProps,\n getRootProps,\n getSeparatorProps,\n getTitleProps,\n } = useStepsItem(props)\n const context = useMemo(\n () => ({\n first,\n index,\n last,\n status,\n getDescriptionProps,\n getIndicatorProps,\n getSeparatorProps,\n getTitleProps,\n }),\n [\n first,\n index,\n last,\n status,\n getTitleProps,\n getDescriptionProps,\n getSeparatorProps,\n getIndicatorProps,\n ],\n )\n\n return (\n <StepsItemContext value={context}>\n <styled.li {...getRootProps()} />\n </StepsItemContext>\n )\n}, \"item\")()\n\nexport interface StepsIndicatorProps extends HTMLStyledProps {\n /**\n * The element for the complete indicator.\n *\n * @default <CheckIcon />\n */\n complete?: ReactNode\n /**\n * The element for the current indicator.\n *\n * @default <StepsNumber />\n */\n current?: ReactNode\n /**\n * The element for the incomplete indicator.\n *\n * @default <StepsNumber />\n */\n incomplete?: ReactNode\n}\n\nexport const StepsIndicator = withContext<\"div\", StepsIndicatorProps>(\n ({\n complete = <CheckIcon />,\n current = <StepsNumber />,\n incomplete = <StepsNumber />,\n ...rest\n }) => {\n const { status, getIndicatorProps } = useStepsItemContext()\n const components = useMemo(\n () => ({ complete, current, incomplete }),\n [complete, current, incomplete],\n )\n\n return (\n <styled.div {...getIndicatorProps(rest)}>{components[status]}</styled.div>\n )\n },\n \"indicator\",\n)()\n\nexport interface StepsNumberProps extends HTMLStyledProps<\"span\"> {}\n\nexport const StepsNumber = withContext<\"span\", StepsNumberProps>(\n \"span\",\n \"number\",\n)(undefined, ({ children, ...rest }) => {\n const { index } = useStepsItemContext()\n\n return { ...rest, children: children ?? index + 1 }\n})\n\nexport interface StepsTitleProps extends HTMLStyledProps {}\n\nexport const StepsTitle = withContext<\"h3\", StepsTitleProps>(\"h3\", \"title\")(\n undefined,\n (props) => {\n const { getTitleProps } = useStepsItemContext()\n\n return getTitleProps(props)\n },\n)\n\nexport interface StepsDescriptionProps extends HTMLStyledProps<\"p\"> {}\n\nexport const StepsDescription = withContext<\"p\", StepsDescriptionProps>(\n \"p\",\n \"description\",\n)(undefined, (props) => {\n const { getDescriptionProps } = useStepsItemContext()\n\n return getDescriptionProps(props)\n})\n\nexport interface StepsSeparatorProps extends HTMLStyledProps {}\n\nexport const StepsSeparator = withContext<\"div\", StepsSeparatorProps>(\n \"div\",\n \"separator\",\n)(undefined, (props) => {\n const { getSeparatorProps } = useStepsItemContext()\n\n return getSeparatorProps(props)\n})\n\nexport interface StepsContentsProps extends PropsWithChildren {}\n\nexport const StepsContents: FC<StepsContentsProps> = ({ children }) => {\n const { items } = useComponentContext()\n\n return useMemo(() => {\n if (children) return children\n else\n return items?.map(({ content, contentProps }, index) =>\n isUndefined(content) || isNull(content) ? null : (\n <StepsContent key={index} index={index} {...contentProps}>\n {content}\n </StepsContent>\n ),\n )\n }, [children, items])\n}\n\nexport interface StepsContentProps extends HTMLStyledProps {\n /**\n * The index of the step content.\n */\n index: number\n}\n\nexport const StepsContent = withContext<\"div\", StepsContentProps>(\n \"div\",\n \"content\",\n)(undefined, ({ index, ...rest }) => {\n const { lazy, lazyBehavior } = useComponentContext()\n const { index: selectedIndex, getContentProps } = useStepsContext()\n const mounted = index === selectedIndex\n const children = useLazyMount({\n lazy,\n lazyBehavior,\n mounted,\n ...rest,\n })\n\n return { ...getContentProps({ index, ...rest }), children }\n})\n\nexport interface StepsCompletedContentProps extends HTMLStyledProps {}\n\nexport const StepsCompletedContent = withContext<\n \"div\",\n StepsCompletedContentProps\n>(\"div\", { name: \"CompletedContent\", slot: [\"content\", \"completed\"] })(\n undefined,\n (props) => {\n const { lazy, lazyBehavior } = useComponentContext()\n const { count, index: selectedIndex, getContentProps } = useStepsContext()\n const mounted = count !== 0 && count === selectedIndex\n const children = useLazyMount({\n lazy,\n lazyBehavior,\n mounted,\n ...props,\n })\n\n return { ...getContentProps(props), children }\n },\n)\n\nexport interface StepsPrevTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const StepsPrevTrigger = withContext<\"button\", StepsPrevTriggerProps>(\n \"button\",\n { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] },\n)((props) => {\n const { getPrevTriggerProps } = useStepsContext()\n\n return { asChild: true, ...getPrevTriggerProps(props) }\n})\n\nexport interface StepsNextTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const StepsNextTrigger = withContext<\"button\", StepsNextTriggerProps>(\n \"button\",\n { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] },\n)((props) => {\n const { getNextTriggerProps } = useStepsContext()\n\n return { asChild: true, ...getNextTriggerProps(props) }\n})\n"],"mappings":";;;;;;;;;;;;;AA0FA,MAAM,EACJ,kBACA,cAAc,mBACd,qBACA,iBAAiB,sBACjB,aACA,iBACE,oBACF,SACA,UACF;;;;;;AASA,MAAa,YAAY,cACtB,EACC,UACA,QAAQ,CAAC,GACT,MACA,cACA,aAAa,iBACb,GAAG,WACC;CACJ,MAAM,sBAAsB,SAAS,eAAe;CAEpD,MAAM,YAAY,aADI,iBAAiB,QACoB,GAAG,SAAS;CACvE,MAAM,EACJ,IACA,OACA,aACA,WACA,OACA,aACA,UACA,iBACA,cACA,qBACA,qBACA,cACA,QACA,WACE,SAAS;EACX,OAAO,MAAM,UAAU,SAAS,MAAM,WAAW,MAAM,QAAQ;EAC/D,aAAa;EACb,GAAG;CACL,CAAC;CACD,MAAM,mBAAmB,eAChB;EAAE;EAAO;EAAM;CAAa,IACnC;EAAC;EAAO;EAAM;CAAY,CAC5B;CAgCA,OACE,oBAAC,yBAAD;EAAyB,OAAO;YAC9B,oBAAC,cAAD;GAAc,OAjCG,eACZ;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,IACA;IACE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Ae,MAAM,CAAC,WAAW,MAAM;AAAE,CACnD,CAAC,EAAE,UAAU;CACX,MAAM,EAAE,wBAAwB,gBAAgB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,oBAAoB,KAAK;CAAE;AACxD,CAAC"}
1
+ {"version":3,"file":"steps.js","names":[],"sources":["../../../../src/components/steps/steps.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { UseLazyMountProps } from \"../../hooks/use-lazy-mount\"\nimport type { StepsStyle } from \"./steps.style\"\nimport type { UseStepsItemProps, UseStepsProps } from \"./use-steps\"\nimport { Children, useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useLazyMount } from \"../../hooks/use-lazy-mount\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n isNull,\n isUndefined,\n useFindChild,\n useValidChildren,\n} from \"../../utils\"\nimport { CheckIcon } from \"../icon\"\nimport { stepsStyle } from \"./steps.style\"\nimport {\n StepsContext,\n StepsDescendantsContext,\n StepsItemContext,\n useSteps,\n useStepsContext,\n useStepsItem,\n useStepsItemContext,\n} from \"./use-steps\"\n\ninterface ComponentContext extends Pick<\n StepsRootProps,\n \"items\" | \"lazy\" | \"lazyBehavior\"\n> {}\n\nexport interface StepsItem\n extends\n Omit<StepsItemProps, \"content\" | \"index\" | \"title\">,\n Pick<StepsIndicatorProps, \"complete\" | \"current\" | \"incomplete\"> {\n /**\n * The content for step element.\n */\n content?: ReactNode\n /**\n * The description for step element.\n */\n description?: ReactNode\n /**\n * If true, display the step separator.\n *\n * @default true\n */\n hasSeparator?: boolean\n /**\n * The title for step element.\n */\n title?: string\n /**\n * Props for step content element.\n */\n contentProps?: StepsContentProps\n /**\n * Props for step description element.\n */\n descriptionProps?: StepsDescriptionProps\n /**\n * Props for step indicator element.\n */\n indicatorProps?: StepsIndicatorProps\n /**\n * Props for step separator element.\n */\n separatorProps?: StepsSeparatorProps\n /**\n * Props for step title element.\n */\n titleProps?: StepsTitleProps\n}\n\nexport interface StepsRootProps\n extends\n Omit<HTMLStyledProps, \"onChange\">,\n Omit<UseStepsProps, \"count\" | \"orientation\">,\n Pick<UseLazyMountProps, \"lazy\" | \"lazyBehavior\">,\n ThemeProps<StepsStyle> {\n /**\n * If provided, generate step components based on steps.\n */\n items?: StepsItem[]\n}\n\nconst {\n ComponentContext,\n PropsContext: StepsPropsContext,\n useComponentContext,\n usePropsContext: useStepsPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<StepsRootProps, StepsStyle, ComponentContext>(\n \"steps\",\n stepsStyle,\n)\n\nexport { StepsPropsContext, useStepsPropsContext }\n\n/**\n * `Steps` is a component that displays the progress of a multi-step process.\n *\n * @see https://yamada-ui.com/docs/components/steps\n */\nexport const StepsRoot = withProvider<\"div\", StepsRootProps, \"orientation\">(\n ({\n children,\n items = [],\n lazy,\n lazyBehavior,\n orientation: orientationProp,\n ...rest\n }) => {\n const computedOrientation = useValue(orientationProp)\n const validChildren = useValidChildren(children)\n const stepsList = useFindChild<StepsListProps>(validChildren, StepsList)\n const {\n id,\n count,\n descendants,\n getStatus,\n index,\n orientation,\n setIndex,\n getContentProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n onNext,\n onPrev,\n } = useSteps({\n count: items.length || Children.count(stepsList?.props.children),\n orientation: computedOrientation,\n ...rest,\n })\n const componentContext = useMemo(\n () => ({ items, lazy, lazyBehavior }),\n [items, lazy, lazyBehavior],\n )\n const stepsContext = useMemo(\n () => ({\n id,\n count,\n getStatus,\n index,\n orientation,\n setIndex,\n getContentProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n onNext,\n onPrev,\n }),\n [\n id,\n count,\n index,\n orientation,\n setIndex,\n getStatus,\n onNext,\n onPrev,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getContentProps,\n ],\n )\n\n return (\n <StepsDescendantsContext value={descendants}>\n <StepsContext value={stepsContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>{children}</styled.div>\n </ComponentContext>\n </StepsContext>\n </StepsDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)()\n\nexport interface StepsListProps extends HTMLStyledProps<\"ol\"> {}\n\nexport const StepsList = withContext<\"ol\", StepsListProps>(\n ({ children, ...rest }) => {\n const { items } = useComponentContext()\n const { getListProps } = useStepsContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return items?.map(\n (\n {\n complete,\n content: _content,\n current,\n description,\n hasSeparator = true,\n incomplete,\n title,\n contentProps: _contentProps,\n descriptionProps,\n indicatorProps,\n separatorProps,\n titleProps,\n ...rest\n },\n index,\n ) => (\n <StepsItem key={index} index={index} title={title} {...rest}>\n <StepsIndicator\n complete={complete}\n current={current}\n incomplete={incomplete}\n {...indicatorProps}\n />\n\n <styled.div>\n {title ? (\n <StepsTitle {...titleProps}>{title}</StepsTitle>\n ) : null}\n {description ? (\n <StepsDescription {...descriptionProps}>\n {description}\n </StepsDescription>\n ) : null}\n </styled.div>\n\n {hasSeparator ? <StepsSeparator {...separatorProps} /> : null}\n </StepsItem>\n ),\n )\n }, [children, items])\n\n return <styled.ol {...getListProps(rest)}>{computedChildren}</styled.ol>\n },\n \"list\",\n)()\n\nexport interface StepsItemProps\n extends HTMLStyledProps<\"li\">, UseStepsItemProps {}\n\nexport const StepsItem = withContext<\"li\", StepsItemProps>((props) => {\n const {\n first,\n index,\n last,\n status,\n getDescriptionProps,\n getIndicatorProps,\n getRootProps,\n getSeparatorProps,\n getTitleProps,\n } = useStepsItem(props)\n const context = useMemo(\n () => ({\n first,\n index,\n last,\n status,\n getDescriptionProps,\n getIndicatorProps,\n getSeparatorProps,\n getTitleProps,\n }),\n [\n first,\n index,\n last,\n status,\n getTitleProps,\n getDescriptionProps,\n getSeparatorProps,\n getIndicatorProps,\n ],\n )\n\n return (\n <StepsItemContext value={context}>\n <styled.li {...getRootProps()} />\n </StepsItemContext>\n )\n}, \"item\")()\n\nexport interface StepsIndicatorProps extends HTMLStyledProps {\n /**\n * The element for the complete indicator.\n *\n * @default <CheckIcon />\n */\n complete?: ReactNode\n /**\n * The element for the current indicator.\n *\n * @default <StepsNumber />\n */\n current?: ReactNode\n /**\n * The element for the incomplete indicator.\n *\n * @default <StepsNumber />\n */\n incomplete?: ReactNode\n}\n\nexport const StepsIndicator = withContext<\"div\", StepsIndicatorProps>(\n ({\n complete = <CheckIcon />,\n current = <StepsNumber />,\n incomplete = <StepsNumber />,\n ...rest\n }) => {\n const { status, getIndicatorProps } = useStepsItemContext()\n const components = useMemo(\n () => ({ complete, current, incomplete }),\n [complete, current, incomplete],\n )\n\n return (\n <styled.div {...getIndicatorProps(rest)}>{components[status]}</styled.div>\n )\n },\n \"indicator\",\n)()\n\nexport interface StepsNumberProps extends HTMLStyledProps<\"span\"> {}\n\nexport const StepsNumber = withContext<\"span\", StepsNumberProps>(\n \"span\",\n \"number\",\n)(undefined, ({ children, ...rest }) => {\n const { index } = useStepsItemContext()\n\n return { ...rest, children: children ?? index + 1 }\n})\n\nexport interface StepsTitleProps extends HTMLStyledProps {}\n\nexport const StepsTitle = withContext<\"h3\", StepsTitleProps>(\"h3\", \"title\")(\n undefined,\n (props) => {\n const { getTitleProps } = useStepsItemContext()\n\n return getTitleProps(props)\n },\n)\n\nexport interface StepsDescriptionProps extends HTMLStyledProps<\"p\"> {}\n\nexport const StepsDescription = withContext<\"p\", StepsDescriptionProps>(\n \"p\",\n \"description\",\n)(undefined, (props) => {\n const { getDescriptionProps } = useStepsItemContext()\n\n return getDescriptionProps(props)\n})\n\nexport interface StepsSeparatorProps extends HTMLStyledProps {}\n\nexport const StepsSeparator = withContext<\"div\", StepsSeparatorProps>(\n \"div\",\n \"separator\",\n)(undefined, (props) => {\n const { getSeparatorProps } = useStepsItemContext()\n\n return getSeparatorProps(props)\n})\n\nexport interface StepsContentsProps extends PropsWithChildren {}\n\nexport const StepsContents: FC<StepsContentsProps> = ({ children }) => {\n const { items } = useComponentContext()\n\n return useMemo(() => {\n if (children) return children\n else\n return items?.map(({ content, contentProps }, index) =>\n isUndefined(content) || isNull(content) ? null : (\n <StepsContent key={index} index={index} {...contentProps}>\n {content}\n </StepsContent>\n ),\n )\n }, [children, items])\n}\n\nexport interface StepsContentProps extends HTMLStyledProps {\n /**\n * The index of the step content.\n */\n index: number\n}\n\nexport const StepsContent = withContext<\"div\", StepsContentProps>(\n \"div\",\n \"content\",\n)(undefined, ({ index, ...rest }) => {\n const { lazy, lazyBehavior } = useComponentContext()\n const { index: selectedIndex, getContentProps } = useStepsContext()\n const mounted = index === selectedIndex\n const children = useLazyMount({\n lazy,\n lazyBehavior,\n mounted,\n ...rest,\n })\n\n return { ...getContentProps({ index, ...rest }), children }\n})\n\nexport interface StepsCompletedContentProps extends HTMLStyledProps {}\n\nexport const StepsCompletedContent = withContext<\n \"div\",\n StepsCompletedContentProps\n>(\"div\", { name: \"CompletedContent\", slot: [\"content\", \"completed\"] })(\n undefined,\n (props) => {\n const { lazy, lazyBehavior } = useComponentContext()\n const { count, index: selectedIndex, getContentProps } = useStepsContext()\n const mounted = count !== 0 && count === selectedIndex\n const children = useLazyMount({\n lazy,\n lazyBehavior,\n mounted,\n ...props,\n })\n\n return { ...getContentProps(props), children }\n },\n)\n\nexport interface StepsPrevTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const StepsPrevTrigger = withContext<\"button\", StepsPrevTriggerProps>(\n \"button\",\n { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] },\n)((props) => {\n const { getPrevTriggerProps } = useStepsContext()\n\n return { asChild: true, ...getPrevTriggerProps(props) }\n})\n\nexport interface StepsNextTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const StepsNextTrigger = withContext<\"button\", StepsNextTriggerProps>(\n \"button\",\n { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] },\n)((props) => {\n const { getNextTriggerProps } = useStepsContext()\n\n return { asChild: true, ...getNextTriggerProps(props) }\n})\n"],"mappings":";;;;;;;;;;;;;AA0FA,MAAM,EACJ,kBACA,cAAc,mBACd,qBACA,iBAAiB,sBACjB,aACA,iBACE,oBACF,SACA,UACF;;;;;;AASA,MAAa,YAAY,cACtB,EACC,UACA,QAAQ,CAAC,GACT,MACA,cACA,aAAa,iBACb,GAAG,WACC;CACJ,MAAM,sBAAsB,SAAS,eAAe;CAEpD,MAAM,YAAY,aADI,iBAAiB,QACoB,GAAG,SAAS;CACvE,MAAM,EACJ,IACA,OACA,aACA,WACA,OACA,aACA,UACA,iBACA,cACA,qBACA,qBACA,cACA,QACA,WACE,SAAS;EACX,OAAO,MAAM,UAAU,SAAS,MAAM,WAAW,MAAM,QAAQ;EAC/D,aAAa;EACb,GAAG;CACL,CAAC;CACD,MAAM,mBAAmB,eAChB;EAAE;EAAO;EAAM;CAAa,IACnC;EAAC;EAAO;EAAM;CAAY,CAC5B;CAgCA,OACE,oBAAC,yBAAD;EAAyB,OAAO;EAC9B,UAAA,oBAAC,cAAD;GAAc,OAjCG,eACZ;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,IACA;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF,CAKkC;GAC9B,UAAA,oBAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,oBAAC,OAAO,KAAR;KAAY,GAAI,aAAa;KAAI;IAAqB,CAAA;GACtC,CAAA;EACN,CAAA;CACS,CAAA;AAE7B,GACA,QACA,EAAE,eAAe,CAAC,aAAa,EAAE,CACnC,CAAC,CAAC;AAIF,MAAa,YAAY,aACtB,EAAE,UAAU,GAAG,WAAW;CACzB,MAAM,EAAE,UAAU,oBAAoB;CACtC,MAAM,EAAE,iBAAiB,gBAAgB;CACzC,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;OAEnB,OAAO,OAAO,KAEV,EACE,UACA,SAAS,UACT,S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AO,eAAe,oBAAoB,gBAAgB;CAElE,MAAM,WAAW,aAAa;EAC5B;EACA;EACA,SAJc,UAAU;EAKxB,GAAG;CACL,CAAC;CAED,OAAO;EAAE,GAAG,gBAAgB;GAAE;GAAO,GAAG;EAAK,CAAC;EAAG;CAAS;AAC5D,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO;CAAE,MAAM;CAAoB,MAAM,CAAC,WAAW,WAAW;AAAE,CAAC,CAAC,CACpE,KAAA,IACC,UAAU;CACT,MAAM,EAAE,MAAM,iBAAiB,oBAAoB;CACnD,MAAM,EAAE,OAAO,OAAO,eAAe,oBAAoB,gBAAgB;CAEzE,MAAM,WAAW,aAAa;EAC5B;EACA;EACA,SAJc,UAAU,KAAK,UAAU;EAKvC,GAAG;CACL,CAAC;CAED,OAAO;EAAE,GAAG,gBAAgB,KAAK;EAAG;CAAS;AAC/C,CACF;AAIA,MAAa,mBAAmB,YAC9B,UACA;CAAE,MAAM;CAAe,MAAM,CAAC,WAAW,MAAM;AAAE,CACnD,CAAC,EAAE,UAAU;CACX,MAAM,EAAE,wBAAwB,gBAAgB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,oBAAoB,KAAK;CAAE;AACxD,CAAC;AAID,MAAa,mBAAmB,YAC9B,UACA;CAAE,MAAM;CAAe,MAAM,CAAC,WAAW,MAAM;AAAE,CACnD,CAAC,EAAE,UAAU;CACX,MAAM,EAAE,wBAAwB,gBAAgB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,oBAAoB,KAAK;CAAE;AACxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","names":[],"sources":["../../../../src/components/switch/switch.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { SwitchStyle } from \"./switch.style\"\nimport type { UseSwitchProps } from \"./use-switch\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { isObject } from \"../../utils\"\nimport { switchStyle } from \"./switch.style\"\nimport { useSwitch } from \"./use-switch\"\n\nexport interface SwitchProps\n extends\n Merge<HTMLStyledProps<\"label\">, UseSwitchProps>,\n ThemeProps<SwitchStyle> {\n /**\n * The switch icon to use.\n */\n icon?: ReactNode | { off: ReactNode; on: ReactNode }\n /**\n * Props for switch input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for switch label element.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nconst {\n PropsContext: SwitchPropsContext,\n usePropsContext: useSwitchPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SwitchProps, SwitchStyle>(\"switch\", switchStyle)\n\nexport { SwitchPropsContext, useSwitchPropsContext }\n\n/**\n * `Switch` is a component used to toggle between on and off states.\n *\n * @see https://yamada-ui.com/docs/components/switch\n */\nexport const Switch = withProvider<\"input\", SwitchProps>(\n ({ children, icon, inputProps, labelProps, ...props }) => {\n const {\n checked,\n getInputProps,\n getLabelProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSwitch(props)\n\n return (\n <styled.label {...getRootProps()}>\n <styled.input data-peer {...getInputProps(inputProps)} />\n\n <SwitchTrack {...getTrackProps()}>\n <SwitchThumb {...getThumbProps()}>\n {icon && isObject(icon) && \"on\" in icon\n ? checked\n ? icon.on\n : icon.off\n : icon}\n </SwitchThumb>\n </SwitchTrack>\n\n {children ? (\n <SwitchLabel {...getLabelProps(labelProps)}>{children}</SwitchLabel>\n ) : null}\n </styled.label>\n )\n },\n \"root\",\n)()\n\ninterface SwitchThumbProps extends HTMLStyledProps {}\n\nconst SwitchThumb = withContext<\"div\", SwitchThumbProps>(\"div\", \"thumb\")()\n\ninterface SwitchTrackProps extends HTMLStyledProps {}\n\nconst SwitchTrack = withContext<\"div\", SwitchTrackProps>(\"div\", \"track\")()\n\ninterface SwitchLabelProps extends HTMLStyledProps<\"span\"> {}\n\nconst SwitchLabel = withContext<\"span\", SwitchLabelProps>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;AA8BA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,aACA,iBACE,oBAA8C,UAAU,WAAW;;;;;;AASvE,MAAa,SAAS,cACnB,EAAE,UAAU,MAAM,YAAY,YAAY,GAAG,YAAY;CACxD,MAAM,EACJ,SACA,eACA,eACA,cACA,eACA,kBACE,UAAU,KAAK;CAEnB,OACE,qBAAC,OAAO,OAAR;EAAc,GAAI,aAAa;YAA/B;GACE,oBAAC,OAAO,OAAR;IAAc,aAAA;IAAU,GAAI,cAAc,UAAU;GAAI,CAAA;GAExD,oBAAC,aAAD;IAAa,GAAI,cAAc;cAC7B,oBAAC,aAAD;KAAa,GAAI,cAAc;eAC5B,SAAA,GAAA,cAAA,SAAA,CAAiB,IAAI,KAAK,QAAQ,OAC/B,UACE,KAAK,KACL,KAAK,MACP;IACO,CAAA;GACF,CAAA;GAEZ,WACC,oBAAC,aAAD;IAAa,GAAI,cAAc,UAAU;IAAI;GAAsB,CAAA,IACjE;EACQ;;AAElB,GACA,MACF,CAAC,CAAC;AAIF,MAAM,cAAc,YAAqC,OAAO,OAAO,CAAC,CAAC;AAIzE,MAAM,cAAc,YAAqC,OAAO,OAAO,CAAC,CAAC;AAIzE,MAAM,cAAc,YAAsC,QAAQ,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"switch.js","names":[],"sources":["../../../../src/components/switch/switch.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { SwitchStyle } from \"./switch.style\"\nimport type { UseSwitchProps } from \"./use-switch\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { isObject } from \"../../utils\"\nimport { switchStyle } from \"./switch.style\"\nimport { useSwitch } from \"./use-switch\"\n\nexport interface SwitchProps\n extends\n Merge<HTMLStyledProps<\"label\">, UseSwitchProps>,\n ThemeProps<SwitchStyle> {\n /**\n * The switch icon to use.\n */\n icon?: ReactNode | { off: ReactNode; on: ReactNode }\n /**\n * Props for switch input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for switch label element.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nconst {\n PropsContext: SwitchPropsContext,\n usePropsContext: useSwitchPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SwitchProps, SwitchStyle>(\"switch\", switchStyle)\n\nexport { SwitchPropsContext, useSwitchPropsContext }\n\n/**\n * `Switch` is a component used to toggle between on and off states.\n *\n * @see https://yamada-ui.com/docs/components/switch\n */\nexport const Switch = withProvider<\"input\", SwitchProps>(\n ({ children, icon, inputProps, labelProps, ...props }) => {\n const {\n checked,\n getInputProps,\n getLabelProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSwitch(props)\n\n return (\n <styled.label {...getRootProps()}>\n <styled.input data-peer {...getInputProps(inputProps)} />\n\n <SwitchTrack {...getTrackProps()}>\n <SwitchThumb {...getThumbProps()}>\n {icon && isObject(icon) && \"on\" in icon\n ? checked\n ? icon.on\n : icon.off\n : icon}\n </SwitchThumb>\n </SwitchTrack>\n\n {children ? (\n <SwitchLabel {...getLabelProps(labelProps)}>{children}</SwitchLabel>\n ) : null}\n </styled.label>\n )\n },\n \"root\",\n)()\n\ninterface SwitchThumbProps extends HTMLStyledProps {}\n\nconst SwitchThumb = withContext<\"div\", SwitchThumbProps>(\"div\", \"thumb\")()\n\ninterface SwitchTrackProps extends HTMLStyledProps {}\n\nconst SwitchTrack = withContext<\"div\", SwitchTrackProps>(\"div\", \"track\")()\n\ninterface SwitchLabelProps extends HTMLStyledProps<\"span\"> {}\n\nconst SwitchLabel = withContext<\"span\", SwitchLabelProps>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;AA8BA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,aACA,iBACE,oBAA8C,UAAU,WAAW;;;;;;AASvE,MAAa,SAAS,cACnB,EAAE,UAAU,MAAM,YAAY,YAAY,GAAG,YAAY;CACxD,MAAM,EACJ,SACA,eACA,eACA,cACA,eACA,kBACE,UAAU,KAAK;CAEnB,OACE,qBAAC,OAAO,OAAR;EAAc,GAAI,aAAa;EAA/B,UAAA;GACE,oBAAC,OAAO,OAAR;IAAc,aAAA;IAAU,GAAI,cAAc,UAAU;GAAI,CAAA;GAExD,oBAAC,aAAD;IAAa,GAAI,cAAc;IAC7B,UAAA,oBAAC,aAAD;KAAa,GAAI,cAAc;KAC5B,UAAA,SAAA,GAAA,cAAA,SAAA,CAAiB,IAAI,KAAK,QAAQ,OAC/B,UACE,KAAK,KACL,KAAK,MACP;IACO,CAAA;GACF,CAAA;GAEZ,WACC,oBAAC,aAAD;IAAa,GAAI,cAAc,UAAU;IAAI;GAAsB,CAAA,IACjE;EACQ;;AAElB,GACA,MACF,CAAC,CAAC;AAIF,MAAM,cAAc,YAAqC,OAAO,OAAO,CAAC,CAAC;AAIzE,MAAM,cAAc,YAAqC,OAAO,OAAO,CAAC,CAAC;AAIzE,MAAM,cAAc,YAAsC,QAAQ,OAAO,CAAC,CAAC"}