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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
  2. package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
  3. package/dist/cjs/components/airy/airy.cjs.map +1 -1
  4. package/dist/cjs/components/alert/alert.cjs.map +1 -1
  5. package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
  6. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  7. package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
  8. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  9. package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
  10. package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
  11. package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
  12. package/dist/cjs/components/button/button-group.cjs.map +1 -1
  13. package/dist/cjs/components/button/button.cjs.map +1 -1
  14. package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
  15. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
  17. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  18. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  19. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  21. package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
  22. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
  24. package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
  25. package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
  26. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  27. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  28. package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
  29. package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
  30. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  31. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  32. package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
  33. package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
  34. package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
  35. package/dist/cjs/components/editable/editable.cjs.map +1 -1
  36. package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
  37. package/dist/cjs/components/fade/fade.cjs.map +1 -1
  38. package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
  39. package/dist/cjs/components/field/field.cjs.map +1 -1
  40. package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
  41. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  42. package/dist/cjs/components/flip/flip.cjs.map +1 -1
  43. package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
  44. package/dist/cjs/components/form/form.cjs.map +1 -1
  45. package/dist/cjs/components/format/format-byte.cjs.map +1 -1
  46. package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
  47. package/dist/cjs/components/format/format-number.cjs.map +1 -1
  48. package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
  49. package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
  50. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
  51. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
  52. package/dist/cjs/components/icon/icons/index.cjs +9 -3
  53. package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
  54. package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
  55. package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
  56. package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
  57. package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
  58. package/dist/cjs/components/icon/index.cjs +6 -2
  59. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  60. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
  61. package/dist/cjs/components/input/input-group.cjs.map +1 -1
  62. package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
  63. package/dist/cjs/components/list/list.cjs.map +1 -1
  64. package/dist/cjs/components/loading/audio.cjs.map +1 -1
  65. package/dist/cjs/components/loading/background.cjs.map +1 -1
  66. package/dist/cjs/components/loading/circles.cjs.map +1 -1
  67. package/dist/cjs/components/loading/dots.cjs.map +1 -1
  68. package/dist/cjs/components/loading/grid.cjs.map +1 -1
  69. package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
  70. package/dist/cjs/components/loading/oval.cjs.map +1 -1
  71. package/dist/cjs/components/loading/page.cjs.map +1 -1
  72. package/dist/cjs/components/loading/puff.cjs.map +1 -1
  73. package/dist/cjs/components/loading/rings.cjs.map +1 -1
  74. package/dist/cjs/components/loading/screen.cjs.map +1 -1
  75. package/dist/cjs/components/loading/suspense.cjs.map +1 -1
  76. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  77. package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
  78. package/dist/cjs/components/modal/modal.cjs.map +1 -1
  79. package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
  80. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  81. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  82. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  83. package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
  84. package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
  85. package/dist/cjs/components/notice/notice.cjs.map +1 -1
  86. package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
  87. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  88. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  89. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  90. package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
  91. package/dist/cjs/components/picture/picture.cjs.map +1 -1
  92. package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
  93. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  94. package/dist/cjs/components/progress/progress.cjs.map +1 -1
  95. package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
  96. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  97. package/dist/cjs/components/radio/radio.cjs.map +1 -1
  98. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  99. package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
  100. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  101. package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
  102. package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
  103. package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
  104. package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
  105. package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
  106. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
  107. package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
  108. package/dist/cjs/components/select/select.cjs.map +1 -1
  109. package/dist/cjs/components/select/use-select.cjs.map +1 -1
  110. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  111. package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
  112. package/dist/cjs/components/slide/slide.cjs.map +1 -1
  113. package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
  114. package/dist/cjs/components/slider/slider.cjs.map +1 -1
  115. package/dist/cjs/components/slot/slot.cjs.map +1 -1
  116. package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
  117. package/dist/cjs/components/stack/stack.cjs.map +1 -1
  118. package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
  119. package/dist/cjs/components/stat/stat.cjs.map +1 -1
  120. package/dist/cjs/components/status/status.cjs.map +1 -1
  121. package/dist/cjs/components/steps/steps.cjs.map +1 -1
  122. package/dist/cjs/components/switch/switch.cjs.map +1 -1
  123. package/dist/cjs/components/table/table.cjs.map +1 -1
  124. package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
  125. package/dist/cjs/components/tag/tag.cjs.map +1 -1
  126. package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
  127. package/dist/cjs/components/tip/tip.cjs.map +1 -1
  128. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  129. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  130. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  131. package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
  132. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  133. package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
  134. package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
  135. package/dist/cjs/core/system/styled.cjs.map +1 -1
  136. package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
  137. package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
  138. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
  139. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  140. package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
  141. package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
  142. package/dist/cjs/index.cjs +9 -3
  143. package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
  144. package/dist/cjs/utils/store.cjs.map +1 -1
  145. package/dist/esm/components/accordion/accordion.js.map +1 -1
  146. package/dist/esm/components/action-bar/action-bar.js.map +1 -1
  147. package/dist/esm/components/airy/airy.js.map +1 -1
  148. package/dist/esm/components/alert/alert.js.map +1 -1
  149. package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
  150. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  151. package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
  152. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  153. package/dist/esm/components/avatar/avatar.js.map +1 -1
  154. package/dist/esm/components/blockquote/blockquote.js.map +1 -1
  155. package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
  156. package/dist/esm/components/button/button-group.js.map +1 -1
  157. package/dist/esm/components/button/button.js.map +1 -1
  158. package/dist/esm/components/calendar/calendar.js.map +1 -1
  159. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  160. package/dist/esm/components/carousel/carousel.js.map +1 -1
  161. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  162. package/dist/esm/components/chart/chart.js.map +1 -1
  163. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  164. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  165. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  166. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  167. package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
  168. package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
  169. package/dist/esm/components/collapse/collapse.js.map +1 -1
  170. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  171. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  172. package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
  173. package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
  174. package/dist/esm/components/data-list/data-list.js.map +1 -1
  175. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  176. package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
  177. package/dist/esm/components/drawer/drawer.js.map +1 -1
  178. package/dist/esm/components/dropzone/dropzone.js.map +1 -1
  179. package/dist/esm/components/editable/editable.js.map +1 -1
  180. package/dist/esm/components/empty-state/empty-state.js.map +1 -1
  181. package/dist/esm/components/fade/fade.js.map +1 -1
  182. package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
  183. package/dist/esm/components/field/field.js.map +1 -1
  184. package/dist/esm/components/fieldset/fieldset.js.map +1 -1
  185. package/dist/esm/components/file-input/file-input.js.map +1 -1
  186. package/dist/esm/components/flip/flip.js.map +1 -1
  187. package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
  188. package/dist/esm/components/form/form.js.map +1 -1
  189. package/dist/esm/components/format/format-byte.js.map +1 -1
  190. package/dist/esm/components/format/format-date-time.js.map +1 -1
  191. package/dist/esm/components/format/format-number.js.map +1 -1
  192. package/dist/esm/components/highlight/highlight.js.map +1 -1
  193. package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
  194. package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
  195. package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
  196. package/dist/esm/components/icon/icons/index.js +7 -3
  197. package/dist/esm/components/icon/icons/index.js.map +1 -1
  198. package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
  199. package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
  200. package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
  201. package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
  202. package/dist/esm/components/icon/index.js +4 -2
  203. package/dist/esm/components/indicator/indicator.js.map +1 -1
  204. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
  205. package/dist/esm/components/input/input-group.js.map +1 -1
  206. package/dist/esm/components/link-box/link-box.js.map +1 -1
  207. package/dist/esm/components/list/list.js.map +1 -1
  208. package/dist/esm/components/loading/audio.js.map +1 -1
  209. package/dist/esm/components/loading/background.js.map +1 -1
  210. package/dist/esm/components/loading/circles.js.map +1 -1
  211. package/dist/esm/components/loading/dots.js.map +1 -1
  212. package/dist/esm/components/loading/grid.js.map +1 -1
  213. package/dist/esm/components/loading/loading-provider.js.map +1 -1
  214. package/dist/esm/components/loading/oval.js.map +1 -1
  215. package/dist/esm/components/loading/page.js.map +1 -1
  216. package/dist/esm/components/loading/puff.js.map +1 -1
  217. package/dist/esm/components/loading/rings.js.map +1 -1
  218. package/dist/esm/components/loading/screen.js.map +1 -1
  219. package/dist/esm/components/loading/suspense.js.map +1 -1
  220. package/dist/esm/components/menu/menu.js.map +1 -1
  221. package/dist/esm/components/menu/use-menu.js.map +1 -1
  222. package/dist/esm/components/modal/modal.js.map +1 -1
  223. package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
  224. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  225. package/dist/esm/components/native-select/native-select.js.map +1 -1
  226. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  227. package/dist/esm/components/native-table/native-table.js.map +1 -1
  228. package/dist/esm/components/notice/notice-provider.js.map +1 -1
  229. package/dist/esm/components/notice/notice.js.map +1 -1
  230. package/dist/esm/components/notice/use-notice.js.map +1 -1
  231. package/dist/esm/components/number-input/number-input.js.map +1 -1
  232. package/dist/esm/components/pagination/pagination.js.map +1 -1
  233. package/dist/esm/components/password-input/password-input.js.map +1 -1
  234. package/dist/esm/components/password-input/strength-meter.js.map +1 -1
  235. package/dist/esm/components/picture/picture.js.map +1 -1
  236. package/dist/esm/components/pin-input/pin-input.js.map +1 -1
  237. package/dist/esm/components/popover/popover.js.map +1 -1
  238. package/dist/esm/components/progress/progress.js.map +1 -1
  239. package/dist/esm/components/qr-code/qr-code.js.map +1 -1
  240. package/dist/esm/components/radio/radio-group.js.map +1 -1
  241. package/dist/esm/components/radio/radio.js.map +1 -1
  242. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  243. package/dist/esm/components/radio-card/radio-card.js.map +1 -1
  244. package/dist/esm/components/rating/rating.js.map +1 -1
  245. package/dist/esm/components/reorder/reorder.js.map +1 -1
  246. package/dist/esm/components/resizable/resizable.js.map +1 -1
  247. package/dist/esm/components/ripple/ripple.js.map +1 -1
  248. package/dist/esm/components/rotate/rotate.js.map +1 -1
  249. package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
  250. package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
  251. package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
  252. package/dist/esm/components/select/select.js.map +1 -1
  253. package/dist/esm/components/select/use-select.js.map +1 -1
  254. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  255. package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
  256. package/dist/esm/components/slide/slide.js.map +1 -1
  257. package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
  258. package/dist/esm/components/slider/slider.js.map +1 -1
  259. package/dist/esm/components/slot/slot.js.map +1 -1
  260. package/dist/esm/components/snacks/snacks.js.map +1 -1
  261. package/dist/esm/components/stack/stack.js.map +1 -1
  262. package/dist/esm/components/stack/z-stack.js.map +1 -1
  263. package/dist/esm/components/stat/stat.js.map +1 -1
  264. package/dist/esm/components/status/status.js.map +1 -1
  265. package/dist/esm/components/steps/steps.js.map +1 -1
  266. package/dist/esm/components/switch/switch.js.map +1 -1
  267. package/dist/esm/components/table/table.js.map +1 -1
  268. package/dist/esm/components/tabs/tabs.js.map +1 -1
  269. package/dist/esm/components/tag/tag.js.map +1 -1
  270. package/dist/esm/components/timeline/timeline.js.map +1 -1
  271. package/dist/esm/components/tip/tip.js.map +1 -1
  272. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  273. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  274. package/dist/esm/components/tree/tree.js.map +1 -1
  275. package/dist/esm/components/tree/use-tree.js.map +1 -1
  276. package/dist/esm/core/components/create-component.js.map +1 -1
  277. package/dist/esm/core/system/breakpoint.js.map +1 -1
  278. package/dist/esm/core/system/environment-provider.js.map +1 -1
  279. package/dist/esm/core/system/styled.js.map +1 -1
  280. package/dist/esm/core/system/theme-provider.js.map +1 -1
  281. package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
  282. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  283. package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
  284. package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
  285. package/dist/esm/index.js +7 -3
  286. package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
  287. package/dist/esm/utils/store.js.map +1 -1
  288. package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
  289. package/dist/types/components/icon/icons/index.d.ts +5 -3
  290. package/dist/types/components/icon/icons/index.types.d.ts +1 -1
  291. package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
  292. package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
  293. package/dist/types/components/icon/index.d.ts +4 -2
  294. package/dist/types/components/menu/use-menu.d.ts +1 -1
  295. package/dist/types/components/number-input/number-input.style.d.ts +1 -1
  296. package/dist/types/index.d.ts +5 -3
  297. package/package.json +5 -5
  298. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
  299. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
  300. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
  301. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
  302. package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.cjs","names":["createContext","createSlotComponent","sidebarStyle","useBreakpointValue","useValue","useSidebar","SidebarDescendantsContext","SidebarContext","styled","useSidebarContext","useSplitChildren","mergeProps","useSidebarGroup","useIncludesChildren","useValidChildren","useLoadingComponent","useSidebarItem","SidebarItemContext","Tooltip","Collapse","ChevronRightIcon","Children"],"sources":["../../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n Breakpoint,\n ExtractStyleValue,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { Loading } from \"../loading\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type {\n UseSidebarGroupProps,\n UseSidebarGroupReturn,\n UseSidebarItemProps,\n UseSidebarItemReturn,\n UseSidebarProps,\n UseSidebarReturn,\n} from \"./use-sidebar\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n} from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useBreakpointValue } from \"../../hooks/use-breakpoint\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n cast,\n createContext,\n dataAttr,\n isObject,\n isString,\n runIfFn,\n useIncludesChildren,\n useSplitChildren,\n useValidChildren,\n} from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { Drawer } from \"../drawer\"\nimport { ChevronRightIcon } from \"../icon\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Tooltip, type TooltipProps } from \"../tooltip\"\nimport { sidebarStyle, type SidebarStyle } from \"./sidebar.style\"\nimport {\n SidebarContext,\n SidebarDescendantsContext,\n SidebarItemContext,\n useSidebar,\n useSidebarContext,\n useSidebarGroup,\n useSidebarItem,\n} from \"./use-sidebar\"\n\ninterface SidebarItemCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\ntype SidebarItemReactNode =\n | ReactNodeOrFunction<SidebarItemCallBackProps>\n | {\n group: ReactNodeOrFunction<SidebarItemCallBackProps>\n item?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n | {\n item: ReactNodeOrFunction<SidebarItemCallBackProps>\n group?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n\ninterface SidebarItemSharedRenderProps\n extends\n Pick<SidebarItemProps, \"label\">,\n Pick<\n UseSidebarItemReturn,\n | \"expanded\"\n | \"expandedValue\"\n | \"onExpandedChange\"\n | \"onSelectedChange\"\n | \"selected\"\n | \"selectedValue\"\n | \"value\"\n > {\n itemProps: HTMLStyledProps<\"li\">\n linkProps: HTMLStyledProps<\"a\">\n triggerProps: HTMLStyledProps<\"button\">\n endElement?: ReactNode\n startElement?: ReactNode\n}\n\ninterface SidebarItemRenderProps\n extends\n PropsWithChildren,\n Omit<SidebarItemSharedRenderProps, \"endElement\" | \"startElement\">,\n Pick<\n UseSidebarItemReturn,\n | \"group\"\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n endElement: { group?: ReactNode; item?: ReactNode }\n startElement: { group?: ReactNode; item?: ReactNode }\n indicator?: ReactNode\n link?: ReactNode\n trigger?: ReactNode\n}\n\ninterface SidebarItemLinkRenderProps extends Omit<\n SidebarItemSharedRenderProps,\n \"itemProps\" | \"triggerProps\"\n> {}\n\ninterface SidebarItemTriggerRenderProps\n extends\n Omit<SidebarItemSharedRenderProps, \"itemProps\" | \"linkProps\">,\n Pick<\n UseSidebarItemReturn,\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n indicator?: ReactNode\n}\n\ninterface SidebarItemRender {\n item?: ReactNodeOrFunction<SidebarItemRenderProps>\n link?: ReactNodeOrFunction<SidebarItemLinkRenderProps>\n trigger?: ReactNodeOrFunction<SidebarItemTriggerRenderProps>\n}\n\ninterface SidebarGroup extends Omit<SidebarGroupProps, \"children\" | \"value\"> {\n children: SidebarItemWithValue[]\n group: true\n}\n\nexport interface SidebarItemWithValue extends Omit<\n SidebarItemProps,\n \"children\"\n> {\n children?: SidebarItemWithValue[]\n}\n\nexport type SidebarItem = SidebarGroup | SidebarItemWithValue\n\nconst createKey = (props: SidebarItem, index: number) => {\n return \"value\" in props ? props.value || index : index\n}\n\nconst getReactNodeOrFunction = (\n type: \"group\" | \"item\",\n custom?: SidebarItemReactNode,\n root?: SidebarItemReactNode,\n): ReactNodeOrFunction<SidebarItemCallBackProps> => {\n if (isObject(custom) && (\"group\" in custom || \"item\" in custom))\n return custom[type]\n else if (custom) return custom\n else if (isObject(root) && (\"group\" in root || \"item\" in root))\n return root[type]\n else return root\n}\n\ninterface ComponentContext extends Pick<\n UseSidebarReturn,\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getSidePanelProps\"\n | \"getTriggerProps\"\n> {\n breakpoint: ExtractStyleValue<NonNullable<SidebarRootProps[\"breakpoint\"]>>\n mode: ExtractStyleValue<NonNullable<SidebarRootProps[\"mode\"]>>\n placement: ExtractStyleValue<NonNullable<SidebarRootProps[\"placement\"]>>\n}\n\ninterface GroupComponentContext\n extends\n Pick<SidebarGroupProps, \"contentProps\" | \"labelProps\">,\n Pick<UseSidebarGroupReturn, \"getContentProps\" | \"getLabelProps\"> {}\n\nconst [GroupComponentContext, useGroupComponentContext] =\n createContext<GroupComponentContext>({ name: \"GroupComponentContext\" })\n\ninterface ItemComponentContext {\n contentProps: SidebarItemContentProps\n endElementProps: SidebarItemEndElementProps\n indicatorProps: SidebarItemIndicatorProps\n labelProps: SidebarItemLabelProps\n startElementProps: SidebarItemStartElementProps\n tooltipProps: SidebarItemTooltipProps\n}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({ name: \"ItemComponentContext\" })\n\ninterface SidePanelComponentContext extends Pick<\n SidebarSidePanelProps,\n | \"animated\"\n | \"contentProps\"\n | \"endElement\"\n | \"endElementProps\"\n | \"footerProps\"\n | \"groupContentProps\"\n | \"groupProps\"\n | \"handleProps\"\n | \"headerProps\"\n | \"indicator\"\n | \"indicatorHidden\"\n | \"indicatorProps\"\n | \"itemContentProps\"\n | \"itemProps\"\n | \"items\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"menuProps\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n> {}\n\nconst [SidePanelComponentContext, useSidePanelComponentContext] =\n createContext<SidePanelComponentContext>({\n name: \"SidePanelComponentContext\",\n })\n\nexport interface SidebarRootProps\n extends\n HTMLStyledProps<\"div\">,\n ThemeProps<SidebarStyle>,\n Omit<UseSidebarProps, \"mobile\"> {\n /**\n * The breakpoint to use for the sidebar. If `false`, the sidebar will be always visible.\n *\n * @default 'md'\n */\n breakpoint?: Exclude<Breakpoint, \"base\"> | false\n}\n\nconst {\n ComponentContext,\n PropsContext: SidebarPropsContext,\n useComponentContext,\n usePropsContext: useSidebarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SidebarRootProps, SidebarStyle, ComponentContext>(\n \"sidebar\",\n sidebarStyle,\n)\n\nexport { SidebarPropsContext, useSidebarPropsContext }\n\n/**\n * `Sidebar` is a component that is used to display a list of items in a sidebar.\n *\n * @see https://yamada-ui.com/docs/components/sidebar\n */\nexport const SidebarRoot = withProvider<\n \"div\",\n SidebarRootProps,\n \"mode\" | \"placement\"\n>(\n ({\n breakpoint = \"md\",\n mode: modeProp = \"offcanvas\",\n placement: placementProp = \"start\",\n ...rest\n }) => {\n const mobile =\n useBreakpointValue<boolean | undefined>(\n breakpoint ? { [breakpoint]: true } : { base: false },\n ) ?? false\n const mode = useValue(modeProp)\n const placement = useValue(placementProp)\n const {\n descendants,\n expandedValue,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n } = useSidebar({ mobile, ...rest })\n const context = useMemo(\n () => ({\n expandedValue,\n mobile,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }),\n [\n mobile,\n expandedValue,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n ],\n )\n const componentContext = useMemo(\n () => ({\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n }),\n [\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n ],\n )\n\n return (\n <SidebarDescendantsContext value={descendants}>\n <SidebarContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div data-group {...getRootProps()} />\n </ComponentContext>\n </SidebarContext>\n </SidebarDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"mode\", \"placement\"] },\n)()\n\nexport interface SidebarMainPanelProps extends HTMLStyledProps {}\n\nexport const SidebarMainPanel = withContext<\"div\", SidebarMainPanelProps>(\n \"div\",\n \"mainPanel\",\n)()\n\nexport interface SidebarTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarTrigger = withContext<\"button\", SidebarTriggerProps>(\n \"button\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getTriggerProps(props) }\n})\n\nexport interface SidebarSidePanelProps\n extends\n Omit<HTMLStyledProps<\"aside\">, \"content\">,\n Pick<SidebarContentProps, \"items\">,\n Pick<\n SidebarItemProps,\n | \"animated\"\n | \"endElement\"\n | \"endElementProps\"\n | \"indicator\"\n | \"indicatorProps\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n > {\n /**\n * The content of the sidebar.\n */\n content?: ReactNode\n /**\n * The footer of the sidebar.\n */\n footer?: ReactNode\n /**\n * The header of the sidebar.\n */\n header?: ReactNode\n /**\n * If `true`, hide the tree indicator icon for all items.\n *\n * @default false\n */\n indicatorHidden?: boolean\n /**\n * If `true`, the sidebar will be rendered with a handle.\n *\n * @default true\n */\n withHandle?: boolean\n /**\n * Props for the content component.\n */\n contentProps?: SidebarContentProps\n /**\n * Props for the drawer component.\n */\n drawerProps?: Omit<\n Drawer.RootProps,\n | \"body\"\n | \"cancel\"\n | \"children\"\n | \"footer\"\n | \"header\"\n | \"middle\"\n | \"onCancel\"\n | \"onClose\"\n | \"onMiddle\"\n | \"onOpen\"\n | \"onSuccess\"\n | \"open\"\n | \"success\"\n | \"title\"\n | \"trigger\"\n >\n /**\n * Props for the footer component.\n */\n footerProps?: SidebarFooterProps\n /**\n * Props for the group content component.\n */\n groupContentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the group component.\n */\n groupProps?: Omit<SidebarGroupProps, \"children\" | \"label\" | \"value\">\n /**\n * Props for the handle component.\n */\n handleProps?: SidebarHandleProps\n /**\n * Props for the header component.\n */\n headerProps?: SidebarHeaderProps\n /**\n * Props for the item content component.\n */\n itemContentProps?: SidebarItemContentProps\n /**\n * Props for the item component.\n */\n itemProps?: Omit<\n SidebarItemProps,\n \"children\" | \"items\" | \"label\" | \"open\" | \"value\"\n >\n /**\n * Props for the menu component.\n *\n * @default 'md'\n */\n menuProps?: SidebarMenuProps\n}\n\nexport const SidebarSidePanel = withContext<\"aside\", SidebarSidePanelProps>(\n ({\n animated = true,\n children,\n content,\n endElement,\n footer,\n header,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n withHandle = true,\n contentProps,\n drawerProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mobile, open, onClose } = useSidebarContext()\n const { breakpoint, placement, getSidePanelProps } = useComponentContext()\n const [\n omittedChildren,\n customHeader,\n customContent,\n customFooter,\n customHandle,\n ] = useSplitChildren(\n children,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarHandle,\n )\n const context = useMemo(\n () => ({\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n }),\n [\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n render,\n loadingScheme,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ],\n )\n\n return (\n <SidePanelComponentContext value={context}>\n {mobile ? (\n <Drawer.Root\n size=\"sm\"\n autoFocus={false}\n duration={!animated ? 0 : undefined}\n open={open}\n placement={`inline-${placement}`}\n withCloseButton={false}\n portalProps={{ disabled: true }}\n onClose={onClose}\n {...drawerProps}\n >\n <Drawer.Content>\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n </Drawer.Content>\n </Drawer.Root>\n ) : (\n <>\n <SidebarGap\n data-animated={dataAttr(animated)}\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n />\n\n <styled.aside\n data-animated={dataAttr(animated)}\n data-group\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n {...getSidePanelProps(rest)}\n >\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n {customHandle ?? (withHandle ? <SidebarHandle /> : null)}\n\n {omittedChildren}\n </styled.aside>\n </>\n )}\n </SidePanelComponentContext>\n )\n },\n \"sidePanel\",\n)()\n\ninterface SidebarGapProps extends HTMLStyledProps<\"div\"> {}\n\nconst SidebarGap = withContext<\"div\", SidebarGapProps>(\"div\", \"gap\")()\n\nexport interface SidebarHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const SidebarHeader = withContext<\"header\", SidebarHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n const { headerProps } = useSidePanelComponentContext()\n\n return getHeaderProps(mergeProps(headerProps, props)())\n})\n\nexport interface SidebarFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const SidebarFooter = withContext<\"footer\", SidebarFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n const { footerProps } = useSidePanelComponentContext()\n\n return getFooterProps(mergeProps(footerProps, props)())\n})\n\nexport interface SidebarContentProps extends HTMLStyledProps<\"ul\"> {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItem[]\n}\n\nexport const SidebarContent = withContext<\"ul\", SidebarContentProps>(\n ({ children, items, ...rest }) => {\n const { getContentProps } = useComponentContext()\n const { items: rootItems, contentProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (items ?? rootItems)?.map((props, index) => {\n const key = createKey(props, index)\n\n if (\"group\" in props) {\n const { children, group: _, ...rest } = props\n\n return <SidebarGroup key={key} items={children} {...rest} />\n } else {\n const { children, ...rest } = props\n\n return <SidebarItem key={key} items={children} {...rest} />\n }\n })\n }, [children, items, rootItems])\n\n return (\n <styled.ul {...getContentProps(mergeProps(contentProps, rest)())}>\n {computedChildren}\n </styled.ul>\n )\n },\n \"content\",\n)()\n\nexport interface SidebarHandleProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarHandle = withContext<\"button\", SidebarHandleProps>(\n (props) => {\n const { handleProps } = useSidePanelComponentContext()\n\n return (\n <SidebarTrigger {...mergeProps(handleProps, props)()}>\n <styled.button tabIndex={-1} />\n </SidebarTrigger>\n )\n },\n \"handle\",\n)()\n\nexport interface SidebarGroupProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"content\" | \"value\">,\n UseSidebarGroupProps {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the label component.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nexport const SidebarGroup = withContext<\"li\", SidebarGroupProps>(\n ({\n children,\n items,\n label,\n value: valueProp = isString(label) ? label : undefined,\n contentProps,\n labelProps,\n ...rest\n }) => {\n const { groupProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [children, items])\n const [omittedChildren, customLabel, customContent] = useSplitChildren(\n computedChildren,\n SidebarGroupLabel,\n SidebarGroupContent,\n )\n const { getContentProps, getLabelProps, getRootProps } = useSidebarGroup({\n ...mergeProps(groupProps, rest)(),\n value: valueProp,\n })\n const context = useMemo(\n () => ({ contentProps, getContentProps, getLabelProps, labelProps }),\n [getLabelProps, labelProps, getContentProps, contentProps],\n )\n\n return (\n <GroupComponentContext value={context}>\n <styled.li {...getRootProps()}>\n {customLabel ??\n (label ? <SidebarGroupLabel>{label}</SidebarGroupLabel> : null)}\n {customContent ?? (\n <SidebarGroupContent>{omittedChildren}</SidebarGroupContent>\n )}\n </styled.li>\n </GroupComponentContext>\n )\n },\n \"group\",\n)()\n\nexport interface SidebarGroupLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarGroupLabel = withContext<\"span\", SidebarGroupLabelProps>(\n \"span\",\n \"groupLabel\",\n)(undefined, (props) => {\n const { getLabelProps, labelProps } = useGroupComponentContext()\n\n return getLabelProps(mergeProps(labelProps, props)())\n})\n\nexport interface SidebarGroupContentProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarGroupContent = withContext<\"div\", SidebarGroupContentProps>(\n \"div\",\n \"groupContent\",\n)(undefined, ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const list = useIncludesChildren(validChildren, SidebarItem)\n const { groupContentProps } = useSidePanelComponentContext()\n const { contentProps, getContentProps } = useGroupComponentContext()\n\n return {\n as: list ? \"ul\" : \"div\",\n children,\n ...getContentProps(mergeProps(groupContentProps, contentProps, rest)()),\n }\n})\n\nexport interface SidebarMenuProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarMenu = withContext<\"div\", SidebarMenuProps>(\"div\", \"menu\")(\n undefined,\n (props) => {\n const { menuProps } = useSidePanelComponentContext()\n\n return { \"data-menu\": \"\", ...mergeProps(menuProps, props)() }\n },\n)\n\nexport interface SidebarMenuButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarMenuButton = withContext<\"button\", SidebarMenuButtonProps>(\n \"button\",\n [\"menu\", \"button\"],\n)(undefined, (props) => {\n const { open } = useSidebarContext()\n const { mode } = useComponentContext()\n const { menuProps } = useSidePanelComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const { disabled, ...rest } = mergeProps(menuProps, props)()\n\n return {\n \"data-menu\": \"\",\n disabled,\n ...rest,\n tabIndex: (!offcanvas || open) && !disabled ? 0 : -1,\n }\n})\n\nexport interface SidebarItemProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"value\">,\n Omit<UseSidebarItemProps, \"asyncChildren\"> {\n /**\n * The label to display in the item.\n */\n label: ReactNode\n /**\n * If `true`, the sidebar item will be animated.\n *\n * @default true\n */\n animated?: boolean\n /**\n * The element to display at the end of the item.\n */\n endElement?: SidebarItemReactNode\n /**\n * The sidebar item indicator icon to use.\n */\n indicator?: ReactNodeOrFunction<SidebarItemCallBackProps>\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n /**\n * If provided, the sidebar item will be rendered with custom components.\n */\n render?: SidebarItemRender\n /**\n * The element to display at the start of the item.\n */\n startElement?: SidebarItemReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarItemContentProps, \"children\">\n /**\n * Props for the end component.\n */\n endElementProps?: SidebarItemEndElementProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SidebarItemIndicatorProps\n /**\n * Props for the label component.\n */\n labelProps?: SidebarItemLabelProps\n /**\n * Props for the link component.\n */\n linkProps?: SidebarItemLinkProps\n /**\n * Props for the start component.\n */\n startElementProps?: SidebarItemStartElementProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: Omit<SidebarItemTooltipProps, \"children\" | \"content\">\n /**\n * Props for the trigger component.\n */\n triggerProps?: SidebarItemTriggerProps\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<SidebarItemWithValue[]>\n}\n\nexport const SidebarItem = withContext<\"li\", SidebarItemProps>(\n ({\n animated: animatedProp,\n asyncChildren: asyncChildrenProp,\n children: childrenProp,\n endElement,\n indicator: indicatorProp,\n items,\n label,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n indicatorProps,\n labelProps,\n linkProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mode } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const componentContext = useSidePanelComponentContext()\n const Loading = useLoadingComponent(\n loadingScheme ?? componentContext.loadingScheme ?? \"oval\",\n )\n const computedChildren = useMemo(() => {\n if (childrenProp) return childrenProp\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [childrenProp, items])\n const asyncChildren = useCallback(async () => {\n const items = await asyncChildrenProp?.()\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [asyncChildrenProp])\n const {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n } = useSidebarItem({\n ...mergeProps(componentContext.itemProps, rest)(),\n asyncChildren: asyncChildrenProp ? asyncChildren : undefined,\n children: computedChildren,\n })\n const animated = animatedProp ?? componentContext.animated ?? true\n const tabIndex = offcanvas\n ? open && expanded && !disabled\n ? 0\n : -1\n : expanded && !disabled\n ? 0\n : -1\n const callbackProps = useMemo(\n () => ({ disabled, expanded: groupOpen }),\n [disabled, groupOpen],\n )\n const mergedTriggerProps = useMemo(() => {\n return getTriggerProps({\n tabIndex,\n ...mergeProps(componentContext.triggerProps, triggerProps)(),\n }) as SidebarItemTriggerProps\n }, [getTriggerProps, tabIndex, componentContext.triggerProps, triggerProps])\n const mergedLinkProps = useMemo(() => {\n return getLinkProps({\n tabIndex,\n ...mergeProps(componentContext.linkProps, linkProps)(),\n }) as SidebarItemLinkProps\n }, [getLinkProps, tabIndex, componentContext.linkProps, linkProps])\n const indicator = useMemo<ReactNode>(\n () => runIfFn(indicatorProp ?? componentContext.indicator, callbackProps),\n [indicatorProp, componentContext.indicator, callbackProps],\n )\n const groupStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const groupEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const itemStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const itemEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const trigger = useMemo<ReactNode>(\n () =>\n runIfFn(render?.trigger ?? componentContext.render?.trigger, {\n endElement: groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n startElement: groupStartElement,\n value,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.trigger,\n componentContext.render?.trigger,\n groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n groupStartElement,\n value,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const link = useMemo<ReactNode>(\n () =>\n runIfFn(render?.link ?? componentContext.render?.link, {\n endElement: itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n startElement: itemStartElement,\n value,\n linkProps: mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n }),\n [\n render?.link,\n componentContext.render?.link,\n itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n itemStartElement,\n value,\n mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n ],\n )\n const item = useMemo<ReactNode>(\n () =>\n runIfFn(render?.item ?? componentContext.render?.item, {\n children,\n endElement: { group: groupEndElement, item: itemEndElement },\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n startElement: { group: groupStartElement, item: itemStartElement },\n trigger,\n value,\n itemProps: getItemProps() as HTMLStyledProps<\"li\">,\n linkProps: mergedLinkProps,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.item,\n componentContext.render?.item,\n children,\n groupEndElement,\n itemEndElement,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n groupStartElement,\n itemStartElement,\n trigger,\n value,\n getItemProps,\n mergedLinkProps,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const context = useMemo(\n () => ({ branchOpen, groupOpen }),\n [branchOpen, groupOpen],\n )\n const itemComponentContext = useMemo(\n () => ({\n contentProps: {\n duration: !animated ? 0 : undefined,\n open: groupOpen,\n ...getContentProps(\n mergeProps(componentContext.itemContentProps, contentProps)(),\n ),\n },\n endElementProps: mergeProps(\n componentContext.endElementProps,\n endElementProps,\n )(),\n indicatorProps: getIndicatorProps({\n \"data-animated\": dataAttr(animated),\n ...mergeProps(componentContext.indicatorProps, indicatorProps)(),\n }) as SidebarItemIndicatorProps,\n labelProps: getLabelProps(\n mergeProps(componentContext.labelProps, labelProps)(),\n ) as SidebarItemLabelProps,\n startElementProps: mergeProps(\n componentContext.startElementProps,\n startElementProps,\n )(),\n tooltipProps: {\n content: label,\n disabled: open,\n ...mergeProps(componentContext.tooltipProps, tooltipProps)(),\n },\n }),\n [\n animated,\n componentContext.endElementProps,\n componentContext.indicatorProps,\n componentContext.itemContentProps,\n componentContext.labelProps,\n componentContext.startElementProps,\n componentContext.tooltipProps,\n contentProps,\n endElementProps,\n getContentProps,\n getIndicatorProps,\n getLabelProps,\n groupOpen,\n indicatorProps,\n label,\n labelProps,\n open,\n startElementProps,\n tooltipProps,\n ],\n )\n\n return (\n <SidebarItemContext value={context}>\n <ItemComponentContext value={itemComponentContext}>\n {item ?? (\n <styled.li {...getItemProps()}>\n {group ? (\n <>\n {trigger ?? (\n <SidebarItemTrigger {...mergedTriggerProps}>\n {groupStartElement ? (\n <SidebarItemStartElement>\n {groupStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {groupEndElement ? (\n <SidebarItemEndElement>\n {groupEndElement}\n </SidebarItemEndElement>\n ) : null}\n <SidebarItemIndicator>\n {groupLoading ? (\n <Loading />\n ) : (\n runIfFn(indicator, callbackProps)\n )}\n </SidebarItemIndicator>\n </SidebarItemTrigger>\n )}\n\n <SidebarItemContent>{children}</SidebarItemContent>\n </>\n ) : (\n (link ?? (\n <SidebarItemLink {...mergedLinkProps}>\n {itemStartElement ? (\n <SidebarItemStartElement>\n {itemStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {itemEndElement ? (\n <SidebarItemEndElement>\n {itemEndElement}\n </SidebarItemEndElement>\n ) : null}\n </SidebarItemLink>\n ))\n )}\n </styled.li>\n )}\n </ItemComponentContext>\n </SidebarItemContext>\n )\n },\n \"item\",\n)()\n\ninterface SidebarItemTooltipProps extends TooltipProps {}\n\nconst SidebarItemTooltip: FC<SidebarItemTooltipProps> = (props) => {\n const { tooltipProps } = useItemComponentContext()\n const { children, disabled, ...rest } = mergeProps(tooltipProps, props)()\n const { mode, placement } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n\n if (offcanvas || disabled) return children\n else\n return (\n <Tooltip\n closeOnClick={false}\n gutter={16}\n placement={`center-${placement === \"start\" ? \"end\" : \"start\"}`}\n {...rest}\n >\n {children}\n </Tooltip>\n )\n}\n\nexport interface SidebarItemTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarItemTrigger = withContext<\n \"button\",\n SidebarItemTriggerProps\n>((props) => {\n return (\n <SidebarItemTooltip>\n <styled.button {...props} />\n </SidebarItemTooltip>\n )\n}, \"itemTrigger\")()\n\nexport interface SidebarItemLinkProps extends HTMLStyledProps<\"a\"> {}\n\nexport const SidebarItemLink = withContext<\"a\", SidebarItemLinkProps>(\n (props) => {\n return (\n <SidebarItemTooltip>\n <styled.a {...props} />\n </SidebarItemTooltip>\n )\n },\n \"itemLink\",\n)()\n\nexport interface SidebarItemContentProps\n extends\n Omit<HTMLStyledProps<\"ul\">, \"transition\">,\n Pick<CollapseProps, \"animationOpacity\" | keyof WithTransitionProps> {}\n\nexport const SidebarItemContent = withContext<\"ul\", SidebarItemContentProps>(\n (props) => {\n const { contentProps } = useItemComponentContext()\n\n return (\n <Collapse\n as=\"ul\"\n {...cast<CollapseProps>(mergeProps(contentProps, props)())}\n />\n )\n },\n \"itemContent\",\n)()\n\nexport interface SidebarItemIndicatorProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const SidebarItemIndicator = withContext<\n \"svg\",\n SidebarItemIndicatorProps\n>(({ children = <ChevronRightIcon />, ...rest }) => {\n const { indicatorHidden } = useSidePanelComponentContext()\n\n if (indicatorHidden) return null\n\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, { ...rest, ...children.props })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}, \"itemIndicator\")(undefined, (props) => {\n const { indicatorProps } = useItemComponentContext()\n\n return mergeProps(indicatorProps, props)()\n})\n\nexport interface SidebarItemStartElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemStartElement = withContext<\n \"div\",\n SidebarItemStartElementProps\n>(\"div\", {\n name: \"ItemStartElement\",\n slot: [\"itemElement\", \"start\"],\n})(undefined, (props) => {\n const { startElementProps } = useItemComponentContext()\n\n return mergeProps(startElementProps, props)()\n})\n\nexport interface SidebarItemEndElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemEndElement = withContext<\n \"div\",\n SidebarItemEndElementProps\n>(\"div\", {\n name: \"ItemEndElement\",\n slot: [\"itemElement\", \"end\"],\n})(undefined, (props) => {\n const { endElementProps } = useItemComponentContext()\n\n return mergeProps(endElementProps, props)()\n})\n\nexport interface SidebarItemLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarItemLabel = withContext<\"span\", SidebarItemLabelProps>(\n \"span\",\n \"itemLabel\",\n)(undefined, (props) => {\n const { labelProps } = useItemComponentContext()\n\n return mergeProps(labelProps, props)()\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0JA,MAAM,aAAa,OAAoB,UAAk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AAM,EAAE,eAAe,wBAAwB;CAE/C,OAAOA,cAAAA,WAAW,YAAY,KAAK,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"sidebar.cjs","names":["createContext","createSlotComponent","sidebarStyle","useBreakpointValue","useValue","useSidebar","SidebarDescendantsContext","SidebarContext","styled","useSidebarContext","useSplitChildren","mergeProps","useSidebarGroup","useIncludesChildren","useValidChildren","useLoadingComponent","useSidebarItem","SidebarItemContext","Tooltip","Collapse","ChevronRightIcon","Children"],"sources":["../../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n Breakpoint,\n ExtractStyleValue,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { Loading } from \"../loading\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type {\n UseSidebarGroupProps,\n UseSidebarGroupReturn,\n UseSidebarItemProps,\n UseSidebarItemReturn,\n UseSidebarProps,\n UseSidebarReturn,\n} from \"./use-sidebar\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n} from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useBreakpointValue } from \"../../hooks/use-breakpoint\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n cast,\n createContext,\n dataAttr,\n isObject,\n isString,\n runIfFn,\n useIncludesChildren,\n useSplitChildren,\n useValidChildren,\n} from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { Drawer } from \"../drawer\"\nimport { ChevronRightIcon } from \"../icon\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Tooltip, type TooltipProps } from \"../tooltip\"\nimport { sidebarStyle, type SidebarStyle } from \"./sidebar.style\"\nimport {\n SidebarContext,\n SidebarDescendantsContext,\n SidebarItemContext,\n useSidebar,\n useSidebarContext,\n useSidebarGroup,\n useSidebarItem,\n} from \"./use-sidebar\"\n\ninterface SidebarItemCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\ntype SidebarItemReactNode =\n | ReactNodeOrFunction<SidebarItemCallBackProps>\n | {\n group: ReactNodeOrFunction<SidebarItemCallBackProps>\n item?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n | {\n item: ReactNodeOrFunction<SidebarItemCallBackProps>\n group?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n\ninterface SidebarItemSharedRenderProps\n extends\n Pick<SidebarItemProps, \"label\">,\n Pick<\n UseSidebarItemReturn,\n | \"expanded\"\n | \"expandedValue\"\n | \"onExpandedChange\"\n | \"onSelectedChange\"\n | \"selected\"\n | \"selectedValue\"\n | \"value\"\n > {\n itemProps: HTMLStyledProps<\"li\">\n linkProps: HTMLStyledProps<\"a\">\n triggerProps: HTMLStyledProps<\"button\">\n endElement?: ReactNode\n startElement?: ReactNode\n}\n\ninterface SidebarItemRenderProps\n extends\n PropsWithChildren,\n Omit<SidebarItemSharedRenderProps, \"endElement\" | \"startElement\">,\n Pick<\n UseSidebarItemReturn,\n | \"group\"\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n endElement: { group?: ReactNode; item?: ReactNode }\n startElement: { group?: ReactNode; item?: ReactNode }\n indicator?: ReactNode\n link?: ReactNode\n trigger?: ReactNode\n}\n\ninterface SidebarItemLinkRenderProps extends Omit<\n SidebarItemSharedRenderProps,\n \"itemProps\" | \"triggerProps\"\n> {}\n\ninterface SidebarItemTriggerRenderProps\n extends\n Omit<SidebarItemSharedRenderProps, \"itemProps\" | \"linkProps\">,\n Pick<\n UseSidebarItemReturn,\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n indicator?: ReactNode\n}\n\ninterface SidebarItemRender {\n item?: ReactNodeOrFunction<SidebarItemRenderProps>\n link?: ReactNodeOrFunction<SidebarItemLinkRenderProps>\n trigger?: ReactNodeOrFunction<SidebarItemTriggerRenderProps>\n}\n\ninterface SidebarGroup extends Omit<SidebarGroupProps, \"children\" | \"value\"> {\n children: SidebarItemWithValue[]\n group: true\n}\n\nexport interface SidebarItemWithValue extends Omit<\n SidebarItemProps,\n \"children\"\n> {\n children?: SidebarItemWithValue[]\n}\n\nexport type SidebarItem = SidebarGroup | SidebarItemWithValue\n\nconst createKey = (props: SidebarItem, index: number) => {\n return \"value\" in props ? props.value || index : index\n}\n\nconst getReactNodeOrFunction = (\n type: \"group\" | \"item\",\n custom?: SidebarItemReactNode,\n root?: SidebarItemReactNode,\n): ReactNodeOrFunction<SidebarItemCallBackProps> => {\n if (isObject(custom) && (\"group\" in custom || \"item\" in custom))\n return custom[type]\n else if (custom) return custom\n else if (isObject(root) && (\"group\" in root || \"item\" in root))\n return root[type]\n else return root\n}\n\ninterface ComponentContext extends Pick<\n UseSidebarReturn,\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getSidePanelProps\"\n | \"getTriggerProps\"\n> {\n breakpoint: ExtractStyleValue<NonNullable<SidebarRootProps[\"breakpoint\"]>>\n mode: ExtractStyleValue<NonNullable<SidebarRootProps[\"mode\"]>>\n placement: ExtractStyleValue<NonNullable<SidebarRootProps[\"placement\"]>>\n}\n\ninterface GroupComponentContext\n extends\n Pick<SidebarGroupProps, \"contentProps\" | \"labelProps\">,\n Pick<UseSidebarGroupReturn, \"getContentProps\" | \"getLabelProps\"> {}\n\nconst [GroupComponentContext, useGroupComponentContext] =\n createContext<GroupComponentContext>({ name: \"GroupComponentContext\" })\n\ninterface ItemComponentContext {\n contentProps: SidebarItemContentProps\n endElementProps: SidebarItemEndElementProps\n indicatorProps: SidebarItemIndicatorProps\n labelProps: SidebarItemLabelProps\n startElementProps: SidebarItemStartElementProps\n tooltipProps: SidebarItemTooltipProps\n}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({ name: \"ItemComponentContext\" })\n\ninterface SidePanelComponentContext extends Pick<\n SidebarSidePanelProps,\n | \"animated\"\n | \"contentProps\"\n | \"endElement\"\n | \"endElementProps\"\n | \"footerProps\"\n | \"groupContentProps\"\n | \"groupProps\"\n | \"handleProps\"\n | \"headerProps\"\n | \"indicator\"\n | \"indicatorHidden\"\n | \"indicatorProps\"\n | \"itemContentProps\"\n | \"itemProps\"\n | \"items\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"menuProps\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n> {}\n\nconst [SidePanelComponentContext, useSidePanelComponentContext] =\n createContext<SidePanelComponentContext>({\n name: \"SidePanelComponentContext\",\n })\n\nexport interface SidebarRootProps\n extends\n HTMLStyledProps<\"div\">,\n ThemeProps<SidebarStyle>,\n Omit<UseSidebarProps, \"mobile\"> {\n /**\n * The breakpoint to use for the sidebar. If `false`, the sidebar will be always visible.\n *\n * @default 'md'\n */\n breakpoint?: Exclude<Breakpoint, \"base\"> | false\n}\n\nconst {\n ComponentContext,\n PropsContext: SidebarPropsContext,\n useComponentContext,\n usePropsContext: useSidebarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SidebarRootProps, SidebarStyle, ComponentContext>(\n \"sidebar\",\n sidebarStyle,\n)\n\nexport { SidebarPropsContext, useSidebarPropsContext }\n\n/**\n * `Sidebar` is a component that is used to display a list of items in a sidebar.\n *\n * @see https://yamada-ui.com/docs/components/sidebar\n */\nexport const SidebarRoot = withProvider<\n \"div\",\n SidebarRootProps,\n \"mode\" | \"placement\"\n>(\n ({\n breakpoint = \"md\",\n mode: modeProp = \"offcanvas\",\n placement: placementProp = \"start\",\n ...rest\n }) => {\n const mobile =\n useBreakpointValue<boolean | undefined>(\n breakpoint ? { [breakpoint]: true } : { base: false },\n ) ?? false\n const mode = useValue(modeProp)\n const placement = useValue(placementProp)\n const {\n descendants,\n expandedValue,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n } = useSidebar({ mobile, ...rest })\n const context = useMemo(\n () => ({\n expandedValue,\n mobile,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }),\n [\n mobile,\n expandedValue,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n ],\n )\n const componentContext = useMemo(\n () => ({\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n }),\n [\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n ],\n )\n\n return (\n <SidebarDescendantsContext value={descendants}>\n <SidebarContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div data-group {...getRootProps()} />\n </ComponentContext>\n </SidebarContext>\n </SidebarDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"mode\", \"placement\"] },\n)()\n\nexport interface SidebarMainPanelProps extends HTMLStyledProps {}\n\nexport const SidebarMainPanel = withContext<\"div\", SidebarMainPanelProps>(\n \"div\",\n \"mainPanel\",\n)()\n\nexport interface SidebarTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarTrigger = withContext<\"button\", SidebarTriggerProps>(\n \"button\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getTriggerProps(props) }\n})\n\nexport interface SidebarSidePanelProps\n extends\n Omit<HTMLStyledProps<\"aside\">, \"content\">,\n Pick<SidebarContentProps, \"items\">,\n Pick<\n SidebarItemProps,\n | \"animated\"\n | \"endElement\"\n | \"endElementProps\"\n | \"indicator\"\n | \"indicatorProps\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n > {\n /**\n * The content of the sidebar.\n */\n content?: ReactNode\n /**\n * The footer of the sidebar.\n */\n footer?: ReactNode\n /**\n * The header of the sidebar.\n */\n header?: ReactNode\n /**\n * If `true`, hide the tree indicator icon for all items.\n *\n * @default false\n */\n indicatorHidden?: boolean\n /**\n * If `true`, the sidebar will be rendered with a handle.\n *\n * @default true\n */\n withHandle?: boolean\n /**\n * Props for the content component.\n */\n contentProps?: SidebarContentProps\n /**\n * Props for the drawer component.\n */\n drawerProps?: Omit<\n Drawer.RootProps,\n | \"body\"\n | \"cancel\"\n | \"children\"\n | \"footer\"\n | \"header\"\n | \"middle\"\n | \"onCancel\"\n | \"onClose\"\n | \"onMiddle\"\n | \"onOpen\"\n | \"onSuccess\"\n | \"open\"\n | \"success\"\n | \"title\"\n | \"trigger\"\n >\n /**\n * Props for the footer component.\n */\n footerProps?: SidebarFooterProps\n /**\n * Props for the group content component.\n */\n groupContentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the group component.\n */\n groupProps?: Omit<SidebarGroupProps, \"children\" | \"label\" | \"value\">\n /**\n * Props for the handle component.\n */\n handleProps?: SidebarHandleProps\n /**\n * Props for the header component.\n */\n headerProps?: SidebarHeaderProps\n /**\n * Props for the item content component.\n */\n itemContentProps?: SidebarItemContentProps\n /**\n * Props for the item component.\n */\n itemProps?: Omit<\n SidebarItemProps,\n \"children\" | \"items\" | \"label\" | \"open\" | \"value\"\n >\n /**\n * Props for the menu component.\n *\n * @default 'md'\n */\n menuProps?: SidebarMenuProps\n}\n\nexport const SidebarSidePanel = withContext<\"aside\", SidebarSidePanelProps>(\n ({\n animated = true,\n children,\n content,\n endElement,\n footer,\n header,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n withHandle = true,\n contentProps,\n drawerProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mobile, open, onClose } = useSidebarContext()\n const { breakpoint, placement, getSidePanelProps } = useComponentContext()\n const [\n omittedChildren,\n customHeader,\n customContent,\n customFooter,\n customHandle,\n ] = useSplitChildren(\n children,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarHandle,\n )\n const context = useMemo(\n () => ({\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n }),\n [\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n render,\n loadingScheme,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ],\n )\n\n return (\n <SidePanelComponentContext value={context}>\n {mobile ? (\n <Drawer.Root\n size=\"sm\"\n autoFocus={false}\n duration={!animated ? 0 : undefined}\n open={open}\n placement={`inline-${placement}`}\n withCloseButton={false}\n portalProps={{ disabled: true }}\n onClose={onClose}\n {...drawerProps}\n >\n <Drawer.Content>\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n </Drawer.Content>\n </Drawer.Root>\n ) : (\n <>\n <SidebarGap\n data-animated={dataAttr(animated)}\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n />\n\n <styled.aside\n data-animated={dataAttr(animated)}\n data-group\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n {...getSidePanelProps(rest)}\n >\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n {customHandle ?? (withHandle ? <SidebarHandle /> : null)}\n\n {omittedChildren}\n </styled.aside>\n </>\n )}\n </SidePanelComponentContext>\n )\n },\n \"sidePanel\",\n)()\n\ninterface SidebarGapProps extends HTMLStyledProps<\"div\"> {}\n\nconst SidebarGap = withContext<\"div\", SidebarGapProps>(\"div\", \"gap\")()\n\nexport interface SidebarHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const SidebarHeader = withContext<\"header\", SidebarHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n const { headerProps } = useSidePanelComponentContext()\n\n return getHeaderProps(mergeProps(headerProps, props)())\n})\n\nexport interface SidebarFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const SidebarFooter = withContext<\"footer\", SidebarFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n const { footerProps } = useSidePanelComponentContext()\n\n return getFooterProps(mergeProps(footerProps, props)())\n})\n\nexport interface SidebarContentProps extends HTMLStyledProps<\"ul\"> {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItem[]\n}\n\nexport const SidebarContent = withContext<\"ul\", SidebarContentProps>(\n ({ children, items, ...rest }) => {\n const { getContentProps } = useComponentContext()\n const { items: rootItems, contentProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (items ?? rootItems)?.map((props, index) => {\n const key = createKey(props, index)\n\n if (\"group\" in props) {\n const { children, group: _, ...rest } = props\n\n return <SidebarGroup key={key} items={children} {...rest} />\n } else {\n const { children, ...rest } = props\n\n return <SidebarItem key={key} items={children} {...rest} />\n }\n })\n }, [children, items, rootItems])\n\n return (\n <styled.ul {...getContentProps(mergeProps(contentProps, rest)())}>\n {computedChildren}\n </styled.ul>\n )\n },\n \"content\",\n)()\n\nexport interface SidebarHandleProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarHandle = withContext<\"button\", SidebarHandleProps>(\n (props) => {\n const { handleProps } = useSidePanelComponentContext()\n\n return (\n <SidebarTrigger {...mergeProps(handleProps, props)()}>\n <styled.button tabIndex={-1} />\n </SidebarTrigger>\n )\n },\n \"handle\",\n)()\n\nexport interface SidebarGroupProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"content\" | \"value\">,\n UseSidebarGroupProps {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the label component.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nexport const SidebarGroup = withContext<\"li\", SidebarGroupProps>(\n ({\n children,\n items,\n label,\n value: valueProp = isString(label) ? label : undefined,\n contentProps,\n labelProps,\n ...rest\n }) => {\n const { groupProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [children, items])\n const [omittedChildren, customLabel, customContent] = useSplitChildren(\n computedChildren,\n SidebarGroupLabel,\n SidebarGroupContent,\n )\n const { getContentProps, getLabelProps, getRootProps } = useSidebarGroup({\n ...mergeProps(groupProps, rest)(),\n value: valueProp,\n })\n const context = useMemo(\n () => ({ contentProps, getContentProps, getLabelProps, labelProps }),\n [getLabelProps, labelProps, getContentProps, contentProps],\n )\n\n return (\n <GroupComponentContext value={context}>\n <styled.li {...getRootProps()}>\n {customLabel ??\n (label ? <SidebarGroupLabel>{label}</SidebarGroupLabel> : null)}\n {customContent ?? (\n <SidebarGroupContent>{omittedChildren}</SidebarGroupContent>\n )}\n </styled.li>\n </GroupComponentContext>\n )\n },\n \"group\",\n)()\n\nexport interface SidebarGroupLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarGroupLabel = withContext<\"span\", SidebarGroupLabelProps>(\n \"span\",\n \"groupLabel\",\n)(undefined, (props) => {\n const { getLabelProps, labelProps } = useGroupComponentContext()\n\n return getLabelProps(mergeProps(labelProps, props)())\n})\n\nexport interface SidebarGroupContentProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarGroupContent = withContext<\"div\", SidebarGroupContentProps>(\n \"div\",\n \"groupContent\",\n)(undefined, ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const list = useIncludesChildren(validChildren, SidebarItem)\n const { groupContentProps } = useSidePanelComponentContext()\n const { contentProps, getContentProps } = useGroupComponentContext()\n\n return {\n as: list ? \"ul\" : \"div\",\n children,\n ...getContentProps(mergeProps(groupContentProps, contentProps, rest)()),\n }\n})\n\nexport interface SidebarMenuProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarMenu = withContext<\"div\", SidebarMenuProps>(\"div\", \"menu\")(\n undefined,\n (props) => {\n const { menuProps } = useSidePanelComponentContext()\n\n return { \"data-menu\": \"\", ...mergeProps(menuProps, props)() }\n },\n)\n\nexport interface SidebarMenuButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarMenuButton = withContext<\"button\", SidebarMenuButtonProps>(\n \"button\",\n [\"menu\", \"button\"],\n)(undefined, (props) => {\n const { open } = useSidebarContext()\n const { mode } = useComponentContext()\n const { menuProps } = useSidePanelComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const { disabled, ...rest } = mergeProps(menuProps, props)()\n\n return {\n \"data-menu\": \"\",\n disabled,\n ...rest,\n tabIndex: (!offcanvas || open) && !disabled ? 0 : -1,\n }\n})\n\nexport interface SidebarItemProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"value\">,\n Omit<UseSidebarItemProps, \"asyncChildren\"> {\n /**\n * The label to display in the item.\n */\n label: ReactNode\n /**\n * If `true`, the sidebar item will be animated.\n *\n * @default true\n */\n animated?: boolean\n /**\n * The element to display at the end of the item.\n */\n endElement?: SidebarItemReactNode\n /**\n * The sidebar item indicator icon to use.\n */\n indicator?: ReactNodeOrFunction<SidebarItemCallBackProps>\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n /**\n * If provided, the sidebar item will be rendered with custom components.\n */\n render?: SidebarItemRender\n /**\n * The element to display at the start of the item.\n */\n startElement?: SidebarItemReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarItemContentProps, \"children\">\n /**\n * Props for the end component.\n */\n endElementProps?: SidebarItemEndElementProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SidebarItemIndicatorProps\n /**\n * Props for the label component.\n */\n labelProps?: SidebarItemLabelProps\n /**\n * Props for the link component.\n */\n linkProps?: SidebarItemLinkProps\n /**\n * Props for the start component.\n */\n startElementProps?: SidebarItemStartElementProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: Omit<SidebarItemTooltipProps, \"children\" | \"content\">\n /**\n * Props for the trigger component.\n */\n triggerProps?: SidebarItemTriggerProps\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<SidebarItemWithValue[]>\n}\n\nexport const SidebarItem = withContext<\"li\", SidebarItemProps>(\n ({\n animated: animatedProp,\n asyncChildren: asyncChildrenProp,\n children: childrenProp,\n endElement,\n indicator: indicatorProp,\n items,\n label,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n indicatorProps,\n labelProps,\n linkProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mode } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const componentContext = useSidePanelComponentContext()\n const Loading = useLoadingComponent(\n loadingScheme ?? componentContext.loadingScheme ?? \"oval\",\n )\n const computedChildren = useMemo(() => {\n if (childrenProp) return childrenProp\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [childrenProp, items])\n const asyncChildren = useCallback(async () => {\n const items = await asyncChildrenProp?.()\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [asyncChildrenProp])\n const {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n } = useSidebarItem({\n ...mergeProps(componentContext.itemProps, rest)(),\n asyncChildren: asyncChildrenProp ? asyncChildren : undefined,\n children: computedChildren,\n })\n const animated = animatedProp ?? componentContext.animated ?? true\n const tabIndex = offcanvas\n ? open && expanded && !disabled\n ? 0\n : -1\n : expanded && !disabled\n ? 0\n : -1\n const callbackProps = useMemo(\n () => ({ disabled, expanded: groupOpen }),\n [disabled, groupOpen],\n )\n const mergedTriggerProps = useMemo(() => {\n return getTriggerProps({\n tabIndex,\n ...mergeProps(componentContext.triggerProps, triggerProps)(),\n }) as SidebarItemTriggerProps\n }, [getTriggerProps, tabIndex, componentContext.triggerProps, triggerProps])\n const mergedLinkProps = useMemo(() => {\n return getLinkProps({\n tabIndex,\n ...mergeProps(componentContext.linkProps, linkProps)(),\n }) as SidebarItemLinkProps\n }, [getLinkProps, tabIndex, componentContext.linkProps, linkProps])\n const indicator = useMemo<ReactNode>(\n () => runIfFn(indicatorProp ?? componentContext.indicator, callbackProps),\n [indicatorProp, componentContext.indicator, callbackProps],\n )\n const groupStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const groupEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const itemStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const itemEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const trigger = useMemo<ReactNode>(\n () =>\n runIfFn(render?.trigger ?? componentContext.render?.trigger, {\n endElement: groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n startElement: groupStartElement,\n value,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.trigger,\n componentContext.render?.trigger,\n groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n groupStartElement,\n value,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const link = useMemo<ReactNode>(\n () =>\n runIfFn(render?.link ?? componentContext.render?.link, {\n endElement: itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n startElement: itemStartElement,\n value,\n linkProps: mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n }),\n [\n render?.link,\n componentContext.render?.link,\n itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n itemStartElement,\n value,\n mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n ],\n )\n const item = useMemo<ReactNode>(\n () =>\n runIfFn(render?.item ?? componentContext.render?.item, {\n children,\n endElement: { group: groupEndElement, item: itemEndElement },\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n startElement: { group: groupStartElement, item: itemStartElement },\n trigger,\n value,\n itemProps: getItemProps() as HTMLStyledProps<\"li\">,\n linkProps: mergedLinkProps,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.item,\n componentContext.render?.item,\n children,\n groupEndElement,\n itemEndElement,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n groupStartElement,\n itemStartElement,\n trigger,\n value,\n getItemProps,\n mergedLinkProps,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const context = useMemo(\n () => ({ branchOpen, groupOpen }),\n [branchOpen, groupOpen],\n )\n const itemComponentContext = useMemo(\n () => ({\n contentProps: {\n duration: !animated ? 0 : undefined,\n open: groupOpen,\n ...getContentProps(\n mergeProps(componentContext.itemContentProps, contentProps)(),\n ),\n },\n endElementProps: mergeProps(\n componentContext.endElementProps,\n endElementProps,\n )(),\n indicatorProps: getIndicatorProps({\n \"data-animated\": dataAttr(animated),\n ...mergeProps(componentContext.indicatorProps, indicatorProps)(),\n }) as SidebarItemIndicatorProps,\n labelProps: getLabelProps(\n mergeProps(componentContext.labelProps, labelProps)(),\n ) as SidebarItemLabelProps,\n startElementProps: mergeProps(\n componentContext.startElementProps,\n startElementProps,\n )(),\n tooltipProps: {\n content: label,\n disabled: open,\n ...mergeProps(componentContext.tooltipProps, tooltipProps)(),\n },\n }),\n [\n animated,\n componentContext.endElementProps,\n componentContext.indicatorProps,\n componentContext.itemContentProps,\n componentContext.labelProps,\n componentContext.startElementProps,\n componentContext.tooltipProps,\n contentProps,\n endElementProps,\n getContentProps,\n getIndicatorProps,\n getLabelProps,\n groupOpen,\n indicatorProps,\n label,\n labelProps,\n open,\n startElementProps,\n tooltipProps,\n ],\n )\n\n return (\n <SidebarItemContext value={context}>\n <ItemComponentContext value={itemComponentContext}>\n {item ?? (\n <styled.li {...getItemProps()}>\n {group ? (\n <>\n {trigger ?? (\n <SidebarItemTrigger {...mergedTriggerProps}>\n {groupStartElement ? (\n <SidebarItemStartElement>\n {groupStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {groupEndElement ? (\n <SidebarItemEndElement>\n {groupEndElement}\n </SidebarItemEndElement>\n ) : null}\n <SidebarItemIndicator>\n {groupLoading ? (\n <Loading />\n ) : (\n runIfFn(indicator, callbackProps)\n )}\n </SidebarItemIndicator>\n </SidebarItemTrigger>\n )}\n\n <SidebarItemContent>{children}</SidebarItemContent>\n </>\n ) : (\n (link ?? (\n <SidebarItemLink {...mergedLinkProps}>\n {itemStartElement ? (\n <SidebarItemStartElement>\n {itemStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {itemEndElement ? (\n <SidebarItemEndElement>\n {itemEndElement}\n </SidebarItemEndElement>\n ) : null}\n </SidebarItemLink>\n ))\n )}\n </styled.li>\n )}\n </ItemComponentContext>\n </SidebarItemContext>\n )\n },\n \"item\",\n)()\n\ninterface SidebarItemTooltipProps extends TooltipProps {}\n\nconst SidebarItemTooltip: FC<SidebarItemTooltipProps> = (props) => {\n const { tooltipProps } = useItemComponentContext()\n const { children, disabled, ...rest } = mergeProps(tooltipProps, props)()\n const { mode, placement } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n\n if (offcanvas || disabled) return children\n else\n return (\n <Tooltip\n closeOnClick={false}\n gutter={16}\n placement={`center-${placement === \"start\" ? \"end\" : \"start\"}`}\n {...rest}\n >\n {children}\n </Tooltip>\n )\n}\n\nexport interface SidebarItemTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarItemTrigger = withContext<\n \"button\",\n SidebarItemTriggerProps\n>((props) => {\n return (\n <SidebarItemTooltip>\n <styled.button {...props} />\n </SidebarItemTooltip>\n )\n}, \"itemTrigger\")()\n\nexport interface SidebarItemLinkProps extends HTMLStyledProps<\"a\"> {}\n\nexport const SidebarItemLink = withContext<\"a\", SidebarItemLinkProps>(\n (props) => {\n return (\n <SidebarItemTooltip>\n <styled.a {...props} />\n </SidebarItemTooltip>\n )\n },\n \"itemLink\",\n)()\n\nexport interface SidebarItemContentProps\n extends\n Omit<HTMLStyledProps<\"ul\">, \"transition\">,\n Pick<CollapseProps, \"animationOpacity\" | keyof WithTransitionProps> {}\n\nexport const SidebarItemContent = withContext<\"ul\", SidebarItemContentProps>(\n (props) => {\n const { contentProps } = useItemComponentContext()\n\n return (\n <Collapse\n as=\"ul\"\n {...cast<CollapseProps>(mergeProps(contentProps, props)())}\n />\n )\n },\n \"itemContent\",\n)()\n\nexport interface SidebarItemIndicatorProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const SidebarItemIndicator = withContext<\n \"svg\",\n SidebarItemIndicatorProps\n>(({ children = <ChevronRightIcon />, ...rest }) => {\n const { indicatorHidden } = useSidePanelComponentContext()\n\n if (indicatorHidden) return null\n\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, { ...rest, ...children.props })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}, \"itemIndicator\")(undefined, (props) => {\n const { indicatorProps } = useItemComponentContext()\n\n return mergeProps(indicatorProps, props)()\n})\n\nexport interface SidebarItemStartElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemStartElement = withContext<\n \"div\",\n SidebarItemStartElementProps\n>(\"div\", {\n name: \"ItemStartElement\",\n slot: [\"itemElement\", \"start\"],\n})(undefined, (props) => {\n const { startElementProps } = useItemComponentContext()\n\n return mergeProps(startElementProps, props)()\n})\n\nexport interface SidebarItemEndElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemEndElement = withContext<\n \"div\",\n SidebarItemEndElementProps\n>(\"div\", {\n name: \"ItemEndElement\",\n slot: [\"itemElement\", \"end\"],\n})(undefined, (props) => {\n const { endElementProps } = useItemComponentContext()\n\n return mergeProps(endElementProps, props)()\n})\n\nexport interface SidebarItemLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarItemLabel = withContext<\"span\", SidebarItemLabelProps>(\n \"span\",\n \"itemLabel\",\n)(undefined, (props) => {\n const { labelProps } = useItemComponentContext()\n\n return mergeProps(labelProps, props)()\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0JA,MAAM,aAAa,OAAoB,UAAkB;CACvD,OAAO,WAAW,QAAQ,MAAM,SAAS,QAAQ;AACnD;AAEA,MAAM,0BACJ,MACA,QACA,SACkD;CAClD,KAAA,GAAA,oBAAA,cAAA,SAAA,CAAa,MAAM,MAAM,WAAW,UAAU,UAAU,SACtD,OAAO,OAAO;MACX,IAAI,QAAQ,OAAO;MACnB,KAAA,GAAA,oBAAA,cAAA,SAAA,CAAa,IAAI,MAAM,WAAW,QAAQ,UAAU,OACvD,OAAO,KAAK;MACT,OAAO;AACd;AAoBA,MAAM,CAAC,uBAAuB,4BAC5BA,gBAAAA,cAAqC,EAAE,MAAM,wBAAwB,CAAC;AAWxE,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC,EAAE,MAAM,uBAAuB,CAAC;AA8BtE,MAAM,CAAC,2BAA2B,gCAChCA,gBAAAA,cAAyC,EACvC,MAAM,4BACR,CAAC;AAeH,MAAM,EACJ,kBACA,cAAc,qBACd,qBACA,iBAAiB,wBACjB,aACA,iBACEC,yBAAAA,oBACF,WACAC,sBAAAA,YACF;;;;;;AASA,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ACtB,MAAM,EAAE,oBAAoB,oBAAoB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,gBAAgB,KAAK;CAAE;AACpD,CAAC;AA8GD,MAAa,mBAAmB,aAC7B,EACC,WAAW,MACX,UACA,SACA,YACA,QACA,QACA,WACA,iBACA,OACA,eACA,QACA,cACA,aAAa,MACb,cACA,aACA,iBACA,aACA,mBACA,YACA,aACA,aACA,gBACA,kBACA,WACA,YACA,WACA,WACA,mBACA,cACA,cACA,GAAG,WACC;CACJ,MAAM,EAAE,QAAQ,MAAM,YAAYC,oBAAAA,kBAAkB;CACpD,MAAM,EAAE,YAAY,WAAW,sBAAsB,oBAAoB;CACzE,MAAM,CACJ,iBACA,cACA,eACA,cACA,gBACEC,iBAAAA,iBACF,UACA,eACA,gBACA,eACA,aACF;CACA,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,2BAAD;EAA2B,OAAO;EAC/B,UAAA,SACC,iBAAA,GAAA,kBAAA,IAAA,CAAA,eAAA,YAAA;GACE,MAAK;GACL,WAAW;GACX,UAAU,CAAC,WAAW,IAAI,KAAA;GACpB;GACN,WAAW,UAAU;GACrB,iBAAiB;GACjB,aAAa,EAAE,UAAU,KAAK;GACrB;GACT,GAAI;GAEJ,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAA,eAAA,eAAA,EAAA,UAAA;IACG,iBACE,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,EAAA,UAAgB,OAAsB,CAAA,IAAI;IAErD,kBACE,WAAW,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SAAS,KAAK,IAAI,IAAI;AAC9D,GAAG,eAAe,CAAC,CAAC,KAAA,IAAY,UAAU;CACxC,MAAM,EAAE,mBAAmB,wBAAwB;CAEnD,OAAOV,cAAAA,WAAW,gBAAgB,KAAK,CAAC,CAAC;AAC3C,CAAC;AAID,MAAa,0BAA0B,YAGrC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,OAAO;AAC/B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,sBAAsB,wBAAwB;CAEtD,OAAOA,cAAAA,WAAW,mBAAmB,KAAK,CAAC,CAAC;AAC9C,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,KAAK;AAC7B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,oBAAoB,wBAAwB;CAEpD,OAAOA,cAAAA,WAAW,iBAAiB,KAAK,CAAC,CAAC;AAC5C,CAAC;AAID,MAAa,mBAAmB,YAC9B,QACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,eAAe,wBAAwB;CAE/C,OAAOA,cAAAA,WAAW,YAAY,KAAK,CAAC,CAAC;AACvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton-text.cjs","names":["styled","Skeleton","mergeCSS"],"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,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;IAEE,KAAKC,kBAAAA,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.cjs","names":["styled","Skeleton","mergeCSS"],"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,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;IAEE,KAAKC,kBAAAA,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.cjs","names":["createTransition","createComponent","slideStyle","useValue","AnimatePresence","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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,eAAe,eAAe;EAC9B,GAAG;CACL;AACF;AAKA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACEC,yBAAAA,gBAAwC,SAASC,oBAAAA,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,YAAYC,8BAAAA,SAAS,aAAa;CAExC,MAAM,UAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAW;EAAY;CAAa,CACxD;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;EAAyB;YACtB,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,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
+ {"version":3,"file":"slide.cjs","names":["createTransition","createComponent","slideStyle","useValue","AnimatePresence","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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,eAAe,eAAe;EAC9B,GAAG;CACL;AACF;AAKA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACEC,yBAAAA,gBAAwC,SAASC,oBAAAA,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,YAAYC,8BAAAA,SAAS,aAAa;CAExC,MAAM,UAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAW;EAAY;CAAa,CACxD;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;EAAyB;EACtB,UAAA,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,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.cjs","names":["createTransition","createComponent","slideFadeStyle","AnimatePresence","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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,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,gBACEC,yBAAAA,gBACF,cACAC,yBAAAA,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,UAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAS;EAAS;EAAS;EAAY;CAAa,CACxE;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;EAAyB;YACtB,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,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.cjs","names":["createTransition","createComponent","slideFadeStyle","AnimatePresence","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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,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,YAAYA,mBAAAA,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,gBACEC,yBAAAA,gBACF,cACAC,yBAAAA,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,UAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAO;EAAU;EAAS;EAAS;EAAS;EAAY;CAAa,CACxE;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;EAAyB;EACtB,UAAA,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;GACW;GACD;GACR,MAAK;GACL,SAAQ;GACR,UAAU;GACV,GAAI;EACL,CAAA,IACC;CACW,CAAA;AAErB,CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slider.cjs","names":["createSlotComponent","sliderStyle","useSlider","useValue","styled","varAttr"],"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,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,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,kBACEC,mBAAAA,UAAa;EAAE,aATCC,8BAAAA,SAAS,eASA;EAAG,GAAG;CAAK,CAAC;CACzC,MAAM,oBAAA,GAAA,MAAA,QAAA,OAAiC;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,aAAD;GAAa,GAAI;aAAjB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAa,GAAI,WAAa,CAAA,GAE7B,QACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,EAAc,GAAI,WAAa,CAAA,IAE/B,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAa,GAAI,WAAa,CAAA,CAErB;MAEZ,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;GAAoB;GAAO,GAAI;EAAa,CAAA,IAAI,IACzD,EAAA,CAAA;CAEN,GAAG;EAAC;EAAU;EAAO;EAAY;EAAO;EAAY;EAAY;CAAU,CAAC;CAC3E,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,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AAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
1
+ {"version":3,"file":"slider.cjs","names":["createSlotComponent","sliderStyle","useSlider","useValue","styled","varAttr"],"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,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,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,kB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A,SAAA,CAA2B,SAAS;EAAG,GAAG;CAAM,CAAC;AACzE,CACF;AASA,MAAa,eAAqC,EAAE,OAAO,GAAG,YAAY;CACxE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACG,MAAM,KAAK,MAAM,UAAU;EAC1B,KAAA,GAAA,oBAAA,cAAA,SAAA,CAAa,IAAI,GACf,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;GAAwB,OAAO;GAAM,GAAI;EAAQ,GAAhC,KAAgC;OACnD;GACL,MAAM,EAAE,WAAW,OAAO,UAAU;GAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,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,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,UACjC,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD;EAAgC;EAAO,GAAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"slot.cjs","names":["useValidChildren","useFindChild","Children","mergeProps"],"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,gBAAgBA,iBAAAA,iBAAiB,QAAQ;CAC/C,MAAM,YAAYC,iBAAAA,aAAa,eAAe,SAAS;CAEvD,IAAI,WAAW;EACb,MAAM,aAAa,UAAU,MAAM;EAEnC,MAAM,cAAc,cAAc,KAAK,UAAU;GAC/C,IAAI,UAAU,WAAW;IACvB,IAAIC,MAAAA,SAAS,MAAM,UAAU,IAAI,GAAG,OAAOA,MAAAA,SAAS,KAAK,IAAI;IAC7D,QAAA,GAAA,MAAA,eAAA,CAAyC,UAAU,IAC/C,WAAW,MAAM,WACjB;GACN,OACE,OAAO;EAEX,CAAC;EAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;GAAW,GAAI;uCACG,UAAU,KAAA,GAAA,MAAA,aAAA,CACT,YAAY,KAAA,GAAW,WAAW,IAC/C;EACK,CAAA;CAEf;CAEA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAW,GAAI;EAAO;CAAoB,CAAA;AACnD;AAKA,MAAM,aAAiC,EAAE,UAAU,GAAG,WAAW;CAC/D,KAAA,GAAA,MAAA,eAAA,CAA+C,QAAQ,GACrD,QAAA,GAAA,MAAA,aAAA,CAAoB,UAAUC,cAAAA,WAAW,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC;CAElE,OAAOD,MAAAA,SAAS,MAAM,QAAQ,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC9D;AAEA,MAAa,aAAoC,EAAE,eAAe;CAEhE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAG,SAAW,CAAA;AACvB"}
1
+ {"version":3,"file":"slot.cjs","names":["useValidChildren","useFindChild","Children","mergeProps"],"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,gBAAgBA,iBAAAA,iBAAiB,QAAQ;CAC/C,MAAM,YAAYC,iBAAAA,aAAa,eAAe,SAAS;CAEvD,IAAI,WAAW;EACb,MAAM,aAAa,UAAU,MAAM;EAEnC,MAAM,cAAc,cAAc,KAAK,UAAU;GAC/C,IAAI,UAAU,WAAW;IACvB,IAAIC,MAAAA,SAAS,MAAM,UAAU,IAAI,GAAG,OAAOA,MAAAA,SAAS,KAAK,IAAI;IAC7D,QAAA,GAAA,MAAA,eAAA,CAAyC,UAAU,IAC/C,WAAW,MAAM,WACjB;GACN,OACE,OAAO;EAEX,CAAC;EAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;GAAW,GAAI;GACG,WAAA,GAAA,MAAA,eAAA,CAAA,UAAU,KAAA,GAAA,MAAA,aAAA,CACT,YAAY,KAAA,GAAW,WAAW,IAC/C;EACK,CAAA;CAEf;CAEA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EAAW,GAAI;EAAO;CAAoB,CAAA;AACnD;AAKA,MAAM,aAAiC,EAAE,UAAU,GAAG,WAAW;CAC/D,KAAA,GAAA,MAAA,eAAA,CAA+C,QAAQ,GACrD,QAAA,GAAA,MAAA,aAAA,CAAoB,UAAUC,cAAAA,WAAW,MAAM,SAAS,KAAK,CAAC,CAAC,CAAC;CAElE,OAAOD,MAAAA,SAAS,MAAM,QAAQ,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC9D;AAEA,MAAa,aAAoC,EAAE,eAAe;CAEhE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAG,SAAW,CAAA;AACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"snacks.cjs","names":["createSlotComponent","snacksStyle","AnimatePresence","motion","varAttr","createTransition","CloseButton"],"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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;AACF,CACF;AAIA,MAAM,eAAe,YAAsC,OAAO,SAAS,CAAC,CAAC;AAI7E,MAAM,mBAAmB,YACvBC,qBAAAA,aACA,aACF,CAAC,CAAC"}
1
+ {"version":3,"file":"snacks.cjs","names":["createSlotComponent","snacksStyle","AnimatePresence","motion","varAttr","createTransition","CloseButton"],"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,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,WACF;AAIA,MAAa,SAAS,cACnB,EACC,QAAQ,EAAE,YAAY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1 @@
1
- {"version":3,"file":"stack.cjs","names":["createComponent","stackStyle","useValidChildren","Fragment","styled"],"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,gBACEA,yBAAAA,gBAAwC,SAASC,oBAAAA,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,gBAAgBC,iBAAAA,iBAAiB,QAAQ;CAC/C,MAAM,iBAAA,GAAA,MAAA,QAAA,OAEF,YACI,cAAc,KAAK,OAAO,UAAU;EAClC,MAAM,MAAM,OAAO,MAAM,QAAQ,cAAc,MAAM,MAAM;EAE3D,MAAM,kBAAA,GAAA,MAAA,aAAA,CAAmC,WAAW;GAClD,cAAA,GAAA,oBAAA,cAAA,cAAA,CAA2B,gBAAgB,UACzC,SAAS,KAAK,IAAI,cAAc,WAClC;GACA,IAAA,GAAA,oBAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,gBAAgB,MACpC;GACA,IAAA,GAAA,oBAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,SAAS,aAC7B;EACF,CAAC;EAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,MAAAA,UAAD,EAAA,UAAA,CACG,QAAQ,iBAAiB,MACzB,KACO,EAAA,GAHK,GAGL;CAEd,CAAC,IACD,eACN;EAAC;EAAW;EAAe;CAAa,CAC1C;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;EACc;EACG;EACL;EACM;EAChB,GAAI;YAEH;CACS,CAAA;AAEhB,CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"stack.cjs","names":["createComponent","stackStyle","useValidChildren","Fragment","styled"],"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,gBACEA,yBAAAA,gBAAwC,SAASC,oBAAAA,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,gBAAgBC,iBAAAA,iBAAiB,QAAQ;CAC/C,MAAM,iBAAA,GAAA,MAAA,QAAA,OAEF,YACI,cAAc,KAAK,OAAO,UAAU;EAClC,MAAM,MAAM,OAAO,MAAM,QAAQ,cAAc,MAAM,MAAM;EAE3D,MAAM,kBAAA,GAAA,MAAA,aAAA,CAAmC,WAAW;GAClD,cAAA,GAAA,oBAAA,cAAA,cAAA,CAA2B,gBAAgB,UACzC,SAAS,KAAK,IAAI,cAAc,WAClC;GACA,IAAA,GAAA,oBAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,gBAAgB,MACpC;GACA,IAAA,GAAA,oBAAA,cAAA,cAAA,CAAiB,gBAAgB,UAC/B,SAAS,KAAK,IAAI,SAAS,aAC7B;EACF,CAAC;EAED,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,MAAAA,UAAD,EAAA,UAAA,CACG,QAAQ,iBAAiB,MACzB,KACO,EAAA,GAHK,GAGL;CAEd,CAAC,IACD,eACN;EAAC;EAAW;EAAe;CAAa,CAC1C;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;EACc;EACG;EACL;EACM;EAChB,GAAI;EAEH,UAAA;CACS,CAAA;AAEhB,CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"z-stack.cjs","names":["createComponent","zStackStyle","getValidChildren","Fragment","mergeRefs","mergeCSS","styled","useInjectVarsIntoCss","useInjectVarsIntoProps"],"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,gBACEA,yBAAAA,gBAA0C,gBAAgBC,sBAAAA,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,UAAA,GAAA,MAAA,OAAA,iBACJ,IAAI,IAAI,CACV;CACA,MAAM,CAAC,MAAM,YAAA,GAAA,MAAA,SAAA,CAAuD;EAClE,QAAQ;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StackStyle","getValidChildren","Fragment","mergeRefs","mergeCSS","styled","useInjectVarsIntoCss","useInjectVarsIntoProps"],"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,gBACEA,yBAAAA,gBAA0C,gBAAgBC,sBAAAA,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,UAAA,GAAA,MAAA,OAAA,iBACJ,IAAI,IAAI,CACV;CACA,MAAM,CAAC,MAAM,YAAA,GAAA,MAAA,SAAA,CAAuD;EAClE,QAAQ;EACR,OAAO;CACT,CAAC;CAED,MAAM,YAAA,GAAA,MAAA,YAAA,EACH,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,cAAA,GAAA,MAAA,YAAA,EACH,UAAkB;EACjB,IAA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