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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
  2. package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
  3. package/dist/cjs/components/airy/airy.cjs.map +1 -1
  4. package/dist/cjs/components/alert/alert.cjs.map +1 -1
  5. package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
  6. package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
  7. package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
  8. package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
  9. package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
  10. package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
  11. package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
  12. package/dist/cjs/components/button/button-group.cjs.map +1 -1
  13. package/dist/cjs/components/button/button.cjs.map +1 -1
  14. package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
  15. package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
  16. package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
  17. package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
  18. package/dist/cjs/components/chart/chart.cjs.map +1 -1
  19. package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
  20. package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
  21. package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
  22. package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
  23. package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
  24. package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
  25. package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
  26. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  27. package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
  28. package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
  29. package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
  30. package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
  31. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  32. package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
  33. package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
  34. package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
  35. package/dist/cjs/components/editable/editable.cjs.map +1 -1
  36. package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
  37. package/dist/cjs/components/fade/fade.cjs.map +1 -1
  38. package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
  39. package/dist/cjs/components/field/field.cjs.map +1 -1
  40. package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
  41. package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
  42. package/dist/cjs/components/flip/flip.cjs.map +1 -1
  43. package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
  44. package/dist/cjs/components/form/form.cjs.map +1 -1
  45. package/dist/cjs/components/format/format-byte.cjs.map +1 -1
  46. package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
  47. package/dist/cjs/components/format/format-number.cjs.map +1 -1
  48. package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
  49. package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
  50. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
  51. package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
  52. package/dist/cjs/components/icon/icons/index.cjs +9 -3
  53. package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
  54. package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
  55. package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
  56. package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
  57. package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
  58. package/dist/cjs/components/icon/index.cjs +6 -2
  59. package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
  60. package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
  61. package/dist/cjs/components/input/input-group.cjs.map +1 -1
  62. package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
  63. package/dist/cjs/components/list/list.cjs.map +1 -1
  64. package/dist/cjs/components/loading/audio.cjs.map +1 -1
  65. package/dist/cjs/components/loading/background.cjs.map +1 -1
  66. package/dist/cjs/components/loading/circles.cjs.map +1 -1
  67. package/dist/cjs/components/loading/dots.cjs.map +1 -1
  68. package/dist/cjs/components/loading/grid.cjs.map +1 -1
  69. package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
  70. package/dist/cjs/components/loading/oval.cjs.map +1 -1
  71. package/dist/cjs/components/loading/page.cjs.map +1 -1
  72. package/dist/cjs/components/loading/puff.cjs.map +1 -1
  73. package/dist/cjs/components/loading/rings.cjs.map +1 -1
  74. package/dist/cjs/components/loading/screen.cjs.map +1 -1
  75. package/dist/cjs/components/loading/suspense.cjs.map +1 -1
  76. package/dist/cjs/components/menu/menu.cjs.map +1 -1
  77. package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
  78. package/dist/cjs/components/modal/modal.cjs.map +1 -1
  79. package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
  80. package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
  81. package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
  82. package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
  83. package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
  84. package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
  85. package/dist/cjs/components/notice/notice.cjs.map +1 -1
  86. package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
  87. package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
  88. package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
  89. package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
  90. package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
  91. package/dist/cjs/components/picture/picture.cjs.map +1 -1
  92. package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
  93. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  94. package/dist/cjs/components/progress/progress.cjs.map +1 -1
  95. package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
  96. package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
  97. package/dist/cjs/components/radio/radio.cjs.map +1 -1
  98. package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
  99. package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
  100. package/dist/cjs/components/rating/rating.cjs.map +1 -1
  101. package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
  102. package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
  103. package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
  104. package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
  105. package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
  106. package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
  107. package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
  108. package/dist/cjs/components/select/select.cjs.map +1 -1
  109. package/dist/cjs/components/select/use-select.cjs.map +1 -1
  110. package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
  111. package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
  112. package/dist/cjs/components/slide/slide.cjs.map +1 -1
  113. package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
  114. package/dist/cjs/components/slider/slider.cjs.map +1 -1
  115. package/dist/cjs/components/slot/slot.cjs.map +1 -1
  116. package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
  117. package/dist/cjs/components/stack/stack.cjs.map +1 -1
  118. package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
  119. package/dist/cjs/components/stat/stat.cjs.map +1 -1
  120. package/dist/cjs/components/status/status.cjs.map +1 -1
  121. package/dist/cjs/components/steps/steps.cjs.map +1 -1
  122. package/dist/cjs/components/switch/switch.cjs.map +1 -1
  123. package/dist/cjs/components/table/table.cjs.map +1 -1
  124. package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
  125. package/dist/cjs/components/tag/tag.cjs.map +1 -1
  126. package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
  127. package/dist/cjs/components/tip/tip.cjs.map +1 -1
  128. package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
  129. package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
  130. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  131. package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
  132. package/dist/cjs/core/components/create-component.cjs.map +1 -1
  133. package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
  134. package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
  135. package/dist/cjs/core/system/styled.cjs.map +1 -1
  136. package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
  137. package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
  138. package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
  139. package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
  140. package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
  141. package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
  142. package/dist/cjs/index.cjs +9 -3
  143. package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
  144. package/dist/cjs/utils/store.cjs.map +1 -1
  145. package/dist/esm/components/accordion/accordion.js.map +1 -1
  146. package/dist/esm/components/action-bar/action-bar.js.map +1 -1
  147. package/dist/esm/components/airy/airy.js.map +1 -1
  148. package/dist/esm/components/alert/alert.js.map +1 -1
  149. package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
  150. package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
  151. package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
  152. package/dist/esm/components/avatar/avatar-group.js.map +1 -1
  153. package/dist/esm/components/avatar/avatar.js.map +1 -1
  154. package/dist/esm/components/blockquote/blockquote.js.map +1 -1
  155. package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
  156. package/dist/esm/components/button/button-group.js.map +1 -1
  157. package/dist/esm/components/button/button.js.map +1 -1
  158. package/dist/esm/components/calendar/calendar.js.map +1 -1
  159. package/dist/esm/components/calendar/use-calendar.js.map +1 -1
  160. package/dist/esm/components/carousel/carousel.js.map +1 -1
  161. package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
  162. package/dist/esm/components/chart/chart.js.map +1 -1
  163. package/dist/esm/components/chart/polar-chart.js.map +1 -1
  164. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  165. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  166. package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
  167. package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
  168. package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
  169. package/dist/esm/components/collapse/collapse.js.map +1 -1
  170. package/dist/esm/components/color-picker/color-picker.js.map +1 -1
  171. package/dist/esm/components/color-selector/color-selector.js.map +1 -1
  172. package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
  173. package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
  174. package/dist/esm/components/data-list/data-list.js.map +1 -1
  175. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  176. package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
  177. package/dist/esm/components/drawer/drawer.js.map +1 -1
  178. package/dist/esm/components/dropzone/dropzone.js.map +1 -1
  179. package/dist/esm/components/editable/editable.js.map +1 -1
  180. package/dist/esm/components/empty-state/empty-state.js.map +1 -1
  181. package/dist/esm/components/fade/fade.js.map +1 -1
  182. package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
  183. package/dist/esm/components/field/field.js.map +1 -1
  184. package/dist/esm/components/fieldset/fieldset.js.map +1 -1
  185. package/dist/esm/components/file-input/file-input.js.map +1 -1
  186. package/dist/esm/components/flip/flip.js.map +1 -1
  187. package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
  188. package/dist/esm/components/form/form.js.map +1 -1
  189. package/dist/esm/components/format/format-byte.js.map +1 -1
  190. package/dist/esm/components/format/format-date-time.js.map +1 -1
  191. package/dist/esm/components/format/format-number.js.map +1 -1
  192. package/dist/esm/components/highlight/highlight.js.map +1 -1
  193. package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
  194. package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
  195. package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
  196. package/dist/esm/components/icon/icons/index.js +7 -3
  197. package/dist/esm/components/icon/icons/index.js.map +1 -1
  198. package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
  199. package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
  200. package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
  201. package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
  202. package/dist/esm/components/icon/index.js +4 -2
  203. package/dist/esm/components/indicator/indicator.js.map +1 -1
  204. package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
  205. package/dist/esm/components/input/input-group.js.map +1 -1
  206. package/dist/esm/components/link-box/link-box.js.map +1 -1
  207. package/dist/esm/components/list/list.js.map +1 -1
  208. package/dist/esm/components/loading/audio.js.map +1 -1
  209. package/dist/esm/components/loading/background.js.map +1 -1
  210. package/dist/esm/components/loading/circles.js.map +1 -1
  211. package/dist/esm/components/loading/dots.js.map +1 -1
  212. package/dist/esm/components/loading/grid.js.map +1 -1
  213. package/dist/esm/components/loading/loading-provider.js.map +1 -1
  214. package/dist/esm/components/loading/oval.js.map +1 -1
  215. package/dist/esm/components/loading/page.js.map +1 -1
  216. package/dist/esm/components/loading/puff.js.map +1 -1
  217. package/dist/esm/components/loading/rings.js.map +1 -1
  218. package/dist/esm/components/loading/screen.js.map +1 -1
  219. package/dist/esm/components/loading/suspense.js.map +1 -1
  220. package/dist/esm/components/menu/menu.js.map +1 -1
  221. package/dist/esm/components/menu/use-menu.js.map +1 -1
  222. package/dist/esm/components/modal/modal.js.map +1 -1
  223. package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
  224. package/dist/esm/components/native-popover/native-popover.js.map +1 -1
  225. package/dist/esm/components/native-select/native-select.js.map +1 -1
  226. package/dist/esm/components/native-select/use-native-select.js.map +1 -1
  227. package/dist/esm/components/native-table/native-table.js.map +1 -1
  228. package/dist/esm/components/notice/notice-provider.js.map +1 -1
  229. package/dist/esm/components/notice/notice.js.map +1 -1
  230. package/dist/esm/components/notice/use-notice.js.map +1 -1
  231. package/dist/esm/components/number-input/number-input.js.map +1 -1
  232. package/dist/esm/components/pagination/pagination.js.map +1 -1
  233. package/dist/esm/components/password-input/password-input.js.map +1 -1
  234. package/dist/esm/components/password-input/strength-meter.js.map +1 -1
  235. package/dist/esm/components/picture/picture.js.map +1 -1
  236. package/dist/esm/components/pin-input/pin-input.js.map +1 -1
  237. package/dist/esm/components/popover/popover.js.map +1 -1
  238. package/dist/esm/components/progress/progress.js.map +1 -1
  239. package/dist/esm/components/qr-code/qr-code.js.map +1 -1
  240. package/dist/esm/components/radio/radio-group.js.map +1 -1
  241. package/dist/esm/components/radio/radio.js.map +1 -1
  242. package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
  243. package/dist/esm/components/radio-card/radio-card.js.map +1 -1
  244. package/dist/esm/components/rating/rating.js.map +1 -1
  245. package/dist/esm/components/reorder/reorder.js.map +1 -1
  246. package/dist/esm/components/resizable/resizable.js.map +1 -1
  247. package/dist/esm/components/ripple/ripple.js.map +1 -1
  248. package/dist/esm/components/rotate/rotate.js.map +1 -1
  249. package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
  250. package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
  251. package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
  252. package/dist/esm/components/select/select.js.map +1 -1
  253. package/dist/esm/components/select/use-select.js.map +1 -1
  254. package/dist/esm/components/sidebar/sidebar.js.map +1 -1
  255. package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
  256. package/dist/esm/components/slide/slide.js.map +1 -1
  257. package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
  258. package/dist/esm/components/slider/slider.js.map +1 -1
  259. package/dist/esm/components/slot/slot.js.map +1 -1
  260. package/dist/esm/components/snacks/snacks.js.map +1 -1
  261. package/dist/esm/components/stack/stack.js.map +1 -1
  262. package/dist/esm/components/stack/z-stack.js.map +1 -1
  263. package/dist/esm/components/stat/stat.js.map +1 -1
  264. package/dist/esm/components/status/status.js.map +1 -1
  265. package/dist/esm/components/steps/steps.js.map +1 -1
  266. package/dist/esm/components/switch/switch.js.map +1 -1
  267. package/dist/esm/components/table/table.js.map +1 -1
  268. package/dist/esm/components/tabs/tabs.js.map +1 -1
  269. package/dist/esm/components/tag/tag.js.map +1 -1
  270. package/dist/esm/components/timeline/timeline.js.map +1 -1
  271. package/dist/esm/components/tip/tip.js.map +1 -1
  272. package/dist/esm/components/toggle/toggle-group.js.map +1 -1
  273. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  274. package/dist/esm/components/tree/tree.js.map +1 -1
  275. package/dist/esm/components/tree/use-tree.js.map +1 -1
  276. package/dist/esm/core/components/create-component.js.map +1 -1
  277. package/dist/esm/core/system/breakpoint.js.map +1 -1
  278. package/dist/esm/core/system/environment-provider.js.map +1 -1
  279. package/dist/esm/core/system/styled.js.map +1 -1
  280. package/dist/esm/core/system/theme-provider.js.map +1 -1
  281. package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
  282. package/dist/esm/hooks/use-combobox/index.js.map +1 -1
  283. package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
  284. package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
  285. package/dist/esm/index.js +7 -3
  286. package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
  287. package/dist/esm/utils/store.js.map +1 -1
  288. package/dist/types/components/avatar/avatar.d.ts +3 -3
  289. package/dist/types/components/avatar/avatar.style.d.ts +1 -1
  290. package/dist/types/components/data-list/data-list.style.d.ts +1 -1
  291. package/dist/types/components/field/field.style.d.ts +2 -2
  292. package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
  293. package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
  294. package/dist/types/components/icon/icons/index.d.ts +5 -3
  295. package/dist/types/components/icon/icons/index.types.d.ts +1 -1
  296. package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
  297. package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
  298. package/dist/types/components/icon/index.d.ts +4 -2
  299. package/dist/types/components/menu/use-menu.d.ts +1 -1
  300. package/dist/types/components/number-input/number-input.style.d.ts +1 -1
  301. package/dist/types/components/steps/steps.style.d.ts +1 -1
  302. package/dist/types/components/timeline/timeline.d.ts +1 -1
  303. package/dist/types/components/timeline/timeline.style.d.ts +1 -1
  304. package/dist/types/index.d.ts +5 -3
  305. package/package.json +5 -5
  306. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
  307. package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
  308. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
  309. package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
  310. package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"rating.cjs","names":["createSlotComponent","ratingStyle","useRating","RatingContext","styled","useRatingContext","mergeProps","useRatingItem","StarIcon","varAttr"],"sources":["../../../../src/components/rating/rating.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { FunctionOrValue, Merge, ReactNodeOrFunction } from \"../../utils\"\nimport type { RatingStyle } from \"./rating.style\"\nimport type { UseRatingItemProps, UseRatingProps } from \"./use-rating\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled, varAttr } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { StarIcon } from \"../icon\"\nimport { ratingStyle } from \"./rating.style\"\nimport {\n RatingContext,\n useRating,\n useRatingContext,\n useRatingItem,\n} from \"./use-rating\"\n\ninterface ComponentContext extends Pick<\n RatingProps,\n | \"color\"\n | \"emptyIcon\"\n | \"filledIcon\"\n | \"groupProps\"\n | \"iconProps\"\n | \"inputProps\"\n | \"itemProps\"\n> {}\n\nexport interface RatingProps\n extends\n Merge<Omit<HTMLStyledProps, \"children\" | \"color\">, UseRatingProps>,\n ThemeProps<RatingStyle> {\n /**\n * The color of the filled icons.\n */\n color?: FunctionOrValue<number, CSSProps[\"color\"]>\n /**\n * The empty icon for the rating.\n */\n emptyIcon?: ReactNodeOrFunction<number>\n /**\n * The filled icon for the rating.\n */\n filledIcon?: ReactNodeOrFunction<number>\n /**\n * Props for the rating group.\n */\n groupProps?: FunctionOrValue<number, RatingGroupProps>\n /**\n * Props for the rating item.\n */\n iconProps?: FunctionOrValue<number, RatingIconProps>\n /**\n * Props for the input element.\n */\n inputProps?: FunctionOrValue<number, HTMLStyledProps<\"input\">>\n /**\n * Props for the rating item.\n */\n itemProps?: FunctionOrValue<number, RatingItemProps>\n}\n\nconst {\n ComponentContext,\n PropsContext: RatingPropsContext,\n useComponentContext,\n usePropsContext: useRatingPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<RatingProps, RatingStyle, ComponentContext>(\n \"rating\",\n ratingStyle,\n)\n\nexport { RatingPropsContext, useRatingPropsContext }\n\n/**\n * `Rating` is a component used to allow users to provide ratings.\n *\n * @see https://yamada-ui.com/docs/components/rating\n */\nexport const Rating = withProvider<\"div\", RatingProps>(\n ({\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n ...rest\n }) => {\n const {\n id,\n name,\n count,\n decimal,\n disabled,\n displayValue,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n getRootProps,\n } = useRating(rest)\n const ratingContext = useMemo(\n () => ({\n id,\n name,\n count,\n decimal,\n disabled,\n displayValue,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n }),\n [\n id,\n name,\n count,\n decimal,\n disabled,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n displayValue,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n ],\n )\n const componentContext = useMemo(\n () => ({\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n }),\n [\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n ],\n )\n\n return (\n <RatingContext value={ratingContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {Array.from({ length: count }).map((_, index) => (\n <RatingGroup key={index} value={index + 1} />\n ))}\n </styled.div>\n </ComponentContext>\n </RatingContext>\n )\n },\n \"root\",\n)()\n\ninterface RatingGroupProps extends HTMLStyledProps {\n value: number\n}\n\nconst RatingGroup = withContext<\"div\", RatingGroupProps>(\n ({ value, ...rest }) => {\n const { fractions } = useRatingContext()\n const { groupProps } = useComponentContext()\n const count = useMemo(\n () => (value === 1 ? fractions + 1 : fractions),\n [value, fractions],\n )\n\n return (\n <styled.div {...mergeProps(rest, runIfFn(groupProps, value))()}>\n {Array.from({ length: count }).map((_, index) => (\n <RatingItem key={index} groupValue={value} index={index} />\n ))}\n </styled.div>\n )\n },\n \"group\",\n)()\n\ninterface RatingItemProps\n extends HTMLStyledProps<\"label\">, UseRatingItemProps {}\n\nconst RatingItem = withContext<\"label\", RatingItemProps>((props) => {\n const {\n active,\n filled,\n fractionValue,\n groupValue,\n getInputProps,\n getLabelProps,\n } = useRatingItem(props)\n const {\n emptyIcon = <StarIcon fill=\"currentColor\" strokeColor=\"currentColor\" />,\n filledIcon = <StarIcon fill=\"currentColor\" strokeColor=\"currentColor\" />,\n iconProps,\n inputProps,\n itemProps,\n } = useComponentContext()\n const clipPath =\n fractionValue !== 1\n ? `inset(0 ${active ? 100 - fractionValue * 100 : 100}% 0 0)`\n : undefined\n\n return (\n <styled.label {...getLabelProps(runIfFn(itemProps, groupValue))}>\n <styled.input {...getInputProps(runIfFn(inputProps, groupValue))} />\n\n <RatingIcon\n {...{ \"--clip-path\": clipPath }}\n {...runIfFn(iconProps, groupValue)}\n >\n {filled\n ? runIfFn(filledIcon, groupValue)\n : runIfFn(emptyIcon, groupValue)}\n </RatingIcon>\n </styled.label>\n )\n}, \"item\")(undefined, ({ groupValue, ...rest }) => {\n const { color } = useComponentContext()\n\n return {\n \"--filled-color\": varAttr(runIfFn(color, groupValue), \"colors\"),\n groupValue,\n ...rest,\n }\n})\n\ninterface RatingIconProps extends HTMLStyledProps {}\n\nconst RatingIcon = withContext<\"div\", RatingIconProps>(\"div\", \"icon\")()\n"],"mappings":";;;;;;;;;;;;AA+DA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,SAAS,cACnB,EACC,OACA,WACA,YACA,YACA,WACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,IACA,MACA,OACA,SACA,UACA,cACA,WACA,uBACA,cACA,aACA,YACA,UACA,UACA,cACA,iBACA,UACA,OACA,WACA,WACA,YACA,iBACEC,mBA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AAA,SAAAA,GAAAA,oBAAAA,cAAAA,QAAAA,CAAgB,OAAO,UAAU,GAAG,QAAQ;EAC9D;EACA,GAAG;CACL;AACF,CAAC;AAID,MAAM,aAAa,YAAoC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"rating.cjs","names":["createSlotComponent","ratingStyle","useRating","RatingContext","styled","useRatingContext","mergeProps","useRatingItem","StarIcon","varAttr"],"sources":["../../../../src/components/rating/rating.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { FunctionOrValue, Merge, ReactNodeOrFunction } from \"../../utils\"\nimport type { RatingStyle } from \"./rating.style\"\nimport type { UseRatingItemProps, UseRatingProps } from \"./use-rating\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled, varAttr } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { StarIcon } from \"../icon\"\nimport { ratingStyle } from \"./rating.style\"\nimport {\n RatingContext,\n useRating,\n useRatingContext,\n useRatingItem,\n} from \"./use-rating\"\n\ninterface ComponentContext extends Pick<\n RatingProps,\n | \"color\"\n | \"emptyIcon\"\n | \"filledIcon\"\n | \"groupProps\"\n | \"iconProps\"\n | \"inputProps\"\n | \"itemProps\"\n> {}\n\nexport interface RatingProps\n extends\n Merge<Omit<HTMLStyledProps, \"children\" | \"color\">, UseRatingProps>,\n ThemeProps<RatingStyle> {\n /**\n * The color of the filled icons.\n */\n color?: FunctionOrValue<number, CSSProps[\"color\"]>\n /**\n * The empty icon for the rating.\n */\n emptyIcon?: ReactNodeOrFunction<number>\n /**\n * The filled icon for the rating.\n */\n filledIcon?: ReactNodeOrFunction<number>\n /**\n * Props for the rating group.\n */\n groupProps?: FunctionOrValue<number, RatingGroupProps>\n /**\n * Props for the rating item.\n */\n iconProps?: FunctionOrValue<number, RatingIconProps>\n /**\n * Props for the input element.\n */\n inputProps?: FunctionOrValue<number, HTMLStyledProps<\"input\">>\n /**\n * Props for the rating item.\n */\n itemProps?: FunctionOrValue<number, RatingItemProps>\n}\n\nconst {\n ComponentContext,\n PropsContext: RatingPropsContext,\n useComponentContext,\n usePropsContext: useRatingPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<RatingProps, RatingStyle, ComponentContext>(\n \"rating\",\n ratingStyle,\n)\n\nexport { RatingPropsContext, useRatingPropsContext }\n\n/**\n * `Rating` is a component used to allow users to provide ratings.\n *\n * @see https://yamada-ui.com/docs/components/rating\n */\nexport const Rating = withProvider<\"div\", RatingProps>(\n ({\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n ...rest\n }) => {\n const {\n id,\n name,\n count,\n decimal,\n disabled,\n displayValue,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n getRootProps,\n } = useRating(rest)\n const ratingContext = useMemo(\n () => ({\n id,\n name,\n count,\n decimal,\n disabled,\n displayValue,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n }),\n [\n id,\n name,\n count,\n decimal,\n disabled,\n fractions,\n highlightSelectedOnly,\n hoveredValue,\n interactive,\n displayValue,\n outsideRef,\n readOnly,\n required,\n roundedValue,\n setHoveredValue,\n setValue,\n value,\n ariaProps,\n dataProps,\n eventProps,\n ],\n )\n const componentContext = useMemo(\n () => ({\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n }),\n [\n color,\n emptyIcon,\n filledIcon,\n groupProps,\n iconProps,\n inputProps,\n itemProps,\n ],\n )\n\n return (\n <RatingContext value={ratingContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {Array.from({ length: count }).map((_, index) => (\n <RatingGroup key={index} value={index + 1} />\n ))}\n </styled.div>\n </ComponentContext>\n </RatingContext>\n )\n },\n \"root\",\n)()\n\ninterface RatingGroupProps extends HTMLStyledProps {\n value: number\n}\n\nconst RatingGroup = withContext<\"div\", RatingGroupProps>(\n ({ value, ...rest }) => {\n const { fractions } = useRatingContext()\n const { groupProps } = useComponentContext()\n const count = useMemo(\n () => (value === 1 ? fractions + 1 : fractions),\n [value, fractions],\n )\n\n return (\n <styled.div {...mergeProps(rest, runIfFn(groupProps, value))()}>\n {Array.from({ length: count }).map((_, index) => (\n <RatingItem key={index} groupValue={value} index={index} />\n ))}\n </styled.div>\n )\n },\n \"group\",\n)()\n\ninterface RatingItemProps\n extends HTMLStyledProps<\"label\">, UseRatingItemProps {}\n\nconst RatingItem = withContext<\"label\", RatingItemProps>((props) => {\n const {\n active,\n filled,\n fractionValue,\n groupValue,\n getInputProps,\n getLabelProps,\n } = useRatingItem(props)\n const {\n emptyIcon = <StarIcon fill=\"currentColor\" strokeColor=\"currentColor\" />,\n filledIcon = <StarIcon fill=\"currentColor\" strokeColor=\"currentColor\" />,\n iconProps,\n inputProps,\n itemProps,\n } = useComponentContext()\n const clipPath =\n fractionValue !== 1\n ? `inset(0 ${active ? 100 - fractionValue * 100 : 100}% 0 0)`\n : undefined\n\n return (\n <styled.label {...getLabelProps(runIfFn(itemProps, groupValue))}>\n <styled.input {...getInputProps(runIfFn(inputProps, groupValue))} />\n\n <RatingIcon\n {...{ \"--clip-path\": clipPath }}\n {...runIfFn(iconProps, groupValue)}\n >\n {filled\n ? runIfFn(filledIcon, groupValue)\n : runIfFn(emptyIcon, groupValue)}\n </RatingIcon>\n </styled.label>\n )\n}, \"item\")(undefined, ({ groupValue, ...rest }) => {\n const { color } = useComponentContext()\n\n return {\n \"--filled-color\": varAttr(runIfFn(color, groupValue), \"colors\"),\n groupValue,\n ...rest,\n }\n})\n\ninterface RatingIconProps extends HTMLStyledProps {}\n\nconst RatingIcon = withContext<\"div\", RatingIconProps>(\"div\", \"icon\")()\n"],"mappings":";;;;;;;;;;;;AA+DA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,SAAS,cACnB,EACC,OACA,WACA,YACA,YACA,WACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,IACA,MACA,OACA,SACA,UACA,cACA,WACA,uBACA,cACA,aACA,YACA,UACA,UACA,cACA,iBACA,UACA,OACA,WACA,WACA,YACA,iBACEC,mBAAAA,UAAU,IAAI;CAClB,MAAM,iBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,oBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,eAAD;EAAe,OAAO;EACpB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;GAAkB,OAAO;GACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;IAAY,GAAI,aAAa;IAC1B,UAAA,MAAM,KAAK,EAAE,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,UACrC,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAyB,OAAO,QAAQ,EAAI,GAA1B,KAA0B,CAC7C;GACS,CAAA;EACI,CAAA;CACL,CAAA;AAEnB,GACA,MACF,CAAC,CAAC;AAMF,MAAM,cAAc,aACjB,EAAE,OAAO,GAAG,WAAW;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AAA,GAEnE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;GACQ,eAAe;GACrB,IAAA,GAAA,oBAAA,cAAA,QAAA,CAAY,WAAW,UAAU;GAEhC,UAAA,UAAA,GAAA,oBAAA,cAAA,QAAA,CACW,YAAY,UAAU,KAAA,GAAA,oBAAA,cAAA,QAAA,CACtB,WAAW,UAAU;EACvB,CAAA,CACA;;AAElB,GAAG,MAAM,CAAC,CAAC,KAAA,IAAY,EAAE,YAAY,GAAG,WAAW;CACjD,MAAM,EAAE,UAAU,oBAAoB;CAEtC,OAAO;EACL,kBAAkBK,YAAAA,SAAAA,GAAAA,oBAAAA,cAAAA,QAAAA,CAAgB,OAAO,UAAU,GAAG,QAAQ;EAC9D;EACA,GAAG;CACL;AACF,CAAC;AAID,MAAM,aAAa,YAAoC,OAAO,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"reorder.cjs","names":["createSlotComponent","reorderStyle","useValue","useReorder","ReorderContext","styled","OriginalReorder","useReorderItem","ReorderItemContext","useReorderItemContext","GripVerticalIcon"],"sources":["../../../../src/components/reorder/reorder.tsx"],"sourcesContent":["\"use client\"\n\nimport type { PropsWithChildren, ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { ReorderStyle } from \"./reorder.style\"\nimport type { UseReorderItemProps, UseReorderProps } from \"./use-reorder\"\nimport { Reorder as OriginalReorder } from \"motion/react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { GripVerticalIcon } from \"../icon\"\nimport { reorderStyle } from \"./reorder.style\"\nimport {\n ReorderContext,\n ReorderItemContext,\n useReorder,\n useReorderItem,\n useReorderItemContext,\n} from \"./use-reorder\"\n\nexport interface ReorderItem<Y = string> extends ReorderItemProps<Y> {}\n\nexport interface ReorderRootProps<Y = string>\n extends\n Merge<\n HTMLMotionProps<\"ul\">,\n Omit<UseReorderProps<Y>, \"item\" | \"items\" | \"orientation\">\n >,\n ThemeProps<ReorderStyle> {\n /**\n * If provided, generate reorder items based on items.\n *\n */\n items?: ReorderItem<Y>[]\n}\n\nconst {\n PropsContext: ReorderPropsContext,\n usePropsContext: useReorderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ReorderRootProps, ReorderStyle>(\"reorder\", reorderStyle)\n\nexport { ReorderPropsContext, useReorderPropsContext }\n\n/**\n * `Reorder` is a component that allows you to change the order of items using drag and drop.\n *\n * @see https://yamada-ui.com/docs/components/reorder\n */\nexport const ReorderRoot = withProvider<\"ul\", ReorderRootProps>(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\n <Y extends any = string>({\n orientation: orientationProp,\n ...rest\n }: ReorderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const { children, getRootProps } = useReorder({\n ...rest,\n item: <ReorderItem />,\n orientation,\n })\n\n return (\n <ReorderContext value={{ orientation }}>\n <styled.ul\n as={OriginalReorder.Group<Y[]>}\n {...(getRootProps() as HTMLStyledProps<\"ul\">)}\n >\n {children}\n </styled.ul>\n </ReorderContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)() as GenericsComponent<{\n <Y = string>(props: ReorderRootProps<Y>): ReactElement\n}>\n\nexport interface ReorderItemProps<Y = string>\n extends\n Omit<Merge<HTMLMotionProps<\"li\">, UseReorderItemProps<Y>>, \"children\">,\n PropsWithChildren {}\n\nexport const ReorderItem = withContext<\"li\", ReorderItemProps>(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\n <Y extends any = string>(props: ReorderItemProps<Y>) => {\n const { getItemProps, getTriggerProps } = useReorderItem(props)\n\n return (\n <ReorderItemContext value={{ getTriggerProps }}>\n <styled.li\n as={OriginalReorder.Item<Y>}\n {...(getItemProps() as HTMLStyledProps<\"li\">)}\n />\n </ReorderItemContext>\n )\n },\n \"item\",\n)() as GenericsComponent<{\n <Y = string>(props: ReorderItemProps<Y>): ReactElement\n}>\n\nexport interface ReorderTriggerProps extends HTMLStyledProps {}\n\nexport const ReorderTrigger = withContext<\"div\", ReorderTriggerProps>(\n \"div\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useReorderItemContext()\n\n return { children: <GripVerticalIcon />, ...getTriggerProps(props) }\n})\n"],"mappings":";;;;;;;;;;AAqCA,MAAM,EACJ,cAAc,qBACd,iBAAiB,wBACjB,aACA,iBACEA,yBAAAA,oBAAoD,WAAWC,sBAAAA,YAAY;;;;;;AAS/E,MAAa,cAAc,cAEA,EACvB,aAAa,iBACb,GAAG,WACsB;CACzB,MAAM,cAAcC,8BAAAA,SAAS,eAAe;CAC5C,MAAM,EAAE,UAAU,iBAAiBC,oBAAAA,WAAW;EAC5C,GAAG;EACH,MAAM,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,CAAc,CAAA;EACpB;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,gBAAD;EAAgB,OAAO,EAAE,YAAY;YACnC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,IAAR;GACE,IAAIC,aAAAA,QAAgB;GACpB,GAAK,aAAa;GAEjB;EACQ,CAAA;CACG,CAAA;AAEpB,GACA,QACA,EAAE,eAAe,CAAC,aAAa,EAAE,CACnC,CAAC,CAAC;AASF,MAAa,cAAc,aAEA,UAA+B;CACtD,MAAM,EAAE,cAAc,oBAAoBC,oBAAAA,eAAe,KAAK;CAE9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,oBAAD;EAAoB,OAAO,EAAE,gBAAgB;YAC3C,iBAAA,GAAA,kBAAA,IAAA,CAACH,gBAAAA,OAAO,IAAR;GACE,IAAIC,aAAAA,QAAgB;GACpB,GAAK,aAAa;EACnB,CAAA;CACiB,CAAA;AAExB,GACA,MACF,CAAC,CAAC;AAMF,MAAa,iBAAiB,YAC5B,OACA,SACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,oBAAoBG,oBAAAA,sBAAsB;CAElD,OAAO;EAAE,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,kBAAD,CAAmB,CAAA;EAAG,GAAG,gBAAgB,KAAK;CAAE;AACrE,CAAC"}
1
+ {"version":3,"file":"reorder.cjs","names":["createSlotComponent","reorderStyle","useValue","useReorder","ReorderContext","styled","OriginalReorder","useReorderItem","ReorderItemContext","useReorderItemContext","GripVerticalIcon"],"sources":["../../../../src/components/reorder/reorder.tsx"],"sourcesContent":["\"use client\"\n\nimport type { PropsWithChildren, ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { ReorderStyle } from \"./reorder.style\"\nimport type { UseReorderItemProps, UseReorderProps } from \"./use-reorder\"\nimport { Reorder as OriginalReorder } from \"motion/react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { GripVerticalIcon } from \"../icon\"\nimport { reorderStyle } from \"./reorder.style\"\nimport {\n ReorderContext,\n ReorderItemContext,\n useReorder,\n useReorderItem,\n useReorderItemContext,\n} from \"./use-reorder\"\n\nexport interface ReorderItem<Y = string> extends ReorderItemProps<Y> {}\n\nexport interface ReorderRootProps<Y = string>\n extends\n Merge<\n HTMLMotionProps<\"ul\">,\n Omit<UseReorderProps<Y>, \"item\" | \"items\" | \"orientation\">\n >,\n ThemeProps<ReorderStyle> {\n /**\n * If provided, generate reorder items based on items.\n *\n */\n items?: ReorderItem<Y>[]\n}\n\nconst {\n PropsContext: ReorderPropsContext,\n usePropsContext: useReorderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ReorderRootProps, ReorderStyle>(\"reorder\", reorderStyle)\n\nexport { ReorderPropsContext, useReorderPropsContext }\n\n/**\n * `Reorder` is a component that allows you to change the order of items using drag and drop.\n *\n * @see https://yamada-ui.com/docs/components/reorder\n */\nexport const ReorderRoot = withProvider<\"ul\", ReorderRootProps>(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\n <Y extends any = string>({\n orientation: orientationProp,\n ...rest\n }: ReorderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const { children, getRootProps } = useReorder({\n ...rest,\n item: <ReorderItem />,\n orientation,\n })\n\n return (\n <ReorderContext value={{ orientation }}>\n <styled.ul\n as={OriginalReorder.Group<Y[]>}\n {...(getRootProps() as HTMLStyledProps<\"ul\">)}\n >\n {children}\n </styled.ul>\n </ReorderContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)() as GenericsComponent<{\n <Y = string>(props: ReorderRootProps<Y>): ReactElement\n}>\n\nexport interface ReorderItemProps<Y = string>\n extends\n Omit<Merge<HTMLMotionProps<\"li\">, UseReorderItemProps<Y>>, \"children\">,\n PropsWithChildren {}\n\nexport const ReorderItem = withContext<\"li\", ReorderItemProps>(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\n <Y extends any = string>(props: ReorderItemProps<Y>) => {\n const { getItemProps, getTriggerProps } = useReorderItem(props)\n\n return (\n <ReorderItemContext value={{ getTriggerProps }}>\n <styled.li\n as={OriginalReorder.Item<Y>}\n {...(getItemProps() as HTMLStyledProps<\"li\">)}\n />\n </ReorderItemContext>\n )\n },\n \"item\",\n)() as GenericsComponent<{\n <Y = string>(props: ReorderItemProps<Y>): ReactElement\n}>\n\nexport interface ReorderTriggerProps extends HTMLStyledProps {}\n\nexport const ReorderTrigger = withContext<\"div\", ReorderTriggerProps>(\n \"div\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useReorderItemContext()\n\n return { children: <GripVerticalIcon />, ...getTriggerProps(props) }\n})\n"],"mappings":";;;;;;;;;;AAqCA,MAAM,EACJ,cAAc,qBACd,iBAAiB,wBACjB,aACA,iBACEA,yBAAAA,oBAAoD,WAAWC,sBAAAA,YAAY;;;;;;AAS/E,MAAa,cAAc,cAEA,EACvB,aAAa,iBACb,GAAG,WACsB;CACzB,MAAM,cAAcC,8BAAAA,SAAS,eAAe;CAC5C,MAAM,EAAE,UAAU,iBAAiBC,oBAAAA,WAAW;EAC5C,GAAG;EACH,MAAM,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,CAAc,CAAA;EACpB;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,gBAAD;EAAgB,OAAO,EAAE,YAAY;EACnC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,IAAR;GACE,IAAIC,aAAAA,QAAgB;GACpB,GAAK,aAAa;GAEjB;EACQ,CAAA;CACG,CAAA;AAEpB,GACA,QACA,EAAE,eAAe,CAAC,aAAa,EAAE,CACnC,CAAC,CAAC;AASF,MAAa,cAAc,aAEA,UAA+B;CACtD,MAAM,EAAE,cAAc,oBAAoBC,oBAAAA,eAAe,KAAK;CAE9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,oBAAD;EAAoB,OAAO,EAAE,gBAAgB;EAC3C,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACH,gBAAAA,OAAO,IAAR;GACE,IAAIC,aAAAA,QAAgB;GACpB,GAAK,aAAa;EACnB,CAAA;CACiB,CAAA;AAExB,GACA,MACF,CAAC,CAAC;AAMF,MAAa,iBAAiB,YAC5B,OACA,SACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,oBAAoBG,oBAAAA,sBAAsB;CAElD,OAAO;EAAE,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,kBAAD,CAAmB,CAAA;EAAG,GAAG,gBAAgB,KAAK;CAAE;AACrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resizable.cjs","names":["createSlotComponent","resizableStyle","useResizable","useValue","ResizableContext","styled","Group","useResizableItem","Panel","useResizableTrigger","Separator"],"sources":["../../../../src/components/resizable/resizable.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n HTMLStyledProps,\n HTMLStyledPropsWithoutAs,\n ThemeProps,\n} from \"../../core\"\nimport type { ResizableStyle } from \"./resizable.style\"\nimport type {\n UseResizableItemProps,\n UseResizableProps,\n UseResizableTriggerProps,\n} from \"./use-resizable\"\nimport { useMemo } from \"react\"\nimport { Group, Panel, Separator } from \"react-resizable-panels\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { resizableStyle } from \"./resizable.style\"\nimport {\n ResizableContext,\n useResizable,\n useResizableItem,\n useResizableTrigger,\n} from \"./use-resizable\"\n\n/**\n * `Resizable` is accessible resizable panel groups and layouts with keyboard support.\n *\n * @see https://yamada-ui.com/docs/components/resizable\n */\nexport interface ResizableRootProps\n extends\n HTMLStyledProps,\n ThemeProps<ResizableStyle>,\n Omit<UseResizableProps, \"orientation\"> {}\n\nconst {\n PropsContext: ResizablePropsContext,\n usePropsContext: useResizablePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ResizableRootProps, ResizableStyle>(\n \"resizable\",\n resizableStyle,\n)\n\nexport { ResizablePropsContext, useResizablePropsContext }\n\nexport const ResizableRoot = withProvider<\n \"div\",\n ResizableRootProps,\n \"orientation\"\n>(\n ({ children, orientation: orientationProp, ...rest }) => {\n const computedOrientation = useValue(orientationProp)\n const { disabled, groupRef, orientation, getRootProps } = useResizable({\n orientation: computedOrientation,\n ...rest,\n })\n\n const context = useMemo(\n () => ({ disabled, groupRef, orientation }),\n [disabled, orientation, groupRef],\n )\n\n return (\n <ResizableContext value={context}>\n <styled.div as={Group} {...getRootProps()}>\n {children}\n </styled.div>\n </ResizableContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)()\n\nexport interface ResizableItemProps\n extends HTMLStyledPropsWithoutAs, UseResizableItemProps {}\n\nexport const ResizableItem = withContext<\"div\", ResizableItemProps>((props) => {\n const { getItemProps } = useResizableItem(props)\n\n return <styled.div as={Panel} {...getItemProps()} />\n}, \"item\")()\n\nexport interface ResizableTriggerProps\n extends HTMLStyledPropsWithoutAs, UseResizableTriggerProps {\n /**\n * The resizable trigger icon to use.\n */\n icon?: ReactElement\n /**\n * Props for resizable trigger icon component.\n */\n iconProps?: HTMLStyledProps\n}\n\nexport const ResizableTrigger = withContext<\"div\", ResizableTriggerProps>(\n ({ children, icon, iconProps, ...rest }) => {\n const { getIconProps, getTriggerProps } = useResizableTrigger(rest)\n\n return (\n <styled.div as={Separator} {...getTriggerProps()}>\n {icon ? (\n <ResizableIcon {...getIconProps(iconProps)}>{icon}</ResizableIcon>\n ) : null}\n\n {children}\n </styled.div>\n )\n },\n \"trigger\",\n)()\n\ninterface ResizableIconProps extends HTMLStyledProps {}\n\nconst ResizableIcon = withContext<\"div\", ResizableIconProps>(\"div\", \"icon\")()\n"],"mappings":";;;;;;;;;;AAqCA,MAAM,EACJ,cAAc,uBACd,iBAAiB,0BACjB,aACA,iBACEA,yBAAAA,oBACF,aACAC,wBAAAA,cACF;AAIA,MAAa,gBAAgB,cAK1B,EAAE,UAAU,aAAa,iBAAiB,GAAG,WAAW;CAEvD,MAAM,EAAE,UAAU,UAAU,aAAa,iBAAiBC,sBAAAA,aAAa;EACrE,aAF0BC,8BAAAA,SAAS,eAEJ;EAC/B,GAAG;CACL,CAAC;CAOD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,kBAAD;EAAkB,QAAA,GAAA,MAAA,QAAA,QALX;GAAE;GAAU;GAAU;EAAY,IACzC;GAAC;GAAU;GAAa;EAAQ,CAID;YAC7B,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;GAAY,IAAIC,uBAAAA;GAAO,GAAI,aAAa;GACrC;EACS,CAAA;CACI,CAAA;AAEtB,GACA,QACA,EAAE,eAAe,CAAC,aAAa,EAAE,CACnC,CAAC,CAAC;AAKF,MAAa,gBAAgB,aAAwC,UAAU;CAC7E,MAAM,EAAE,iBAAiBC,sBAAAA,iBAAiB,KAAK;CAE/C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACF,gBAAAA,OAAO,KAAR;EAAY,IAAIG,uBAAAA;EAAO,GAAI,aAAa;CAAI,CAAA;AACrD,GAAG,MAAM,CAAC,CAAC;AAcX,MAAa,mBAAmB,aAC7B,EAAE,UAAU,MAAM,WAAW,GAAG,WAAW;CAC1C,MAAM,EAAE,cAAc,oBAAoBC,sBAAAA,oBAAoB,IAAI;CAElE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACJ,gBAAAA,OAAO,KAAR;EAAY,IAAIK,uBAAAA;EAAW,GAAI,gBAAgB;YAA/C,CACG,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;GAAe,GAAI,aAAa,SAAS;aAAI;EAAoB,CAAA,IAC/D,MAEH,QACS;;AAEhB,GACA,SACF,CAAC,CAAC;AAIF,MAAM,gBAAgB,YAAuC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"resizable.cjs","names":["createSlotComponent","resizableStyle","useResizable","useValue","ResizableContext","styled","Group","useResizableItem","Panel","useResizableTrigger","Separator"],"sources":["../../../../src/components/resizable/resizable.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n HTMLStyledProps,\n HTMLStyledPropsWithoutAs,\n ThemeProps,\n} from \"../../core\"\nimport type { ResizableStyle } from \"./resizable.style\"\nimport type {\n UseResizableItemProps,\n UseResizableProps,\n UseResizableTriggerProps,\n} from \"./use-resizable\"\nimport { useMemo } from \"react\"\nimport { Group, Panel, Separator } from \"react-resizable-panels\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { resizableStyle } from \"./resizable.style\"\nimport {\n ResizableContext,\n useResizable,\n useResizableItem,\n useResizableTrigger,\n} from \"./use-resizable\"\n\n/**\n * `Resizable` is accessible resizable panel groups and layouts with keyboard support.\n *\n * @see https://yamada-ui.com/docs/components/resizable\n */\nexport interface ResizableRootProps\n extends\n HTMLStyledProps,\n ThemeProps<ResizableStyle>,\n Omit<UseResizableProps, \"orientation\"> {}\n\nconst {\n PropsContext: ResizablePropsContext,\n usePropsContext: useResizablePropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ResizableRootProps, ResizableStyle>(\n \"resizable\",\n resizableStyle,\n)\n\nexport { ResizablePropsContext, useResizablePropsContext }\n\nexport const ResizableRoot = withProvider<\n \"div\",\n ResizableRootProps,\n \"orientation\"\n>(\n ({ children, orientation: orientationProp, ...rest }) => {\n const computedOrientation = useValue(orientationProp)\n const { disabled, groupRef, orientation, getRootProps } = useResizable({\n orientation: computedOrientation,\n ...rest,\n })\n\n const context = useMemo(\n () => ({ disabled, groupRef, orientation }),\n [disabled, orientation, groupRef],\n )\n\n return (\n <ResizableContext value={context}>\n <styled.div as={Group} {...getRootProps()}>\n {children}\n </styled.div>\n </ResizableContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)()\n\nexport interface ResizableItemProps\n extends HTMLStyledPropsWithoutAs, UseResizableItemProps {}\n\nexport const ResizableItem = withContext<\"div\", ResizableItemProps>((props) => {\n const { getItemProps } = useResizableItem(props)\n\n return <styled.div as={Panel} {...getItemProps()} />\n}, \"item\")()\n\nexport interface ResizableTriggerProps\n extends HTMLStyledPropsWithoutAs, UseResizableTriggerProps {\n /**\n * The resizable trigger icon to use.\n */\n icon?: ReactElement\n /**\n * Props for resizable trigger icon component.\n */\n iconProps?: HTMLStyledProps\n}\n\nexport const ResizableTrigger = withContext<\"div\", ResizableTriggerProps>(\n ({ children, icon, iconProps, ...rest }) => {\n const { getIconProps, getTriggerProps } = useResizableTrigger(rest)\n\n return (\n <styled.div as={Separator} {...getTriggerProps()}>\n {icon ? (\n <ResizableIcon {...getIconProps(iconProps)}>{icon}</ResizableIcon>\n ) : null}\n\n {children}\n </styled.div>\n )\n },\n \"trigger\",\n)()\n\ninterface ResizableIconProps extends HTMLStyledProps {}\n\nconst ResizableIcon = withContext<\"div\", ResizableIconProps>(\"div\", \"icon\")()\n"],"mappings":";;;;;;;;;;AAqCA,MAAM,EACJ,cAAc,uBACd,iBAAiB,0BACjB,aACA,iBACEA,yBAAAA,oBACF,aACAC,wBAAAA,cACF;AAIA,MAAa,gBAAgB,cAK1B,EAAE,UAAU,aAAa,iBAAiB,GAAG,WAAW;CAEvD,MAAM,EAAE,UAAU,UAAU,aAAa,iBAAiBC,sBAAAA,aAAa;EACrE,aAF0BC,8BAAAA,SAAS,eAEJ;EAC/B,GAAG;CACL,CAAC;CAOD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,kBAAD;EAAkB,QAAA,GAAA,MAAA,QAAA,QALX;GAAE;GAAU;GAAU;EAAY,IACzC;GAAC;GAAU;GAAa;EAAQ,CAID;EAC7B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;GAAY,IAAIC,uBAAAA;GAAO,GAAI,aAAa;GACrC;EACS,CAAA;CACI,CAAA;AAEtB,GACA,QACA,EAAE,eAAe,CAAC,aAAa,EAAE,CACnC,CAAC,CAAC;AAKF,MAAa,gBAAgB,aAAwC,UAAU;CAC7E,MAAM,EAAE,iBAAiBC,sBAAAA,iBAAiB,KAAK;CAE/C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACF,gBAAAA,OAAO,KAAR;EAAY,IAAIG,uBAAAA;EAAO,GAAI,aAAa;CAAI,CAAA;AACrD,GAAG,MAAM,CAAC,CAAC;AAcX,MAAa,mBAAmB,aAC7B,EAAE,UAAU,MAAM,WAAW,GAAG,WAAW;CAC1C,MAAM,EAAE,cAAc,oBAAoBC,sBAAAA,oBAAoB,IAAI;CAElE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACJ,gBAAAA,OAAO,KAAR;EAAY,IAAIK,uBAAAA;EAAW,GAAI,gBAAgB;EAA/C,UAAA,CACG,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;GAAe,GAAI,aAAa,SAAS;GAAI,UAAA;EAAoB,CAAA,IAC/D,MAEH,QACS;;AAEhB,GACA,SACF,CAAC,CAAC;AAIF,MAAM,gBAAgB,YAAuC,OAAO,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ripple.cjs","names":["createComponent","rippleStyle","AnimatePresence","motion"],"sources":["../../../../src/components/ripple/ripple.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Key } from \"react\"\nimport type { ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { RippleStyle } from \"./ripple.style\"\nimport type { RippleOptions } from \"./use-ripple\"\nimport { AnimatePresence } from \"motion/react\"\nimport { createComponent } from \"../../core\"\nimport { handlerAll } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { rippleStyle } from \"./ripple.style\"\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max)\n\nexport interface RippleProps\n extends HTMLMotionProps<\"span\">, ThemeProps<RippleStyle> {\n /**\n * The ripples to use.\n */\n ripples: RippleOptions[]\n /**\n * The callback invoked when a ripple is cleared.\n */\n onClear: (key: Key) => void\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nconst {\n PropsContext: RipplePropsContext,\n usePropsContext: useRipplePropsContext,\n withContext,\n} = createComponent<RippleProps, RippleStyle>(\"ripple\", rippleStyle)\n\nexport { RipplePropsContext, useRipplePropsContext }\n\n/**\n * `Ripple` is a component that adds a ripple effect to elements, allowing users to recognize when they have clicked.\n *\n * @see https://yamada-ui.com/docs/components/ripple\n */\nexport const Ripple = withContext<\"span\", RippleProps>(\n ({\n style,\n color = \"currentColor\",\n disabled,\n ripples,\n onAnimationComplete,\n onClear,\n ...rest\n }) => {\n if (disabled) return null\n\n return (\n <>\n {ripples.map(({ key, size, x, y }) => {\n const duration = clamp(0.01 * size, 0.2, size > 100 ? 0.75 : 0.5)\n\n return (\n <AnimatePresence key={key} mode=\"popLayout\">\n <motion.span\n style={{\n height: `${size}px`,\n left: x,\n pointerEvents: \"none\",\n position: \"absolute\",\n top: y,\n transformOrigin: \"center\",\n width: `${size}px`,\n ...style,\n }}\n animate={{ opacity: 0, transform: \"scale(2)\" }}\n bgColor={color}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0.35, transform: \"scale(0)\" }}\n transition={{ duration }}\n {...rest}\n onAnimationComplete={handlerAll(onAnimationComplete, () =>\n onClear(key),\n )}\n />\n </AnimatePresence>\n )\n })}\n </>\n )\n },\n)()\n"],"mappings":";;;;;;;;AAaA,MAAM,SAAS,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAoBpC,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACEA,yBAAAA,gBAA0C,UAAUC,qBAAAA,WAAW;;;;;;AASnE,MAAa,SAAS,aACnB,EACC,OACA,QAAQ,gBACR,UACA,SACA,qBACA,SACA,GAAG,WACC;CACJ,IAAI,UAAU,OAAO;CAErB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACG,QAAQ,KAAK,EAAE,KAAK,MAAM,GAAG,QAAQ;EACpC,MAAM,WAAW,MAAM,MAAO,MAAM,IAAK,OAAO,MAAM,MAAO,EAAG;EAEhE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;GAA2B,MAAK;aAC9B,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,MAAR;IACE,OAAO;KACL,QAAQ,GAAG,KAAK;KAChB,MAAM;KACN,eAAe;KACf,UAAU;KACV,KAAK;KACL,iBAAiB;KACjB,OAAO,GAAG,KAAK;KACf,GAAG;IACL;IACA,SAAS;KAAE,SAAS;KAAG,WAAW;IAAW;IAC7C,SAAS;IACT,MAAM,EAAE,SAAS,EAAE;IACnB,SAAS;KAAE,SAAS;KAAM,WAAW;IAAW;IAChD,YAAY,EAAE,SAAS;IACvB,GAAI;IACJ,sBAAA,GAAA,oBAAA,cAAA,WAAA,CAAgC,2BAC9B,QAAQ,GAAG,CACb;GACD,CAAA;EACc,GAtBK,GAsBL;CAErB,CAAC,EACD,CAAA;AAEN,CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"ripple.cjs","names":["createComponent","rippleStyle","AnimatePresence","motion"],"sources":["../../../../src/components/ripple/ripple.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Key } from \"react\"\nimport type { ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { RippleStyle } from \"./ripple.style\"\nimport type { RippleOptions } from \"./use-ripple\"\nimport { AnimatePresence } from \"motion/react\"\nimport { createComponent } from \"../../core\"\nimport { handlerAll } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { rippleStyle } from \"./ripple.style\"\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(Math.max(value, min), max)\n\nexport interface RippleProps\n extends HTMLMotionProps<\"span\">, ThemeProps<RippleStyle> {\n /**\n * The ripples to use.\n */\n ripples: RippleOptions[]\n /**\n * The callback invoked when a ripple is cleared.\n */\n onClear: (key: Key) => void\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disabled?: boolean\n}\n\nconst {\n PropsContext: RipplePropsContext,\n usePropsContext: useRipplePropsContext,\n withContext,\n} = createComponent<RippleProps, RippleStyle>(\"ripple\", rippleStyle)\n\nexport { RipplePropsContext, useRipplePropsContext }\n\n/**\n * `Ripple` is a component that adds a ripple effect to elements, allowing users to recognize when they have clicked.\n *\n * @see https://yamada-ui.com/docs/components/ripple\n */\nexport const Ripple = withContext<\"span\", RippleProps>(\n ({\n style,\n color = \"currentColor\",\n disabled,\n ripples,\n onAnimationComplete,\n onClear,\n ...rest\n }) => {\n if (disabled) return null\n\n return (\n <>\n {ripples.map(({ key, size, x, y }) => {\n const duration = clamp(0.01 * size, 0.2, size > 100 ? 0.75 : 0.5)\n\n return (\n <AnimatePresence key={key} mode=\"popLayout\">\n <motion.span\n style={{\n height: `${size}px`,\n left: x,\n pointerEvents: \"none\",\n position: \"absolute\",\n top: y,\n transformOrigin: \"center\",\n width: `${size}px`,\n ...style,\n }}\n animate={{ opacity: 0, transform: \"scale(2)\" }}\n bgColor={color}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0.35, transform: \"scale(0)\" }}\n transition={{ duration }}\n {...rest}\n onAnimationComplete={handlerAll(onAnimationComplete, () =>\n onClear(key),\n )}\n />\n </AnimatePresence>\n )\n })}\n </>\n )\n },\n)()\n"],"mappings":";;;;;;;;AAaA,MAAM,SAAS,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,GAAG;AAoBpC,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACEA,yBAAAA,gBAA0C,UAAUC,qBAAAA,WAAW;;;;;;AASnE,MAAa,SAAS,aACnB,EACC,OACA,QAAQ,gBACR,UACA,SACA,qBACA,SACA,GAAG,WACC;CACJ,IAAI,UAAU,OAAO;CAErB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UACG,QAAQ,KAAK,EAAE,KAAK,MAAM,GAAG,QAAQ;EACpC,MAAM,WAAW,MAAM,MAAO,MAAM,IAAK,OAAO,MAAM,MAAO,EAAG;EAEhE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,iBAAD;GAA2B,MAAK;GAC9B,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,MAAR;IACE,OAAO;KACL,QAAQ,GAAG,KAAK;KAChB,MAAM;KACN,eAAe;KACf,UAAU;KACV,KAAK;KACL,iBAAiB;KACjB,OAAO,GAAG,KAAK;KACf,GAAG;IACL;IACA,SAAS;KAAE,SAAS;KAAG,WAAW;IAAW;IAC7C,SAAS;IACT,MAAM,EAAE,SAAS,EAAE;IACnB,SAAS;KAAE,SAAS;KAAM,WAAW;IAAW;IAChD,YAAY,EAAE,SAAS;IACvB,GAAI;IACJ,sBAAA,GAAA,oBAAA,cAAA,WAAA,CAAgC,2BAC9B,QAAQ,GAAG,CACb;GACD,CAAA;EACc,GAtBK,GAsBL;CAErB,CAAC,EACD,CAAA;AAEN,CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rotate.cjs","names":["createComponent","rotateStyle","useControllableState","motion","useInjectVarsIntoCss","useInjectVarsIntoProps"],"sources":["../../../../src/components/rotate/rotate.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { KeyframeIdent, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { RotateStyle } from \"./rotate.style\"\nimport { useAnimation } from \"motion/react\"\nimport { useCallback } from \"react\"\nimport {\n createComponent,\n useInjectVarsIntoCss,\n useInjectVarsIntoProps,\n} from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { dataAttr, handlerAll } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { rotateStyle } from \"./rotate.style\"\n\nexport interface RotateProps\n extends\n Omit<HTMLMotionProps<\"button\">, \"onChange\" | \"rotate\">,\n ThemeProps<RotateStyle> {\n /**\n * Passing React elements to \"from\" is required.\n */\n from: ReactNode\n /**\n * Passing React elements to \"to\" is required.\n */\n to: ReactNode\n /**\n * You can set the initial state.\n *\n * @default 'from'\n */\n defaultValue?: KeyframeIdent\n /**\n * The animation delay.\n *\n * @default 0\n */\n delay?: number\n /**\n * If `true`, the component is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The animation duration.\n *\n * @default 0.4\n */\n duration?: number\n /**\n * If `true`, the component is readonly.\n *\n * @default false\n */\n readOnly?: boolean\n /**\n * The animation rotation.\n *\n * @default 45\n */\n rotate?: number\n /**\n * Use this when you want to control the animation from outside the component.\n */\n value?: KeyframeIdent\n /**\n * This is a callback function that is called when the animation state changes.\n */\n onChange?: (value: KeyframeIdent) => void\n}\n\nconst {\n PropsContext: RotatePropsContext,\n usePropsContext: useRotatePropsContext,\n withContext,\n} = createComponent<RotateProps, RotateStyle>(\"rotate\", rotateStyle)\n\nexport { RotatePropsContext, useRotatePropsContext }\n\n/**\n * `Rotate` is an animation component that alternately rotates two elements as they switch.\n *\n * @see https://yamada-ui.com/docs/components/rotate\n */\nexport const Rotate = withContext<\"button\", RotateProps>(\n ({\n defaultValue = \"from\",\n delay = 0,\n disabled,\n duration = 0.4,\n from,\n readOnly,\n rotate = 45,\n to,\n value: valueProp,\n onChange,\n onClick: onClickProp,\n ...rest\n }) => {\n const opacity = \"var(--opacity)\"\n const animate = useAnimation()\n const [value, setValue] = useControllableState<KeyframeIdent>({\n defaultValue,\n value: valueProp,\n onChange,\n })\n\n const onClick = useCallback(async () => {\n if (readOnly) return\n\n await animate.start({\n opacity: 0,\n rotate: `${rotate}deg`,\n transition: { delay, duration },\n })\n\n setValue((prev) => (prev === \"from\" ? \"to\" : \"from\"))\n\n await animate.start({\n opacity: \"var(--opacity)\",\n rotate: \"0deg\",\n transition: { duration },\n })\n }, [readOnly, animate, rotate, duration, delay, setValue])\n\n return (\n <motion.button\n type=\"button\"\n data-disabled={dataAttr(disabled)}\n data-readonly={dataAttr(readOnly)}\n data-value={value}\n animate={animate}\n custom={{ rotate }}\n disabled={disabled}\n initial={{ opacity, rotate: \"0deg\" }}\n onClick={handlerAll(onClickProp, onClick)}\n {...rest}\n >\n {value === \"from\" ? from : to}\n </motion.button>\n )\n },\n)(undefined, (props) => {\n const css = useInjectVarsIntoCss(props.css, { opacity: \"opacity\" })\n const rest = useInjectVarsIntoProps(props, { opacity: \"opacity\" })\n\n return { ...rest, css, opacity: \"{opacity}\" }\n})\n"],"mappings":";;;;;;;;;;;AA4EA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACEA,yBAAAA,gBAA0C,UAAUC,qBAAAA,WAAW;;;;;;AASnE,MA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":"rotate.cjs","names":["createComponent","rotateStyle","useControllableState","motion","useInjectVarsIntoCss","useInjectVarsIntoProps"],"sources":["../../../../src/components/rotate/rotate.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { KeyframeIdent, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { RotateStyle } from \"./rotate.style\"\nimport { useAnimation } from \"motion/react\"\nimport { useCallback } from \"react\"\nimport {\n createComponent,\n useInjectVarsIntoCss,\n useInjectVarsIntoProps,\n} from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { dataAttr, handlerAll } from \"../../utils\"\nimport { motion } from \"../motion\"\nimport { rotateStyle } from \"./rotate.style\"\n\nexport interface RotateProps\n extends\n Omit<HTMLMotionProps<\"button\">, \"onChange\" | \"rotate\">,\n ThemeProps<RotateStyle> {\n /**\n * Passing React elements to \"from\" is required.\n */\n from: ReactNode\n /**\n * Passing React elements to \"to\" is required.\n */\n to: ReactNode\n /**\n * You can set the initial state.\n *\n * @default 'from'\n */\n defaultValue?: KeyframeIdent\n /**\n * The animation delay.\n *\n * @default 0\n */\n delay?: number\n /**\n * If `true`, the component is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The animation duration.\n *\n * @default 0.4\n */\n duration?: number\n /**\n * If `true`, the component is readonly.\n *\n * @default false\n */\n readOnly?: boolean\n /**\n * The animation rotation.\n *\n * @default 45\n */\n rotate?: number\n /**\n * Use this when you want to control the animation from outside the component.\n */\n value?: KeyframeIdent\n /**\n * This is a callback function that is called when the animation state changes.\n */\n onChange?: (value: KeyframeIdent) => void\n}\n\nconst {\n PropsContext: RotatePropsContext,\n usePropsContext: useRotatePropsContext,\n withContext,\n} = createComponent<RotateProps, RotateStyle>(\"rotate\", rotateStyle)\n\nexport { RotatePropsContext, useRotatePropsContext }\n\n/**\n * `Rotate` is an animation component that alternately rotates two elements as they switch.\n *\n * @see https://yamada-ui.com/docs/components/rotate\n */\nexport const Rotate = withContext<\"button\", RotateProps>(\n ({\n defaultValue = \"from\",\n delay = 0,\n disabled,\n duration = 0.4,\n from,\n readOnly,\n rotate = 45,\n to,\n value: valueProp,\n onChange,\n onClick: onClickProp,\n ...rest\n }) => {\n const opacity = \"var(--opacity)\"\n const animate = useAnimation()\n const [value, setValue] = useControllableState<KeyframeIdent>({\n defaultValue,\n value: valueProp,\n onChange,\n })\n\n const onClick = useCallback(async () => {\n if (readOnly) return\n\n await animate.start({\n opacity: 0,\n rotate: `${rotate}deg`,\n transition: { delay, duration },\n })\n\n setValue((prev) => (prev === \"from\" ? \"to\" : \"from\"))\n\n await animate.start({\n opacity: \"var(--opacity)\",\n rotate: \"0deg\",\n transition: { duration },\n })\n }, [readOnly, animate, rotate, duration, delay, setValue])\n\n return (\n <motion.button\n type=\"button\"\n data-disabled={dataAttr(disabled)}\n data-readonly={dataAttr(readOnly)}\n data-value={value}\n animate={animate}\n custom={{ rotate }}\n disabled={disabled}\n initial={{ opacity, rotate: \"0deg\" }}\n onClick={handlerAll(onClickProp, onClick)}\n {...rest}\n >\n {value === \"from\" ? from : to}\n </motion.button>\n )\n },\n)(undefined, (props) => {\n const css = useInjectVarsIntoCss(props.css, { opacity: \"opacity\" })\n const rest = useInjectVarsIntoProps(props, { opacity: \"opacity\" })\n\n return { ...rest, css, opacity: \"{opacity}\" }\n})\n"],"mappings":";;;;;;;;;;;AA4EA,MAAM,EACJ,cAAc,oBACd,iBAAiB,uBACjB,gBACEA,yBAAAA,gBAA0C,UAAUC,qBAAAA,WAAW;;;;;;AASnE,MAAa,SAAS,aACnB,EACC,eAAe,QACf,QAAQ,GACR,UACA,WAAW,IACX,MACA,UACA,SAAS,IACT,IACA,OAAO,WACP,UACA,SAAS,aACT,GAAG,WACC;CACJ,MAAM,UAAU;CAChB,MAAM,WAAA,GAAA,aAAA,aAAA,CAAuB;CAC7B,MAAM,CAAC,OAAO,YAAYC,2CAAAA,qBAAoC;EAC5D;EACA,OAAO;EACP;CACF,CAAC;CAED,MAAM,WAAA,GAAA,MAAA,YAAA,CAAsB,YAAY;EACtC,IAAI,UAAU;EAEd,MAAM,QAAQ,MAAM;GAClB,SAAS;GACT,QAAQ,GAAG,OAAO;GAClB,YAAY;IAAE;IAAO;GAAS;EAChC,CAAC;EAED,UAAU,SAAU,SAAS,SAAS,OAAO,MAAO;EAEpD,MAAM,QAAQ,MAAM;GAClB,SAAS;GACT,QAAQ;GACR,YAAY,EAAE,SAAS;EACzB,CAAC;CACH,GAAG;EAAC;EAAU;EAAS;EAAQ;EAAU;EAAO;CAAQ,CAAC;CAEzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,QAAR;EACE,MAAK;EACL,kBAAA,GAAA,oBAAA,cAAA,SAAA,CAAwB,QAAQ;EAChC,kBAAA,GAAA,oBAAA,cAAA,SAAA,CAAwB,QAAQ;EAChC,cAAY;EACH;EACT,QAAQ,EAAE,OAAO;EACP;EACV,SAAS;GAAE;GAAS,QAAQ;EAAO;EACnC,UAAA,GAAA,oBAAA,cAAA,WAAA,CAAoB,aAAa,OAAO;EACxC,GAAI;EAEH,UAAA,UAAU,SAAS,OAAO;CACd,CAAA;AAEnB,CACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,MAAMC,wBAAAA,qBAAqB,MAAM,KAAK,EAAE,SAAS,UAAU,CAAC;CAGlE,OAAO;EAAE,GAFIC,wBAAAA,uBAAuB,OAAO,EAAE,SAAS,UAAU,CAEjD;EAAG;EAAK,SAAS;CAAY;AAC9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"saturation-slider.cjs","names":["createSlotComponent","saturationSliderStyle","useSaturationSlider","styled"],"sources":["../../../../src/components/saturation-slider/saturation-slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { SaturationSliderStyle } from \"./saturation-slider.style\"\nimport type {\n UseSaturationSliderProps,\n UseSaturationSliderReturn,\n} from \"./use-saturation-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { saturationSliderStyle } from \"./saturation-slider.style\"\nimport { useSaturationSlider } from \"./use-saturation-slider\"\n\ninterface ComponentContext extends Pick<\n UseSaturationSliderReturn,\n \"getThumbProps\" | \"getTrackProps\"\n> {}\n\nexport interface SaturationSliderRootProps\n extends\n Merge<HTMLStyledProps, UseSaturationSliderProps>,\n ThemeProps<SaturationSliderStyle> {\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the thumb element.\n */\n thumbProps?: SaturationSliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SaturationSliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SaturationSliderPropsContext,\n useComponentContext,\n usePropsContext: useSaturationSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n SaturationSliderRootProps,\n SaturationSliderStyle,\n ComponentContext\n>(\"saturation-slider\", saturationSliderStyle)\n\nexport { SaturationSliderPropsContext, useSaturationSliderPropsContext }\n\n/**\n * `SaturationSlider` is a component used to allow the user to select a color saturation.\n *\n * @see https://yamada-ui.com/docs/components/saturation-slider\n */\nexport const SaturationSliderRoot = withProvider<\n \"input\",\n SaturationSliderRootProps\n>(({ children, inputProps, thumbProps, trackProps, ...rest }) => {\n const { getInputProps, getRootProps, getThumbProps, getTrackProps } =\n useSaturationSlider(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <SaturationSliderTrack {...trackProps}>\n <SaturationSliderThumb {...thumbProps} />\n </SaturationSliderTrack>\n )\n }, [children, thumbProps, trackProps])\n const context = useMemo(\n () => ({ getThumbProps, getTrackProps }),\n [getThumbProps, getTrackProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <styled.input {...getInputProps(inputProps)} />\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n}, \"root\")()\n\nexport interface SaturationSliderTrackProps extends HTMLStyledProps {}\n\nexport const SaturationSliderTrack = withContext<\n \"div\",\n SaturationSliderTrackProps\n>(\"div\", \"track\")(undefined, (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n})\n\nexport interface SaturationSliderThumbProps extends HTMLStyledProps {}\n\nexport const SaturationSliderThumb = withContext<\n \"div\",\n SaturationSliderThumbProps\n>(\"div\", \"thumb\")(undefined, (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n})\n"],"mappings":";;;;;;;;AAqCA,MAAM,EACJ,kBACA,cAAc,8BACd,qBACA,iBAAiB,iCACjB,aACA,iBACEA,yBAAAA,oBAIF,qBAAqBC,gCAAAA,qBAAqB;;;;;;AAS5C,MAAa,uBAAuB,cAGjC,EAAE,UAAU,YAAY,YAAY,YAAY,GAAG,WAAW;CAC/D,MAAM,EAAE,eAAe,cAAc,eAAe,kBAClDC,8BAAAA,oBAAoB,IAAI;CAC1B,MAAM,oBAAA,GAAA,MAAA,QAAA,OAAiC;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD;GAAuB,GAAI;aACzB,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD,EAAuB,GAAI,WAAa,CAAA;EACnB,CAAA;CAE3B,GAAG;EAAC;EAAU;EAAY;CAAU,CAAC;CACrC,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAe;CAAc,IACtC,CAAC,eAAe,aAAa,CAC/B;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,OAAO;YACvB,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,OAAO,KAAR;GAAY,GAAI,aAAa;aAA7B,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA,GAC7C,gBACS;;CACI,CAAA;AAEtB,GAAG,MAAM,CAAC,CAAC;AAIX,MAAa,wBAAwB,YAGnC,OAAO,OAAO,CAAC,CAAC,KAAA,IAAY,UAAU;CACtC,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO,OAAO,CAAC,CAAC,KAAA,IAAY,UAAU;CACtC,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CAAC"}
1
+ {"version":3,"file":"saturation-slider.cjs","names":["createSlotComponent","saturationSliderStyle","useSaturationSlider","styled"],"sources":["../../../../src/components/saturation-slider/saturation-slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { SaturationSliderStyle } from \"./saturation-slider.style\"\nimport type {\n UseSaturationSliderProps,\n UseSaturationSliderReturn,\n} from \"./use-saturation-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { saturationSliderStyle } from \"./saturation-slider.style\"\nimport { useSaturationSlider } from \"./use-saturation-slider\"\n\ninterface ComponentContext extends Pick<\n UseSaturationSliderReturn,\n \"getThumbProps\" | \"getTrackProps\"\n> {}\n\nexport interface SaturationSliderRootProps\n extends\n Merge<HTMLStyledProps, UseSaturationSliderProps>,\n ThemeProps<SaturationSliderStyle> {\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the thumb element.\n */\n thumbProps?: SaturationSliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SaturationSliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SaturationSliderPropsContext,\n useComponentContext,\n usePropsContext: useSaturationSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n SaturationSliderRootProps,\n SaturationSliderStyle,\n ComponentContext\n>(\"saturation-slider\", saturationSliderStyle)\n\nexport { SaturationSliderPropsContext, useSaturationSliderPropsContext }\n\n/**\n * `SaturationSlider` is a component used to allow the user to select a color saturation.\n *\n * @see https://yamada-ui.com/docs/components/saturation-slider\n */\nexport const SaturationSliderRoot = withProvider<\n \"input\",\n SaturationSliderRootProps\n>(({ children, inputProps, thumbProps, trackProps, ...rest }) => {\n const { getInputProps, getRootProps, getThumbProps, getTrackProps } =\n useSaturationSlider(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <SaturationSliderTrack {...trackProps}>\n <SaturationSliderThumb {...thumbProps} />\n </SaturationSliderTrack>\n )\n }, [children, thumbProps, trackProps])\n const context = useMemo(\n () => ({ getThumbProps, getTrackProps }),\n [getThumbProps, getTrackProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <styled.input {...getInputProps(inputProps)} />\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n}, \"root\")()\n\nexport interface SaturationSliderTrackProps extends HTMLStyledProps {}\n\nexport const SaturationSliderTrack = withContext<\n \"div\",\n SaturationSliderTrackProps\n>(\"div\", \"track\")(undefined, (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n})\n\nexport interface SaturationSliderThumbProps extends HTMLStyledProps {}\n\nexport const SaturationSliderThumb = withContext<\n \"div\",\n SaturationSliderThumbProps\n>(\"div\", \"thumb\")(undefined, (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n})\n"],"mappings":";;;;;;;;AAqCA,MAAM,EACJ,kBACA,cAAc,8BACd,qBACA,iBAAiB,iCACjB,aACA,iBACEA,yBAAAA,oBAIF,qBAAqBC,gCAAAA,qBAAqB;;;;;;AAS5C,MAAa,uBAAuB,cAGjC,EAAE,UAAU,YAAY,YAAY,YAAY,GAAG,WAAW;CAC/D,MAAM,EAAE,eAAe,cAAc,eAAe,kBAClDC,8BAAAA,oBAAoB,IAAI;CAC1B,MAAM,oBAAA,GAAA,MAAA,QAAA,OAAiC;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD;GAAuB,GAAI;GACzB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAD,EAAuB,GAAI,WAAa,CAAA;EACnB,CAAA;CAE3B,GAAG;EAAC;EAAU;EAAY;CAAU,CAAC;CACrC,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAe;CAAc,IACtC,CAAC,eAAe,aAAa,CAC/B;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACC,gBAAAA,OAAO,KAAR;GAAY,GAAI,aAAa;GAA7B,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA,GAC7C,gBACS;;CACI,CAAA;AAEtB,GAAG,MAAM,CAAC,CAAC;AAIX,MAAa,wBAAwB,YAGnC,OAAO,OAAO,CAAC,CAAC,KAAA,IAAY,UAAU;CACtC,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO,OAAO,CAAC,CAAC,KAAA,IAAY,UAAU;CACtC,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-saturation-slider.cjs","names":["useFieldProps","useI18n","useControllableState","usePanEvent","mergeProps","visuallyHiddenAttributes","mergeRefs"],"sources":["../../../../src/components/saturation-slider/use-saturation-slider.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { Point } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { usePanEvent } from \"../../hooks/use-pan-event\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n clampNumber,\n cx,\n handlerAll,\n mergeRefs,\n roundNumberToStep,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { runKeyAction } from \"../../utils/dom\"\nimport { useFieldProps } from \"../field\"\n\nfunction clampValue(value: [number, number, number]) {\n return [\n clampNumber(value[0], 0, 360),\n clampNumber(value[1], 0, 1),\n clampNumber(value[2], 0, 1),\n ] as [number, number, number]\n}\n\nexport interface UseSaturationSliderProps\n extends\n Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * The initial value of the saturation slider.\n *\n * @default [0, 0, 1]\n */\n defaultValue?: [number, number, number]\n /**\n * The base `id` to use for the slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * The value of the saturation slider.\n */\n value?: [number, number, number]\n /**\n * This is used to format the value so that screen readers\n * can speak out a more human-friendly value.\n *\n * It is used to set the `aria-valuetext` property of the input.\n */\n getAriaValueText?: (value: [number, number, number]) => string | undefined\n /**\n * Function called whenever the saturation slider value changes.\n */\n onChange?: (value: [number, number, number]) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: [number, number, number]) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: [number, number, number]) => void\n}\n\nexport const useSaturationSlider = (props: UseSaturationSliderProps = {}) => {\n const {\n props: {\n id,\n ref,\n name,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n defaultValue = [0, 0, 1],\n disabled,\n getAriaValueText,\n readOnly,\n required,\n step = 0.01,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd,\n onChangeStart,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const { t } = useI18n(\"saturationSlider\")\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [h, s, v] = clampValue(value)\n const interactive = !(disabled || readOnly)\n const [_, getPanEventProps] = usePanEvent<HTMLDivElement>({\n onEnd: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n onChangeEnd?.(panValue)\n },\n onMove: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n setValue(panValue)\n },\n onStart: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n onChangeStart?.(value)\n setValue(panValue)\n },\n })\n\n const onChange = useCallback(\n ([h, s, v]: [number, number, number]) => {\n if (!interactive) return\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n setValue([h, s, v])\n },\n [interactive, setValue],\n )\n\n const getPanValue = useCallback(\n (\n { x, y }: Point,\n { bottom, height, left, width }: DOMRect,\n ): [number, number, number] => {\n const diff = { x: x - left, y: bottom - y }\n const percent = { x: diff.x / width, y: diff.y / height }\n const clamp = {\n x: clampNumber(percent.x, 0, 1),\n y: clampNumber(percent.y, 0, 1),\n }\n const s = roundNumberToStep(clamp.x, 0, step)\n const v = roundNumberToStep(clamp.y, 0, step)\n\n return [h, parseFloat(s), parseFloat(v)]\n },\n [h, step],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => onChange([h, s, v - step]),\n ArrowLeft: () => onChange([h, s - step, v]),\n ArrowRight: () => onChange([h, s + step, v]),\n ArrowUp: () => onChange([h, s, v + step]),\n })\n },\n [h, onChange, s, step, v],\n )\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => {\n const merged = mergeProps(dataProps, rest, props)()\n\n return {\n ...merged,\n style: {\n ...rest.style,\n ...props.style,\n \"--x\": `${Math.abs(s * 100)}%`,\n \"--y\": `${Math.abs(100 - v * 100)}%`,\n backgroundColor: `hsl(${h}, 100%, 50%)`,\n backgroundImage:\n \"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, transparent)\",\n },\n onBlur: handlerAll(props.onBlur, eventProps.onBlur),\n onFocus: handlerAll(props.onFocus, eventProps.onFocus),\n }\n },\n [dataProps, eventProps, h, rest, s, v],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => ({\n ...visuallyHiddenAttributes,\n ...dataProps,\n ...ariaProps,\n id,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: [h, s, v].toString(),\n ...props,\n ref: mergeRefs(props.ref, ref),\n }),\n [\n ariaProps,\n dataProps,\n disabled,\n h,\n id,\n name,\n readOnly,\n ref,\n required,\n s,\n v,\n ],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}) => getPanEventProps({ ...dataProps, ...props }),\n [dataProps, getPanEventProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}) => ({\n ...dataProps,\n ...ariaProps,\n \"aria-label\": t(\"Saturation and brightness thumb\"),\n \"aria-roledescription\": \"2D slider\",\n \"aria-valuemax\": 100,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": s * 100,\n \"aria-valuetext\":\n ariaValueText ??\n getAriaValueText?.(value) ??\n t(\"Saturation {saturation}%, Brightness {brightness}%\", {\n brightness: v * 100,\n saturation: s * 100,\n }),\n role: \"slider\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n \"aria-labelledby\": cx(props[\"aria-labelledby\"], ariaLabelledBy),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n ariaLabelledBy,\n ariaProps,\n ariaValueText,\n dataProps,\n getAriaValueText,\n interactive,\n onKeyDown,\n s,\n t,\n v,\n value,\n ],\n )\n\n return {\n setValue,\n value,\n getInputProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n onChange,\n }\n}\n\nexport type UseSaturationSliderRetur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,cAAc,IAAI;GAC5B,GAAG;GACH,oBAAA,GAAA,oBAAA,cAAA,GAAA,CAAsB,MAAM,oBAAoB,cAAc;GAC9D,YAAA,GAAA,oBAAA,cAAA,WAAA,CAAsB,MAAM,WAAW,SAAS;EAClD,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAQY;EACZ;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-saturation-slider.cjs","names":["useFieldProps","useI18n","useControllableState","usePanEvent","mergeProps","visuallyHiddenAttributes","mergeRefs"],"sources":["../../../../src/components/saturation-slider/use-saturation-slider.ts"],"sourcesContent":["\"use client\"\n\nimport type { KeyboardEvent } from \"react\"\nimport type { HTMLProps, HTMLRefAttributes, PropGetter } from \"../../core\"\nimport type { Point } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { usePanEvent } from \"../../hooks/use-pan-event\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n clampNumber,\n cx,\n handlerAll,\n mergeRefs,\n roundNumberToStep,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { runKeyAction } from \"../../utils/dom\"\nimport { useFieldProps } from \"../field\"\n\nfunction clampValue(value: [number, number, number]) {\n return [\n clampNumber(value[0], 0, 360),\n clampNumber(value[1], 0, 1),\n clampNumber(value[2], 0, 1),\n ] as [number, number, number]\n}\n\nexport interface UseSaturationSliderProps\n extends\n Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n HTMLRefAttributes<\"input\">,\n FieldProps {\n /**\n * The initial value of the saturation slider.\n *\n * @default [0, 0, 1]\n */\n defaultValue?: [number, number, number]\n /**\n * The base `id` to use for the slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * The value of the saturation slider.\n */\n value?: [number, number, number]\n /**\n * This is used to format the value so that screen readers\n * can speak out a more human-friendly value.\n *\n * It is used to set the `aria-valuetext` property of the input.\n */\n getAriaValueText?: (value: [number, number, number]) => string | undefined\n /**\n * Function called whenever the saturation slider value changes.\n */\n onChange?: (value: [number, number, number]) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: [number, number, number]) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: [number, number, number]) => void\n}\n\nexport const useSaturationSlider = (props: UseSaturationSliderProps = {}) => {\n const {\n props: {\n id,\n ref,\n name,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n defaultValue = [0, 0, 1],\n disabled,\n getAriaValueText,\n readOnly,\n required,\n step = 0.01,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd,\n onChangeStart,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const { t } = useI18n(\"saturationSlider\")\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [h, s, v] = clampValue(value)\n const interactive = !(disabled || readOnly)\n const [_, getPanEventProps] = usePanEvent<HTMLDivElement>({\n onEnd: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n onChangeEnd?.(panValue)\n },\n onMove: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n setValue(panValue)\n },\n onStart: (_, point, rect) => {\n if (!interactive) return\n\n const panValue = getPanValue(point, rect)\n\n onChangeStart?.(value)\n setValue(panValue)\n },\n })\n\n const onChange = useCallback(\n ([h, s, v]: [number, number, number]) => {\n if (!interactive) return\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n setValue([h, s, v])\n },\n [interactive, setValue],\n )\n\n const getPanValue = useCallback(\n (\n { x, y }: Point,\n { bottom, height, left, width }: DOMRect,\n ): [number, number, number] => {\n const diff = { x: x - left, y: bottom - y }\n const percent = { x: diff.x / width, y: diff.y / height }\n const clamp = {\n x: clampNumber(percent.x, 0, 1),\n y: clampNumber(percent.y, 0, 1),\n }\n const s = roundNumberToStep(clamp.x, 0, step)\n const v = roundNumberToStep(clamp.y, 0, step)\n\n return [h, parseFloat(s), parseFloat(v)]\n },\n [h, step],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n runKeyAction(ev, {\n ArrowDown: () => onChange([h, s, v - step]),\n ArrowLeft: () => onChange([h, s - step, v]),\n ArrowRight: () => onChange([h, s + step, v]),\n ArrowUp: () => onChange([h, s, v + step]),\n })\n },\n [h, onChange, s, step, v],\n )\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) => {\n const merged = mergeProps(dataProps, rest, props)()\n\n return {\n ...merged,\n style: {\n ...rest.style,\n ...props.style,\n \"--x\": `${Math.abs(s * 100)}%`,\n \"--y\": `${Math.abs(100 - v * 100)}%`,\n backgroundColor: `hsl(${h}, 100%, 50%)`,\n backgroundImage:\n \"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, transparent)\",\n },\n onBlur: handlerAll(props.onBlur, eventProps.onBlur),\n onFocus: handlerAll(props.onFocus, eventProps.onFocus),\n }\n },\n [dataProps, eventProps, h, rest, s, v],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => ({\n ...visuallyHiddenAttributes,\n ...dataProps,\n ...ariaProps,\n id,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: [h, s, v].toString(),\n ...props,\n ref: mergeRefs(props.ref, ref),\n }),\n [\n ariaProps,\n dataProps,\n disabled,\n h,\n id,\n name,\n readOnly,\n ref,\n required,\n s,\n v,\n ],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}) => getPanEventProps({ ...dataProps, ...props }),\n [dataProps, getPanEventProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}) => ({\n ...dataProps,\n ...ariaProps,\n \"aria-label\": t(\"Saturation and brightness thumb\"),\n \"aria-roledescription\": \"2D slider\",\n \"aria-valuemax\": 100,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": s * 100,\n \"aria-valuetext\":\n ariaValueText ??\n getAriaValueText?.(value) ??\n t(\"Saturation {saturation}%, Brightness {brightness}%\", {\n brightness: v * 100,\n saturation: s * 100,\n }),\n role: \"slider\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n \"aria-labelledby\": cx(props[\"aria-labelledby\"], ariaLabelledBy),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }),\n [\n ariaLabelledBy,\n ariaProps,\n ariaValueText,\n dataProps,\n getAriaValueText,\n interactive,\n onKeyDown,\n s,\n t,\n v,\n value,\n ],\n )\n\n return {\n setValue,\n value,\n getInputProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n onChange,\n }\n}\n\nexport type UseSaturationSliderReturn = ReturnType<typeof useSaturationSlider>\n"],"mappings":";;;;;;;;;;;AAsBA,SAAS,WAAW,OAAiC;CACnD,OAAO;GACO,GAAA,oBAAA,cAAA,YAAA,CAAA,MAAM,IAAI,GAAG,GAAG;GAChB,GAAA,oBAAA,cAAA,YAAA,CAAA,MAAM,IAAI,GAAG,CAAC;GACd,GAAA,oBAAA,cAAA,YAAA,CAAA,MAAM,IAAI,GAAG,CAAC;CAC5B;AACF;AAqDA,MAAa,uBAAuB,QAAkC,CAAC,MAAM;CAC3E,MAAM,EACJ,OAAO,EACL,IACA,KACA,MACA,mBAAmB,gBACnB,kBAAkB,eAClB,eAAe;EAAC;EAAG;EAAG;CAAC,GACvB,UACA,kBACA,UACA,UACA,OAAO,KACP,OAAO,WACP,UAAU,cACV,aACA,eACA,GAAG,QAEL,WACA,WACA,eACEA,wBAAAA,cAAc,KAAK;CACvB,MAAM,EAAE,MAAMC,sBAAAA,QAAQ,kBAAkB;CACxC,MAAM,CAAC,OAAO,YAAYC,2CAAAA,qBAAqB;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;EACH;EACA,MAAM;EACN;EACA;EACA;EACA;EACA,OAAO;GAAC;GAAG;GAAG;EAAC,CAAC,CAAC,SAAS;EAC1B,GAAG;EACH,KAAKC,YAAAA,UAAU,MAAM,KAAK,GAAG;CAC/B,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,iBAAA,GAAA,MAAA,YAAA,EACH,QAAQ,CAAC,MAAM,iBAAiB;EAAE,GAAG;EAAW,GAAG;CAAM,CAAC,GAC3D,CAAC,WAAW,gBAAgB,CAC9B;CAuCA,OAAO;EACL;EACA;EACA;EACA;EACA,gBAAA,GAAA,MAAA,YAAA,EAzCC,QAAQ,CAAC,OAAO;GACf,GAAG;GACH,GAAG;GACH,cAAc,EAAE,iCAAiC;GACjD,wBAAwB;GACxB,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB,IAAI;GACrB,kBACE,iBACA,mBAAmB,KAAK,KACxB,EAAE,sDAAsD;IACtD,YAAY,IAAI;IAChB,YAAY,IAAI;GAClB,CAAC;GACH,MAAM;GACN,UAAU,cAAc,IAAI;GAC5B,GAAG;GACH,oBAAA,GAAA,oBAAA,cAAA,GAAA,CAAsB,MAAM,oBAAoB,cAAc;GAC9D,YAAA,GAAA,oBAAA,cAAA,WAAA,CAAsB,MAAM,WAAW,SAAS;EAClD,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAQY;EACZ;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-control.cjs","names":["createSlotComponent","segmentedControlStyle","useSegmentedControl","useValue","SegmentedControlContext","SegmentedControlDescendantsContext","LayoutGroup","styled","useSegmentedControlItem","motion"],"sources":["../../../../src/components/segmented-control/segmented-control.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { SegmentedControlStyle } from \"./segmented-control.style\"\nimport type {\n UseSegmentedControlItemProps,\n UseSegmentedControlProps,\n} from \"./use-segmented-control\"\nimport { LayoutGroup } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { motion } from \"../motion\"\nimport { segmentedControlStyle } from \"./segmented-control.style\"\nimport {\n SegmentedControlContext,\n SegmentedControlDescendantsContext,\n useSegmentedControl,\n useSegmentedControlItem,\n} from \"./use-segmented-control\"\n\nexport interface SegmentedControlItem extends SegmentedControlItemProps {\n label?: ReactNode\n}\n\ninterface ComponentContext extends Pick<\n SegmentedControlRootProps,\n \"indicatorProps\" | \"itemProps\"\n> {}\n\nexport interface SegmentedControlRootProps<Y extends string = string>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<SegmentedControlStyle>,\n Omit<UseSegmentedControlProps<Y>, \"orientation\"> {\n /**\n * If provided, generate segmented control buttons but based on items.\n *\n * @default []\n */\n items?: SegmentedControlItem[]\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SegmentedControlIndicatorProps\n /**\n * Props for the item component.\n */\n itemProps?: SegmentedControlItemProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SegmentedControlPropsContext,\n useComponentContext,\n usePropsContext: useSegmentedControlPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n SegmentedControlRootProps,\n SegmentedControlStyle,\n ComponentContext\n>(\"segmented-control\", segmentedControlStyle)\n\nexport { SegmentedControlPropsContext, useSegmentedControlPropsContext }\n\n/**\n * `SegmentedControl` is a component used for allowing users to select one option from multiple choices.\n *\n * @see https://yamada-ui.com/docs/components/segmented-control\n */\nexport const SegmentedControlRoot = withProvider(\n ({\n children,\n items = [],\n orientation: orientationProp,\n indicatorProps,\n itemProps,\n ...rest\n }) => {\n const computedOrientation = useValue(orientationProp)\n const {\n id,\n name,\n descendants,\n disabled,\n orientation,\n readOnly,\n setValue,\n value,\n getRootProps,\n } = useSegmentedControl({ orientation: computedOrientation, ...rest })\n const cloneChildren = useMemo(() => {\n if (children) return children\n else\n return items.map(({ label, ...rest }, index) => (\n <SegmentedControlItem key={index} {...rest}>\n {label}\n </SegmentedControlItem>\n ))\n }, [children, items])\n const context = useMemo(\n () => ({ id, name, disabled, orientation, readOnly, setValue, value }),\n [id, name, disabled, readOnly, orientation, setValue, value],\n )\n const componentContext = useMemo(\n () => ({ indicatorProps, itemProps }),\n [itemProps, indicatorProps],\n )\n\n return (\n <SegmentedControlContext value={context}>\n <ComponentContext value={componentContext}>\n <SegmentedControlDescendantsContext value={descendants}>\n <LayoutGroup id={id}>\n <styled.div {...getRootProps()}>{cloneChildren}</styled.div>\n </LayoutGroup>\n </SegmentedControlDescendantsContext>\n </ComponentContext>\n </SegmentedControlContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)() as GenericsComponent<{\n <Y extends string = string>(props: SegmentedControlRootProps<Y>): ReactElement\n}>\n\nexport interface SegmentedControlItemProps<Y extends string = string>\n extends HTMLStyledProps<\"label\">, UseSegmentedControlItemProps<Y> {\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SegmentedControlIndicatorProps\n}\n\nexport const SegmentedControlItem = withContext<\n \"label\",\n SegmentedControlItemProps\n>(({ children, indicatorProps, ...rest }) => {\n const { checked, getInputProps, getLabelProps } =\n useSegmentedControlItem(rest)\n\n return (\n <styled.label {...getLabelProps()}>\n <styled.input {...getInputProps()} />\n\n <styled.span>{children}</styled.span>\n\n {checked ? <SegmentedControlIndicator {...indicatorProps} /> : null}\n </styled.label>\n )\n}, \"item\")((props) => {\n const { indicatorProps, itemProps } = useComponentContext()\n\n return {\n ...itemProps,\n ...props,\n indicatorProps: {\n ...indicatorProps,\n ...itemProps?.indicatorProps,\n ...props.indicatorProps,\n },\n }\n}) as GenericsComponent<{\n <Y extends string = string>(props: SegmentedControlItemProps<Y>): ReactElement\n}>\n\ninterface SegmentedControlIndicatorProps extends HTMLMotionProps {}\n\nconst SegmentedControlIndicator = withContext<\n \"div\",\n SegmentedControlIndicatorProps\n>(({ transition, ...props }) => {\n return (\n <motion.div\n layoutDependency={false}\n layoutId=\"indicator\"\n transition={{ duration: 0.2, ...transition }}\n {...props}\n />\n )\n}, \"indicator\")()\n"],"mappings":";;;;;;;;;;;AAqDA,MAAM,EACJ,kBACA,cAAc,8BACd,qBACA,iBAAiB,iCACjB,aACA,iBACEA,yBAAAA,oBAIF,qBAAqBC,gCAAAA,qBAAqB;;;;;;AAS5C,MAAa,uBAAuB,cACjC,EACC,UACA,QAAQ,CAAC,GACT,aAAa,iBACb,gBACA,WACA,GAAG,WACC;CAEJ,MAAM,EACJ,IACA,MACA,aACA,UACA,aACA,UACA,UACA,OACA,iBACEC,8BAAAA,oBAAoB;EAAE,aAXEC,8BAAAA,SAAS,eAWoB;EAAG,GAAG;CAAK,CAAC;CACrE,MAAM,iBAAA,GAAA,MAAA,QAAA,OAA8B;EAClC,IAAI,UAAU,OAAO;OAEnB,OAAO,MAAM,KAAK,EAAE,OAAO,GAAG,QAAQ,UACpC,iBAAA,GAAA,kBAAA,IAAA,CAAC,sBAAD;GAAkC,GAAI;aACnC;EACmB,GAFK,KAEL,CACvB;CACL,GAAG,CAAC,UAAU,KAAK,CAAC;CACpB,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAI;EAAM;EAAU;EAAa;EAAU;EAAU;CAAM,IACpE;EAAC;EAAI;EAAM;EAAU;EAAU;EAAa;EAAU;CAAK,CAC7D;CACA,MAAM,oBAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAgB;CAAU,IACnC,CAAC,WAAW,cAAc,CAC5B;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,8BAAAA,yBAAD;EAAyB,OAAO;YAC9B,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;GAAkB,OAAO;aACvB,iBAAA,GAAA,kBAAA,IAAA,CAACC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["createSlotComponent","segmentedControlStyle","useSegmentedControl","useValue","SegmentedControlContext","SegmentedControlDescendantsContext","LayoutGroup","styled","useSegmentedControlItem","motion"],"sources":["../../../../src/components/segmented-control/segmented-control.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { HTMLMotionProps } from \"../motion\"\nimport type { SegmentedControlStyle } from \"./segmented-control.style\"\nimport type {\n UseSegmentedControlItemProps,\n UseSegmentedControlProps,\n} from \"./use-segmented-control\"\nimport { LayoutGroup } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { motion } from \"../motion\"\nimport { segmentedControlStyle } from \"./segmented-control.style\"\nimport {\n SegmentedControlContext,\n SegmentedControlDescendantsContext,\n useSegmentedControl,\n useSegmentedControlItem,\n} from \"./use-segmented-control\"\n\nexport interface SegmentedControlItem extends SegmentedControlItemProps {\n label?: ReactNode\n}\n\ninterface ComponentContext extends Pick<\n SegmentedControlRootProps,\n \"indicatorProps\" | \"itemProps\"\n> {}\n\nexport interface SegmentedControlRootProps<Y extends string = string>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<SegmentedControlStyle>,\n Omit<UseSegmentedControlProps<Y>, \"orientation\"> {\n /**\n * If provided, generate segmented control buttons but based on items.\n *\n * @default []\n */\n items?: SegmentedControlItem[]\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SegmentedControlIndicatorProps\n /**\n * Props for the item component.\n */\n itemProps?: SegmentedControlItemProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SegmentedControlPropsContext,\n useComponentContext,\n usePropsContext: useSegmentedControlPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<\n SegmentedControlRootProps,\n SegmentedControlStyle,\n ComponentContext\n>(\"segmented-control\", segmentedControlStyle)\n\nexport { SegmentedControlPropsContext, useSegmentedControlPropsContext }\n\n/**\n * `SegmentedControl` is a component used for allowing users to select one option from multiple choices.\n *\n * @see https://yamada-ui.com/docs/components/segmented-control\n */\nexport const SegmentedControlRoot = withProvider(\n ({\n children,\n items = [],\n orientation: orientationProp,\n indicatorProps,\n itemProps,\n ...rest\n }) => {\n const computedOrientation = useValue(orientationProp)\n const {\n id,\n name,\n descendants,\n disabled,\n orientation,\n readOnly,\n setValue,\n value,\n getRootProps,\n } = useSegmentedControl({ orientation: computedOrientation, ...rest })\n const cloneChildren = useMemo(() => {\n if (children) return children\n else\n return items.map(({ label, ...rest }, index) => (\n <SegmentedControlItem key={index} {...rest}>\n {label}\n </SegmentedControlItem>\n ))\n }, [children, items])\n const context = useMemo(\n () => ({ id, name, disabled, orientation, readOnly, setValue, value }),\n [id, name, disabled, readOnly, orientation, setValue, value],\n )\n const componentContext = useMemo(\n () => ({ indicatorProps, itemProps }),\n [itemProps, indicatorProps],\n )\n\n return (\n <SegmentedControlContext value={context}>\n <ComponentContext value={componentContext}>\n <SegmentedControlDescendantsContext value={descendants}>\n <LayoutGroup id={id}>\n <styled.div {...getRootProps()}>{cloneChildren}</styled.div>\n </LayoutGroup>\n </SegmentedControlDescendantsContext>\n </ComponentContext>\n </SegmentedControlContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)() as GenericsComponent<{\n <Y extends string = string>(props: SegmentedControlRootProps<Y>): ReactElement\n}>\n\nexport interface SegmentedControlItemProps<Y extends string = string>\n extends HTMLStyledProps<\"label\">, UseSegmentedControlItemProps<Y> {\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SegmentedControlIndicatorProps\n}\n\nexport const SegmentedControlItem = withContext<\n \"label\",\n SegmentedControlItemProps\n>(({ children, indicatorProps, ...rest }) => {\n const { checked, getInputProps, getLabelProps } =\n useSegmentedControlItem(rest)\n\n return (\n <styled.label {...getLabelProps()}>\n <styled.input {...getInputProps()} />\n\n <styled.span>{children}</styled.span>\n\n {checked ? <SegmentedControlIndicator {...indicatorProps} /> : null}\n </styled.label>\n )\n}, \"item\")((props) => {\n const { indicatorProps, itemProps } = useComponentContext()\n\n return {\n ...itemProps,\n ...props,\n indicatorProps: {\n ...indicatorProps,\n ...itemProps?.indicatorProps,\n ...props.indicatorProps,\n },\n }\n}) as GenericsComponent<{\n <Y extends string = string>(props: SegmentedControlItemProps<Y>): ReactElement\n}>\n\ninterface SegmentedControlIndicatorProps extends HTMLMotionProps {}\n\nconst SegmentedControlIndicator = withContext<\n \"div\",\n SegmentedControlIndicatorProps\n>(({ transition, ...props }) => {\n return (\n <motion.div\n layoutDependency={false}\n layoutId=\"indicator\"\n transition={{ duration: 0.2, ...transition }}\n {...props}\n />\n )\n}, \"indicator\")()\n"],"mappings":";;;;;;;;;;;AAqDA,MAAM,EACJ,kBACA,cAAc,8BACd,qBACA,iBAAiB,iCACjB,aACA,iBACEA,yBAAAA,oBAIF,qBAAqBC,gCAAAA,qBAAqB;;;;;;AAS5C,MAAa,uBAAuB,cACjC,EACC,UACA,QAAQ,CAAC,GACT,aAAa,iBACb,gBACA,WACA,GAAG,WACC;CAEJ,MAAM,EACJ,IACA,MACA,aACA,UACA,aACA,UACA,UACA,OACA,iBACEC,8BAAAA,oBAAoB;EAAE,aAXEC,8BAAAA,SAAS,eAWoB;EAAG,GAAG;CAAK,CAAC;CACrE,MAAM,iBAAA,GAAA,MAAA,QAAA,OAA8B;EAClC,IAAI,UAAU,OAAO;OAEnB,OAAO,MAAM,KAAK,EAAE,OAAO,GAAG,QAAQ,UACpC,iBAAA,GAAA,kBAAA,IAAA,CAAC,sBAAD;GAAkC,GAAI;GACnC,UAAA;EACmB,GAFK,KAEL,CACvB;CACL,GAAG,CAAC,UAAU,KAAK,CAAC;CACpB,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAI;EAAM;EAAU;EAAa;EAAU;EAAU;CAAM,IACpE;EAAC;EAAI;EAAM;EAAU;EAAU;EAAa;EAAU;CAAK,CAC7D;CAC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M;EACX;CACF;AACF,CAAC;AAMD,MAAM,4BAA4B,aAG/B,EAAE,YAAY,GAAG,YAAY;CAC9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,kBAAAA,OAAO,KAAR;EACE,kBAAkB;EAClB,UAAS;EACT,YAAY;GAAE,UAAU;GAAK,GAAG;EAAW;EAC3C,GAAI;CACL,CAAA;AAEL,GAAG,WAAW,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.cjs","names":["createSlotComponent","selectStyle","XIcon","useGroupItemProps","usePopoverStyleProps","useSelect","createComboboxItem","createComboboxChildren","useInputBorder","ComboboxDescendantsContext","ComboboxContext","SelectContext","styled","mergeProps","useInputPropsContext","ChevronDownIcon","useComboboxGroupContext","useComboboxGroup","ComboboxGroupContext","useSelectOption","CheckIcon"],"sources":["../../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type {\n ComboboxItem,\n UseComboboxGroupProps,\n} from \"../../hooks/use-combobox\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { SelectStyle } from \"./select.style\"\nimport type {\n UseSelectOptionProps,\n UseSelectProps,\n UseSelectReturn,\n} from \"./use-select\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport {\n ComboboxContext,\n ComboboxDescendantsContext,\n ComboboxGroupContext,\n createComboboxChildren,\n createComboboxItem,\n useComboboxGroup,\n useComboboxGroupContext,\n} from \"../../hooks/use-combobox\"\nimport { cast, isArray } from \"../../utils\"\nimport { useGroupItemProps } from \"../group\"\nimport { CheckIcon, ChevronDownIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { selectStyle } from \"./select.style\"\nimport { SelectContext, useSelect, useSelectOption } from \"./use-select\"\n\ninterface ComponentContext\n extends\n Pick<UseSelectReturn, \"getSeparatorProps\">,\n Pick<SelectRootProps, \"groupProps\" | \"optionProps\"> {}\n\nexport interface SelectRootProps<Multiple extends boolean = false>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"offset\" | \"onChange\" | \"value\">,\n Merge<UseSelectProps<Multiple>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<SelectStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default false\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the select.\n */\n icon?: ReactNode\n /**\n * Props for content element.\n */\n contentProps?: SelectContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for group element.\n */\n groupProps?: Omit<SelectGroupProps, \"children\" | \"label\">\n /**\n * Props for icon element.\n */\n iconProps?: SelectIconProps\n /**\n * Props for option element.\n */\n optionProps?: Omit<SelectOptionProps, \"children\" | \"value\">\n /**\n * Props for placeholder element.\n */\n placeholderProps?: Omit<SelectOptionProps, \"children\" | \"value\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SelectPropsContext,\n useComponentContext,\n usePropsContext: useSelectPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SelectRootProps, SelectStyle, ComponentContext>(\n \"select\",\n selectStyle,\n)\n\nexport { SelectPropsContext, useSelectPropsContext }\n\n/**\n * `Select` is a component used for allowing a user to choose one option from a list.\n *\n * @see https://yamada-ui.com/docs/components/select\n */\nexport const SelectRoot = withProvider<\"div\", SelectRootProps>(\n <Multiple extends boolean = false>(props: SelectRootProps<Multiple>) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n animationScheme = \"block-start\",\n children,\n clearable,\n clearIcon = <XIcon />,\n duration,\n errorBorderColor,\n focusBorderColor,\n icon,\n items: itemsProp,\n contentProps,\n elementProps,\n groupProps,\n iconProps,\n optionProps,\n placeholderProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const items = useMemo<ComboboxItem[]>(() => {\n if (itemsProp) return itemsProp\n\n return createComboboxItem(children, {\n Group: SelectGroup,\n Label: SelectLabel,\n Option: SelectOption,\n })\n }, [itemsProp, children])\n const {\n descendants,\n includePlaceholder,\n items: computedItems,\n max,\n placeholder,\n value,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onChange,\n onClose,\n onSelect,\n } = useSelect({ items, ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const computedChildren = useMemo(() => {\n if (children)\n return (\n <>\n {placeholder ? (\n <SelectOption\n {...placeholderProps}\n hidden={!includePlaceholder}\n value=\"\"\n >\n {placeholder}\n </SelectOption>\n ) : null}\n\n {children}\n </>\n )\n\n return createComboboxChildren(computedItems, {\n Group: SelectGroup,\n Option: SelectOption,\n })\n }, [\n children,\n computedItems,\n placeholder,\n includePlaceholder,\n placeholderProps,\n ])\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const comboboxContext = useMemo(\n () => ({ max, value, onActiveDescendant, onChange, onClose, onSelect }),\n [max, onActiveDescendant, onChange, onClose, onSelect, value],\n )\n const selectContext = useMemo(() => ({ max, value }), [max, value])\n const componentContext = useMemo(\n () => ({ getSeparatorProps, groupProps, optionProps }),\n [getSeparatorProps, groupProps, optionProps],\n )\n const hasValue = isArray(value) ? !!value.length : !!value\n\n return (\n <ComboboxDescendantsContext value={descendants}>\n <ComboboxContext value={comboboxContext}>\n <SelectContext value={selectContext}>\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <styled.input {...getInputProps()} />\n\n <InputGroup.Root\n {...mergeProps(\n { className, css, colorScheme },\n getRootProps(groupItemProps),\n rootProps,\n )()}\n >\n <Popover.Trigger>\n <SelectField {...getFieldProps({ ...varProps })} />\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <SelectIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <SelectIcon icon={icon} {...getIconProps(iconProps)} />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <SelectContent\n {...cast<SelectContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {computedChildren}\n </SelectContent>\n </Popover.Root>\n </ComponentContext>\n </SelectContext>\n </ComboboxContext>\n </ComboboxDescendantsContext>\n )\n },\n \"root\",\n)((props) => {\n const context = useInputPropsContext()\n\n return mergeProps(context, props)()\n}) as GenericsComponent<{\n <Multiple extends boolean = false>(\n props: SelectRootProps<Multiple>,\n ): ReactElement\n}>\n\ninterface SelectFieldProps extends HTMLStyledProps {}\n\nconst SelectField = withContext<\"div\", SelectFieldProps>(\"div\", \"field\")(\n { \"data-group-propagate\": \"\" },\n ({ children, ...rest }) => ({\n ...rest,\n children: <SelectValueText>{children}</SelectValueText>,\n }),\n)\n\ninterface SelectIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst SelectIcon = withContext<\"div\", SelectIconProps>(\"div\", \"icon\")(\n undefined,\n ({ children, icon, ...rest }) => ({\n children: icon || children || <ChevronDownIcon />,\n ...rest,\n }),\n)\n\ninterface SelectValueTextProps extends HTMLProps<\"span\"> {}\n\nconst SelectValueText = withContext<\"span\", SelectValueTextProps>(\n \"span\",\n \"valueText\",\n)()\n\ninterface SelectContentProps extends Popover.ContentProps {}\n\nconst SelectContent = withContext<\"div\", SelectContentProps>(\n Popover.Content,\n \"content\",\n)()\n\nexport interface SelectLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SelectLabel = withContext<\"span\", SelectLabelProps>(\n \"span\",\n \"label\",\n)(undefined, (props) => {\n const { getLabelProps } = useComboboxGroupContext()\n\n return getLabelProps(props)\n})\n\nexport interface SelectGroupProps\n extends UseComboboxGroupProps, HTMLStyledProps {\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the label component.\n */\n labelProps?: SelectLabelProps\n}\n\nexport const SelectGroup = withContext<\"div\", SelectGroupProps>(\n ({ children, label, labelProps, ...rest }) => {\n const { groupProps } = useComponentContext()\n const { getGroupProps, getLabelProps } = useComboboxGroup(\n mergeProps(groupProps, rest)(),\n )\n const context = useMemo(() => ({ getLabelProps }), [getLabelProps])\n\n return (\n <ComboboxGroupContext value={context}>\n <styled.div {...getGroupProps()}>\n {label ? <SelectLabel {...labelProps}>{label}</SelectLabel> : null}\n {children}\n </styled.div>\n </ComboboxGroupContext>\n )\n },\n \"group\",\n)()\n\nexport interface SelectOptionProps\n extends UseSelectOptionProps, HTMLStyledProps {\n /**\n * The icon to be used in the select option.\n */\n icon?: ReactNode\n}\n\nexport const SelectOption = withContext<\"div\", SelectOptionProps>(\n ({ children, icon: iconProp, ...rest }) => {\n const { optionProps: { icon, ...optionProps } = {} } = useComponentContext()\n const { getIndicatorProps, getOptionProps } = useSelectOption(\n mergeProps(optionProps, rest)(),\n )\n\n return (\n <styled.div {...getOptionProps()}>\n <SelectIndicator {...getIndicatorProps()}>\n {iconProp ?? icon ?? <CheckIcon />}\n </SelectIndicator>\n {children}\n </styled.div>\n )\n },\n \"option\",\n)()\n\ninterface SelectIndicatorProps extends HTMLStyledProps {}\n\nconst SelectIndicator = withContext<\"div\", SelectIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n\nexport interface SelectSeparatorProps extends HTMLStyledProps<\"hr\"> {}\n\nexport const SelectSeparator = withContext<\"hr\", SelectSeparatorProps>(\n \"hr\",\n \"separator\",\n)(undefined, (props) => {\n const { getSeparatorProps } = useComponentContext()\n\n return getSeparatorProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACEA,yBAAAA,oBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,aAAa,cACW,UAAqC;CACtE,MAAM,CACJ,gBACA,EACE,WACA,KACA,aACA,kBAAkB,eAClB,UACA,WACA,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,OAAD,CAAQ,CAAA,GACpB,UACA,kBACA,kBACA,MACA,OAAO,WACP,cACA,cACA,YACA,WACA,aACA,kBACA,WACA,GAAG,UAEHC,kBAAAA,kBAAkB,KAAK;CAC3B,MAAM,oBAAoBC,gBAAAA,qBAAqB,IAAI;CAUnD,MAAM,EACJ,aACA,oBACA,OAAO,eACP,KACA,aACA,OACA,mBACA,iBACA,eACA,cACA,eACA,cACA,mBACA,cACA,oBACA,UACA,SACA,aACEC,mBAAAA,UAAU;EAAE,QAAA,GAAA,MAAA,QAAA,OA5B4B;GAC1C,IAAI,WAAW,OAAO;GAEtB,OAAOC,iCAAAA,mBAAmB,UAAU;IAClC,OAAO;IACP,OAAO;IACP,QAAQ;GACV,CAAC;EACH,GAAG,CAAC,WAAW,QAAQ,CAoBH;EAAG,GAAG;EAAM,GAAG;CAAkB,CAAC;CACtD,MAAM,sBAAA,GAAA,MAAA,QAAA,QACG;EACL;EACA;EACA,GAAG;CACL,IACA;EAAC;EAAiB;EAAU;CAAY,CAC1C;CACA,MAAM,oBAAA,GAAA,MAAA,QAAA,OAAiC;EACrC,IAAI,UACF,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACG,cACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD;GACE,GAAI;GACJ,QAAQ,CAAC;GACT,OAAM;aAEL;EACW,CAAA,IACZ,MAEH,QACD,EAAA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C,CAAC;AAIF,MAAM,kBAAkB,YACtB,OACA,WACF,CAAC,CAAC;AAIF,MAAa,kBAAkB,YAC7B,MACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,sBAAsB,oBAAoB;CAElD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
1
+ {"version":3,"file":"select.cjs","names":["createSlotComponent","selectStyle","XIcon","useGroupItemProps","usePopoverStyleProps","useSelect","createComboboxItem","createComboboxChildren","useInputBorder","ComboboxDescendantsContext","ComboboxContext","SelectContext","styled","mergeProps","useInputPropsContext","ChevronDownIcon","useComboboxGroupContext","useComboboxGroup","ComboboxGroupContext","useSelectOption","CheckIcon"],"sources":["../../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type {\n ComboboxItem,\n UseComboboxGroupProps,\n} from \"../../hooks/use-combobox\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { UsePopoverStyleProps, UsePopupAnimationProps } from \"../popover\"\nimport type { SelectStyle } from \"./select.style\"\nimport type {\n UseSelectOptionProps,\n UseSelectProps,\n UseSelectReturn,\n} from \"./use-select\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport {\n ComboboxContext,\n ComboboxDescendantsContext,\n ComboboxGroupContext,\n createComboboxChildren,\n createComboboxItem,\n useComboboxGroup,\n useComboboxGroupContext,\n} from \"../../hooks/use-combobox\"\nimport { cast, isArray } from \"../../utils\"\nimport { useGroupItemProps } from \"../group\"\nimport { CheckIcon, ChevronDownIcon, XIcon } from \"../icon\"\nimport { InputGroup, useInputBorder, useInputPropsContext } from \"../input\"\nimport { Popover, usePopoverStyleProps } from \"../popover\"\nimport { selectStyle } from \"./select.style\"\nimport { SelectContext, useSelect, useSelectOption } from \"./use-select\"\n\ninterface ComponentContext\n extends\n Pick<UseSelectReturn, \"getSeparatorProps\">,\n Pick<SelectRootProps, \"groupProps\" | \"optionProps\"> {}\n\nexport interface SelectRootProps<Multiple extends boolean = false>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"offset\" | \"onChange\" | \"value\">,\n Merge<UseSelectProps<Multiple>, UsePopoverStyleProps>,\n UsePopupAnimationProps,\n ThemeProps<SelectStyle>,\n UseInputBorderProps {\n /**\n * If `true`, display the clear icon.\n *\n * @default false\n */\n clearable?: boolean\n /**\n * The icon to be used in the clear button.\n */\n clearIcon?: ReactNode\n /**\n * The icon to be used in the select.\n */\n icon?: ReactNode\n /**\n * Props for content element.\n */\n contentProps?: SelectContentProps\n /**\n * The props for the end element.\n */\n elementProps?: InputGroup.ElementProps\n /**\n * Props for group element.\n */\n groupProps?: Omit<SelectGroupProps, \"children\" | \"label\">\n /**\n * Props for icon element.\n */\n iconProps?: SelectIconProps\n /**\n * Props for option element.\n */\n optionProps?: Omit<SelectOptionProps, \"children\" | \"value\">\n /**\n * Props for placeholder element.\n */\n placeholderProps?: Omit<SelectOptionProps, \"children\" | \"value\">\n /**\n * Props for root element.\n */\n rootProps?: InputGroup.RootProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SelectPropsContext,\n useComponentContext,\n usePropsContext: useSelectPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SelectRootProps, SelectStyle, ComponentContext>(\n \"select\",\n selectStyle,\n)\n\nexport { SelectPropsContext, useSelectPropsContext }\n\n/**\n * `Select` is a component used for allowing a user to choose one option from a list.\n *\n * @see https://yamada-ui.com/docs/components/select\n */\nexport const SelectRoot = withProvider<\"div\", SelectRootProps>(\n <Multiple extends boolean = false>(props: SelectRootProps<Multiple>) => {\n const [\n groupItemProps,\n {\n className,\n css,\n colorScheme,\n animationScheme = \"block-start\",\n children,\n clearable,\n clearIcon = <XIcon />,\n duration,\n errorBorderColor,\n focusBorderColor,\n icon,\n items: itemsProp,\n contentProps,\n elementProps,\n groupProps,\n iconProps,\n optionProps,\n placeholderProps,\n rootProps,\n ...rest\n },\n ] = useGroupItemProps(props)\n const popoverStyleProps = usePopoverStyleProps(rest)\n const items = useMemo<ComboboxItem[]>(() => {\n if (itemsProp) return itemsProp\n\n return createComboboxItem(children, {\n Group: SelectGroup,\n Label: SelectLabel,\n Option: SelectOption,\n })\n }, [itemsProp, children])\n const {\n descendants,\n includePlaceholder,\n items: computedItems,\n max,\n placeholder,\n value,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onChange,\n onClose,\n onSelect,\n } = useSelect({ items, ...rest, ...popoverStyleProps })\n const mergedPopoverProps = useMemo<Popover.RootProps>(\n () => ({\n animationScheme,\n duration,\n ...popoverProps,\n }),\n [animationScheme, duration, popoverProps],\n )\n const computedChildren = useMemo(() => {\n if (children)\n return (\n <>\n {placeholder ? (\n <SelectOption\n {...placeholderProps}\n hidden={!includePlaceholder}\n value=\"\"\n >\n {placeholder}\n </SelectOption>\n ) : null}\n\n {children}\n </>\n )\n\n return createComboboxChildren(computedItems, {\n Group: SelectGroup,\n Option: SelectOption,\n })\n }, [\n children,\n computedItems,\n placeholder,\n includePlaceholder,\n placeholderProps,\n ])\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const comboboxContext = useMemo(\n () => ({ max, value, onActiveDescendant, onChange, onClose, onSelect }),\n [max, onActiveDescendant, onChange, onClose, onSelect, value],\n )\n const selectContext = useMemo(() => ({ max, value }), [max, value])\n const componentContext = useMemo(\n () => ({ getSeparatorProps, groupProps, optionProps }),\n [getSeparatorProps, groupProps, optionProps],\n )\n const hasValue = isArray(value) ? !!value.length : !!value\n\n return (\n <ComboboxDescendantsContext value={descendants}>\n <ComboboxContext value={comboboxContext}>\n <SelectContext value={selectContext}>\n <ComponentContext value={componentContext}>\n <Popover.Root {...mergedPopoverProps}>\n <styled.input {...getInputProps()} />\n\n <InputGroup.Root\n {...mergeProps(\n { className, css, colorScheme },\n getRootProps(groupItemProps),\n rootProps,\n )()}\n >\n <Popover.Trigger>\n <SelectField {...getFieldProps({ ...varProps })} />\n </Popover.Trigger>\n\n <InputGroup.Element\n {...{ clickable: clearable && hasValue, ...elementProps }}\n >\n {clearable && hasValue ? (\n <SelectIcon\n icon={clearIcon}\n {...getClearIconProps(iconProps)}\n />\n ) : (\n <SelectIcon icon={icon} {...getIconProps(iconProps)} />\n )}\n </InputGroup.Element>\n </InputGroup.Root>\n\n <SelectContent\n {...cast<SelectContentProps>(\n getContentProps(cast<HTMLProps>(contentProps)),\n )}\n >\n {computedChildren}\n </SelectContent>\n </Popover.Root>\n </ComponentContext>\n </SelectContext>\n </ComboboxContext>\n </ComboboxDescendantsContext>\n )\n },\n \"root\",\n)((props) => {\n const context = useInputPropsContext()\n\n return mergeProps(context, props)()\n}) as GenericsComponent<{\n <Multiple extends boolean = false>(\n props: SelectRootProps<Multiple>,\n ): ReactElement\n}>\n\ninterface SelectFieldProps extends HTMLStyledProps {}\n\nconst SelectField = withContext<\"div\", SelectFieldProps>(\"div\", \"field\")(\n { \"data-group-propagate\": \"\" },\n ({ children, ...rest }) => ({\n ...rest,\n children: <SelectValueText>{children}</SelectValueText>,\n }),\n)\n\ninterface SelectIconProps extends HTMLStyledProps {\n icon?: ReactNode\n}\n\nconst SelectIcon = withContext<\"div\", SelectIconProps>(\"div\", \"icon\")(\n undefined,\n ({ children, icon, ...rest }) => ({\n children: icon || children || <ChevronDownIcon />,\n ...rest,\n }),\n)\n\ninterface SelectValueTextProps extends HTMLProps<\"span\"> {}\n\nconst SelectValueText = withContext<\"span\", SelectValueTextProps>(\n \"span\",\n \"valueText\",\n)()\n\ninterface SelectContentProps extends Popover.ContentProps {}\n\nconst SelectContent = withContext<\"div\", SelectContentProps>(\n Popover.Content,\n \"content\",\n)()\n\nexport interface SelectLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SelectLabel = withContext<\"span\", SelectLabelProps>(\n \"span\",\n \"label\",\n)(undefined, (props) => {\n const { getLabelProps } = useComboboxGroupContext()\n\n return getLabelProps(props)\n})\n\nexport interface SelectGroupProps\n extends UseComboboxGroupProps, HTMLStyledProps {\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the label component.\n */\n labelProps?: SelectLabelProps\n}\n\nexport const SelectGroup = withContext<\"div\", SelectGroupProps>(\n ({ children, label, labelProps, ...rest }) => {\n const { groupProps } = useComponentContext()\n const { getGroupProps, getLabelProps } = useComboboxGroup(\n mergeProps(groupProps, rest)(),\n )\n const context = useMemo(() => ({ getLabelProps }), [getLabelProps])\n\n return (\n <ComboboxGroupContext value={context}>\n <styled.div {...getGroupProps()}>\n {label ? <SelectLabel {...labelProps}>{label}</SelectLabel> : null}\n {children}\n </styled.div>\n </ComboboxGroupContext>\n )\n },\n \"group\",\n)()\n\nexport interface SelectOptionProps\n extends UseSelectOptionProps, HTMLStyledProps {\n /**\n * The icon to be used in the select option.\n */\n icon?: ReactNode\n}\n\nexport const SelectOption = withContext<\"div\", SelectOptionProps>(\n ({ children, icon: iconProp, ...rest }) => {\n const { optionProps: { icon, ...optionProps } = {} } = useComponentContext()\n const { getIndicatorProps, getOptionProps } = useSelectOption(\n mergeProps(optionProps, rest)(),\n )\n\n return (\n <styled.div {...getOptionProps()}>\n <SelectIndicator {...getIndicatorProps()}>\n {iconProp ?? icon ?? <CheckIcon />}\n </SelectIndicator>\n {children}\n </styled.div>\n )\n },\n \"option\",\n)()\n\ninterface SelectIndicatorProps extends HTMLStyledProps {}\n\nconst SelectIndicator = withContext<\"div\", SelectIndicatorProps>(\n \"div\",\n \"indicator\",\n)()\n\nexport interface SelectSeparatorProps extends HTMLStyledProps<\"hr\"> {}\n\nexport const SelectSeparator = withContext<\"hr\", SelectSeparatorProps>(\n \"hr\",\n \"separator\",\n)(undefined, (props) => {\n const { getSeparatorProps } = useComponentContext()\n\n return getSeparatorProps(props)\n})\n"],"mappings":";;;;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CAAC,CAAC;AAIF,MAAM,kBAAkB,YACtB,OACA,WACF,CAAC,CAAC;AAIF,MAAa,kBAAkB,YAC7B,MACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,sBAAsB,oBAAoB;CAElD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-select.cjs","names":["createContext","useI18n","useFieldProps","useControllableState","useCombobox","mergeRefs","visuallyHiddenAttributes","runKeyAction","useComboboxItem"],"sources":["../../../../src/components/select/use-select.tsx"],"sourcesContent":["\"use client\"\n\nimport type { MouseEvent, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type {\n ComboboxItem,\n ComboboxItemWithValue,\n UseComboboxItemProps,\n UseComboboxProps,\n} from \"../../hooks/use-combobox\"\nimport type { Dict } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { useCombobox, useComboboxItem } from \"../../hooks/use-combobox\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isArray,\n isNumber,\n isString,\n isUndefined,\n mergeRefs,\n runKeyAction,\n toArray,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface SelectRenderProps extends ComboboxItemWithValue {\n count: number\n index: number\n separator: string\n onClear: () => void\n}\n\nexport interface SelectItemRender {\n (props: SelectRenderProps): ReactNode\n}\n\nconst defaultRender: SelectItemRender = ({\n count,\n index,\n label,\n separator,\n value,\n}) => {\n const last = count - 1 === index\n\n return (\n <span\n style={{ marginInlineEnd: \"var(--gap)\" }}\n data-placeholder={dataAttr(value === \"\")}\n >\n {label}\n {!last ? separator : null}\n </span>\n )\n}\n\ninterface SelectContext extends Pick<UseSelectReturn, \"max\" | \"value\"> {}\n\nconst [SelectContext, useSelectContext] = createContext<SelectContext>({\n name: \"SelectContext\",\n})\n\nexport { SelectContext, useSelectContext }\n\nexport interface UseSelectProps<Multiple extends boolean = false>\n extends\n Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">,\n Omit<\n UseComboboxProps,\n \"defaultValue\" | \"initialFocusValue\" | \"onChange\" | \"value\"\n >,\n FieldProps {\n /**\n * The initial value of the select.\n */\n defaultValue?: Multiple extends true ? string[] : string\n /**\n * If `true`, the field will be focused when the clear icon is clicked.\n *\n * @default true\n */\n focusOnClear?: boolean\n /**\n * The `id` attribute of the input element.\n */\n id?: string\n /**\n * If `true`, include placeholder in options.\n *\n * @default true\n */\n includePlaceholder?: boolean\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: ComboboxItem[]\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * If `true`, the select will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * The `name` attribute of the input element.\n */\n name?: string\n /**\n * The placeholder for select.\n */\n placeholder?: string\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The value of the select.\n */\n value?: Multiple extends true ? string[] : string\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: Multiple extends true ? string[] : string) => void\n /**\n * The function to render the selected items.\n */\n render?: (props: SelectRenderProps) => ReactNode\n}\n\nexport const useSelect = <Multiple extends boolean = false>(\n props: UseSelectProps<Multiple> = {},\n) => {\n type MaybeValue = Multiple extends true ? string[] : string\n\n const { t } = useI18n(\"select\")\n const {\n context: { labelId } = {},\n props: {\n id,\n name,\n multiple = false,\n closeOnSelect = !multiple,\n defaultValue = (multiple ? [] : \"\") as MaybeValue,\n disabled,\n focusOnClear = true,\n includePlaceholder = !multiple,\n items: itemProp = [],\n max,\n placeholder,\n readOnly,\n render = defaultRender,\n required,\n separator = \",\",\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const fieldRef = useRef<HTMLDivElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const onChange = useCallback(\n (value: string) => {\n setValue((prev) => {\n if (isArray(prev))\n if (prev.includes(value))\n return prev.filter((prevValue) => prevValue !== value) as MaybeValue\n else if (!isNumber(max) || prev.length < max)\n return [...prev, value] as MaybeValue\n else return prev\n else return value as MaybeValue\n })\n },\n [max, setValue],\n )\n const items = useMemo<ComboboxItem[]>(() => {\n const items = [...itemProp]\n\n if (placeholder)\n items.unshift({\n hidden: !includePlaceholder,\n label: placeholder,\n value: \"\",\n })\n\n return items\n }, [itemProp, placeholder, includePlaceholder])\n const empty = useMemo(\n () => !items.filter(({ hidden }) => !hidden).length,\n [items],\n )\n const {\n descendants,\n interactive,\n open,\n getContentProps: getComboboxContentProps,\n getSeparatorProps,\n getTriggerProps,\n popoverProps,\n onActiveDescendant,\n onClose,\n onOpen,\n onSelect,\n } = useCombobox({\n closeOnSelect,\n disabled,\n initialFocusValue: isArray(value) ? value[0] : value,\n readOnly,\n onChange,\n ...ariaProps,\n ...dataProps,\n ...eventProps,\n ...rest,\n })\n const valueMap = useMemo<{ [key: string]: ComboboxItemWithValue }>(() => {\n const valueMap: { [key: string]: ComboboxItemWithValue } = {}\n\n items.forEach((item) => {\n if (\"items\" in item) {\n item.items.forEach((item) => {\n item.value ??= isString(item.label) ? item.label : undefined\n\n if (!isUndefined(item.value)) valueMap[item.value] = item\n })\n } else {\n item.value ??= isString(item.label) ? item.label : undefined\n\n if (!isUndefined(item.value)) valueMap[item.value] = item\n }\n })\n\n return valueMap\n }, [items])\n const selectedItems = useMemo<ComboboxItemWithValue[]>(() => {\n if (isArray(value))\n if (value.length) return toArray(value.map((value) => valueMap[value]))\n else return placeholder ? [{ label: placeholder, value: \"\" }] : []\n else return isString(value) ? toArray(valueMap[value]) : []\n }, [placeholder, value, valueMap])\n const children = useMemo<ReactNode>(() => {\n const count = selectedItems.length\n\n return selectedItems.map((item, index) => {\n const onClear = (ev?: MouseEvent<HTMLElement>) => {\n ev?.preventDefault()\n ev?.stopPropagation()\n\n if (item.value) onChange(item.value)\n }\n\n const component = render({\n count,\n index,\n separator,\n onClear,\n ...item,\n })\n\n if (isValidElement<Dict>(component))\n return cloneElement(component, { ...component.props, key: index })\n else return component\n })\n }, [onChange, render, selectedItems, separator])\n\n const onFocus = useCallback(() => {\n if (!interactive || !fieldRef.current) return\n\n fieldRef.current.focus()\n }, [interactive])\n\n const onClear = useCallback(() => {\n if (!interactive) return\n\n setValue((prev) => (isArray(prev) ? [] : \"\") as MaybeValue)\n\n if (!fieldRef.current) return\n\n if (focusOnClear) fieldRef.current.focus()\n }, [focusOnClear, interactive, setValue])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getFieldProps: PropGetter = useCallback(\n ({ ref, \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n getTriggerProps({\n ref: mergeRefs(ref, fieldRef),\n \"aria-label\": placeholder,\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n ...props,\n children,\n }),\n [children, getTriggerProps, labelId, placeholder],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => ({\n ...dataProps,\n ...visuallyHiddenAttributes,\n id,\n name,\n defaultValue: isString(value) ? value : value.join(\", \"),\n disabled,\n readOnly,\n required,\n ...props,\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dataProps, disabled, id, name, onFocus, readOnly, required, value],\n )\n\n const getContentProps: PropGetter = useCallback(\n (props) => getComboboxContentProps({ hidden: empty, ...props }),\n [empty, getComboboxContentProps],\n )\n\n const getIconProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getClearIconProps: PropGetter = useCallback(\n (props = {}) =>\n getIconProps({\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-label\": t(\"Clear value\"),\n role: \"button\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClear),\n onKeyDown: handlerAll(props.onKeyDown, (ev) =>\n runKeyAction(ev, { Enter: onClear, Space: onClear }),\n ),\n }),\n [getIconProps, interactive, onClear, t],\n )\n\n return {\n descendants,\n includePlaceholder,\n interactive,\n items,\n max,\n open,\n placeholder,\n setValue,\n value,\n valueMap,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onChange,\n onClose,\n onOpen,\n onSelect,\n }\n}\n\nexport type UseSelectReturn = ReturnType<typeof useSelect>\n\nexport interface UseSelectOptionProps extends UseComboboxItemProps {}\n\nexport const useSelectOption = ({\n children,\n closeOnSelect,\n disabled,\n hidden,\n value,\n ...rest\n}: UseSelectOptionProps = {}) => {\n const { max, value: selectedValue } = useSelectContext()\n\n value ??= isString(children) ? children : undefined\n\n const selected = isArray(selectedValue)\n ? !isUndefined(value) && selectedValue.includes(value)\n : selectedValue === value\n const completed =\n isNumber(max) && isArray(selectedValue) && selectedValue.length >= max\n const { getIndicatorProps, getItemProps } = useComboboxItem({\n children,\n closeOnSelect,\n disabled: disabled || hidden || (completed && !selected),\n hidden,\n selected,\n value,\n ...rest,\n })\n\n const getOptionProps: PropGetter = useCallback(\n (props = {}) => getItemProps(props),\n [getItemProps],\n )\n\n return { getIndicatorProps, getOptionProps }\n}\n\nexport type UseSelectOptionReturn = ReturnType<typeof useSelectOption>\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAM,iBAAmC,EACvC,OACA,OACA,OACA,WACA,YACI;CACJ,MAAM,OAAO,QAAQ,MAAM;CAE3B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EACE,OAAO,EAAE,iBAAiB,aAAa;EACvC,qBAAA,GAAA,oBAAA,cAAA,SAAA,CAA2B,UAAU,EAAE;YAFzC,CAIG,OACA,CAAC,OAAO,YAAY,IAC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;EACA;EACA;EACA;EACA;CACF;AACF;AAMA,MAAa,mBAAmB,EAC9B,UACA,eACA,UACA,QACA,OACA,GAAG,SACqB,CAAC,MAAM;CAC/B,MAAM,EAAE,KAAK,OAAO,kBAAkB,iBAAiB;CAEvD,WAAA,GAAA,oBAAA,cAAA,SAAA,CAAmB,QAAQ,IAAI,WAAW,KAAA;CAE1C,MAAM,YAAA,GAAA,oBAAA,cAAA,QAAA,CAAmB,aAAa,IAClC,EAAA,GAAA,oBAAA,cAAA,YAAA,CAAa,KAAK,KAAK,cAAc,SAAS,KAAK,IACnD,kBAAkB;CACtB,MAAM,aAAA,GAAA,oBAAA,cAAA,SAAA,CACK,GAAG,MAAA,GAAA,oBAAA,cAAA,QAAA,CAAa,aAAa,KAAK,cAAc,UAAU;CACrE,MAAM,EAAE,mBAAmB,iBAAiBC,iCAAAA,gBAAgB;EAC1D;EACA;EACA,UAAU,YAAY,UAAW,aAAa,CAAC;EAC/C;EACA;EACA;EACA,GAAG;CACL,CAAC;CAOD,OAAO;EAAE;EAAmB,iBAAA,GAAA,MAAA,YAAA,EAJzB,QAAQ,CAAC,MAAM,aAAa,KAAK,GAClC,CAAC,YAAY,CAG0B;CAAE;AAC7C"}
1
+ {"version":3,"file":"use-select.cjs","names":["createContext","useI18n","useFieldProps","useControllableState","useCombobox","mergeRefs","visuallyHiddenAttributes","runKeyAction","useComboboxItem"],"sources":["../../../../src/components/select/use-select.tsx"],"sourcesContent":["\"use client\"\n\nimport type { MouseEvent, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type {\n ComboboxItem,\n ComboboxItemWithValue,\n UseComboboxItemProps,\n UseComboboxProps,\n} from \"../../hooks/use-combobox\"\nimport type { Dict } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { useCombobox, useComboboxItem } from \"../../hooks/use-combobox\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isArray,\n isNumber,\n isString,\n isUndefined,\n mergeRefs,\n runKeyAction,\n toArray,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface SelectRenderProps extends ComboboxItemWithValue {\n count: number\n index: number\n separator: string\n onClear: () => void\n}\n\nexport interface SelectItemRender {\n (props: SelectRenderProps): ReactNode\n}\n\nconst defaultRender: SelectItemRender = ({\n count,\n index,\n label,\n separator,\n value,\n}) => {\n const last = count - 1 === index\n\n return (\n <span\n style={{ marginInlineEnd: \"var(--gap)\" }}\n data-placeholder={dataAttr(value === \"\")}\n >\n {label}\n {!last ? separator : null}\n </span>\n )\n}\n\ninterface SelectContext extends Pick<UseSelectReturn, \"max\" | \"value\"> {}\n\nconst [SelectContext, useSelectContext] = createContext<SelectContext>({\n name: \"SelectContext\",\n})\n\nexport { SelectContext, useSelectContext }\n\nexport interface UseSelectProps<Multiple extends boolean = false>\n extends\n Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">,\n Omit<\n UseComboboxProps,\n \"defaultValue\" | \"initialFocusValue\" | \"onChange\" | \"value\"\n >,\n FieldProps {\n /**\n * The initial value of the select.\n */\n defaultValue?: Multiple extends true ? string[] : string\n /**\n * If `true`, the field will be focused when the clear icon is clicked.\n *\n * @default true\n */\n focusOnClear?: boolean\n /**\n * The `id` attribute of the input element.\n */\n id?: string\n /**\n * If `true`, include placeholder in options.\n *\n * @default true\n */\n includePlaceholder?: boolean\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: ComboboxItem[]\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * If `true`, the select will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * The `name` attribute of the input element.\n */\n name?: string\n /**\n * The placeholder for select.\n */\n placeholder?: string\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The value of the select.\n */\n value?: Multiple extends true ? string[] : string\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: Multiple extends true ? string[] : string) => void\n /**\n * The function to render the selected items.\n */\n render?: (props: SelectRenderProps) => ReactNode\n}\n\nexport const useSelect = <Multiple extends boolean = false>(\n props: UseSelectProps<Multiple> = {},\n) => {\n type MaybeValue = Multiple extends true ? string[] : string\n\n const { t } = useI18n(\"select\")\n const {\n context: { labelId } = {},\n props: {\n id,\n name,\n multiple = false,\n closeOnSelect = !multiple,\n defaultValue = (multiple ? [] : \"\") as MaybeValue,\n disabled,\n focusOnClear = true,\n includePlaceholder = !multiple,\n items: itemProp = [],\n max,\n placeholder,\n readOnly,\n render = defaultRender,\n required,\n separator = \",\",\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const fieldRef = useRef<HTMLDivElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const onChange = useCallback(\n (value: string) => {\n setValue((prev) => {\n if (isArray(prev))\n if (prev.includes(value))\n return prev.filter((prevValue) => prevValue !== value) as MaybeValue\n else if (!isNumber(max) || prev.length < max)\n return [...prev, value] as MaybeValue\n else return prev\n else return value as MaybeValue\n })\n },\n [max, setValue],\n )\n const items = useMemo<ComboboxItem[]>(() => {\n const items = [...itemProp]\n\n if (placeholder)\n items.unshift({\n hidden: !includePlaceholder,\n label: placeholder,\n value: \"\",\n })\n\n return items\n }, [itemProp, placeholder, includePlaceholder])\n const empty = useMemo(\n () => !items.filter(({ hidden }) => !hidden).length,\n [items],\n )\n const {\n descendants,\n interactive,\n open,\n getContentProps: getComboboxContentProps,\n getSeparatorProps,\n getTriggerProps,\n popoverProps,\n onActiveDescendant,\n onClose,\n onOpen,\n onSelect,\n } = useCombobox({\n closeOnSelect,\n disabled,\n initialFocusValue: isArray(value) ? value[0] : value,\n readOnly,\n onChange,\n ...ariaProps,\n ...dataProps,\n ...eventProps,\n ...rest,\n })\n const valueMap = useMemo<{ [key: string]: ComboboxItemWithValue }>(() => {\n const valueMap: { [key: string]: ComboboxItemWithValue } = {}\n\n items.forEach((item) => {\n if (\"items\" in item) {\n item.items.forEach((item) => {\n item.value ??= isString(item.label) ? item.label : undefined\n\n if (!isUndefined(item.value)) valueMap[item.value] = item\n })\n } else {\n item.value ??= isString(item.label) ? item.label : undefined\n\n if (!isUndefined(item.value)) valueMap[item.value] = item\n }\n })\n\n return valueMap\n }, [items])\n const selectedItems = useMemo<ComboboxItemWithValue[]>(() => {\n if (isArray(value))\n if (value.length) return toArray(value.map((value) => valueMap[value]))\n else return placeholder ? [{ label: placeholder, value: \"\" }] : []\n else return isString(value) ? toArray(valueMap[value]) : []\n }, [placeholder, value, valueMap])\n const children = useMemo<ReactNode>(() => {\n const count = selectedItems.length\n\n return selectedItems.map((item, index) => {\n const onClear = (ev?: MouseEvent<HTMLElement>) => {\n ev?.preventDefault()\n ev?.stopPropagation()\n\n if (item.value) onChange(item.value)\n }\n\n const component = render({\n count,\n index,\n separator,\n onClear,\n ...item,\n })\n\n if (isValidElement<Dict>(component))\n return cloneElement(component, { ...component.props, key: index })\n else return component\n })\n }, [onChange, render, selectedItems, separator])\n\n const onFocus = useCallback(() => {\n if (!interactive || !fieldRef.current) return\n\n fieldRef.current.focus()\n }, [interactive])\n\n const onClear = useCallback(() => {\n if (!interactive) return\n\n setValue((prev) => (isArray(prev) ? [] : \"\") as MaybeValue)\n\n if (!fieldRef.current) return\n\n if (focusOnClear) fieldRef.current.focus()\n }, [focusOnClear, interactive, setValue])\n\n const getRootProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getFieldProps: PropGetter = useCallback(\n ({ ref, \"aria-labelledby\": ariaLabelledby, ...props } = {}) =>\n getTriggerProps({\n ref: mergeRefs(ref, fieldRef),\n \"aria-label\": placeholder,\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n ...props,\n children,\n }),\n [children, getTriggerProps, labelId, placeholder],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => ({\n ...dataProps,\n ...visuallyHiddenAttributes,\n id,\n name,\n defaultValue: isString(value) ? value : value.join(\", \"),\n disabled,\n readOnly,\n required,\n ...props,\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dataProps, disabled, id, name, onFocus, readOnly, required, value],\n )\n\n const getContentProps: PropGetter = useCallback(\n (props) => getComboboxContentProps({ hidden: empty, ...props }),\n [empty, getComboboxContentProps],\n )\n\n const getIconProps: PropGetter = useCallback(\n (props) => ({ ...dataProps, ...props }),\n [dataProps],\n )\n\n const getClearIconProps: PropGetter = useCallback(\n (props = {}) =>\n getIconProps({\n \"aria-disabled\": ariaAttr(!interactive),\n \"aria-label\": t(\"Clear value\"),\n role: \"button\",\n tabIndex: interactive ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onClear),\n onKeyDown: handlerAll(props.onKeyDown, (ev) =>\n runKeyAction(ev, { Enter: onClear, Space: onClear }),\n ),\n }),\n [getIconProps, interactive, onClear, t],\n )\n\n return {\n descendants,\n includePlaceholder,\n interactive,\n items,\n max,\n open,\n placeholder,\n setValue,\n value,\n valueMap,\n getClearIconProps,\n getContentProps,\n getFieldProps,\n getIconProps,\n getInputProps,\n getRootProps,\n getSeparatorProps,\n popoverProps,\n onActiveDescendant,\n onChange,\n onClose,\n onOpen,\n onSelect,\n }\n}\n\nexport type UseSelectReturn = ReturnType<typeof useSelect>\n\nexport interface UseSelectOptionProps extends UseComboboxItemProps {}\n\nexport const useSelectOption = ({\n children,\n closeOnSelect,\n disabled,\n hidden,\n value,\n ...rest\n}: UseSelectOptionProps = {}) => {\n const { max, value: selectedValue } = useSelectContext()\n\n value ??= isString(children) ? children : undefined\n\n const selected = isArray(selectedValue)\n ? !isUndefined(value) && selectedValue.includes(value)\n : selectedValue === value\n const completed =\n isNumber(max) && isArray(selectedValue) && selectedValue.length >= max\n const { getIndicatorProps, getItemProps } = useComboboxItem({\n children,\n closeOnSelect,\n disabled: disabled || hidden || (completed && !selected),\n hidden,\n selected,\n value,\n ...rest,\n })\n\n const getOptionProps: PropGetter = useCallback(\n (props = {}) => getItemProps(props),\n [getItemProps],\n )\n\n return { getIndicatorProps, getOptionProps }\n}\n\nexport type UseSelectOptionReturn = ReturnType<typeof useSelectOption>\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAM,iBAAmC,EACvC,OACA,OACA,OACA,WACA,YACI;CACJ,MAAM,OAAO,QAAQ,MAAM;CAE3B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EACE,OAAO,EAAE,iBAAiB,aAAa;EACvC,qBAAA,GAAA,oBAAA,cAAA,SAAA,CAA2B,UAAU,EAAE;EAFzC,UAAA,CAIG,OACA,CAAC,OAAO,YAAY,IACjB;;AAEV;AAIA,MAAM,CAAC,eAAe,oBAAoBA,gBAAAA,cAA6B,EACrE,MAAM,gBACR,CAAC;AA4ED,MAAa,aACX,QAAkC,CAAC,MAChC;CAGH,MAAM,EAAE,MAAMC,sBAAAA,QAAQ,QAAQ;CAC9B,MAAM,EACJ,SAAS,EAAE,YAAY,CAAC,GACxB,OAAO,EACL,IACA,MACA,WAAW,OACX,gBAAgB,CAAC,UACjB,eAAgB,WAAW,CAAC,IAAI,IAChC,UACA,eAAe,MACf,qBAAqB,CAAC,UACtB,OAAO,WAAW,CAAC,GACnB,KACA,aACA,UACA,SAAS,eACT,UACA,YAAY,KACZ,OAAO,WACP,UAAU,cACV,GAAG,QAEL,WACA,WACA,eACEC,wBAAAA,cAAc,KAAK;CACvB,MAAM,YAAA,GAAA,MAAA,OAAA,CAAkC,IAAI;CAC5C,MAAM,CAAC,OAAO,YAAYC,2CAAAA,qBAAqB;EAC7C;EACA,OAAO;EACP,UAAU;CACZ,CAAC;CACD,MAAM,YAAA,GAAA,MAAA,YAAA,EACH,UAAkB;EACjB,UAAU,SAAS;GACjB,KAA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