eidos-ui 3.6.3 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/README.md +11 -0
  2. package/dist/{Avatar.types-BY-C09Ke.d.cts → Avatar.types-DkRznn-7.d.cts} +6 -1
  3. package/dist/{Avatar.types-BY-C09Ke.d.ts → Avatar.types-DkRznn-7.d.ts} +6 -1
  4. package/dist/{Breadcrumb.types-DaykU-C8.d.cts → Breadcrumb.types-C3uADbKU.d.cts} +4 -1
  5. package/dist/{Breadcrumb.types-DaykU-C8.d.ts → Breadcrumb.types-C3uADbKU.d.ts} +4 -1
  6. package/dist/Button.types-BCIK8Qlk.d.ts +59 -0
  7. package/dist/Button.types-DkgWjFsk.d.cts +59 -0
  8. package/dist/Chip.types-BM-UZOCv.d.ts +33 -0
  9. package/dist/Chip.types-_1bhyKz4.d.cts +33 -0
  10. package/dist/{Header.types-Ce5Cj301.d.cts → Header.types-a6p0-ZHx.d.cts} +24 -8
  11. package/dist/{Header.types-0XovUp0T.d.ts → Header.types-zbhURbg7.d.ts} +24 -8
  12. package/dist/{Input.types-D7-sWq-q.d.cts → Input.types--K0t_3L2.d.cts} +1 -1
  13. package/dist/{Input.types-CSDMaZNe.d.ts → Input.types--UjucBDd.d.ts} +1 -1
  14. package/dist/{Menu.types-CTnUijv5.d.cts → Menu.types-D6VoK9T9.d.cts} +1 -1
  15. package/dist/{Menu.types-BN4g1-3A.d.ts → Menu.types-tUEhXn52.d.ts} +1 -1
  16. package/dist/{Navigation.types-By5HfPTi.d.ts → Navigation.types-CJRzo9Zo.d.ts} +1 -1
  17. package/dist/{Navigation.types-_MrYqqUI.d.cts → Navigation.types-D95oHZEJ.d.cts} +1 -1
  18. package/dist/{SegmentedControl.types-cjLwwBAm.d.ts → SegmentedControl.types-CHtjABQM.d.ts} +1 -1
  19. package/dist/{SegmentedControl.types-BofrEYyd.d.cts → SegmentedControl.types-D_gHYL9X.d.cts} +1 -1
  20. package/dist/{Select.types-ok-03rLo.d.cts → Select.types-8CGZBgT-.d.cts} +2 -2
  21. package/dist/{Select.types-C2tGy1vj.d.ts → Select.types-CAVh9Gvd.d.ts} +2 -2
  22. package/dist/{Table.types-D8pmgxKA.d.ts → Table.types-BFDE-hhF.d.ts} +2 -2
  23. package/dist/{Table.types-D-9tC0kJ.d.cts → Table.types-Tai7_MTz.d.cts} +2 -2
  24. package/dist/{Toolbar.types-CKnQC_TW.d.ts → Toolbar.types-BqBrPVww.d.ts} +8 -6
  25. package/dist/{Toolbar.types-DUz2mxct.d.cts → Toolbar.types-GCUgzuKW.d.cts} +8 -6
  26. package/dist/alert/index.cjs +8 -5
  27. package/dist/alert/index.cjs.map +1 -1
  28. package/dist/alert/index.d.cts +1 -1
  29. package/dist/alert/index.d.ts +1 -1
  30. package/dist/alert/index.js +7 -4
  31. package/dist/avatar/index.d.cts +2 -2
  32. package/dist/avatar/index.d.ts +2 -2
  33. package/dist/breadcrumb/index.cjs +4 -2
  34. package/dist/breadcrumb/index.cjs.map +1 -1
  35. package/dist/breadcrumb/index.d.cts +2 -2
  36. package/dist/breadcrumb/index.d.ts +2 -2
  37. package/dist/breadcrumb/index.js +3 -1
  38. package/dist/button/index.cjs +7 -4
  39. package/dist/button/index.cjs.map +1 -1
  40. package/dist/button/index.d.cts +5 -5
  41. package/dist/button/index.d.ts +5 -5
  42. package/dist/button/index.js +6 -3
  43. package/dist/button-group/index.d.cts +2 -2
  44. package/dist/button-group/index.d.ts +2 -2
  45. package/dist/chip/index.cjs +7 -4
  46. package/dist/chip/index.cjs.map +1 -1
  47. package/dist/chip/index.d.cts +5 -23
  48. package/dist/chip/index.d.ts +5 -23
  49. package/dist/chip/index.js +6 -3
  50. package/dist/{chunk-DRXPTACG.js → chunk-26PRBZA6.js} +6 -2
  51. package/dist/chunk-26PRBZA6.js.map +1 -0
  52. package/dist/chunk-2IXCEKLI.js +82 -0
  53. package/dist/chunk-2IXCEKLI.js.map +1 -0
  54. package/dist/{chunk-GWHZFX2H.js → chunk-2TIMJD4K.js} +29 -6
  55. package/dist/chunk-2TIMJD4K.js.map +1 -0
  56. package/dist/{chunk-RHFD2Z5V.js → chunk-3TF2GZSG.js} +7 -7
  57. package/dist/{chunk-TC5IC6OP.cjs → chunk-3VXUOAIJ.cjs} +3 -3
  58. package/dist/{chunk-TC5IC6OP.cjs.map → chunk-3VXUOAIJ.cjs.map} +1 -1
  59. package/dist/{chunk-JHX6JK3M.js → chunk-3X6QVHTD.js} +2 -2
  60. package/dist/{chunk-7VJCGKVP.cjs → chunk-4HZIXRAJ.cjs} +11 -11
  61. package/dist/{chunk-7VJCGKVP.cjs.map → chunk-4HZIXRAJ.cjs.map} +1 -1
  62. package/dist/{chunk-MQAOXZD4.js → chunk-4S57PE43.js} +4 -4
  63. package/dist/{chunk-JT4KVXJK.js → chunk-4V2XYUQL.js} +2 -2
  64. package/dist/{chunk-PMSENLOA.cjs → chunk-544RAXWO.cjs} +19 -19
  65. package/dist/{chunk-PMSENLOA.cjs.map → chunk-544RAXWO.cjs.map} +1 -1
  66. package/dist/{chunk-4JSTBA4F.cjs → chunk-6CW5QSYV.cjs} +7 -7
  67. package/dist/{chunk-4JSTBA4F.cjs.map → chunk-6CW5QSYV.cjs.map} +1 -1
  68. package/dist/{chunk-AR2ZOO6L.js → chunk-6FXFKMJ5.js} +3 -3
  69. package/dist/{chunk-KREHT4AQ.cjs → chunk-6IB27I5K.cjs} +8 -8
  70. package/dist/{chunk-KREHT4AQ.cjs.map → chunk-6IB27I5K.cjs.map} +1 -1
  71. package/dist/{chunk-LGDODZHI.js → chunk-6LTZV6HN.js} +4 -4
  72. package/dist/{chunk-YP4HUBKN.js → chunk-6NAOAKII.js} +2 -2
  73. package/dist/chunk-75Q5OS7L.cjs +10 -0
  74. package/dist/chunk-75Q5OS7L.cjs.map +1 -0
  75. package/dist/{chunk-LQXFXXMJ.cjs → chunk-7FV2X62W.cjs} +7 -7
  76. package/dist/{chunk-LQXFXXMJ.cjs.map → chunk-7FV2X62W.cjs.map} +1 -1
  77. package/dist/{chunk-2T7ZMMH5.cjs → chunk-7NUVLVSL.cjs} +5 -5
  78. package/dist/{chunk-2T7ZMMH5.cjs.map → chunk-7NUVLVSL.cjs.map} +1 -1
  79. package/dist/chunk-ACH7SYQ2.js +47 -0
  80. package/dist/chunk-ACH7SYQ2.js.map +1 -0
  81. package/dist/{chunk-HNGFRRVZ.cjs → chunk-AUNDBUHM.cjs} +3 -3
  82. package/dist/{chunk-HNGFRRVZ.cjs.map → chunk-AUNDBUHM.cjs.map} +1 -1
  83. package/dist/{chunk-XZLSHEHE.cjs → chunk-B2OHBIAL.cjs} +10 -10
  84. package/dist/{chunk-XZLSHEHE.cjs.map → chunk-B2OHBIAL.cjs.map} +1 -1
  85. package/dist/chunk-BDH2MXJW.js +46 -0
  86. package/dist/chunk-BDH2MXJW.js.map +1 -0
  87. package/dist/{chunk-D7SQ7LHJ.js → chunk-BO3KK3ZQ.js} +2 -2
  88. package/dist/{chunk-NOQF7UQ5.cjs → chunk-CFVUUMQA.cjs} +6 -6
  89. package/dist/{chunk-NOQF7UQ5.cjs.map → chunk-CFVUUMQA.cjs.map} +1 -1
  90. package/dist/chunk-CJT7L764.cjs +21 -0
  91. package/dist/chunk-CJT7L764.cjs.map +1 -0
  92. package/dist/{chunk-5XH2PHT2.js → chunk-CNTG7OOO.js} +14 -14
  93. package/dist/{chunk-I6M6CVI2.cjs → chunk-DG3O5NV4.cjs} +3 -3
  94. package/dist/{chunk-I6M6CVI2.cjs.map → chunk-DG3O5NV4.cjs.map} +1 -1
  95. package/dist/{chunk-WNDDS367.js → chunk-DPTTDHZ5.js} +3 -3
  96. package/dist/{chunk-35LGEPLP.cjs → chunk-ENMDOQQO.cjs} +29 -14
  97. package/dist/chunk-ENMDOQQO.cjs.map +1 -0
  98. package/dist/{chunk-V4BZWBZT.cjs → chunk-F5IRMMZ2.cjs} +7 -7
  99. package/dist/{chunk-V4BZWBZT.cjs.map → chunk-F5IRMMZ2.cjs.map} +1 -1
  100. package/dist/{chunk-WE2SBWZ6.js → chunk-FE7S4RSK.js} +10 -10
  101. package/dist/chunk-FE7S4RSK.js.map +1 -0
  102. package/dist/{chunk-BFKPJ627.js → chunk-FHOD3FUN.js} +4 -4
  103. package/dist/{chunk-SNRRF64M.js → chunk-GDRLVX2A.js} +31 -10
  104. package/dist/chunk-GDRLVX2A.js.map +1 -0
  105. package/dist/{chunk-5O73AALP.cjs → chunk-GP6EEZH5.cjs} +7 -3
  106. package/dist/chunk-GP6EEZH5.cjs.map +1 -0
  107. package/dist/{chunk-SDUGYJGW.js → chunk-H3C6YECZ.js} +6 -6
  108. package/dist/{chunk-RJVHR45I.cjs → chunk-H46ZLPNJ.cjs} +7 -7
  109. package/dist/{chunk-RJVHR45I.cjs.map → chunk-H46ZLPNJ.cjs.map} +1 -1
  110. package/dist/{chunk-66UQTF57.cjs → chunk-HLI4SOH3.cjs} +45 -45
  111. package/dist/{chunk-66UQTF57.cjs.map → chunk-HLI4SOH3.cjs.map} +1 -1
  112. package/dist/{chunk-ZMRINZIO.cjs → chunk-HR5MWA3B.cjs} +5 -5
  113. package/dist/{chunk-ZMRINZIO.cjs.map → chunk-HR5MWA3B.cjs.map} +1 -1
  114. package/dist/{chunk-MPIVBAMY.js → chunk-HYRLK462.js} +2 -2
  115. package/dist/{chunk-FIVMMCGM.js → chunk-IHPSRTVW.js} +4 -4
  116. package/dist/{chunk-THCTUBX6.js → chunk-IKXXXVUO.js} +3 -3
  117. package/dist/{chunk-JPYJQ4TF.cjs → chunk-JFV56ISS.cjs} +6 -6
  118. package/dist/{chunk-JPYJQ4TF.cjs.map → chunk-JFV56ISS.cjs.map} +1 -1
  119. package/dist/{chunk-75GFIQRU.js → chunk-JY77VJAZ.js} +30 -15
  120. package/dist/chunk-JY77VJAZ.js.map +1 -0
  121. package/dist/chunk-KXDGW6LJ.cjs +46 -0
  122. package/dist/chunk-KXDGW6LJ.cjs.map +1 -0
  123. package/dist/{chunk-24HKKSKX.js → chunk-L6ERHCQ2.js} +3 -3
  124. package/dist/{chunk-4LNTZPSQ.js → chunk-L6YJ6QTZ.js} +2 -2
  125. package/dist/{chunk-KBQD4JLK.cjs → chunk-LUDK44NZ.cjs} +3 -3
  126. package/dist/{chunk-KBQD4JLK.cjs.map → chunk-LUDK44NZ.cjs.map} +1 -1
  127. package/dist/chunk-LWCFT5SP.cjs +82 -0
  128. package/dist/chunk-LWCFT5SP.cjs.map +1 -0
  129. package/dist/{chunk-JNY7TUDS.js → chunk-MCPGI6EI.js} +2 -2
  130. package/dist/{chunk-DU5JKTHK.cjs → chunk-MKC6V3SY.cjs} +6 -6
  131. package/dist/{chunk-DU5JKTHK.cjs.map → chunk-MKC6V3SY.cjs.map} +1 -1
  132. package/dist/{chunk-J76JHN7J.cjs → chunk-N5NXKVFJ.cjs} +10 -10
  133. package/dist/{chunk-J76JHN7J.cjs.map → chunk-N5NXKVFJ.cjs.map} +1 -1
  134. package/dist/{chunk-XERBOFYZ.cjs → chunk-NERASTO2.cjs} +3 -3
  135. package/dist/{chunk-XERBOFYZ.cjs.map → chunk-NERASTO2.cjs.map} +1 -1
  136. package/dist/{chunk-3KBBJZHK.cjs → chunk-NFD7MPX4.cjs} +16 -14
  137. package/dist/chunk-NFD7MPX4.cjs.map +1 -0
  138. package/dist/{chunk-3ZRFOKDM.cjs → chunk-NNAEQR3Y.cjs} +30 -30
  139. package/dist/{chunk-3ZRFOKDM.cjs.map → chunk-NNAEQR3Y.cjs.map} +1 -1
  140. package/dist/{chunk-36JFXFM2.cjs → chunk-OGGZIFTI.cjs} +38 -38
  141. package/dist/chunk-OGGZIFTI.cjs.map +1 -0
  142. package/dist/{chunk-2PCCGQOH.js → chunk-P6OJQ2RN.js} +6 -6
  143. package/dist/{chunk-3RWZC6OW.cjs → chunk-PE2SLXUS.cjs} +5 -5
  144. package/dist/{chunk-3RWZC6OW.cjs.map → chunk-PE2SLXUS.cjs.map} +1 -1
  145. package/dist/chunk-QD32IMMH.js +13 -0
  146. package/dist/chunk-QD32IMMH.js.map +1 -0
  147. package/dist/{chunk-HEXAY6DE.cjs → chunk-QUSO4GFA.cjs} +7 -7
  148. package/dist/{chunk-HEXAY6DE.cjs.map → chunk-QUSO4GFA.cjs.map} +1 -1
  149. package/dist/{chunk-OOCCSMWM.js → chunk-RHWZX7PB.js} +9 -7
  150. package/dist/chunk-RHWZX7PB.js.map +1 -0
  151. package/dist/{chunk-YXRKBKFB.js → chunk-S5CMZFX6.js} +3 -3
  152. package/dist/{chunk-4AO5RKV5.cjs → chunk-SLHIVEFW.cjs} +7 -7
  153. package/dist/{chunk-4AO5RKV5.cjs.map → chunk-SLHIVEFW.cjs.map} +1 -1
  154. package/dist/{chunk-HEX4IMLO.js → chunk-TJQNGJHP.js} +4 -4
  155. package/dist/{chunk-JCKGAAPZ.cjs → chunk-TNQ2ZZ7W.cjs} +9 -9
  156. package/dist/{chunk-JCKGAAPZ.cjs.map → chunk-TNQ2ZZ7W.cjs.map} +1 -1
  157. package/dist/chunk-U32K2H3N.js +10 -0
  158. package/dist/chunk-U32K2H3N.js.map +1 -0
  159. package/dist/{chunk-RHHZRTWM.js → chunk-U34INRFO.js} +28 -13
  160. package/dist/chunk-U34INRFO.js.map +1 -0
  161. package/dist/{chunk-SFFKQQ5Z.js → chunk-U4SVBE2M.js} +5 -5
  162. package/dist/{chunk-O3QM3BFE.js → chunk-UC4NYF6T.js} +2 -2
  163. package/dist/{chunk-6JHVXWDV.cjs → chunk-ULKWUKD2.cjs} +22 -22
  164. package/dist/{chunk-6JHVXWDV.cjs.map → chunk-ULKWUKD2.cjs.map} +1 -1
  165. package/dist/{chunk-BEOECPVJ.cjs → chunk-UTYY35QX.cjs} +3 -3
  166. package/dist/{chunk-BEOECPVJ.cjs.map → chunk-UTYY35QX.cjs.map} +1 -1
  167. package/dist/{chunk-7BFODYNL.cjs → chunk-UUT2VEN5.cjs} +7 -7
  168. package/dist/{chunk-7BFODYNL.cjs.map → chunk-UUT2VEN5.cjs.map} +1 -1
  169. package/dist/chunk-V3T7RO4F.js +21 -0
  170. package/dist/chunk-V3T7RO4F.js.map +1 -0
  171. package/dist/{chunk-GIEDIAPD.js → chunk-V5CM5TH3.js} +3 -3
  172. package/dist/{chunk-L65MHFMD.js → chunk-V64DICJK.js} +3 -3
  173. package/dist/{chunk-KIZVY57H.cjs → chunk-VXC7Z7XB.cjs} +5 -5
  174. package/dist/{chunk-KIZVY57H.cjs.map → chunk-VXC7Z7XB.cjs.map} +1 -1
  175. package/dist/chunk-VYF7WV4K.cjs +47 -0
  176. package/dist/chunk-VYF7WV4K.cjs.map +1 -0
  177. package/dist/{chunk-P4XZH3OR.js → chunk-WHQGJHMD.js} +4 -4
  178. package/dist/{chunk-TTLFY76J.cjs → chunk-WR77IZUU.cjs} +32 -9
  179. package/dist/chunk-WR77IZUU.cjs.map +1 -0
  180. package/dist/{chunk-O2BECFXJ.cjs → chunk-WTFEMOV5.cjs} +43 -22
  181. package/dist/chunk-WTFEMOV5.cjs.map +1 -0
  182. package/dist/{chunk-YAKTVIVK.js → chunk-XIUZT4TO.js} +3 -3
  183. package/dist/chunk-XPG56DLQ.cjs +103 -0
  184. package/dist/chunk-XPG56DLQ.cjs.map +1 -0
  185. package/dist/{chunk-GPVGGBIR.js → chunk-XWMXEJVZ.js} +2 -2
  186. package/dist/chunk-XZILHRKG.cjs +13 -0
  187. package/dist/chunk-XZILHRKG.cjs.map +1 -0
  188. package/dist/{chunk-VQGLVBPL.cjs → chunk-YIOHKQ6Y.cjs} +11 -4
  189. package/dist/chunk-YIOHKQ6Y.cjs.map +1 -0
  190. package/dist/{chunk-A3LMUPG3.js → chunk-Z3IJWYUD.js} +2 -2
  191. package/dist/{chunk-4J25XZDI.js → chunk-ZJWQPZ7E.js} +9 -2
  192. package/dist/chunk-ZJWQPZ7E.js.map +1 -0
  193. package/dist/color-picker/index.cjs +5 -4
  194. package/dist/color-picker/index.cjs.map +1 -1
  195. package/dist/color-picker/index.js +4 -3
  196. package/dist/combobox/index.cjs +7 -6
  197. package/dist/combobox/index.cjs.map +1 -1
  198. package/dist/combobox/index.js +6 -5
  199. package/dist/command-palette/index.cjs +4 -3
  200. package/dist/command-palette/index.cjs.map +1 -1
  201. package/dist/command-palette/index.js +3 -2
  202. package/dist/context-menu/index.cjs +7 -6
  203. package/dist/context-menu/index.cjs.map +1 -1
  204. package/dist/context-menu/index.d.cts +2 -2
  205. package/dist/context-menu/index.d.ts +2 -2
  206. package/dist/context-menu/index.js +6 -5
  207. package/dist/conversation/index.cjs +11 -8
  208. package/dist/conversation/index.cjs.map +1 -1
  209. package/dist/conversation/index.d.cts +3 -3
  210. package/dist/conversation/index.d.ts +3 -3
  211. package/dist/conversation/index.js +10 -7
  212. package/dist/data-grid/index.cjs +18 -15
  213. package/dist/data-grid/index.cjs.map +1 -1
  214. package/dist/data-grid/index.d.cts +8 -8
  215. package/dist/data-grid/index.d.ts +8 -8
  216. package/dist/data-grid/index.js +17 -14
  217. package/dist/date-picker/index.cjs +11 -8
  218. package/dist/date-picker/index.cjs.map +1 -1
  219. package/dist/date-picker/index.d.cts +2 -2
  220. package/dist/date-picker/index.d.ts +2 -2
  221. package/dist/date-picker/index.js +10 -7
  222. package/dist/drawer/index.cjs +8 -5
  223. package/dist/drawer/index.cjs.map +1 -1
  224. package/dist/drawer/index.d.cts +5 -4
  225. package/dist/drawer/index.d.ts +5 -4
  226. package/dist/drawer/index.js +7 -4
  227. package/dist/dropdown/index.cjs +4 -3
  228. package/dist/dropdown/index.cjs.map +1 -1
  229. package/dist/dropdown/index.js +3 -2
  230. package/dist/header/index.cjs +9 -6
  231. package/dist/header/index.cjs.map +1 -1
  232. package/dist/header/index.d.cts +10 -10
  233. package/dist/header/index.d.ts +10 -10
  234. package/dist/header/index.js +8 -5
  235. package/dist/index.cjs +59 -42
  236. package/dist/index.cjs.map +1 -1
  237. package/dist/index.css +107 -34
  238. package/dist/index.d.cts +16 -13
  239. package/dist/index.d.ts +16 -13
  240. package/dist/index.js +65 -48
  241. package/dist/inline-edit/index.cjs +6 -5
  242. package/dist/inline-edit/index.cjs.map +1 -1
  243. package/dist/inline-edit/index.js +5 -4
  244. package/dist/input/index.cjs +5 -4
  245. package/dist/input/index.cjs.map +1 -1
  246. package/dist/input/index.d.cts +3 -3
  247. package/dist/input/index.d.ts +3 -3
  248. package/dist/input/index.js +4 -3
  249. package/dist/link-provider/index.cjs +12 -0
  250. package/dist/link-provider/index.cjs.map +1 -0
  251. package/dist/link-provider/index.d.cts +43 -0
  252. package/dist/link-provider/index.d.ts +43 -0
  253. package/dist/link-provider/index.js +12 -0
  254. package/dist/link-provider/index.js.map +1 -0
  255. package/dist/lucide-icons/index.cjs +9 -0
  256. package/dist/lucide-icons/index.cjs.map +1 -0
  257. package/dist/lucide-icons/index.d.cts +2 -0
  258. package/dist/lucide-icons/index.d.ts +2 -0
  259. package/dist/lucide-icons/index.js +9 -0
  260. package/dist/lucide-icons/index.js.map +1 -0
  261. package/dist/menu/index.cjs +6 -5
  262. package/dist/menu/index.cjs.map +1 -1
  263. package/dist/menu/index.d.cts +3 -3
  264. package/dist/menu/index.d.ts +3 -3
  265. package/dist/menu/index.js +5 -4
  266. package/dist/modal/index.cjs +8 -5
  267. package/dist/modal/index.cjs.map +1 -1
  268. package/dist/modal/index.d.cts +2 -2
  269. package/dist/modal/index.d.ts +2 -2
  270. package/dist/modal/index.js +7 -4
  271. package/dist/navigation/index.cjs +8 -5
  272. package/dist/navigation/index.cjs.map +1 -1
  273. package/dist/navigation/index.d.cts +3 -3
  274. package/dist/navigation/index.d.ts +3 -3
  275. package/dist/navigation/index.js +7 -4
  276. package/dist/number-input/index.cjs +4 -3
  277. package/dist/number-input/index.cjs.map +1 -1
  278. package/dist/number-input/index.js +3 -2
  279. package/dist/page-layout/index.cjs +16 -13
  280. package/dist/page-layout/index.cjs.map +1 -1
  281. package/dist/page-layout/index.d.cts +8 -8
  282. package/dist/page-layout/index.d.ts +8 -8
  283. package/dist/page-layout/index.js +15 -12
  284. package/dist/pagination/index.cjs +11 -8
  285. package/dist/pagination/index.cjs.map +1 -1
  286. package/dist/pagination/index.js +10 -7
  287. package/dist/popover/index.cjs +4 -3
  288. package/dist/popover/index.cjs.map +1 -1
  289. package/dist/popover/index.d.cts +1 -1
  290. package/dist/popover/index.d.ts +1 -1
  291. package/dist/popover/index.js +3 -2
  292. package/dist/renderIcon-BW3PUtg8.d.cts +50 -0
  293. package/dist/renderIcon-BW3PUtg8.d.ts +50 -0
  294. package/dist/segmented-control/index.cjs +5 -4
  295. package/dist/segmented-control/index.cjs.map +1 -1
  296. package/dist/segmented-control/index.d.cts +3 -3
  297. package/dist/segmented-control/index.d.ts +3 -3
  298. package/dist/segmented-control/index.js +4 -3
  299. package/dist/select/index.cjs +7 -6
  300. package/dist/select/index.cjs.map +1 -1
  301. package/dist/select/index.d.cts +4 -4
  302. package/dist/select/index.d.ts +4 -4
  303. package/dist/select/index.js +6 -5
  304. package/dist/snackbar/index.cjs +8 -5
  305. package/dist/snackbar/index.cjs.map +1 -1
  306. package/dist/snackbar/index.js +7 -4
  307. package/dist/split-button/index.cjs +7 -6
  308. package/dist/split-button/index.cjs.map +1 -1
  309. package/dist/split-button/index.d.cts +2 -2
  310. package/dist/split-button/index.d.ts +2 -2
  311. package/dist/split-button/index.js +6 -5
  312. package/dist/split-chip/index.cjs +14 -0
  313. package/dist/split-chip/index.cjs.map +1 -0
  314. package/dist/split-chip/index.d.cts +67 -0
  315. package/dist/split-chip/index.d.ts +67 -0
  316. package/dist/split-chip/index.js +14 -0
  317. package/dist/split-chip/index.js.map +1 -0
  318. package/dist/table/index.cjs +16 -13
  319. package/dist/table/index.cjs.map +1 -1
  320. package/dist/table/index.d.cts +4 -4
  321. package/dist/table/index.d.ts +4 -4
  322. package/dist/table/index.js +15 -12
  323. package/dist/tabs/index.cjs +4 -3
  324. package/dist/tabs/index.cjs.map +1 -1
  325. package/dist/tabs/index.d.cts +1 -1
  326. package/dist/tabs/index.d.ts +1 -1
  327. package/dist/tabs/index.js +3 -2
  328. package/dist/tag-input/index.cjs +9 -6
  329. package/dist/tag-input/index.cjs.map +1 -1
  330. package/dist/tag-input/index.js +8 -5
  331. package/dist/textarea/index.cjs +5 -4
  332. package/dist/textarea/index.cjs.map +1 -1
  333. package/dist/textarea/index.d.cts +1 -1
  334. package/dist/textarea/index.d.ts +1 -1
  335. package/dist/textarea/index.js +4 -3
  336. package/dist/theme-editor/index.cjs +14 -11
  337. package/dist/theme-editor/index.cjs.map +1 -1
  338. package/dist/theme-editor/index.js +13 -10
  339. package/dist/theme-provider/index.cjs +4 -3
  340. package/dist/theme-provider/index.cjs.map +1 -1
  341. package/dist/theme-provider/index.js +3 -2
  342. package/dist/timeline/index.cjs +2 -2
  343. package/dist/timeline/index.d.cts +18 -3
  344. package/dist/timeline/index.d.ts +18 -3
  345. package/dist/timeline/index.js +1 -1
  346. package/dist/toolbar/index.cjs +12 -9
  347. package/dist/toolbar/index.cjs.map +1 -1
  348. package/dist/toolbar/index.d.cts +7 -7
  349. package/dist/toolbar/index.d.ts +7 -7
  350. package/dist/toolbar/index.js +11 -8
  351. package/dist/tooltip/index.cjs +4 -3
  352. package/dist/tooltip/index.cjs.map +1 -1
  353. package/dist/tooltip/index.js +3 -2
  354. package/package.json +4 -2
  355. package/dist/Button.types-BH0CPyPx.d.ts +0 -33
  356. package/dist/Button.types-DZRCVqyN.d.cts +0 -33
  357. package/dist/chunk-35LGEPLP.cjs.map +0 -1
  358. package/dist/chunk-36JFXFM2.cjs.map +0 -1
  359. package/dist/chunk-3KBBJZHK.cjs.map +0 -1
  360. package/dist/chunk-4J25XZDI.js.map +0 -1
  361. package/dist/chunk-5O73AALP.cjs.map +0 -1
  362. package/dist/chunk-75GFIQRU.js.map +0 -1
  363. package/dist/chunk-DA375AI6.cjs +0 -88
  364. package/dist/chunk-DA375AI6.cjs.map +0 -1
  365. package/dist/chunk-DRXPTACG.js.map +0 -1
  366. package/dist/chunk-GWHZFX2H.js.map +0 -1
  367. package/dist/chunk-NEQXEVHM.js +0 -34
  368. package/dist/chunk-NEQXEVHM.js.map +0 -1
  369. package/dist/chunk-O2BECFXJ.cjs.map +0 -1
  370. package/dist/chunk-OOCCSMWM.js.map +0 -1
  371. package/dist/chunk-RHHZRTWM.js.map +0 -1
  372. package/dist/chunk-SNRRF64M.js.map +0 -1
  373. package/dist/chunk-TTLFY76J.cjs.map +0 -1
  374. package/dist/chunk-VQGLVBPL.cjs.map +0 -1
  375. package/dist/chunk-WE2SBWZ6.js.map +0 -1
  376. package/dist/chunk-ZMDZGL5A.cjs +0 -34
  377. package/dist/chunk-ZMDZGL5A.cjs.map +0 -1
  378. package/dist/renderIcon-C2lEMMzb.d.cts +0 -30
  379. package/dist/renderIcon-C2lEMMzb.d.ts +0 -30
  380. /package/dist/{chunk-RHFD2Z5V.js.map → chunk-3TF2GZSG.js.map} +0 -0
  381. /package/dist/{chunk-JHX6JK3M.js.map → chunk-3X6QVHTD.js.map} +0 -0
  382. /package/dist/{chunk-MQAOXZD4.js.map → chunk-4S57PE43.js.map} +0 -0
  383. /package/dist/{chunk-JT4KVXJK.js.map → chunk-4V2XYUQL.js.map} +0 -0
  384. /package/dist/{chunk-AR2ZOO6L.js.map → chunk-6FXFKMJ5.js.map} +0 -0
  385. /package/dist/{chunk-LGDODZHI.js.map → chunk-6LTZV6HN.js.map} +0 -0
  386. /package/dist/{chunk-YP4HUBKN.js.map → chunk-6NAOAKII.js.map} +0 -0
  387. /package/dist/{chunk-D7SQ7LHJ.js.map → chunk-BO3KK3ZQ.js.map} +0 -0
  388. /package/dist/{chunk-5XH2PHT2.js.map → chunk-CNTG7OOO.js.map} +0 -0
  389. /package/dist/{chunk-WNDDS367.js.map → chunk-DPTTDHZ5.js.map} +0 -0
  390. /package/dist/{chunk-BFKPJ627.js.map → chunk-FHOD3FUN.js.map} +0 -0
  391. /package/dist/{chunk-SDUGYJGW.js.map → chunk-H3C6YECZ.js.map} +0 -0
  392. /package/dist/{chunk-MPIVBAMY.js.map → chunk-HYRLK462.js.map} +0 -0
  393. /package/dist/{chunk-FIVMMCGM.js.map → chunk-IHPSRTVW.js.map} +0 -0
  394. /package/dist/{chunk-THCTUBX6.js.map → chunk-IKXXXVUO.js.map} +0 -0
  395. /package/dist/{chunk-24HKKSKX.js.map → chunk-L6ERHCQ2.js.map} +0 -0
  396. /package/dist/{chunk-4LNTZPSQ.js.map → chunk-L6YJ6QTZ.js.map} +0 -0
  397. /package/dist/{chunk-JNY7TUDS.js.map → chunk-MCPGI6EI.js.map} +0 -0
  398. /package/dist/{chunk-2PCCGQOH.js.map → chunk-P6OJQ2RN.js.map} +0 -0
  399. /package/dist/{chunk-YXRKBKFB.js.map → chunk-S5CMZFX6.js.map} +0 -0
  400. /package/dist/{chunk-HEX4IMLO.js.map → chunk-TJQNGJHP.js.map} +0 -0
  401. /package/dist/{chunk-SFFKQQ5Z.js.map → chunk-U4SVBE2M.js.map} +0 -0
  402. /package/dist/{chunk-O3QM3BFE.js.map → chunk-UC4NYF6T.js.map} +0 -0
  403. /package/dist/{chunk-GIEDIAPD.js.map → chunk-V5CM5TH3.js.map} +0 -0
  404. /package/dist/{chunk-L65MHFMD.js.map → chunk-V64DICJK.js.map} +0 -0
  405. /package/dist/{chunk-P4XZH3OR.js.map → chunk-WHQGJHMD.js.map} +0 -0
  406. /package/dist/{chunk-YAKTVIVK.js.map → chunk-XIUZT4TO.js.map} +0 -0
  407. /package/dist/{chunk-GPVGGBIR.js.map → chunk-XWMXEJVZ.js.map} +0 -0
  408. /package/dist/{chunk-A3LMUPG3.js.map → chunk-Z3IJWYUD.js.map} +0 -0
@@ -1,33 +0,0 @@
1
- import { I as IconType } from './renderIcon-C2lEMMzb.cjs';
2
- import { C as ComponentSizeProps } from './sizes-DM6Rrrgq.cjs';
3
-
4
- /** Shared across every Button-family component (Button, ButtonGroup, SplitButton, bulk actions, ...). */
5
- type ButtonVariantProps = 'filled' | 'outlined' | 'text';
6
- /** Shared across every Button-family component (Button, ButtonGroup, SplitButton, bulk actions, ...). */
7
- type ButtonColorProps = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
8
- interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
9
- variant?: ButtonVariantProps;
10
- color?: ButtonColorProps;
11
- size?: ComponentSizeProps;
12
- disabled?: boolean;
13
- loading?: boolean;
14
- className?: string;
15
- tooltip?: string;
16
- }
17
- interface TextButtonProps extends BaseButtonProps {
18
- children: React.ReactNode;
19
- preIcon?: IconType;
20
- posIcon?: IconType;
21
- icon?: never;
22
- loadingText?: string;
23
- }
24
- interface IconButtonProps extends BaseButtonProps {
25
- icon: IconType;
26
- children?: never;
27
- preIcon?: never;
28
- posIcon?: never;
29
- loadingText?: never;
30
- }
31
- type ButtonProps = TextButtonProps | IconButtonProps;
32
-
33
- export type { ButtonColorProps as B, IconButtonProps as I, TextButtonProps as T, ButtonProps as a, ButtonVariantProps as b };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-35LGEPLP.cjs","../src/utils/renderIcon.tsx","../src/utils/devWarn.ts","../src/utils/dualModifier.ts","../src/utils/useDialogFocus.ts","../src/utils/useIsClient.ts"],"names":["active"],"mappings":"AAAA;ACCA,2CAAsB;AAyCT,+CAAA;AAfN,IAAM,WAAA,EAAa,CAAC,IAAA,EAA4B,SAAA,EAAA,GAAwC;AAC7F,EAAA,GAAA,CAAI,CAAC,IAAA,EAAM,OAAO,IAAA;AAElB,EAAA,GAAA,CAAI,OAAO,KAAA,IAAS,QAAA,EAAU;AAE5B,IAAA,MAAM,SAAA,EAAW,IAAA,CACd,KAAA,CAAM,GAAG,CAAA,CACT,GAAA,CAAI,CAAC,IAAA,EAAA,GAAS,IAAA,CAAK,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,CAAY,EAAA,EAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAC,CAAA,CAC1D,IAAA,CAAK,EAAE,CAAA;AA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,MAAA;AACO,MAAA;AAenB,MAAA;AACeA,MAAAA;AAEJ,MAAA;AACT,QAAA;AAC1B,MAAA;AACF,IAAA;AACsC,EAAA;AAC1C;AJtGkD;AACA;AKlHd;AA4CM;AACM,EAAA;AAE9B,EAAA;AACE,IAAA;AACb,EAAA;AAEE,EAAA;AACT;ALuEkD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-35LGEPLP.cjs","sourcesContent":[null,"import React from 'react';\nimport { icons } from 'lucide-react';\n\nexport type IconType = React.ComponentType<{ className?: string }> | string;\n\n/**\n * Helper function to render icons dynamically\n * Supports both React components (Lucide, MUI, etc.) and string-based icon names\n *\n * @param icon - Icon component or string name (e.g., \"heart\" or \"arrow-right\")\n * @param className - Optional CSS class name to apply to the icon\n * @returns React node representing the icon, or null if no icon provided\n *\n * @example\n * // Component-based icon\n * import { Heart } from 'lucide-react';\n * renderIcon(Heart, 'my-icon-class');\n *\n * @example\n * // String-based Lucide icon (kebab-case converted to PascalCase)\n * renderIcon('heart', 'my-icon-class');\n * renderIcon('arrow-right', 'my-icon-class');\n *\n * @example\n * // String-based CSS class (for Font Awesome, Remixicon, etc.)\n * renderIcon('fas fa-heart', 'my-icon-class');\n */\nexport const renderIcon = (icon: IconType | undefined, className?: string): React.ReactNode => {\n if (!icon) return null;\n\n if (typeof icon === 'string') {\n // Convert kebab-case to PascalCase for Lucide icons\n const iconName = icon\n .split('-')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n\n // Try to find the icon in lucide-react\n const LucideIcon = icons[iconName as keyof typeof icons] as\n React.ComponentType<{ className?: string }> | undefined;\n\n if (LucideIcon) {\n return <LucideIcon className={className} aria-hidden=\"true\" />;\n }\n\n // Fallback: render as a CSS class (for Font Awesome, Remixicon, etc.)\n return <i className={`${icon} ${className || ''}`} aria-hidden=\"true\" />;\n }\n\n // It's a React component\n const IconComponent = icon;\n return <IconComponent className={className} aria-hidden=\"true\" />;\n};\n","/**\n * Logs a misconfiguration warning, once per `key`, and never in production.\n *\n * Deliberately reads `process.env.NODE_ENV` off `globalThis` behind a cast\n * rather than referencing `process` directly: this is a browser library, and\n * a bare `process` reference fails the `tsup` dts build (its worker resolves\n * without node types, so `npm run typecheck` passing is not enough) as well\n * as throwing at runtime anywhere a bundler hasn't substituted it. The\n * optional chaining covers every case - no `process`, no `env`, no value.\n *\n * Because the check is dynamic rather than a statically replaceable\n * `process.env.NODE_ENV` expression, the message text stays in production\n * bundles; only the logging is skipped. That is the trade for not shipping a\n * `process` reference at all, and these strings are small.\n */\nconst warned = new Set<string>();\n\nexport function devWarn(key: string, message: string): void {\n const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env\n ?.NODE_ENV;\n if (nodeEnv === 'production') return;\n if (warned.has(key)) return;\n warned.add(key);\n console.warn(`[eidos-ui] ${message}`);\n}\n","/**\n * Emits a BEM modifier in both its canonical kebab-case spelling and a legacy\n * camelCase one.\n *\n * The library shipped two conventions for the same idea: eight components\n * used `--fullWidth` while four used `--full-width`, and `Tabs` had\n * `--hideScrollbar`. Kebab-case is the canonical form - every block name\n * (`eidos-date-picker-trigger`) and every design token (`--font-size-sm`) is\n * already kebab, so a camelCase modifier was inconsistent with the very\n * selector it hung off.\n *\n * Renaming outright would be a **breaking** change: `README.md` presents the\n * `eidos-*` class names as things consumers may target, so a stylesheet out\n * there is matching the old spelling. Emitting both keeps every existing\n * selector working while new code has one spelling to learn.\n *\n * Deliberately a helper rather than a duplicated string literal at each call\n * site: two near-identical classes in a `className` read as a copy-paste slip\n * and invite exactly the \"tidy up\" that would silently break those consumer\n * stylesheets. It also makes dropping the aliases at the next major a change\n * to this one file rather than an edit in every component.\n *\n * Internal only - deliberately not re-exported from `src/index.ts`.\n *\n * @example\n * dualModifier('eidos-input', 'full-width', 'fullWidth');\n * // 'eidos-input--full-width eidos-input--fullWidth'\n */\nexport const dualModifier = (block: string, canonical: string, legacy: string): string =>\n `${block}--${canonical} ${block}--${legacy}`;\n\n/** `dualModifier` preset for the library's most widespread split modifier. */\nexport const fullWidthModifier = (block: string): string =>\n dualModifier(block, 'full-width', 'fullWidth');\n","import { useEffect, type RefObject } from 'react';\n\n/**\n * Focus management for a dialog: move focus in on open, optionally trap Tab\n * inside it, and restore focus to the opener on close.\n *\n * Named for the job rather than the mechanism because the trap is optional.\n * `Popover` declares `aria-modal=\"false\"` - an honest non-modal dialog - so\n * trapping Tab in it would be wrong, but it still needs the other two: its\n * panel is portaled to `document.body`, so without moving focus in, Tab from\n * the trigger goes to whatever follows it in the page and the panel's own\n * controls are unreachable by keyboard entirely.\n *\n * ## Why this exists\n *\n * `Modal`, `Drawer` and `CommandPalette` all rendered\n * `role=\"dialog\" aria-modal=\"true\"` with no focus management whatsoever. That\n * attribute is a **promise to assistive technology that the rest of the page\n * is inert**, and it was false: measured in a browser, focus never entered the\n * dialog, and Tab moved to the page behind the scrim on the first press\n * (Drawer on the second). Drawer additionally dropped focus onto `<body>` when\n * it closed, so a keyboard user was returned to the top of the document.\n *\n * That is WCAG 2.4.3 Focus Order (Level A), and it is invisible to axe - a\n * static snapshot of the DOM looks perfectly correct.\n *\n * ## Nesting\n *\n * Traps register on a module-level stack and only the innermost one acts, so a\n * dialog opened from a dialog behaves correctly. Without this, both listeners\n * fire for the same Tab and fight over where focus lands.\n *\n * ## What this does *not* do\n *\n * It does not mark the background `inert`. A trap plus `aria-modal` is the\n * widely-supported approach and is what screen readers act on; `inert` on\n * every sibling of the portal root would be stronger, but it needs the\n * component to know about DOM it does not own. Worth revisiting if a\n * consumer reports a screen reader escaping the dialog in browse mode.\n */\n\n/**\n * Deliberately not `[tabindex]` in general - that would match `tabindex=\"-1\"`,\n * which is programmatically focusable but explicitly removed from the Tab\n * sequence, so including it would make Tab stop somewhere the user cannot\n * reach by tabbing in the first place.\n */\nexport const FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'details > summary:first-of-type',\n 'iframe',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex^=\"-\"])',\n].join(',');\n\n/**\n * `offsetParent === null` is the usual visibility check and is wrong here: it\n * is also null for `position: fixed` elements, which is exactly what a modal\n * is. `getClientRects()` is empty only when the element genuinely does not\n * render.\n */\nconst isVisible = (element: HTMLElement): boolean =>\n element.getClientRects().length > 0 && getComputedStyle(element).visibility !== 'hidden';\n\nconst getFocusable = (container: HTMLElement): HTMLElement[] =>\n Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (element) => isVisible(element) && element.closest('[aria-hidden=\"true\"]') === null,\n );\n\n/** Innermost trap last. Only the last entry responds to Tab. */\nconst trapStack: HTMLElement[] = [];\n\nexport interface UseDialogFocusOptions {\n /** Focused when the trap activates. Defaults to the first focusable child. */\n initialFocus?: RefObject<HTMLElement | null>;\n /**\n * Whether to return focus to whatever had it when the trap activated.\n * Defaults to `true`; pass `false` when the caller restores focus itself.\n */\n restoreFocus?: boolean;\n /**\n * Whether Tab is confined to the container. Defaults to `true`.\n *\n * Set `false` for a non-modal dialog (`aria-modal=\"false\"`), where the rest\n * of the page stays available and trapping would strand the user.\n */\n trapTab?: boolean;\n}\n\nexport const useDialogFocus = (\n active: boolean,\n containerRef: RefObject<HTMLElement | null>,\n { initialFocus, restoreFocus = true, trapTab = true }: UseDialogFocusOptions = {},\n): void => {\n useEffect(() => {\n const container = containerRef.current;\n if (!active || !container) return;\n\n // Captured before focus moves. The caller must only flip `active` to true\n // once the container is in the DOM - for the animated overlays that means\n // `isOpen && isMounted`, since `isMounted` is set in an effect one render\n // later and the container does not exist before it.\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n trapStack.push(container);\n\n // Moving focus in is retried across a few frames rather than attempted\n // once.\n //\n // These overlays animate open, and `.focus()` on an element that is still\n // `visibility: hidden` is a silent no-op - it does not throw, it just\n // leaves focus where it was. `Modal` sets its `--is-open` class two\n // animation frames after mounting, and the computed style has not caught\n // up at the moment the effect runs, so a single attempt focused nothing\n // and the trap looked broken.\n //\n // Retrying is better than keying off any particular animation: the hook\n // stays ignorant of each component's transition duration, and simply\n // stops as soon as focus has actually landed inside.\n const MAX_FRAMES = 10;\n let frame = 0;\n let attempts = 0;\n\n const tryFocus = () => {\n const target = initialFocus?.current ?? getFocusable(container)[0];\n if (target) {\n target.focus();\n } else {\n // A dialog with nothing focusable in it still must not leave focus on\n // the page behind, so the container takes it. `tabindex=\"-1\"` keeps\n // it out of the Tab sequence while allowing `.focus()`.\n if (!container.hasAttribute('tabindex')) container.setAttribute('tabindex', '-1');\n container.focus();\n }\n\n if (!container.contains(document.activeElement) && attempts < MAX_FRAMES) {\n attempts += 1;\n frame = requestAnimationFrame(tryFocus);\n }\n };\n\n tryFocus();\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Tab') return;\n // Only the innermost trap acts.\n if (trapStack[trapStack.length - 1] !== container) return;\n\n // Re-queried on every Tab rather than cached: dialog contents change\n // (a disabled Confirm button becoming enabled, a list filtering down),\n // and a stale list sends focus to an element that is no longer there.\n const focusable = getFocusable(container);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const activeElement = document.activeElement as HTMLElement | null;\n\n // Focus outside the container - e.g. a click landed on the backdrop.\n // Pull it back in rather than letting Tab continue through the page.\n if (!activeElement || !container.contains(activeElement)) {\n event.preventDefault();\n (event.shiftKey ? last : first).focus();\n return;\n }\n\n if (event.shiftKey && activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n if (trapTab) document.addEventListener('keydown', onKeyDown, true);\n\n return () => {\n cancelAnimationFrame(frame);\n document.removeEventListener('keydown', onKeyDown, true);\n\n const index = trapStack.lastIndexOf(container);\n if (index !== -1) trapStack.splice(index, 1);\n\n // Restore only if focus still belongs to the closing dialog.\n //\n // Two cases count as \"belongs\":\n //\n // 1. Focus is still inside the container.\n // 2. Focus has been lost to `<body>`. When the overlay hides, the\n // browser blurs whatever was focused inside it, so by the time this\n // cleanup runs `activeElement` is often already `<body>` - checking\n // only case 1 meant `CommandPalette` never restored at all.\n //\n // Anything else means something took focus deliberately - a confirm\n // action moving to a new region, say - and stealing it back would be\n // worse than doing nothing.\n const active = document.activeElement;\n const focusIsOurs = container.contains(active) || active === document.body || active === null;\n\n if (restoreFocus && focusIsOurs && previouslyFocused?.isConnected) {\n previouslyFocused.focus();\n }\n };\n }, [active, containerRef, initialFocus, restoreFocus, trapTab]);\n};\n","import { useEffect, useState } from 'react';\n\n/**\n * `false` on the server and on the very first client render, `true` from the\n * first effect onwards.\n *\n * ## Why this exists\n *\n * Every overlay in this library renders through `createPortal(…,\n * document.body)`. A portal is a client-only construct: there is no\n * `document` during `renderToString`, so any overlay that is *already open on\n * its first render* does not merely render oddly - it throws, and takes the\n * whole server render down with it. Measured against the built package:\n *\n * ```\n * renderToString(<Modal isOpen>) ReferenceError: document is not defined\n * renderToString(<Dropdown defaultOpen>) ReferenceError: DOMRect is not defined\n * renderToString(<Select autoOpen>) ReferenceError: DOMRect is not defined\n * ```\n *\n * `Modal`, `Drawer` and `CommandPalette` each keep an `isMounted` flag, which\n * looks like it would prevent this and does not: it is initialised to\n * `useState(isOpen)`, so it is already `true` on the first render. It exists\n * to sequence the open/close *animation*, not to defer the portal.\n *\n * With this hook the server renders nothing for the panel, and the portal\n * appears on the client after mount.\n *\n * ## Why a state flag rather than `typeof document !== 'undefined'`\n *\n * That check is `true` during hydration, so the client's first render would\n * produce the portal while the server's produced nothing - a hydration\n * mismatch, which React resolves by discarding and re-rendering the subtree.\n * A state flag set in an effect makes the first client render agree with the\n * server by construction, and the portal arrive one render later.\n *\n * ## Scope\n *\n * Only for components that can be open on their first render - `Dropdown`\n * (`defaultOpen`), `Popover`, `Modal`, `Drawer`, `CommandPalette`. `Tooltip`,\n * `ContextMenu` and `Snackbar` can only open in response to an event, which\n * cannot happen during a server render, so they need nothing. `check-ssr.js`\n * asserts all of them either way.\n */\nexport const useIsClient = (): boolean => {\n const [isClient, setIsClient] = useState(false);\n\n useEffect(() => {\n setIsClient(true);\n }, []);\n\n return isClient;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-36JFXFM2.cjs","../src/components/ThemeEditor/ThemeEditor.component.tsx"],"names":["ratio","grade"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACvCA,8BAAqF;AACrF,2CAAoD;AAgQ9C,+CAAA;AAhON,IAAM,aAAA,EAAe,gCAAA;AAGrB,IAAM,eAAA,EAAiB,GAAA;AAEvB,IAAM,aAAA,EAA8C;AAAA,EAClD,OAAA,EAAS,SAAA;AAAA,EACT,SAAA,EAAW,WAAA;AAAA,EACX,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,SAAA,EAAW;AACb,CAAA;AAGA,IAAM,OAAA,EAAS,CAAC,GAAA,EAAA,GAAgC,IAAA,IAAQ,WAAA;AAmBxD,IAAM,YAAA,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrC,EAAE,KAAA,EAAO,mCAAA,EAAqC,KAAA,EAAO,8BAAA,CAAa,UAAA,CAAW,WAAY,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AA;AAAC,YAAA;AAAA,cAAA;AACiC,cAAA;AAC3B,cAAA;AACA,cAAA;AACC,cAAA;AACG,cAAA;AACC,cAAA;AACL,cAAA;AACgE,YAAA;AAAA,UAAA;AAEzE,QAAA;AACF,MAAA;AACF,IAAA;AACF,IAAA;AAKG,MAAA;AAGC,MAAA;AAGA,QAAA;AAAC,QAAA;AAAA,UAAA;AACS,UAAA;AACoB,UAAA;AACnB,UAAA;AACD,UAAA;AAEa,QAAA;AAAA,MAAA;AACvB,IAAA;AAEJ,EAAA;AAIR;AAEA;AD7KA;AACA;AACA;AACA","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-36JFXFM2.cjs","sourcesContent":[null,"import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';\nimport { CircleCheck, CircleX, TriangleAlert } from 'lucide-react';\nimport { Alert } from '../Alert';\nimport { Button, IconButton } from '../Button';\nimport { Card } from '../Card';\nimport { ColorPicker } from '../ColorPicker';\nimport { Select } from '../Select';\nimport { Slider } from '../Slider';\nimport { Tooltip } from '../Tooltip';\nimport { useTheme } from '../ThemeProvider';\nimport type { ThemeColorKey, ThemeFontOption } from '../ThemeProvider';\nimport {\n THEME_COLOR_KEYS,\n FONT_SCALE_MAX,\n FONT_SCALE_MIN,\n defaultTheme,\n} from '../ThemeProvider/ThemeProvider.tokens';\nimport {\n CONTRAST_DARK,\n CONTRAST_LIGHT,\n contrastRatio,\n pickContrast,\n} from '../ThemeProvider/ThemeProvider.color';\nimport {\n FONT_ACCEPT,\n isFontStackAvailable,\n registerFontFile,\n subscribeToFontLoads,\n toFontStack,\n} from '../ThemeProvider/ThemeProvider.fonts';\nimport type { ThemeEditorProps } from './ThemeEditor.types';\n\n/** The page surface every diagnostic is measured against - `--white`. */\nconst PAGE_SURFACE = CONTRAST_LIGHT;\n\n/** Below this, a fill is effectively invisible against the page behind it. */\nconst EDGE_MIN_RATIO = 1.5;\n\nconst COLOR_LABELS: Record<ThemeColorKey, string> = {\n primary: 'Primary',\n secondary: 'Secondary',\n success: 'Success',\n danger: 'Danger',\n warning: 'Warning',\n info: 'Info',\n hyperlink: 'Hyperlink',\n};\n\n/** `hyperlink` is only ever text on a surface, so it is graded differently. */\nconst isFill = (key: ThemeColorKey): boolean => key !== 'hyperlink';\n\n/**\n * Built-in stacks, deliberately limited to fonts that can be relied on.\n *\n * A dropdown implies its entries are available, but a font stack is only a list\n * of *names* - nothing here can install a font. So the list is restricted to\n * generic families (guaranteed by CSS), `system-ui` (whatever the OS provides),\n * and the handful of genuinely web-safe faces. Fonts like Inter, which are not\n * installed anywhere by default, were removed: offering one is offering a\n * choice that silently does nothing on most machines.\n *\n * The preset is included because it is the shipped default and therefore has to\n * be representable - and note that `eidos-ui` does not ship the Plus Jakarta\n * Sans file either, so it renders only where the consumer provides it. That is\n * exactly why unavailable options are labelled as such.\n *\n * Anything beyond this belongs to the consuming app, via `fontOptions`.\n */\nconst FONT_STACKS: ThemeFontOption[] = [\n // Taken from the preset rather than retyped, so the shipped default always\n // matches an option exactly. A hand-copied shorter stack did not match, and\n // the row fell back to showing a synthetic \"custom\" entry instead of the\n // name of the font actually in use.\n { label: 'Plus Jakarta Sans (theme default)', value: defaultTheme.typography.fontFamily! },\n { label: 'System UI', value: \"system-ui, -apple-system, 'Segoe UI', sans-serif\" },\n { label: 'Helvetica / Arial', value: 'Helvetica, Arial, sans-serif' },\n { label: 'Georgia', value: \"Georgia, 'Times New Roman', serif\" },\n { label: 'Sans-serif (generic)', value: 'sans-serif' },\n { label: 'Serif (generic)', value: 'serif' },\n];\n\nconst MONO_STACKS: ThemeFontOption[] = [\n { label: 'JetBrains Mono (theme default)', value: defaultTheme.typography.monoFamily! },\n { label: 'Menlo / Consolas', value: 'Menlo, Consolas, monospace' },\n { label: 'Courier New', value: \"'Courier New', Courier, monospace\" },\n { label: 'Monospace (generic)', value: 'monospace' },\n];\n\ntype Grade = 'aa' | 'aa-large' | 'fail';\n\nconst gradeFor = (ratio: number): Grade => (ratio >= 4.5 ? 'aa' : ratio >= 3 ? 'aa-large' : 'fail');\n\n/** Spelled out for the middle grade, which is the one that misleads. */\nconst GRADE_CAVEAT: Partial<Record<Grade, string>> = {\n 'aa-large':\n ' WCAG AA needs 4.5:1 for normal text and allows 3:1 only at 24px or larger - button and label text here is around 12px, so this does not pass.',\n fail: ' Below 3:1, which fails WCAG AA at every text size.',\n};\n\n/**\n * Severity is carried by an icon and the label text, not by colour.\n *\n * These badges cannot use `Pill`, or any themed `--x-color`: the theme being\n * edited also styles this editor, so a washed-out `success` colour would render\n * the \"passes AA\" badge illegible at precisely the moment it is reporting that\n * a colour is illegible. The badge styling comes from the gray ramp, which is\n * deliberately not themeable.\n *\n * Not relying on colour alone also satisfies WCAG 1.4.1 (Use of Colour).\n */\nconst GRADE_BADGE: Record<\n Grade,\n { label: string; icon: React.ComponentType<{ className?: string }> }\n> = {\n aa: { label: 'AA', icon: CircleCheck },\n // Named for what it means in practice, not just for the threshold it clears.\n // WCAG's relaxed 3:1 tier applies only to text at 24px (or 18.7px bold) and\n // above, and nothing in this library is that large - `--font-size-sm` is\n // ~12.25px at the default root size. A bare \"AA large only\" reads as a pass\n // when for every component here it is a fail.\n 'aa-large': { label: 'Too low for body text', icon: TriangleAlert },\n fail: { label: 'Fails AA', icon: CircleX },\n};\n\ninterface Diagnostic {\n grade: Grade;\n ratio: number;\n /** What the ratio describes, for the tooltip. */\n detail: string;\n /** Set when the fill is too close to the page surface to be seen. */\n edgeWarning?: string;\n}\n\nconst diagnose = (key: ThemeColorKey, base: string, explicitContrast?: string): Diagnostic => {\n if (!isFill(key)) {\n // Link text sits on the page, so the page is what it must contrast with.\n const ratio = contrastRatio(base, PAGE_SURFACE);\n const grade = gradeFor(ratio);\n return {\n grade,\n ratio,\n detail: `Link text on the page background: ${ratio.toFixed(2)}:1 against white.${GRADE_CAVEAT[grade] ?? ''}`,\n };\n }\n\n const foreground = explicitContrast ?? pickContrast(base);\n const ratio = contrastRatio(base, foreground);\n const name = foreground.toLowerCase() === CONTRAST_DARK ? 'dark' : 'white';\n const edge = contrastRatio(base, PAGE_SURFACE);\n\n const grade = gradeFor(ratio);\n\n return {\n grade,\n ratio,\n detail: `${name === 'white' ? 'White' : 'Near-black'} text on this fill is ${ratio.toFixed(2)}:1.${\n explicitContrast ? ' Foreground pinned via the theme.' : ''\n }${GRADE_CAVEAT[grade] ?? ''}`,\n edgeWarning:\n edge < EDGE_MIN_RATIO\n ? `Only ${edge.toFixed(2)}:1 against the page background - this fill is barely distinguishable from the page it sits on.`\n : undefined,\n };\n};\n\ninterface FontRowProps {\n label: string;\n /** Stack currently applied, used to pick the matching option. */\n value: string;\n options: ThemeFontOption[];\n mono: boolean;\n allowUpload: boolean;\n onChange: (stack: string) => void;\n onUploaded: (option: ThemeFontOption, file: File, family: string) => void;\n}\n\n/** Pulls the first family out of a stack, unquoted. */\nconst firstFamily = (stack: string): string =>\n stack\n .split(',')[0]\n ?.trim()\n .replace(/^['\"]|['\"]$/g, '') || 'Custom';\n\n/**\n * One font row: a `Select` over the known stacks, an optional upload, and an\n * availability warning.\n *\n * Uses `Select` rather than `Combobox` deliberately. `Combobox` filters its\n * options against the text in the field, and the field holds a full font stack\n * (`'Plus Jakarta Sans', -apple-system, …`) which matches no option label - so\n * the list read \"No results found\" until the text was cleared by hand. A font\n * is a choice from a known set, not a search.\n */\nconst FontRow: React.FC<FontRowProps> = ({\n label,\n value,\n options,\n mono,\n allowUpload,\n onChange,\n onUploaded,\n}) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [error, setError] = useState<string | null>(null);\n\n // Web fonts load asynchronously, so the first render always sees them as\n // unavailable. Without re-checking once they arrive, the row would sit on a\n // stale \"not installed\" warning for a font that is rendering perfectly.\n // The reducer exists only to schedule that re-render; its value is unused.\n const [, onFontsLoaded] = useReducer((count: number) => count + 1, 0);\n useEffect(() => subscribeToFontLoads(onFontsLoaded), [onFontsLoaded]);\n\n const baseOptions = useMemo(() => {\n // A stack the theme carries but that isn't in the list (loaded by the host\n // app, or set programmatically) still needs to be selectable, labelled with\n // its own first family so the row names the font actually in use.\n const known = options.some((o) => o.value === value);\n return known ? options : [...options, { label: `${firstFamily(value)} (custom)`, value }];\n }, [options, value]);\n\n // Probed on every render rather than memoised: availability changes over time\n // as fonts load, so a cached answer is a wrong answer. Four canvas\n // measurements are far cheaper than getting this wrong.\n //\n // Availability is annotated per option rather than filtered or disabled. A\n // theme is shared across machines, so a font present here may be absent for\n // the next user - and vice versa, which would mean hiding a font someone\n // legitimately wants. Annotating keeps every choice selectable while making\n // the list stop implying that a name is a guarantee.\n const selectOptions = baseOptions.map((option) => ({\n id: option.value,\n label: isFontStackAvailable(option.value) ? option.label : `${option.label} - not installed`,\n value: option.value,\n }));\n\n const handleFile = useCallback(\n async (file: File | undefined) => {\n if (!file) return;\n setError(null);\n try {\n const family = await registerFontFile(file);\n const stack = toFontStack(family, mono);\n onUploaded({ label: `${family} (this session)`, value: stack }, file, family);\n onChange(stack);\n } catch (cause) {\n setError(\n cause instanceof Error ? cause.message : 'That file could not be loaded as a font.',\n );\n }\n },\n [mono, onChange, onUploaded],\n );\n\n const unavailable = !isFontStackAvailable(value);\n\n return (\n <div className=\"eidos-theme-editor-row eidos-theme-editor-row--wide\">\n <span className=\"eidos-theme-editor-row__label\">{label}</span>\n\n <div className=\"eidos-theme-editor-row__control\">\n <Select\n options={selectOptions}\n value={value}\n onChange={(next) => onChange(Array.isArray(next) ? next[0] : next)}\n fullWidth\n // The row's visible label is a `<span>`, not a `<label htmlFor>`,\n // so nothing associates it with the control. Naming the input\n // directly keeps the two in step without restructuring the row.\n inputProps={{ 'aria-label': label }}\n />\n </div>\n\n {/* Occasional - lives before the action so it can never displace it. */}\n <div className=\"eidos-theme-editor-row__diagnostics\">\n {unavailable && (\n <Tooltip\n message={`${firstFamily(value)} isn't available here, so the browser is rendering the next family in the stack instead. Upload the file, or have your app serve it, to use it.`}\n >\n <span className=\"eidos-theme-editor-badge eidos-theme-editor-badge--aa-large\">\n <TriangleAlert className=\"eidos-theme-editor-badge__icon\" />\n Not installed\n </span>\n </Tooltip>\n )}\n {error && (\n <Tooltip message={error}>\n <span className=\"eidos-theme-editor-badge eidos-theme-editor-badge--fail\">\n <CircleX className=\"eidos-theme-editor-badge__icon\" />\n Upload failed\n </span>\n </Tooltip>\n )}\n </div>\n\n {allowUpload && (\n <div className=\"eidos-theme-editor-row__actions\">\n <Button\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n preIcon=\"Upload\"\n onClick={() => inputRef.current?.click()}\n tooltip=\"Load a font file to use it right away. Not saved - see onFontUpload to persist it.\"\n >\n Upload\n </Button>\n {/* Plain input rather than FileUpload: this is a single inline\n action in a dense row, not a drop zone. */}\n <input\n ref={inputRef}\n type=\"file\"\n accept={FONT_ACCEPT}\n // Same proxy pattern as `MessageComposer` - see the note there.\n className=\"eidos-theme-editor-file\"\n tabIndex={-1}\n aria-hidden=\"true\"\n onChange={(event) => {\n void handleFile(event.target.files?.[0]);\n // Allow re-picking the same file after a failure.\n event.target.value = '';\n }}\n />\n </div>\n )}\n </div>\n );\n};\n\n/**\n * Live editor for the active `ThemeProvider` theme.\n *\n * Renders no preview of its own: the provider writes tokens to\n * `document.documentElement`, so the surrounding page is the preview.\n *\n * Contrast readouts are diagnostics only - a colour that fails is still\n * applied. Automatically \"correcting\" a chosen colour would mean silently\n * rendering something other than what was picked.\n */\nexport const ThemeEditor: React.FC<ThemeEditorProps> = ({\n colors = THEME_COLOR_KEYS as ThemeColorKey[],\n fontOptions = FONT_STACKS,\n monoFontOptions = MONO_STACKS,\n allowFontUpload = true,\n onFontUpload,\n hideTypography = false,\n hideReset = false,\n hideCssExport = false,\n className,\n}) => {\n const { theme, resolvedTheme, setTheme, updateTheme, resetTheme, isDefault, toCss } = useTheme();\n const [copied, setCopied] = useState(false);\n\n // Fonts registered through the upload control this session. Kept local\n // because font *data* cannot live in a ThemeConfig - see the .mdx.\n const [uploaded, setUploaded] = useState<ThemeFontOption[]>([]);\n const [monoUploaded, setMonoUploaded] = useState<ThemeFontOption[]>([]);\n\n const setColor = useCallback(\n (key: ThemeColorKey, hex: string) => {\n const current = theme.colors?.[key];\n // Only the base is written here. A `contrast` pinned in the theme is\n // preserved rather than dropped, since the editor never sets one.\n const pinned = typeof current === 'object' ? current.contrast : undefined;\n updateTheme({ colors: { [key]: pinned ? { base: hex, contrast: pinned } : hex } });\n },\n [theme.colors, updateTheme],\n );\n\n const resetColor = useCallback(\n (key: ThemeColorKey) => {\n // Must go through setTheme, not updateTheme: updateTheme merges, so a key\n // left out of the patch keeps its existing value instead of being removed.\n // Removal is what restores the preset, since resolveTheme fills gaps.\n const nextColors = { ...theme.colors };\n delete nextColors[key];\n setTheme({ ...theme, colors: nextColors });\n },\n [theme, setTheme],\n );\n\n const diagnostics = useMemo(\n () =>\n colors.map((key) => {\n const { base, contrast } = resolvedTheme.colors[key];\n return { key, base, ...diagnose(key, base, contrast) };\n }),\n [colors, resolvedTheme],\n );\n\n const failing = diagnostics.filter((d) => d.grade === 'fail');\n const invisible = diagnostics.filter((d) => d.edgeWarning);\n\n const copyCss = useCallback(() => {\n const css = toCss();\n const done = () => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1600);\n };\n if (navigator.clipboard?.writeText) {\n navigator.clipboard.writeText(css).then(done, done);\n return;\n }\n done();\n }, [toCss]);\n\n return (\n <div className={['eidos-theme-editor', className].filter(Boolean).join(' ')}>\n {(failing.length > 0 || invisible.length > 0) && (\n <Alert variant=\"warning\" title=\"Contrast issues\">\n {failing.length > 0 && (\n <p>\n Cannot reach WCAG AA (4.5:1) with either foreground:{' '}\n {failing.map((d) => COLOR_LABELS[d.key]).join(', ')}.\n </p>\n )}\n {invisible.length > 0 && (\n <p>\n Too close to the page background to read as a filled surface:{' '}\n {invisible.map((d) => COLOR_LABELS[d.key]).join(', ')}.\n </p>\n )}\n </Alert>\n )}\n\n <Card variant=\"outlined\" padding=\"lg\" className=\"eidos-theme-editor-section\">\n <div className=\"eidos-theme-editor-section__header\">\n <span className=\"eidos-theme-editor-section__title\">Colours</span>\n <span className=\"eidos-theme-editor-section__hint\">\n Shades, tints and foregrounds are derived from each base colour.\n </span>\n </div>\n\n <div className=\"eidos-theme-editor-rows\">\n {diagnostics.map(({ key, base, grade, ratio, detail, edgeWarning }) => {\n const badge = GRADE_BADGE[grade];\n const overridden = theme.colors?.[key] !== undefined;\n return (\n <div className=\"eidos-theme-editor-row\" key={key}>\n <span className=\"eidos-theme-editor-row__label\">{COLOR_LABELS[key]}</span>\n\n {/* `md` rather than `sm`: the size drives the panel's\n saturation/brightness canvas, and 120px is cramped for\n picking a lightness precisely. */}\n <ColorPicker\n value={base}\n onChange={(hex) => setColor(key, hex)}\n size=\"md\"\n // The row draws its own visible label, so the picker must\n // not draw a second one - but without a name of its own\n // every picker here announced as \"Open colour picker\" and\n // they were indistinguishable.\n ariaLabel={COLOR_LABELS[key]}\n />\n\n <div className=\"eidos-theme-editor-row__diagnostics\">\n <Tooltip message={detail}>\n <span className={`eidos-theme-editor-badge eidos-theme-editor-badge--${grade}`}>\n <badge.icon className=\"eidos-theme-editor-badge__icon\" />\n {`${ratio.toFixed(2)}:1 ${badge.label}`}\n </span>\n </Tooltip>\n {edgeWarning && (\n <Tooltip message={edgeWarning}>\n <span className=\"eidos-theme-editor-badge eidos-theme-editor-badge--fail\">\n <CircleX className=\"eidos-theme-editor-badge__icon\" />\n Invisible on page\n </span>\n </Tooltip>\n )}\n </div>\n\n <div className=\"eidos-theme-editor-row__actions\">\n <IconButton\n icon=\"RotateCcw\"\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n disabled={!overridden}\n onClick={() => resetColor(key)}\n tooltip={overridden ? `Reset ${COLOR_LABELS[key]} to the preset` : 'Unchanged'}\n aria-label={`Reset ${COLOR_LABELS[key]}`}\n />\n </div>\n </div>\n );\n })}\n </div>\n </Card>\n\n {!hideTypography && (\n <Card variant=\"outlined\" padding=\"lg\" className=\"eidos-theme-editor-section\">\n <div className=\"eidos-theme-editor-section__header\">\n <span className=\"eidos-theme-editor-section__title\">Typography</span>\n <span className=\"eidos-theme-editor-section__hint\">\n A stack only names a font - upload the file to use one the browser doesn&apos;t\n already have. Spacing is declared in <code>em</code>, so the scale moves padding with\n the text.\n </span>\n </div>\n\n <div className=\"eidos-theme-editor-rows\">\n <FontRow\n label=\"Body font\"\n value={resolvedTheme.typography.fontFamily}\n options={[...fontOptions, ...uploaded]}\n mono={false}\n allowUpload={allowFontUpload}\n onChange={(fontFamily) => updateTheme({ typography: { fontFamily } })}\n onUploaded={(option, file, family) => {\n setUploaded((prev) => [...prev, option]);\n onFontUpload?.(file, family, false);\n }}\n />\n\n <FontRow\n label=\"Mono font\"\n value={resolvedTheme.typography.monoFamily}\n options={[...monoFontOptions, ...monoUploaded]}\n mono\n allowUpload={allowFontUpload}\n onChange={(monoFamily) => updateTheme({ typography: { monoFamily } })}\n onUploaded={(option, file, family) => {\n setMonoUploaded((prev) => [...prev, option]);\n onFontUpload?.(file, family, true);\n }}\n />\n\n <div className=\"eidos-theme-editor-row eidos-theme-editor-row--wide\">\n <span className=\"eidos-theme-editor-row__label\">Scale</span>\n <div className=\"eidos-theme-editor-row__control\">\n <Slider\n value={resolvedTheme.typography.fontScale}\n min={FONT_SCALE_MIN}\n max={FONT_SCALE_MAX}\n step={0.025}\n showValue\n showMinMax\n unit=\"×\"\n onChange={(value) => updateTheme({ typography: { fontScale: value } })}\n />\n </div>\n </div>\n </div>\n </Card>\n )}\n\n {(!hideReset || !hideCssExport) && (\n <div className=\"eidos-theme-editor-actions\">\n {!hideReset && (\n <Button variant=\"outlined\" color=\"secondary\" disabled={isDefault} onClick={resetTheme}>\n Reset all\n </Button>\n )}\n {!hideCssExport && (\n <Button\n variant=\"outlined\"\n preIcon={copied ? 'Check' : 'Clipboard'}\n onClick={copyCss}\n tooltip=\"Copy the resolved tokens as a :root block you can paste into your own stylesheet\"\n >\n {copied ? 'Copied' : 'Copy as CSS'}\n </Button>\n )}\n </div>\n )}\n </div>\n );\n};\n\nThemeEditor.displayName = 'ThemeEditor';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-3KBBJZHK.cjs","../src/components/Header/Header.component.tsx","../src/components/Header/IdentityHeader.component.tsx"],"names":["jsx"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACdA,8BAAiF;AAsFzE,+CAAA;AA/ED,IAAM,OAAA,EAAgC,CAAC;AAAA,EAC5C,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA,EAAU,SAAA;AAAA,EACV,OAAA;AAAA,EACA,qBAAA,EAAuB,GAAA;AAAA,EACvB,4BAAA,EAA8B,CAAA;AAAA,EAC9B,UAAA,EAAY;AACd,CAAA,EAAA,GAAM;AACJ,EAAA,MAAM,QAAA,EAAU,CAAC,cAAA,EAAgB,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAA;AAEd,EAAA;AACG,EAAA;AACQ,EAAA;AASpB,EAAA;AACR,IAAA;AACV,IAAA;AACuC,IAAA;AAC9B,EAAA;AAQH,EAAA;AACO,IAAA;AACR,MAAA;AACjB,MAAA;AACF,IAAA;AAEQ,IAAA;AAEgB,IAAA;AAC+B,IAAA;AAEZ,IAAA;AACnB,IAAA;AACS,IAAA;AACD,EAAA;AAEH,EAAA;AAC0B,EAAA;AACC,EAAA;AAIA,EAAA;AACL,EAAA;AAIrC,EAAA;AACyC,IAAA;AAC3B,EAAA;AAE6C,EAAA;AACZ,IAAA;AACrC,sBAAA;AACD,MAAA;AACvB,IAAA;AAKuD,IAAA;AAClB,MAAA;AAEE,MAAA;AAIvC,IAAA;AAE4C,IAAA;AAC9C,EAAA;AAGiB,EAAA;AACC,oBAAA;AACe,IAAA;AAEtB,IAAA;AAGqC,MAAA;AACf,MAAA;AACL,sBAAA;AAGtB,IAAA;AAEJ,EAAA;AAIyB,EAAA;AASJ,IAAA;AACE,sBAAA;AACd,MAAA;AAGH,IAAA;AAEa,oBAAA;AAEX,MAAA;AAAC,QAAA;AAAA,QAAA;AACS,UAAA;AACM,UAAA;AACJ,UAAA;AACA,UAAA;AAGA,UAAA;AACV,UAAA;AAAA;AAAA;AAGE,4BAAA;AAAC,cAAA;AAAA,cAAA;AACM,gBAAA;AACA,gBAAA;AACG,gBAAA;AACF,gBAAA;AAC+B,gBAAA;AAAA,cAAA;AACvC,YAAA;AAAA,UAAA;AAGa,UAAA;AAEf,QAAA;AACF,MAAA;AAGA,MAAA;AAEJ,IAAA;AAEJ,EAAA;AAEJ;ADpD4D;AACA;AEnFjB;AAdmB;AAC5D,EAAA;AACA,EAAA;AACU,EAAA;AACE,EAAA;AACT,EAAA;AACC;AACiB,EAAA;AACnB,IAAA;AACE,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AAEyCA,EAAAA;AAGvCA,EAAAA;AAAC,IAAA;AAAA,IAAA;AACK,MAAA;AACJ,MAAA;AACO,MAAA;AACyC,MAAA;AAAwB,IAAA;AAC1E,EAAA;AAEJ;AFmG4D;AACA;AACA;AACA;AACA","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-3KBBJZHK.cjs","sourcesContent":[null,"import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { HeaderActionProps, HeaderProps } from './Header.types';\nimport './Header.scss';\nimport { Button } from '../Button';\nimport { Popover } from '../Popover';\nimport { renderIcon } from '../../utils';\n\nexport const Header: React.FC<HeaderProps> = ({\n title,\n subtitle,\n media,\n meta,\n variant = 'default',\n actions,\n collapseActionsBelow = 640,\n actionsVisibleWhenCollapsed = 1,\n className = '',\n}) => {\n const classes = ['eidos-header', `eidos-header--${variant}`, className].filter(Boolean).join(' ');\n\n const rootRef = useRef<HTMLDivElement>(null);\n const [isNarrow, setIsNarrow] = useState(false);\n const [overflowOpen, setOverflowOpen] = useState(false);\n\n // Measures the header's own box rather than the viewport, so the collapse\n // point matches the container queries in Header.scss - a viewport query\n // would disagree with them by the width of PageLayout's navigation rail,\n // which is itself collapsible. The 1px hero border makes this border-box\n // reading differ from the container query's content-box one by 2px; that is\n // far below any threshold worth caring about, and using one measurement for\n // both the initial pass and the observer keeps it to a single code path.\n const measure = useCallback(() => {\n const element = rootRef.current;\n if (!element) return;\n setIsNarrow(element.getBoundingClientRect().width <= collapseActionsBelow);\n }, [collapseActionsBelow]);\n\n // `useLayoutEffect` for the first measurement specifically: ResizeObserver\n // delivers its initial callback asynchronously, so relying on it alone\n // would paint the full action row for a frame before collapsing it. Reading\n // the box synchronously here collapses before paint instead. Nothing runs\n // during SSR, so the server renders the uncollapsed row and hydration\n // matches - the same client-only posture Navigation's `collapseBelow` has.\n useLayoutEffect(() => {\n if (!collapseActionsBelow) {\n setIsNarrow(false);\n return;\n }\n\n measure();\n\n const element = rootRef.current;\n if (!element || typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [collapseActionsBelow, measure]);\n\n const allActions = actions ?? [];\n const keptCount = Math.max(0, actionsVisibleWhenCollapsed);\n const isCollapsed = isNarrow && !!collapseActionsBelow && allActions.length > keptCount;\n\n // The *last* actions stay inline: a primary call to action is conventionally\n // rightmost, which is also how Header's own stories order them.\n const overflowActions = isCollapsed ? allActions.slice(0, allActions.length - keptCount) : [];\n const inlineActions = isCollapsed ? allActions.slice(allActions.length - keptCount) : allActions;\n\n // A portalled popover would otherwise stay on screen after the header grows\n // back past the threshold and its trigger stops being rendered.\n useEffect(() => {\n if (!isCollapsed && overflowOpen) setOverflowOpen(false);\n }, [isCollapsed, overflowOpen]);\n\n const renderOverflowAction = (action: HeaderActionProps, index: number) => {\n const handleClick: HeaderActionProps['onClick'] = (event) => {\n action.onClick?.(event);\n setOverflowOpen(false);\n };\n\n // An icon-only action has no visible label, which is fine in a horizontal\n // row of small buttons and useless in a vertical list. Its tooltip is\n // already the label, so promote it rather than showing a bare glyph.\n if (action.icon && !action.children && action.tooltip) {\n const { icon, tooltip, ...rest } = action;\n return (\n <Button key={index} {...rest} size=\"md\" preIcon={icon} onClick={handleClick}>\n {tooltip}\n </Button>\n );\n }\n\n return <Button key={index} {...action} size=\"md\" onClick={handleClick} />;\n };\n\n const titles = (\n <div className=\"eidos-header__titles\">\n <h1 className=\"eidos-header__title\">{title}</h1>\n {subtitle && <span className=\"eidos-header__subtitle\">{subtitle}</span>}\n {!!meta?.length && (\n <div className=\"eidos-header__meta\">\n {meta.map((item, index) => (\n <span key={index} className=\"eidos-header__meta-item\">\n {item.icon && renderIcon(item.icon, 'eidos-header__meta-icon')}\n {item.label && <span className=\"eidos-header__meta-label\">{item.label}</span>}\n <span className=\"eidos-header__meta-value\">{item.value}</span>\n </span>\n ))}\n </div>\n )}\n </div>\n );\n\n return (\n <div className={classes} ref={rootRef}>\n <div className=\"eidos-header__content\">\n {/* The `__lead` wrapper only exists when there is media to group with\n the titles. Media and titles need a tighter gap than titles and\n actions do, and a flex container has a single gap - but rendering\n the wrapper unconditionally would change the markup for every\n existing consumer, and the `eidos-*` class names are documented as\n targetable. */}\n {media ? (\n <div className=\"eidos-header__lead\">\n <div className=\"eidos-header__media\">{media}</div>\n {titles}\n </div>\n ) : (\n titles\n )}\n <div className=\"eidos-header__actions\">\n {overflowActions.length > 0 && (\n <Popover\n isOpen={overflowOpen}\n onOpenChange={setOverflowOpen}\n placement=\"bottom\"\n maxWidth={260}\n // Popover puts `className` on its trigger wrapper, which is the\n // element that actually becomes a flex item of `__actions`.\n className=\"eidos-header__overflow-trigger\"\n trigger={\n // No `aria-haspopup`/`aria-expanded` here: Popover already\n // sets both on the wrapper it renders around this button.\n <Button\n icon=\"ellipsis\"\n size=\"md\"\n variant=\"outlined\"\n color=\"secondary\"\n aria-label={`${overflowActions.length} more actions`}\n />\n }\n >\n <div className=\"eidos-header__overflow-actions\">\n {overflowActions.map(renderOverflowAction)}\n </div>\n </Popover>\n )}\n {inlineActions.map((action, index) => (\n <Button key={index} size=\"md\" {...action} />\n ))}\n </div>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport type { IdentityHeaderProps } from './IdentityHeader.types';\nimport { Header } from './Header.component';\nimport { Avatar } from '../Avatar';\nimport { devWarn } from '../../utils';\n\n/**\n * `Header` preconfigured for the \"this page is about one person or entity\"\n * shape - an avatar beside the name, supporting facts below it, actions on\n * the end - which account and profile pages share. Settings-style pages want\n * a plain `Header` instead; they have no identity to lead with.\n *\n * Deliberately thin: it pins `variant=\"hero\"`, types the avatar so consumers\n * don't have to import `Avatar` to fill the slot, and gives the shape a name\n * worth discovering. Everything else is `Header`.\n */\nexport const IdentityHeader: React.FC<IdentityHeaderProps> = ({\n avatar,\n media,\n variant = 'hero',\n className = '',\n ...rest\n}) => {\n if (avatar && media) {\n devWarn(\n 'identity-header-avatar-and-media',\n 'IdentityHeader received both `avatar` and `media`. `media` takes precedence - drop `avatar` to silence this.',\n );\n }\n\n const resolvedMedia = media ?? (avatar ? <Avatar size=\"lg\" {...avatar} /> : undefined);\n\n return (\n <Header\n {...rest}\n variant={variant}\n media={resolvedMedia}\n className={['eidos-identity-header', className].filter(Boolean).join(' ')}\n />\n );\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Popover/Popover.component.tsx"],"sourcesContent":["import React, { useState, useRef, useCallback, useEffect, useId } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from 'lucide-react';\nimport type { PopoverProps, PopoverState, PopoverPlacement } from './Popover.types';\nimport { useDialogFocus, useIsClient } from '../../utils';\n\nexport const Popover: React.FC<PopoverProps> = ({\n trigger,\n children,\n title,\n placement: preferredPlacement = 'bottom',\n showCloseButton = false,\n closeOnClickOutside = true,\n closeOnEscape = true,\n disabled = false,\n isOpen,\n open: openProp,\n defaultOpen,\n onOpenChange,\n maxWidth = 320,\n className,\n contentClassName,\n}) => {\n // `isOpen`/`defaultOpen` make the portal reachable on the first render,\n // which cannot happen on a server - see `useIsClient`.\n const isClient = useIsClient();\n\n // ── Controlled / uncontrolled bridge ──────────────────────────────────────\n //\n // `open` is the canonical name, matching `Dropdown` and `CommandPalette`.\n // `isOpen` is the original spelling, kept working rather than renamed out\n // from under anyone.\n const controlledOpen = openProp ?? isOpen;\n const isControlled = controlledOpen !== undefined;\n const [localOpen, setLocalOpen] = useState(defaultOpen ?? false);\n const isVisible = isControlled ? controlledOpen! : localOpen;\n\n // ── Positioning state ─────────────────────────────────────────────────────\n const [popoverState, setPopoverState] = useState<PopoverState>({\n isVisible: false,\n isPositioned: false,\n position: { top: 0, left: 0, placement: preferredPlacement },\n });\n\n // Names the dialog by pointing at the rendered title, the same way `Modal`\n // and `Drawer` do. This was an `aria-label={title ?? 'Popover'}`, which\n // both duplicated the visible text into a second, invisible copy and hard\n // limited `title` to a string - `aria-label` takes only a string, so a\n // `ReactNode` title would have been stringified to \"[object Object]\" and\n // silently destroyed the accessible name.\n const titleId = useId();\n\n // ── Refs ──────────────────────────────────────────────────────────────────\n const triggerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const animationFrameRef = useRef<number | undefined>(undefined);\n const isScrollingRef = useRef(false);\n\n // ── Open / close helpers ──────────────────────────────────────────────────\n const open = useCallback(() => {\n if (disabled) return;\n if (!isControlled) setLocalOpen(true);\n onOpenChange?.(true);\n }, [disabled, isControlled, onOpenChange]);\n\n const close = useCallback(() => {\n if (!isControlled) setLocalOpen(false);\n onOpenChange?.(false);\n }, [isControlled, onOpenChange]);\n\n const toggle = useCallback(() => {\n if (isVisible) {\n close();\n } else {\n open();\n }\n }, [isVisible, open, close]);\n\n // ── Positioning calculation ───────────────────────────────────────────────\n const calculateOptimalPosition = useCallback(\n (triggerRect: DOMRect, contentRect: DOMRect) => {\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const gap = 8;\n\n let placement: PopoverPlacement = preferredPlacement;\n let top = 0;\n let left = 0;\n\n switch (preferredPlacement) {\n case 'top':\n top = triggerRect.top - contentRect.height - gap;\n left = triggerRect.left + triggerRect.width / 2 - contentRect.width / 2;\n break;\n case 'bottom':\n top = triggerRect.bottom + gap;\n left = triggerRect.left + triggerRect.width / 2 - contentRect.width / 2;\n break;\n case 'left':\n top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;\n left = triggerRect.left - contentRect.width - gap;\n break;\n case 'right':\n top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;\n left = triggerRect.right + gap;\n break;\n }\n\n // Flip if it doesn't fit in the preferred direction\n if (placement === 'top' && top < gap) {\n placement = 'bottom';\n top = triggerRect.bottom + gap;\n left = triggerRect.left + triggerRect.width / 2 - contentRect.width / 2;\n } else if (placement === 'bottom' && top + contentRect.height > viewportHeight - gap) {\n placement = 'top';\n top = triggerRect.top - contentRect.height - gap;\n left = triggerRect.left + triggerRect.width / 2 - contentRect.width / 2;\n } else if (placement === 'left' && left < gap) {\n placement = 'right';\n top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;\n left = triggerRect.right + gap;\n } else if (placement === 'right' && left + contentRect.width > viewportWidth - gap) {\n placement = 'left';\n top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;\n left = triggerRect.left - contentRect.width - gap;\n }\n\n // Clamp to viewport\n top = Math.max(gap, Math.min(top, viewportHeight - contentRect.height - gap));\n left = Math.max(gap, Math.min(left, viewportWidth - contentRect.width - gap));\n\n return { top, left, placement };\n },\n [preferredPlacement],\n );\n\n // ── Sync isVisible → popoverState ─────────────────────────────────────────\n useEffect(() => {\n if (isVisible) {\n setPopoverState((prev) => ({ ...prev, isVisible: true, isPositioned: false }));\n } else {\n setPopoverState((prev) => ({ ...prev, isVisible: false, isPositioned: false }));\n }\n }, [isVisible]);\n\n // ── Two-pass positioning (Pass 2: measure then commit) ────────────────────\n useEffect(() => {\n if (\n popoverState.isVisible &&\n !popoverState.isPositioned &&\n contentRef.current &&\n triggerRef.current\n ) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const contentRect = contentRef.current.getBoundingClientRect();\n\n const { top, left, placement } = calculateOptimalPosition(triggerRect, contentRect);\n\n setPopoverState((prev) => ({\n ...prev,\n position: { top, left, placement },\n isPositioned: true,\n }));\n }\n // `isClient` for the same reason as `Dropdown`: with `defaultOpen` the\n // portal arrives one render after this effect first runs, and without it in\n // the deps the panel is never measured and never becomes visible.\n }, [popoverState.isVisible, popoverState.isPositioned, calculateOptimalPosition, isClient]);\n\n // ── Scroll repositioning ─────────────────────────────────────────────────\n const handleScroll = useCallback(() => {\n if (!popoverState.isVisible || !popoverState.isPositioned || isScrollingRef.current) return;\n\n isScrollingRef.current = true;\n\n animationFrameRef.current = requestAnimationFrame(() => {\n if (triggerRef.current && contentRef.current) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const contentRect = contentRef.current.getBoundingClientRect();\n\n const { top, left, placement } = calculateOptimalPosition(triggerRect, contentRect);\n\n setPopoverState((prev) => ({\n ...prev,\n position: { top, left, placement },\n }));\n }\n\n isScrollingRef.current = false;\n });\n }, [popoverState.isVisible, popoverState.isPositioned, calculateOptimalPosition]);\n\n // ── Resize repositioning ──────────────────────────────────────────────────\n useEffect(() => {\n const handleResize = () => {\n if (\n popoverState.isVisible &&\n popoverState.isPositioned &&\n contentRef.current &&\n triggerRef.current\n ) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const contentRect = contentRef.current.getBoundingClientRect();\n\n const { top, left, placement } = calculateOptimalPosition(triggerRect, contentRect);\n\n setPopoverState((prev) => ({\n ...prev,\n position: { top, left, placement },\n }));\n }\n };\n\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [popoverState.isVisible, popoverState.isPositioned, calculateOptimalPosition]);\n\n // ── Scroll listener registration ─────────────────────────────────────────\n useEffect(() => {\n if (popoverState.isVisible) {\n // Capture phase on `document` - see the note in `Dropdown`. `scroll` does\n // not bubble, so listeners on `window`/`document.body` miss every\n // ancestor scroll container and the portaled panel detaches from its\n // trigger.\n document.addEventListener('scroll', handleScroll, { capture: true, passive: true });\n }\n\n return () => {\n document.removeEventListener('scroll', handleScroll, { capture: true });\n };\n }, [popoverState.isVisible, handleScroll]);\n\n // ── Click-outside handler ─────────────────────────────────────────────────\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!closeOnClickOutside || !popoverState.isVisible) return;\n\n const target = event.target as Node;\n\n if (contentRef.current?.contains(target) || triggerRef.current?.contains(target)) {\n return;\n }\n\n close();\n },\n [closeOnClickOutside, popoverState.isVisible, close],\n );\n\n // ── Escape key handler ────────────────────────────────────────────────────\n const handleEscapeKey = useCallback(\n (event: KeyboardEvent) => {\n if (closeOnEscape && event.key === 'Escape' && popoverState.isVisible) {\n close();\n }\n },\n [closeOnEscape, popoverState.isVisible, close],\n );\n\n // ── Register global event listeners ──────────────────────────────────────\n useEffect(() => {\n if (popoverState.isVisible) {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleEscapeKey);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleEscapeKey);\n };\n }, [popoverState.isVisible, handleClickOutside, handleEscapeKey]);\n\n // ── Cleanup on unmount ────────────────────────────────────────────────────\n useEffect(() => {\n const timeoutId = timeoutRef.current;\n const animationFrameId = animationFrameRef.current;\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (animationFrameId) {\n cancelAnimationFrame(animationFrameId);\n }\n };\n }, []);\n\n // Non-modal focus handling: move focus into the panel and return it to the\n // trigger on close, but leave Tab free.\n //\n // `trapTab: false` because this dialog is honestly `aria-modal=\"false\"` -\n // the rest of the page stays available, so confining Tab would strand the\n // user. Moving focus in is still required: the panel is portaled to\n // `document.body`, so Tab from the trigger continues into whatever follows\n // it in the page and the panel's own controls cannot be reached at all.\n //\n // Keyed to `isPositioned`, not `isVisible`: the panel renders off-screen\n // for one frame while its placement is measured, and focusing it in that\n // state scrolls the page to wherever it was parked.\n useDialogFocus(popoverState.isVisible && popoverState.isPositioned, contentRef, {\n trapTab: false,\n });\n\n // ── Render ────────────────────────────────────────────────────────────────\n return (\n <>\n {/* Trigger wrapper.\n\n The wrapper carries no ARIA. It had `aria-expanded` and\n `aria-haspopup` while having no role, which is invalid - both need\n a role that supports them, and adding `role=\"button\"` here would be\n worse still, since the trigger inside is usually a real button\n (that is the `nested-interactive` shape already fixed on\n `Dropdown`).\n\n Instead the state is cloned onto the trigger element, which is the\n thing a user actually activates. Guarded by `isValidElement`\n because `trigger` is typed as `ReactNode` and may be a bare string,\n in which case there is nothing to annotate and the wrapper stays\n exactly as it was. */}\n <div\n ref={triggerRef}\n className={['eidos-popover-trigger', className].filter(Boolean).join(' ')}\n onClick={toggle}\n >\n {React.isValidElement(trigger)\n ? React.cloneElement(trigger as React.ReactElement<Record<string, unknown>>, {\n 'aria-expanded': popoverState.isVisible,\n 'aria-haspopup': 'dialog',\n })\n : trigger}\n </div>\n\n {/* Portal: floating panel */}\n {isClient &&\n popoverState.isVisible &&\n createPortal(\n <div\n ref={contentRef}\n role=\"dialog\"\n aria-modal=\"false\"\n aria-labelledby={title ? titleId : undefined}\n // Only the untitled case still needs a literal label - there is\n // no visible text to point at.\n aria-label={title ? undefined : 'Popover'}\n className={[\n 'eidos-popover-content',\n `eidos-popover-content--${popoverState.position.placement}`,\n popoverState.isPositioned ? 'eidos-popover-content--visible' : '',\n contentClassName,\n ]\n .filter(Boolean)\n .join(' ')}\n style={{\n top: popoverState.position.top,\n left: popoverState.position.left,\n maxWidth: maxWidth,\n }}\n >\n {(title || showCloseButton) && (\n <div className=\"eidos-popover-header\">\n {title && (\n <span id={titleId} className=\"eidos-popover-title\">\n {title}\n </span>\n )}\n {showCloseButton && (\n <button\n type=\"button\"\n className=\"eidos-popover-close\"\n onClick={close}\n aria-label=\"Close popover\"\n >\n <X aria-hidden=\"true\" />\n </button>\n )}\n </div>\n )}\n <div className=\"eidos-popover-body\">{children}</div>\n </div>,\n document.body,\n )}\n </>\n );\n};\n\nPopover.displayName = 'Popover';\n"],"mappings":";;;;;;AAAA,OAAO,SAAS,UAAU,QAAQ,aAAa,WAAW,aAAa;AACvE,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AA8Sd,mBAeE,KAwCQ,YAvDV;AA1SG,IAAM,UAAkC,CAAC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,qBAAqB;AAAA,EAChC,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AAGJ,QAAM,WAAW,YAAY;AAO7B,QAAM,iBAAiB,YAAY;AACnC,QAAM,eAAe,mBAAmB;AACxC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,eAAe,KAAK;AAC/D,QAAM,YAAY,eAAe,iBAAkB;AAGnD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAuB;AAAA,IAC7D,WAAW;AAAA,IACX,cAAc;AAAA,IACd,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,WAAW,mBAAmB;AAAA,EAC7D,CAAC;AAQD,QAAM,UAAU,MAAM;AAGtB,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,aAAa,OAAkD,MAAS;AAC9E,QAAM,oBAAoB,OAA2B,MAAS;AAC9D,QAAM,iBAAiB,OAAO,KAAK;AAGnC,QAAM,OAAO,YAAY,MAAM;AAC7B,QAAI,SAAU;AACd,QAAI,CAAC,aAAc,cAAa,IAAI;AACpC,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,UAAU,cAAc,YAAY,CAAC;AAEzC,QAAM,QAAQ,YAAY,MAAM;AAC9B,QAAI,CAAC,aA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;AAAA,QACxE,SAAS;AAAA,QAER,gBAAM,eAAe,OAAO,IACzB,MAAM,aAAa,SAAwD;AAAA,UACzE,iBAAiB,aAAa;AAAA,UAC9B,iBAAiB;AAAA,QACnB,CAAC,IACD;AAAA;AAAA,IACN;AAAA,IAGC,YACC,aAAa,aACb;AAAA,MACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,MAAK;AAAA,UACL,cAAW;AAAA,UACX,mBAAiB,QAAQ,UAAU;AAAA,UAGnC,cAAY,QAAQ,SAAY;AAAA,UAChC,WAAW;AAAA,YACT;AAAA,YACA,0BAA0B,aAAa,SAAS,SAAS;AAAA,YACzD,aAAa,eAAe,mCAAmC;AAAA,YAC/D;AAAA,UACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,UACX,OAAO;AAAA,YACL,KAAK,aAAa,SAAS;AAAA,YAC3B,MAAM,aAAa,SAAS;AAAA,YAC5B;AAAA,UACF;AAAA,UAEE;AAAA,sBAAS,oBACT,qBAAC,SAAI,WAAU,wBACZ;AAAA,uBACC,oBAAC,UAAK,IAAI,SAAS,WAAU,uBAC1B,iBACH;AAAA,cAED,mBACC;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,SAAS;AAAA,kBACT,cAAW;AAAA,kBAEX,8BAAC,KAAE,eAAY,QAAO;AAAA;AAAA,cACxB;AAAA,eAEJ;AAAA,YAEF,oBAAC,SAAI,WAAU,sBAAsB,UAAS;AAAA;AAAA;AAAA,MAChD;AAAA,MACA,SAAS;AAAA,IACX;AAAA,KACJ;AAEJ;AAEA,QAAQ,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-5O73AALP.cjs","../src/components/Breadcrumb/Breadcrumb.component.tsx"],"names":[],"mappings":"AAAA;ACwBc,+CAAA;AArBP,IAAM,WAAA,EAAwC,CAAC;AAAA,EACpD,KAAA;AAA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yB,QAAA,EAAA,IAAA,CAAK,KAAA,CAAK,CAAA;AAAA,cAChE,IAAA,CAAK;AAAA,YAAA,EAAA,CACR,EAAA,kBAEA,8BAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,QAAA;AAAA,gBACL,OAAA,EAAS,IAAA,CAAK,OAAA;AAAA,gBACd,SAAA,EAAU,qDAAA;AAAA,gBAET,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAK,KAAA,mBAAQ,6BAAA,MAAC,EAAA,EAAK,SAAA,EAAU,uBAAA,EAAyB,QAAA,EAAA,IAAA,CAAK,KAAA,CAAK,CAAA;AAAA,kBAChE,IAAA,CAAK;AAAA,gBAAA;AAAA,cAAA;AAAA,YACR,CAAA;AAAA,YAGD,CAAC,OAAA,mBACA,6BAAA,MAAC,EAAA,EAAK,aAAA,EAAY,MAAA,EAAO,SAAA,EAAU,4BAAA,EAChC,QAAA,EAAA,UAAA,CACH;AAAA,UAAA;AAAA,QAAA,CAAA;AAAA,QA7BG;AAAA,MA+BP,CAAA;AAAA,IAEJ,CAAC,EAAA,CACH;AAAA,EAAA;AACF,CAAA;AAGF,UAAA,CAAW,YAAA,EAAc,YAAA;ADXzB;AACA;AACE;AACF,gCAAC","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-5O73AALP.cjs","sourcesContent":[null,"import React from 'react';\nimport type { BreadcrumbProps } from './Breadcrumb.types';\n\nexport const Breadcrumb: React.FC<BreadcrumbProps> = ({\n items,\n separator = '/',\n className = '',\n}) => (\n <nav\n aria-label=\"Breadcrumb\"\n className={['eidos-breadcrumb-nav', className].filter(Boolean).join(' ')}\n >\n <ol className=\"eidos-breadcrumb\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n\n return (\n <li\n key={index}\n className={['eidos-breadcrumb-item', isLast && 'eidos-breadcrumb-item--current']\n .filter(Boolean)\n .join(' ')}\n >\n {isLast ? (\n <span aria-current=\"page\" className=\"eidos-breadcrumb-current\">\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </span>\n ) : item.href ? (\n <a href={item.href} onClick={item.onClick} className=\"eidos-breadcrumb-link\">\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={item.onClick}\n className=\"eidos-breadcrumb-link eidos-breadcrumb-link--button\"\n >\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </button>\n )}\n\n {!isLast && (\n <span aria-hidden=\"true\" className=\"eidos-breadcrumb-separator\">\n {separator}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n);\n\nBreadcrumb.displayName = 'Breadcrumb';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Button/Button.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LoaderCircle } from 'lucide-react';\nimport { Tooltip } from '../Tooltip';\nimport { ButtonProps, IconButtonProps } from './Button.types';\nimport { renderIcon, devWarn } from '../../utils';\n\nexport const Button: React.FC<ButtonProps> = ({\n variant = 'filled',\n color = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n loadingText = 'Loading...',\n tooltip,\n className = '',\n preIcon,\n posIcon,\n icon,\n children,\n ...buttonProps\n}) => {\n const isIconOnly = !!icon;\n\n if (isIconOnly) {\n if (children) {\n throw new Error('Icon-only buttons cannot have children');\n }\n if (preIcon) {\n throw new Error('Icon-only buttons cannot have preIcon');\n }\n if (posIcon) {\n throw new Error('Icon-only buttons cannot have posIcon');\n }\n }\n\n // ── Accessible name for icon-only buttons ──────────────────────────────\n //\n // An icon-only button has no text, so without `aria-label` it is announced\n // as just \"button\". `tooltip` alone did NOT fix this: `Tooltip` renders a\n // floating panel and adds no naming attributes to its child, so the\n // library's own documented example - `<IconButton icon={Plus}\n // tooltip=\"Add item\" />` - shipped a nameless control.\n //\n // Falling back to `tooltip` makes that documented pattern correct without\n // asking anyone to change their code: if you already described the button\n // for sighted users, that description now names it for everyone.\n //\n // Only ever a fallback - an explicit `aria-label` or `aria-labelledby`\n // always wins, since the caller may want a longer name than the tooltip.\n const suppliedLabel = buttonProps['aria-label'] ?? buttonProps['aria-labelledby'];\n const iconOnlyLabel = isIconOnly && !suppliedLabel ? tooltip : undefined;\n\n if (isIconOnly && !suppliedLabel && !tooltip) {\n devWarn(\n 'button-icon-only-name',\n 'Button: an icon-only button needs an accessible name. Pass `tooltip` (which now also names it) or `aria-label`, otherwise it is announced as just \"button\".',\n );\n }\n\n const buttonClasses = [\n 'eidos-button',\n `eidos-button--${variant}`,\n `eidos-button--${color}`,\n `eidos-button--${size}`,\n isIconOnly && 'eidos-button--icon-only',\n disabled && 'eidos-button--disabled',\n loading && 'eidos-button--loading',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const buttonContent = (\n <button\n type=\"button\"\n {...buttonProps}\n aria-label={iconOnlyLabel ?? buttonProps['aria-label']}\n className={buttonClasses}\n disabled={disabled || loading}\n >\n {loading ? (\n <>\n {!isIconOnly && (\n <>\n <span className=\"eidos-button--loading-spinner\">\n <LoaderCircle className=\"eidos-button--spinner-icon\" />\n </span>\n <span className=\"eidos-button--copy\">{loadingText}</span>\n </>\n )}\n {isIconOnly && (\n <span className=\"eidos-button--loading-spinner\">\n <LoaderCircle className=\"eidos-button--spinner-icon\" />\n </span>\n )}\n </>\n ) : (\n <>\n {preIcon && renderIcon(preIcon, 'eidos-button--pre-icon')}\n\n {isIconOnly && icon ? (\n renderIcon(icon, 'eidos-button--icon')\n ) : (\n <span className=\"eidos-button--copy\">{children}</span>\n )}\n\n {posIcon && renderIcon(posIcon, 'eidos-button--pos-icon')}\n </>\n )}\n </button>\n );\n\n return tooltip ? <Tooltip message={tooltip}>{buttonContent}</Tooltip> : buttonContent;\n};\n\n/**\n * IconButton - Convenience wrapper for icon-only buttons\n *\n * @example\n * ```tsx\n * import { IconButton } from 'eidos-ui';\n * import { Plus } from 'lucide-react';\n *\n * <IconButton icon={Plus} tooltip=\"Add item\" />\n * ```\n */\nexport const IconButton: React.FC<IconButtonProps> = (props) => {\n return <Button {...props} />;\n};\n"],"mappings":";;;;;;;;;AACA,SAAS,oBAAoB;AAkFjB,mBAEI,KAFJ;AA7EL,IAAM,SAAgC,CAAC;AAAA,EAC5C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,UAAU;AAAA,EACV,cAAc;AAAA,EACd;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,aAAa,CAAC,CAAC;AAErB,MAAI,YAAY;AACd,QAAI,UAAU;AACZ,YAAM,IAAI,MAAM,wCAAwC;AAAA,IAC1D;AACA,QAAI,SAAS;AACX,YAAM,IAAI,MAAM,uCAAuC;AAAA,IACzD;AACA,QAAI,SAAS;AACX,YAAM,IAAI,MAAM,uCAAuC;AAAA,IACzD;AAAA,EACF;AAgBA,QAAM,gBAAgB,YAAY,YAAY,KAAK,YAAY,iBAAiB;AAChF,QAAM,gBAAgB,cAAc,CAAC,gBAAgB,UAAU;AAE/D,MAAI,cAAc,CAAC,iBAAiB,CAAC,SAAS;AAC5C;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,iBAAiB,OAAO;AAAA,IACxB,iBAAiB,KAAK;AAAA,IACtB,iBAAiB,IAAI;AAAA,IACrB,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,WAAW;AAAA,IACX;AAAA,EACF,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,QAAM,gBACJ;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACJ,GAAG;AAAA,MACJ,cAAY,iBAAiB,YAAY,YAAY;AAAA,MACrD,WAAW;AAAA,MACX,UAAU,YAAY;AAAA,MAErB,oBACC,iCACG;AAAA,SAAC,cACA,iCACE;AAAA,8BAAC,UAAK,WAAU,iCACd,8BAAC,gBAAa,WAAU,8BAA6B,GACvD;AAAA,UACA,oBAAC,UAAK,WAAU,sBAAsB,uBAAY;AAAA,WACpD;AAAA,QAED,cACC,oBAAC,UAAK,WAAU,iCACd,8BAAC,gBAAa,WAAU,8BAA6B,GACvD;AAAA,SAEJ,IAEA,iCACG;AAAA,mBAAW,WAAW,SAAS,wBAAwB;AAAA,QAEvD,cAAc,OACb,WAAW,MAAM,oBAAoB,IAErC,oBAAC,UAAK,WAAU,sBAAsB,UAAS;AAAA,QAGhD,WAAW,WAAW,SAAS,wBAAwB;AAAA,SAC1D;AAAA;AAAA,EAEJ;AAGF,SAAO,UAAU,oBAAC,WAAQ,SAAS,SAAU,yBAAc,IAAa;AAC1E;AAaO,IAAM,aAAwC,CAAC,UAAU;AAC9D,SAAO,oBAAC,UAAQ,GAAG,OAAO;AAC5B;","names":[]}
@@ -1,88 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkBEOECPVJcjs = require('./chunk-BEOECPVJ.cjs');
4
-
5
-
6
-
7
- var _chunk35LGEPLPcjs = require('./chunk-35LGEPLP.cjs');
8
-
9
- // src/components/Button/Button.component.tsx
10
- var _lucidereact = require('lucide-react');
11
- var _jsxruntime = require('react/jsx-runtime');
12
- var Button = ({
13
- variant = "filled",
14
- color = "primary",
15
- size = "md",
16
- disabled = false,
17
- loading = false,
18
- loadingText = "Loading...",
19
- tooltip,
20
- className = "",
21
- preIcon,
22
- posIcon,
23
- icon,
24
- children,
25
- ...buttonProps
26
- }) => {
27
- const isIconOnly = !!icon;
28
- if (isIconOnly) {
29
- if (children) {
30
- throw new Error("Icon-only buttons cannot have children");
31
- }
32
- if (preIcon) {
33
- throw new Error("Icon-only buttons cannot have preIcon");
34
- }
35
- if (posIcon) {
36
- throw new Error("Icon-only buttons cannot have posIcon");
37
- }
38
- }
39
- const suppliedLabel = _nullishCoalesce(buttonProps["aria-label"], () => ( buttonProps["aria-labelledby"]));
40
- const iconOnlyLabel = isIconOnly && !suppliedLabel ? tooltip : void 0;
41
- if (isIconOnly && !suppliedLabel && !tooltip) {
42
- _chunk35LGEPLPcjs.devWarn.call(void 0,
43
- "button-icon-only-name",
44
- 'Button: an icon-only button needs an accessible name. Pass `tooltip` (which now also names it) or `aria-label`, otherwise it is announced as just "button".'
45
- );
46
- }
47
- const buttonClasses = [
48
- "eidos-button",
49
- `eidos-button--${variant}`,
50
- `eidos-button--${color}`,
51
- `eidos-button--${size}`,
52
- isIconOnly && "eidos-button--icon-only",
53
- disabled && "eidos-button--disabled",
54
- loading && "eidos-button--loading",
55
- className
56
- ].filter(Boolean).join(" ");
57
- const buttonContent = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
58
- "button",
59
- {
60
- type: "button",
61
- ...buttonProps,
62
- "aria-label": _nullishCoalesce(iconOnlyLabel, () => ( buttonProps["aria-label"])),
63
- className: buttonClasses,
64
- disabled: disabled || loading,
65
- children: loading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
66
- !isIconOnly && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
67
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "eidos-button--loading-spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircle, { className: "eidos-button--spinner-icon" }) }),
68
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "eidos-button--copy", children: loadingText })
69
- ] }),
70
- isIconOnly && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "eidos-button--loading-spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircle, { className: "eidos-button--spinner-icon" }) })
71
- ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
72
- preIcon && _chunk35LGEPLPcjs.renderIcon.call(void 0, preIcon, "eidos-button--pre-icon"),
73
- isIconOnly && icon ? _chunk35LGEPLPcjs.renderIcon.call(void 0, icon, "eidos-button--icon") : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "eidos-button--copy", children }),
74
- posIcon && _chunk35LGEPLPcjs.renderIcon.call(void 0, posIcon, "eidos-button--pos-icon")
75
- ] })
76
- }
77
- );
78
- return tooltip ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBEOECPVJcjs.Tooltip, { message: tooltip, children: buttonContent }) : buttonContent;
79
- };
80
- var IconButton = (props) => {
81
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { ...props });
82
- };
83
-
84
-
85
-
86
-
87
- exports.Button = Button; exports.IconButton = IconButton;
88
- //# sourceMappingURL=chunk-DA375AI6.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-DA375AI6.cjs","../src/components/Button/Button.component.tsx"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACPA,2CAA6B;AAkFjB,+CAAA;AA7EL,IAAM,OAAA,EAAgC,CAAC;AAAA,EAC5C,QAAA,EAAU,QAAA;AAAA,EACV,MAAA,EAAQ,SAAA;AAAA,EACR,KAAA,EAAO,IAAA;AAAA,EACP,SAAA,EAAW,KAAA;AAAA,EACX,QAAA,EAAU,KAAA;AAAA,EACV,YAAA,EAAc,YAAA;AAAA,EACd,OAAA;AAAA,EACA,UAAA,EAAY,EAAA;AAAA,EACZ,OAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAA,GAAM;AACJ,EAAA,MAAM,WAAA,EAAa,CAAC,CAAC,IAAA;AAErB,EAAA,GAAA,CAAI,UAAA,EAAY;AACd,IAAA,GAAA,CAAI,QAAA,EAAU;AACZ,MAAA,MAAM,IAAI,KAAA,CAAM,wCAAwC,CAAA;AAAA,IAC1D;AACA,IAAA,GAAA,CAAI,OAAA,EAAS;AACX,MAAA,MAAM,IAAI,KAAA,CAAM,uCAAuC,CAAA;AAAA,IACzD;AACA,IAAA,GAAA,CAAI,OAAA,EAAS;AACX,MAAA,MAAM,IAAI,KAAA,CAAM,uCAAuC,CAAA;AAAA,IACzD;AAAA,EACF;AAgBA,EAAA,MAAM,cAAA,mBAAgB,WAAA,CAAY,YAAY,CAAA,UAAK,WAAA,CAAY,iBAAiB,GAAA;AAChF,EAAA,MAAM,cAAA,EAAgB,WAAA,GAAc,CAAC,cAAA,EAAgB,QAAA,EAAU,KAAA,CAAA;AAE/D,EAAA,GAAA,CAAI,WAAA,GAAc,CAAC,cAAA,GAAiB,CAAC,OAAA,EAAS;AAC5C,IAAA,uCAAA;AAAA,MACE,uBAAA;AAAA,MACA;AAAA,IACF,CAAA;AAAA,EACF;AAEA,EAAA,MAAM,cAAA,EAAgB;AAAA,IACpB,cAAA;AAAA,IACA,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAA;AACF,IAAA;AACD,IAAA;AACP,IAAA;AACF,IAAA;AACD,IAAA;AACX,IAAA;AAGS,EAAA;AAGT,EAAA;AAAC,IAAA;AAAA,IAAA;AACM,MAAA;AACD,MAAA;AACQ,MAAA;AACD,MAAA;AACW,MAAA;AAGpB,MAAA;AAEI,QAAA;AACE,0BAAA;AAGA,0BAAA;AACF,QAAA;AAGA,QAAA;AAMJ,MAAA;AACc,QAAA;AAGV,QAAA;AAKU,QAAA;AACd,MAAA;AAAA,IAAA;AAEJ,EAAA;AAGe,EAAA;AACnB;AAagE;AACtD,EAAA;AACV;AD9C6B;AACA;AACA;AACA;AACA","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-DA375AI6.cjs","sourcesContent":[null,"import React from 'react';\nimport { LoaderCircle } from 'lucide-react';\nimport { Tooltip } from '../Tooltip';\nimport { ButtonProps, IconButtonProps } from './Button.types';\nimport { renderIcon, devWarn } from '../../utils';\n\nexport const Button: React.FC<ButtonProps> = ({\n variant = 'filled',\n color = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n loadingText = 'Loading...',\n tooltip,\n className = '',\n preIcon,\n posIcon,\n icon,\n children,\n ...buttonProps\n}) => {\n const isIconOnly = !!icon;\n\n if (isIconOnly) {\n if (children) {\n throw new Error('Icon-only buttons cannot have children');\n }\n if (preIcon) {\n throw new Error('Icon-only buttons cannot have preIcon');\n }\n if (posIcon) {\n throw new Error('Icon-only buttons cannot have posIcon');\n }\n }\n\n // ── Accessible name for icon-only buttons ──────────────────────────────\n //\n // An icon-only button has no text, so without `aria-label` it is announced\n // as just \"button\". `tooltip` alone did NOT fix this: `Tooltip` renders a\n // floating panel and adds no naming attributes to its child, so the\n // library's own documented example - `<IconButton icon={Plus}\n // tooltip=\"Add item\" />` - shipped a nameless control.\n //\n // Falling back to `tooltip` makes that documented pattern correct without\n // asking anyone to change their code: if you already described the button\n // for sighted users, that description now names it for everyone.\n //\n // Only ever a fallback - an explicit `aria-label` or `aria-labelledby`\n // always wins, since the caller may want a longer name than the tooltip.\n const suppliedLabel = buttonProps['aria-label'] ?? buttonProps['aria-labelledby'];\n const iconOnlyLabel = isIconOnly && !suppliedLabel ? tooltip : undefined;\n\n if (isIconOnly && !suppliedLabel && !tooltip) {\n devWarn(\n 'button-icon-only-name',\n 'Button: an icon-only button needs an accessible name. Pass `tooltip` (which now also names it) or `aria-label`, otherwise it is announced as just \"button\".',\n );\n }\n\n const buttonClasses = [\n 'eidos-button',\n `eidos-button--${variant}`,\n `eidos-button--${color}`,\n `eidos-button--${size}`,\n isIconOnly && 'eidos-button--icon-only',\n disabled && 'eidos-button--disabled',\n loading && 'eidos-button--loading',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const buttonContent = (\n <button\n type=\"button\"\n {...buttonProps}\n aria-label={iconOnlyLabel ?? buttonProps['aria-label']}\n className={buttonClasses}\n disabled={disabled || loading}\n >\n {loading ? (\n <>\n {!isIconOnly && (\n <>\n <span className=\"eidos-button--loading-spinner\">\n <LoaderCircle className=\"eidos-button--spinner-icon\" />\n </span>\n <span className=\"eidos-button--copy\">{loadingText}</span>\n </>\n )}\n {isIconOnly && (\n <span className=\"eidos-button--loading-spinner\">\n <LoaderCircle className=\"eidos-button--spinner-icon\" />\n </span>\n )}\n </>\n ) : (\n <>\n {preIcon && renderIcon(preIcon, 'eidos-button--pre-icon')}\n\n {isIconOnly && icon ? (\n renderIcon(icon, 'eidos-button--icon')\n ) : (\n <span className=\"eidos-button--copy\">{children}</span>\n )}\n\n {posIcon && renderIcon(posIcon, 'eidos-button--pos-icon')}\n </>\n )}\n </button>\n );\n\n return tooltip ? <Tooltip message={tooltip}>{buttonContent}</Tooltip> : buttonContent;\n};\n\n/**\n * IconButton - Convenience wrapper for icon-only buttons\n *\n * @example\n * ```tsx\n * import { IconButton } from 'eidos-ui';\n * import { Plus } from 'lucide-react';\n *\n * <IconButton icon={Plus} tooltip=\"Add item\" />\n * ```\n */\nexport const IconButton: React.FC<IconButtonProps> = (props) => {\n return <Button {...props} />;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Breadcrumb/Breadcrumb.component.tsx"],"sourcesContent":["import React from 'react';\nimport type { BreadcrumbProps } from './Breadcrumb.types';\n\nexport const Breadcrumb: React.FC<BreadcrumbProps> = ({\n items,\n separator = '/',\n className = '',\n}) => (\n <nav\n aria-label=\"Breadcrumb\"\n className={['eidos-breadcrumb-nav', className].filter(Boolean).join(' ')}\n >\n <ol className=\"eidos-breadcrumb\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n\n return (\n <li\n key={index}\n className={['eidos-breadcrumb-item', isLast && 'eidos-breadcrumb-item--current']\n .filter(Boolean)\n .join(' ')}\n >\n {isLast ? (\n <span aria-current=\"page\" className=\"eidos-breadcrumb-current\">\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </span>\n ) : item.href ? (\n <a href={item.href} onClick={item.onClick} className=\"eidos-breadcrumb-link\">\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={item.onClick}\n className=\"eidos-breadcrumb-link eidos-breadcrumb-link--button\"\n >\n {item.icon && <span className=\"eidos-breadcrumb-icon\">{item.icon}</span>}\n {item.label}\n </button>\n )}\n\n {!isLast && (\n <span aria-hidden=\"true\" className=\"eidos-breadcrumb-separator\">\n {separator}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n);\n\nBreadcrumb.displayName = 'Breadcrumb';\n"],"mappings":";AAwBc,SACgB,KADhB;AArBP,IAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AACd,MACE;AAAA,EAAC;AAAA;AAAA,IACC,cAAW;AAAA,IACX,WAAW,CAAC,wBAAwB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IAEvE,8BAAC,QAAG,WAAU,oBACX,gBAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,YAAM,SAAS,UAAU,MAAM,SAAS;AAExC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,WAAW,CAAC,yBAAyB,UAAU,gCAAgC,EAC5E,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,UAEV;AAAA,qBACC,qBAAC,UAAK,gBAAa,QAAO,WAAU,4BACjC;AAAA,mBAAK,QAAQ,oBAAC,UAAK,WAAU,yBAAyB,eAAK,MAAK;AAAA,cAChE,KAAK;AAAA,eACR,IACE,KAAK,OACP,qBAAC,OAAE,MAAM,KAAK,MAAM,SAAS,KAAK,SAAS,WAAU,yBAClD;AAAA,mBAAK,QAAQ,oBAAC,UAAK,WAAU,yBAAyB,eAAK,MAAK;AAAA,cAChE,KAAK;AAAA,eACR,IAEA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,KAAK;AAAA,gBACd,WAAU;AAAA,gBAET;AAAA,uBAAK,QAAQ,oBAAC,UAAK,WAAU,yBAAyB,eAAK,MAAK;AAAA,kBAChE,KAAK;AAAA;AAAA;AAAA,YACR;AAAA,YAGD,CAAC,UACA,oBAAC,UAAK,eAAY,QAAO,WAAU,8BAChC,qBACH;AAAA;AAAA;AAAA,QA7BG;AAAA,MA+BP;AAAA,IAEJ,CAAC,GACH;AAAA;AACF;AAGF,WAAW,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Chip/Chip.component.tsx"],"sourcesContent":["import React from 'react';\nimport { X } from 'lucide-react';\nimport type { ChipProps } from './Chip.types';\nimport { Tooltip } from '../Tooltip/Tooltip.component';\nimport { renderIcon } from '../../utils';\n\nexport const Chip: React.FC<ChipProps> = ({\n variant = 'filled',\n color = 'primary',\n size = 'md',\n disabled = false,\n fullWidth = false,\n tooltip,\n className = '',\n preIcon,\n posIcon,\n children,\n onClick,\n onRemove,\n ...chipProps\n}) => {\n const isClickable = !!onClick;\n const isRemovable = !!onRemove;\n\n // Build CSS classes\n const chipClasses = [\n 'eidos-chip',\n `eidos-chip--${variant}`,\n `eidos-chip--${color}`,\n `eidos-chip--${size}`,\n disabled && 'eidos-chip--disabled',\n isClickable && 'eidos-chip--clickable',\n isRemovable && 'eidos-chip--removable',\n fullWidth && 'eidos-chip--full-width',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const handleClick = () => {\n if (disabled || !onClick) return;\n onClick();\n };\n\n const handleRemove = (e: React.MouseEvent) => {\n e.stopPropagation(); // Prevent chip click when removing\n if (disabled || !onRemove) return;\n onRemove();\n };\n\n // A chip that is both clickable and removable holds *two* controls, so it\n // has to render them as siblings.\n //\n // The previous shape switched the outer element to a `<div>` when\n // removable - the comment said \"to avoid nested buttons\" - and then gave\n // that div `role=\"button\"` and `tabIndex={0}`. That is the same defect\n // wearing a different hat: a button containing a button, which is invalid\n // (`nested-interactive`) and leaves a screen reader announcing a control\n // inside a control. It is the same shape already fixed on `Dropdown` and\n // `DataGrid`'s rows.\n //\n // Now the outer element is a plain container whenever there is a remove\n // button, and the chip's own action moves to an inner `<button>` wrapping\n // just the content. Each control is separately reachable and separately\n // named.\n const hasBothControls = isClickable && isRemovable;\n const ChipElement = isClickable && !isRemovable ? 'button' : 'div';\n\n const body = (\n <>\n {preIcon && renderIcon(preIcon, 'eidos-chip--pre-icon')}\n\n <span className=\"eidos-chip--copy\">{children}</span>\n\n {posIcon && renderIcon(posIcon, 'eidos-chip--pos-icon')}\n </>\n );\n\n const chipContent = (\n <ChipElement\n className={chipClasses}\n disabled={ChipElement === 'button' ? disabled : undefined}\n onClick={isClickable && !hasBothControls ? handleClick : undefined}\n {...chipProps}\n >\n {hasBothControls ? (\n <button\n type=\"button\"\n className=\"eidos-chip--action\"\n onClick={handleClick}\n disabled={disabled}\n >\n {body}\n </button>\n ) : (\n body\n )}\n\n {isRemovable && (\n <button\n className=\"eidos-chip--remove-button\"\n onClick={handleRemove}\n disabled={disabled}\n aria-label=\"Remove\"\n type=\"button\"\n >\n <X className=\"eidos-chip--remove-icon\" />\n </button>\n )}\n </ChipElement>\n );\n\n return tooltip ? <Tooltip message={tooltip}>{chipContent}</Tooltip> : chipContent;\n};\n"],"mappings":";;;;;;;;AACA,SAAS,SAAS;AAoEd,mBAGE,KAHF;AA/DG,IAAM,OAA4B,CAAC;AAAA,EACxC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,cAAc,CAAC,CAAC;AACtB,QAAM,cAAc,CAAC,CAAC;AAGtB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,eAAe,OAAO;AAAA,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({ items, className = "" }) => /* @__PURE__ */ jsx("ol", { className: ["eidos-timeline", className].filter(Boolean).join(" "), "aria-label": "Timeline", children: items.map((item, index) => {
4
- const isLast = index === items.length - 1;
5
- const color = item.color ?? "default";
6
- return /* @__PURE__ */ jsxs(
7
- "li",
8
- {
9
- className: [
10
- "eidos-timeline-item",
11
- `eidos-timeline-item--${color}`,
12
- !isLast && "eidos-timeline-item--has-connector"
13
- ].filter(Boolean).join(" "),
14
- children: [
15
- /* @__PURE__ */ jsxs("div", { className: "eidos-timeline-track", "aria-hidden": "true", children: [
16
- /* @__PURE__ */ jsx("div", { className: "eidos-timeline-dot", children: item.icon && /* @__PURE__ */ jsx("span", { className: "eidos-timeline-dot-icon", children: item.icon }) }),
17
- !isLast && /* @__PURE__ */ jsx("div", { className: "eidos-timeline-connector" })
18
- ] }),
19
- /* @__PURE__ */ jsxs("div", { className: "eidos-timeline-content", children: [
20
- item.timestamp && /* @__PURE__ */ jsx("span", { className: "eidos-timeline-timestamp", children: item.timestamp }),
21
- /* @__PURE__ */ jsx("span", { className: "eidos-timeline-title", children: item.title }),
22
- item.description && /* @__PURE__ */ jsx("p", { className: "eidos-timeline-description", children: item.description })
23
- ] })
24
- ]
25
- },
26
- item.id
27
- );
28
- }) });
29
- Timeline.displayName = "Timeline";
30
-
31
- export {
32
- Timeline
33
- };
34
- //# sourceMappingURL=chunk-NEQXEVHM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Timeline/Timeline.component.tsx"],"sourcesContent":["import React from 'react';\nimport type { TimelineProps } from './Timeline.types';\n\nexport const Timeline: React.FC<TimelineProps> = ({ items, className = '' }) => (\n <ol className={['eidos-timeline', className].filter(Boolean).join(' ')} aria-label=\"Timeline\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const color = item.color ?? 'default';\n\n return (\n <li\n key={item.id}\n className={[\n 'eidos-timeline-item',\n `eidos-timeline-item--${color}`,\n !isLast && 'eidos-timeline-item--has-connector',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {/* Left: dot + connector */}\n <div className=\"eidos-timeline-track\" aria-hidden=\"true\">\n <div className=\"eidos-timeline-dot\">\n {item.icon && <span className=\"eidos-timeline-dot-icon\">{item.icon}</span>}\n </div>\n {!isLast && <div className=\"eidos-timeline-connector\" />}\n </div>\n\n {/* Right: content */}\n <div className=\"eidos-timeline-content\">\n {item.timestamp && <span className=\"eidos-timeline-timestamp\">{item.timestamp}</span>}\n <span className=\"eidos-timeline-title\">{item.title}</span>\n {item.description && <p className=\"eidos-timeline-description\">{item.description}</p>}\n </div>\n </li>\n );\n })}\n </ol>\n);\n\nTimeline.displayName = 'Timeline';\n"],"mappings":";AAqBU,SAEkB,KAFlB;AAlBH,IAAM,WAAoC,CAAC,EAAE,OAAO,YAAY,GAAG,MACxE,oBAAC,QAAG,WAAW,CAAC,kBAAkB,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAG,cAAW,YAChF,gBAAM,IAAI,CAAC,MAAM,UAAU;AAC1B,QAAM,SAAS,UAAU,MAAM,SAAS;AACxC,QAAM,QAAQ,KAAK,SAAS;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,WAAW;AAAA,QACT;AAAA,QACA,wBAAwB,KAAK;AAAA,QAC7B,CAAC,UAAU;AAAA,MACb,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MAGX;AAAA,6BAAC,SAAI,WAAU,wBAAuB,eAAY,QAChD;AAAA,8BAAC,SAAI,WAAU,sBACZ,eAAK,QAAQ,oBAAC,UAAK,WAAU,2BAA2B,eAAK,MAAK,GACrE;AAAA,UACC,CAAC,UAAU,oBAAC,SAAI,WAAU,4BAA2B;AAAA,WACxD;AAAA,QAGA,qBAAC,SAAI,WAAU,0BACZ;AAAA,eAAK,aAAa,oBAAC,UAAK,WAAU,4BAA4B,eAAK,WAAU;AAAA,UAC9E,oBAAC,UAAK,WAAU,wBAAwB,eAAK,OAAM;AAAA,UAClD,KAAK,eAAe,oBAAC,OAAE,WAAU,8BAA8B,eAAK,aAAY;AAAA,WACnF;AAAA;AAAA;AAAA,IAtBK,KAAK;AAAA,EAuBZ;AAEJ,CAAC,GACH;AAGF,SAAS,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/eidos-ui/eidos-ui/dist/chunk-O2BECFXJ.cjs","../src/components/Conversation/Chat.component.tsx","../src/components/Conversation/MessageComposer.component.tsx","../src/components/Conversation/Conversation.hooks.ts","../src/components/Conversation/Conversation.utils.ts","../src/components/Conversation/MessageItem.component.tsx","../src/components/Conversation/CommentThread.component.tsx"],"names":["useRef","useCallback","Fragment","Paperclip","jsx","jsxs"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACzBA,8BAA4C;AAC5C,2CAA0C;AD2B1C;AACA;AE7BA;AACA;AF+BA;AACA;AGjCA;AAWO,IAAM,iBAAA,EAAmB,CAC9B,QAAA,EACA,OAAA,EAAA,GACgB;AAChB,EAAA,MAAM,KAAA,EAAO,2BAAA,IAA+B,CAAA;AAC5C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,EAAA,EAAI,6BAAA,CAAsB,EAAA,mBAAM,IAAI,GAAA,CAAI,CAAC,CAAA;AAE/D,EAAA,8BAAA,CAAU,EAAA,GAAM;AAEd,IAAA,GAAA,CAAI,IAAA,CAAK,QAAA,IAAY,IAAA,EAAM;AACzB,MAAA,IAAA,CAAK,QAAA,EAAU,IAAI,GAAA,CAAI,QAAA,CAAS,GAAA,CAAI,CAAC,OAAA,EAAA,GAAY,OAAA,CAAQ,EAAE,CAAC,CAAA;AAC5D,MAAA,MAAA;AAAA,IACF;AAEA,IAAA,GAAA,CA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AA;AACA,MAAA;AACU,MAAA;AAAA,IAAA;AACZ,EAAA;AAIAI,EAAAA;AACqB,IAAA;AAEL,MAAA;AAER,MAAA;AACG,QAAA;AAAM,QAAA;AAAgB,QAAA;AACzB,MAAA;AAEJ,IAAA;AAGoB,IAAA;AAEV,IAAA;AAGT,IAAA;AACE,MAAA;AAAA,MAAA;AACO,QAAA;AACA,QAAA;AACO,QAAA;AACR,QAAA;AAAA,MAAA;AACP,IAAA;AAGe,IAAA;AAIXD,sBAAAA;AAIc,MAAA;AAEgB,QAAA;AAET,UAAA;AACE,UAAA;AACN,UAAA;AACV,QAAA;AAEL,MAAA;AAIC,MAAA;AAGI,QAAA;AAAA,QAAA;AACW,UAAA;AACA,UAAA;AACA,UAAA;AACE,UAAA;AACA,UAAA;AACA,UAAA;AACZ,UAAA;AACA,UAAA;AACA,UAAA;AACS,UAAA;AAAA,QAAA;AAEb,MAAA;AAGP,IAAA;AAKH,IAAA;AAGMA,sBAAAA;AAAuC,MAAA;AAIzC,IAAA;AAOgB,IAAA;AAET,IAAA;AAGf,EAAA;AAEJ;AAEc;AN8oBW;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eidos-ui/eidos-ui/dist/chunk-O2BECFXJ.cjs","sourcesContent":[null,"import React, { useCallback, useMemo } from 'react';\nimport { ArrowDown, MessagesSquare } from 'lucide-react';\nimport { Button } from '../Button';\nimport { EmptyState } from '../EmptyState';\nimport { Skeleton } from '../Skeleton';\nimport { Spinner } from '../Spinner';\nimport { MessageComposer } from './MessageComposer.component';\nimport { MessageItem } from './MessageItem.component';\nimport type { ChatProps, ConversationMessage } from './Conversation.types';\nimport {\n useLoadMoreOnScrollTop,\n useNewMessageIds,\n useScrollAnchor,\n useStickToBottom,\n} from './Conversation.hooks';\nimport { classNames, continuesRun, formatDateSeparator, isSameDay } from './Conversation.utils';\n\nconst ChatSkeleton: React.FC = () => (\n <div className=\"eidos-chat-skeleton\" aria-hidden=\"true\">\n {[0, 1, 2, 3].map((row) => (\n <div\n key={row}\n className={classNames(\n 'eidos-chat-skeleton-row',\n row % 2 === 1 && 'eidos-chat-skeleton-row--own',\n )}\n >\n <Skeleton variant=\"circular\" width={28} height={28} />\n <Skeleton variant=\"rounded\" height={48} />\n </div>\n ))}\n </div>\n);\n\n/**\n * A bottom-anchored message thread with a composer.\n *\n * Controlled and transport-agnostic: it renders the `messages` it is given and\n * reports intent through `onSend` / `onLoadMore`. It never fetches, so the\n * same array can be persisted and replayed verbatim.\n */\nexport const Chat: React.FC<ChatProps> = ({\n messages,\n currentUserId,\n onSend,\n onRetry,\n readOnly = false,\n readOnlyMessage,\n renderBody,\n messageActions,\n renderMessageFooter,\n loading = false,\n emptyContent,\n hasMore = false,\n loadingMore = false,\n onLoadMore,\n groupConsecutive = true,\n groupWindowMinutes = 5,\n showDateSeparators = true,\n formatTimestamp,\n animateNewMessages = true,\n allowAttachments = false,\n attachmentAccept,\n typing,\n unreadFromId,\n placeholder = 'Write a message...',\n sendOnEnter = true,\n ariaLabel = 'Conversation',\n className = '',\n}) => {\n const { scrollRef, atBottom, scrollToBottom, handleScroll } = useStickToBottom(messages);\n const newIds = useNewMessageIds(messages, animateNewMessages);\n useScrollAnchor(scrollRef, messages);\n\n const loadMoreOnScroll = useLoadMoreOnScrollTop(scrollRef, { hasMore, loadingMore, onLoadMore });\n\n const onScroll = useCallback(() => {\n handleScroll();\n loadMoreOnScroll();\n }, [handleScroll, loadMoreOnScroll]);\n\n const byId = useMemo(() => new Map(messages.map((message) => [message.id, message])), [messages]);\n\n // An id that isn't in the current page must not draw a divider above\n // nothing - it would float at the top of whatever happens to be loaded.\n const unreadIndex = useMemo(() => {\n if (!unreadFromId) return -1;\n return messages.findIndex((message) => message.id === unreadFromId);\n }, [messages, unreadFromId]);\n\n const showComposer = !readOnly && Boolean(onSend);\n const isEmpty = !loading && messages.length === 0;\n\n const renderMessage = (message: ConversationMessage, index: number) => {\n const previous = messages[index - 1];\n const actions = readOnly ? undefined : messageActions?.(message);\n const quoted = message.parentId ? byId.get(message.parentId) : undefined;\n\n const nodes: React.ReactNode[] = [];\n\n if (showDateSeparators && (!previous || !isSameDay(previous.sentAt, message.sentAt))) {\n nodes.push(\n <li key={`date-${message.id}`} className=\"eidos-conversation-separator\">\n <span>{formatDateSeparator(message.sentAt)}</span>\n </li>,\n );\n }\n\n if (index === unreadIndex) {\n nodes.push(\n <li\n key={`unread-${message.id}`}\n className=\"eidos-conversation-separator eidos-conversation-separator--unread\"\n >\n <span>Unread messages</span>\n </li>,\n );\n }\n\n // A separator breaks a run: the message under it needs its own header.\n const grouped =\n groupConsecutive &&\n index !== unreadIndex &&\n nodes.length === 0 &&\n continuesRun(previous, message, groupWindowMinutes);\n\n nodes.push(\n <MessageItem\n key={message.id}\n message={message}\n layout=\"chat\"\n isOwn={Boolean(currentUserId) && message.author.id === currentUserId}\n grouped={grouped}\n isNew={newIds.has(message.id)}\n actions={actions}\n footer={renderMessageFooter?.(message)}\n body={renderBody?.(message)}\n onRetry={!readOnly && onRetry ? () => onRetry(message) : undefined}\n quoted={quoted}\n formatTimestamp={formatTimestamp}\n />,\n );\n\n return nodes;\n };\n\n return (\n <div className={classNames('eidos-chat', className)}>\n <div\n ref={scrollRef}\n className=\"eidos-chat-scroll\"\n onScroll={onScroll}\n role=\"log\"\n aria-live=\"polite\"\n aria-relevant=\"additions\"\n aria-busy={loading}\n aria-label={ariaLabel}\n tabIndex={0}\n >\n {hasMore && (\n <div className=\"eidos-chat-load-more\">\n {loadingMore ? (\n <span className=\"eidos-chat-loading-more\">\n <Spinner size=\"sm\" color=\"secondary\" />\n Loading earlier messages…\n </span>\n ) : (\n <Button variant=\"text\" color=\"secondary\" size=\"sm\" onClick={onLoadMore}>\n Load earlier messages\n </Button>\n )}\n </div>\n )}\n\n {loading && <ChatSkeleton />}\n\n {isEmpty &&\n (emptyContent ?? (\n <EmptyState\n icon={<MessagesSquare />}\n title=\"No messages yet\"\n description={\n showComposer ? 'Send the first message to start the conversation.' : undefined\n }\n size=\"sm\"\n />\n ))}\n\n {!loading && messages.length > 0 && (\n <ol className=\"eidos-conversation-list\">{messages.map(renderMessage)}</ol>\n )}\n\n {typing && typing.length > 0 && (\n <div className=\"eidos-chat-typing\" aria-live=\"polite\">\n <span className=\"eidos-chat-typing-dots\" aria-hidden=\"true\">\n <i />\n <i />\n <i />\n </span>\n {typing.length === 1\n ? `${typing[0].name} is typing…`\n : `${typing.length} people are typing…`}\n </div>\n )}\n </div>\n\n {!atBottom && messages.length > 0 && (\n <div className=\"eidos-chat-jump\">\n <Button\n size=\"sm\"\n variant=\"filled\"\n color=\"secondary\"\n preIcon={ArrowDown}\n onClick={() => scrollToBottom('smooth')}\n >\n Latest\n </Button>\n </div>\n )}\n\n {showComposer && (\n <div className=\"eidos-chat-composer\">\n <MessageComposer\n onSubmit={onSend as NonNullable<typeof onSend>}\n placeholder={placeholder}\n sendOnEnter={sendOnEnter}\n allowAttachments={allowAttachments}\n attachmentAccept={attachmentAccept}\n />\n </div>\n )}\n\n {readOnly && readOnlyMessage && (\n <p className=\"eidos-conversation-readonly\">{readOnlyMessage}</p>\n )}\n </div>\n );\n};\n\nChat.displayName = 'Chat';\n","import React, { useCallback, useId, useRef, useState } from 'react';\nimport { Paperclip, Send, X } from 'lucide-react';\nimport { Avatar } from '../Avatar';\nimport { Button } from '../Button';\nimport { Chip } from '../Chip';\nimport type { MessageComposerProps } from './Conversation.types';\nimport { useAutoGrow } from './Conversation.hooks';\nimport { classNames, formatFileSize } from './Conversation.utils';\n\n/**\n * The authoring half of a conversation - a growing text field, optional\n * attachments, and a submit control.\n *\n * Exported on its own so a consumer building a bespoke list can still reuse\n * the input, and used internally by both `Chat` and `CommentThread`.\n */\nexport const MessageComposer: React.FC<MessageComposerProps> = ({\n value,\n onChange,\n onSubmit,\n onCancel,\n placeholder = 'Write a message...',\n submitLabel = 'Send',\n sendOnEnter = false,\n parentId,\n replyingTo,\n allowAttachments = false,\n attachmentAccept,\n author,\n disabled = false,\n requireBody = true,\n autoFocus = false,\n maxLength,\n className = '',\n}) => {\n const [internalBody, setInternalBody] = useState('');\n const [attachments, setAttachments] = useState<File[]>([]);\n const [pending, setPending] = useState(false);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const fileInputId = useId();\n\n const isControlled = value !== undefined;\n const body = isControlled ? value : internalBody;\n\n useAutoGrow(textareaRef, body);\n\n const setBody = useCallback(\n (next: string) => {\n if (!isControlled) setInternalBody(next);\n onChange?.(next);\n },\n [isControlled, onChange],\n );\n\n const canSubmit = !disabled && !pending && (!requireBody || body.trim().length > 0);\n\n const submit = useCallback(async () => {\n if (!canSubmit) return;\n\n const draft = { body: body.trim(), attachments, parentId };\n const result = onSubmit(draft);\n\n // A synchronous handler clears immediately; an async one keeps the draft\n // until it resolves, so a rejected send never loses what was typed.\n if (!(result instanceof Promise)) {\n setBody('');\n setAttachments([]);\n return;\n }\n\n setPending(true);\n try {\n await result;\n setBody('');\n setAttachments([]);\n } catch {\n // Intentionally swallowed: the draft stays put and the consumer owns\n // error reporting (a Snackbar, an Alert, ...). Rethrowing here would\n // surface as an unhandled rejection from a keystroke.\n } finally {\n setPending(false);\n }\n }, [canSubmit, body, attachments, parentId, onSubmit, setBody]);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (!sendOnEnter) return;\n // Shift+Enter always inserts a newline; the modifier check also leaves\n // IME composition (which fires Enter to commit) alone.\n if (event.key !== 'Enter' || event.shiftKey || event.nativeEvent.isComposing) return;\n event.preventDefault();\n void submit();\n };\n\n const addFiles = (list: FileList | null) => {\n if (!list?.length) return;\n setAttachments((current) => [...current, ...Array.from(list)]);\n // Reset so selecting the same file twice in a row still fires `change`.\n if (fileInputRef.current) fileInputRef.current.value = '';\n };\n\n const removeAttachment = (index: number) =>\n setAttachments((current) => current.filter((_, i) => i !== index));\n\n return (\n <form\n className={classNames('eidos-message-composer', className)}\n onSubmit={(event) => {\n event.preventDefault();\n void submit();\n }}\n >\n {replyingTo && (\n <div className=\"eidos-composer-reply-hint\">\n <span>\n Replying to <strong>{replyingTo}</strong>\n </span>\n {onCancel && (\n <Button\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n icon={X}\n onClick={onCancel}\n tooltip=\"Cancel reply\"\n aria-label=\"Cancel reply\"\n />\n )}\n </div>\n )}\n\n <div className=\"eidos-composer-row\">\n {author && (\n <div className=\"eidos-composer-avatar\">\n <Avatar\n src={author.avatarSrc}\n name={author.name}\n size=\"sm\"\n color={author.avatarColor ?? 'gray'}\n />\n </div>\n )}\n\n <div className=\"eidos-composer-field\">\n <textarea\n ref={textareaRef}\n className=\"eidos-composer-input\"\n value={body}\n onChange={(event) => setBody(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled || pending}\n rows={1}\n maxLength={maxLength}\n // Opt-in and off by default. Only the reply composer sets it, where\n // the field appears in direct response to the user pressing Reply -\n // moving focus there is the expected outcome, not a hijack.\n autoFocus={autoFocus}\n aria-label={placeholder}\n />\n\n {attachments.length > 0 && (\n <ul className=\"eidos-composer-attachments\">\n {attachments.map((file, index) => (\n <li key={`${file.name}-${file.size}-${index}`}>\n <Chip\n size=\"sm\"\n variant=\"outlined\"\n color=\"secondary\"\n preIcon={Paperclip}\n onRemove={() => removeAttachment(index)}\n >\n {file.name}\n {file.size > 0 && ` (${formatFileSize(file.size)})`}\n </Chip>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n\n <div className=\"eidos-composer-actions\">\n <div className=\"eidos-composer-actions-start\">\n {allowAttachments && (\n <>\n <input\n ref={fileInputRef}\n id={fileInputId}\n type=\"file\"\n multiple\n accept={attachmentAccept}\n // Hidden from both the tab order and the accessibility\n // tree. It is a proxy: the visible button above opens the\n // file dialog via `.click()`, so this input is an\n // implementation detail, not a control.\n //\n // `visually-hidden` keeps an element *focusable* - that is\n // the point of it, for skip links and screen-reader-only\n // text - so a keyboard user landed on an invisible control\n // and met the same \"Attach files\" action twice. `FileUpload`\n // already gets this right with `display: none` +\n // `tabIndex={-1}`; these two had drifted from it.\n //\n // `aria-hidden` is safe here only *because* of the\n // `tabIndex={-1}` beside it - hiding a focusable element is\n // its own violation.\n className=\"eidos-composer-file-input\"\n tabIndex={-1}\n aria-hidden=\"true\"\n onChange={(event) => addFiles(event.target.files)}\n disabled={disabled || pending}\n />\n <Button\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n icon={Paperclip}\n tooltip=\"Attach files\"\n aria-label=\"Attach files\"\n disabled={disabled || pending}\n onClick={() => fileInputRef.current?.click()}\n />\n </>\n )}\n {sendOnEnter && (\n <span className=\"eidos-composer-hint\">\n <kbd>Enter</kbd> to send · <kbd>Shift</kbd>+<kbd>Enter</kbd> for a new line\n </span>\n )}\n </div>\n\n <div className=\"eidos-composer-actions-end\">\n {onCancel && !replyingTo && (\n <Button\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n onClick={onCancel}\n disabled={pending}\n >\n Cancel\n </Button>\n )}\n <Button\n type=\"submit\"\n size=\"sm\"\n color=\"primary\"\n preIcon={Send}\n loading={pending}\n disabled={!canSubmit}\n >\n {submitLabel}\n </Button>\n </div>\n </div>\n </form>\n );\n};\n\nMessageComposer.displayName = 'MessageComposer';\n","import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { ConversationMessage } from './Conversation.types';\n\n/**\n * Ids that arrived *after* the first render.\n *\n * Seeded from the first commit so an initial page of history is never\n * animated - otherwise opening a thread fades forty messages in at once,\n * which reads as a glitch rather than as feedback. Only genuinely new ids get\n * the entrance class, and each one only once.\n */\nexport const useNewMessageIds = (\n messages: ConversationMessage[],\n enabled: boolean,\n): Set<string> => {\n const seen = useRef<Set<string> | null>(null);\n const [fresh, setFresh] = useState<Set<string>>(() => new Set());\n\n useEffect(() => {\n // First commit: everything already on screen counts as pre-existing.\n if (seen.current === null) {\n seen.current = new Set(messages.map((message) => message.id));\n return;\n }\n\n if (!enabled) {\n for (const message of messages) seen.current.add(message.id);\n return;\n }\n\n const added = messages.filter((message) => !seen.current?.has(message.id));\n if (!added.length) return;\n\n for (const message of added) seen.current.add(message.id);\n setFresh(new Set(added.map((message) => message.id)));\n }, [messages, enabled]);\n\n return fresh;\n};\n\ninterface StickToBottom {\n scrollRef: React.RefObject<HTMLDivElement | null>;\n /** The viewport is at (or near) the newest message. */\n atBottom: boolean;\n scrollToBottom: (behavior?: ScrollBehavior) => void;\n handleScroll: () => void;\n}\n\n/** Distance from the bottom still counted as \"reading the newest message\". */\nconst BOTTOM_THRESHOLD_PX = 48;\n\n/**\n * Keeps a bottom-anchored list pinned to the newest message - but only while\n * the reader is already there.\n *\n * Scrolling someone back down while they are reading scrollback is the single\n * most common defect in chat UIs, so arrival of a new message only forces a\n * scroll when `atBottom` was already true. Otherwise the caller surfaces a\n * jump-to-latest affordance and leaves the viewport alone.\n */\nexport const useStickToBottom = (messages: ConversationMessage[]): StickToBottom => {\n const scrollRef = useRef<HTMLDivElement>(null);\n const [atBottom, setAtBottom] = useState(true);\n // Read during a layout effect, so it must not be state - it has to be\n // correct for the commit that is happening right now, not the next render.\n const atBottomRef = useRef(true);\n const lastCount = useRef(messages.length);\n\n const scrollToBottom = useCallback((behavior: ScrollBehavior = 'smooth') => {\n const node = scrollRef.current;\n if (!node) return;\n node.scrollTo({ top: node.scrollHeight, behavior });\n }, []);\n\n const handleScroll = useCallback(() => {\n const node = scrollRef.current;\n if (!node) return;\n const distance = node.scrollHeight - node.scrollTop - node.clientHeight;\n const next = distance <= BOTTOM_THRESHOLD_PX;\n atBottomRef.current = next;\n setAtBottom((current) => (current === next ? current : next));\n }, []);\n\n // Jump (not animate) to the bottom on first paint so a thread opens on its\n // newest message instead of visibly scrolling there.\n useLayoutEffect(() => {\n scrollToBottom('auto');\n // eslint-disable-next-line react-hooks/exhaustive-deps -- mount only\n }, []);\n\n useLayoutEffect(() => {\n if (messages.length > lastCount.current && atBottomRef.current) {\n scrollToBottom('smooth');\n }\n lastCount.current = messages.length;\n }, [messages.length, scrollToBottom]);\n\n return { scrollRef, atBottom, scrollToBottom, handleScroll };\n};\n\n/**\n * Preserves the reader's position when older messages are prepended.\n *\n * Without this, inserting a page above the viewport pushes the content the\n * user was reading down by the height of everything added, which reads as the\n * list jumping to a random place. Capturing `scrollHeight` before the DOM\n * mutation and restoring the delta in a *layout* effect corrects it before the\n * browser paints, so there is no visible shift.\n */\nexport const useScrollAnchor = (\n scrollRef: React.RefObject<HTMLDivElement | null>,\n messages: ConversationMessage[],\n): void => {\n const previous = useRef({ height: 0, firstId: '', count: 0 });\n\n useLayoutEffect(() => {\n const node = scrollRef.current;\n if (!node) return;\n\n const firstId = messages[0]?.id ?? '';\n const before = previous.current;\n // A prepend is the only case where the first id changes while the list\n // grows - an append leaves it untouched, and a replacement shrinks it.\n const prepended =\n before.firstId !== '' && before.firstId !== firstId && messages.length > before.count;\n\n if (prepended) {\n node.scrollTop += node.scrollHeight - before.height;\n }\n\n previous.current = { height: node.scrollHeight, firstId, count: messages.length };\n }, [messages, scrollRef]);\n};\n\n/**\n * Fires `onLoadMore` once the reader approaches the top of the history.\n *\n * Latched on the way in and released only after they scroll back out of the\n * trigger zone, so a single pause near the top can't queue a dozen fetches.\n */\nexport const useLoadMoreOnScrollTop = (\n scrollRef: React.RefObject<HTMLDivElement | null>,\n {\n hasMore,\n loadingMore,\n onLoadMore,\n }: {\n hasMore?: boolean;\n loadingMore?: boolean;\n onLoadMore?: () => void;\n },\n thresholdPx = 80,\n): (() => void) => {\n const armed = useRef(true);\n\n return useCallback(() => {\n const node = scrollRef.current;\n if (!node) return;\n\n if (node.scrollTop > thresholdPx) {\n armed.current = true;\n return;\n }\n\n if (!armed.current || !hasMore || loadingMore || !onLoadMore) return;\n armed.current = false;\n onLoadMore();\n }, [scrollRef, hasMore, loadingMore, onLoadMore, thresholdPx]);\n};\n\n/**\n * Grows a textarea to fit its content, up to `maxHeight`.\n *\n * Height is written to `style.height` directly rather than through a React\n * inline style: it is measured from the live DOM after every keystroke, so it\n * cannot be expressed as a class, and routing it through state would add a\n * render per character. Assigning the property imperatively also keeps it out\n * of the server-rendered `style` attribute that CSP's `style-src-attr` gates.\n */\nexport const useAutoGrow = (\n ref: React.RefObject<HTMLTextAreaElement | null>,\n value: string,\n maxHeight = 200,\n): void => {\n useLayoutEffect(() => {\n const node = ref.current;\n if (!node) return;\n\n node.style.height = 'auto';\n const next = Math.min(node.scrollHeight, maxHeight);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight > maxHeight ? 'auto' : 'hidden';\n }, [ref, value, maxHeight]);\n};\n","import type { ConversationMessage } from './Conversation.types';\n\n/**\n * Timestamp formatting goes through `Intl` rather than a date library on\n * purpose: `dayjs` is currently bundled only into the `DatePicker` chunk, and\n * pulling it in here would add it to every consumer importing a conversation.\n * `Intl` is built in and already locale-aware.\n */\n\nconst timeFormat = new Intl.DateTimeFormat(undefined, {\n hour: '2-digit',\n minute: '2-digit',\n});\n\nconst dateFormat = new Intl.DateTimeFormat(undefined, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n});\n\nconst dateFormatSameYear = new Intl.DateTimeFormat(undefined, {\n day: 'numeric',\n month: 'long',\n});\n\n/** Parses an ISO string, returning null rather than an `Invalid Date`. */\nexport const parseDate = (iso: string): Date | null => {\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? null : date;\n};\n\nexport const formatMessageTime = (iso: string): string => {\n const date = parseDate(iso);\n return date ? timeFormat.format(date) : iso;\n};\n\nconst startOfDay = (date: Date): number =>\n new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();\n\nexport const isSameDay = (a: string, b: string): boolean => {\n const first = parseDate(a);\n const second = parseDate(b);\n if (!first || !second) return false;\n return startOfDay(first) === startOfDay(second);\n};\n\n/** `Today` / `Yesterday` / a full date, for the divider between days. */\nexport const formatDateSeparator = (iso: string): string => {\n const date = parseDate(iso);\n if (!date) return iso;\n\n const now = new Date();\n const dayDelta = Math.round((startOfDay(now) - startOfDay(date)) / 86_400_000);\n\n if (dayDelta === 0) return 'Today';\n if (dayDelta === 1) return 'Yesterday';\n return date.getFullYear() === now.getFullYear()\n ? dateFormatSameYear.format(date)\n : dateFormat.format(date);\n};\n\nconst FILE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'];\n\nexport const formatFileSize = (bytes: number): string => {\n if (!Number.isFinite(bytes) || bytes < 0) return '';\n if (bytes < 1024) return `${bytes} B`;\n\n let value = bytes;\n let unit = 0;\n while (value >= 1024 && unit < FILE_UNITS.length - 1) {\n value /= 1024;\n unit += 1;\n }\n // One decimal below 10 (9.4 MB), none above it (24 MB) - the extra digit\n // stops carrying information once the integer part is two digits.\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${FILE_UNITS[unit]}`;\n};\n\n/**\n * Whether `message` continues a run started by `previous` - same author, same\n * day, and within the grouping window. A grouped message hides its avatar and\n * author line.\n */\nexport const continuesRun = (\n previous: ConversationMessage | undefined,\n message: ConversationMessage,\n windowMinutes: number,\n): boolean => {\n if (!previous) return false;\n if (previous.author.id !== message.author.id) return false;\n if (!isSameDay(previous.sentAt, message.sentAt)) return false;\n\n const before = parseDate(previous.sentAt);\n const after = parseDate(message.sentAt);\n if (!before || !after) return false;\n\n return Math.abs(after.getTime() - before.getTime()) <= windowMinutes * 60_000;\n};\n\nexport const sortBySentAt = (messages: ConversationMessage[]): ConversationMessage[] =>\n [...messages].sort((a, b) => {\n const first = parseDate(a.sentAt)?.getTime() ?? 0;\n const second = parseDate(b.sentAt)?.getTime() ?? 0;\n return first - second;\n });\n\nexport interface ThreadNode {\n message: ConversationMessage;\n replies: ConversationMessage[];\n}\n\n/**\n * Collapses a flat list into one level of nesting.\n *\n * Deeper chains are flattened onto the nearest **top-level** ancestor rather\n * than being dropped or nested further: indentation past one level is\n * unreadable on a phone, and silently discarding a reply-to-a-reply would lose\n * data the consumer stored. `replyingToName` on the rendered reply is what\n * preserves who was actually answered.\n *\n * A `parentId` pointing at a message that isn't present (paged out, deleted)\n * is treated as top-level, so nothing ever disappears from the list.\n */\nexport const buildThread = (messages: ConversationMessage[]): ThreadNode[] => {\n const byId = new Map(messages.map((message) => [message.id, message]));\n\n /** Walks up to the outermost ancestor, guarding against a parentId cycle. */\n const rootIdOf = (message: ConversationMessage): string => {\n const seen = new Set<string>([message.id]);\n let current = message;\n\n while (current.parentId) {\n const parent = byId.get(current.parentId);\n if (!parent || seen.has(parent.id)) break;\n seen.add(parent.id);\n current = parent;\n }\n\n return current.id;\n };\n\n const nodes = new Map<string, ThreadNode>();\n const roots: ThreadNode[] = [];\n\n for (const message of messages) {\n if (message.parentId && byId.has(message.parentId)) continue;\n const node: ThreadNode = { message, replies: [] };\n nodes.set(message.id, node);\n roots.push(node);\n }\n\n for (const message of messages) {\n if (!message.parentId || !byId.has(message.parentId)) continue;\n nodes.get(rootIdOf(message))?.replies.push(message);\n }\n\n for (const node of nodes.values()) {\n node.replies = sortBySentAt(node.replies);\n }\n\n return roots;\n};\n\n/** Name of the author a reply was addressed to, when it isn't its own parent. */\nexport const replyTargetName = (\n message: ConversationMessage,\n byId: Map<string, ConversationMessage>,\n rootId: string,\n): string | undefined => {\n if (!message.parentId || message.parentId === rootId) return undefined;\n return byId.get(message.parentId)?.author.name;\n};\n\n/** Trims a quoted excerpt so a long parent message can't dominate the reply. */\nexport const excerpt = (body: string, maxLength = 120): string => {\n const flat = body.replace(/\\s+/g, ' ').trim();\n return flat.length > maxLength ? `${flat.slice(0, maxLength - 1)}…` : flat;\n};\n\nexport const classNames = (...values: Array<string | false | null | undefined>): string =>\n values.filter(Boolean).join(' ');\n","import React from 'react';\nimport { AlertCircle, MoreHorizontal, Paperclip, RotateCw } from 'lucide-react';\nimport { Avatar } from '../Avatar';\nimport { Button } from '../Button';\nimport { Menu } from '../Menu';\nimport { Pill } from '../Pill';\nimport { Spinner } from '../Spinner';\nimport type { ConversationMessage, MessageAttachment } from './Conversation.types';\nimport type { MenuItemType } from '../Menu';\nimport { classNames, excerpt, formatFileSize, formatMessageTime } from './Conversation.utils';\n\nexport interface MessageItemProps {\n message: ConversationMessage;\n /** 'chat' right-aligns own messages into bubbles; 'comment' renders a flat card. */\n layout: 'chat' | 'comment';\n isOwn: boolean;\n /** Continues a run from the same author - hides the avatar and author line. */\n grouped: boolean;\n /** Plays the entrance animation. */\n isNew: boolean;\n actions?: MenuItemType[];\n footer?: React.ReactNode;\n body?: React.ReactNode;\n onRetry?: () => void;\n /** Author of the message being answered, for a flattened deep reply. */\n replyingToName?: string;\n /** Quoted parent, rendered above the body in chat layout. */\n quoted?: ConversationMessage;\n /** Reply affordance; omitted entirely when the viewer may not reply. */\n onReply?: () => void;\n formatTimestamp?: (iso: string) => string;\n}\n\nconst AttachmentList: React.FC<{ attachments: MessageAttachment[] }> = ({ attachments }) => (\n <ul className=\"eidos-message-attachments\">\n {attachments.map((attachment) => {\n const label = (\n <>\n <Paperclip aria-hidden=\"true\" />\n <span className=\"eidos-message-attachment-name\">{attachment.name}</span>\n {attachment.size !== undefined && (\n <span className=\"eidos-message-attachment-size\">{formatFileSize(attachment.size)}</span>\n )}\n </>\n );\n\n return (\n <li key={attachment.id} className=\"eidos-message-attachment\">\n {attachment.url ? (\n <a\n href={attachment.url}\n className=\"eidos-message-attachment-link\"\n target=\"_blank\"\n rel=\"noreferrer\"\n download={attachment.name}\n >\n {label}\n </a>\n ) : (\n <span className=\"eidos-message-attachment-link\">{label}</span>\n )}\n </li>\n );\n })}\n </ul>\n);\n\nexport const MessageItem: React.FC<MessageItemProps> = ({\n message,\n layout,\n isOwn,\n grouped,\n isNew,\n actions,\n footer,\n body,\n onRetry,\n replyingToName,\n quoted,\n onReply,\n formatTimestamp,\n}) => {\n const { author, status = 'sent' } = message;\n const timestamp = formatTimestamp\n ? formatTimestamp(message.sentAt)\n : formatMessageTime(message.sentAt);\n // An empty action list must not leave a dead trigger behind - see the\n // permissions note in Conversation.types.ts.\n const hasActions = Boolean(actions && actions.length > 0);\n\n // One placement per layout, rather than one per message.\n //\n // `chat` puts the time at the foot of the bubble, where a grouped message\n // already had it; it used to appear in the header for the first message of a\n // group and inside the bubble for the rest, so a single thread showed the\n // same fact in two places. `comment` keeps it in the header, where the row is\n // full width and has space for it.\n const timeInBubble = layout === 'chat';\n\n return (\n <li\n className={classNames(\n 'eidos-message',\n `eidos-message--${layout}`,\n isOwn && 'eidos-message--own',\n grouped && 'eidos-message--grouped',\n status !== 'sent' && `eidos-message--${status}`,\n isNew && 'eidos-message--enter',\n )}\n data-message-id={message.id}\n >\n <div className=\"eidos-message-avatar\">\n {!grouped && (\n <Avatar\n src={author.avatarSrc}\n name={author.name}\n size=\"sm\"\n color={author.avatarColor ?? 'gray'}\n />\n )}\n </div>\n\n <div className=\"eidos-message-main\">\n {!grouped && (\n <div className=\"eidos-message-header\">\n <span className=\"eidos-message-author\">{author.name}</span>\n {author.role && (\n <Pill size=\"sm\" variant=\"outlined\" color=\"secondary\">\n {author.role}\n </Pill>\n )}\n {!timeInBubble && (\n <time className=\"eidos-message-time\" dateTime={message.sentAt}>\n {timestamp}\n </time>\n )}\n {message.edited && <span className=\"eidos-message-edited\">edited</span>}\n </div>\n )}\n\n <div className=\"eidos-message-bubble\">\n {quoted && (\n <blockquote className=\"eidos-message-quote\">\n <span className=\"eidos-message-quote-author\">{quoted.author.name}</span>\n <span className=\"eidos-message-quote-body\">{excerpt(quoted.body)}</span>\n </blockquote>\n )}\n\n {replyingToName && (\n <span className=\"eidos-message-reply-target\">Replying to {replyingToName}</span>\n )}\n\n <div className=\"eidos-message-body\">{body ?? message.body}</div>\n\n {message.attachments && message.attachments.length > 0 && (\n <AttachmentList attachments={message.attachments} />\n )}\n\n {(timeInBubble || grouped) && (\n <time\n className=\"eidos-message-time eidos-message-time--inline\"\n dateTime={message.sentAt}\n >\n {timestamp}\n </time>\n )}\n </div>\n\n {status === 'sending' && (\n <span className=\"eidos-message-status\">\n <Spinner size=\"sm\" color=\"secondary\" />\n Sending…\n </span>\n )}\n\n {status === 'failed' && (\n <span className=\"eidos-message-status eidos-message-status--failed\">\n <AlertCircle aria-hidden=\"true\" />\n Not sent\n {onRetry && (\n <Button variant=\"text\" color=\"danger\" size=\"sm\" preIcon={RotateCw} onClick={onRetry}>\n Retry\n </Button>\n )}\n </span>\n )}\n\n {footer && <div className=\"eidos-message-footer\">{footer}</div>}\n\n {onReply && (\n <div className=\"eidos-message-reply\">\n <Button variant=\"text\" color=\"secondary\" size=\"sm\" onClick={onReply}>\n Reply\n </Button>\n </div>\n )}\n </div>\n\n {hasActions && (\n <div className=\"eidos-message-actions\">\n <Menu\n items={actions ?? []}\n trigger={\n <Button\n variant=\"text\"\n color=\"secondary\"\n size=\"sm\"\n icon={MoreHorizontal}\n aria-label={`Actions for ${author.name}'s message`}\n />\n }\n />\n </div>\n )}\n </li>\n );\n};\n\nMessageItem.displayName = 'MessageItem';\n","import React, { useCallback, useMemo, useState } from 'react';\nimport { MessageSquare } from 'lucide-react';\nimport { Button } from '../Button';\nimport { EmptyState } from '../EmptyState';\nimport { Skeleton } from '../Skeleton';\nimport { Spinner } from '../Spinner';\nimport { MessageComposer } from './MessageComposer.component';\nimport { MessageItem } from './MessageItem.component';\nimport type { CommentThreadProps, ConversationMessage, MessageDraft } from './Conversation.types';\nimport { useNewMessageIds } from './Conversation.hooks';\nimport {\n buildThread,\n classNames,\n continuesRun,\n replyTargetName,\n sortBySentAt,\n} from './Conversation.utils';\n\nconst CommentSkeleton: React.FC = () => (\n <div className=\"eidos-comment-thread-skeleton\" aria-hidden=\"true\">\n {[0, 1, 2].map((row) => (\n <div key={row} className=\"eidos-comment-thread-skeleton-row\">\n <Skeleton variant=\"circular\" width={28} height={28} />\n <Skeleton variant=\"text\" lines={2} />\n </div>\n ))}\n </div>\n);\n\n/**\n * A comment section: document flow, no internal scroll container, one level of\n * nesting.\n *\n * Shares its data model and message rendering with `Chat`, so history captured\n * in one can be displayed in the other. Unlike `Chat` it has no scroll region\n * of its own - it grows with the page and pages *downward* via `onLoadMore`.\n */\nexport const CommentThread: React.FC<CommentThreadProps> = ({\n messages,\n currentUserId,\n onSend,\n onReply,\n onRetry,\n readOnly = false,\n readOnlyMessage,\n renderBody,\n messageActions,\n renderMessageFooter,\n loading = false,\n emptyContent,\n hasMore = false,\n loadingMore = false,\n onLoadMore,\n groupConsecutive = true,\n groupWindowMinutes = 5,\n formatTimestamp,\n animateNewMessages = true,\n allowAttachments = false,\n attachmentAccept,\n order = 'oldest-first',\n composerPosition = 'bottom',\n placeholder = 'Add a comment...',\n sendOnEnter = false,\n title,\n ariaLabel = 'Comments',\n className = '',\n}) => {\n const [replyingToId, setReplyingToId] = useState<string | null>(null);\n const newIds = useNewMessageIds(messages, animateNewMessages);\n\n const byId = useMemo(() => new Map(messages.map((message) => [message.id, message])), [messages]);\n\n const roots = useMemo(() => {\n const thread = buildThread(messages);\n const sorted = sortBySentAt(thread.map((node) => node.message));\n const ordered = order === 'newest-first' ? [...sorted].reverse() : sorted;\n const nodeById = new Map(thread.map((node) => [node.message.id, node]));\n // Replies always read oldest-first, even when roots are reversed - a\n // conversation under a single comment is chronological by nature.\n return ordered.map((message) => nodeById.get(message.id)!);\n }, [messages, order]);\n\n const canReply = !readOnly && Boolean(onReply);\n const showComposer = !readOnly && Boolean(onSend);\n const isEmpty = !loading && messages.length === 0;\n const total = messages.length;\n\n const handleReply = useCallback(\n async (draft: MessageDraft) => {\n await onReply?.(draft);\n setReplyingToId(null);\n },\n [onReply],\n );\n\n const renderComment = (\n message: ConversationMessage,\n options: { rootId: string; previous?: ConversationMessage; isReply: boolean },\n ) => {\n const actions = readOnly ? undefined : messageActions?.(message);\n\n return (\n <MessageItem\n key={message.id}\n message={message}\n layout=\"comment\"\n isOwn={Boolean(currentUserId) && message.author.id === currentUserId}\n grouped={groupConsecutive && continuesRun(options.previous, message, groupWindowMinutes)}\n isNew={newIds.has(message.id)}\n actions={actions}\n footer={renderMessageFooter?.(message)}\n body={renderBody?.(message)}\n onRetry={!readOnly && onRetry ? () => onRetry(message) : undefined}\n replyingToName={\n options.isReply ? replyTargetName(message, byId, options.rootId) : undefined\n }\n onReply={canReply ? () => setReplyingToId(message.id) : undefined}\n formatTimestamp={formatTimestamp}\n />\n );\n };\n\n const composer = showComposer && (\n <MessageComposer\n onSubmit={onSend as NonNullable<typeof onSend>}\n placeholder={placeholder}\n submitLabel=\"Comment\"\n sendOnEnter={sendOnEnter}\n allowAttachments={allowAttachments}\n attachmentAccept={attachmentAccept}\n className=\"eidos-comment-thread-composer\"\n />\n );\n\n return (\n <section className={classNames('eidos-comment-thread', className)} aria-label={ariaLabel}>\n {(title || total > 0) && (\n <header className=\"eidos-comment-thread-header\">\n {title && <h3 className=\"eidos-comment-thread-title\">{title}</h3>}\n {total > 0 && (\n <span className=\"eidos-comment-thread-count\">\n {total} {total === 1 ? 'comment' : 'comments'}\n </span>\n )}\n </header>\n )}\n\n {composerPosition === 'top' && composer}\n\n {loading && <CommentSkeleton />}\n\n {isEmpty &&\n (emptyContent ?? (\n <EmptyState\n icon={<MessageSquare />}\n title=\"No comments yet\"\n description={showComposer ? 'Start the discussion by leaving a comment.' : undefined}\n size=\"sm\"\n />\n ))}\n\n {!loading && roots.length > 0 && (\n <ol className=\"eidos-conversation-list eidos-comment-thread-list\" aria-busy={loadingMore}>\n {roots.map((node) => (\n <li key={node.message.id} className=\"eidos-comment-thread-node\">\n <ol className=\"eidos-conversation-list\">\n {renderComment(node.message, { rootId: node.message.id, isReply: false })}\n </ol>\n\n {node.replies.length > 0 && (\n <ol className=\"eidos-conversation-list eidos-comment-thread-replies\">\n {node.replies.map((reply, index) =>\n renderComment(reply, {\n rootId: node.message.id,\n previous: node.replies[index - 1],\n isReply: true,\n }),\n )}\n </ol>\n )}\n\n {replyingToId &&\n (replyingToId === node.message.id ||\n node.replies.some((reply) => reply.id === replyingToId)) && (\n <div className=\"eidos-comment-thread-reply-composer\">\n <MessageComposer\n onSubmit={handleReply}\n onCancel={() => setReplyingToId(null)}\n parentId={replyingToId}\n replyingTo={byId.get(replyingToId)?.author.name}\n placeholder=\"Write a reply...\"\n submitLabel=\"Reply\"\n sendOnEnter={sendOnEnter}\n allowAttachments={allowAttachments}\n attachmentAccept={attachmentAccept}\n autoFocus\n />\n </div>\n )}\n </li>\n ))}\n </ol>\n )}\n\n {hasMore && (\n <div className=\"eidos-comment-thread-load-more\">\n {loadingMore ? (\n <span className=\"eidos-comment-thread-loading-more\">\n <Spinner size=\"sm\" color=\"secondary\" />\n Loading more comments…\n </span>\n ) : (\n <Button variant=\"outlined\" color=\"secondary\" size=\"sm\" onClick={onLoadMore}>\n Load more comments\n </Button>\n )}\n </div>\n )}\n\n {composerPosition === 'bottom' && composer}\n\n {readOnly && readOnlyMessage && (\n <p className=\"eidos-conversation-readonly\">{readOnlyMessage}</p>\n )}\n </section>\n );\n};\n\nCommentThread.displayName = 'CommentThread';\n"]}