@womp/kookie-ui 0.23.0 → 0.24.0

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 (463) hide show
  1. package/components.css +190 -185
  2. package/dist/cjs/components/_internal/base-button.d.ts +11 -1
  3. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/base-button.js +1 -1
  5. package/dist/cjs/components/_internal/base-button.js.map +4 -4
  6. package/dist/cjs/components/_internal/menu-context.d.ts +2 -0
  7. package/dist/cjs/components/_internal/menu-context.d.ts.map +1 -1
  8. package/dist/cjs/components/_internal/menu-context.js +1 -1
  9. package/dist/cjs/components/_internal/menu-context.js.map +3 -3
  10. package/dist/cjs/components/_internal/pane-chrome.d.ts +17 -2
  11. package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
  12. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  13. package/dist/cjs/components/_internal/pane-chrome.js.map +4 -4
  14. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  15. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  16. package/dist/cjs/components/accordion.d.ts +2 -2
  17. package/dist/cjs/components/accordion.d.ts.map +1 -1
  18. package/dist/cjs/components/accordion.js +1 -1
  19. package/dist/cjs/components/accordion.js.map +4 -4
  20. package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
  21. package/dist/cjs/components/alert-dialog.js +1 -1
  22. package/dist/cjs/components/alert-dialog.js.map +3 -3
  23. package/dist/cjs/components/avatar.d.ts +1 -1
  24. package/dist/cjs/components/avatar.d.ts.map +1 -1
  25. package/dist/cjs/components/avatar.js +1 -1
  26. package/dist/cjs/components/avatar.js.map +3 -3
  27. package/dist/cjs/components/avatar.props.d.ts +8 -0
  28. package/dist/cjs/components/avatar.props.d.ts.map +1 -1
  29. package/dist/cjs/components/avatar.props.js +1 -1
  30. package/dist/cjs/components/avatar.props.js.map +2 -2
  31. package/dist/cjs/components/blockquote.d.ts +1 -1
  32. package/dist/cjs/components/blockquote.d.ts.map +1 -1
  33. package/dist/cjs/components/blockquote.js +1 -1
  34. package/dist/cjs/components/blockquote.js.map +4 -4
  35. package/dist/cjs/components/button.js +1 -1
  36. package/dist/cjs/components/button.js.map +4 -4
  37. package/dist/cjs/components/chatbar.d.ts.map +1 -1
  38. package/dist/cjs/components/chatbar.js +1 -1
  39. package/dist/cjs/components/chatbar.js.map +4 -4
  40. package/dist/cjs/components/checkbox-group.d.ts.map +1 -1
  41. package/dist/cjs/components/checkbox-group.js +1 -1
  42. package/dist/cjs/components/checkbox-group.js.map +3 -3
  43. package/dist/cjs/components/checkbox-group.primitive.d.ts +12 -5
  44. package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
  45. package/dist/cjs/components/checkbox-group.primitive.js +1 -1
  46. package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
  47. package/dist/cjs/components/checkbox.js +1 -1
  48. package/dist/cjs/components/checkbox.js.map +3 -3
  49. package/dist/cjs/components/chip.d.ts.map +1 -1
  50. package/dist/cjs/components/chip.js +1 -1
  51. package/dist/cjs/components/chip.js.map +3 -3
  52. package/dist/cjs/components/code.d.ts.map +1 -1
  53. package/dist/cjs/components/code.js +1 -1
  54. package/dist/cjs/components/code.js.map +2 -2
  55. package/dist/cjs/components/combobox.js +1 -1
  56. package/dist/cjs/components/combobox.js.map +3 -3
  57. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  58. package/dist/cjs/components/context-menu.js +1 -1
  59. package/dist/cjs/components/context-menu.js.map +4 -4
  60. package/dist/cjs/components/dialog.d.ts +1 -1
  61. package/dist/cjs/components/dialog.d.ts.map +1 -1
  62. package/dist/cjs/components/dialog.js +1 -1
  63. package/dist/cjs/components/dialog.js.map +3 -3
  64. package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
  65. package/dist/cjs/components/dropdown-menu.js +1 -1
  66. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  67. package/dist/cjs/components/icons.d.ts +3 -1
  68. package/dist/cjs/components/icons.d.ts.map +1 -1
  69. package/dist/cjs/components/icons.js +1 -1
  70. package/dist/cjs/components/icons.js.map +3 -3
  71. package/dist/cjs/components/index.d.ts +1 -1
  72. package/dist/cjs/components/index.d.ts.map +1 -1
  73. package/dist/cjs/components/index.js +2 -10
  74. package/dist/cjs/components/index.js.map +4 -4
  75. package/dist/cjs/components/message-scroller.d.ts.map +1 -1
  76. package/dist/cjs/components/message-scroller.js +1 -1
  77. package/dist/cjs/components/message-scroller.js.map +4 -4
  78. package/dist/cjs/components/navbar.d.ts.map +1 -1
  79. package/dist/cjs/components/navbar.js +1 -1
  80. package/dist/cjs/components/navbar.js.map +3 -3
  81. package/dist/cjs/components/notice.d.ts +4 -1
  82. package/dist/cjs/components/notice.d.ts.map +1 -1
  83. package/dist/cjs/components/notice.js +1 -1
  84. package/dist/cjs/components/notice.js.map +4 -4
  85. package/dist/cjs/components/progress.d.ts.map +1 -1
  86. package/dist/cjs/components/progress.js +1 -1
  87. package/dist/cjs/components/progress.js.map +3 -3
  88. package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
  89. package/dist/cjs/components/schemas/toggle.schema.d.ts +1 -1
  90. package/dist/cjs/components/scroll-area.d.ts +3 -1
  91. package/dist/cjs/components/scroll-area.d.ts.map +1 -1
  92. package/dist/cjs/components/scroll-area.js +1 -1
  93. package/dist/cjs/components/scroll-area.js.map +4 -4
  94. package/dist/cjs/components/segmented-control.d.ts +3 -1
  95. package/dist/cjs/components/segmented-control.d.ts.map +1 -1
  96. package/dist/cjs/components/segmented-control.js +1 -1
  97. package/dist/cjs/components/segmented-control.js.map +3 -3
  98. package/dist/cjs/components/select.d.ts.map +1 -1
  99. package/dist/cjs/components/select.js +1 -1
  100. package/dist/cjs/components/select.js.map +3 -3
  101. package/dist/cjs/components/separator.d.ts.map +1 -1
  102. package/dist/cjs/components/separator.js +1 -1
  103. package/dist/cjs/components/separator.js.map +3 -3
  104. package/dist/cjs/components/sheet.d.ts +1 -0
  105. package/dist/cjs/components/sheet.d.ts.map +1 -1
  106. package/dist/cjs/components/sheet.js +1 -1
  107. package/dist/cjs/components/sheet.js.map +3 -3
  108. package/dist/cjs/components/shell.d.ts +12 -1
  109. package/dist/cjs/components/shell.d.ts.map +1 -1
  110. package/dist/cjs/components/shell.js +1 -1
  111. package/dist/cjs/components/shell.js.map +4 -4
  112. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  113. package/dist/cjs/components/sidebar.js +1 -1
  114. package/dist/cjs/components/sidebar.js.map +4 -4
  115. package/dist/cjs/components/slider.d.ts.map +1 -1
  116. package/dist/cjs/components/slider.js +1 -1
  117. package/dist/cjs/components/slider.js.map +3 -3
  118. package/dist/cjs/components/spinner.d.ts.map +1 -1
  119. package/dist/cjs/components/spinner.js +1 -1
  120. package/dist/cjs/components/spinner.js.map +3 -3
  121. package/dist/cjs/components/table.d.ts.map +1 -1
  122. package/dist/cjs/components/table.js +1 -1
  123. package/dist/cjs/components/table.js.map +4 -4
  124. package/dist/cjs/components/tabs.d.ts.map +1 -1
  125. package/dist/cjs/components/tabs.js +1 -1
  126. package/dist/cjs/components/tabs.js.map +2 -2
  127. package/dist/cjs/components/text-area.js +1 -1
  128. package/dist/cjs/components/text-area.js.map +2 -2
  129. package/dist/cjs/components/text-field.js +2 -2
  130. package/dist/cjs/components/text-field.js.map +2 -2
  131. package/dist/cjs/components/toggle.d.ts +3 -2
  132. package/dist/cjs/components/toggle.d.ts.map +1 -1
  133. package/dist/cjs/components/toggle.js +1 -9
  134. package/dist/cjs/components/toggle.js.map +4 -4
  135. package/dist/cjs/components/toolbar.d.ts +80 -8
  136. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  137. package/dist/cjs/components/toolbar.js +1 -1
  138. package/dist/cjs/components/toolbar.js.map +4 -4
  139. package/dist/cjs/components/virtual-menu.d.ts +3 -5
  140. package/dist/cjs/components/virtual-menu.d.ts.map +1 -1
  141. package/dist/cjs/components/virtual-menu.js +1 -1
  142. package/dist/cjs/components/virtual-menu.js.map +3 -3
  143. package/dist/cjs/helpers/extract-margin-props.d.ts +7 -7
  144. package/dist/cjs/hooks/use-scroll-edges.d.ts +4 -2
  145. package/dist/cjs/hooks/use-scroll-edges.d.ts.map +1 -1
  146. package/dist/cjs/hooks/use-scroll-edges.js +1 -1
  147. package/dist/cjs/hooks/use-scroll-edges.js.map +3 -3
  148. package/dist/cjs/index.js +5 -5
  149. package/dist/cjs/index.js.map +4 -4
  150. package/dist/cjs/props/index.js +1 -1
  151. package/dist/cjs/props/index.js.map +2 -2
  152. package/dist/esm/chunk-3VTS4C63.js +2 -0
  153. package/dist/esm/chunk-3VTS4C63.js.map +7 -0
  154. package/dist/esm/chunk-3WE4E2WQ.js +2 -0
  155. package/dist/esm/chunk-3WE4E2WQ.js.map +7 -0
  156. package/dist/esm/chunk-3XUY5WFA.js +2 -0
  157. package/dist/esm/chunk-3XUY5WFA.js.map +7 -0
  158. package/dist/esm/chunk-3XZOE2IQ.js +2 -0
  159. package/dist/esm/chunk-3XZOE2IQ.js.map +7 -0
  160. package/dist/esm/chunk-432YLNB3.js +2 -0
  161. package/dist/esm/chunk-432YLNB3.js.map +7 -0
  162. package/dist/esm/chunk-4QKZYCCH.js +2 -0
  163. package/dist/esm/chunk-4QKZYCCH.js.map +7 -0
  164. package/dist/esm/chunk-4R5EMVB3.js +2 -0
  165. package/dist/esm/chunk-4R5EMVB3.js.map +7 -0
  166. package/dist/esm/chunk-4ZOVV3TY.js +2 -0
  167. package/dist/esm/chunk-4ZOVV3TY.js.map +7 -0
  168. package/dist/esm/{chunk-IX5HIHVI.js → chunk-62ZGP4ET.js} +2 -2
  169. package/dist/esm/{chunk-IX5HIHVI.js.map → chunk-62ZGP4ET.js.map} +3 -3
  170. package/dist/esm/chunk-BGAJ2MDF.js +2 -0
  171. package/dist/esm/chunk-BGAJ2MDF.js.map +7 -0
  172. package/dist/esm/chunk-CHPT42BY.js +2 -0
  173. package/dist/esm/{chunk-Y3JYEEFB.js.map → chunk-CHPT42BY.js.map} +2 -2
  174. package/dist/esm/{chunk-KS4U4VPH.js → chunk-CMHUK7OG.js} +2 -2
  175. package/dist/esm/{chunk-KS4U4VPH.js.map → chunk-CMHUK7OG.js.map} +2 -2
  176. package/dist/esm/chunk-CN6F4REJ.js +2 -0
  177. package/dist/esm/chunk-CN6F4REJ.js.map +7 -0
  178. package/dist/esm/chunk-DUTZUWZP.js +2 -0
  179. package/dist/esm/chunk-DUTZUWZP.js.map +7 -0
  180. package/dist/esm/chunk-FDJV5RXX.js +2 -0
  181. package/dist/esm/chunk-FDJV5RXX.js.map +7 -0
  182. package/dist/esm/chunk-G2JD52O5.js +2 -0
  183. package/dist/esm/{chunk-23KT3D2Z.js.map → chunk-G2JD52O5.js.map} +3 -3
  184. package/dist/esm/{chunk-6DDOR73D.js → chunk-G4ETY2NP.js} +2 -2
  185. package/dist/esm/chunk-GPOCLDBR.js +2 -0
  186. package/dist/esm/chunk-GPOCLDBR.js.map +7 -0
  187. package/dist/esm/chunk-GYP66ZK2.js +2 -0
  188. package/dist/esm/chunk-GYP66ZK2.js.map +7 -0
  189. package/dist/esm/chunk-H5BYPX6V.js +2 -0
  190. package/dist/esm/chunk-H5BYPX6V.js.map +7 -0
  191. package/dist/esm/chunk-H5G7UECV.js +2 -0
  192. package/dist/esm/chunk-H5G7UECV.js.map +7 -0
  193. package/dist/esm/chunk-I4FLQELQ.js +2 -0
  194. package/dist/esm/chunk-I4FLQELQ.js.map +7 -0
  195. package/dist/esm/chunk-JYQGCXXI.js +2 -0
  196. package/dist/esm/chunk-JYQGCXXI.js.map +7 -0
  197. package/dist/esm/chunk-KA5UE2VN.js +2 -0
  198. package/dist/esm/chunk-KA5UE2VN.js.map +7 -0
  199. package/dist/esm/{chunk-QGCXTULQ.js → chunk-KEGCX5VM.js} +2 -2
  200. package/dist/esm/chunk-KVHKPUZ2.js +2 -0
  201. package/dist/esm/chunk-KVHKPUZ2.js.map +7 -0
  202. package/dist/esm/{chunk-FFG32ERA.js → chunk-N3WBEQWL.js} +3 -3
  203. package/dist/esm/chunk-N3WBEQWL.js.map +7 -0
  204. package/dist/esm/{chunk-HKPXDQ2B.js → chunk-NC3CJUE3.js} +2 -2
  205. package/dist/esm/chunk-P2MV6HLA.js +2 -0
  206. package/dist/esm/{chunk-7SS4UUJH.js.map → chunk-P2MV6HLA.js.map} +3 -3
  207. package/dist/esm/chunk-PALE5UWK.js +2 -0
  208. package/dist/esm/{chunk-DSPYHO3L.js.map → chunk-PALE5UWK.js.map} +2 -2
  209. package/dist/esm/chunk-PDMCLVYT.js +2 -0
  210. package/dist/esm/chunk-PDMCLVYT.js.map +7 -0
  211. package/dist/esm/chunk-PM6QY3JO.js +2 -0
  212. package/dist/esm/{chunk-ZEX2DECM.js.map → chunk-PM6QY3JO.js.map} +3 -3
  213. package/dist/esm/chunk-RKZVXVBN.js +2 -0
  214. package/dist/esm/chunk-RKZVXVBN.js.map +7 -0
  215. package/dist/esm/chunk-TXQZ5HLV.js +2 -0
  216. package/dist/esm/chunk-TXQZ5HLV.js.map +7 -0
  217. package/dist/esm/chunk-UKASIY6M.js +2 -0
  218. package/dist/esm/chunk-UKASIY6M.js.map +7 -0
  219. package/dist/esm/{chunk-OJQNLROL.js → chunk-UY6WJUNA.js} +2 -2
  220. package/dist/esm/chunk-V5O3TF57.js +2 -0
  221. package/dist/esm/{chunk-3KQE2PSJ.js.map → chunk-V5O3TF57.js.map} +3 -3
  222. package/dist/esm/chunk-VUNCI6A6.js +2 -0
  223. package/dist/esm/chunk-VUNCI6A6.js.map +7 -0
  224. package/dist/esm/{chunk-JBHRV364.js → chunk-VUPIJNG2.js} +2 -2
  225. package/dist/esm/chunk-W6BN5QLH.js +2 -0
  226. package/dist/esm/{chunk-ZNDCZM5A.js.map → chunk-W6BN5QLH.js.map} +2 -2
  227. package/dist/esm/chunk-WG5ORTIW.js +2 -0
  228. package/dist/esm/chunk-WG5ORTIW.js.map +7 -0
  229. package/dist/esm/chunk-WMVR2XBR.js +2 -0
  230. package/dist/esm/{chunk-XKSU3NLG.js.map → chunk-WMVR2XBR.js.map} +2 -2
  231. package/dist/esm/{chunk-NNZTSXKH.js → chunk-WX7SX5BN.js} +2 -2
  232. package/dist/esm/chunk-XOACTIBL.js +2 -0
  233. package/dist/esm/chunk-XOACTIBL.js.map +7 -0
  234. package/dist/esm/components/_internal/base-button.d.ts +11 -1
  235. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  236. package/dist/esm/components/_internal/base-button.js +1 -1
  237. package/dist/esm/components/_internal/menu-context.d.ts +2 -0
  238. package/dist/esm/components/_internal/menu-context.d.ts.map +1 -1
  239. package/dist/esm/components/_internal/menu-context.js +1 -1
  240. package/dist/esm/components/_internal/pane-chrome.d.ts +17 -2
  241. package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
  242. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  243. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  244. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  245. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  246. package/dist/esm/components/accordion.d.ts +2 -2
  247. package/dist/esm/components/accordion.d.ts.map +1 -1
  248. package/dist/esm/components/accordion.js +1 -1
  249. package/dist/esm/components/alert-dialog.d.ts.map +1 -1
  250. package/dist/esm/components/alert-dialog.js +1 -1
  251. package/dist/esm/components/avatar.d.ts +1 -1
  252. package/dist/esm/components/avatar.d.ts.map +1 -1
  253. package/dist/esm/components/avatar.js +1 -1
  254. package/dist/esm/components/avatar.props.d.ts +8 -0
  255. package/dist/esm/components/avatar.props.d.ts.map +1 -1
  256. package/dist/esm/components/avatar.props.js +1 -1
  257. package/dist/esm/components/blockquote.d.ts +1 -1
  258. package/dist/esm/components/blockquote.d.ts.map +1 -1
  259. package/dist/esm/components/blockquote.js +1 -1
  260. package/dist/esm/components/button.js +1 -1
  261. package/dist/esm/components/chatbar.d.ts.map +1 -1
  262. package/dist/esm/components/chatbar.js +1 -1
  263. package/dist/esm/components/checkbox-group.d.ts.map +1 -1
  264. package/dist/esm/components/checkbox-group.js +1 -1
  265. package/dist/esm/components/checkbox-group.primitive.d.ts +12 -5
  266. package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
  267. package/dist/esm/components/checkbox-group.primitive.js +1 -1
  268. package/dist/esm/components/checkbox.js +1 -1
  269. package/dist/esm/components/chip.d.ts.map +1 -1
  270. package/dist/esm/components/chip.js +1 -1
  271. package/dist/esm/components/code.d.ts.map +1 -1
  272. package/dist/esm/components/code.js +1 -1
  273. package/dist/esm/components/combobox.js +1 -1
  274. package/dist/esm/components/context-menu.d.ts.map +1 -1
  275. package/dist/esm/components/context-menu.js +1 -1
  276. package/dist/esm/components/dialog.d.ts +1 -1
  277. package/dist/esm/components/dialog.d.ts.map +1 -1
  278. package/dist/esm/components/dialog.js +1 -1
  279. package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
  280. package/dist/esm/components/dropdown-menu.js +1 -1
  281. package/dist/esm/components/icons.d.ts +3 -1
  282. package/dist/esm/components/icons.d.ts.map +1 -1
  283. package/dist/esm/components/icons.js +1 -1
  284. package/dist/esm/components/index.d.ts +1 -1
  285. package/dist/esm/components/index.d.ts.map +1 -1
  286. package/dist/esm/components/index.js +1 -1
  287. package/dist/esm/components/message-scroller.d.ts.map +1 -1
  288. package/dist/esm/components/message-scroller.js +1 -1
  289. package/dist/esm/components/navbar.d.ts.map +1 -1
  290. package/dist/esm/components/navbar.js +1 -1
  291. package/dist/esm/components/notice.d.ts +4 -1
  292. package/dist/esm/components/notice.d.ts.map +1 -1
  293. package/dist/esm/components/notice.js +1 -1
  294. package/dist/esm/components/progress.d.ts.map +1 -1
  295. package/dist/esm/components/progress.js +1 -1
  296. package/dist/esm/components/schemas/button.schema.d.ts +2 -2
  297. package/dist/esm/components/schemas/toggle.schema.d.ts +1 -1
  298. package/dist/esm/components/scroll-area.d.ts +3 -1
  299. package/dist/esm/components/scroll-area.d.ts.map +1 -1
  300. package/dist/esm/components/scroll-area.js +1 -1
  301. package/dist/esm/components/segmented-control.d.ts +3 -1
  302. package/dist/esm/components/segmented-control.d.ts.map +1 -1
  303. package/dist/esm/components/segmented-control.js +1 -1
  304. package/dist/esm/components/select.d.ts.map +1 -1
  305. package/dist/esm/components/select.js +1 -1
  306. package/dist/esm/components/separator.d.ts.map +1 -1
  307. package/dist/esm/components/separator.js +1 -1
  308. package/dist/esm/components/sheet.d.ts +1 -0
  309. package/dist/esm/components/sheet.d.ts.map +1 -1
  310. package/dist/esm/components/sheet.js +1 -1
  311. package/dist/esm/components/shell.d.ts +12 -1
  312. package/dist/esm/components/shell.d.ts.map +1 -1
  313. package/dist/esm/components/shell.js +1 -1
  314. package/dist/esm/components/sidebar.d.ts.map +1 -1
  315. package/dist/esm/components/sidebar.js +1 -1
  316. package/dist/esm/components/slider.d.ts.map +1 -1
  317. package/dist/esm/components/slider.js +1 -1
  318. package/dist/esm/components/spinner.d.ts.map +1 -1
  319. package/dist/esm/components/spinner.js +1 -1
  320. package/dist/esm/components/table.d.ts.map +1 -1
  321. package/dist/esm/components/table.js +1 -1
  322. package/dist/esm/components/tabs.d.ts.map +1 -1
  323. package/dist/esm/components/tabs.js +1 -1
  324. package/dist/esm/components/text-area.js +1 -1
  325. package/dist/esm/components/text-field.js +1 -1
  326. package/dist/esm/components/toggle.d.ts +3 -2
  327. package/dist/esm/components/toggle.d.ts.map +1 -1
  328. package/dist/esm/components/toggle.js +1 -1
  329. package/dist/esm/components/toolbar.d.ts +80 -8
  330. package/dist/esm/components/toolbar.d.ts.map +1 -1
  331. package/dist/esm/components/toolbar.js +1 -1
  332. package/dist/esm/components/virtual-menu.d.ts +3 -5
  333. package/dist/esm/components/virtual-menu.d.ts.map +1 -1
  334. package/dist/esm/components/virtual-menu.js +1 -1
  335. package/dist/esm/helpers/extract-margin-props.d.ts +7 -7
  336. package/dist/esm/hooks/index.js +1 -1
  337. package/dist/esm/hooks/use-scroll-edges.d.ts +4 -2
  338. package/dist/esm/hooks/use-scroll-edges.d.ts.map +1 -1
  339. package/dist/esm/hooks/use-scroll-edges.js +1 -1
  340. package/dist/esm/index.js +1 -1
  341. package/dist/esm/props/index.js +1 -1
  342. package/package.json +1 -1
  343. package/src/components/_internal/base-button.tsx +51 -12
  344. package/src/components/_internal/base-sidebar-menu.css +8 -0
  345. package/src/components/_internal/menu-context.tsx +11 -0
  346. package/src/components/_internal/pane-chrome.tsx +45 -8
  347. package/src/components/accordion.css +35 -3
  348. package/src/components/accordion.tsx +12 -16
  349. package/src/components/alert-dialog.tsx +59 -161
  350. package/src/components/avatar.props.tsx +6 -0
  351. package/src/components/avatar.tsx +57 -71
  352. package/src/components/blockquote.tsx +8 -9
  353. package/src/components/chatbar.tsx +27 -20
  354. package/src/components/checkbox-group.primitive.tsx +40 -51
  355. package/src/components/checkbox-group.tsx +1 -9
  356. package/src/components/chip.css +18 -20
  357. package/src/components/chip.tsx +3 -4
  358. package/src/components/code.tsx +3 -2
  359. package/src/components/context-menu.tsx +23 -5
  360. package/src/components/dialog.tsx +59 -160
  361. package/src/components/dropdown-menu.tsx +8 -5
  362. package/src/components/icons.tsx +11 -1
  363. package/src/components/index.tsx +7 -0
  364. package/src/components/message-scroller.tsx +48 -26
  365. package/src/components/navbar.tsx +34 -69
  366. package/src/components/notice.tsx +6 -3
  367. package/src/components/progress.tsx +6 -3
  368. package/src/components/scroll-area.css +28 -2
  369. package/src/components/scroll-area.tsx +49 -3
  370. package/src/components/segmented-control.css +8 -130
  371. package/src/components/segmented-control.tsx +36 -5
  372. package/src/components/select.tsx +23 -3
  373. package/src/components/separator.tsx +13 -1
  374. package/src/components/sheet.css +7 -6
  375. package/src/components/sheet.tsx +76 -143
  376. package/src/components/shell.css +14 -0
  377. package/src/components/shell.tsx +29 -8
  378. package/src/components/sidebar.tsx +27 -16
  379. package/src/components/slider.tsx +51 -32
  380. package/src/components/spinner.tsx +10 -2
  381. package/src/components/table.tsx +18 -5
  382. package/src/components/tabs.css +34 -0
  383. package/src/components/tabs.tsx +0 -2
  384. package/src/components/text-area.css +2 -1
  385. package/src/components/text-area.tsx +1 -1
  386. package/src/components/text-field.tsx +1 -1
  387. package/src/components/toggle.tsx +21 -39
  388. package/src/components/toolbar.css +34 -0
  389. package/src/components/toolbar.tsx +432 -23
  390. package/src/components/virtual-menu.tsx +110 -37
  391. package/src/hooks/use-scroll-edges.ts +11 -2
  392. package/src/styles/utilities/truncate.css +10 -0
  393. package/styles.css +195 -185
  394. package/utilities.css +5 -0
  395. package/dist/esm/chunk-23KT3D2Z.js +0 -2
  396. package/dist/esm/chunk-3JA7SJDT.js +0 -2
  397. package/dist/esm/chunk-3JA7SJDT.js.map +0 -7
  398. package/dist/esm/chunk-3KQE2PSJ.js +0 -2
  399. package/dist/esm/chunk-5BWLY27A.js +0 -2
  400. package/dist/esm/chunk-5BWLY27A.js.map +0 -7
  401. package/dist/esm/chunk-6CK7UTNH.js +0 -2
  402. package/dist/esm/chunk-6CK7UTNH.js.map +0 -7
  403. package/dist/esm/chunk-6RK26HIY.js +0 -2
  404. package/dist/esm/chunk-6RK26HIY.js.map +0 -7
  405. package/dist/esm/chunk-7ESWH773.js +0 -2
  406. package/dist/esm/chunk-7ESWH773.js.map +0 -7
  407. package/dist/esm/chunk-7SS4UUJH.js +0 -2
  408. package/dist/esm/chunk-AB3QCCUM.js +0 -2
  409. package/dist/esm/chunk-AB3QCCUM.js.map +0 -7
  410. package/dist/esm/chunk-BEP4AH5V.js +0 -2
  411. package/dist/esm/chunk-BEP4AH5V.js.map +0 -7
  412. package/dist/esm/chunk-BOL3VVSN.js +0 -2
  413. package/dist/esm/chunk-BOL3VVSN.js.map +0 -7
  414. package/dist/esm/chunk-DBROSD2J.js +0 -2
  415. package/dist/esm/chunk-DBROSD2J.js.map +0 -7
  416. package/dist/esm/chunk-DSPYHO3L.js +0 -2
  417. package/dist/esm/chunk-E2D2VWUI.js +0 -2
  418. package/dist/esm/chunk-E2D2VWUI.js.map +0 -7
  419. package/dist/esm/chunk-EMNSA65L.js +0 -2
  420. package/dist/esm/chunk-EMNSA65L.js.map +0 -7
  421. package/dist/esm/chunk-FFG32ERA.js.map +0 -7
  422. package/dist/esm/chunk-FHPHEIYJ.js +0 -2
  423. package/dist/esm/chunk-FHPHEIYJ.js.map +0 -7
  424. package/dist/esm/chunk-FJFBM7HW.js +0 -2
  425. package/dist/esm/chunk-FJFBM7HW.js.map +0 -7
  426. package/dist/esm/chunk-FYT7TYGS.js +0 -2
  427. package/dist/esm/chunk-FYT7TYGS.js.map +0 -7
  428. package/dist/esm/chunk-GLV7VGBH.js +0 -2
  429. package/dist/esm/chunk-GLV7VGBH.js.map +0 -7
  430. package/dist/esm/chunk-HIKMKGPT.js +0 -2
  431. package/dist/esm/chunk-HIKMKGPT.js.map +0 -7
  432. package/dist/esm/chunk-L2R62BOB.js +0 -2
  433. package/dist/esm/chunk-L2R62BOB.js.map +0 -7
  434. package/dist/esm/chunk-LHIS3UKQ.js +0 -2
  435. package/dist/esm/chunk-LHIS3UKQ.js.map +0 -7
  436. package/dist/esm/chunk-NQDMTOGB.js +0 -2
  437. package/dist/esm/chunk-NQDMTOGB.js.map +0 -7
  438. package/dist/esm/chunk-Q6MFPATL.js +0 -2
  439. package/dist/esm/chunk-Q6MFPATL.js.map +0 -7
  440. package/dist/esm/chunk-QOHJIF25.js +0 -2
  441. package/dist/esm/chunk-QOHJIF25.js.map +0 -7
  442. package/dist/esm/chunk-R4XJNQX5.js +0 -2
  443. package/dist/esm/chunk-R4XJNQX5.js.map +0 -7
  444. package/dist/esm/chunk-UE3HATOA.js +0 -2
  445. package/dist/esm/chunk-UE3HATOA.js.map +0 -7
  446. package/dist/esm/chunk-V32EP3S7.js +0 -2
  447. package/dist/esm/chunk-V32EP3S7.js.map +0 -7
  448. package/dist/esm/chunk-XKSU3NLG.js +0 -2
  449. package/dist/esm/chunk-XRCMPBAY.js +0 -2
  450. package/dist/esm/chunk-XRCMPBAY.js.map +0 -7
  451. package/dist/esm/chunk-Y3JYEEFB.js +0 -2
  452. package/dist/esm/chunk-YZM54IJE.js +0 -2
  453. package/dist/esm/chunk-YZM54IJE.js.map +0 -7
  454. package/dist/esm/chunk-ZEX2DECM.js +0 -2
  455. package/dist/esm/chunk-ZJI2IK7C.js +0 -2
  456. package/dist/esm/chunk-ZJI2IK7C.js.map +0 -7
  457. package/dist/esm/chunk-ZNDCZM5A.js +0 -2
  458. /package/dist/esm/{chunk-6DDOR73D.js.map → chunk-G4ETY2NP.js.map} +0 -0
  459. /package/dist/esm/{chunk-QGCXTULQ.js.map → chunk-KEGCX5VM.js.map} +0 -0
  460. /package/dist/esm/{chunk-HKPXDQ2B.js.map → chunk-NC3CJUE3.js.map} +0 -0
  461. /package/dist/esm/{chunk-OJQNLROL.js.map → chunk-UY6WJUNA.js.map} +0 -0
  462. /package/dist/esm/{chunk-JBHRV364.js.map → chunk-VUPIJNG2.js.map} +0 -0
  463. /package/dist/esm/{chunk-NNZTSXKH.js.map → chunk-WX7SX5BN.js.map} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/chatbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { useDropzone } from 'react-dropzone';\n\nimport { Button } from './button.js';\nimport { CloseIcon, FileTextIcon } from './icons.js';\nimport { Flex } from './flex.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Slot } from './slot.js';\nimport { NoticeSizeContext } from './notice.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { Spinner } from './spinner.js';\nimport { Text } from './text.js';\nimport { VisuallyHidden } from './visually-hidden.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { accentColors } from '../props/color.prop.js';\nimport type { radii } from '../props/radius.prop.js';\nimport type { ButtonProps, ButtonRankProps } from './button.js';\n\n// Avoid SSR warnings by using an isomorphic layout effect\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\n/**\n * Runs `measure` with the placeholder taken out of layout, so a height read\n * reflects the value alone.\n *\n * A textarea with an empty value lays its placeholder out as real text, so\n * `scrollHeight` reports the placeholder wrapped at whatever width the field\n * has at that instant. That sizes an empty bar to the suggestion showing in it\n * rather than to `minLines`, and when the read lands before the field has its\n * final width -- a panel still animating open, a flex parent whose basis is 0\n * -- it wraps that text at a fraction of the real width and opens the bar at\n * `maxLines`. The first keystroke takes the placeholder out of layout and the\n * height snaps back, which is what made the bug look intermittent rather than\n * simply wrong.\n *\n * The reset to 'auto' and the `scrollHeight` read sit in different functions\n * here, so the whole measurement window is wrapped rather than a single read.\n * Costs one extra style recalc on a path that is already forcing a reflow.\n */\nfunction withoutPlaceholder(el: HTMLTextAreaElement, measure: () => void): void {\n const { placeholder } = el;\n if (!placeholder) {\n measure();\n return;\n }\n el.placeholder = '';\n try {\n measure();\n } finally {\n el.placeholder = placeholder;\n }\n}\n\ntype ExpandOn = 'none' | 'focus' | 'overflow' | 'both';\ntype SendMode = 'always' | 'whenDirty' | 'never';\n\n// Attachments\n/** Status flag for attachment lifecycle. */\ntype AttachmentStatus = 'idle' | 'uploading' | 'error' | 'done';\n/**\n * Attachment data model used by Chatbar.\n * - `file` exposes the original File object for uploads and processing.\n * - `url` is an object URL used for image previews. Chatbar revokes it when the\n * attachment is removed; once an attachment is handed to `onSubmit`, the\n * consumer owns the URL and is responsible for revoking it.\n */\ninterface ChatbarAttachment {\n id: string;\n name: string;\n size: number;\n type: string;\n /** Original File object for uploads and processing */\n file: File;\n url?: string;\n status?: AttachmentStatus;\n progress?: number;\n meta?: Record<string, unknown>;\n}\n\ntype ChatbarRejectReason = 'type' | 'size' | 'count';\ninterface ChatbarAttachmentRejection {\n file: File;\n reason: ChatbarRejectReason;\n}\n\ninterface ChatbarSubmitPayload {\n value: string;\n attachments: ChatbarAttachment[];\n}\n\ninterface FilePickerOptions {\n accept?: string | string[];\n multiple?: boolean;\n}\n\ninterface ChatbarContextValue {\n open: boolean;\n setOpen(next: boolean): void;\n\n setValue(next: string): void;\n\n size: '1' | '2' | '3';\n expandOn: ExpandOn;\n minLines: number;\n maxLines: number;\n sendMode: SendMode;\n disabled?: boolean;\n readOnly?: boolean;\n paste: boolean;\n clearOnSubmit: boolean;\n multiple: boolean;\n\n textareaRef: React.RefObject<HTMLTextAreaElement | null>;\n\n attachments: ChatbarAttachment[];\n removeAttachment(id: string): void;\n\n /** Validates and submits; returns false when there was nothing to submit */\n submit(clear: boolean): boolean;\n appendFiles(files: File[]): number;\n appendFilesFromPaste(files: File[]): number;\n openFilePicker(options?: FilePickerOptions): void;\n /** Guards blur-collapse between pointerdown on a picker trigger and its click */\n beginFilePickerPress(): void;\n}\n\n/** Chatbar's own range; a Theme size of 4 maps to 3. */\nconst chatbarSizePropDef = { values: ['1', '2', '3'] as const };\n\nconst ChatbarContext = React.createContext<ChatbarContextValue | null>(null);\n// Value lives in its own context so keystrokes only re-render parts that read it\nconst ChatbarValueContext = React.createContext<string>('');\n\nconst useChatbarContext = () => {\n const ctx = React.useContext(ChatbarContext);\n if (!ctx) throw new Error('Chatbar context not found. Wrap parts in <Chatbar.Root>.');\n return ctx;\n};\n\nconst toArray = (val: string | string[] | undefined) =>\n Array.isArray(val) ? val : typeof val === 'string' ? val.split(',').map((s) => s.trim()).filter(Boolean) : [];\n\nconst matchesAccept = (file: File, patterns: string[]) => {\n if (patterns.length === 0) return true;\n const mime = file.type.toLowerCase();\n const name = file.name.toLowerCase();\n for (const patRaw of patterns) {\n const pat = patRaw.toLowerCase();\n if (pat.includes('/')) {\n const [type, subtype] = pat.split('/');\n const [fmType, fmSubtype] = mime.split('/');\n if (type === '*' || (type === fmType && (subtype === '*' || subtype === fmSubtype))) return true;\n } else if (pat.startsWith('.')) {\n if (name.endsWith(pat)) return true;\n }\n }\n return false;\n};\n\nconst IMAGE_EXT_RE = /\\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i;\nconst isImageLike = (name: string, type: string) => (type || '').toLowerCase().startsWith('image/') || IMAGE_EXT_RE.test(name);\n\nconst hasText = (value: string) => value.trim().length > 0;\n\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`;\n\nlet attachmentCounter = 0;\nconst createAttachmentId = () => `chatbar-attachment-${Date.now()}-${++attachmentCounter}`;\n\n/**\n * Chatbar container and state provider.\n *\n * Value & Open\n * - Supports controlled/uncontrolled `value` and `open`.\n *\n * Attachments\n * - Controlled/uncontrolled attachments with client-side filtering.\n * - Filters by `accept`/`pasteAccept`, `multiple`, `maxAttachments`, and `maxFileSize`.\n * - Rejections are reported via `onAttachmentReject`.\n *\n * Submit\n * - `onSubmit({ value, attachments })` emits both message and attachments.\n * - Submitting requires text or at least one attachment.\n * - `clearOnSubmit` clears message and attachments by default.\n */\ninterface ChatbarRootBaseProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n /** When the chatbar expands on its own. `none` leaves open state entirely to the consumer. */\n expandOn?: ExpandOn;\n\n /** Minimum visible lines when expanded (default: 3). The compact state is always one line. */\n minLines?: number;\n /** Maximum number of lines before scrolling (default: 6) */\n maxLines?: number;\n\n /** Controls Send button visibility only. Enter-to-submit is controlled by `Textarea submitOnEnter`. */\n sendMode?: SendMode;\n\n /** Disables text input, submission and every way of adding attachments */\n disabled?: boolean;\n /** Prevents editing, submission and adding attachments */\n readOnly?: boolean;\n\n /** Combined submit payload */\n onSubmit?: (payload: ChatbarSubmitPayload) => void;\n\n size?: '1' | '2' | '3';\n variant?: 'raised' | 'surface' | 'outline' | 'ghost' | 'soft';\n /** Accent color for the control (matches TextArea) */\n color?: (typeof accentColors)[number];\n /** Optional radius override (matches TextArea) */\n radius?: (typeof radii)[number];\n\n width?: React.CSSProperties['width'];\n maxWidth?: React.CSSProperties['maxWidth'];\n\n // Attachments API\n attachments?: ChatbarAttachment[];\n defaultAttachments?: ChatbarAttachment[];\n onAttachmentsChange?: (attachments: ChatbarAttachment[]) => void;\n accept?: string | string[];\n /** Allow more than one file per pick, paste or drop */\n multiple?: boolean;\n maxAttachments?: number;\n maxFileSize?: number;\n paste?: boolean;\n /** Accepted types for pasted files. Replaces `accept` for paste when set. */\n pasteAccept?: string | string[];\n /** Clear message and attachments after submit */\n clearOnSubmit?: boolean;\n onAttachmentReject?: (rejections: ChatbarAttachmentRejection[]) => void;\n\n /**\n * Enables drag-and-drop file uploads when true.\n *\n * When enabled:\n * - Files can be dropped anywhere on the chatbar\n * - Same validation rules apply (accept, multiple, maxFileSize, maxAttachments)\n * - Visual feedback shows during drag operations\n * - Rejected files trigger onAttachmentReject\n *\n * @default true\n */\n dropzone?: boolean;\n\n /**\n * Optional API ref to control Chatbar imperatively without relying on DOM refs.\n * Provides methods to focus the textarea and open the file picker.\n */\n apiRef?: React.Ref<ChatbarApi>;\n\n /**\n * Messages that need an answer before the next message, such as `Notice` and `Confirmation`.\n * They stack in a column above the chatbar, in the order given, so put the one the next\n * message answers last, nearest the text. They sit outside the box: a button in a notice never\n * submits the message, and pressing one never collapses the chatbar.\n */\n notices?: React.ReactNode;\n /**\n * Short facts that stay true about the conversation, such as the model or the context left.\n * They sit below the chatbar, inset from its sides.\n */\n context?: React.ReactNode;\n}\n\ntype RootElement = React.ElementRef<'div'>;\n/** Imperative API for Chatbar.Root */\nexport interface ChatbarApi {\n /** Focus the textarea input */\n focusTextarea: () => void;\n /** Open the file picker dialog (respects accept/multiple). No-op when disabled or read-only. */\n openFilePicker: () => void;\n}\n/**\n * Chatbar container and state provider.\n *\n * Behavior\n * - Supports controlled and uncontrolled `value` and `open` states via props.\n * - Provides context to subcomponents like `Textarea`, `Row`, and `Send`.\n * - Exposes `data-state`, `data-disabled`, and `data-readonly` attributes for styling.\n *\n * Attachments\n * - Paste-to-attach: when `paste` is enabled, pasting files adds attachments.\n * - Additions and rejections are announced through a polite live region.\n *\n * Dropzone\n * - When `dropzone` is true, enables drag-and-drop file uploads.\n * - Visual feedback via `data-drop-active` attribute during drag operations.\n *\n * Accessibility\n * - Consumers should label the `Textarea` via `aria-label`/`aria-labelledby`.\n */\ninterface RootProps extends ComponentPropsWithout<'div', RemovedProps | 'onSubmit' | 'color'>, ChatbarRootBaseProps {}\n\nconst Root = React.forwardRef<RootElement, RootProps>((props, forwardedRef) => {\n const {\n className,\n style,\n children,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n expandOn = 'both',\n minLines = 3,\n maxLines = 6,\n sendMode = 'whenDirty',\n disabled,\n readOnly,\n onSubmit,\n size: sizeProp,\n variant,\n color,\n radius,\n width,\n maxWidth,\n attachments: attachmentsProp,\n defaultAttachments,\n onAttachmentsChange,\n accept,\n multiple = true,\n maxAttachments,\n maxFileSize,\n paste = true,\n pasteAccept,\n clearOnSubmit = true,\n onAttachmentReject,\n dropzone = true,\n apiRef,\n onBlurCapture,\n notices,\n context,\n ...divProps\n } = props;\n const size = useThemeSize(sizeProp, chatbarSizePropDef);\n\n const isValueControlled = valueProp != null;\n const [valueUncontrolled, setValueUncontrolled] = React.useState<string>(defaultValue);\n const value = isValueControlled ? valueProp : valueUncontrolled;\n\n const isOpenControlled = openProp != null;\n const [openUncontrolled, setOpenUncontrolled] = React.useState<boolean>(defaultOpen);\n const open = isOpenControlled ? openProp : openUncontrolled;\n\n // Treat `attachments` as controlled if the prop is provided, even if its value is `undefined`.\n // This avoids switching between controlled and uncontrolled when a consumer sets\n // `attachments={undefined}` to clear attachments. In that case we normalize to an empty array.\n const isAttachmentsControlled = 'attachments' in props;\n const [attachmentsUncontrolled, setAttachmentsUncontrolled] = React.useState<ChatbarAttachment[]>(() => defaultAttachments ?? []);\n const attachments = React.useMemo(\n () => (isAttachmentsControlled ? (attachmentsProp ?? []) : attachmentsUncontrolled),\n [isAttachmentsControlled, attachmentsProp, attachmentsUncontrolled],\n );\n\n // `id` changes on every announcement so identical messages still update the live region\n const [announcement, setAnnouncementState] = React.useState({ text: '', id: 0 });\n const announce = React.useCallback((text: string) => setAnnouncementState((prev) => ({ text, id: prev.id + 1 })), []);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const composedRootRef = useComposedRefs(forwardedRef, rootRef);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n // Blur-collapse guards: `pickerOpenRef` is true while the native dialog is open,\n // `pressGuardRef` covers the gap between pointerdown on a trigger and its click\n // (Safari blurs the textarea before the click fires).\n const pickerOpenRef = React.useRef(false);\n const pressGuardRef = React.useRef(false);\n const pressGuardTimerRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const pickerRef = React.useRef<{ patterns: string[]; multiple: boolean } | null>(null);\n\n const acceptKey = toArray(accept).join(',');\n const pasteAcceptKey = toArray(pasteAccept).join(',');\n const accepts = React.useMemo(() => toArray(acceptKey), [acceptKey]);\n const pasteAccepts = React.useMemo(() => (pasteAcceptKey ? toArray(pasteAcceptKey) : accepts), [pasteAcceptKey, accepts]);\n\n // Latest props/state for stable callbacks. Synced during render (not in an effect) so\n // child layout effects that call setOpen/setValue see this render's handlers.\n const snapshot = {\n value,\n attachments,\n accepts,\n pasteAccepts,\n multiple,\n maxAttachments,\n maxFileSize,\n disabled,\n readOnly,\n expandOn,\n isValueControlled,\n isOpenControlled,\n isAttachmentsControlled,\n onValueChange,\n onOpenChange,\n onAttachmentsChange,\n onAttachmentReject,\n onSubmit,\n };\n const latest = React.useRef(snapshot);\n // eslint-disable-next-line react-hooks/refs -- read only in callbacks/effects; see comment above\n latest.current = snapshot;\n\n // Attachments set during the current event, before Root re-renders. Cleared at the end\n // of the task so a controlled parent that rejects the change is not overridden.\n const pendingAttachmentsRef = React.useRef<ChatbarAttachment[] | null>(null);\n const getAttachments = React.useCallback(() => pendingAttachmentsRef.current ?? latest.current.attachments, []);\n\n const setOpen = React.useCallback((next: boolean) => {\n if (!latest.current.isOpenControlled) setOpenUncontrolled(next);\n latest.current.onOpenChange?.(next);\n }, []);\n\n const setValue = React.useCallback((next: string) => {\n if (!latest.current.isValueControlled) setValueUncontrolled(next);\n latest.current.onValueChange?.(next);\n }, []);\n\n const setAttachments = React.useCallback((next: ChatbarAttachment[]) => {\n // Back-to-back updates in one event must see each other\n pendingAttachmentsRef.current = next;\n queueMicrotask(() => {\n pendingAttachmentsRef.current = null;\n });\n if (!latest.current.isAttachmentsControlled) setAttachmentsUncontrolled(next);\n latest.current.onAttachmentsChange?.(next);\n }, []);\n\n // Object URLs Chatbar created and still owns\n const ownedUrlsRef = React.useRef<Set<string>>(new Set());\n\n const addFiles = React.useCallback(\n (files: File[], patterns: string[], multiple: boolean = latest.current.multiple): number => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly || files.length === 0) return 0;\n\n const current = getAttachments();\n const next: ChatbarAttachment[] = [];\n const rejected: ChatbarAttachmentRejection[] = [];\n const remainingSlots = typeof cfg.maxAttachments === 'number' ? Math.max(cfg.maxAttachments - current.length, 0) : Infinity;\n const perActionLimit = multiple ? Infinity : 1;\n\n for (const file of files) {\n if (next.length >= remainingSlots || next.length >= perActionLimit) {\n rejected.push({ file, reason: 'count' });\n continue;\n }\n if (typeof cfg.maxFileSize === 'number' && file.size > cfg.maxFileSize) {\n rejected.push({ file, reason: 'size' });\n continue;\n }\n if (!matchesAccept(file, patterns)) {\n rejected.push({ file, reason: 'type' });\n continue;\n }\n const url = isImageLike(file.name, file.type) ? URL.createObjectURL(file) : undefined;\n if (url) ownedUrlsRef.current.add(url);\n next.push({ id: createAttachmentId(), name: file.name, size: file.size, type: file.type, file, url, status: 'idle' });\n }\n\n const messages: string[] = [];\n if (next.length > 0) {\n setAttachments(current.concat(next));\n if (cfg.expandOn !== 'none') setOpen(true);\n messages.push(`${plural(next.length, 'file')} attached.`);\n }\n if (rejected.length > 0) {\n cfg.onAttachmentReject?.(rejected);\n messages.push(`${plural(rejected.length, 'file')} could not be attached.`);\n }\n if (messages.length > 0) announce(messages.join(' '));\n return next.length;\n },\n [getAttachments, setAttachments, setOpen, announce],\n );\n\n const appendFiles = React.useCallback((files: File[]) => addFiles(files, latest.current.accepts), [addFiles]);\n const appendFilesFromPaste = React.useCallback((files: File[]) => addFiles(files, latest.current.pasteAccepts), [addFiles]);\n\n const removeAttachment = React.useCallback(\n (id: string) => {\n const current = getAttachments();\n const removed = current.find((a) => a.id === id);\n if (!removed) return;\n setAttachments(current.filter((a) => a.id !== id));\n announce(`Removed ${removed.name}.`);\n },\n [getAttachments, setAttachments, announce],\n );\n\n const submit = React.useCallback(\n (clear: boolean) => {\n const cfg = latest.current;\n if (cfg.disabled || cfg.readOnly) return false;\n const current = getAttachments();\n if (!hasText(cfg.value) && current.length === 0) return false;\n const payload = { value: cfg.value, attachments: current };\n // Hand preview URLs to the consumer only when they leave the chatbar; URLs still\n // rendered here stay owned so removing them later revokes them\n if (clear && cfg.onSubmit) {\n for (const att of current) if (att.url) ownedUrlsRef.current.delete(att.url);\n }\n cfg.onSubmit?.(payload);\n if (clear) {\n setValue('');\n setAttachments([]);\n }\n return true;\n },\n [getAttachments, setValue, setAttachments],\n );\n\n // Revoke owned object URLs that are no longer referenced by current attachments\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n if (owned.size === 0) return;\n const current = new Set(attachments.map((a) => a.url));\n for (const url of Array.from(owned)) {\n if (!current.has(url)) {\n URL.revokeObjectURL(url);\n owned.delete(url);\n }\n }\n }, [attachments]);\n\n // On unmount, revoke URLs only when Chatbar owns the attachment list;\n // controlled attachments may still be rendered by the parent.\n React.useEffect(() => {\n const owned = ownedUrlsRef.current;\n return () => {\n if (latest.current.isAttachmentsControlled) return;\n for (const url of Array.from(owned)) URL.revokeObjectURL(url);\n owned.clear();\n };\n }, []);\n\n const openFilePicker = React.useCallback((options?: FilePickerOptions) => {\n const cfg = latest.current;\n const input = fileInputRef.current;\n // The picker guard takes over from the press guard\n clearTimeout(pressGuardTimerRef.current);\n pressGuardRef.current = false;\n if (!input || cfg.disabled || cfg.readOnly) return;\n const patterns = options?.accept != null ? toArray(options.accept) : cfg.accepts;\n const multiple = options?.multiple ?? cfg.multiple;\n pickerRef.current = { patterns, multiple };\n input.accept = patterns.join(',');\n input.multiple = multiple;\n pickerOpenRef.current = true;\n input.click();\n // Browsers block the dialog outside a user gesture; if the window kept focus,\n // no dialog opened and no focus/cancel/change event will clear the guard\n setTimeout(() => {\n if (document.hasFocus()) pickerOpenRef.current = false;\n }, 1000);\n }, []);\n\n const beginFilePickerPress = React.useCallback(() => {\n // On touch (notably iOS), the compatibility mousedown, blur and click arrive in later\n // tasks than pointerup, so hold the guard until the click or a timeout\n pressGuardRef.current = true;\n clearTimeout(pressGuardTimerRef.current);\n pressGuardTimerRef.current = setTimeout(() => {\n pressGuardRef.current = false;\n }, 800);\n }, []);\n\n React.useEffect(() => () => clearTimeout(pressGuardTimerRef.current), []);\n\n // Clear the picker guard when the dialog closes, whichever way it closes\n React.useEffect(() => {\n const input = fileInputRef.current;\n const reset = () => {\n pickerOpenRef.current = false;\n };\n window.addEventListener('focus', reset);\n input?.addEventListener('cancel', reset);\n return () => {\n window.removeEventListener('focus', reset);\n input?.removeEventListener('cancel', reset);\n };\n }, []);\n\n const handleFileInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const files = Array.from(input.files ?? []);\n const picker = pickerRef.current;\n addFiles(files, picker?.patterns ?? latest.current.accepts, picker?.multiple);\n pickerOpenRef.current = false;\n pickerRef.current = null;\n // Reset so selecting the same file again still fires change\n input.value = '';\n },\n [addFiles],\n );\n\n const handleBlurCapture = React.useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n onBlurCapture?.(event);\n const cfg = latest.current;\n const rootEl = rootRef.current;\n if (!rootEl || cfg.expandOn === 'none') return;\n const nextTarget = event.relatedTarget as Node | null;\n if (nextTarget && rootEl.contains(nextTarget)) return;\n if (pickerOpenRef.current || pressGuardRef.current) return;\n if (!hasText(cfg.value) && getAttachments().length === 0) setOpen(false);\n },\n [onBlurCapture, setOpen, getAttachments],\n );\n\n const handleDrop = React.useCallback((files: File[]) => {\n appendFiles(files);\n }, [appendFiles]);\n\n // Validation happens in addFiles so drop, paste and picker share one rule set\n const { getRootProps, isDragActive } = useDropzone({\n onDrop: handleDrop,\n // Drop any earlier message so it is not re-announced when the drag hint goes away\n onDragEnter: () => announce(''),\n noClick: true,\n noKeyboard: true,\n // Textarea handles paste itself; letting the dropzone see it attaches twice\n noPaste: true,\n disabled: !dropzone || disabled || readOnly,\n });\n const dragActive = dropzone && isDragActive;\n\n React.useImperativeHandle(\n apiRef,\n () => ({\n focusTextarea: () => textareaRef.current?.focus({ preventScroll: true }),\n openFilePicker: () => openFilePicker(),\n }),\n [openFilePicker],\n );\n\n // Click-to-focus: focus textarea when clicking non-interactive areas inside the container\n const handleContainerPointerDown = React.useCallback(\n (event: React.PointerEvent) => {\n if (disabled) return;\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target;\n if (target instanceof Element && target.closest('button, [role=\"button\"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex=\"-1\"])')) return;\n event.preventDefault();\n textareaRef.current?.focus({ preventScroll: true });\n },\n [disabled],\n );\n\n const contextValue = React.useMemo<ChatbarContextValue>(\n () => ({\n open,\n setOpen,\n setValue,\n size,\n expandOn,\n minLines,\n maxLines,\n sendMode,\n disabled,\n readOnly,\n paste,\n clearOnSubmit,\n multiple,\n textareaRef,\n attachments,\n removeAttachment,\n submit,\n appendFiles,\n appendFilesFromPaste,\n openFilePicker,\n beginFilePickerPress,\n }),\n [\n open, setOpen, setValue, size, expandOn, minLines, maxLines, sendMode, disabled, readOnly, paste,\n clearOnSubmit, multiple, attachments, removeAttachment, submit, appendFiles, appendFilesFromPaste,\n openFilePicker, beginFilePickerPress,\n ],\n );\n\n return (\n <ChatbarContext.Provider value={contextValue}>\n <ChatbarValueContext.Provider value={value}>\n <>\n <div\n {...divProps}\n ref={composedRootRef}\n className={classNames('kui-ChatbarRoot', `kui-r-size-${size}`, className)}\n style={{ position: 'relative', width, maxWidth, ...style }}\n data-state={open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n data-drop-active={dragActive ? '' : undefined}\n data-accent-color={color}\n data-radius={radius}\n onBlurCapture={handleBlurCapture}\n >\n <input\n ref={fileInputRef}\n type=\"file\"\n tabIndex={-1}\n aria-hidden\n style={{ display: 'none' }}\n onChange={handleFileInputChange}\n />\n {notices ? (\n <div className=\"kui-ChatbarNotices\">\n <NoticeSizeContext.Provider value={size}>{notices}</NoticeSizeContext.Provider>\n </div>\n ) : null}\n <div {...(dropzone ? getRootProps() : {})} style={{ width: '100%', flex: '1 1 auto', minHeight: 0 }} onPointerDown={handleContainerPointerDown}>\n <div\n className={classNames('kui-ChatbarBox', `kui-variant-${variant ?? 'raised'}`)}\n style={{ position: 'relative' }}\n data-accent-color={color}\n data-radius={radius}\n >\n <div className=\"kui-ChatbarGrid\">\n {children}\n </div>\n {dragActive && (\n <div className=\"kui-ChatbarDropOverlay\" aria-hidden>\n <div className=\"kui-ChatbarDropContent\">\n <Text emphasis=\"medium\" size={size} weight=\"medium\">\n Drop files here to attach\n </Text>\n </div>\n </div>\n )}\n </div>\n </div>\n {context ? (\n <Text as=\"div\" size={size === '3' ? '2' : '1'} emphasis=\"medium\" className=\"kui-ChatbarContext\">\n {context}\n </Text>\n ) : null}\n <VisuallyHidden role=\"status\" aria-live=\"polite\">\n {dragActive ? 'Drop files here to attach.' : <span key={announcement.id}>{announcement.text}</span>}\n </VisuallyHidden>\n </div>\n </>\n </ChatbarValueContext.Provider>\n </ChatbarContext.Provider>\n );\n});\nRoot.displayName = 'Chatbar.Root';\n\n/**\n * Multi-line text input for Chatbar.\n * - Uses onChange to control value and avoid duplicate updates.\n * - Auto-resizes between minLines and maxLines.\n * - Expands on focus/overflow per `expandOn`.\n * - Paste-to-attach: when `paste` is enabled on Root, pasting files adds attachments.\n * - Provide `aria-label` or `aria-labelledby` for an accessible name.\n */\ninterface TextareaProps extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'size' | 'rows' | 'value' | 'defaultValue'> {\n asChild?: boolean;\n /**\n * When true, pressing Enter submits (Shift+Enter inserts a newline).\n * Works with every `sendMode`. Defaults to false.\n */\n submitOnEnter?: boolean;\n}\n\n/**\n * Chatbar multi-line text input.\n *\n * Behavior\n * - Controls the Chatbar value via React onChange.\n * - Auto-resizes between minLines and maxLines in a single layout effect, which\n * also opens the Chatbar when content overflows the compact height and\n * `expandOn` is `overflow` or `both`.\n * - Consumer handlers run first; calling `preventDefault` in `onKeyDown` or\n * `onPaste` skips the built-in submit or attach behavior.\n *\n * Accessibility\n * - Consumers should provide labeling via aria-label or aria-labelledby\n * on this component, as no implicit label is rendered.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>((props, forwardedRef) => {\n const {\n className,\n style,\n asChild,\n onFocus,\n onChange,\n onPaste,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n submitOnEnter = false,\n ...textareaProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n const { open, minLines, maxLines, expandOn, disabled, readOnly, setOpen, setValue, textareaRef, paste, appendFilesFromPaste, size, submit, clearOnSubmit } = ctx;\n const composedRef = useComposedRefs(forwardedRef, textareaRef);\n\n // Cached metrics to avoid repeated getComputedStyle calls\n const lineHeightRef = React.useRef(0);\n const paddingRef = React.useRef(0);\n const composingRef = React.useRef(false);\n\n const sizingRef = React.useRef({ open, minLines, maxLines });\n // Declared before the sizing effect so it runs first in the same commit\n useIsomorphicLayoutEffect(() => {\n sizingRef.current = { open, minLines, maxLines };\n }, [open, minLines, maxLines]);\n\n const recomputeMetrics = React.useCallback(() => {\n const el = textareaRef.current;\n if (!el) return;\n const computedStyle = window.getComputedStyle(el);\n lineHeightRef.current = parseFloat(computedStyle.lineHeight) || 20;\n paddingRef.current = (parseFloat(computedStyle.paddingTop) || 0) + (parseFloat(computedStyle.paddingBottom) || 0);\n }, [textareaRef]);\n\n // Sizes `el` for the given open state; caller must have set height to 'auto' first\n const applyHeight = React.useCallback((el: HTMLTextAreaElement, isOpen: boolean) => {\n const { minLines: min, maxLines: max } = sizingRef.current;\n const lineHeight = lineHeightRef.current;\n const padding = paddingRef.current;\n const minHeight = Math.ceil((isOpen ? min : 1) * lineHeight) + padding;\n const maxHeight = Math.ceil((isOpen ? max : 1) * lineHeight) + padding;\n const contentHeight = Math.max(el.scrollHeight, minHeight);\n el.style.height = `${Math.min(contentHeight, maxHeight)}px`;\n const overflowing = contentHeight > maxHeight;\n el.style.overflowY = overflowing ? 'auto' : 'hidden';\n el.style.maxHeight = overflowing ? `${maxHeight}px` : 'none';\n }, []);\n\n // Typography depends on size\n useIsomorphicLayoutEffect(() => {\n recomputeMetrics();\n }, [recomputeMetrics, size]);\n\n // Single place for sizing and overflow auto-open: one height reset, one scrollHeight read\n useIsomorphicLayoutEffect(() => {\n const el = textareaRef.current;\n if (!el) return;\n if (lineHeightRef.current === 0) recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n let isOpen = open;\n if (!open && (expandOn === 'overflow' || expandOn === 'both')) {\n const compactHeight = Math.ceil(lineHeightRef.current) + paddingRef.current;\n if (el.scrollHeight > compactHeight + 1) {\n isOpen = true;\n setOpen(true);\n }\n }\n applyHeight(el, isOpen);\n });\n }, [value, open, expandOn, minLines, maxLines, size, setOpen, textareaRef, recomputeMetrics, applyHeight]);\n\n // Width changes re-wrap text; re-measure only when the width actually changes\n React.useEffect(() => {\n const el = textareaRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return;\n let prevWidth = -1;\n const ro = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width === prevWidth) return;\n const first = prevWidth === -1;\n prevWidth = width;\n if (first) return;\n recomputeMetrics();\n withoutPlaceholder(el, () => {\n el.style.height = 'auto';\n applyHeight(el, sizingRef.current.open);\n });\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, [textareaRef, recomputeMetrics, applyHeight]);\n\n // Dev-only warning if no accessible name is provided\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n const hasLabel = textareaProps['aria-label'] != null || textareaProps['aria-labelledby'] != null;\n if (!hasLabel) {\n console.warn('[Chatbar.Textarea] Provide aria-label or aria-labelledby to ensure the control has an accessible name.');\n }\n // warn only on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleFocus = React.useCallback<React.FocusEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onFocus?.(event);\n if (disabled || readOnly) return;\n if ((expandOn === 'focus' || expandOn === 'both') && !open) setOpen(true);\n },\n [disabled, readOnly, expandOn, open, setOpen, onFocus],\n );\n\n const handleChange = React.useCallback<React.ChangeEventHandler<HTMLTextAreaElement>>(\n (event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n },\n [setValue, onChange],\n );\n\n const handlePaste = React.useCallback<React.ClipboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onPaste?.(event);\n if (event.defaultPrevented || !paste || disabled || readOnly) return;\n const files = Array.from(event.clipboardData?.items ?? [])\n .filter((item) => item.kind === 'file')\n .map((item) => item.getAsFile())\n .filter((f): f is File => !!f);\n if (files.length === 0) return;\n // Suppress the filename/text representation only when a file was actually attached\n if (appendFilesFromPaste(files) > 0) event.preventDefault();\n },\n [paste, disabled, readOnly, onPaste, appendFilesFromPaste],\n );\n\n const handleCompositionStart = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = true;\n onCompositionStart?.(event);\n },\n [onCompositionStart],\n );\n\n const handleCompositionEnd = React.useCallback<React.CompositionEventHandler<HTMLTextAreaElement>>(\n (event) => {\n composingRef.current = false;\n onCompositionEnd?.(event);\n },\n [onCompositionEnd],\n );\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLTextAreaElement>>(\n (event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !submitOnEnter) return;\n if (event.key !== 'Enter' || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;\n // Safari fires the IME-confirming Enter after compositionend with keyCode 229\n if (composingRef.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n // Plain Enter never inserts a newline when submitOnEnter is on, even with nothing to send\n event.preventDefault();\n submit(clearOnSubmit);\n },\n [submitOnEnter, onKeyDown, submit, clearOnSubmit],\n );\n\n const Comp = asChild ? Slot : 'textarea';\n return (\n <div className={classNames('kui-ChatbarField', 'kui-ChatbarTextarea', className)}>\n <Comp\n {...textareaProps}\n ref={composedRef}\n className=\"kui-ChatbarInput\"\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n disabled={disabled}\n readOnly={readOnly}\n rows={open ? minLines : 1}\n spellCheck={textareaProps.spellCheck ?? true}\n autoCorrect={textareaProps.autoCorrect ?? 'on'}\n style={style}\n />\n </div>\n );\n});\nTextarea.displayName = 'Chatbar.Textarea';\n\ninterface InlineSlotProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst InlineStart = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineStart', className)}>\n {children}\n </Comp>\n );\n});\nInlineStart.displayName = 'Chatbar.InlineStart';\n\nconst InlineEnd = React.forwardRef<HTMLDivElement, InlineSlotProps>((props, forwardedRef) => {\n const { children, asChild, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarInlineEnd', className)}>\n {children}\n </Comp>\n );\n});\nInlineEnd.displayName = 'Chatbar.InlineEnd';\n\n/**\n * Renders a horizontally scrollable list of attachments above the inline row.\n * Hidden when empty unless `forceMount`. Override per-item with `renderAttachment`.\n * `Chatbar.Item`s passed as children follow the attachments in the same row.\n */\ninterface AttachmentsRowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n forceMount?: boolean;\n /** If provided, custom-render a tile; otherwise default tile is used */\n renderAttachment?: (attachment: ChatbarAttachment) => React.ReactNode;\n /** `Chatbar.Item`s: things the message refers to that are not files. */\n children?: React.ReactNode;\n}\n\nconst AttachmentsRow = React.forwardRef<HTMLDivElement, AttachmentsRowProps>((props, forwardedRef) => {\n const { asChild, forceMount, renderAttachment, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const hasItems = React.Children.toArray(children).length > 0;\n if (ctx.attachments.length === 0 && !hasItems && !forceMount) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarAttachmentsRow', className)} role=\"list\" aria-label={divProps['aria-label'] ?? 'Attachments'}>\n <ScrollArea className=\"kui-ChatbarScrollArea\" scrollbars=\"horizontal\">\n <Flex align=\"center\" gap=\"3\" minWidth=\"fit-content\">\n {ctx.attachments.map((att) => (\n <Attachment key={att.id} attachment={att} asChild={!!renderAttachment}>\n {renderAttachment?.(att)}\n </Attachment>\n ))}\n {children}\n </Flex>\n </ScrollArea>\n </Comp>\n </div>\n );\n});\nAttachmentsRow.displayName = 'Chatbar.AttachmentsRow';\n\n/**\n * Moves focus off a pill that is about to unmount, to the next pill's remove\n * button, the previous one's, or the text, so keyboard users are not dropped\n * to <body>.\n */\nfunction moveFocusOffPill(button: HTMLButtonElement, textareaRef: React.RefObject<HTMLTextAreaElement | null>) {\n const pill = button.closest('[role=\"listitem\"]');\n const pills = pill?.parentElement ? Array.from(pill.parentElement.children) : [];\n const index = pill ? pills.indexOf(pill) : -1;\n const neighbour = pills[index + 1] ?? pills[index - 1];\n const nextButton = neighbour?.querySelector<HTMLButtonElement>('.kui-ChatbarItemRemove');\n if (nextButton) nextButton.focus();\n else textareaRef.current?.focus({ preventScroll: true });\n}\n\n/** The pill an attachment and an item share: a lead tile, a label and \u00D7. */\nconst Pill: React.FC<{\n lead: React.ReactNode;\n leadKind: 'image' | 'icon';\n label: React.ReactNode;\n /** Read after the label by screen readers only, e.g. a file's size. */\n detail?: string;\n removeLabel: string;\n onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}> = ({ lead, leadKind, label, detail, removeLabel, onRemove }) => {\n const ctx = useChatbarContext();\n return (\n <>\n <span className=\"kui-ChatbarItemLead\" data-kind={leadKind} aria-hidden>\n {lead}\n </span>\n <Text className=\"kui-ChatbarItemLabel\" size={ctx.size} truncate>\n {label}\n {detail ? <VisuallyHidden>, {detail}</VisuallyHidden> : null}\n </Text>\n {onRemove && (\n <Button iconOnly className=\"kui-ChatbarItemRemove\" aria-label={removeLabel} size=\"1\" variant=\"ghost\" color=\"gray\" onClick={onRemove}>\n <CloseIcon />\n </Button>\n )}\n </>\n );\n};\n\n/** Default tile renderer for a single attachment. */\ninterface AttachmentProps extends React.ComponentPropsWithoutRef<'div'> {\n attachment: ChatbarAttachment;\n asChild?: boolean;\n}\n\nconst STATUS_LABEL: Partial<Record<AttachmentStatus, string>> = { uploading: 'uploading', error: 'failed to upload' };\n\nconst Attachment = React.forwardRef<HTMLDivElement, AttachmentProps>((props, forwardedRef) => {\n const { attachment, asChild, className, children, ...divProps } = props;\n const ctx = useChatbarContext();\n const Comp = asChild ? Slot : 'div';\n const isImage = !!attachment.url && isImageLike(attachment.name, attachment.type);\n const sizeLabel = `${Math.ceil(attachment.size / 1024)} KB`;\n const statusLabel = attachment.status ? STATUS_LABEL[attachment.status] : undefined;\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n ctx.removeAttachment(attachment.id);\n };\n\n const lead =\n attachment.status === 'uploading' ? (\n <Spinner />\n ) : isImage ? (\n <img className=\"kui-ChatbarAttachmentImage\" src={attachment.url} alt=\"\" />\n ) : (\n <FileTextIcon />\n );\n\n return (\n <Comp\n {...divProps}\n ref={forwardedRef}\n className={classNames(children ? 'kui-ChatbarAttachment' : 'kui-ChatbarAttachment kui-ChatbarItem', className)}\n role=\"listitem\"\n data-kind={isImage ? 'image' : 'file'}\n data-status={attachment.status}\n title={attachment.name}\n >\n {children ?? (\n <Pill\n lead={lead}\n leadKind={isImage && attachment.status !== 'uploading' ? 'image' : 'icon'}\n label={attachment.name}\n detail={statusLabel ? `${sizeLabel}, ${statusLabel}` : sizeLabel}\n removeLabel={`Remove ${attachment.name}`}\n onRemove={locked ? undefined : handleRemove}\n />\n )}\n </Comp>\n );\n});\nAttachment.displayName = 'Chatbar.Attachment';\n\n/**\n * Something the message refers to that is not a file: a scene object, a\n * picked mode, a selection. The same pill as an attachment, placed in\n * `Chatbar.AttachmentsRow` as a child. The app owns the list, so removing one\n * calls `onRemove` and nothing else; leave it out for a pill that cannot be\n * removed.\n */\ninterface ItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'color'> {\n /** The label. Also names the remove button: \"Remove {label}\". */\n children: string;\n /** Drawn in the lead tile, tinted with `color`. */\n icon?: React.ReactNode;\n /** A thumbnail for the lead tile, in place of the icon. */\n image?: string;\n /** Tint of the icon tile. Defaults to gray. */\n color?: (typeof accentColors)[number];\n onRemove?: () => void;\n /** Overrides the remove button's label. */\n removeLabel?: string;\n}\n\nconst Item = React.forwardRef<HTMLDivElement, ItemProps>((props, forwardedRef) => {\n const { children, icon, image, color, onRemove, removeLabel, className, ...divProps } = props;\n const ctx = useChatbarContext();\n const locked = ctx.disabled || ctx.readOnly;\n\n const handleRemove = onRemove\n ? (event: React.MouseEvent<HTMLButtonElement>) => {\n moveFocusOffPill(event.currentTarget, ctx.textareaRef);\n onRemove();\n }\n : undefined;\n\n return (\n <div\n {...divProps}\n ref={forwardedRef}\n className={classNames('kui-ChatbarItem', className)}\n role=\"listitem\"\n data-accent-color={image ? undefined : (color ?? 'gray')}\n title={children}\n >\n <Pill\n lead={image ? <img className=\"kui-ChatbarAttachmentImage\" src={image} alt=\"\" /> : icon}\n leadKind={image ? 'image' : 'icon'}\n label={children}\n removeLabel={removeLabel ?? `Remove ${children}`}\n onRemove={locked ? undefined : handleRemove}\n />\n </div>\n );\n});\nItem.displayName = 'Chatbar.Item';\n\ninterface AttachTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n /** Overrides Root `accept` for files chosen through this trigger */\n accept?: string | string[];\n multiple?: boolean;\n}\n\nconst AttachTrigger = React.forwardRef<HTMLButtonElement, AttachTriggerProps>((props, forwardedRef) => {\n const { asChild, accept, multiple, disabled: disabledProp, onPointerDown, onClick, ...buttonProps } = props;\n const ctx = useChatbarContext();\n const disabled = disabledProp || ctx.disabled || ctx.readOnly;\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp\n {...buttonProps}\n ref={forwardedRef}\n className={classNames('kui-ChatbarAttachTrigger', buttonProps.className)}\n type={buttonProps.type ?? 'button'}\n aria-label={buttonProps['aria-label'] ?? 'Add attachments'}\n disabled={disabled}\n onPointerDown={(event: React.PointerEvent<HTMLButtonElement>) => {\n onPointerDown?.(event);\n if (!disabled && !event.defaultPrevented) ctx.beginFilePickerPress();\n }}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (disabled || event.defaultPrevented) return;\n ctx.openFilePicker({ accept, multiple });\n }}\n />\n );\n});\nAttachTrigger.displayName = 'Chatbar.AttachTrigger';\n\ninterface RowProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {\n asChild?: boolean;\n children?: React.ReactNode;\n}\n\nconst Row = React.forwardRef<HTMLDivElement, RowProps>((props, forwardedRef) => {\n const { asChild, children, className, ...divProps } = props;\n const ctx = useChatbarContext();\n if (!ctx.open) return null;\n const Comp = asChild ? Slot : 'div';\n return (\n <div>\n <Comp {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRow', className)}>\n <Flex align=\"center\" justify=\"between\" width=\"100%\">\n {children}\n </Flex>\n </Comp>\n </div>\n );\n});\nRow.displayName = 'Chatbar.Row';\n\ntype RowSlotProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst RowStart = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowStart', className)} />;\n});\nRowStart.displayName = 'Chatbar.RowStart';\n\nconst RowEnd = React.forwardRef<HTMLDivElement, RowSlotProps>((props, forwardedRef) => {\n const { className, ...divProps } = props;\n return <div {...divProps} ref={forwardedRef} className={classNames('kui-ChatbarRowEnd', className)} />;\n});\nRowEnd.displayName = 'Chatbar.RowEnd';\n\ntype SendStatus = 'ready' | 'submitted' | 'streaming' | 'error';\n\ntype SendProps = Omit<ButtonProps, 'aria-label' | 'aria-labelledby' | 'variant' | 'emphasis' | 'iconOnly' | 'fullWidth'> &\n ButtonRankProps & {\n /** Optional override for accessible name. Defaults to \"Send\". */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n asChild?: boolean;\n /** Clear message and attachments after sending. Defaults to Root `clearOnSubmit`. */\n clearOnSend?: boolean;\n /**\n * What the button means. `ready` sends. While a reply is `submitted` or `streaming` and the\n * box is empty, the button STOPS the reply (`onStop`); with a draft in the box it still sends,\n * and the app decides whether sending interrupts the reply. After an `error`, an empty box\n * makes it RETRY (`onRetry`). Default `ready`.\n */\n status?: SendStatus;\n /** Called when the button is pressed to stop a reply. */\n onStop?: () => void;\n /** Called when the button is pressed to retry after an error. */\n onRetry?: () => void;\n /** Accessible name while it stops. Default \"Stop\". */\n stopLabel?: string;\n /** Accessible name while it retries. Default \"Retry\". */\n retryLabel?: string;\n /** Glyph while it stops. Defaults to a square, or a spinner while `submitted`. */\n stopIcon?: React.ReactNode;\n /** Glyph while it retries. */\n retryIcon?: React.ReactNode;\n};\n\nconst Send = React.forwardRef<HTMLButtonElement, SendProps>((props, forwardedRef) => {\n const {\n asChild,\n clearOnSend,\n disabled,\n children,\n style,\n className,\n size: sizeProp,\n variant: variantProp, emphasis,\n tabIndex,\n onClick,\n status = 'ready',\n onStop,\n onRetry,\n stopLabel = 'Stop',\n retryLabel = 'Retry',\n stopIcon,\n retryIcon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...buttonProps\n } = props;\n const ctx = useChatbarContext();\n const value = React.useContext(ChatbarValueContext);\n\n const hasContent = hasText(value) || ctx.attachments.length > 0;\n const running = status === 'submitted' || status === 'streaming';\n const mode: 'send' | 'stop' | 'retry' = hasContent ? 'send' : running ? 'stop' : status === 'error' ? 'retry' : 'send';\n\n if (ctx.sendMode === 'never' && mode === 'send') return null;\n\n const visible = mode !== 'send' || ctx.sendMode === 'always' || hasContent;\n const inactive = mode === 'send' ? disabled || ctx.disabled || ctx.readOnly || !hasContent : disabled || ctx.disabled;\n\n const sendName = ariaLabel ?? 'Send';\n const labelProps: { 'aria-label': string } | { 'aria-labelledby': string } =\n mode === 'stop' ? { 'aria-label': stopLabel } : mode === 'retry' ? { 'aria-label': retryLabel } : ariaLabelledby ? { 'aria-labelledby': ariaLabelledby } : { 'aria-label': sendName };\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (event.defaultPrevented || inactive) return;\n if (mode === 'stop') {\n onStop?.();\n return;\n }\n if (mode === 'retry') {\n onRetry?.();\n return;\n }\n const clear = clearOnSend ?? ctx.clearOnSubmit;\n // Clearing hides and disables this button; keep keyboard focus in the composer\n if (ctx.submit(clear) && clear) ctx.textareaRef.current?.focus({ preventScroll: true });\n };\n\n const glyph =\n mode === 'stop' ? (\n stopIcon ?? (status === 'submitted' ? <Spinner /> : (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden>\n <rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n </svg>\n ))\n ) : mode === 'retry' ? (\n retryIcon ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M3 12a9 9 0 1 0 3-6.7L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n )\n ) : (\n children ?? (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n )\n );\n\n return (\n <Button\n iconOnly\n {...buttonProps}\n ref={forwardedRef}\n size={sizeProp ?? ctx.size}\n {...(emphasis ? { emphasis } : { variant: variantProp ?? (ctx.open || mode !== 'send' ? 'solid' : 'ghost') })}\n disabled={inactive}\n className={classNames('kui-ChatbarSend', className)}\n style={{ opacity: visible ? 1 : 0, pointerEvents: visible ? undefined : 'none', ...style }}\n // Hidden Send must not be reachable by keyboard or announced\n aria-hidden={visible ? undefined : true}\n tabIndex={visible ? tabIndex : -1}\n asChild={asChild}\n onClick={handleClick}\n data-status={status}\n data-mode={mode}\n {...labelProps}\n >\n {glyph}\n </Button>\n );\n});\nSend.displayName = 'Chatbar.Send';\n\nexport { Root, Textarea, InlineStart, InlineEnd, AttachmentsRow, Attachment, Item, AttachTrigger, Row, RowStart, RowEnd, Send };\nexport type {\n RootProps as ChatbarRootProps,\n TextareaProps as ChatbarTextareaProps,\n InlineSlotProps as ChatbarInlineSlotProps,\n AttachmentsRowProps as ChatbarAttachmentsRowProps,\n AttachmentProps as ChatbarAttachmentProps,\n ItemProps as ChatbarItemProps,\n AttachTriggerProps as ChatbarAttachTriggerProps,\n RowProps as ChatbarRowProps,\n RowSlotProps as ChatbarRowSlotProps,\n SendProps as ChatbarSendProps,\n ChatbarAttachment,\n ChatbarAttachmentRejection,\n ChatbarRejectReason,\n ChatbarSubmitPayload,\n AttachmentStatus as ChatbarAttachmentStatus,\n ExpandOn as ChatbarExpandOn,\n SendMode as ChatbarSendMode,\n SendStatus as ChatbarSendStatus,\n};\n"],
5
- "mappings": "0cAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,GAAA,eAAAC,GAAA,mBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,QAAAC,GAAA,WAAAC,GAAA,aAAAC,GAAA,SAAAC,GAAA,aAAAC,KAAA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBAChC,OAAS,eAAAC,OAAmB,iBAkB5B,IAAMC,GAA4B,OAAO,OAAW,IAAoB,kBAAwB,YAoBhG,SAASC,GAAmBC,EAAyBC,EAA2B,CAC9E,GAAM,CAAE,YAAAC,CAAY,EAAIF,EACxB,GAAI,CAACE,EAAa,CAChBD,EAAQ,EACR,MACF,CACAD,EAAG,YAAc,GACjB,GAAI,CACFC,EAAQ,CACV,QAAE,CACAD,EAAG,YAAcE,CACnB,CACF,CA4EA,IAAMC,GAAqB,CAAE,OAAQ,CAAC,IAAK,IAAK,GAAG,CAAW,EAExDC,GAAuB,gBAA0C,IAAI,EAErEC,GAA4B,gBAAsB,EAAE,EAEpDC,EAAoB,IAAM,CAC9B,IAAMC,EAAY,aAAWH,EAAc,EAC3C,GAAI,CAACG,EAAK,MAAM,IAAI,MAAM,0DAA0D,EACpF,OAAOA,CACT,EAEMC,GAAWC,GACf,MAAM,QAAQA,CAAG,EAAIA,EAAM,OAAOA,GAAQ,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AI,EAAG,cAAeA,EAAU,OAAY,OAAQ,GAAG/N,CAAM,EAEzF,cAAa+N,EAAU,OAAY,GACnC,SAAUA,EAAUZ,EAAW,GAC/B,QAASzF,EACT,QAASwG,EACT,cAAad,EACb,YAAWU,EACV,GAAGG,GAEHE,CACH,CAEJ,CAAC,EACDpB,GAAK,YAAc",
6
- "names": ["chatbar_exports", "__export", "AttachTrigger", "Attachment", "AttachmentsRow", "InlineEnd", "InlineStart", "Item", "Root", "Row", "RowEnd", "RowStart", "Send", "Textarea", "React", "classNames", "useComposedRefs", "useDropzone", "useIsomorphicLayoutEffect", "withoutPlaceholder", "el", "measure", "placeholder", "chatbarSizePropDef", "ChatbarContext", "ChatbarValueContext", "useChatbarContext", "ctx", "toArray", "val", "s", "matchesAccept", "file", "patterns", "mime", "name", "patRaw", "pat", "type", "subtype", "fmType", "fmSubtype", "IMAGE_EXT_RE", "isImageLike", "hasText", "value", "plural", "n", "word", "attachmentCounter", "createAttachmentId", "Root", "props", "forwardedRef", "className", "style", "children", "valueProp", "defaultValue", "onValueChange", "openProp", "defaultOpen", "onOpenChange", "expandOn", "minLines", "maxLines", "sendMode", "disabled", "readOnly", "onSubmit", "sizeProp", "variant", "color", "radius", "width", "maxWidth", "attachmentsProp", "defaultAttachments", "onAttachmentsChange", "accept", "multiple", "maxAttachments", "maxFileSize", "paste", "pasteAccept", "clearOnSubmit", "onAttachmentReject", "dropzone", "apiRef", "onBlurCapture", "notices", "context", "divProps", "size", "useThemeSize", "isValueControlled", "valueUncontrolled", "setValueUncontrolled", "isOpenControlled", "openUncontrolled", "setOpenUncontrolled", "open", "isAttachmentsControlled", "attachmentsUncontrolled", "setAttachmentsUncontrolled", "attachments", "announcement", "setAnnouncementState", "announce", "text", "prev", "rootRef", "composedRootRef", "useComposedRefs", "textareaRef", "fileInputRef", "pickerOpenRef", "pressGuardRef", "pressGuardTimerRef", "pickerRef", "acceptKey", "pasteAcceptKey", "accepts", "pasteAccepts", "snapshot", "latest", "pendingAttachmentsRef", "getAttachments", "setOpen", "next", "setValue", "setAttachments", "ownedUrlsRef", "addFiles", "files", "cfg", "current", "rejected", "remainingSlots", "perActionLimit", "url", "messages", "appendFiles", "appendFilesFromPaste", "removeAttachment", "id", "removed", "a", "submit", "clear", "payload", "att", "owned", "openFilePicker", "options", "input", "beginFilePickerPress", "reset", "handleFileInputChange", "event", "picker", "handleBlurCapture", "rootEl", "nextTarget", "handleDrop", "getRootProps", "isDragActive", "useDropzone", "dragActive", "handleContainerPointerDown", "target", "contextValue", "classNames", "NoticeSizeContext", "Text", "VisuallyHidden", "Textarea", "asChild", "onFocus", "onChange", "onPaste", "onKeyDown", "onCompositionStart", "onCompositionEnd", "submitOnEnter", "textareaProps", "composedRef", "lineHeightRef", "paddingRef", "composingRef", "sizingRef", "recomputeMetrics", "computedStyle", "applyHeight", "isOpen", "min", "max", "lineHeight", "padding", "minHeight", "maxHeight", "contentHeight", "overflowing", "compactHeight", "prevWidth", "ro", "entries", "first", "handleFocus", "handleChange", "handlePaste", "item", "f", "handleCompositionStart", "handleCompositionEnd", "handleKeyDown", "Comp", "Slot", "InlineStart", "InlineEnd", "AttachmentsRow", "forceMount", "renderAttachment", "hasItems", "ScrollArea", "Flex", "Attachment", "moveFocusOffPill", "button", "pill", "pills", "index", "nextButton", "Pill", "lead", "leadKind", "label", "detail", "removeLabel", "onRemove", "Button", "CloseIcon", "STATUS_LABEL", "attachment", "isImage", "sizeLabel", "statusLabel", "locked", "handleRemove", "Spinner", "FileTextIcon", "Item", "icon", "image", "AttachTrigger", "disabledProp", "onPointerDown", "onClick", "buttonProps", "Row", "RowStart", "RowEnd", "Send", "clearOnSend", "variantProp", "emphasis", "tabIndex", "status", "onStop", "onRetry", "stopLabel", "retryLabel", "stopIcon", "retryIcon", "ariaLabel", "ariaLabelledby", "hasContent", "mode", "visible", "inactive", "labelProps", "handleClick", "glyph"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as T}from"./chunk-PJR6GRZC.js";import{e as C}from"./chunk-3YLYGKFB.js";import{a as P}from"./chunk-ELAW7ZUG.js";import*as t from"react";import G from"classnames";import{Slider as b}from"radix-ui";var L=t.forwardRef((x,N)=>{let v=C(x,T.size),{className:A,color:V,radius:M,tabIndex:h,...n}=P(v,T),{ticks:s,showTickLabels:D,snapToTicks:p,unit:i}=v,u=n.min??0,o=n.max??100,c=n.value??n.defaultValue??[u],y=Array.isArray(c)&&c.length>1,E=n.step,l=t.useMemo(()=>s?[...s].sort((e,r)=>e.value-r.value):[],[s]),R=t.useCallback(e=>{if(!p||!l.length)return e;let r=0,a=l.length-1;if(e<=l[r].value)return l[r].value;if(e>=l[a].value)return l[a].value;for(;r<=a;){let f=Math.floor((r+a)/2);if(l[f].value===e)return e;l[f].value<e?r=f+1:a=f-1}let w=Math.abs(e-l[a].value),j=Math.abs(e-l[r].value);return w<=j?l[a].value:l[r].value},[p,l]),S=t.useCallback(e=>{let r=a=>i?`${a} ${i}`:a.toString();return e.length===1?`${r(e[0])} out of ${r(o)}`:e.length===2?`${r(e[0])} to ${r(e[1])} out of ${r(o)}`:`${e.map(r).join(", ")} out of ${r(o)}`},[i,o]),$=t.useMemo(()=>s?s.map((e,r)=>({...e,percentage:(e.value-u)/(o-u)*100,index:r})):null,[s,u,o]),m=t.useRef(null),d=t.useRef(null),{onValueChange:k}=n,g=t.useCallback(e=>{let r=p&&s?e.map(a=>R(a)):e;if(m.current){let a=S(r);m.current.textContent=a,d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{m.current&&(m.current.textContent="")},1e3)}k?.(r)},[p,s,R,S,k]);return t.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),t.createElement("div",{className:"kui-SliderContainer"},t.createElement("div",{ref:m,"aria-live":"polite","aria-atomic":"true",className:"kui-sr-only"}),t.createElement(b.Root,{"data-accent-color":V,"data-radius":M,ref:N,...n,step:E,onValueChange:g,asChild:!1,className:G("kui-SliderRoot",A),"aria-valuemin":u,"aria-valuemax":o,"aria-valuenow":Array.isArray(c)?c[0]:c,"aria-valuetext":S(c),"aria-label":v["aria-label"]||`${y?"Range":"Value"} slider`},t.createElement(b.Track,{className:"kui-SliderTrack"},t.createElement(b.Range,{className:"kui-SliderRange","data-inverted":n.inverted?"":void 0})),(n.value??n.defaultValue??[]).map((e,r)=>t.createElement(b.Thumb,{key:r,className:"kui-SliderThumb",...h!==void 0?{tabIndex:h}:void 0,"aria-label":y?`${r===0?"Minimum":r===1?"Maximum":`Thumb ${r+1}`} value: ${i?`${e} ${i}`:e}`:`Slider value: ${i?`${e} ${i}`:e}`,"aria-valuetext":i?`${e} ${i}`:e.toString()}))),$&&t.createElement("div",{className:"kui-SliderTicks",role:"group","aria-label":"Slider tick marks"},$.map(e=>t.createElement("button",{key:e.index,className:"kui-SliderTick",style:{left:`${e.percentage}%`},onClick:()=>{let r=n.value??n.defaultValue??[u],a=Array.isArray(r)?r.map(()=>e.value):[e.value];g(a)},"aria-label":`Set to ${e.label||(i?`${e.value} ${i}`:e.value)}`,"aria-describedby":e.label?void 0:`tick-${e.index}-value`,type:"button"},t.createElement("div",{className:"kui-SliderTickMark"}),e.label&&D!==!1&&t.createElement("div",{className:"kui-SliderTickLabel"},e.label),!e.label&&t.createElement("span",{id:`tick-${e.index}-value`,className:"sr-only"},i?`${e.value} ${i}`:e.value)))))});L.displayName="Slider";export{L as a};
2
- //# sourceMappingURL=chunk-GLV7VGBH.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/slider.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slider as SliderPrimitive } from 'radix-ui';\n\nimport { sliderPropDefs } from './slider.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SliderElement = React.ElementRef<typeof SliderPrimitive.Root>;\ntype SliderOwnProps = GetPropDefTypes<typeof sliderPropDefs>;\ninterface SliderProps\n extends ComponentPropsWithout<\n typeof SliderPrimitive.Root,\n 'asChild' | 'color' | 'children' | 'defaultChecked'\n >,\n SliderOwnProps {\n ticks?: Array<{ value: number; label?: string }>;\n unit?: string;\n}\nconst Slider = React.forwardRef<SliderElement, SliderProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, sliderPropDefs.size);\n const { className, color, radius, tabIndex, ...sliderProps } = extractProps(\n props,\n sliderPropDefs,\n );\n const { ticks, showTickLabels, snapToTicks, unit } = props;\n\n const min = sliderProps.min ?? 0;\n const max = sliderProps.max ?? 100;\n\n // Current value for accessibility\n const currentValue = sliderProps.value ?? sliderProps.defaultValue ?? [min];\n const isRange = Array.isArray(currentValue) && currentValue.length > 1;\n\n // For snapping to ticks, we need to handle this differently\n // Radix slider doesn't support arbitrary step values, so we'll handle snapping in the onValueChange\n const step = sliderProps.step;\n\n // Optimized snap-to-ticks with memoized sorted ticks\n const sortedTicks = React.useMemo(\n () => (ticks ? [...ticks].sort((a, b) => a.value - b.value) : []),\n [ticks],\n );\n\n // Function to snap value to nearest tick (optimized)\n const snapToNearestTick = React.useCallback(\n (value: number): number => {\n if (!snapToTicks || !sortedTicks.length) return value;\n\n // Binary search for closest tick\n let left = 0;\n let right = sortedTicks.length - 1;\n\n if (value <= sortedTicks[left].value) return sortedTicks[left].value;\n if (value >= sortedTicks[right].value) return sortedTicks[right].value;\n\n while (left <= right) {\n const mid = Math.floor((left + right) / 2);\n if (sortedTicks[mid].value === value) return value;\n\n if (sortedTicks[mid].value < value) {\n left = mid + 1;\n } else {\n right = mid - 1;\n }\n }\n\n // Find closest between left and right\n const leftDistance = Math.abs(value - sortedTicks[right].value);\n const rightDistance = Math.abs(value - sortedTicks[left].value);\n\n return leftDistance <= rightDistance ? sortedTicks[right].value : sortedTicks[left].value;\n },\n [snapToTicks, sortedTicks],\n );\n\n // Format value text for accessibility\n const formatValueText = React.useCallback(\n (values: number[]): string => {\n const formatValue = (val: number) => (unit ? `${val} ${unit}` : val.toString());\n\n if (values.length === 1) {\n return `${formatValue(values[0])} out of ${formatValue(max)}`;\n } else if (values.length === 2) {\n return `${formatValue(values[0])} to ${formatValue(values[1])} out of ${formatValue(max)}`;\n } else {\n return `${values.map(formatValue).join(', ')} out of ${formatValue(max)}`;\n }\n },\n [unit, max],\n );\n\n // Memoize tick elements for performance\n const tickElements = React.useMemo(() => {\n if (!ticks) return null;\n\n return ticks.map((tick, index) => ({\n ...tick,\n percentage: ((tick.value - min) / (max - min)) * 100,\n index,\n }));\n }, [ticks, min, max]);\n\n // Live region ref for accessibility announcements (no state = no re-renders)\n const announceRef = React.useRef<HTMLDivElement>(null);\n const announceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const { onValueChange } = sliderProps;\n // Handle value changes with snapping\n const handleValueChange = React.useCallback(\n (newValue: number[]) => {\n const finalValue =\n snapToTicks && ticks ? newValue.map((v) => snapToNearestTick(v)) : newValue;\n\n // Update live region for screen readers (direct DOM update, no React state)\n if (announceRef.current) {\n const valueText = formatValueText(finalValue);\n announceRef.current.textContent = valueText;\n\n // Clear after delay to prevent spam\n if (announceTimeoutRef.current) {\n clearTimeout(announceTimeoutRef.current);\n }\n announceTimeoutRef.current = setTimeout(() => {\n if (announceRef.current) {\n announceRef.current.textContent = '';\n }\n }, 1000);\n }\n\n onValueChange?.(finalValue);\n },\n [snapToTicks, ticks, snapToNearestTick, formatValueText, onValueChange],\n );\n\n // Cleanup timeout on unmount\n React.useEffect(() => {\n return () => {\n if (announceTimeoutRef.current) {\n clearTimeout(announceTimeoutRef.current);\n }\n };\n }, []);\n\n return (\n <div className=\"kui-SliderContainer\">\n {/* Live region for screen reader announcements */}\n <div\n ref={announceRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"kui-sr-only\"\n />\n\n <SliderPrimitive.Root\n data-accent-color={color}\n data-radius={radius}\n ref={forwardedRef}\n {...sliderProps}\n step={step}\n onValueChange={handleValueChange}\n asChild={false}\n className={classNames('kui-SliderRoot', className)}\n // Essential ARIA attributes for WCAG 2.2 AA compliance\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={Array.isArray(currentValue) ? currentValue[0] : (currentValue as number)}\n aria-valuetext={formatValueText(currentValue as number[])}\n aria-label={props['aria-label'] || `${isRange ? 'Range' : 'Value'} slider`}\n >\n <SliderPrimitive.Track className=\"kui-SliderTrack\">\n <SliderPrimitive.Range\n className=\"kui-SliderRange\"\n data-inverted={sliderProps.inverted ? '' : undefined}\n />\n </SliderPrimitive.Track>\n {(sliderProps.value ?? sliderProps.defaultValue ?? []).map((value, index) => (\n <SliderPrimitive.Thumb\n key={index}\n className=\"kui-SliderThumb\"\n {...(tabIndex !== undefined ? { tabIndex } : undefined)}\n aria-label={\n isRange\n ? `${index === 0 ? 'Minimum' : index === 1 ? 'Maximum' : `Thumb ${index + 1}`} value: ${unit ? `${value} ${unit}` : value}`\n : `Slider value: ${unit ? `${value} ${unit}` : value}`\n }\n aria-valuetext={unit ? `${value} ${unit}` : value.toString()}\n />\n ))}\n </SliderPrimitive.Root>\n {tickElements && (\n <div className=\"kui-SliderTicks\" role=\"group\" aria-label=\"Slider tick marks\">\n {tickElements.map((tick) => {\n return (\n <button\n key={tick.index}\n className=\"kui-SliderTick\"\n // Only `left` varies per tick; the centring transform lives in `.kui-SliderTick`.\n style={{ left: `${tick.percentage}%` }}\n onClick={() => {\n const currentValues = sliderProps.value ?? sliderProps.defaultValue ?? [min];\n const newValue = Array.isArray(currentValues)\n ? currentValues.map(() => tick.value)\n : [tick.value];\n\n handleValueChange(newValue);\n }}\n aria-label={`Set to ${tick.label || (unit ? `${tick.value} ${unit}` : tick.value)}`}\n aria-describedby={tick.label ? undefined : `tick-${tick.index}-value`}\n type=\"button\"\n >\n <div className=\"kui-SliderTickMark\" />\n {tick.label && showTickLabels !== false && (\n <div className=\"kui-SliderTickLabel\">{tick.label}</div>\n )}\n {!tick.label && (\n <span id={`tick-${tick.index}-value`} className=\"sr-only\">\n {unit ? `${tick.value} ${unit}` : tick.value}\n </span>\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n});\nSlider.displayName = 'Slider';\n\nexport { Slider };\nexport type { SliderProps };\n"],
5
- "mappings": "wHAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAoB1C,IAAMC,EAAe,aAAuC,CAACC,EAAUC,IAAiB,CACtF,IAAMC,EAAQC,EAAkBH,EAAUI,EAAe,IAAI,EACvD,CAAE,UAAAC,EAAW,MAAAC,EAAO,OAAAC,EAAQ,SAAAC,EAAU,GAAGC,CAAY,EAAIC,EAC7DR,EACAE,CACF,EACM,CAAE,MAAAO,EAAO,eAAAC,EAAgB,YAAAC,EAAa,KAAAC,CAAK,EAAIZ,EAE/Ca,EAAMN,EAAY,KAAO,EACzBO,EAAMP,EAAY,KAAO,IAGzBQ,EAAeR,EAAY,OAASA,EAAY,cAAgB,CAACM,CAAG,EACpEG,EAAU,MAAM,QAAQD,CAAY,GAAKA,EAAa,OAAS,EAI/DE,EAAOV,EAAY,KAGnBW,EAAoB,UACxB,IAAOT,EAAQ,CAAC,GAAGA,CAAK,EAAE,KAAK,CAACU,EAAGC,IAAMD,EAAE,MAAQC,EAAE,KAAK,EAAI,CAAC,EAC/D,CAACX,CAAK,CACR,EAGMY,EAA0B,cAC7BC,GAA0B,CACzB,GAAI,CAACX,GAAe,CAACO,EAAY,OAAQ,OAAOI,EAGhD,IAAIC,EAAO,EACPC,EAAQN,EAAY,OAAS,EAEjC,GAAII,GAASJ,EAAYK,CAAI,EAAE,MAAO,OAAOL,EAAYK,CAAI,EAAE,MAC/D,GAAID,GAASJ,EAAYM,CAAK,EAAE,MAAO,OAAON,EAAYM,CAAK,EAAE,MAEjE,KAAOD,GAAQC,GAAO,CACpB,IAAMC,EAAM,KAAK,OAAOF,EAAOC,GAAS,CAAC,EACzC,GAAIN,EAAYO,CAAG,EAAE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GAAGU,CAAK,IAAIV,CAAI,GAAKU,CAAK,GACvH,iBAAiBV,EAAO,GAAGU,CAAK,IAAIV,CAAI,GAAKU,CAAK,GAExD,iBAAgBV,EAAO,GAAGU,CAAK,IAAIV,CAAI,GAAKU,EAAM,SAAS,EAC7D,CACD,CACH,EACCU,GACC,gBAAC,OAAI,UAAU,kBAAkB,KAAK,QAAQ,aAAW,qBACtDA,EAAa,IAAKC,GAEf,gBAAC,UACC,IAAKA,EAAK,MACV,UAAU,iBAEV,MAAO,CAAE,KAAM,GAAGA,EAAK,UAAU,GAAI,EACrC,QAAS,IAAM,CACb,IAAMY,EAAgBtC,EAAY,OAASA,EAAY,cAAgB,CAACM,CAAG,EACrE0B,EAAW,MAAM,QAAQM,CAAa,EACxCA,EAAc,IAAI,IAAMZ,EAAK,KAAK,EAClC,CAACA,EAAK,KAAK,EAEfK,EAAkBC,CAAQ,CAC5B,EACA,aAAY,UAAUN,EAAK,QAAUrB,EAAO,GAAGqB,EAAK,KAAK,IAAIrB,CAAI,GAAKqB,EAAK,MAAM,GACjF,mBAAkBA,EAAK,MAAQ,OAAY,QAAQA,EAAK,KAAK,SAC7D,KAAK,UAEL,gBAAC,OAAI,UAAU,qBAAqB,EACnCA,EAAK,OAASvB,IAAmB,IAChC,gBAAC,OAAI,UAAU,uBAAuBuB,EAAK,KAAM,EAElD,CAACA,EAAK,OACL,gBAAC,QAAK,GAAI,QAAQA,EAAK,KAAK,SAAU,UAAU,WAC7CrB,EAAO,GAAGqB,EAAK,KAAK,IAAIrB,CAAI,GAAKqB,EAAK,KACzC,CAEJ,CAEH,CACH,CAEJ,CAEJ,CAAC,EACDpC,EAAO,YAAc",
6
- "names": ["React", "classNames", "SliderPrimitive", "Slider", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "sliderPropDefs", "className", "color", "radius", "tabIndex", "sliderProps", "extractProps", "ticks", "showTickLabels", "snapToTicks", "unit", "min", "max", "currentValue", "isRange", "step", "sortedTicks", "a", "b", "snapToNearestTick", "value", "left", "right", "mid", "leftDistance", "rightDistance", "formatValueText", "values", "formatValue", "val", "tickElements", "tick", "index", "announceRef", "announceTimeoutRef", "onValueChange", "handleValueChange", "newValue", "finalValue", "v", "valueText", "SliderPrimitive", "classNames", "currentValues"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as A,b as g,c as R,d as u,e as y}from"./chunk-OY5NT7VT.js";import{e as f}from"./chunk-3YLYGKFB.js";import{a as i}from"./chunk-ELAW7ZUG.js";import{a as w}from"./chunk-OS3FCYZY.js";var x={};w(x,{Content:()=>H,Header:()=>v,Item:()=>T,Root:()=>C,Trigger:()=>E});import*as o from"react";import p from"classnames";import{Accordion as m}from"radix-ui";var C=o.forwardRef((r,t)=>{let e=f(r,A.size),{className:c,radius:s,color:P,...a}=i(e,A),n=a;n.type==="single"&&n.collapsible===void 0&&(n.collapsible=!0);let I=o.useCallback(d=>{if(n.type==="multiple"){let l=d.currentTarget.querySelectorAll("[data-radix-accordion-item]");d.key==="Home"?(d.preventDefault(),l[0]?.querySelector("[data-radix-accordion-trigger]")?.focus()):d.key==="End"&&(d.preventDefault(),l[l.length-1]?.querySelector("[data-radix-accordion-trigger]")?.focus())}},[n.type]);return o.createElement(m.Root,{...n,ref:t,className:p("kui-AccordionRoot",c),"data-accent-color":P,"data-radius":s,onKeyDown:I})});C.displayName="Accordion.Root";var T=o.forwardRef((r,t)=>{let{className:e,...c}=i(r,g);return o.createElement(m.Item,{...c,ref:t,className:p("kui-AccordionItem",e)})});T.displayName="Accordion.Item";var v=o.forwardRef((r,t)=>{let{className:e,...c}=i(r,R);return o.createElement(m.Header,{...c,ref:t,className:p("kui-AccordionHeader",e)})});v.displayName="Accordion.Header";var E=o.forwardRef(({children:r,...t},e)=>{let{className:c,...s}=i(t,u),P=o.useRef(null);return o.createElement(m.Trigger,{...s,ref:a=>{P.current=a,typeof e=="function"?e(a):e&&(e.current=a)},className:p("kui-AccordionTrigger",c)},r)});E.displayName="Accordion.Trigger";var H=o.forwardRef((r,t)=>{let{className:e,children:c,...s}=i(r,y);return o.createElement(m.Content,{...s,ref:t,className:p("kui-AccordionContent",e),"aria-live":"polite"},o.createElement("div",{className:"kui-AccordionContentInner"},c))});H.displayName="Accordion.Content";export{C as a,T as b,v as c,E as d,H as e,x as f};
2
- //# sourceMappingURL=chunk-HIKMKGPT.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/accordion.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Accordion as AccordionPrimitive } from 'radix-ui';\n\nimport {\n accordionRootPropDefs,\n accordionItemPropDefs,\n accordionHeaderPropDefs,\n accordionTriggerPropDefs,\n accordionContentPropDefs,\n} from './accordion.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\n\nimport type {\n AccordionRootOwnProps,\n AccordionItemOwnProps,\n AccordionHeaderOwnProps,\n AccordionTriggerOwnProps,\n AccordionContentOwnProps,\n} from './accordion.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// Root component\ntype AccordionRootElement = React.ElementRef<typeof AccordionPrimitive.Root>;\ninterface AccordionRootProps\n extends ComponentPropsWithout<typeof AccordionPrimitive.Root, RemovedProps>,\n AccordionRootOwnProps {}\n\nconst AccordionRoot = React.forwardRef<AccordionRootElement, AccordionRootProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, accordionRootPropDefs.size);\n const { className, radius, color, ...extractedRadixProps } =\n extractProps(props, accordionRootPropDefs);\n\n const radixProps = extractedRadixProps as React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Root\n >;\n\n\n // Ensure single accordions can collapse by default unless explicitly set\n if (radixProps.type === 'single' && radixProps.collapsible === undefined) {\n radixProps.collapsible = true;\n }\n\n // Handle Home/End key navigation for multi-item accordions\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (radixProps.type === 'multiple') {\n const items = event.currentTarget.querySelectorAll('[data-radix-accordion-item]');\n\n if (event.key === 'Home') {\n event.preventDefault();\n const firstTrigger = items[0]?.querySelector(\n '[data-radix-accordion-trigger]',\n ) as HTMLElement;\n firstTrigger?.focus();\n } else if (event.key === 'End') {\n event.preventDefault();\n const lastTrigger = items[items.length - 1]?.querySelector(\n '[data-radix-accordion-trigger]',\n ) as HTMLElement;\n lastTrigger?.focus();\n }\n }\n },\n [radixProps.type],\n );\n\n return (\n <AccordionPrimitive.Root\n {...radixProps}\n ref={forwardedRef}\n className={classNames('kui-AccordionRoot', className)}\n data-accent-color={color}\n data-radius={radius}\n onKeyDown={handleKeyDown}\n />\n );\n },\n);\nAccordionRoot.displayName = 'Accordion.Root';\n\n// Item component\ntype AccordionItemElement = React.ElementRef<typeof AccordionPrimitive.Item>;\ninterface AccordionItemProps\n extends ComponentPropsWithout<typeof AccordionPrimitive.Item, RemovedProps>,\n AccordionItemOwnProps {}\n\nconst AccordionItem = React.forwardRef<AccordionItemElement, AccordionItemProps>(\n (props, forwardedRef) => {\n const { className, ...itemProps } = extractProps(props, accordionItemPropDefs);\n\n return (\n <AccordionPrimitive.Item\n {...itemProps}\n ref={forwardedRef}\n className={classNames('kui-AccordionItem', className)}\n />\n );\n },\n);\nAccordionItem.displayName = 'Accordion.Item';\n\n// Header component\ntype AccordionHeaderElement = React.ElementRef<typeof AccordionPrimitive.Header>;\ninterface AccordionHeaderProps\n extends ComponentPropsWithout<typeof AccordionPrimitive.Header, RemovedProps>,\n AccordionHeaderOwnProps {}\n\nconst AccordionHeader = React.forwardRef<AccordionHeaderElement, AccordionHeaderProps>(\n (props, forwardedRef) => {\n const { className, ...headerProps } = extractProps(props, accordionHeaderPropDefs);\n\n return (\n <AccordionPrimitive.Header\n {...headerProps}\n ref={forwardedRef}\n className={classNames('kui-AccordionHeader', className)}\n />\n );\n },\n);\nAccordionHeader.displayName = 'Accordion.Header';\n\n// Trigger component\ntype AccordionTriggerElement = React.ElementRef<typeof AccordionPrimitive.Trigger>;\ninterface AccordionTriggerProps\n extends ComponentPropsWithout<typeof AccordionPrimitive.Trigger, RemovedProps>,\n AccordionTriggerOwnProps {}\n\nconst AccordionTrigger = React.forwardRef<AccordionTriggerElement, AccordionTriggerProps>(\n ({ children, ...props }, forwardedRef) => {\n const { className, ...triggerProps } = extractProps(props, accordionTriggerPropDefs);\n\n // Radix UI handles focus management automatically\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n\n return (\n <AccordionPrimitive.Trigger\n {...triggerProps}\n ref={(node) => {\n triggerRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n className={classNames('kui-AccordionTrigger', className)}\n >\n {children}\n </AccordionPrimitive.Trigger>\n );\n },\n);\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\n// Content component\ntype AccordionContentElement = React.ElementRef<typeof AccordionPrimitive.Content>;\ninterface AccordionContentProps\n extends ComponentPropsWithout<typeof AccordionPrimitive.Content, RemovedProps>,\n AccordionContentOwnProps {}\n\nconst AccordionContent = React.forwardRef<AccordionContentElement, AccordionContentProps>(\n (props, forwardedRef) => {\n const { className, children, ...contentProps } = extractProps(props, accordionContentPropDefs);\n\n return (\n <AccordionPrimitive.Content\n {...contentProps}\n ref={forwardedRef}\n className={classNames('kui-AccordionContent', className)}\n aria-live=\"polite\"\n >\n <div className=\"kui-AccordionContentInner\">{children}</div>\n </AccordionPrimitive.Content>\n );\n },\n);\nAccordionContent.displayName = 'Accordion.Content';\n\nexport {\n AccordionRoot as Root,\n AccordionItem as Item,\n AccordionHeader as Header,\n AccordionTrigger as Trigger,\n AccordionContent as Content,\n};\n\nexport type {\n AccordionRootProps as RootProps,\n AccordionItemProps as ItemProps,\n AccordionHeaderProps as HeaderProps,\n AccordionTriggerProps as TriggerProps,\n AccordionContentProps as ContentProps,\n};\n"],
5
- "mappings": "4LAAA,IAAAA,EAAA,GAAAC,EAAAD,EAA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ACvB,GAAM,CAAE,UAAAI,EAAW,GAAGe,CAAY,EAAIX,EAAaP,EAAOmB,CAAuB,EAEjF,OACE,gBAACP,EAAmB,OAAnB,CACE,GAAGM,EACJ,IAAKnB,EACL,UAAWc,EAAW,sBAAuBV,CAAS,EACxD,CAEJ,CACF,EACAc,EAAgB,YAAc,mBAQ9B,IAAMG,EAAyB,aAC7B,CAAC,CAAE,SAAAC,EAAU,GAAGrB,CAAM,EAAGD,IAAiB,CACxC,GAAM,CAAE,UAAAI,EAAW,GAAGmB,CAAa,EAAIf,EAAaP,EAAOuB,CAAwB,EAG7EC,EAAmB,SAA0B,IAAI,EAEvD,OACE,gBAACZ,EAAmB,QAAnB,CACE,GAAGU,EACJ,IAAMG,GAAS,CACbD,EAAW,QAAUC,EACjB,OAAO1B,GAAiB,WAC1BA,EAAa0B,CAAI,EACR1B,IACTA,EAAa,QAAU0B,EAE3B,EACA,UAAWZ,EAAW,uBAAwBV,CAAS,GAEtDkB,CACH,CAEJ,CACF,EACAD,EAAiB,YAAc,oBAQ/B,IAAMM,EAAyB,aAC7B,CAAC1B,EAAOD,IAAiB,CACvB,GAAM,CAAE,UAAAI,EAAW,SAAAkB,EAAU,GAAGM,CAAa,EAAIpB,EAAaP,EAAO4B,CAAwB,EAE7F,OACE,gBAAChB,EAAmB,QAAnB,CACE,GAAGe,EACJ,IAAK5B,EACL,UAAWc,EAAW,uBAAwBV,CAAS,EACvD,YAAU,UAEV,gBAAC,OAAI,UAAU,6BAA6BkB,CAAS,CACvD,CAEJ,CACF,EACAK,EAAiB,YAAc",
6
- "names": ["accordion_exports", "__export", "AccordionContent", "AccordionHeader", "AccordionItem", "AccordionRoot", "AccordionTrigger", "React", "classNames", "AccordionPrimitive", "AccordionRoot", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "accordionRootPropDefs", "className", "radius", "color", "extractedRadixProps", "extractProps", "radixProps", "handleKeyDown", "event", "items", "AccordionPrimitive", "classNames", "AccordionItem", "itemProps", "accordionItemPropDefs", "AccordionHeader", "headerProps", "accordionHeaderPropDefs", "AccordionTrigger", "children", "triggerProps", "accordionTriggerPropDefs", "triggerRef", "node", "AccordionContent", "contentProps", "accordionContentPropDefs"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as d}from"./chunk-QGCXTULQ.js";import{a as u}from"./chunk-4P6TKZCA.js";import{d as m}from"./chunk-3YLYGKFB.js";import*as e from"react";import g from"classnames";var R=e.createContext(void 0),C={values:["1","2","3","4"]},f=e.forwardRef(({kind:r,size:o="2",color:t="gray",className:c,children:n,trailing:s,leading:i,...l},a)=>e.createElement("div",{role:"status","aria-live":"polite",...l,ref:a,className:g("kui-NoticeRoot",`kui-r-size-${o}`,c),"data-kind":r,"data-accent-color":t},i?e.createElement("span",{className:"kui-NoticeIcon","aria-hidden":!0},i):null,e.createElement(u,{as:"div",size:o,className:"kui-NoticeText"},n),s));f.displayName="Strip";var v=e.forwardRef(({icon:r,action:o,onDismiss:t,dismissLabel:c="Dismiss",size:n,...s},i)=>{let l=e.useContext(R),a=m(n??l,C);return e.createElement(f,{...s,size:a,ref:i,kind:"notice",leading:r,trailing:o||t?e.createElement("span",{className:"kui-NoticeActions"},o,t?e.createElement(d,{iconOnly:!0,size:a,variant:"ghost",color:"gray","aria-label":c,className:"kui-NoticeDismiss",onClick:t},e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0},e.createElement("path",{d:"M4 4l7 7M11 4l-7 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))):null):null})});v.displayName="Notice";var z=e.forwardRef(({confirmLabel:r,cancelLabel:o="Not now",onConfirm:t,onCancel:c,busy:n=!1,size:s,color:i="gray",...l},a)=>{let N=e.useContext(R),p=m(s??N,C);return e.createElement(f,{...l,size:p,color:i,ref:a,kind:"confirmation",trailing:e.createElement("span",{className:"kui-NoticeActions"},e.createElement(d,{size:p,variant:"ghost",color:"gray",disabled:n,onClick:c},o),e.createElement(d,{size:p,variant:"solid",color:i,loading:n,onClick:t},r))})});z.displayName="Confirmation";export{R as a,v as b,z as c};
2
- //# sourceMappingURL=chunk-L2R62BOB.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/notice.tsx"],
4
- "sourcesContent": ["'use client';\n\n/**\n * Notice and Confirmation \u2014 what the app tells the person while it is true.\n *\n * Two questions place every message: what is it about, and what made it appear.\n *\n * - **Notice** \u2014 a condition that is true now, which nobody just caused: a usage limit, a\n * connection lost, a goal that finished. It takes space in the layout and never floats, so it\n * cannot cover what it is about. At most one action, and that action FIXES the condition. A\n * dismiss button only ACKNOWLEDGES it, and the app owns that state (`onDismiss`), because a\n * component cannot remember a dismissal across a reload.\n * - **Confirmation** \u2014 a question that waits for an answer: a quiet no before a loud yes, and no\n * dismiss button, because closing a question does not answer it. It never takes focus, so a\n * person can answer in the composer instead.\n *\n * Placement is the caller's. In a chat, both go in `Chatbar.Root`'s `notices`.\n * A notice with no action and no dismiss button is just a sentence: use `Text`.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Button } from './button.js';\nimport { Text } from './text.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { accentColorPropDef } from '../props/color.prop.js';\n\ntype NoticeSize = '1' | '2' | '3' | '4';\n\n/** The size a notice takes when it doesn't set one. `Chatbar.Root` provides its own size here. */\nconst NoticeSizeContext = React.createContext<NoticeSize | undefined>(undefined);\n\n/** Notice's own range, the Theme's four sizes. */\nconst noticeSizePropDef = { values: ['1', '2', '3', '4'] as const };\ntype NoticeColor = (typeof accentColorPropDef)['color']['values'][number];\n\ninterface StripProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {\n /** Padding, text and button size. Defaults to the nearest Theme's size. */\n size?: NoticeSize;\n /**\n * The category of the message, not its volume. Default `gray`. Use a colour only when it adds a\n * fact the words don't already give, such as `red` for something that stops the next step.\n */\n color?: NoticeColor;\n /** The message. */\n children: React.ReactNode;\n}\n\ninterface NoticeProps extends StripProps {\n /** An icon before the message. It is hidden from assistive technology. */\n icon?: React.ReactNode;\n /** One action that fixes the condition, such as `<Button>Add credits</Button>`. */\n action?: React.ReactNode;\n /**\n * Called when the person presses the dismiss button, which shows only when this is set.\n * Dismissing hides the message; it does not fix the condition. Remove the notice and remember\n * the choice in your app.\n */\n onDismiss?: () => void;\n /** Accessible name of the dismiss button. Default \"Dismiss\". */\n dismissLabel?: string;\n}\n\ninterface ConfirmationProps extends StripProps {\n /** The yes. Name the action, such as \"Run\" or \"Allow up to $18\". */\n confirmLabel: string;\n /** The no. Default \"Not now\". */\n cancelLabel?: string;\n onConfirm: () => void;\n onCancel: () => void;\n /** The yes is running: it shows a spinner and the no is disabled. */\n busy?: boolean;\n}\n\nconst Strip = React.forwardRef<HTMLDivElement, StripProps & { kind: 'notice' | 'confirmation'; trailing: React.ReactNode; leading?: React.ReactNode }>(\n ({ kind, size = '2', color = 'gray', className, children, trailing, leading, ...props }, forwardedRef) => (\n <div\n role=\"status\"\n aria-live=\"polite\"\n {...props}\n ref={forwardedRef}\n className={classNames('kui-NoticeRoot', `kui-r-size-${size}`, className)}\n data-kind={kind}\n data-accent-color={color}\n >\n {leading ? (\n <span className=\"kui-NoticeIcon\" aria-hidden>\n {leading}\n </span>\n ) : null}\n <Text as=\"div\" size={size} className=\"kui-NoticeText\">\n {children}\n </Text>\n {trailing}\n </div>\n ),\n);\nStrip.displayName = 'Strip';\n\n/** A condition that is true now, with at most one action that fixes it. */\nconst Notice = React.forwardRef<HTMLDivElement, NoticeProps>(({ icon, action, onDismiss, dismissLabel = 'Dismiss', size: sizeProp, ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n const trailing =\n action || onDismiss ? (\n <span className=\"kui-NoticeActions\">\n {action}\n {onDismiss ? (\n <Button iconOnly size={size} variant=\"ghost\" color=\"gray\" aria-label={dismissLabel} className=\"kui-NoticeDismiss\" onClick={onDismiss}>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" aria-hidden>\n <path d=\"M4 4l7 7M11 4l-7 7\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n </Button>\n ) : null}\n </span>\n ) : null;\n return <Strip {...props} size={size} ref={forwardedRef} kind=\"notice\" leading={icon} trailing={trailing} />;\n});\nNotice.displayName = 'Notice';\n\n/** A question that waits for an answer: a quiet no, a loud yes, and no dismiss button. */\nconst Confirmation = React.forwardRef<HTMLDivElement, ConfirmationProps>(\n ({ confirmLabel, cancelLabel = 'Not now', onConfirm, onCancel, busy = false, size: sizeProp, color = 'gray', ...props }, forwardedRef) => {\n const contextSize = React.useContext(NoticeSizeContext);\n const size = useThemeSize(sizeProp ?? contextSize, noticeSizePropDef);\n return (\n <Strip\n {...props}\n size={size}\n color={color}\n ref={forwardedRef}\n kind=\"confirmation\"\n trailing={\n <span className=\"kui-NoticeActions\">\n <Button size={size} variant=\"ghost\" color=\"gray\" disabled={busy} onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button size={size} variant=\"solid\" color={color} loading={busy} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </span>\n }\n />\n );\n },\n);\nConfirmation.displayName = 'Confirmation';\n\nexport { Notice, Confirmation, NoticeSizeContext };\nexport type { NoticeProps, ConfirmationProps };\n"],
5
- "mappings": "wHAoBA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAUvB,IAAMC,EAA0B,gBAAsC,MAAS,EAGzEC,EAAoB,CAAE,OAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,CAAW,EAyC5DC,EAAc,aAClB,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAO,IAAK,MAAAC,EAAQ,OAAQ,UAAAC,EAAW,SAAAC,EAAU,SAAAC,EAAU,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IACvF,gBAAC,OACC,KAAK,SACL,YAAU,SACT,GAAGD,EACJ,IA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,CACE,GAAGQ,EACJ,KAAMN,EACN,MAAOC,EACP,IAAKM,EACL,KAAK,eACL,SACE,gBAAC,QAAK,UAAU,qBACd,gBAACW,EAAA,CAAO,KAAMlB,EAAM,QAAQ,QAAQ,MAAM,OAAO,SAAUwB,EAAM,QAASD,GACvEF,CACH,EACA,gBAACH,EAAA,CAAO,KAAMlB,EAAM,QAAQ,QAAQ,MAAOC,EAAO,QAASuB,EAAM,QAASF,GACvEF,CACH,CACF,EAEJ,CAEF,CACF,EACAD,EAAa,YAAc",
6
- "names": ["React", "classNames", "NoticeSizeContext", "noticeSizePropDef", "Strip", "kind", "size", "color", "className", "children", "trailing", "leading", "props", "forwardedRef", "classNames", "Text", "Notice", "icon", "action", "onDismiss", "dismissLabel", "sizeProp", "contextSize", "useThemeSize", "Button", "Confirmation", "confirmLabel", "cancelLabel", "onConfirm", "onCancel", "busy"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as o}from"./chunk-3QZBWH2A.js";import{a as e}from"./chunk-ELAW7ZUG.js";import*as r from"react";import f from"classnames";var c=r.forwardRef((p,t)=>{let{className:a,color:s,decorative:m,...n}=e(p,o);return r.createElement("span",{"data-accent-color":s,role:m?void 0:"separator",...n,ref:t,className:f("kui-Separator",a)})});c.displayName="Separator";export{c as a};
2
- //# sourceMappingURL=chunk-LHIS3UKQ.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/separator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { separatorPropDefs } from './separator.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SeparatorElement = React.ElementRef<'span'>;\ntype SeparatorOwnProps = GetPropDefTypes<typeof separatorPropDefs>;\ninterface SeparatorProps extends ComponentPropsWithout<'span', RemovedProps>, SeparatorOwnProps {}\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { className, color, decorative, ...separatorProps } = extractProps(props, separatorPropDefs);\n return <span data-accent-color={color} role={decorative ? undefined : 'separator'} {...separatorProps} ref={forwardedRef} className={classNames('kui-Separator', className)} />;\n});\nSeparator.displayName = 'Separator';\n\nexport { Separator };\nexport type { SeparatorProps };\n"],
5
- "mappings": "gFAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAWvB,IAAMC,EAAkB,aAA6C,CAACC,EAAOC,IAAiB,CAC5F,GAAM,CAAE,UAAAC,EAAW,MAAAC,EAAO,WAAAC,EAAY,GAAGC,CAAe,EAAIC,EAAaN,EAAOO,CAAiB,EACjG,OAAO,gBAAC,QAAK,oBAAmBJ,EAAO,KAAMC,EAAa,OAAY,YAAc,GAAGC,EAAgB,IAAKJ,EAAc,UAAWO,EAAW,gBAAiBN,CAAS,EAAG,CAC/K,CAAC,EACDH,EAAU,YAAc",
6
- "names": ["React", "classNames", "Separator", "props", "forwardedRef", "className", "color", "decorative", "separatorProps", "extractProps", "separatorPropDefs", "classNames"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as v,b as L,c as D}from"./chunk-HCBR74BW.js";import{b as x,c as E}from"./chunk-IX5HIHVI.js";import{b as N,c as w}from"./chunk-PPZY7PJA.js";import{a as b}from"./chunk-IWCFJJBI.js";import{d as T}from"./chunk-3YLYGKFB.js";import{a as C}from"./chunk-ELAW7ZUG.js";import{a as F}from"./chunk-OS3FCYZY.js";var U={};F(U,{Content:()=>V,Group:()=>M,Item:()=>A,Label:()=>W,Root:()=>O,Separator:()=>B,Trigger:()=>z});import*as e from"react";import m from"classnames";import{Select as r,ScrollArea as R}from"radix-ui";var G={size:v.size},y=e.createContext({}),O=o=>{let{children:t,size:a,open:i,defaultOpen:l,onOpenChange:c,...S}=o,s=T(a,v.size),[P,n]=e.useState(l??!1),p=i??P,d=e.useCallback(u=>{n(u),c?.(u)},[c]);return e.createElement(r.Root,{...S,open:p,onOpenChange:d},e.createElement(y.Provider,{value:e.useMemo(()=>({size:s,open:p}),[s,p])},t))};O.displayName="Select.Root";var z=e.forwardRef((o,t)=>{let a=e.useContext(y),{children:i,className:l,color:c,radius:S,placeholder:s,error:P,loading:n,disabled:p,readOnly:d,...u}=C({size:a?.size,...o},G,L),{"aria-invalid":f,"aria-busy":g,"aria-disabled":h,"aria-readonly":I}=u,k=!!P||f===!0||f==="true",j=e.useMemo(()=>({"aria-invalid":k?!0:f,"aria-busy":n||g,"aria-disabled":p||h,"aria-readonly":d||I}),[k,f,n,g,p,h,d,I]);return e.createElement(r.Trigger,{asChild:!0,disabled:p},e.createElement("button",{"data-accent-color":c,"data-radius":S,"data-error":P,"data-loading":n,...u,...j,ref:t,className:m("kui-reset","kui-SelectTrigger",l)},e.createElement("span",{className:"kui-SelectTriggerInner"},e.createElement(r.Value,{placeholder:s},i)),e.createElement(r.Icon,{asChild:!0},n?e.createElement("div",{className:"kui-SelectIcon kui-SelectLoadingIcon","aria-hidden":"true"},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.createElement("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"kui-SelectLoadingIconCircle"}))):e.createElement(E,{className:"kui-SelectIcon"}))))});z.displayName="Select.Trigger";var V=e.forwardRef((o,t)=>{let a=e.useContext(y),{className:i,children:l,color:c,container:S,...s}=C({size:a?.size,...o},G,D),P=N();if(a.open===!1&&!s.forceMount)return e.createElement(r.Portal,{container:S},e.createElement(r.Content,{...s,asChild:!1,ref:t},l));let n=c||P.accentColor;return e.createElement(r.Portal,{container:S},e.createElement(w,{asChild:!0},e.createElement(r.Content,{"data-accent-color":n,sideOffset:4,...s,asChild:!1,ref:t,className:m("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-SelectContent",i)},e.createElement(H,null,l))))});V.displayName="Select.Content";function H({children:o}){let t=b();return e.createElement(R.Root,{type:"auto",className:"kui-ScrollAreaRoot"},e.createElement(r.Viewport,{asChild:!0,className:m("kui-BaseMenuViewport","kui-SelectViewport")},e.createElement(R.Viewport,{ref:t,className:"kui-ScrollAreaViewport",style:{overflowY:void 0}},o)),e.createElement(R.Scrollbar,{className:"kui-ScrollAreaScrollbar",orientation:"vertical"},e.createElement(R.Thumb,{className:"kui-ScrollAreaThumb"})))}var A=e.forwardRef((o,t)=>{let{className:a,children:i,...l}=o,c=typeof i!="string";return e.createElement(r.Item,{...l,asChild:!1,ref:t,className:m("kui-reset","kui-BaseMenuItem","kui-SelectItem",{"kui-SelectItemRich":c},a)},e.createElement(r.ItemIndicator,{className:"kui-SelectItemIndicator"},e.createElement(x,{className:"kui-SelectItemIndicatorIcon"})),e.createElement(r.ItemText,null,i))});A.displayName="Select.Item";var M=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Group,{...t,asChild:!1,ref:a,className:m("kui-SelectGroup",o)}));M.displayName="Select.Group";var W=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Label,{...t,asChild:!1,ref:a,className:m("kui-BaseMenuLabel","kui-SelectLabel",o)}));W.displayName="Select.Label";var B=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Separator,{...t,asChild:!1,ref:a,className:m("kui-BaseMenuSeparator","kui-SelectSeparator",o)}));B.displayName="Select.Separator";export{O as a,z as b,V as c,A as d,M as e,W as f,B as g,U as h};
2
- //# sourceMappingURL=chunk-NQDMTOGB.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/select.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport { warnDeprecated } from '../helpers/warn-deprecated.js';\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Select as SelectPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport {\n selectRootPropDefs,\n selectTriggerPropDefs,\n selectContentPropDefs,\n} from './select.props.js';\nimport { useThemeContext, Theme } from './theme.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype SelectRootOwnProps = GetPropDefTypes<typeof selectRootPropDefs>;\n\n// Trigger and Content pass the size prop def as its own record. It is hoisted because\n// extractProps caches its compiled prop defs on the identity of each record it is given:\n// a literal written at the call site would be a new object, and a recompile, every render.\nconst selectSizePropDefs = { size: selectRootPropDefs.size };\n\ninterface SelectContextValue extends SelectRootOwnProps {\n /** Whether the list is open. Undefined when Content is rendered outside a Kookie Select.Root. */\n open?: boolean;\n}\nconst SelectContext = React.createContext<SelectContextValue>({});\n\ninterface SelectRootProps extends SelectPrimitive.SelectProps, SelectRootOwnProps {}\nconst SelectRoot: React.FC<SelectRootProps> = (props) => {\n const {\n children,\n size: sizeProp,\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...rootProps\n } = props;\n const size = useThemeSize(sizeProp, selectRootPropDefs.size);\n\n // Root owns the open state and hands Radix a controlled `open`, so Content learns of a\n // change in the same render Radix does. Radix's uncontrolled state reports changes from an\n // effect, a render late, which would mount the open list once without its wrappers.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);\n const open = openProp ?? uncontrolledOpen;\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n\n return (\n <SelectPrimitive.Root {...rootProps} open={open} onOpenChange={handleOpenChange}>\n <SelectContext.Provider value={React.useMemo(() => ({ size, open }), [size, open])}>\n {children}\n </SelectContext.Provider>\n </SelectPrimitive.Root>\n );\n};\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerOwnProps = GetPropDefTypes<typeof selectTriggerPropDefs>;\ninterface SelectTriggerProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Trigger, RemovedProps>,\n SelectTriggerOwnProps {}\nconst SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const {\n children,\n className,\n color,\n radius,\n placeholder,\n error,\n loading,\n disabled,\n readOnly,\n ...triggerProps\n } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectTriggerPropDefs,\n );\n\n\n // The props win when set; otherwise a caller's own aria-* (a form library's aria-invalid)\n // stays, so both paths reach the accessibility tree and the CSS, as on TextField.\n const {\n 'aria-invalid': ariaInvalid,\n 'aria-busy': ariaBusy,\n 'aria-disabled': ariaDisabled,\n 'aria-readonly': ariaReadOnly,\n } = triggerProps;\n const isInvalid = Boolean(error) || ariaInvalid === true || ariaInvalid === 'true';\n const ariaProps = React.useMemo(\n () => ({\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n 'aria-busy': loading || ariaBusy,\n 'aria-disabled': disabled || ariaDisabled,\n 'aria-readonly': readOnly || ariaReadOnly,\n }),\n [isInvalid, ariaInvalid, loading, ariaBusy, disabled, ariaDisabled, readOnly, ariaReadOnly],\n );\n\n return (\n // `disabled` goes to Radix, which merges it with Root's and sets the native attribute.\n <SelectPrimitive.Trigger asChild disabled={disabled}>\n <button\n data-accent-color={color}\n data-radius={radius}\n data-error={error}\n data-loading={loading}\n {...triggerProps}\n {...ariaProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-SelectTrigger', className)}\n >\n <span className=\"kui-SelectTriggerInner\">\n <SelectPrimitive.Value placeholder={placeholder}>{children}</SelectPrimitive.Value>\n </span>\n <SelectPrimitive.Icon asChild>\n {loading ? (\n <div className=\"kui-SelectIcon kui-SelectLoadingIcon\" aria-hidden=\"true\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <circle\n cx=\"8\"\n cy=\"8\"\n r=\"7\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeDasharray=\"32\"\n strokeDashoffset=\"32\"\n className=\"kui-SelectLoadingIconCircle\"\n />\n </svg>\n </div>\n ) : (\n <ChevronDownIcon className=\"kui-SelectIcon\" />\n )}\n </SelectPrimitive.Icon>\n </button>\n </SelectPrimitive.Trigger>\n );\n },\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentOwnProps = GetPropDefTypes<typeof selectContentPropDefs>;\ninterface SelectContentProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Content, RemovedProps>,\n SelectContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>['container'];\n}\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const { className, children, color, container, ...contentProps } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectContentPropDefs,\n );\n const themeContext = useThemeContext();\n\n // While closed, Radix still renders Content's children, into a detached fragment: the\n // items must exist for the trigger's value label, typeahead and the native form select.\n // Nothing in that fragment is ever shown, so the theme wrapper and the scroll area, with\n // its two resize observers, are left out until the list opens.\n if (context.open === false && !contentProps.forceMount) {\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content {...contentProps} asChild={false} ref={forwardedRef}>\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n }\n\n const resolvedColor = color || themeContext.accentColor;\n return (\n <SelectPrimitive.Portal container={container}>\n <Theme asChild>\n <SelectPrimitive.Content\n data-accent-color={resolvedColor}\n sideOffset={4}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-SelectContent',\n className,\n )}\n >\n <SelectScrollArea>{children}</SelectScrollArea>\n </SelectPrimitive.Content>\n </Theme>\n </SelectPrimitive.Portal>\n );\n },\n);\nSelectContent.displayName = 'Select.Content';\n\n/** The open list's scroll area. Its own component so the thumb sync hook runs only while open. */\nfunction SelectScrollArea({ children }: { children: React.ReactNode }) {\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n return (\n <ScrollAreaPrimitive.Root type=\"auto\" className=\"kui-ScrollAreaRoot\">\n <SelectPrimitive.Viewport\n asChild\n className={classNames('kui-BaseMenuViewport', 'kui-SelectViewport')}\n >\n <ScrollAreaPrimitive.Viewport\n ref={setThumbViewport}\n className=\"kui-ScrollAreaViewport\"\n style={{ overflowY: undefined }}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n </SelectPrimitive.Viewport>\n <ScrollAreaPrimitive.Scrollbar className=\"kui-ScrollAreaScrollbar\" orientation=\"vertical\">\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n </ScrollAreaPrimitive.Root>\n );\n}\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ninterface SelectItemProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Item, RemovedProps> {}\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>((props, forwardedRef) => {\n const { className, children, ...itemProps } = props;\n\n // Detect if this is rich content (not just a string)\n const isRichContent = typeof children !== 'string';\n\n return (\n <SelectPrimitive.Item\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-SelectItem',\n { 'kui-SelectItemRich': isRichContent },\n className,\n )}\n >\n <SelectPrimitive.ItemIndicator className=\"kui-SelectItemIndicator\">\n <ThickCheckIcon className=\"kui-SelectItemIndicatorIcon\" />\n </SelectPrimitive.ItemIndicator>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectGroupElement = React.ElementRef<typeof SelectPrimitive.Group>;\ninterface SelectGroupProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Group, RemovedProps> {}\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-SelectGroup', className)}\n />\n ),\n);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ninterface SelectLabelProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Label, RemovedProps> {}\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-SelectLabel', className)}\n />\n ),\n);\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>;\ninterface SelectSeparatorProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Separator, RemovedProps> {}\nconst SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-SelectSeparator', className)}\n />\n ),\n);\nSelectSeparator.displayName = 'Select.Separator';\n\nexport {\n SelectRoot as Root,\n SelectTrigger as Trigger,\n SelectContent as Content,\n SelectItem as Item,\n SelectGroup as Group,\n SelectLabel as Label,\n SelectSeparator as Separator,\n};\n\nexport type {\n SelectRootProps as RootProps,\n SelectTriggerProps as TriggerProps,\n SelectContentProps as ContentProps,\n SelectItemProps as ItemProps,\n SelectGroupProps as GroupProps,\n Select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ACL,UAAWmB,EACT,YACA,mBACA,iBACA,CAAE,qBAAsBgB,CAAc,EACtCjC,CACF,GAEA,gBAACJ,EAAgB,cAAhB,CAA8B,UAAU,2BACvC,gBAACsC,EAAA,CAAe,UAAU,8BAA8B,CAC1D,EACA,gBAACtC,EAAgB,SAAhB,KAA0Bb,CAAS,CACtC,CAEJ,CAAC,EACDgD,EAAW,YAAc,cAKzB,IAAMI,EAAoB,aACxB,CAAC,CAAE,UAAAnC,EAAW,GAAGlB,CAAM,EAAGgB,IACxB,gBAACF,EAAgB,MAAhB,CACE,GAAGd,EACJ,QAAS,GACT,IAAKgB,EACL,UAAWmB,EAAW,kBAAmBjB,CAAS,EACpD,CAEJ,EACAmC,EAAY,YAAc,eAK1B,IAAMC,EAAoB,aACxB,CAAC,CAAE,UAAApC,EAAW,GAAGlB,CAAM,EAAGgB,IACxB,gBAACF,EAAgB,MAAhB,CACE,GAAGd,EACJ,QAAS,GACT,IAAKgB,EACL,UAAWmB,EAAW,oBAAqB,kBAAmBjB,CAAS,EACzE,CAEJ,EACAoC,EAAY,YAAc,eAK1B,IAAMC,EAAwB,aAC5B,CAAC,CAAE,UAAArC,EAAW,GAAGlB,CAAM,EAAGgB,IACxB,gBAACF,EAAgB,UAAhB,CACE,GAAGd,EACJ,QAAS,GACT,IAAKgB,EACL,UAAWmB,EAAW,wBAAyB,sBAAuBjB,CAAS,EACjF,CAEJ,EACAqC,EAAgB,YAAc",
6
- "names": ["select_exports", "__export", "SelectContent", "SelectGroup", "SelectItem", "SelectLabel", "SelectRoot", "SelectSeparator", "SelectTrigger", "React", "classNames", "SelectPrimitive", "ScrollAreaPrimitive", "selectSizePropDefs", "selectRootPropDefs", "SelectContext", "SelectRoot", "props", "children", "sizeProp", "openProp", "defaultOpen", "onOpenChange", "rootProps", "size", "useThemeSize", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChange", "next", "SelectPrimitive", "SelectTrigger", "forwardedRef", "context", "className", "color", "radius", "placeholder", "error", "loading", "disabled", "readOnly", "triggerProps", "extractProps", "selectTriggerPropDefs", "ariaInvalid", "ariaBusy", "ariaDisabled", "ariaReadOnly", "isInvalid", "ariaProps", "classNames", "ChevronDownIcon", "SelectContent", "container", "contentProps", "selectContentPropDefs", "themeContext", "useThemeContext", "resolvedColor", "Theme", "SelectScrollArea", "setThumbViewport", "useThumbSync", "ScrollAreaPrimitive", "SelectItem", "itemProps", "isRichContent", "ThickCheckIcon", "SelectGroup", "SelectLabel", "SelectSeparator"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-KL73COYX.js";import{a as x}from"./chunk-QGCXTULQ.js";import{a as B}from"./chunk-4P6TKZCA.js";import{f as y}from"./chunk-AB3QCCUM.js";import{d as R}from"./chunk-3YLYGKFB.js";import{a as m}from"./chunk-ELAW7ZUG.js";import*as o from"react";import u from"classnames";import{Toolbar as f}from"radix-ui";var v=o.createContext(null),S=o.createContext(null);function b(t){let r=o.useContext(v);if(!r)throw new Error(`${t} must be rendered inside a Toolbar.`);return r}var P=o.forwardRef((t,r)=>{let e=y(),a=R(t.size??e??void 0,p.size),s=t.orientation??p.orientation.default,{className:n,orientation:l,backdrop:i=!1,children:T,...d}=m({...t,size:a},p),c=o.useMemo(()=>({size:a,orientation:s,backdrop:i}),[a,s,i]);return o.createElement(f.Root,{...d,ref:r,orientation:s,"data-backdrop":i||void 0,className:u("kui-Toolbar",n)},o.createElement(v.Provider,{value:c},T))});P.displayName="Toolbar";var C=o.forwardRef(({className:t,disabled:r=!1,children:e,...a},s)=>{let{orientation:n}=b("ToolbarGroup"),l=o.useMemo(()=>({disabled:r}),[r]);return o.createElement("div",{role:"group","data-orientation":n,"data-disabled":r||void 0,...a,ref:s,className:u("kui-ToolbarGroup",t)},o.createElement(S.Provider,{value:l},e))});C.displayName="Toolbar.Group";function D(t){return t===!0||t==="true"}var z=o.forwardRef((t,r)=>{let e=b("ToolbarButton"),a=o.useContext(S),{iconOnly:s,size:n,variant:l,emphasis:i,color:T,disabled:d,...c}=t,h=D(t["aria-pressed"]),k="data-state"in t||t["aria-pressed"]===void 0?{}:{"data-state":h?"on":"off"},O={size:n??e.size,...i!==void 0?{emphasis:i}:{variant:l??(a?"ghost":e.backdrop?"raised":"soft")},color:T??(l||i?void 0:"gray"),...k},g={...c,...s?{iconOnly:!0}:{},...O};return o.createElement(f.Button,{asChild:!0,ref:r,disabled:d||a?.disabled||void 0},o.createElement(x,{...g}))});z.displayName="Toolbar.Button";var G=o.forwardRef(({className:t,...r},e)=>(b("ToolbarSeparator"),o.createElement(f.Separator,{...r,ref:e,className:u("kui-ToolbarSeparator",t)})));G.displayName="Toolbar.Separator";var w={1:"2",2:"3",3:"4",4:"5"},N=o.forwardRef(({className:t,children:r,style:e,id:a},s)=>{let{size:n}=b("ToolbarTitle");return r==null||r===!1?null:o.createElement(B,{ref:s,as:"span",size:w[n],weight:"medium",truncate:!0,id:a,style:e,className:u("kui-ToolbarTitle",t)},r)});N.displayName="Toolbar.Title";var A=Object.assign(P,{Root:P,Group:C,Button:z,Separator:G,Title:N});export{P as a,C as b,z as c,G as d,N as e,A as f};
2
- //# sourceMappingURL=chunk-Q6MFPATL.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/toolbar.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Toolbar as ToolbarPrimitive } from 'radix-ui';\n\nimport { toolbarRootPropDefs } from './toolbar.props.js';\nimport { Button } from './button.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { usePaneBandSize } from './_internal/pane-chrome.js';\n\nimport type { ButtonProps } from './button.js';\nimport type { TextProps } from './text.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ButtonRankProps } from './button.js';\n\n/*\n * Toolbar takes Kookie UI v2's contract (v2: components/toolbar), built on Radix instead of\n * Base UI. A toolbar is a row of controls with ONE tab stop: `role=\"toolbar\"`, and the arrow\n * keys move focus between its controls. That keyboard is the reason it is a component.\n *\n * Its `size` reaches every control inside it that does not state its own. The row itself paints\n * nothing; a `ToolbarGroup` draws a quiet well around controls that belong together, and a\n * `ToolbarSeparator` draws a gray hairline between clusters. Use a `Flex` to cluster controls\n * without a well: the row spaces the clusters with `space-between`.\n */\n\ntype ToolbarSize = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['size']>;\ntype ToolbarOrientation = NonNullable<GetPropDefTypes<typeof toolbarRootPropDefs>['orientation']>;\n\ninterface ToolbarContextValue {\n size: ToolbarSize;\n orientation: ToolbarOrientation;\n backdrop: boolean;\n}\n\nconst ToolbarContext = React.createContext<ToolbarContextValue | null>(null);\n\n/** Set by a `ToolbarGroup`: its children rest quiet, and `disabled` turns them all off. */\nconst ToolbarGroupContext = React.createContext<{ disabled: boolean } | null>(null);\n\nfunction useToolbarContext(consumer: string): ToolbarContextValue {\n const context = React.useContext(ToolbarContext);\n if (!context) {\n throw new Error(`${consumer} must be rendered inside a Toolbar.`);\n }\n return context;\n}\n\n// ============================================================================\n// Toolbar (root)\n// ============================================================================\n\ntype ToolbarOwnProps = GetPropDefTypes<typeof toolbarRootPropDefs>;\n\ninterface ToolbarProps\n extends ComponentPropsWithout<typeof ToolbarPrimitive.Root, RemovedProps | 'orientation'>,\n ToolbarOwnProps {\n /**\n * Gives every control a surface of its own, for a row that content passes behind, such as\n * `Shell.PaneHeader float`. Buttons rest `raised` instead of `soft`, and a group's well is\n * solid and raised.\n */\n backdrop?: boolean;\n}\n\n/**\n * A row of controls with one keyboard tab stop. The arrow keys move focus between the controls.\n *\n * Give it an `aria-label` (or `aria-labelledby`) that says what the controls act on.\n *\n * @example\n * ```tsx\n * <Toolbar aria-label=\"Formatting\">\n * <ToolbarGroup>\n * <ToolbarButton iconOnly aria-label=\"Bold\" aria-pressed={bold} onClick={toggleBold}>\n * <HugeiconsIcon icon={TextBoldIcon} strokeWidth={1.75} />\n * </ToolbarButton>\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * <ToolbarButton>Share</ToolbarButton>\n * </Toolbar>\n * ```\n */\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarProps>((props, forwardedRef) => {\n // In a Shell pane's header or footer, a toolbar with no size rests one step above the Shell's.\n const band = usePaneBandSize();\n // Elsewhere it takes the nearest Theme's size.\n const size: ToolbarSize = useThemeSize(props.size ?? band ?? undefined, toolbarRootPropDefs.size);\n const orientation: ToolbarOrientation = props.orientation ?? toolbarRootPropDefs.orientation.default;\n const { className, orientation: _orientation, backdrop = false, children, ...rootProps } = extractProps(\n { ...props, size },\n toolbarRootPropDefs,\n );\n\n const context = React.useMemo(() => ({ size, orientation, backdrop }), [size, orientation, backdrop]);\n\n return (\n <ToolbarPrimitive.Root\n {...rootProps}\n ref={forwardedRef}\n orientation={orientation}\n data-backdrop={backdrop || undefined}\n className={classNames('kui-Toolbar', className)}\n >\n <ToolbarContext.Provider value={context}>{children}</ToolbarContext.Provider>\n </ToolbarPrimitive.Root>\n );\n});\nToolbarRoot.displayName = 'Toolbar';\n\n// ============================================================================\n// ToolbarGroup\n// ============================================================================\n\ninterface ToolbarGroupProps extends ComponentPropsWithout<'div', RemovedProps> {\n /** Turns every control in the group off at once. */\n disabled?: boolean;\n}\n\n/**\n * Controls that belong together, drawn as one quiet well that stands level with a button\n * beside it. Buttons inside it rest as `ghost` unless they state a `variant`.\n * To cluster controls without a well, use a `Flex`.\n */\nconst ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroupProps>(\n ({ className, disabled = false, children, ...props }, forwardedRef) => {\n const { orientation } = useToolbarContext('ToolbarGroup');\n const group = React.useMemo(() => ({ disabled }), [disabled]);\n return (\n <div\n role=\"group\"\n data-orientation={orientation}\n data-disabled={disabled || undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarGroup', className)}\n >\n <ToolbarGroupContext.Provider value={group}>{children}</ToolbarGroupContext.Provider>\n </div>\n );\n },\n);\nToolbarGroup.displayName = 'Toolbar.Group';\n\n// ============================================================================\n// ToolbarButton\n// ============================================================================\n\ntype ToolbarButtonBaseProps = Omit<ButtonProps, 'as' | 'asChild' | 'variant' | 'emphasis'>;\n\n/** A labelled button: takes every `Button` prop. */\ntype ToolbarTextButtonProps = ToolbarButtonBaseProps &\n ButtonRankProps & {\n iconOnly?: false;\n};\n\n/** An icon-only button: renders `Button iconOnly`, and the type requires an `aria-label`. */\ntype ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-labelledby' | 'fullWidth'> &\n ButtonRankProps & {\n iconOnly: true;\n /** The control's accessible name. An icon has no words of its own, so this is required. */\n 'aria-label': string;\n};\n\ntype ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;\n\nfunction isPressed(value: React.AriaAttributes['aria-pressed']) {\n return value === true || value === 'true';\n}\n\n/**\n * A `Button` that joins the toolbar's keyboard navigation, so a row of them is one tab stop.\n *\n * Set `iconOnly` (with an `aria-label`) for a symbol-only control. Set `aria-pressed` for a\n * control that toggles; a pressed button wears Button's pressed look.\n *\n * It takes the toolbar's `size`, and rests as a gray `soft` button (`raised` in a toolbar with\n * `backdrop`, gray `ghost` inside a `ToolbarGroup`). A stated `size`, `variant` or `color` wins; a stated `variant` without a\n * `color` takes Button's own default colour. It throws outside a `Toolbar`.\n */\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((props, forwardedRef) => {\n const toolbar = useToolbarContext('ToolbarButton');\n const group = React.useContext(ToolbarGroupContext);\n const { iconOnly, size, variant, emphasis, color, disabled, ...rest } = props;\n\n const pressed = isPressed(props['aria-pressed']);\n const stateProps =\n 'data-state' in props || props['aria-pressed'] === undefined ? {} : { 'data-state': pressed ? 'on' : 'off' };\n\n const shared = {\n size: size ?? toolbar.size,\n // A caller states the look by `variant` or the rank by `emphasis`, never both.\n ...(emphasis !== undefined ? { emphasis } : { variant: variant ?? (group ? 'ghost' : toolbar.backdrop ? 'raised' : 'soft') }),\n // The gray rest is a pair with the default variant: a caller who states a variant or an\n // emphasis gets Button's own colour for it unless they state a colour too.\n color: color ?? (variant || emphasis ? undefined : 'gray'),\n ...stateProps,\n } as const;\n\n // The text and icon-only branches share every prop but the name; one Button renders both.\n const buttonProps = { ...rest, ...(iconOnly ? { iconOnly: true } : {}), ...shared } as ButtonProps;\n\n return (\n <ToolbarPrimitive.Button asChild ref={forwardedRef} disabled={disabled || group?.disabled || undefined}>\n <Button {...buttonProps} />\n </ToolbarPrimitive.Button>\n );\n});\nToolbarButton.displayName = 'Toolbar.Button';\n\n// ============================================================================\n// ToolbarSeparator\n// ============================================================================\n\ntype ToolbarSeparatorProps = ComponentPropsWithout<typeof ToolbarPrimitive.Separator, RemovedProps | 'orientation'>;\n\n/**\n * A gray hairline between two clusters, announced as a separator. Its direction is always\n * opposite to the toolbar's.\n */\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n useToolbarContext('ToolbarSeparator');\n return (\n <ToolbarPrimitive.Separator\n {...props}\n ref={forwardedRef}\n className={classNames('kui-ToolbarSeparator', className)}\n />\n );\n },\n);\nToolbarSeparator.displayName = 'Toolbar.Separator';\n\n// ============================================================================\n// ToolbarTitle\n// ============================================================================\n\n/** The title's text step: one step above the label of a button at the same size. */\nconst TITLE_SIZE = { '1': '2', '2': '3', '3': '4', '4': '5' } as const satisfies Record<ToolbarSize, TextProps['size']>;\n\ninterface ToolbarTitleProps {\n /** The title text. With none, the title renders nothing. */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n /** The id of the title, so that the toolbar's `aria-labelledby` can point at it. */\n id?: string;\n}\n\n/**\n * What the row is about, at its leading edge. One line: it truncates rather than wrapping.\n * Its text step follows the toolbar's `size`, and it takes more air from the controls beside it\n * than they take from each other.\n */\nconst ToolbarTitle = React.forwardRef<HTMLSpanElement, ToolbarTitleProps>(\n ({ className, children, style, id }, forwardedRef) => {\n const { size } = useToolbarContext('ToolbarTitle');\n if (children === undefined || children === null || children === false) return null;\n return (\n <Text\n ref={forwardedRef}\n as=\"span\"\n size={TITLE_SIZE[size]}\n weight=\"medium\"\n truncate\n id={id}\n style={style}\n className={classNames('kui-ToolbarTitle', className)}\n >\n {children}\n </Text>\n );\n },\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n Title: ToolbarTitle,\n});\n\nexport {\n Toolbar,\n ToolbarGroup,\n ToolbarButton,\n ToolbarSeparator,\n ToolbarTitle,\n ToolbarRoot as Root,\n ToolbarGroup as Group,\n ToolbarButton as Button,\n ToolbarSeparator as Separator,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarProps,\n ToolbarGroupProps,\n ToolbarButtonProps,\n ToolbarSeparatorProps,\n ToolbarTitleProps,\n ToolbarProps as RootProps,\n ToolbarGroupProps as GroupProps,\n ToolbarButtonProps as ButtonProps,\n ToolbarSeparatorProps as SeparatorProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
5
- "mappings": "gPAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,WAAWC,MAAwB,WAmC5C,IAAMC,EAAuB,gBAA0C,IAAI,EAGrEC,EAA4B,gBAA4C,IAAI,EAElF,SAASC,EAAkBC,EAAuC,CAChE,IAAMC,EAAgB,aAAWJ,CAAc,EAC/C,GAAI,CAACI,EACH,MAAM,IAAI,MAAM,GAAGD,CAAQ,qCAAqC,EAElE,OAAOC,CACT,CAqCA,IAAMC,EAAoB,aAAyC,CAACC,EAAOC,IAAiB,CAE1F,IAAMC,EAAOC,EAAgB,EAEvBC,EAAoBC,EAAaL,EAAM,MAAQE,GAAQ,OAAWI,E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MiC,EAAW9B,CAAI,EACrB,OAAO,SACP,SAAQ,GACR,GAAIiC,EACJ,MAAOD,EACP,UAAWrB,EAAW,mBAAoBP,CAAS,GAElDG,CACH,CAEJ,CACF,EACAwB,EAAa,YAAc,gBAM3B,IAAMI,EAAU,OAAO,OAAOxC,EAAa,CACzC,KAAMA,EACN,MAAOiB,EACP,OAAQK,EACR,UAAWY,EACX,MAAOE,CACT,CAAC",
6
- "names": ["React", "classNames", "ToolbarPrimitive", "ToolbarContext", "ToolbarGroupContext", "useToolbarContext", "consumer", "context", "ToolbarRoot", "props", "forwardedRef", "band", "usePaneBandSize", "size", "useThemeSize", "toolbarRootPropDefs", "orientation", "className", "_orientation", "backdrop", "children", "rootProps", "extractProps", "ToolbarPrimitive", "classNames", "ToolbarGroup", "disabled", "group", "isPressed", "value", "ToolbarButton", "toolbar", "iconOnly", "variant", "emphasis", "color", "rest", "pressed", "stateProps", "shared", "buttonProps", "Button", "ToolbarSeparator", "TITLE_SIZE", "ToolbarTitle", "style", "id", "Text", "Toolbar"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as y}from"./chunk-MHANZINI.js";import{a as d}from"./chunk-MPTTUBFU.js";import{a as m}from"./chunk-MJJ7XDIP.js";import{c as C}from"./chunk-PPZY7PJA.js";import{a as u}from"./chunk-4P6TKZCA.js";import{a as P}from"./chunk-FNAE6HUI.js";import{e as f}from"./chunk-3YLYGKFB.js";import{a as p}from"./chunk-ELAW7ZUG.js";import{a as O}from"./chunk-OS3FCYZY.js";var A={};O(A,{Close:()=>x,Content:()=>E,Description:()=>N,Root:()=>R,Title:()=>h,Trigger:()=>T});import*as e from"react";import S from"classnames";import{Dialog as r}from"radix-ui";var R=o=>e.createElement(r.Root,{...o,modal:!0});R.displayName="Dialog.Root";var T=e.forwardRef(({children:o,...i},a)=>e.createElement(r.Trigger,{...i,ref:a,asChild:!0},m(o)));T.displayName="Dialog.Trigger";var{align:B,...v}=P,z={align:B},E=e.forwardRef(({align:o,...i},a)=>{let k=f(i,v.size),{className:b}=p({align:o},z),{className:w,forceMount:H,container:M,...L}=p(k,v),g=e.useRef(null),W=e.useMemo(()=>t=>{g.current=t,typeof a=="function"?a(t):a&&(a.current=t)},[a]);return y(),e.useEffect(()=>{if(typeof window>"u")return;let t=g.current;if(!t)return;let l=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let s=l[0],c=l[l.length-1],D=n=>{n.key==="Tab"&&(n.shiftKey?document.activeElement===s&&(n.preventDefault(),c.focus()):document.activeElement===c&&(n.preventDefault(),s.focus()))};return t.addEventListener("keydown",D),s.focus(),()=>{t.removeEventListener("keydown",D)}},[]),e.createElement(r.Portal,{container:M,forceMount:H},e.createElement(C,{asChild:!0},e.createElement(r.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay"},e.createElement("div",{className:"kui-BaseDialogScroll kui-DialogScroll"},e.createElement("div",{className:`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${b}`},e.createElement(r.Content,{...L,ref:W,className:S("kui-BaseDialogContent","kui-DialogContent",w),tabIndex:-1,role:"dialog","aria-modal":"true",onCloseAutoFocus:t=>{t.preventDefault(),document.body.style.pointerEvents=""}}),e.createElement("div",{"aria-live":"polite","aria-atomic":"true",className:"kui-sr-only",id:"dialog-announcement"}))))))});E.displayName="Dialog.Content";var h=e.forwardRef((o,i)=>e.createElement(r.Title,{asChild:!0},e.createElement(d,{size:"5",trim:"start",...o,asChild:!1,ref:i})));h.displayName="Dialog.Title";var N=e.forwardRef((o,i)=>e.createElement(r.Description,{asChild:!0},e.createElement(u,{as:"p",size:"3",...o,asChild:!1,ref:i})));N.displayName="Dialog.Description";var x=e.forwardRef(({children:o,...i},a)=>e.createElement(r.Close,{...i,ref:a,asChild:!0},m(o)));x.displayName="Dialog.Close";export{R as a,T as b,E as c,h as d,N as e,x as f,A as g};
2
- //# sourceMappingURL=chunk-QOHJIF25.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\n// Split once at module scope. `extractProps` memoises on the identity of the\n// prop def objects it is handed, so rebuilding these per render would recompile\n// them on every render.\nconst {\n align: alignPropDef,\n ...contentPropDefs\n} = dialogContentPropDefs;\nconst alignPropDefs = { align: alignPropDef };\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...ownProps }, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, contentPropDefs.size);\n const { className: alignClassName } = extractProps({ align }, alignPropDefs);\n\n const {\n className,\n forceMount,\n container,\n ...contentProps\n } = extractProps(props, contentPropDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-DialogOverlay\">\n <div className=\"kui-BaseDialogScroll kui-DialogScroll\">\n <div\n className={`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('kui-BaseDialogContent', 'kui-DialogContent', className)}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"kui-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\n },\n);\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
- "mappings": "wWAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAmB1C,IAAMC,EAAyCC,GAAU,gBAACC,EAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGD,EAAW,YAAc,cAKzB,IAAMG,EAAsB,aAC1B,CAAC,CAAE,SAAAC,EAAU,GAAGH,CAAM,EAAGI,IACvB,gBAACH,EAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKI,EAAc,QAAO,IAC3DC,EAAoBF,CAAQ,CAC/B,CAEJ,EACAD,EAAc,YAAc,iBAK5B,GAAM,CACJ,MAAOI,EACP,GAAGC,CACL,EAAIC,EACEC,EAAgB,CAAE,MAAOH,CAAa,EAQtCI,EAAsB,aAC1B,CAAC,CAAE,MAAAC,EAAO,GAAGC,CAAS,EAAGR,IAAiB,CACxC,IAAMJ,EAAQa,EAAkBD,EAAUL,EAAgB,IAAI,EACxD,CAAE,UAAWO,CAAe,EAAIC,EAAa,CAAE,MAAAJ,CAAM,EAAGF,CAAa,EAErE,CACJ,UAAAO,EACA,WAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAIJ,EAAaf,EAAOO,CAAe,EAGjCa,EAAmB,SAAuB,IAAI,EAC9CC,EAAoB,UACxB,IAAOC,GAAgC,CACrCF,EAAW,QAAUE,EACjB,OAAOlB,GAAiB,WAC1BA,EAAakB,CAAI,E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C,EAAOI,IACN,gBAACH,EAAgB,MAAhB,CAAsB,QAAO,IAC5B,gBAACgC,EAAA,CAAQ,KAAK,IAAI,KAAK,QAAS,GAAGjC,EAAO,QAAS,GAAO,IAAKI,EAAc,CAC/E,CAEJ,EACA4B,EAAY,YAAc,eAI1B,IAAME,EAA0B,aAC9B,CAAClC,EAAOI,IACN,gBAACH,EAAgB,YAAhB,CAA4B,QAAO,IAClC,gBAACkC,EAAA,CAAK,GAAG,IAAI,KAAK,IAAK,GAAGnC,EAAO,QAAS,GAAO,IAAKI,EAAc,CACtE,CAEJ,EACA8B,EAAkB,YAAc,qBAKhC,IAAME,EAAoB,aACxB,CAAC,CAAE,SAAAjC,EAAU,GAAGH,CAAM,EAAGI,IACvB,gBAACH,EAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKI,EAAc,QAAO,IACzDC,EAAoBF,CAAQ,CAC/B,CAEJ,EACAiC,EAAY,YAAc",
6
- "names": ["dialog_exports", "__export", "DialogClose", "DialogContent", "DialogDescription", "DialogRoot", "DialogTitle", "DialogTrigger", "React", "classNames", "DialogPrimitive", "DialogRoot", "props", "DialogPrimitive", "DialogTrigger", "children", "forwardedRef", "requireReactElement", "alignPropDef", "contentPropDefs", "dialogContentPropDefs", "alignPropDefs", "DialogContent", "align", "ownProps", "useThemeSizeProps", "alignClassName", "extractProps", "className", "forceMount", "container", "contentProps", "contentRef", "combinedRef", "node", "useBodyPointerEventsCleanup", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "Theme", "classNames", "DialogTitle", "Heading", "DialogDescription", "Text", "DialogClose"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-IWCFJJBI.js";import{a as o}from"./chunk-UONSKZQT.js";import{a as c}from"./chunk-5BWLY27A.js";import{a as m}from"./chunk-PS6NEG5A.js";import*as r from"react";import R from"classnames";import{ScrollArea as e}from"radix-ui";import{useComposedRefs as w}from"radix-ui/internal";var N=r.forwardRef((n,d)=>{let{asChild:t,children:u,className:S,style:f,type:a,scrollHideDelay:A=a!=="scroll"?0:void 0,dir:T,radius:i=o.radius.default,scrollbars:l=o.scrollbars.default,fade:s=o.fade.default,...P}=n,y=c(s),v=p(),b=w(d,y,v);return r.createElement(e.Root,{type:a,scrollHideDelay:A,className:R("kui-ScrollAreaRoot",S),"data-fade":s?"":void 0,style:f,asChild:t},m({asChild:t,children:u},h=>r.createElement(r.Fragment,null,r.createElement(e.Viewport,{...P,ref:b,className:"kui-ScrollAreaViewport"},h),r.createElement("div",{className:"kui-ScrollAreaViewportFocusRing"}),l!=="vertical"?r.createElement(e.Scrollbar,{"data-radius":i,orientation:"horizontal",className:"kui-ScrollAreaScrollbar"},r.createElement(e.Thumb,{className:"kui-ScrollAreaThumb"})):null,l!=="horizontal"?r.createElement(e.Scrollbar,{"data-radius":i,orientation:"vertical",className:"kui-ScrollAreaScrollbar"},r.createElement(e.Thumb,{className:"kui-ScrollAreaThumb"})):null,l==="both"?r.createElement(e.Corner,{className:"kui-ScrollAreaCorner"}):null)))});N.displayName="ScrollArea";export{N as a};
2
- //# sourceMappingURL=chunk-R4XJNQX5.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/scroll-area.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs } from 'radix-ui/internal';\n\nimport { scrollAreaPropDefs } from './scroll-area.props.js';\nimport { useScrollEdges } from '../hooks/use-scroll-edges.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ScrollAreaElement = React.ElementRef<typeof ScrollAreaPrimitive.Viewport>;\ntype ScrollAreaOwnProps = GetPropDefTypes<typeof scrollAreaPropDefs>;\ninterface ScrollAreaProps\n extends ComponentPropsWithout<typeof ScrollAreaPrimitive.Root, RemovedProps>,\n ComponentPropsWithout<typeof ScrollAreaPrimitive.Viewport, RemovedProps | 'dir'>,\n ScrollAreaOwnProps {}\nconst ScrollArea = React.forwardRef<ScrollAreaElement, ScrollAreaProps>((props, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n style,\n type,\n scrollHideDelay = type !== 'scroll' ? 0 : undefined,\n dir,\n radius = scrollAreaPropDefs.radius.default,\n scrollbars = scrollAreaPropDefs.scrollbars.default,\n fade = scrollAreaPropDefs.fade.default,\n ...viewportProps\n } = props;\n const setEdgesElement = useScrollEdges<HTMLDivElement>(fade);\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n const viewportRef = useComposedRefs(forwardedRef, setEdgesElement, setThumbViewport);\n\n return (\n <ScrollAreaPrimitive.Root\n type={type}\n scrollHideDelay={scrollHideDelay}\n className={classNames('kui-ScrollAreaRoot', className)}\n data-fade={fade ? '' : undefined}\n style={style}\n asChild={asChild}\n >\n {getSubtree({ asChild, children }, (children) => (\n <>\n <ScrollAreaPrimitive.Viewport\n {...viewportProps}\n ref={viewportRef}\n className=\"kui-ScrollAreaViewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n\n <div className=\"kui-ScrollAreaViewportFocusRing\" />\n\n {scrollbars !== 'vertical' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"horizontal\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars !== 'horizontal' ? (\n <ScrollAreaPrimitive.Scrollbar\n data-radius={radius}\n orientation=\"vertical\"\n className=\"kui-ScrollAreaScrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n\n {scrollbars === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"kui-ScrollAreaCorner\" />\n ) : null}\n </>\n ))}\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport { ScrollArea };\nexport type { ScrollAreaProps };\n"],
5
- "mappings": "gKAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,cAAcC,MAA2B,WAClD,OAAS,mBAAAC,MAAuB,oBAgBhC,IAAMC,EAAmB,aAA+C,CAACC,EAAOC,IAAiB,CAC/F,GAAM,CACJ,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,KAAAC,EACA,gBAAAC,EAAkBD,IAAS,SAAW,EAAI,OAC1C,IAAAE,EACA,OAAAC,EAASC,EAAmB,OAAO,QACnC,WAAAC,EAAaD,EAAmB,WAAW,QAC3C,KAAAE,EAAOF,EAAmB,KAAK,QAC/B,GAAGG,CACL,EAAIb,EACEc,EAAkBC,EAA+BH,CAAI,EACrDI,EAAmBC,EAA6B,EAChDC,EAAcC,EAAgBlB,EAAca,EAAiBE,CAAgB,EAEnF,OACE,gBAACI,EAAoB,KAApB,CACC,KAAMd,EACN,gBAAiBC,EACjB,UAAWc,EAAW,qBAAsBjB,CAAS,EACrD,YAAWQ,EAAO,GAAK,OACvB,MAAOP,EACP,QAASH,GAERoB,EAAW,CAAE,QAAApB,EAAS,SAAAC,CAAS,EAAIA,GAClC,gCACE,gBAACiB,EAAoB,SAApB,CACE,GAAGP,EACJ,IAAKK,EACL,UAAU,0BAETf,CACH,EAEA,gBAAC,OAAI,UAAU,kCAAkC,EAEhDQ,IAAe,WACd,gBAACS,EAAoB,UAApB,CACC,cAAaX,EACb,YAAY,aACZ,UAAU,2BAEV,gBAACW,EAAoB,MAApB,CAA0B,UAAU,sBAAsB,CAC7D,EACE,KAEHT,IAAe,aACd,gBAACS,EAAoB,UAApB,CACC,cAAaX,EACb,YAAY,WACZ,UAAU,2BAEV,gBAACW,EAAoB,MAApB,CAA0B,UAAU,sBAAsB,CAC7D,EACE,KAEHT,IAAe,OACd,gBAACS,EAAoB,OAApB,CAA2B,UAAU,uBAAuB,EAC3D,IACN,CACD,CACH,CAEJ,CAAC,EACDrB,EAAW,YAAc",
6
- "names": ["React", "classNames", "ScrollAreaPrimitive", "useComposedRefs", "ScrollArea", "props", "forwardedRef", "asChild", "children", "className", "style", "type", "scrollHideDelay", "dir", "radius", "scrollAreaPropDefs", "scrollbars", "fade", "viewportProps", "setEdgesElement", "useScrollEdges", "setThumbViewport", "useThumbSync", "viewportRef", "useComposedRefs", "ScrollAreaPrimitive", "classNames", "getSubtree"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-HIEGLLY7.js";import{a as p}from"./chunk-BJUCBOGU.js";import{a as r}from"./chunk-ELAW7ZUG.js";import*as e from"react";import l from"classnames";var c=e.forwardRef((i,o)=>{let{className:t,children:n,loading:m,...f}=r(i,a);if(!m)return n;let s=e.createElement("span",{...f,ref:o,className:l("kui-Spinner",t)},e.createElement("span",{className:"kui-SpinnerWheel"},e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"}),e.createElement("span",{className:"kui-SpinnerLeaf"})));return n===void 0?s:e.createElement(p,{asChild:!0,position:"relative",align:"center",justify:"center"},e.createElement("span",null,e.createElement("span",{"aria-hidden":!0,className:"kui-SpinnerHiddenChildren",inert:void 0},n),e.createElement(p,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},e.createElement("span",null,s))))});c.displayName="Spinner";export{c as a};
2
- //# sourceMappingURL=chunk-UE3HATOA.js.map