@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,18 @@
1
+ import { defineSchema } from "../../../schema/define.js";
2
+ export const INPUT_UNDERLINE_SCHEMA = defineSchema()({
3
+ id: "inputUnderline",
4
+ family: "form",
5
+ factory: "inputUnderline",
6
+ fields: {
7
+ from: {
8
+ kind: "choice",
9
+ label: "Grows from",
10
+ values: ["start", "center", "end", "pointer"],
11
+ labels: { start: "Reading start", center: "Centre", end: "Reading end", pointer: "Where you click" },
12
+ default: "start",
13
+ },
14
+ color: { kind: "color", label: "Colour", default: "var(--color-sx-primary)" },
15
+ thickness: { kind: "number", label: "Thickness", min: 1, max: 6, step: 0.5, unit: "px", default: 2 },
16
+ duration: { kind: "number", label: "Duration", min: 0.1, max: 1, step: 0.05, unit: "s", default: 0.3 },
17
+ },
18
+ });
@@ -0,0 +1,11 @@
1
+ import type { FormEffect } from "../../types.js";
2
+ export interface InputWaveOptions {
3
+ /** How high each letter hops, in ems. Default `0.35`. */
4
+ readonly height?: number;
5
+ /** Seconds between one letter and the next. Default `0.04`. */
6
+ readonly stagger?: number;
7
+ /** Seconds one hop takes. Default `0.45`. */
8
+ readonly duration?: number;
9
+ }
10
+ /** The label's letters hop up one after another on focus. Needs a plain text label. */
11
+ export declare function inputWave(options?: InputWaveOptions): FormEffect;
@@ -0,0 +1,23 @@
1
+ import { FOCUSED, at, charOf, defineForm, inField, v, varName } from "../kit.js";
2
+ const ID = "inputWave";
3
+ // The letters are cut on the server (whole words in a joined script, so Arabic keeps its joins); each focus plays the
4
+ // hop once, letter after letter. Screen readers get one plain copy of the label.
5
+ const CSS = ` ${at(inField(ID, FOCUSED, charOf(ID)))} {
6
+ animation: sx-form-inputWave ${v(ID, "time")} ease-out both;
7
+ animation-delay: calc(var(--sx-field-i) * ${v(ID, "stagger")} * 1s);
8
+ }
9
+ @keyframes sx-form-inputWave {
10
+ 0%, 100% { translate: 0 0; }
11
+ 40% { translate: 0 calc(-1em * ${v(ID, "height")}); }
12
+ }`;
13
+ /** The label's letters hop up one after another on focus. Needs a plain text label. */
14
+ export function inputWave(options = {}) {
15
+ return defineForm(ID, CSS, {
16
+ vars: {
17
+ [varName(ID, "height")]: options.height ?? 0.35,
18
+ [varName(ID, "stagger")]: options.stagger ?? 0.04,
19
+ [varName(ID, "time")]: `${options.duration ?? 0.45}s`,
20
+ },
21
+ label: { split: true },
22
+ });
23
+ }
@@ -0,0 +1 @@
1
+ export declare const INPUT_WAVE_SCHEMA: import("../../../schema/types.js").Schema;
@@ -0,0 +1,11 @@
1
+ import { defineSchema } from "../../../schema/define.js";
2
+ export const INPUT_WAVE_SCHEMA = defineSchema()({
3
+ id: "inputWave",
4
+ family: "form",
5
+ factory: "inputWave",
6
+ fields: {
7
+ height: { kind: "number", label: "Hop height", min: 0.1, max: 0.8, step: 0.05, unit: "em", default: 0.35 },
8
+ stagger: { kind: "number", label: "Between letters", min: 0.01, max: 0.12, step: 0.01, unit: "s", default: 0.04 },
9
+ duration: { kind: "number", label: "One hop", min: 0.2, max: 1, step: 0.05, unit: "s", default: 0.45 },
10
+ },
11
+ });
@@ -0,0 +1,11 @@
1
+ import type { FormEffect } from "../../types.js";
2
+ export interface InputWavyOptions {
3
+ /** The line's colour while the field has the focus. Default `var(--color-sx-primary)`. */
4
+ readonly color?: string;
5
+ /** Its thickness, px. Default `2`. */
6
+ readonly thickness?: number;
7
+ /** Seconds the wobble lasts. Default `0.8`. */
8
+ readonly duration?: number;
9
+ }
10
+ /** The bottom line wobbles like jelly on focus, then settles flat (Codrops' Nao and Shoko). */
11
+ export declare function inputWavy(options?: InputWavyOptions): FormEffect;
@@ -0,0 +1,53 @@
1
+ import { at, defineForm, layerOf, v, varName, whenFocused } from "../kit.js";
2
+ import { ringOff } from "../ring.js";
3
+ const ID = "inputWavy";
4
+ const LAYER = layerOf(ID);
5
+ const WAVE = `${LAYER} [data-sx-field-svg="wave"]`;
6
+ /** A wave twice as wide as the field: sliding it by half (one viewBox) loops with no seam. */
7
+ const HALF = 12.5;
8
+ const WAVE_PATH = `M0 6 Q${HALF / 2} 1 ${HALF} 6${Array.from({ length: 63 }, (_, i) => ` T${(i + 2) * HALF} 6`).join("")}`;
9
+ // The wave rests nearly flat (scale 0.02, never 0: a flat transform hides an SVG shape): an underline in the line's
10
+ // colour. On focus it swells, flips, and settles flat again while it slides, like jelly. Only `scale` and `translate`
11
+ // move, on one path.
12
+ const CSS = ` ${at(LAYER)} {
13
+ inset-block: auto calc(-0.375rem - var(--sx-field-bw));
14
+ block-size: 0.75rem;
15
+ border-radius: 0;
16
+ clip-path: inset(-100% 0);
17
+ }
18
+ ${at(WAVE)} {
19
+ fill: none;
20
+ stroke: var(--sx-field-line, var(--color-sx-border));
21
+ stroke-width: calc(${v(ID, "thickness")} * 1px);
22
+ vector-effect: non-scaling-stroke;
23
+ transform-box: fill-box;
24
+ transform-origin: 50% 50%;
25
+ scale: 1 0.02;
26
+ transition: stroke 0.2s ease-out;
27
+ }
28
+ ${whenFocused(ID, WAVE, `stroke: ${v(ID, "color")}; animation: sx-form-inputWavy ${v(ID, "time")} ease-out;`)}
29
+ @keyframes sx-form-inputWavy {
30
+ 0% { translate: 0 0; scale: 1 0.02; }
31
+ 15% { scale: 1 1; }
32
+ 35% { scale: 1 -0.7; }
33
+ 55% { scale: 1 0.4; }
34
+ 75% { scale: 1 -0.15; }
35
+ 100% { translate: -50% 0; scale: 1 0.02; }
36
+ }`;
37
+ /** The bottom line wobbles like jelly on focus, then settles flat (Codrops' Nao and Shoko). */
38
+ export function inputWavy(options = {}) {
39
+ return defineForm(ID, CSS, {
40
+ marksFocus: ringOff(ID),
41
+ vars: {
42
+ [varName(ID, "color")]: options.color ?? "var(--color-sx-primary)",
43
+ [varName(ID, "thickness")]: options.thickness ?? 2,
44
+ [varName(ID, "time")]: `${options.duration ?? 0.8}s`,
45
+ },
46
+ layers: [
47
+ {
48
+ slot: "edge",
49
+ svg: { viewBox: "0 0 400 12", preserveAspectRatio: "none", children: [{ tag: "path", part: "wave", attrs: { d: WAVE_PATH } }] },
50
+ },
51
+ ],
52
+ });
53
+ }
@@ -0,0 +1 @@
1
+ export declare const INPUT_WAVY_SCHEMA: import("../../../schema/types.js").Schema;
@@ -0,0 +1,11 @@
1
+ import { defineSchema } from "../../../schema/define.js";
2
+ export const INPUT_WAVY_SCHEMA = defineSchema()({
3
+ id: "inputWavy",
4
+ family: "form",
5
+ factory: "inputWavy",
6
+ fields: {
7
+ color: { kind: "color", label: "Colour on focus", default: "var(--color-sx-primary)" },
8
+ thickness: { kind: "number", label: "Thickness", min: 1, max: 5, step: 0.5, unit: "px", default: 2 },
9
+ duration: { kind: "number", label: "Wobble", min: 0.3, max: 2, step: 0.1, unit: "s", default: 0.8 },
10
+ },
11
+ });
@@ -0,0 +1,213 @@
1
+ import type { FormClaim, FormControl, FormEffect, FormLabelPlan, FormLayer, FormNeeds, FormProgram, FormTier, FormVars } from "../types.js";
2
+ /** An effect's option as a custom property: `--sx-form-inputFloat-scale`. */
3
+ export declare const varName: (id: string, name: string) => `--${string}`;
4
+ /** Read it. */
5
+ export declare const v: (id: string, name: string) => string;
6
+ /** 1, or -1 in a right-to-left field. Physical values multiply by it. */
7
+ export declare const DIR = "var(--sx-form-dir)";
8
+ /** The text's start inside the box: the padding, plus the icon when there is one (base sheet). */
9
+ export declare const START = "var(--sx-field-start)";
10
+ /** The box's padding, block and inline (base sheet; the default look and the developer may change them). */
11
+ export declare const PAD_Y = "var(--sx-field-py)";
12
+ export declare const PAD_X = "var(--sx-field-px)";
13
+ /** Wrap a raw selector. */
14
+ export declare const at: (raw: string) => string;
15
+ /** A field wearing this effect, as a raw selector. */
16
+ export declare const fieldOf: (id: string) => string;
17
+ /** Its box (what you see: border, background), as a raw selector. */
18
+ export declare const boxOf: (id: string) => string;
19
+ /** Its label, as a raw selector. */
20
+ export declare const labelOf: (id: string) => string;
21
+ /** The label's text span (`label.wrap`), as a raw selector. */
22
+ export declare const textOf: (id: string) => string;
23
+ /** One letter of the label (`label.split`), as a raw selector. `--sx-field-i` is its position. */
24
+ export declare const charOf: (id: string) => string;
25
+ /** The input or textarea, as a raw selector. */
26
+ export declare const controlOf: (id: string) => string;
27
+ /** The icon, as a raw selector. */
28
+ export declare const iconOf: (id: string) => string;
29
+ /** An effect's layer, as a raw selector. */
30
+ export declare const layerOf: (id: string, part?: string) => string;
31
+ /** A named span inside an effect's layer, as a raw selector. */
32
+ export declare const childOf: (id: string, part: string, layerPart?: string) => string;
33
+ /** The field holds the focus (the input, or a button in its end slot). */
34
+ export declare const FOCUSED = ":focus-within";
35
+ /** The field has text in it (typed or autofilled). */
36
+ export declare const FILLED = ":is(:has([data-sx-field-control]:not(:placeholder-shown)), :has([data-sx-field-control]:autofill))";
37
+ /** Focused or filled: where a floating label goes up. Autofill counts, so the label never sits on the text (atlas rule 5). */
38
+ export declare const RAISED = ":is(:focus-within, :has([data-sx-field-control]:not(:placeholder-shown)), :has([data-sx-field-control]:autofill))";
39
+ /** The field is loading its value (`busy`). */
40
+ export declare const BUSY = ":has([data-sx-field-control][aria-busy=\"true\"])";
41
+ /**
42
+ * The field is wrong: the browser's own check once the user has left it or tried to submit (`:user-invalid`, never
43
+ * `:invalid`, which fires while typing), or the app's (`aria-invalid`, which `error`, `invalid` and `status` set).
44
+ */
45
+ export declare const INVALID = ":has([data-sx-field-control]:user-invalid, [data-sx-field-control][aria-invalid=\"true\"])";
46
+ /**
47
+ * The field is right: an async check said so (`status="valid"`), or the user filled it, left it, and neither the browser
48
+ * nor the app found a fault. An empty optional field stays neutral.
49
+ */
50
+ export declare const VALID = ":is([data-sx-status=\"valid\"], :has([data-sx-field-control]:user-valid:not([aria-invalid=\"true\"])):is(:has([data-sx-field-control]:not(:placeholder-shown)), :has([data-sx-field-control]:autofill))):not(:has([data-sx-field-control]:user-invalid, [data-sx-field-control][aria-invalid=\"true\"]))";
51
+ /** The field was just sent to (`focusFirstError`, an error summary's link): it flashes once. */
52
+ export declare const FLASH = "[data-sx-flash]";
53
+ /** A checkbox wearing this effect (the option's root), as a raw selector. */
54
+ export declare const choiceOf: (id: string) => string;
55
+ /** A Select or a Combobox wearing this effect (its root), as a raw selector. */
56
+ export declare const pickerOf: (id: string) => string;
57
+ /**
58
+ * The picker is open: a Combobox says so (`data-sx-open`), a `<select>` with `:open`. Inside `:is()`, so a browser
59
+ * that doesn't know `:open` drops only that part.
60
+ */
61
+ export declare const OPEN = ":is([data-sx-open], :has(select:open))";
62
+ /** A Combobox's popup, and a `<select>`'s own picker where it can be styled. */
63
+ export declare const POPUP = "[data-sx-picker-popup]";
64
+ /** A Select's real `<select>`. */
65
+ export declare const SELECT = "select[data-sx-picker-control]";
66
+ /** The arrow at the box's end: a span in a Select, a button in a Combobox. Its `svg` turns. */
67
+ export declare const ARROW = "[data-sx-picker-arrow]";
68
+ /** A Combobox option. A `<select>`'s are `option` elements. */
69
+ export declare const OPTION = "[data-sx-option]";
70
+ /** A chosen value of a `multiple` Combobox; `data-sx-leaving` while it plays its way out. */
71
+ export declare const CHIP = "[data-sx-chip]";
72
+ /** A Range wearing this effect (its root), as a raw selector. */
73
+ export declare const rangeOf: (id: string) => string;
74
+ /** A Range's drawn rail, and its drawn thumbs (`[data-sx-thumb="a"]`, and `"b"` with two). */
75
+ export declare const RAIL = "[data-sx-range-track]";
76
+ export declare const KNOB = "[data-sx-range-thumb]";
77
+ /**
78
+ * A Range's thumb while it is being dragged (by its own thumb or from the rail), as a raw selector. Each drawn thumb
79
+ * carries its place, `--sx-at` (0-1); the root carries the filled stretch, `--sx-range-from` / `--sx-range-to`.
80
+ */
81
+ export declare const draggedKnob: (root: string, target?: string) => string;
82
+ /** A Range's thumb while its input holds the keyboard's focus, as a raw selector. */
83
+ export declare const keyedKnob: (root: string, target?: string) => string;
84
+ /** A ChipGroup wearing this effect (the group's `<fieldset>`), as a raw selector. */
85
+ export declare const chipsOf: (id: string) => string;
86
+ /** One filter chip: a label round its real checkbox (or radio), which lies over the whole chip at opacity 0. */
87
+ export declare const CHIP_OPTION = "[data-sx-chip-option]";
88
+ export declare const CHIP_CONTROL = "[data-sx-chip-control]";
89
+ /** The chip's check, before its words: a column that opens when the chip is on; its `path` is the tick. */
90
+ export declare const CHIP_CHECK = "[data-sx-chip-check]";
91
+ /** The chip is on. */
92
+ export declare const CHIP_ON = ":has([data-sx-chip-control]:checked)";
93
+ /** A chip's layer, as a raw selector. */
94
+ export declare const chipLayer: (id: string, part?: string) => string;
95
+ /** A FileDrop wearing this effect (its root), as a raw selector. */
96
+ export declare const fileOf: (id: string) => string;
97
+ /** The drop zone (it holds the real file input), and each file's card in the list. */
98
+ export declare const ZONE = "[data-sx-file-zone]";
99
+ export declare const CARD = "[data-sx-file-card]";
100
+ /**
101
+ * Files are dragged over the zone (`data-sx-over="ok"`), or files it won't take (`"reject"`, where the browser tells the
102
+ * types while dragging). The zone just refused a file: `data-sx-rejected`, for a moment.
103
+ */
104
+ export declare const OVER = "[data-sx-over=\"ok\"]";
105
+ export declare const OVER_REJECT = "[data-sx-over=\"reject\"]";
106
+ export declare const REJECTED = "[data-sx-rejected]";
107
+ /** A FileDrop's layer, as a raw selector. */
108
+ export declare const fileLayer: (id: string, part?: string) => string;
109
+ /** FormSteps wearing this effect (its root), as a raw selector. */
110
+ export declare const stepsOf: (id: string) => string;
111
+ /**
112
+ * One step (`data-sx-active` on the current one, `data-sx-leaving` on the one playing its way out), and the progress's
113
+ * marks (`data-sx-done` on each step done, `aria-current="step"` on the current one). The root carries the way it moves,
114
+ * `--sx-steps-way` (1 forward, -1 back), and `data-sx-moved` once the user has moved (nothing plays on load).
115
+ */
116
+ export declare const STEP = "[data-sx-step]";
117
+ export declare const STEP_MARK = "[data-sx-step-mark]";
118
+ /** A switch wearing this effect (its root), as a raw selector. */
119
+ export declare const switchOf: (id: string) => string;
120
+ /** A switch's thumb. Its place: `--sx-switch-at` (0 off, 1 on, the finger's place while dragged). */
121
+ export declare const THUMB = "[data-sx-switch-thumb]";
122
+ /** How far the thumb travels, as a length: the track's width less its height. */
123
+ export declare const TRAVEL = "(var(--sx-switch-w) - var(--sx-switch-h))";
124
+ /** A radio group wearing this effect, as a raw selector. */
125
+ export declare const radiosOf: (id: string) => string;
126
+ /** One option: a checkbox's root, or one radio of a group. */
127
+ export declare const ITEM = "[data-sx-choice]";
128
+ /** The real checkbox or radio, at opacity 0 on top of the drawn box. */
129
+ export declare const CHOICE = "[data-sx-choice-control]";
130
+ /** The parts of an option. */
131
+ export declare const BOX = "[data-sx-choice-box]";
132
+ export declare const MARK = "[data-sx-choice-mark]";
133
+ export declare const TEXT = "[data-sx-choice-text]";
134
+ export declare const ROW = "[data-sx-choice-row]";
135
+ /** The options' box of a group (where `track` layers go). */
136
+ export declare const OPTIONS = "[data-sx-group-options]";
137
+ /** An option's layer, as a raw selector. */
138
+ export declare const choiceLayer: (id: string, part?: string) => string;
139
+ /** A named span inside an option's layer. */
140
+ export declare const choiceChild: (id: string, part: string, layerPart?: string) => string;
141
+ /** The option is checked (for a mixed checkbox, see MIXED). */
142
+ export declare const CHECKED = ":has([data-sx-choice-control]:checked)";
143
+ /** The checkbox is mixed: `indeterminate` (the attribute stands in on the server, before the property is set). */
144
+ export declare const MIXED = ":is(:has([data-sx-choice-control]:indeterminate), [data-sx-mixed])";
145
+ /**
146
+ * The user changed this option (it is `:user-valid` or `:user-invalid` from then on, in every engine): a pop, a jelly, a
147
+ * pulse or a burst plays when it is checked by hand, never for an option that loads checked.
148
+ */
149
+ export declare const CHANGED = ":has([data-sx-choice-control]:is(:user-valid, :user-invalid))";
150
+ /** The option holds the keyboard focus. */
151
+ export declare const KEYED = ":has([data-sx-choice-control]:focus-visible)";
152
+ /** An option that can't be used. */
153
+ export declare const IDLE = ":has([data-sx-choice-control]:disabled)";
154
+ /**
155
+ * `target` (raw, inside the option) while the option is in `state`. `root` is the effect's own root: a checkbox
156
+ * (`choiceOf`) or a radio group (`radiosOf`, then the state applies to each option in it).
157
+ */
158
+ export declare function inItem(root: string, state: string, target?: string): string;
159
+ /** A rule for an option's `target` while the option is hovered, where hover exists. A disabled option stays still. */
160
+ export declare function whenItemHover(root: string, target: string, body: string): string;
161
+ /** `target` (a raw selector inside a field wearing `id`, or the field itself) while the field is in `state`. */
162
+ export declare function inField(id: string, state: string, target: string): string;
163
+ /** A rule for `target` while the field holds the focus. */
164
+ export declare const whenFocused: (id: string, target: string, body: string) => string;
165
+ /** A rule for `target` while the field is focused or has text. */
166
+ export declare const whenRaised: (id: string, target: string, body: string) => string;
167
+ /** A rule for `target` while the field is loading its value. */
168
+ export declare const whenBusy: (id: string, target: string, body: string) => string;
169
+ /**
170
+ * A rule for `target` while the field is hovered, where hover exists: `:hover` sits inside the media query, so a tap
171
+ * never leaves it stuck on a phone. A disabled field stays still.
172
+ */
173
+ export declare function whenHover(id: string, target: string, body: string): string;
174
+ /** The easing most effects use. */
175
+ export declare const EASE = "var(--ease-sx-out, ease-out)";
176
+ /** A springy curve that overshoots and settles. */
177
+ export declare const SPRING = "linear(0, 0.45 12%, 0.85 25%, 1.08 38%, 1.1 46%, 1.03 62%, 0.99 78%, 1)";
178
+ /** A `transition` for some properties at an effect's duration (its `time` var). */
179
+ export declare const timed: (id: string, properties: string, ease?: string) => string;
180
+ /**
181
+ * A loop stops while the page pauses its loops (`usePauseLoops`, WCAG 2.2.2). Off screen, the base sheet pauses every
182
+ * animation in the field (`data-sx-field-off`).
183
+ */
184
+ export declare const loopPaused: (target: string) => string;
185
+ export interface FormParts {
186
+ readonly vars?: FormVars;
187
+ readonly layers?: readonly FormLayer[];
188
+ readonly claims?: readonly FormClaim[];
189
+ readonly needs?: FormNeeds;
190
+ /** The controls it fits. Default `["field"]`. */
191
+ readonly fits?: readonly FormControl[];
192
+ /** The weakest device that runs it, as in the registry (tested). Default `"all"`. */
193
+ readonly tier?: FormTier;
194
+ /** At-rules that can't sit inside a layer (`@property`). */
195
+ readonly head?: string;
196
+ /** Rules that show a state, not a motion: they apply under reduced motion too. */
197
+ readonly state?: string;
198
+ readonly label?: FormLabelPlan;
199
+ /** What a device below `tier` wears instead. Required for a `mid` / `high` effect (tested). */
200
+ readonly fallback?: FormEffect;
201
+ /** Code it runs on the control (confetti): the page needs `"use client"`. */
202
+ readonly program?: FormProgram;
203
+ /**
204
+ * It shows the focus by itself: `ringOff(id)` from `./ring.js`, the rule that drops the field's outline (see
205
+ * `FormEffect.marksFocus`). A separate module, so effects that don't mark the focus don't carry its text.
206
+ */
207
+ readonly marksFocus?: string;
208
+ }
209
+ /**
210
+ * A form effect from its registry id, its rules and its parts. Rules go in `@layer components`. It doesn't read the
211
+ * registry: that would put every effect's label and description in the download of any page with one field.
212
+ */
213
+ export declare function defineForm(id: string, css: string, parts?: FormParts): FormEffect;
@@ -0,0 +1,226 @@
1
+ // Helpers for form effects: selectors keyed on `data-sx-field`, the state rules (focused, raised, hovered, busy) and
2
+ // defineForm(). Pure strings; no React, no DOM.
3
+ /** An effect's option as a custom property: `--sx-form-inputFloat-scale`. */
4
+ export const varName = (id, name) => `--sx-form-${id}-${name}`;
5
+ /** Read it. */
6
+ export const v = (id, name) => `var(${varName(id, name)})`;
7
+ /** 1, or -1 in a right-to-left field. Physical values multiply by it. */
8
+ export const DIR = "var(--sx-form-dir)";
9
+ /** The text's start inside the box: the padding, plus the icon when there is one (base sheet). */
10
+ export const START = "var(--sx-field-start)";
11
+ /** The box's padding, block and inline (base sheet; the default look and the developer may change them). */
12
+ export const PAD_Y = "var(--sx-field-py)";
13
+ export const PAD_X = "var(--sx-field-px)";
14
+ /** Wrap a raw selector. */
15
+ export const at = (raw) => `:where(${raw})`;
16
+ const CONTROL = "[data-sx-field-control]";
17
+ /** A field wearing this effect, as a raw selector. */
18
+ export const fieldOf = (id) => `[data-sx-field~="${id}"]`;
19
+ /** Its box (what you see: border, background), as a raw selector. */
20
+ export const boxOf = (id) => `${fieldOf(id)} [data-sx-field-box]`;
21
+ /** Its label, as a raw selector. */
22
+ export const labelOf = (id) => `${fieldOf(id)} [data-sx-field-label]`;
23
+ /** The label's text span (`label.wrap`), as a raw selector. */
24
+ export const textOf = (id) => `${fieldOf(id)} [data-sx-field-text]`;
25
+ /** One letter of the label (`label.split`), as a raw selector. `--sx-field-i` is its position. */
26
+ export const charOf = (id) => `${fieldOf(id)} [data-sx-field-char]`;
27
+ /** The input or textarea, as a raw selector. */
28
+ export const controlOf = (id) => `${fieldOf(id)} ${CONTROL}`;
29
+ /** The icon, as a raw selector. */
30
+ export const iconOf = (id) => `${fieldOf(id)} [data-sx-field-icon]`;
31
+ /** An effect's layer, as a raw selector. */
32
+ export const layerOf = (id, part) => part ? `[data-sx-field-layer="${id}"][data-sx-field-part="${part}"]` : `[data-sx-field-layer="${id}"]`;
33
+ /** A named span inside an effect's layer, as a raw selector. */
34
+ export const childOf = (id, part, layerPart) => `${layerOf(id, layerPart)} > [data-sx-field-part="${part}"]`;
35
+ /** The field holds the focus (the input, or a button in its end slot). */
36
+ export const FOCUSED = ":focus-within";
37
+ /** The field has text in it (typed or autofilled). */
38
+ export const FILLED = `:is(:has(${CONTROL}:not(:placeholder-shown)), :has(${CONTROL}:autofill))`;
39
+ /** Focused or filled: where a floating label goes up. Autofill counts, so the label never sits on the text (atlas rule 5). */
40
+ export const RAISED = `:is(:focus-within, :has(${CONTROL}:not(:placeholder-shown)), :has(${CONTROL}:autofill))`;
41
+ /** The field is loading its value (`busy`). */
42
+ export const BUSY = `:has(${CONTROL}[aria-busy="true"])`;
43
+ /**
44
+ * The field is wrong: the browser's own check once the user has left it or tried to submit (`:user-invalid`, never
45
+ * `:invalid`, which fires while typing), or the app's (`aria-invalid`, which `error`, `invalid` and `status` set).
46
+ */
47
+ export const INVALID = `:has(${CONTROL}:user-invalid, ${CONTROL}[aria-invalid="true"])`;
48
+ /**
49
+ * The field is right: an async check said so (`status="valid"`), or the user filled it, left it, and neither the browser
50
+ * nor the app found a fault. An empty optional field stays neutral.
51
+ */
52
+ export const VALID = `:is([data-sx-status="valid"], :has(${CONTROL}:user-valid:not([aria-invalid="true"]))${FILLED}):not(${INVALID})`;
53
+ /** The field was just sent to (`focusFirstError`, an error summary's link): it flashes once. */
54
+ export const FLASH = "[data-sx-flash]";
55
+ // --- choices: a checkbox (effects on each option's root) or a radio group (effects on the group, options inside) ---
56
+ /** A checkbox wearing this effect (the option's root), as a raw selector. */
57
+ export const choiceOf = (id) => `[data-sx-choice~="${id}"]`;
58
+ /** A Select or a Combobox wearing this effect (its root), as a raw selector. */
59
+ export const pickerOf = (id) => `[data-sx-picker~="${id}"]`;
60
+ /**
61
+ * The picker is open: a Combobox says so (`data-sx-open`), a `<select>` with `:open`. Inside `:is()`, so a browser
62
+ * that doesn't know `:open` drops only that part.
63
+ */
64
+ export const OPEN = ':is([data-sx-open], :has(select:open))';
65
+ /** A Combobox's popup, and a `<select>`'s own picker where it can be styled. */
66
+ export const POPUP = "[data-sx-picker-popup]";
67
+ /** A Select's real `<select>`. */
68
+ export const SELECT = "select[data-sx-picker-control]";
69
+ /** The arrow at the box's end: a span in a Select, a button in a Combobox. Its `svg` turns. */
70
+ export const ARROW = "[data-sx-picker-arrow]";
71
+ /** A Combobox option. A `<select>`'s are `option` elements. */
72
+ export const OPTION = "[data-sx-option]";
73
+ /** A chosen value of a `multiple` Combobox; `data-sx-leaving` while it plays its way out. */
74
+ export const CHIP = "[data-sx-chip]";
75
+ /** A Range wearing this effect (its root), as a raw selector. */
76
+ export const rangeOf = (id) => `[data-sx-range~="${id}"]`;
77
+ /** A Range's drawn rail, and its drawn thumbs (`[data-sx-thumb="a"]`, and `"b"` with two). */
78
+ export const RAIL = "[data-sx-range-track]";
79
+ export const KNOB = "[data-sx-range-thumb]";
80
+ /**
81
+ * A Range's thumb while it is being dragged (by its own thumb or from the rail), as a raw selector. Each drawn thumb
82
+ * carries its place, `--sx-at` (0-1); the root carries the filled stretch, `--sx-range-from` / `--sx-range-to`.
83
+ */
84
+ export const draggedKnob = (root, target = "") => ["a", "b"].map((t) => `${root}[data-sx-dragging="${t}"] ${KNOB}[data-sx-thumb="${t}"]${target ? ` ${target}` : ""}`).join(", ");
85
+ /** A Range's thumb while its input holds the keyboard's focus, as a raw selector. */
86
+ export const keyedKnob = (root, target = "") => ["a", "b"].map((t) => `${root}:has([data-sx-range-control][data-sx-thumb="${t}"]:focus-visible) ${KNOB}[data-sx-thumb="${t}"]${target ? ` ${target}` : ""}`).join(", ");
87
+ /** A ChipGroup wearing this effect (the group's `<fieldset>`), as a raw selector. */
88
+ export const chipsOf = (id) => `[data-sx-chips~="${id}"]`;
89
+ /** One filter chip: a label round its real checkbox (or radio), which lies over the whole chip at opacity 0. */
90
+ export const CHIP_OPTION = "[data-sx-chip-option]";
91
+ export const CHIP_CONTROL = "[data-sx-chip-control]";
92
+ /** The chip's check, before its words: a column that opens when the chip is on; its `path` is the tick. */
93
+ export const CHIP_CHECK = "[data-sx-chip-check]";
94
+ /** The chip is on. */
95
+ export const CHIP_ON = `:has(${CHIP_CONTROL}:checked)`;
96
+ /** A chip's layer, as a raw selector. */
97
+ export const chipLayer = (id, part) => part ? `[data-sx-chip-layer="${id}"][data-sx-chip-part="${part}"]` : `[data-sx-chip-layer="${id}"]`;
98
+ /** A FileDrop wearing this effect (its root), as a raw selector. */
99
+ export const fileOf = (id) => `[data-sx-file~="${id}"]`;
100
+ /** The drop zone (it holds the real file input), and each file's card in the list. */
101
+ export const ZONE = "[data-sx-file-zone]";
102
+ export const CARD = "[data-sx-file-card]";
103
+ /**
104
+ * Files are dragged over the zone (`data-sx-over="ok"`), or files it won't take (`"reject"`, where the browser tells the
105
+ * types while dragging). The zone just refused a file: `data-sx-rejected`, for a moment.
106
+ */
107
+ export const OVER = '[data-sx-over="ok"]';
108
+ export const OVER_REJECT = '[data-sx-over="reject"]';
109
+ export const REJECTED = "[data-sx-rejected]";
110
+ /** A FileDrop's layer, as a raw selector. */
111
+ export const fileLayer = (id, part) => part ? `[data-sx-file-layer="${id}"][data-sx-file-part="${part}"]` : `[data-sx-file-layer="${id}"]`;
112
+ /** FormSteps wearing this effect (its root), as a raw selector. */
113
+ export const stepsOf = (id) => `[data-sx-steps~="${id}"]`;
114
+ /**
115
+ * One step (`data-sx-active` on the current one, `data-sx-leaving` on the one playing its way out), and the progress's
116
+ * marks (`data-sx-done` on each step done, `aria-current="step"` on the current one). The root carries the way it moves,
117
+ * `--sx-steps-way` (1 forward, -1 back), and `data-sx-moved` once the user has moved (nothing plays on load).
118
+ */
119
+ export const STEP = "[data-sx-step]";
120
+ export const STEP_MARK = "[data-sx-step-mark]";
121
+ /** A switch wearing this effect (its root), as a raw selector. */
122
+ export const switchOf = (id) => `[data-sx-switch~="${id}"]`;
123
+ /** A switch's thumb. Its place: `--sx-switch-at` (0 off, 1 on, the finger's place while dragged). */
124
+ export const THUMB = "[data-sx-switch-thumb]";
125
+ /** How far the thumb travels, as a length: the track's width less its height. */
126
+ export const TRAVEL = "(var(--sx-switch-w) - var(--sx-switch-h))";
127
+ /** A radio group wearing this effect, as a raw selector. */
128
+ export const radiosOf = (id) => `[data-sx-radios~="${id}"]`;
129
+ /** One option: a checkbox's root, or one radio of a group. */
130
+ export const ITEM = "[data-sx-choice]";
131
+ /** The real checkbox or radio, at opacity 0 on top of the drawn box. */
132
+ export const CHOICE = "[data-sx-choice-control]";
133
+ /** The parts of an option. */
134
+ export const BOX = "[data-sx-choice-box]";
135
+ export const MARK = "[data-sx-choice-mark]";
136
+ export const TEXT = "[data-sx-choice-text]";
137
+ export const ROW = "[data-sx-choice-row]";
138
+ /** The options' box of a group (where `track` layers go). */
139
+ export const OPTIONS = "[data-sx-group-options]";
140
+ /** An option's layer, as a raw selector. */
141
+ export const choiceLayer = (id, part) => part ? `[data-sx-choice-layer="${id}"][data-sx-choice-part="${part}"]` : `[data-sx-choice-layer="${id}"]`;
142
+ /** A named span inside an option's layer. */
143
+ export const choiceChild = (id, part, layerPart) => `${choiceLayer(id, layerPart)} > [data-sx-choice-part="${part}"]`;
144
+ /** The option is checked (for a mixed checkbox, see MIXED). */
145
+ export const CHECKED = `:has(${CHOICE}:checked)`;
146
+ /** The checkbox is mixed: `indeterminate` (the attribute stands in on the server, before the property is set). */
147
+ export const MIXED = `:is(:has(${CHOICE}:indeterminate), [data-sx-mixed])`;
148
+ /**
149
+ * The user changed this option (it is `:user-valid` or `:user-invalid` from then on, in every engine): a pop, a jelly, a
150
+ * pulse or a burst plays when it is checked by hand, never for an option that loads checked.
151
+ */
152
+ export const CHANGED = `:has(${CHOICE}:is(:user-valid, :user-invalid))`;
153
+ /** The option holds the keyboard focus. */
154
+ export const KEYED = `:has(${CHOICE}:focus-visible)`;
155
+ /** An option that can't be used. */
156
+ export const IDLE = `:has(${CHOICE}:disabled)`;
157
+ /**
158
+ * `target` (raw, inside the option) while the option is in `state`. `root` is the effect's own root: a checkbox
159
+ * (`choiceOf`) or a radio group (`radiosOf`, then the state applies to each option in it).
160
+ */
161
+ export function inItem(root, state, target = "") {
162
+ const item = root.startsWith("[data-sx-radios") ? `${root} ${ITEM}${state}` : `${root}${state}`;
163
+ return target ? `${item} ${target}` : item;
164
+ }
165
+ /** A rule for an option's `target` while the option is hovered, where hover exists. A disabled option stays still. */
166
+ export function whenItemHover(root, target, body) {
167
+ return ` @media (hover: hover) and (pointer: fine) {
168
+ ${at(inItem(root, `:not(${IDLE}):hover`, target))} { ${body} }
169
+ }`;
170
+ }
171
+ /** The field is disabled. */
172
+ const ENABLED = `:not(:has(${CONTROL}:disabled))`;
173
+ /** `target` (a raw selector inside a field wearing `id`, or the field itself) while the field is in `state`. */
174
+ export function inField(id, state, target) {
175
+ const field = fieldOf(id);
176
+ return target.startsWith(field) ? `${field}${state}${target.slice(field.length)}` : `${field}${state} ${target}`;
177
+ }
178
+ /** A rule for `target` while the field holds the focus. */
179
+ export const whenFocused = (id, target, body) => ` ${at(inField(id, FOCUSED, target))} { ${body} }`;
180
+ /** A rule for `target` while the field is focused or has text. */
181
+ export const whenRaised = (id, target, body) => ` ${at(inField(id, RAISED, target))} { ${body} }`;
182
+ /** A rule for `target` while the field is loading its value. */
183
+ export const whenBusy = (id, target, body) => ` ${at(inField(id, BUSY, target))} { ${body} }`;
184
+ /**
185
+ * A rule for `target` while the field is hovered, where hover exists: `:hover` sits inside the media query, so a tap
186
+ * never leaves it stuck on a phone. A disabled field stays still.
187
+ */
188
+ export function whenHover(id, target, body) {
189
+ return ` @media (hover: hover) and (pointer: fine) {
190
+ ${at(inField(id, `${ENABLED}:hover`, target))} { ${body} }
191
+ }`;
192
+ }
193
+ /** The easing most effects use. */
194
+ export const EASE = "var(--ease-sx-out, ease-out)";
195
+ /** A springy curve that overshoots and settles. */
196
+ export const SPRING = "linear(0, 0.45 12%, 0.85 25%, 1.08 38%, 1.1 46%, 1.03 62%, 0.99 78%, 1)";
197
+ /** A `transition` for some properties at an effect's duration (its `time` var). */
198
+ export const timed = (id, properties, ease = EASE) => `transition: ${properties.split(",").map((p) => `${p.trim()} ${v(id, "time")} ${ease}`).join(", ")};`;
199
+ /**
200
+ * A loop stops while the page pauses its loops (`usePauseLoops`, WCAG 2.2.2). Off screen, the base sheet pauses every
201
+ * animation in the field (`data-sx-field-off`).
202
+ */
203
+ export const loopPaused = (target) => ` :where(html[data-sx-loops-paused] ${target}) { animation-play-state: paused; }`;
204
+ /**
205
+ * A form effect from its registry id, its rules and its parts. Rules go in `@layer components`. It doesn't read the
206
+ * registry: that would put every effect's label and description in the download of any page with one field.
207
+ */
208
+ export function defineForm(id, css, parts = {}) {
209
+ const head = parts.head ? `${parts.head}\n` : "";
210
+ const state = [parts.state, parts.marksFocus].filter(Boolean).join("\n");
211
+ return {
212
+ id,
213
+ tier: parts.tier ?? "all",
214
+ fits: parts.fits ?? ["field"],
215
+ css: css ? `${head}@layer components {\n${css}\n}` : "",
216
+ vars: parts.vars ?? {},
217
+ layers: parts.layers ?? [],
218
+ claims: parts.claims ?? [],
219
+ needs: parts.needs ?? {},
220
+ ...(state ? { stateCss: `@layer components {\n${state}\n}` } : {}),
221
+ ...(parts.label ? { label: parts.label } : {}),
222
+ ...(parts.program ? { program: parts.program } : {}),
223
+ ...(parts.marksFocus ? { marksFocus: true } : {}),
224
+ ...(parts.fallback ? { fallback: parts.fallback } : {}),
225
+ };
226
+ }
@@ -0,0 +1,7 @@
1
+ import type { FormEffect } from "../../types.js";
2
+ export interface ChipPopOptions {
3
+ /** Seconds a chip takes to pop in or out. Default `0.2`. */
4
+ readonly duration?: number;
5
+ }
6
+ /** Chips pop in when picked and shrink away when removed; the others glide into place. A Combobox's only. */
7
+ export declare function chipPop(options?: ChipPopOptions): FormEffect;
@@ -0,0 +1,28 @@
1
+ import { CHIP, EASE, SPRING, at, defineForm, pickerOf, v, varName } from "../kit.js";
2
+ const ID = "chipPop";
3
+ // A chip picked in a `multiple` Combobox pops in; a removed one shrinks away before it leaves (the Combobox keeps it,
4
+ // marked `data-sx-leaving`, until this animation ends: `needs.flip`), and the chips after it glide into the gap (the
5
+ // Combobox's FLIP: an inline `translate` this transition takes back to nothing). Chips only pop while the combobox
6
+ // has the focus, so the ones a page loads with stay still.
7
+ const CSS = ` ${at(`${pickerOf(ID)} ${CHIP}`)} {
8
+ transition: translate ${v(ID, "time")} ${SPRING}, scale ${v(ID, "time")} ${SPRING}, opacity ${v(ID, "time")} ${EASE};
9
+ }
10
+ @starting-style {
11
+ ${at(`${pickerOf(ID)}:focus-within ${CHIP}`)} {
12
+ scale: 0.6;
13
+ opacity: 0;
14
+ }
15
+ }
16
+ ${at(`${pickerOf(ID)} ${CHIP}[data-sx-leaving]`)} {
17
+ animation: sx-form-chipPop-out ${v(ID, "time")} ${EASE} forwards;
18
+ }
19
+ @keyframes sx-form-chipPop-out {
20
+ to {
21
+ scale: 0.6;
22
+ opacity: 0;
23
+ }
24
+ }`;
25
+ /** Chips pop in when picked and shrink away when removed; the others glide into place. A Combobox's only. */
26
+ export function chipPop(options = {}) {
27
+ return defineForm(ID, CSS, { fits: ["picker"], needs: { flip: true }, vars: { [varName(ID, "time")]: `${options.duration ?? 0.2}s` } });
28
+ }
@@ -0,0 +1 @@
1
+ export declare const CHIP_POP_SCHEMA: import("../../../schema/types.js").Schema;