@sharedex/ui 0.9.0 → 0.10.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 (509) hide show
  1. package/README.md +37 -2
  2. package/dist/backgrounds/hosts/CssHost.d.ts +2 -6
  3. package/dist/backgrounds/hosts/CssHost.js +3 -17
  4. package/dist/backgrounds/hosts/styleHref.d.ts +6 -0
  5. package/dist/backgrounds/hosts/styleHref.js +20 -0
  6. package/dist/buttons/pick.d.ts +9 -3
  7. package/dist/buttons/pick.js +4 -1
  8. package/dist/forms/base.d.ts +1 -0
  9. package/dist/forms/base.js +224 -0
  10. package/dist/forms/buddy.d.ts +6 -0
  11. package/dist/forms/buddy.js +150 -0
  12. package/dist/forms/chips.d.ts +1 -0
  13. package/dist/forms/chips.js +140 -0
  14. package/dist/forms/choice.d.ts +1 -0
  15. package/dist/forms/choice.js +208 -0
  16. package/dist/forms/controls/CheckGroup.d.ts +65 -0
  17. package/dist/forms/controls/CheckGroup.js +99 -0
  18. package/dist/forms/controls/Checkbox.d.ts +43 -0
  19. package/dist/forms/controls/Checkbox.js +67 -0
  20. package/dist/forms/controls/ChipGroup.d.ts +50 -0
  21. package/dist/forms/controls/ChipGroup.js +56 -0
  22. package/dist/forms/controls/Combobox.d.ts +75 -0
  23. package/dist/forms/controls/Combobox.js +249 -0
  24. package/dist/forms/controls/ErrorSummary.d.ts +29 -0
  25. package/dist/forms/controls/ErrorSummary.js +79 -0
  26. package/dist/forms/controls/Field.d.ts +92 -0
  27. package/dist/forms/controls/Field.js +219 -0
  28. package/dist/forms/controls/FileDrop.d.ts +81 -0
  29. package/dist/forms/controls/FileDrop.js +328 -0
  30. package/dist/forms/controls/FormBuddy.d.ts +22 -0
  31. package/dist/forms/controls/FormBuddy.js +143 -0
  32. package/dist/forms/controls/FormReveal.d.ts +21 -0
  33. package/dist/forms/controls/FormReveal.js +19 -0
  34. package/dist/forms/controls/FormSteps.d.ts +75 -0
  35. package/dist/forms/controls/FormSteps.js +205 -0
  36. package/dist/forms/controls/FormSwap.d.ts +27 -0
  37. package/dist/forms/controls/FormSwap.js +38 -0
  38. package/dist/forms/controls/InlineEdit.d.ts +50 -0
  39. package/dist/forms/controls/InlineEdit.js +136 -0
  40. package/dist/forms/controls/NumberField.d.ts +43 -0
  41. package/dist/forms/controls/NumberField.js +205 -0
  42. package/dist/forms/controls/OtpField.d.ts +46 -0
  43. package/dist/forms/controls/OtpField.js +195 -0
  44. package/dist/forms/controls/PasswordRules.d.ts +31 -0
  45. package/dist/forms/controls/PasswordRules.js +85 -0
  46. package/dist/forms/controls/RadioGroup.d.ts +69 -0
  47. package/dist/forms/controls/RadioGroup.js +95 -0
  48. package/dist/forms/controls/Range.d.ts +60 -0
  49. package/dist/forms/controls/Range.js +169 -0
  50. package/dist/forms/controls/SaveStatus.d.ts +25 -0
  51. package/dist/forms/controls/SaveStatus.js +88 -0
  52. package/dist/forms/controls/Select.d.ts +46 -0
  53. package/dist/forms/controls/Select.js +35 -0
  54. package/dist/forms/controls/Switch.d.ts +54 -0
  55. package/dist/forms/controls/Switch.js +91 -0
  56. package/dist/forms/controls/TagsField.d.ts +68 -0
  57. package/dist/forms/controls/TagsField.js +0 -0
  58. package/dist/forms/controls/choiceChecks.d.ts +11 -0
  59. package/dist/forms/controls/choiceChecks.js +19 -0
  60. package/dist/forms/controls/choiceParts.d.ts +40 -0
  61. package/dist/forms/controls/choiceParts.js +49 -0
  62. package/dist/forms/controls/fieldChecks.d.ts +17 -0
  63. package/dist/forms/controls/fieldChecks.js +34 -0
  64. package/dist/forms/controls/fieldTools.d.ts +62 -0
  65. package/dist/forms/controls/fieldTools.js +54 -0
  66. package/dist/forms/controls/pickerChecks.d.ts +10 -0
  67. package/dist/forms/controls/pickerChecks.js +27 -0
  68. package/dist/forms/controls/rangeChecks.d.ts +11 -0
  69. package/dist/forms/controls/rangeChecks.js +23 -0
  70. package/dist/forms/controls/shared.d.ts +8 -0
  71. package/dist/forms/controls/shared.js +18 -0
  72. package/dist/forms/effects/cards.d.ts +11 -0
  73. package/dist/forms/effects/cards.js +52 -0
  74. package/dist/forms/effects/check/checkCard.d.ts +10 -0
  75. package/dist/forms/effects/check/checkCard.js +15 -0
  76. package/dist/forms/effects/check/checkCard.schema.d.ts +1 -0
  77. package/dist/forms/effects/check/checkCard.schema.js +9 -0
  78. package/dist/forms/effects/check/checkConfetti.d.ts +18 -0
  79. package/dist/forms/effects/check/checkConfetti.js +38 -0
  80. package/dist/forms/effects/check/checkConfetti.schema.d.ts +1 -0
  81. package/dist/forms/effects/check/checkConfetti.schema.js +13 -0
  82. package/dist/forms/effects/check/checkDraw.d.ts +7 -0
  83. package/dist/forms/effects/check/checkDraw.js +12 -0
  84. package/dist/forms/effects/check/checkDraw.schema.d.ts +1 -0
  85. package/dist/forms/effects/check/checkDraw.schema.js +9 -0
  86. package/dist/forms/effects/check/checkHeart.d.ts +9 -0
  87. package/dist/forms/effects/check/checkHeart.js +84 -0
  88. package/dist/forms/effects/check/checkHeart.schema.d.ts +1 -0
  89. package/dist/forms/effects/check/checkHeart.schema.js +10 -0
  90. package/dist/forms/effects/check/checkJelly.d.ts +9 -0
  91. package/dist/forms/effects/check/checkJelly.js +23 -0
  92. package/dist/forms/effects/check/checkJelly.schema.d.ts +1 -0
  93. package/dist/forms/effects/check/checkJelly.schema.js +10 -0
  94. package/dist/forms/effects/check/checkMerge.d.ts +9 -0
  95. package/dist/forms/effects/check/checkMerge.js +37 -0
  96. package/dist/forms/effects/check/checkMerge.schema.d.ts +1 -0
  97. package/dist/forms/effects/check/checkMerge.schema.js +10 -0
  98. package/dist/forms/effects/check/checkMixed.d.ts +7 -0
  99. package/dist/forms/effects/check/checkMixed.js +25 -0
  100. package/dist/forms/effects/check/checkMixed.schema.d.ts +1 -0
  101. package/dist/forms/effects/check/checkMixed.schema.js +9 -0
  102. package/dist/forms/effects/check/checkMorph.d.ts +9 -0
  103. package/dist/forms/effects/check/checkMorph.js +53 -0
  104. package/dist/forms/effects/check/checkMorph.schema.d.ts +1 -0
  105. package/dist/forms/effects/check/checkMorph.schema.js +10 -0
  106. package/dist/forms/effects/check/checkPop.d.ts +9 -0
  107. package/dist/forms/effects/check/checkPop.js +27 -0
  108. package/dist/forms/effects/check/checkPop.schema.d.ts +1 -0
  109. package/dist/forms/effects/check/checkPop.schema.js +10 -0
  110. package/dist/forms/effects/check/checkRipple.d.ts +7 -0
  111. package/dist/forms/effects/check/checkRipple.js +33 -0
  112. package/dist/forms/effects/check/checkRipple.schema.d.ts +1 -0
  113. package/dist/forms/effects/check/checkRipple.schema.js +9 -0
  114. package/dist/forms/effects/check/checkScribble.d.ts +11 -0
  115. package/dist/forms/effects/check/checkScribble.js +42 -0
  116. package/dist/forms/effects/check/checkScribble.schema.d.ts +1 -0
  117. package/dist/forms/effects/check/checkScribble.schema.js +11 -0
  118. package/dist/forms/effects/check/checkStrike.d.ts +9 -0
  119. package/dist/forms/effects/check/checkStrike.js +54 -0
  120. package/dist/forms/effects/check/checkStrike.schema.d.ts +1 -0
  121. package/dist/forms/effects/check/checkStrike.schema.js +10 -0
  122. package/dist/forms/effects/chip/chipCheck.d.ts +7 -0
  123. package/dist/forms/effects/chip/chipCheck.js +26 -0
  124. package/dist/forms/effects/chip/chipCheck.schema.d.ts +1 -0
  125. package/dist/forms/effects/chip/chipCheck.schema.js +9 -0
  126. package/dist/forms/effects/chip/chipMerge.d.ts +9 -0
  127. package/dist/forms/effects/chip/chipMerge.js +63 -0
  128. package/dist/forms/effects/chip/chipMerge.schema.d.ts +1 -0
  129. package/dist/forms/effects/chip/chipMerge.schema.js +10 -0
  130. package/dist/forms/effects/file/fileButton.d.ts +7 -0
  131. package/dist/forms/effects/file/fileButton.js +28 -0
  132. package/dist/forms/effects/file/fileButton.schema.d.ts +1 -0
  133. package/dist/forms/effects/file/fileButton.schema.js +9 -0
  134. package/dist/forms/effects/file/fileCards.d.ts +7 -0
  135. package/dist/forms/effects/file/fileCards.js +38 -0
  136. package/dist/forms/effects/file/fileCards.schema.d.ts +1 -0
  137. package/dist/forms/effects/file/fileCards.schema.js +9 -0
  138. package/dist/forms/effects/file/fileDrag.d.ts +9 -0
  139. package/dist/forms/effects/file/fileDrag.js +45 -0
  140. package/dist/forms/effects/file/fileDrag.schema.d.ts +1 -0
  141. package/dist/forms/effects/file/fileDrag.schema.js +10 -0
  142. package/dist/forms/effects/file/filePage.d.ts +7 -0
  143. package/dist/forms/effects/file/filePage.js +46 -0
  144. package/dist/forms/effects/file/filePage.schema.d.ts +1 -0
  145. package/dist/forms/effects/file/filePage.schema.js +9 -0
  146. package/dist/forms/effects/file/filePreview.d.ts +7 -0
  147. package/dist/forms/effects/file/filePreview.js +17 -0
  148. package/dist/forms/effects/file/filePreview.schema.d.ts +1 -0
  149. package/dist/forms/effects/file/filePreview.schema.js +9 -0
  150. package/dist/forms/effects/file/fileProgress.d.ts +9 -0
  151. package/dist/forms/effects/file/fileProgress.js +92 -0
  152. package/dist/forms/effects/file/fileProgress.schema.d.ts +1 -0
  153. package/dist/forms/effects/file/fileProgress.schema.js +10 -0
  154. package/dist/forms/effects/file/fileReject.d.ts +7 -0
  155. package/dist/forms/effects/file/fileReject.js +24 -0
  156. package/dist/forms/effects/file/fileReject.schema.d.ts +1 -0
  157. package/dist/forms/effects/file/fileReject.schema.js +9 -0
  158. package/dist/forms/effects/input/inputAside.d.ts +11 -0
  159. package/dist/forms/effects/input/inputAside.js +42 -0
  160. package/dist/forms/effects/input/inputAside.schema.d.ts +1 -0
  161. package/dist/forms/effects/input/inputAside.schema.js +11 -0
  162. package/dist/forms/effects/input/inputBeam.d.ts +14 -0
  163. package/dist/forms/effects/input/inputBeam.js +51 -0
  164. package/dist/forms/effects/input/inputBeam.schema.d.ts +1 -0
  165. package/dist/forms/effects/input/inputBeam.schema.js +18 -0
  166. package/dist/forms/effects/input/inputCaret.d.ts +13 -0
  167. package/dist/forms/effects/input/inputCaret.js +33 -0
  168. package/dist/forms/effects/input/inputCaret.schema.d.ts +1 -0
  169. package/dist/forms/effects/input/inputCaret.schema.js +26 -0
  170. package/dist/forms/effects/input/inputCounter.d.ts +16 -0
  171. package/dist/forms/effects/input/inputCounter.js +84 -0
  172. package/dist/forms/effects/input/inputCounter.schema.d.ts +1 -0
  173. package/dist/forms/effects/input/inputCounter.schema.js +12 -0
  174. package/dist/forms/effects/input/inputCycle.d.ts +19 -0
  175. package/dist/forms/effects/input/inputCycle.js +93 -0
  176. package/dist/forms/effects/input/inputCycle.schema.d.ts +1 -0
  177. package/dist/forms/effects/input/inputCycle.schema.js +11 -0
  178. package/dist/forms/effects/input/inputDepth.d.ts +11 -0
  179. package/dist/forms/effects/input/inputDepth.js +31 -0
  180. package/dist/forms/effects/input/inputDepth.schema.d.ts +1 -0
  181. package/dist/forms/effects/input/inputDepth.schema.js +11 -0
  182. package/dist/forms/effects/input/inputDraw.d.ts +13 -0
  183. package/dist/forms/effects/input/inputDraw.js +27 -0
  184. package/dist/forms/effects/input/inputDraw.schema.d.ts +1 -0
  185. package/dist/forms/effects/input/inputDraw.schema.js +12 -0
  186. package/dist/forms/effects/input/inputFlap.d.ts +9 -0
  187. package/dist/forms/effects/input/inputFlap.js +24 -0
  188. package/dist/forms/effects/input/inputFlap.schema.d.ts +1 -0
  189. package/dist/forms/effects/input/inputFlap.schema.js +10 -0
  190. package/dist/forms/effects/input/inputFloat.d.ts +12 -0
  191. package/dist/forms/effects/input/inputFloat.js +46 -0
  192. package/dist/forms/effects/input/inputFloat.schema.d.ts +1 -0
  193. package/dist/forms/effects/input/inputFloat.schema.js +10 -0
  194. package/dist/forms/effects/input/inputFlood.d.ts +11 -0
  195. package/dist/forms/effects/input/inputFlood.js +30 -0
  196. package/dist/forms/effects/input/inputFlood.schema.d.ts +1 -0
  197. package/dist/forms/effects/input/inputFlood.schema.js +11 -0
  198. package/dist/forms/effects/input/inputFrame.d.ts +18 -0
  199. package/dist/forms/effects/input/inputFrame.js +77 -0
  200. package/dist/forms/effects/input/inputFrame.schema.d.ts +1 -0
  201. package/dist/forms/effects/input/inputFrame.schema.js +13 -0
  202. package/dist/forms/effects/input/inputIcon.d.ts +11 -0
  203. package/dist/forms/effects/input/inputIcon.js +18 -0
  204. package/dist/forms/effects/input/inputIcon.schema.d.ts +1 -0
  205. package/dist/forms/effects/input/inputIcon.schema.js +11 -0
  206. package/dist/forms/effects/input/inputNotch.d.ts +9 -0
  207. package/dist/forms/effects/input/inputNotch.js +70 -0
  208. package/dist/forms/effects/input/inputNotch.schema.d.ts +1 -0
  209. package/dist/forms/effects/input/inputNotch.schema.js +10 -0
  210. package/dist/forms/effects/input/inputReveal.d.ts +15 -0
  211. package/dist/forms/effects/input/inputReveal.js +56 -0
  212. package/dist/forms/effects/input/inputReveal.schema.d.ts +1 -0
  213. package/dist/forms/effects/input/inputReveal.schema.js +16 -0
  214. package/dist/forms/effects/input/inputRing.d.ts +13 -0
  215. package/dist/forms/effects/input/inputRing.js +27 -0
  216. package/dist/forms/effects/input/inputRing.schema.d.ts +1 -0
  217. package/dist/forms/effects/input/inputRing.schema.js +12 -0
  218. package/dist/forms/effects/input/inputRise.d.ts +9 -0
  219. package/dist/forms/effects/input/inputRise.js +22 -0
  220. package/dist/forms/effects/input/inputRise.schema.d.ts +1 -0
  221. package/dist/forms/effects/input/inputRise.schema.js +10 -0
  222. package/dist/forms/effects/input/inputSearch.d.ts +9 -0
  223. package/dist/forms/effects/input/inputSearch.js +37 -0
  224. package/dist/forms/effects/input/inputSearch.schema.d.ts +1 -0
  225. package/dist/forms/effects/input/inputSearch.schema.js +10 -0
  226. package/dist/forms/effects/input/inputSkeleton.d.ts +7 -0
  227. package/dist/forms/effects/input/inputSkeleton.js +41 -0
  228. package/dist/forms/effects/input/inputSkeleton.schema.d.ts +1 -0
  229. package/dist/forms/effects/input/inputSkeleton.schema.js +9 -0
  230. package/dist/forms/effects/input/inputSpotlight.d.ts +9 -0
  231. package/dist/forms/effects/input/inputSpotlight.js +20 -0
  232. package/dist/forms/effects/input/inputSpotlight.schema.d.ts +1 -0
  233. package/dist/forms/effects/input/inputSpotlight.schema.js +10 -0
  234. package/dist/forms/effects/input/inputStrength.d.ts +9 -0
  235. package/dist/forms/effects/input/inputStrength.js +29 -0
  236. package/dist/forms/effects/input/inputStrength.schema.d.ts +1 -0
  237. package/dist/forms/effects/input/inputStrength.schema.js +10 -0
  238. package/dist/forms/effects/input/inputSwap.d.ts +11 -0
  239. package/dist/forms/effects/input/inputSwap.js +39 -0
  240. package/dist/forms/effects/input/inputSwap.schema.d.ts +1 -0
  241. package/dist/forms/effects/input/inputSwap.schema.js +11 -0
  242. package/dist/forms/effects/input/inputUnderline.d.ts +13 -0
  243. package/dist/forms/effects/input/inputUnderline.js +36 -0
  244. package/dist/forms/effects/input/inputUnderline.schema.d.ts +1 -0
  245. package/dist/forms/effects/input/inputUnderline.schema.js +18 -0
  246. package/dist/forms/effects/input/inputWave.d.ts +11 -0
  247. package/dist/forms/effects/input/inputWave.js +23 -0
  248. package/dist/forms/effects/input/inputWave.schema.d.ts +1 -0
  249. package/dist/forms/effects/input/inputWave.schema.js +11 -0
  250. package/dist/forms/effects/input/inputWavy.d.ts +11 -0
  251. package/dist/forms/effects/input/inputWavy.js +53 -0
  252. package/dist/forms/effects/input/inputWavy.schema.d.ts +1 -0
  253. package/dist/forms/effects/input/inputWavy.schema.js +11 -0
  254. package/dist/forms/effects/kit.d.ts +213 -0
  255. package/dist/forms/effects/kit.js +226 -0
  256. package/dist/forms/effects/picker/chipPop.d.ts +7 -0
  257. package/dist/forms/effects/picker/chipPop.js +28 -0
  258. package/dist/forms/effects/picker/chipPop.schema.d.ts +1 -0
  259. package/dist/forms/effects/picker/chipPop.schema.js +9 -0
  260. package/dist/forms/effects/picker/listHighlight.d.ts +9 -0
  261. package/dist/forms/effects/picker/listHighlight.js +42 -0
  262. package/dist/forms/effects/picker/listHighlight.schema.d.ts +1 -0
  263. package/dist/forms/effects/picker/listHighlight.schema.js +10 -0
  264. package/dist/forms/effects/picker/listMatch.d.ts +7 -0
  265. package/dist/forms/effects/picker/listMatch.js +21 -0
  266. package/dist/forms/effects/picker/listMatch.schema.d.ts +1 -0
  267. package/dist/forms/effects/picker/listMatch.schema.js +9 -0
  268. package/dist/forms/effects/picker/pickerArrow.d.ts +9 -0
  269. package/dist/forms/effects/picker/pickerArrow.js +17 -0
  270. package/dist/forms/effects/picker/pickerArrow.schema.d.ts +1 -0
  271. package/dist/forms/effects/picker/pickerArrow.schema.js +10 -0
  272. package/dist/forms/effects/picker/pickerCheck.d.ts +7 -0
  273. package/dist/forms/effects/picker/pickerCheck.js +31 -0
  274. package/dist/forms/effects/picker/pickerCheck.schema.d.ts +1 -0
  275. package/dist/forms/effects/picker/pickerCheck.schema.js +9 -0
  276. package/dist/forms/effects/picker/pickerOpen.d.ts +12 -0
  277. package/dist/forms/effects/picker/pickerOpen.js +34 -0
  278. package/dist/forms/effects/picker/pickerOpen.schema.d.ts +1 -0
  279. package/dist/forms/effects/picker/pickerOpen.schema.js +16 -0
  280. package/dist/forms/effects/picker/pickerSheet.d.ts +9 -0
  281. package/dist/forms/effects/picker/pickerSheet.js +47 -0
  282. package/dist/forms/effects/picker/pickerSheet.schema.d.ts +1 -0
  283. package/dist/forms/effects/picker/pickerSheet.schema.js +10 -0
  284. package/dist/forms/effects/picker/pickerStagger.d.ts +9 -0
  285. package/dist/forms/effects/picker/pickerStagger.js +31 -0
  286. package/dist/forms/effects/picker/pickerStagger.schema.d.ts +1 -0
  287. package/dist/forms/effects/picker/pickerStagger.schema.js +10 -0
  288. package/dist/forms/effects/radio/radioCard.d.ts +10 -0
  289. package/dist/forms/effects/radio/radioCard.js +15 -0
  290. package/dist/forms/effects/radio/radioCard.schema.d.ts +1 -0
  291. package/dist/forms/effects/radio/radioCard.schema.js +9 -0
  292. package/dist/forms/effects/radio/radioCircle.d.ts +9 -0
  293. package/dist/forms/effects/radio/radioCircle.js +49 -0
  294. package/dist/forms/effects/radio/radioCircle.schema.d.ts +1 -0
  295. package/dist/forms/effects/radio/radioCircle.schema.js +10 -0
  296. package/dist/forms/effects/radio/radioDot.d.ts +7 -0
  297. package/dist/forms/effects/radio/radioDot.js +10 -0
  298. package/dist/forms/effects/radio/radioDot.schema.d.ts +1 -0
  299. package/dist/forms/effects/radio/radioDot.schema.js +9 -0
  300. package/dist/forms/effects/radio/radioEmoji.d.ts +9 -0
  301. package/dist/forms/effects/radio/radioEmoji.js +94 -0
  302. package/dist/forms/effects/radio/radioEmoji.schema.d.ts +1 -0
  303. package/dist/forms/effects/radio/radioEmoji.schema.js +10 -0
  304. package/dist/forms/effects/radio/radioPulse.d.ts +9 -0
  305. package/dist/forms/effects/radio/radioPulse.js +24 -0
  306. package/dist/forms/effects/radio/radioPulse.schema.d.ts +1 -0
  307. package/dist/forms/effects/radio/radioPulse.schema.js +10 -0
  308. package/dist/forms/effects/radio/radioScale.d.ts +9 -0
  309. package/dist/forms/effects/radio/radioScale.js +73 -0
  310. package/dist/forms/effects/radio/radioScale.schema.d.ts +1 -0
  311. package/dist/forms/effects/radio/radioScale.schema.js +10 -0
  312. package/dist/forms/effects/radio/radioSegment.d.ts +7 -0
  313. package/dist/forms/effects/radio/radioSegment.js +52 -0
  314. package/dist/forms/effects/radio/radioSegment.schema.d.ts +1 -0
  315. package/dist/forms/effects/radio/radioSegment.schema.js +9 -0
  316. package/dist/forms/effects/radio/radioStars.d.ts +15 -0
  317. package/dist/forms/effects/radio/radioStars.js +125 -0
  318. package/dist/forms/effects/radio/radioStars.schema.d.ts +1 -0
  319. package/dist/forms/effects/radio/radioStars.schema.js +13 -0
  320. package/dist/forms/effects/radio/radioTravel.d.ts +9 -0
  321. package/dist/forms/effects/radio/radioTravel.js +49 -0
  322. package/dist/forms/effects/radio/radioTravel.schema.d.ts +1 -0
  323. package/dist/forms/effects/radio/radioTravel.schema.js +10 -0
  324. package/dist/forms/effects/radio/radioUnderline.d.ts +9 -0
  325. package/dist/forms/effects/radio/radioUnderline.js +61 -0
  326. package/dist/forms/effects/radio/radioUnderline.schema.d.ts +1 -0
  327. package/dist/forms/effects/radio/radioUnderline.schema.js +10 -0
  328. package/dist/forms/effects/radio/shape.d.ts +13 -0
  329. package/dist/forms/effects/radio/shape.js +61 -0
  330. package/dist/forms/effects/range/rangeBubble.d.ts +9 -0
  331. package/dist/forms/effects/range/rangeBubble.js +54 -0
  332. package/dist/forms/effects/range/rangeBubble.schema.d.ts +1 -0
  333. package/dist/forms/effects/range/rangeBubble.schema.js +10 -0
  334. package/dist/forms/effects/range/rangeElastic.d.ts +9 -0
  335. package/dist/forms/effects/range/rangeElastic.js +101 -0
  336. package/dist/forms/effects/range/rangeElastic.schema.d.ts +1 -0
  337. package/dist/forms/effects/range/rangeElastic.schema.js +10 -0
  338. package/dist/forms/effects/range/rangeFace.d.ts +11 -0
  339. package/dist/forms/effects/range/rangeFace.js +68 -0
  340. package/dist/forms/effects/range/rangeFace.schema.d.ts +1 -0
  341. package/dist/forms/effects/range/rangeFace.schema.js +11 -0
  342. package/dist/forms/effects/range/rangeFill.d.ts +7 -0
  343. package/dist/forms/effects/range/rangeFill.js +29 -0
  344. package/dist/forms/effects/range/rangeFill.schema.d.ts +1 -0
  345. package/dist/forms/effects/range/rangeFill.schema.js +9 -0
  346. package/dist/forms/effects/range/rangeHistogram.d.ts +14 -0
  347. package/dist/forms/effects/range/rangeHistogram.js +65 -0
  348. package/dist/forms/effects/range/rangeHistogram.schema.d.ts +1 -0
  349. package/dist/forms/effects/range/rangeHistogram.schema.js +11 -0
  350. package/dist/forms/effects/range/rangeThumb.d.ts +9 -0
  351. package/dist/forms/effects/range/rangeThumb.js +39 -0
  352. package/dist/forms/effects/range/rangeThumb.schema.d.ts +1 -0
  353. package/dist/forms/effects/range/rangeThumb.schema.js +10 -0
  354. package/dist/forms/effects/range/rangeTicks.d.ts +9 -0
  355. package/dist/forms/effects/range/rangeTicks.js +44 -0
  356. package/dist/forms/effects/range/rangeTicks.schema.d.ts +1 -0
  357. package/dist/forms/effects/range/rangeTicks.schema.js +18 -0
  358. package/dist/forms/effects/ring.d.ts +5 -0
  359. package/dist/forms/effects/ring.js +12 -0
  360. package/dist/forms/effects/step/stepProgress.d.ts +9 -0
  361. package/dist/forms/effects/step/stepProgress.js +35 -0
  362. package/dist/forms/effects/step/stepProgress.schema.d.ts +1 -0
  363. package/dist/forms/effects/step/stepProgress.schema.js +10 -0
  364. package/dist/forms/effects/step/stepSlide.d.ts +9 -0
  365. package/dist/forms/effects/step/stepSlide.js +50 -0
  366. package/dist/forms/effects/step/stepSlide.schema.d.ts +1 -0
  367. package/dist/forms/effects/step/stepSlide.schema.js +10 -0
  368. package/dist/forms/effects/switch/switchBulb.d.ts +9 -0
  369. package/dist/forms/effects/switch/switchBulb.js +70 -0
  370. package/dist/forms/effects/switch/switchBulb.schema.d.ts +1 -0
  371. package/dist/forms/effects/switch/switchBulb.schema.js +10 -0
  372. package/dist/forms/effects/switch/switchDayNight.d.ts +15 -0
  373. package/dist/forms/effects/switch/switchDayNight.js +96 -0
  374. package/dist/forms/effects/switch/switchDayNight.schema.d.ts +1 -0
  375. package/dist/forms/effects/switch/switchDayNight.schema.js +13 -0
  376. package/dist/forms/effects/switch/switchFace.d.ts +7 -0
  377. package/dist/forms/effects/switch/switchFace.js +75 -0
  378. package/dist/forms/effects/switch/switchFace.schema.d.ts +1 -0
  379. package/dist/forms/effects/switch/switchFace.schema.js +9 -0
  380. package/dist/forms/effects/switch/switchFlip.d.ts +7 -0
  381. package/dist/forms/effects/switch/switchFlip.js +45 -0
  382. package/dist/forms/effects/switch/switchFlip.schema.d.ts +1 -0
  383. package/dist/forms/effects/switch/switchFlip.schema.js +9 -0
  384. package/dist/forms/effects/switch/switchGoo.d.ts +7 -0
  385. package/dist/forms/effects/switch/switchGoo.js +95 -0
  386. package/dist/forms/effects/switch/switchGoo.schema.d.ts +1 -0
  387. package/dist/forms/effects/switch/switchGoo.schema.js +9 -0
  388. package/dist/forms/effects/switch/switchIcon.d.ts +9 -0
  389. package/dist/forms/effects/switch/switchIcon.js +63 -0
  390. package/dist/forms/effects/switch/switchIcon.schema.d.ts +1 -0
  391. package/dist/forms/effects/switch/switchIcon.schema.js +10 -0
  392. package/dist/forms/effects/switch/switchLabels.d.ts +11 -0
  393. package/dist/forms/effects/switch/switchLabels.js +55 -0
  394. package/dist/forms/effects/switch/switchLabels.schema.d.ts +1 -0
  395. package/dist/forms/effects/switch/switchLabels.schema.js +11 -0
  396. package/dist/forms/effects/switch/switchMorph.d.ts +9 -0
  397. package/dist/forms/effects/switch/switchMorph.js +22 -0
  398. package/dist/forms/effects/switch/switchMorph.schema.d.ts +1 -0
  399. package/dist/forms/effects/switch/switchMorph.schema.js +10 -0
  400. package/dist/forms/effects/switch/switchNeon.d.ts +11 -0
  401. package/dist/forms/effects/switch/switchNeon.js +53 -0
  402. package/dist/forms/effects/switch/switchNeon.schema.d.ts +1 -0
  403. package/dist/forms/effects/switch/switchNeon.schema.js +11 -0
  404. package/dist/forms/effects/switch/switchSlide.d.ts +7 -0
  405. package/dist/forms/effects/switch/switchSlide.js +11 -0
  406. package/dist/forms/effects/switch/switchSlide.schema.d.ts +1 -0
  407. package/dist/forms/effects/switch/switchSlide.schema.js +9 -0
  408. package/dist/forms/effects/switch/switchStretch.d.ts +9 -0
  409. package/dist/forms/effects/switch/switchStretch.js +21 -0
  410. package/dist/forms/effects/switch/switchStretch.schema.d.ts +1 -0
  411. package/dist/forms/effects/switch/switchStretch.schema.js +10 -0
  412. package/dist/forms/effects/valid/validAsync.d.ts +7 -0
  413. package/dist/forms/effects/valid/validAsync.js +36 -0
  414. package/dist/forms/effects/valid/validAsync.schema.d.ts +1 -0
  415. package/dist/forms/effects/valid/validAsync.schema.js +9 -0
  416. package/dist/forms/effects/valid/validBubble.d.ts +7 -0
  417. package/dist/forms/effects/valid/validBubble.js +61 -0
  418. package/dist/forms/effects/valid/validBubble.schema.d.ts +1 -0
  419. package/dist/forms/effects/valid/validBubble.schema.js +9 -0
  420. package/dist/forms/effects/valid/validCheck.d.ts +9 -0
  421. package/dist/forms/effects/valid/validCheck.js +50 -0
  422. package/dist/forms/effects/valid/validCheck.schema.d.ts +1 -0
  423. package/dist/forms/effects/valid/validCheck.schema.js +10 -0
  424. package/dist/forms/effects/valid/validColor.d.ts +11 -0
  425. package/dist/forms/effects/valid/validColor.js +28 -0
  426. package/dist/forms/effects/valid/validColor.schema.d.ts +1 -0
  427. package/dist/forms/effects/valid/validColor.schema.js +11 -0
  428. package/dist/forms/effects/valid/validFlash.d.ts +9 -0
  429. package/dist/forms/effects/valid/validFlash.js +36 -0
  430. package/dist/forms/effects/valid/validFlash.schema.d.ts +1 -0
  431. package/dist/forms/effects/valid/validFlash.schema.js +10 -0
  432. package/dist/forms/effects/valid/validMessage.d.ts +7 -0
  433. package/dist/forms/effects/valid/validMessage.js +24 -0
  434. package/dist/forms/effects/valid/validMessage.schema.d.ts +1 -0
  435. package/dist/forms/effects/valid/validMessage.schema.js +9 -0
  436. package/dist/forms/effects/valid/validShake.d.ts +9 -0
  437. package/dist/forms/effects/valid/validShake.js +37 -0
  438. package/dist/forms/effects/valid/validShake.schema.d.ts +1 -0
  439. package/dist/forms/effects/valid/validShake.schema.js +10 -0
  440. package/dist/forms/effects/valid/validSwap.d.ts +7 -0
  441. package/dist/forms/effects/valid/validSwap.js +33 -0
  442. package/dist/forms/effects/valid/validSwap.schema.d.ts +1 -0
  443. package/dist/forms/effects/valid/validSwap.schema.js +9 -0
  444. package/dist/forms/errors.d.ts +12 -0
  445. package/dist/forms/errors.js +20 -0
  446. package/dist/forms/file.d.ts +1 -0
  447. package/dist/forms/file.js +268 -0
  448. package/dist/forms/files.d.ts +7 -0
  449. package/dist/forms/files.js +29 -0
  450. package/dist/forms/formSteps.d.ts +9 -0
  451. package/dist/forms/formSteps.js +6 -0
  452. package/dist/forms/ids.d.ts +17 -0
  453. package/dist/forms/ids.js +13 -0
  454. package/dist/forms/inline.d.ts +3 -0
  455. package/dist/forms/inline.js +128 -0
  456. package/dist/forms/number.d.ts +1 -0
  457. package/dist/forms/number.js +67 -0
  458. package/dist/forms/otp.d.ts +4 -0
  459. package/dist/forms/otp.js +171 -0
  460. package/dist/forms/picker.d.ts +1 -0
  461. package/dist/forms/picker.js +303 -0
  462. package/dist/forms/range.d.ts +3 -0
  463. package/dist/forms/range.js +223 -0
  464. package/dist/forms/registry.d.ts +4 -0
  465. package/dist/forms/registry.js +133 -0
  466. package/dist/forms/reveal.d.ts +6 -0
  467. package/dist/forms/reveal.js +51 -0
  468. package/dist/forms/runtime/focus.d.ts +16 -0
  469. package/dist/forms/runtime/focus.js +55 -0
  470. package/dist/forms/runtime/listMatch.d.ts +2 -0
  471. package/dist/forms/runtime/listMatch.js +33 -0
  472. package/dist/forms/runtime/origin.d.ts +10 -0
  473. package/dist/forms/runtime/origin.js +25 -0
  474. package/dist/forms/runtime/placePopup.d.ts +10 -0
  475. package/dist/forms/runtime/placePopup.js +55 -0
  476. package/dist/forms/runtime/useFlip.d.ts +7 -0
  477. package/dist/forms/runtime/useFlip.js +38 -0
  478. package/dist/forms/runtime/useMorph.d.ts +8 -0
  479. package/dist/forms/runtime/useMorph.js +56 -0
  480. package/dist/forms/runtime/useOffScreen.d.ts +3 -0
  481. package/dist/forms/runtime/useOffScreen.js +16 -0
  482. package/dist/forms/runtime/useSwitchDrag.d.ts +8 -0
  483. package/dist/forms/runtime/useSwitchDrag.js +83 -0
  484. package/dist/forms/runtime/vanish.d.ts +6 -0
  485. package/dist/forms/runtime/vanish.js +185 -0
  486. package/dist/forms/steps.d.ts +1 -0
  487. package/dist/forms/steps.js +149 -0
  488. package/dist/forms/swap.d.ts +7 -0
  489. package/dist/forms/swap.js +149 -0
  490. package/dist/forms/switch.d.ts +1 -0
  491. package/dist/forms/switch.js +99 -0
  492. package/dist/forms/tools.d.ts +3 -0
  493. package/dist/forms/tools.js +248 -0
  494. package/dist/forms/types.d.ts +161 -0
  495. package/dist/forms/types.js +5 -0
  496. package/dist/index.d.ts +234 -0
  497. package/dist/index.js +119 -0
  498. package/dist/schema/forms.d.ts +3 -0
  499. package/dist/schema/forms.js +194 -0
  500. package/dist/schema/index.d.ts +2 -1
  501. package/dist/schema/index.js +3 -1
  502. package/dist/schema/types.d.ts +2 -2
  503. package/dist/schema/types.js +1 -0
  504. package/guides/README.md +62 -61
  505. package/guides/contact.md +100 -77
  506. package/guides/forms.md +105 -0
  507. package/package.json +1 -1
  508. package/styles/form.css +594 -0
  509. package/theme.css +6 -1
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { styleHref } from "../../backgrounds/hosts/styleHref.js";
3
+ import { motionOnly } from "../../transitions/progress.js";
4
+ import { SPRING } from "../effects/kit.js";
5
+ const PART = "data-sx-rule-part";
6
+ const CSS = `@layer components {
7
+ :where([data-sx-password-rules]) {
8
+ position: relative;
9
+ }
10
+ :where([data-sx-password-rules] ul) {
11
+ display: grid;
12
+ gap: 0.25rem;
13
+ margin: 0;
14
+ padding: 0;
15
+ list-style: none;
16
+ }
17
+ :where([data-sx-password-rules] li) {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 0.5rem;
21
+ }
22
+ :where([data-sx-password-rules] svg) {
23
+ flex: none;
24
+ inline-size: 1em;
25
+ block-size: 1em;
26
+ overflow: visible;
27
+ fill: none;
28
+ stroke: currentColor;
29
+ stroke-width: 2.5;
30
+ stroke-linecap: round;
31
+ stroke-linejoin: round;
32
+ }
33
+ :where([${PART}]) {
34
+ transform-box: fill-box;
35
+ transform-origin: center;
36
+ }
37
+ :where([${PART}="check"]) {
38
+ stroke-dasharray: 1 2;
39
+ stroke-dashoffset: 1.01;
40
+ }
41
+ :where([data-sx-met] [${PART}="check"]) {
42
+ stroke-dashoffset: 0;
43
+ }
44
+ :where([data-sx-met] [${PART}="dot"]) {
45
+ opacity: 0;
46
+ scale: 0;
47
+ }
48
+ :where([data-sx-rules-sr]) {
49
+ position: absolute;
50
+ inline-size: 1px;
51
+ block-size: 1px;
52
+ overflow: hidden;
53
+ clip-path: inset(50%);
54
+ white-space: nowrap;
55
+ }
56
+ }`;
57
+ const MOTION = `@layer components {
58
+ :where([${PART}="check"]) {
59
+ transition: stroke-dashoffset 250ms ease-out;
60
+ }
61
+ :where([${PART}="dot"]) {
62
+ transition: opacity 150ms ease-out, scale 150ms ease-out;
63
+ }
64
+ :where([data-sx-met] svg) {
65
+ animation: sx-form-rule-pop 350ms ${SPRING};
66
+ }
67
+ @keyframes sx-form-rule-pop {
68
+ 0% { scale: 0.7; }
69
+ 100% { scale: 1; }
70
+ }
71
+ }`;
72
+ const fill = (s, met, total) => s.replace("{met}", String(met)).replace("{total}", String(total));
73
+ /**
74
+ * The rules a new password must meet, each ticking off as it is met: a dot turns into a check that draws in. Screen
75
+ * readers hear "done" or "not yet" on each rule, and a count when it changes. Your app checks the rules.
76
+ *
77
+ * ```tsx
78
+ * <PasswordRules id="pw-rules" rules={[{ label: "8 characters or more", met: pw.length >= 8 }]} />
79
+ * <Field type="password" aria-describedby="pw-rules" … />
80
+ * ```
81
+ */
82
+ export function PasswordRules({ rules, id, labels, className, unstyled }) {
83
+ const met = rules.filter((r) => r.met).length;
84
+ return (_jsxs(_Fragment, { children: [_jsx("style", { href: styleHref("form-rules", CSS), precedence: "sx", children: CSS }), _jsx("style", { href: styleHref("form-rules-motion", MOTION), precedence: "sx", children: motionOnly(MOTION) }), _jsxs("div", { id: id, "data-sx-password-rules": "", "data-sx-styled": unstyled ? undefined : "", className: className, children: [_jsx("ul", { children: rules.map((rule, i) => (_jsxs("li", { "data-sx-met": rule.met ? "" : undefined, children: [_jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": true, focusable: "false", children: [_jsx("circle", { [PART]: "dot", cx: "8", cy: "8", r: "2" }), _jsx("path", { [PART]: "check", d: "m3 8.5 3 3 7-7", pathLength: 1 })] }), _jsx("span", { children: rule.label }), _jsx("span", { "data-sx-rules-sr": "", children: rule.met ? (labels?.met ?? "done") : (labels?.unmet ?? "not yet") })] }, i))) }), _jsx("span", { "data-sx-rules-sr": "", role: "status", children: fill(labels?.progress ?? "{met} of {total} requirements met", met, rules.length) })] })] }));
85
+ }
@@ -0,0 +1,69 @@
1
+ import { type ComponentPropsWithRef, type CSSProperties, type ReactNode } from "react";
2
+ import type { FormEffect } from "../types.js";
3
+ /** One choice of a group. */
4
+ export interface RadioOption {
5
+ readonly value: string;
6
+ /** Its words. A star or a face shows them to screen readers only. */
7
+ readonly label: ReactNode;
8
+ /** Help under the words (a card shows it inside). */
9
+ readonly description?: ReactNode;
10
+ readonly disabled?: boolean;
11
+ }
12
+ interface RadioGroupOwnProps {
13
+ /** The group's question: a real `<legend>`. */
14
+ readonly label?: ReactNode;
15
+ /** Help under the question, read with the group. */
16
+ readonly description?: ReactNode;
17
+ /** The error message. While set, every radio is `aria-invalid` and the group points at the message. */
18
+ readonly error?: ReactNode;
19
+ /** Invalid with no message of its own. */
20
+ readonly invalid?: boolean;
21
+ /** The choices. Or put `<Radio>` elements inside instead. */
22
+ readonly options?: readonly RadioOption[];
23
+ readonly children?: ReactNode;
24
+ /** The chosen value, when you hold it (with `onChange` or `onValueChange`). */
25
+ readonly value?: string;
26
+ /** The value chosen at first, when the browser holds it. */
27
+ readonly defaultValue?: string;
28
+ /** Called with the new value. */
29
+ readonly onValueChange?: (value: string) => void;
30
+ /** Default `"vertical"`. */
31
+ readonly orientation?: "vertical" | "horizontal";
32
+ /** One effect or a list; they stack. Radio effects dress the whole group: each option, and a track behind them. */
33
+ readonly effect?: FormEffect | readonly FormEffect[];
34
+ /** The browser's own radios, coloured with `accent-color`. Effects don't apply. */
35
+ readonly native?: boolean;
36
+ /** Drop the default look. */
37
+ readonly unstyled?: boolean;
38
+ /** Goes on the options' box. */
39
+ readonly className?: string;
40
+ /** Goes on the `<fieldset>`. */
41
+ readonly rootClassName?: string;
42
+ /** Goes on the `<legend>`. */
43
+ readonly labelClassName?: string;
44
+ /** Goes on the `<fieldset>`, beside the effects' variables. */
45
+ readonly style?: CSSProperties;
46
+ }
47
+ /**
48
+ * Every other prop goes on each radio, `ref` included: `name`, `onChange`, `onBlur`, `required`, `disabled`, so
49
+ * `{...register("plan")}` from React Hook Form spreads onto all of them (it groups radios by name).
50
+ */
51
+ export type RadioGroupProps = RadioGroupOwnProps & Omit<ComponentPropsWithRef<"input">, keyof RadioGroupOwnProps | "type" | "checked" | "defaultChecked">;
52
+ export interface RadioProps extends Omit<RadioOption, "value"> {
53
+ readonly value: string;
54
+ /** Set by the group: the option's place, for effects that stagger or count (`--sx-choice-i`). */
55
+ readonly index?: number;
56
+ }
57
+ /** One radio of a `RadioGroup`, for a layout of your own. Outside a group it renders nothing. */
58
+ export declare function Radio({ value, label, description, disabled, index }: RadioProps): import("react").JSX.Element | null;
59
+ /**
60
+ * A group of radios in a real `<fieldset>`, its question a `<legend>`. The radios share one name, so the browser moves
61
+ * between them with the arrow keys and submits the chosen one. Effects dress the options (a dot, a card, a star, a
62
+ * face) and the group (a sliding segment, a tab underline, a travelling dot).
63
+ *
64
+ * ```tsx
65
+ * <RadioGroup label="Plan" options={plans} effect={radioSegment()} {...register("plan")} />
66
+ * ```
67
+ */
68
+ export declare function RadioGroup(props: RadioGroupProps): import("react").JSX.Element;
69
+ export {};
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Children, cloneElement, createContext, isValidElement, useContext, useId, useRef, } from "react";
4
+ import { CHOICE_BASE_CSS } from "../choice.js";
5
+ import { fieldDescribedBy, fieldIds } from "../ids.js";
6
+ import { checkChoice } from "./choiceChecks.js";
7
+ import { ChoiceItem, EffectSheets, choiceLayers, usePrograms } from "./choiceParts.js";
8
+ import { effectList, filled, withUid } from "./shared.js";
9
+ const RadioContext = createContext(null);
10
+ /** One radio of a `RadioGroup`, for a layout of your own. Outside a group it renders nothing. */
11
+ export function Radio({ value, label, description, disabled, index = 0 }) {
12
+ const group = useContext(RadioContext);
13
+ if (!group)
14
+ return null;
15
+ const id = `${group.idBase}-${index}`;
16
+ const onChange = group.shared.onChange;
17
+ return (_jsx(ChoiceItem, { kind: "radio", effects: group.effects, uid: group.uid, label: label, description: description, descriptionId: filled(description) ? `${id}-description` : undefined, root: {
18
+ "data-sx-choice": "",
19
+ "data-sx-kind": "radio",
20
+ "data-sx-styled": group.unstyled ? undefined : "",
21
+ "data-sx-native": group.native ? "" : undefined,
22
+ style: { "--sx-choice-i": index },
23
+ }, control: {
24
+ ...group.shared,
25
+ id,
26
+ type: "radio",
27
+ name: group.name,
28
+ value,
29
+ disabled: disabled || group.shared.disabled,
30
+ ...(group.value === undefined ? { defaultChecked: group.defaultValue === undefined ? undefined : group.defaultValue === value } : { checked: group.value === value }),
31
+ onChange,
32
+ "aria-invalid": group.invalid || undefined,
33
+ "aria-describedby": filled(description) ? `${id}-description` : undefined,
34
+ } }));
35
+ }
36
+ /**
37
+ * A group of radios in a real `<fieldset>`, its question a `<legend>`. The radios share one name, so the browser moves
38
+ * between them with the arrow keys and submits the chosen one. Effects dress the options (a dot, a card, a star, a
39
+ * face) and the group (a sliding segment, a tab underline, a travelling dot).
40
+ *
41
+ * ```tsx
42
+ * <RadioGroup label="Plan" options={plans} effect={radioSegment()} {...register("plan")} />
43
+ * ```
44
+ */
45
+ export function RadioGroup(props) {
46
+ const { label, description, error, invalid, options, children, value, defaultValue, onValueChange, orientation = "vertical", effect, native, unstyled, className, rootClassName, labelClassName, style, id: ownId, ...rest } = props;
47
+ const effects = native ? [] : effectList(effect);
48
+ const auto = useId().replace(/[^\w-]/g, "");
49
+ const idBase = ownId ?? `sx-radios${auto}`;
50
+ const uid = `sx${auto}`;
51
+ const ids = fieldIds(idBase);
52
+ const hasError = filled(error);
53
+ const isInvalid = hasError || invalid === true;
54
+ const describedBy = fieldDescribedBy(ids, { error: hasError, description: filled(description), own: rest["aria-describedby"] });
55
+ if (process.env.NODE_ENV !== "production") {
56
+ checkChoice({
57
+ control: "radio",
58
+ effects,
59
+ labelled: filled(label) || !!rest["aria-label"] || !!rest["aria-labelledby"],
60
+ nativeWithEffects: !!native && !!effect && effectList(effect).length > 0,
61
+ invalidWithoutWords: invalid === true && !hasError,
62
+ });
63
+ }
64
+ const root = useRef(null);
65
+ usePrograms(root, effects);
66
+ const { "aria-describedby": _own, "aria-label": groupLabel, "aria-labelledby": groupLabelledBy, ...shared } = rest;
67
+ const ownChange = shared.onChange;
68
+ const context = {
69
+ name: shared.name ?? `sx-radios${auto}`,
70
+ effects,
71
+ uid,
72
+ idBase,
73
+ value,
74
+ defaultValue,
75
+ invalid: isInvalid,
76
+ unstyled,
77
+ native,
78
+ shared: {
79
+ ...shared,
80
+ onChange: (e) => {
81
+ ownChange?.(e);
82
+ onValueChange?.(e.target.value);
83
+ },
84
+ },
85
+ };
86
+ const items = options
87
+ ? options.map((o, i) => _jsx(Radio, { ...o, index: i }, o.value))
88
+ : Children.toArray(children).map((child, i) => isValidElement(child) ? cloneElement(child, { index: i }) : child);
89
+ const vars = {
90
+ "--sx-radios-n": items.length,
91
+ ...withUid(Object.assign({}, ...effects.map((e) => e.vars)), uid),
92
+ ...style,
93
+ };
94
+ return (_jsxs(_Fragment, { children: [_jsx(EffectSheets, { name: "form-choice", base: CHOICE_BASE_CSS, effects: effects }), _jsxs("fieldset", { ref: root, id: idBase, "data-sx-radios": effects.map((e) => e.id).join(" "), "data-sx-group": "radio", "data-sx-styled": unstyled ? undefined : "", "data-sx-orientation": orientation, "aria-describedby": describedBy, "aria-label": groupLabel, "aria-labelledby": groupLabelledBy, className: rootClassName, style: vars, children: [filled(label) ? (_jsx("legend", { "data-sx-group-legend": "", className: labelClassName, children: label })) : null, filled(description) ? (_jsx("p", { "data-sx-group-description": "", id: ids.description, children: description })) : null, _jsxs("div", { "data-sx-group-options": "", className: className, children: [choiceLayers(effects, "track", uid), _jsx(RadioContext, { value: context, children: items })] }), _jsx("div", { "data-sx-choice-message": "", children: _jsx("p", { "data-sx-choice-error": "", id: ids.error, role: "alert", children: hasError ? (_jsx("span", { "data-sx-choice-says": "", children: error }, typeof error === "string" ? error : undefined)) : null }) })] })] }));
95
+ }
@@ -0,0 +1,60 @@
1
+ import { type ComponentPropsWithRef, type CSSProperties, type ReactNode } from "react";
2
+ import type { FormEffect } from "../types.js";
3
+ type Value = number | readonly [number, number];
4
+ /** The words a Range says, for your language: the two thumbs' names. */
5
+ export interface RangeLabels {
6
+ readonly min?: string;
7
+ readonly max?: string;
8
+ }
9
+ interface RangeOwnProps {
10
+ /** The visible label. */
11
+ readonly label?: ReactNode;
12
+ readonly description?: ReactNode;
13
+ /** The error message, with `aria-invalid` and a `role="alert"` region. */
14
+ readonly error?: ReactNode;
15
+ readonly invalid?: boolean;
16
+ /** The value: a number, or `[low, high]` for two thumbs. Held by you, with `onValueChange`. */
17
+ readonly value?: Value;
18
+ /** The first value, when the browser holds it: a number, or `[low, high]` for two thumbs. */
19
+ readonly defaultValue?: Value;
20
+ /** Called with the new value (a pair with two thumbs) as it moves: fits React Hook Form's `Controller`. */
21
+ readonly onValueChange?: (value: number | [number, number]) => void;
22
+ /** Numbers, or number strings as React Hook Form's `register()` passes them. */
23
+ readonly min?: number | string;
24
+ readonly max?: number | string;
25
+ readonly step?: number | string;
26
+ /** `"vertical"` stands it upright, the lowest value at the bottom. Its height: `--sx-range-length` (10rem). */
27
+ readonly orientation?: "horizontal" | "vertical";
28
+ /** Shows the value beside the label, as an `<output>`. */
29
+ readonly showValue?: boolean;
30
+ /** How the value reads, on screen and to a screen reader (`aria-valuetext`): `Intl.NumberFormat` options. */
31
+ readonly format?: Intl.NumberFormatOptions;
32
+ /** The locale for the numbers. Default the visitor's. */
33
+ readonly locale?: string;
34
+ /** One effect or a list; they stack. */
35
+ readonly effect?: FormEffect | readonly FormEffect[];
36
+ readonly labels?: RangeLabels;
37
+ readonly unstyled?: boolean;
38
+ /** Goes on the box with the rail and thumbs. */
39
+ readonly className?: string;
40
+ readonly rootClassName?: string;
41
+ readonly labelClassName?: string;
42
+ readonly style?: CSSProperties;
43
+ }
44
+ /**
45
+ * Every other prop goes on the real range input (the low one with two thumbs): `name`, `disabled`, `onChange`, `ref`, so
46
+ * `{...register("volume", { valueAsNumber: true })}` spreads onto a one-thumb Range.
47
+ */
48
+ export type RangeProps = RangeOwnProps & Omit<ComponentPropsWithRef<"input">, keyof RangeOwnProps | "type" | "children">;
49
+ /**
50
+ * A slider on the browser's own range input: it takes the keys, the screen reader, a phone's drag and a plain form
51
+ * submit, at opacity 0 over a drawn rail and thumb that effects paint. One thumb, or two (`value={[20, 80]}`), each its
52
+ * own input with its own name to a screen reader; upright with `orientation="vertical"`.
53
+ *
54
+ * ```tsx
55
+ * <Range label="Volume" defaultValue={40} effect={[rangeFill(), rangeBubble()]} {...register("volume", { valueAsNumber: true })} />
56
+ * <Range label="Price" min={0} max={500} value={price} onValueChange={setPrice} format={{ style: "currency", currency: "EUR" }} />
57
+ * ```
58
+ */
59
+ export declare function Range(props: RangeProps): import("react").JSX.Element;
60
+ export {};
@@ -0,0 +1,169 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useEffect, useId, useMemo, useRef, useState, } from "react";
4
+ import { fieldDescribedBy, fieldIds } from "../ids.js";
5
+ import { RANGE_BASE_CSS, autoTicks } from "../range.js";
6
+ import { EffectSheets, choiceLayers, usePrograms } from "./choiceParts.js";
7
+ import { checkRange } from "./rangeChecks.js";
8
+ import { effectList, filled, withUid } from "./shared.js";
9
+ const WORDS = { min: "Minimum", max: "Maximum" };
10
+ const pair = (v, min, max) => v === undefined ? [min, max] : typeof v === "number" ? [v, v] : [v[0], v[1]];
11
+ const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
12
+ /**
13
+ * A slider on the browser's own range input: it takes the keys, the screen reader, a phone's drag and a plain form
14
+ * submit, at opacity 0 over a drawn rail and thumb that effects paint. One thumb, or two (`value={[20, 80]}`), each its
15
+ * own input with its own name to a screen reader; upright with `orientation="vertical"`.
16
+ *
17
+ * ```tsx
18
+ * <Range label="Volume" defaultValue={40} effect={[rangeFill(), rangeBubble()]} {...register("volume", { valueAsNumber: true })} />
19
+ * <Range label="Price" min={0} max={500} value={price} onValueChange={setPrice} format={{ style: "currency", currency: "EUR" }} />
20
+ * ```
21
+ */
22
+ export function Range(props) {
23
+ const { label, description, error, invalid, value, defaultValue, onValueChange, min: rawMin = 0, max: rawMax = 100, step: rawStep = 1, orientation, showValue, format, locale, effect, labels, unstyled, className, rootClassName, labelClassName, style, id: ownId, ...rest } = props;
24
+ const effects = effectList(effect);
25
+ const words = { ...WORDS, ...labels };
26
+ const min = Number(rawMin);
27
+ const max = Number(rawMax);
28
+ const step = Number(rawStep);
29
+ const auto = useId().replace(/[^\w-]/g, "");
30
+ const id = ownId ?? `sx-range${auto}`;
31
+ const uid = `sx${auto}`;
32
+ const ids = fieldIds(id);
33
+ const dual = Array.isArray(value ?? defaultValue);
34
+ const vertical = orientation === "vertical";
35
+ const hasError = filled(error);
36
+ const isInvalid = hasError || invalid === true || rest["aria-invalid"] === true || rest["aria-invalid"] === "true";
37
+ const describedBy = fieldDescribedBy(ids, { error: hasError, description: filled(description), own: rest["aria-describedby"] });
38
+ if (process.env.NODE_ENV !== "production") {
39
+ checkRange({ effects, labelled: filled(label) || !!rest["aria-label"] || !!rest["aria-labelledby"], min, max, step, vertical, dual });
40
+ }
41
+ const controlled = value !== undefined;
42
+ // like the browser's own: one thumb starts in the middle, two at the ends
43
+ const [held, setHeld] = useState(() => pair(defaultValue, min + (max - min) / 2, min + (max - min) / 2));
44
+ const [lo, hi] = controlled ? pair(value, min, max) : held;
45
+ const [dragging, setDragging] = useState(null);
46
+ const root = useRef(null);
47
+ const box = useRef(null);
48
+ const inputs = useRef([null, null]);
49
+ usePrograms(root, effects);
50
+ const span = max - min || 1;
51
+ const at = (n) => clamp((n - min) / span, 0, 1);
52
+ const formatter = useMemo(() => {
53
+ if (!format && !locale)
54
+ return null;
55
+ try {
56
+ return new Intl.NumberFormat(locale, format);
57
+ }
58
+ catch {
59
+ // options the browser doesn't know (a unit it lacks): plain digits rather than a broken page
60
+ return null;
61
+ }
62
+ }, [JSON.stringify(format), locale]); // eslint-disable-line react-hooks/exhaustive-deps
63
+ const fmt = (n) => (formatter ? formatter.format(n) : String(n));
64
+ const commit = (next) => {
65
+ if (!controlled)
66
+ setHeld(next);
67
+ onValueChange?.(dual ? next : next[0]);
68
+ };
69
+ const moved = (which) => (e) => {
70
+ const n = Number(e.target.value);
71
+ // two thumbs never cross: the moving one stops at the other
72
+ const next = which === 0 ? [dual ? Math.min(n, hi) : n, dual ? hi : n] : [lo, Math.max(n, lo)];
73
+ if (dual && next[which] !== n)
74
+ e.target.value = String(next[which]);
75
+ commit(next);
76
+ if (which === 0)
77
+ rest.onChange?.(e);
78
+ };
79
+ // after a form reset (or a value React Hook Form set on the input), read the inputs again
80
+ useEffect(() => {
81
+ const form = inputs.current[0]?.form;
82
+ if (!form || controlled)
83
+ return;
84
+ const read = () => setTimeout(() => {
85
+ const [a, b] = inputs.current;
86
+ if (a)
87
+ setHeld([Number(a.value), b ? Number(b.value) : Number(a.value)]);
88
+ });
89
+ form.addEventListener("reset", read);
90
+ return () => form.removeEventListener("reset", read);
91
+ }, [controlled]);
92
+ // a drag ends wherever the pointer is let go
93
+ useEffect(() => {
94
+ if (!dragging)
95
+ return;
96
+ const stop = () => setDragging(null);
97
+ addEventListener("pointerup", stop);
98
+ addEventListener("pointercancel", stop);
99
+ return () => {
100
+ removeEventListener("pointerup", stop);
101
+ removeEventListener("pointercancel", stop);
102
+ };
103
+ }, [dragging]);
104
+ // two thumbs: a press on the rail moves the nearer thumb there, and a drag carries it on
105
+ const fromPointer = (e) => {
106
+ const r = box.current.getBoundingClientRect();
107
+ const thumb = box.current.querySelector("[data-sx-range-thumb]")?.offsetWidth ?? 0;
108
+ const room = (vertical ? r.height : r.width) - thumb;
109
+ const along = vertical ? r.bottom - e.clientY : getComputedStyle(box.current).direction === "rtl" ? r.right - e.clientX : e.clientX - r.left;
110
+ const raw = min + clamp((along - thumb / 2) / (room || 1), 0, 1) * span;
111
+ return clamp(Math.round((raw - min) / step) * step + min, min, max);
112
+ };
113
+ const setInput = (which, n) => {
114
+ const el = inputs.current[which];
115
+ if (!el || Number(el.value) === n)
116
+ return;
117
+ const set = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
118
+ set?.call(el, String(n));
119
+ el.dispatchEvent(new Event("input", { bubbles: true }));
120
+ el.dispatchEvent(new Event("change", { bubbles: true }));
121
+ };
122
+ const railDown = (e) => {
123
+ if (!dual || e.button !== 0 || e.target.matches("input") || inputs.current[0]?.disabled)
124
+ return;
125
+ const n = fromPointer(e);
126
+ const which = Math.abs(n - lo) < Math.abs(n - hi) || (n < lo && lo === hi) ? 0 : 1;
127
+ e.preventDefault();
128
+ box.current.setPointerCapture(e.pointerId);
129
+ inputs.current[which]?.focus();
130
+ setDragging(which === 0 ? "a" : "b");
131
+ setInput(which, n);
132
+ const move = (ev) => setInput(which, fromPointer(ev));
133
+ const up = () => {
134
+ box.current?.removeEventListener("pointermove", move);
135
+ box.current?.removeEventListener("pointerup", up);
136
+ };
137
+ box.current.addEventListener("pointermove", move);
138
+ box.current.addEventListener("pointerup", up);
139
+ };
140
+ const setRef = (which) => (el) => {
141
+ inputs.current[which] = el;
142
+ if (which !== 0)
143
+ return;
144
+ const ref = rest.ref;
145
+ if (typeof ref === "function")
146
+ ref(el);
147
+ else if (ref)
148
+ ref.current = el;
149
+ };
150
+ const { ref: _ref, onChange: _onChange, ...own } = rest;
151
+ void _ref;
152
+ void _onChange;
153
+ const steps = (max - min) / step;
154
+ const vars = {
155
+ "--sx-range-from": dual ? at(lo) : 0,
156
+ "--sx-range-to": at(hi),
157
+ "--sx-range-steps": Math.round(steps),
158
+ "--sx-range-ticks": autoTicks(steps),
159
+ ...withUid(Object.assign({}, ...effects.map((e) => e.vars)), uid),
160
+ ...style,
161
+ };
162
+ const named = filled(label);
163
+ const thumbs = dual ? ["a", "b"] : ["a"];
164
+ return (_jsxs(_Fragment, { children: [_jsx(EffectSheets, { name: "form-range", base: RANGE_BASE_CSS, effects: effects }), _jsxs("div", { ref: root, "data-sx-range": effects.map((e) => e.id).join(" "), "data-sx-kind": "range", "data-sx-styled": unstyled ? undefined : "", "data-sx-dual": dual ? "" : undefined, "data-sx-vertical": vertical ? "" : undefined, "data-sx-dragging": dragging ?? undefined, "data-sx-top": dual && lo === hi && lo > min + span / 2 ? "a" : undefined, role: dual ? "group" : undefined, "aria-labelledby": dual && named ? ids.label : undefined, className: rootClassName, style: vars, children: [named || showValue ? (_jsxs("div", { "data-sx-range-head": "", children: [named ? (dual ? (_jsx("span", { "data-sx-range-label": "", id: ids.label, className: labelClassName, children: label })) : (_jsx("label", { "data-sx-range-label": "", id: ids.label, htmlFor: id, className: labelClassName, children: label }))) : null, showValue ? (_jsx("output", { "data-sx-range-output": "", htmlFor: dual ? `${id} ${id}-b` : id, "aria-live": "off", children: dual ? `${fmt(lo)} – ${fmt(hi)}` : fmt(lo) })) : null] })) : null, _jsxs("div", { ref: box, "data-sx-range-box": "", className: className, onPointerDown: railDown, children: [_jsx("span", { "data-sx-range-track": "", "aria-hidden": true, children: choiceLayers(effects, "track", uid) }), thumbs.map((t) => (_jsxs("span", { "data-sx-range-thumb": "", "data-sx-thumb": t, "aria-hidden": true, style: { "--sx-at": at(t === "a" ? lo : hi) }, children: [_jsx("span", { "data-sx-range-says": "", children: fmt(t === "a" ? lo : hi) }), choiceLayers(effects, "thumb", uid)] }, t))), thumbs.map((t, i) => {
165
+ const n = t === "a" ? lo : hi;
166
+ const which = i;
167
+ return (_jsx("input", { ...own, ...(controlled ? { value: n } : { defaultValue: n }), ref: setRef(which), id: t === "a" ? id : `${id}-b`, type: "range", min: min, max: max, step: step, "data-sx-range-control": "", "data-sx-thumb": t, "aria-orientation": vertical ? "vertical" : undefined, "aria-valuetext": formatter ? fmt(n) : undefined, "aria-labelledby": dual ? [named ? ids.label : "", `${id}-${t}-name`].filter(Boolean).join(" ") : own["aria-labelledby"], "aria-invalid": isInvalid || undefined, "aria-describedby": describedBy, onChange: moved(which), onPointerDown: () => setDragging(t) }, t));
168
+ }), dual ? (_jsxs(_Fragment, { children: [_jsx("span", { "data-sx-range-name": "", id: `${id}-a-name`, children: words.min }), _jsx("span", { "data-sx-range-name": "", id: `${id}-b-name`, children: words.max })] })) : null] }), filled(description) ? (_jsx("p", { "data-sx-range-description": "", id: ids.description, children: description })) : null, _jsx("div", { "data-sx-range-message": "", children: _jsx("p", { "data-sx-range-error": "", id: ids.error, role: "alert", children: hasError ? (_jsx("span", { "data-sx-range-says-error": "", children: error }, typeof error === "string" ? error : undefined)) : null }) })] })] }));
169
+ }
@@ -0,0 +1,25 @@
1
+ /** Where an autosave stands. */
2
+ export type SaveState = "idle" | "saving" | "saved" | "error";
3
+ export interface SaveStatusProps {
4
+ /** Where it stands. `"idle"` shows nothing (the live region stays, so the next change is read out). */
5
+ readonly state: SaveState;
6
+ /** The words, for your language. Default "Saving…", "Saved", "Couldn't save". */
7
+ readonly labels?: {
8
+ readonly saving?: string;
9
+ readonly saved?: string;
10
+ readonly error?: string;
11
+ };
12
+ /** Goes on the status. */
13
+ readonly className?: string;
14
+ /** Drop the default look. */
15
+ readonly unstyled?: boolean;
16
+ }
17
+ /**
18
+ * An autosave's status: a spinner and "Saving…", then a check that draws in and "Saved" (or a cross and "Couldn't
19
+ * save"). A live region, so screen readers hear each change. Your app sets `state`.
20
+ *
21
+ * ```tsx
22
+ * <SaveStatus state={saving ? "saving" : saved ? "saved" : "idle"} />
23
+ * ```
24
+ */
25
+ export declare function SaveStatus({ state, labels, className, unstyled }: SaveStatusProps): import("react").JSX.Element;
@@ -0,0 +1,88 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { styleHref } from "../../backgrounds/hosts/styleHref.js";
3
+ import { motionOnly } from "../../transitions/progress.js";
4
+ import { SPRING } from "../effects/kit.js";
5
+ const PART = "data-sx-save-part";
6
+ const CSS = `@layer components {
7
+ :where([data-sx-save]) {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ gap: 0.375rem;
11
+ min-block-size: 1.5rem;
12
+ }
13
+ :where([data-sx-save="idle"] > svg) {
14
+ visibility: hidden;
15
+ }
16
+ :where([data-sx-save] > svg) {
17
+ flex: none;
18
+ inline-size: 1.125em;
19
+ block-size: 1.125em;
20
+ overflow: visible;
21
+ fill: none;
22
+ stroke: currentColor;
23
+ stroke-width: 2;
24
+ stroke-linecap: round;
25
+ stroke-linejoin: round;
26
+ }
27
+ :where([${PART}]) {
28
+ stroke-dasharray: 1 2;
29
+ stroke-dashoffset: 1.01;
30
+ transform-box: fill-box;
31
+ transform-origin: center;
32
+ }
33
+ :where([${PART}="ring"]) {
34
+ rotate: -90deg;
35
+ }
36
+ :where([data-sx-save="saving"] [${PART}="ring"]) {
37
+ stroke-dashoffset: 0.7;
38
+ }
39
+ :where([data-sx-save="saved"] [${PART}="check"], [data-sx-save="error"] [${PART}="cross"]) {
40
+ stroke-dashoffset: 0;
41
+ }
42
+ :where([data-sx-save] > span) {
43
+ display: inline-block;
44
+ }
45
+ }`;
46
+ const MOTION = `@layer components {
47
+ :where([data-sx-save="saving"] > svg) {
48
+ animation: sx-form-save-spin 0.8s linear infinite;
49
+ }
50
+ :where(html[data-sx-loops-paused] [data-sx-save] > svg) {
51
+ animation-play-state: paused;
52
+ }
53
+ :where([${PART}="check"], [${PART}="cross"]) {
54
+ transition: stroke-dashoffset 300ms ease-out;
55
+ }
56
+ :where([data-sx-save="saved"] > svg, [data-sx-save="error"] > svg) {
57
+ animation: sx-form-save-pop 400ms ${SPRING};
58
+ }
59
+ :where([data-sx-save] > span) {
60
+ transition: opacity 180ms ease-out, translate 180ms ease-out;
61
+ }
62
+ @starting-style {
63
+ :where([data-sx-save] > span) {
64
+ opacity: 0;
65
+ translate: 0 0.4em;
66
+ }
67
+ }
68
+ @keyframes sx-form-save-spin {
69
+ to { rotate: 1turn; }
70
+ }
71
+ @keyframes sx-form-save-pop {
72
+ 0% { scale: 0.6; }
73
+ 100% { scale: 1; }
74
+ }
75
+ }`;
76
+ const WORDS = { saving: "Saving…", saved: "Saved", error: "Couldn't save" };
77
+ /**
78
+ * An autosave's status: a spinner and "Saving…", then a check that draws in and "Saved" (or a cross and "Couldn't
79
+ * save"). A live region, so screen readers hear each change. Your app sets `state`.
80
+ *
81
+ * ```tsx
82
+ * <SaveStatus state={saving ? "saving" : saved ? "saved" : "idle"} />
83
+ * ```
84
+ */
85
+ export function SaveStatus({ state, labels, className, unstyled }) {
86
+ const text = state === "idle" ? "" : (labels?.[state] ?? WORDS[state]);
87
+ return (_jsxs(_Fragment, { children: [_jsx("style", { href: styleHref("form-save", CSS), precedence: "sx", children: CSS }), _jsx("style", { href: styleHref("form-save-motion", MOTION), precedence: "sx", children: motionOnly(MOTION) }), _jsxs("span", { "data-sx-save": state, "data-sx-styled": unstyled ? undefined : "", role: "status", className: className, children: [_jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": true, focusable: "false", children: [_jsx("circle", { [PART]: "ring", cx: "12", cy: "12", r: "9", pathLength: 1 }), _jsx("path", { [PART]: "check", d: "m8 12.5 2.75 2.75L16 9.5", pathLength: 1 }), _jsx("path", { [PART]: "cross", d: "m9 9 6 6m0-6-6 6", pathLength: 1 })] }), _jsx("span", { children: text }, state)] })] }));
88
+ }
@@ -0,0 +1,46 @@
1
+ import { type ComponentPropsWithRef, type CSSProperties, type ReactNode } from "react";
2
+ import type { FormEffect } from "../types.js";
3
+ /** One choice of a Select. */
4
+ export interface SelectOption {
5
+ readonly value: string;
6
+ /** Plain words: a `<select>` shows text only. */
7
+ readonly label: string;
8
+ readonly disabled?: boolean;
9
+ }
10
+ interface SelectOwnProps {
11
+ /** The visible label: a real `<label for>`. */
12
+ readonly label?: ReactNode;
13
+ readonly description?: ReactNode;
14
+ /** The error message, with `aria-invalid` and a `role="alert"` region. */
15
+ readonly error?: ReactNode;
16
+ readonly invalid?: boolean;
17
+ /** The choices. Or put `<option>` elements inside instead. */
18
+ readonly options?: readonly SelectOption[];
19
+ readonly children?: ReactNode;
20
+ /** Shown while nothing is chosen: a first option that can't be picked again. */
21
+ readonly placeholder?: string;
22
+ /** One effect or a list; they stack. Most reach the browser's own picker only where it can be styled. */
23
+ readonly effect?: FormEffect | readonly FormEffect[];
24
+ /** A select inside a sentence ("I'd like a ___ website"): it sits in the line; its label is read by screen readers only. */
25
+ readonly inline?: boolean;
26
+ readonly unstyled?: boolean;
27
+ /** Goes on the box you see. */
28
+ readonly className?: string;
29
+ readonly rootClassName?: string;
30
+ readonly labelClassName?: string;
31
+ readonly style?: CSSProperties;
32
+ }
33
+ /** Every other prop goes on the real `<select>`, `ref` included, so `{...register("country")}` spreads onto it. */
34
+ export type SelectProps = SelectOwnProps & Omit<ComponentPropsWithRef<"select">, keyof SelectOwnProps>;
35
+ /**
36
+ * The browser's own `<select>`, wearing effects. Where the browser lets a page style its picker (Chrome 135+, Safari 27:
37
+ * `appearance: base-select`), the picker effects reach the list that opens; elsewhere (Firefox) the browser's own list
38
+ * opens, and the box, the arrow and the error still look the part. The keyboard, the screen reader, autofill and a
39
+ * phone's own picker all keep working, because it is the real one.
40
+ *
41
+ * ```tsx
42
+ * <Select label="Country" options={countries} placeholder="Choose…" effect={[pickerArrow(), pickerOpen()]} {...register("country")} />
43
+ * ```
44
+ */
45
+ export declare function Select(props: SelectProps): import("react").JSX.Element;
46
+ export {};