@womp/kookie-ui 0.34.0 → 0.34.2

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 (320) hide show
  1. package/README.md +1 -1
  2. package/components.css +15 -4
  3. package/dist/cjs/components/_internal/pane-chrome.d.ts +1 -2
  4. package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
  5. package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
  6. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  7. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  8. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  9. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  10. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  11. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  12. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  13. package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
  14. package/dist/cjs/components/_internal/shell-resizable.js +1 -1
  15. package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
  16. package/dist/cjs/components/_internal/shell-resize.d.ts +2 -0
  17. package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
  18. package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
  19. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  20. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  21. package/dist/cjs/components/avatar.d.ts.map +1 -1
  22. package/dist/cjs/components/avatar.js +1 -1
  23. package/dist/cjs/components/avatar.js.map +2 -2
  24. package/dist/cjs/components/button.js +1 -1
  25. package/dist/cjs/components/button.js.map +3 -3
  26. package/dist/cjs/components/chatbar.d.ts.map +1 -1
  27. package/dist/cjs/components/chatbar.js +1 -1
  28. package/dist/cjs/components/chatbar.js.map +3 -3
  29. package/dist/cjs/components/combobox.d.ts +16 -0
  30. package/dist/cjs/components/combobox.d.ts.map +1 -1
  31. package/dist/cjs/components/combobox.js +1 -1
  32. package/dist/cjs/components/combobox.js.map +2 -2
  33. package/dist/cjs/components/index.js +2 -2
  34. package/dist/cjs/components/index.js.map +3 -3
  35. package/dist/cjs/components/message-scroller.js +1 -1
  36. package/dist/cjs/components/message-scroller.js.map +3 -3
  37. package/dist/cjs/components/navbar.d.ts.map +1 -1
  38. package/dist/cjs/components/navbar.js +1 -1
  39. package/dist/cjs/components/navbar.js.map +3 -3
  40. package/dist/cjs/components/navigator.js +1 -1
  41. package/dist/cjs/components/navigator.js.map +3 -3
  42. package/dist/cjs/components/notice.js +1 -1
  43. package/dist/cjs/components/notice.js.map +3 -3
  44. package/dist/cjs/components/schemas/base-button.schema.d.ts +7 -0
  45. package/dist/cjs/components/schemas/base-button.schema.d.ts.map +1 -1
  46. package/dist/cjs/components/schemas/base-button.schema.js +1 -1
  47. package/dist/cjs/components/schemas/base-button.schema.js.map +2 -2
  48. package/dist/cjs/components/schemas/button.schema.d.ts +14 -0
  49. package/dist/cjs/components/schemas/button.schema.d.ts.map +1 -1
  50. package/dist/cjs/components/schemas/button.schema.js +1 -1
  51. package/dist/cjs/components/schemas/button.schema.js.map +2 -2
  52. package/dist/cjs/components/schemas/index.js +1 -1
  53. package/dist/cjs/components/schemas/index.js.map +2 -2
  54. package/dist/cjs/components/schemas/shell.schema.d.ts +7 -6
  55. package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
  56. package/dist/cjs/components/schemas/shell.schema.js +1 -1
  57. package/dist/cjs/components/schemas/shell.schema.js.map +2 -2
  58. package/dist/cjs/components/schemas/toggle.schema.d.ts +83 -77
  59. package/dist/cjs/components/schemas/toggle.schema.d.ts.map +1 -1
  60. package/dist/cjs/components/schemas/toggle.schema.js +1 -1
  61. package/dist/cjs/components/schemas/toggle.schema.js.map +2 -2
  62. package/dist/cjs/components/segmented-control.d.ts.map +1 -1
  63. package/dist/cjs/components/segmented-control.js +1 -1
  64. package/dist/cjs/components/segmented-control.js.map +3 -3
  65. package/dist/cjs/components/select.js +1 -1
  66. package/dist/cjs/components/select.js.map +2 -2
  67. package/dist/cjs/components/sheet.d.ts +2 -2
  68. package/dist/cjs/components/sheet.js.map +1 -1
  69. package/dist/cjs/components/shell.context.js.map +1 -1
  70. package/dist/cjs/components/shell.js +1 -1
  71. package/dist/cjs/components/shell.js.map +3 -3
  72. package/dist/cjs/components/sidebar.d.ts +1 -1
  73. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  74. package/dist/cjs/components/sidebar.js +1 -1
  75. package/dist/cjs/components/sidebar.js.map +3 -3
  76. package/dist/cjs/components/table.d.ts.map +1 -1
  77. package/dist/cjs/components/table.js +1 -1
  78. package/dist/cjs/components/table.js.map +3 -3
  79. package/dist/cjs/components/text-field.d.ts.map +1 -1
  80. package/dist/cjs/components/text-field.js +2 -2
  81. package/dist/cjs/components/text-field.js.map +3 -3
  82. package/dist/cjs/components/toggle.js +1 -1
  83. package/dist/cjs/components/toggle.js.map +3 -3
  84. package/dist/cjs/components/toolbar.js +1 -1
  85. package/dist/cjs/components/toolbar.js.map +3 -3
  86. package/dist/cjs/components/virtual-menu.d.ts.map +1 -1
  87. package/dist/cjs/components/virtual-menu.js +1 -1
  88. package/dist/cjs/components/virtual-menu.js.map +3 -3
  89. package/dist/cjs/helpers/index.js +3 -3
  90. package/dist/cjs/helpers/index.js.map +2 -2
  91. package/dist/cjs/helpers/map-prop-values.d.ts.map +1 -1
  92. package/dist/cjs/helpers/map-prop-values.js +1 -1
  93. package/dist/cjs/helpers/map-prop-values.js.map +2 -2
  94. package/dist/cjs/index.js +4 -4
  95. package/dist/cjs/index.js.map +3 -3
  96. package/dist/cjs/props/index.d.ts +6 -0
  97. package/dist/cjs/props/index.d.ts.map +1 -1
  98. package/dist/cjs/props/index.js +1 -1
  99. package/dist/cjs/props/index.js.map +4 -4
  100. package/dist/esm/chunk-25FNCKUM.js +2 -0
  101. package/dist/esm/chunk-25FNCKUM.js.map +7 -0
  102. package/dist/esm/{chunk-KDJM4NQQ.js → chunk-2WFN4D52.js} +2 -2
  103. package/dist/esm/chunk-4OJRLS5N.js +3 -0
  104. package/dist/esm/chunk-4OJRLS5N.js.map +7 -0
  105. package/dist/esm/chunk-4TTRPCGG.js +3 -0
  106. package/dist/esm/{chunk-QKCNGEX4.js.map → chunk-4TTRPCGG.js.map} +3 -3
  107. package/dist/esm/chunk-4X64QOAR.js +3 -0
  108. package/dist/esm/chunk-4X64QOAR.js.map +7 -0
  109. package/dist/esm/{chunk-L7PRLW6A.js → chunk-5APRBJRR.js} +2 -2
  110. package/dist/esm/{chunk-L7PRLW6A.js.map → chunk-5APRBJRR.js.map} +2 -2
  111. package/dist/esm/chunk-7HD5LS3M.js +3 -0
  112. package/dist/esm/chunk-7HD5LS3M.js.map +7 -0
  113. package/dist/esm/chunk-7ZOGH5NT.js +2 -0
  114. package/dist/esm/chunk-7ZOGH5NT.js.map +7 -0
  115. package/dist/esm/chunk-BJA75XKG.js +2 -0
  116. package/dist/esm/chunk-BJA75XKG.js.map +7 -0
  117. package/dist/esm/{chunk-NO2JCJWI.js → chunk-BJVXB3PN.js} +2 -2
  118. package/dist/esm/{chunk-BR6Z2CAE.js → chunk-C6VGCYFQ.js} +2 -2
  119. package/dist/esm/chunk-EZYXYLR2.js +2 -0
  120. package/dist/esm/chunk-EZYXYLR2.js.map +7 -0
  121. package/dist/esm/chunk-FTNZWAPB.js +3 -0
  122. package/dist/esm/{chunk-7QBNXNEN.js.map → chunk-FTNZWAPB.js.map} +3 -3
  123. package/dist/esm/{chunk-ZLGOZKB3.js → chunk-FYZXC7AL.js} +2 -2
  124. package/dist/esm/{chunk-XD676L6S.js → chunk-HQT32HQ6.js} +2 -2
  125. package/dist/esm/{chunk-XKYPJTRN.js → chunk-I5TPDYJO.js} +2 -2
  126. package/dist/esm/chunk-I77CYEBT.js +2 -0
  127. package/dist/esm/chunk-I77CYEBT.js.map +7 -0
  128. package/dist/esm/{chunk-API4DAPY.js → chunk-J7MIXG6M.js} +1 -1
  129. package/dist/esm/chunk-J7MIXG6M.js.map +7 -0
  130. package/dist/esm/{chunk-UMQOTGJC.js → chunk-M26LLCQC.js} +2 -2
  131. package/dist/esm/{chunk-WN3WMFAM.js → chunk-MLHS2GWL.js} +2 -2
  132. package/dist/esm/chunk-MPLBIPJ6.js +3 -0
  133. package/dist/esm/chunk-MPLBIPJ6.js.map +7 -0
  134. package/dist/esm/{chunk-WEBNIUEX.js → chunk-MXEOE4LA.js} +1 -1
  135. package/dist/esm/chunk-MXEOE4LA.js.map +7 -0
  136. package/dist/esm/chunk-OGVKMDO7.js +3 -0
  137. package/dist/esm/chunk-OGVKMDO7.js.map +7 -0
  138. package/dist/esm/{chunk-ODHCDJ3Y.js → chunk-PMXIQ5B4.js} +1 -1
  139. package/dist/esm/chunk-PMXIQ5B4.js.map +7 -0
  140. package/dist/esm/{chunk-LG5DPQ46.js → chunk-R4DMVTM3.js} +2 -2
  141. package/dist/esm/{chunk-LG5DPQ46.js.map → chunk-R4DMVTM3.js.map} +3 -3
  142. package/dist/esm/chunk-S6SEWECR.js +3 -0
  143. package/dist/esm/{chunk-5VYQDA5S.js.map → chunk-S6SEWECR.js.map} +3 -3
  144. package/dist/esm/{chunk-7YXHLU4C.js → chunk-TANYRHGP.js} +2 -2
  145. package/dist/esm/{chunk-INGT6DB6.js → chunk-TS4QCDSI.js} +1 -1
  146. package/dist/esm/chunk-TS4QCDSI.js.map +7 -0
  147. package/dist/esm/chunk-WYLIU3Q6.js +2 -0
  148. package/dist/esm/chunk-WYLIU3Q6.js.map +7 -0
  149. package/dist/esm/chunk-X4PWBFOT.js +3 -0
  150. package/dist/esm/chunk-X4PWBFOT.js.map +7 -0
  151. package/dist/esm/chunk-XFMAA4MD.js +3 -0
  152. package/dist/esm/chunk-XFMAA4MD.js.map +7 -0
  153. package/dist/esm/chunk-XGV7KNSE.js +3 -0
  154. package/dist/esm/chunk-XGV7KNSE.js.map +7 -0
  155. package/dist/esm/chunk-XOAOSRTH.js +3 -0
  156. package/dist/esm/chunk-XOAOSRTH.js.map +7 -0
  157. package/dist/esm/{chunk-YOTTLPJ3.js → chunk-Y5ITMKC6.js} +2 -2
  158. package/dist/esm/chunk-YLGIP3A5.js +6 -0
  159. package/dist/esm/chunk-YLGIP3A5.js.map +7 -0
  160. package/dist/esm/chunk-YLPCYCYA.js +3 -0
  161. package/dist/esm/chunk-YLPCYCYA.js.map +7 -0
  162. package/dist/esm/components/_internal/pane-chrome.d.ts +1 -2
  163. package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
  164. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  165. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  166. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  167. package/dist/esm/components/_internal/shell-handles.js +1 -1
  168. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  169. package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
  170. package/dist/esm/components/_internal/shell-resizable.js +1 -1
  171. package/dist/esm/components/_internal/shell-resize.d.ts +2 -0
  172. package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
  173. package/dist/esm/components/_internal/shell-resize.js +1 -1
  174. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  175. package/dist/esm/components/accordion.props.js +1 -1
  176. package/dist/esm/components/accordion.props.js.map +4 -4
  177. package/dist/esm/components/avatar.d.ts.map +1 -1
  178. package/dist/esm/components/avatar.js +1 -1
  179. package/dist/esm/components/button.js +1 -1
  180. package/dist/esm/components/chatbar.d.ts.map +1 -1
  181. package/dist/esm/components/chatbar.js +1 -1
  182. package/dist/esm/components/combobox.d.ts +16 -0
  183. package/dist/esm/components/combobox.d.ts.map +1 -1
  184. package/dist/esm/components/combobox.js +1 -1
  185. package/dist/esm/components/combobox.props.js +1 -1
  186. package/dist/esm/components/combobox.props.js.map +4 -4
  187. package/dist/esm/components/image.props.js +1 -1
  188. package/dist/esm/components/image.props.js.map +4 -4
  189. package/dist/esm/components/index.js +1 -1
  190. package/dist/esm/components/message-scroller.js +1 -1
  191. package/dist/esm/components/navbar.d.ts.map +1 -1
  192. package/dist/esm/components/navbar.js +1 -1
  193. package/dist/esm/components/navbar.props.js +1 -1
  194. package/dist/esm/components/navbar.props.js.map +4 -4
  195. package/dist/esm/components/navigator.js +1 -1
  196. package/dist/esm/components/notice.js +1 -1
  197. package/dist/esm/components/schemas/base-button.schema.d.ts +7 -0
  198. package/dist/esm/components/schemas/base-button.schema.d.ts.map +1 -1
  199. package/dist/esm/components/schemas/base-button.schema.js +1 -1
  200. package/dist/esm/components/schemas/button.schema.d.ts +14 -0
  201. package/dist/esm/components/schemas/button.schema.d.ts.map +1 -1
  202. package/dist/esm/components/schemas/button.schema.js +1 -1
  203. package/dist/esm/components/schemas/index.js +1 -1
  204. package/dist/esm/components/schemas/shell.schema.d.ts +7 -6
  205. package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
  206. package/dist/esm/components/schemas/shell.schema.js +1 -1
  207. package/dist/esm/components/schemas/toggle.schema.d.ts +83 -77
  208. package/dist/esm/components/schemas/toggle.schema.d.ts.map +1 -1
  209. package/dist/esm/components/schemas/toggle.schema.js +1 -1
  210. package/dist/esm/components/segmented-control.d.ts.map +1 -1
  211. package/dist/esm/components/segmented-control.js +1 -1
  212. package/dist/esm/components/select.js +1 -1
  213. package/dist/esm/components/sheet.d.ts +2 -2
  214. package/dist/esm/components/sheet.js +1 -1
  215. package/dist/esm/components/shell.context.js +1 -1
  216. package/dist/esm/components/shell.js +1 -1
  217. package/dist/esm/components/sidebar.d.ts +1 -1
  218. package/dist/esm/components/sidebar.d.ts.map +1 -1
  219. package/dist/esm/components/sidebar.js +1 -1
  220. package/dist/esm/components/table.d.ts.map +1 -1
  221. package/dist/esm/components/table.js +1 -1
  222. package/dist/esm/components/text-field.d.ts.map +1 -1
  223. package/dist/esm/components/text-field.js +1 -1
  224. package/dist/esm/components/toggle.js +1 -1
  225. package/dist/esm/components/toolbar.js +1 -1
  226. package/dist/esm/components/toolbar.props.js +1 -1
  227. package/dist/esm/components/toolbar.props.js.map +4 -4
  228. package/dist/esm/components/virtual-menu.d.ts.map +1 -1
  229. package/dist/esm/components/virtual-menu.js +1 -1
  230. package/dist/esm/helpers/index.js +1 -1
  231. package/dist/esm/helpers/map-prop-values.d.ts.map +1 -1
  232. package/dist/esm/helpers/map-prop-values.js +1 -1
  233. package/dist/esm/index.js +1 -1
  234. package/dist/esm/props/index.d.ts +6 -0
  235. package/dist/esm/props/index.d.ts.map +1 -1
  236. package/dist/esm/props/index.js +1 -1
  237. package/layout/utilities.css +810 -0
  238. package/layout.css +810 -0
  239. package/package.json +3 -4
  240. package/schemas/base-button.json +13 -0
  241. package/schemas/button.json +13 -0
  242. package/schemas/index.json +51 -12
  243. package/schemas/shell-bottom.json +2 -2
  244. package/schemas/shell-content.json +2 -2
  245. package/schemas/shell-header.json +4 -0
  246. package/schemas/shell-inspector.json +2 -2
  247. package/schemas/shell-panel.json +2 -2
  248. package/schemas/shell-rail.json +2 -2
  249. package/schemas/shell-sidebar.json +2 -2
  250. package/schemas/toggle.json +9 -0
  251. package/src/components/_internal/base-dialog.css +1 -1
  252. package/src/components/_internal/pane-chrome.tsx +2 -3
  253. package/src/components/_internal/shell-handles.tsx +3 -0
  254. package/src/components/_internal/shell-resizable.tsx +9 -0
  255. package/src/components/_internal/shell-resize.tsx +2 -0
  256. package/src/components/avatar.tsx +3 -1
  257. package/src/components/button.tsx +1 -1
  258. package/src/components/chatbar.tsx +2 -1
  259. package/src/components/combobox.tsx +2 -3
  260. package/src/components/navbar.tsx +3 -4
  261. package/src/components/navigator.css +4 -4
  262. package/src/components/schemas/base-button.schema.ts +7 -0
  263. package/src/components/schemas/shell.schema.ts +3 -2
  264. package/src/components/schemas/toggle.schema.ts +2 -1
  265. package/src/components/segmented-control.css +13 -0
  266. package/src/components/segmented-control.tsx +10 -2
  267. package/src/components/select.tsx +2 -2
  268. package/src/components/sheet.tsx +2 -2
  269. package/src/components/shell.context.tsx +1 -1
  270. package/src/components/sidebar.tsx +1 -1
  271. package/src/components/table.tsx +4 -1
  272. package/src/components/text-field.css +2 -2
  273. package/src/components/text-field.tsx +11 -4
  274. package/src/components/virtual-menu.tsx +8 -1
  275. package/src/helpers/map-prop-values.ts +0 -1
  276. package/src/props/index.ts +6 -0
  277. package/src/styles/utilities/inset.css +135 -0
  278. package/styles.css +825 -4
  279. package/utilities.css +810 -0
  280. package/dist/esm/chunk-3QWGSRYC.js +0 -3
  281. package/dist/esm/chunk-3QWGSRYC.js.map +0 -7
  282. package/dist/esm/chunk-5KQCG7AV.js +0 -3
  283. package/dist/esm/chunk-5KQCG7AV.js.map +0 -7
  284. package/dist/esm/chunk-5VYQDA5S.js +0 -3
  285. package/dist/esm/chunk-7QBNXNEN.js +0 -3
  286. package/dist/esm/chunk-API4DAPY.js.map +0 -7
  287. package/dist/esm/chunk-BQOFHLDP.js +0 -3
  288. package/dist/esm/chunk-BQOFHLDP.js.map +0 -7
  289. package/dist/esm/chunk-CZ24FOFS.js +0 -3
  290. package/dist/esm/chunk-CZ24FOFS.js.map +0 -7
  291. package/dist/esm/chunk-EERKYRYI.js +0 -3
  292. package/dist/esm/chunk-EERKYRYI.js.map +0 -7
  293. package/dist/esm/chunk-HZYE46V2.js +0 -2
  294. package/dist/esm/chunk-HZYE46V2.js.map +0 -7
  295. package/dist/esm/chunk-IN2WND4B.js +0 -3
  296. package/dist/esm/chunk-IN2WND4B.js.map +0 -7
  297. package/dist/esm/chunk-INGT6DB6.js.map +0 -7
  298. package/dist/esm/chunk-J6B7UCZN.js +0 -3
  299. package/dist/esm/chunk-J6B7UCZN.js.map +0 -7
  300. package/dist/esm/chunk-JQMWNI62.js +0 -3
  301. package/dist/esm/chunk-JQMWNI62.js.map +0 -7
  302. package/dist/esm/chunk-ODHCDJ3Y.js.map +0 -7
  303. package/dist/esm/chunk-QKCNGEX4.js +0 -3
  304. package/dist/esm/chunk-TMINGBSQ.js +0 -3
  305. package/dist/esm/chunk-TMINGBSQ.js.map +0 -7
  306. package/dist/esm/chunk-WEBNIUEX.js.map +0 -7
  307. package/dist/esm/chunk-XF6Z5NKE.js +0 -3
  308. package/dist/esm/chunk-XF6Z5NKE.js.map +0 -7
  309. package/dist/esm/chunk-Y44DYJA5.js +0 -6
  310. package/dist/esm/chunk-Y44DYJA5.js.map +0 -7
  311. /package/dist/esm/{chunk-KDJM4NQQ.js.map → chunk-2WFN4D52.js.map} +0 -0
  312. /package/dist/esm/{chunk-NO2JCJWI.js.map → chunk-BJVXB3PN.js.map} +0 -0
  313. /package/dist/esm/{chunk-BR6Z2CAE.js.map → chunk-C6VGCYFQ.js.map} +0 -0
  314. /package/dist/esm/{chunk-ZLGOZKB3.js.map → chunk-FYZXC7AL.js.map} +0 -0
  315. /package/dist/esm/{chunk-XD676L6S.js.map → chunk-HQT32HQ6.js.map} +0 -0
  316. /package/dist/esm/{chunk-XKYPJTRN.js.map → chunk-I5TPDYJO.js.map} +0 -0
  317. /package/dist/esm/{chunk-UMQOTGJC.js.map → chunk-M26LLCQC.js.map} +0 -0
  318. /package/dist/esm/{chunk-WN3WMFAM.js.map → chunk-MLHS2GWL.js.map} +0 -0
  319. /package/dist/esm/{chunk-7YXHLU4C.js.map → chunk-TANYRHGP.js.map} +0 -0
  320. /package/dist/esm/{chunk-YOTTLPJ3.js.map → chunk-Y5ITMKC6.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,WAAY,SAAQ,eAAe;CAAG;AAChD,QAAA,MAAM,MAAM,qFA6EV,CAAC;AAIH,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,UAAU,eAAgB,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,cAAc;IAEjH,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CACnD;AA0CD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,WAAY,SAAQ,eAAe;CAAG;AAChD,QAAA,MAAM,MAAM,qFA6EV,CAAC;AAIH,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,UAAU,eAAgB,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,cAAc;IAEjH,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CACnD;AA4CD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";"use client";var oe=Object.create;var g=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var fe=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ae(e))!le.call(t,o)&&o!==n&&g(t,o,{get:()=>e[o],enumerable:!(s=ie(e,o))||s.enumerable});return t};var m=(t,e,n)=>(n=t!=null?oe(pe(t)):{},x(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),ue=t=>x(g({},"__esModule",{value:!0}),t);var Ne={};fe(Ne,{Avatar:()=>U});module.exports=ue(Ne);var u=m(require("react")),k=m(require("classnames")),D=require("radix-ui");var V={asChild:{type:"boolean"}};var h=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var A={color:{type:"enum",values:h,default:"gray"}};var de=["none","small","medium","large","full"],z={radius:{type:"enum",values:de,default:void 0}};var ce=["1","2","3","4","5","6","7","8","9"],me=["raised","solid","soft","surface","outline"],ye=["cover","contain","fill","scale-down","none"],b={...V,size:{type:"enum",className:"kui-r-size",values:ce,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:me,default:"raised"},...A,...z,fallback:{type:"ReactNode",required:!0},status:{type:"enum",values:h,default:void 0},statusLabel:{type:"string",default:void 0},badge:{type:"ReactNode",default:void 0},fit:{type:"enum",className:"kui-r-fit",values:ye,default:"cover",responsive:!0}};var j=m(require("classnames"));var ge=[],Pe=new Set;function ve(t){let e=Object.assign({},...t),n=[],s=[],o=new Set;for(let a in e){let i=e[a],l=i.values??ge,p={key:a,type:i.type,default:i.default,hasDefault:i.default!==void 0,responsive:"responsive"in i,className:i.className,customProperties:i.customProperties,parseValue:i.parseValue,values:l,valueSet:l.length>0?new Set(l):Pe,enumValueSet:i.type==="enum"?new Set([i.default,...l]):void 0};i.className?(n.push(p),o.add(a)):(p.hasDefault||i.type==="enum")&&s.push(p)}return{styling:n,passthrough:s,stylingKeys:o}}var Re={children:new WeakMap};function E(t){let e=Re;for(let n=0;n<t.length;n++){let s=t[n],o=e.children.get(s);o===void 0&&(o={children:new WeakMap},e.children.set(s,o)),e=o}return e.compiled??(e.compiled=ve(t))}var De=["initial","xs","sm","md","lg","xl"],S=new Set(De);function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var he=new Set(["initial","xs","sm","md","lg","xl"]);function c(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(he.has(e))return!0;return!1}function P(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function O({className:t,customProperties:e,...n}){let s=N({allowArbitraryValues:!0,className:t,...n}),o=be({customProperties:e,...n});return[s,o]}function N({allowArbitraryValues:t,value:e,className:n,propValues:s,propValueSet:o,parseValue:a=i=>i}){if(e){if(typeof e=="string")return P(s,o,e)?w(n,e,a):t?n:void 0;if(c(e)){let i=e,l=[];for(let p in i){if(!C(i,p)||!S.has(p))continue;let r=i[p];if(r!==void 0){if(P(s,o,r)){let f=w(n,r,a),d=p==="initial"?f:`${p}:${f}`;l.push(d)}else if(t){let f=p==="initial"?n:`${p}:${n}`;l.push(f)}}}return l.length>0?l.join(" "):""}if(t)return n}}function w(t,e,n){let s=t?"-":"",o=n(e),a=o?.startsWith("-"),i=a?"-":"",l=a?o?.substring(1):o;return`${i}${t}${s}${l}`}function be({customProperties:t,value:e,propValues:n,propValueSet:s,parseValue:o=a=>a}){if(!e||typeof e=="string"&&P(n,s,e))return;let a;if(typeof e=="string"){let i=o(e);a={};for(let l of t)a[l]=i;return a}if(c(e)){let i=e;for(let l in i){if(!C(i,l)||!S.has(l))continue;let p=i[l];if(p===void 0||P(n,s,p))continue;let r=o(p);a??(a={});for(let f of t){let d=l==="initial"?f:`${f}-${l}`;a[d]=r}}}return a??{}}function T(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function Se(t,e){let n=t.initial,s=!1;return e.hasDefault&&n===void 0&&(n=e.default,s=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,s=!0),s?{...t,initial:n}:t}function I(t,...e){let{styling:n,passthrough:s,stylingKeys:o}=E(e),a={};for(let p in t)o.has(p)||(a[p]=t[p]);for(let p=0;p<s.length;p++){let r=s[p],f=a[r.key];if(f===void 0){r.hasDefault&&(a[r.key]=r.default);continue}r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!c(f)&&(a[r.key]=r.default)}let i,l=[];for(let p=0;p<n.length;p++){let r=n[p],f=t[r.key];if(f===void 0&&r.hasDefault&&(f=r.default),r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!c(f)&&(f=r.default),!!f){if(c(f)){if(!r.responsive)continue;f=Se(f,r)}if(r.type==="enum"){let d=N({allowArbitraryValues:!1,value:f,className:r.className,propValues:r.values,propValueSet:r.valueSet,parseValue:r.parseValue});d&&l.push(d);continue}if(r.type==="string"||r.type==="enum | string"){let[d,y]=O({className:r.className,customProperties:r.customProperties,propValues:r.type==="string"?[]:r.values,propValueSet:r.type==="string"?void 0:r.valueSet,parseValue:r.parseValue,value:f});y&&(i=T(i,y)),d&&l.push(d);continue}if(r.type==="boolean"){l.push(r.className);continue}}}return a.className=(0,j.default)(l.length>0?l.join(" "):void 0,t.className),a.style=T(i,t.style),a}var v=m(require("react"));function $(t,e){let{asChild:n,children:s}=t;if(!n)return typeof e=="function"?e(s):e;let o=v.Children.only(s);return v.cloneElement(o,{children:typeof e=="function"?e(o.props.children):e})}var R=m(require("react"));function G(t,e){if(e.includes(t))return t;let n=Number(t),s=e[0],o=1/0;for(let a=0;a<e.length;a++){let i=Math.abs(Number(e[a])-n);i<o&&(o=i,s=e[a])}return s}var K=R.createContext("2");K.displayName="ThemeSizeContext";function L(t,e){let n=R.useContext(K);if(t.size!==void 0)return t;let s=G(n,e.values);return s===e.default?t:{...t,size:s}}var U=u.forwardRef((t,e)=>{let n=L(t,b.size),{asChild:s,children:o,className:a,style:i,color:l,radius:p,status:r,statusLabel:f,badge:d,fallback:y,onLoadingStatusChange:W,src:F,alt:M,srcSet:_,sizes:q,crossOrigin:H,referrerPolicy:Y,loading:Z,decoding:J,onLoad:Q,onError:X,...ee}=I(n,b),te={fallback:y,onLoadingStatusChange:W,src:F,alt:M,srcSet:_,sizes:q,crossOrigin:H,referrerPolicy:Y,loading:Z,decoding:J,onLoad:Q,onError:X},ne=s&&o!=null&&u.isValidElement(o)&&(o.props.disabled===!0||o.props["data-disabled"]===!0),re=d!==void 0||r!==void 0,se=d!==void 0?u.createElement("span",{className:"kui-AvatarBadge"},d):r!==void 0?u.createElement("span",{className:"kui-AvatarStatus","data-accent-color":r,role:f?"img":void 0,"aria-label":f||void 0,"aria-hidden":f?void 0:!0}):null;return u.createElement(D.Avatar.Root,{...ee,ref:e,"data-accent-color":l,"data-radius":p,"data-disabled":ne||void 0,"data-has-indicator":re||void 0,className:(0,k.default)("kui-reset","kui-AvatarRoot",a),style:i,asChild:s},$({asChild:s,children:o},u.createElement(u.Fragment,null,u.createElement(B,{...te}),se)))});U.displayName="Avatar";var B=u.memo(({fallback:t,onLoadingStatusChange:e,...n})=>{let[s,o]=u.useState("idle"),a=u.useCallback(i=>{e?.(i),o(i)},[e]);return u.createElement(u.Fragment,null,s==="idle"||s==="loading"?u.createElement("span",{className:"kui-AvatarFallback"}):null,s==="error"?u.createElement(D.Avatar.Fallback,{className:(0,k.default)("kui-AvatarFallback",{"kui-one-letter":typeof t=="string"&&t.length===1,"kui-two-letters":typeof t=="string"&&t.length===2}),...n.alt?{role:"img","aria-label":n.alt}:{"aria-hidden":!0}},t):null,u.createElement(D.Avatar.Image,{className:"kui-AvatarImage",...n,onLoadingStatusChange:a}))});B.displayName="AvatarImpl";
2
+ "use strict";"use client";var oe=Object.create;var g=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var fe=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ae(e))!le.call(t,o)&&o!==n&&g(t,o,{get:()=>e[o],enumerable:!(s=ie(e,o))||s.enumerable});return t};var m=(t,e,n)=>(n=t!=null?oe(pe(t)):{},x(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),ue=t=>x(g({},"__esModule",{value:!0}),t);var Ne={};fe(Ne,{Avatar:()=>U});module.exports=ue(Ne);var u=m(require("react")),k=m(require("classnames")),D=require("radix-ui");var V={asChild:{type:"boolean"}};var h=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"];var A={color:{type:"enum",values:h,default:"gray"}};var de=["none","small","medium","large","full"],z={radius:{type:"enum",values:de,default:void 0}};var ce=["1","2","3","4","5","6","7","8","9"],me=["raised","solid","soft","surface","outline"],ye=["cover","contain","fill","scale-down","none"],b={...V,size:{type:"enum",className:"kui-r-size",values:ce,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:me,default:"raised"},...A,...z,fallback:{type:"ReactNode",required:!0},status:{type:"enum",values:h,default:void 0},statusLabel:{type:"string",default:void 0},badge:{type:"ReactNode",default:void 0},fit:{type:"enum",className:"kui-r-fit",values:ye,default:"cover",responsive:!0}};var j=m(require("classnames"));var ge=[],Pe=new Set;function ve(t){let e=Object.assign({},...t),n=[],s=[],o=new Set;for(let a in e){let i=e[a],l=i.values??ge,p={key:a,type:i.type,default:i.default,hasDefault:i.default!==void 0,responsive:"responsive"in i,className:i.className,customProperties:i.customProperties,parseValue:i.parseValue,values:l,valueSet:l.length>0?new Set(l):Pe,enumValueSet:i.type==="enum"?new Set([i.default,...l]):void 0};i.className?(n.push(p),o.add(a)):(p.hasDefault||i.type==="enum")&&s.push(p)}return{styling:n,passthrough:s,stylingKeys:o}}var Re={children:new WeakMap};function E(t){let e=Re;for(let n=0;n<t.length;n++){let s=t[n],o=e.children.get(s);o===void 0&&(o={children:new WeakMap},e.children.set(s,o)),e=o}return e.compiled??(e.compiled=ve(t))}var De=["initial","xs","sm","md","lg","xl"],S=new Set(De);function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var he=new Set(["initial","xs","sm","md","lg","xl"]);function c(t){if(typeof t!="object"||t===null)return!1;for(let e in t)if(he.has(e))return!0;return!1}function P(t,e,n){return e!==void 0?e.has(n):t.includes(n)}function O({className:t,customProperties:e,...n}){let s=N({allowArbitraryValues:!0,className:t,...n}),o=be({customProperties:e,...n});return[s,o]}function N({allowArbitraryValues:t,value:e,className:n,propValues:s,propValueSet:o,parseValue:a=i=>i}){if(e){if(typeof e=="string")return P(s,o,e)?w(n,e,a):t?n:void 0;if(c(e)){let i=e,l=[];for(let p in i){if(!C(i,p)||!S.has(p))continue;let r=i[p];if(r!==void 0){if(P(s,o,r)){let f=w(n,r,a),d=p==="initial"?f:`${p}:${f}`;l.push(d)}else if(t){let f=p==="initial"?n:`${p}:${n}`;l.push(f)}}}return l.length>0?l.join(" "):""}if(t)return n}}function w(t,e,n){let s=t?"-":"",o=n(e),a=o?.startsWith("-"),i=a?"-":"",l=a?o?.substring(1):o;return`${i}${t}${s}${l}`}function be({customProperties:t,value:e,propValues:n,propValueSet:s,parseValue:o=a=>a}){if(!e||typeof e=="string"&&P(n,s,e))return;let a;if(typeof e=="string"){let i=o(e);a={};for(let l of t)a[l]=i;return a}if(c(e)){let i=e;for(let l in i){if(!C(i,l)||!S.has(l))continue;let p=i[l];if(p===void 0||P(n,s,p))continue;let r=o(p);a??(a={});for(let f of t){let d=l==="initial"?f:`${f}-${l}`;a[d]=r}}}return a??{}}function T(...t){let e;for(let n of t)n&&(e===void 0&&(e={}),Object.assign(e,n));return e}function Se(t,e){let n=t.initial,s=!1;return e.hasDefault&&n===void 0&&(n=e.default,s=!0),e.enumValueSet!==void 0&&!e.enumValueSet.has(n)&&(n=e.default,s=!0),s?{...t,initial:n}:t}function I(t,...e){let{styling:n,passthrough:s,stylingKeys:o}=E(e),a={};for(let p in t)o.has(p)||(a[p]=t[p]);for(let p=0;p<s.length;p++){let r=s[p],f=a[r.key];if(f===void 0){r.hasDefault&&(a[r.key]=r.default);continue}r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!c(f)&&(a[r.key]=r.default)}let i,l=[];for(let p=0;p<n.length;p++){let r=n[p],f=t[r.key];if(f===void 0&&r.hasDefault&&(f=r.default),r.enumValueSet!==void 0&&!r.enumValueSet.has(f)&&!c(f)&&(f=r.default),!!f){if(c(f)){if(!r.responsive)continue;f=Se(f,r)}if(r.type==="enum"){let d=N({allowArbitraryValues:!1,value:f,className:r.className,propValues:r.values,propValueSet:r.valueSet,parseValue:r.parseValue});d&&l.push(d);continue}if(r.type==="string"||r.type==="enum | string"){let[d,y]=O({className:r.className,customProperties:r.customProperties,propValues:r.type==="string"?[]:r.values,propValueSet:r.type==="string"?void 0:r.valueSet,parseValue:r.parseValue,value:f});y&&(i=T(i,y)),d&&l.push(d);continue}if(r.type==="boolean"){l.push(r.className);continue}}}return a.className=(0,j.default)(l.length>0?l.join(" "):void 0,t.className),a.style=T(i,t.style),a}var v=m(require("react"));function $(t,e){let{asChild:n,children:s}=t;if(!n)return typeof e=="function"?e(s):e;let o=v.Children.only(s);return v.cloneElement(o,{children:typeof e=="function"?e(o.props.children):e})}var R=m(require("react"));function G(t,e){if(e.includes(t))return t;let n=Number(t),s=e[0],o=1/0;for(let a=0;a<e.length;a++){let i=Math.abs(Number(e[a])-n);i<o&&(o=i,s=e[a])}return s}var K=R.createContext("2");K.displayName="ThemeSizeContext";function L(t,e){let n=R.useContext(K);if(t.size!==void 0)return t;let s=G(n,e.values);return s===e.default?t:{...t,size:s}}var U=u.forwardRef((t,e)=>{let n=L(t,b.size),{asChild:s,children:o,className:a,style:i,color:l,radius:p,status:r,statusLabel:f,badge:d,fallback:y,onLoadingStatusChange:W,src:F,alt:M,srcSet:_,sizes:q,crossOrigin:H,referrerPolicy:Y,loading:Z,decoding:J,onLoad:Q,onError:X,...ee}=I(n,b),te={fallback:y,onLoadingStatusChange:W,src:F,alt:M,srcSet:_,sizes:q,crossOrigin:H,referrerPolicy:Y,loading:Z,decoding:J,onLoad:Q,onError:X},ne=s&&o!=null&&u.isValidElement(o)&&(o.props.disabled===!0||o.props["data-disabled"]===!0),re=d!==void 0||r!==void 0,se=d!==void 0?u.createElement("span",{className:"kui-AvatarBadge"},d):r!==void 0?u.createElement("span",{className:"kui-AvatarStatus","data-accent-color":r,role:f?"img":void 0,"aria-label":f||void 0,"aria-hidden":f?void 0:!0}):null;return u.createElement(D.Avatar.Root,{...ee,ref:e,"data-accent-color":l,"data-radius":p,"data-disabled":ne||void 0,"data-has-indicator":re||void 0,className:(0,k.default)("kui-reset","kui-AvatarRoot",a),style:i,asChild:s},$({asChild:s,children:o},u.createElement(u.Fragment,null,u.createElement(B,{...te}),se)))});U.displayName="Avatar";var B=u.memo(({fallback:t,onLoadingStatusChange:e,...n})=>{let[s,o]=u.useState(()=>n.src?"idle":"error"),a=u.useCallback(i=>{e?.(i),o(i)},[e]);return u.createElement(u.Fragment,null,s==="idle"||s==="loading"?u.createElement("span",{className:"kui-AvatarFallback"}):null,s==="error"?u.createElement(D.Avatar.Fallback,{className:(0,k.default)("kui-AvatarFallback",{"kui-one-letter":typeof t=="string"&&t.length===1,"kui-two-letters":typeof t=="string"&&t.length===2}),...n.alt?{role:"img","aria-label":n.alt}:{"aria-hidden":!0}},t):null,u.createElement(D.Avatar.Image,{className:"kui-AvatarImage",...n,onLoadingStatusChange:a}))});B.displayName="AvatarImpl";
3
3
  //# sourceMappingURL=avatar.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/avatar.tsx", "../../../src/props/as-child.prop.ts", "../../../src/props/color.prop.ts", "../../../src/props/radius.prop.ts", "../../../src/components/avatar.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/helpers/get-subtree.ts", "../../../src/hooks/theme-size.ts", "../../../src/helpers/theme-size.ts"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Avatar as AvatarPrimitive } from 'radix-ui';\n\nimport { avatarPropDefs } from './avatar.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ninterface AvatarProps extends AvatarImplProps {}\nconst Avatar = React.forwardRef<AvatarElement, AvatarProps>((ownProps, forwardedRef) => {\n // An unset size follows the Theme, like a control. Sizes above 4 are only explicit.\n const props = useThemeSizeProps(ownProps, avatarPropDefs.size);\n const {\n asChild,\n children,\n className,\n style,\n color,\n radius,\n status,\n statusLabel,\n badge,\n // Only these reach the <img>, which Radix renders once the picture has loaded.\n fallback,\n onLoadingStatusChange,\n src,\n alt,\n srcSet,\n sizes,\n crossOrigin,\n referrerPolicy,\n loading,\n decoding,\n onLoad,\n onError,\n // Everything else (id, aria-*, data-*, handlers) goes on the root, so it is always rendered.\n ...rootProps\n } = extractProps(props, avatarPropDefs);\n const imageProps = { fallback, onLoadingStatusChange, src, alt, srcSet, sizes, crossOrigin, referrerPolicy, loading, decoding, onLoad, onError };\n\n if (process.env.NODE_ENV !== 'production') {\n if (status !== undefined && badge !== undefined) {\n console.warn('Avatar: Cannot use both `status` and `badge` props together. ' + 'The `badge` prop will be used and `status` will be ignored.');\n }\n }\n\n // Cheap boolean checks \u2014 no memoization needed\n const isDisabled = asChild && children != null && React.isValidElement(children) && ((children.props as any).disabled === true || (children.props as any)['data-disabled'] === true);\n\n const hasIndicator = badge !== undefined || status !== undefined;\n\n const indicator =\n badge !== undefined ? (\n <span className=\"kui-AvatarBadge\">{badge}</span>\n ) : status !== undefined ? (\n <span\n className=\"kui-AvatarStatus\"\n data-accent-color={status}\n role={statusLabel ? 'img' : undefined}\n aria-label={statusLabel || undefined}\n aria-hidden={statusLabel ? undefined : true}\n />\n ) : null;\n\n return (\n <AvatarPrimitive.Root\n {...(rootProps as React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>)}\n ref={forwardedRef}\n data-accent-color={color}\n data-radius={radius}\n data-disabled={isDisabled || undefined}\n data-has-indicator={hasIndicator || undefined}\n className={classNames('kui-reset', 'kui-AvatarRoot', className)}\n style={style}\n asChild={asChild}\n >\n {/* With asChild, Slot takes exactly one child, so the indicator goes inside it. */}\n {getSubtree(\n { asChild, children },\n <>\n <AvatarImpl {...imageProps} />\n {indicator}\n </>,\n )}\n </AvatarPrimitive.Root>\n );\n});\nAvatar.displayName = 'Avatar';\n\ntype AvatarElement = React.ElementRef<typeof AvatarPrimitive.Root>;\ntype AvatarOwnProps = GetPropDefTypes<typeof avatarPropDefs>;\n\ninterface AvatarImplProps extends ComponentPropsWithout<typeof AvatarPrimitive.Image, RemovedProps>, AvatarOwnProps {\n // TODO: See if we can automate making prop defs with `required: true` non nullable\n fallback: NonNullable<AvatarOwnProps['fallback']>;\n}\n\ntype AvatarImageProps = Pick<\n AvatarImplProps,\n 'fallback' | 'onLoadingStatusChange' | 'src' | 'alt' | 'srcSet' | 'sizes' | 'crossOrigin' | 'referrerPolicy' | 'loading' | 'decoding' | 'onLoad' | 'onError'\n>;\n\nconst AvatarImpl = React.memo(({ fallback, onLoadingStatusChange, ...imageProps }: AvatarImageProps) => {\n const [status, setStatus] = React.useState<'idle' | 'loading' | 'loaded' | 'error'>('idle');\n\n const handleLoadingStatusChange = React.useCallback(\n (newStatus: 'idle' | 'loading' | 'loaded' | 'error') => {\n onLoadingStatusChange?.(newStatus);\n setStatus(newStatus);\n },\n [onLoadingStatusChange],\n );\n\n return (\n <>\n {status === 'idle' || status === 'loading' ? <span className=\"kui-AvatarFallback\" /> : null}\n\n {status === 'error' ? (\n <AvatarPrimitive.Fallback\n className={classNames('kui-AvatarFallback', {\n 'kui-one-letter': typeof fallback === 'string' && fallback.length === 1,\n 'kui-two-letters': typeof fallback === 'string' && fallback.length === 2,\n })}\n // Named from alt, like the picture it stands in for. Unnamed, it is decorative.\n {...(imageProps.alt ? { role: 'img', 'aria-label': imageProps.alt } : { 'aria-hidden': true })}\n >\n {fallback}\n </AvatarPrimitive.Fallback>\n ) : null}\n\n <AvatarPrimitive.Image className=\"kui-AvatarImage\" {...imageProps} onLoadingStatusChange={handleLoadingStatusChange} />\n </>\n );\n});\n\nAvatarImpl.displayName = 'AvatarImpl';\n\nexport { Avatar };\nexport type { AvatarProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { grayAccentColorPropDef, accentColors } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline'] as const;\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\n\nconst avatarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n ...grayAccentColorPropDef,\n ...radiusPropDef,\n fallback: { type: 'ReactNode', required: true },\n /**\n * Status indicator color. Renders a small colored dot at the bottom-right corner.\n * Cannot be used together with `badge`.\n */\n status: { type: 'enum', values: accentColors, default: undefined },\n /**\n * The words the status dot stands for, such as \"Online\". A screen reader reads them with the\n * avatar. Without it the dot is hidden from screen readers.\n */\n statusLabel: { type: 'string', default: undefined },\n /**\n * Custom badge content. Renders at the bottom-right corner.\n * Cannot be used together with `status`.\n */\n badge: { type: 'ReactNode', default: undefined },\n /**\n * Controls how the avatar image should be resized to fit its container.\n * Defaults to 'cover' which crops the image to fill the avatar.\n * Use 'contain' to show the full image without cropping.\n */\n fit: { type: 'enum', className: 'kui-r-fit', values: objectFitValues, default: 'cover', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n fallback: PropDef<React.ReactNode>;\n status: PropDef<(typeof accentColors)[number] | undefined>;\n statusLabel: PropDef<string | undefined>;\n badge: PropDef<React.ReactNode>;\n fit: PropDef<(typeof objectFitValues)[number]>;\n};\n\nexport { avatarPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n"],
5
- "mappings": ";mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBCF1C,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,EAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OA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AwBuB,CAAS,EACjCF,EAAUE,CAAS,CACrB,EACA,CAACvB,CAAqB,CACxB,EAEA,OACE,gCACGJ,IAAW,QAAUA,IAAW,UAAY,gBAAC,QAAK,UAAU,qBAAqB,EAAK,KAEtFA,IAAW,QACV,gBAAC,EAAAqB,OAAgB,SAAhB,CACC,aAAW,EAAAC,SAAW,qBAAsB,CAC1C,iBAAkB,OAAOnB,GAAa,UAAYA,EAAS,SAAW,EACtE,kBAAmB,OAAOA,GAAa,UAAYA,EAAS,SAAW,CACzE,CAAC,EAEA,GAAIc,EAAW,IAAM,CAAE,KAAM,MAAO,aAAcA,EAAW,GAAI,EAAI,CAAE,cAAe,EAAK,GAE3Fd,CACH,EACE,KAEJ,gBAAC,EAAAkB,OAAgB,MAAhB,CAAsB,UAAU,kBAAmB,GAAGJ,EAAY,sBAAuBS,EAA2B,CACvH,CAEJ,CAAC,EAEDF,EAAW,YAAc",
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Avatar as AvatarPrimitive } from 'radix-ui';\n\nimport { avatarPropDefs } from './avatar.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { getSubtree } from '../helpers/get-subtree.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ninterface AvatarProps extends AvatarImplProps {}\nconst Avatar = React.forwardRef<AvatarElement, AvatarProps>((ownProps, forwardedRef) => {\n // An unset size follows the Theme, like a control. Sizes above 4 are only explicit.\n const props = useThemeSizeProps(ownProps, avatarPropDefs.size);\n const {\n asChild,\n children,\n className,\n style,\n color,\n radius,\n status,\n statusLabel,\n badge,\n // Only these reach the <img>, which Radix renders once the picture has loaded.\n fallback,\n onLoadingStatusChange,\n src,\n alt,\n srcSet,\n sizes,\n crossOrigin,\n referrerPolicy,\n loading,\n decoding,\n onLoad,\n onError,\n // Everything else (id, aria-*, data-*, handlers) goes on the root, so it is always rendered.\n ...rootProps\n } = extractProps(props, avatarPropDefs);\n const imageProps = { fallback, onLoadingStatusChange, src, alt, srcSet, sizes, crossOrigin, referrerPolicy, loading, decoding, onLoad, onError };\n\n if (process.env.NODE_ENV !== 'production') {\n if (status !== undefined && badge !== undefined) {\n console.warn('Avatar: Cannot use both `status` and `badge` props together. ' + 'The `badge` prop will be used and `status` will be ignored.');\n }\n }\n\n // Cheap boolean checks \u2014 no memoization needed\n const isDisabled = asChild && children != null && React.isValidElement(children) && ((children.props as any).disabled === true || (children.props as any)['data-disabled'] === true);\n\n const hasIndicator = badge !== undefined || status !== undefined;\n\n const indicator =\n badge !== undefined ? (\n <span className=\"kui-AvatarBadge\">{badge}</span>\n ) : status !== undefined ? (\n <span\n className=\"kui-AvatarStatus\"\n data-accent-color={status}\n role={statusLabel ? 'img' : undefined}\n aria-label={statusLabel || undefined}\n aria-hidden={statusLabel ? undefined : true}\n />\n ) : null;\n\n return (\n <AvatarPrimitive.Root\n {...(rootProps as React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>)}\n ref={forwardedRef}\n data-accent-color={color}\n data-radius={radius}\n data-disabled={isDisabled || undefined}\n data-has-indicator={hasIndicator || undefined}\n className={classNames('kui-reset', 'kui-AvatarRoot', className)}\n style={style}\n asChild={asChild}\n >\n {/* With asChild, Slot takes exactly one child, so the indicator goes inside it. */}\n {getSubtree(\n { asChild, children },\n <>\n <AvatarImpl {...imageProps} />\n {indicator}\n </>,\n )}\n </AvatarPrimitive.Root>\n );\n});\nAvatar.displayName = 'Avatar';\n\ntype AvatarElement = React.ElementRef<typeof AvatarPrimitive.Root>;\ntype AvatarOwnProps = GetPropDefTypes<typeof avatarPropDefs>;\n\ninterface AvatarImplProps extends ComponentPropsWithout<typeof AvatarPrimitive.Image, RemovedProps>, AvatarOwnProps {\n // TODO: See if we can automate making prop defs with `required: true` non nullable\n fallback: NonNullable<AvatarOwnProps['fallback']>;\n}\n\ntype AvatarImageProps = Pick<\n AvatarImplProps,\n 'fallback' | 'onLoadingStatusChange' | 'src' | 'alt' | 'srcSet' | 'sizes' | 'crossOrigin' | 'referrerPolicy' | 'loading' | 'decoding' | 'onLoad' | 'onError'\n>;\n\nconst AvatarImpl = React.memo(({ fallback, onLoadingStatusChange, ...imageProps }: AvatarImageProps) => {\n // With no picture to wait for, the fallback is the avatar from the first render, so it is in\n // the server HTML. With one, the box stays empty until the picture loads or fails.\n const [status, setStatus] = React.useState<'idle' | 'loading' | 'loaded' | 'error'>(() => (imageProps.src ? 'idle' : 'error'));\n\n const handleLoadingStatusChange = React.useCallback(\n (newStatus: 'idle' | 'loading' | 'loaded' | 'error') => {\n onLoadingStatusChange?.(newStatus);\n setStatus(newStatus);\n },\n [onLoadingStatusChange],\n );\n\n return (\n <>\n {status === 'idle' || status === 'loading' ? <span className=\"kui-AvatarFallback\" /> : null}\n\n {status === 'error' ? (\n <AvatarPrimitive.Fallback\n className={classNames('kui-AvatarFallback', {\n 'kui-one-letter': typeof fallback === 'string' && fallback.length === 1,\n 'kui-two-letters': typeof fallback === 'string' && fallback.length === 2,\n })}\n // Named from alt, like the picture it stands in for. Unnamed, it is decorative.\n {...(imageProps.alt ? { role: 'img', 'aria-label': imageProps.alt } : { 'aria-hidden': true })}\n >\n {fallback}\n </AvatarPrimitive.Fallback>\n ) : null}\n\n <AvatarPrimitive.Image className=\"kui-AvatarImage\" {...imageProps} onLoadingStatusChange={handleLoadingStatusChange} />\n </>\n );\n});\n\nAvatarImpl.displayName = 'AvatarImpl';\n\nexport { Avatar };\nexport type { AvatarProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import type { PropDef } from './prop-def.js';\n\n// prettier-ignore\nconst accentColors = ['gray', 'gold', 'bronze', 'brown', 'yellow', 'amber', 'orange', 'tomato', 'red', 'ruby', 'crimson', 'pink', 'plum', 'purple', 'violet', 'iris', 'indigo', 'blue', 'cyan', 'teal', 'jade', 'green', 'grass', 'lime', 'mint', 'sky'] as const;\n\nconst grayColors = ['auto', 'gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;\n\nconst colorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: undefined as (typeof accentColors)[number] | undefined,\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// 1. When used on components that compose Text, sets the color of the text to the current accent.\n// 2. Re-declares the accent role tokens (`--accent-ink`, `--accent-solid`, ...) that descendants read.\nconst accentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: '' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\n// For components whose colour comes from their content (Chip, Avatar, Code): they rest gray, and `color` picks a category when it means something.\nconst grayAccentColorPropDef = {\n color: {\n type: 'enum',\n values: accentColors,\n default: 'gray' as (typeof accentColors)[number],\n },\n} satisfies {\n color: PropDef<(typeof accentColors)[number]>;\n};\n\nexport {\n accentColorPropDef,\n grayAccentColorPropDef,\n colorPropDef,\n //\n accentColors,\n grayColors,\n};\n", "import type { PropDef } from './prop-def.js';\n\nconst radii = ['none', 'small', 'medium', 'large', 'full'] as const;\n\nconst radiusPropDef = {\n radius: {\n type: 'enum',\n values: radii,\n default: undefined,\n },\n} satisfies {\n radius: PropDef<(typeof radii)[number]>;\n};\n\nexport { radiusPropDef, radii };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { grayAccentColorPropDef, accentColors } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\nconst variants = ['raised', 'solid', 'soft', 'surface', 'outline'] as const;\nconst objectFitValues = ['cover', 'contain', 'fill', 'scale-down', 'none'] as const;\n\nconst avatarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n ...grayAccentColorPropDef,\n ...radiusPropDef,\n fallback: { type: 'ReactNode', required: true },\n /**\n * Status indicator color. Renders a small colored dot at the bottom-right corner.\n * Cannot be used together with `badge`.\n */\n status: { type: 'enum', values: accentColors, default: undefined },\n /**\n * The words the status dot stands for, such as \"Online\". A screen reader reads them with the\n * avatar. Without it the dot is hidden from screen readers.\n */\n statusLabel: { type: 'string', default: undefined },\n /**\n * Custom badge content. Renders at the bottom-right corner.\n * Cannot be used together with `status`.\n */\n badge: { type: 'ReactNode', default: undefined },\n /**\n * Controls how the avatar image should be resized to fit its container.\n * Defaults to 'cover' which crops the image to fill the avatar.\n * Use 'contain' to show the full image without cropping.\n */\n fit: { type: 'enum', className: 'kui-r-fit', values: objectFitValues, default: 'cover', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n fallback: PropDef<React.ReactNode>;\n status: PropDef<(typeof accentColors)[number] | undefined>;\n statusLabel: PropDef<string | undefined>;\n badge: PropDef<React.ReactNode>;\n fit: PropDef<(typeof objectFitValues)[number]>;\n};\n\nexport { avatarPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import * as React from 'react';\n\n/**\n * This is a helper function that is used when a component supports `asChild`\n * using the `Slot` component but its implementation contains nested DOM elements.\n *\n * Using it ensures if a consumer uses the `asChild` prop, the elements are in\n * correct order in the DOM, adopting the intended consumer `children`.\n */\nexport function getSubtree(\n options: { asChild: boolean | undefined; children: React.ReactNode },\n content: React.ReactNode | ((children: React.ReactNode) => React.ReactNode)\n) {\n const { asChild, children } = options;\n if (!asChild) return typeof content === 'function' ? content(children) : content;\n\n const firstChild = React.Children.only(children) as React.ReactElement;\n return React.cloneElement(firstChild, {\n // @ts-expect-error\n children: typeof content === 'function' ? content(firstChild.props.children) : content,\n });\n}\n", "'use client';\n\nimport * as React from 'react';\n\nimport { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';\nimport type { ThemeSize } from '../helpers/theme-size.js';\n\n/**\n * The app-wide size index, provided by `Theme` beside `ThemeContext`.\n *\n * It is its own context, holding one string, so a component that only needs\n * the size does not re-render when the accent colour or appearance changes.\n */\nconst ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);\nThemeSizeContext.displayName = 'ThemeSizeContext';\n\ninterface SizePropDef {\n values: readonly string[];\n default?: string;\n}\n\n/**\n * The size a component on the 1-4 index takes: what the caller said, else the\n * nearest Theme's size, mapped into the component's range.\n */\nfunction useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {\n const themeSize = React.useContext(ThemeSizeContext);\n if (explicit !== undefined) return explicit;\n // The clamped value is one of `propDef.values`, which is what `V` ranges over.\n return clampSize(themeSize, propDef.values) as V;\n}\n\n/**\n * Fills `size` from the nearest Theme when the caller left it unset, so the\n * result can go straight into `extractProps`. An explicit size, responsive\n * object included, wins.\n *\n * Returns the same props object when there is nothing to fill: when a size is\n * set, or when the theme size resolves to the prop def's own default (the\n * common case, a Theme with no size), so `extractProps` applies it as before.\n */\nfunction useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {\n const themeSize = React.useContext(ThemeSizeContext);\n if (props.size !== undefined) return props;\n const size = clampSize(themeSize, propDef.values);\n if (size === propDef.default) return props;\n return { ...props, size };\n}\n\nexport { ThemeSizeContext, useThemeSize, useThemeSizeProps };\n", "/**\n * The pure half of the theme size: the type, the default and the clamp. Server-safe.\n *\n * The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there\n * is one `ThemeSizeContext` and importing `/helpers` from a server component does not call\n * `createContext`.\n */\n\ntype ThemeSize = '1' | '2' | '3' | '4';\n\n/** The rest of the 1-4 index when no Theme states a size. */\nconst THEME_SIZE_DEFAULT: ThemeSize = '2';\n\n/**\n * Maps the theme size onto a component's own range: the value itself when the\n * component has it, otherwise the nearest end of the range (`4` on a 1-3 scale\n * is `3`, on a 1-2 scale it is `2`).\n */\nfunction clampSize(size: ThemeSize, values: readonly string[]): string {\n if (values.includes(size)) return size;\n const n = Number(size);\n let nearest = values[0];\n let distance = Infinity;\n for (let i = 0; i < values.length; i++) {\n const d = Math.abs(Number(values[i]) - n);\n if (d < distance) {\n distance = d;\n nearest = values[i];\n }\n }\n return nearest;\n}\n\nexport { THEME_SIZE_DEFAULT, clampSize };\nexport type { ThemeSize };\n"],
5
+ "mappings": ";mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,IAAA,eAAAC,GAAAH,IAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBCF1C,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECPA,IAAMC,EAAe,CAAC,OAAQ,OAAQ,SAAU,QAAS,SAAU,QAAS,SAAU,SAAU,MAAO,OAAQ,UAAW,OAAQ,OAAQ,SAAU,SAAU,OAAQ,SAAU,OAAQ,OAAQ,OAAQ,OAAQ,QAAS,QAAS,OAAQ,OAAQ,KAAK,EA2BvP,IAAMC,EAAyB,CAC7B,MAAO,CACL,KAAM,OACN,OAAQC,EACR,QAAS,MACX,CACF,EClCA,IAAMC,GAAQ,CAAC,OAAQ,QAAS,SAAU,QAAS,MAAM,EAEnDC,EAAgB,CACpB,OAAQ,CACN,KAAM,OACN,OAAQD,GACR,QAAS,MACX,CACF,ECJA,IAAME,GAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,EACpDC,GAAW,CAAC,SAAU,QAAS,OAAQ,UAAW,SAAS,EAC3DC,GAAkB,CAAC,QAAS,UAAW,OAAQ,aAAc,MAAM,EAEnEC,EAAiB,CACrB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQJ,GAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQC,GAAU,QAAS,QAAS,EACvF,GAAGI,EACH,GAAGC,EACH,SAAU,CAAE,KAAM,YAAa,SAAU,EAAK,EAK9C,OAAQ,CAAE,KAAM,OAAQ,OAAQC,EAAc,QAAS,MAAU,EAK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B,EACL,oBAAmBQ,EACnB,cAAaC,EACb,gBAAemB,IAAc,OAC7B,qBAAoBC,IAAgB,OACpC,aAAW,EAAAG,SAAW,YAAa,iBAAkB1B,CAAS,EAC9D,MAAOC,EACP,QAASH,GAGR6B,EACC,CAAE,QAAA7B,EAAS,SAAAC,CAAS,EACpB,gCACE,gBAAC6B,EAAA,CAAY,GAAGP,GAAY,EAC3BG,EACH,CACF,CACF,CAEJ,CAAC,EACDhC,EAAO,YAAc,SAerB,IAAMoC,EAAmB,OAAK,CAAC,CAAE,SAAArB,EAAU,sBAAAC,EAAuB,GAAGa,CAAW,IAAwB,CAGtG,GAAM,CAACjB,EAAQyB,CAAS,EAAU,WAAkD,IAAOR,EAAW,IAAM,OAAS,OAAQ,EAEvHS,EAAkC,cACrCC,GAAuD,CACtDvB,IAAwBuB,CAAS,EACjCF,EAAUE,CAAS,CACrB,EACA,CAACvB,CAAqB,CACxB,EAEA,OACE,gCACGJ,IAAW,QAAUA,IAAW,UAAY,gBAAC,QAAK,UAAU,qBAAqB,EAAK,KAEtFA,IAAW,QACV,gBAAC,EAAAqB,OAAgB,SAAhB,CACC,aAAW,EAAAC,SAAW,qBAAsB,CAC1C,iBAAkB,OAAOnB,GAAa,UAAYA,EAAS,SAAW,EACtE,kBAAmB,OAAOA,GAAa,UAAYA,EAAS,SAAW,CACzE,CAAC,EAEA,GAAIc,EAAW,IAAM,CAAE,KAAM,MAAO,aAAcA,EAAW,GAAI,EAAI,CAAE,cAAe,EAAK,GAE3Fd,CACH,EACE,KAEJ,gBAAC,EAAAkB,OAAgB,MAAhB,CAAsB,UAAU,kBAAmB,GAAGJ,EAAY,sBAAuBS,EAA2B,CACvH,CAEJ,CAAC,EAEDF,EAAW,YAAc",
6
6
  "names": ["avatar_exports", "__export", "Avatar", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "accentColors", "grayAccentColorPropDef", "accentColors", "radii", "radiusPropDef", "sizes", "variants", "objectFitValues", "avatarPropDefs", "asChildPropDef", "grayAccentColorPropDef", "radiusPropDef", "accentColors", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "i", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "React", "getSubtree", "options", "content", "asChild", "children", "firstChild", "React", "clampSize", "size", "values", "nearest", "distance", "i", "d", "ThemeSizeContext", "useThemeSizeProps", "props", "propDef", "themeSize", "ThemeSizeContext", "size", "clampSize", "Avatar", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "avatarPropDefs", "asChild", "children", "className", "style", "color", "radius", "status", "statusLabel", "badge", "fallback", "onLoadingStatusChange", "src", "alt", "srcSet", "sizes", "crossOrigin", "referrerPolicy", "loading", "decoding", "onLoad", "onError", "rootProps", "extractProps", "imageProps", "isDisabled", "hasIndicator", "indicator", "AvatarPrimitive", "classNames", "getSubtree", "AvatarImpl", "setStatus", "handleLoadingStatusChange", "newStatus"]
7
7
  }
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";var Mt=Object.create;var te=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var _t=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Oe=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gt(t))!Ht.call(e,r)&&r!==o&&te(e,r,{get:()=>t[r],enumerable:!(s=Wt(t,r))||s.enumerable});return e};var d=(e,t,o)=>(o=e!=null?Mt(At(e)):{},Oe(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e)),$t=e=>Oe(te({},"__esModule",{value:!0}),e);var Go={};_t(Go,{Button:()=>St});module.exports=$t(Go);var Q=d(require("react")),Nt=d(require("classnames"));var u=d(require("react")),st=d(require("classnames")),it=require("radix-ui"),pe=require("radix-ui/internal");var j={asChild:{type:"boolean"}};var oe=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Me=["auto","gray","mauve","slate","sage","olive","sand"],We={color:{type:"enum",values:oe,default:void 0}},Ge={color:{type:"enum",values:oe,default:""}};var me=["none","small","medium","large","full"],Ae={radius:{type:"enum",values:me,default:void 0}};var Kt=["1","2","3","4"],qt=["raised","solid","soft","surface","outline","ghost"],fe={...j,size:{type:"enum",className:"kui-r-size",values:Kt,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:qt,default:"solid"},...Ge,...Ae,loading:{type:"boolean",className:"kui-loading",default:!1},fullWidth:{type:"boolean",className:"kui-full-width",default:!1}};var se=d(require("react")),et=d(require("classnames"));var Ke=d(require("classnames"));var Ut=[],Zt=new Set;function Yt(e){let t=Object.assign({},...e),o=[],s=[],r=new Set;for(let n in t){let i=t[n],p=i.values??Ut,l={key:n,type:i.type,default:i.default,hasDefault:i.default!==void 0,responsive:"responsive"in i,className:i.className,customProperties:i.customProperties,parseValue:i.parseValue,values:p,valueSet:p.length>0?new Set(p):Zt,enumValueSet:i.type==="enum"?new Set([i.default,...p]):void 0};i.className?(o.push(l),r.add(n)):(l.hasDefault||i.type==="enum")&&s.push(l)}return{styling:o,passthrough:s,stylingKeys:r}}var Xt={children:new WeakMap};function He(e){let t=Xt;for(let o=0;o<e.length;o++){let s=e[o],r=t.children.get(s);r===void 0&&(r={children:new WeakMap},t.children.set(s,r)),t=r}return t.compiled??(t.compiled=Yt(e))}var Jt=["initial","xs","sm","md","lg","xl"],de=new Set(Jt);function ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Qt=new Set(["initial","xs","sm","md","lg","xl"]);function W(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(Qt.has(t))return!0;return!1}function re(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function $e({className:e,customProperties:t,...o}){let s=Pe({allowArbitraryValues:!0,className:e,...o}),r=eo({customProperties:t,...o});return[s,r]}function Pe({allowArbitraryValues:e,value:t,className:o,propValues:s,propValueSet:r,parseValue:n=i=>i}){if(t){if(typeof t=="string")return re(s,r,t)?_e(o,t,n):e?o:void 0;if(W(t)){let i=t,p=[];for(let l in i){if(!ye(i,l)||!de.has(l))continue;let a=i[l];if(a!==void 0){if(re(s,r,a)){let c=_e(o,a,n),f=l==="initial"?c:`${l}:${c}`;p.push(f)}else if(e){let c=l==="initial"?o:`${l}:${o}`;p.push(c)}}}return p.length>0?p.join(" "):""}if(e)return o}}function _e(e,t,o){let s=e?"-":"",r=o(t),n=r?.startsWith("-"),i=n?"-":"",p=n?r?.substring(1):r;return`${i}${e}${s}${p}`}function eo({customProperties:e,value:t,propValues:o,propValueSet:s,parseValue:r=n=>n}){if(!t||typeof t=="string"&&re(o,s,t))return;let n;if(typeof t=="string"){let i=r(t);n={};for(let p of e)n[p]=i;return n}if(W(t)){let i=t;for(let p in i){if(!ye(i,p)||!de.has(p))continue;let l=i[p];if(l===void 0||re(o,s,l))continue;let a=r(l);n??(n={});for(let c of e){let f=p==="initial"?c:`${c}-${p}`;n[f]=a}}}return n??{}}function ge(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function to(e,t){let o=e.initial,s=!1;return t.hasDefault&&o===void 0&&(o=t.default,s=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,s=!0),s?{...e,initial:o}:e}function S(e,...t){let{styling:o,passthrough:s,stylingKeys:r}=He(t),n={};for(let l in e)r.has(l)||(n[l]=e[l]);for(let l=0;l<s.length;l++){let a=s[l],c=n[a.key];if(c===void 0){a.hasDefault&&(n[a.key]=a.default);continue}a.enumValueSet!==void 0&&!a.enumValueSet.has(c)&&!W(c)&&(n[a.key]=a.default)}let i,p=[];for(let l=0;l<o.length;l++){let a=o[l],c=e[a.key];if(c===void 0&&a.hasDefault&&(c=a.default),a.enumValueSet!==void 0&&!a.enumValueSet.has(c)&&!W(c)&&(c=a.default),!!c){if(W(c)){if(!a.responsive)continue;c=to(c,a)}if(a.type==="enum"){let f=Pe({allowArbitraryValues:!1,value:c,className:a.className,propValues:a.values,propValueSet:a.valueSet,parseValue:a.parseValue});f&&p.push(f);continue}if(a.type==="string"||a.type==="enum | string"){let[f,P]=$e({className:a.className,customProperties:a.customProperties,propValues:a.type==="string"?[]:a.values,propValueSet:a.type==="string"?void 0:a.valueSet,parseValue:a.parseValue,value:c});P&&(i=ge(i,P)),f&&p.push(f);continue}if(a.type==="boolean"){p.push(a.className);continue}}}return n.className=(0,Ke.default)(p.length>0?p.join(" "):void 0,e.className),n.style=ge(i,e.style),n}var G=["0","1","2","3","4","5","6","7","8","9","10","11","12"],qe={p:{type:"enum | string",className:"kui-r-p",customProperties:["--p"],values:G,responsive:!0},px:{type:"enum | string",className:"kui-r-px",customProperties:["--pl","--pr"],values:G,responsive:!0},py:{type:"enum | string",className:"kui-r-py",customProperties:["--pt","--pb"],values:G,responsive:!0},pt:{type:"enum | string",className:"kui-r-pt",customProperties:["--pt"],values:G,responsive:!0},pr:{type:"enum | string",className:"kui-r-pr",customProperties:["--pr"],values:G,responsive:!0},pb:{type:"enum | string",className:"kui-r-pb",customProperties:["--pb"],values:G,responsive:!0},pl:{type:"enum | string",className:"kui-r-pl",customProperties:["--pl"],values:G,responsive:!0}};var Ue={height:{type:"string",className:"kui-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"kui-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"kui-r-max-h",customProperties:["--max-height"],responsive:!0}};var K={width:{type:"string",className:"kui-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"kui-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"kui-r-max-w",customProperties:["--max-width"],responsive:!0}};var he=["visible","hidden","clip","scroll","auto"],oo=["static","relative","absolute","fixed","sticky"],Y=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9"],ro=["0","1"],no=["0","1"],so=["start","center","end","baseline","stretch"],io=["start","center","end","baseline","stretch"],Ze={...qe,...K,...Ue,position:{type:"enum",className:"kui-r-position",values:oo,responsive:!0},inset:{type:"enum | string",className:"kui-r-inset",customProperties:["--inset"],values:Y,responsive:!0},top:{type:"enum | string",className:"kui-r-top",customProperties:["--top"],values:Y,responsive:!0},right:{type:"enum | string",className:"kui-r-right",customProperties:["--right"],values:Y,responsive:!0},bottom:{type:"enum | string",className:"kui-r-bottom",customProperties:["--bottom"],values:Y,responsive:!0},left:{type:"enum | string",className:"kui-r-left",customProperties:["--left"],values:Y,responsive:!0},overflow:{type:"enum",className:"kui-r-overflow",values:he,responsive:!0},overflowX:{type:"enum",className:"kui-r-ox",values:he,responsive:!0},overflowY:{type:"enum",className:"kui-r-oy",values:he,responsive:!0},flexBasis:{type:"string",className:"kui-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"kui-r-fs",customProperties:["--flex-shrink"],values:ro,responsive:!0},flexGrow:{type:"enum | string",className:"kui-r-fg",customProperties:["--flex-grow"],values:no,responsive:!0},gridArea:{type:"string",className:"kui-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"kui-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"kui-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"kui-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"kui-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"kui-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"kui-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"kui-r-as",values:so,responsive:!0},justifySelf:{type:"enum",className:"kui-r-js",values:io,responsive:!0}};var A=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12","bleed"],Ye={m:{type:"enum | string",values:A,responsive:!0,className:"kui-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:A,responsive:!0,className:"kui-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:A,responsive:!0,className:"kui-r-ml",customProperties:["--ml"]}};var ne=require("radix-ui"),vr=ne.Slot.Root,Xe=ne.Slot.Root,Cr=ne.Slot.Slottable;var ve=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Je={gap:{type:"enum | string",className:"kui-r-gap",customProperties:["--gap"],values:ve,responsive:!0},gapX:{type:"enum | string",className:"kui-r-cg",customProperties:["--column-gap"],values:ve,responsive:!0},gapY:{type:"enum | string",className:"kui-r-rg",customProperties:["--row-gap"],values:ve,responsive:!0}};var ao=["div","span"],po=["none","inline-flex","flex"],lo=["row","column","row-reverse","column-reverse"],uo=["start","center","end","baseline","stretch"],co=["start","center","end","between"],mo=["nowrap","wrap","wrap-reverse"],Qe={as:{type:"enum",values:ao,default:"div"},...j,display:{type:"enum",className:"kui-r-display",values:po,responsive:!0},direction:{type:"enum",className:"kui-r-fd",values:lo,responsive:!0},align:{type:"enum",className:"kui-r-ai",values:uo,responsive:!0},justify:{type:"enum",className:"kui-r-jc",values:co,parseValue:fo,responsive:!0},wrap:{type:"enum",className:"kui-r-fw",values:mo,responsive:!0},...Je};function fo(e){return e==="between"?"space-between":e}var X=se.forwardRef((e,t)=>{let{className:o,asChild:s,as:r="div",...n}=S(e,Qe,Ze,Ye);return se.createElement(s?Xe:r,{...n,ref:t,className:(0,et.default)("kui-Flex",o)})});X.displayName="Flex";var v=d(require("react")),Ce=d(require("classnames"));var tt={loading:{type:"boolean",default:!0}};var De=v.forwardRef((e,t)=>{let{className:o,children:s,loading:r,...n}=S(e,tt);if(s===void 0&&!r)return null;let i=n["aria-label"]!==void 0||n["aria-labelledby"]!==void 0,p=v.createElement("span",{role:i?"status":void 0,"aria-hidden":i?void 0:!0,...n,ref:t,className:(0,Ce.default)("kui-Spinner",o)},v.createElement("span",{className:"kui-SpinnerWheel"},v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"})),typeof n["aria-label"]=="string"?v.createElement("span",{className:"kui-sr-only"},n["aria-label"]):null);return s===void 0?p:v.createElement("span",{className:"kui-SpinnerHost","data-loading":r||void 0,"aria-busy":r||void 0},v.createElement("span",{"aria-hidden":r||void 0,className:(0,Ce.default)("kui-SpinnerChildren",r&&"kui-SpinnerHiddenChildren")},s),r?v.createElement(X,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},v.createElement("span",null,p)):null)});De.displayName="Spinner";var m=d(require("react")),yo=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));yo.displayName="ThickDividerHorizontalIcon";var Po=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Po.displayName="ThickCheckIcon";var go=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));go.displayName="ChevronDownIcon";var ho=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));ho.displayName="ThickChevronRightIcon";var vo=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));vo.displayName="ThickChevronLeftIcon";var Co=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Co.displayName="ThickDotIcon";var Do=m.default.forwardRef((e,t)=>m.default.createElement("svg",{...e,ref:t,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"},m.default.createElement("path",{d:"M18 6 6 18"}),m.default.createElement("path",{d:"m6 6 12 12"})));Do.displayName="CloseIcon";var Ro=m.default.forwardRef((e,t)=>m.default.createElement("svg",{...e,ref:t,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"},m.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));Ro.displayName="PaperclipIcon";var bo=m.default.forwardRef((e,t)=>m.default.createElement("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"},m.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),m.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));bo.displayName="FileIcon";var To=m.default.forwardRef((e,t)=>m.default.createElement("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"},m.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),m.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),m.default.createElement("path",{d:"M10 9H8"}),m.default.createElement("path",{d:"M16 13H8"}),m.default.createElement("path",{d:"M16 17H8"})));To.displayName="FileTextIcon";var Re=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{d:"M5 12.75L9.5 17.25L19 7.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})));Re.displayName="TickIcon";var ie=d(require("react"));function ot(e,t){if(t.includes(e))return e;let o=Number(e),s=t[0],r=1/0;for(let n=0;n<t.length;n++){let i=Math.abs(Number(t[n])-o);i<r&&(r=i,s=t[n])}return s}var ae=ie.createContext("2");ae.displayName="ThemeSizeContext";function rt(e,t){let o=ie.useContext(ae);if(e.size!==void 0)return e;let s=ot(o,t.values);return s===t.default?e:{...e,size:s}}var xe=u.forwardRef((e,t)=>{let o=rt(e,fe.size),{className:s,children:r,asChild:n,as:i,color:p,radius:l,disabled:a,done:c=!1,...f}=S(o,fe),P=!!o.loading,x=o.loading!==void 0,D=!!a||P,{onClick:T,"aria-describedby":B}=f,F=u.useCallback(g=>{if(D){g.preventDefault();return}T?.(g)},[D,T]),V=u.useMemo(()=>{let g=n&&u.isValidElement(r)?r.props.children:r,k=Te(g),N=b=>u.isValidElement(b)&&(b.type==="svg"||typeof b.type!="string"&&b.type!==u.Fragment&&!wo.has(be(b.type)));return{iconStart:N(k[0]),iconEnd:N(k[k.length-1])}},[n,r]),[w,_]=u.useState(null),$=u.useRef(null),O=(0,pe.useComposedRefs)(t,$);(0,pe.useLayoutEffect)(()=>{let g=$.current;if(!g||P||c)return;let k=g.querySelector(":scope > .kui-BaseButtonContent")??g,N=nt(k,"start"),b=nt(k,"end");_(I=>I&&I.iconStart===N&&I.iconEnd===b?I:{iconStart:N,iconEnd:b})});let{iconStart:M,iconEnd:U}=w??V,Ve=!!f["data-icon-only"],Z=u.useMemo(()=>{if(!c)return r;let g=u.createElement(Re,{key:"kui-done-tick",className:"kui-BaseButtonTick","aria-hidden":!0}),k=N=>{if(Ve)return g;let b=Te(N),I=b.findIndex(ee=>!(typeof ee=="string"&&!ee.trim())),Le=b[I];return I!==-1&&M&&(w!==null||u.isValidElement(Le)&&Le.type==="svg")?b.map((ee,Ot)=>Ot===I?g:ee):[g,...b]};if(n&&u.isValidElement(r)){let N=r;return u.cloneElement(N,void 0,k(N.props.children))}return k(r)},[c,r,Ve,M,w,n]),Et=n?it.Slot.Root:i||"button",Bt=["button","input","textarea","select"],Ie=n?u.isValidElement(r)?r.type:void 0:i||"button",ue=typeof Ie=="string"&&Bt.includes(Ie),{onClickCapture:je}=f,Ft=u.useCallback(g=>{if(n&&D){g.preventDefault(),g.stopPropagation();return}je?.(g)},[n,D,je]),Vt=!n&&(!i||i==="button"),It="type"in f,jt=u.useId(),ce=P?`${jt}-loading`:void 0,zt=u.useMemo(()=>P?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":[B,ce].filter(Boolean).join(" ")}:a&&(!ue||n)?{"aria-disabled":!0}:{},[P,ce,B,a,ue,n]),ze=(g,k)=>x?u.createElement(u.Fragment,null,u.createElement("span",{className:"kui-BaseButtonContent","aria-hidden":P||void 0},g),P?u.createElement(u.Fragment,null,u.createElement("span",{className:"kui-sr-only"},u.createElement("span",{id:ce,"aria-hidden":!0},"Loading"),k),u.createElement(X,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},u.createElement("span",null,u.createElement(De,{"aria-hidden":"true"})))):null):g,Lt=n&&x&&u.isValidElement(Z)?u.cloneElement(Z,void 0,ze(Z.props.children,u.isValidElement(r)?r.props.children:null)):Z;return u.createElement(Et,{"data-accent-color":p,"data-radius":l,"data-icon-start":M||void 0,"data-icon-end":U||void 0,"data-done":c||void 0,...f,...zt,"data-disabled":D||void 0,onClick:F,onClickCapture:Ft,ref:O,className:(0,st.default)("kui-reset","kui-BaseButton",s),...ue&&{disabled:a},...Vt&&!It?{type:"button"}:{}},n?Lt:ze(Z,r))});xe.displayName="BaseButton";var wo=new Set(["Text","Kbd","Code","Link","Em","Strong","Quote","Badge","Trans"]);function be(e){if(!e||typeof e!="function"&&typeof e!="object")return"";let t=e;return t.displayName||t.name||be(t.render)||be(t.type)}function Te(e){return u.Children.toArray(e).flatMap(t=>u.isValidElement(t)&&t.type===u.Fragment?Te(t.props.children):[t])}function nt(e,t){let o=t==="start"?e.firstChild:e.lastChild;for(;o&&(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.TEXT_NODE&&!o.textContent?.trim());)o=t==="start"?o.nextSibling:o.previousSibling;return o?.nodeType===Node.ELEMENT_NODE&&o.localName==="svg"}var C=d(require("react")),Tt=d(require("classnames")),L=require("radix-ui");var H=d(require("react")),yt=require("radix-ui");var ko=["loud","medium","quiet"],at={emphasis:{type:"enum",className:"kui-emphasis",values:ko,default:void 0}};var No=["normal","start","end","both"],pt={trim:{type:"enum",className:"kui-r-lt",values:No,responsive:!0}};var So=["left","center","right"],lt={align:{type:"enum",className:"kui-r-ta",values:So,responsive:!0}};var Eo=["wrap","nowrap","pretty","balance"],ut={wrap:{type:"enum",className:"kui-r-tw",values:Eo,responsive:!0}};var ct={truncate:{type:"boolean",className:"kui-truncate"}};var Bo=["sans","mono","serif"],mt={font:{type:"enum",className:"kui-r-ff",values:Bo}};var Fo=["regular","medium","semibold"],ft={weight:{type:"enum",className:"kui-r-weight",values:Fo,responsive:!0}};var Vo=["span","div","label","p"],Io=["1","2","3","4","5","6","7","8","9"],dt={as:{type:"enum",values:Vo,default:"span"},...j,size:{type:"enum",className:"kui-r-size",values:Io,responsive:!0},...mt,...ft,...lt,...pt,...ct,...ut,...We,...at};var we=H.memo(H.forwardRef((e,t)=>{let{children:o,className:s,asChild:r,as:n="span",color:i,...p}=S(e,dt),l=s?`kui-Text ${s}`:"kui-Text";return r?H.createElement(yt.Slot.Root,{"data-accent-color":i,...p,ref:t,className:l},o):H.createElement(n,{"data-accent-color":i,...p,ref:t,className:l},o)}));we.displayName="Text";var q=d(require("react"));var h=d(require("react")),ht=d(require("classnames")),J=require("radix-ui");function Pt(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var ke=d(require("react"));function z(e){let[t,o]=ke.useState(e),[s,r]=ke.useState(e);return Object.is(e,s)||(r(e),o(e)),[t,o]}var jo=["inherit","light","dark"],gt=["sans","mono","serif"],zo=["1","2","3","4"],y={...j,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:jo,default:"inherit"},accentColor:{type:"enum",values:oe,default:"gray"},grayColor:{type:"enum",values:Me,default:"gray"},radius:{type:"enum",values:me,default:"full"},fontFamily:{type:"enum",values:gt,default:"sans"},headingFontFamily:{type:"enum",values:gt},size:{type:"enum",values:zo,default:"2"}};var R=()=>{},xn={appearance:y.appearance.default,accentColor:y.accentColor.default,grayColor:y.grayColor.default,resolvedGrayColor:y.grayColor.default,radius:y.radius.default,fontFamily:y.fontFamily.default,headingFontFamily:void 0,size:y.size.default,onAppearanceChange:R,onAccentColorChange:R,onGrayColorChange:R,onRadiusChange:R,onFontFamilyChange:R,onHeadingFontFamilyChange:R,onSizeChange:R},Ne=h.createContext(void 0);var Se=h.forwardRef((e,t)=>{let o=h.useContext(Ne),s=J.Direction.useDirection();return o===void 0?h.createElement(J.Direction.Provider,{dir:s},h.createElement(vt,{...e,ref:t})):h.createElement(Ee,{...e,ref:t})});Se.displayName="Theme";var vt=h.forwardRef((e,t)=>{let{appearance:o=y.appearance.default,accentColor:s=y.accentColor.default,grayColor:r=y.grayColor.default,radius:n=y.radius.default,fontFamily:i=y.fontFamily.default,headingFontFamily:p,size:l=y.size.default,hasBackground:a=y.hasBackground.default,...c}=e,[f,P]=z(o),[x,D]=z(s),[T,B]=z(r),[F,V]=z(n),[w,_]=z(i),[$,O]=z(p),[M,U]=z(l);return h.createElement(Ee,{...c,ref:t,isRoot:!0,hasBackground:a,appearance:f,accentColor:x,grayColor:T,radius:F,fontFamily:w,headingFontFamily:$,size:M,onAppearanceChange:P,onAccentColorChange:D,onGrayColorChange:B,onRadiusChange:V,onFontFamilyChange:_,onHeadingFontFamilyChange:O,onSizeChange:U})});vt.displayName="ThemeRoot";var Ee=h.forwardRef((e,t)=>{let o=h.useContext(Ne),{asChild:s,isRoot:r,hasBackground:n,appearance:i=e.appearance??o?.appearance??y.appearance.default,accentColor:p=e.accentColor??o?.accentColor??y.accentColor.default,grayColor:l=e.grayColor??o?.resolvedGrayColor??y.grayColor.default,radius:a=e.radius??o?.radius??y.radius.default,fontFamily:c=e.fontFamily??o?.fontFamily??y.fontFamily.default,headingFontFamily:f=e.headingFontFamily??o?.headingFontFamily,size:P=e.size??o?.size??y.size.default,onAppearanceChange:x=o?.onAppearanceChange??R,onAccentColorChange:D=o?.onAccentColorChange??R,onGrayColorChange:T=o?.onGrayColorChange??R,onRadiusChange:B=o?.onRadiusChange??R,onFontFamilyChange:F=o?.onFontFamilyChange??R,onHeadingFontFamilyChange:V=o?.onHeadingFontFamilyChange??R,onSizeChange:w=o?.onSizeChange??R,..._}=e,$=s?J.Slot.Root:"div",O=l==="auto"?Pt(p):l,M=e.appearance==="light"||e.appearance==="dark",U=n===void 0?r||M:n;return h.createElement(Ne.Provider,{value:h.useMemo(()=>({appearance:i,accentColor:p,grayColor:l,resolvedGrayColor:O,radius:a,fontFamily:c,headingFontFamily:f,size:P,onAppearanceChange:x,onAccentColorChange:D,onGrayColorChange:T,onRadiusChange:B,onFontFamilyChange:F,onHeadingFontFamilyChange:V,onSizeChange:w}),[i,p,l,O,a,c,f,P,x,D,T,B,F,V,w])},h.createElement(ae.Provider,{value:P},h.createElement($,{"data-is-root-theme":r?"true":"false","data-accent-color":p,"data-gray-color":O,"data-has-background":U?"true":"false","data-radius":a,"data-font-family":c,"data-heading-font-family":f,ref:t,..._,className:(0,ht.default)("kui-theme",{light:i==="light",dark:i==="dark"},_.className)})))});Ee.displayName="ThemeImpl";var Ct=d(require("react")),Dt=Ct.createContext(void 0);var E=d(require("react")),Lo=E.createContext(null);function Rt({children:e}){return E.createElement(Lo.Provider,{value:null},e)}var Be=q.forwardRef((e,t)=>q.createElement(Dt.Provider,{value:null},q.createElement(Rt,null,q.createElement(Se,{...e,ref:t}))));Be.displayName="PortalTheme";var bt={content:{type:"ReactNode",required:!0},width:K.width,minWidth:K.minWidth,maxWidth:{...K.maxWidth,default:"360px"}};var xt=200,wt=C.createContext(!1);function Oo({delayDuration:e=xt,children:t,...o}){return C.createElement(wt.Provider,{value:!0},C.createElement(L.Tooltip.Provider,{delayDuration:e,...o},t))}Oo.displayName="TooltipProvider";var Fe=C.forwardRef((e,t)=>{let{children:o,className:s,open:r,defaultOpen:n,onOpenChange:i,delayDuration:p,disableHoverableContent:l,content:a,container:c,forceMount:f,...P}=S(e,bt),x={open:r,defaultOpen:n,onOpenChange:i,delayDuration:p,disableHoverableContent:l},D=C.useContext(wt),T=C.createElement(L.Tooltip.Root,{...x},C.createElement(L.Tooltip.Trigger,{asChild:!0},o),C.createElement(L.Tooltip.Portal,{container:c,forceMount:f},C.createElement(Be,{asChild:!0},C.createElement(L.Tooltip.Content,{sideOffset:4,collisionPadding:10,...P,asChild:!1,ref:t,className:(0,Tt.default)("kui-TooltipContent",s)},C.createElement(we,{as:"p",className:"kui-TooltipText",size:"1"},a),C.createElement(L.Tooltip.Arrow,{className:"kui-TooltipArrow"})))));return D?T:C.createElement(L.Tooltip.Provider,{delayDuration:xt},T)});Fe.displayName="Tooltip";var le=d(require("react"));function kt(e){let t=le.useId(),o=!!e,s=le.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:s}}var Mo={loud:"solid",medium:"raised",quiet:"ghost"};function Wo(e){if(e["aria-label"]||e["aria-labelledby"])return;console.error("Button: an `iconOnly` button must have an accessible name. Pass `aria-label`, or `aria-labelledby` referencing a label element.")}var St=Q.forwardRef(({className:e,style:t,tooltip:o,tooltipSide:s="top",tooltipAlign:r="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:i,iconOnly:p=!1,emphasis:l,variant:a,...c},f)=>{let{tooltipId:P,hasTooltip:x,accessibilityProps:D}=kt(o);p&&(Wo(c),c.fullWidth=!1);let T=l!==void 0?Mo[l]:a,B=c["aria-describedby"],F=D["aria-describedby"],V=[B,F].filter(Boolean).join(" ")||void 0,w=Q.createElement(xe,{...c,variant:T,"aria-describedby":V,ref:f,"data-icon-only":p||void 0,className:(0,Nt.default)("kui-Button",e),style:t});return x?Q.createElement(Fe,{content:o,side:s,align:r,delayDuration:n,disableHoverableContent:i,id:P},w):w});St.displayName="Button";
2
+ "use strict";var Mt=Object.create;var te=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var _t=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Le=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gt(t))!Ht.call(e,r)&&r!==o&&te(e,r,{get:()=>t[r],enumerable:!(s=Wt(t,r))||s.enumerable});return e};var d=(e,t,o)=>(o=e!=null?Mt(At(e)):{},Le(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e)),$t=e=>Le(te({},"__esModule",{value:!0}),e);var Wo={};_t(Wo,{Button:()=>St});module.exports=$t(Wo);var Q=d(require("react")),kt=d(require("classnames"));var u=d(require("react")),st=d(require("classnames")),it=require("radix-ui"),pe=require("radix-ui/internal");var j={asChild:{type:"boolean"}};var oe=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Me=["auto","gray","mauve","slate","sage","olive","sand"],We={color:{type:"enum",values:oe,default:void 0}},Ge={color:{type:"enum",values:oe,default:""}};var me=["none","small","medium","large","full"],Ae={radius:{type:"enum",values:me,default:void 0}};var Kt=["1","2","3","4"],qt=["raised","solid","soft","surface","outline","ghost"],fe={...j,size:{type:"enum",className:"kui-r-size",values:Kt,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:qt,default:"solid"},...Ge,...Ae,loading:{type:"boolean",className:"kui-loading",default:!1},fullWidth:{type:"boolean",className:"kui-full-width",default:!1}};var se=d(require("react")),et=d(require("classnames"));var Ke=d(require("classnames"));var Ut=[],Zt=new Set;function Yt(e){let t=Object.assign({},...e),o=[],s=[],r=new Set;for(let n in t){let i=t[n],p=i.values??Ut,l={key:n,type:i.type,default:i.default,hasDefault:i.default!==void 0,responsive:"responsive"in i,className:i.className,customProperties:i.customProperties,parseValue:i.parseValue,values:p,valueSet:p.length>0?new Set(p):Zt,enumValueSet:i.type==="enum"?new Set([i.default,...p]):void 0};i.className?(o.push(l),r.add(n)):(l.hasDefault||i.type==="enum")&&s.push(l)}return{styling:o,passthrough:s,stylingKeys:r}}var Xt={children:new WeakMap};function He(e){let t=Xt;for(let o=0;o<e.length;o++){let s=e[o],r=t.children.get(s);r===void 0&&(r={children:new WeakMap},t.children.set(s,r)),t=r}return t.compiled??(t.compiled=Yt(e))}var Jt=["initial","xs","sm","md","lg","xl"],de=new Set(Jt);function ye(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Qt=new Set(["initial","xs","sm","md","lg","xl"]);function W(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(Qt.has(t))return!0;return!1}function re(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function $e({className:e,customProperties:t,...o}){let s=Pe({allowArbitraryValues:!0,className:e,...o}),r=eo({customProperties:t,...o});return[s,r]}function Pe({allowArbitraryValues:e,value:t,className:o,propValues:s,propValueSet:r,parseValue:n=i=>i}){if(t){if(typeof t=="string")return re(s,r,t)?_e(o,t,n):e?o:void 0;if(W(t)){let i=t,p=[];for(let l in i){if(!ye(i,l)||!de.has(l))continue;let a=i[l];if(a!==void 0){if(re(s,r,a)){let c=_e(o,a,n),f=l==="initial"?c:`${l}:${c}`;p.push(f)}else if(e){let c=l==="initial"?o:`${l}:${o}`;p.push(c)}}}return p.length>0?p.join(" "):""}if(e)return o}}function _e(e,t,o){let s=e?"-":"",r=o(t),n=r?.startsWith("-"),i=n?"-":"",p=n?r?.substring(1):r;return`${i}${e}${s}${p}`}function eo({customProperties:e,value:t,propValues:o,propValueSet:s,parseValue:r=n=>n}){if(!t||typeof t=="string"&&re(o,s,t))return;let n;if(typeof t=="string"){let i=r(t);n={};for(let p of e)n[p]=i;return n}if(W(t)){let i=t;for(let p in i){if(!ye(i,p)||!de.has(p))continue;let l=i[p];if(l===void 0||re(o,s,l))continue;let a=r(l);n??(n={});for(let c of e){let f=p==="initial"?c:`${c}-${p}`;n[f]=a}}}return n??{}}function ge(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function to(e,t){let o=e.initial,s=!1;return t.hasDefault&&o===void 0&&(o=t.default,s=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,s=!0),s?{...e,initial:o}:e}function S(e,...t){let{styling:o,passthrough:s,stylingKeys:r}=He(t),n={};for(let l in e)r.has(l)||(n[l]=e[l]);for(let l=0;l<s.length;l++){let a=s[l],c=n[a.key];if(c===void 0){a.hasDefault&&(n[a.key]=a.default);continue}a.enumValueSet!==void 0&&!a.enumValueSet.has(c)&&!W(c)&&(n[a.key]=a.default)}let i,p=[];for(let l=0;l<o.length;l++){let a=o[l],c=e[a.key];if(c===void 0&&a.hasDefault&&(c=a.default),a.enumValueSet!==void 0&&!a.enumValueSet.has(c)&&!W(c)&&(c=a.default),!!c){if(W(c)){if(!a.responsive)continue;c=to(c,a)}if(a.type==="enum"){let f=Pe({allowArbitraryValues:!1,value:c,className:a.className,propValues:a.values,propValueSet:a.valueSet,parseValue:a.parseValue});f&&p.push(f);continue}if(a.type==="string"||a.type==="enum | string"){let[f,P]=$e({className:a.className,customProperties:a.customProperties,propValues:a.type==="string"?[]:a.values,propValueSet:a.type==="string"?void 0:a.valueSet,parseValue:a.parseValue,value:c});P&&(i=ge(i,P)),f&&p.push(f);continue}if(a.type==="boolean"){p.push(a.className);continue}}}return n.className=(0,Ke.default)(p.length>0?p.join(" "):void 0,e.className),n.style=ge(i,e.style),n}var G=["0","1","2","3","4","5","6","7","8","9","10","11","12"],qe={p:{type:"enum | string",className:"kui-r-p",customProperties:["--p"],values:G,responsive:!0},px:{type:"enum | string",className:"kui-r-px",customProperties:["--pl","--pr"],values:G,responsive:!0},py:{type:"enum | string",className:"kui-r-py",customProperties:["--pt","--pb"],values:G,responsive:!0},pt:{type:"enum | string",className:"kui-r-pt",customProperties:["--pt"],values:G,responsive:!0},pr:{type:"enum | string",className:"kui-r-pr",customProperties:["--pr"],values:G,responsive:!0},pb:{type:"enum | string",className:"kui-r-pb",customProperties:["--pb"],values:G,responsive:!0},pl:{type:"enum | string",className:"kui-r-pl",customProperties:["--pl"],values:G,responsive:!0}};var Ue={height:{type:"string",className:"kui-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"kui-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"kui-r-max-h",customProperties:["--max-height"],responsive:!0}};var K={width:{type:"string",className:"kui-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"kui-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"kui-r-max-w",customProperties:["--max-width"],responsive:!0}};var he=["visible","hidden","clip","scroll","auto"],oo=["static","relative","absolute","fixed","sticky"],Y=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9"],ro=["0","1"],no=["0","1"],so=["start","center","end","baseline","stretch"],io=["start","center","end","baseline","stretch"],Ze={...qe,...K,...Ue,position:{type:"enum",className:"kui-r-position",values:oo,responsive:!0},inset:{type:"enum | string",className:"kui-r-inset",customProperties:["--inset"],values:Y,responsive:!0},top:{type:"enum | string",className:"kui-r-top",customProperties:["--top"],values:Y,responsive:!0},right:{type:"enum | string",className:"kui-r-right",customProperties:["--right"],values:Y,responsive:!0},bottom:{type:"enum | string",className:"kui-r-bottom",customProperties:["--bottom"],values:Y,responsive:!0},left:{type:"enum | string",className:"kui-r-left",customProperties:["--left"],values:Y,responsive:!0},overflow:{type:"enum",className:"kui-r-overflow",values:he,responsive:!0},overflowX:{type:"enum",className:"kui-r-ox",values:he,responsive:!0},overflowY:{type:"enum",className:"kui-r-oy",values:he,responsive:!0},flexBasis:{type:"string",className:"kui-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"kui-r-fs",customProperties:["--flex-shrink"],values:ro,responsive:!0},flexGrow:{type:"enum | string",className:"kui-r-fg",customProperties:["--flex-grow"],values:no,responsive:!0},gridArea:{type:"string",className:"kui-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"kui-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"kui-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"kui-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"kui-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"kui-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"kui-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"kui-r-as",values:so,responsive:!0},justifySelf:{type:"enum",className:"kui-r-js",values:io,responsive:!0}};var A=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12","bleed"],Ye={m:{type:"enum | string",values:A,responsive:!0,className:"kui-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:A,responsive:!0,className:"kui-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:A,responsive:!0,className:"kui-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:A,responsive:!0,className:"kui-r-ml",customProperties:["--ml"]}};var ne=require("radix-ui"),hr=ne.Slot.Root,Xe=ne.Slot.Root,vr=ne.Slot.Slottable;var ve=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Je={gap:{type:"enum | string",className:"kui-r-gap",customProperties:["--gap"],values:ve,responsive:!0},gapX:{type:"enum | string",className:"kui-r-cg",customProperties:["--column-gap"],values:ve,responsive:!0},gapY:{type:"enum | string",className:"kui-r-rg",customProperties:["--row-gap"],values:ve,responsive:!0}};var ao=["div","span"],po=["none","inline-flex","flex"],lo=["row","column","row-reverse","column-reverse"],uo=["start","center","end","baseline","stretch"],co=["start","center","end","between"],mo=["nowrap","wrap","wrap-reverse"],Qe={as:{type:"enum",values:ao,default:"div"},...j,display:{type:"enum",className:"kui-r-display",values:po,responsive:!0},direction:{type:"enum",className:"kui-r-fd",values:lo,responsive:!0},align:{type:"enum",className:"kui-r-ai",values:uo,responsive:!0},justify:{type:"enum",className:"kui-r-jc",values:co,parseValue:fo,responsive:!0},wrap:{type:"enum",className:"kui-r-fw",values:mo,responsive:!0},...Je};function fo(e){return e==="between"?"space-between":e}var X=se.forwardRef((e,t)=>{let{className:o,asChild:s,as:r="div",...n}=S(e,Qe,Ze,Ye);return se.createElement(s?Xe:r,{...n,ref:t,className:(0,et.default)("kui-Flex",o)})});X.displayName="Flex";var v=d(require("react")),Ce=d(require("classnames"));var tt={loading:{type:"boolean",default:!0}};var De=v.forwardRef((e,t)=>{let{className:o,children:s,loading:r,...n}=S(e,tt);if(s===void 0&&!r)return null;let i=n["aria-label"]!==void 0||n["aria-labelledby"]!==void 0,p=v.createElement("span",{role:i?"status":void 0,"aria-hidden":i?void 0:!0,...n,ref:t,className:(0,Ce.default)("kui-Spinner",o)},v.createElement("span",{className:"kui-SpinnerWheel"},v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"}),v.createElement("span",{className:"kui-SpinnerLeaf"})),typeof n["aria-label"]=="string"?v.createElement("span",{className:"kui-sr-only"},n["aria-label"]):null);return s===void 0?p:v.createElement("span",{className:"kui-SpinnerHost","data-loading":r||void 0,"aria-busy":r||void 0},v.createElement("span",{"aria-hidden":r||void 0,className:(0,Ce.default)("kui-SpinnerChildren",r&&"kui-SpinnerHiddenChildren")},s),r?v.createElement(X,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},v.createElement("span",null,p)):null)});De.displayName="Spinner";var m=d(require("react")),yo=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));yo.displayName="ThickDividerHorizontalIcon";var Po=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Po.displayName="ThickCheckIcon";var go=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));go.displayName="ChevronDownIcon";var ho=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));ho.displayName="ThickChevronRightIcon";var vo=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));vo.displayName="ThickChevronLeftIcon";var Co=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Co.displayName="ThickDotIcon";var Do=m.default.forwardRef((e,t)=>m.default.createElement("svg",{...e,ref:t,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"},m.default.createElement("path",{d:"M18 6 6 18"}),m.default.createElement("path",{d:"m6 6 12 12"})));Do.displayName="CloseIcon";var Ro=m.default.forwardRef((e,t)=>m.default.createElement("svg",{...e,ref:t,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"},m.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));Ro.displayName="PaperclipIcon";var bo=m.default.forwardRef((e,t)=>m.default.createElement("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"},m.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),m.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));bo.displayName="FileIcon";var To=m.default.forwardRef((e,t)=>m.default.createElement("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"},m.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),m.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),m.default.createElement("path",{d:"M10 9H8"}),m.default.createElement("path",{d:"M16 13H8"}),m.default.createElement("path",{d:"M16 17H8"})));To.displayName="FileTextIcon";var Re=m.default.forwardRef((e,t)=>m.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},m.default.createElement("path",{d:"M5 12.75L9.5 17.25L19 7.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})));Re.displayName="TickIcon";var ie=d(require("react"));function ot(e,t){if(t.includes(e))return e;let o=Number(e),s=t[0],r=1/0;for(let n=0;n<t.length;n++){let i=Math.abs(Number(t[n])-o);i<r&&(r=i,s=t[n])}return s}var ae=ie.createContext("2");ae.displayName="ThemeSizeContext";function rt(e,t){let o=ie.useContext(ae);if(e.size!==void 0)return e;let s=ot(o,t.values);return s===t.default?e:{...e,size:s}}var xe=u.forwardRef((e,t)=>{let o=rt(e,fe.size),{className:s,children:r,asChild:n,as:i,color:p,radius:l,disabled:a,done:c=!1,...f}=S(o,fe),P=!!o.loading,x=o.loading!==void 0,D=!!a||P,{onClick:T,"aria-describedby":B}=f,F=u.useCallback(g=>{if(D){g.preventDefault();return}T?.(g)},[D,T]),V=u.useMemo(()=>{let g=n&&u.isValidElement(r)?r.props.children:r,N=Te(g),k=b=>u.isValidElement(b)&&(b.type==="svg"||typeof b.type!="string"&&b.type!==u.Fragment&&!wo.has(be(b.type)));return{iconStart:k(N[0]),iconEnd:k(N[N.length-1])}},[n,r]),[w,_]=u.useState(null),$=u.useRef(null),L=(0,pe.useComposedRefs)(t,$);(0,pe.useLayoutEffect)(()=>{let g=$.current;if(!g||P||c)return;let N=g.querySelector(":scope > .kui-BaseButtonContent")??g,k=nt(N,"start"),b=nt(N,"end");_(I=>I&&I.iconStart===k&&I.iconEnd===b?I:{iconStart:k,iconEnd:b})});let{iconStart:M,iconEnd:U}=w??V,Ve=!!f["data-icon-only"],Z=u.useMemo(()=>{if(!c)return r;let g=u.createElement(Re,{key:"kui-done-tick",className:"kui-BaseButtonTick","aria-hidden":!0}),N=k=>{if(Ve)return g;let b=Te(k),I=b.findIndex(ee=>!(typeof ee=="string"&&!ee.trim())),Oe=b[I];return I!==-1&&M&&(w!==null||u.isValidElement(Oe)&&Oe.type==="svg")?b.map((ee,Lt)=>Lt===I?g:ee):[g,...b]};if(n&&u.isValidElement(r)){let k=r;return u.cloneElement(k,void 0,N(k.props.children))}return N(r)},[c,r,Ve,M,w,n]),Et=n?it.Slot.Root:i||"button",Bt=["button","input","textarea","select"],Ie=n?u.isValidElement(r)?r.type:void 0:i||"button",ue=typeof Ie=="string"&&Bt.includes(Ie),{onClickCapture:je}=f,Ft=u.useCallback(g=>{if(n&&D){g.preventDefault(),g.stopPropagation();return}je?.(g)},[n,D,je]),Vt=!n&&(!i||i==="button"),It="type"in f,jt=u.useId(),ce=P?`${jt}-loading`:void 0,zt=u.useMemo(()=>P?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":[B,ce].filter(Boolean).join(" ")}:a&&(!ue||n)?{"aria-disabled":!0}:{},[P,ce,B,a,ue,n]),ze=(g,N)=>x?u.createElement(u.Fragment,null,u.createElement("span",{className:"kui-BaseButtonContent","aria-hidden":P||void 0},g),P?u.createElement(u.Fragment,null,u.createElement("span",{className:"kui-sr-only"},u.createElement("span",{id:ce,"aria-hidden":!0},"Loading"),N),u.createElement(X,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},u.createElement("span",null,u.createElement(De,{"aria-hidden":"true"})))):null):g,Ot=n&&x&&u.isValidElement(Z)?u.cloneElement(Z,void 0,ze(Z.props.children,u.isValidElement(r)?r.props.children:null)):Z;return u.createElement(Et,{"data-accent-color":p,"data-radius":l,"data-icon-start":M||void 0,"data-icon-end":U||void 0,"data-done":c||void 0,...f,...zt,"data-disabled":D||void 0,onClick:F,onClickCapture:Ft,ref:L,className:(0,st.default)("kui-reset","kui-BaseButton",s),...ue&&{disabled:a},...Vt&&!It?{type:"button"}:{}},n?Ot:ze(Z,r))});xe.displayName="BaseButton";var wo=new Set(["Text","Kbd","Code","Link","Em","Strong","Quote","Badge","Trans"]);function be(e){if(!e||typeof e!="function"&&typeof e!="object")return"";let t=e;return t.displayName||t.name||be(t.render)||be(t.type)}function Te(e){return u.Children.toArray(e).flatMap(t=>u.isValidElement(t)&&t.type===u.Fragment?Te(t.props.children):[t])}function nt(e,t){let o=t==="start"?e.firstChild:e.lastChild;for(;o&&(o.nodeType===Node.COMMENT_NODE||o.nodeType===Node.TEXT_NODE&&!o.textContent?.trim());)o=t==="start"?o.nextSibling:o.previousSibling;return o?.nodeType===Node.ELEMENT_NODE&&o.localName==="svg"}var C=d(require("react")),Tt=d(require("classnames")),O=require("radix-ui");var H=d(require("react")),yt=require("radix-ui");var No=["loud","medium","quiet"],at={emphasis:{type:"enum",className:"kui-emphasis",values:No,default:void 0}};var ko=["normal","start","end","both"],pt={trim:{type:"enum",className:"kui-r-lt",values:ko,responsive:!0}};var So=["left","center","right"],lt={align:{type:"enum",className:"kui-r-ta",values:So,responsive:!0}};var Eo=["wrap","nowrap","pretty","balance"],ut={wrap:{type:"enum",className:"kui-r-tw",values:Eo,responsive:!0}};var ct={truncate:{type:"boolean",className:"kui-truncate"}};var Bo=["sans","mono","serif"],mt={font:{type:"enum",className:"kui-r-ff",values:Bo}};var Fo=["regular","medium","semibold"],ft={weight:{type:"enum",className:"kui-r-weight",values:Fo,responsive:!0}};var Vo=["span","div","label","p"],Io=["1","2","3","4","5","6","7","8","9"],dt={as:{type:"enum",values:Vo,default:"span"},...j,size:{type:"enum",className:"kui-r-size",values:Io,responsive:!0},...mt,...ft,...lt,...pt,...ct,...ut,...We,...at};var we=H.memo(H.forwardRef((e,t)=>{let{children:o,className:s,asChild:r,as:n="span",color:i,...p}=S(e,dt),l=s?`kui-Text ${s}`:"kui-Text";return r?H.createElement(yt.Slot.Root,{"data-accent-color":i,...p,ref:t,className:l},o):H.createElement(n,{"data-accent-color":i,...p,ref:t,className:l},o)}));we.displayName="Text";var q=d(require("react"));var h=d(require("react")),ht=d(require("classnames")),J=require("radix-ui");function Pt(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Ne=d(require("react"));function z(e){let[t,o]=Ne.useState(e),[s,r]=Ne.useState(e);return Object.is(e,s)||(r(e),o(e)),[t,o]}var jo=["inherit","light","dark"],gt=["sans","mono","serif"],zo=["1","2","3","4"],y={...j,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:jo,default:"inherit"},accentColor:{type:"enum",values:oe,default:"gray"},grayColor:{type:"enum",values:Me,default:"gray"},radius:{type:"enum",values:me,default:"full"},fontFamily:{type:"enum",values:gt,default:"sans"},headingFontFamily:{type:"enum",values:gt},size:{type:"enum",values:zo,default:"2"}};var R=()=>{},Tn={appearance:y.appearance.default,accentColor:y.accentColor.default,grayColor:y.grayColor.default,resolvedGrayColor:y.grayColor.default,radius:y.radius.default,fontFamily:y.fontFamily.default,headingFontFamily:void 0,size:y.size.default,onAppearanceChange:R,onAccentColorChange:R,onGrayColorChange:R,onRadiusChange:R,onFontFamilyChange:R,onHeadingFontFamilyChange:R,onSizeChange:R},ke=h.createContext(void 0);var Se=h.forwardRef((e,t)=>{let o=h.useContext(ke),s=J.Direction.useDirection();return o===void 0?h.createElement(J.Direction.Provider,{dir:s},h.createElement(vt,{...e,ref:t})):h.createElement(Ee,{...e,ref:t})});Se.displayName="Theme";var vt=h.forwardRef((e,t)=>{let{appearance:o=y.appearance.default,accentColor:s=y.accentColor.default,grayColor:r=y.grayColor.default,radius:n=y.radius.default,fontFamily:i=y.fontFamily.default,headingFontFamily:p,size:l=y.size.default,hasBackground:a=y.hasBackground.default,...c}=e,[f,P]=z(o),[x,D]=z(s),[T,B]=z(r),[F,V]=z(n),[w,_]=z(i),[$,L]=z(p),[M,U]=z(l);return h.createElement(Ee,{...c,ref:t,isRoot:!0,hasBackground:a,appearance:f,accentColor:x,grayColor:T,radius:F,fontFamily:w,headingFontFamily:$,size:M,onAppearanceChange:P,onAccentColorChange:D,onGrayColorChange:B,onRadiusChange:V,onFontFamilyChange:_,onHeadingFontFamilyChange:L,onSizeChange:U})});vt.displayName="ThemeRoot";var Ee=h.forwardRef((e,t)=>{let o=h.useContext(ke),{asChild:s,isRoot:r,hasBackground:n,appearance:i=e.appearance??o?.appearance??y.appearance.default,accentColor:p=e.accentColor??o?.accentColor??y.accentColor.default,grayColor:l=e.grayColor??o?.resolvedGrayColor??y.grayColor.default,radius:a=e.radius??o?.radius??y.radius.default,fontFamily:c=e.fontFamily??o?.fontFamily??y.fontFamily.default,headingFontFamily:f=e.headingFontFamily??o?.headingFontFamily,size:P=e.size??o?.size??y.size.default,onAppearanceChange:x=o?.onAppearanceChange??R,onAccentColorChange:D=o?.onAccentColorChange??R,onGrayColorChange:T=o?.onGrayColorChange??R,onRadiusChange:B=o?.onRadiusChange??R,onFontFamilyChange:F=o?.onFontFamilyChange??R,onHeadingFontFamilyChange:V=o?.onHeadingFontFamilyChange??R,onSizeChange:w=o?.onSizeChange??R,..._}=e,$=s?J.Slot.Root:"div",L=l==="auto"?Pt(p):l,M=e.appearance==="light"||e.appearance==="dark",U=n===void 0?r||M:n;return h.createElement(ke.Provider,{value:h.useMemo(()=>({appearance:i,accentColor:p,grayColor:l,resolvedGrayColor:L,radius:a,fontFamily:c,headingFontFamily:f,size:P,onAppearanceChange:x,onAccentColorChange:D,onGrayColorChange:T,onRadiusChange:B,onFontFamilyChange:F,onHeadingFontFamilyChange:V,onSizeChange:w}),[i,p,l,L,a,c,f,P,x,D,T,B,F,V,w])},h.createElement(ae.Provider,{value:P},h.createElement($,{"data-is-root-theme":r?"true":"false","data-accent-color":p,"data-gray-color":L,"data-has-background":U?"true":"false","data-radius":a,"data-font-family":c,"data-heading-font-family":f,ref:t,..._,className:(0,ht.default)("kui-theme",{light:i==="light",dark:i==="dark"},_.className)})))});Ee.displayName="ThemeImpl";var Ct=d(require("react")),Dt=Ct.createContext(void 0);var E=d(require("react")),Oo=E.createContext(null);function Rt({children:e}){return E.createElement(Oo.Provider,{value:null},e)}var Be=q.forwardRef((e,t)=>q.createElement(Dt.Provider,{value:null},q.createElement(Rt,null,q.createElement(Se,{...e,ref:t}))));Be.displayName="PortalTheme";var bt={content:{type:"ReactNode",required:!0},width:K.width,minWidth:K.minWidth,maxWidth:{...K.maxWidth,default:"360px"}};var xt=200,wt=C.createContext(!1);function Lo({delayDuration:e=xt,children:t,...o}){return C.createElement(wt.Provider,{value:!0},C.createElement(O.Tooltip.Provider,{delayDuration:e,...o},t))}Lo.displayName="TooltipProvider";var Fe=C.forwardRef((e,t)=>{let{children:o,className:s,open:r,defaultOpen:n,onOpenChange:i,delayDuration:p,disableHoverableContent:l,content:a,container:c,forceMount:f,...P}=S(e,bt),x={open:r,defaultOpen:n,onOpenChange:i,delayDuration:p,disableHoverableContent:l},D=C.useContext(wt),T=C.createElement(O.Tooltip.Root,{...x},C.createElement(O.Tooltip.Trigger,{asChild:!0},o),C.createElement(O.Tooltip.Portal,{container:c,forceMount:f},C.createElement(Be,{asChild:!0},C.createElement(O.Tooltip.Content,{sideOffset:4,collisionPadding:10,...P,asChild:!1,ref:t,className:(0,Tt.default)("kui-TooltipContent",s)},C.createElement(we,{as:"p",className:"kui-TooltipText",size:"1"},a),C.createElement(O.Tooltip.Arrow,{className:"kui-TooltipArrow"})))));return D?T:C.createElement(O.Tooltip.Provider,{delayDuration:xt},T)});Fe.displayName="Tooltip";var le=d(require("react"));function Nt(e){let t=le.useId(),o=!!e,s=le.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:s}}var Mo={loud:"solid",medium:"raised",quiet:"ghost"};var St=Q.forwardRef(({className:e,style:t,tooltip:o,tooltipSide:s="top",tooltipAlign:r="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:i,iconOnly:p=!1,emphasis:l,variant:a,...c},f)=>{let{tooltipId:P,hasTooltip:x,accessibilityProps:D}=Nt(o);p&&(c.fullWidth=!1);let T=l!==void 0?Mo[l]:a,B=c["aria-describedby"],F=D["aria-describedby"],V=[B,F].filter(Boolean).join(" ")||void 0,w=Q.createElement(xe,{...c,variant:T,"aria-describedby":V,ref:f,"data-icon-only":p||void 0,className:(0,kt.default)("kui-Button",e),style:t});return x?Q.createElement(Fe,{content:o,side:s,align:r,delayDuration:n,disableHoverableContent:i,id:P},w):w});St.displayName="Button";
3
3
  //# sourceMappingURL=button.js.map