@eluan/core 0.5.1 → 0.7.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 (417) hide show
  1. package/README.md +41 -3
  2. package/bin/eluan.mjs +75 -0
  3. package/bin/lib/check.mjs +271 -0
  4. package/bin/lib/skill.mjs +123 -0
  5. package/dist/{action-popover-D6K9aVFk.cjs → action-popover-Bt7U0g8y.cjs} +1 -1
  6. package/dist/{action-popover-BVJQBuky.js → action-popover-jEeycwXM.js} +2 -2
  7. package/dist/action-popover.cjs +1 -1
  8. package/dist/action-popover.js +1 -1
  9. package/dist/{avatar-CS5f1irF.js → avatar-C1LUOzjw.js} +1 -1
  10. package/dist/{avatar-Co-k8KqV.cjs → avatar-SwIO4oyt.cjs} +1 -1
  11. package/dist/avatar.cjs +1 -1
  12. package/dist/avatar.js +1 -1
  13. package/dist/badge-BLInSFM-.cjs +1 -0
  14. package/dist/{badge-D9NYZFWH.js → badge-Bj7i1Xf5.js} +20 -18
  15. package/dist/badge.cjs +1 -1
  16. package/dist/badge.js +1 -1
  17. package/dist/{banner-CyYFLZXw.js → banner-BqEziMp4.js} +11 -12
  18. package/dist/banner-C8OECYHz.cjs +1 -0
  19. package/dist/banner.cjs +1 -1
  20. package/dist/banner.js +1 -1
  21. package/dist/box-DG-tkaYi.cjs +1 -0
  22. package/dist/box-DKbNgGGG.js +17 -0
  23. package/dist/box.cjs +1 -0
  24. package/dist/box.d.ts +1 -0
  25. package/dist/box.js +5 -0
  26. package/dist/{breadcrumb-NWXeCH5q.cjs → breadcrumb-BGH_YhOZ.cjs} +1 -1
  27. package/dist/{breadcrumb-Cm1nb9Xj.js → breadcrumb-BVXSOA4Z.js} +2 -2
  28. package/dist/breadcrumb.cjs +1 -1
  29. package/dist/breadcrumb.js +1 -1
  30. package/dist/button-BUHQOcAo.cjs +1 -0
  31. package/dist/{button-ANAPDrvs.js → button-fCYiYUPE.js} +69 -60
  32. package/dist/button.cjs +1 -1
  33. package/dist/button.js +1 -1
  34. package/dist/calendar-2s_jGUBa.cjs +76 -0
  35. package/dist/{calendar-BpBsomy5.js → calendar-BN9BkjO_.js} +22 -22
  36. package/dist/calendar.cjs +1 -1
  37. package/dist/calendar.js +1 -1
  38. package/dist/card-CfSvhkGH.js +81 -0
  39. package/dist/card-DlP39QSZ.cjs +1 -0
  40. package/dist/card.cjs +1 -1
  41. package/dist/card.js +1 -1
  42. package/dist/{carousel-DuP0hvF-.js → carousel-BO6KUdP8.js} +1 -1
  43. package/dist/{carousel-BfL7oy_q.cjs → carousel-dypuabh8.cjs} +1 -1
  44. package/dist/carousel.cjs +1 -1
  45. package/dist/carousel.js +1 -1
  46. package/dist/{checkbox-Bi0Kmuut.js → checkbox-CGUTGery.js} +1 -1
  47. package/dist/{checkbox-M8DmWKiC.cjs → checkbox-Cq9sHU_S.cjs} +1 -1
  48. package/dist/{checkbox-group-KBwPhjmW.cjs → checkbox-group-DGXZ4o2-.cjs} +1 -1
  49. package/dist/{checkbox-group-CQMEJnhD.js → checkbox-group-Tkio3IhK.js} +1 -1
  50. package/dist/checkbox-group.cjs +1 -1
  51. package/dist/checkbox-group.js +1 -1
  52. package/dist/checkbox.cjs +1 -1
  53. package/dist/checkbox.js +1 -1
  54. package/dist/{code-block-C9u140Ob.js → code-block-CAXUOKNI.js} +10 -10
  55. package/dist/{code-block-_dFw7Su1.cjs → code-block-Co8uGXiG.cjs} +2 -2
  56. package/dist/code-block.cjs +1 -1
  57. package/dist/code-block.js +1 -1
  58. package/dist/command-C50Jkuv7.js +132 -0
  59. package/dist/command-DqNgPVsf.cjs +9 -0
  60. package/dist/command.cjs +1 -1
  61. package/dist/command.js +1 -1
  62. package/dist/components/box.d.ts +12 -0
  63. package/dist/components/card.d.ts +7 -2
  64. package/dist/components/grid.d.ts +35 -0
  65. package/dist/components/icon.d.ts +26 -0
  66. package/dist/components/input.d.ts +1 -1
  67. package/dist/components/layout-shared.d.ts +307 -0
  68. package/dist/components/navigation-drawer.d.ts +25 -5
  69. package/dist/components/row.d.ts +18 -0
  70. package/dist/components/stack.d.ts +14 -0
  71. package/dist/components/table.d.ts +8 -4
  72. package/dist/components/tone-shared.d.ts +39 -0
  73. package/dist/components/typography.d.ts +22 -2
  74. package/dist/components/visually-hidden.d.ts +11 -0
  75. package/dist/{context-menu-Bd6m1RYU.js → context-menu-CTyczUjx.js} +34 -34
  76. package/dist/context-menu-oQ6xMN6t.cjs +1 -0
  77. package/dist/context-menu.cjs +1 -1
  78. package/dist/context-menu.js +1 -1
  79. package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-C6oNQBAl.cjs} +1 -1
  80. package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-aYftFdRo.js} +1 -1
  81. package/dist/credit-card-input.cjs +1 -1
  82. package/dist/credit-card-input.js +1 -1
  83. package/dist/{date-picker-ni8td8Ru.js → date-picker-DK-G61Nn.js} +3 -3
  84. package/dist/{date-picker-DGBsfZXx.cjs → date-picker-D_aU_P3A.cjs} +1 -1
  85. package/dist/date-picker.cjs +1 -1
  86. package/dist/date-picker.js +1 -1
  87. package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-897BvwxW.cjs} +1 -1
  88. package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CECtSobs.js} +4 -4
  89. package/dist/datetime-picker.cjs +1 -1
  90. package/dist/datetime-picker.js +1 -1
  91. package/dist/decimal-input-B7IHYVXP.cjs +1 -0
  92. package/dist/decimal-input-ohejnbQg.js +177 -0
  93. package/dist/decimal-input.cjs +1 -1
  94. package/dist/decimal-input.js +1 -1
  95. package/dist/dialog-DIGW7qln.cjs +1 -0
  96. package/dist/dialog-DVhnZFqE.js +64 -0
  97. package/dist/dialog.cjs +1 -1
  98. package/dist/dialog.js +1 -1
  99. package/dist/dropdown-menu-BV2rX_ow.cjs +1 -0
  100. package/dist/dropdown-menu-C6NPtU9J.js +115 -0
  101. package/dist/dropdown-menu.cjs +1 -1
  102. package/dist/dropdown-menu.js +1 -1
  103. package/dist/{email-input-pX0hlYV3.js → email-input-CRd87a_c.js} +1 -1
  104. package/dist/{email-input-DFI4h_KN.cjs → email-input-Dvj1xSzJ.cjs} +1 -1
  105. package/dist/email-input.cjs +1 -1
  106. package/dist/email-input.js +1 -1
  107. package/dist/{fieldset-5V8wx-KE.js → fieldset-BxINrO_H.js} +6 -6
  108. package/dist/fieldset-C6cahGeV.cjs +1 -0
  109. package/dist/fieldset.cjs +1 -1
  110. package/dist/fieldset.js +1 -1
  111. package/dist/file-input-BzYcnore.cjs +1 -0
  112. package/dist/{file-input-B_aBgxmT.js → file-input-Ch16hNA1.js} +55 -55
  113. package/dist/file-input.cjs +1 -1
  114. package/dist/file-input.js +1 -1
  115. package/dist/{footer-DB0_-IwN.cjs → footer-B-fRLhqP.cjs} +1 -1
  116. package/dist/{footer-B3KUIwXW.js → footer-BiiV6-ZD.js} +9 -9
  117. package/dist/footer.cjs +1 -1
  118. package/dist/footer.js +1 -1
  119. package/dist/grid-BDz4Xs6M.cjs +1 -0
  120. package/dist/grid-BX5vZjDo.js +612 -0
  121. package/dist/grid.cjs +1 -0
  122. package/dist/grid.d.ts +1 -0
  123. package/dist/grid.js +5 -0
  124. package/dist/header-CvhqGcuo.cjs +1 -0
  125. package/dist/{header-CDOWlOAR.js → header-DwvyTpRi.js} +22 -22
  126. package/dist/header.cjs +1 -1
  127. package/dist/header.js +1 -1
  128. package/dist/hover-card-BQpzaazK.js +21 -0
  129. package/dist/{hover-card-C5KsTSZR.cjs → hover-card-V5A1HzEu.cjs} +1 -1
  130. package/dist/hover-card.cjs +1 -1
  131. package/dist/hover-card.js +1 -1
  132. package/dist/icon-BmLOodCQ.cjs +1 -0
  133. package/dist/icon-BwDfkIdR.js +153 -0
  134. package/dist/icon.cjs +1 -0
  135. package/dist/icon.d.ts +1 -0
  136. package/dist/icon.js +5 -0
  137. package/dist/index.cjs +10 -5
  138. package/dist/index.d.ts +6 -0
  139. package/dist/index.js +593 -516
  140. package/dist/input-Dtr0tlf7.cjs +1 -0
  141. package/dist/input-Zs45H33i.js +131 -0
  142. package/dist/input-otp-D-T32R3O.cjs +1 -0
  143. package/dist/{input-otp-DmEGB1nu.js → input-otp-DwdX6VlR.js} +33 -33
  144. package/dist/input-otp.cjs +1 -1
  145. package/dist/input-otp.js +1 -1
  146. package/dist/input.cjs +1 -1
  147. package/dist/input.js +1 -1
  148. package/dist/layout-shared-B_1iX4Hj.js +319 -0
  149. package/dist/layout-shared-CsBZcT4V.cjs +1 -0
  150. package/dist/{menubar-F1_bhmku.js → menubar-CodcV4b7.js} +28 -28
  151. package/dist/menubar-bOYi1jKo.cjs +1 -0
  152. package/dist/menubar.cjs +1 -1
  153. package/dist/menubar.js +1 -1
  154. package/dist/multi-select-ChfbxrG3.js +85 -0
  155. package/dist/multi-select-D573XqUT.cjs +1 -0
  156. package/dist/multi-select.cjs +1 -1
  157. package/dist/multi-select.js +1 -1
  158. package/dist/navigation-drawer-C7YYtBXz.js +198 -0
  159. package/dist/navigation-drawer-Cu2q1NMn.cjs +1 -0
  160. package/dist/navigation-drawer.cjs +1 -1
  161. package/dist/navigation-drawer.js +1 -1
  162. package/dist/{navigation-menu-BjA-PdMY.js → navigation-menu-BEp603xA.js} +16 -16
  163. package/dist/{navigation-menu-BtpLfxHN.cjs → navigation-menu-tw5cD7mL.cjs} +2 -2
  164. package/dist/navigation-menu.cjs +1 -1
  165. package/dist/navigation-menu.js +1 -1
  166. package/dist/number-input-C1RS-p2C.js +66 -0
  167. package/dist/number-input-N3-IvxZT.cjs +1 -0
  168. package/dist/number-input.cjs +1 -1
  169. package/dist/number-input.js +1 -1
  170. package/dist/{pagination-4IuE_APs.cjs → pagination-C6e9oVes.cjs} +1 -1
  171. package/dist/{pagination-DTWRjiOm.js → pagination-XlaE-Plb.js} +32 -32
  172. package/dist/pagination.cjs +1 -1
  173. package/dist/pagination.js +1 -1
  174. package/dist/{password-input-B9V45d3Q.js → password-input-CR6FT6Rh.js} +2 -2
  175. package/dist/{password-input-BwnlHPbX.cjs → password-input-CZ19HPZd.cjs} +1 -1
  176. package/dist/password-input.cjs +1 -1
  177. package/dist/password-input.js +1 -1
  178. package/dist/{phone-input-BQjZj5jI.cjs → phone-input-BZhkLmI6.cjs} +1 -1
  179. package/dist/{phone-input-CSBpGHvI.js → phone-input-CT9W87M7.js} +2 -2
  180. package/dist/phone-input.cjs +1 -1
  181. package/dist/phone-input.js +1 -1
  182. package/dist/popover-CE0n5BQv.cjs +1 -0
  183. package/dist/popover-CguR4kP7.js +70 -0
  184. package/dist/popover.cjs +1 -1
  185. package/dist/popover.js +1 -1
  186. package/dist/{progress-Dz_it5I-.js → progress-BpUNvswZ.js} +8 -7
  187. package/dist/progress-DSy_jRee.cjs +1 -0
  188. package/dist/progress.cjs +1 -1
  189. package/dist/progress.js +1 -1
  190. package/dist/providers/create-theme.d.ts +11 -2
  191. package/dist/providers/eluan-provider.d.ts +8 -6
  192. package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
  193. package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
  194. package/dist/radio-group.cjs +1 -1
  195. package/dist/radio-group.js +1 -1
  196. package/dist/{rich-text-BZSyuYSo.js → rich-text-CuAa5WkV.js} +21 -21
  197. package/dist/{rich-text-DerWxzdn.cjs → rich-text-p7H-0qE7.cjs} +2 -2
  198. package/dist/rich-text.cjs +1 -1
  199. package/dist/rich-text.js +1 -1
  200. package/dist/row-BYAk7G5d.js +37 -0
  201. package/dist/row-Bjn-GQAC.cjs +1 -0
  202. package/dist/row.cjs +1 -0
  203. package/dist/row.d.ts +1 -0
  204. package/dist/row.js +5 -0
  205. package/dist/{search-input-bFNW6oiE.js → search-input-CxKLBmii.js} +53 -53
  206. package/dist/{search-input-Dmmo-BEL.cjs → search-input-XmoL2YjY.cjs} +1 -1
  207. package/dist/search-input.cjs +1 -1
  208. package/dist/search-input.js +1 -1
  209. package/dist/select-BCDam7PR.cjs +1 -0
  210. package/dist/select-QgjG43ye.js +119 -0
  211. package/dist/select.cjs +1 -1
  212. package/dist/select.js +1 -1
  213. package/dist/sheet-BxNmBMti.cjs +1 -0
  214. package/dist/{sheet-D5HWF66e.js → sheet-D0hVuH9a.js} +7 -7
  215. package/dist/sheet.cjs +1 -1
  216. package/dist/sheet.js +1 -1
  217. package/dist/slider-Cv7uIp4z.js +16 -0
  218. package/dist/slider-Dci7KGjg.cjs +1 -0
  219. package/dist/slider.cjs +1 -1
  220. package/dist/slider.js +1 -1
  221. package/dist/stack-Ck1w2iJu.cjs +1 -0
  222. package/dist/stack-D2btWM1t.js +27 -0
  223. package/dist/stack.cjs +1 -0
  224. package/dist/stack.d.ts +1 -0
  225. package/dist/stack.js +5 -0
  226. package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
  227. package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
  228. package/dist/stepper.cjs +1 -1
  229. package/dist/stepper.js +1 -1
  230. package/dist/styles.css +1205 -189
  231. package/dist/switch-DQ4R-gjR.cjs +1 -0
  232. package/dist/switch-WaESqUuN.js +9 -0
  233. package/dist/switch.cjs +1 -1
  234. package/dist/switch.js +1 -1
  235. package/dist/table-YKEWGYnI.js +149 -0
  236. package/dist/table-zbkgP43L.cjs +1 -0
  237. package/dist/table.cjs +1 -1
  238. package/dist/table.js +1 -1
  239. package/dist/tabs-BwNIi7Dl.js +22 -0
  240. package/dist/tabs-DItFd2o9.cjs +1 -0
  241. package/dist/tabs.cjs +1 -1
  242. package/dist/tabs.js +1 -1
  243. package/dist/textarea-BWAPWDRt.js +8 -0
  244. package/dist/textarea-CniUTipL.cjs +1 -0
  245. package/dist/textarea.cjs +1 -1
  246. package/dist/textarea.js +1 -1
  247. package/dist/{time-input-BPoFvoeM.js → time-input-CeJVQKWO.js} +68 -68
  248. package/dist/time-input-eVFFYo10.cjs +1 -0
  249. package/dist/time-input.cjs +1 -1
  250. package/dist/time-input.js +1 -1
  251. package/dist/{toast-BK0ulAzi.cjs → toast-84RpQJtn.cjs} +1 -1
  252. package/dist/{toast-hI3pdZ2X.js → toast-BGKaAZwf.js} +1 -1
  253. package/dist/toast.cjs +1 -1
  254. package/dist/toast.js +1 -1
  255. package/dist/{toggle-Dv1VZ5Le.js → toggle-CxHqX2-V.js} +11 -11
  256. package/dist/toggle-DrJJAflI.cjs +1 -0
  257. package/dist/toggle-group-DvoxSJMq.cjs +1 -0
  258. package/dist/{toggle-group-DE8BPZih.js → toggle-group-k-kiBnEe.js} +21 -21
  259. package/dist/toggle-group.cjs +1 -1
  260. package/dist/toggle-group.js +1 -1
  261. package/dist/toggle.cjs +1 -1
  262. package/dist/toggle.js +1 -1
  263. package/dist/{tooltip-DZqn4wKl.js → tooltip-1Biy6A0m.js} +3 -3
  264. package/dist/{tooltip-faf1dIXp.cjs → tooltip-DIerl2vz.cjs} +1 -1
  265. package/dist/tooltip.cjs +1 -1
  266. package/dist/tooltip.js +1 -1
  267. package/dist/{tree-view-CyeJR7cW.js → tree-view-Bswh2RGr.js} +37 -37
  268. package/dist/tree-view-DDX9QjzF.cjs +1 -0
  269. package/dist/tree-view.cjs +1 -1
  270. package/dist/tree-view.js +1 -1
  271. package/dist/visually-hidden-BQMRYGxP.js +14 -0
  272. package/dist/visually-hidden-DzxxOswl.cjs +1 -0
  273. package/dist/visually-hidden.cjs +1 -0
  274. package/dist/visually-hidden.d.ts +1 -0
  275. package/dist/visually-hidden.js +5 -0
  276. package/package.json +12 -8
  277. package/skills/eluan/DESIGN.md +411 -0
  278. package/skills/eluan/SKILL.md +202 -0
  279. package/skills/eluan/components/accordion.md +212 -0
  280. package/skills/eluan/components/action-popover.md +266 -0
  281. package/skills/eluan/components/aspect-ratio.md +169 -0
  282. package/skills/eluan/components/avatar.md +277 -0
  283. package/skills/eluan/components/badge.md +190 -0
  284. package/skills/eluan/components/banner.md +247 -0
  285. package/skills/eluan/components/box.md +166 -0
  286. package/skills/eluan/components/breadcrumb.md +240 -0
  287. package/skills/eluan/components/button.md +214 -0
  288. package/skills/eluan/components/calendar.md +192 -0
  289. package/skills/eluan/components/card.md +271 -0
  290. package/skills/eluan/components/carousel.md +274 -0
  291. package/skills/eluan/components/checkbox-group.md +228 -0
  292. package/skills/eluan/components/checkbox.md +226 -0
  293. package/skills/eluan/components/code-block.md +193 -0
  294. package/skills/eluan/components/collapsible.md +240 -0
  295. package/skills/eluan/components/command.md +359 -0
  296. package/skills/eluan/components/context-menu.md +296 -0
  297. package/skills/eluan/components/credit-card-input.md +217 -0
  298. package/skills/eluan/components/date-picker.md +255 -0
  299. package/skills/eluan/components/date-time-picker.md +196 -0
  300. package/skills/eluan/components/decimal-input.md +232 -0
  301. package/skills/eluan/components/dialog.md +322 -0
  302. package/skills/eluan/components/drawer.md +292 -0
  303. package/skills/eluan/components/dropdown-menu.md +450 -0
  304. package/skills/eluan/components/email-input.md +200 -0
  305. package/skills/eluan/components/fieldset.md +219 -0
  306. package/skills/eluan/components/file-input.md +249 -0
  307. package/skills/eluan/components/footer.md +290 -0
  308. package/skills/eluan/components/form-label.md +254 -0
  309. package/skills/eluan/components/grid.md +192 -0
  310. package/skills/eluan/components/header.md +242 -0
  311. package/skills/eluan/components/hover-card.md +215 -0
  312. package/skills/eluan/components/icon.md +161 -0
  313. package/skills/eluan/components/input-otp.md +227 -0
  314. package/skills/eluan/components/input.md +249 -0
  315. package/skills/eluan/components/kbd.md +216 -0
  316. package/skills/eluan/components/media.md +244 -0
  317. package/skills/eluan/components/menubar.md +300 -0
  318. package/skills/eluan/components/multi-select.md +221 -0
  319. package/skills/eluan/components/navigation-drawer.md +297 -0
  320. package/skills/eluan/components/navigation-menu.md +291 -0
  321. package/skills/eluan/components/number-input.md +190 -0
  322. package/skills/eluan/components/pagination.md +262 -0
  323. package/skills/eluan/components/password-input.md +218 -0
  324. package/skills/eluan/components/phone-input.md +205 -0
  325. package/skills/eluan/components/popover.md +250 -0
  326. package/skills/eluan/components/progress.md +185 -0
  327. package/skills/eluan/components/radio-group.md +232 -0
  328. package/skills/eluan/components/rich-text.md +195 -0
  329. package/skills/eluan/components/row.md +174 -0
  330. package/skills/eluan/components/scroll-area.md +203 -0
  331. package/skills/eluan/components/search-input.md +281 -0
  332. package/skills/eluan/components/segmented-control.md +201 -0
  333. package/skills/eluan/components/select.md +296 -0
  334. package/skills/eluan/components/separator.md +179 -0
  335. package/skills/eluan/components/sheet.md +326 -0
  336. package/skills/eluan/components/skeleton.md +202 -0
  337. package/skills/eluan/components/slider.md +195 -0
  338. package/skills/eluan/components/spinner.md +187 -0
  339. package/skills/eluan/components/stack.md +158 -0
  340. package/skills/eluan/components/stepper.md +236 -0
  341. package/skills/eluan/components/switch.md +218 -0
  342. package/skills/eluan/components/table.md +348 -0
  343. package/skills/eluan/components/tabs.md +277 -0
  344. package/skills/eluan/components/textarea.md +202 -0
  345. package/skills/eluan/components/time-input.md +181 -0
  346. package/skills/eluan/components/toast.md +251 -0
  347. package/skills/eluan/components/toggle-group.md +241 -0
  348. package/skills/eluan/components/toggle.md +198 -0
  349. package/skills/eluan/components/tooltip.md +222 -0
  350. package/skills/eluan/components/tree-view.md +213 -0
  351. package/skills/eluan/components/typography.md +210 -0
  352. package/skills/eluan/components/visually-hidden.md +132 -0
  353. package/skills/eluan/foundations/colour.md +257 -0
  354. package/skills/eluan/foundations/elevation.md +86 -0
  355. package/skills/eluan/foundations/iconography.md +70 -0
  356. package/skills/eluan/foundations/look.md +135 -0
  357. package/skills/eluan/foundations/motion.md +60 -0
  358. package/skills/eluan/foundations/radius.md +73 -0
  359. package/skills/eluan/foundations/spacing.md +98 -0
  360. package/skills/eluan/foundations/theming.md +212 -0
  361. package/skills/eluan/foundations/typography.md +169 -0
  362. package/skills/eluan/patterns/app-shell.md +222 -0
  363. package/skills/eluan/patterns/dashboard.md +249 -0
  364. package/skills/eluan/patterns/empty-states.md +78 -0
  365. package/skills/eluan/patterns/feedback.md +95 -0
  366. package/skills/eluan/patterns/forms.md +138 -0
  367. package/skills/eluan/patterns/navigation.md +96 -0
  368. package/skills/eluan/patterns/page-layout.md +185 -0
  369. package/dist/badge-DXKWztL-.cjs +0 -1
  370. package/dist/banner-COlEFRuK.cjs +0 -1
  371. package/dist/button-Ny6OF8Un.cjs +0 -1
  372. package/dist/calendar-7LX5YGGT.cjs +0 -76
  373. package/dist/card-BC_4C3ns.js +0 -70
  374. package/dist/card-C88--zB4.cjs +0 -1
  375. package/dist/command-BCl0seLL.cjs +0 -9
  376. package/dist/command-Chs5VlBL.js +0 -132
  377. package/dist/context-menu-1WehRCpR.cjs +0 -1
  378. package/dist/decimal-input-BLmifKF2.cjs +0 -1
  379. package/dist/decimal-input-yTk35W_5.js +0 -177
  380. package/dist/dialog-B8eWKqzS.js +0 -64
  381. package/dist/dialog-DWYtFhZl.cjs +0 -1
  382. package/dist/dropdown-menu-_h_fqgvS.cjs +0 -1
  383. package/dist/dropdown-menu-p0NkOoTP.js +0 -115
  384. package/dist/fieldset-C3aAINhi.cjs +0 -1
  385. package/dist/file-input-D62FEnKg.cjs +0 -1
  386. package/dist/header-CiZQY_7S.cjs +0 -1
  387. package/dist/hover-card-C_FCzE41.js +0 -21
  388. package/dist/input-BrGJn-D9.cjs +0 -1
  389. package/dist/input-Cccufiqn.js +0 -128
  390. package/dist/input-otp-DcZ7wyjs.cjs +0 -1
  391. package/dist/menubar-CKWQEl7c.cjs +0 -1
  392. package/dist/multi-select-B6NBbDCW.js +0 -85
  393. package/dist/multi-select-kcoUbSwE.cjs +0 -1
  394. package/dist/navigation-drawer-BbeDYPhu.js +0 -171
  395. package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
  396. package/dist/number-input-Bc7jUsu-.cjs +0 -1
  397. package/dist/number-input-vICbRc2y.js +0 -66
  398. package/dist/popover-DPc4rRsR.js +0 -70
  399. package/dist/popover-Db6VOysz.cjs +0 -1
  400. package/dist/progress-DpQjGEyn.cjs +0 -1
  401. package/dist/select-1Eb3NSrR.cjs +0 -1
  402. package/dist/select-DDSYjKtj.js +0 -119
  403. package/dist/sheet-7NP1LuHy.cjs +0 -1
  404. package/dist/slider-CZQBAXup.js +0 -16
  405. package/dist/slider-DdEOapYP.cjs +0 -1
  406. package/dist/switch-C7EBLT5H.js +0 -9
  407. package/dist/switch-KzBijHMJ.cjs +0 -1
  408. package/dist/table-DopzfXYj.js +0 -101
  409. package/dist/table-xNu_KUaU.cjs +0 -1
  410. package/dist/tabs-C9NKBmH0.js +0 -22
  411. package/dist/tabs-DztJ2iVc.cjs +0 -1
  412. package/dist/textarea-DXUk1b_-.js +0 -8
  413. package/dist/textarea-Dl-daLHR.cjs +0 -1
  414. package/dist/time-input-DR2snTgB.cjs +0 -1
  415. package/dist/toggle-Bvh1v32T.cjs +0 -1
  416. package/dist/toggle-group-SyHMwO90.cjs +0 -1
  417. package/dist/tree-view-CNvEc1TT.cjs +0 -1
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: CheckboxGroup
3
+ use_when: The user picks any number of options from a short, visible list, such as notification channels or permissions.
4
+ instead_of: RadioGroup when only one option can be chosen; MultiSelect for long or searchable lists; Switch rows for settings that apply immediately.
5
+ source: packages/core/src/components/checkbox-group.tsx
6
+ ---
7
+
8
+ # CheckboxGroup
9
+
10
+ ## 1. Overview
11
+
12
+ CheckboxGroup manages a list of checkboxes as one `string[]` value. Each CheckboxGroupItem renders a Checkbox with its own Label and an optional description. The group renders a `<div role="group">` and stacks items vertically or wraps them in a row.
13
+
14
+ ## 2. When to use
15
+
16
+ - Choosing several options from a visible list: Email, SMS and Push notifications.
17
+ - Granting permissions: Read, Write, Admin.
18
+ - Short filters on one line, such as sizes S, M, L, with `orientation="horizontal"`.
19
+
20
+ ### When not to use
21
+
22
+ - Only one option can be chosen → use [RadioGroup](./radio-group.md).
23
+ - A long or searchable list → use [MultiSelect](./multi-select.md).
24
+ - A single yes/no choice → use [Checkbox](./checkbox.md).
25
+ - Settings that apply the moment they change → use a list of [Switch](./switch.md) rows.
26
+ - A row of pressable toolbar options → use [ToggleGroup](./toggle-group.md).
27
+
28
+ ## 3. Anatomy
29
+
30
+ 1. **Group**: the `<div role="group">`. A grid with a `--spacing-md` gap when vertical; a wrapping row with a `--spacing-lg` gap when horizontal.
31
+ 2. **Item row**: one CheckboxGroupItem. A flex row with a `--spacing-sm` gap; centred when it has no description, top-aligned when it has one.
32
+ 3. **Checkbox**: a [Checkbox](./checkbox.md) with `id` defaulting to `checkbox-{value}`.
33
+ 4. **Label**: a Label wired to the checkbox, from `label`. It sits in a box with a `--size-xxs` minimum height, so the label stays centred on the checkbox even when a description flows below it. This is deliberate; keep it.
34
+ 5. **Description** (optional): a `<p>` from `description`, in `--interactive-fg-alt` at `--font-size-sm`.
35
+
36
+ ## 4. Variants
37
+
38
+ CheckboxGroup has no variants. `orientation` sets the layout:
39
+
40
+ | Orientation | Use for |
41
+ | --- | --- |
42
+ | `vertical` (default) | Most lists, and any list with descriptions. |
43
+ | `horizontal` | A few short labels that fit on one line: S, M, L. |
44
+
45
+ ## 5. Sizes
46
+
47
+ CheckboxGroup has no `size` prop. Checkboxes are `--size-xxs` and spacing follows density.
48
+
49
+ ## 6. States
50
+
51
+ | State | Looks like | Notes |
52
+ | --- | --- | --- |
53
+ | Default, hover, checked | As [Checkbox](./checkbox.md) | |
54
+ | Focus | Checkbox outline in `--focus-ring` | Never remove or restyle the focus ring. |
55
+ | Disabled | Checkbox disabled; label and description in `--interactive-fg-disabled`, not-allowed cursor | `disabled` on the group disables every item; on an item, only that one. |
56
+ | Checked and disabled | Reads as unchecked: the box turns pale and the check disappears into it | A locked-on item looks off. Say it in the label or description ("Required for all admins"). |
57
+ | Error | No error style | Show a FormMessage under the group and point the group's `aria-describedby` at it. |
58
+
59
+ ## 7. Content guidelines
60
+
61
+ - Name the group with a visible heading: "Notify me by", "Permissions".
62
+ - Label each option with a short noun phrase: "Email notifications", "SMS notifications".
63
+ - Use the description for one sentence on what the option does: "Receive updates about your account via email."
64
+ - Keep option labels parallel in form and order them logically.
65
+
66
+ | Do | Don't |
67
+ | --- | --- |
68
+ | Email notifications | Would you like to receive email? |
69
+ | Receive updates about your account via email. | Email. |
70
+ | Read · Write · Admin | Read · Can write things · ADMIN |
71
+
72
+ ## 8. Rules
73
+
74
+ 1. Name the group: `aria-labelledby` pointing at a visible heading, or `aria-label`. `role="group"` has no name of its own.
75
+ 2. Read and set the selection with `value` or `defaultValue` and `onValueChange` (a `string[]`). There's no `onChange`.
76
+ 3. Give every item a unique `value`. If the same value appears in two groups on one page, pass a unique `id` to each item; the default `checkbox-{value}` ids would collide and wire labels to the wrong box.
77
+ 4. Submit the array from your state. Native form data won't hold the item values: each checked item submits `"on"` under its `name`.
78
+ 5. Put only CheckboxGroupItem, or a custom item built with `useCheckboxGroup`, inside the group.
79
+ 6. Don't put essential information only in `description`; it isn't linked to the checkbox and isn't announced with it.
80
+ 7. Never pass `className` or `style`; they're dropped.
81
+
82
+ ## 9. Dos and don'ts
83
+
84
+ **Do:** name the group and control it with `onValueChange`.
85
+
86
+ ```tsx
87
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
88
+ <Typography id="notify-heading" variant="label" weight="medium">Notify me by</Typography>
89
+ <CheckboxGroup aria-labelledby="notify-heading" value={channels} onValueChange={setChannels}>
90
+ <CheckboxGroupItem value="email" label="Email" />
91
+ <CheckboxGroupItem value="sms" label="SMS" />
92
+ </CheckboxGroup>
93
+ </div>
94
+ ```
95
+
96
+ **Don't:** hand-roll the list with separate Checkboxes and array logic.
97
+
98
+ ```tsx
99
+ <div>
100
+ <Checkbox onCheckedChange={(c) => setChannels(c ? [...channels, "email"] : channels.filter((v) => v !== "email"))} /> Email
101
+ <Checkbox onCheckedChange={(c) => setChannels(c ? [...channels, "sms"] : channels.filter((v) => v !== "sms"))} /> SMS
102
+ </div>
103
+ ```
104
+
105
+ **Do:** give items unique ids when two groups share values.
106
+
107
+ ```tsx
108
+ <CheckboxGroup aria-label="Comment notifications">
109
+ <CheckboxGroupItem id="comments-email" value="email" label="Email" />
110
+ </CheckboxGroup>
111
+ <CheckboxGroup aria-label="Mention notifications">
112
+ <CheckboxGroupItem id="mentions-email" value="email" label="Email" />
113
+ </CheckboxGroup>
114
+ ```
115
+
116
+ **Don't:** let two items default to the same id.
117
+
118
+ ```tsx
119
+ <CheckboxGroup aria-label="Comment notifications">
120
+ <CheckboxGroupItem value="email" label="Email" />
121
+ </CheckboxGroup>
122
+ <CheckboxGroup aria-label="Mention notifications">
123
+ <CheckboxGroupItem value="email" label="Email" />
124
+ </CheckboxGroup>
125
+ ```
126
+
127
+ ## 10. Accessibility
128
+
129
+ - Role: `group` on the container; each item is a `checkbox`.
130
+ - Label: the group needs `aria-labelledby` or `aria-label`. Each checkbox is named by its `label`. The `description` has no id and isn't linked, so screen readers don't read it with the checkbox.
131
+ - Keyboard: every checkbox is its own Tab stop. Space toggles; Enter does nothing. There's no arrow-key navigation.
132
+ - Focus: the Checkbox focus outline.
133
+ - Contrast: handled by the theme. Don't override colours.
134
+
135
+ ## 11. Behaviour
136
+
137
+ - Responsive: vertical stacks items; horizontal wraps them onto new lines when they don't fit.
138
+ - Overflow and truncation: labels and descriptions wrap.
139
+ - Order: a newly checked value is appended, so the array follows click order. Sort it yourself if order matters.
140
+ - Motion: from Checkbox (150ms). Don't add your own.
141
+
142
+ ## 12. API
143
+
144
+ <!-- api:start -->
145
+ ### CheckboxGroup
146
+
147
+ | Prop | Type | Default | Description |
148
+ | --- | --- | --- | --- |
149
+ | `value` | `string[]` | | Controlled selection. Pair with `onValueChange`. |
150
+ | `defaultValue` | `string[]` | `[]` | Uncontrolled starting selection. |
151
+ | `onValueChange` | `(value: string[]) => void` | | Called with the next selection, in both modes. |
152
+ | `disabled` | `boolean` | | Disables every item. |
153
+ | `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Stack or wrap the items. |
154
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style`, `onChange`, `defaultValue` | | `aria-labelledby`, `aria-label`, `aria-describedby`, `id`. `ref` goes to the group `<div>`. |
155
+
156
+ ### CheckboxGroupItem
157
+
158
+ | Prop | Type | Default | Description |
159
+ | --- | --- | --- | --- |
160
+ | `value` | `string` | required | The value added to the group's array when checked. |
161
+ | `label` | `string` | required | Visible label, wired to the checkbox. |
162
+ | `description` | `string` | | One line of supporting text under the label. Not linked to the checkbox. |
163
+ | `disabled` | `boolean` | | Disables this item. The group's `disabled` also applies. |
164
+ | `id` | `string` | `checkbox-{value}` | The checkbox id. Set it when values repeat on a page. |
165
+ | `...props` | Checkbox props without `checked`, `onCheckedChange`, `value`, `className`, `style` | | `name`, `required`, `aria-*`, passed to the Checkbox. `ref` goes to the checkbox `<button>`. |
166
+
167
+ ### useCheckboxGroup
168
+
169
+ | Prop | Type | Default | Description |
170
+ | --- | --- | --- | --- |
171
+ | returns | `{ value: string[]; onItemChange: (itemValue: string, checked: boolean) => void; disabled?: boolean }` | | Reads the nearest CheckboxGroup. Throws outside one. Use it to build a custom item. |
172
+ <!-- api:end -->
173
+
174
+ ## 13. Examples
175
+
176
+ ```tsx
177
+ import { CheckboxGroup, CheckboxGroupItem, Typography } from "@eluan/core";
178
+ import * as React from "react";
179
+
180
+ export function NotificationChannels({ onChange }: { onChange: (channels: string[]) => void }) {
181
+ const [channels, setChannels] = React.useState<string[]>(["email", "security"]);
182
+
183
+ return (
184
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
185
+ <Typography id="channels-heading" variant="label" weight="medium">
186
+ Notify me by
187
+ </Typography>
188
+ <CheckboxGroup
189
+ aria-labelledby="channels-heading"
190
+ value={channels}
191
+ onValueChange={(next) => {
192
+ setChannels(next);
193
+ onChange(next);
194
+ }}
195
+ >
196
+ <CheckboxGroupItem
197
+ value="email"
198
+ label="Email notifications"
199
+ description="Receive updates about your account via email."
200
+ />
201
+ <CheckboxGroupItem
202
+ value="sms"
203
+ label="SMS notifications"
204
+ description="Get text messages for important alerts."
205
+ />
206
+ <CheckboxGroupItem
207
+ value="security"
208
+ label="Security alerts (always on)"
209
+ description="Required for every account. Contact your admin to change it."
210
+ disabled
211
+ />
212
+ </CheckboxGroup>
213
+ </div>
214
+ );
215
+ }
216
+ ```
217
+
218
+ ## 14. Related components
219
+
220
+ - [Checkbox](./checkbox.md): the single control each item renders.
221
+ - [RadioGroup](./radio-group.md): the single-choice equivalent.
222
+ - [MultiSelect](./multi-select.md): multiple choice from a long list.
223
+ - [Fieldset](./fieldset.md): titles the group alongside related fields.
224
+ - See [../patterns/forms.md](../patterns/forms.md) for grouping and labelling options.
225
+
226
+ ## 15. Common agent mistakes
227
+
228
+ _Filled from evals._
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: Checkbox
3
+ use_when: A single yes/no choice the user confirms when they submit a form, such as accepting terms, or a select-all control above a list.
4
+ instead_of: Switch for settings that apply immediately; CheckboxGroup for a labelled list of options; RadioGroup when only one option can be chosen.
5
+ source: packages/core/src/components/checkbox.tsx
6
+ ---
7
+
8
+ # Checkbox
9
+
10
+ ## 1. Overview
11
+
12
+ Checkbox is a square control for one on/off choice, built on Radix Checkbox. It renders a `<button role="checkbox">` with a check icon and supports checked, unchecked and indeterminate states. It has no label of its own: pair it with a Label.
13
+
14
+ ## 2. When to use
15
+
16
+ - One independent choice in a form that the user submits: "I agree to the Terms of Service", "Remember this device".
17
+ - A select-all control above a list, using the indeterminate state when only some items are selected.
18
+ - One checkbox in a layout CheckboxGroup can't produce, with your own Label.
19
+
20
+ ### When not to use
21
+
22
+ - A setting that takes effect the moment it changes → use [Switch](./switch.md).
23
+ - A list of related options with labels and descriptions → use [CheckboxGroup](./checkbox-group.md).
24
+ - One choice out of several → use [RadioGroup](./radio-group.md).
25
+ - A pressed/unpressed toolbar button → use [Toggle](./toggle.md).
26
+
27
+ ## 3. Anatomy
28
+
29
+ 1. **Box**: the `<button role="checkbox">`. `--size-xxs` square, `--curves-xs` radius, 1px `--interactive-border-alt` border.
30
+ 2. **Indicator**: always mounted; fades the check in and out with opacity.
31
+ 3. **Check icon**: a Lucide `Check` at stroke width 3, `--spacing-md` square. White (`--interactive-fg-selected`) on the filled box when checked.
32
+ 4. **Hidden input**: inside a `<form>`, Radix adds a hidden native checkbox so `name` and `value` submit with the form.
33
+ 5. **Label** (yours): a Label beside the box, with `htmlFor` matching the Checkbox `id`.
34
+
35
+ ## 4. Variants
36
+
37
+ Checkbox has no variants.
38
+
39
+ ## 5. Sizes
40
+
41
+ Checkbox has no `size` prop. The box is `--size-xxs` and follows density.
42
+
43
+ ## 6. States
44
+
45
+ | State | Looks like | Notes |
46
+ | --- | --- | --- |
47
+ | Unchecked | Transparent box, `--interactive-border-alt` border | |
48
+ | Hover | `--interactive-bg-hover` fill | |
49
+ | Focus | 1px outline in `--focus-ring`, 1px offset | Never remove or restyle the focus ring. |
50
+ | Checked | `--interactive-bg-selected` fill and border, white check | |
51
+ | Indeterminate | `aria-checked="mixed"`. The box stays unfilled and shows the check icon in the surrounding text colour; there's no dash | Use it only for a select-all parent. |
52
+ | Disabled | `--interactive-bg-disabled` fill, `--interactive-border-disabled` border, not-allowed cursor | Disable its Label too. |
53
+ | Checked and disabled | Reads as empty: the fill turns pale and the white check disappears into it | Don't rely on it to show a locked-on choice. Say it in the label ("Included in your plan") or show the value as text. |
54
+ | Error | No error style | Set `aria-invalid={true}` and show a FormMessage linked with `aria-describedby`. |
55
+
56
+ ## 7. Content guidelines
57
+
58
+ - Write the label as what will be true when it's checked: "Email me product updates", not "Don't email me".
59
+ - Keep it short, in sentence case. Put details or links in a description under the label.
60
+ - Never make the user uncheck a box to opt out of something they didn't choose.
61
+
62
+ | Do | Don't |
63
+ | --- | --- |
64
+ | Email me product updates | Uncheck to stop receiving emails |
65
+ | I agree to the Terms of Service | Yes |
66
+ | Remember this device | Remember me? |
67
+
68
+ ## 8. Rules
69
+
70
+ 1. Pair every Checkbox with a Label whose `htmlFor` matches its `id`, or give it `aria-label`. The box has no text.
71
+ 2. Read changes with `onCheckedChange`; it receives `true`, `false` or `"indeterminate"`. Native `onChange` doesn't fire (it's a button).
72
+ 3. Control it with `checked` and `onCheckedChange` together, or leave it uncontrolled with `defaultChecked`.
73
+ 4. Set `name` (and `value` if `"on"` isn't what your server expects) when the form submits natively.
74
+ 5. Don't use a Checkbox for a setting that saves on change; use Switch.
75
+ 6. Use CheckboxGroup for a list of related options instead of managing an array by hand.
76
+ 7. Never pass `className` or `style`; they're dropped.
77
+
78
+ ## 9. Dos and don'ts
79
+
80
+ **Do:** pair the box with a Label so both are clickable.
81
+
82
+ ```tsx
83
+ <div style={{ display: "flex", alignItems: "center", gap: "var(--spacing-sm)" }}>
84
+ <Checkbox id="remember-device" name="rememberDevice" />
85
+ <Label htmlFor="remember-device">Remember this device</Label>
86
+ </div>
87
+ ```
88
+
89
+ **Don't:** leave the text unconnected.
90
+
91
+ ```tsx
92
+ <div>
93
+ <Checkbox />
94
+ <span>Remember this device</span>
95
+ </div>
96
+ ```
97
+
98
+ **Do:** state a locked-on choice in words.
99
+
100
+ ```tsx
101
+ <div style={{ display: "flex", alignItems: "center", gap: "var(--spacing-sm)" }}>
102
+ <Checkbox id="audit-log" checked disabled />
103
+ <Label htmlFor="audit-log" disabled>Audit log (included in your plan)</Label>
104
+ </div>
105
+ ```
106
+
107
+ **Don't:** rely on a checked, disabled box alone to say it's on.
108
+
109
+ ```tsx
110
+ <Checkbox checked disabled aria-label="Audit log" />
111
+ ```
112
+
113
+ ## 10. Accessibility
114
+
115
+ - Role: `checkbox` (Radix renders a `<button>`), with `aria-checked` set to `true`, `false` or `"mixed"`.
116
+ - Label: a Label with `htmlFor` matching the Checkbox `id`, or `aria-label`.
117
+ - Keyboard: Space toggles. Enter does nothing (Radix blocks it, following WAI-ARIA). Tab moves between checkboxes.
118
+ - Focus: visible outline on `:focus-visible`. Disabled checkboxes use the native `disabled` attribute and are skipped by Tab.
119
+ - Contrast: handled by the theme. Don't override colours.
120
+
121
+ ## 11. Behaviour
122
+
123
+ - Responsive: the box has a fixed size and doesn't shrink beside long labels. Centre it on a one-line label; for a label with a description, align to the top and wrap the label in a `--size-xxs` minimum-height box, as CheckboxGroup does.
124
+ - Motion: colours change over 150ms and the check fades over 150ms. Don't add your own.
125
+ - Forms: inside a `<form>`, a hidden input submits `value` (default `"on"`) under `name` when checked.
126
+
127
+ ## 12. API
128
+
129
+ <!-- api:start -->
130
+ | Prop | Type | Default | Description |
131
+ | --- | --- | --- | --- |
132
+ | `checked` | `boolean \| "indeterminate"` | | Controlled state. Pair with `onCheckedChange`. |
133
+ | `defaultChecked` | `boolean \| "indeterminate"` | | Uncontrolled starting state. |
134
+ | `onCheckedChange` | `(checked: boolean \| "indeterminate") => void` | | Called when the user toggles it. |
135
+ | `disabled` | `boolean` | `false` | Prevents interaction. |
136
+ | `required` | `boolean` | `false` | Marks it required for form validation. |
137
+ | `name` | `string` | | Field name for form submission. |
138
+ | `value` | `string` | `"on"` | Value submitted when checked. |
139
+ | `id` | `string` | | Match it with the Label's `htmlFor`. |
140
+ | `...props` | Radix `Checkbox.Root` props without `className`, `style` | | Button attributes and `aria-*`. `ref` goes to the `<button>`. |
141
+ <!-- api:end -->
142
+
143
+ ## 13. Examples
144
+
145
+ ```tsx
146
+ import { Button, Checkbox, FormDescription, FormMessage, Label } from "@eluan/core";
147
+ import * as React from "react";
148
+
149
+ const row = { display: "flex", alignItems: "flex-start", gap: "var(--spacing-sm)" } as const;
150
+ const labelLine = { display: "flex", alignItems: "center", minHeight: "var(--size-xxs)" } as const;
151
+ const copy = { display: "flex", flexDirection: "column", gap: "var(--spacing-xxs)" } as const;
152
+
153
+ export function SignUpConsent({ onContinue }: { onContinue: (updates: boolean) => void }) {
154
+ const [acceptedTerms, setAcceptedTerms] = React.useState(false);
155
+ const [productUpdates, setProductUpdates] = React.useState(false);
156
+ const [showError, setShowError] = React.useState(false);
157
+
158
+ function handleSubmit(event: React.FormEvent) {
159
+ event.preventDefault();
160
+ if (!acceptedTerms) {
161
+ setShowError(true);
162
+ return;
163
+ }
164
+ onContinue(productUpdates);
165
+ }
166
+
167
+ return (
168
+ <form
169
+ onSubmit={handleSubmit}
170
+ style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-lg)" }}
171
+ >
172
+ <div style={row}>
173
+ <Checkbox
174
+ id="accept-terms"
175
+ name="acceptTerms"
176
+ required
177
+ checked={acceptedTerms}
178
+ onCheckedChange={(checked) => {
179
+ setAcceptedTerms(checked === true);
180
+ setShowError(false);
181
+ }}
182
+ aria-invalid={showError ? true : undefined}
183
+ aria-describedby={showError ? "accept-terms-hint accept-terms-error" : "accept-terms-hint"}
184
+ />
185
+ <div style={copy}>
186
+ <span style={labelLine}>
187
+ <Label htmlFor="accept-terms" required>I agree to the Terms of Service</Label>
188
+ </span>
189
+ <FormDescription id="accept-terms-hint">
190
+ You can read them at acme.com/terms before continuing.
191
+ </FormDescription>
192
+ {showError && (
193
+ <FormMessage id="accept-terms-error">Accept the Terms of Service to create an account</FormMessage>
194
+ )}
195
+ </div>
196
+ </div>
197
+
198
+ <div style={{ display: "flex", alignItems: "center", gap: "var(--spacing-sm)" }}>
199
+ <Checkbox
200
+ id="product-updates"
201
+ name="productUpdates"
202
+ checked={productUpdates}
203
+ onCheckedChange={(checked) => setProductUpdates(checked === true)}
204
+ />
205
+ <Label htmlFor="product-updates">Email me product updates</Label>
206
+ </div>
207
+
208
+ <div style={{ display: "flex", justifyContent: "flex-end" }}>
209
+ <Button type="submit">Create account</Button>
210
+ </div>
211
+ </form>
212
+ );
213
+ }
214
+ ```
215
+
216
+ ## 14. Related components
217
+
218
+ - [CheckboxGroup](./checkbox-group.md): a managed list of checkboxes with labels and descriptions.
219
+ - [Switch](./switch.md): an on/off control for settings that apply immediately.
220
+ - [RadioGroup](./radio-group.md): one choice from several.
221
+ - [Label](./form-label.md): the Label, FormDescription and FormMessage around the box.
222
+ - See [../patterns/forms.md](../patterns/forms.md) for when to use Checkbox or Switch in a form.
223
+
224
+ ## 15. Common agent mistakes
225
+
226
+ _Filled from evals._
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: CodeBlock
3
+ use_when: Showing a multi-line code sample, config file or command with syntax highlighting and a copy button.
4
+ instead_of: Kbd for keyboard keys; an inline code element with the mono font for code inside a sentence; Textarea for code the user edits.
5
+ source: packages/core/src/components/code-block.tsx
6
+ ---
7
+
8
+ # CodeBlock
9
+
10
+ ## 1. Overview
11
+
12
+ CodeBlock shows read-only code with Prism syntax highlighting. It adds an optional header with a filename, a language switcher and a copy button, and can number and highlight lines. Code is always escaped before rendering, so untrusted strings are safe to show.
13
+
14
+ ## 2. When to use
15
+
16
+ - Code samples and setup instructions in docs, onboarding or settings (API keys usage, webhooks).
17
+ - A config file or command the user copies: `.env` values, a CLI command, a JSON payload.
18
+ - The same example in several languages or package managers (`languages`).
19
+ - Pointing at specific lines in a sample (`highlightLines`).
20
+
21
+ ### When not to use
22
+
23
+ - A keyboard shortcut → use [Kbd](./kbd.md).
24
+ - A short code word inside a sentence → use an inline `<code>` styled with `--font-mono`; see [typography.md](../foundations/typography.md).
25
+ - Code or text the user edits → use [Textarea](./textarea.md) or [RichText](./rich-text.md).
26
+ - Long logs or streaming output → use a [ScrollArea](./scroll-area.md) with your own mono text.
27
+
28
+ ## 3. Anatomy
29
+
30
+ 1. **Container**: `--container-bg-alt` surface with a `--container-border` border and `--curves-lg` corners.
31
+ 2. **Header** (shown when there's a filename, a copy button or more than one language): a row with a bottom border.
32
+ 3. **Filename** (optional): muted `--font-size-xs` text at the start of the header.
33
+ 4. **Language switcher** (optional): a row of small buttons, one per entry in `languages`, with the active one filled.
34
+ 5. **Copy button**: at the end of the header. Shows "Copy", then "Copied" with a check for two seconds.
35
+ 6. **Code area**: a horizontally scrolling `<pre><code>` in `--font-mono` at `--font-size-sm`.
36
+ 7. **Line numbers** (optional): a muted gutter that isn't selected when copying text by hand.
37
+ 8. **Highlighted lines** (optional): full-width rows on `--cautionary-bg-alt`.
38
+
39
+ ## 4. Variants
40
+
41
+ CodeBlock has no `variant` prop. `language` picks the Prism grammar: `javascript`, `typescript`, `jsx`, `tsx`, `css`, `json`, `bash`, `python`, `java`, `go`, `rust`, `sql`, `markdown`, `yaml` or `text` (the default, no highlighting). Other languages aren't accepted; use `text`.
42
+
43
+ Syntax colours come from the package stylesheet, not theme tokens: a One Dark palette in dim and dark modes and a darker One Light palette in light mode. A custom theme doesn't change them.
44
+
45
+ ## 5. Sizes
46
+
47
+ CodeBlock has no size prop. Code uses `--font-size-sm`; it fills its parent's width and grows to fit every line.
48
+
49
+ ## 6. States
50
+
51
+ | State | Looks like | Notes |
52
+ | --- | --- | --- |
53
+ | Default | Highlighted code on the alt surface | |
54
+ | Hover | Copy button gets `--interactive-bg-hover`; inactive language buttons darken | |
55
+ | Focus | The browser's default focus ring on the copy and language buttons | They declare no focus style. Never remove or restyle the focus ring. |
56
+ | Copied | Check icon and "Copied" for two seconds | Not announced to screen readers (see Accessibility). |
57
+ | Active language | Filled with `--interactive-bg-selected` | |
58
+
59
+ ## 7. Content guidelines
60
+
61
+ - Show complete, runnable snippets. Don't leave placeholders like `foo` or `...` in code users will copy.
62
+ - Set `filename` when the code belongs in a file ("next.config.ts"); leave it off for commands.
63
+ - Keep one command per block when users copy them one at a time.
64
+ - Label language variants the way users name them: "pnpm", "npm", "TypeScript", "Python".
65
+ - Don't put a prompt character (`$`) in commands; it gets copied.
66
+
67
+ | Do | Don't |
68
+ | --- | --- |
69
+ | `pnpm add @eluan/core` | `$ pnpm add @eluan/core` |
70
+ | `filename="next.config.ts"` | `filename="Code"` |
71
+ | Label: TypeScript | Label: ts |
72
+
73
+ ## 8. Rules
74
+
75
+ 1. Set `language` on every block that isn't plain text; the default is `text`, with no highlighting.
76
+ 2. With `languages`, still pass `code` (it's required by the type but ignored); pass the first variant's code.
77
+ 3. Pass code as a string. Never pre-highlight it or pass HTML; CodeBlock escapes it.
78
+ 4. Turn on `showLineNumbers` when the surrounding text refers to line numbers or you use `highlightLines`.
79
+ 5. `highlightLines` counts from 1.
80
+ 6. Keep `showCopyButton` on (the default) for anything users run or paste.
81
+ 7. Never pass `className` or `style`; they're dropped. Constrain width with a wrapper.
82
+
83
+ ## 9. Dos and don'ts
84
+
85
+ **Do:** set the language and filename.
86
+
87
+ ```tsx
88
+ <CodeBlock language="json" filename="package.json" code={`{\n "name": "acme-dashboard",\n "private": true\n}`} />
89
+ ```
90
+
91
+ **Don't:** rely on the default `text` language or pass HTML.
92
+
93
+ ```tsx
94
+ <CodeBlock code={`<span class="token keyword">const</span> port = 3000;`} />
95
+ ```
96
+
97
+ **Do:** offer package-manager variants in one block.
98
+
99
+ ```tsx
100
+ <CodeBlock
101
+ code="pnpm add @eluan/core @eluan/tokens"
102
+ languages={[
103
+ { language: "bash", code: "pnpm add @eluan/core @eluan/tokens", label: "pnpm" },
104
+ { language: "bash", code: "npm install @eluan/core @eluan/tokens", label: "npm" },
105
+ ]}
106
+ />
107
+ ```
108
+
109
+ **Don't:** stack near-identical blocks.
110
+
111
+ ```tsx
112
+ <CodeBlock language="bash" code="pnpm add @eluan/core @eluan/tokens" />
113
+ <CodeBlock language="bash" code="npm install @eluan/core @eluan/tokens" />
114
+ ```
115
+
116
+ ## 10. Accessibility
117
+
118
+ - Role: a plain `<pre><code>` block; the copy and language controls are native buttons.
119
+ - Label: the copy button is named by its text ("Copy", then "Copied"). Language buttons are named by their `label`. Add a heading or sentence before the block that says what the code does.
120
+ - Keyboard: Tab reaches the language buttons and the copy button; Enter and Space activate them. The code area scrolls horizontally but isn't focusable, so keyboard users can't scroll long lines.
121
+ - State: the active language isn't exposed (no `aria-pressed` or tab roles), and the "Copied" change isn't announced (no live region).
122
+ - Line numbers: they're real text, so screen readers read a number before each line. Leave `showLineNumbers` off unless sighted users need them.
123
+ - Focus: the buttons keep the browser's default ring; don't add your own.
124
+ - Contrast: surfaces come from the theme; syntax colours are tuned to at least 3.9:1 on the light-mode surface. Don't override them.
125
+
126
+ ## 11. Behaviour
127
+
128
+ - Responsive: fills its parent's width. Long lines scroll horizontally inside the block; they never wrap.
129
+ - Overflow and truncation: the block grows to fit every line. For long files, show an excerpt or wrap the block in a height-limited [ScrollArea](./scroll-area.md).
130
+ - Copy: copies the active variant's code with the Clipboard API, which needs a secure context (HTTPS or localhost).
131
+ - Motion: language buttons fade colour over 150ms. Don't add your own.
132
+
133
+ ## 12. API
134
+
135
+ <!-- api:start -->
136
+ | Prop | Type | Default | Description |
137
+ | --- | --- | --- | --- |
138
+ | `code` | `string` | | Required. The code to show. Ignored when `languages` is set. |
139
+ | `language` | `"javascript" \| "typescript" \| "jsx" \| "tsx" \| "css" \| "json" \| "bash" \| "python" \| "java" \| "go" \| "rust" \| "sql" \| "markdown" \| "yaml" \| "text"` | `"text"` | Prism grammar. `text` is not highlighted. |
140
+ | `languages` | `{ language: Language; code: string; label?: string }[]` | | Variants of the same snippet. Two or more show a switcher in the header; `label` defaults to the language id. |
141
+ | `filename` | `string` | | Shown at the start of the header. |
142
+ | `showCopyButton` | `boolean` | `true` | Shows the copy button. |
143
+ | `showLineNumbers` | `boolean` | `false` | Shows a line-number gutter. |
144
+ | `highlightLines` | `number[]` | `[]` | 1-based line numbers to highlight. |
145
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Native div attributes on the container: `id`, `aria-*`. |
146
+ <!-- api:end -->
147
+
148
+ `Language` isn't exported as a type; write the union or use `CodeBlockProps["language"]`.
149
+
150
+ ## 13. Examples
151
+
152
+ Setup instructions with package-manager variants, then a config file with the changed lines highlighted.
153
+
154
+ ```tsx
155
+ import { CodeBlock, Typography } from "@eluan/core";
156
+
157
+ const install = [
158
+ { language: "bash" as const, code: "pnpm add @eluan/core @eluan/tokens", label: "pnpm" },
159
+ { language: "bash" as const, code: "npm install @eluan/core @eluan/tokens", label: "npm" },
160
+ { language: "bash" as const, code: "yarn add @eluan/core @eluan/tokens", label: "yarn" },
161
+ ];
162
+
163
+ const providerCode = `import "@eluan/core/styles.css";
164
+ import { EluanProvider } from "@eluan/core";
165
+
166
+ export function App({ children }: { children: React.ReactNode }) {
167
+ return <EluanProvider>{children}</EluanProvider>;
168
+ }`;
169
+
170
+ export function InstallSteps() {
171
+ return (
172
+ <section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
173
+ <Typography variant="heading" as="h2">Install</Typography>
174
+ <Typography>Add the core package and its tokens.</Typography>
175
+ <CodeBlock code={install[0].code} languages={install} />
176
+
177
+ <Typography>Wrap your app in the provider and import the stylesheet once.</Typography>
178
+ <CodeBlock language="tsx" filename="app.tsx" code={providerCode} showLineNumbers highlightLines={[1, 5]} />
179
+ </section>
180
+ );
181
+ }
182
+ ```
183
+
184
+ ## 14. Related components
185
+
186
+ - [Kbd](./kbd.md): keyboard keys and shortcuts.
187
+ - [ScrollArea](./scroll-area.md): limit the height of a long block.
188
+ - [Typography](./typography.md): the heading and sentence that introduce a block.
189
+ - [Tabs](./tabs.md): separate whole sections, rather than one snippet's language variants.
190
+
191
+ ## 15. Common agent mistakes
192
+
193
+ _Filled from evals._