@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,99 @@
1
+ // The switch's own sheet, on top of the choice base sheet (a switch is an option whose drawn box is a track): the
2
+ // track's size, the thumb and its place, the pending spinner, the label first, the browser's own switch, forced
3
+ // colours. Positioning only; the look is styles/form.css. See ./CLAUDE.md.
4
+ const CONTROL = "[data-sx-choice-control]";
5
+ const SWITCH = '[data-sx-kind="switch"]';
6
+ export const SWITCH_BASE_CSS = `@layer components {
7
+ :where(${SWITCH}) {
8
+ --sx-switch-w: 2.75em;
9
+ --sx-switch-h: 1.5em;
10
+ --sx-switch-pad: 0.1875em;
11
+ --sx-switch-at: 0;
12
+ }
13
+ :where(${SWITCH}:has(${CONTROL}:checked)) {
14
+ --sx-switch-at: 1;
15
+ }
16
+ :where(${SWITCH}[data-sx-dragging]) {
17
+ --sx-switch-at: var(--sx-switch-drag, 0);
18
+ }
19
+ :where(${SWITCH} > [data-sx-choice-row]) {
20
+ grid-template-columns: var(--sx-switch-w) minmax(0, 1fr);
21
+ }
22
+ :where(${SWITCH} :is([data-sx-choice-box], ${CONTROL})) {
23
+ inline-size: var(--sx-switch-w);
24
+ block-size: var(--sx-switch-h);
25
+ margin: calc((1.5em - var(--sx-switch-h)) / 2) 0 0;
26
+ }
27
+ :where(${SWITCH}[data-sx-label-first] > [data-sx-choice-row]) {
28
+ grid-template-columns: minmax(0, 1fr) var(--sx-switch-w);
29
+ }
30
+ :where(${SWITCH}[data-sx-label-first] > [data-sx-choice-row] > :is([data-sx-choice-box], ${CONTROL})) {
31
+ grid-area: 1 / 2;
32
+ }
33
+ :where(${SWITCH}[data-sx-label-first] [data-sx-choice-text]) {
34
+ grid-area: 1 / 1;
35
+ }
36
+ :where(${SWITCH}[data-sx-label-first] [data-sx-choice-description]) {
37
+ grid-area: 2 / 1;
38
+ }
39
+ :where(${SWITCH}[data-sx-label-first] > [data-sx-choice-message]) {
40
+ padding-inline-start: 0;
41
+ }
42
+ :where(${SWITCH} > [data-sx-choice-message]) {
43
+ padding-inline-start: calc(var(--sx-switch-w) + var(--sx-choice-gap));
44
+ }
45
+ :where([data-sx-switch-thumb]) {
46
+ position: absolute;
47
+ inset-block: var(--sx-switch-pad);
48
+ inset-inline-start: var(--sx-switch-pad);
49
+ aspect-ratio: 1;
50
+ display: grid;
51
+ place-items: center;
52
+ border-radius: 50%;
53
+ translate: calc(var(--sx-switch-at) * (var(--sx-switch-w) - var(--sx-switch-h)) * var(--sx-form-dir)) 0;
54
+ }
55
+ :where([data-sx-switch-thumb] > [data-sx-choice-layer]) {
56
+ border-radius: inherit;
57
+ }
58
+ :where([data-sx-switch-spinner]) {
59
+ inline-size: 62%;
60
+ block-size: 62%;
61
+ box-sizing: border-box;
62
+ border: 2px solid currentColor;
63
+ border-block-start-color: transparent;
64
+ border-radius: 50%;
65
+ }
66
+ :where(${SWITCH}[data-sx-pending] [data-sx-choice-row]) {
67
+ cursor: progress;
68
+ }
69
+ :where(${SWITCH}[data-sx-drag] ${CONTROL}) {
70
+ touch-action: pan-y;
71
+ }
72
+ :where(${SWITCH}[data-sx-native] ${CONTROL}, ${SWITCH}[data-sx-native] > [data-sx-choice-row]) {
73
+ inline-size: auto;
74
+ block-size: auto;
75
+ }
76
+ :where(${SWITCH}[data-sx-native] > [data-sx-choice-row]) {
77
+ grid-template-columns: auto minmax(0, 1fr);
78
+ }
79
+ @media (forced-colors: active) {
80
+ :where(${SWITCH} ${CONTROL}) {
81
+ inline-size: auto;
82
+ block-size: auto;
83
+ }
84
+ :where(${SWITCH} > [data-sx-choice-row]) {
85
+ grid-template-columns: auto minmax(0, 1fr);
86
+ }
87
+ }
88
+ @media (prefers-reduced-motion: no-preference) {
89
+ :where([data-sx-switch-spinner]) {
90
+ animation: sx-form-switch-spin 0.8s linear infinite;
91
+ }
92
+ :where(html[data-sx-loops-paused] [data-sx-switch-spinner]) {
93
+ animation-play-state: paused;
94
+ }
95
+ @keyframes sx-form-switch-spin {
96
+ to { rotate: 1turn; }
97
+ }
98
+ }
99
+ }`;
@@ -0,0 +1,3 @@
1
+ export declare const FORM_TOOLS_CSS: string;
2
+ /** The tools' movement: dropped under reduced motion, where they just appear. */
3
+ export declare const FORM_TOOLS_MOTION = "@layer components {\n :where([data-sx-field-clear]) {\n transition: opacity 120ms ease-out, scale 120ms ease-out, visibility 0s 120ms;\n }\n :where([data-sx-field]:is(:has([data-sx-field-control]:not(:placeholder-shown)), :has([data-sx-field-control]:autofill)) [data-sx-field-clear]) {\n transition: opacity 150ms ease-out, scale 220ms linear(0, 0.45 12%, 0.85 25%, 1.08 38%, 1.1 46%, 1.03 62%, 0.99 78%, 1), visibility 0s;\n }\n :where([data-sx-status=\"checking\"] [data-sx-field-status] > svg) {\n animation: sx-form-spin 0.8s linear infinite;\n }\n :where(html[data-sx-loops-paused] [data-sx-field-status] > svg) {\n animation-play-state: paused;\n }\n :where([data-sx-field-note] > span) {\n transition: opacity 150ms ease-out, translate 150ms ease-out;\n }\n :where([data-sx-field-hint]) {\n opacity: 0;\n translate: 0 0.25rem;\n transition: opacity 150ms ease-out, translate 150ms ease-out, display 150ms allow-discrete, overlay 150ms allow-discrete;\n }\n :where([data-sx-field-hint]:popover-open) {\n opacity: 1;\n translate: 0 0;\n }\n @starting-style {\n :where([data-sx-field-hint]:popover-open) {\n opacity: 0;\n translate: 0 0.25rem;\n }\n :where([data-sx-field-note] > span) {\n opacity: 0;\n translate: 0 -0.25rem;\n }\n }\n @keyframes sx-form-spin {\n to { rotate: 1turn; }\n }\n}";
@@ -0,0 +1,248 @@
1
+ // The field's own tools: the clear and show-password buttons, the character counter, the strength meter, the async
2
+ // check mark, the hint popover, the Caps Lock note and the auto-growing textarea. Every `Field` ships these sheets right
3
+ // after the base sheet, so they always sit before the effects that restyle the tools. The state sheet holds what must
4
+ // show under reduced motion too; the motion sheet goes through `motionOnly()`. Colours come from sx tokens, with system colours behind them for a page without theme.css.
5
+ // Effects (`inputReveal`, `inputCounter`, `inputStrength`, `validAsync`) add the motion on top. Under forced colours the
6
+ // browser paints backgrounds over in its own colours, so the strength bars get a border and a fill it leaves alone.
7
+ // See ./CLAUDE.md.
8
+ import { FILLED, SPRING } from "./effects/kit.js";
9
+ const CONTROL = "[data-sx-field-control]";
10
+ const PART = "data-sx-tool-part";
11
+ const BARS = [1, 2, 3, 4].map((n) => `[data-sx-strength="${n}"] [data-sx-field-bar]:nth-child(-n + ${n}) > span`).join(", ");
12
+ const ICON = "[data-sx-field-tool] > svg, [data-sx-field-status] > svg, [data-sx-field-note] svg";
13
+ export const FORM_TOOLS_CSS = `@layer components {
14
+ :where([data-sx-field-end] > [data-sx-field-layer]) {
15
+ position: relative;
16
+ inset: auto;
17
+ flex: none;
18
+ display: grid;
19
+ place-items: center;
20
+ inline-size: 1.25em;
21
+ block-size: 1.25em;
22
+ }
23
+ :where([data-sx-field-box]:has(> textarea${CONTROL})) {
24
+ flex-wrap: wrap;
25
+ }
26
+ :where(textarea${CONTROL}) {
27
+ flex-basis: 100%;
28
+ }
29
+ :where(textarea${CONTROL} + [data-sx-field-end]) {
30
+ margin: calc(-1 * var(--sx-field-py)) 0 0 auto;
31
+ }
32
+ :where([data-sx-field-tool]) {
33
+ all: unset;
34
+ border-radius: var(--radius-sx-control, 0.25rem);
35
+ cursor: pointer;
36
+ }
37
+ :where([data-sx-field-tool], [data-sx-field-status], [data-sx-field-counter]) {
38
+ flex: none;
39
+ display: grid;
40
+ place-items: center;
41
+ inline-size: 2rem;
42
+ block-size: 2rem;
43
+ }
44
+ :where([data-sx-field-tool]:focus-visible) {
45
+ outline: 2px solid var(--color-sx-primary, currentColor);
46
+ outline-offset: -2px;
47
+ }
48
+ :where(${ICON}) {
49
+ display: block;
50
+ inline-size: 1.125em;
51
+ block-size: 1.125em;
52
+ fill: none;
53
+ stroke: currentColor;
54
+ stroke-width: 2;
55
+ stroke-linecap: round;
56
+ stroke-linejoin: round;
57
+ }
58
+ :where([${PART}]) {
59
+ stroke-dasharray: 1 2;
60
+ }
61
+ :where([data-sx-field-clear]) {
62
+ visibility: hidden;
63
+ opacity: 0;
64
+ scale: 0.5;
65
+ }
66
+ :where([data-sx-field]${FILLED}:not(:has(${CONTROL}:disabled, ${CONTROL}:read-only)) [data-sx-field-clear]) {
67
+ visibility: visible;
68
+ opacity: 1;
69
+ scale: 1;
70
+ }
71
+ :where([data-sx-field-reveal] [${PART}="slash"]) {
72
+ stroke-dashoffset: 1.01;
73
+ }
74
+ :where([data-sx-revealed] [data-sx-field-reveal] [${PART}="slash"]) {
75
+ stroke-dashoffset: 0;
76
+ }
77
+ :where([data-sx-field-status] [${PART}]) {
78
+ stroke-dashoffset: 1.01;
79
+ }
80
+ :where([data-sx-status="checking"] [${PART}="ring"]) {
81
+ stroke-dashoffset: 0.7;
82
+ }
83
+ :where([data-sx-status="valid"] [${PART}="check"], [data-sx-status="invalid"] [${PART}="cross"]) {
84
+ stroke-dashoffset: 0;
85
+ }
86
+ :where([data-sx-status="valid"] [data-sx-field-status]) {
87
+ color: var(--color-sx-success, currentColor);
88
+ }
89
+ :where([data-sx-status="invalid"] [data-sx-field-status]) {
90
+ color: var(--color-sx-danger, currentColor);
91
+ }
92
+ :where([data-sx-field-counter]) {
93
+ position: relative;
94
+ inline-size: auto;
95
+ min-inline-size: 2rem;
96
+ padding-inline: 0.25rem;
97
+ font-size: 0.75rem;
98
+ font-variant-numeric: tabular-nums;
99
+ line-height: 1;
100
+ }
101
+ :where([data-sx-field-counter] > span) {
102
+ grid-area: 1 / 1;
103
+ }
104
+ :where([data-sx-field-counter] > [data-sx-field-layer]) {
105
+ inset: 0;
106
+ }
107
+ :where([data-sx-field-left]) {
108
+ display: none;
109
+ }
110
+ :where([data-sx-field-strength]) {
111
+ grid-area: meter;
112
+ display: flex;
113
+ align-items: center;
114
+ gap: 0.75rem;
115
+ margin-block-start: 0.5rem;
116
+ font-size: 0.75rem;
117
+ }
118
+ :where([data-sx-field-bars]) {
119
+ flex: 1 1 auto;
120
+ display: grid;
121
+ grid-template-columns: repeat(4, minmax(0, 1fr));
122
+ gap: 0.25rem;
123
+ }
124
+ :where([data-sx-field-bar]) {
125
+ display: block;
126
+ block-size: 0.25rem;
127
+ overflow: hidden;
128
+ border-radius: 999px;
129
+ background: color-mix(in oklab, currentColor 15%, transparent);
130
+ }
131
+ :where([data-sx-field-bar] > span) {
132
+ display: block;
133
+ block-size: 100%;
134
+ background: var(--sx-field-strength, currentColor);
135
+ scale: 0 1;
136
+ transform-origin: calc(50% - 50% * var(--sx-form-dir)) 50%;
137
+ }
138
+ :where(${BARS}) {
139
+ scale: 1 1;
140
+ }
141
+ :where([data-sx-strength="0"], [data-sx-strength="1"]) {
142
+ --sx-field-strength: var(--color-sx-danger);
143
+ }
144
+ :where([data-sx-strength="2"]) {
145
+ --sx-field-strength: color-mix(in oklab, var(--color-sx-danger) 50%, var(--color-sx-success));
146
+ }
147
+ :where([data-sx-strength="3"]) {
148
+ --sx-field-strength: color-mix(in oklab, var(--color-sx-danger) 20%, var(--color-sx-success));
149
+ }
150
+ :where([data-sx-strength="4"]) {
151
+ --sx-field-strength: var(--color-sx-success);
152
+ }
153
+ :where([data-sx-field-level]) {
154
+ flex: none;
155
+ min-inline-size: 6em;
156
+ text-align: end;
157
+ }
158
+ :where([data-sx-field-level] > span) {
159
+ display: inline-block;
160
+ }
161
+ :where([data-sx-field-note]) {
162
+ grid-area: note;
163
+ margin: 0;
164
+ }
165
+ :where([data-sx-field-note] > span) {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: 0.375rem;
169
+ padding-block-start: 0.375rem;
170
+ font-size: 0.875rem;
171
+ }
172
+ :where([data-sx-field-hint]) {
173
+ inset: auto;
174
+ margin: 0.375rem 0;
175
+ position-area: block-start span-inline-start;
176
+ position-try-fallbacks: flip-block;
177
+ inline-size: max-content;
178
+ max-inline-size: min(20rem, calc(100vw - 2rem));
179
+ padding: 0.5rem 0.75rem;
180
+ border: 1px solid var(--color-sx-border, currentColor);
181
+ border-radius: var(--radius-sx-control, 0.375rem);
182
+ background: var(--color-sx-secondary, Canvas);
183
+ color: var(--color-sx-ink, CanvasText);
184
+ font-size: 0.875rem;
185
+ line-height: 1.4;
186
+ }
187
+ @supports not (position-area: block-start) {
188
+ :where([data-sx-field-hint]) {
189
+ inset: auto 1rem 1rem;
190
+ margin: 0 auto;
191
+ }
192
+ }
193
+ :where([data-sx-field-grow] textarea${CONTROL}) {
194
+ field-sizing: content;
195
+ resize: none;
196
+ min-block-size: calc(var(--sx-field-rows, 2) * 1lh + 2 * var(--sx-field-py));
197
+ max-block-size: calc(var(--sx-field-rows-max) * 1lh + 2 * var(--sx-field-py));
198
+ }
199
+ @media (forced-colors: active) {
200
+ :where([data-sx-field-bar]) {
201
+ border: 1px solid CanvasText;
202
+ }
203
+ :where([data-sx-field-bar] > span) {
204
+ forced-color-adjust: none;
205
+ background: CanvasText;
206
+ }
207
+ }
208
+ }`;
209
+ /** The tools' movement: dropped under reduced motion, where they just appear. */
210
+ export const FORM_TOOLS_MOTION = `@layer components {
211
+ :where([data-sx-field-clear]) {
212
+ transition: opacity 120ms ease-out, scale 120ms ease-out, visibility 0s 120ms;
213
+ }
214
+ :where([data-sx-field]${FILLED} [data-sx-field-clear]) {
215
+ transition: opacity 150ms ease-out, scale 220ms ${SPRING}, visibility 0s;
216
+ }
217
+ :where([data-sx-status="checking"] [data-sx-field-status] > svg) {
218
+ animation: sx-form-spin 0.8s linear infinite;
219
+ }
220
+ :where(html[data-sx-loops-paused] [data-sx-field-status] > svg) {
221
+ animation-play-state: paused;
222
+ }
223
+ :where([data-sx-field-note] > span) {
224
+ transition: opacity 150ms ease-out, translate 150ms ease-out;
225
+ }
226
+ :where([data-sx-field-hint]) {
227
+ opacity: 0;
228
+ translate: 0 0.25rem;
229
+ transition: opacity 150ms ease-out, translate 150ms ease-out, display 150ms allow-discrete, overlay 150ms allow-discrete;
230
+ }
231
+ :where([data-sx-field-hint]:popover-open) {
232
+ opacity: 1;
233
+ translate: 0 0;
234
+ }
235
+ @starting-style {
236
+ :where([data-sx-field-hint]:popover-open) {
237
+ opacity: 0;
238
+ translate: 0 0.25rem;
239
+ }
240
+ :where([data-sx-field-note] > span) {
241
+ opacity: 0;
242
+ translate: 0 -0.25rem;
243
+ }
244
+ }
245
+ @keyframes sx-form-spin {
246
+ to { rotate: 1turn; }
247
+ }
248
+ }`;
@@ -0,0 +1,161 @@
1
+ import type { SvgElement } from "../backgrounds/types.js";
2
+ /** The atlas's groups. */
3
+ export declare const FORM_GROUPS: readonly ["input", "valid", "check", "radio", "switch", "select", "range", "file", "flow"];
4
+ export type FormGroup = (typeof FORM_GROUPS)[number];
5
+ /** The controls an effect can sit on. */
6
+ export type FormControl = "field" | "checkbox" | "radio" | "switch" | "picker" | "range" | "file" | "steps" | "chip";
7
+ /** When an effect fires: the cursor enters, the value changes, a choice is made, a check runs, a drag, a submit. */
8
+ export type FormFires = "focus" | "typing" | "change" | "validate" | "drag" | "submit" | "idle";
9
+ /** What it is built with. */
10
+ export type FormTech = "css" | "native" | "svg" | "js" | "canvas";
11
+ /** The lowest device tier that runs it (same scale as backgrounds, transitions and buttons). */
12
+ export type FormTier = "all" | "mid" | "high";
13
+ /**
14
+ * What two effects on one control can't both write. Layers never clash (each effect has its own span); these do.
15
+ * - `label`: where the label sits and how it moves (`translate`, `scale`, its grid area).
16
+ * - `box`: a `translate` / `transform` on the box (a lift, a shake).
17
+ * - `icon`: the icon's `translate` / `scale`.
18
+ * - `mark`: a choice's mark: an effect that hides the tick or dot and draws its own (a scribble, a heart, a morph);
19
+ * a switch's thumb face (an icon, a sun, a face).
20
+ * - `thumb`: a switch's thumb: its `scale`, `rotate`, corners or visibility.
21
+ */
22
+ export type FormClaim = "label" | "box" | "icon" | "mark" | "thumb";
23
+ /** CSS custom properties, written inline on the control's root. Names start with `--sx-form-<id>-`. */
24
+ export type FormVars = Readonly<Record<`--${string}`, string | number>>;
25
+ /**
26
+ * Where a layer sits in a field.
27
+ * - `under`: behind the input text, on the box's background (a tint, a flap).
28
+ * - `fill`: like `under`, clipped to the box's corners (a fill that rises, a flood).
29
+ * - `edge`: above everything, not clipped (lines, outlines, rings); never takes the pointer.
30
+ * - `label`: inside the label, after its text (a second copy that rolls in).
31
+ * - `behind`: behind the whole box, in its grid cell (a hard shadow the box lifts off).
32
+ * - `end`: in the box's end row, before the field's own buttons, taking its own room (a check that draws in).
33
+ * - `counter`: inside the character counter, around its number (`counter` on the field; a ring that fills).
34
+ *
35
+ * A checkbox or a radio (each option of a group):
36
+ * - `box`: inside the drawn box, over its mark (a scribble, a heart, a star, a face).
37
+ * - `halo`: behind the box, centred on it and larger (a state layer, a pulse ring, a burst).
38
+ * - `text`: over the option's words (a strike line, a hand-drawn circle).
39
+ * - `row`: behind the whole option, its words included (a card, a pill that merges with the next).
40
+ *
41
+ * A radio group (once, not per option):
42
+ * - `track`: in the options' box, behind them (a segment's thumb, a travelling dot, a tab underline).
43
+ *
44
+ * A switch uses `box` for its track (behind the thumb: a sky, words, a neon tube, a goo) and:
45
+ * - `thumb`: inside the thumb (an icon, a sun turning moon, a face).
46
+ *
47
+ * A combobox's list:
48
+ * - `list`: in the list, behind the options (a highlight that glides to the active one).
49
+ *
50
+ * A ChipGroup's chip uses `row`: behind the chip's words, inside it (a pill, a bridge to the next chip).
51
+ *
52
+ * A FileDrop:
53
+ * - `zone`: in the drop zone, behind its words (a tint, a frame that answers a drag).
54
+ * - `card`: in each file's card (a ring that fills with the upload).
55
+ * - `page`: in the page-wide overlay (`page`), behind its words.
56
+ *
57
+ * FormSteps use `track`: in the progress, along its rail (a fill, a glow).
58
+ */
59
+ export type FormSlot = "under" | "fill" | "edge" | "label" | "behind" | "end" | "counter" | "box" | "halo" | "text" | "row" | "track" | "thumb" | "list" | "zone" | "card" | "page";
60
+ /** A generated span. An effect never uses pseudo-elements, or two effects on one control would fight over them. */
61
+ export interface FormLayer {
62
+ readonly slot: FormSlot;
63
+ /** Tells an effect's layers apart in its CSS (`data-sx-field-part`). */
64
+ readonly part?: string;
65
+ /** Empty spans inside the layer, named by part. */
66
+ readonly children?: readonly string[];
67
+ /** Words inside the layer. Hidden from screen readers, like every layer. */
68
+ readonly text?: string;
69
+ /** Repeats the label's text inside the layer, when there is no `text`. */
70
+ readonly copy?: boolean;
71
+ /** Lines of words, one span each (`data-sx-field-part="line"`, `--sx-field-i` its place): phrases that take turns. */
72
+ readonly lines?: readonly string[];
73
+ /** An inline `<svg>` inside the layer. Colours come from the CSS, never attributes. */
74
+ readonly svg?: {
75
+ readonly viewBox?: string;
76
+ readonly preserveAspectRatio?: string;
77
+ readonly children: readonly SvgElement[];
78
+ };
79
+ /**
80
+ * Render the layer as a `<fieldset>` whose `<legend>` holds a hidden copy of the label: the browser cuts a gap in the
81
+ * fieldset's border exactly as wide as the label (the notched outline), with no measuring.
82
+ */
83
+ readonly legend?: boolean;
84
+ /** It shows a state, so it stays under reduced motion, when every other layer goes. */
85
+ readonly keep?: boolean;
86
+ }
87
+ /** Plain flags the control reads. */
88
+ export interface FormNeeds {
89
+ /** It runs without end: pause it off screen and when the page pauses its loops (WCAG 2.2.2). */
90
+ readonly inView?: boolean;
91
+ /** It grows from where the field was clicked: the control writes `--sx-field-ox` (0-1) on each press. */
92
+ readonly origin?: boolean;
93
+ /** It styles one of the field's own tools, so the field warns in development when that tool is off. */
94
+ readonly tool?: "counter" | "reveal";
95
+ /** Removed chips stay until their exit animation ends, and the others glide into place (a combobox's `multiple`). */
96
+ readonly flip?: boolean;
97
+ /** The combobox marks the typed text in each option with the Custom Highlight API (`sx-list-match`). */
98
+ readonly match?: boolean;
99
+ /** It docks the popup at the bottom of a phone's screen: the combobox keeps its box in view and the sheet above the keyboard. */
100
+ readonly sheet?: boolean;
101
+ /** A FileDrop shows a picture's thumbnail (an object URL, let go when the file goes). */
102
+ readonly preview?: boolean;
103
+ }
104
+ /** What an effect needs from the label. Effects that ask for the same thing share it. */
105
+ export interface FormLabelPlan {
106
+ /** Cut a text label into letters (`data-sx-field-char`), or whole words in a joined script. */
107
+ readonly split?: boolean;
108
+ /** Keep the label's text in its own span (`data-sx-field-text`). */
109
+ readonly wrap?: boolean;
110
+ }
111
+ export interface FormMeta {
112
+ /** The factory's name in the barrel (`inputFloat`, `checkDraw` …). */
113
+ readonly id: string;
114
+ readonly label: string;
115
+ readonly group: FormGroup;
116
+ /** The controls it fits. */
117
+ readonly fits: readonly FormControl[];
118
+ readonly fires: readonly FormFires[];
119
+ readonly tech: FormTech;
120
+ readonly tier: FormTier;
121
+ /** One line for the docs table. */
122
+ readonly description: string;
123
+ /** It relies on a feature some browsers lack; they get the plain control (`caret-shape` …). */
124
+ readonly limited?: string;
125
+ }
126
+ /**
127
+ * Code an effect runs on its control (confetti on the page's burst canvas). It makes the page need `"use client"`.
128
+ */
129
+ export interface FormProgram {
130
+ /** Starts it on the control's root. Returns what stops it. */
131
+ readonly attach: (root: HTMLElement) => () => void;
132
+ /** Its options as a stable string: the control restarts it only when this changes. */
133
+ readonly signature: string;
134
+ }
135
+ /** One effect on a control: plain data (unless it has a `program`), so a Server Component can pass it. */
136
+ export interface FormEffect {
137
+ /** The `data-sx-field` value its stylesheet is keyed on: its registry id. */
138
+ readonly id: string;
139
+ readonly tier: FormTier;
140
+ /** The controls it fits: a control warns in development when given one that doesn't fit it. */
141
+ readonly fits: readonly FormControl[];
142
+ /** Its stylesheet, one per id. */
143
+ readonly css: string;
144
+ readonly vars: FormVars;
145
+ readonly layers: readonly FormLayer[];
146
+ readonly claims: readonly FormClaim[];
147
+ readonly needs: FormNeeds;
148
+ /** Rules that show a state rather than a motion, shipped under reduced motion too. */
149
+ readonly stateCss?: string;
150
+ readonly label?: FormLabelPlan;
151
+ /** Code it runs on the control. Only the few effects that need one have it. */
152
+ readonly program?: FormProgram;
153
+ /**
154
+ * It shows where the focus is by itself (a line, an outline, a ring, a fill that stays while focused), so the field
155
+ * drops its own focus outline (`focusRing="auto"`): its state sheet carries the rule. The outline comes back under
156
+ * reduced motion and forced colours, where the effect's layers may not show.
157
+ */
158
+ readonly marksFocus?: true;
159
+ /** What a weaker device wears instead (every `mid` / `high` effect has one). Its id ends in `-lite`. */
160
+ readonly fallback?: FormEffect;
161
+ }
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Form effect descriptors and their metadata. See ./CLAUDE.md.
3
+ // ---------------------------------------------------------------------------
4
+ /** The atlas's groups. */
5
+ export const FORM_GROUPS = ["input", "valid", "check", "radio", "switch", "select", "range", "file", "flow"];