@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,201 @@
1
+ ---
2
+ name: SegmentedControl
3
+ use_when: The user picks exactly one of two to five short options that set the mode or filter of the current view, such as Day, Week, Month or List, Board.
4
+ instead_of: Tabs when each option has its own content panel; ToggleGroup for toolbar tool options or several values; RadioGroup for a value submitted with a form; Select for longer lists.
5
+ source: packages/core/src/components/segmented-control.tsx
6
+ ---
7
+
8
+ # SegmentedControl
9
+
10
+ ## 1. Overview
11
+
12
+ SegmentedControl shows a few options as segments in a recessed track, with the selected segment raised. It is built on Radix Tabs, the list only: exactly one segment is selected once a value is set, and you render whatever the selection controls yourself.
13
+
14
+ ## 2. When to use
15
+
16
+ - The mode or range of the same view: Day, Week, Month; List, Board, Calendar.
17
+ - A filter over the same list: All, Active, Archived.
18
+ - A short exclusive choice that takes effect immediately, such as a delivery speed.
19
+
20
+ ### When not to use
21
+
22
+ - Each option shows its own content panel (Overview, Activity, Settings) → use [Tabs](./tabs.md). Tabs render the panels and link each tab to its panel.
23
+ - Tool options in a toolbar, icon-only options, or several options pressed at once → use [ToggleGroup](./toggle-group.md).
24
+ - A value submitted with a form, or options that need a description each → use [RadioGroup](./radio-group.md). SegmentedControl submits nothing.
25
+ - More than five options, or labels longer than a couple of words → use [Select](./select.md).
26
+ - An on/off setting → use [Switch](./switch.md).
27
+
28
+ ## 3. Anatomy
29
+
30
+ 1. **Root** (`SegmentedControl`): holds the value. Inline by default; stretches to its container with `fullWidth`.
31
+ 2. **Track**: the recessed background behind the segments, with `--spacing-xs` padding and gap and `--curves-md` corners.
32
+ 3. **Segment** (`SegmentedControlItem`): a button with a short label. Unselected segments show `--interactive-fg-alt` text on the track; the selected segment is raised on `--interactive-bg` with `--interactive-fg` text. Segment corners are inset to sit inside the track's.
33
+
34
+ ## 4. Variants
35
+
36
+ SegmentedControl has no variants. `size` and `fullWidth` control its look.
37
+
38
+ ## 5. Sizes
39
+
40
+ | Size | Use in |
41
+ | --- | --- |
42
+ | `default` | Page and panel headers, next to default controls (`--size-md` tall segments, `--font-size-sm`). |
43
+ | `sm` | Dense headers, cards and toolbars (`--size-sm` tall, `--font-size-xs`). |
44
+
45
+ `fullWidth` stretches the control to its container and splits the width equally between segments. Use it in narrow panels and on mobile.
46
+
47
+ ## 6. States
48
+
49
+ | State | Looks like | Notes |
50
+ | --- | --- | --- |
51
+ | Default | Muted labels on the recessed track | |
52
+ | Hover | An unselected segment's text darkens to `--interactive-fg` | No fill change. |
53
+ | Focus | 1px outline in `--focus-ring`, 1px offset, on the segment | Never remove or restyle the focus ring. |
54
+ | Selected | Raised segment on `--interactive-bg`, `--interactive-fg` text | `data-state="active"`. |
55
+ | Disabled | `--interactive-fg-disabled` text, no pointer events | `disabled` on the root disables every segment; `disabled` on an item disables one. |
56
+
57
+ ## 7. Content guidelines
58
+
59
+ - Use one or two words per segment, in sentence case, in the same grammatical form: "Day, Week, Month", not "Daily, This week, Month view".
60
+ - Order segments the way the values run: smallest to largest, shortest to longest time.
61
+ - Keep segment labels similar in length; with `fullWidth` every segment gets the same width.
62
+
63
+ | Do | Don't |
64
+ | --- | --- |
65
+ | Day · Week · Month | Today's view · 7 days · Monthly calendar |
66
+ | All · Active · Archived | Show all items · Active only · Archive |
67
+
68
+ ## 8. Rules
69
+
70
+ 1. Always set `defaultValue` or `value`. With neither, no segment is selected until the user clicks one.
71
+ 2. Give every segment a unique `value`, and read the selection from `onValueChange` to render your content.
72
+ 3. Don't add Tabs panels (`TabsContent`) or mix SegmentedControl parts with Tabs parts. If options have panels, use [Tabs](./tabs.md).
73
+ 4. Put a visible label or heading next to the control; it can't name its own tab list (see Accessibility).
74
+ 5. Use two to five segments with text labels. For icon-only options use [ToggleGroup](./toggle-group.md).
75
+ 6. Use `fullWidth` to stretch it. Never pass `className` or `style`; they're dropped.
76
+ 7. Keep the value in your own state if a form needs it; SegmentedControl submits nothing.
77
+
78
+ ## 9. Dos and don'ts
79
+
80
+ **Do:** switch the mode of one view and render it from the value.
81
+
82
+ ```tsx
83
+ <SegmentedControl value={view} onValueChange={setView}>
84
+ <SegmentedControlItem value="list">List</SegmentedControlItem>
85
+ <SegmentedControlItem value="board">Board</SegmentedControlItem>
86
+ </SegmentedControl>
87
+ {view === "list" ? <TaskList tasks={tasks} /> : <TaskBoard tasks={tasks} />}
88
+ ```
89
+
90
+ **Don't:** leave it without a value, or use it for pages with their own content.
91
+
92
+ ```tsx
93
+ <SegmentedControl>
94
+ <SegmentedControlItem value="overview">Overview</SegmentedControlItem>
95
+ <SegmentedControlItem value="activity">Activity</SegmentedControlItem>
96
+ <SegmentedControlItem value="settings">Settings and permissions</SegmentedControlItem>
97
+ </SegmentedControl>
98
+ ```
99
+
100
+ **Do:** use Tabs when each option has a panel.
101
+
102
+ ```tsx
103
+ <Tabs defaultValue="overview">
104
+ <TabsList>
105
+ <TabsTrigger value="overview">Overview</TabsTrigger>
106
+ <TabsTrigger value="activity">Activity</TabsTrigger>
107
+ </TabsList>
108
+ <TabsContent value="overview">{overview}</TabsContent>
109
+ <TabsContent value="activity">{activity}</TabsContent>
110
+ </Tabs>
111
+ ```
112
+
113
+ ## 10. Accessibility
114
+
115
+ - Role: the track is a `tablist` and each segment a `tab` with `aria-selected`, because SegmentedControl is built on Radix Tabs. Each tab also points `aria-controls` at a panel that doesn't exist, since SegmentedControl renders none. Screen readers announce segments as tabs ("Week, tab, 2 of 3").
116
+ - Label: each segment is named by its text. `aria-label` on SegmentedControl lands on the root wrapper, not the tab list, so the list itself can't be named. Place a visible heading or label next to it.
117
+ - Keyboard: Tab moves to the selected segment. Left and Right arrows move between segments and select as they go; Home and End jump to the first and last. Tab again leaves the control. With `activationMode="manual"`, arrows only move focus and Enter or Space selects.
118
+ - Focus: visible outline on the focused segment. Disabled segments use the native `disabled` attribute and are skipped.
119
+ - Contrast: handled by the theme. Don't override colours.
120
+
121
+ ## 11. Behaviour
122
+
123
+ - Responsive: inline and as wide as its segments by default, so it sits in a row with a heading. `fullWidth` fills the container with equal segments.
124
+ - Overflow and truncation: labels never wrap. Too many or too-long segments overflow the container; keep labels short.
125
+ - Motion: text and background colours transition over 150ms. The raised segment doesn't slide between positions. Don't add motion.
126
+
127
+ ## 12. API
128
+
129
+ <!-- api:start -->
130
+ ### SegmentedControl
131
+
132
+ | Prop | Type | Default | Description |
133
+ | --- | --- | --- | --- |
134
+ | `value` | `string` | | Controlled selected value. |
135
+ | `defaultValue` | `string` | | Initial value when uncontrolled. |
136
+ | `onValueChange` | `(value: string) => void` | | Called when the selection changes. |
137
+ | `size` | `"default" \| "sm"` | `"default"` | Height and type size of every segment. |
138
+ | `fullWidth` | `boolean` | `false` | Fills the container with equal-width segments. |
139
+ | `disabled` | `boolean` | `false` | Disables every segment. |
140
+ | `activationMode` | `"automatic" \| "manual"` | `"automatic"` | Whether arrow keys select as they move focus. |
141
+ | `...props` | Radix `Tabs.Root` props without `className`, `style`, `orientation`, `asChild` | | `dir`, `id`. Land on the root wrapper, not the tab list. |
142
+
143
+ ### SegmentedControlItem
144
+
145
+ | Prop | Type | Default | Description |
146
+ | --- | --- | --- | --- |
147
+ | `value` | `string` | | Required. The value this segment selects. |
148
+ | `disabled` | `boolean` | `false` | Disables this segment. |
149
+ | `...props` | Radix `Tabs.Trigger` props without `className`, `style`, `asChild` | | `id`, `onFocus`. |
150
+ <!-- api:end -->
151
+
152
+ `className` and `style` are omitted from both parts; Eluan components are styling-closed.
153
+
154
+ ## 13. Examples
155
+
156
+ ```tsx
157
+ import { useState } from "react";
158
+ import { SegmentedControl, SegmentedControlItem, Typography } from "@eluan/core";
159
+
160
+ type View = "list" | "board" | "calendar";
161
+
162
+ const descriptions: Record<View, string> = {
163
+ list: "A flat, sortable list of every task.",
164
+ board: "Tasks grouped into columns by status.",
165
+ calendar: "Tasks placed on their due dates.",
166
+ };
167
+
168
+ export function TasksHeader() {
169
+ const [view, setView] = useState<View>("list");
170
+
171
+ return (
172
+ <section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
173
+ <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: "var(--spacing-md)" }}>
174
+ <Typography variant="heading" as="h2">
175
+ Tasks
176
+ </Typography>
177
+ <SegmentedControl size="sm" value={view} onValueChange={(next) => setView(next as View)}>
178
+ <SegmentedControlItem value="list">List</SegmentedControlItem>
179
+ <SegmentedControlItem value="board">Board</SegmentedControlItem>
180
+ <SegmentedControlItem value="calendar">Calendar</SegmentedControlItem>
181
+ </SegmentedControl>
182
+ </div>
183
+ <Typography variant="body" tone="muted">
184
+ {descriptions[view]}
185
+ </Typography>
186
+ </section>
187
+ );
188
+ }
189
+ ```
190
+
191
+ ## 14. Related components
192
+
193
+ - [Tabs](./tabs.md): switches between content panels.
194
+ - [ToggleGroup](./toggle-group.md): pressable tool options, single or multiple, often icon-only.
195
+ - [RadioGroup](./radio-group.md): one value in a form, with room for descriptions.
196
+ - [Select](./select.md): one value from a longer list.
197
+ - See [navigation](../patterns/navigation.md) for Tabs vs SegmentedControl.
198
+
199
+ ## 15. Common agent mistakes
200
+
201
+ _Filled from evals._
@@ -0,0 +1,296 @@
1
+ ---
2
+ name: Select
3
+ use_when: The user picks one value from a list too long to show as radio buttons, such as country, time zone or role.
4
+ instead_of: RadioGroup for a few options that fit on screen; SegmentedControl for a mode of the same view; MultiSelect for several values; DropdownMenu for actions.
5
+ source: packages/core/src/components/select.tsx
6
+ ---
7
+
8
+ # Select
9
+
10
+ ## 1. Overview
11
+
12
+ Select lets the user pick one value from a list that opens in a floating panel. It wraps Radix Select: the trigger is a `<button role="combobox">` that shows the chosen value, and the list renders in a portal. You compose it from `Select`, `SelectTrigger`, `SelectValue`, `SelectContent` and `SelectItem`, with optional groups, labels and separators.
13
+
14
+ ## 2. When to use
15
+
16
+ - One choice from a list of about six or more options, or a shorter list where vertical space is tight.
17
+ - Form fields with a known set of values: country, time zone, role, currency.
18
+ - A sort order or page-size picker in a toolbar.
19
+
20
+ ### When not to use
21
+
22
+ - Two to five options the user should compare at a glance → use [RadioGroup](./radio-group.md). It shows every option without a click.
23
+ - A mode or filter of the same view (Day, Week, Month) → use [SegmentedControl](./segmented-control.md).
24
+ - Tool states in a toolbar (alignment, bold, italic) → use [ToggleGroup](./toggle-group.md).
25
+ - Switching between content panels on the page → use [Tabs](./tabs.md).
26
+ - Several values at once → use [MultiSelect](./multi-select.md) for long lists or [CheckboxGroup](./checkbox-group.md) for short ones.
27
+ - A list of actions (Export, Duplicate, Delete) → use [DropdownMenu](./dropdown-menu.md). Select stores a value; it doesn't run commands.
28
+ - One value from a list so long the user needs to search it → compose [Command](./command.md) inside a [Popover](./popover.md). Select only has typeahead.
29
+ - A phone country code → use [PhoneInput](./phone-input.md), which already contains its own Select.
30
+ - A date → use [DatePicker](./date-picker.md).
31
+
32
+ ## 3. Anatomy
33
+
34
+ 1. **Select** (root): holds the value and open state. Renders no element of its own.
35
+ 2. **SelectTrigger**: the `<button role="combobox">`. Fills its container's width, `--size-lg` tall, with a chevron at the end that Eluan renders for you.
36
+ 3. **SelectValue**: goes inside the trigger. Shows the selected item's text, or its `placeholder` when nothing is selected.
37
+ 4. **SelectContent**: the floating panel, portalled out of the page flow. `--container-bg` surface, `--container-border` border, at least as wide as the trigger and at most 24rem tall. It renders the scroll buttons and the scrolling viewport for you.
38
+ 5. **SelectItem**: one option. A check mark appears on the trailing edge of the selected item.
39
+ 6. **SelectGroup** and **SelectLabel** (optional): a labelled group of items. SelectLabel renders small, uppercase, muted text (`--font-size-xs`, `--container-fg-alt`).
40
+ 7. **SelectSeparator** (optional): a 1px line between groups.
41
+ 8. **SelectScrollUpButton** and **SelectScrollDownButton**: chevrons that appear when the list overflows. SelectContent already renders them; you never place them yourself.
42
+
43
+ ## 4. Variants
44
+
45
+ SelectTrigger has a `variant` prop and SelectContent has a `layout` prop. Use the defaults; the other values exist for Calendar and PhoneInput.
46
+
47
+ | Variant | Use for |
48
+ | --- | --- |
49
+ | SelectTrigger `default` | Every Select you build. |
50
+ | SelectTrigger `calendarCaption` | Calendar's month and year pickers only. It removes the border and the focus outline. |
51
+ | SelectTrigger `countryCode` | PhoneInput's dial-code picker only. It squares the end edge to sit against the number field. |
52
+ | SelectContent `layout="default"` | Every Select you build: the panel is at least as wide as the trigger (min 8rem). |
53
+ | SelectContent `layout="auto"` | A panel that shrinks to its items, as Calendar uses. |
54
+ | SelectContent `layout="country"` | PhoneInput's country list (min 17.5rem). |
55
+
56
+ ## 5. Sizes
57
+
58
+ SelectTrigger has no size prop. It is `--size-lg` tall with `--font-size-sm` text and stretches to its container; set width on a wrapper. SelectItem has a `size` prop:
59
+
60
+ | Size | Use in |
61
+ | --- | --- |
62
+ | SelectItem `default` | Every list (`--font-size-sm`). |
63
+ | SelectItem `sm` | Dense lists inside a small picker (`--font-size-xs`), as Calendar's month and year lists use. |
64
+
65
+ ## 6. States
66
+
67
+ | State | Looks like | Notes |
68
+ | --- | --- | --- |
69
+ | Default | `--interactive-bg` fill, 1px `--interactive-border-alt` border, chevron at 50% opacity | |
70
+ | Placeholder | SelectValue's `placeholder` text | Renders in the same colour as a chosen value. |
71
+ | Focus | 1px outline in `--focus-ring`, 1px offset; the border also switches to `--focus-ring` | Never remove or restyle the focus ring. |
72
+ | Open | Panel below the trigger; the item under the pointer or keyboard fills with `--interactive-bg-hover` | Page scroll is locked while open. |
73
+ | Selected | Check mark on the trailing edge of the selected item; the trigger shows its text | |
74
+ | Grouped | SelectSeparator draws a 1px line in `--container-bg-alt` | Close to invisible on `--container-bg` in the default theme. Separate groups with SelectGroup and SelectLabel, not the separator alone. |
75
+ | Disabled | Trigger fills with `--interactive-bg-disabled`, text `--interactive-fg-disabled`, not-allowed cursor | Set `disabled` on `Select`. A disabled SelectItem gets the same fill and is skipped by the keyboard. |
76
+ | Error | No built-in error style | Put a [FormMessage](./form-label.md) under the field and set `aria-invalid` and `aria-describedby` on SelectTrigger. |
77
+
78
+ ## 7. Content guidelines
79
+
80
+ - Label the field with a noun ("Time zone"). Use the placeholder as a prompt: "Select a time zone".
81
+ - Keep option text short, in sentence case, with no end punctuation. Put the distinguishing word first.
82
+ - Order options the way users expect to scan them: alphabetical for names, numeric or chronological for sizes and dates.
83
+ - Name groups with short nouns ("North America", "Europe").
84
+
85
+ | Do | Don't |
86
+ | --- | --- |
87
+ | Select a time zone | Choose one... |
88
+ | Central European Time (CET) | CET - central europe time. |
89
+ | Admin, Editor, Viewer | Option 1, Option 2, Option 3 |
90
+
91
+ ## 8. Rules
92
+
93
+ 1. Give every Select a label: a [Label](./form-label.md) whose `htmlFor` matches SelectTrigger's `id`, or `aria-label` on SelectTrigger when no visible label fits.
94
+ 2. Put `placeholder` on `SelectValue`, not on `Select`.
95
+ 3. Give every SelectItem a unique, non-empty `value`. Radix throws on `value=""`. To clear a controlled Select, set its `value` to `""`.
96
+ 4. Use `name` (and `required`) on `Select` when the value must submit with a native form; Radix renders a hidden `<select>` for it.
97
+ 5. Never place SelectScrollUpButton or SelectScrollDownButton yourself; SelectContent already renders both.
98
+ 6. Use only the `default` trigger variant and content layout in app code. `calendarCaption` removes the focus outline.
99
+ 7. Never pass `className` or `style`; they're dropped. The trigger fills its container, so set width on a wrapper.
100
+ 8. Inside a scoped theme, give overlays a portal target: `container` on SelectContent, or `PortalContainerProvider` around the region. Otherwise the panel mounts in `document.body` with the page theme.
101
+
102
+ ## 9. Dos and don'ts
103
+
104
+ **Do:** tie a visible label to the trigger and prompt with the placeholder.
105
+
106
+ ```tsx
107
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
108
+ <Label htmlFor="timezone">Time zone</Label>
109
+ <Select name="timezone">
110
+ <SelectTrigger id="timezone">
111
+ <SelectValue placeholder="Select a time zone" />
112
+ </SelectTrigger>
113
+ <SelectContent>
114
+ <SelectItem value="cet">Central European Time (CET)</SelectItem>
115
+ <SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
116
+ </SelectContent>
117
+ </Select>
118
+ </div>
119
+ ```
120
+
121
+ **Don't:** use the placeholder as the only label, put it on the root, or use an empty value.
122
+
123
+ ```tsx
124
+ <Select placeholder="Time zone">
125
+ <SelectTrigger>
126
+ <SelectValue />
127
+ </SelectTrigger>
128
+ <SelectContent>
129
+ <SelectItem value="">None</SelectItem>
130
+ <SelectItem value="cet">CET</SelectItem>
131
+ </SelectContent>
132
+ </Select>
133
+ ```
134
+
135
+ **Do:** structure long lists with groups and labels.
136
+
137
+ ```tsx
138
+ <SelectContent>
139
+ <SelectGroup>
140
+ <SelectLabel>North America</SelectLabel>
141
+ <SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
142
+ <SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
143
+ </SelectGroup>
144
+ <SelectGroup>
145
+ <SelectLabel>Europe</SelectLabel>
146
+ <SelectItem value="cet">Central European Time (CET)</SelectItem>
147
+ </SelectGroup>
148
+ </SelectContent>
149
+ ```
150
+
151
+ **Don't:** fake headings with disabled items or rely on the separator alone.
152
+
153
+ ```tsx
154
+ <SelectContent>
155
+ <SelectItem value="na" disabled>— North America —</SelectItem>
156
+ <SelectItem value="est">EST</SelectItem>
157
+ <SelectSeparator />
158
+ <SelectItem value="cet">CET</SelectItem>
159
+ </SelectContent>
160
+ ```
161
+
162
+ ## 10. Accessibility
163
+
164
+ - Role: the trigger is a `combobox` button with `aria-expanded`; the panel is a `listbox`; items are `option`s; each SelectGroup is a `group` named by its SelectLabel.
165
+ - Label: Label via `htmlFor`/`id` on SelectTrigger, or `aria-label` on SelectTrigger.
166
+ - Keyboard: on the trigger, Space, Enter, ArrowDown and ArrowUp open the list, and typing jumps to a matching item. In the list, arrows move, Home and End jump to the ends, Enter or Space selects and closes, Escape closes, and typing jumps to a match.
167
+ - Focus: focus moves into the list on open and is trapped there; the rest of the page is hidden from assistive tech and scroll is locked. Focus returns to the trigger on close. A disabled Select uses the native `disabled` attribute, so Tab skips it.
168
+ - Contrast: handled by the theme. Don't override colours.
169
+
170
+ ## 11. Behaviour
171
+
172
+ - Responsive: the trigger fills its container. The panel is at least the trigger's width, at most 24rem tall, and scrolls with chevron buttons when it overflows.
173
+ - Position: Eluan defaults SelectContent to `position="popper"`, so the panel opens below the trigger with a small offset and flips when there's no room. Eluan's offset and sizing styles only apply in popper mode; keep the default.
174
+ - Overflow and truncation: the trigger doesn't truncate long values. Keep option text short.
175
+ - Motion: none. The panel opens and closes without a transition. Don't add one.
176
+ - Portal: the panel mounts into the nearest `PortalContainerProvider` container, else `document.body`. `container` on SelectContent overrides both.
177
+
178
+ ## 12. API
179
+
180
+ <!-- api:start -->
181
+ ### Select
182
+
183
+ | Prop | Type | Default | Description |
184
+ | --- | --- | --- | --- |
185
+ | `value` | `string` | | Controlled value. `""` clears the selection and shows the placeholder. |
186
+ | `defaultValue` | `string` | | Initial value when uncontrolled. |
187
+ | `onValueChange` | `(value: string) => void` | | Called when the user picks an item. |
188
+ | `open` / `defaultOpen` / `onOpenChange` | `boolean` / `boolean` / `(open: boolean) => void` | | Control the open state. |
189
+ | `name` | `string` | | Submits the value with a native form through a hidden `<select>`. |
190
+ | `required` | `boolean` | | Native required validation on the hidden `<select>`. |
191
+ | `disabled` | `boolean` | | Disables the trigger. |
192
+ | `...props` | Radix `Select.Root` props | | `dir`, `autoComplete`, `form`. Root renders no element. |
193
+
194
+ ### SelectTrigger
195
+
196
+ | Prop | Type | Default | Description |
197
+ | --- | --- | --- | --- |
198
+ | `variant` | `"default" \| "calendarCaption" \| "countryCode"` | `"default"` | Trigger style. Use `"default"`; the others serve Calendar and PhoneInput. |
199
+ | `...props` | Radix `Select.Trigger` props without `className`, `style` | | `id`, `aria-label`, `aria-invalid`, `aria-describedby`. Children: a `SelectValue`. |
200
+
201
+ ### SelectValue
202
+
203
+ | Prop | Type | Default | Description |
204
+ | --- | --- | --- | --- |
205
+ | `placeholder` | `ReactNode` | | Shown when no value is selected. |
206
+ | `...props` | Radix `Select.Value` props | | |
207
+
208
+ ### SelectContent
209
+
210
+ | Prop | Type | Default | Description |
211
+ | --- | --- | --- | --- |
212
+ | `layout` | `"default" \| "auto" \| "country"` | `"default"` | Panel width rule. |
213
+ | `position` | `"popper" \| "item-aligned"` | `"popper"` | Placement. Eluan's styles assume `"popper"`. |
214
+ | `container` | `HTMLElement \| null` | nearest `PortalContainerProvider`, then `document.body` | Element to portal into. |
215
+ | `side` / `sideOffset` / `align` | Radix popper props | | Placement in popper mode. |
216
+ | `...props` | Radix `Select.Content` props without `className`, `style` | | `onCloseAutoFocus`, `onEscapeKeyDown`. |
217
+
218
+ ### SelectItem
219
+
220
+ | Prop | Type | Default | Description |
221
+ | --- | --- | --- | --- |
222
+ | `value` | `string` | | Required. Unique and non-empty. |
223
+ | `size` | `"default" \| "sm"` | `"default"` | Item text size. |
224
+ | `disabled` | `boolean` | | Skipped by the keyboard and not selectable. |
225
+ | `textValue` | `string` | | Text used for typeahead when the children aren't plain text. |
226
+ | `...props` | Radix `Select.Item` props without `className`, `style` | | |
227
+
228
+ ### SelectGroup, SelectLabel, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton
229
+
230
+ | Prop | Type | Default | Description |
231
+ | --- | --- | --- | --- |
232
+ | `...props` | The matching Radix `Select` part's props without `className`, `style` | | No Eluan props. SelectGroup is Radix `Select.Group` re-exported as is. |
233
+ <!-- api:end -->
234
+
235
+ `className` and `style` are omitted from every part; Eluan components are styling-closed.
236
+
237
+ ## 13. Examples
238
+
239
+ ```tsx
240
+ import { useState } from "react";
241
+ import {
242
+ Label,
243
+ Select,
244
+ SelectContent,
245
+ SelectGroup,
246
+ SelectItem,
247
+ SelectLabel,
248
+ SelectTrigger,
249
+ SelectValue,
250
+ } from "@eluan/core";
251
+
252
+ export function TimezoneField() {
253
+ const [timezone, setTimezone] = useState("");
254
+
255
+ return (
256
+ <div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
257
+ <Label htmlFor="workspace-timezone" required>
258
+ Time zone
259
+ </Label>
260
+ <Select name="timezone" required value={timezone} onValueChange={setTimezone}>
261
+ <SelectTrigger id="workspace-timezone">
262
+ <SelectValue placeholder="Select a time zone" />
263
+ </SelectTrigger>
264
+ <SelectContent>
265
+ <SelectGroup>
266
+ <SelectLabel>North America</SelectLabel>
267
+ <SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
268
+ <SelectItem value="cst">Central Standard Time (CST)</SelectItem>
269
+ <SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
270
+ </SelectGroup>
271
+ <SelectGroup>
272
+ <SelectLabel>Europe</SelectLabel>
273
+ <SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
274
+ <SelectItem value="cet">Central European Time (CET)</SelectItem>
275
+ </SelectGroup>
276
+ </SelectContent>
277
+ </Select>
278
+ </div>
279
+ );
280
+ }
281
+ ```
282
+
283
+ ## 14. Related components
284
+
285
+ - [RadioGroup](./radio-group.md): one choice with every option visible; better for a few options.
286
+ - [SegmentedControl](./segmented-control.md): one mode or filter from two to five short options, always visible.
287
+ - [ToggleGroup](./toggle-group.md): pressable tool options, single or multiple.
288
+ - [Tabs](./tabs.md): switches content panels, not a stored value.
289
+ - [MultiSelect](./multi-select.md): several values from a searchable list.
290
+ - [DropdownMenu](./dropdown-menu.md): a list of actions behind a trigger.
291
+ - [Label](./form-label.md): `Label`, `FormDescription` and `FormMessage` for the field around a Select.
292
+ - See [forms](../patterns/forms.md) for choosing between selection controls.
293
+
294
+ ## 15. Common agent mistakes
295
+
296
+ _Filled from evals._