@aivex/ui 1.2.0-dev.59 → 1.2.0-dev.60

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 (362) hide show
  1. package/README.md +64 -19
  2. package/dist/DESIGN.md +1 -1
  3. package/dist/components/Accordion/Accordion.cjs +2 -0
  4. package/dist/components/Accordion/Accordion.cjs.map +1 -0
  5. package/dist/components/Accordion/Accordion.d.cts +111 -0
  6. package/dist/components/Accordion/Accordion.d.ts +111 -0
  7. package/dist/components/Accordion/Accordion.js +75 -0
  8. package/dist/components/Accordion/Accordion.js.map +1 -0
  9. package/dist/components/Accordion/index.d.cts +2 -0
  10. package/dist/components/Accordion/index.d.ts +2 -0
  11. package/dist/components/Avatar/Avatar.cjs +1 -1
  12. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  13. package/dist/components/Avatar/Avatar.js +11 -11
  14. package/dist/components/Avatar/Avatar.js.map +1 -1
  15. package/dist/components/Badge/Badge.cjs +1 -1
  16. package/dist/components/Badge/Badge.js +13 -13
  17. package/dist/components/BreadCrumb/BreadCrumb.cjs +1 -1
  18. package/dist/components/BreadCrumb/BreadCrumb.cjs.map +1 -1
  19. package/dist/components/BreadCrumb/BreadCrumb.js +13 -15
  20. package/dist/components/BreadCrumb/BreadCrumb.js.map +1 -1
  21. package/dist/components/Button/Button.cjs +1 -1
  22. package/dist/components/Button/Button.cjs.map +1 -1
  23. package/dist/components/Button/Button.d.cts +6 -5
  24. package/dist/components/Button/Button.d.ts +6 -5
  25. package/dist/components/Button/Button.js +36 -33
  26. package/dist/components/Button/Button.js.map +1 -1
  27. package/dist/components/Calendar/Calendar.cjs +1 -1
  28. package/dist/components/Calendar/Calendar.js +27 -27
  29. package/dist/components/Card/Card.cjs +1 -1
  30. package/dist/components/Card/Card.cjs.map +1 -1
  31. package/dist/components/Card/Card.d.cts +9 -8
  32. package/dist/components/Card/Card.d.ts +9 -8
  33. package/dist/components/Card/Card.js +25 -22
  34. package/dist/components/Card/Card.js.map +1 -1
  35. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  36. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  37. package/dist/components/Checkbox/Checkbox.d.cts +17 -18
  38. package/dist/components/Checkbox/Checkbox.d.ts +17 -18
  39. package/dist/components/Checkbox/Checkbox.js +31 -42
  40. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  41. package/dist/components/Checkbox/ChipsCheckbox.cjs +1 -1
  42. package/dist/components/Checkbox/ChipsCheckbox.cjs.map +1 -1
  43. package/dist/components/Checkbox/ChipsCheckbox.d.cts +10 -8
  44. package/dist/components/Checkbox/ChipsCheckbox.d.ts +10 -8
  45. package/dist/components/Checkbox/ChipsCheckbox.js +19 -37
  46. package/dist/components/Checkbox/ChipsCheckbox.js.map +1 -1
  47. package/dist/components/Coachmark/Coachmark.cjs +1 -1
  48. package/dist/components/Coachmark/Coachmark.cjs.map +1 -1
  49. package/dist/components/Coachmark/Coachmark.d.cts +29 -25
  50. package/dist/components/Coachmark/Coachmark.d.ts +29 -25
  51. package/dist/components/Coachmark/Coachmark.js +91 -83
  52. package/dist/components/Coachmark/Coachmark.js.map +1 -1
  53. package/dist/components/Coachmark/index.d.cts +1 -1
  54. package/dist/components/Coachmark/index.d.ts +1 -1
  55. package/dist/components/Comment/CommentInput.cjs +1 -1
  56. package/dist/components/Comment/CommentInput.js +7 -7
  57. package/dist/components/Comment/MentionInput.cjs +1 -1
  58. package/dist/components/Comment/MentionInput.cjs.map +1 -1
  59. package/dist/components/Comment/MentionInput.js +3 -1
  60. package/dist/components/Comment/MentionInput.js.map +1 -1
  61. package/dist/components/Comment/useMentionSuggestion.cjs +1 -1
  62. package/dist/components/Comment/useMentionSuggestion.cjs.map +1 -1
  63. package/dist/components/Comment/useMentionSuggestion.js +1 -1
  64. package/dist/components/Comment/useMentionSuggestion.js.map +1 -1
  65. package/dist/components/ContextMenu/ContextMenu.cjs +2 -0
  66. package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -0
  67. package/dist/components/ContextMenu/ContextMenu.d.cts +72 -0
  68. package/dist/components/ContextMenu/ContextMenu.d.ts +72 -0
  69. package/dist/components/ContextMenu/ContextMenu.js +56 -0
  70. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  71. package/dist/components/ContextMenu/index.d.cts +2 -0
  72. package/dist/components/ContextMenu/index.d.ts +2 -0
  73. package/dist/components/DataGrid/DataGrid.cjs +1 -1
  74. package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
  75. package/dist/components/DataGrid/DataGrid.js +33 -33
  76. package/dist/components/DataGrid/DataGrid.js.map +1 -1
  77. package/dist/components/DataGrid/DataGridColumnSettings.cjs +1 -1
  78. package/dist/components/DataGrid/DataGridColumnSettings.cjs.map +1 -1
  79. package/dist/components/DataGrid/DataGridColumnSettings.d.cts +1 -1
  80. package/dist/components/DataGrid/DataGridColumnSettings.d.ts +1 -1
  81. package/dist/components/DataGrid/DataGridColumnSettings.js +30 -31
  82. package/dist/components/DataGrid/DataGridColumnSettings.js.map +1 -1
  83. package/dist/components/DataGrid/DataGridPrimitives.cjs +1 -1
  84. package/dist/components/DataGrid/DataGridPrimitives.cjs.map +1 -1
  85. package/dist/components/DataGrid/DataGridPrimitives.d.cts +10 -12
  86. package/dist/components/DataGrid/DataGridPrimitives.d.ts +10 -12
  87. package/dist/components/DataGrid/DataGridPrimitives.js +43 -37
  88. package/dist/components/DataGrid/DataGridPrimitives.js.map +1 -1
  89. package/dist/components/Dialog/Dialog.cjs +1 -1
  90. package/dist/components/Dialog/Dialog.cjs.map +1 -1
  91. package/dist/components/Dialog/Dialog.d.cts +15 -5
  92. package/dist/components/Dialog/Dialog.d.ts +15 -5
  93. package/dist/components/Dialog/Dialog.js +61 -49
  94. package/dist/components/Dialog/Dialog.js.map +1 -1
  95. package/dist/components/Divider/Divider.cjs +1 -1
  96. package/dist/components/Divider/Divider.cjs.map +1 -1
  97. package/dist/components/Divider/Divider.js +6 -6
  98. package/dist/components/Drawer/Drawer.cjs +1 -1
  99. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  100. package/dist/components/Drawer/Drawer.d.cts +34 -22
  101. package/dist/components/Drawer/Drawer.d.ts +34 -22
  102. package/dist/components/Drawer/Drawer.js +80 -72
  103. package/dist/components/Drawer/Drawer.js.map +1 -1
  104. package/dist/components/EmptyState/EmptyState.cjs +2 -0
  105. package/dist/components/EmptyState/EmptyState.cjs.map +1 -0
  106. package/dist/components/EmptyState/EmptyState.d.cts +61 -0
  107. package/dist/components/EmptyState/EmptyState.d.ts +61 -0
  108. package/dist/components/EmptyState/EmptyState.js +50 -0
  109. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  110. package/dist/components/EmptyState/index.d.cts +2 -0
  111. package/dist/components/EmptyState/index.d.ts +2 -0
  112. package/dist/components/Field/Field.cjs +1 -1
  113. package/dist/components/Field/Field.cjs.map +1 -1
  114. package/dist/components/Field/Field.d.cts +45 -34
  115. package/dist/components/Field/Field.d.ts +45 -34
  116. package/dist/components/Field/Field.js +46 -65
  117. package/dist/components/Field/Field.js.map +1 -1
  118. package/dist/components/Field/FieldStateContext.cjs +2 -0
  119. package/dist/components/Field/FieldStateContext.cjs.map +1 -0
  120. package/dist/components/Field/FieldStateContext.d.cts +12 -0
  121. package/dist/components/Field/FieldStateContext.d.ts +12 -0
  122. package/dist/components/Field/FieldStateContext.js +14 -0
  123. package/dist/components/Field/FieldStateContext.js.map +1 -0
  124. package/dist/components/HoverCard/HoverCard.cjs +2 -0
  125. package/dist/components/HoverCard/HoverCard.cjs.map +1 -0
  126. package/dist/components/HoverCard/HoverCard.d.cts +61 -0
  127. package/dist/components/HoverCard/HoverCard.d.ts +61 -0
  128. package/dist/components/HoverCard/HoverCard.js +44 -0
  129. package/dist/components/HoverCard/HoverCard.js.map +1 -0
  130. package/dist/components/HoverCard/index.d.cts +2 -0
  131. package/dist/components/HoverCard/index.d.ts +2 -0
  132. package/dist/components/Icon/index.cjs +1 -1
  133. package/dist/components/Icon/index.cjs.map +1 -1
  134. package/dist/components/Icon/index.js +12 -12
  135. package/dist/components/Icon/index.js.map +1 -1
  136. package/dist/components/IconButton/IconButton.cjs +1 -1
  137. package/dist/components/IconButton/IconButton.cjs.map +1 -1
  138. package/dist/components/IconButton/IconButton.d.cts +6 -5
  139. package/dist/components/IconButton/IconButton.d.ts +6 -5
  140. package/dist/components/IconButton/IconButton.js +31 -28
  141. package/dist/components/IconButton/IconButton.js.map +1 -1
  142. package/dist/components/InputBase/InputBase.cjs +1 -1
  143. package/dist/components/InputBase/InputBase.cjs.map +1 -1
  144. package/dist/components/InputBase/InputBase.js +8 -8
  145. package/dist/components/Logo/index.cjs +1 -1
  146. package/dist/components/Logo/index.cjs.map +1 -1
  147. package/dist/components/Logo/index.d.cts +21 -2
  148. package/dist/components/Logo/index.d.ts +21 -2
  149. package/dist/components/Logo/index.js +487 -2
  150. package/dist/components/Logo/index.js.map +1 -1
  151. package/dist/components/Menu/Menu.cjs +1 -1
  152. package/dist/components/Menu/Menu.cjs.map +1 -1
  153. package/dist/components/Menu/Menu.d.cts +80 -43
  154. package/dist/components/Menu/Menu.d.ts +80 -43
  155. package/dist/components/Menu/Menu.js +144 -122
  156. package/dist/components/Menu/Menu.js.map +1 -1
  157. package/dist/components/Messagebox/Messagebox.cjs +1 -1
  158. package/dist/components/Messagebox/Messagebox.cjs.map +1 -1
  159. package/dist/components/Messagebox/Messagebox.js +27 -27
  160. package/dist/components/Modal/Modal.cjs +1 -1
  161. package/dist/components/Modal/Modal.cjs.map +1 -1
  162. package/dist/components/Modal/Modal.d.cts +22 -9
  163. package/dist/components/Modal/Modal.d.ts +22 -9
  164. package/dist/components/Modal/Modal.js +95 -98
  165. package/dist/components/Modal/Modal.js.map +1 -1
  166. package/dist/components/Modal/ModalBase.cjs +1 -1
  167. package/dist/components/Modal/ModalBase.cjs.map +1 -1
  168. package/dist/components/Modal/ModalBase.d.cts +32 -23
  169. package/dist/components/Modal/ModalBase.d.ts +32 -23
  170. package/dist/components/Modal/ModalBase.js +35 -23
  171. package/dist/components/Modal/ModalBase.js.map +1 -1
  172. package/dist/components/Nav/Nav.cjs +1 -1
  173. package/dist/components/Nav/Nav.js +19 -19
  174. package/dist/components/NumberField/NumberField.cjs +2 -0
  175. package/dist/components/NumberField/NumberField.cjs.map +1 -0
  176. package/dist/components/NumberField/NumberField.d.cts +79 -0
  177. package/dist/components/NumberField/NumberField.d.ts +79 -0
  178. package/dist/components/NumberField/NumberField.js +65 -0
  179. package/dist/components/NumberField/NumberField.js.map +1 -0
  180. package/dist/components/NumberField/index.d.cts +2 -0
  181. package/dist/components/NumberField/index.d.ts +2 -0
  182. package/dist/components/Overlay/Overlay.cjs +1 -1
  183. package/dist/components/Overlay/Overlay.js +6 -6
  184. package/dist/components/Pagination/Pagination.cjs +1 -1
  185. package/dist/components/Pagination/Pagination.js +20 -20
  186. package/dist/components/Panel/Panel.cjs +1 -1
  187. package/dist/components/Panel/Panel.js +25 -25
  188. package/dist/components/Popover/Popover.cjs +1 -1
  189. package/dist/components/Popover/Popover.cjs.map +1 -1
  190. package/dist/components/Popover/Popover.d.cts +32 -28
  191. package/dist/components/Popover/Popover.d.ts +32 -28
  192. package/dist/components/Popover/Popover.js +50 -46
  193. package/dist/components/Popover/Popover.js.map +1 -1
  194. package/dist/components/Popover/index.d.cts +1 -1
  195. package/dist/components/Popover/index.d.ts +1 -1
  196. package/dist/components/Radio/Radio.cjs +1 -1
  197. package/dist/components/Radio/Radio.cjs.map +1 -1
  198. package/dist/components/Radio/Radio.d.cts +47 -18
  199. package/dist/components/Radio/Radio.d.ts +47 -18
  200. package/dist/components/Radio/Radio.js +43 -33
  201. package/dist/components/Radio/Radio.js.map +1 -1
  202. package/dist/components/Radio/index.d.cts +2 -2
  203. package/dist/components/Radio/index.d.ts +2 -2
  204. package/dist/components/ScrollArea/ScrollArea.cjs +1 -1
  205. package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
  206. package/dist/components/ScrollArea/ScrollArea.d.cts +25 -8
  207. package/dist/components/ScrollArea/ScrollArea.d.ts +25 -8
  208. package/dist/components/ScrollArea/ScrollArea.js +50 -30
  209. package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
  210. package/dist/components/ScrollArea/index.d.cts +1 -1
  211. package/dist/components/ScrollArea/index.d.ts +1 -1
  212. package/dist/components/Segmented/Segmented.cjs +1 -1
  213. package/dist/components/Segmented/Segmented.cjs.map +1 -1
  214. package/dist/components/Segmented/Segmented.d.cts +20 -5
  215. package/dist/components/Segmented/Segmented.d.ts +20 -5
  216. package/dist/components/Segmented/Segmented.js +18 -18
  217. package/dist/components/Segmented/Segmented.js.map +1 -1
  218. package/dist/components/SelectBox/SelectBox.cjs +1 -1
  219. package/dist/components/SelectBox/SelectBox.cjs.map +1 -1
  220. package/dist/components/SelectBox/SelectBox.d.cts +13 -15
  221. package/dist/components/SelectBox/SelectBox.d.ts +13 -15
  222. package/dist/components/SelectBox/SelectBox.js +64 -56
  223. package/dist/components/SelectBox/SelectBox.js.map +1 -1
  224. package/dist/components/SelectButton/SelectButton.cjs +1 -1
  225. package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
  226. package/dist/components/SelectButton/SelectButton.d.cts +13 -10
  227. package/dist/components/SelectButton/SelectButton.d.ts +13 -10
  228. package/dist/components/SelectButton/SelectButton.js +6 -6
  229. package/dist/components/SelectButton/SelectButton.js.map +1 -1
  230. package/dist/components/ShapeEditor/_components/ContextMenu.cjs +1 -1
  231. package/dist/components/ShapeEditor/_components/ContextMenu.cjs.map +1 -1
  232. package/dist/components/ShapeEditor/_components/ContextMenu.d.cts +2 -2
  233. package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +2 -2
  234. package/dist/components/ShapeEditor/_components/ContextMenu.js +32 -32
  235. package/dist/components/ShapeEditor/_components/ContextMenu.js.map +1 -1
  236. package/dist/components/ShapeEditor/_components/Minimap.cjs +1 -1
  237. package/dist/components/ShapeEditor/_components/Minimap.cjs.map +1 -1
  238. package/dist/components/ShapeEditor/_components/Minimap.js +7 -10
  239. package/dist/components/ShapeEditor/_components/Minimap.js.map +1 -1
  240. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  241. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  242. package/dist/components/Skeleton/Skeleton.d.cts +4 -4
  243. package/dist/components/Skeleton/Skeleton.d.ts +4 -4
  244. package/dist/components/Skeleton/Skeleton.js +12 -9
  245. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  246. package/dist/components/Slider/Slider.cjs +1 -1
  247. package/dist/components/Slider/Slider.cjs.map +1 -1
  248. package/dist/components/Slider/Slider.d.cts +21 -8
  249. package/dist/components/Slider/Slider.d.ts +21 -8
  250. package/dist/components/Slider/Slider.js +37 -32
  251. package/dist/components/Slider/Slider.js.map +1 -1
  252. package/dist/components/Switch/Switch.cjs +1 -1
  253. package/dist/components/Switch/Switch.cjs.map +1 -1
  254. package/dist/components/Switch/Switch.d.cts +6 -4
  255. package/dist/components/Switch/Switch.d.ts +6 -4
  256. package/dist/components/Switch/Switch.js +26 -23
  257. package/dist/components/Switch/Switch.js.map +1 -1
  258. package/dist/components/Tab/Tab.cjs +1 -1
  259. package/dist/components/Tab/Tab.cjs.map +1 -1
  260. package/dist/components/Tab/Tab.d.cts +47 -16
  261. package/dist/components/Tab/Tab.d.ts +47 -16
  262. package/dist/components/Tab/Tab.js +17 -13
  263. package/dist/components/Tab/Tab.js.map +1 -1
  264. package/dist/components/Tag/Tag.cjs +1 -1
  265. package/dist/components/Tag/Tag.cjs.map +1 -1
  266. package/dist/components/Tag/Tag.js +16 -16
  267. package/dist/components/Tagbox/Tagbox.cjs +1 -1
  268. package/dist/components/Tagbox/Tagbox.cjs.map +1 -1
  269. package/dist/components/Tagbox/Tagbox.d.cts +8 -10
  270. package/dist/components/Tagbox/Tagbox.d.ts +8 -10
  271. package/dist/components/Tagbox/Tagbox.js +63 -61
  272. package/dist/components/Tagbox/Tagbox.js.map +1 -1
  273. package/dist/components/Textarea/Textarea.cjs +1 -1
  274. package/dist/components/Textarea/Textarea.cjs.map +1 -1
  275. package/dist/components/Textarea/Textarea.d.cts +4 -6
  276. package/dist/components/Textarea/Textarea.d.ts +4 -6
  277. package/dist/components/Textarea/Textarea.js +44 -40
  278. package/dist/components/Textarea/Textarea.js.map +1 -1
  279. package/dist/components/Textbox/Textbox.cjs +1 -1
  280. package/dist/components/Textbox/Textbox.cjs.map +1 -1
  281. package/dist/components/Textbox/Textbox.d.cts +4 -6
  282. package/dist/components/Textbox/Textbox.d.ts +4 -6
  283. package/dist/components/Textbox/Textbox.js +46 -44
  284. package/dist/components/Textbox/Textbox.js.map +1 -1
  285. package/dist/components/Toast/Toast.cjs +1 -1
  286. package/dist/components/Toast/Toast.cjs.map +1 -1
  287. package/dist/components/Toast/Toast.d.cts +1 -1
  288. package/dist/components/Toast/Toast.d.ts +1 -1
  289. package/dist/components/Toast/Toast.js +18 -18
  290. package/dist/components/Toast/Toast.js.map +1 -1
  291. package/dist/components/ToggleButton/ToggleButton.cjs +1 -1
  292. package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
  293. package/dist/components/ToggleButton/ToggleButton.js +13 -13
  294. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  295. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  296. package/dist/components/Tooltip/Tooltip.d.cts +2 -2
  297. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  298. package/dist/components/Tooltip/Tooltip.js +37 -26
  299. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  300. package/dist/components/TruncatedText/TruncatedText.cjs +1 -1
  301. package/dist/components/TruncatedText/TruncatedText.cjs.map +1 -1
  302. package/dist/components/TruncatedText/TruncatedText.js +64 -51
  303. package/dist/components/TruncatedText/TruncatedText.js.map +1 -1
  304. package/dist/components/Typography/Typography.cjs +1 -1
  305. package/dist/components/Typography/Typography.cjs.map +1 -1
  306. package/dist/components/Typography/Typography.js +5 -5
  307. package/dist/components/UploadArea/UploadArea.cjs +1 -1
  308. package/dist/components/UploadArea/UploadArea.js +6 -6
  309. package/dist/index.cjs +1 -1
  310. package/dist/index.d.cts +5 -0
  311. package/dist/index.d.ts +5 -0
  312. package/dist/index.js +63 -58
  313. package/dist/llms-full.txt +877 -290
  314. package/dist/llms.txt +16 -11
  315. package/dist/styles.css +1 -1
  316. package/dist/utils/PortalEventBoundary.cjs +2 -0
  317. package/dist/utils/PortalEventBoundary.cjs.map +1 -0
  318. package/dist/utils/PortalEventBoundary.d.cts +13 -0
  319. package/dist/utils/PortalEventBoundary.d.ts +13 -0
  320. package/dist/utils/PortalEventBoundary.js +12 -0
  321. package/dist/utils/PortalEventBoundary.js.map +1 -0
  322. package/dist/utils/Primitive.cjs +2 -0
  323. package/dist/utils/Primitive.cjs.map +1 -0
  324. package/dist/utils/Primitive.d.cts +9 -0
  325. package/dist/utils/Primitive.d.ts +9 -0
  326. package/dist/utils/Primitive.js +15 -0
  327. package/dist/utils/Primitive.js.map +1 -0
  328. package/dist/utils/popupArrow.cjs +2 -0
  329. package/dist/utils/popupArrow.cjs.map +1 -0
  330. package/dist/utils/popupArrow.d.cts +14 -0
  331. package/dist/utils/popupArrow.d.ts +14 -0
  332. package/dist/utils/popupArrow.js +26 -0
  333. package/dist/utils/popupArrow.js.map +1 -0
  334. package/dist/utils/popupPositioning.cjs +2 -0
  335. package/dist/utils/popupPositioning.cjs.map +1 -0
  336. package/dist/utils/popupPositioning.d.cts +11 -0
  337. package/dist/utils/popupPositioning.d.ts +11 -0
  338. package/dist/utils/popupPositioning.js +25 -0
  339. package/dist/utils/popupPositioning.js.map +1 -0
  340. package/dist/utils/useComposedRefs.cjs +2 -0
  341. package/dist/utils/useComposedRefs.cjs.map +1 -0
  342. package/dist/utils/useComposedRefs.d.cts +6 -0
  343. package/dist/utils/useComposedRefs.d.ts +6 -0
  344. package/dist/utils/useComposedRefs.js +22 -0
  345. package/dist/utils/useComposedRefs.js.map +1 -0
  346. package/dist/utils/useControllableState.cjs.map +1 -1
  347. package/dist/utils/useControllableState.d.cts +1 -1
  348. package/dist/utils/useControllableState.d.ts +1 -1
  349. package/dist/utils/useControllableState.js.map +1 -1
  350. package/dist/utils/useModalFocus.cjs +2 -0
  351. package/dist/utils/useModalFocus.cjs.map +1 -0
  352. package/dist/utils/useModalFocus.d.cts +31 -0
  353. package/dist/utils/useModalFocus.d.ts +31 -0
  354. package/dist/utils/useModalFocus.js +28 -0
  355. package/dist/utils/useModalFocus.js.map +1 -0
  356. package/package.json +2 -16
  357. package/dist/utils/useModalAutoFocus.cjs +0 -2
  358. package/dist/utils/useModalAutoFocus.cjs.map +0 -1
  359. package/dist/utils/useModalAutoFocus.d.cts +0 -11
  360. package/dist/utils/useModalAutoFocus.d.ts +0 -11
  361. package/dist/utils/useModalAutoFocus.js +0 -22
  362. package/dist/utils/useModalAutoFocus.js.map +0 -1
@@ -1,37 +1,36 @@
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
1
2
  import { type VariantProps } from "class-variance-authority";
2
- import { type InputHTMLAttributes, type Ref } from "react";
3
- /** Checkbox 입력 박스의 크기(`size`) 클래스를 만드는 cva 변형 함수. */
3
+ import type { Ref } from "react";
4
+ /** Checkbox 박스의 크기(`size`) 클래스를 만드는 cva 변형 함수. */
4
5
  declare const checkboxVariants: (props?: ({
5
6
  size?: "md" | "sm" | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type">, VariantProps<typeof checkboxVariants> {
8
- /**
9
- * 일부 선택(–) 상태로 표시. `checked`보다 우선해 보이며 input의 `indeterminate` 속성도 설정한다.
10
- * @default false
11
- */
12
- indeterminate?: boolean;
13
- /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */
8
+ type CheckboxRootProps = CheckboxPrimitive.Root.Props;
9
+ export interface CheckboxProps extends Omit<CheckboxRootProps, "className" | "style" | "onCheckedChange" | "render" | "nativeButton" | "parent" | "children">, VariantProps<typeof checkboxVariants> {
10
+ className?: string;
11
+ /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */
14
12
  onCheckedChange?: (checked: boolean) => void;
15
- ref?: Ref<HTMLInputElement>;
13
+ /** 보이는 체크박스 요소(`role="checkbox"`) ref */
14
+ ref?: Ref<HTMLElement>;
16
15
  }
17
16
  /**
18
- * 네이티브 `<input type="checkbox">` 기반 체크박스.
17
+ * 체크박스.
19
18
  *
20
- * `checked`(+`onCheckedChange`)로 제어하거나 `defaultChecked`로 비제어로 쓴다.
21
- * 라벨을 포함하지 않으므로 `Field`·`FieldControl`·`FieldLabel`로 감싸거나 `aria-label`을 준다.
19
+ * `checked`(+`onCheckedChange`)로 제어하거나 `defaultChecked`로 비제어로 쓴다. `indeterminate`는 일부 선택(–)으로
20
+ * 표시하며 `checked`보다 우선해 보인다. 폼에는 `name`·`value`가 숨은 input으로 제출된다(`inputRef`로 접근).
21
+ * 라벨을 포함하지 않으므로 `Field` 안에 `FieldLabel`과 함께 두거나 `aria-label`을 준다. `Field` 안에서는
22
+ * 라벨·설명·invalid·disabled가 자동으로 연결된다.
22
23
  * `size`: sm(16px)·md(18px, 기본). `aria-invalid`를 주면 오류 테두리로 표시된다.
23
24
  *
24
25
  * @example
25
26
  * ```tsx
26
- * import { Checkbox, Field, FieldControl, FieldLabel } from "@aivex/ui";
27
+ * import { Checkbox, Field, FieldLabel } from "@aivex/ui";
27
28
  *
28
29
  * <Field orientation="horizontal">
29
- * <FieldControl>
30
- * <Checkbox checked={agreed} onCheckedChange={setAgreed} />
31
- * </FieldControl>
30
+ * <Checkbox checked={agreed} onCheckedChange={setAgreed} />
32
31
  * <FieldLabel>약관에 동의합니다</FieldLabel>
33
32
  * </Field>
34
33
  * ```
35
34
  */
36
- declare function Checkbox({ className, size, indeterminate, disabled, checked, defaultChecked, onCheckedChange, onChange, id, ref, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
35
+ declare function Checkbox({ className, size, indeterminate, onCheckedChange, ref, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
37
36
  export { Checkbox, checkboxVariants };
@@ -1,60 +1,49 @@
1
1
  "use client";
2
- import { cn as e } from "../../utils.js";
3
- import { CheckboxCheckIcon as t, CheckboxIndeterminateIcon as n } from "../Icon/index.js";
2
+ "use client";
3
+ import { CheckboxCheckIcon as e, CheckboxIndeterminateIcon as t } from "../Icon/index.js";
4
+ import { cn as n } from "../../utils.js";
4
5
  import { isAriaInvalid as r } from "../InputBase/useInputState.js";
5
- import { useControllableState as i } from "../../utils/useControllableState.js";
6
- import { cva as a } from "class-variance-authority";
7
- import { useEffect as o, useRef as s } from "react";
8
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
- import { useComposedRefs as u } from "@radix-ui/react-compose-refs";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { cva as o } from "class-variance-authority";
8
+ import { Checkbox as s } from "@base-ui/react/checkbox";
10
9
  //#region src/components/Checkbox/Checkbox.tsx
11
- var d = a("aivex:relative aivex:m-0 aivex:shrink-0 aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:appearance-none aivex:cursor-pointer aivex:transition-colors aivex:peer", {
10
+ var c = o([
11
+ "aivex:relative aivex:m-0 aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:justify-center aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:cursor-pointer aivex:transition-colors aivex:outline-none",
12
+ "aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand",
13
+ "aivex:data-[invalid]:border-border-danger",
14
+ "aivex:data-[checked]:border-transparent aivex:data-[checked]:bg-bg-brand",
15
+ "aivex:data-[indeterminate]:border-transparent aivex:data-[indeterminate]:bg-bg-brand"
16
+ ], {
12
17
  variants: { size: {
13
18
  sm: "aivex:w-4 aivex:h-4",
14
19
  md: "aivex:w-[18px] aivex:h-[18px]"
15
20
  } },
16
21
  defaultVariants: { size: "md" }
17
- }), f = {
22
+ }), l = {
18
23
  sm: "aivex:w-5 aivex:h-5",
19
24
  md: "aivex:w-6 aivex:h-6"
20
25
  };
21
- function p({ className: a, size: p = "md", indeterminate: m = !1, disabled: h, checked: g, defaultChecked: _, onCheckedChange: v, onChange: y, id: b, ref: x, ...S }) {
22
- let C = s(null), [w, T] = i({
23
- value: g,
24
- defaultValue: !!_,
25
- onChange: v
26
- }), E = u(x, C);
27
- o(() => {
28
- C.current && (C.current.indeterminate = m);
29
- }, [m]);
30
- let D = !!w, O = D || m, k = p ?? "md", A = r(S["aria-invalid"]);
31
- return /* @__PURE__ */ c("span", {
32
- className: e("aivex:inline-flex aivex:items-center aivex:gap-md", h && "aivex:opacity-disable aivex:pointer-events-none"),
33
- children: /* @__PURE__ */ l("span", {
34
- className: e("aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group", f[k]),
35
- children: [
36
- /* @__PURE__ */ c("span", { className: "aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity" }),
37
- /* @__PURE__ */ c("input", {
38
- ref: E,
39
- id: b,
40
- type: "checkbox",
41
- disabled: h,
42
- checked: D,
43
- onChange: (e) => {
44
- T(e.target.checked), y?.(e);
45
- },
46
- className: e(d({ size: k }), A && "aivex:border-border-danger", O && "aivex:border-transparent aivex:bg-bg-brand", a),
47
- ...S
48
- }),
49
- O && /* @__PURE__ */ c("span", {
50
- className: "aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none",
51
- children: c(m ? n : t, { size: k })
26
+ function u({ className: o, size: u = "md", indeterminate: d = !1, onCheckedChange: f, ref: p, ...m }) {
27
+ let h = u ?? "md", g = r(m["aria-invalid"]);
28
+ return /* @__PURE__ */ i("span", {
29
+ className: "aivex:inline-flex aivex:items-center aivex:gap-md aivex:has-[[data-disabled]]:opacity-disable aivex:has-[[data-disabled]]:pointer-events-none",
30
+ children: /* @__PURE__ */ a("span", {
31
+ className: n("aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group", l[h]),
32
+ children: [/* @__PURE__ */ i("span", { className: "aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity" }), /* @__PURE__ */ i(s.Root, {
33
+ ref: p,
34
+ indeterminate: d,
35
+ onCheckedChange: f ? (e) => f(e) : void 0,
36
+ className: n(c({ size: h }), g && "aivex:border-border-danger", o),
37
+ ...m,
38
+ children: /* @__PURE__ */ i(s.Indicator, {
39
+ className: "aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none",
40
+ children: i(d ? t : e, { size: h })
52
41
  })
53
- ]
42
+ })]
54
43
  })
55
44
  });
56
45
  }
57
46
  //#endregion
58
- export { p as Checkbox, d as checkboxVariants };
47
+ export { u as Checkbox, c as checkboxVariants };
59
48
 
60
49
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":[],"sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { type ChangeEvent, type InputHTMLAttributes, type Ref, useEffect, useRef } from \"react\";\nimport { CheckboxCheckIcon, CheckboxIndeterminateIcon } from \"@/components/Icon\";\nimport { isAriaInvalid } from \"@/components/InputBase/useInputState\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\n/** Checkbox 입력 박스의 크기(`size`) 클래스를 만드는 cva 변형 함수. */\nconst checkboxVariants = cva(\n \"aivex:relative aivex:m-0 aivex:shrink-0 aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:appearance-none aivex:cursor-pointer aivex:transition-colors aivex:peer\",\n {\n variants: {\n size: {\n sm: \"aivex:w-4 aivex:h-4\",\n md: \"aivex:w-[18px] aivex:h-[18px]\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n },\n);\n\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"type\">,\n VariantProps<typeof checkboxVariants> {\n /**\n * 일부 선택(–) 상태로 표시. `checked`보다 우선해 보이며 input의 `indeterminate` 속성도 설정한다.\n * @default false\n */\n indeterminate?: boolean;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */\n onCheckedChange?: (checked: boolean) => void;\n ref?: Ref<HTMLInputElement>;\n}\n\nconst checkboxContainerSizeClass = {\n sm: \"aivex:w-5 aivex:h-5\",\n md: \"aivex:w-6 aivex:h-6\",\n};\n\n/**\n * 네이티브 `<input type=\"checkbox\">` 기반 체크박스.\n *\n * `checked`(+`onCheckedChange`)로 제어하거나 `defaultChecked`로 비제어로 쓴다.\n * 라벨을 포함하지 않으므로 `Field`·`FieldControl`·`FieldLabel`로 감싸거나 `aria-label`을 준다.\n * `size`: sm(16px)·md(18px, 기본). `aria-invalid`를 주면 오류 테두리로 표시된다.\n *\n * @example\n * ```tsx\n * import { Checkbox, Field, FieldControl, FieldLabel } from \"@aivex/ui\";\n *\n * <Field orientation=\"horizontal\">\n * <FieldControl>\n * <Checkbox checked={agreed} onCheckedChange={setAgreed} />\n * </FieldControl>\n * <FieldLabel>약관에 동의합니다</FieldLabel>\n * </Field>\n * ```\n */\nfunction Checkbox({\n className,\n size = \"md\",\n indeterminate = false,\n disabled,\n checked,\n defaultChecked,\n onCheckedChange,\n onChange,\n id,\n ref,\n ...props\n}: CheckboxProps) {\n const innerRef = useRef<HTMLInputElement>(null);\n const [resolvedChecked, setChecked] = useControllableState({\n value: checked,\n defaultValue: Boolean(defaultChecked),\n onChange: onCheckedChange,\n });\n\n // 내부 ref로 indeterminate를 다루면서 객체·함수 ref 모두에 같은 input을 넘긴다.\n const resolvedRef = useComposedRefs(ref, innerRef);\n\n useEffect(() => {\n if (innerRef.current) innerRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const currentChecked = Boolean(resolvedChecked);\n const isChecked = currentChecked || indeterminate;\n const resolvedSize = size ?? \"md\";\n const invalid = isAriaInvalid(props[\"aria-invalid\"]);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChecked(event.target.checked);\n onChange?.(event);\n };\n\n return (\n <span\n className={cn(\n \"aivex:inline-flex aivex:items-center aivex:gap-md\",\n disabled && \"aivex:opacity-disable aivex:pointer-events-none\",\n )}\n >\n <span\n className={cn(\n \"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group\",\n checkboxContainerSizeClass[resolvedSize],\n )}\n >\n <span className=\"aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity\" />\n <input\n ref={resolvedRef}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n checked={currentChecked}\n onChange={handleChange}\n className={cn(\n checkboxVariants({ size: resolvedSize }),\n invalid && \"aivex:border-border-danger\",\n isChecked && \"aivex:border-transparent aivex:bg-bg-brand\",\n className,\n )}\n {...props}\n />\n {isChecked && (\n <span className=\"aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n {indeterminate ? (\n <CheckboxIndeterminateIcon size={resolvedSize} />\n ) : (\n <CheckboxCheckIcon size={resolvedSize} />\n )}\n </span>\n )}\n </span>\n </span>\n );\n}\n\nexport { Checkbox, checkboxVariants };\n"],"mappings":";;;;;;;;;;AASA,IAAM,IAAmB,EACvB,uMACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACD,iBAAiB,EACf,MAAM,MACP;CACF,CACF,EAeK,IAA6B;CACjC,IAAI;CACJ,IAAI;CACL;AAqBD,SAAS,EAAS,EAChB,cACA,UAAO,MACP,mBAAgB,IAChB,aACA,YACA,mBACA,oBACA,aACA,OACA,QACA,GAAG,KACa;CAChB,IAAM,IAAW,EAAyB,KAAK,EACzC,CAAC,GAAiB,KAAc,EAAqB;EACzD,OAAO;EACP,cAAc,EAAQ;EACtB,UAAU;EACX,CAAC,EAGI,IAAc,EAAgB,GAAK,EAAS;AAElD,SAAgB;AACd,EAAI,EAAS,YAAS,EAAS,QAAQ,gBAAgB;IACtD,CAAC,EAAc,CAAC;CAEnB,IAAM,IAAiB,EAAQ,GACzB,IAAY,KAAkB,GAC9B,IAAe,KAAQ,MACvB,IAAU,EAAc,EAAM,gBAAgB;AAOpD,QACE,kBAAC,QAAD;EACE,WAAW,EACT,qDACA,KAAY,kDACb;YAED,kBAAC,QAAD;GACE,WAAW,EACT,uGACA,EAA2B,GAC5B;aAJH;IAME,kBAAC,QAAD,EAAM,WAAU,2MAA4M,CAAA;IAC5N,kBAAC,SAAD;KACE,KAAK;KACD;KACJ,MAAK;KACK;KACV,SAAS;KACT,WAzBc,MAAyC;AAE7D,MADA,EAAW,EAAM,OAAO,QAAQ,EAChC,IAAW,EAAM;;KAwBX,WAAW,EACT,EAAiB,EAAE,MAAM,GAAc,CAAC,EACxC,KAAW,8BACX,KAAa,8CACb,EACD;KACD,GAAI;KACJ,CAAA;IACD,KACC,kBAAC,QAAD;KAAM,WAAU;eAEZ,EADD,IACE,IAEA,GAFD,EAA2B,MAAM,GAAgB,CAER;KAEtC,CAAA;IAEJ;;EACF,CAAA"}
1
+ {"version":3,"file":"Checkbox.js","names":[],"sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { Ref } from \"react\";\nimport { CheckboxCheckIcon, CheckboxIndeterminateIcon } from \"@/components/Icon\";\nimport { isAriaInvalid } from \"@/components/InputBase/useInputState\";\nimport { cn } from \"@/utils/cn\";\n\n/** Checkbox 박스의 크기(`size`) 클래스를 만드는 cva 변형 함수. */\nconst checkboxVariants = cva(\n [\n \"aivex:relative aivex:m-0 aivex:inline-flex aivex:shrink-0 aivex:items-center aivex:justify-center aivex:rounded-xs aivex:border aivex:border-border-default aivex:bg-bg-primary aivex:cursor-pointer aivex:transition-colors aivex:outline-none\",\n \"aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand\",\n // Field의 invalid가 전파되면 data-invalid가 붙는다.\n \"aivex:data-[invalid]:border-border-danger\",\n \"aivex:data-[checked]:border-transparent aivex:data-[checked]:bg-bg-brand\",\n \"aivex:data-[indeterminate]:border-transparent aivex:data-[indeterminate]:bg-bg-brand\",\n ],\n {\n variants: {\n size: {\n sm: \"aivex:w-4 aivex:h-4\",\n md: \"aivex:w-[18px] aivex:h-[18px]\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n },\n);\n\ntype CheckboxRootProps = CheckboxPrimitive.Root.Props;\n\nexport interface CheckboxProps\n extends Omit<\n CheckboxRootProps,\n \"className\" | \"style\" | \"onCheckedChange\" | \"render\" | \"nativeButton\" | \"parent\" | \"children\"\n >,\n VariantProps<typeof checkboxVariants> {\n className?: string;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */\n onCheckedChange?: (checked: boolean) => void;\n /** 보이는 체크박스 요소(`role=\"checkbox\"`) ref */\n ref?: Ref<HTMLElement>;\n}\n\nconst checkboxContainerSizeClass = {\n sm: \"aivex:w-5 aivex:h-5\",\n md: \"aivex:w-6 aivex:h-6\",\n};\n\n/**\n * 체크박스.\n *\n * `checked`(+`onCheckedChange`)로 제어하거나 `defaultChecked`로 비제어로 쓴다. `indeterminate`는 일부 선택(–)으로\n * 표시하며 `checked`보다 우선해 보인다. 폼에는 `name`·`value`가 숨은 input으로 제출된다(`inputRef`로 접근).\n * 라벨을 포함하지 않으므로 `Field` 안에 `FieldLabel`과 함께 두거나 `aria-label`을 준다. `Field` 안에서는\n * 라벨·설명·invalid·disabled가 자동으로 연결된다.\n * `size`: sm(16px)·md(18px, 기본). `aria-invalid`를 주면 오류 테두리로 표시된다.\n *\n * @example\n * ```tsx\n * import { Checkbox, Field, FieldLabel } from \"@aivex/ui\";\n *\n * <Field orientation=\"horizontal\">\n * <Checkbox checked={agreed} onCheckedChange={setAgreed} />\n * <FieldLabel>약관에 동의합니다</FieldLabel>\n * </Field>\n * ```\n */\nfunction Checkbox({\n className,\n size = \"md\",\n indeterminate = false,\n onCheckedChange,\n ref,\n ...props\n}: CheckboxProps) {\n const resolvedSize = size ?? \"md\";\n const invalid = isAriaInvalid(props[\"aria-invalid\"]);\n\n return (\n <span className=\"aivex:inline-flex aivex:items-center aivex:gap-md aivex:has-[[data-disabled]]:opacity-disable aivex:has-[[data-disabled]]:pointer-events-none\">\n <span\n className={cn(\n \"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:shrink-0 aivex:group\",\n checkboxContainerSizeClass[resolvedSize],\n )}\n >\n <span className=\"aivex:absolute aivex:-inset-1 aivex:rounded-full aivex:bg-bg-inverse-strong aivex:opacity-0 aivex:group-hover:opacity-4 aivex:group-active:opacity-8 aivex:pointer-events-none aivex:transition-opacity\" />\n <CheckboxPrimitive.Root\n ref={ref}\n indeterminate={indeterminate}\n onCheckedChange={onCheckedChange ? (checked) => onCheckedChange(checked) : undefined}\n className={cn(\n checkboxVariants({ size: resolvedSize }),\n invalid && \"aivex:border-border-danger\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n {indeterminate ? (\n <CheckboxIndeterminateIcon size={resolvedSize} />\n ) : (\n <CheckboxCheckIcon size={resolvedSize} />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n </span>\n </span>\n );\n}\n\nexport { Checkbox, checkboxVariants };\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAmB,EACvB;CACE;CACA;CAEA;CACA;CACA;CACD,EACD;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACD,iBAAiB,EACf,MAAM,MACP;CACF,CACF,EAiBK,IAA6B;CACjC,IAAI;CACJ,IAAI;CACL;AAqBD,SAAS,EAAS,EAChB,cACA,UAAO,MACP,mBAAgB,IAChB,oBACA,QACA,GAAG,KACa;CAChB,IAAM,IAAe,KAAQ,MACvB,IAAU,EAAc,EAAM,gBAAgB;AAEpD,QACE,kBAAC,QAAD;EAAM,WAAU;YACd,kBAAC,QAAD;GACE,WAAW,EACT,uGACA,EAA2B,GAC5B;aAJH,CAME,kBAAC,QAAD,EAAM,WAAU,2MAA4M,CAAA,EAC5N,kBAAC,EAAkB,MAAnB;IACO;IACU;IACf,iBAAiB,KAAmB,MAAY,EAAgB,EAAQ,GAAG,KAAA;IAC3E,WAAW,EACT,EAAiB,EAAE,MAAM,GAAc,CAAC,EACxC,KAAW,8BACX,EACD;IACD,GAAI;cAEJ,kBAAC,EAAkB,WAAnB;KAA6B,WAAU;eAEnC,EADD,IACE,IAEA,GAFD,EAA2B,MAAM,GAAgB,CAER;KAEf,CAAA;IACP,CAAA,CACpB;;EACF,CAAA"}
@@ -1,2 +1,2 @@
1
- "use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils.cjs`),t=require(`../InteractionLayer/InteractionLayer.cjs`),n=require(`../Icon/index.cjs`),r=require(`../../utils/useControllableState.cjs`);let i=require(`react/jsx-runtime`);function a({className:a,disabled:o,checked:s,defaultChecked:c,onCheckedChange:l,onChange:u,onClick:d,id:f,ref:p,...m}){let[h,g]=r.useControllableState({value:s,defaultValue:!!c,onChange:l}),_=!!h;return(0,i.jsxs)(`label`,{onClick:d,className:e.cn(`aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center`,`aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors`,_?`aivex:bg-bg-brand-subtle aivex:border-border-brand-subtle`:`aivex:bg-bg-tertiary aivex:border-border-default`,o&&`aivex:opacity-disable aivex:pointer-events-none`,a),children:[(0,i.jsx)(t.InteractionLayer,{}),(0,i.jsx)(`input`,{ref:p,id:f,type:`checkbox`,disabled:o,checked:_,onChange:e=>{g(e.target.checked),u?.(e)},onClick:e=>e.stopPropagation(),className:`aivex:sr-only`,...m}),(0,i.jsxs)(`span`,{className:`aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0`,children:[(0,i.jsx)(`span`,{className:e.cn(`aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors`,_?`aivex:bg-bg-brand aivex:border-transparent`:`aivex:bg-bg-primary aivex:border-border-default`)}),_&&(0,i.jsx)(`span`,{className:`aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none`,children:(0,i.jsx)(n.CheckboxCheckIcon,{size:`sm`})})]})]})}exports.ChipsCheckbox=a;
1
+ "use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../Icon/index.cjs`),t=require(`../../utils.cjs`),n=require(`../InteractionLayer/InteractionLayer.cjs`);let r=require(`react/jsx-runtime`),i=require(`@base-ui/react/checkbox`);function a({className:a,onCheckedChange:o,ref:s,...c}){return(0,r.jsxs)(i.Checkbox.Root,{ref:s,onCheckedChange:o?e=>o(e):void 0,className:t.cn(`aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center`,`aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors aivex:outline-none`,`aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand`,`aivex:bg-bg-tertiary aivex:border-border-default`,`aivex:data-[checked]:bg-bg-brand-subtle aivex:data-[checked]:border-border-brand-subtle`,`aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none`,a),...c,children:[(0,r.jsx)(n.InteractionLayer,{}),(0,r.jsxs)(`span`,{className:`aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0`,children:[(0,r.jsx)(`span`,{className:`aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors aivex:bg-bg-primary aivex:border-border-default aivex:group-data-[checked]:bg-bg-brand aivex:group-data-[checked]:border-transparent`}),(0,r.jsx)(i.Checkbox.Indicator,{className:`aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none`,children:(0,r.jsx)(e.CheckboxCheckIcon,{size:`sm`})})]})]})}exports.ChipsCheckbox=a;
2
2
  //# sourceMappingURL=ChipsCheckbox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipsCheckbox.cjs","names":[],"sources":["../../../src/components/Checkbox/ChipsCheckbox.tsx"],"sourcesContent":["import type { ChangeEvent, InputHTMLAttributes, MouseEventHandler, Ref } from \"react\";\nimport { CheckboxCheckIcon } from \"@/components/Icon\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\nexport interface ChipsCheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"onClick\"> {\n ref?: Ref<HTMLInputElement>;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */\n onCheckedChange?: (checked: boolean) => void;\n /** 바깥 `<label>`(칩 전체) 클릭 핸들러. 안쪽 input의 클릭은 label로 전파되지 않는다. */\n onClick?: MouseEventHandler<HTMLLabelElement>;\n}\n\n/**\n * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.\n *\n * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.\n * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.\n * `className`은 바깥 `<label>`에, 그 외 input 속성은 안쪽 input에 적용된다.\n *\n * @example\n * ```tsx\n * import { ChipsCheckbox } from \"@aivex/ui\";\n *\n * <ChipsCheckbox aria-label=\"행 선택\" checked={selected} onCheckedChange={setSelected} />\n * ```\n */\nfunction ChipsCheckbox({\n className,\n disabled,\n checked,\n defaultChecked,\n onCheckedChange,\n onChange,\n onClick,\n id,\n ref,\n ...props\n}: ChipsCheckboxProps) {\n const [resolvedChecked, setChecked] = useControllableState({\n value: checked,\n defaultValue: Boolean(defaultChecked),\n onChange: onCheckedChange,\n });\n const currentChecked = Boolean(resolvedChecked);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChecked(event.target.checked);\n onChange?.(event);\n };\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: 키보드는 안쪽 checkbox input이 받는다\n <label\n onClick={onClick}\n className={cn(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center\",\n \"aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors\",\n currentChecked\n ? \"aivex:bg-bg-brand-subtle aivex:border-border-brand-subtle\"\n : \"aivex:bg-bg-tertiary aivex:border-border-default\",\n disabled && \"aivex:opacity-disable aivex:pointer-events-none\",\n className,\n )}\n >\n <InteractionLayer />\n <input\n ref={ref}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n checked={currentChecked}\n onChange={handleChange}\n onClick={(e) => e.stopPropagation()}\n className=\"aivex:sr-only\"\n {...props}\n />\n <span className=\"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0\">\n <span\n className={cn(\n \"aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors\",\n currentChecked\n ? \"aivex:bg-bg-brand aivex:border-transparent\"\n : \"aivex:bg-bg-primary aivex:border-border-default\",\n )}\n />\n {currentChecked && (\n <span className=\"aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n <CheckboxCheckIcon size=\"sm\" />\n </span>\n )}\n </span>\n </label>\n );\n}\n\nexport { ChipsCheckbox };\n"],"mappings":"0QA6BA,SAAS,EAAc,CACrB,YACA,WACA,UACA,iBACA,kBACA,WACA,UACA,KACA,MACA,GAAG,GACkB,CACrB,GAAM,CAAC,EAAiB,GAAc,EAAA,qBAAqB,CACzD,MAAO,EACP,aAAc,EAAQ,EACtB,SAAU,EACX,CAAC,CACI,EAAiB,EAAQ,EAO/B,OAEE,EAAA,EAAA,MAAC,QAAD,CACW,UACT,UAAW,EAAA,GACT,6GACA,kIACA,EACI,4DACA,mDACJ,GAAY,kDACZ,EACD,UAVH,EAYE,EAAA,EAAA,KAAC,EAAA,iBAAD,EAAoB,CAAA,EACpB,EAAA,EAAA,KAAC,QAAD,CACO,MACD,KACJ,KAAK,WACK,WACV,QAAS,EACT,SA1BgB,GAAyC,CAC7D,EAAW,EAAM,OAAO,QAAQ,CAChC,IAAW,EAAM,EAyBb,QAAU,GAAM,EAAE,iBAAiB,CACnC,UAAU,gBACV,GAAI,EACJ,CAAA,EACF,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,uHAAhB,EACE,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,EAAA,GACT,4EACA,EACI,6CACA,kDACL,CACD,CAAA,CACD,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,+IACd,EAAA,EAAA,KAAC,EAAA,kBAAD,CAAmB,KAAK,KAAO,CAAA,CAC1B,CAAA,CAEJ,GACD"}
1
+ {"version":3,"file":"ChipsCheckbox.cjs","names":[],"sources":["../../../src/components/Checkbox/ChipsCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport type { Ref } from \"react\";\nimport { CheckboxCheckIcon } from \"@/components/Icon\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\n\ntype CheckboxRootProps = CheckboxPrimitive.Root.Props;\n\nexport interface ChipsCheckboxProps\n extends Omit<\n CheckboxRootProps,\n | \"className\"\n | \"style\"\n | \"onCheckedChange\"\n | \"render\"\n | \"nativeButton\"\n | \"parent\"\n | \"indeterminate\"\n | \"children\"\n > {\n className?: string;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */\n onCheckedChange?: (checked: boolean) => void;\n /** 칩(`role=\"checkbox\"`) 요소 ref */\n ref?: Ref<HTMLElement>;\n}\n\n/**\n * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.\n *\n * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.\n * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.\n * 칩 전체가 체크박스라 `className`·`onClick` 등은 칩에 적용되고, 폼 제출용 숨은 input은 `inputRef`로 접근한다.\n *\n * @example\n * ```tsx\n * import { ChipsCheckbox } from \"@aivex/ui\";\n *\n * <ChipsCheckbox aria-label=\"행 선택\" checked={selected} onCheckedChange={setSelected} />\n * ```\n */\nfunction ChipsCheckbox({ className, onCheckedChange, ref, ...props }: ChipsCheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n onCheckedChange={onCheckedChange ? (checked) => onCheckedChange(checked) : undefined}\n className={cn(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center\",\n \"aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors aivex:outline-none\",\n \"aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand\",\n \"aivex:bg-bg-tertiary aivex:border-border-default\",\n \"aivex:data-[checked]:bg-bg-brand-subtle aivex:data-[checked]:border-border-brand-subtle\",\n \"aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none\",\n className,\n )}\n {...props}\n >\n <InteractionLayer />\n <span className=\"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0\">\n <span className=\"aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors aivex:bg-bg-primary aivex:border-border-default aivex:group-data-[checked]:bg-bg-brand aivex:group-data-[checked]:border-transparent\" />\n <CheckboxPrimitive.Indicator className=\"aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n <CheckboxCheckIcon size=\"sm\" />\n </CheckboxPrimitive.Indicator>\n </span>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { ChipsCheckbox };\n"],"mappings":"0QA2CA,SAAS,EAAc,CAAE,YAAW,kBAAiB,MAAK,GAAG,GAA6B,CACxF,OACE,EAAA,EAAA,MAAC,EAAA,SAAkB,KAAnB,CACO,MACL,gBAAiB,EAAmB,GAAY,EAAgB,EAAQ,CAAG,IAAA,GAC3E,UAAW,EAAA,GACT,6GACA,qJACA,mEACA,mDACA,0FACA,kFACA,EACD,CACD,GAAI,WAZN,EAcE,EAAA,EAAA,KAAC,EAAA,iBAAD,EAAoB,CAAA,EACpB,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,uHAAhB,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iNAAmN,CAAA,EACnO,EAAA,EAAA,KAAC,EAAA,SAAkB,UAAnB,CAA6B,UAAU,+IACrC,EAAA,EAAA,KAAC,EAAA,kBAAD,CAAmB,KAAK,KAAO,CAAA,CACH,CAAA,CACzB,GACgB"}
@@ -1,17 +1,19 @@
1
- import type { InputHTMLAttributes, MouseEventHandler, Ref } from "react";
2
- export interface ChipsCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onClick"> {
3
- ref?: Ref<HTMLInputElement>;
4
- /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ import type { Ref } from "react";
3
+ type CheckboxRootProps = CheckboxPrimitive.Root.Props;
4
+ export interface ChipsCheckboxProps extends Omit<CheckboxRootProps, "className" | "style" | "onCheckedChange" | "render" | "nativeButton" | "parent" | "indeterminate" | "children"> {
5
+ className?: string;
6
+ /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */
5
7
  onCheckedChange?: (checked: boolean) => void;
6
- /** 바깥 `<label>`(칩 전체) 클릭 핸들러. 안쪽 input의 클릭은 label로 전파되지 않는다. */
7
- onClick?: MouseEventHandler<HTMLLabelElement>;
8
+ /** 칩(`role="checkbox"`) 요소 ref */
9
+ ref?: Ref<HTMLElement>;
8
10
  }
9
11
  /**
10
12
  * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.
11
13
  *
12
14
  * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.
13
15
  * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.
14
- * `className`은 바깥 `<label>`에, 그 외 input 속성은 안쪽 input에 적용된다.
16
+ * 칩 전체가 체크박스라 `className`·`onClick` 등은 칩에 적용되고, 폼 제출용 숨은 input은 `inputRef`로 접근한다.
15
17
  *
16
18
  * @example
17
19
  * ```tsx
@@ -20,5 +22,5 @@ export interface ChipsCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputEl
20
22
  * <ChipsCheckbox aria-label="행 선택" checked={selected} onCheckedChange={setSelected} />
21
23
  * ```
22
24
  */
23
- declare function ChipsCheckbox({ className, disabled, checked, defaultChecked, onCheckedChange, onChange, onClick, id, ref, ...props }: ChipsCheckboxProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function ChipsCheckbox({ className, onCheckedChange, ref, ...props }: ChipsCheckboxProps): import("react/jsx-runtime").JSX.Element;
24
26
  export { ChipsCheckbox };
@@ -1,17 +1,19 @@
1
- import type { InputHTMLAttributes, MouseEventHandler, Ref } from "react";
2
- export interface ChipsCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onClick"> {
3
- ref?: Ref<HTMLInputElement>;
4
- /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ import type { Ref } from "react";
3
+ type CheckboxRootProps = CheckboxPrimitive.Root.Props;
4
+ export interface ChipsCheckboxProps extends Omit<CheckboxRootProps, "className" | "style" | "onCheckedChange" | "render" | "nativeButton" | "parent" | "indeterminate" | "children"> {
5
+ className?: string;
6
+ /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */
5
7
  onCheckedChange?: (checked: boolean) => void;
6
- /** 바깥 `<label>`(칩 전체) 클릭 핸들러. 안쪽 input의 클릭은 label로 전파되지 않는다. */
7
- onClick?: MouseEventHandler<HTMLLabelElement>;
8
+ /** 칩(`role="checkbox"`) 요소 ref */
9
+ ref?: Ref<HTMLElement>;
8
10
  }
9
11
  /**
10
12
  * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.
11
13
  *
12
14
  * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.
13
15
  * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.
14
- * `className`은 바깥 `<label>`에, 그 외 input 속성은 안쪽 input에 적용된다.
16
+ * 칩 전체가 체크박스라 `className`·`onClick` 등은 칩에 적용되고, 폼 제출용 숨은 input은 `inputRef`로 접근한다.
15
17
  *
16
18
  * @example
17
19
  * ```tsx
@@ -20,5 +22,5 @@ export interface ChipsCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputEl
20
22
  * <ChipsCheckbox aria-label="행 선택" checked={selected} onCheckedChange={setSelected} />
21
23
  * ```
22
24
  */
23
- declare function ChipsCheckbox({ className, disabled, checked, defaultChecked, onCheckedChange, onChange, onClick, id, ref, ...props }: ChipsCheckboxProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function ChipsCheckbox({ className, onCheckedChange, ref, ...props }: ChipsCheckboxProps): import("react/jsx-runtime").JSX.Element;
24
26
  export { ChipsCheckbox };
@@ -1,42 +1,24 @@
1
1
  "use client";
2
- import { cn as e } from "../../utils.js";
3
- import { InteractionLayer as t } from "../InteractionLayer/InteractionLayer.js";
4
- import { CheckboxCheckIcon as n } from "../Icon/index.js";
5
- import { useControllableState as r } from "../../utils/useControllableState.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ "use client";
3
+ import { CheckboxCheckIcon as e } from "../Icon/index.js";
4
+ import { cn as t } from "../../utils.js";
5
+ import { InteractionLayer as n } from "../InteractionLayer/InteractionLayer.js";
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
7
+ import { Checkbox as a } from "@base-ui/react/checkbox";
7
8
  //#region src/components/Checkbox/ChipsCheckbox.tsx
8
- function o({ className: o, disabled: s, checked: c, defaultChecked: l, onCheckedChange: u, onChange: d, onClick: f, id: p, ref: m, ...h }) {
9
- let [g, _] = r({
10
- value: c,
11
- defaultValue: !!l,
12
- onChange: u
13
- }), v = !!g;
14
- return /* @__PURE__ */ a("label", {
15
- onClick: f,
16
- className: e("aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center", "aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors", v ? "aivex:bg-bg-brand-subtle aivex:border-border-brand-subtle" : "aivex:bg-bg-tertiary aivex:border-border-default", s && "aivex:opacity-disable aivex:pointer-events-none", o),
17
- children: [
18
- /* @__PURE__ */ i(t, {}),
19
- /* @__PURE__ */ i("input", {
20
- ref: m,
21
- id: p,
22
- type: "checkbox",
23
- disabled: s,
24
- checked: v,
25
- onChange: (e) => {
26
- _(e.target.checked), d?.(e);
27
- },
28
- onClick: (e) => e.stopPropagation(),
29
- className: "aivex:sr-only",
30
- ...h
31
- }),
32
- /* @__PURE__ */ a("span", {
33
- className: "aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0",
34
- children: [/* @__PURE__ */ i("span", { className: e("aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors", v ? "aivex:bg-bg-brand aivex:border-transparent" : "aivex:bg-bg-primary aivex:border-border-default") }), v && /* @__PURE__ */ i("span", {
35
- className: "aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none",
36
- children: /* @__PURE__ */ i(n, { size: "sm" })
37
- })]
38
- })
39
- ]
9
+ function o({ className: o, onCheckedChange: s, ref: c, ...l }) {
10
+ return /* @__PURE__ */ i(a.Root, {
11
+ ref: c,
12
+ onCheckedChange: s ? (e) => s(e) : void 0,
13
+ className: t("aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center", "aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors aivex:outline-none", "aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand", "aivex:bg-bg-tertiary aivex:border-border-default", "aivex:data-[checked]:bg-bg-brand-subtle aivex:data-[checked]:border-border-brand-subtle", "aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none", o),
14
+ ...l,
15
+ children: [/* @__PURE__ */ r(n, {}), /* @__PURE__ */ i("span", {
16
+ className: "aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0",
17
+ children: [/* @__PURE__ */ r("span", { className: "aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors aivex:bg-bg-primary aivex:border-border-default aivex:group-data-[checked]:bg-bg-brand aivex:group-data-[checked]:border-transparent" }), /* @__PURE__ */ r(a.Indicator, {
18
+ className: "aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none",
19
+ children: /* @__PURE__ */ r(e, { size: "sm" })
20
+ })]
21
+ })]
40
22
  });
41
23
  }
42
24
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ChipsCheckbox.js","names":[],"sources":["../../../src/components/Checkbox/ChipsCheckbox.tsx"],"sourcesContent":["import type { ChangeEvent, InputHTMLAttributes, MouseEventHandler, Ref } from \"react\";\nimport { CheckboxCheckIcon } from \"@/components/Icon\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\nimport { useControllableState } from \"@/utils/useControllableState\";\n\nexport interface ChipsCheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"onClick\"> {\n ref?: Ref<HTMLInputElement>;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. (네이티브 이벤트는 `onChange`) */\n onCheckedChange?: (checked: boolean) => void;\n /** 바깥 `<label>`(칩 전체) 클릭 핸들러. 안쪽 input의 클릭은 label로 전파되지 않는다. */\n onClick?: MouseEventHandler<HTMLLabelElement>;\n}\n\n/**\n * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.\n *\n * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.\n * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.\n * `className`은 바깥 `<label>`에, 그 외 input 속성은 안쪽 input에 적용된다.\n *\n * @example\n * ```tsx\n * import { ChipsCheckbox } from \"@aivex/ui\";\n *\n * <ChipsCheckbox aria-label=\"행 선택\" checked={selected} onCheckedChange={setSelected} />\n * ```\n */\nfunction ChipsCheckbox({\n className,\n disabled,\n checked,\n defaultChecked,\n onCheckedChange,\n onChange,\n onClick,\n id,\n ref,\n ...props\n}: ChipsCheckboxProps) {\n const [resolvedChecked, setChecked] = useControllableState({\n value: checked,\n defaultValue: Boolean(defaultChecked),\n onChange: onCheckedChange,\n });\n const currentChecked = Boolean(resolvedChecked);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setChecked(event.target.checked);\n onChange?.(event);\n };\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: 키보드는 안쪽 checkbox input이 받는다\n <label\n onClick={onClick}\n className={cn(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center\",\n \"aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors\",\n currentChecked\n ? \"aivex:bg-bg-brand-subtle aivex:border-border-brand-subtle\"\n : \"aivex:bg-bg-tertiary aivex:border-border-default\",\n disabled && \"aivex:opacity-disable aivex:pointer-events-none\",\n className,\n )}\n >\n <InteractionLayer />\n <input\n ref={ref}\n id={id}\n type=\"checkbox\"\n disabled={disabled}\n checked={currentChecked}\n onChange={handleChange}\n onClick={(e) => e.stopPropagation()}\n className=\"aivex:sr-only\"\n {...props}\n />\n <span className=\"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0\">\n <span\n className={cn(\n \"aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors\",\n currentChecked\n ? \"aivex:bg-bg-brand aivex:border-transparent\"\n : \"aivex:bg-bg-primary aivex:border-border-default\",\n )}\n />\n {currentChecked && (\n <span className=\"aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n <CheckboxCheckIcon size=\"sm\" />\n </span>\n )}\n </span>\n </label>\n );\n}\n\nexport { ChipsCheckbox };\n"],"mappings":";;;;;;;AA6BA,SAAS,EAAc,EACrB,cACA,aACA,YACA,mBACA,oBACA,aACA,YACA,OACA,QACA,GAAG,KACkB;CACrB,IAAM,CAAC,GAAiB,KAAc,EAAqB;EACzD,OAAO;EACP,cAAc,EAAQ;EACtB,UAAU;EACX,CAAC,EACI,IAAiB,EAAQ;AAO/B,QAEE,kBAAC,SAAD;EACW;EACT,WAAW,EACT,8GACA,mIACA,IACI,8DACA,oDACJ,KAAY,mDACZ,EACD;YAVH;GAYE,kBAAC,GAAD,EAAoB,CAAA;GACpB,kBAAC,SAAD;IACO;IACD;IACJ,MAAK;IACK;IACV,SAAS;IACT,WA1BgB,MAAyC;AAE7D,KADA,EAAW,EAAM,OAAO,QAAQ,EAChC,IAAW,EAAM;;IAyBb,UAAU,MAAM,EAAE,iBAAiB;IACnC,WAAU;IACV,GAAI;IACJ,CAAA;GACF,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,kBAAC,QAAD,EACE,WAAW,EACT,6EACA,IACI,+CACA,kDACL,EACD,CAAA,EACD,KACC,kBAAC,QAAD;KAAM,WAAU;eACd,kBAAC,GAAD,EAAmB,MAAK,MAAO,CAAA;KAC1B,CAAA,CAEJ;;GACD"}
1
+ {"version":3,"file":"ChipsCheckbox.js","names":[],"sources":["../../../src/components/Checkbox/ChipsCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport type { Ref } from \"react\";\nimport { CheckboxCheckIcon } from \"@/components/Icon\";\nimport { InteractionLayer } from \"@/components/InteractionLayer\";\nimport { cn } from \"@/utils/cn\";\n\ntype CheckboxRootProps = CheckboxPrimitive.Root.Props;\n\nexport interface ChipsCheckboxProps\n extends Omit<\n CheckboxRootProps,\n | \"className\"\n | \"style\"\n | \"onCheckedChange\"\n | \"render\"\n | \"nativeButton\"\n | \"parent\"\n | \"indeterminate\"\n | \"children\"\n > {\n className?: string;\n /** 체크 상태가 바뀔 때 새 checked 값으로 호출된다. */\n onCheckedChange?: (checked: boolean) => void;\n /** 칩(`role=\"checkbox\"`) 요소 ref */\n ref?: Ref<HTMLElement>;\n}\n\n/**\n * 32×32 칩 모양 배경 안에 체크박스를 담은 정사각형 선택 컨트롤.\n *\n * 체크 시 칩 배경·테두리가 brand-subtle로 바뀐다. 텍스트 라벨이 없으므로 `aria-label`을 반드시 준다.\n * 일반 폼의 체크박스는 `Checkbox`를 쓴다. `checked`(+`onCheckedChange`) 제어형, `defaultChecked` 비제어형 모두 지원한다.\n * 칩 전체가 체크박스라 `className`·`onClick` 등은 칩에 적용되고, 폼 제출용 숨은 input은 `inputRef`로 접근한다.\n *\n * @example\n * ```tsx\n * import { ChipsCheckbox } from \"@aivex/ui\";\n *\n * <ChipsCheckbox aria-label=\"행 선택\" checked={selected} onCheckedChange={setSelected} />\n * ```\n */\nfunction ChipsCheckbox({ className, onCheckedChange, ref, ...props }: ChipsCheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n onCheckedChange={onCheckedChange ? (checked) => onCheckedChange(checked) : undefined}\n className={cn(\n \"aivex:relative aivex:overflow-hidden aivex:group aivex:inline-flex aivex:items-center aivex:justify-center\",\n \"aivex:h-8 aivex:w-8 aivex:shrink-0 aivex:rounded-lg aivex:border aivex:cursor-pointer aivex:select-none aivex:transition-colors aivex:outline-none\",\n \"aivex:focus-visible:ring-2 aivex:focus-visible:ring-border-brand\",\n \"aivex:bg-bg-tertiary aivex:border-border-default\",\n \"aivex:data-[checked]:bg-bg-brand-subtle aivex:data-[checked]:border-border-brand-subtle\",\n \"aivex:data-[disabled]:opacity-disable aivex:data-[disabled]:pointer-events-none\",\n className,\n )}\n {...props}\n >\n <InteractionLayer />\n <span className=\"aivex:relative aivex:inline-flex aivex:items-center aivex:justify-center aivex:w-5 aivex:h-5 aivex:shrink-0\">\n <span className=\"aivex:w-4 aivex:h-4 aivex:rounded-xs aivex:border aivex:transition-colors aivex:bg-bg-primary aivex:border-border-default aivex:group-data-[checked]:bg-bg-brand aivex:group-data-[checked]:border-transparent\" />\n <CheckboxPrimitive.Indicator className=\"aivex:absolute aivex:inset-0 aivex:flex aivex:items-center aivex:justify-center aivex:text-icon-on-color aivex:pointer-events-none\">\n <CheckboxCheckIcon size=\"sm\" />\n </CheckboxPrimitive.Indicator>\n </span>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { ChipsCheckbox };\n"],"mappings":";;;;;;;;AA2CA,SAAS,EAAc,EAAE,cAAW,oBAAiB,QAAK,GAAG,KAA6B;AACxF,QACE,kBAAC,EAAkB,MAAnB;EACO;EACL,iBAAiB,KAAmB,MAAY,EAAgB,EAAQ,GAAG,KAAA;EAC3E,WAAW,EACT,8GACA,sJACA,oEACA,oDACA,2FACA,mFACA,EACD;EACD,GAAI;YAZN,CAcE,kBAAC,GAAD,EAAoB,CAAA,EACpB,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACE,kBAAC,QAAD,EAAM,WAAU,kNAAmN,CAAA,EACnO,kBAAC,EAAkB,WAAnB;IAA6B,WAAU;cACrC,kBAAC,GAAD,EAAmB,MAAK,MAAO,CAAA;IACH,CAAA,CACzB;KACgB"}
@@ -1,2 +1,2 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils.cjs`),n=require(`../Icon/index.cjs`),r=require(`../Button/Button.cjs`),i=require(`../IconButton/IconButton.cjs`),a=require(`../Popover/Popover.cjs`);let o=require(`react/jsx-runtime`),s=require(`@radix-ui/react-popover`);s=e.__toESM(s,1);var c=t.cn(a.popoverContentBaseClassName,`aivex:w-[280px] aivex:bg-static-gray aivex:text-text-on-color`);function l({button:e,variant:n,className:i}){let{children:a,...s}=e;return(0,o.jsx)(r.Button,{variant:n,color:`primary`,size:`md`,className:t.cn(`aivex:text-text-on-color`,i),...s,children:a})}function u(e){return(0,o.jsx)(s.Root,{...e})}function d({ref:e,...t}){return(0,o.jsx)(s.Trigger,{ref:e,...t})}function f(e){return(0,o.jsx)(s.Anchor,{...e})}function p({className:e,sideOffset:r=8,title:a,children:u,tertiaryButton:d,secondaryButton:f,primaryButton:p,onClose:m,closeAriaLabel:h=`닫기`,container:g,ref:_,...v}){let y=!!(d||f||p);return(0,o.jsx)(s.Portal,{container:g,children:(0,o.jsxs)(s.Content,{ref:_,sideOffset:r,onOpenAutoFocus:e=>e.preventDefault(),className:t.cn(c,e),...v,children:[(a!=null||m!=null)&&(0,o.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:gap-2.5 aivex:px-xs`,children:[(0,o.jsx)(`div`,{className:`aivex:min-w-0 aivex:flex-1 aivex:truncate aivex:text-label-lg`,children:a}),m!=null&&(0,o.jsx)(i.IconButton,{"aria-label":h,color:`white`,size:`xs`,onClick:m,children:(0,o.jsx)(n.CloseIcon,{size:20})})]}),(0,o.jsx)(`div`,{className:`aivex:flex aivex:max-h-[200px] aivex:min-h-[40px] aivex:w-full aivex:flex-col aivex:gap-md aivex:overflow-y-auto aivex:text-body-md-regular`,children:u}),y&&(0,o.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md`,children:[(0,o.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-start`,children:d&&(0,o.jsx)(l,{button:d,variant:`ghost`,className:`aivex:min-w-9`})}),(0,o.jsxs)(`div`,{className:`aivex:flex aivex:items-start aivex:gap-md`,children:[f&&(0,o.jsx)(l,{button:f,variant:`ghost`,className:`aivex:min-w-[60px]`}),p&&(0,o.jsx)(l,{button:p,variant:`solid`,className:`aivex:min-w-[60px]`})]})]}),(0,o.jsx)(s.Arrow,{width:20,height:10,className:`aivex:fill-static-gray`})]})})}var m=Object.assign(u,{Trigger:d,Anchor:f,Content:p});exports.Coachmark=m;
1
+ "use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../Icon/index.cjs`),t=require(`../../utils.cjs`),n=require(`../../utils/PortalEventBoundary.cjs`),r=require(`../../utils/popupArrow.cjs`),i=require(`../../utils/popupPositioning.cjs`),a=require(`../Button/Button.cjs`),o=require(`../IconButton/IconButton.cjs`),s=require(`../Popover/Popover.cjs`);let c=require(`react/jsx-runtime`),l=require(`@base-ui/react/popover`);var u=20,d=10,f=t.cn(s.popoverContentBaseClassName,`aivex:w-[280px] aivex:bg-static-gray aivex:text-text-on-color`);function p({button:e,variant:n,className:r}){let{children:i,...o}=e;return(0,c.jsx)(a.Button,{variant:n,color:`primary`,size:`md`,className:t.cn(`aivex:text-text-on-color`,r),...o,children:i})}function m(e){return(0,c.jsx)(l.Popover.Root,{...e})}function h({ref:e,...t}){return(0,c.jsx)(l.Popover.Trigger,{ref:e,...t})}function g({className:a,title:m,children:h,tertiaryButton:g,secondaryButton:_,primaryButton:v,onClose:y,closeAriaLabel:b=`닫기`,container:x,keepMounted:S,ref:C,...w}){let[{sideOffset:T=8,...E},D]=i.splitPositioningProps(w),O=!!(g||_||v);return(0,c.jsx)(n.PortalEventBoundary,{children:(0,c.jsx)(l.Popover.Portal,{container:x,keepMounted:S,children:(0,c.jsx)(l.Popover.Positioner,{sideOffset:typeof T==`number`?T+d:e=>T(e)+d,className:s.popoverPositionerClassName,...E,children:(0,c.jsxs)(l.Popover.Popup,{ref:C,initialFocus:!1,className:t.cn(f,a),...D,children:[(m!=null||y!=null)&&(0,c.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:gap-2.5 aivex:px-xs`,children:[(0,c.jsx)(`div`,{className:`aivex:min-w-0 aivex:flex-1 aivex:truncate aivex:text-label-lg`,children:m}),y!=null&&(0,c.jsx)(o.IconButton,{"aria-label":b,color:`white`,size:`xs`,onClick:y,children:(0,c.jsx)(e.CloseIcon,{size:20})})]}),(0,c.jsx)(`div`,{className:`aivex:flex aivex:max-h-[200px] aivex:min-h-[40px] aivex:w-full aivex:flex-col aivex:gap-md aivex:overflow-y-auto aivex:text-body-md-regular`,children:h}),O&&(0,c.jsxs)(`div`,{className:`aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md`,children:[(0,c.jsx)(`div`,{className:`aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-start`,children:g&&(0,c.jsx)(p,{button:g,variant:`ghost`,className:`aivex:min-w-9`})}),(0,c.jsxs)(`div`,{className:`aivex:flex aivex:items-start aivex:gap-md`,children:[_&&(0,c.jsx)(p,{button:_,variant:`ghost`,className:`aivex:min-w-[60px]`}),v&&(0,c.jsx)(p,{button:v,variant:`solid`,className:`aivex:min-w-[60px]`})]})]}),(0,c.jsx)(l.Popover.Arrow,{className:r.popupArrowClassName,style:r.popupArrowStyle(u,d),children:(0,c.jsx)(r.PopupArrowShape,{width:u,height:d,className:`aivex:fill-static-gray`})})]})})})})}var _=Object.assign(m,{Trigger:h,Content:g});exports.Coachmark=_;
2
2
  //# sourceMappingURL=Coachmark.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Coachmark.cjs","names":[],"sources":["../../../src/components/Coachmark/Coachmark.tsx"],"sourcesContent":["\"use client\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport { popoverContentBaseClassName } from \"@/components/Popover/Popover\";\nimport { cn } from \"@/utils/cn\";\nimport type { DataAttributes } from \"@/utils/dataAttributes\";\n\n// 진한 배경(static-gray) 위 코치마크 콘텐츠. Radix가 side/충돌 회피/화살표 위치를 처리한다.\n// 폭 280px은 Figma Popover-Bubble(3848:11976) 사양이다(Popover-Dropdown은 277px).\nconst contentClassName = cn(\n popoverContentBaseClassName,\n \"aivex:w-[280px] aivex:bg-static-gray aivex:text-text-on-color\",\n);\n\n/** 버튼은 라벨을 children으로 받고, 스타일(variant/color/size)은 Coachmark가 고정한다. */\nexport interface CoachmarkButtonProps\n extends Omit<\n ButtonProps,\n \"asChild\" | \"children\" | \"className\" | \"color\" | \"ref\" | \"size\" | \"style\" | \"variant\"\n >,\n DataAttributes {\n /** 버튼 라벨 */\n children: ReactNode;\n}\n\nfunction CoachmarkActionButton({\n button,\n variant,\n className,\n}: {\n button: CoachmarkButtonProps;\n variant: ButtonProps[\"variant\"];\n className?: string;\n}) {\n const { children, ...props } = button;\n\n return (\n <Button\n variant={variant}\n color=\"primary\"\n size=\"md\"\n // 진한 배경 위라 세 버튼 모두 text/on-color(흰색)다. ghost의 기본 브랜드색을 덮는다.\n className={cn(\"aivex:text-text-on-color\", className)}\n {...props}\n >\n {children}\n </Button>\n );\n}\n\n// ─── Root ───────────────────────────────────────────────────────────────────\n/** Coachmark 루트 props (Radix `Popover.Root`와 동일: `open`·`defaultOpen`·`onOpenChange`·`modal`). */\ntype CoachmarkRootProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;\n\n/** 코치마크의 열림 상태를 관리하는 루트(Radix Popover.Root). */\nfunction CoachmarkRoot(props: CoachmarkRootProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\n// ─── Trigger / Anchor ────────────────────────────────────────────────────────\n/** Coachmark.Trigger props (Radix `Popover.Trigger`와 동일). */\ntype CoachmarkTriggerProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** 클릭하면 코치마크를 여닫는 기준 요소. asChild로 임의 요소를 감싼다. */\nfunction CoachmarkTrigger({ ref, ...props }: CoachmarkTriggerProps) {\n return <PopoverPrimitive.Trigger ref={ref} {...props} />;\n}\n\n/** Coachmark.Anchor props (Radix `Popover.Anchor`와 동일). */\ntype CoachmarkAnchorProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;\n\n/** 클릭 트리거 없이 특정 요소를 기준점으로만 쓸 때 사용한다. */\nfunction CoachmarkAnchor(props: CoachmarkAnchorProps) {\n return <PopoverPrimitive.Anchor {...props} />;\n}\n\n// ─── Content ─────────────────────────────────────────────────────────────────\n/** Coachmark.Content props. `side`·`align`·`sideOffset` 등 Radix `Popover.Content` 위치 props도 받는다. */\ninterface CoachmarkContentProps\n extends Omit<ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, \"children\" | \"title\"> {\n /** 상단 타이틀. 생략하면 타이틀 영역을 렌더하지 않는다. */\n title?: ReactNode;\n /** 본문(텍스트·이미지 등, min 40 / max 200px, 초과 시 스크롤). */\n children?: ReactNode;\n /** 좌측 하단 보조 버튼(예: 넘기기). */\n tertiaryButton?: CoachmarkButtonProps;\n /** 우측 보조 버튼(예: 이전). */\n secondaryButton?: CoachmarkButtonProps;\n /** 우측 주요 버튼(예: 다음). */\n primaryButton?: CoachmarkButtonProps;\n /** 지정하면 타이틀 우측에 닫기(X) 버튼을 렌더한다. */\n onClose?: () => void;\n /** 포털 대상. 생략하면 document.body — Shadow DOM 안에서는 그 루트 안의 요소를 넘긴다. */\n container?: ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>[\"container\"];\n /**\n * 닫기 버튼 aria-label\n * @default \"닫기\"\n */\n closeAriaLabel?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 진한 배경의 말풍선 본체. 포털로 렌더링되고 열릴 때 포커스를 가져가지 않는다.\n * `sideOffset` 기본값은 8이다.\n */\nfunction CoachmarkContent({\n className,\n sideOffset = 8,\n title,\n children,\n tertiaryButton,\n secondaryButton,\n primaryButton,\n onClose,\n closeAriaLabel = \"닫기\",\n container,\n ref,\n ...props\n}: CoachmarkContentProps) {\n const hasBtnArea = Boolean(tertiaryButton || secondaryButton || primaryButton);\n\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n // 코치마크는 페이지 흐름을 방해하지 않도록 열릴 때 포커스를 뺏지 않는다.\n onOpenAutoFocus={(event) => event.preventDefault()}\n className={cn(contentClassName, className)}\n {...props}\n >\n {(title != null || onClose != null) && (\n <div className=\"aivex:flex aivex:w-full aivex:items-center aivex:gap-2.5 aivex:px-xs\">\n <div className=\"aivex:min-w-0 aivex:flex-1 aivex:truncate aivex:text-label-lg\">\n {title}\n </div>\n {onClose != null && (\n <IconButton aria-label={closeAriaLabel} color=\"white\" size=\"xs\" onClick={onClose}>\n <CloseIcon size={20} />\n </IconButton>\n )}\n </div>\n )}\n\n <div className=\"aivex:flex aivex:max-h-[200px] aivex:min-h-[40px] aivex:w-full aivex:flex-col aivex:gap-md aivex:overflow-y-auto aivex:text-body-md-regular\">\n {children}\n </div>\n\n {hasBtnArea && (\n <div className=\"aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md\">\n <div className=\"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-start\">\n {tertiaryButton && (\n <CoachmarkActionButton\n button={tertiaryButton}\n variant=\"ghost\"\n className=\"aivex:min-w-9\"\n />\n )}\n </div>\n <div className=\"aivex:flex aivex:items-start aivex:gap-md\">\n {secondaryButton && (\n <CoachmarkActionButton\n button={secondaryButton}\n variant=\"ghost\"\n className=\"aivex:min-w-[60px]\"\n />\n )}\n {primaryButton && (\n <CoachmarkActionButton\n button={primaryButton}\n variant=\"solid\"\n className=\"aivex:min-w-[60px]\"\n />\n )}\n </div>\n </div>\n )}\n\n <PopoverPrimitive.Arrow width={20} height={10} className=\"aivex:fill-static-gray\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n}\n\n/**\n * 특정 요소를 가리키며 온보딩·기능 안내를 띄우는 진한 말풍선 코치마크.\n *\n * Figma Popover-Bubble(3848:11976). `@radix-ui/react-popover` 기반이라 side/정렬/충돌 회피/화살표 위치를 Radix가 처리한다.\n * 진한 배경 위에 타이틀·닫기·본문·버튼(넘기기/이전/다음)을 담는다. 일반 드롭다운·폼 팝업은 `Popover`, 짧은 hover 설명은 `Tooltip`을 쓴다.\n * 구성: `Coachmark`(루트, `open`/`onOpenChange`) > `Coachmark.Trigger` 또는 `Coachmark.Anchor`(asChild) + `Coachmark.Content`.\n * 바깥 클릭 등으로도 닫히므로 보통 `open`을 제어형으로 관리한다.\n *\n * @example\n * ```tsx\n * import { Button, Coachmark } from \"@aivex/ui\";\n *\n * const [open, setOpen] = useState(true);\n *\n * <Coachmark open={open} onOpenChange={setOpen}>\n * <Coachmark.Anchor asChild>\n * <Button variant=\"outline\" color=\"secondary\">새 기능</Button>\n * </Coachmark.Anchor>\n * <Coachmark.Content\n * side=\"bottom\"\n * title=\"새 기능 안내\"\n * onClose={() => setOpen(false)}\n * tertiaryButton={{ children: \"넘기기\", onClick: () => setOpen(false) }}\n * primaryButton={{ children: \"다음\", onClick: goNext }}\n * >\n * 여기서 데이터를 내보낼 수 있습니다.\n * </Coachmark.Content>\n * </Coachmark>\n * ```\n */\nconst Coachmark = Object.assign(CoachmarkRoot, {\n Trigger: CoachmarkTrigger,\n Anchor: CoachmarkAnchor,\n Content: CoachmarkContent,\n});\n\nexport type {\n CoachmarkAnchorProps,\n CoachmarkContentProps,\n CoachmarkRootProps,\n CoachmarkTriggerProps,\n};\nexport { Coachmark };\n"],"mappings":"uVAaA,IAAM,EAAmB,EAAA,GACvB,EAAA,4BACA,gEACD,CAaD,SAAS,EAAsB,CAC7B,SACA,UACA,aAKC,CACD,GAAM,CAAE,WAAU,GAAG,GAAU,EAE/B,OACE,EAAA,EAAA,KAAC,EAAA,OAAD,CACW,UACT,MAAM,UACN,KAAK,KAEL,UAAW,EAAA,GAAG,2BAA4B,EAAU,CACpD,GAAI,EAEH,WACM,CAAA,CASb,SAAS,EAAc,EAA2B,CAChD,OAAO,EAAA,EAAA,KAAC,EAAiB,KAAlB,CAAuB,GAAI,EAAS,CAAA,CAU7C,SAAS,EAAiB,CAAE,MAAK,GAAG,GAAgC,CAClE,OAAO,EAAA,EAAA,KAAC,EAAiB,QAAlB,CAA+B,MAAK,GAAI,EAAS,CAAA,CAO1D,SAAS,EAAgB,EAA6B,CACpD,OAAO,EAAA,EAAA,KAAC,EAAiB,OAAlB,CAAyB,GAAI,EAAS,CAAA,CAiC/C,SAAS,EAAiB,CACxB,YACA,aAAa,EACb,QACA,WACA,iBACA,kBACA,gBACA,UACA,iBAAiB,KACjB,YACA,MACA,GAAG,GACqB,CACxB,IAAM,EAAa,GAAQ,GAAkB,GAAmB,GAEhE,OACE,EAAA,EAAA,KAAC,EAAiB,OAAlB,CAAoC,sBAClC,EAAA,EAAA,MAAC,EAAiB,QAAlB,CACO,MACO,aAEZ,gBAAkB,GAAU,EAAM,gBAAgB,CAClD,UAAW,EAAA,GAAG,EAAkB,EAAU,CAC1C,GAAI,WANN,EAQI,GAAS,MAAQ,GAAW,QAC5B,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gFAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,yEACZ,EACG,CAAA,CACL,GAAW,OACV,EAAA,EAAA,KAAC,EAAA,WAAD,CAAY,aAAY,EAAgB,MAAM,QAAQ,KAAK,KAAK,QAAS,YACvE,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,GAAM,CAAA,CACZ,CAAA,CAEX,IAGR,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8IACZ,WACG,CAAA,CAEL,IACC,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qFAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mEACZ,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,gBACV,CAAA,CAEA,CAAA,EACN,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qDAAf,CACG,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,qBACV,CAAA,CAEH,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,qBACV,CAAA,CAEA,GACF,IAGR,EAAA,EAAA,KAAC,EAAiB,MAAlB,CAAwB,MAAO,GAAI,OAAQ,GAAI,UAAU,yBAA2B,CAAA,CAC3D,GACH,CAAA,CAkC9B,IAAM,EAAY,OAAO,OAAO,EAAe,CAC7C,QAAS,EACT,OAAQ,EACR,QAAS,EACV,CAAC"}
1
+ {"version":3,"file":"Coachmark.cjs","names":[],"sources":["../../../src/components/Coachmark/Coachmark.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\";\nimport type { ReactNode, Ref } from \"react\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { CloseIcon } from \"@/components/Icon\";\nimport { IconButton } from \"@/components/IconButton\";\nimport {\n popoverContentBaseClassName,\n popoverPositionerClassName,\n} from \"@/components/Popover/Popover\";\nimport { cn } from \"@/utils/cn\";\nimport type { DataAttributes } from \"@/utils/dataAttributes\";\nimport { PortalEventBoundary } from \"@/utils/PortalEventBoundary\";\nimport { PopupArrowShape, popupArrowClassName, popupArrowStyle } from \"@/utils/popupArrow\";\nimport { type PopupPositioningProps, splitPositioningProps } from \"@/utils/popupPositioning\";\n\n// 화살표 크기(px). 말풍선은 화살표 끝이 기준 요소에서 sideOffset만큼 떨어지도록 그 길이만큼 더 띄운다.\nconst ARROW_WIDTH = 20;\nconst ARROW_HEIGHT = 10;\n\n// 진한 배경(static-gray) 위 코치마크 콘텐츠. side/충돌 회피/화살표 위치는 Positioner가 처리한다.\n// 폭 280px은 Figma Popover-Bubble(3848:11976) 사양이다(Popover-Dropdown은 277px).\nconst contentClassName = cn(\n popoverContentBaseClassName,\n \"aivex:w-[280px] aivex:bg-static-gray aivex:text-text-on-color\",\n);\n\n/** 버튼은 라벨을 children으로 받고, 스타일(variant/color/size)은 Coachmark가 고정한다. */\nexport interface CoachmarkButtonProps\n extends Omit<\n ButtonProps,\n \"children\" | \"className\" | \"color\" | \"ref\" | \"render\" | \"size\" | \"style\" | \"variant\"\n >,\n DataAttributes {\n /** 버튼 라벨 */\n children: ReactNode;\n}\n\nfunction CoachmarkActionButton({\n button,\n variant,\n className,\n}: {\n button: CoachmarkButtonProps;\n variant: ButtonProps[\"variant\"];\n className?: string;\n}) {\n const { children, ...props } = button;\n\n return (\n <Button\n variant={variant}\n color=\"primary\"\n size=\"md\"\n // 진한 배경 위라 세 버튼 모두 text/on-color(흰색)다. ghost의 기본 브랜드색을 덮는다.\n className={cn(\"aivex:text-text-on-color\", className)}\n {...props}\n >\n {children}\n </Button>\n );\n}\n\n// ─── Root ───────────────────────────────────────────────────────────────────\n/** Coachmark 루트 props: `open`·`defaultOpen`·`onOpenChange(open, details)`·`modal`. */\ntype CoachmarkRootProps = PopoverPrimitive.Root.Props;\n\n/** 코치마크의 열림 상태를 관리하는 루트. */\nfunction CoachmarkRoot(props: CoachmarkRootProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\n// ─── Trigger ─────────────────────────────────────────────────────────────────\n/** Coachmark.Trigger props — button 속성 + `render`. */\ntype CoachmarkTriggerProps = PopoverPrimitive.Trigger.Props & {\n ref?: Ref<HTMLButtonElement>;\n};\n\n/** 클릭하면 코치마크를 여닫는 기준 요소. `render`로 임의의 버튼을 넘긴다. */\nfunction CoachmarkTrigger({ ref, ...props }: CoachmarkTriggerProps) {\n return <PopoverPrimitive.Trigger ref={ref} {...props} />;\n}\n\n// ─── Content ─────────────────────────────────────────────────────────────────\n/** Coachmark.Content props. `side`·`align`·`sideOffset`·`anchor` 등 위치 props도 받는다. */\ninterface CoachmarkContentProps\n extends Omit<PopoverPrimitive.Popup.Props, \"children\" | \"className\" | \"title\">,\n PopupPositioningProps {\n className?: string;\n /** 상단 타이틀. 생략하면 타이틀 영역을 렌더하지 않는다. */\n title?: ReactNode;\n /** 본문(텍스트·이미지 등, min 40 / max 200px, 초과 시 스크롤). */\n children?: ReactNode;\n /** 좌측 하단 보조 버튼(예: 넘기기). */\n tertiaryButton?: CoachmarkButtonProps;\n /** 우측 보조 버튼(예: 이전). */\n secondaryButton?: CoachmarkButtonProps;\n /** 우측 주요 버튼(예: 다음). */\n primaryButton?: CoachmarkButtonProps;\n /** 지정하면 타이틀 우측에 닫기(X) 버튼을 렌더한다. */\n onClose?: () => void;\n /** 포털 대상. 생략하면 document.body — Shadow DOM 안에서는 그 루트 안의 요소를 넘긴다. */\n container?: PopoverPrimitive.Portal.Props[\"container\"];\n /**\n * 닫혀 있을 때도 DOM에 남겨 둔다.\n * @default false\n */\n keepMounted?: boolean;\n /**\n * 닫기 버튼 aria-label\n * @default \"닫기\"\n */\n closeAriaLabel?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * 진한 배경의 말풍선 본체. 포털로 렌더링되고 열릴 때 포커스를 가져가지 않는다.\n * `sideOffset` 기본값은 8(화살표 끝과 기준 요소 사이 간격)이다.\n * 클릭 트리거 없이 특정 요소만 가리키려면 `anchor`에 그 요소나 ref를 넘긴다.\n */\nfunction CoachmarkContent({\n className,\n title,\n children,\n tertiaryButton,\n secondaryButton,\n primaryButton,\n onClose,\n closeAriaLabel = \"닫기\",\n container,\n keepMounted,\n ref,\n ...props\n}: CoachmarkContentProps) {\n const [{ sideOffset = 8, ...positioning }, popupProps] = splitPositioningProps(props);\n const hasBtnArea = Boolean(tertiaryButton || secondaryButton || primaryButton);\n\n return (\n <PortalEventBoundary>\n <PopoverPrimitive.Portal container={container} keepMounted={keepMounted}>\n <PopoverPrimitive.Positioner\n sideOffset={\n typeof sideOffset === \"number\"\n ? sideOffset + ARROW_HEIGHT\n : (data) => sideOffset(data) + ARROW_HEIGHT\n }\n className={popoverPositionerClassName}\n {...positioning}\n >\n <PopoverPrimitive.Popup\n ref={ref}\n // 코치마크는 페이지 흐름을 방해하지 않도록 열릴 때 포커스를 뺏지 않는다.\n initialFocus={false}\n className={cn(contentClassName, className)}\n {...popupProps}\n >\n {(title != null || onClose != null) && (\n <div className=\"aivex:flex aivex:w-full aivex:items-center aivex:gap-2.5 aivex:px-xs\">\n <div className=\"aivex:min-w-0 aivex:flex-1 aivex:truncate aivex:text-label-lg\">\n {title}\n </div>\n {onClose != null && (\n <IconButton aria-label={closeAriaLabel} color=\"white\" size=\"xs\" onClick={onClose}>\n <CloseIcon size={20} />\n </IconButton>\n )}\n </div>\n )}\n\n <div className=\"aivex:flex aivex:max-h-[200px] aivex:min-h-[40px] aivex:w-full aivex:flex-col aivex:gap-md aivex:overflow-y-auto aivex:text-body-md-regular\">\n {children}\n </div>\n\n {hasBtnArea && (\n <div className=\"aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-md\">\n <div className=\"aivex:flex aivex:min-w-0 aivex:flex-1 aivex:items-start\">\n {tertiaryButton && (\n <CoachmarkActionButton\n button={tertiaryButton}\n variant=\"ghost\"\n className=\"aivex:min-w-9\"\n />\n )}\n </div>\n <div className=\"aivex:flex aivex:items-start aivex:gap-md\">\n {secondaryButton && (\n <CoachmarkActionButton\n button={secondaryButton}\n variant=\"ghost\"\n className=\"aivex:min-w-[60px]\"\n />\n )}\n {primaryButton && (\n <CoachmarkActionButton\n button={primaryButton}\n variant=\"solid\"\n className=\"aivex:min-w-[60px]\"\n />\n )}\n </div>\n </div>\n )}\n\n <PopoverPrimitive.Arrow\n className={popupArrowClassName}\n style={popupArrowStyle(ARROW_WIDTH, ARROW_HEIGHT)}\n >\n <PopupArrowShape\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n className=\"aivex:fill-static-gray\"\n />\n </PopoverPrimitive.Arrow>\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PortalEventBoundary>\n );\n}\n\n/**\n * 특정 요소를 가리키며 온보딩·기능 안내를 띄우는 진한 말풍선 코치마크.\n *\n * Figma Popover-Bubble(3848:11976). side/정렬/충돌 회피/화살표 위치는 자동으로 처리된다.\n * 진한 배경 위에 타이틀·닫기·본문·버튼(넘기기/이전/다음)을 담는다. 일반 드롭다운·폼 팝업은 `Popover`, 짧은 hover 설명은 `Tooltip`을 쓴다.\n * 구성: `Coachmark`(루트, `open`/`onOpenChange`) > `Coachmark.Trigger`(render) + `Coachmark.Content`.\n * 클릭 트리거 없이 가리키기만 하려면 Trigger를 빼고 `Coachmark.Content`의 `anchor`에 기준 요소(ref)를 넘긴다.\n * 바깥 클릭 등으로도 닫히므로 보통 `open`을 제어형으로 관리한다.\n *\n * @example\n * ```tsx\n * import { Button, Coachmark } from \"@aivex/ui\";\n *\n * const [open, setOpen] = useState(true);\n * const anchorRef = useRef<HTMLButtonElement>(null);\n *\n * <Button ref={anchorRef} variant=\"outline\" color=\"secondary\">새 기능</Button>\n * <Coachmark open={open} onOpenChange={setOpen}>\n * <Coachmark.Content\n * anchor={anchorRef}\n * side=\"bottom\"\n * title=\"새 기능 안내\"\n * onClose={() => setOpen(false)}\n * tertiaryButton={{ children: \"넘기기\", onClick: () => setOpen(false) }}\n * primaryButton={{ children: \"다음\", onClick: goNext }}\n * >\n * 여기서 데이터를 내보낼 수 있습니다.\n * </Coachmark.Content>\n * </Coachmark>\n * ```\n */\nconst Coachmark = Object.assign(CoachmarkRoot, {\n Trigger: CoachmarkTrigger,\n Content: CoachmarkContent,\n});\n\nexport type { CoachmarkContentProps, CoachmarkRootProps, CoachmarkTriggerProps };\nexport { Coachmark };\n"],"mappings":"0cAkBA,IAAM,EAAc,GACd,EAAe,GAIf,EAAmB,EAAA,GACvB,EAAA,4BACA,gEACD,CAaD,SAAS,EAAsB,CAC7B,SACA,UACA,aAKC,CACD,GAAM,CAAE,WAAU,GAAG,GAAU,EAE/B,OACE,EAAA,EAAA,KAAC,EAAA,OAAD,CACW,UACT,MAAM,UACN,KAAK,KAEL,UAAW,EAAA,GAAG,2BAA4B,EAAU,CACpD,GAAI,EAEH,WACM,CAAA,CASb,SAAS,EAAc,EAA2B,CAChD,OAAO,EAAA,EAAA,KAAC,EAAA,QAAiB,KAAlB,CAAuB,GAAI,EAAS,CAAA,CAU7C,SAAS,EAAiB,CAAE,MAAK,GAAG,GAAgC,CAClE,OAAO,EAAA,EAAA,KAAC,EAAA,QAAiB,QAAlB,CAA+B,MAAK,GAAI,EAAS,CAAA,CAyC1D,SAAS,EAAiB,CACxB,YACA,QACA,WACA,iBACA,kBACA,gBACA,UACA,iBAAiB,KACjB,YACA,cACA,MACA,GAAG,GACqB,CACxB,GAAM,CAAC,CAAE,aAAa,EAAG,GAAG,GAAe,GAAc,EAAA,sBAAsB,EAAM,CAC/E,EAAa,GAAQ,GAAkB,GAAmB,GAEhE,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,QAAiB,OAAlB,CAAoC,YAAwB,wBAC1D,EAAA,EAAA,KAAC,EAAA,QAAiB,WAAlB,CACE,WACE,OAAO,GAAe,SAClB,EAAa,EACZ,GAAS,EAAW,EAAK,CAAG,EAEnC,UAAW,EAAA,2BACX,GAAI,YAEJ,EAAA,EAAA,MAAC,EAAA,QAAiB,MAAlB,CACO,MAEL,aAAc,GACd,UAAW,EAAA,GAAG,EAAkB,EAAU,CAC1C,GAAI,WALN,EAOI,GAAS,MAAQ,GAAW,QAC5B,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gFAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,yEACZ,EACG,CAAA,CACL,GAAW,OACV,EAAA,EAAA,KAAC,EAAA,WAAD,CAAY,aAAY,EAAgB,MAAM,QAAQ,KAAK,KAAK,QAAS,YACvE,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,GAAM,CAAA,CACZ,CAAA,CAEX,IAGR,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8IACZ,WACG,CAAA,CAEL,IACC,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qFAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mEACZ,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,gBACV,CAAA,CAEA,CAAA,EACN,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qDAAf,CACG,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,qBACV,CAAA,CAEH,IACC,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,QAAQ,QACR,UAAU,qBACV,CAAA,CAEA,GACF,IAGR,EAAA,EAAA,KAAC,EAAA,QAAiB,MAAlB,CACE,UAAW,EAAA,oBACX,MAAO,EAAA,gBAAgB,EAAa,EAAa,WAEjD,EAAA,EAAA,KAAC,EAAA,gBAAD,CACE,MAAO,EACP,OAAQ,EACR,UAAU,yBACV,CAAA,CACqB,CAAA,CACF,GACG,CAAA,CACN,CAAA,CACN,CAAA,CAmC1B,IAAM,EAAY,OAAO,OAAO,EAAe,CAC7C,QAAS,EACT,QAAS,EACV,CAAC"}
@@ -1,28 +1,26 @@
1
- import * as PopoverPrimitive from "@radix-ui/react-popover";
2
- import type { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
1
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
2
+ import type { ReactNode, Ref } from "react";
3
3
  import { type ButtonProps } from "../Button/index.cjs";
4
4
  import type { DataAttributes } from "../../utils/dataAttributes.cjs";
5
+ import { type PopupPositioningProps } from "../../utils/popupPositioning.cjs";
5
6
  /** 버튼은 라벨을 children으로 받고, 스타일(variant/color/size)은 Coachmark가 고정한다. */
6
- export interface CoachmarkButtonProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant">, DataAttributes {
7
+ export interface CoachmarkButtonProps extends Omit<ButtonProps, "children" | "className" | "color" | "ref" | "render" | "size" | "style" | "variant">, DataAttributes {
7
8
  /** 버튼 라벨 */
8
9
  children: ReactNode;
9
10
  }
10
- /** Coachmark 루트 props (Radix `Popover.Root`와 동일: `open`·`defaultOpen`·`onOpenChange`·`modal`). */
11
- type CoachmarkRootProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;
12
- /** 코치마크의 열림 상태를 관리하는 루트(Radix Popover.Root). */
11
+ /** Coachmark 루트 props: `open`·`defaultOpen`·`onOpenChange(open, details)`·`modal`. */
12
+ type CoachmarkRootProps = PopoverPrimitive.Root.Props;
13
+ /** 코치마크의 열림 상태를 관리하는 루트. */
13
14
  declare function CoachmarkRoot(props: CoachmarkRootProps): import("react/jsx-runtime").JSX.Element;
14
- /** Coachmark.Trigger props (Radix `Popover.Trigger`와 동일). */
15
- type CoachmarkTriggerProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> & {
15
+ /** Coachmark.Trigger props — button 속성 + `render`. */
16
+ type CoachmarkTriggerProps = PopoverPrimitive.Trigger.Props & {
16
17
  ref?: Ref<HTMLButtonElement>;
17
18
  };
18
- /** 클릭하면 코치마크를 여닫는 기준 요소. asChild로 임의 요소를 감싼다. */
19
+ /** 클릭하면 코치마크를 여닫는 기준 요소. `render`로 임의의 버튼을 넘긴다. */
19
20
  declare function CoachmarkTrigger({ ref, ...props }: CoachmarkTriggerProps): import("react/jsx-runtime").JSX.Element;
20
- /** Coachmark.Anchor props (Radix `Popover.Anchor`와 동일). */
21
- type CoachmarkAnchorProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;
22
- /** 클릭 트리거 없이 특정 요소를 기준점으로만 쓸 때 사용한다. */
23
- declare function CoachmarkAnchor(props: CoachmarkAnchorProps): import("react/jsx-runtime").JSX.Element;
24
- /** Coachmark.Content props. `side`·`align`·`sideOffset` 등 Radix `Popover.Content` 위치 props도 받는다. */
25
- interface CoachmarkContentProps extends Omit<ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, "children" | "title"> {
21
+ /** Coachmark.Content props. `side`·`align`·`sideOffset`·`anchor` 등 위치 props도 받는다. */
22
+ interface CoachmarkContentProps extends Omit<PopoverPrimitive.Popup.Props, "children" | "className" | "title">, PopupPositioningProps {
23
+ className?: string;
26
24
  /** 상단 타이틀. 생략하면 타이틀 영역을 렌더하지 않는다. */
27
25
  title?: ReactNode;
28
26
  /** 본문(텍스트·이미지 등, min 40 / max 200px, 초과 시 스크롤). */
@@ -36,7 +34,12 @@ interface CoachmarkContentProps extends Omit<ComponentPropsWithoutRef<typeof Pop
36
34
  /** 지정하면 타이틀 우측에 닫기(X) 버튼을 렌더한다. */
37
35
  onClose?: () => void;
38
36
  /** 포털 대상. 생략하면 document.body — Shadow DOM 안에서는 그 루트 안의 요소를 넘긴다. */
39
- container?: ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>["container"];
37
+ container?: PopoverPrimitive.Portal.Props["container"];
38
+ /**
39
+ * 닫혀 있을 때도 DOM에 남겨 둔다.
40
+ * @default false
41
+ */
42
+ keepMounted?: boolean;
40
43
  /**
41
44
  * 닫기 버튼 aria-label
42
45
  * @default "닫기"
@@ -46,15 +49,17 @@ interface CoachmarkContentProps extends Omit<ComponentPropsWithoutRef<typeof Pop
46
49
  }
47
50
  /**
48
51
  * 진한 배경의 말풍선 본체. 포털로 렌더링되고 열릴 때 포커스를 가져가지 않는다.
49
- * `sideOffset` 기본값은 8이다.
52
+ * `sideOffset` 기본값은 8(화살표 끝과 기준 요소 사이 간격)이다.
53
+ * 클릭 트리거 없이 특정 요소만 가리키려면 `anchor`에 그 요소나 ref를 넘긴다.
50
54
  */
51
- declare function CoachmarkContent({ className, sideOffset, title, children, tertiaryButton, secondaryButton, primaryButton, onClose, closeAriaLabel, container, ref, ...props }: CoachmarkContentProps): import("react/jsx-runtime").JSX.Element;
55
+ declare function CoachmarkContent({ className, title, children, tertiaryButton, secondaryButton, primaryButton, onClose, closeAriaLabel, container, keepMounted, ref, ...props }: CoachmarkContentProps): import("react/jsx-runtime").JSX.Element;
52
56
  /**
53
57
  * 특정 요소를 가리키며 온보딩·기능 안내를 띄우는 진한 말풍선 코치마크.
54
58
  *
55
- * Figma Popover-Bubble(3848:11976). `@radix-ui/react-popover` 기반이라 side/정렬/충돌 회피/화살표 위치를 Radix가 처리한다.
59
+ * Figma Popover-Bubble(3848:11976). side/정렬/충돌 회피/화살표 위치는 자동으로 처리된다.
56
60
  * 진한 배경 위에 타이틀·닫기·본문·버튼(넘기기/이전/다음)을 담는다. 일반 드롭다운·폼 팝업은 `Popover`, 짧은 hover 설명은 `Tooltip`을 쓴다.
57
- * 구성: `Coachmark`(루트, `open`/`onOpenChange`) > `Coachmark.Trigger` 또는 `Coachmark.Anchor`(asChild) + `Coachmark.Content`.
61
+ * 구성: `Coachmark`(루트, `open`/`onOpenChange`) > `Coachmark.Trigger`(render) + `Coachmark.Content`.
62
+ * 클릭 트리거 없이 가리키기만 하려면 Trigger를 빼고 `Coachmark.Content`의 `anchor`에 기준 요소(ref)를 넘긴다.
58
63
  * 바깥 클릭 등으로도 닫히므로 보통 `open`을 제어형으로 관리한다.
59
64
  *
60
65
  * @example
@@ -62,12 +67,12 @@ declare function CoachmarkContent({ className, sideOffset, title, children, tert
62
67
  * import { Button, Coachmark } from "@aivex/ui";
63
68
  *
64
69
  * const [open, setOpen] = useState(true);
70
+ * const anchorRef = useRef<HTMLButtonElement>(null);
65
71
  *
72
+ * <Button ref={anchorRef} variant="outline" color="secondary">새 기능</Button>
66
73
  * <Coachmark open={open} onOpenChange={setOpen}>
67
- * <Coachmark.Anchor asChild>
68
- * <Button variant="outline" color="secondary">새 기능</Button>
69
- * </Coachmark.Anchor>
70
74
  * <Coachmark.Content
75
+ * anchor={anchorRef}
71
76
  * side="bottom"
72
77
  * title="새 기능 안내"
73
78
  * onClose={() => setOpen(false)}
@@ -81,8 +86,7 @@ declare function CoachmarkContent({ className, sideOffset, title, children, tert
81
86
  */
82
87
  declare const Coachmark: typeof CoachmarkRoot & {
83
88
  Trigger: typeof CoachmarkTrigger;
84
- Anchor: typeof CoachmarkAnchor;
85
89
  Content: typeof CoachmarkContent;
86
90
  };
87
- export type { CoachmarkAnchorProps, CoachmarkContentProps, CoachmarkRootProps, CoachmarkTriggerProps, };
91
+ export type { CoachmarkContentProps, CoachmarkRootProps, CoachmarkTriggerProps };
88
92
  export { Coachmark };