@funstack/ui 0.1.0-alpha.15 → 0.1.0-alpha.16

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 (558) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-item.d.mts +19 -0
  3. package/dist/accordion/accordion-item.d.mts.map +1 -1
  4. package/dist/accordion/accordion-item.mjs +2 -0
  5. package/dist/accordion/accordion-item.mjs.map +1 -1
  6. package/dist/accordion/accordion-panel.d.mts +16 -0
  7. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  8. package/dist/accordion/accordion-panel.mjs +2 -0
  9. package/dist/accordion/accordion-panel.mjs.map +1 -1
  10. package/dist/accordion/accordion-root.d.mts +36 -2
  11. package/dist/accordion/accordion-root.d.mts.map +1 -1
  12. package/dist/accordion/accordion-root.mjs +2 -0
  13. package/dist/accordion/accordion-root.mjs.map +1 -1
  14. package/dist/accordion/accordion-trigger.d.mts +9 -0
  15. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  16. package/dist/accordion/accordion-trigger.mjs +2 -0
  17. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  18. package/dist/accordion/index.d.mts +2 -0
  19. package/dist/accordion/index.d.mts.map +1 -1
  20. package/dist/accordion/index.mjs +2 -0
  21. package/dist/accordion/index.mjs.map +1 -1
  22. package/dist/bin/skill-installer.d.mts +1 -0
  23. package/dist/bin/skill-installer.mjs +12 -0
  24. package/dist/bin/skill-installer.mjs.map +1 -0
  25. package/dist/button/button.d.mts +25 -7
  26. package/dist/button/button.d.mts.map +1 -1
  27. package/dist/button/button.mjs +2 -0
  28. package/dist/button/button.mjs.map +1 -1
  29. package/dist/checkbox/checkbox.d.mts +25 -3
  30. package/dist/checkbox/checkbox.d.mts.map +1 -1
  31. package/dist/checkbox/checkbox.mjs +2 -0
  32. package/dist/checkbox/checkbox.mjs.map +1 -1
  33. package/dist/checkbox-group/checkbox-group-item.d.mts +15 -0
  34. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  35. package/dist/checkbox-group/checkbox-group-item.mjs +2 -0
  36. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  37. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  38. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  39. package/dist/checkbox-group/checkbox-group-label.mjs +2 -0
  40. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  41. package/dist/checkbox-group/checkbox-group-parent.d.mts +19 -1
  42. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  43. package/dist/checkbox-group/checkbox-group-parent.mjs +2 -0
  44. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  45. package/dist/checkbox-group/checkbox-group-root.d.mts +31 -4
  46. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  47. package/dist/checkbox-group/checkbox-group-root.mjs +2 -0
  48. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  49. package/dist/checkbox-group/index.d.mts +2 -0
  50. package/dist/checkbox-group/index.d.mts.map +1 -1
  51. package/dist/checkbox-group/index.mjs +2 -0
  52. package/dist/checkbox-group/index.mjs.map +1 -1
  53. package/dist/combobox/combobox-clear.d.mts +18 -0
  54. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  55. package/dist/combobox/combobox-clear.mjs +2 -0
  56. package/dist/combobox/combobox-clear.mjs.map +1 -1
  57. package/dist/combobox/combobox-group.d.mts +49 -1
  58. package/dist/combobox/combobox-group.d.mts.map +1 -1
  59. package/dist/combobox/combobox-group.mjs +11 -1
  60. package/dist/combobox/combobox-group.mjs.map +1 -1
  61. package/dist/combobox/combobox-input.d.mts +11 -0
  62. package/dist/combobox/combobox-input.d.mts.map +1 -1
  63. package/dist/combobox/combobox-input.mjs +2 -0
  64. package/dist/combobox/combobox-input.mjs.map +1 -1
  65. package/dist/combobox/combobox-label.d.mts +16 -0
  66. package/dist/combobox/combobox-label.d.mts.map +1 -1
  67. package/dist/combobox/combobox-label.mjs +2 -0
  68. package/dist/combobox/combobox-label.mjs.map +1 -1
  69. package/dist/combobox/combobox-list.d.mts +14 -0
  70. package/dist/combobox/combobox-list.d.mts.map +1 -1
  71. package/dist/combobox/combobox-list.mjs +2 -0
  72. package/dist/combobox/combobox-list.mjs.map +1 -1
  73. package/dist/combobox/combobox-option.d.mts +25 -3
  74. package/dist/combobox/combobox-option.d.mts.map +1 -1
  75. package/dist/combobox/combobox-option.mjs +2 -0
  76. package/dist/combobox/combobox-option.mjs.map +1 -1
  77. package/dist/combobox/combobox-popup.d.mts +16 -0
  78. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  79. package/dist/combobox/combobox-popup.mjs +2 -0
  80. package/dist/combobox/combobox-popup.mjs.map +1 -1
  81. package/dist/combobox/combobox-root.d.mts +49 -12
  82. package/dist/combobox/combobox-root.d.mts.map +1 -1
  83. package/dist/combobox/combobox-root.mjs +2 -0
  84. package/dist/combobox/combobox-root.mjs.map +1 -1
  85. package/dist/combobox/combobox-trigger.d.mts +16 -0
  86. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  87. package/dist/combobox/combobox-trigger.mjs +2 -0
  88. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  89. package/dist/combobox/index.d.mts +2 -0
  90. package/dist/combobox/index.d.mts.map +1 -1
  91. package/dist/combobox/index.mjs +2 -0
  92. package/dist/combobox/index.mjs.map +1 -1
  93. package/dist/csp/csp-provider.d.mts +8 -0
  94. package/dist/csp/csp-provider.d.mts.map +1 -1
  95. package/dist/csp/csp-provider.mjs +2 -0
  96. package/dist/csp/csp-provider.mjs.map +1 -1
  97. package/dist/csp/style-hashes.d.mts +2 -0
  98. package/dist/csp/style-hashes.d.mts.map +1 -1
  99. package/dist/csp/style-hashes.mjs +2 -0
  100. package/dist/csp/style-hashes.mjs.map +1 -1
  101. package/dist/dialog/dialog-close.d.mts +18 -0
  102. package/dist/dialog/dialog-close.d.mts.map +1 -1
  103. package/dist/dialog/dialog-close.mjs +2 -0
  104. package/dist/dialog/dialog-close.mjs.map +1 -1
  105. package/dist/dialog/dialog-description.d.mts +12 -0
  106. package/dist/dialog/dialog-description.d.mts.map +1 -1
  107. package/dist/dialog/dialog-description.mjs +2 -0
  108. package/dist/dialog/dialog-description.mjs.map +1 -1
  109. package/dist/dialog/dialog-form.d.mts +18 -1
  110. package/dist/dialog/dialog-form.d.mts.map +1 -1
  111. package/dist/dialog/dialog-form.mjs +2 -0
  112. package/dist/dialog/dialog-form.mjs.map +1 -1
  113. package/dist/dialog/dialog-popup.d.mts +25 -4
  114. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  115. package/dist/dialog/dialog-popup.mjs +2 -0
  116. package/dist/dialog/dialog-popup.mjs.map +1 -1
  117. package/dist/dialog/dialog-root.d.mts +15 -1
  118. package/dist/dialog/dialog-root.d.mts.map +1 -1
  119. package/dist/dialog/dialog-root.mjs +2 -0
  120. package/dist/dialog/dialog-root.mjs.map +1 -1
  121. package/dist/dialog/dialog-title.d.mts +11 -0
  122. package/dist/dialog/dialog-title.d.mts.map +1 -1
  123. package/dist/dialog/dialog-title.mjs +2 -0
  124. package/dist/dialog/dialog-title.mjs.map +1 -1
  125. package/dist/dialog/dialog-trigger.d.mts +16 -0
  126. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  127. package/dist/dialog/dialog-trigger.mjs +2 -0
  128. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  129. package/dist/dialog/index.d.mts +2 -0
  130. package/dist/dialog/index.d.mts.map +1 -1
  131. package/dist/dialog/index.mjs +2 -0
  132. package/dist/dialog/index.mjs.map +1 -1
  133. package/dist/docs/components/accordion.md +426 -0
  134. package/dist/docs/components/button.md +464 -0
  135. package/dist/docs/components/checkbox-group.md +474 -0
  136. package/dist/docs/components/checkbox.md +373 -0
  137. package/dist/docs/components/combobox.md +635 -0
  138. package/dist/docs/components/context-menu.md +524 -0
  139. package/dist/docs/components/dialog.md +686 -0
  140. package/dist/docs/components/field.md +587 -0
  141. package/dist/docs/components/menu.md +589 -0
  142. package/dist/docs/components/meter.md +313 -0
  143. package/dist/docs/components/number-field.md +528 -0
  144. package/dist/docs/components/popover.md +591 -0
  145. package/dist/docs/components/progress.md +450 -0
  146. package/dist/docs/components/radio-group.md +457 -0
  147. package/dist/docs/components/select.md +662 -0
  148. package/dist/docs/components/slider.md +558 -0
  149. package/dist/docs/components/switch.md +311 -0
  150. package/dist/docs/components/tabs.md +473 -0
  151. package/dist/docs/components/toast.md +576 -0
  152. package/dist/docs/components/toggle-group.md +341 -0
  153. package/dist/docs/components/toggle.md +245 -0
  154. package/dist/docs/components/toolbar.md +389 -0
  155. package/dist/docs/components/tooltip.md +494 -0
  156. package/dist/docs/concepts/action-props.md +251 -0
  157. package/dist/docs/concepts/ai-agents.md +56 -0
  158. package/dist/docs/concepts/browser-owned-state.md +118 -0
  159. package/dist/docs/concepts/content-security-policy.md +69 -0
  160. package/dist/docs/concepts/experimental.md +36 -0
  161. package/dist/docs/concepts/pending-and-optimistic.md +250 -0
  162. package/dist/docs/concepts/server-components.md +118 -0
  163. package/dist/docs/concepts/suspense.md +124 -0
  164. package/dist/docs/concepts/transitions.md +118 -0
  165. package/dist/docs/getting-started.md +115 -0
  166. package/dist/docs/index.md +181 -0
  167. package/dist/docs/roadmap.md +74 -0
  168. package/dist/docs/why.md +100 -0
  169. package/dist/field/field-control.d.mts +26 -3
  170. package/dist/field/field-control.d.mts.map +1 -1
  171. package/dist/field/field-control.mjs +2 -0
  172. package/dist/field/field-control.mjs.map +1 -1
  173. package/dist/field/field-description.d.mts +11 -0
  174. package/dist/field/field-description.d.mts.map +1 -1
  175. package/dist/field/field-description.mjs +2 -0
  176. package/dist/field/field-description.mjs.map +1 -1
  177. package/dist/field/field-error.d.mts +14 -2
  178. package/dist/field/field-error.d.mts.map +1 -1
  179. package/dist/field/field-error.mjs +2 -0
  180. package/dist/field/field-error.mjs.map +1 -1
  181. package/dist/field/field-label.d.mts +10 -0
  182. package/dist/field/field-label.d.mts.map +1 -1
  183. package/dist/field/field-label.mjs +2 -0
  184. package/dist/field/field-label.mjs.map +1 -1
  185. package/dist/field/field-root.d.mts +21 -2
  186. package/dist/field/field-root.d.mts.map +1 -1
  187. package/dist/field/field-root.mjs +2 -0
  188. package/dist/field/field-root.mjs.map +1 -1
  189. package/dist/field/index.d.mts +9 -0
  190. package/dist/field/index.d.mts.map +1 -1
  191. package/dist/field/index.mjs +9 -0
  192. package/dist/field/index.mjs.map +1 -1
  193. package/dist/form/form-root.d.mts +17 -1
  194. package/dist/form/form-root.d.mts.map +1 -1
  195. package/dist/form/form-root.mjs +2 -0
  196. package/dist/form/form-root.mjs.map +1 -1
  197. package/dist/form/form-submit.d.mts +18 -0
  198. package/dist/form/form-submit.d.mts.map +1 -1
  199. package/dist/form/form-submit.mjs +2 -0
  200. package/dist/form/form-submit.mjs.map +1 -1
  201. package/dist/form/index.d.mts +7 -0
  202. package/dist/form/index.d.mts.map +1 -1
  203. package/dist/form/index.mjs +7 -0
  204. package/dist/form/index.mjs.map +1 -1
  205. package/dist/index.d.mts +2 -1
  206. package/dist/internal/types.d.mts +3 -0
  207. package/dist/internal/types.d.mts.map +1 -1
  208. package/dist/internal/use-popover-trigger.d.mts +1 -0
  209. package/dist/internal/use-popover-trigger.d.mts.map +1 -1
  210. package/dist/internal/use-popover-trigger.mjs.map +1 -1
  211. package/dist/internal/validity.d.mts +11 -0
  212. package/dist/internal/validity.d.mts.map +1 -1
  213. package/dist/internal/validity.mjs.map +1 -1
  214. package/dist/menu/index.d.mts +2 -0
  215. package/dist/menu/index.d.mts.map +1 -1
  216. package/dist/menu/index.mjs +2 -0
  217. package/dist/menu/index.mjs.map +1 -1
  218. package/dist/menu/menu-checkbox-item.d.mts +26 -2
  219. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  220. package/dist/menu/menu-checkbox-item.mjs +2 -0
  221. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  222. package/dist/menu/menu-context-trigger.d.mts +24 -2
  223. package/dist/menu/menu-context-trigger.d.mts.map +1 -1
  224. package/dist/menu/menu-context-trigger.mjs +2 -0
  225. package/dist/menu/menu-context-trigger.mjs.map +1 -1
  226. package/dist/menu/menu-group.d.mts +36 -1
  227. package/dist/menu/menu-group.d.mts.map +1 -1
  228. package/dist/menu/menu-group.mjs +9 -1
  229. package/dist/menu/menu-group.mjs.map +1 -1
  230. package/dist/menu/menu-item.d.mts +23 -1
  231. package/dist/menu/menu-item.d.mts.map +1 -1
  232. package/dist/menu/menu-item.mjs +2 -0
  233. package/dist/menu/menu-item.mjs.map +1 -1
  234. package/dist/menu/menu-popup.d.mts +33 -8
  235. package/dist/menu/menu-popup.d.mts.map +1 -1
  236. package/dist/menu/menu-popup.mjs +2 -0
  237. package/dist/menu/menu-popup.mjs.map +1 -1
  238. package/dist/menu/menu-radio-group.d.mts +20 -1
  239. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  240. package/dist/menu/menu-radio-group.mjs +2 -0
  241. package/dist/menu/menu-radio-group.mjs.map +1 -1
  242. package/dist/menu/menu-radio-item.d.mts +16 -0
  243. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  244. package/dist/menu/menu-radio-item.mjs +2 -0
  245. package/dist/menu/menu-radio-item.mjs.map +1 -1
  246. package/dist/menu/menu-root.d.mts +22 -3
  247. package/dist/menu/menu-root.d.mts.map +1 -1
  248. package/dist/menu/menu-root.mjs +2 -0
  249. package/dist/menu/menu-root.mjs.map +1 -1
  250. package/dist/menu/menu-submenu-trigger.d.mts +13 -0
  251. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  252. package/dist/menu/menu-submenu-trigger.mjs +2 -0
  253. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  254. package/dist/menu/menu-trigger.d.mts +15 -0
  255. package/dist/menu/menu-trigger.d.mts.map +1 -1
  256. package/dist/menu/menu-trigger.mjs +2 -0
  257. package/dist/menu/menu-trigger.mjs.map +1 -1
  258. package/dist/meter/index.d.mts +2 -0
  259. package/dist/meter/index.d.mts.map +1 -1
  260. package/dist/meter/index.mjs +2 -0
  261. package/dist/meter/index.mjs.map +1 -1
  262. package/dist/meter/meter-indicator.d.mts +11 -0
  263. package/dist/meter/meter-indicator.d.mts.map +1 -1
  264. package/dist/meter/meter-indicator.mjs +2 -0
  265. package/dist/meter/meter-indicator.mjs.map +1 -1
  266. package/dist/meter/meter-label.d.mts +11 -0
  267. package/dist/meter/meter-label.d.mts.map +1 -1
  268. package/dist/meter/meter-label.mjs +2 -0
  269. package/dist/meter/meter-label.mjs.map +1 -1
  270. package/dist/meter/meter-region.d.mts +5 -0
  271. package/dist/meter/meter-region.d.mts.map +1 -1
  272. package/dist/meter/meter-region.mjs.map +1 -1
  273. package/dist/meter/meter-root.d.mts +52 -10
  274. package/dist/meter/meter-root.d.mts.map +1 -1
  275. package/dist/meter/meter-root.mjs +2 -0
  276. package/dist/meter/meter-root.mjs.map +1 -1
  277. package/dist/meter/meter-track.d.mts +11 -0
  278. package/dist/meter/meter-track.d.mts.map +1 -1
  279. package/dist/meter/meter-track.mjs +2 -0
  280. package/dist/meter/meter-track.mjs.map +1 -1
  281. package/dist/meter/meter-value.d.mts +15 -1
  282. package/dist/meter/meter-value.d.mts.map +1 -1
  283. package/dist/meter/meter-value.mjs +2 -0
  284. package/dist/meter/meter-value.mjs.map +1 -1
  285. package/dist/number-field/index.d.mts +2 -0
  286. package/dist/number-field/index.d.mts.map +1 -1
  287. package/dist/number-field/index.mjs +2 -0
  288. package/dist/number-field/index.mjs.map +1 -1
  289. package/dist/number-field/number-field-decrement.d.mts +2 -0
  290. package/dist/number-field/number-field-decrement.d.mts.map +1 -1
  291. package/dist/number-field/number-field-decrement.mjs +2 -0
  292. package/dist/number-field/number-field-decrement.mjs.map +1 -1
  293. package/dist/number-field/number-field-increment.d.mts +2 -0
  294. package/dist/number-field/number-field-increment.d.mts.map +1 -1
  295. package/dist/number-field/number-field-increment.mjs +2 -0
  296. package/dist/number-field/number-field-increment.mjs.map +1 -1
  297. package/dist/number-field/number-field-input.d.mts +9 -0
  298. package/dist/number-field/number-field-input.d.mts.map +1 -1
  299. package/dist/number-field/number-field-input.mjs +2 -0
  300. package/dist/number-field/number-field-input.mjs.map +1 -1
  301. package/dist/number-field/number-field-label.d.mts +10 -0
  302. package/dist/number-field/number-field-label.d.mts.map +1 -1
  303. package/dist/number-field/number-field-label.mjs +2 -0
  304. package/dist/number-field/number-field-label.mjs.map +1 -1
  305. package/dist/number-field/number-field-root.d.mts +62 -14
  306. package/dist/number-field/number-field-root.d.mts.map +1 -1
  307. package/dist/number-field/number-field-root.mjs +2 -0
  308. package/dist/number-field/number-field-root.mjs.map +1 -1
  309. package/dist/number-field/use-step-button.d.mts +20 -0
  310. package/dist/number-field/use-step-button.d.mts.map +1 -1
  311. package/dist/number-field/use-step-button.mjs.map +1 -1
  312. package/dist/popover/index.d.mts +2 -0
  313. package/dist/popover/index.d.mts.map +1 -1
  314. package/dist/popover/index.mjs +2 -0
  315. package/dist/popover/index.mjs.map +1 -1
  316. package/dist/popover/popover-close.d.mts +18 -0
  317. package/dist/popover/popover-close.d.mts.map +1 -1
  318. package/dist/popover/popover-close.mjs +2 -0
  319. package/dist/popover/popover-close.mjs.map +1 -1
  320. package/dist/popover/popover-description.d.mts +12 -0
  321. package/dist/popover/popover-description.d.mts.map +1 -1
  322. package/dist/popover/popover-description.mjs +2 -0
  323. package/dist/popover/popover-description.mjs.map +1 -1
  324. package/dist/popover/popover-popup.d.mts +30 -4
  325. package/dist/popover/popover-popup.d.mts.map +1 -1
  326. package/dist/popover/popover-popup.mjs +2 -0
  327. package/dist/popover/popover-popup.mjs.map +1 -1
  328. package/dist/popover/popover-root.d.mts +9 -0
  329. package/dist/popover/popover-root.d.mts.map +1 -1
  330. package/dist/popover/popover-root.mjs +2 -0
  331. package/dist/popover/popover-root.mjs.map +1 -1
  332. package/dist/popover/popover-title.d.mts +11 -0
  333. package/dist/popover/popover-title.d.mts.map +1 -1
  334. package/dist/popover/popover-title.mjs +2 -0
  335. package/dist/popover/popover-title.mjs.map +1 -1
  336. package/dist/popover/popover-trigger.d.mts +15 -0
  337. package/dist/popover/popover-trigger.d.mts.map +1 -1
  338. package/dist/popover/popover-trigger.mjs +2 -0
  339. package/dist/popover/popover-trigger.mjs.map +1 -1
  340. package/dist/progress/index.d.mts +2 -0
  341. package/dist/progress/index.d.mts.map +1 -1
  342. package/dist/progress/index.mjs +2 -0
  343. package/dist/progress/index.mjs.map +1 -1
  344. package/dist/progress/progress-indicator.d.mts +11 -0
  345. package/dist/progress/progress-indicator.d.mts.map +1 -1
  346. package/dist/progress/progress-indicator.mjs +2 -0
  347. package/dist/progress/progress-indicator.mjs.map +1 -1
  348. package/dist/progress/progress-label.d.mts +11 -0
  349. package/dist/progress/progress-label.d.mts.map +1 -1
  350. package/dist/progress/progress-label.mjs +2 -0
  351. package/dist/progress/progress-label.mjs.map +1 -1
  352. package/dist/progress/progress-root.d.mts +36 -8
  353. package/dist/progress/progress-root.d.mts.map +1 -1
  354. package/dist/progress/progress-root.mjs +2 -0
  355. package/dist/progress/progress-root.mjs.map +1 -1
  356. package/dist/progress/progress-track.d.mts +11 -0
  357. package/dist/progress/progress-track.d.mts.map +1 -1
  358. package/dist/progress/progress-track.mjs +2 -0
  359. package/dist/progress/progress-track.mjs.map +1 -1
  360. package/dist/progress/progress-value.d.mts +15 -1
  361. package/dist/progress/progress-value.d.mts.map +1 -1
  362. package/dist/progress/progress-value.mjs +2 -0
  363. package/dist/progress/progress-value.mjs.map +1 -1
  364. package/dist/radio-group/index.d.mts +2 -0
  365. package/dist/radio-group/index.d.mts.map +1 -1
  366. package/dist/radio-group/index.mjs +2 -0
  367. package/dist/radio-group/index.mjs.map +1 -1
  368. package/dist/radio-group/radio-group-item.d.mts +18 -1
  369. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  370. package/dist/radio-group/radio-group-item.mjs +2 -0
  371. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  372. package/dist/radio-group/radio-group-label.d.mts +10 -0
  373. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  374. package/dist/radio-group/radio-group-label.mjs +2 -0
  375. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  376. package/dist/radio-group/radio-group-root.d.mts +29 -5
  377. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  378. package/dist/radio-group/radio-group-root.mjs +2 -0
  379. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  380. package/dist/select/index.d.mts +2 -0
  381. package/dist/select/index.d.mts.map +1 -1
  382. package/dist/select/index.mjs +2 -0
  383. package/dist/select/index.mjs.map +1 -1
  384. package/dist/select/select-group-label.d.mts +10 -0
  385. package/dist/select/select-group-label.d.mts.map +1 -1
  386. package/dist/select/select-group-label.mjs +2 -0
  387. package/dist/select/select-group-label.mjs.map +1 -1
  388. package/dist/select/select-group.d.mts +15 -1
  389. package/dist/select/select-group.d.mts.map +1 -1
  390. package/dist/select/select-group.mjs +2 -0
  391. package/dist/select/select-group.mjs.map +1 -1
  392. package/dist/select/select-option.d.mts +19 -1
  393. package/dist/select/select-option.d.mts.map +1 -1
  394. package/dist/select/select-option.mjs +2 -0
  395. package/dist/select/select-option.mjs.map +1 -1
  396. package/dist/select/select-root.d.mts +24 -1
  397. package/dist/select/select-root.d.mts.map +1 -1
  398. package/dist/select/select-root.mjs +2 -0
  399. package/dist/select/select-root.mjs.map +1 -1
  400. package/dist/select/select-separator.d.mts +9 -0
  401. package/dist/select/select-separator.d.mts.map +1 -1
  402. package/dist/select/select-separator.mjs +2 -0
  403. package/dist/select/select-separator.mjs.map +1 -1
  404. package/dist/select/select-trigger.d.mts +9 -0
  405. package/dist/select/select-trigger.d.mts.map +1 -1
  406. package/dist/select/select-trigger.mjs +2 -0
  407. package/dist/select/select-trigger.mjs.map +1 -1
  408. package/dist/select/select-value.d.mts +9 -0
  409. package/dist/select/select-value.d.mts.map +1 -1
  410. package/dist/select/select-value.mjs +2 -0
  411. package/dist/select/select-value.mjs.map +1 -1
  412. package/dist/slider/index.d.mts +2 -0
  413. package/dist/slider/index.d.mts.map +1 -1
  414. package/dist/slider/index.mjs +2 -0
  415. package/dist/slider/index.mjs.map +1 -1
  416. package/dist/slider/slider-indicator.d.mts +12 -0
  417. package/dist/slider/slider-indicator.d.mts.map +1 -1
  418. package/dist/slider/slider-indicator.mjs +2 -0
  419. package/dist/slider/slider-indicator.mjs.map +1 -1
  420. package/dist/slider/slider-label.d.mts +11 -1
  421. package/dist/slider/slider-label.d.mts.map +1 -1
  422. package/dist/slider/slider-label.mjs +2 -0
  423. package/dist/slider/slider-label.mjs.map +1 -1
  424. package/dist/slider/slider-root.d.mts +53 -9
  425. package/dist/slider/slider-root.d.mts.map +1 -1
  426. package/dist/slider/slider-root.mjs +2 -0
  427. package/dist/slider/slider-root.mjs.map +1 -1
  428. package/dist/slider/slider-thumb.d.mts +32 -3
  429. package/dist/slider/slider-thumb.d.mts.map +1 -1
  430. package/dist/slider/slider-thumb.mjs +2 -0
  431. package/dist/slider/slider-thumb.mjs.map +1 -1
  432. package/dist/slider/slider-track.d.mts +17 -0
  433. package/dist/slider/slider-track.d.mts.map +1 -1
  434. package/dist/slider/slider-track.mjs +2 -0
  435. package/dist/slider/slider-track.mjs.map +1 -1
  436. package/dist/slider/slider-value.d.mts +11 -0
  437. package/dist/slider/slider-value.d.mts.map +1 -1
  438. package/dist/slider/slider-value.mjs +2 -0
  439. package/dist/slider/slider-value.mjs.map +1 -1
  440. package/dist/switch/switch.d.mts +23 -3
  441. package/dist/switch/switch.d.mts.map +1 -1
  442. package/dist/switch/switch.mjs +2 -0
  443. package/dist/switch/switch.mjs.map +1 -1
  444. package/dist/tabs/index.d.mts +2 -0
  445. package/dist/tabs/index.d.mts.map +1 -1
  446. package/dist/tabs/index.mjs +2 -0
  447. package/dist/tabs/index.mjs.map +1 -1
  448. package/dist/tabs/tabs-context.d.mts +5 -0
  449. package/dist/tabs/tabs-context.d.mts.map +1 -1
  450. package/dist/tabs/tabs-context.mjs.map +1 -1
  451. package/dist/tabs/tabs-indicator.d.mts +17 -0
  452. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  453. package/dist/tabs/tabs-indicator.mjs +2 -0
  454. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  455. package/dist/tabs/tabs-list.d.mts +19 -1
  456. package/dist/tabs/tabs-list.d.mts.map +1 -1
  457. package/dist/tabs/tabs-list.mjs +2 -0
  458. package/dist/tabs/tabs-list.mjs.map +1 -1
  459. package/dist/tabs/tabs-panel.d.mts +19 -0
  460. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  461. package/dist/tabs/tabs-panel.mjs +2 -0
  462. package/dist/tabs/tabs-panel.mjs.map +1 -1
  463. package/dist/tabs/tabs-root.d.mts +39 -5
  464. package/dist/tabs/tabs-root.d.mts.map +1 -1
  465. package/dist/tabs/tabs-root.mjs +2 -0
  466. package/dist/tabs/tabs-root.mjs.map +1 -1
  467. package/dist/tabs/tabs-tab.d.mts +22 -1
  468. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  469. package/dist/tabs/tabs-tab.mjs +2 -0
  470. package/dist/tabs/tabs-tab.mjs.map +1 -1
  471. package/dist/toast/index.d.mts +2 -0
  472. package/dist/toast/index.d.mts.map +1 -1
  473. package/dist/toast/index.mjs +2 -0
  474. package/dist/toast/index.mjs.map +1 -1
  475. package/dist/toast/toast-action.d.mts +28 -3
  476. package/dist/toast/toast-action.d.mts.map +1 -1
  477. package/dist/toast/toast-action.mjs +2 -0
  478. package/dist/toast/toast-action.mjs.map +1 -1
  479. package/dist/toast/toast-close.d.mts +16 -0
  480. package/dist/toast/toast-close.d.mts.map +1 -1
  481. package/dist/toast/toast-close.mjs +2 -0
  482. package/dist/toast/toast-close.mjs.map +1 -1
  483. package/dist/toast/toast-description.d.mts +16 -1
  484. package/dist/toast/toast-description.d.mts.map +1 -1
  485. package/dist/toast/toast-description.mjs +2 -0
  486. package/dist/toast/toast-description.mjs.map +1 -1
  487. package/dist/toast/toast-root.d.mts +20 -0
  488. package/dist/toast/toast-root.d.mts.map +1 -1
  489. package/dist/toast/toast-root.mjs +2 -0
  490. package/dist/toast/toast-root.mjs.map +1 -1
  491. package/dist/toast/toast-title.d.mts +15 -1
  492. package/dist/toast/toast-title.d.mts.map +1 -1
  493. package/dist/toast/toast-title.mjs +2 -0
  494. package/dist/toast/toast-title.mjs.map +1 -1
  495. package/dist/toast/toast-viewport.d.mts +34 -5
  496. package/dist/toast/toast-viewport.d.mts.map +1 -1
  497. package/dist/toast/toast-viewport.mjs +2 -0
  498. package/dist/toast/toast-viewport.mjs.map +1 -1
  499. package/dist/toast/toast.d.mts +46 -6
  500. package/dist/toast/toast.d.mts.map +1 -1
  501. package/dist/toast/toast.mjs +4 -0
  502. package/dist/toast/toast.mjs.map +1 -1
  503. package/dist/toggle/toggle.d.mts +20 -2
  504. package/dist/toggle/toggle.d.mts.map +1 -1
  505. package/dist/toggle/toggle.mjs +2 -0
  506. package/dist/toggle/toggle.mjs.map +1 -1
  507. package/dist/toggle-group/index.d.mts +2 -0
  508. package/dist/toggle-group/index.d.mts.map +1 -1
  509. package/dist/toggle-group/index.mjs +2 -0
  510. package/dist/toggle-group/index.mjs.map +1 -1
  511. package/dist/toggle-group/toggle-group-context.d.mts +1 -0
  512. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
  513. package/dist/toggle-group/toggle-group-context.mjs.map +1 -1
  514. package/dist/toggle-group/toggle-group-item.d.mts +16 -0
  515. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
  516. package/dist/toggle-group/toggle-group-item.mjs +2 -0
  517. package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
  518. package/dist/toggle-group/toggle-group-root.d.mts +73 -12
  519. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
  520. package/dist/toggle-group/toggle-group-root.mjs +2 -0
  521. package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
  522. package/dist/toolbar/index.d.mts +2 -0
  523. package/dist/toolbar/index.d.mts.map +1 -1
  524. package/dist/toolbar/index.mjs +2 -0
  525. package/dist/toolbar/index.mjs.map +1 -1
  526. package/dist/toolbar/toolbar-root.d.mts +30 -3
  527. package/dist/toolbar/toolbar-root.d.mts.map +1 -1
  528. package/dist/toolbar/toolbar-root.mjs +2 -0
  529. package/dist/toolbar/toolbar-root.mjs.map +1 -1
  530. package/dist/toolbar/toolbar-separator.d.mts +13 -0
  531. package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
  532. package/dist/toolbar/toolbar-separator.mjs +2 -0
  533. package/dist/toolbar/toolbar-separator.mjs.map +1 -1
  534. package/dist/tooltip/index.d.mts +2 -0
  535. package/dist/tooltip/index.d.mts.map +1 -1
  536. package/dist/tooltip/index.mjs +2 -0
  537. package/dist/tooltip/index.mjs.map +1 -1
  538. package/dist/tooltip/tooltip-arrow.d.mts +16 -0
  539. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
  540. package/dist/tooltip/tooltip-arrow.mjs +2 -0
  541. package/dist/tooltip/tooltip-arrow.mjs.map +1 -1
  542. package/dist/tooltip/tooltip-context.d.mts +4 -0
  543. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  544. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  545. package/dist/tooltip/tooltip-popup.d.mts +24 -3
  546. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  547. package/dist/tooltip/tooltip-popup.mjs +2 -0
  548. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  549. package/dist/tooltip/tooltip-root.d.mts +24 -2
  550. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  551. package/dist/tooltip/tooltip-root.mjs +2 -0
  552. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  553. package/dist/tooltip/tooltip-trigger.d.mts +18 -1
  554. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  555. package/dist/tooltip/tooltip-trigger.mjs +2 -0
  556. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  557. package/package.json +9 -1
  558. package/skills/funstack-ui-knowledge/SKILL.md +75 -0
@@ -0,0 +1,662 @@
1
+ # Select
2
+
3
+ A real `<select>`. The platform gives it form participation, `required`, autofill, typeahead, option groups, the native combobox semantics, mobile pickers, and interaction before hydration. Opt into a styled picker with one CSS declaration, `appearance: base-select`; the library ships the markup for it and no JavaScript for the picker. What the library adds is the same as for RadioGroup: the selection changes through `valueChangeAction` in a transition, with optimistic feedback and `data-pending`, plus fixes for three things React gets wrong with a `<select>`.
4
+
5
+ ```tsx title="SelectFruit.tsx"
6
+ "use client";
7
+ import { startTransition, useState } from "react";
8
+ import { Select } from "@funstack/ui/select";
9
+ import { fakeSave } from "./fake-api.js";
10
+
11
+ /** A decorative swatch: an SVG with no text, so the option still reads as plain text. */
12
+ function Swatch({ color }: { color: string }) {
13
+ return (
14
+ <svg className="demo-select-swatch" viewBox="0 0 10 10" aria-hidden="true">
15
+ <circle cx="5" cy="5" r="5" fill={color} />
16
+ </svg>
17
+ );
18
+ }
19
+
20
+ // Uncontrolled with an async save. The pick shows at once (the <select> renders the optimistic
21
+ // value); the select, its button and the picked option carry data-pending for the 800 ms the save
22
+ // takes, and the Trigger's function children add a spinner. With `appearance: base-select`
23
+ // (Chromium, Safari 27) the button and the picker are styled; Firefox renders the native select
24
+ // from the same markup.
25
+ export function SelectFruit() {
26
+ const [saved, setSaved] = useState("");
27
+ return (
28
+ <div className="demo-stack">
29
+ <label className="demo-field" htmlFor="fruit">
30
+ Favourite fruit
31
+ </label>
32
+ <Select.Root
33
+ id="fruit"
34
+ className="demo-select"
35
+ defaultValue=""
36
+ valueChangeAction={async (next) => {
37
+ await fakeSave(`fruit=${next}`);
38
+ startTransition(() => setSaved(next));
39
+ }}
40
+ >
41
+ <Select.Trigger className="demo-select-button">
42
+ {({ pending }) => (
43
+ <>
44
+ <Select.Value />
45
+ {pending && <span className="demo-spinner" aria-hidden />}
46
+ </>
47
+ )}
48
+ </Select.Trigger>
49
+ <Select.Option value="" disabled>
50
+ Choose a fruit
51
+ </Select.Option>
52
+ <Select.Group label="Citrus">
53
+ <Select.GroupLabel>Citrus</Select.GroupLabel>
54
+ <Select.Option value="orange">
55
+ <Swatch color="orange" /> Orange
56
+ </Select.Option>
57
+ <Select.Option value="lemon">
58
+ <Swatch color="gold" /> Lemon
59
+ </Select.Option>
60
+ </Select.Group>
61
+ <Select.Separator />
62
+ <Select.Option value="apple" disabled>
63
+ <Swatch color="crimson" /> Apple (out of season)
64
+ </Select.Option>
65
+ <Select.Option value="banana">
66
+ <Swatch color="khaki" /> Banana
67
+ </Select.Option>
68
+ </Select.Root>
69
+ <output className="demo-readout">
70
+ saved: <code>{JSON.stringify(saved)}</code>
71
+ </output>
72
+ </div>
73
+ );
74
+ }
75
+ ```
76
+
77
+ ```css title="select.css"
78
+ /* Select: the Root is a real <select>. The opt-in to the styled picker is `appearance:
79
+ base-select` on the select and on its ::picker(select); engines without customizable select
80
+ (Firefox today) keep the native select and ignore the rest. Two rules, because an engine that
81
+ does not know `::picker(select)` drops a whole rule that names it. */
82
+ .demo-select {
83
+ appearance: base-select;
84
+ min-inline-size: 14rem;
85
+ padding: 0.4em 0.6em;
86
+ border: 1px solid var(--color-border);
87
+ border-radius: 6px;
88
+ background: var(--color-bg);
89
+ color: var(--color-text);
90
+ font: inherit;
91
+ }
92
+ .demo-select::picker(select) {
93
+ appearance: base-select;
94
+ }
95
+
96
+ .demo-select[data-pending] {
97
+ cursor: progress;
98
+ }
99
+ .demo-select[data-pending] selectedcontent {
100
+ opacity: 0.6;
101
+ }
102
+ .demo-select:user-invalid {
103
+ border-color: #dc2626;
104
+ }
105
+ .demo-select::picker-icon {
106
+ content: "▾";
107
+ transition: rotate 120ms;
108
+ }
109
+ .demo-select:open::picker-icon {
110
+ rotate: 180deg;
111
+ }
112
+
113
+ /* The select's own <button> (Select.Trigger): the UA makes it `display: contents`; lay out what
114
+ is inside it instead. */
115
+ .demo-select-button selectedcontent,
116
+ .demo-select selectedcontent {
117
+ display: inline-flex;
118
+ align-items: center;
119
+ gap: 0.5em;
120
+ }
121
+ .demo-select-button .demo-spinner {
122
+ margin-inline-start: 0.5em;
123
+ }
124
+
125
+ /* The picker and its options. */
126
+ .demo-select::picker(select) {
127
+ margin-block: 4px;
128
+ padding: 4px;
129
+ border: 1px solid var(--color-border);
130
+ border-radius: 8px;
131
+ background: var(--color-bg);
132
+ color: var(--color-text);
133
+ opacity: 0;
134
+ transition:
135
+ opacity 120ms,
136
+ overlay 120ms allow-discrete,
137
+ display 120ms allow-discrete;
138
+ }
139
+ .demo-select:open::picker(select) {
140
+ opacity: 1;
141
+ @starting-style {
142
+ opacity: 0;
143
+ }
144
+ }
145
+ .demo-select option {
146
+ display: flex;
147
+ align-items: center;
148
+ gap: 0.5em;
149
+ padding: 0.4em 0.6em;
150
+ border-radius: 4px;
151
+ }
152
+ .demo-select option:hover,
153
+ .demo-select option:focus-visible {
154
+ background: var(--color-primary);
155
+ color: var(--color-on-primary);
156
+ }
157
+ .demo-select option:checked {
158
+ font-weight: 600;
159
+ }
160
+ .demo-select option::checkmark {
161
+ content: "✓";
162
+ order: 1;
163
+ margin-inline-start: auto;
164
+ }
165
+ .demo-select option[data-pending]::after {
166
+ content: "…";
167
+ }
168
+ .demo-select option:disabled {
169
+ opacity: 0.45;
170
+ }
171
+ .demo-select optgroup legend {
172
+ padding: 0.3em 0.6em 0.1em;
173
+ font-size: 0.85em;
174
+ color: var(--color-text-secondary);
175
+ }
176
+ .demo-select hr {
177
+ margin: 4px 0;
178
+ border: 0;
179
+ border-block-start: 1px solid var(--color-border);
180
+ }
181
+
182
+ /* Icons: the clone in <selectedcontent> is a copy, so style it there too. */
183
+ .demo-select-swatch {
184
+ flex: none;
185
+ inline-size: 0.8em;
186
+ block-size: 0.8em;
187
+ }
188
+
189
+ @media (prefers-reduced-motion: reduce) {
190
+ .demo-select::picker(select),
191
+ .demo-select::picker-icon {
192
+ transition: none;
193
+ }
194
+ }
195
+ ```
196
+
197
+ ## Anatomy
198
+
199
+ ```tsx
200
+ import { Select } from "@funstack/ui/select";
201
+
202
+ <Select.Root name="fruit" defaultValue="" required valueChangeAction={saveFruit}> {/* select */}
203
+ <Select.Trigger> {/* button: optional, first child */}
204
+ <Select.Value /> {/* selectedcontent: the browser fills it */}
205
+ </Select.Trigger>
206
+ <Select.Option value="">Choose a fruit</Select.Option> {/* option: the placeholder */}
207
+ <Select.Group label="Citrus"> {/* optgroup */}
208
+ <Select.GroupLabel>Citrus <em>fruits</em></Select.GroupLabel> {/* legend: optional */}
209
+ <Select.Option value="orange"><Icon aria-hidden /> Orange</Select.Option>
210
+ </Select.Group>
211
+ <Select.Separator /> {/* hr */}
212
+ <Select.Option value="banana">Banana</Select.Option>
213
+ </Select.Root>
214
+ ```
215
+
216
+ - **Root is the `<select>` itself**: value, form, validation, picker, keyboard and accessibility mapping all live on that element. A `render` element must stay a `<select>`. There is no open state: the picker is the browser's `::picker(select)`, opened and closed with no events. Style it with `:open`.
217
+ - **Trigger and Value are optional.** Without them, browsers with customizable select draw their own button with the selected option's text. Add them for rich button content: `Select.Value` is a `<selectedcontent>` into which the browser copies the selected option's content. It has no `children`. The Trigger must be the select's first child.
218
+ - **Option content must read as plain text.** Firefox (default settings) shows the native select, which displays only the text. Give icons `aria-hidden` and no text (an SVG, or `alt=""`), and avoid the `label` attribute: Chromium names the option from it but shows the content.
219
+ - **Group needs `label`**: native pickers and assistive technology read the attribute. `GroupLabel` (a `<legend>`, first child of its Group) is the rich label drawn by customizable select; keep its text equal to `label`.
220
+ - No Popup, Positioner, Icon or Indicator parts: the picker, the arrow (`::picker-icon`) and the check mark (`::checkmark`) are pseudo-elements.
221
+
222
+ ## Props
223
+
224
+ ### `Select.Root`
225
+
226
+ | Prop | Type | Default | Description |
227
+ | - | - | - | - |
228
+ | `value` | `string` | – | Controlled value. undefined means uncontrolled. `""` selects the placeholder option. |
229
+ | `defaultValue` | `string` | `the browser's choice` | Initial value in uncontrolled mode, and what a form reset returns to (the latest value is mirrored into the options' `defaultSelected`). Without it (and without `value`) the Select follows the browser: an option with `value=""`, else the first enabled option, is adopted at mount without calling the action, and a reset returns to that adopted option (a disabled `""` placeholder included). Until a pick sets the value, options that load later behind a fallback are adopted again; after one, the pick is kept. |
230
+ | `valueChangeAction` | `ChangeAction<string, SelectValueChangeDetails>` | – | Runs in the Root's transition whenever the selected option changes; sync, async or a Server Function. Rejections reach the nearest Error Boundary and roll the selection back. In engines whose closed select changes the value on every arrow press (Firefox, Safari's native select) every press dispatches; the latest wins. |
231
+ | `disabled` | `boolean` | `false` | Native `disabled`. Never set by the library while pending (a disabled select would also drop out of the form data). |
232
+ | `name, required, form, autoComplete` | `native` | – | Plain `<select>` props. With `required`, the placeholder (`value=""`) fails validation. |
233
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
234
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
235
+ | `children` | `ReactNode \| ((state: SelectRootState) => ReactNode)` | – | The options and the Trigger. The function form receives the optimistic value; must not suspend. |
236
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<select> (element form) or take over rendering (function form). |
237
+
238
+ - **State**: `SelectRootState` is `{ value, pending, disabled }`; `value` is optimistic.
239
+ - **Owned**: `value`, `disabled`, `onChange`, `data-pending`, `data-disabled`. Inside a `Field.Root` also `id`, `name`, `required`, `aria-invalid`, `aria-describedby` and `data-invalid`.
240
+
241
+ `multiple` and `size` are not accepted: multi-select is not part of this version. `id`, `aria-*`, `onFocus` and other select props pass through.
242
+
243
+ `SelectValueChangeDetails`: `{ reason, event }`. `reason` is `"activate"` for a pick (pointer, keyboard, typeahead or autofill; `event` is the native `change`) and `"platform"` for a form reset (`event` is the `reset` event) or a pick made before hydration (no event).
244
+
245
+ ### `Select.Trigger`
246
+
247
+ | Prop | Type | Default | Description |
248
+ | - | - | - | - |
249
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
250
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
251
+ | `children` | `ReactNode \| ((state: SelectRootState) => ReactNode)` | – | Non-interactive content, usually `<Select.Value />`; a function of the Root's state for a pending indicator. |
252
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<button> (element form) or take over rendering (function form). |
253
+
254
+ - **State**: `SelectRootState`.
255
+ - **Owned**: `type` (always `"button"`), `data-pending`, `data-disabled`.
256
+
257
+ Must be the select's first child. Engines without customizable select do not render it, so a spinner inside it also needs a `select[data-pending]` style.
258
+
259
+ ### `Select.Value`
260
+
261
+ | Prop | Type | Default | Description |
262
+ | - | - | - | - |
263
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
264
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
265
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<selectedcontent> (element form) or take over rendering (function form). |
266
+
267
+ - **State**: `SelectRootState`.
268
+ - **Owned**: `children` (none: the browser fills the element), and the hydration-related props of that content.
269
+
270
+ The browser copies the selected option's content in on every selection change, and the parser does so before hydration (the element is rendered so that hydration accepts that content). The library keeps the copy fresh: when the selected option's content changes through React (a translated label, a count, the option's own function children, a Suspense boundary resolving inside it) or a form reset changes the selection, it asks the browser to copy again. The copy is a snapshot: style it as `selectedcontent .icon`, not `option:checked .icon`.
271
+
272
+ ### `Select.Option`
273
+
274
+ | Prop | Type | Default | Description |
275
+ | - | - | - | - |
276
+ | `value` | `string` | – | Required (React cannot infer a value from rich content). Submitted as the form value. |
277
+ | `disabled` | `boolean` | `false` | Native `disabled`: not pickable, skipped by keyboard navigation. |
278
+ | `className` | `string \| ((state: SelectOptionState) => string \| undefined)` | – | A class name, or a function of the part's state. |
279
+ | `style` | `CSSProperties \| ((state: SelectOptionState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
280
+ | `children` | `ReactNode \| ((state: SelectOptionState) => ReactNode)` | – | Content, or a function of the option's state. |
281
+ | `render` | `ReactElement \| ((props, state: SelectOptionState) => ReactNode)` | – | Replace the default \<option> (element form) or take over rendering (function form). |
282
+
283
+ - **State**: `SelectOptionState` is `{ value, selected, pending, disabled }`; `selected` is optimistic, `pending` is true on the option the user is waiting on, `disabled` includes a disabled `Select.Group` and `Root disabled`.
284
+ - **Owned**: `value`, `selected` (never rendered), `disabled`, `data-selected`, `data-pending`, `data-disabled`.
285
+
286
+ ### `Select.Group`
287
+
288
+ | Prop | Type | Default | Description |
289
+ | - | - | - | - |
290
+ | `label` | `string` | – | Required. The `<optgroup label>`, shown by native pickers and read by assistive technology. |
291
+ | `disabled` | `boolean` | `false` | Native: disables every option in the group. |
292
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
293
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
294
+ | `children` | `ReactNode \| ((state: SelectRootState) => ReactNode)` | – | The GroupLabel and the group's Options. |
295
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<optgroup>; it must stay an \<optgroup>. |
296
+
297
+ - **State**: `SelectRootState`.
298
+ - **Owned**: `label`.
299
+
300
+ ### `Select.GroupLabel`
301
+
302
+ | Prop | Type | Default | Description |
303
+ | - | - | - | - |
304
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
305
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
306
+ | `children` | `ReactNode \| ((state: SelectRootState) => ReactNode)` | – | The rich label. |
307
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<legend> (element form) or take over rendering (function form). |
308
+
309
+ - **State**: `SelectRootState`.
310
+ - **Owned**: none.
311
+
312
+ ### `Select.Separator`
313
+
314
+ | Prop | Type | Default | Description |
315
+ | - | - | - | - |
316
+ | `className` | `string \| ((state: SelectRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
317
+ | `style` | `CSSProperties \| ((state: SelectRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
318
+ | `render` | `ReactElement \| ((props, state: SelectRootState) => ReactNode)` | – | Replace the default \<hr> (element form) or take over rendering (function form). |
319
+
320
+ - **State**: `SelectRootState`.
321
+ - **Owned**: none.
322
+
323
+ Takes no children.
324
+
325
+ ## Data attributes
326
+
327
+ | Hook | On | Pseudo-class | Meaning |
328
+ | - | - | - | - |
329
+ | `data-pending` | Root, Trigger | – | `valueChangeAction` is in flight. |
330
+ | `data-pending` | Option | – | The option the in-flight dispatch is selecting. |
331
+ | `data-selected` | Option | `:checked` | Optimistic selection. Identical, because the select renders the optimistic value. |
332
+ | `data-disabled` | Root, Trigger, Option | `:disabled` | Disabled by prop; on an Option, by its own prop, a disabled Group or `Root disabled`. |
333
+ | – | Root | `:open`, `:focus-within` | The picker is open. Browser-owned, no attribute. In Chromium focus moves to the option while open, so `select:focus-within` is the robust focus selector. |
334
+ | – | Root | `:required`, `:user-invalid`, `:valid` | Platform only. |
335
+
336
+ ## Keyboard and ARIA
337
+
338
+ Everything is the browser's; the library installs no key handler. The engines differ, and the Select's contract does not depend on them: one `valueChangeAction` per committed change, with the optimistic value in the DOM.
339
+
340
+ | Key | Chromium (customizable select) | Firefox, Safari (native) | Dispatches |
341
+ | - | - | - | - |
342
+ | Tab / Shift+Tab | Focuses the select; while open, closes without committing and focus returns to the select. | Focuses the select. | no |
343
+ | Enter, Space, ArrowDown (closed) | Opens the picker; focus moves to the selected option. | Space / Alt+Down open the native popup; arrows change the value at once. | Chromium: no. Native: once per arrow press |
344
+ | Arrows, Home, End (open) | Move focus between enabled options. | Inside the native popup. | no |
345
+ | Enter, Space, click (open) | Commits the focused option and closes. | Pick. | once |
346
+ | Escape (open) | Closes without committing. | Closes the native popup. | no |
347
+ | Typeahead | Closed: selects the match at once. Open: moves focus to it. | Selects the match. | once per match while closed |
348
+
349
+ - The select is exposed as a `combobox` with a popup; options are named from their content (`aria-hidden` icons excluded), groups are `group` and, in Chromium's customizable select, the separator is a `separator`. Name the select with a `<label for>` or `aria-label`.
350
+ - The library never moves focus, not even on rollback. A rollback is silent; add an `aria-live` region if a slow action may fail.
351
+ - In Firefox and Safari's native select every arrow press is a committed change. For a preference that needs no wait, do not return the promise (`(next) => { void save(next); }`), or leave the value to the form submit.
352
+
353
+ ## Transition types
354
+
355
+ Concept: [Transitions & ViewTransition](../concepts/transitions.md#transition-types)
356
+
357
+ `fsui-select`. No part takes a `transition` prop: the picker and the button's copy are drawn by the browser.
358
+
359
+ ## Optimistic and pending
360
+
361
+ Concept: [Pending & optimistic state](../concepts/pending-and-optimistic.md)
362
+
363
+ The `<select>` renders the optimistic value (a correctness requirement), so `option:checked` and `data-selected` agree. `data-pending` is on the Root and Trigger while `valueChangeAction` is in flight, and on the Option being selected.
364
+
365
+ ### Walkthrough
366
+
367
+ 1. Pick Banana: the browser selects it, copies it into the button and fires `change`. The Root dispatches `valueChangeAction("banana", { reason: "activate" })` in its transition. The Root, the Trigger and the Banana option get `data-pending`.
368
+ 2. Resolve: the value is committed (uncontrolled) and the attributes go.
369
+ 3. Reject: the optimistic value reverts, React selects the old option again (the button follows), and the error reaches the nearest Error Boundary.
370
+ 4. A controlled parent vetoes by not adopting the value: the button shows Banana for the action's duration, then the old option again.
371
+
372
+ The select shows the optimistic value because react-dom restores a controlled select's options after every event ([Native inputs](../concepts/browser-owned-state.md#native-inputs)); a select driven by committed state would snap back, button included, for the whole pending time.
373
+
374
+ ## Suspense
375
+
376
+ Concept: [Suspense](../concepts/suspense.md)
377
+
378
+ Options revealed later by a Suspense boundary or `use()` inside the Select get the value re-applied when they arrive, without a dispatch. There is no load-on-open.
379
+
380
+ ### Options that load later
381
+
382
+ ```tsx title="SelectCountry.tsx"
383
+ "use client";
384
+ import { Suspense, use, useState } from "react";
385
+ import { Select } from "@funstack/ui/select";
386
+ import { sleep } from "./fake-api.js";
387
+
388
+ interface Country {
389
+ readonly code: string;
390
+ readonly name: string;
391
+ }
392
+
393
+ const initialCountries: readonly Country[] = [
394
+ { code: "jp", name: "Japan" },
395
+ { code: "fr", name: "France" },
396
+ { code: "br", name: "Brazil" },
397
+ ];
398
+
399
+ async function fetchCountries(): Promise<readonly Country[]> {
400
+ await sleep(1500);
401
+ return [...initialCountries, { code: "ke", name: "Kenya" }];
402
+ }
403
+
404
+ function CountryOptions({ countries }: { countries: Promise<readonly Country[]> | null }) {
405
+ const list = countries === null ? initialCountries : use(countries);
406
+ return list.map((c) => (
407
+ <Select.Option key={c.code} value={c.code}>
408
+ {c.name}
409
+ </Select.Option>
410
+ ));
411
+ }
412
+
413
+ // The options sit behind a Suspense boundary inside the select. "Reload" remounts the boundary
414
+ // (a new `key`), so the fallback option replaces the list for 1.5 s and the real options mount
415
+ // later. React selects options only in the select's own commit, so on its own it would leave the
416
+ // browser's first option selected; the library re-applies the value (`br`) when they arrive.
417
+ export function SelectCountry() {
418
+ const [country, setCountry] = useState("br");
419
+ const [countries, setCountries] = useState<Promise<readonly Country[]> | null>(null);
420
+ const [generation, setGeneration] = useState(0);
421
+ return (
422
+ <div className="demo-stack">
423
+ <div className="demo-row">
424
+ <Select.Root
425
+ aria-label="Country"
426
+ className="demo-select"
427
+ value={country}
428
+ valueChangeAction={(next) => {
429
+ setCountry(next);
430
+ }}
431
+ >
432
+ <Select.Trigger className="demo-select-button">
433
+ <Select.Value />
434
+ </Select.Trigger>
435
+ <Suspense
436
+ key={generation}
437
+ fallback={
438
+ <Select.Option value="" disabled>
439
+ Loading countries…
440
+ </Select.Option>
441
+ }
442
+ >
443
+ <CountryOptions countries={countries} />
444
+ </Suspense>
445
+ </Select.Root>
446
+ <button
447
+ type="button"
448
+ className="demo-button"
449
+ onClick={() => {
450
+ setCountries(fetchCountries());
451
+ setGeneration((g) => g + 1);
452
+ }}
453
+ >
454
+ Reload
455
+ </button>
456
+ </div>
457
+ <output className="demo-readout">
458
+ value: <code>{JSON.stringify(country)}</code>
459
+ </output>
460
+ </div>
461
+ );
462
+ }
463
+ ```
464
+
465
+ `select.css`: the same file as above.
466
+
467
+ React selects options only in the select's own commit, so options revealed later by a Suspense boundary or `use()` inside the select would leave the browser's first option selected. The library re-applies the value when they arrive, without a dispatch. Until then nothing (or the fallback) is selected and the button is empty. Use a disabled fallback option, or put the whole Select inside the boundary for a skeleton. There is no "load on open": a native select has no open event (use a [Combobox](combobox.md) for that).
468
+
469
+ ## Browser-owned state
470
+
471
+ Concept: [Browser-owned state](../concepts/browser-owned-state.md)
472
+
473
+ The picker's open state (`:open`) is the browser's, with no attribute and no action. The browser selects an option before any JavaScript runs; a form reset and picks before hydration are dispatched with `reason: "platform"`.
474
+
475
+ ## Before hydration
476
+
477
+ Concept: [Server Components](../concepts/server-components.md#before-hydration)
478
+
479
+ A native select: picking, the keyboard, typeahead, `required` and form submission work, and with `appearance: base-select` the browser copies the selected option into `Select.Value`. On hydration a changed value is reconciled with one `valueChangeAction` call (`reason: "platform"`).
480
+
481
+ ### Plain HTML
482
+
483
+ If a select only posts with its form, a Server Component can render the native element itself, with no library code for it:
484
+
485
+ ```tsx
486
+ // A Server Component: no import from @funstack/ui.
487
+ <label>
488
+ Size
489
+ <select name="size" defaultValue={order.size ?? ""} required>
490
+ <option value="">Choose a size</option>
491
+ <option value="s">Small</option>
492
+ <option value="m">Medium</option>
493
+ </select>
494
+ </label>
495
+ ```
496
+
497
+ Picking, the keyboard, typeahead, `required` and submission are the browser's. The `appearance: base-select` recipes above apply to it too: a styled picker in Chromium 135+ and Safari 27, the native select in Firefox. Keep the options' content plain text there. Rich button content needs a `<selectedcontent>`, which the parser fills before hydration, so a plain one in a hydrated React tree causes a hydration mismatch (and `@types/react` does not type it); `Select.Value` is the part that handles this.
498
+
499
+ Compared with `Select`, it has no `valueChangeAction`, so no transition, `data-pending` or rollback on rejection; no data attributes (use `:checked` on options, `:open`, `:disabled`); no React state that tracks it, and none of the library's fixes for React's form reset and re-applying the selection; no options that load later behind Suspense; and no [Field](field.md) integration.
500
+
501
+ ## Forms
502
+
503
+ ```tsx title="SelectForm.tsx"
504
+ "use client";
505
+ import { startTransition, useState } from "react";
506
+ import { useFormStatus } from "react-dom";
507
+ import { Select } from "@funstack/ui/select";
508
+ import type { SelectValueChangeDetails } from "@funstack/ui/select";
509
+ import { fakeSave } from "./fake-api.js";
510
+
511
+ function SubmitButton() {
512
+ const { pending } = useFormStatus();
513
+ return (
514
+ <button type="submit" className="demo-button demo-primary">
515
+ {pending && <span className="demo-spinner" aria-hidden />}
516
+ Order
517
+ </button>
518
+ );
519
+ }
520
+
521
+ // The select posts `size=…` with the form (a real `name`). The first option is the placeholder:
522
+ // `value=""`, so `required` blocks the submit until a real size is picked, and the select matches
523
+ // `:user-invalid` after the attempt. After the form action succeeds React resets the form; the
524
+ // ordered size is the new `defaultValue`, so the reset returns to it. `valueChangeAction` only
525
+ // records what the Select was told: picks arrive with reason "activate", resets with "platform".
526
+ export function SelectForm() {
527
+ const [ordered, setOrdered] = useState("");
528
+ const [log, setLog] = useState<string[]>([]);
529
+ const record = (next: string, { reason, event }: SelectValueChangeDetails) => {
530
+ const entry = `${JSON.stringify(next)} (${reason}, ${event?.type ?? "no event"})`;
531
+ setLog((prev) => [entry, ...prev].slice(0, 4));
532
+ };
533
+ return (
534
+ <form
535
+ className="demo-stack"
536
+ action={async (formData) => {
537
+ await fakeSave("the order");
538
+ const size = formData.get("size");
539
+ startTransition(() => setOrdered(typeof size === "string" ? size : ""));
540
+ }}
541
+ >
542
+ <label className="demo-field" htmlFor="size">
543
+ T-shirt size
544
+ </label>
545
+ <Select.Root
546
+ id="size"
547
+ className="demo-select"
548
+ name="size"
549
+ required
550
+ defaultValue={ordered}
551
+ valueChangeAction={record}
552
+ >
553
+ <Select.Option value="" disabled>
554
+ Choose a size
555
+ </Select.Option>
556
+ <Select.Option value="s">Small</Select.Option>
557
+ <Select.Option value="m">Medium</Select.Option>
558
+ <Select.Option value="l">Large</Select.Option>
559
+ <Select.Option value="xl" disabled>
560
+ Extra large (sold out)
561
+ </Select.Option>
562
+ </Select.Root>
563
+ <div className="demo-row">
564
+ <SubmitButton />
565
+ <button type="reset" className="demo-button">
566
+ Reset
567
+ </button>
568
+ </div>
569
+ <output className="demo-readout">
570
+ ordered: <code>{JSON.stringify(ordered)}</code>
571
+ <br />
572
+ valueChangeAction calls, latest first: <code>{log.join(" · ") || "(none yet)"}</code>
573
+ </output>
574
+ </form>
575
+ );
576
+ }
577
+ ```
578
+
579
+ `select.css`: the same file as above.
580
+
581
+ - **The value is always a string.** "Nothing chosen" is the HTML placeholder: a first `<Select.Option value="">`, which `required` rejects with the browser's own message and `:user-invalid`. It may be `disabled` so that it cannot be picked again.
582
+ - **Form reset** (the Reset button, `form.reset()`, or React's automatic reset after the action succeeds) is one dispatch with `reason: "platform"` and the `reset` event. Uncontrolled, the target is the latest `defaultValue` (without one, the option adopted at mount); controlled, the Root's mount-time value, offered to the parent. A disabled Select is reset too.
583
+ - **Picks before hydration** (and Firefox restoring form state on reload) work natively; on hydration the Root finds the DOM differs from its state and dispatches once, with no event. That includes options that hydrate later inside a Suspense boundary.
584
+
585
+ ### Server Functions and forms
586
+
587
+ ```tsx
588
+ // Autosave: an action with data-pending, passed directly from a Server Component.
589
+ <Select.Root defaultValue={user.country} valueChangeAction={setCountry}>...</Select.Root>
590
+
591
+ // Native submission: no action on the Select; pending is the form's.
592
+ <form action={placeOrder}>
593
+ <Select.Root name="size" defaultValue="" required>...</Select.Root>
594
+ <SubmitButton />
595
+ </form>
596
+ ```
597
+
598
+ The [two channels](../concepts/action-props.md#form-channel) are independent and may be combined. Every dispatch adds the view transition type `fsui-select`; no part takes a `transition` prop, since the picker and the button's copy are drawn by the browser. An action-less Select is a working native select before hydration, including the copy into the button.
599
+
600
+ ## Styling
601
+
602
+ The library ships no CSS. These recipes cover the opt-in, the button, the picker, its options and an open/close animation. Engines without customizable select ignore all of it except the plain properties on the select.
603
+
604
+ ```css
605
+ /* 1. Opt in to the customizable picker. Two rules: an engine that does not know
606
+ ::picker(select) drops any rule naming it. */
607
+ .select { appearance: base-select; }
608
+ .select::picker(select) { appearance: base-select; }
609
+
610
+ /* 2. The button, its content, the arrow. */
611
+ .select { border: 1px solid GrayText; border-radius: 6px; padding: 0.4em 0.6em; }
612
+ .select::picker-icon { content: "▾"; transition: rotate 120ms; }
613
+ .select:open::picker-icon { rotate: 180deg; }
614
+ .select[data-pending] { cursor: progress; }
615
+ .select[data-pending] selectedcontent { opacity: 0.6; }
616
+ .select:user-invalid { border-color: var(--danger); }
617
+ selectedcontent .icon { inline-size: 1em; } /* the copy, not the option */
618
+
619
+ /* 3. The picker and its options. */
620
+ .select::picker(select) { border: 1px solid GrayText; border-radius: 8px; padding: 4px; }
621
+ .select option { padding: 0.4em 0.6em; border-radius: 4px; }
622
+ .select option:hover, .select option:focus-visible { background: Highlight; color: HighlightText; }
623
+ .select option:checked { font-weight: 600; } /* optimistic: flips on pick, reverts on rejection */
624
+ .select option::checkmark { content: "✓"; order: 1; margin-inline-start: auto; }
625
+ .select option[data-pending]::after { content: "…"; }
626
+ .select option:disabled { opacity: 0.4; }
627
+ .select optgroup legend { font-size: 0.85em; color: GrayText; }
628
+
629
+ /* 4. Open/close animation (Chromium; Safari 27.0 does not animate the picker yet). */
630
+ .select::picker(select) {
631
+ opacity: 0;
632
+ transition: opacity 120ms, overlay 120ms allow-discrete, display 120ms allow-discrete;
633
+ }
634
+ .select:open::picker(select) { opacity: 1; @starting-style { opacity: 0; } }
635
+
636
+ /* 5. Placement: the browser anchors the picker to the select; override its position. The self-*
637
+ keywords follow the select's own direction (an RTL container too); plain logical ones would
638
+ follow the root's, since the picker is in the top layer. */
639
+ .select::picker(select) { position-area: self-block-end span-self-inline-end; position-try-fallbacks: flip-block; }
640
+
641
+ @media (prefers-reduced-motion: reduce) {
642
+ .select::picker(select), .select::picker-icon { transition: none; }
643
+ }
644
+ ```
645
+
646
+ Tailwind: `data-pending:cursor-progress open:ring-2` on the Root, `checked:font-semibold data-pending:animate-pulse` on an Option.
647
+
648
+ > **Safari: a Select inside a Popover or Menu**
649
+ >
650
+ > The browser positions the picker with anchor positioning and fallbacks. A WebKit bug (302008) can hang a page that opens a popover with position fallbacks inside another popover. If a Select inside a Popover or Menu misbehaves in Safari, turn the fallbacks off: `.select::picker(select) { position-try-fallbacks: none; }`.
651
+
652
+ ## Browser notes
653
+
654
+ | | Chromium 135+ | Safari 27 | Firefox (default settings) |
655
+ | - | - | - | - |
656
+ | `appearance: base-select` | styled picker | styled picker | ignored: native select |
657
+ | Trigger (`<button>`) | replaces the UA button | same | parsed, not rendered |
658
+ | Value (`<selectedcontent>`) | filled by the browser | same | stays empty |
659
+ | Rich option content, GroupLabel | rendered | rendered | the option text; the group's `label` |
660
+ | Value, forms, `required`, reset, actions, pending | identical | identical | identical |
661
+
662
+ No experimental flag: the markup works everywhere and the opt-in is your CSS. Whether Safari on iOS draws the styled picker in the page or the system wheel is not verified yet; the value contract is the same either way (wrap the opt-in in `@media (pointer: fine)` if you need the wheel). Search, free text and async loading on open are [Combobox](combobox.md)'s job.