@eluan/core 0.5.0 → 0.6.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 (340) hide show
  1. package/README.md +33 -1
  2. package/dist/{action-popover-D6K9aVFk.cjs → action-popover-DrHKPGqw.cjs} +1 -1
  3. package/dist/{action-popover-BVJQBuky.js → action-popover-NkXDAHJT.js} +1 -1
  4. package/dist/action-popover.cjs +1 -1
  5. package/dist/action-popover.js +1 -1
  6. package/dist/{avatar-Co-k8KqV.cjs → avatar-B-t3ctR4.cjs} +1 -1
  7. package/dist/{avatar-CS5f1irF.js → avatar-kDEa0rjF.js} +1 -1
  8. package/dist/avatar.cjs +1 -1
  9. package/dist/avatar.js +1 -1
  10. package/dist/{badge-D9NYZFWH.js → badge-BLZ8V-KC.js} +10 -10
  11. package/dist/{badge-DXKWztL-.cjs → badge-D1A0Tc79.cjs} +1 -1
  12. package/dist/badge.cjs +1 -1
  13. package/dist/badge.js +1 -1
  14. package/dist/{banner-COlEFRuK.cjs → banner-CNdwDPqA.cjs} +1 -1
  15. package/dist/{banner-CyYFLZXw.js → banner-DzSp5WfQ.js} +9 -9
  16. package/dist/banner.cjs +1 -1
  17. package/dist/banner.js +1 -1
  18. package/dist/box-DG-tkaYi.cjs +1 -0
  19. package/dist/box-DKbNgGGG.js +17 -0
  20. package/dist/box.cjs +1 -0
  21. package/dist/box.d.ts +1 -0
  22. package/dist/box.js +5 -0
  23. package/dist/{breadcrumb-NWXeCH5q.cjs → breadcrumb-BuxXkm6O.cjs} +1 -1
  24. package/dist/{breadcrumb-Cm1nb9Xj.js → breadcrumb-C6qj-tDx.js} +1 -1
  25. package/dist/breadcrumb.cjs +1 -1
  26. package/dist/breadcrumb.js +1 -1
  27. package/dist/button--_WI-fM6.cjs +1 -0
  28. package/dist/{button-ANAPDrvs.js → button-DNSNShUc.js} +28 -26
  29. package/dist/button.cjs +1 -1
  30. package/dist/button.js +1 -1
  31. package/dist/{calendar-BpBsomy5.js → calendar-BA2tSwZD.js} +6 -6
  32. package/dist/{calendar-7LX5YGGT.cjs → calendar-DS5821-k.cjs} +3 -3
  33. package/dist/calendar.cjs +1 -1
  34. package/dist/calendar.js +1 -1
  35. package/dist/{card-C88--zB4.cjs → card-BNdR5aDa.cjs} +1 -1
  36. package/dist/{card-BC_4C3ns.js → card-BSgN7WSe.js} +1 -1
  37. package/dist/card.cjs +1 -1
  38. package/dist/card.js +1 -1
  39. package/dist/{carousel-BfL7oy_q.cjs → carousel-4AERgboz.cjs} +1 -1
  40. package/dist/{carousel-DuP0hvF-.js → carousel-Bb7jpzep.js} +1 -1
  41. package/dist/carousel.cjs +1 -1
  42. package/dist/carousel.js +1 -1
  43. package/dist/{checkbox-Bi0Kmuut.js → checkbox-CGUTGery.js} +1 -1
  44. package/dist/{checkbox-M8DmWKiC.cjs → checkbox-Cq9sHU_S.cjs} +1 -1
  45. package/dist/{checkbox-group-KBwPhjmW.cjs → checkbox-group-DGXZ4o2-.cjs} +1 -1
  46. package/dist/{checkbox-group-CQMEJnhD.js → checkbox-group-Tkio3IhK.js} +1 -1
  47. package/dist/checkbox-group.cjs +1 -1
  48. package/dist/checkbox-group.js +1 -1
  49. package/dist/checkbox.cjs +1 -1
  50. package/dist/checkbox.js +1 -1
  51. package/dist/{command-BCl0seLL.cjs → command-D02vvta9.cjs} +1 -1
  52. package/dist/{command-Chs5VlBL.js → command-sUMAxm8S.js} +1 -1
  53. package/dist/command.cjs +1 -1
  54. package/dist/command.js +1 -1
  55. package/dist/components/box.d.ts +12 -0
  56. package/dist/components/grid.d.ts +35 -0
  57. package/dist/components/hover-card.d.ts +14 -2
  58. package/dist/components/icon.d.ts +26 -0
  59. package/dist/components/layout-shared.d.ts +307 -0
  60. package/dist/components/multi-select.d.ts +1 -1
  61. package/dist/components/navigation-drawer.d.ts +25 -5
  62. package/dist/components/row.d.ts +18 -0
  63. package/dist/components/stack.d.ts +14 -0
  64. package/dist/components/tone-shared.d.ts +39 -0
  65. package/dist/components/tooltip.d.ts +14 -2
  66. package/dist/components/typography.d.ts +22 -2
  67. package/dist/components/visually-hidden.d.ts +11 -0
  68. package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-9VPlzvDm.js} +1 -1
  69. package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-DppPJBne.cjs} +1 -1
  70. package/dist/credit-card-input.cjs +1 -1
  71. package/dist/credit-card-input.js +1 -1
  72. package/dist/{date-picker-ni8td8Ru.js → date-picker-M5hLx_1s.js} +2 -2
  73. package/dist/{date-picker-DGBsfZXx.cjs → date-picker-hE7cDg2B.cjs} +1 -1
  74. package/dist/date-picker.cjs +1 -1
  75. package/dist/date-picker.js +1 -1
  76. package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-BeRUPJ7s.cjs} +1 -1
  77. package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CIqBZYMH.js} +3 -3
  78. package/dist/datetime-picker.cjs +1 -1
  79. package/dist/datetime-picker.js +1 -1
  80. package/dist/{decimal-input-yTk35W_5.js → decimal-input-Bg2BPKIr.js} +38 -38
  81. package/dist/decimal-input-CkTEjo2J.cjs +1 -0
  82. package/dist/decimal-input.cjs +1 -1
  83. package/dist/decimal-input.js +1 -1
  84. package/dist/{dialog-B8eWKqzS.js → dialog-Bsfviqvy.js} +2 -2
  85. package/dist/dialog-DRAoumvB.cjs +1 -0
  86. package/dist/dialog.cjs +1 -1
  87. package/dist/dialog.js +1 -1
  88. package/dist/{email-input-DFI4h_KN.cjs → email-input-CehmtNUq.cjs} +1 -1
  89. package/dist/{email-input-pX0hlYV3.js → email-input-DIiY9Q3S.js} +1 -1
  90. package/dist/email-input.cjs +1 -1
  91. package/dist/email-input.js +1 -1
  92. package/dist/{footer-DB0_-IwN.cjs → footer-fovIsy-0.cjs} +1 -1
  93. package/dist/{footer-B3KUIwXW.js → footer-jWaFq3qk.js} +9 -9
  94. package/dist/footer.cjs +1 -1
  95. package/dist/footer.js +1 -1
  96. package/dist/grid-BDz4Xs6M.cjs +1 -0
  97. package/dist/grid-BX5vZjDo.js +612 -0
  98. package/dist/grid.cjs +1 -0
  99. package/dist/grid.d.ts +1 -0
  100. package/dist/grid.js +5 -0
  101. package/dist/{header-CDOWlOAR.js → header-Dnf8AnIx.js} +2 -2
  102. package/dist/{header-CiZQY_7S.cjs → header-DzItWqW4.cjs} +1 -1
  103. package/dist/header.cjs +1 -1
  104. package/dist/header.js +1 -1
  105. package/dist/hover-card-C5KsTSZR.cjs +1 -0
  106. package/dist/hover-card-C_FCzE41.js +21 -0
  107. package/dist/hover-card.cjs +1 -1
  108. package/dist/hover-card.js +1 -1
  109. package/dist/icon-BmLOodCQ.cjs +1 -0
  110. package/dist/icon-BwDfkIdR.js +153 -0
  111. package/dist/icon.cjs +1 -0
  112. package/dist/icon.d.ts +1 -0
  113. package/dist/icon.js +5 -0
  114. package/dist/index.cjs +10 -5
  115. package/dist/index.d.ts +6 -0
  116. package/dist/index.js +612 -541
  117. package/dist/{input-BrGJn-D9.cjs → input-BcjL2oxv.cjs} +1 -1
  118. package/dist/{input-Cccufiqn.js → input-CPb9yVU5.js} +8 -8
  119. package/dist/input-otp-BhJ3ERrY.cjs +1 -0
  120. package/dist/{input-otp-DmEGB1nu.js → input-otp-CTvJztkH.js} +32 -32
  121. package/dist/input-otp.cjs +1 -1
  122. package/dist/input-otp.js +1 -1
  123. package/dist/input.cjs +1 -1
  124. package/dist/input.js +1 -1
  125. package/dist/layout-shared-B_1iX4Hj.js +319 -0
  126. package/dist/layout-shared-CsBZcT4V.cjs +1 -0
  127. package/dist/multi-select-CVxkWW29.js +85 -0
  128. package/dist/multi-select-DBFINH3F.cjs +1 -0
  129. package/dist/multi-select.cjs +1 -1
  130. package/dist/multi-select.js +1 -1
  131. package/dist/navigation-drawer-BCBFtLEq.cjs +1 -0
  132. package/dist/navigation-drawer-BMyHXhhX.js +198 -0
  133. package/dist/navigation-drawer.cjs +1 -1
  134. package/dist/navigation-drawer.js +1 -1
  135. package/dist/{number-input-vICbRc2y.js → number-input-Cm9YPBOX.js} +1 -1
  136. package/dist/{number-input-Bc7jUsu-.cjs → number-input-Dr9MbuRV.cjs} +1 -1
  137. package/dist/number-input.cjs +1 -1
  138. package/dist/number-input.js +1 -1
  139. package/dist/{pagination-DTWRjiOm.js → pagination-D2tjMpVU.js} +2 -2
  140. package/dist/{pagination-4IuE_APs.cjs → pagination-yKmFlFMR.cjs} +1 -1
  141. package/dist/pagination.cjs +1 -1
  142. package/dist/pagination.js +1 -1
  143. package/dist/{password-input-BwnlHPbX.cjs → password-input-CmHubHuU.cjs} +1 -1
  144. package/dist/{password-input-B9V45d3Q.js → password-input-ljwdGCO6.js} +2 -2
  145. package/dist/password-input.cjs +1 -1
  146. package/dist/password-input.js +1 -1
  147. package/dist/{phone-input-BQjZj5jI.cjs → phone-input-B8VksCer.cjs} +1 -1
  148. package/dist/{phone-input-CSBpGHvI.js → phone-input-qTL6K8rT.js} +2 -2
  149. package/dist/phone-input.cjs +1 -1
  150. package/dist/phone-input.js +1 -1
  151. package/dist/progress-BpdmBGaX.cjs +1 -0
  152. package/dist/{progress-Dz_it5I-.js → progress-ChFf9bIq.js} +1 -1
  153. package/dist/progress.cjs +1 -1
  154. package/dist/progress.js +1 -1
  155. package/dist/providers/create-theme.d.ts +10 -1
  156. package/dist/providers/eluan-provider.d.ts +2 -1
  157. package/dist/providers/portal-container.d.ts +1 -1
  158. package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
  159. package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
  160. package/dist/radio-group.cjs +1 -1
  161. package/dist/radio-group.js +1 -1
  162. package/dist/{rich-text-BZSyuYSo.js → rich-text-DImwK9hN.js} +1 -1
  163. package/dist/{rich-text-DerWxzdn.cjs → rich-text-DzHLeG7W.cjs} +1 -1
  164. package/dist/rich-text.cjs +1 -1
  165. package/dist/rich-text.js +1 -1
  166. package/dist/row-BYAk7G5d.js +37 -0
  167. package/dist/row-Bjn-GQAC.cjs +1 -0
  168. package/dist/row.cjs +1 -0
  169. package/dist/row.d.ts +1 -0
  170. package/dist/row.js +5 -0
  171. package/dist/{search-input-Dmmo-BEL.cjs → search-input-BKTjebg7.cjs} +1 -1
  172. package/dist/{search-input-bFNW6oiE.js → search-input-Dgr9kT1a.js} +1 -1
  173. package/dist/search-input.cjs +1 -1
  174. package/dist/search-input.js +1 -1
  175. package/dist/select-Cdh991T-.cjs +1 -0
  176. package/dist/{select-DDSYjKtj.js → select-Dp5AJ6I-.js} +15 -15
  177. package/dist/select.cjs +1 -1
  178. package/dist/select.js +1 -1
  179. package/dist/sheet-CkXjinUG.cjs +1 -0
  180. package/dist/{sheet-D5HWF66e.js → sheet-uiyHNKEw.js} +6 -6
  181. package/dist/sheet.cjs +1 -1
  182. package/dist/sheet.js +1 -1
  183. package/dist/{slider-CZQBAXup.js → slider-BQmbh0Nl.js} +1 -1
  184. package/dist/{slider-DdEOapYP.cjs → slider-DK2yk-YK.cjs} +1 -1
  185. package/dist/slider.cjs +1 -1
  186. package/dist/slider.js +1 -1
  187. package/dist/stack-Ck1w2iJu.cjs +1 -0
  188. package/dist/stack-D2btWM1t.js +27 -0
  189. package/dist/stack.cjs +1 -0
  190. package/dist/stack.d.ts +1 -0
  191. package/dist/stack.js +5 -0
  192. package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
  193. package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
  194. package/dist/stepper.cjs +1 -1
  195. package/dist/stepper.js +1 -1
  196. package/dist/styles.css +935 -59
  197. package/dist/{switch-KzBijHMJ.cjs → switch-C2OPCq5Z.cjs} +1 -1
  198. package/dist/{switch-C7EBLT5H.js → switch-CXBWUZcq.js} +3 -3
  199. package/dist/switch.cjs +1 -1
  200. package/dist/switch.js +1 -1
  201. package/dist/{tabs-DztJ2iVc.cjs → tabs-D8p6Tr5i.cjs} +1 -1
  202. package/dist/{tabs-C9NKBmH0.js → tabs-TV4_2wi1.js} +9 -9
  203. package/dist/tabs.cjs +1 -1
  204. package/dist/tabs.js +1 -1
  205. package/dist/{textarea-Dl-daLHR.cjs → textarea-BnpQmE74.cjs} +1 -1
  206. package/dist/{textarea-DXUk1b_-.js → textarea-CJRmnazN.js} +1 -1
  207. package/dist/textarea.cjs +1 -1
  208. package/dist/textarea.js +1 -1
  209. package/dist/{time-input-BPoFvoeM.js → time-input-A603mEFQ.js} +38 -38
  210. package/dist/time-input-qxljhdEb.cjs +1 -0
  211. package/dist/time-input.cjs +1 -1
  212. package/dist/time-input.js +1 -1
  213. package/dist/{toggle-Dv1VZ5Le.js → toggle-Bx3q15Pu.js} +6 -6
  214. package/dist/{toggle-Bvh1v32T.cjs → toggle-Z3t4jPdv.cjs} +1 -1
  215. package/dist/{toggle-group-SyHMwO90.cjs → toggle-group-BZIW4wJp.cjs} +1 -1
  216. package/dist/{toggle-group-DE8BPZih.js → toggle-group-LaZmOMx_.js} +7 -7
  217. package/dist/toggle-group.cjs +1 -1
  218. package/dist/toggle-group.js +1 -1
  219. package/dist/toggle.cjs +1 -1
  220. package/dist/toggle.js +1 -1
  221. package/dist/tooltip-DZqn4wKl.js +23 -0
  222. package/dist/tooltip-faf1dIXp.cjs +1 -0
  223. package/dist/tooltip.cjs +1 -1
  224. package/dist/tooltip.js +1 -1
  225. package/dist/{tree-view-CyeJR7cW.js → tree-view-DRmm6oL6.js} +23 -23
  226. package/dist/tree-view-DVQyRQDg.cjs +1 -0
  227. package/dist/tree-view.cjs +1 -1
  228. package/dist/tree-view.js +1 -1
  229. package/dist/visually-hidden-BQMRYGxP.js +14 -0
  230. package/dist/visually-hidden-DzxxOswl.cjs +1 -0
  231. package/dist/visually-hidden.cjs +1 -0
  232. package/dist/visually-hidden.d.ts +1 -0
  233. package/dist/visually-hidden.js +5 -0
  234. package/package.json +8 -8
  235. package/skills/eluan/DESIGN.md +409 -0
  236. package/skills/eluan/SKILL.md +166 -0
  237. package/skills/eluan/components/accordion.md +212 -0
  238. package/skills/eluan/components/action-popover.md +266 -0
  239. package/skills/eluan/components/aspect-ratio.md +169 -0
  240. package/skills/eluan/components/avatar.md +277 -0
  241. package/skills/eluan/components/badge.md +190 -0
  242. package/skills/eluan/components/banner.md +247 -0
  243. package/skills/eluan/components/box.md +166 -0
  244. package/skills/eluan/components/breadcrumb.md +240 -0
  245. package/skills/eluan/components/button.md +214 -0
  246. package/skills/eluan/components/calendar.md +192 -0
  247. package/skills/eluan/components/card.md +270 -0
  248. package/skills/eluan/components/carousel.md +274 -0
  249. package/skills/eluan/components/checkbox-group.md +228 -0
  250. package/skills/eluan/components/checkbox.md +226 -0
  251. package/skills/eluan/components/code-block.md +193 -0
  252. package/skills/eluan/components/collapsible.md +240 -0
  253. package/skills/eluan/components/command.md +359 -0
  254. package/skills/eluan/components/context-menu.md +296 -0
  255. package/skills/eluan/components/credit-card-input.md +217 -0
  256. package/skills/eluan/components/date-picker.md +255 -0
  257. package/skills/eluan/components/date-time-picker.md +196 -0
  258. package/skills/eluan/components/decimal-input.md +232 -0
  259. package/skills/eluan/components/dialog.md +322 -0
  260. package/skills/eluan/components/drawer.md +292 -0
  261. package/skills/eluan/components/dropdown-menu.md +450 -0
  262. package/skills/eluan/components/email-input.md +200 -0
  263. package/skills/eluan/components/fieldset.md +219 -0
  264. package/skills/eluan/components/file-input.md +249 -0
  265. package/skills/eluan/components/footer.md +290 -0
  266. package/skills/eluan/components/form-label.md +254 -0
  267. package/skills/eluan/components/grid.md +192 -0
  268. package/skills/eluan/components/header.md +242 -0
  269. package/skills/eluan/components/hover-card.md +215 -0
  270. package/skills/eluan/components/icon.md +161 -0
  271. package/skills/eluan/components/input-otp.md +227 -0
  272. package/skills/eluan/components/input.md +249 -0
  273. package/skills/eluan/components/kbd.md +216 -0
  274. package/skills/eluan/components/media.md +244 -0
  275. package/skills/eluan/components/menubar.md +300 -0
  276. package/skills/eluan/components/multi-select.md +221 -0
  277. package/skills/eluan/components/navigation-drawer.md +297 -0
  278. package/skills/eluan/components/navigation-menu.md +291 -0
  279. package/skills/eluan/components/number-input.md +190 -0
  280. package/skills/eluan/components/pagination.md +262 -0
  281. package/skills/eluan/components/password-input.md +218 -0
  282. package/skills/eluan/components/phone-input.md +205 -0
  283. package/skills/eluan/components/popover.md +250 -0
  284. package/skills/eluan/components/progress.md +185 -0
  285. package/skills/eluan/components/radio-group.md +232 -0
  286. package/skills/eluan/components/rich-text.md +195 -0
  287. package/skills/eluan/components/row.md +174 -0
  288. package/skills/eluan/components/scroll-area.md +203 -0
  289. package/skills/eluan/components/search-input.md +281 -0
  290. package/skills/eluan/components/segmented-control.md +201 -0
  291. package/skills/eluan/components/select.md +296 -0
  292. package/skills/eluan/components/separator.md +179 -0
  293. package/skills/eluan/components/sheet.md +326 -0
  294. package/skills/eluan/components/skeleton.md +202 -0
  295. package/skills/eluan/components/slider.md +195 -0
  296. package/skills/eluan/components/spinner.md +187 -0
  297. package/skills/eluan/components/stack.md +158 -0
  298. package/skills/eluan/components/stepper.md +236 -0
  299. package/skills/eluan/components/switch.md +218 -0
  300. package/skills/eluan/components/table.md +348 -0
  301. package/skills/eluan/components/tabs.md +277 -0
  302. package/skills/eluan/components/textarea.md +202 -0
  303. package/skills/eluan/components/time-input.md +181 -0
  304. package/skills/eluan/components/toast.md +251 -0
  305. package/skills/eluan/components/toggle-group.md +241 -0
  306. package/skills/eluan/components/toggle.md +198 -0
  307. package/skills/eluan/components/tooltip.md +222 -0
  308. package/skills/eluan/components/tree-view.md +213 -0
  309. package/skills/eluan/components/typography.md +207 -0
  310. package/skills/eluan/components/visually-hidden.md +132 -0
  311. package/skills/eluan/foundations/colour.md +252 -0
  312. package/skills/eluan/foundations/elevation.md +57 -0
  313. package/skills/eluan/foundations/iconography.md +70 -0
  314. package/skills/eluan/foundations/motion.md +60 -0
  315. package/skills/eluan/foundations/radius.md +61 -0
  316. package/skills/eluan/foundations/spacing.md +98 -0
  317. package/skills/eluan/foundations/theming.md +197 -0
  318. package/skills/eluan/foundations/typography.md +163 -0
  319. package/skills/eluan/patterns/empty-states.md +84 -0
  320. package/skills/eluan/patterns/feedback.md +95 -0
  321. package/skills/eluan/patterns/forms.md +138 -0
  322. package/skills/eluan/patterns/navigation.md +95 -0
  323. package/skills/eluan/patterns/page-layout.md +101 -0
  324. package/dist/button-Ny6OF8Un.cjs +0 -1
  325. package/dist/decimal-input-BLmifKF2.cjs +0 -1
  326. package/dist/dialog-DWYtFhZl.cjs +0 -1
  327. package/dist/hover-card-BN7Ew2Y1.js +0 -16
  328. package/dist/hover-card-Dft-08Ha.cjs +0 -1
  329. package/dist/input-otp-DcZ7wyjs.cjs +0 -1
  330. package/dist/multi-select-DPoOHWSC.js +0 -74
  331. package/dist/multi-select-fX5FXYEY.cjs +0 -1
  332. package/dist/navigation-drawer-BbeDYPhu.js +0 -171
  333. package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
  334. package/dist/progress-DpQjGEyn.cjs +0 -1
  335. package/dist/select-1Eb3NSrR.cjs +0 -1
  336. package/dist/sheet-7NP1LuHy.cjs +0 -1
  337. package/dist/time-input-DR2snTgB.cjs +0 -1
  338. package/dist/tooltip-BlCQKhUE.js +0 -18
  339. package/dist/tooltip-Cyu7fWYZ.cjs +0 -1
  340. package/dist/tree-view-CNvEc1TT.cjs +0 -1
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: Footer
3
+ use_when: A site page needs a bottom section with grouped links, legal links, a copyright line and social links.
4
+ instead_of: CardFooter, DialogFooter or SheetFooter for the bottom of those surfaces; NavigationDrawerFooter for the bottom of an app sidebar; Header for the top bar.
5
+ source: packages/core/src/components/footer.tsx
6
+ ---
7
+
8
+ # Footer
9
+
10
+ ## 1. Overview
11
+
12
+ Footer is a composable site footer. `Footer` renders a `<footer>` with a centred container, and you build the inside from parts: a responsive grid of link sections, a bottom row with the copyright and social links, and optional brand treatments. It comes in two variants (`default` and `modern`) and three paddings, with an optional full-bleed `wordmark` and a `FooterStagger` grid that fades its columns in.
13
+
14
+ ## 2. When to use
15
+
16
+ - The bottom of a marketing, docs or content site: grouped links, legal links, copyright, social links.
17
+ - A compact legal bar with a copyright line and a few links (`size="sm"`).
18
+ - A branded closing band with a large wordmark (`variant="modern"` with `wordmark`).
19
+
20
+ ### When not to use
21
+
22
+ - Actions at the bottom of a card → use `CardFooter` in [Card](./card.md).
23
+ - Buttons at the bottom of a dialog or side panel → use `DialogFooter` in [Dialog](./dialog.md) or `SheetFooter` in [Sheet](./sheet.md).
24
+ - The bottom of an app sidebar → use `NavigationDrawerFooter` in [NavigationDrawer](./navigation-drawer.md).
25
+ - The top bar of the page → use [Header](./header.md).
26
+
27
+ ## 3. Anatomy
28
+
29
+ 1. **Footer**: the `<footer>` landmark. Applies the variant surface and vertical padding, and centres a container up to `80rem` with `--spacing-md` side padding.
30
+ 2. **FooterContent**: a grid of columns: one column, two from 768px, four from 1024px.
31
+ 3. **FooterSection**: one column; stacks its title and links with a `--spacing-md` gap.
32
+ 4. **FooterTitle**: the column heading, an `<h3>` in `--container-fg-alt`.
33
+ 5. **FooterLinks**: the `<ul>` that holds a column's links.
34
+ 6. **FooterLink**: an `<li>` with an underlined `<a>` inside. `FooterModernLink` is identical.
35
+ 7. **FooterBottom**: the closing row under a top border in `--container-border-alt`; stacked on small screens, spread across one row from 768px.
36
+ 8. **FooterCopyright**: a `<p>` in `--container-fg-alt`.
37
+ 9. **FooterSocial**: a row of social links.
38
+ 10. **FooterSocialLink**: a ghost icon Button wrapping an `<a>`, named by `label`. `FooterModernSocialLink` is the round version.
39
+ 11. **FooterBrand** (optional): a large, faint, uppercase brand name above a bottom border.
40
+ 12. **FooterStagger** (optional): the same grid as FooterContent, fading each child in one after another.
41
+ 13. **Wordmark** (optional, `wordmark` prop): a huge brand word along the bottom edge with its lower half clipped. Decorative and hidden from assistive tech.
42
+
43
+ ## 4. Variants
44
+
45
+ | Variant | Use for |
46
+ | --- | --- |
47
+ | `default` | Most footers: the page surface (`--container-bg`) with a top border in `--container-border-alt`. |
48
+ | `modern` | A dark closing band: `--container-fg` background with `--container-fg-inverse` text, usually with `wordmark` and FooterStagger. Titles, copyright and social icons are currently near-invisible on it; see Accessibility. |
49
+
50
+ ## 5. Sizes
51
+
52
+ `size` sets the vertical padding.
53
+
54
+ | Size | Use in |
55
+ | --- | --- |
56
+ | `sm` | A compact legal bar with a copyright line and a few links (`--spacing-lg` padding). |
57
+ | `default` | A standard multi-column footer (`--spacing-2xl`). |
58
+ | `lg` | A spacious closing band (1.5 × `--spacing-2xl`); the Modern story pairs it with `wordmark`. |
59
+
60
+ ## 6. States
61
+
62
+ | State | Looks like | Notes |
63
+ | --- | --- | --- |
64
+ | Default | Underlined links in the inherited text colour | |
65
+ | Hover | Links fade to 70% opacity; social links take the ghost Button hover | |
66
+ | Focus | Links: 1px outline in `--focus-ring`, 2px offset. Social links: Button focus outline | Never remove or restyle the focus ring. |
67
+
68
+ ## 7. Content guidelines
69
+
70
+ - Title each column with a short, sentence-case noun: "Product", "Company", "Resources", "Legal".
71
+ - Label links with the destination's name: "Changelog", "Help center", "Cookie policy".
72
+ - Write the copyright as "© 2026 Northwind Ltd. All rights reserved." with the current year.
73
+ - Name each social link after the network in `label`: "GitHub", "LinkedIn".
74
+ - Pass your own brand to FooterBrand; its default text is "ELUAN".
75
+
76
+ | Do | Don't |
77
+ | --- | --- |
78
+ | Help center | Click here for help |
79
+ | Privacy | Privacy Policy Information |
80
+ | `label="GitHub"` | `label="icon"` |
81
+
82
+ ## 8. Rules
83
+
84
+ 1. Put FooterLink only inside FooterLinks; it renders an `<li>`. Don't put bare anchors in FooterLinks.
85
+ 2. Use FooterContent for the column grid, or FooterStagger for the same grid with a fade-in. Never nest one in the other.
86
+ 3. Give every FooterSocialLink a `label`, mark its icon `aria-hidden="true"`, and size the icon with `--size-xxs`.
87
+ 4. Pass `text` or children to FooterBrand. Without them it shows "ELUAN".
88
+ 5. Wrap the link columns in `<nav aria-label="Footer">` so they form a named navigation landmark.
89
+ 6. Check the heading outline: FooterTitle is always an `<h3>` and has no `as` prop.
90
+ 7. Use one Footer per page and keep it outside `<main>` so it's the `contentinfo` landmark.
91
+ 8. Lay out anything else inside Footer with a wrapper you own, as the Small story does. Footer and its parts drop `className` and `style`.
92
+ 9. Prefer `variant="default"` until the `modern` contrast issue is fixed.
93
+ 10. Don't call `footerVariants`. It always returns an empty string.
94
+
95
+ ## 9. Dos and don'ts
96
+
97
+ **Do:** compose links from the parts.
98
+
99
+ ```tsx
100
+ <FooterSection>
101
+ <FooterTitle>Company</FooterTitle>
102
+ <FooterLinks>
103
+ <FooterLink href="/about">About</FooterLink>
104
+ <FooterLink href="/careers">Careers</FooterLink>
105
+ </FooterLinks>
106
+ </FooterSection>
107
+ ```
108
+
109
+ **Don't:** put bare anchors in the list or style the parts.
110
+
111
+ ```tsx
112
+ <FooterLinks style={{ gap: 12 }}>
113
+ <a href="/about">About</a>
114
+ <a href="/careers">Careers</a>
115
+ </FooterLinks>
116
+ ```
117
+
118
+ **Do:** name social links and size icons with a token.
119
+
120
+ ```tsx
121
+ <FooterSocialLink href="https://github.com/northwind" label="GitHub">
122
+ <Github aria-hidden="true" style={{ width: "var(--size-xxs)", height: "var(--size-xxs)" }} />
123
+ </FooterSocialLink>
124
+ ```
125
+
126
+ **Don't:** leave them unnamed or size icons in pixels.
127
+
128
+ ```tsx
129
+ <FooterSocialLink href="https://github.com/northwind" label="">
130
+ <Github size={20} />
131
+ </FooterSocialLink>
132
+ ```
133
+
134
+ ## 10. Accessibility
135
+
136
+ - Role: `<footer>` is the `contentinfo` landmark when it isn't nested inside `<main>`, `<article>`, `<aside>`, `<nav>` or `<section>`. FooterLinks is a list, so screen readers announce each column's link count. FooterTitle is an `<h3>`. The `wordmark` is `aria-hidden`.
137
+ - Label: FooterLink takes its text. FooterSocialLink puts `label` on the anchor as `aria-label`.
138
+ - Keyboard: Tab moves through the links in DOM order; Enter follows a link.
139
+ - Focus: FooterLink shows an outline on `:focus-visible`; social links use the Button outline.
140
+ - Contrast: handled by the theme. Don't override colours.
141
+ - Modern variant: FooterTitle and FooterCopyright (`--container-fg-alt`) and the social icons (ghost Button colour) sit at about 1.3:1 on the `modern` background, in both light and dark mode. Use `default` until it's fixed.
142
+
143
+ ## 11. Behaviour
144
+
145
+ - Responsive: FooterContent and FooterStagger go from one column to two at 768px and four at 1024px. FooterBottom stacks below 768px and spreads into one row above it.
146
+ - Overflow and truncation: link text wraps. The `wordmark` never wraps; it's scaled to the viewport and its lower half is clipped by the footer.
147
+ - Motion: links fade on hover over 150ms. FooterStagger fades and lifts each child on mount (0.5s each, `delayMs` apart, 80ms by default), not when scrolled into view. Under reduced motion each fade is near-instant, but the delays remain, so columns still appear one by one.
148
+ - With `wordmark`, the container gets extra bottom padding (`--spacing-2xl`) so content clears the word.
149
+
150
+ ## 12. API
151
+
152
+ <!-- api:start -->
153
+ ### Footer
154
+
155
+ | Prop | Type | Default | Description |
156
+ | --- | --- | --- | --- |
157
+ | `variant` | `"default" \| "modern" \| null` | `"default"` | Surface treatment. |
158
+ | `size` | `"sm" \| "default" \| "lg" \| null` | `"default"` | Vertical padding. |
159
+ | `wordmark` | `string` | | Full-bleed decorative brand word along the bottom edge, lower half clipped, hidden from assistive tech. |
160
+ | `...props` | `HTMLAttributes<HTMLElement>` without `className`, `style` | | Applied to the `<footer>`. Children render inside the centred container. `className` and `style` are omitted. |
161
+
162
+ ### FooterSocialLink and FooterModernSocialLink
163
+
164
+ | Prop | Type | Default | Description |
165
+ | --- | --- | --- | --- |
166
+ | `label` | `string` | | Accessible name, set as `aria-label` on the link. Required. |
167
+ | `children` | `ReactNode` | | The icon. |
168
+ | `...props` | `AnchorHTMLAttributes<HTMLAnchorElement>` without `className`, `style` | | `href`, `target`, `rel`. Renders a ghost `icon` Button around the `<a>`; the Modern version is round. |
169
+
170
+ ### FooterBrand
171
+
172
+ | Prop | Type | Default | Description |
173
+ | --- | --- | --- | --- |
174
+ | `text` | `string` | `"ELUAN"` | Brand text, shown uppercase, when there are no children. |
175
+ | `children` | `ReactNode` | | Replaces the text, for example with a logo. |
176
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | |
177
+
178
+ ### FooterStagger
179
+
180
+ | Prop | Type | Default | Description |
181
+ | --- | --- | --- | --- |
182
+ | `delayMs` | `number` | `80` | Milliseconds between each child's fade-in. |
183
+ | `children` | `ReactNode` | | Each child is wrapped in an animated cell of the column grid. |
184
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | |
185
+
186
+ ### Structural parts
187
+
188
+ | Prop | Type | Default | Description |
189
+ | --- | --- | --- | --- |
190
+ | `...props` (FooterContent, FooterSection, FooterBottom, FooterSocial) | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Each renders a `<div>`. |
191
+ | `...props` (FooterTitle) | `HTMLAttributes<HTMLHeadingElement>` without `className`, `style` | | Renders an `<h3>`. |
192
+ | `...props` (FooterLinks) | `HTMLAttributes<HTMLUListElement>` without `className`, `style` | | Renders a `<ul>` with no bullets. |
193
+ | `...props` (FooterLink, FooterModernLink) | `AnchorHTMLAttributes<HTMLAnchorElement>` without `className`, `style` | | `href`, `target`, `rel`. Renders `<li><a>`; `ref` points to the `<a>`. |
194
+ | `...props` (FooterCopyright) | `HTMLAttributes<HTMLParagraphElement>` without `className`, `style` | | Renders a `<p>`. |
195
+
196
+ ### footerVariants
197
+
198
+ | Prop | Type | Default | Description |
199
+ | --- | --- | --- | --- |
200
+ | `footerVariants(options?)` | `(options?: { variant?, size? }) => string` | | Always returns `""`. Kept for compatibility; don't use it. |
201
+ <!-- api:end -->
202
+
203
+ ## 13. Examples
204
+
205
+ ```tsx
206
+ import {
207
+ Footer,
208
+ FooterBottom,
209
+ FooterContent,
210
+ FooterCopyright,
211
+ FooterLink,
212
+ FooterLinks,
213
+ FooterSection,
214
+ FooterSocial,
215
+ FooterSocialLink,
216
+ FooterTitle,
217
+ } from "@eluan/core";
218
+ import { Github, Linkedin, Rss } from "lucide-react";
219
+
220
+ const iconStyle = { width: "var(--size-xxs)", height: "var(--size-xxs)" };
221
+
222
+ export function SiteFooter() {
223
+ return (
224
+ <Footer>
225
+ <nav aria-label="Footer">
226
+ <FooterContent>
227
+ <FooterSection>
228
+ <FooterTitle>Product</FooterTitle>
229
+ <FooterLinks>
230
+ <FooterLink href="/features">Features</FooterLink>
231
+ <FooterLink href="/pricing">Pricing</FooterLink>
232
+ <FooterLink href="/changelog">Changelog</FooterLink>
233
+ </FooterLinks>
234
+ </FooterSection>
235
+ <FooterSection>
236
+ <FooterTitle>Company</FooterTitle>
237
+ <FooterLinks>
238
+ <FooterLink href="/about">About</FooterLink>
239
+ <FooterLink href="/careers">Careers</FooterLink>
240
+ <FooterLink href="/press">Press</FooterLink>
241
+ </FooterLinks>
242
+ </FooterSection>
243
+ <FooterSection>
244
+ <FooterTitle>Resources</FooterTitle>
245
+ <FooterLinks>
246
+ <FooterLink href="/docs">Documentation</FooterLink>
247
+ <FooterLink href="/help">Help center</FooterLink>
248
+ <FooterLink href="/status">Status</FooterLink>
249
+ </FooterLinks>
250
+ </FooterSection>
251
+ <FooterSection>
252
+ <FooterTitle>Legal</FooterTitle>
253
+ <FooterLinks>
254
+ <FooterLink href="/privacy">Privacy</FooterLink>
255
+ <FooterLink href="/terms">Terms</FooterLink>
256
+ <FooterLink href="/cookies">Cookie policy</FooterLink>
257
+ </FooterLinks>
258
+ </FooterSection>
259
+ </FooterContent>
260
+ </nav>
261
+ <FooterBottom>
262
+ <FooterCopyright>© 2026 Northwind Ltd. All rights reserved.</FooterCopyright>
263
+ <FooterSocial>
264
+ <FooterSocialLink href="https://github.com/northwind" label="GitHub">
265
+ <Github aria-hidden="true" style={iconStyle} />
266
+ </FooterSocialLink>
267
+ <FooterSocialLink href="https://www.linkedin.com/company/northwind" label="LinkedIn">
268
+ <Linkedin aria-hidden="true" style={iconStyle} />
269
+ </FooterSocialLink>
270
+ <FooterSocialLink href="/blog/rss.xml" label="Blog RSS feed">
271
+ <Rss aria-hidden="true" style={iconStyle} />
272
+ </FooterSocialLink>
273
+ </FooterSocial>
274
+ </FooterBottom>
275
+ </Footer>
276
+ );
277
+ }
278
+ ```
279
+
280
+ ## 14. Related components
281
+
282
+ - [Header](./header.md): the matching top bar.
283
+ - [Button](./button.md): renders the social links (ghost, `icon` size).
284
+ - [Separator](./separator.md): for any extra divider you add inside the footer.
285
+ - [Card](./card.md): `CardFooter` for actions at the bottom of a card.
286
+ - [NavigationDrawer](./navigation-drawer.md): `NavigationDrawerFooter` for the bottom of an app sidebar.
287
+
288
+ ## 15. Common agent mistakes
289
+
290
+ _Filled from evals._
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: FormLabel
3
+ use_when: Naming a form control, adding helper text under it, or showing an error or status message for one field.
4
+ instead_of: FieldsetLegend to title a group of fields; Banner for form-level or server errors; Toast for a saved confirmation; Typography for text that isn't part of a form.
5
+ source: packages/core/src/components/form-label.tsx
6
+ ---
7
+
8
+ # FormLabel
9
+
10
+ ## 1. Overview
11
+
12
+ `form-label.tsx` exports four parts for the text around a form control: **Label** (a `<label>` with required, optional and hint markers), **FormLabel** (the same component, marked `@deprecated` in favour of Label), **FormDescription** (helper text) and **FormMessage** (a field message, destructive by default). Import `Label`; `FormLabel` still works.
13
+
14
+ ## 2. When to use
15
+
16
+ - The visible label of every form control: Input, Textarea, Select, Checkbox, each RadioGroupItem, Switch.
17
+ - Marking a field as required (`required`) or optional (`optional`).
18
+ - A short note beside the label, such as a limit (`hint`).
19
+ - Helper text under a control (FormDescription).
20
+ - An error, or a neutral status, for one field (FormMessage).
21
+
22
+ ### When not to use
23
+
24
+ - A title for a group of fields → use FieldsetLegend in [Fieldset](./fieldset.md).
25
+ - Labels inside a checkbox list → use [CheckboxGroup](./checkbox-group.md); each item renders its own Label from `label`.
26
+ - An error for the whole form or a failed save → use [Banner](./banner.md) inline.
27
+ - A confirmation after saving → use [Toast](./toast.md).
28
+ - Headings and body text → use [Typography](./typography.md).
29
+
30
+ ## 3. Anatomy
31
+
32
+ 1. **Label row**: a flex `<div>` (baseline-aligned, `--spacing-sm` gap) around the label parts. Props and `ref` go to the inner `<label>`, not this div.
33
+ 2. **Label text**: the `<label>`. `--font-size-sm`, weight 500, line height 1; colour inherits.
34
+ 3. **Required marker**: a CSS-generated `*` after the text in `--destructive-fg`, when `required`.
35
+ 4. **Optional tag**: "(optional)" after the label in `--interactive-fg-alt`, `--font-size-xs`, when `optional`.
36
+ 5. **Hint**: your `hint` string after the label, same style as the optional tag.
37
+ 6. **FormDescription**: a `<p>` in `--interactive-fg-alt`, `--font-size-sm`. Goes under the control.
38
+ 7. **FormMessage**: a `<p>` at `--font-size-sm`, in `--destructive-fg` by default or `--interactive-fg-alt` with `error={false}`. Goes under the control, after any description.
39
+
40
+ ## 4. Variants
41
+
42
+ | Part and prop | Use for |
43
+ | --- | --- |
44
+ | `Label` | Every field. |
45
+ | `Label required` | A field the user must fill. |
46
+ | `Label optional` | A field the user can skip, in a form where most fields are required. |
47
+ | `FormMessage` (default, `error`) | A validation error for the field. |
48
+ | `FormMessage error={false}` | A neutral status for the field, such as "Checking availability". |
49
+
50
+ ## 5. Sizes
51
+
52
+ There's no `size` prop. Label, FormDescription and FormMessage use `--font-size-sm`; the optional tag and hint use `--font-size-xs`. All follow density.
53
+
54
+ ## 6. States
55
+
56
+ | State | Looks like | Notes |
57
+ | --- | --- | --- |
58
+ | Default | `--font-size-sm`, weight 500, inherited colour | |
59
+ | Disabled | Label text in `--interactive-fg-disabled`, not-allowed cursor | `disabled` only styles the label. It isn't forwarded to the DOM and doesn't disable the control; set `disabled` on the control too. |
60
+ | Error | FormMessage in `--destructive-fg` | Label has no error style of its own. |
61
+
62
+ ## 7. Content guidelines
63
+
64
+ - Label: a short noun phrase in sentence case, no colon: "Email", "Workspace name", "Your message".
65
+ - Don't type your own asterisk or "(optional)"; use the props.
66
+ - Hint: a few words, such as "Max 2 MB". Put anything longer in a FormDescription.
67
+ - FormDescription: one sentence of guidance: "This will be your public display name."
68
+ - FormMessage: say what's wrong and how to fix it, in plain words.
69
+
70
+ | Do | Don't |
71
+ | --- | --- |
72
+ | `<Label required>Email</Label>` | `<Label>Email *</Label>` |
73
+ | Label "Workspace name" | Label "Please enter the name of your workspace:" |
74
+ | Message "Enter an email address like jane@acme.com" | Message "Error 422" |
75
+
76
+ ## 8. Rules
77
+
78
+ 1. Import `Label`. `FormLabel` is the same component, marked deprecated.
79
+ 2. Connect every Label to its control: `htmlFor` must match the control's `id`.
80
+ 3. Set `required` on the control as well as on the Label. The asterisk is CSS only and tells assistive tech nothing.
81
+ 4. Set `disabled` on the control as well as on the Label. The Label's `disabled` only greys the text.
82
+ 5. Give FormDescription and FormMessage an `id` and list them in the control's `aria-describedby`; they don't connect themselves. On errors, also set `aria-invalid={true}` on the control.
83
+ 6. Render FormMessage only when there's a message. It has no empty or hidden state.
84
+ 7. Don't put essential guidance in `hint`. It sits outside the `<label>` and isn't linked to the control; use FormDescription instead.
85
+ 8. Don't set `required` and `optional` on the same Label.
86
+ 9. Never pass `className` or `style`; they're dropped.
87
+
88
+ ## 9. Dos and don'ts
89
+
90
+ **Do:** wire the label, helper text and error to the control.
91
+
92
+ ```tsx
93
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
94
+ <Label htmlFor="display-name" required>Display name</Label>
95
+ <Input
96
+ id="display-name"
97
+ required
98
+ aria-invalid={true}
99
+ aria-describedby="display-name-hint display-name-error"
100
+ />
101
+ <FormDescription id="display-name-hint">This will be your public display name.</FormDescription>
102
+ <FormMessage id="display-name-error">Enter a display name</FormMessage>
103
+ </div>
104
+ ```
105
+
106
+ **Don't:** hand-roll the label, asterisk and error text.
107
+
108
+ ```tsx
109
+ <label style={{ fontWeight: 600 }}>Display name <span style={{ color: "red" }}>*</span></label>
110
+ <input />
111
+ <p style={{ color: "red", fontSize: 12 }}>Required</p>
112
+ ```
113
+
114
+ **Do:** disable the control and its label together.
115
+
116
+ ```tsx
117
+ <Label htmlFor="billing-email" disabled>Billing email</Label>
118
+ <Input id="billing-email" type="email" disabled value="billing@acme.com" />
119
+ ```
120
+
121
+ **Don't:** grey the label and leave the control live.
122
+
123
+ ```tsx
124
+ <Label htmlFor="billing-email" disabled>Billing email</Label>
125
+ <Input id="billing-email" type="email" />
126
+ ```
127
+
128
+ ## 10. Accessibility
129
+
130
+ - Role: Label renders a native `<label>`. FormDescription and FormMessage are `<p>` elements with no role.
131
+ - Label: `htmlFor` names the control, and clicking the label focuses or toggles it.
132
+ - Required: the asterisk is generated content; screen readers may skip it or read it as "star". The control's own `required` attribute is what announces it.
133
+ - Optional and hint: both render outside the `<label>`, so they're not part of the control's name and aren't announced with it.
134
+ - Messages: FormMessage isn't a live region. It's read when focus reaches a control that lists it in `aria-describedby`. After a failed submit, move focus to the first invalid field.
135
+ - Focus: Label isn't focusable; clicking it moves focus to the control.
136
+ - Contrast: handled by the theme. Don't override colours.
137
+
138
+ ## 11. Behaviour
139
+
140
+ - Layout: the label row is a block-level `<div>`, so Label always takes its own line. Don't put it inside a `<p>` or inline text.
141
+ - Spacing: Label adds no space below itself. Stack the label, control, description and message in a wrapper with a `--spacing-sm` gap, as the Input and Textarea stories do.
142
+ - Overflow: line height is 1, so long labels wrap tightly. Keep labels to one line.
143
+ - Motion: none.
144
+
145
+ ## 12. API
146
+
147
+ <!-- api:start -->
148
+ ### Label (and FormLabel)
149
+
150
+ | Prop | Type | Default | Description |
151
+ | --- | --- | --- | --- |
152
+ | `htmlFor` | `string` | | The `id` of the control this label names. |
153
+ | `required` | `boolean` | `false` | Adds a `*` after the text in `--destructive-fg`. Visual only. |
154
+ | `optional` | `boolean` | | Adds "(optional)" after the label. |
155
+ | `hint` | `string` | | Short muted text after the label. Not linked to the control. |
156
+ | `disabled` | `boolean` | `false` | Greys the label. Not forwarded to the DOM. |
157
+ | `...props` | `LabelHTMLAttributes<HTMLLabelElement>` without `className`, `style` | | Native label attributes, `id`. `ref` goes to the `<label>`. |
158
+
159
+ ### FormDescription
160
+
161
+ | Prop | Type | Default | Description |
162
+ | --- | --- | --- | --- |
163
+ | `...props` | `HTMLAttributes<HTMLParagraphElement>` without `className`, `style` | | `id` (reference it from `aria-describedby`), `children`. |
164
+
165
+ ### FormMessage
166
+
167
+ | Prop | Type | Default | Description |
168
+ | --- | --- | --- | --- |
169
+ | `error` | `boolean` | `true` | `true` colours the message `--destructive-fg`; `false` uses `--interactive-fg-alt`. |
170
+ | `...props` | `HTMLAttributes<HTMLParagraphElement>` without `className`, `style` | | `id` (reference it from `aria-describedby`), `children`. |
171
+ <!-- api:end -->
172
+
173
+ ## 13. Examples
174
+
175
+ ```tsx
176
+ import { Button, FormDescription, FormMessage, Input, Label, Textarea } from "@eluan/core";
177
+ import * as React from "react";
178
+
179
+ const field = { display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" } as const;
180
+
181
+ export function ProfileForm({ onSave }: { onSave: (name: string, bio: string) => void }) {
182
+ const [name, setName] = React.useState("");
183
+ const [bio, setBio] = React.useState("");
184
+ const [nameError, setNameError] = React.useState<string | null>(null);
185
+
186
+ function handleSubmit(event: React.FormEvent) {
187
+ event.preventDefault();
188
+ if (!name.trim()) {
189
+ setNameError("Enter a display name");
190
+ document.getElementById("profile-name")?.focus();
191
+ return;
192
+ }
193
+ onSave(name, bio);
194
+ }
195
+
196
+ return (
197
+ <form
198
+ onSubmit={handleSubmit}
199
+ noValidate
200
+ style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-lg)" }}
201
+ >
202
+ <div style={field}>
203
+ <Label htmlFor="profile-name" required>Display name</Label>
204
+ <Input
205
+ id="profile-name"
206
+ name="displayName"
207
+ required
208
+ autoComplete="nickname"
209
+ placeholder="Jane Cooper"
210
+ value={name}
211
+ onChange={(event) => {
212
+ setName(event.target.value);
213
+ setNameError(null);
214
+ }}
215
+ aria-invalid={nameError ? true : undefined}
216
+ aria-describedby={nameError ? "profile-name-hint profile-name-error" : "profile-name-hint"}
217
+ />
218
+ <FormDescription id="profile-name-hint">This will be your public display name.</FormDescription>
219
+ {nameError && <FormMessage id="profile-name-error">{nameError}</FormMessage>}
220
+ </div>
221
+
222
+ <div style={field}>
223
+ <Label htmlFor="profile-bio" optional>Bio</Label>
224
+ <Textarea
225
+ id="profile-bio"
226
+ name="bio"
227
+ rows={3}
228
+ maxLength={160}
229
+ value={bio}
230
+ onChange={(event) => setBio(event.target.value)}
231
+ aria-describedby="profile-bio-hint"
232
+ />
233
+ <FormDescription id="profile-bio-hint">Up to 160 characters, shown on your profile.</FormDescription>
234
+ </div>
235
+
236
+ <div style={{ display: "flex", justifyContent: "flex-end" }}>
237
+ <Button type="submit">Save profile</Button>
238
+ </div>
239
+ </form>
240
+ );
241
+ }
242
+ ```
243
+
244
+ ## 14. Related components
245
+
246
+ - [Input](./input.md) and [Textarea](./textarea.md): the text fields Label most often names.
247
+ - [Fieldset](./fieldset.md): FieldsetLegend titles a group of labelled fields.
248
+ - [CheckboxGroup](./checkbox-group.md): renders a Label for each item.
249
+ - [Banner](./banner.md): messages that apply to the whole form.
250
+ - See [../patterns/forms.md](../patterns/forms.md) for validation and error handling across a form.
251
+
252
+ ## 15. Common agent mistakes
253
+
254
+ _Filled from evals._