@yamada-ui/react 2.2.0 → 2.3.0-next-20260411030430

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 (301) hide show
  1. package/dist/cjs/components/avatar/avatar-group.cjs +6 -3
  2. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  3. package/dist/cjs/components/checkbox/checkbox-group.cjs +6 -4
  4. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  5. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs +5 -3
  6. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  7. package/dist/cjs/components/menu/menu.cjs +45 -42
  8. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  9. package/dist/cjs/components/native-popover/native-popover.cjs +26 -23
  10. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  11. package/dist/cjs/components/popover/popover.cjs +34 -31
  12. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  13. package/dist/cjs/components/radio/radio-group.cjs +6 -4
  14. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  15. package/dist/cjs/components/radio-card/radio-card-group.cjs +5 -3
  16. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  17. package/dist/cjs/components/toggle/toggle-group.cjs +6 -4
  18. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  19. package/dist/cjs/components/tooltip/tooltip.cjs +23 -18
  20. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  21. package/dist/cjs/core/components/create-component.cjs +31 -6
  22. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  23. package/dist/esm/components/avatar/avatar-group.js +6 -3
  24. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  25. package/dist/esm/components/checkbox/checkbox-group.js +6 -4
  26. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  27. package/dist/esm/components/checkbox-card/checkbox-card-group.js +5 -3
  28. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  29. package/dist/esm/components/menu/menu.js +45 -42
  30. package/dist/esm/components/menu/menu.js.map +1 -1
  31. package/dist/esm/components/native-popover/native-popover.js +26 -23
  32. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  33. package/dist/esm/components/popover/popover.js +34 -31
  34. package/dist/esm/components/popover/popover.js.map +1 -1
  35. package/dist/esm/components/radio/radio-group.js +6 -4
  36. package/dist/esm/components/radio/radio-group.js.map +1 -1
  37. package/dist/esm/components/radio-card/radio-card-group.js +5 -3
  38. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  39. package/dist/esm/components/toggle/toggle-group.js +6 -4
  40. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  41. package/dist/esm/components/tooltip/tooltip.js +23 -18
  42. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  43. package/dist/esm/core/components/create-component.js +31 -6
  44. package/dist/esm/core/components/create-component.js.map +1 -1
  45. package/dist/types/components/accordion/accordion.d.ts +2 -4
  46. package/dist/types/components/accordion/use-accordion.d.ts +11 -11
  47. package/dist/types/components/action-bar/action-bar.d.ts +2 -3
  48. package/dist/types/components/airy/airy.d.ts +2 -3
  49. package/dist/types/components/alert/alert.d.ts +2 -5
  50. package/dist/types/components/alert/alert.style.d.ts +1 -1
  51. package/dist/types/components/alpha-slider/alpha-slider.d.ts +2 -3
  52. package/dist/types/components/aspect-ratio/aspect-ratio.d.ts +2 -2
  53. package/dist/types/components/autocomplete/autocomplete.d.ts +2 -4
  54. package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
  55. package/dist/types/components/autocomplete/use-autocomplete.d.ts +5 -7
  56. package/dist/types/components/avatar/avatar.d.ts +5 -5
  57. package/dist/types/components/avatar/avatar.style.d.ts +1 -1
  58. package/dist/types/components/avatar/use-avatar-group.d.ts +2 -2
  59. package/dist/types/components/badge/badge.d.ts +2 -2
  60. package/dist/types/components/bleed/bleed.d.ts +2 -2
  61. package/dist/types/components/blockquote/blockquote.d.ts +2 -2
  62. package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
  63. package/dist/types/components/breadcrumb/use-breadcrumb.d.ts +2 -2
  64. package/dist/types/components/button/button-group.d.ts +0 -1
  65. package/dist/types/components/button/button.d.ts +2 -3
  66. package/dist/types/components/button/icon-button.d.ts +2 -2
  67. package/dist/types/components/calendar/calendar.d.ts +2 -3
  68. package/dist/types/components/calendar/calendar.style.d.ts +2 -2
  69. package/dist/types/components/calendar/use-calendar.d.ts +8 -9
  70. package/dist/types/components/card/card.d.ts +2 -2
  71. package/dist/types/components/carousel/carousel.d.ts +2 -3
  72. package/dist/types/components/carousel/carousel.style.d.ts +2 -2
  73. package/dist/types/components/carousel/use-carousel.d.ts +3 -3
  74. package/dist/types/components/center/center.d.ts +2 -2
  75. package/dist/types/components/chart/area-chart.d.ts +2 -2
  76. package/dist/types/components/chart/bar-chart.d.ts +2 -2
  77. package/dist/types/components/chart/chart.d.ts +5 -5
  78. package/dist/types/components/chart/composed-chart.d.ts +2 -2
  79. package/dist/types/components/chart/donut-chart.d.ts +2 -2
  80. package/dist/types/components/chart/line-chart.d.ts +2 -2
  81. package/dist/types/components/chart/pie-chart.d.ts +2 -2
  82. package/dist/types/components/chart/radar-chart.d.ts +2 -2
  83. package/dist/types/components/chart/radial-chart.d.ts +2 -2
  84. package/dist/types/components/chart/use-chart.d.ts +2 -2
  85. package/dist/types/components/checkbox/checkbox-group.d.ts +0 -2
  86. package/dist/types/components/checkbox/checkbox.d.ts +5 -6
  87. package/dist/types/components/checkbox/checkbox.style.d.ts +1 -1
  88. package/dist/types/components/checkbox/use-checkbox-group.d.ts +2 -3
  89. package/dist/types/components/checkbox/use-checkbox.d.ts +0 -1
  90. package/dist/types/components/checkbox-card/checkbox-card-group.d.ts +0 -3
  91. package/dist/types/components/checkbox-card/checkbox-card.d.ts +5 -7
  92. package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
  93. package/dist/types/components/circle-progress/circle-progress.d.ts +2 -3
  94. package/dist/types/components/close-button/close-button.d.ts +2 -3
  95. package/dist/types/components/code/code.d.ts +2 -2
  96. package/dist/types/components/collapse/collapse.d.ts +2 -3
  97. package/dist/types/components/color-picker/color-picker.d.ts +2 -6
  98. package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
  99. package/dist/types/components/color-picker/use-color-picker.d.ts +2 -5
  100. package/dist/types/components/color-selector/color-selector.d.ts +2 -6
  101. package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
  102. package/dist/types/components/color-selector/use-color-selector.d.ts +3 -5
  103. package/dist/types/components/color-swatch/color-swatch.d.ts +2 -2
  104. package/dist/types/components/container/container.d.ts +2 -2
  105. package/dist/types/components/data-list/data-list.d.ts +2 -2
  106. package/dist/types/components/data-list/data-list.style.d.ts +1 -1
  107. package/dist/types/components/date-picker/date-picker.d.ts +2 -5
  108. package/dist/types/components/date-picker/use-date-picker.d.ts +4 -7
  109. package/dist/types/components/drawer/drawer.d.ts +2 -5
  110. package/dist/types/components/drawer/drawer.style.d.ts +2 -2
  111. package/dist/types/components/drawer/use-drawer.d.ts +0 -2
  112. package/dist/types/components/dropzone/dropzone.d.ts +5 -8
  113. package/dist/types/components/dropzone/dropzone.style.d.ts +1 -1
  114. package/dist/types/components/dropzone/use-dropzone.d.ts +0 -1
  115. package/dist/types/components/editable/editable.d.ts +2 -3
  116. package/dist/types/components/editable/use-editable.d.ts +2 -3
  117. package/dist/types/components/em/em.d.ts +2 -2
  118. package/dist/types/components/empty-state/empty-state.d.ts +2 -2
  119. package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
  120. package/dist/types/components/fade/fade.d.ts +2 -3
  121. package/dist/types/components/fade-scale/fade-scale.d.ts +0 -1
  122. package/dist/types/components/field/field.d.ts +3 -3
  123. package/dist/types/components/field/use-field-props.d.ts +4 -4
  124. package/dist/types/components/fieldset/fieldset.d.ts +3 -4
  125. package/dist/types/components/file-button/file-button.d.ts +2 -4
  126. package/dist/types/components/file-button/use-file-button.d.ts +18 -20
  127. package/dist/types/components/file-input/file-input.d.ts +2 -4
  128. package/dist/types/components/file-input/file-input.style.d.ts +1 -1
  129. package/dist/types/components/file-input/use-file-input.d.ts +17 -18
  130. package/dist/types/components/flex/flex.d.ts +2 -2
  131. package/dist/types/components/flip/flip.d.ts +4 -5
  132. package/dist/types/components/float/float.d.ts +2 -2
  133. package/dist/types/components/form/form.d.ts +3 -4
  134. package/dist/types/components/format/format-byte.d.ts +4 -4
  135. package/dist/types/components/format/format-date-time.d.ts +4 -4
  136. package/dist/types/components/format/format-number.d.ts +2 -2
  137. package/dist/types/components/format/use-format-byte.d.ts +0 -1
  138. package/dist/types/components/format/use-format-date-time.d.ts +0 -1
  139. package/dist/types/components/format/use-format-number.d.ts +0 -1
  140. package/dist/types/components/grid/grid-item.d.ts +2 -2
  141. package/dist/types/components/grid/grid.d.ts +2 -2
  142. package/dist/types/components/group/group.d.ts +2 -3
  143. package/dist/types/components/group/use-group.d.ts +2 -2
  144. package/dist/types/components/heading/heading.d.ts +2 -2
  145. package/dist/types/components/highlight/highlight.d.ts +0 -2
  146. package/dist/types/components/hue-slider/hue-slider.d.ts +3 -4
  147. package/dist/types/components/icon/icon.d.ts +4 -4
  148. package/dist/types/components/image/image.d.ts +2 -2
  149. package/dist/types/components/indicator/indicator.d.ts +4 -5
  150. package/dist/types/components/infinite-scroll-area/infinite-scroll-area.d.ts +2 -2
  151. package/dist/types/components/input/input-addon.d.ts +2 -2
  152. package/dist/types/components/input/input-element.d.ts +2 -2
  153. package/dist/types/components/input/input-group.d.ts +0 -2
  154. package/dist/types/components/input/input.d.ts +2 -3
  155. package/dist/types/components/kbd/kbd.d.ts +2 -2
  156. package/dist/types/components/link/link.d.ts +2 -2
  157. package/dist/types/components/link-box/link-box.d.ts +2 -2
  158. package/dist/types/components/list/list.d.ts +2 -2
  159. package/dist/types/components/loading/loading-provider.d.ts +2 -2
  160. package/dist/types/components/loading/loading.d.ts +3 -4
  161. package/dist/types/components/loading/use-loading-component.d.ts +0 -1
  162. package/dist/types/components/mark/mark.d.ts +2 -2
  163. package/dist/types/components/menu/menu.d.ts +2 -3
  164. package/dist/types/components/menu/use-menu.d.ts +11 -11
  165. package/dist/types/components/modal/modal.d.ts +2 -6
  166. package/dist/types/components/modal/modal.style.d.ts +2 -2
  167. package/dist/types/components/native-accordion/native-accordion.d.ts +2 -2
  168. package/dist/types/components/native-accordion/use-native-accordion.d.ts +2 -2
  169. package/dist/types/components/native-popover/native-popover.d.ts +4 -4
  170. package/dist/types/components/native-select/native-select.d.ts +2 -4
  171. package/dist/types/components/native-select/use-native-select.d.ts +0 -1
  172. package/dist/types/components/native-table/native-table.d.ts +4 -4
  173. package/dist/types/components/notice/notice.style.d.ts +1 -1
  174. package/dist/types/components/notice/use-notice.d.ts +0 -3
  175. package/dist/types/components/number-input/number-input.d.ts +2 -3
  176. package/dist/types/components/number-input/number-input.style.d.ts +1 -1
  177. package/dist/types/components/number-input/use-number-input.d.ts +0 -1
  178. package/dist/types/components/pagination/pagination.d.ts +2 -3
  179. package/dist/types/components/pagination/use-pagination.d.ts +2 -2
  180. package/dist/types/components/password-input/password-input.d.ts +2 -3
  181. package/dist/types/components/password-input/strength-meter.d.ts +2 -2
  182. package/dist/types/components/password-input/strength-meter.style.d.ts +1 -1
  183. package/dist/types/components/password-input/use-password-input.d.ts +2 -3
  184. package/dist/types/components/picture/picture.d.ts +0 -1
  185. package/dist/types/components/pin-input/pin-input.d.ts +2 -4
  186. package/dist/types/components/pin-input/use-pin-input.d.ts +7 -8
  187. package/dist/types/components/popover/popover.d.ts +4 -5
  188. package/dist/types/components/progress/progress.d.ts +4 -4
  189. package/dist/types/components/progress/use-progress.d.ts +706 -706
  190. package/dist/types/components/qr-code/qr-code.d.ts +2 -2
  191. package/dist/types/components/radio/radio-group.d.ts +0 -2
  192. package/dist/types/components/radio/radio.d.ts +5 -6
  193. package/dist/types/components/radio/radio.style.d.ts +1 -1
  194. package/dist/types/components/radio/use-radio-group.d.ts +2 -3
  195. package/dist/types/components/radio/use-radio.d.ts +0 -1
  196. package/dist/types/components/radio-card/radio-card-group.d.ts +0 -3
  197. package/dist/types/components/radio-card/radio-card.d.ts +5 -7
  198. package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
  199. package/dist/types/components/rating/use-rating.d.ts +7 -8
  200. package/dist/types/components/reorder/reorder.d.ts +2 -3
  201. package/dist/types/components/reorder/reorder.style.d.ts +1 -1
  202. package/dist/types/components/reorder/use-reorder.d.ts +3 -3
  203. package/dist/types/components/resizable/resizable.d.ts +2 -2
  204. package/dist/types/components/resizable/resizable.style.d.ts +2 -2
  205. package/dist/types/components/resizable/use-resizable.d.ts +2 -2
  206. package/dist/types/components/ripple/ripple.d.ts +2 -3
  207. package/dist/types/components/ripple/use-ripple.d.ts +2 -2
  208. package/dist/types/components/rotate/rotate.d.ts +2 -3
  209. package/dist/types/components/saturation-slider/saturation-slider.d.ts +2 -2
  210. package/dist/types/components/saturation-slider/use-saturation-slider.d.ts +2 -3
  211. package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
  212. package/dist/types/components/segmented-control/segmented-control.d.ts +2 -3
  213. package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
  214. package/dist/types/components/segmented-control/use-segmented-control.d.ts +9 -10
  215. package/dist/types/components/select/select.d.ts +2 -4
  216. package/dist/types/components/select/select.style.d.ts +1 -1
  217. package/dist/types/components/select/use-select.d.ts +4 -6
  218. package/dist/types/components/separator/separator.d.ts +2 -2
  219. package/dist/types/components/sidebar/sidebar.d.ts +2 -7
  220. package/dist/types/components/sidebar/use-sidebar.d.ts +9 -9
  221. package/dist/types/components/simple-grid/simple-grid.d.ts +2 -3
  222. package/dist/types/components/skeleton/skeleton.d.ts +2 -2
  223. package/dist/types/components/slide/slide.d.ts +2 -3
  224. package/dist/types/components/slide-fade/slide-fade.d.ts +2 -3
  225. package/dist/types/components/slider/slider.d.ts +2 -2
  226. package/dist/types/components/slider/use-slider.d.ts +2 -3
  227. package/dist/types/components/snacks/snacks.d.ts +0 -2
  228. package/dist/types/components/snacks/use-snacks.d.ts +0 -1
  229. package/dist/types/components/stack/h-stack.d.ts +2 -2
  230. package/dist/types/components/stack/stack.d.ts +2 -2
  231. package/dist/types/components/stack/v-stack.d.ts +2 -2
  232. package/dist/types/components/stack/z-stack.d.ts +2 -2
  233. package/dist/types/components/stat/stat.d.ts +2 -2
  234. package/dist/types/components/status/status.d.ts +2 -2
  235. package/dist/types/components/status/status.style.d.ts +2 -2
  236. package/dist/types/components/steps/steps.d.ts +2 -2
  237. package/dist/types/components/steps/steps.style.d.ts +1 -1
  238. package/dist/types/components/steps/use-steps.d.ts +10 -10
  239. package/dist/types/components/switch/switch.d.ts +2 -2
  240. package/dist/types/components/switch/use-switch.d.ts +0 -1
  241. package/dist/types/components/table/table.d.ts +2 -4
  242. package/dist/types/components/tabs/tabs.d.ts +2 -2
  243. package/dist/types/components/tabs/tabs.style.d.ts +1 -1
  244. package/dist/types/components/tabs/use-tabs.d.ts +16 -16
  245. package/dist/types/components/tag/tag.d.ts +2 -2
  246. package/dist/types/components/tag/tag.style.d.ts +1 -1
  247. package/dist/types/components/text/text.d.ts +2 -2
  248. package/dist/types/components/textarea/textarea.d.ts +2 -4
  249. package/dist/types/components/textarea/use-autosize.d.ts +2 -2
  250. package/dist/types/components/timeline/timeline.d.ts +5 -5
  251. package/dist/types/components/timeline/timeline.style.d.ts +1 -1
  252. package/dist/types/components/tip/tip.d.ts +0 -3
  253. package/dist/types/components/toggle/toggle-group.d.ts +1 -1
  254. package/dist/types/components/toggle/toggle.d.ts +5 -7
  255. package/dist/types/components/toggle/use-toggle-group.d.ts +2 -2
  256. package/dist/types/components/toggle/use-toggle.d.ts +2 -3
  257. package/dist/types/components/tooltip/tooltip.d.ts +4 -5
  258. package/dist/types/components/tree/tree.d.ts +2 -6
  259. package/dist/types/components/tree/tree.style.d.ts +1 -1
  260. package/dist/types/components/tree/use-tree.d.ts +184 -185
  261. package/dist/types/components/visually-hidden/visually-hidden.d.ts +2 -2
  262. package/dist/types/components/wrap/wrap.d.ts +2 -3
  263. package/dist/types/core/components/create-component.d.ts +21 -10
  264. package/dist/types/core/components/index.d.ts +2 -2
  265. package/dist/types/core/components/index.types.d.ts +1 -0
  266. package/dist/types/core/components/use-component-style.d.ts +2 -0
  267. package/dist/types/core/components/utils.d.ts +1 -0
  268. package/dist/types/core/constant.d.ts +1 -0
  269. package/dist/types/core/css/calc.d.ts +1 -0
  270. package/dist/types/core/css/config.d.ts +1 -0
  271. package/dist/types/core/css/css.d.ts +1 -0
  272. package/dist/types/core/css/index.types.d.ts +1 -0
  273. package/dist/types/core/css/styles.d.ts +1 -0
  274. package/dist/types/core/css/token.d.ts +1 -0
  275. package/dist/types/core/css/use-css.d.ts +1 -0
  276. package/dist/types/core/css/utils.d.ts +2 -0
  277. package/dist/types/core/generated-theme-tokens.types.d.ts +1 -0
  278. package/dist/types/core/index.d.ts +4 -2
  279. package/dist/types/core/system/color-mode-provider.d.ts +2 -2
  280. package/dist/types/core/system/config.d.ts +1 -0
  281. package/dist/types/core/system/create-system.d.ts +1 -0
  282. package/dist/types/core/system/factory.d.ts +1 -0
  283. package/dist/types/core/system/index.types.d.ts +1 -0
  284. package/dist/types/core/system/storage-script.d.ts +3 -3
  285. package/dist/types/core/system/styled.d.ts +3 -2
  286. package/dist/types/core/system/system-provider.d.ts +2 -2
  287. package/dist/types/core/system/var.d.ts +2 -0
  288. package/dist/types/hooks/use-async-callback/index.d.ts +0 -1
  289. package/dist/types/hooks/use-breakpoint/use-breakpoint-state.d.ts +2 -2
  290. package/dist/types/hooks/use-clickable/index.d.ts +2 -2
  291. package/dist/types/hooks/use-clipboard/index.d.ts +2 -2
  292. package/dist/types/hooks/use-combobox/index.d.ts +12 -13
  293. package/dist/types/hooks/use-counter/index.d.ts +2 -2
  294. package/dist/types/hooks/use-descendants/index.d.ts +2 -2
  295. package/dist/types/hooks/use-field-sizing/index.d.ts +2 -2
  296. package/dist/types/hooks/use-hover/index.d.ts +2 -2
  297. package/dist/types/index.d.ts +3 -109
  298. package/dist/types/providers/i18n-provider/i18n-provider.d.ts +3 -3
  299. package/dist/types/providers/ui-provider/ui-provider.d.ts +2 -3
  300. package/dist/types/utils/children.d.ts +2 -2
  301. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"popover.cjs","names":["useValue","fadeScaleVariants","slideFadeVariants","createSlotComponent","popoverStyle","PopoverRoot: FC<PopoverRootProps>","usePopover","AnimatePresence","Portal","motion"],"sources":["../../../../src/components/popover/popover.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren } from \"react\"\nimport type {\n HTMLProps,\n HTMLStyledProps,\n SimplePlacement,\n StyleValue,\n ThemeProps,\n} from \"../../core\"\nimport type { Merge, ReactNodeOrFunction } from \"../../utils\"\nimport type { HTMLMotionProps, MotionTransitionProps } from \"../motion\"\nimport type { PortalProps } from \"../portal\"\nimport type { PopoverStyle } from \"./popover.style\"\nimport type { UsePopoverProps, UsePopoverReturn } from \"./use-popover\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { cast, runIfFn } from \"../../utils\"\nimport { fadeScaleVariants } from \"../fade-scale\"\nimport { motion } from \"../motion\"\nimport { Portal } from \"../portal\"\nimport { slideFadeVariants } from \"../slide-fade\"\nimport { popoverStyle } from \"./popover.style\"\nimport { usePopover } from \"./use-popover\"\n\nexport interface UsePopupAnimationProps {\n /**\n * The animation of the element.\n *\n * @default 'scale'\n */\n animationScheme?: StyleValue<\"none\" | \"scale\" | SimplePlacement>\n /**\n * The animation duration.\n *\n * @default 0.1\n */\n duration?: StyleValue<MotionTransitionProps[\"duration\"]>\n}\n\nexport const usePopupAnimationProps = (props: UsePopupAnimationProps = {}) => {\n const animationScheme = useValue(props.animationScheme ?? \"scale\")\n const duration = useValue(props.duration ?? 0.1)\n const sharedProps = { animate: \"enter\", exit: \"exit\", initial: \"exit\" }\n\n switch (animationScheme) {\n case \"scale\":\n return {\n ...sharedProps,\n custom: { duration, reverse: true, scale: 0.95 },\n variants: fadeScaleVariants,\n }\n case \"block-start\":\n return {\n ...sharedProps,\n custom: { duration, offsetY: -16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"inline-end\":\n return {\n ...sharedProps,\n custom: { duration, offsetX: 16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"inline-start\":\n return {\n ...sharedProps,\n custom: { duration, offsetX: -16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"block-end\":\n return {\n ...sharedProps,\n custom: { duration, offsetY: 16, reverse: true },\n variants: slideFadeVariants,\n }\n default:\n return {}\n }\n}\n\nexport interface UsePopoverStyleProps {\n /**\n * If `true`, the popper will change its placement and flip when it's about to overflow its boundary area.\n *\n * @default true\n */\n flip?: StyleValue<UsePopoverProps[\"flip\"]>\n /**\n * The distance or margin between the reference and popper.\n * It is used internally to create an `offset` modifier.\n *\n * @default 8\n */\n gutter?: StyleValue<UsePopoverProps[\"gutter\"]>\n /**\n * If `true`, the popper will match the width of the reference at all times.\n * It's useful for `autocomplete`, `date-picker` and `select` patterns.\n *\n * @default false\n */\n matchWidth?: StyleValue<UsePopoverProps[\"matchWidth\"]>\n /**\n * The placement of the popper relative to its reference.\n *\n * @default 'end'\n */\n placement?: StyleValue<UsePopoverProps[\"placement\"]>\n /**\n * The CSS positioning strategy to use.\n *\n * @default 'absolute'\n */\n strategy?: StyleValue<UsePopoverProps[\"strategy\"]>\n}\n\nexport const usePopoverStyleProps = (props: UsePopoverStyleProps = {}) => {\n const placement = useValue(props.placement)\n const gutter = useValue(props.gutter)\n const matchWidth = useValue(props.matchWidth)\n const strategy = useValue(props.strategy)\n const flip = useValue(props.flip)\n\n return {\n flip,\n gutter,\n matchWidth,\n placement,\n strategy,\n }\n}\n\ninterface ComponentContext\n extends\n Pick<\n UsePopoverReturn,\n | \"getAnchorProps\"\n | \"getBodyProps\"\n | \"getCloseTriggerProps\"\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getPositionerProps\"\n | \"getTriggerProps\"\n | \"open\"\n >,\n UsePopupAnimationProps {}\n\nexport interface PopoverRootProps\n extends\n Merge<UsePopoverProps, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<PopoverStyle> {\n /**\n * The children of the popover.\n */\n children?: ReactNodeOrFunction<{\n open: boolean\n onClose: () => void\n }>\n}\n\nconst {\n ComponentContext,\n PropsContext: PopoverPropsContext,\n StyleContext,\n useComponentContext,\n usePropsContext: usePopoverPropsContext,\n withContext,\n useRootComponentProps,\n} = createSlotComponent<PopoverRootProps, PopoverStyle, ComponentContext>(\n \"popover\",\n popoverStyle,\n)\n\nexport { PopoverPropsContext, usePopoverPropsContext }\n\n/**\n * `Popover` is a component that floats around an element to display information.\n *\n * @see https://yamada-ui.com/docs/components/popover\n */\nexport const PopoverRoot: FC<PopoverRootProps> = (props) => {\n const styleProps = usePopoverStyleProps(props)\n const [styleContext, { animationScheme, children, duration, ...rest }] =\n useRootComponentProps({ ...props, ...styleProps })\n const {\n open,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n onClose,\n } = usePopover(rest)\n const componentContext = useMemo(\n () => ({\n animationScheme,\n duration,\n open,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n }),\n [\n open,\n animationScheme,\n duration,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n ],\n )\n\n return (\n <StyleContext value={styleContext}>\n <ComponentContext value={componentContext}>\n {runIfFn(children, { open, onClose })}\n </ComponentContext>\n </StyleContext>\n )\n}\n\nexport interface PopoverTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const PopoverTrigger = withContext<\"button\", PopoverTriggerProps>(\n \"button\",\n \"trigger\",\n)({ asChild: true }, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return getTriggerProps(props)\n})\n\nexport interface PopoverCloseTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const PopoverCloseTrigger = withContext<\n \"button\",\n PopoverCloseTriggerProps\n>(\"button\", { name: \"CloseTrigger\", slot: [\"trigger\", \"close\"] })(\n { asChild: true },\n (props) => {\n const { getCloseTriggerProps } = useComponentContext()\n\n return getCloseTriggerProps(props)\n },\n)\n\nexport interface PopoverAnchorProps extends HTMLStyledProps {}\n\nexport const PopoverAnchor = withContext<\"div\", PopoverAnchorProps>(\n \"div\",\n \"anchor\",\n)({ asChild: true }, (props) => {\n const { getAnchorProps } = useComponentContext()\n\n return getAnchorProps(props)\n})\n\ninterface PopoverPositionerProps extends HTMLStyledProps {}\n\nconst PopoverPositioner = withContext<\"div\", PopoverPositionerProps>(\n \"div\",\n \"positioner\",\n)(undefined, (props) => {\n const { getPositionerProps } = useComponentContext()\n\n return getPositionerProps(props)\n})\n\nexport interface PopoverContentProps\n extends Omit<HTMLMotionProps, \"children\">, PropsWithChildren {\n /**\n * Props for portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n}\n\nexport const PopoverContent = withContext<\"div\", PopoverContentProps>(\n ({ portalProps, ...rest }) => {\n const { animationScheme, duration, open, getContentProps } =\n useComponentContext()\n const popupAnimationProps = usePopupAnimationProps({\n animationScheme,\n duration,\n })\n\n return (\n <AnimatePresence>\n {open ? (\n <Portal {...portalProps}>\n <PopoverPositioner>\n <motion.div\n {...popupAnimationProps}\n {...cast<HTMLMotionProps>(\n getContentProps(cast<HTMLProps>(rest)),\n )}\n />\n </PopoverPositioner>\n </Portal>\n ) : null}\n </AnimatePresence>\n )\n },\n \"content\",\n)()\n\nexport interface PopoverHeaderProps extends HTMLStyledProps {}\n\nexport const PopoverHeader = withContext<\"div\", PopoverHeaderProps>(\n \"div\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n\n return getHeaderProps(props)\n})\n\nexport interface PopoverBodyProps extends HTMLStyledProps {}\n\nexport const PopoverBody = withContext<\"div\", PopoverBodyProps>(\"div\", \"body\")(\n undefined,\n (props) => {\n const { getBodyProps } = useComponentContext()\n\n return getBodyProps(props)\n },\n)\n\nexport interface PopoverFooterProps extends HTMLStyledProps {}\n\nexport const PopoverFooter = withContext<\"div\", PopoverFooterProps>(\n \"div\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n\n return getFooterProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,0BAA0B,QAAgC,EAAE,KAAK;CAC5E,MAAM,kBAAkBA,uCAAS,MAAM,mBAAmB,QAAQ;CAClE,MAAM,WAAWA,uCAAS,MAAM,YAAY,GAAI;CAChD,MAAM,cAAc;EAAE,SAAS;EAAS,MAAM;EAAQ,SAAS;EAAQ;AAEvE,SAAQ,iBAAR;EACE,KAAK,QACH,QAAO;GACL,GAAG;GACH,QAAQ;IAAE;IAAU,SAAS;IAAM,OAAO;IAAM;GAChD,UAAUC;GACX;EACH,KAAK,cACH,QAAO;GACL,GAAG;GACH,QAAQ;IAAE;IAAU,SAAS;IAAK,SAAS;IAAM;GACjD,UAAUC;GACX;EACH,KAAK,aACH,QAAO;GACL,GAAG;GACH,QAAQ;IAAE;IAAU,SAAS;IAAI,SAAS;IAAM;GAChD,UAAUA;GACX;EACH,KAAK,eACH,QAAO;GACL,GAAG;GACH,QAAQ;IAAE;IAAU,SAAS;IAAK,SAAS;IAAM;GACjD,UAAUA;GACX;EACH,KAAK,YACH,QAAO;GACL,GAAG;GACH,QAAQ;IAAE;IAAU,SAAS;IAAI,SAAS;IAAM;GAChD,UAAUA;GACX;EACH,QACE,QAAO,EAAE;;;AAuCf,MAAa,wBAAwB,QAA8B,EAAE,KAAK;CACxE,MAAM,Y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M,EAAE,mBAAmB,qBAAqB;AAEhD,QAAO,eAAe,MAAM;EAC5B;AAIF,MAAM,oBAAoB,YACxB,OACA,aACD,CAAC,SAAY,UAAU;CACtB,MAAM,EAAE,uBAAuB,qBAAqB;AAEpD,QAAO,mBAAmB,MAAM;EAChC;AAUF,MAAa,iBAAiB,aAC3B,EAAE,aAAa,GAAG,WAAW;CAC5B,MAAM,EAAE,iBAAiB,UAAU,MAAM,oBACvC,qBAAqB;CACvB,MAAM,sBAAsB,uBAAuB;EACjD;EACA;EACD,CAAC;AAEF,QACE,2CAACC,0CACE,OACC,2CAACC;EAAO,GAAI;YACV,2CAAC,+BACC,2CAACC,uBAAO;GACN,GAAI;GACJ,+CACE,4DAAgC,KAAK,CAAC,CACvC;IACD,GACgB;GACb,GACP,OACY;GAGtB,UACD,EAAE;AAIH,MAAa,gBAAgB,YAC3B,OACA,SACD,CAAC,SAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,qBAAqB;AAEhD,QAAO,eAAe,MAAM;EAC5B;AAIF,MAAa,cAAc,YAAqC,OAAO,OAAO,CAC5E,SACC,UAAU;CACT,MAAM,EAAE,iBAAiB,qBAAqB;AAE9C,QAAO,aAAa,MAAM;EAE7B;AAID,MAAa,gBAAgB,YAC3B,OACA,SACD,CAAC,SAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,qBAAqB;AAEhD,QAAO,eAAe,MAAM;EAC5B"}
1
+ {"version":3,"file":"popover.cjs","names":["useValue","fadeScaleVariants","slideFadeVariants","createSlotComponent","popoverStyle","PopoverRoot: FC<PopoverRootProps>","usePopover","AnimatePresence","Portal","motion"],"sources":["../../../../src/components/popover/popover.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren } from \"react\"\nimport type {\n HTMLProps,\n HTMLStyledProps,\n SimplePlacement,\n StyleValue,\n ThemeProps,\n} from \"../../core\"\nimport type { Merge, ReactNodeOrFunction } from \"../../utils\"\nimport type { HTMLMotionProps, MotionTransitionProps } from \"../motion\"\nimport type { PortalProps } from \"../portal\"\nimport type { PopoverStyle } from \"./popover.style\"\nimport type { UsePopoverProps, UsePopoverReturn } from \"./use-popover\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { cast, runIfFn } from \"../../utils\"\nimport { fadeScaleVariants } from \"../fade-scale\"\nimport { motion } from \"../motion\"\nimport { Portal } from \"../portal\"\nimport { slideFadeVariants } from \"../slide-fade\"\nimport { popoverStyle } from \"./popover.style\"\nimport { usePopover } from \"./use-popover\"\n\nexport interface UsePopupAnimationProps {\n /**\n * The animation of the element.\n *\n * @default 'scale'\n */\n animationScheme?: StyleValue<\"none\" | \"scale\" | SimplePlacement>\n /**\n * The animation duration.\n *\n * @default 0.1\n */\n duration?: StyleValue<MotionTransitionProps[\"duration\"]>\n}\n\nexport const usePopupAnimationProps = (props: UsePopupAnimationProps = {}) => {\n const animationScheme = useValue(props.animationScheme ?? \"scale\")\n const duration = useValue(props.duration ?? 0.1)\n const sharedProps = { animate: \"enter\", exit: \"exit\", initial: \"exit\" }\n\n switch (animationScheme) {\n case \"scale\":\n return {\n ...sharedProps,\n custom: { duration, reverse: true, scale: 0.95 },\n variants: fadeScaleVariants,\n }\n case \"block-start\":\n return {\n ...sharedProps,\n custom: { duration, offsetY: -16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"inline-end\":\n return {\n ...sharedProps,\n custom: { duration, offsetX: 16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"inline-start\":\n return {\n ...sharedProps,\n custom: { duration, offsetX: -16, reverse: true },\n variants: slideFadeVariants,\n }\n case \"block-end\":\n return {\n ...sharedProps,\n custom: { duration, offsetY: 16, reverse: true },\n variants: slideFadeVariants,\n }\n default:\n return {}\n }\n}\n\nexport interface UsePopoverStyleProps {\n /**\n * If `true`, the popper will change its placement and flip when it's about to overflow its boundary area.\n *\n * @default true\n */\n flip?: StyleValue<UsePopoverProps[\"flip\"]>\n /**\n * The distance or margin between the reference and popper.\n * It is used internally to create an `offset` modifier.\n *\n * @default 8\n */\n gutter?: StyleValue<UsePopoverProps[\"gutter\"]>\n /**\n * If `true`, the popper will match the width of the reference at all times.\n * It's useful for `autocomplete`, `date-picker` and `select` patterns.\n *\n * @default false\n */\n matchWidth?: StyleValue<UsePopoverProps[\"matchWidth\"]>\n /**\n * The placement of the popper relative to its reference.\n *\n * @default 'end'\n */\n placement?: StyleValue<UsePopoverProps[\"placement\"]>\n /**\n * The CSS positioning strategy to use.\n *\n * @default 'absolute'\n */\n strategy?: StyleValue<UsePopoverProps[\"strategy\"]>\n}\n\nexport const usePopoverStyleProps = (props: UsePopoverStyleProps = {}) => {\n const placement = useValue(props.placement)\n const gutter = useValue(props.gutter)\n const matchWidth = useValue(props.matchWidth)\n const strategy = useValue(props.strategy)\n const flip = useValue(props.flip)\n\n return {\n flip,\n gutter,\n matchWidth,\n placement,\n strategy,\n }\n}\n\ninterface ComponentContext\n extends\n Pick<\n UsePopoverReturn,\n | \"getAnchorProps\"\n | \"getBodyProps\"\n | \"getCloseTriggerProps\"\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getPositionerProps\"\n | \"getTriggerProps\"\n | \"open\"\n >,\n UsePopupAnimationProps {}\n\nexport interface PopoverRootProps\n extends\n Merge<UsePopoverProps, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<PopoverStyle>,\n Pick<HTMLProps, \"suppressHydrationWarning\"> {\n /**\n * The children of the popover.\n */\n children?: ReactNodeOrFunction<{\n open: boolean\n onClose: () => void\n }>\n}\n\nconst {\n ComponentContext,\n HydrationContext,\n PropsContext: PopoverPropsContext,\n StyleContext,\n useComponentContext,\n usePropsContext: usePopoverPropsContext,\n withContext,\n useRootComponentProps,\n} = createSlotComponent<PopoverRootProps, PopoverStyle, ComponentContext>(\n \"popover\",\n popoverStyle,\n)\n\nexport { PopoverPropsContext, usePopoverPropsContext }\n\n/**\n * `Popover` is a component that floats around an element to display information.\n *\n * @see https://yamada-ui.com/docs/components/popover\n */\nexport const PopoverRoot: FC<PopoverRootProps> = (props) => {\n const styleProps = usePopoverStyleProps(props)\n const [\n styleContext,\n { animationScheme, children, duration, suppressHydrationWarning, ...rest },\n ] = useRootComponentProps({ ...props, ...styleProps })\n const {\n open,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n onClose,\n } = usePopover(rest)\n const hydrationContext = useMemo(\n () => (suppressHydrationWarning ? { suppressHydrationWarning } : {}),\n [suppressHydrationWarning],\n )\n const componentContext = useMemo(\n () => ({\n animationScheme,\n duration,\n open,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n }),\n [\n open,\n animationScheme,\n duration,\n getAnchorProps,\n getBodyProps,\n getCloseTriggerProps,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getPositionerProps,\n getTriggerProps,\n ],\n )\n\n return (\n <StyleContext value={styleContext}>\n <HydrationContext value={hydrationContext}>\n <ComponentContext value={componentContext}>\n {runIfFn(children, { open, onClose })}\n </ComponentContext>\n </HydrationContext>\n </StyleContext>\n )\n}\n\nexport interface PopoverTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const PopoverTrigger = withContext<\"button\", PopoverTriggerProps>(\n \"button\",\n \"trigger\",\n)({ asChild: true }, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return getTriggerProps(props)\n})\n\nexport interface PopoverCloseTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const PopoverCloseTrigger = withContext<\n \"button\",\n PopoverCloseTriggerProps\n>(\"button\", { name: \"CloseTrigger\", slot: [\"trigger\", \"close\"] })(\n { asChild: true },\n (props) => {\n const { getCloseTriggerProps } = useComponentContext()\n\n return getCloseTriggerProps(props)\n },\n)\n\nexport interface PopoverAnchorProps extends HTMLStyledProps {}\n\nexport const PopoverAnchor = withContext<\"div\", PopoverAnchorProps>(\n \"div\",\n \"anchor\",\n)({ asChild: true }, (props) => {\n const { getAnchorProps } = useComponentContext()\n\n return getAnchorProps(props)\n})\n\ninterface PopoverPositionerProps extends HTMLStyledProps {}\n\nconst PopoverPositioner = withContext<\"div\", PopoverPositionerProps>(\n \"div\",\n \"positioner\",\n)(undefined, (props) => {\n const { getPositionerProps } = useComponentContext()\n\n return getPositionerProps(props)\n})\n\nexport interface PopoverContentProps\n extends Omit<HTMLMotionProps, \"children\">, PropsWithChildren {\n /**\n * Props for portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n}\n\nexport const PopoverContent = withContext<\"div\", PopoverContentProps>(\n ({ portalProps, ...rest }) => {\n const { animationScheme, duration, open, getContentProps } =\n useComponentContext()\n const popupAnimationProps = usePopupAnimationProps({\n animationScheme,\n duration,\n })\n\n return (\n <AnimatePresence>\n {open ? (\n <Portal {...portalProps}>\n <PopoverPositioner>\n <motion.div\n {...popupAnimationProps}\n {...cast<HTMLMotionProps>(\n getContentProps(cast<HTMLProps>(rest)),\n )}\n />\n </PopoverPositioner>\n </Portal>\n ) : null}\n </AnimatePresence>\n )\n },\n \"content\",\n)()\n\nexport interface PopoverHeaderProps extends HTMLStyledProps {}\n\nexport const PopoverHeader = withContext<\"div\", PopoverHeaderProps>(\n \"div\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n\n return getHeaderProps(props)\n})\n\nexport interface PopoverBodyProps extends HTMLStyledProps {}\n\nexport const PopoverBody = withContext<\"div\", PopoverBodyProps>(\"div\", \"body\")(\n undefined,\n (props) => {\n const { getBodyProps } = useComponentContext()\n\n return getBodyProps(props)\n },\n)\n\nexport interface PopoverFooterProps extends HTMLStyledProps {}\n\nexport const PopoverFooter = withContext<\"div\", PopoverFooterProps>(\n \"div\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentCont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AM,oBACvC,qBAAqB;CACvB,MAAM,sBAAsB,uBAAuB;EACjD;EACA;EACD,CAAC;AAEF,QACE,2CAACC,0CACE,OACC,2CAACC;EAAO,GAAI;YACV,2CAAC,+BACC,2CAACC,uBAAO;GACN,GAAI;GACJ,+CACE,4DAAgC,KAAK,CAAC,CACvC;IACD,GACgB;GACb,GACP,OACY;GAGtB,UACD,EAAE;AAIH,MAAa,gBAAgB,YAC3B,OACA,SACD,CAAC,SAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,qBAAqB;AAEhD,QAAO,eAAe,MAAM;EAC5B;AAIF,MAAa,cAAc,YAAqC,OAAO,OAAO,CAC5E,SACC,UAAU;CACT,MAAM,EAAE,iBAAiB,qBAAqB;AAE9C,QAAO,aAAa,MAAM;EAE7B;AAID,MAAa,gBAAgB,YAC3B,OACA,SACD,CAAC,SAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,qBAAqB;AAEhD,QAAO,eAAe,MAAM;EAC5B"}
@@ -15,7 +15,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
15
15
  * @see https://yamada-ui.com/docs/components/radio
16
16
  */
17
17
  const RadioGroupRoot = require_radio.component((props) => {
18
- const [, { colorScheme, size, variant, children, disabled, errorBorderColor, focusBorderColor, invalid, items = [], readOnly, shape, ...rest }] = require_radio.useRootComponentProps(props, "group", { transferProps: [
18
+ const [, { colorScheme, size, variant, children, disabled, errorBorderColor, focusBorderColor, invalid, items = [], readOnly, shape, suppressHydrationWarning, ...rest }] = require_radio.useRootComponentProps(props, "group", { transferProps: [
19
19
  "variant",
20
20
  "colorScheme",
21
21
  "size",
@@ -40,7 +40,8 @@ const RadioGroupRoot = require_radio.component((props) => {
40
40
  focusBorderColor,
41
41
  invalid,
42
42
  readOnly,
43
- shape
43
+ shape,
44
+ suppressHydrationWarning
44
45
  }), [
45
46
  variant,
46
47
  size,
@@ -50,7 +51,8 @@ const RadioGroupRoot = require_radio.component((props) => {
50
51
  invalid,
51
52
  readOnly,
52
53
  errorBorderColor,
53
- focusBorderColor
54
+ focusBorderColor,
55
+ suppressHydrationWarning
54
56
  ]),
55
57
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_radio_group.RadioGroupContext, {
56
58
  value: (0, react.useMemo)(() => ({
@@ -68,7 +70,7 @@ const RadioGroupRoot = require_radio.component((props) => {
68
70
  ]),
69
71
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_group.Group, {
70
72
  orientation: "vertical",
71
- ...getRootProps(),
73
+ ...getRootProps({ suppressHydrationWarning }),
72
74
  children: computedChildren
73
75
  })
74
76
  })
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.cjs","names":["component","useRootComponentProps","useRadioGroup","rest","Radio","value","RadioPropsContext","RadioGroupContext","Group"],"sources":["../../../../src/components/radio/radio-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { RadioProps } from \"./radio\"\nimport type { RadioStyle } from \"./radio.style\"\nimport type { UseRadioGroupProps } from \"./use-radio-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport {\n component,\n Radio,\n RadioPropsContext,\n useRootComponentProps,\n} from \"./radio\"\nimport { RadioGroupContext, useRadioGroup } from \"./use-radio-group\"\n\nexport interface RadioGroupItem<\n Y extends string = string,\n> extends RadioProps<Y> {\n label: ReactNode\n}\n\nexport interface RadioGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, RadioStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<RadioStyle>,\n UseRadioGroupProps<Y>,\n UseInputBorderProps {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: RadioGroupItem<Y>[]\n}\n\n/**\n * `RadioGroup` is a component that groups `Radio` components.\n *\n * @see https://yamada-ui.com/docs/components/radio\n */\nexport const RadioGroupRoot = component<\"div\", RadioGroupRootProps>((props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n readOnly,\n shape,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { name, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useRadioGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ label, value, ...rest }, index) => (\n <Radio key={value ?? index} value={value} {...rest}>\n {label}\n </Radio>\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n }),\n [\n variant,\n size,\n colorScheme,\n shape,\n disabled,\n invalid,\n readOnly,\n errorBorderColor,\n focusBorderColor,\n ],\n )\n const groupContext = useMemo(\n () => ({ name, value, getInputProps, getLabelProps, onChange }),\n [name, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <RadioPropsContext value={context}>\n <RadioGroupContext value={groupContext}>\n <Group orientation=\"vertical\" {...getRootProps()}>\n {computedChildren}\n </Group>\n </RadioGroupContext>\n </RadioPropsContext>\n )\n}, \"group\")() as GenericsComponent<{\n <Y extends string = string>(props: RadioGroupRootProps<Y>): ReactElement\n}>\n\nexport { Radio as RadioGroupItem }\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,MAAa,iBAAiBA,yBAAuC,UAAU;CAC7E,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,EAAE,EACV,UACA,OACA,GAAG,UAEHC,oCAAsB,OAAO,SAAS,EACxC,eAAe;EAAC;EAAW;EAAe;EAAQ;EAAQ,EAC3D,CAAC;CACF,MAAM,EAAE,MAAM,OAAO,eAAe,eAAe,cAAc,aAC/DC,sCAAc,KAAK;CACrB,MAAM,4CAAiC;AACrC,MAAI,SAAU,QAAO;AAErB,SAAO,MAAM,KAAK,EAAE,OAAO,gBAAO,GAAGC,UAAQ,UAC3C,2CAACC;GAA2B,OAAOC;GAAO,GAAIF;aAC3C;KADSE,WAAS,MAEb,CACR;IACD,CAAC,OAAO,SAAS,CAAC;AA8BrB,QACE,2CAACC;EAAkB,iCA7BZ;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;YAQG,2CAACC;GAAkB,iCANd;IAAE;IAAM;IAAO;IAAe;IAAe;IAAU,GAC9D;IAAC;IAAM;IAAO;IAAe;IAAe;IAAS,CACtD;aAKK,2CAACC;IAAM,aAAY;IAAW,GAAI,cAAc;cAC7C;KACK;IACU;GACF;GAErB,QAAQ,EAAE"}
1
+ {"version":3,"file":"radio-group.cjs","names":["component","useRootComponentProps","useRadioGroup","rest","Radio","value","RadioPropsContext","RadioGroupContext","Group"],"sources":["../../../../src/components/radio/radio-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { RadioProps } from \"./radio\"\nimport type { RadioStyle } from \"./radio.style\"\nimport type { UseRadioGroupProps } from \"./use-radio-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport {\n component,\n Radio,\n RadioPropsContext,\n useRootComponentProps,\n} from \"./radio\"\nimport { RadioGroupContext, useRadioGroup } from \"./use-radio-group\"\n\nexport interface RadioGroupItem<\n Y extends string = string,\n> extends RadioProps<Y> {\n label: ReactNode\n}\n\nexport interface RadioGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, RadioStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<RadioStyle>,\n UseRadioGroupProps<Y>,\n UseInputBorderProps {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: RadioGroupItem<Y>[]\n}\n\n/**\n * `RadioGroup` is a component that groups `Radio` components.\n *\n * @see https://yamada-ui.com/docs/components/radio\n */\nexport const RadioGroupRoot = component<\"div\", RadioGroupRootProps>((props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n readOnly,\n shape,\n suppressHydrationWarning,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { name, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useRadioGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ label, value, ...rest }, index) => (\n <Radio key={value ?? index} value={value} {...rest}>\n {label}\n </Radio>\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n suppressHydrationWarning,\n }),\n [\n variant,\n size,\n colorScheme,\n shape,\n disabled,\n invalid,\n readOnly,\n errorBorderColor,\n focusBorderColor,\n suppressHydrationWarning,\n ],\n )\n const groupContext = useMemo(\n () => ({ name, value, getInputProps, getLabelProps, onChange }),\n [name, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <RadioPropsContext value={context}>\n <RadioGroupContext value={groupContext}>\n <Group\n orientation=\"vertical\"\n {...getRootProps({ suppressHydrationWarning })}\n >\n {computedChildren}\n </Group>\n </RadioGroupContext>\n </RadioPropsContext>\n )\n}, \"group\")() as GenericsComponent<{\n <Y extends string = string>(props: RadioGroupRootProps<Y>): ReactElement\n}>\n\nexport { Radio as RadioGroupItem }\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,MAAa,iBAAiBA,yBAAuC,UAAU;CAC7E,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,EAAE,EACV,UACA,OACA,0BACA,GAAG,UAEHC,oCAAsB,OAAO,SAAS,EACxC,eAAe;EAAC;EAAW;EAAe;EAAQ;EAAQ,EAC3D,CAAC;CACF,MAAM,EAAE,MAAM,OAAO,eAAe,eAAe,cAAc,aAC/DC,sCAAc,KAAK;CACrB,MAAM,4CAAiC;AACrC,MAAI,SAAU,QAAO;AAErB,SAAO,MAAM,KAAK,EAAE,OAAO,gBAAO,GAAGC,UAAQ,UAC3C,2CAACC;GAA2B,OAAOC;GAAO,GAAIF;aAC3C;KADSE,WAAS,MAEb,CACR;IACD,CAAC,OAAO,SAAS,CAAC;AAgCrB,QACE,2CAACC;EAAkB,iCA/BZ;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;YAQG,2CAACC;GAAkB,iCANd;IAAE;IAAM;IAAO;IAAe;IAAe;IAAU,GAC9D;IAAC;IAAM;IAAO;IAAe;IAAe;IAAS,CACtD;aAKK,2CAACC;IACC,aAAY;IACZ,GAAI,aAAa,EAAE,0BAA0B,CAAC;cAE7C;KACK;IACU;GACF;GAErB,QAAQ,EAAE"}
@@ -16,7 +16,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
16
16
  * @see https://yamada-ui.com/docs/components/radio-card
17
17
  */
18
18
  const RadioCardGroupRoot = require_radio_card.component((props) => {
19
- const [, { colorScheme, size, variant, children, disabled, errorBorderColor, focusBorderColor, invalid, items = [], justify, readOnly, shape, withIndicator, ...rest }] = require_radio_card.useRootComponentProps(props, "group", { transferProps: [
19
+ const [, { colorScheme, size, variant, children, disabled, errorBorderColor, focusBorderColor, invalid, items = [], justify, readOnly, shape, suppressHydrationWarning, withIndicator, ...rest }] = require_radio_card.useRootComponentProps(props, "group", { transferProps: [
20
20
  "variant",
21
21
  "colorScheme",
22
22
  "size",
@@ -44,6 +44,7 @@ const RadioCardGroupRoot = require_radio_card.component((props) => {
44
44
  justify,
45
45
  readOnly,
46
46
  shape,
47
+ suppressHydrationWarning,
47
48
  withIndicator
48
49
  }), [
49
50
  colorScheme,
@@ -56,7 +57,8 @@ const RadioCardGroupRoot = require_radio_card.component((props) => {
56
57
  focusBorderColor,
57
58
  invalid,
58
59
  readOnly,
59
- shape
60
+ shape,
61
+ suppressHydrationWarning
60
62
  ]),
61
63
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_radio_group.RadioGroupContext, {
62
64
  value: (0, react.useMemo)(() => ({
@@ -73,7 +75,7 @@ const RadioCardGroupRoot = require_radio_card.component((props) => {
73
75
  onChange
74
76
  ]),
75
77
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_group.Group, {
76
- ...getRootProps(),
78
+ ...getRootProps({ suppressHydrationWarning }),
77
79
  children: computedChildren
78
80
  })
79
81
  })
@@ -1 +1 @@
1
- {"version":3,"file":"radio-card-group.cjs","names":["component","useRootComponentProps","useRadioGroup","rest","RadioCardRoot","value","RadioCardPropsContext","RadioGroupContext","Group"],"sources":["../../../../src/components/radio-card/radio-card-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UseRadioGroupProps } from \"../radio\"\nimport type { RadioCardRootProps } from \"./radio-card\"\nimport type { RadioCardStyle } from \"./radio-card.style\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport { RadioGroupContext, useRadioGroup } from \"../radio\"\nimport {\n component,\n RadioCardPropsContext,\n RadioCardRoot,\n useRootComponentProps,\n} from \"./radio-card\"\n\nexport interface RadioCardGroupItem<\n Y extends string = string,\n> extends RadioCardRootProps<Y> {}\n\nexport interface RadioCardGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, RadioCardStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<RadioCardStyle>,\n UseRadioGroupProps<Y>,\n UseInputBorderProps,\n Pick<RadioCardRootProps, \"withIndicator\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: RadioCardGroupItem<Y>[]\n}\n\n/**\n * `RadioCardGroup` is a component that groups `RadioCard` components.\n *\n * @see https://yamada-ui.com/docs/components/radio-card\n */\nexport const RadioCardGroupRoot = component<\"div\", RadioCardGroupRootProps>(\n (props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n justify,\n readOnly,\n shape,\n withIndicator,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\n \"variant\",\n \"colorScheme\",\n \"size\",\n \"shape\",\n \"justify\",\n \"withIndicator\",\n ],\n })\n const {\n name,\n value,\n getInputProps,\n getLabelProps,\n getRootProps,\n onChange,\n } = useRadioGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ value, ...rest }, index) => (\n <RadioCardRoot key={value ?? index} value={value} {...rest} />\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n justify,\n readOnly,\n shape,\n withIndicator,\n }),\n [\n colorScheme,\n size,\n variant,\n disabled,\n justify,\n withIndicator,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n ],\n )\n const groupContext = useMemo(\n () => ({ name, value, getInputProps, getLabelProps, onChange }),\n [name, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <RadioCardPropsContext value={context}>\n <RadioGroupContext value={groupContext}>\n <Group {...getRootProps()}>{computedChildren}</Group>\n </RadioGroupContext>\n </RadioCardPropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: RadioCardGroupRootProps<Y>): ReactElement\n}>\n\nexport { RadioCardRoot as RadioCardGroupItem }\n"],"mappings":";;;;;;;;;;;;;;;;;AAkDA,MAAa,qBAAqBA,8BAC/B,UAAU;CACT,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,EAAE,EACV,SACA,UACA,OACA,eACA,GAAG,UAEHC,yCAAsB,OAAO,SAAS,EACxC,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;CACF,MAAM,EACJ,MACA,OACA,eACA,eACA,cACA,aACEC,sCAAc,KAAK;CACvB,MAAM,4CAAiC;AACrC,MAAI,SAAU,QAAO;AAErB,SAAO,MAAM,KAAK,EAAE,gBAAO,GAAGC,UAAQ,UACpC,2CAACC;GAAmC,OAAOC;GAAO,GAAIF;KAAlCE,WAAS,MAAiC,CAC9D;IACD,CAAC,OAAO,SAAS,CAAC;AAkCrB,QACE,2CAACC;EAAsB,iCAjChB;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;YAQG,2CAACC;GAAkB,iCANd;IAAE;IAAM;IAAO;IAAe;IAAe;IAAU,GAC9D;IAAC;IAAM;IAAO;IAAe;IAAe;IAAS,CACtD;aAKK,2CAACC;IAAM,GAAI,cAAc;cAAG;KAAyB;IACnC;GACE;GAG5B,QACD,EAAE"}
1
+ {"version":3,"file":"radio-card-group.cjs","names":["component","useRootComponentProps","useRadioGroup","rest","RadioCardRoot","value","RadioCardPropsContext","RadioGroupContext","Group"],"sources":["../../../../src/components/radio-card/radio-card-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UseRadioGroupProps } from \"../radio\"\nimport type { RadioCardRootProps } from \"./radio-card\"\nimport type { RadioCardStyle } from \"./radio-card.style\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport { RadioGroupContext, useRadioGroup } from \"../radio\"\nimport {\n component,\n RadioCardPropsContext,\n RadioCardRoot,\n useRootComponentProps,\n} from \"./radio-card\"\n\nexport interface RadioCardGroupItem<\n Y extends string = string,\n> extends RadioCardRootProps<Y> {}\n\nexport interface RadioCardGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, RadioCardStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<RadioCardStyle>,\n UseRadioGroupProps<Y>,\n UseInputBorderProps,\n Pick<RadioCardRootProps, \"withIndicator\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: RadioCardGroupItem<Y>[]\n}\n\n/**\n * `RadioCardGroup` is a component that groups `RadioCard` components.\n *\n * @see https://yamada-ui.com/docs/components/radio-card\n */\nexport const RadioCardGroupRoot = component<\"div\", RadioCardGroupRootProps>(\n (props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n justify,\n readOnly,\n shape,\n suppressHydrationWarning,\n withIndicator,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\n \"variant\",\n \"colorScheme\",\n \"size\",\n \"shape\",\n \"justify\",\n \"withIndicator\",\n ],\n })\n const {\n name,\n value,\n getInputProps,\n getLabelProps,\n getRootProps,\n onChange,\n } = useRadioGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ value, ...rest }, index) => (\n <RadioCardRoot key={value ?? index} value={value} {...rest} />\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n justify,\n readOnly,\n shape,\n suppressHydrationWarning,\n withIndicator,\n }),\n [\n colorScheme,\n size,\n variant,\n disabled,\n justify,\n withIndicator,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n suppressHydrationWarning,\n ],\n )\n const groupContext = useMemo(\n () => ({ name, value, getInputProps, getLabelProps, onChange }),\n [name, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <RadioCardPropsContext value={context}>\n <RadioGroupContext value={groupContext}>\n <Group {...getRootProps({ suppressHydrationWarning })}>\n {computedChildren}\n </Group>\n </RadioGroupContext>\n </RadioCardPropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: RadioCardGroupRootProps<Y>): ReactElement\n}>\n\nexport { RadioCardRoot as RadioCardGroupItem }\n"],"mappings":";;;;;;;;;;;;;;;;;AAkDA,MAAa,qBAAqBA,8BAC/B,UAAU;CACT,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,EAAE,EACV,SACA,UACA,OACA,0BACA,eACA,GAAG,UAEHC,yCAAsB,OAAO,SAAS,EACxC,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;CACF,MAAM,EACJ,MACA,OACA,eACA,eACA,cACA,aACEC,sCAAc,KAAK;CACvB,MAAM,4CAAiC;AACrC,MAAI,SAAU,QAAO;AAErB,SAAO,MAAM,KAAK,EAAE,gBAAO,GAAGC,UAAQ,UACpC,2CAACC;GAAmC,OAAOC;GAAO,GAAIF;KAAlCE,WAAS,MAAiC,CAC9D;IACD,CAAC,OAAO,SAAS,CAAC;AAoCrB,QACE,2CAACC;EAAsB,iCAnChB;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;YAQG,2CAACC;GAAkB,iCANd;IAAE;IAAM;IAAO;IAAe;IAAe;IAAU,GAC9D;IAAC;IAAM;IAAO;IAAe;IAAe;IAAS,CACtD;aAKK,2CAACC;IAAM,GAAI,aAAa,EAAE,0BAA0B,CAAC;cAClD;KACK;IACU;GACE;GAG5B,QACD,EAAE"}
@@ -10,7 +10,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
10
10
 
11
11
  //#region src/components/toggle/toggle-group.tsx
12
12
  const ToggleGroupRoot = require_toggle.component((props) => {
13
- const [, { colorScheme, size, variant, attached, ...rest }] = require_toggle.useRootComponentProps(props, "group", { transferProps: [
13
+ const [, { colorScheme, size, variant, attached, suppressHydrationWarning, ...rest }] = require_toggle.useRootComponentProps(props, "group", { transferProps: [
14
14
  "size",
15
15
  "variant",
16
16
  "colorScheme"
@@ -21,12 +21,14 @@ const ToggleGroupRoot = require_toggle.component((props) => {
21
21
  colorScheme,
22
22
  size,
23
23
  variant,
24
- focusVisibleRing: attached ? "inside" : void 0
24
+ focusVisibleRing: attached ? "inside" : void 0,
25
+ suppressHydrationWarning
25
26
  }), [
26
27
  variant,
27
28
  size,
28
29
  colorScheme,
29
- attached
30
+ attached,
31
+ suppressHydrationWarning
30
32
  ]),
31
33
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_toggle_group.ToggleGroupContext, {
32
34
  value: (0, react.useMemo)(() => ({
@@ -44,7 +46,7 @@ const ToggleGroupRoot = require_toggle.component((props) => {
44
46
  ]),
45
47
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_group.Group, {
46
48
  attached,
47
- ...getGroupProps()
49
+ ...getGroupProps({ suppressHydrationWarning })
48
50
  })
49
51
  })
50
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-group.cjs","names":["component","useRootComponentProps","useToggleGroup","TogglePropsContext","ToggleGroupContext","Group"],"sources":["../../../../src/components/toggle/toggle-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { ToggleProps } from \"./toggle\"\nimport type { ToggleStyle } from \"./toggle.style\"\nimport type { UseToggleGroupProps } from \"./use-toggle-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport { component, TogglePropsContext, useRootComponentProps } from \"./toggle\"\nimport { ToggleGroupContext, useToggleGroup } from \"./use-toggle-group\"\n\n/**\n * `ToggleGroup` is a set of two-state buttons that can be toggled on or off.\n *\n * @see https://yamada-ui.com/docs/components/toggle\n */\nexport interface ToggleGroupRootProps<Y extends string | string[] = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, ToggleStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n UseToggleGroupProps<Y>,\n ThemeProps<ToggleStyle> {}\n\nexport const ToggleGroupRoot = component<\"div\", ToggleGroupRootProps>(\n (props: ToggleGroupRootProps) => {\n const [, { colorScheme, size, variant, attached, ...rest }] =\n useRootComponentProps(props, \"group\", {\n transferProps: [\"size\", \"variant\", \"colorScheme\"],\n })\n const {\n disabled,\n readOnly,\n value,\n getGroupProps,\n onChange,\n onChangeMapRef,\n } = useToggleGroup(rest)\n const context = useMemo<ToggleProps>(\n () => ({\n colorScheme,\n size,\n variant,\n focusVisibleRing: attached ? \"inside\" : undefined,\n }),\n [variant, size, colorScheme, attached],\n )\n const groupContext = useMemo(\n () => ({\n disabled,\n readOnly,\n value,\n onChange,\n onChangeMapRef,\n }),\n [value, disabled, readOnly, onChange, onChangeMapRef],\n )\n\n return (\n <TogglePropsContext value={context}>\n <ToggleGroupContext value={groupContext}>\n <Group attached={attached} {...getGroupProps()} />\n </ToggleGroupContext>\n </TogglePropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string | string[] = string>(\n props: ToggleGroupRootProps<Y>,\n ): ReactElement\n}>\n"],"mappings":";;;;;;;;;;;AA+BA,MAAa,kBAAkBA,0BAC5B,UAAgC;CAC/B,MAAM,GAAG,EAAE,aAAa,MAAM,SAAS,UAAU,GAAG,UAClDC,qCAAsB,OAAO,SAAS,EACpC,eAAe;EAAC;EAAQ;EAAW;EAAc,EAClD,CAAC;CACJ,MAAM,EACJ,UACA,UACA,OACA,eACA,UACA,mBACEC,wCAAe,KAAK;AAqBxB,QACE,2CAACC;EAAmB,iCApBb;GACL;GACA;GACA;GACA,kBAAkB,WAAW,WAAW;GACzC,GACD;GAAC;GAAS;GAAM;GAAa;GAAS,CACvC;YAcG,2CAACC;GAAmB,iCAZf;IACL;IACA;IACA;IACA;IACA;IACD,GACD;IAAC;IAAO;IAAU;IAAU;IAAU;IAAe,CACtD;aAKK,2CAACC;IAAgB;IAAU,GAAI,eAAe;KAAI;IAC/B;GACF;GAGzB,QACD,EAAE"}
1
+ {"version":3,"file":"toggle-group.cjs","names":["component","useRootComponentProps","useToggleGroup","TogglePropsContext","ToggleGroupContext","Group"],"sources":["../../../../src/components/toggle/toggle-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { ToggleProps } from \"./toggle\"\nimport type { ToggleStyle } from \"./toggle.style\"\nimport type { UseToggleGroupProps } from \"./use-toggle-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport { component, TogglePropsContext, useRootComponentProps } from \"./toggle\"\nimport { ToggleGroupContext, useToggleGroup } from \"./use-toggle-group\"\n\n/**\n * `ToggleGroup` is a set of two-state buttons that can be toggled on or off.\n *\n * @see https://yamada-ui.com/docs/components/toggle\n */\nexport interface ToggleGroupRootProps<Y extends string | string[] = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, ToggleStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n UseToggleGroupProps<Y>,\n ThemeProps<ToggleStyle> {}\n\nexport const ToggleGroupRoot = component<\"div\", ToggleGroupRootProps>(\n (props: ToggleGroupRootProps) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n attached,\n suppressHydrationWarning,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"size\", \"variant\", \"colorScheme\"],\n })\n const {\n disabled,\n readOnly,\n value,\n getGroupProps,\n onChange,\n onChangeMapRef,\n } = useToggleGroup(rest)\n const context = useMemo<ToggleProps>(\n () => ({\n colorScheme,\n size,\n variant,\n focusVisibleRing: attached ? \"inside\" : undefined,\n suppressHydrationWarning,\n }),\n [variant, size, colorScheme, attached, suppressHydrationWarning],\n )\n const groupContext = useMemo(\n () => ({\n disabled,\n readOnly,\n value,\n onChange,\n onChangeMapRef,\n }),\n [value, disabled, readOnly, onChange, onChangeMapRef],\n )\n\n return (\n <TogglePropsContext value={context}>\n <ToggleGroupContext value={groupContext}>\n <Group\n attached={attached}\n {...getGroupProps({ suppressHydrationWarning })}\n />\n </ToggleGroupContext>\n </TogglePropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string | string[] = string>(\n props: ToggleGroupRootProps<Y>,\n ): ReactElement\n}>\n"],"mappings":";;;;;;;;;;;AA+BA,MAAa,kBAAkBA,0BAC5B,UAAgC;CAC/B,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,0BACA,GAAG,UAEHC,qCAAsB,OAAO,SAAS,EACxC,eAAe;EAAC;EAAQ;EAAW;EAAc,EAClD,CAAC;CACF,MAAM,EACJ,UACA,UACA,OACA,eACA,UACA,mBACEC,wCAAe,KAAK;AAsBxB,QACE,2CAACC;EAAmB,iCArBb;GACL;GACA;GACA;GACA,kBAAkB,WAAW,WAAW;GACxC;GACD,GACD;GAAC;GAAS;GAAM;GAAa;GAAU;GAAyB,CACjE;YAcG,2CAACC;GAAmB,iCAZf;IACL;IACA;IACA;IACA;IACA;IACD,GACD;IAAC;IAAO;IAAU;IAAU;IAAU;IAAe,CACtD;aAKK,2CAACC;IACW;IACV,GAAI,cAAc,EAAE,0BAA0B,CAAC;KAC/C;IACiB;GACF;GAGzB,QACD,EAAE"}
@@ -12,41 +12,46 @@ const require_popover = require('../popover/popover.cjs');
12
12
  require('../popover/index.cjs');
13
13
  const require_tooltip_style = require('./tooltip.style.cjs');
14
14
  const require_use_tooltip = require('./use-tooltip.cjs');
15
+ let react = require("react");
15
16
  let react_jsx_runtime = require("react/jsx-runtime");
16
17
  let motion_react = require("motion/react");
17
18
 
18
19
  //#region src/components/tooltip/tooltip.tsx
19
- const { PropsContext: TooltipPropsContext, StyleContext, usePropsContext: useTooltipPropsContext, withContext, useRootComponentProps } = require_create_component.createSlotComponent("tooltip", require_tooltip_style.tooltipStyle);
20
+ const { HydrationContext, PropsContext: TooltipPropsContext, StyleContext, usePropsContext: useTooltipPropsContext, withContext, useRootComponentProps } = require_create_component.createSlotComponent("tooltip", require_tooltip_style.tooltipStyle);
20
21
  /**
21
22
  * `Tooltip` is a component that displays short information, such as supplementary details for an element.
22
23
  *
23
24
  * @see https://yamada-ui.com/docs/components/tooltip
24
25
  */
25
26
  const Tooltip = (props) => {
26
- const [context, { animationScheme = "scale", children, content, duration = .1, contentProps, portalProps, ...rest }] = useRootComponentProps(props);
27
+ const [styleContext, { animationScheme = "scale", children, content, duration = .1, suppressHydrationWarning, contentProps, portalProps, ...rest }] = useRootComponentProps(props);
27
28
  const { open, getContentProps, getPositionerProps, getTriggerProps } = require_use_tooltip.useTooltip(rest);
28
29
  const popupAnimationProps = require_popover.usePopupAnimationProps({
29
30
  animationScheme,
30
31
  duration
31
32
  });
33
+ const hydrationContext = (0, react.useMemo)(() => suppressHydrationWarning ? { suppressHydrationWarning } : {}, [suppressHydrationWarning]);
32
34
  if (!content) return children;
33
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyleContext, {
34
- value: context,
35
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
36
- asChild: true,
37
- ...getTriggerProps(),
38
- children
39
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portal.Portal, {
40
- ...portalProps,
41
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipPositioner, {
42
- ...getPositionerProps(),
43
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
44
- ...popupAnimationProps,
45
- ...(0, require_utils_index.utils_exports.cast)(getContentProps((0, require_utils_index.utils_exports.cast)(contentProps))),
46
- children: content
35
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyleContext, {
36
+ value: styleContext,
37
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HydrationContext, {
38
+ value: hydrationContext,
39
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
40
+ asChild: true,
41
+ ...getTriggerProps(),
42
+ children
43
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, { children: open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portal.Portal, {
44
+ ...portalProps,
45
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipPositioner, {
46
+ ...getPositionerProps(),
47
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
48
+ ...popupAnimationProps,
49
+ ...(0, require_utils_index.utils_exports.cast)(getContentProps((0, require_utils_index.utils_exports.cast)(contentProps))),
50
+ children: content
51
+ })
47
52
  })
48
- })
49
- }) : null })]
53
+ }) : null })]
54
+ })
50
55
  });
51
56
  };
52
57
  const TooltipPositioner = withContext("div", "positioner")();
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.cjs","names":["createSlotComponent","tooltipStyle","Tooltip: FC<TooltipProps>","useTooltip","usePopupAnimationProps","AnimatePresence","Portal","motion"],"sources":["../../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { UsePopupAnimationProps } from \"../popover\"\nimport type { PortalProps } from \"../portal\"\nimport type { TooltipStyle } from \"./tooltip.style\"\nimport type { UseTooltipProps } from \"./use-tooltip\"\nimport { AnimatePresence } from \"motion/react\"\nimport { createSlotComponent } from \"../../core\"\nimport { cast } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { usePopupAnimationProps } from \"../popover\"\nimport { Portal } from \"../portal\"\nimport { tooltipStyle } from \"./tooltip.style\"\nimport { useTooltip } from \"./use-tooltip\"\n\nexport interface TooltipProps\n extends\n UseTooltipProps,\n PropsWithChildren,\n UsePopupAnimationProps,\n ThemeProps<TooltipStyle> {\n /**\n * The content of the tooltip.\n */\n content?: ReactNode\n /**\n * The animation duration.\n *\n * @default 0.1\n */\n duration?: UsePopupAnimationProps[\"duration\"]\n /**\n * Props for content element.\n */\n contentProps?: HTMLMotionProps\n /**\n * Props for portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n}\n\nconst {\n PropsContext: TooltipPropsContext,\n StyleContext,\n usePropsContext: useTooltipPropsContext,\n withContext,\n useRootComponentProps,\n} = createSlotComponent<TooltipProps, TooltipStyle>(\"tooltip\", tooltipStyle)\n\nexport { TooltipPropsContext, useTooltipPropsContext }\n\n/**\n * `Tooltip` is a component that displays short information, such as supplementary details for an element.\n *\n * @see https://yamada-ui.com/docs/components/tooltip\n */\nexport const Tooltip: FC<TooltipProps> = (props) => {\n const [\n context,\n {\n animationScheme = \"scale\",\n children,\n content,\n duration = 0.1,\n contentProps,\n portalProps,\n ...rest\n },\n ] = useRootComponentProps(props)\n const { open, getContentProps, getPositionerProps, getTriggerProps } =\n useTooltip(rest)\n const popupAnimationProps = usePopupAnimationProps({\n animationScheme,\n duration,\n })\n\n if (!content) return children\n\n return (\n <StyleContext value={context}>\n <TooltipTrigger asChild {...getTriggerProps()}>\n {children}\n </TooltipTrigger>\n\n <AnimatePresence>\n {open ? (\n <Portal {...portalProps}>\n <TooltipPositioner {...getPositionerProps()}>\n <TooltipContent\n {...popupAnimationProps}\n {...cast<HTMLMotionProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {content}\n </TooltipContent>\n </TooltipPositioner>\n </Portal>\n ) : null}\n </AnimatePresence>\n </StyleContext>\n )\n}\n\ninterface TooltipPositionerProps extends HTMLStyledProps {}\n\nconst TooltipPositioner = withContext<\"div\", TooltipPositionerProps>(\n \"div\",\n \"positioner\",\n)()\n\ninterface TooltipTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nconst TooltipTrigger = withContext<\"button\", TooltipTriggerProps>(\n \"button\",\n \"trigger\",\n)()\n\ninterface TooltipContentProps extends Omit<\n HTMLMotionProps,\n \"children\" | \"offset\" | \"transform\"\n> {}\n\nconst TooltipContent = withContext<\"div\", TooltipContentProps>(\n motion.div,\n \"content\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,MAAM,EACJ,cAAc,qBACd,cACA,iBAAiB,wBACjB,aACA,0BACEA,6CAAgD,WAAWC,mCAAa;;;;;;AAS5E,MAAaC,WAA6B,UAAU;CAClD,MAAM,CACJ,SACA,EACE,kBAAkB,SAClB,UACA,SACA,WAAW,IACX,cACA,aACA,GAAG,UAEH,sBAAsB,MAAM;CAChC,MAAM,EAAE,MAAM,iBAAiB,oBAAoB,oBACjDC,+BAAW,KAAK;CAClB,MAAM,sBAAsBC,uCAAuB;EACjD;EACA;EACD,CAAC;AAEF,KAAI,CAAC,QAAS,QAAO;AAErB,QACE,4CAAC;EAAa,OAAO;aACnB,2CAAC;GAAe;GAAQ,GAAI,iBAAiB;GAC1C;IACc,EAEjB,2CAACC,0CACE,OACC,2CAACC;GAAO,GAAI;aACV,2CAAC;IAAkB,GAAI,oBAAoB;cACzC,2CAAC;KACC,GAAI;KACJ,+CACE,4DAAgC,aAAa,CAAC,CAC/C;eAEA;MACc;KACC;IACb,GACP,OACY;GACL;;AAMnB,MAAM,oBAAoB,YACxB,OACA,aACD,EAAE;AAIH,MAAM,iBAAiB,YACrB,UACA,UACD,EAAE;AAOH,MAAM,iBAAiB,YACrBC,uBAAO,KACP,UACD,EAAE"}
1
+ {"version":3,"file":"tooltip.cjs","names":["createSlotComponent","tooltipStyle","Tooltip: FC<TooltipProps>","useTooltip","usePopupAnimationProps","AnimatePresence","Portal","motion"],"sources":["../../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { UsePopupAnimationProps } from \"../popover\"\nimport type { PortalProps } from \"../portal\"\nimport type { TooltipStyle } from \"./tooltip.style\"\nimport type { UseTooltipProps } from \"./use-tooltip\"\nimport { AnimatePresence } from \"motion/react\"\nimport { type FC, type PropsWithChildren, type ReactNode, useMemo } from \"react\"\nimport { createSlotComponent } from \"../../core\"\nimport { cast } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { usePopupAnimationProps } from \"../popover\"\nimport { Portal } from \"../portal\"\nimport { tooltipStyle } from \"./tooltip.style\"\nimport { useTooltip } from \"./use-tooltip\"\n\nexport interface TooltipProps\n extends\n UseTooltipProps,\n PropsWithChildren,\n UsePopupAnimationProps,\n ThemeProps<TooltipStyle>,\n Pick<HTMLProps, \"suppressHydrationWarning\"> {\n /**\n * The content of the tooltip.\n */\n content?: ReactNode\n /**\n * The animation duration.\n *\n * @default 0.1\n */\n duration?: UsePopupAnimationProps[\"duration\"]\n /**\n * Props for content element.\n */\n contentProps?: HTMLMotionProps\n /**\n * Props for portal component.\n */\n portalProps?: Omit<PortalProps, \"children\">\n}\n\nconst {\n HydrationContext,\n PropsContext: TooltipPropsContext,\n StyleContext,\n usePropsContext: useTooltipPropsContext,\n withContext,\n useRootComponentProps,\n} = createSlotComponent<TooltipProps, TooltipStyle>(\"tooltip\", tooltipStyle)\n\nexport { TooltipPropsContext, useTooltipPropsContext }\n\n/**\n * `Tooltip` is a component that displays short information, such as supplementary details for an element.\n *\n * @see https://yamada-ui.com/docs/components/tooltip\n */\nexport const Tooltip: FC<TooltipProps> = (props) => {\n const [\n styleContext,\n {\n animationScheme = \"scale\",\n children,\n content,\n duration = 0.1,\n suppressHydrationWarning,\n contentProps,\n portalProps,\n ...rest\n },\n ] = useRootComponentProps(props)\n const { open, getContentProps, getPositionerProps, getTriggerProps } =\n useTooltip(rest)\n const popupAnimationProps = usePopupAnimationProps({\n animationScheme,\n duration,\n })\n const hydrationContext = useMemo(\n () => (suppressHydrationWarning ? { suppressHydrationWarning } : {}),\n [suppressHydrationWarning],\n )\n\n if (!content) return children\n\n return (\n <StyleContext value={styleContext}>\n <HydrationContext value={hydrationContext}>\n <TooltipTrigger asChild {...getTriggerProps()}>\n {children}\n </TooltipTrigger>\n\n <AnimatePresence>\n {open ? (\n <Portal {...portalProps}>\n <TooltipPositioner {...getPositionerProps()}>\n <TooltipContent\n {...popupAnimationProps}\n {...cast<HTMLMotionProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {content}\n </TooltipContent>\n </TooltipPositioner>\n </Portal>\n ) : null}\n </AnimatePresence>\n </HydrationContext>\n </StyleContext>\n )\n}\n\ninterface TooltipPositionerProps extends HTMLStyledProps {}\n\nconst TooltipPositioner = withContext<\"div\", TooltipPositionerProps>(\n \"div\",\n \"positioner\",\n)()\n\ninterface TooltipTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nconst TooltipTrigger = withContext<\"button\", TooltipTriggerProps>(\n \"button\",\n \"trigger\",\n)()\n\ninterface TooltipContentProps extends Omit<\n HTMLMotionProps,\n \"children\" | \"offset\" | \"transform\"\n> {}\n\nconst TooltipContent = withContext<\"div\", TooltipContentProps>(\n motion.div,\n \"content\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6CA,MAAM,EACJ,kBACA,cAAc,qBACd,cACA,iBAAiB,wBACjB,aACA,0BACEA,6CAAgD,WAAWC,mCAAa;;;;;;AAS5E,MAAaC,WAA6B,UAAU;CAClD,MAAM,CACJ,cACA,EACE,kBAAkB,SAClB,UACA,SACA,WAAW,IACX,0BACA,cACA,aACA,GAAG,UAEH,sBAAsB,MAAM;CAChC,MAAM,EAAE,MAAM,iBAAiB,oBAAoB,oBACjDC,+BAAW,KAAK;CAClB,MAAM,sBAAsBC,uCAAuB;EACjD;EACA;EACD,CAAC;CACF,MAAM,4CACG,2BAA2B,EAAE,0BAA0B,GAAG,EAAE,EACnE,CAAC,yBAAyB,CAC3B;AAED,KAAI,CAAC,QAAS,QAAO;AAErB,QACE,2CAAC;EAAa,OAAO;YACnB,4CAAC;GAAiB,OAAO;cACvB,2CAAC;IAAe;IAAQ,GAAI,iBAAiB;IAC1C;KACc,EAEjB,2CAACC,0CACE,OACC,2CAACC;IAAO,GAAI;cACV,2CAAC;KAAkB,GAAI,oBAAoB;eACzC,2CAAC;MACC,GAAI;MACJ,+CACE,4DAAgC,aAAa,CAAC,CAC/C;gBAEA;OACc;MACC;KACb,GACP,OACY;IACD;GACN;;AAMnB,MAAM,oBAAoB,YACxB,OACA,aACD,EAAE;AAIH,MAAM,iBAAiB,YACrB,UACA,UACD,EAAE;AAOH,MAAM,iBAAiB,YACrBC,uBAAO,KACP,UACD,EAAE"}
@@ -50,6 +50,10 @@ function createComponent(name, style) {
50
50
  name: `${defaultDisplayName}PropsContext`,
51
51
  strict: false
52
52
  });
53
+ const [HydrationContext, useHydrationContext] = require_context.createContext({
54
+ name: `${defaultDisplayName}HydrationContext`,
55
+ strict: false
56
+ });
53
57
  function useClassName(name$1, className) {
54
58
  const system = require_system_provider.useSystem();
55
59
  className = (0, require_utils_index.utils_exports.runIfFn)(className, system);
@@ -76,9 +80,11 @@ function createComponent(name, style) {
76
80
  return function(initialProps, ...superProps) {
77
81
  return withDisplayName((props) => {
78
82
  className = useClassName(name$1, className);
83
+ const hydrationProps = useHydrationContext();
79
84
  const computedProps = (0, require_utils_index.utils_exports.isFunction)(initialProps) ? initialProps(props) : require_props.mergeProps(initialProps ?? {}, props)();
80
85
  const mergedProps = require_props.chainProps(...superProps)()(computedProps);
81
86
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, {
87
+ ...hydrationProps,
82
88
  ...mergedProps,
83
89
  className: (0, require_utils_index.utils_exports.cx)(className, mergedProps.className)
84
90
  });
@@ -96,15 +102,21 @@ function createComponent(name, style) {
96
102
  withContext: withContext$1,
97
103
  transferProps
98
104
  });
99
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, { ...require_props.chainProps(...(0, require_utils_index.utils_exports.toArray)(superProps))()(mergedProps) });
105
+ const rest = require_props.chainProps(...(0, require_utils_index.utils_exports.toArray)(superProps))()(mergedProps);
106
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HydrationContext, {
107
+ value: rest.suppressHydrationWarning ? { suppressHydrationWarning: true } : {},
108
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, { ...rest })
109
+ });
100
110
  }, displayName);
101
111
  };
102
112
  }
103
113
  return {
104
114
  component,
105
115
  ComponentContext,
116
+ HydrationContext,
106
117
  PropsContext,
107
118
  useComponentContext,
119
+ useHydrationContext,
108
120
  usePropsContext,
109
121
  withContext,
110
122
  useComponentProps
@@ -120,6 +132,10 @@ function createSlotComponent(rootName, style) {
120
132
  name: `${rootDisplayName}PropsContext`,
121
133
  strict: false
122
134
  });
135
+ const [HydrationContext, useHydrationContext] = require_context.createContext({
136
+ name: `${rootDisplayName}HydrationContext`,
137
+ strict: false
138
+ });
123
139
  function useClassName(slot, className) {
124
140
  const system = require_system_provider.useSystem();
125
141
  className = (0, require_utils_index.utils_exports.runIfFn)(className, system);
@@ -138,19 +154,20 @@ function createSlotComponent(rootName, style) {
138
154
  function useRootComponentProps(props, slot, { className, withContext: withContext$1 = true, transferProps } = {}) {
139
155
  className = useClassName(slot, className);
140
156
  const contextProps = usePropsContext() ?? {};
141
- const [css, rest] = require_use_component_style.useComponentSlotStyle(withContext$1 ? require_props.mergeProps(contextProps, props)() : props, {
157
+ const [styleContext, rest] = require_use_component_style.useComponentSlotStyle(withContext$1 ? require_props.mergeProps(contextProps, props)() : props, {
142
158
  name: rootName,
143
159
  className,
144
160
  style,
145
161
  slot,
146
162
  transferProps
147
163
  });
148
- return [css, rest];
164
+ return [styleContext, rest];
149
165
  }
150
166
  function useSlotComponentProps(props, slot, { className } = {}) {
151
167
  className = useClassName(slot, className);
152
168
  const style$1 = useStyleContext();
153
169
  return {
170
+ ...useHydrationContext(),
154
171
  ...props,
155
172
  className: (0, require_utils_index.utils_exports.cx)(className, props.className),
156
173
  css: require_use_component_style.mergeSlotCSS(slot, style$1, props.css)
@@ -167,9 +184,11 @@ function createSlotComponent(rootName, style) {
167
184
  return function(initialProps, ...superProps) {
168
185
  return withDisplayName((props) => {
169
186
  className = useClassName(slot, className);
187
+ const hydrationProps = useHydrationContext();
170
188
  const computedProps = (0, require_utils_index.utils_exports.isFunction)(initialProps) ? initialProps(props) : require_props.mergeProps(initialProps ?? {}, props)();
171
189
  const mergedProps = require_props.chainProps(...superProps)()(computedProps);
172
190
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, {
191
+ ...hydrationProps,
173
192
  ...mergedProps,
174
193
  className: (0, require_utils_index.utils_exports.cx)(className, mergedProps.className)
175
194
  });
@@ -186,14 +205,18 @@ function createSlotComponent(rootName, style) {
186
205
  });
187
206
  return function(initialProps, ...superProps) {
188
207
  return withDisplayName((props) => {
189
- const [context, mergedProps] = useRootComponentProps((0, require_utils_index.utils_exports.isFunction)(initialProps) ? initialProps(props) : require_props.mergeProps(initialProps ?? {}, props)(), slot, {
208
+ const [styleContext, mergedProps] = useRootComponentProps((0, require_utils_index.utils_exports.isFunction)(initialProps) ? initialProps(props) : require_props.mergeProps(initialProps ?? {}, props)(), slot, {
190
209
  className,
191
210
  withContext: withContext$1,
192
211
  transferProps
193
212
  });
213
+ const rest = require_props.chainProps(...superProps)()(mergedProps);
194
214
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyleContext, {
195
- value: context,
196
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, { ...require_props.chainProps(...superProps)()(mergedProps) })
215
+ value: styleContext,
216
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HydrationContext, {
217
+ value: rest.suppressHydrationWarning ? { suppressHydrationWarning: true } : {},
218
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProxyComponent, { ...rest })
219
+ })
197
220
  });
198
221
  }, displayName);
199
222
  };
@@ -219,10 +242,12 @@ function createSlotComponent(rootName, style) {
219
242
  return {
220
243
  component,
221
244
  ComponentContext,
245
+ HydrationContext,
222
246
  PropsContext,
223
247
  StyleContext,
224
248
  useClassNames,
225
249
  useComponentContext,
250
+ useHydrationContext,
226
251
  usePropsContext,
227
252
  useStyleContext,
228
253
  withContext,
@@ -1 +1 @@
1
- {"version":3,"file":"create-component.cjs","names":["Fragment","styled","getDisplayName","createContext","useSystem","getClassName","name","useComponentStyle","withContext","mergeProps","chainProps","getSlotClassName","useComponentSlotStyle","style","mergeSlotCSS"],"sources":["../../../../src/core/components/create-component.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, FunctionComponent } from \"react\"\nimport type { AnyString, Dict, Merge } from \"../../utils\"\nimport type { CSSObject, CSSSlotObject } from \"../css\"\nimport type {\n ComponentSlotStyle,\n ComponentStyle,\n StyledOptions,\n System,\n WithoutThemeProps,\n} from \"../system\"\nimport type {\n As,\n DOMElement,\n HTMLStyledProps,\n Component as OriginalComponent,\n} from \"./index.types\"\nimport { Fragment } from \"react\"\nimport {\n createContext,\n cx,\n isArray,\n isFunction,\n isObject,\n isString,\n runIfFn,\n toArray,\n toCamelCase,\n toPascalCase,\n} from \"../../utils\"\nimport { styled, useSystem } from \"../system\"\nimport { chainProps, mergeProps } from \"./props\"\nimport {\n getSlotClassName,\n mergeSlotCSS,\n useComponentSlotStyle,\n useComponentStyle,\n} from \"./use-component-style\"\nimport { getClassName, getDisplayName } from \"./utils\"\n\ntype AsWithFragment = \"fragment\" | As\ntype ClassName = ((system: System) => string) | string\n\ntype Component<\n Y extends AsWithFragment = AsWithFragment,\n M extends object = {},\n> = Y extends \"fragment\"\n ? FunctionComponent<M>\n : OriginalComponent<Exclude<Y, \"fragment\">, M>\n\nexport type ComponentSlotName<\n Y extends ComponentSlotStyle | ComponentStyle = ComponentSlotStyle,\n> = AnyString | Extract<keyof NonNullable<Y[\"base\"]>, string>\n\nexport type ComponentSlot<Y extends string> =\n | [Y, Y]\n | Y\n | { name: string; slot: [Y, Y] | Y }\n\nexport type InitialProps<Y extends Dict = Dict> =\n | ((props: Y) => any)\n | Partial<Y>\nexport type SuperProps<Y extends Dict = Dict> = ((props: Y) => any) | Y\n\nexport type SuperWithoutThemeProps<\n Y extends Dict = Dict,\n M extends Dict = Dict,\n D extends keyof Y = keyof Y,\n> = ((props: WithoutThemeProps<Y, M, D>) => any) | WithoutThemeProps<Y, M, D>\n\nexport interface UseComponentPropsOptions<\n Y extends number | string | symbol = string,\n> {\n className?: ClassName\n withContext?: boolean\n transferProps?: Y[]\n}\n\nexport interface ComponentOptions extends Omit<StyledOptions, \"transferProps\"> {\n className?: ClassName\n shouldStyleProps?: boolean\n}\n\ninterface classNameOptions<Y extends string = string> {\n className?: ClassName\n slot?: ComponentSlot<Y>\n}\n\nexport interface ComponentWithContextOptions<\n Y extends number | string | symbol = string,\n>\n extends ComponentOptions, UseComponentPropsOptions<Y> {}\n\nfunction createProxyComponent<\n Y extends AsWithFragment = \"div\",\n M extends Dict = Dict,\n>(el: FC<M> | Y, { shouldStyleProps, ...options }: ComponentOptions = {}) {\n options.shouldForwardProp ??= isFunction(el)\n shouldStyleProps ??= !isFunction(el)\n\n if (el === \"fragment\") el = Fragment\n\n if (shouldStyleProps || isString(el)) {\n const ProxyComponent = styled(el as As, options)\n\n ProxyComponent.displayName = \"ProxyComponent\"\n\n return ProxyComponent\n } else {\n el.displayName ??= \"ProxyComponent\"\n\n return el as FC<M>\n }\n}\n\nfunction withDisplayName<\n Y extends AsWithFragment = AsWithFragment,\n M extends object = {},\n>(Component: FC<M>, displayName: string) {\n Object.defineProperty(Component, \"name\", { value: displayName })\n Object.defineProperty(Component, \"displayName\", { value: displayName })\n\n return Component as Component<Y, M>\n}\n\nfunction getSlotKey<Y extends string>(slot?: ComponentSlot<Y>) {\n if (!slot) return \"unknown\"\n\n if (isArray(slot) || !isObject(slot)) {\n return toCamelCase(toArray(slot).join(\"-\"))\n } else {\n return toCamelCase(slot.name)\n }\n}\n\nfunction getSlotName<Y extends string>(slot?: ComponentSlot<Y>) {\n if (!slot) return \"\"\n\n if (isArray(slot)) {\n return slot.map((value) => toPascalCase(value as string)).join(\"\")\n } else if (isObject(slot)) {\n return toPascalCase(slot.name)\n } else {\n return toPascalCase(slot as string)\n }\n}\n\nexport function createComponent<\n Y extends object = {},\n M extends ComponentStyle = Dict,\n D extends Dict = Dict,\n>(name: string, style?: M) {\n const defaultClassName = style?.className\n const defaultDisplayName = getDisplayName(name)\n const [ComponentContext, useComponentContext] = createContext<D>({\n name: `${defaultDisplayName}Context`,\n })\n const [PropsContext, usePropsContext] = createContext<Partial<Y>>({\n name: `${defaultDisplayName}PropsContext`,\n strict: false,\n })\n\n function useClassName(name?: string, className?: ClassName) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= getClassName(name, defaultClassName)(system)\n\n return className\n }\n\n function useComponentProps<H extends Y = Y, R extends keyof H = keyof H>(\n props: H,\n {\n className,\n withContext = true,\n transferProps,\n }: UseComponentPropsOptions<R> = {},\n ) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= defaultClassName\n className ??= getClassName(name)(system)\n\n const contextProps = usePropsContext() ?? {}\n const mergedProps = withContext\n ? (mergeProps(contextProps, props)() as H)\n : props\n const [, rest] = useComponentStyle(mergedProps, {\n name,\n className,\n style,\n transferProps,\n })\n\n return rest\n }\n\n function component<D extends AsWithFragment = \"div\", H extends Dict = Y>(\n el: D | FC<H>,\n { name, className, ...options }: ComponentOptions = {},\n ) {\n const displayName = getDisplayName(name, defaultDisplayName)\n const ProxyComponent = createProxyComponent(el, options)\n\n return function (\n initialProps?: InitialProps<H>,\n ...superProps: SuperProps<H>[]\n ) {\n return withDisplayName<D, H>((props) => {\n className = useClassName(name, className)\n\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = chainProps<any>(...superProps)()(computedProps)\n\n return (\n <ProxyComponent\n {...mergedProps}\n className={cx(className, mergedProps.className)}\n />\n )\n }, displayName)\n }\n }\n\n function withContext<\n D extends AsWithFragment = \"div\",\n H extends Y = Y,\n R extends keyof H = keyof H,\n >(\n el: D | FC<WithoutThemeProps<H, M, R>>,\n {\n name,\n className,\n withContext,\n transferProps,\n ...options\n }: ComponentWithContextOptions<R> = {},\n ) {\n const displayName = getDisplayName(name, defaultDisplayName)\n const ProxyComponent = createProxyComponent(el, options)\n\n return function (\n initialProps?: InitialProps<H>,\n ...superProps: SuperWithoutThemeProps<H, M, R>[]\n ) {\n return withDisplayName<D, H>((props) => {\n className = useClassName(name, className)\n\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = useComponentProps(computedProps, {\n className,\n withContext,\n transferProps,\n })\n const rest = chainProps<any>(...toArray(superProps))()(mergedProps)\n\n return <ProxyComponent {...rest} />\n }, displayName)\n }\n }\n\n return {\n component,\n ComponentContext,\n PropsContext,\n useComponentContext,\n usePropsContext,\n withContext,\n useComponentProps,\n }\n}\n\nexport function createSlotComponent<\n Y extends object = {},\n M extends ComponentSlotStyle = Dict,\n D extends Dict = Dict,\n>(rootName: string, style?: M) {\n const rootClassName = style?.className\n const rootDisplayName = getDisplayName(rootName)\n const classNameMap = new Map<string, classNameOptions>()\n const [StyleContext, useStyleContext] = createContext<\n CSSSlotObject<ComponentSlotName<M>>\n >({\n name: `${rootDisplayName}StyleContext`,\n })\n const [ComponentContext, useComponentContext] = createContext<D>({\n name: `${rootDisplayName}Context`,\n })\n const [PropsContext, usePropsContext] = createContext<Partial<Y>>({\n name: `${rootDisplayName}PropsContext`,\n strict: false,\n })\n\n function useClassName(\n slot?: ComponentSlot<ComponentSlotName<M>>,\n className?: ClassName,\n ) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= getSlotClassName(\n rootClassName ?? getClassName(rootName)(system),\n slot,\n )\n\n return className\n }\n\n function useClassNames() {\n const system = useSystem()\n const entries = classNameMap.entries().map(([key, { className, slot }]) => {\n className = runIfFn(className, system)\n className ??= getSlotClassName(\n rootClassName ?? getClassName(rootName)(system),\n slot,\n )\n\n return [key, className]\n })\n\n return Object.fromEntries(\n entries.filter(([_, className]) => className),\n ) as { [key: string]: string }\n }\n\n function useRootComponentProps<\n Y extends Dict = {},\n R extends keyof Y = keyof Y,\n >(\n props: Y,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n {\n className,\n withContext = true,\n transferProps,\n }: UseComponentPropsOptions<R> = {},\n ): [\n CSSSlotObject,\n Merge<WithoutThemeProps<Y, M, R>, { css?: CSSObject | CSSObject[] }>,\n ] {\n className = useClassName(slot, className)\n\n const contextProps = usePropsContext() ?? {}\n const mergedProps = withContext\n ? (mergeProps(contextProps, props)() as Y)\n : props\n const [css, rest] = useComponentSlotStyle(mergedProps, {\n name: rootName,\n className,\n style,\n slot,\n transferProps,\n })\n\n return [css, rest]\n }\n\n function useSlotComponentProps<Y extends Dict = {}>(\n props: Y,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n { className }: Omit<UseComponentPropsOptions, \"transferProps\"> = {},\n ) {\n className = useClassName(slot, className)\n\n const style = useStyleContext()\n\n return {\n ...props,\n className: cx(className, props.className),\n css: mergeSlotCSS(slot, style, props.css),\n }\n }\n\n function component<H extends AsWithFragment = \"div\", R extends Dict = Dict>(\n el: FC<R> | H,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n { name, className, ...options }: ComponentOptions = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperProps<R>[]\n ) {\n return withDisplayName<H, R>((props) => {\n className = useClassName(slot, className)\n\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = chainProps(...superProps)()(computedProps)\n\n return (\n <ProxyComponent\n {...mergedProps}\n className={cx(className, mergedProps.className)}\n />\n )\n }, displayName)\n }\n }\n\n function withProvider<\n H extends AsWithFragment = \"div\",\n R extends Y = Y,\n T extends keyof R = keyof R,\n >(\n el: FC<WithoutThemeProps<R, M, T>> | H,\n slot: ComponentSlot<ComponentSlotName<M>> = \"root\" as ComponentSlot<\n ComponentSlotName<M>\n >,\n {\n name,\n className,\n withContext,\n transferProps,\n ...options\n }: ComponentWithContextOptions<T> = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperWithoutThemeProps<R, M, T>[]\n ) {\n return withDisplayName<H, R>((props) => {\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const [context, mergedProps] = useRootComponentProps(\n computedProps,\n slot,\n {\n className,\n withContext,\n transferProps,\n },\n )\n const rest = chainProps<any>(...superProps)()(mergedProps)\n\n return (\n <StyleContext value={context}>\n <ProxyComponent {...rest} />\n </StyleContext>\n )\n }, displayName)\n }\n }\n\n function withContext<\n H extends AsWithFragment = \"div\",\n R extends Dict = H extends DOMElement ? HTMLStyledProps<H> : Dict,\n >(\n el: FC<R> | H,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n {\n name,\n className,\n withContext,\n ...options\n }: Omit<ComponentWithContextOptions, \"transferProps\"> = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperProps<R>[]\n ) {\n return withDisplayName<H, R>((props) => {\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = useSlotComponentProps(computedProps, slot, {\n className,\n withContext,\n })\n const rest = chainProps(...superProps)()(mergedProps)\n\n return <ProxyComponent {...rest} />\n }, displayName)\n }\n }\n\n return {\n component,\n ComponentContext,\n PropsContext,\n StyleContext,\n useClassNames,\n useComponentContext,\n usePropsContext,\n useStyleContext,\n withContext,\n withProvider,\n useRootComponentProps,\n useSlotComponentProps,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA8FA,SAAS,qBAGP,IAAe,EAAE,kBAAkB,GAAG,YAA8B,EAAE,EAAE;AACxE,SAAQ,wEAAiC,GAAG;AAC5C,sBAAqB,mDAAY,GAAG;AAEpC,KAAI,OAAO,WAAY,MAAKA;AAE5B,KAAI,oEAA6B,GAAG,EAAE;EACpC,MAAM,iBAAiBC,uBAAO,IAAU,QAAQ;AAEhD,iBAAe,cAAc;AAE7B,SAAO;QACF;AACL,KAAG,gBAAgB;AAEnB,SAAO;;;AAIX,SAAS,gBAGP,WAAkB,aAAqB;AACvC,QAAO,eAAe,WAAW,QAAQ,EAAE,OAAO,aAAa,CAAC;AAChE,QAAO,eAAe,WAAW,eAAe,EAAE,OAAO,aAAa,CAAC;AAEvE,QAAO;;AAGT,SAAS,WAA6B,MAAyB;AAC7D,KAAI,CAAC,KAAM,QAAO;AAElB,oDAAY,KAAK,IAAI,iDAAU,KAAK,CAClC,0GAA2B,KAAK,CAAC,KAAK,IAAI,CAAC;KAE3C,2DAAmB,KAAK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AAgB,EAAE,EAAE,MAAM,EAAE,EACc,MAAM;KAC7D;KACA;KACD,CAAC;AAGF,WAAO,2CAAC,kBAAe,GAFVC,yBAAW,GAAG,WAAW,EAAE,CAAC,YAAY,GAElB;MAClC,YAAY;;;AAInB,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"create-component.cjs","names":["Fragment","styled","getDisplayName","createContext","useSystem","getClassName","name","useComponentStyle","withContext","mergeProps","chainProps","getSlotClassName","useComponentSlotStyle","style","mergeSlotCSS"],"sources":["../../../../src/core/components/create-component.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, FunctionComponent } from \"react\"\nimport type { AnyString, Dict, Merge } from \"../../utils\"\nimport type { CSSObject, CSSSlotObject } from \"../css\"\nimport type {\n ComponentSlotStyle,\n ComponentStyle,\n StyledOptions,\n System,\n WithoutThemeProps,\n} from \"../system\"\nimport type {\n As,\n DOMElement,\n HTMLStyledProps,\n Component as OriginalComponent,\n} from \"./index.types\"\nimport { Fragment } from \"react\"\nimport {\n createContext,\n cx,\n isArray,\n isFunction,\n isObject,\n isString,\n runIfFn,\n toArray,\n toCamelCase,\n toPascalCase,\n} from \"../../utils\"\nimport { styled, useSystem } from \"../system\"\nimport { chainProps, mergeProps } from \"./props\"\nimport {\n getSlotClassName,\n mergeSlotCSS,\n useComponentSlotStyle,\n useComponentStyle,\n} from \"./use-component-style\"\nimport { getClassName, getDisplayName } from \"./utils\"\n\nexport interface HydrationContext {\n suppressHydrationWarning?: boolean\n}\n\ntype AsWithFragment = \"fragment\" | As\ntype ClassName = ((system: System) => string) | string\n\ntype Component<\n Y extends AsWithFragment = AsWithFragment,\n M extends object = {},\n> = Y extends \"fragment\"\n ? FunctionComponent<M>\n : OriginalComponent<Exclude<Y, \"fragment\">, M>\n\nexport type ComponentSlotName<\n Y extends ComponentSlotStyle | ComponentStyle = ComponentSlotStyle,\n> = AnyString | Extract<keyof NonNullable<Y[\"base\"]>, string>\n\nexport type ComponentSlot<Y extends string> =\n | [Y, Y]\n | Y\n | { name: string; slot: [Y, Y] | Y }\n\nexport type InitialProps<Y extends Dict = Dict> =\n | ((props: Y) => any)\n | Partial<Y>\nexport type SuperProps<Y extends Dict = Dict> = ((props: Y) => any) | Y\n\nexport type SuperWithoutThemeProps<\n Y extends Dict = Dict,\n M extends Dict = Dict,\n D extends keyof Y = keyof Y,\n> = ((props: WithoutThemeProps<Y, M, D>) => any) | WithoutThemeProps<Y, M, D>\n\nexport interface UseComponentPropsOptions<\n Y extends number | string | symbol = string,\n> {\n className?: ClassName\n withContext?: boolean\n transferProps?: Y[]\n}\n\nexport interface ComponentOptions extends Omit<StyledOptions, \"transferProps\"> {\n className?: ClassName\n shouldStyleProps?: boolean\n}\n\ninterface classNameOptions<Y extends string = string> {\n className?: ClassName\n slot?: ComponentSlot<Y>\n}\n\nexport interface ComponentWithContextOptions<\n Y extends number | string | symbol = string,\n>\n extends ComponentOptions, UseComponentPropsOptions<Y> {}\n\nfunction createProxyComponent<\n Y extends AsWithFragment = \"div\",\n M extends Dict = Dict,\n>(el: FC<M> | Y, { shouldStyleProps, ...options }: ComponentOptions = {}) {\n options.shouldForwardProp ??= isFunction(el)\n shouldStyleProps ??= !isFunction(el)\n\n if (el === \"fragment\") el = Fragment\n\n if (shouldStyleProps || isString(el)) {\n const ProxyComponent = styled(el as As, options)\n\n ProxyComponent.displayName = \"ProxyComponent\"\n\n return ProxyComponent\n } else {\n el.displayName ??= \"ProxyComponent\"\n\n return el as FC<M>\n }\n}\n\nfunction withDisplayName<\n Y extends AsWithFragment = AsWithFragment,\n M extends object = {},\n>(Component: FC<M>, displayName: string) {\n Object.defineProperty(Component, \"name\", { value: displayName })\n Object.defineProperty(Component, \"displayName\", { value: displayName })\n\n return Component as Component<Y, M>\n}\n\nfunction getSlotKey<Y extends string>(slot?: ComponentSlot<Y>) {\n if (!slot) return \"unknown\"\n\n if (isArray(slot) || !isObject(slot)) {\n return toCamelCase(toArray(slot).join(\"-\"))\n } else {\n return toCamelCase(slot.name)\n }\n}\n\nfunction getSlotName<Y extends string>(slot?: ComponentSlot<Y>) {\n if (!slot) return \"\"\n\n if (isArray(slot)) {\n return slot.map((value) => toPascalCase(value as string)).join(\"\")\n } else if (isObject(slot)) {\n return toPascalCase(slot.name)\n } else {\n return toPascalCase(slot as string)\n }\n}\n\nexport function createComponent<\n Y extends Dict = {},\n M extends ComponentStyle = Dict,\n D extends Dict = Dict,\n>(name: string, style?: M) {\n const defaultClassName = style?.className\n const defaultDisplayName = getDisplayName(name)\n const [ComponentContext, useComponentContext] = createContext<D>({\n name: `${defaultDisplayName}Context`,\n })\n const [PropsContext, usePropsContext] = createContext<Partial<Y>>({\n name: `${defaultDisplayName}PropsContext`,\n strict: false,\n })\n const [HydrationContext, useHydrationContext] =\n createContext<HydrationContext>({\n name: `${defaultDisplayName}HydrationContext`,\n strict: false,\n })\n\n function useClassName(name?: string, className?: ClassName) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= getClassName(name, defaultClassName)(system)\n\n return className\n }\n\n function useComponentProps<H extends Y = Y, R extends keyof H = keyof H>(\n props: H,\n {\n className,\n withContext = true,\n transferProps,\n }: UseComponentPropsOptions<R> = {},\n ) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= defaultClassName\n className ??= getClassName(name)(system)\n\n const contextProps = usePropsContext() ?? {}\n const mergedProps = withContext\n ? (mergeProps(contextProps, props)() as H)\n : props\n const [, rest] = useComponentStyle(mergedProps, {\n name,\n className,\n style,\n transferProps,\n })\n\n return rest\n }\n\n function component<D extends AsWithFragment = \"div\", H extends Dict = Y>(\n el: D | FC<H>,\n { name, className, ...options }: ComponentOptions = {},\n ) {\n const displayName = getDisplayName(name, defaultDisplayName)\n const ProxyComponent = createProxyComponent(el, options)\n\n return function (\n initialProps?: InitialProps<H>,\n ...superProps: SuperProps<H>[]\n ) {\n return withDisplayName<D, H>((props) => {\n className = useClassName(name, className)\n\n const hydrationProps = useHydrationContext()\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = chainProps<any>(...superProps)()(computedProps)\n\n return (\n <ProxyComponent\n {...hydrationProps}\n {...mergedProps}\n className={cx(className, mergedProps.className)}\n />\n )\n }, displayName)\n }\n }\n\n function withContext<\n D extends AsWithFragment = \"div\",\n H extends Y = Y,\n R extends keyof H = keyof H,\n >(\n el: D | FC<WithoutThemeProps<H, M, R>>,\n {\n name,\n className,\n withContext,\n transferProps,\n ...options\n }: ComponentWithContextOptions<R> = {},\n ) {\n const displayName = getDisplayName(name, defaultDisplayName)\n const ProxyComponent = createProxyComponent(el, options)\n\n return function (\n initialProps?: InitialProps<H>,\n ...superProps: SuperWithoutThemeProps<H, M, R>[]\n ) {\n return withDisplayName<D, H>((props) => {\n className = useClassName(name, className)\n\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = useComponentProps(computedProps, {\n className,\n withContext,\n transferProps,\n })\n const rest = chainProps<any>(...toArray(superProps))()(mergedProps)\n const hydrationContext = rest.suppressHydrationWarning\n ? { suppressHydrationWarning: true }\n : {}\n\n return (\n <HydrationContext value={hydrationContext}>\n <ProxyComponent {...rest} />\n </HydrationContext>\n )\n }, displayName)\n }\n }\n\n return {\n component,\n ComponentContext,\n HydrationContext,\n PropsContext,\n useComponentContext,\n useHydrationContext,\n usePropsContext,\n withContext,\n useComponentProps,\n }\n}\n\nexport function createSlotComponent<\n Y extends object = {},\n M extends ComponentSlotStyle = Dict,\n D extends Dict = Dict,\n>(rootName: string, style?: M) {\n const rootClassName = style?.className\n const rootDisplayName = getDisplayName(rootName)\n const classNameMap = new Map<string, classNameOptions>()\n const [StyleContext, useStyleContext] = createContext<\n CSSSlotObject<ComponentSlotName<M>>\n >({\n name: `${rootDisplayName}StyleContext`,\n })\n const [ComponentContext, useComponentContext] = createContext<D>({\n name: `${rootDisplayName}Context`,\n })\n const [PropsContext, usePropsContext] = createContext<Partial<Y>>({\n name: `${rootDisplayName}PropsContext`,\n strict: false,\n })\n const [HydrationContext, useHydrationContext] =\n createContext<HydrationContext>({\n name: `${rootDisplayName}HydrationContext`,\n strict: false,\n })\n\n function useClassName(\n slot?: ComponentSlot<ComponentSlotName<M>>,\n className?: ClassName,\n ) {\n const system = useSystem()\n\n className = runIfFn(className, system)\n className ??= getSlotClassName(\n rootClassName ?? getClassName(rootName)(system),\n slot,\n )\n\n return className\n }\n\n function useClassNames() {\n const system = useSystem()\n const entries = classNameMap.entries().map(([key, { className, slot }]) => {\n className = runIfFn(className, system)\n className ??= getSlotClassName(\n rootClassName ?? getClassName(rootName)(system),\n slot,\n )\n\n return [key, className]\n })\n\n return Object.fromEntries(\n entries.filter(([_, className]) => className),\n ) as { [key: string]: string }\n }\n\n function useRootComponentProps<\n Y extends Dict = {},\n R extends keyof Y = keyof Y,\n >(\n props: Y,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n {\n className,\n withContext = true,\n transferProps,\n }: UseComponentPropsOptions<R> = {},\n ): [\n CSSSlotObject,\n Merge<WithoutThemeProps<Y, M, R>, { css?: CSSObject | CSSObject[] }>,\n ] {\n className = useClassName(slot, className)\n\n const contextProps = usePropsContext() ?? {}\n const mergedProps = withContext\n ? (mergeProps(contextProps, props)() as Y)\n : props\n const [styleContext, rest] = useComponentSlotStyle(mergedProps, {\n name: rootName,\n className,\n style,\n slot,\n transferProps,\n })\n\n return [styleContext, rest]\n }\n\n function useSlotComponentProps<Y extends Dict = {}>(\n props: Y,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n { className }: Omit<UseComponentPropsOptions, \"transferProps\"> = {},\n ) {\n className = useClassName(slot, className)\n\n const style = useStyleContext()\n const hydrationProps = useHydrationContext()\n\n return {\n ...hydrationProps,\n ...props,\n className: cx(className, props.className),\n css: mergeSlotCSS(slot, style, props.css),\n }\n }\n\n function component<H extends AsWithFragment = \"div\", R extends Dict = Dict>(\n el: FC<R> | H,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n { name, className, ...options }: ComponentOptions = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperProps<R>[]\n ) {\n return withDisplayName<H, R>((props) => {\n className = useClassName(slot, className)\n\n const hydrationProps = useHydrationContext()\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = chainProps(...superProps)()(computedProps)\n\n return (\n <ProxyComponent\n {...hydrationProps}\n {...mergedProps}\n className={cx(className, mergedProps.className)}\n />\n )\n }, displayName)\n }\n }\n\n function withProvider<\n H extends AsWithFragment = \"div\",\n R extends Y = Y,\n T extends keyof R = keyof R,\n >(\n el: FC<WithoutThemeProps<R, M, T>> | H,\n slot: ComponentSlot<ComponentSlotName<M>> = \"root\" as ComponentSlot<\n ComponentSlotName<M>\n >,\n {\n name,\n className,\n withContext,\n transferProps,\n ...options\n }: ComponentWithContextOptions<T> = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperWithoutThemeProps<R, M, T>[]\n ) {\n return withDisplayName<H, R>((props) => {\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const [styleContext, mergedProps] = useRootComponentProps(\n computedProps,\n slot,\n {\n className,\n withContext,\n transferProps,\n },\n )\n const rest = chainProps<any>(...superProps)()(mergedProps)\n const hydrationContext = rest.suppressHydrationWarning\n ? { suppressHydrationWarning: true }\n : {}\n\n return (\n <StyleContext value={styleContext}>\n <HydrationContext value={hydrationContext}>\n <ProxyComponent {...rest} />\n </HydrationContext>\n </StyleContext>\n )\n }, displayName)\n }\n }\n\n function withContext<\n H extends AsWithFragment = \"div\",\n R extends Dict = H extends DOMElement ? HTMLStyledProps<H> : Dict,\n >(\n el: FC<R> | H,\n slot?: ComponentSlot<ComponentSlotName<M>>,\n {\n name,\n className,\n withContext,\n ...options\n }: Omit<ComponentWithContextOptions, \"transferProps\"> = {},\n ) {\n const ProxyComponent = createProxyComponent(el, options)\n const slotKey = getSlotKey(slot)\n const slotName = getSlotName(slot)\n const displayName = getDisplayName(name, `${rootDisplayName}${slotName}`)\n\n classNameMap.set(slotKey, { className, slot })\n\n return function (\n initialProps?: InitialProps<R>,\n ...superProps: SuperProps<R>[]\n ) {\n return withDisplayName<H, R>((props) => {\n const computedProps = isFunction(initialProps)\n ? initialProps(props)\n : mergeProps(initialProps ?? {}, props)()\n const mergedProps = useSlotComponentProps(computedProps, slot, {\n className,\n withContext,\n })\n const rest = chainProps(...superProps)()(mergedProps)\n\n return <ProxyComponent {...rest} />\n }, displayName)\n }\n }\n\n return {\n component,\n ComponentContext,\n HydrationContext,\n PropsContext,\n StyleContext,\n useClassNames,\n useComponentContext,\n useHydrationContext,\n usePropsContext,\n useStyleContext,\n withContext,\n withProvider,\n useRootComponentProps,\n useSlotComponentProps,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkGA,SAAS,qBAGP,IAAe,EAAE,kBAAkB,GAAG,YAA8B,EAAE,EAAE;AACxE,SAAQ,wEAAiC,GAAG;AAC5C,sBAAqB,mDAAY,GAAG;AAEpC,KAAI,OAAO,WAAY,MAAKA;AAE5B,KAAI,oEAA6B,GAAG,EAAE;EACpC,MAAM,iBAAiBC,uBAAO,IAAU,QAAQ;AAEhD,iBAAe,cAAc;AAE7B,SAAO;QACF;AACL,KAAG,gBAAgB;AAEnB,SAAO;;;AAIX,SAAS,gBAGP,WAAkB,aAAqB;AACvC,QAAO,eAAe,WAAW,QAA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,UAAU;IAItC,MAAM,CAAC,cAAc,eAAe,wEAHH,aAAa,GAC1C,aAAa,MAAM,GACnBO,yBAAW,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAGzC,MACA;KACE;KACA;KACA;KACD,CACF;IACD,MAAM,OAAOC,yBAAgB,GAAG,WAAW,EAAE,CAAC,YAAY;AAK1D,WACE,2CAAC;KAAa,OAAO;eACnB,2CAAC;MAAiB,OANG,KAAK,2BAC1B,EAAE,0BAA0B,MAAM,GAClC,EAAE;gBAKA,2CAAC,kBAAe,GAAI,OAAQ;OACX;MACN;MAEhB,YAAY;;;CAInB,SAAS,YAIP,IACA,MACA,EACE,MACA,WACA,4BACA,GAAG,YACmD,EAAE,EAC1D;EACA,MAAM,iBAAiB,qBAAqB,IAAI,QAAQ;EACxD,MAAM,UAAU,WAAW,KAAK;EAEhC,MAAM,cAAcR,6BAAe,MAAM,GAAG,kBAD3B,YAAY,KAAK,GACuC;AAEzE,eAAa,IAAI,SAAS;GAAE;GAAW;GAAM,CAAC;AAE9C,SAAO,SACL,cACA,GAAG,YACH;AACA,UAAO,iBAAuB,UAAU;IAItC,MAAM,cAAc,wEAHa,aAAa,GAC1C,aAAa,MAAM,GACnBO,yBAAW,gBAAgB,EAAE,EAAE,MAAM,EAAE,EACc,MAAM;KAC7D;KACA;KACD,CAAC;AAGF,WAAO,2CAAC,kBAAe,GAFVC,yBAAW,GAAG,WAAW,EAAE,CAAC,YAAY,GAElB;MAClC,YAAY;;;AAInB,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -14,7 +14,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
14
14
  * @see https://yamada-ui.com/docs/components/avatar
15
15
  */
16
16
  const AvatarGroupRoot = component((props) => {
17
- const [, { colorScheme, size, variant, shape, ...rest }] = useRootComponentProps(props, "group", { transferProps: [
17
+ const [, { colorScheme, size, variant, shape, suppressHydrationWarning, ...rest }] = useRootComponentProps(props, "group", { transferProps: [
18
18
  "variant",
19
19
  "colorScheme",
20
20
  "size",
@@ -26,14 +26,17 @@ const AvatarGroupRoot = component((props) => {
26
26
  colorScheme,
27
27
  size,
28
28
  variant,
29
- shape
29
+ shape,
30
+ suppressHydrationWarning
30
31
  }), [
31
32
  variant,
32
33
  size,
33
34
  colorScheme,
34
- shape
35
+ shape,
36
+ suppressHydrationWarning
35
37
  ]),
36
38
  children: /* @__PURE__ */ jsxs(styled.div, {
39
+ suppressHydrationWarning,
37
40
  ...getRootProps(),
38
41
  children: [excess > 0 ? /* @__PURE__ */ jsx(Avatar, { fallback: `+${excess}` }) : null, children]
39
42
  })