@eluan/core 0.5.1 → 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 (322) 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/icon.d.ts +26 -0
  58. package/dist/components/layout-shared.d.ts +307 -0
  59. package/dist/components/navigation-drawer.d.ts +25 -5
  60. package/dist/components/row.d.ts +18 -0
  61. package/dist/components/stack.d.ts +14 -0
  62. package/dist/components/tone-shared.d.ts +39 -0
  63. package/dist/components/typography.d.ts +22 -2
  64. package/dist/components/visually-hidden.d.ts +11 -0
  65. package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-9VPlzvDm.js} +1 -1
  66. package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-DppPJBne.cjs} +1 -1
  67. package/dist/credit-card-input.cjs +1 -1
  68. package/dist/credit-card-input.js +1 -1
  69. package/dist/{date-picker-ni8td8Ru.js → date-picker-M5hLx_1s.js} +2 -2
  70. package/dist/{date-picker-DGBsfZXx.cjs → date-picker-hE7cDg2B.cjs} +1 -1
  71. package/dist/date-picker.cjs +1 -1
  72. package/dist/date-picker.js +1 -1
  73. package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-BeRUPJ7s.cjs} +1 -1
  74. package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CIqBZYMH.js} +3 -3
  75. package/dist/datetime-picker.cjs +1 -1
  76. package/dist/datetime-picker.js +1 -1
  77. package/dist/{decimal-input-yTk35W_5.js → decimal-input-Bg2BPKIr.js} +38 -38
  78. package/dist/decimal-input-CkTEjo2J.cjs +1 -0
  79. package/dist/decimal-input.cjs +1 -1
  80. package/dist/decimal-input.js +1 -1
  81. package/dist/{dialog-B8eWKqzS.js → dialog-Bsfviqvy.js} +2 -2
  82. package/dist/dialog-DRAoumvB.cjs +1 -0
  83. package/dist/dialog.cjs +1 -1
  84. package/dist/dialog.js +1 -1
  85. package/dist/{email-input-DFI4h_KN.cjs → email-input-CehmtNUq.cjs} +1 -1
  86. package/dist/{email-input-pX0hlYV3.js → email-input-DIiY9Q3S.js} +1 -1
  87. package/dist/email-input.cjs +1 -1
  88. package/dist/email-input.js +1 -1
  89. package/dist/{footer-DB0_-IwN.cjs → footer-fovIsy-0.cjs} +1 -1
  90. package/dist/{footer-B3KUIwXW.js → footer-jWaFq3qk.js} +9 -9
  91. package/dist/footer.cjs +1 -1
  92. package/dist/footer.js +1 -1
  93. package/dist/grid-BDz4Xs6M.cjs +1 -0
  94. package/dist/grid-BX5vZjDo.js +612 -0
  95. package/dist/grid.cjs +1 -0
  96. package/dist/grid.d.ts +1 -0
  97. package/dist/grid.js +5 -0
  98. package/dist/{header-CDOWlOAR.js → header-Dnf8AnIx.js} +2 -2
  99. package/dist/{header-CiZQY_7S.cjs → header-DzItWqW4.cjs} +1 -1
  100. package/dist/header.cjs +1 -1
  101. package/dist/header.js +1 -1
  102. package/dist/icon-BmLOodCQ.cjs +1 -0
  103. package/dist/icon-BwDfkIdR.js +153 -0
  104. package/dist/icon.cjs +1 -0
  105. package/dist/icon.d.ts +1 -0
  106. package/dist/icon.js +5 -0
  107. package/dist/index.cjs +10 -5
  108. package/dist/index.d.ts +6 -0
  109. package/dist/index.js +612 -541
  110. package/dist/{input-BrGJn-D9.cjs → input-BcjL2oxv.cjs} +1 -1
  111. package/dist/{input-Cccufiqn.js → input-CPb9yVU5.js} +8 -8
  112. package/dist/input-otp-BhJ3ERrY.cjs +1 -0
  113. package/dist/{input-otp-DmEGB1nu.js → input-otp-CTvJztkH.js} +32 -32
  114. package/dist/input-otp.cjs +1 -1
  115. package/dist/input-otp.js +1 -1
  116. package/dist/input.cjs +1 -1
  117. package/dist/input.js +1 -1
  118. package/dist/layout-shared-B_1iX4Hj.js +319 -0
  119. package/dist/layout-shared-CsBZcT4V.cjs +1 -0
  120. package/dist/{multi-select-B6NBbDCW.js → multi-select-CVxkWW29.js} +30 -30
  121. package/dist/multi-select-DBFINH3F.cjs +1 -0
  122. package/dist/multi-select.cjs +1 -1
  123. package/dist/multi-select.js +1 -1
  124. package/dist/navigation-drawer-BCBFtLEq.cjs +1 -0
  125. package/dist/navigation-drawer-BMyHXhhX.js +198 -0
  126. package/dist/navigation-drawer.cjs +1 -1
  127. package/dist/navigation-drawer.js +1 -1
  128. package/dist/{number-input-vICbRc2y.js → number-input-Cm9YPBOX.js} +1 -1
  129. package/dist/{number-input-Bc7jUsu-.cjs → number-input-Dr9MbuRV.cjs} +1 -1
  130. package/dist/number-input.cjs +1 -1
  131. package/dist/number-input.js +1 -1
  132. package/dist/{pagination-DTWRjiOm.js → pagination-D2tjMpVU.js} +2 -2
  133. package/dist/{pagination-4IuE_APs.cjs → pagination-yKmFlFMR.cjs} +1 -1
  134. package/dist/pagination.cjs +1 -1
  135. package/dist/pagination.js +1 -1
  136. package/dist/{password-input-BwnlHPbX.cjs → password-input-CmHubHuU.cjs} +1 -1
  137. package/dist/{password-input-B9V45d3Q.js → password-input-ljwdGCO6.js} +2 -2
  138. package/dist/password-input.cjs +1 -1
  139. package/dist/password-input.js +1 -1
  140. package/dist/{phone-input-BQjZj5jI.cjs → phone-input-B8VksCer.cjs} +1 -1
  141. package/dist/{phone-input-CSBpGHvI.js → phone-input-qTL6K8rT.js} +2 -2
  142. package/dist/phone-input.cjs +1 -1
  143. package/dist/phone-input.js +1 -1
  144. package/dist/progress-BpdmBGaX.cjs +1 -0
  145. package/dist/{progress-Dz_it5I-.js → progress-ChFf9bIq.js} +1 -1
  146. package/dist/progress.cjs +1 -1
  147. package/dist/progress.js +1 -1
  148. package/dist/providers/create-theme.d.ts +10 -1
  149. package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
  150. package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
  151. package/dist/radio-group.cjs +1 -1
  152. package/dist/radio-group.js +1 -1
  153. package/dist/{rich-text-BZSyuYSo.js → rich-text-DImwK9hN.js} +1 -1
  154. package/dist/{rich-text-DerWxzdn.cjs → rich-text-DzHLeG7W.cjs} +1 -1
  155. package/dist/rich-text.cjs +1 -1
  156. package/dist/rich-text.js +1 -1
  157. package/dist/row-BYAk7G5d.js +37 -0
  158. package/dist/row-Bjn-GQAC.cjs +1 -0
  159. package/dist/row.cjs +1 -0
  160. package/dist/row.d.ts +1 -0
  161. package/dist/row.js +5 -0
  162. package/dist/{search-input-Dmmo-BEL.cjs → search-input-BKTjebg7.cjs} +1 -1
  163. package/dist/{search-input-bFNW6oiE.js → search-input-Dgr9kT1a.js} +1 -1
  164. package/dist/search-input.cjs +1 -1
  165. package/dist/search-input.js +1 -1
  166. package/dist/select-Cdh991T-.cjs +1 -0
  167. package/dist/{select-DDSYjKtj.js → select-Dp5AJ6I-.js} +15 -15
  168. package/dist/select.cjs +1 -1
  169. package/dist/select.js +1 -1
  170. package/dist/sheet-CkXjinUG.cjs +1 -0
  171. package/dist/{sheet-D5HWF66e.js → sheet-uiyHNKEw.js} +6 -6
  172. package/dist/sheet.cjs +1 -1
  173. package/dist/sheet.js +1 -1
  174. package/dist/{slider-CZQBAXup.js → slider-BQmbh0Nl.js} +1 -1
  175. package/dist/{slider-DdEOapYP.cjs → slider-DK2yk-YK.cjs} +1 -1
  176. package/dist/slider.cjs +1 -1
  177. package/dist/slider.js +1 -1
  178. package/dist/stack-Ck1w2iJu.cjs +1 -0
  179. package/dist/stack-D2btWM1t.js +27 -0
  180. package/dist/stack.cjs +1 -0
  181. package/dist/stack.d.ts +1 -0
  182. package/dist/stack.js +5 -0
  183. package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
  184. package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
  185. package/dist/stepper.cjs +1 -1
  186. package/dist/stepper.js +1 -1
  187. package/dist/styles.css +935 -59
  188. package/dist/{switch-KzBijHMJ.cjs → switch-C2OPCq5Z.cjs} +1 -1
  189. package/dist/{switch-C7EBLT5H.js → switch-CXBWUZcq.js} +3 -3
  190. package/dist/switch.cjs +1 -1
  191. package/dist/switch.js +1 -1
  192. package/dist/{tabs-DztJ2iVc.cjs → tabs-D8p6Tr5i.cjs} +1 -1
  193. package/dist/{tabs-C9NKBmH0.js → tabs-TV4_2wi1.js} +9 -9
  194. package/dist/tabs.cjs +1 -1
  195. package/dist/tabs.js +1 -1
  196. package/dist/{textarea-Dl-daLHR.cjs → textarea-BnpQmE74.cjs} +1 -1
  197. package/dist/{textarea-DXUk1b_-.js → textarea-CJRmnazN.js} +1 -1
  198. package/dist/textarea.cjs +1 -1
  199. package/dist/textarea.js +1 -1
  200. package/dist/{time-input-BPoFvoeM.js → time-input-A603mEFQ.js} +38 -38
  201. package/dist/time-input-qxljhdEb.cjs +1 -0
  202. package/dist/time-input.cjs +1 -1
  203. package/dist/time-input.js +1 -1
  204. package/dist/{toggle-Dv1VZ5Le.js → toggle-Bx3q15Pu.js} +6 -6
  205. package/dist/{toggle-Bvh1v32T.cjs → toggle-Z3t4jPdv.cjs} +1 -1
  206. package/dist/{toggle-group-SyHMwO90.cjs → toggle-group-BZIW4wJp.cjs} +1 -1
  207. package/dist/{toggle-group-DE8BPZih.js → toggle-group-LaZmOMx_.js} +7 -7
  208. package/dist/toggle-group.cjs +1 -1
  209. package/dist/toggle-group.js +1 -1
  210. package/dist/toggle.cjs +1 -1
  211. package/dist/toggle.js +1 -1
  212. package/dist/{tree-view-CyeJR7cW.js → tree-view-DRmm6oL6.js} +23 -23
  213. package/dist/tree-view-DVQyRQDg.cjs +1 -0
  214. package/dist/tree-view.cjs +1 -1
  215. package/dist/tree-view.js +1 -1
  216. package/dist/visually-hidden-BQMRYGxP.js +14 -0
  217. package/dist/visually-hidden-DzxxOswl.cjs +1 -0
  218. package/dist/visually-hidden.cjs +1 -0
  219. package/dist/visually-hidden.d.ts +1 -0
  220. package/dist/visually-hidden.js +5 -0
  221. package/package.json +8 -8
  222. package/skills/eluan/DESIGN.md +409 -0
  223. package/skills/eluan/SKILL.md +166 -0
  224. package/skills/eluan/components/accordion.md +212 -0
  225. package/skills/eluan/components/action-popover.md +266 -0
  226. package/skills/eluan/components/aspect-ratio.md +169 -0
  227. package/skills/eluan/components/avatar.md +277 -0
  228. package/skills/eluan/components/badge.md +190 -0
  229. package/skills/eluan/components/banner.md +247 -0
  230. package/skills/eluan/components/box.md +166 -0
  231. package/skills/eluan/components/breadcrumb.md +240 -0
  232. package/skills/eluan/components/button.md +214 -0
  233. package/skills/eluan/components/calendar.md +192 -0
  234. package/skills/eluan/components/card.md +270 -0
  235. package/skills/eluan/components/carousel.md +274 -0
  236. package/skills/eluan/components/checkbox-group.md +228 -0
  237. package/skills/eluan/components/checkbox.md +226 -0
  238. package/skills/eluan/components/code-block.md +193 -0
  239. package/skills/eluan/components/collapsible.md +240 -0
  240. package/skills/eluan/components/command.md +359 -0
  241. package/skills/eluan/components/context-menu.md +296 -0
  242. package/skills/eluan/components/credit-card-input.md +217 -0
  243. package/skills/eluan/components/date-picker.md +255 -0
  244. package/skills/eluan/components/date-time-picker.md +196 -0
  245. package/skills/eluan/components/decimal-input.md +232 -0
  246. package/skills/eluan/components/dialog.md +322 -0
  247. package/skills/eluan/components/drawer.md +292 -0
  248. package/skills/eluan/components/dropdown-menu.md +450 -0
  249. package/skills/eluan/components/email-input.md +200 -0
  250. package/skills/eluan/components/fieldset.md +219 -0
  251. package/skills/eluan/components/file-input.md +249 -0
  252. package/skills/eluan/components/footer.md +290 -0
  253. package/skills/eluan/components/form-label.md +254 -0
  254. package/skills/eluan/components/grid.md +192 -0
  255. package/skills/eluan/components/header.md +242 -0
  256. package/skills/eluan/components/hover-card.md +215 -0
  257. package/skills/eluan/components/icon.md +161 -0
  258. package/skills/eluan/components/input-otp.md +227 -0
  259. package/skills/eluan/components/input.md +249 -0
  260. package/skills/eluan/components/kbd.md +216 -0
  261. package/skills/eluan/components/media.md +244 -0
  262. package/skills/eluan/components/menubar.md +300 -0
  263. package/skills/eluan/components/multi-select.md +221 -0
  264. package/skills/eluan/components/navigation-drawer.md +297 -0
  265. package/skills/eluan/components/navigation-menu.md +291 -0
  266. package/skills/eluan/components/number-input.md +190 -0
  267. package/skills/eluan/components/pagination.md +262 -0
  268. package/skills/eluan/components/password-input.md +218 -0
  269. package/skills/eluan/components/phone-input.md +205 -0
  270. package/skills/eluan/components/popover.md +250 -0
  271. package/skills/eluan/components/progress.md +185 -0
  272. package/skills/eluan/components/radio-group.md +232 -0
  273. package/skills/eluan/components/rich-text.md +195 -0
  274. package/skills/eluan/components/row.md +174 -0
  275. package/skills/eluan/components/scroll-area.md +203 -0
  276. package/skills/eluan/components/search-input.md +281 -0
  277. package/skills/eluan/components/segmented-control.md +201 -0
  278. package/skills/eluan/components/select.md +296 -0
  279. package/skills/eluan/components/separator.md +179 -0
  280. package/skills/eluan/components/sheet.md +326 -0
  281. package/skills/eluan/components/skeleton.md +202 -0
  282. package/skills/eluan/components/slider.md +195 -0
  283. package/skills/eluan/components/spinner.md +187 -0
  284. package/skills/eluan/components/stack.md +158 -0
  285. package/skills/eluan/components/stepper.md +236 -0
  286. package/skills/eluan/components/switch.md +218 -0
  287. package/skills/eluan/components/table.md +348 -0
  288. package/skills/eluan/components/tabs.md +277 -0
  289. package/skills/eluan/components/textarea.md +202 -0
  290. package/skills/eluan/components/time-input.md +181 -0
  291. package/skills/eluan/components/toast.md +251 -0
  292. package/skills/eluan/components/toggle-group.md +241 -0
  293. package/skills/eluan/components/toggle.md +198 -0
  294. package/skills/eluan/components/tooltip.md +222 -0
  295. package/skills/eluan/components/tree-view.md +213 -0
  296. package/skills/eluan/components/typography.md +207 -0
  297. package/skills/eluan/components/visually-hidden.md +132 -0
  298. package/skills/eluan/foundations/colour.md +252 -0
  299. package/skills/eluan/foundations/elevation.md +57 -0
  300. package/skills/eluan/foundations/iconography.md +70 -0
  301. package/skills/eluan/foundations/motion.md +60 -0
  302. package/skills/eluan/foundations/radius.md +61 -0
  303. package/skills/eluan/foundations/spacing.md +98 -0
  304. package/skills/eluan/foundations/theming.md +197 -0
  305. package/skills/eluan/foundations/typography.md +163 -0
  306. package/skills/eluan/patterns/empty-states.md +84 -0
  307. package/skills/eluan/patterns/feedback.md +95 -0
  308. package/skills/eluan/patterns/forms.md +138 -0
  309. package/skills/eluan/patterns/navigation.md +95 -0
  310. package/skills/eluan/patterns/page-layout.md +101 -0
  311. package/dist/button-Ny6OF8Un.cjs +0 -1
  312. package/dist/decimal-input-BLmifKF2.cjs +0 -1
  313. package/dist/dialog-DWYtFhZl.cjs +0 -1
  314. package/dist/input-otp-DcZ7wyjs.cjs +0 -1
  315. package/dist/multi-select-kcoUbSwE.cjs +0 -1
  316. package/dist/navigation-drawer-BbeDYPhu.js +0 -171
  317. package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
  318. package/dist/progress-DpQjGEyn.cjs +0 -1
  319. package/dist/select-1Eb3NSrR.cjs +0 -1
  320. package/dist/sheet-7NP1LuHy.cjs +0 -1
  321. package/dist/time-input-DR2snTgB.cjs +0 -1
  322. package/dist/tree-view-CNvEc1TT.cjs +0 -1
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: Skeleton
3
+ use_when: Holding the shape of content that's loading into a known layout, such as a list, card grid or table on first load.
4
+ instead_of: Spinner for a short in-place wait or a running action; Progress when the amount is known.
5
+ source: packages/core/src/components/skeleton.tsx
6
+ ---
7
+
8
+ # Skeleton
9
+
10
+ ## 1. Overview
11
+
12
+ Skeleton is a pulsing placeholder block in the shape of content that hasn't loaded yet. It renders an empty `<div>`; you set its `width`, `height` and `radius`, and compose several to match the layout that's coming.
13
+
14
+ ## 2. When to use
15
+
16
+ - The first load of a list, card grid, table or profile whose layout you know.
17
+ - A panel or section that loads after the rest of the page.
18
+
19
+ ### When not to use
20
+
21
+ - An action is running (save, export) → use [Spinner](./spinner.md) inside the [Button](./button.md).
22
+ - A short refresh, or you don't know the layout → use [Spinner](./spinner.md).
23
+ - You know how far along the work is → use [Progress](./progress.md).
24
+ - Loading finished and there's nothing to show → see [patterns/empty-states.md](../patterns/empty-states.md).
25
+
26
+ ## 3. Anatomy
27
+
28
+ 1. **Block**: the `<div>`; `--container-bg-alt` fill, `--curves-md` corners, pulsing.
29
+
30
+ Compose blocks into the shape of the content: thin blocks for lines of text, a circle (`radius="var(--radius-radius-full)"`) for an avatar, a tall block for an image.
31
+
32
+ ## 4. Variants
33
+
34
+ Skeleton has no variants. Its shape comes from `width`, `height` and `radius`.
35
+
36
+ ## 5. Sizes
37
+
38
+ Skeleton has no size prop. `width` defaults to `100%` and `height` to `var(--size-xxs)`. Pass token strings:
39
+
40
+ | Placeholder for | Props |
41
+ | --- | --- |
42
+ | A line of body text | default height; `width` as a percentage, such as `"75%"` |
43
+ | A heading | `height="var(--size-xs)"` |
44
+ | An avatar | `width` and `height` `"var(--size-lg)"`, `radius="var(--radius-radius-full)"` |
45
+ | An image or media block | `height="var(--size-4xl)"`, `radius="var(--curves-lg)"` |
46
+ | A table cell | `height="var(--size-sm)"` |
47
+
48
+ ## 6. States
49
+
50
+ | State | Looks like | Notes |
51
+ | --- | --- | --- |
52
+ | Default | Fill pulsing between full and half opacity every 2 seconds | |
53
+ | Reduced motion | Static fill | Under `prefers-reduced-motion` the pulse runs once, almost instantly, and stops. |
54
+
55
+ ## 7. Content guidelines
56
+
57
+ Skeletons have no text. Make them look like the content they stand in for:
58
+
59
+ - Use about as many lines as the real content, and make the last line of a paragraph shorter.
60
+ - Put circles where avatars will be and blocks where images will be.
61
+ - Keep the real spacing: use the same `gap` the loaded layout uses.
62
+
63
+ | Do | Don't |
64
+ | --- | --- |
65
+ | Three rows, each an avatar circle and two lines | One grey block covering the whole page |
66
+ | Line widths of 100%, 100% and 60% | Every line at full width |
67
+
68
+ ## 8. Rules
69
+
70
+ 1. Match the shape and size of the content that replaces it, so the layout doesn't jump when data arrives.
71
+ 2. Size with tokens or percentages. Never pass numbers (they become px) or rem values.
72
+ 3. Use `--radius-radius-full` only for circles; otherwise keep the default corners or use a `--curves-*` token.
73
+ 4. Don't place skeletons on a `--container-bg-alt` surface. They use the same fill and disappear.
74
+ 5. Hide skeletons from assistive tech and mark the region busy: `aria-hidden="true"` on the skeleton wrapper, `aria-busy="true"` on the region, and a visually hidden "Loading…" message.
75
+ 6. Swap the whole skeleton layout for the real content in one go.
76
+ 7. Never pass `className` or `style`; they're dropped. Use the `width`, `height` and `radius` props, and a wrapper for anything else.
77
+
78
+ ## 9. Dos and don'ts
79
+
80
+ **Do:** mirror the row you're loading, with tokens.
81
+
82
+ ```tsx
83
+ <div aria-hidden="true" style={{ display: "flex", alignItems: "center", gap: "var(--spacing-md)" }}>
84
+ <Skeleton width="var(--size-lg)" height="var(--size-lg)" radius="var(--radius-radius-full)" />
85
+ <div style={{ display: "flex", flex: 1, flexDirection: "column", gap: "var(--spacing-xs)" }}>
86
+ <Skeleton width="50%" />
87
+ <Skeleton width="75%" />
88
+ </div>
89
+ </div>
90
+ ```
91
+
92
+ **Don't:** size in px or rem, or style it directly.
93
+
94
+ ```tsx
95
+ <Skeleton width={200} height="1rem" style={{ background: "#eee" }} />
96
+ ```
97
+
98
+ **Do:** use a Spinner in the button for a running action.
99
+
100
+ ```tsx
101
+ <Button type="submit" aria-busy aria-disabled>
102
+ <Spinner size="sm" aria-hidden="true" />
103
+ Saving…
104
+ </Button>
105
+ ```
106
+
107
+ **Don't:** replace a form with skeletons while it saves.
108
+
109
+ ```tsx
110
+ {saving ? <Skeleton height="var(--size-4xl)" /> : <ProfileForm />}
111
+ ```
112
+
113
+ ## 10. Accessibility
114
+
115
+ - Role: none. Skeleton is an empty `<div>` with no text, so screen readers skip it and nothing says content is loading.
116
+ - Label: none. Mark the loading region `aria-busy="true"`, hide the skeletons with `aria-hidden="true"`, and add a visually hidden status message. See Rules.
117
+ - Keyboard: not focusable; no keys.
118
+ - Focus: Skeleton never takes focus. Don't move focus when the real content replaces it.
119
+ - Motion: the pulse respects `prefers-reduced-motion`.
120
+ - Contrast: `--container-bg-alt` is a subtle fill meant for `--container-bg` surfaces. Don't override colours.
121
+
122
+ ## 11. Behaviour
123
+
124
+ - Responsive: the default `width="100%"` fills the container. Percentage widths track the container.
125
+ - Flex rows: Skeleton sets `flex-shrink: 0`, so a full-width skeleton in a flex row won't shrink. Wrap it in an element with `flex: 1`, as the stories do for table cells.
126
+ - Density: heights from `--size-*` grow and shrink with density, like the content they stand in for.
127
+ - Motion: 2-second opacity pulse, forever, until unmounted. Don't add your own.
128
+
129
+ ## 12. API
130
+
131
+ <!-- api:start -->
132
+ | Prop | Type | Default | Description |
133
+ | --- | --- | --- | --- |
134
+ | `width` | `number \| string` | `"100%"` | Width. Numbers are pixels; pass a percentage or a `--size-*` token instead. |
135
+ | `height` | `number \| string` | `"var(--size-xxs)"` | Height. Numbers are pixels; pass a `--size-*` token instead. |
136
+ | `radius` | `string` | `--curves-md` | Corner radius, such as `"var(--radius-radius-full)"` for a circle. |
137
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | `aria-hidden`, `id`. Skeleton isn't wrapped in `forwardRef`. |
138
+ <!-- api:end -->
139
+
140
+ ## 13. Examples
141
+
142
+ ```tsx
143
+ import { Skeleton, Typography } from "@eluan/core";
144
+
145
+ type Teammate = { id: string; name: string; email: string };
146
+
147
+ // eluan: composed, no component for visually hidden text (same recipe Spinner uses internally)
148
+ const visuallyHidden: React.CSSProperties = {
149
+ position: "absolute",
150
+ width: 1,
151
+ height: 1,
152
+ overflow: "hidden",
153
+ clip: "rect(0 0 0 0)",
154
+ whiteSpace: "nowrap",
155
+ };
156
+
157
+ export function TeammateList({ teammates }: { teammates: Teammate[] | undefined }) {
158
+ const loading = teammates === undefined;
159
+
160
+ return (
161
+ <section aria-busy={loading} aria-labelledby="teammates-heading">
162
+ <Typography variant="heading" id="teammates-heading">Teammates</Typography>
163
+ {loading ? (
164
+ <>
165
+ <span role="status" style={visuallyHidden}>Loading teammates…</span>
166
+ <div aria-hidden="true" style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
167
+ {["a", "b", "c"].map((key) => (
168
+ <div key={key} style={{ display: "flex", alignItems: "center", gap: "var(--spacing-md)" }}>
169
+ <Skeleton width="var(--size-lg)" height="var(--size-lg)" radius="var(--radius-radius-full)" />
170
+ <div style={{ display: "flex", flex: 1, flexDirection: "column", gap: "var(--spacing-xs)" }}>
171
+ <Skeleton width="40%" />
172
+ <Skeleton width="60%" />
173
+ </div>
174
+ </div>
175
+ ))}
176
+ </div>
177
+ </>
178
+ ) : (
179
+ <ul style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)", margin: 0, padding: 0, listStyle: "none" }}>
180
+ {teammates.map((person) => (
181
+ <li key={person.id}>
182
+ <Typography variant="body">{person.name}</Typography>
183
+ <Typography variant="caption" tone="muted">{person.email}</Typography>
184
+ </li>
185
+ ))}
186
+ </ul>
187
+ )}
188
+ </section>
189
+ );
190
+ }
191
+ ```
192
+
193
+ ## 14. Related components
194
+
195
+ - [Spinner](./spinner.md): short in-place waits and running actions.
196
+ - [Progress](./progress.md): work with a known amount.
197
+ - [Card](./card.md), [Table](./table.md) and [Avatar](./avatar.md): the layouts skeletons usually stand in for.
198
+ - See [patterns/empty-states.md](../patterns/empty-states.md) for what to show when loading returns nothing.
199
+
200
+ ## 15. Common agent mistakes
201
+
202
+ _Filled from evals._
@@ -0,0 +1,195 @@
1
+ ---
2
+ name: Slider
3
+ use_when: The user sets a value or a range on a bounded scale where the position matters more than the exact number, such as volume, opacity or a price range.
4
+ instead_of: NumberInput or DecimalInput when the exact value matters; SegmentedControl or RadioGroup for a few named steps; Progress to show progress.
5
+ source: packages/core/src/components/slider.tsx
6
+ ---
7
+
8
+ # Slider
9
+
10
+ ## 1. Overview
11
+
12
+ Slider lets the user set a number, or a range with two thumbs, by dragging along a track or using the arrow keys. It wraps Radix Slider and renders the track, the filled range and one thumb per value for you. It renders no label and no value text.
13
+
14
+ ## 2. When to use
15
+
16
+ - A value on a bounded scale where position is the point: volume, opacity, zoom, brightness.
17
+ - A range with two thumbs: a price filter, a minimum and maximum size.
18
+ - A setting the user adjusts while watching the result update.
19
+
20
+ ### When not to use
21
+
22
+ - An exact number the user knows (quantity, age, amount) → use [NumberInput](./number-input.md) or [DecimalInput](./decimal-input.md).
23
+ - A few named steps (Low, Medium, High) → use [SegmentedControl](./segmented-control.md) or [RadioGroup](./radio-group.md).
24
+ - Showing how far a task has got → use [Progress](./progress.md). Slider is an input.
25
+ - Turning something on or off → use [Switch](./switch.md).
26
+
27
+ ## 3. Anatomy
28
+
29
+ 1. **Root**: a full-width row that holds the track and thumbs.
30
+ 2. **Track**: a thin pill in `--interactive-bg-alt`.
31
+ 3. **Range**: the filled part of the track in `--interactive-bg-selected`, from the start to the thumb (or between two thumbs).
32
+ 4. **Thumb**: one per value, `--size-xxs` square, `--interactive-bg` fill with a 1px `--interactive-bg-selected` border. Each thumb is the focusable `slider` element.
33
+
34
+ Slider renders one thumb per entry in `value` (when it's an array), else per entry in `defaultValue`, else one thumb. Compose the label and the value readout yourself.
35
+
36
+ ## 4. Variants
37
+
38
+ Slider has no variants.
39
+
40
+ ## 5. Sizes
41
+
42
+ Slider has no size prop. It fills its container's width; the track and thumb sizes come from `--spacing-*` and `--size-xxs`, so they follow density. Set width on a wrapper.
43
+
44
+ ## 6. States
45
+
46
+ | State | Looks like | Notes |
47
+ | --- | --- | --- |
48
+ | Default | Pale track, dark range, light thumb with a dark border | The thumb renders as a circle on the `slight` and `sweeping` corner styles and as a square on `sharp`. |
49
+ | Focus | 1px outline in `--focus-ring`, 1px offset, on the focused thumb | Never remove or restyle the focus ring. |
50
+ | Disabled | Range turns `--interactive-fg-disabled`; thumb fills with `--interactive-bg-disabled` and its border turns `--interactive-fg-disabled` | Set `disabled`. Thumbs get `data-disabled`, not the native attribute, and leave the Tab order. |
51
+
52
+ ## 7. Content guidelines
53
+
54
+ - Put a visible label above the slider that names the setting: "Volume", "Price".
55
+ - Show the current value as text next to the label, formatted the way users think of it: "60%", "$40 – $120", "1.5×".
56
+ - Show the minimum and maximum as text under the ends when the scale isn't obvious.
57
+
58
+ | Do | Don't |
59
+ | --- | --- |
60
+ | Volume · 60% | Slider |
61
+ | Price · $40 – $120 | Range: 40,120 |
62
+
63
+ ## 8. Rules
64
+
65
+ 1. Pass values as arrays, one entry per thumb: `defaultValue={[50]}`, `value={[20, 80]}`.
66
+ 2. When controlled, update `value` from `onValueChange`. Run expensive work (saving, fetching) in `onValueCommit`, which fires once the user lets go.
67
+ 3. Set `min`, `max` and `step` explicitly. They default to 0, 100 and 1.
68
+ 4. Always show a visible label and the current value as text; Slider renders neither, and screen readers get no name from it (see Accessibility).
69
+ 5. Keep `orientation="horizontal"`. Eluan's track and root styles are horizontal only.
70
+ 6. Use `name` to submit with a native form. Radix adds a hidden input per thumb and appends `[]` to the name for ranges.
71
+ 7. Never pass `className` or `style`; they're dropped. Set width on a wrapper.
72
+
73
+ ## 9. Dos and don'ts
74
+
75
+ **Do:** label the slider and show its value.
76
+
77
+ ```tsx
78
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
79
+ <div style={{ display: "flex", justifyContent: "space-between" }}>
80
+ <Typography variant="label" weight="medium">Volume</Typography>
81
+ <Typography variant="label" tone="muted">{volume[0]}%</Typography>
82
+ </div>
83
+ <Slider value={volume} onValueChange={setVolume} max={100} step={5} />
84
+ </div>
85
+ ```
86
+
87
+ **Don't:** drop a bare slider with no label, value or array.
88
+
89
+ ```tsx
90
+ <Slider value={volume} onChange={setVolume} />
91
+ ```
92
+
93
+ **Do:** save once the user lets go.
94
+
95
+ ```tsx
96
+ <Slider defaultValue={[70]} onValueCommit={([next]) => saveBrightness(next)} />
97
+ ```
98
+
99
+ **Don't:** save on every move.
100
+
101
+ ```tsx
102
+ <Slider defaultValue={[70]} onValueChange={([next]) => saveBrightness(next)} />
103
+ ```
104
+
105
+ ## 10. Accessibility
106
+
107
+ - Role: each thumb is a `slider` with `aria-valuemin`, `aria-valuemax`, `aria-valuenow` and `aria-orientation`.
108
+ - Label: Slider passes `aria-label` and `aria-labelledby` to its root, which has no role, not to the thumbs it renders, and you can't pass props to the thumbs. A single-thumb Slider therefore has no accessible name; a two-thumb Slider's thumbs are named "Minimum" and "Maximum" by Radix. Screen readers announce the bare number, with no unit. Show a visible label and the value with its unit as text next to it.
109
+ - Keyboard: arrow keys move the focused thumb by `step`; Shift with an arrow, PageUp and PageDown move by 10 steps; Home and End jump to `min` and `max`. Tab moves between thumbs.
110
+ - Focus: every enabled thumb is in the Tab order; disabled thumbs aren't.
111
+ - Contrast: handled by the theme. Don't override colours.
112
+
113
+ ## 11. Behaviour
114
+
115
+ - Responsive: fills its container's width.
116
+ - Pointer: clicking the track moves the nearest thumb there. Touch dragging doesn't scroll the page (`touch-action: none`).
117
+ - Ranges: with two thumbs the range fills between them. Use `minStepsBetweenThumbs` to keep them apart.
118
+ - Overflow and truncation: not applicable; there's no text.
119
+ - Motion: thumb colours transition over 150ms. The thumb doesn't animate between positions. Don't add motion.
120
+
121
+ ## 12. API
122
+
123
+ <!-- api:start -->
124
+ | Prop | Type | Default | Description |
125
+ | --- | --- | --- | --- |
126
+ | `value` | `number[]` | | Controlled values, one per thumb. Also sets the thumb count. |
127
+ | `defaultValue` | `number[]` | one thumb at `min` | Initial values when uncontrolled; sets the thumb count. |
128
+ | `onValueChange` | `(value: number[]) => void` | | Called on every change while dragging or pressing keys. |
129
+ | `onValueCommit` | `(value: number[]) => void` | | Called once when the user releases the thumb or finishes a key press. |
130
+ | `min` | `number` | `0` | Lowest value. |
131
+ | `max` | `number` | `100` | Highest value. |
132
+ | `step` | `number` | `1` | Increment for dragging and arrow keys. |
133
+ | `minStepsBetweenThumbs` | `number` | `0` | Minimum gap between thumbs, in steps. |
134
+ | `disabled` | `boolean` | `false` | Disables every thumb. |
135
+ | `name` | `string` | | Submits each value through a hidden input. |
136
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Keep horizontal; Eluan's styles don't support vertical. |
137
+ | `inverted` | `boolean` | `false` | Reverses the direction of the track. |
138
+ | `...props` | Radix `Slider.Root` props without `className`, `style` | | `dir`, `form`. Land on the root element, not the thumbs. |
139
+ <!-- api:end -->
140
+
141
+ `className` and `style` are omitted; Eluan components are styling-closed.
142
+
143
+ ## 13. Examples
144
+
145
+ ```tsx
146
+ import { useState } from "react";
147
+ import { Slider, Typography } from "@eluan/core";
148
+
149
+ export function PriceFilter({ onApply }: { onApply: (range: number[]) => void }) {
150
+ const [price, setPrice] = useState([40, 120]);
151
+
152
+ return (
153
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
154
+ <div style={{ display: "flex", justifyContent: "space-between" }}>
155
+ <Typography variant="label" weight="medium">
156
+ Price
157
+ </Typography>
158
+ <Typography variant="label" tone="muted">
159
+ ${price[0]} – ${price[1]}
160
+ </Typography>
161
+ </div>
162
+ <Slider
163
+ min={0}
164
+ max={200}
165
+ step={10}
166
+ minStepsBetweenThumbs={1}
167
+ value={price}
168
+ onValueChange={setPrice}
169
+ onValueCommit={onApply}
170
+ />
171
+ <div style={{ display: "flex", justifyContent: "space-between" }}>
172
+ <Typography variant="caption" tone="muted">
173
+ $0
174
+ </Typography>
175
+ <Typography variant="caption" tone="muted">
176
+ $200
177
+ </Typography>
178
+ </div>
179
+ </div>
180
+ );
181
+ }
182
+ ```
183
+
184
+ ## 14. Related components
185
+
186
+ - [NumberInput](./number-input.md): exact whole numbers.
187
+ - [DecimalInput](./decimal-input.md): exact decimal numbers and amounts.
188
+ - [SegmentedControl](./segmented-control.md): a few named steps.
189
+ - [Progress](./progress.md): shows progress; not an input.
190
+ - [Label](./form-label.md): `Label` for the visible label above a Slider.
191
+ - See [forms](../patterns/forms.md) for choosing an input.
192
+
193
+ ## 15. Common agent mistakes
194
+
195
+ _Filled from evals._
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: Spinner
3
+ use_when: Showing that something is working when you can't say how long it will take, such as a button action or a panel refreshing.
4
+ instead_of: Progress when the amount is known; Skeleton when content loads into a known layout.
5
+ source: packages/core/src/components/spinner.tsx
6
+ ---
7
+
8
+ # Spinner
9
+
10
+ ## 1. Overview
11
+
12
+ Spinner is a rotating ring that shows work in progress. It renders a `<div role="status">` named "Loading", with visually hidden "Loading..." text inside. It draws in the current text colour and comes in four sizes.
13
+
14
+ ## 2. When to use
15
+
16
+ - Inside a Button while its action runs, before the label.
17
+ - A region refreshing in place: a table reloading after a filter change, a card fetching new data.
18
+ - A short wait where you don't know the shape of what's coming.
19
+
20
+ ### When not to use
21
+
22
+ - You know how far along the work is → use [Progress](./progress.md).
23
+ - Content is loading into a known layout (a list, card grid or table on first load) → use [Skeleton](./skeleton.md). Don't put a lone Spinner in the middle of an empty page.
24
+ - Background work the user doesn't wait on → use [Toast](./toast.md) with `toast.promise()`.
25
+
26
+ ## 3. Anatomy
27
+
28
+ 1. **Ring**: the `<div>`; a 2px circle in `currentColor` with a transparent top segment, rotating.
29
+ 2. **Hidden label**: visually hidden "Loading..." text inside the ring.
30
+
31
+ ## 4. Variants
32
+
33
+ Spinner has no variants. It draws in `currentColor`, so it takes the text colour of its parent. To change it, set `color` with a token on a wrapper you own.
34
+
35
+ ## 5. Sizes
36
+
37
+ | Size | Use in |
38
+ | --- | --- |
39
+ | `sm` | Inside buttons and inputs, next to small text (`--size-xxs`). |
40
+ | `default` | Inline with body text (`--size-xs`). |
41
+ | `lg` | A panel or card region (`--size-sm`). |
42
+ | `xl` | A large empty region (`--size-md`). |
43
+
44
+ ## 6. States
45
+
46
+ | State | Looks like | Notes |
47
+ | --- | --- | --- |
48
+ | Default | Ring rotating once a second | |
49
+ | Reduced motion | Static ring with a gap | Under `prefers-reduced-motion` the animation runs once, almost instantly, and stops. |
50
+
51
+ ## 7. Content guidelines
52
+
53
+ - Spinner has no visible text. When the wait is more than a moment, put a short label beside it that says what's loading: "Loading invoices…".
54
+ - In a Button, keep the label and switch it to the ongoing verb: "Save changes" becomes "Saving…".
55
+ - When the Spinner stands alone, give it a specific `aria-label`: "Loading invoices", not the default "Loading".
56
+
57
+ | Do | Don't |
58
+ | --- | --- |
59
+ | Loading invoices… | Please wait |
60
+ | Saving… (in the button) | A button with only a Spinner and no label |
61
+ | Refreshing results… | Loading... Loading... (two labels saying the same) |
62
+
63
+ ## 8. Rules
64
+
65
+ 1. In a Button, put the Spinner before the label, keep the label, and set `aria-busy` and `aria-disabled` on the Button, ignoring clicks while it's busy. Don't set `disabled`: it drops focus from the button the user just pressed.
66
+ 2. Mark a Spinner inside a labelled Button `aria-hidden="true"`, so the button's name stays "Saving…" instead of "Loading Saving…".
67
+ 3. Give a standalone Spinner a specific `aria-label` that says what's loading.
68
+ 4. Change its colour through the parent's `color`, using a token. Never pass `className` or `style`; they're dropped.
69
+ 5. Use [Progress](./progress.md) when you know the amount and [Skeleton](./skeleton.md) when you know the layout.
70
+ 6. Don't build your own spinner with CSS animations.
71
+
72
+ ## 9. Dos and don'ts
73
+
74
+ **Do:** keep the label in a busy button.
75
+
76
+ ```tsx
77
+ <Button type="submit" aria-busy={saving} aria-disabled={saving}>
78
+ {saving && <Spinner size="sm" aria-hidden="true" />}
79
+ {saving ? "Saving…" : "Save changes"}
80
+ </Button>
81
+ ```
82
+
83
+ **Don't:** replace the label with a Spinner.
84
+
85
+ ```tsx
86
+ <Button type="submit" aria-busy={saving} aria-disabled={saving}>
87
+ {saving ? <Spinner /> : "Save changes"}
88
+ </Button>
89
+ ```
90
+
91
+ **Do:** say what a region is loading.
92
+
93
+ ```tsx
94
+ <div style={{ display: "flex", alignItems: "center", gap: "var(--spacing-sm)", color: "var(--container-fg-alt)" }}>
95
+ <Spinner size="sm" aria-label="Refreshing results" />
96
+ <Typography variant="label" tone="muted" aria-hidden="true">Refreshing results…</Typography>
97
+ </div>
98
+ ```
99
+
100
+ **Don't:** recolour or resize it by hand.
101
+
102
+ ```tsx
103
+ <Spinner style={{ borderColor: "#3b82f6", width: 40, height: 40 }} />
104
+ ```
105
+
106
+ ## 10. Accessibility
107
+
108
+ - Role: `status`, a polite live region.
109
+ - Label: `aria-label="Loading"` by default, plus visually hidden "Loading..." text. Both `role` and `aria-label` can be overridden through props.
110
+ - Keyboard: not focusable; no keys.
111
+ - Focus: Spinner never takes or moves focus. When loading ends, leave focus where the user was.
112
+ - Motion: respects `prefers-reduced-motion` (see States).
113
+ - Contrast: the ring uses the surrounding text colour, so it's as legible as the text it sits in. Keep the parent on a token pair from the theme; don't override colours.
114
+
115
+ ## 11. Behaviour
116
+
117
+ - Responsive: fixed size from `--size-*`, which scales with density.
118
+ - Layout: Spinner is a `<div>`. Put it in a flex row with `gap` to line it up with text.
119
+ - Motion: one linear rotation per second, forever, until unmounted. Don't add your own.
120
+
121
+ ## 12. API
122
+
123
+ <!-- api:start -->
124
+ | Prop | Type | Default | Description |
125
+ | --- | --- | --- | --- |
126
+ | `size` | `"sm" \| "default" \| "lg" \| "xl"` | `"default"` | Diameter, from `--size-xxs` to `--size-md`. |
127
+ | `aria-label` | `string` | `"Loading"` | Accessible name. Make it specific when the Spinner stands alone. |
128
+ | `role` | `string` | `"status"` | Live-region role. Leave it unless you hide the Spinner with `aria-hidden`. |
129
+ | `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | `aria-hidden`, `id`. The ref goes to the `<div>`. |
130
+ <!-- api:end -->
131
+
132
+ ## 13. Examples
133
+
134
+ ```tsx
135
+ import { useState } from "react";
136
+ import { Button, Spinner, Typography } from "@eluan/core";
137
+
138
+ export function ExportReportButton({ exportReport }: { exportReport: () => Promise<void> }) {
139
+ const [exporting, setExporting] = useState(false);
140
+
141
+ async function handleClick() {
142
+ if (exporting) return;
143
+ setExporting(true);
144
+ try {
145
+ await exportReport();
146
+ } finally {
147
+ setExporting(false);
148
+ }
149
+ }
150
+
151
+ return (
152
+ <Button type="button" variant="outline" aria-busy={exporting} aria-disabled={exporting} onClick={handleClick}>
153
+ {exporting && <Spinner size="sm" aria-hidden="true" />}
154
+ {exporting ? "Exporting…" : "Export CSV"}
155
+ </Button>
156
+ );
157
+ }
158
+
159
+ export function ResultsRefreshing() {
160
+ return (
161
+ <div
162
+ style={{
163
+ display: "flex",
164
+ alignItems: "center",
165
+ justifyContent: "center",
166
+ gap: "var(--spacing-sm)",
167
+ padding: "var(--spacing-xl)",
168
+ color: "var(--container-fg-alt)",
169
+ }}
170
+ >
171
+ <Spinner aria-label="Refreshing results" />
172
+ <Typography variant="label" tone="muted" aria-hidden="true">Refreshing results…</Typography>
173
+ </div>
174
+ );
175
+ }
176
+ ```
177
+
178
+ ## 14. Related components
179
+
180
+ - [Button](./button.md): the most common place for a Spinner.
181
+ - [Progress](./progress.md): when you know how far along the work is.
182
+ - [Skeleton](./skeleton.md): placeholders in the shape of loading content.
183
+ - [Toast](./toast.md): `toast.promise()` for background work.
184
+
185
+ ## 15. Common agent mistakes
186
+
187
+ _Filled from evals._