@mhmo91/schmancy 0.10.14 → 0.10.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (544) hide show
  1. package/custom-elements.json +2554 -3086
  2. package/dist/active-host-BP0zy_Y9.js +63 -0
  3. package/dist/{active-host-CvNYoprt.js.map → active-host-BP0zy_Y9.js.map} +1 -1
  4. package/dist/active-host-jH3iloCR.cjs +1 -0
  5. package/dist/{active-host-CcIa2tmW.cjs.map → active-host-jH3iloCR.cjs.map} +1 -1
  6. package/dist/agent/schmancy.agent.js +2579 -2385
  7. package/dist/agent/schmancy.agent.js.map +1 -1
  8. package/dist/agent/schmancy.manifest.json +971 -1189
  9. package/dist/{animation-CO_Csq84.cjs.map → animation-CCOIW4wJ.cjs.map} +1 -1
  10. package/dist/{animation-BK-8BwY8.js.map → animation-DCznELuT.js.map} +1 -1
  11. package/dist/{area-C_kgZZhN.js → area-ChxsDTu_.js} +2 -2
  12. package/dist/{area-C_kgZZhN.js.map → area-ChxsDTu_.js.map} +1 -1
  13. package/dist/{area-DFPtKzWy.cjs → area-Qt6yUnuA.cjs} +3 -3
  14. package/dist/{area-DFPtKzWy.cjs.map → area-Qt6yUnuA.cjs.map} +1 -1
  15. package/dist/area.cjs +1 -1
  16. package/dist/area.js +2 -2
  17. package/dist/{audio-CluX8Qpq.cjs → audio-D-TZzpXF.cjs} +1 -1
  18. package/dist/{audio-CluX8Qpq.cjs.map → audio-D-TZzpXF.cjs.map} +1 -1
  19. package/dist/{audio-DcXphulJ.js → audio-DS43uoRA.js} +1 -1
  20. package/dist/{audio-DcXphulJ.js.map → audio-DS43uoRA.js.map} +1 -1
  21. package/dist/audio.cjs +1 -1
  22. package/dist/audio.js +2 -2
  23. package/dist/{autocomplete-DWSuwSRS.js → autocomplete-CXvUjMD-.js} +46 -71
  24. package/dist/autocomplete-CXvUjMD-.js.map +1 -0
  25. package/dist/autocomplete-Ck2zbdF9.cjs +115 -0
  26. package/dist/autocomplete-Ck2zbdF9.cjs.map +1 -0
  27. package/dist/autocomplete.cjs +1 -1
  28. package/dist/autocomplete.js +1 -1
  29. package/dist/avatar.cjs +2 -2
  30. package/dist/avatar.cjs.map +1 -1
  31. package/dist/avatar.js +3 -3
  32. package/dist/badge.cjs +1 -1
  33. package/dist/badge.js +1 -1
  34. package/dist/{boat-CZma2ojF.js → boat-Bj0wVcZi.js} +5 -5
  35. package/dist/{boat-CZma2ojF.js.map → boat-Bj0wVcZi.js.map} +1 -1
  36. package/dist/{boat-Dy6cc3hB.cjs → boat-DpFkILFF.cjs} +2 -2
  37. package/dist/{boat-Dy6cc3hB.cjs.map → boat-DpFkILFF.cjs.map} +1 -1
  38. package/dist/boat.cjs +1 -1
  39. package/dist/boat.js +1 -1
  40. package/dist/breadcrumb.cjs +3 -3
  41. package/dist/breadcrumb.cjs.map +1 -1
  42. package/dist/breadcrumb.js +2 -2
  43. package/dist/{busy-DCsqryvq.cjs → busy-CtcnclA3.cjs} +3 -3
  44. package/dist/{busy-DCsqryvq.cjs.map → busy-CtcnclA3.cjs.map} +1 -1
  45. package/dist/{busy-DeV2ByMw.js → busy-CyZSBnZP.js} +2 -2
  46. package/dist/{busy-DeV2ByMw.js.map → busy-CyZSBnZP.js.map} +1 -1
  47. package/dist/busy.cjs +1 -1
  48. package/dist/busy.js +1 -1
  49. package/dist/button.cjs +4 -4
  50. package/dist/button.cjs.map +1 -1
  51. package/dist/button.js +19 -4
  52. package/dist/button.js.map +1 -1
  53. package/dist/{card--GgSX4X5.cjs → card-Cl6jp1yX.cjs} +5 -5
  54. package/dist/{card--GgSX4X5.cjs.map → card-Cl6jp1yX.cjs.map} +1 -1
  55. package/dist/{card-BTTsHzJJ.js → card-nYZCKmOO.js} +3 -3
  56. package/dist/{card-BTTsHzJJ.js.map → card-nYZCKmOO.js.map} +1 -1
  57. package/dist/card.cjs +1 -1
  58. package/dist/card.js +1 -1
  59. package/dist/{checkbox-NNReP9s_.cjs → checkbox-BeNo0ZGt.cjs} +4 -4
  60. package/dist/{checkbox-Cj5j-ppk.js.map → checkbox-BeNo0ZGt.cjs.map} +1 -1
  61. package/dist/{checkbox-Cj5j-ppk.js → checkbox-DiUrZiyc.js} +17 -30
  62. package/dist/checkbox-DiUrZiyc.js.map +1 -0
  63. package/dist/checkbox.cjs +1 -1
  64. package/dist/checkbox.js +1 -1
  65. package/dist/{chips-CP-CbfoZ.js → chips-CfPFXv7Z.js} +5 -5
  66. package/dist/{chips-CP-CbfoZ.js.map → chips-CfPFXv7Z.js.map} +1 -1
  67. package/dist/{chips-iporOXxK.cjs → chips-DK6m-VCM.cjs} +5 -5
  68. package/dist/{chips-iporOXxK.cjs.map → chips-DK6m-VCM.cjs.map} +1 -1
  69. package/dist/chips.cjs +1 -1
  70. package/dist/chips.js +2 -2
  71. package/dist/connectivity.cjs +2 -2
  72. package/dist/connectivity.cjs.map +1 -1
  73. package/dist/connectivity.js +3 -3
  74. package/dist/content-drawer.cjs +1 -1
  75. package/dist/content-drawer.js +1 -1
  76. package/dist/{context-DJTJnSK4.js.map → context-6oXCZmZN.js.map} +1 -1
  77. package/dist/{context-BpCETidA.cjs.map → context-CRZeiCqq.cjs.map} +1 -1
  78. package/dist/{cursor-glow-Bulq-38P.cjs → cursor-glow-C8LgCxpI.cjs} +1 -1
  79. package/dist/{cursor-glow-Bulq-38P.cjs.map → cursor-glow-C8LgCxpI.cjs.map} +1 -1
  80. package/dist/{cursor-glow-Ah7VXSj7.js → cursor-glow-Cs2XLDB9.js} +1 -1
  81. package/dist/{cursor-glow-Ah7VXSj7.js.map → cursor-glow-Cs2XLDB9.js.map} +1 -1
  82. package/dist/date-range-DA6anfcF.cjs +131 -0
  83. package/dist/date-range-DA6anfcF.cjs.map +1 -0
  84. package/dist/{date-range-CgNujP8r.js → date-range-DjlF2u7o.js} +124 -89
  85. package/dist/date-range-DjlF2u7o.js.map +1 -0
  86. package/dist/date-range-inline-BfYK795W.cjs +43 -0
  87. package/dist/{date-range-inline-D4IjOOO0.cjs.map → date-range-inline-BfYK795W.cjs.map} +1 -1
  88. package/dist/{date-range-inline-C2PXX_GY.js → date-range-inline-n7y_H6PJ.js} +2 -2
  89. package/dist/{date-range-inline-C2PXX_GY.js.map → date-range-inline-n7y_H6PJ.js.map} +1 -1
  90. package/dist/date-range-inline.cjs +1 -1
  91. package/dist/date-range-inline.js +1 -1
  92. package/dist/date-range.cjs +1 -1
  93. package/dist/date-range.js +1 -1
  94. package/dist/delay.cjs +2 -2
  95. package/dist/delay.cjs.map +1 -1
  96. package/dist/delay.js +3 -3
  97. package/dist/{details-DT2b3xOn.cjs → details-BdAVsLl-.cjs} +2 -2
  98. package/dist/{details-DT2b3xOn.cjs.map → details-BdAVsLl-.cjs.map} +1 -1
  99. package/dist/{details-VjaNwtfd.js → details-CS_ToAOj.js} +6 -6
  100. package/dist/{details-VjaNwtfd.js.map → details-CS_ToAOj.js.map} +1 -1
  101. package/dist/details.cjs +1 -1
  102. package/dist/details.js +1 -1
  103. package/dist/directives.cjs +1 -1
  104. package/dist/directives.js +5 -5
  105. package/dist/{divider-BMO8pzEO.js → divider-COLK0RbT.js} +2 -2
  106. package/dist/{divider-BMO8pzEO.js.map → divider-COLK0RbT.js.map} +1 -1
  107. package/dist/{divider-BW33TZ-X.cjs → divider-CvWAnvdO.cjs} +2 -2
  108. package/dist/{divider-BW33TZ-X.cjs.map → divider-CvWAnvdO.cjs.map} +1 -1
  109. package/dist/divider.cjs +1 -1
  110. package/dist/divider.js +1 -1
  111. package/dist/dropdown.cjs +3 -3
  112. package/dist/dropdown.cjs.map +1 -1
  113. package/dist/dropdown.js +2 -2
  114. package/dist/{expand-DbELKKOt.js → expand-D9LzmpoV.js} +5 -5
  115. package/dist/{expand-DbELKKOt.js.map → expand-D9LzmpoV.js.map} +1 -1
  116. package/dist/{expand-_f5EUKWB.cjs → expand-r2sATPUJ.cjs} +3 -3
  117. package/dist/{expand-_f5EUKWB.cjs.map → expand-r2sATPUJ.cjs.map} +1 -1
  118. package/dist/expand.cjs +1 -1
  119. package/dist/expand.js +1 -1
  120. package/dist/float-2nHYuBx-.cjs +1 -0
  121. package/dist/{float-CKmd-0-t.cjs.map → float-2nHYuBx-.cjs.map} +1 -1
  122. package/dist/{float-B6RBb2dN.js → float-BWy39CXr.js} +2 -2
  123. package/dist/{float-B6RBb2dN.js.map → float-BWy39CXr.js.map} +1 -1
  124. package/dist/float.cjs +1 -1
  125. package/dist/float.js +1 -1
  126. package/dist/form-DhjedCWm.js +258 -0
  127. package/dist/form-DhjedCWm.js.map +1 -0
  128. package/dist/form-g5c70rac.cjs +42 -0
  129. package/dist/form-g5c70rac.cjs.map +1 -0
  130. package/dist/form.cjs +1 -1
  131. package/dist/form.js +2 -2
  132. package/dist/handover/agent-runtime-followups.md +1 -1
  133. package/dist/handover/agent-runtime-v1.md +3 -3
  134. package/dist/{hashContent-Bobsobip.cjs.map → hashContent-Ck6laKlk.cjs.map} +1 -1
  135. package/dist/{hashContent-BU6jl5ih.js.map → hashContent-dJrI-9sc.js.map} +1 -1
  136. package/dist/{icons-r-S17M8U.cjs → icons-1HIENBco.cjs} +2 -2
  137. package/dist/{icons-r-S17M8U.cjs.map → icons-1HIENBco.cjs.map} +1 -1
  138. package/dist/{icons-CoDo95Cu.js → icons-3y0kr1aB.js} +3 -3
  139. package/dist/{icons-CoDo95Cu.js.map → icons-3y0kr1aB.js.map} +1 -1
  140. package/dist/icons.cjs +1 -1
  141. package/dist/icons.js +1 -1
  142. package/dist/{iframe-P9c_qg1-.cjs → iframe-CjqYuZG5.cjs} +2 -2
  143. package/dist/{iframe-P9c_qg1-.cjs.map → iframe-CjqYuZG5.cjs.map} +1 -1
  144. package/dist/{iframe-k4oI-TIj.js → iframe-Z5gTK-gd.js} +2 -2
  145. package/dist/{iframe-k4oI-TIj.js.map → iframe-Z5gTK-gd.js.map} +1 -1
  146. package/dist/iframe.cjs +1 -1
  147. package/dist/iframe.js +1 -1
  148. package/dist/index.cjs +1 -1
  149. package/dist/index.js +60 -60
  150. package/dist/{input-D95GjINh.js → input-B-fw6f_r.js} +103 -104
  151. package/dist/input-B-fw6f_r.js.map +1 -0
  152. package/dist/input-BtcIhu0Q.cjs +52 -0
  153. package/dist/input-BtcIhu0Q.cjs.map +1 -0
  154. package/dist/{input-chip-DpC_XEKN.js → input-chip-CtQ0pH5b.js} +2 -2
  155. package/dist/{input-chip-DpC_XEKN.js.map → input-chip-CtQ0pH5b.js.map} +1 -1
  156. package/dist/{input-chip-D0ZXqTt5.cjs → input-chip-DZktYohr.cjs} +2 -2
  157. package/dist/{input-chip-D0ZXqTt5.cjs.map → input-chip-DZktYohr.cjs.map} +1 -1
  158. package/dist/input.cjs +1 -1
  159. package/dist/input.js +1 -1
  160. package/dist/json.cjs +2 -2
  161. package/dist/json.cjs.map +1 -1
  162. package/dist/json.js +3 -3
  163. package/dist/kbd.cjs +2 -2
  164. package/dist/kbd.cjs.map +1 -1
  165. package/dist/kbd.js +2 -2
  166. package/dist/{layout-CXPNsUIo.js → layout-BH28sKGc.js} +1 -1
  167. package/dist/{layout-CXPNsUIo.js.map → layout-BH28sKGc.js.map} +1 -1
  168. package/dist/{layout-Zhe7wSZ_.cjs → layout-Delq-QvR.cjs} +1 -1
  169. package/dist/{layout-Zhe7wSZ_.cjs.map → layout-Delq-QvR.cjs.map} +1 -1
  170. package/dist/layout.cjs +1 -1
  171. package/dist/layout.js +1 -1
  172. package/dist/{lazy-Dq9mRRjT.cjs.map → lazy-CayEFyC3.cjs.map} +1 -1
  173. package/dist/{lazy-B0ia54tT.js.map → lazy-D-bO2r4m.js.map} +1 -1
  174. package/dist/{lightbox-C-yHeoK0.cjs → lightbox-BHTZOn8K.cjs} +3 -3
  175. package/dist/{lightbox-C-yHeoK0.cjs.map → lightbox-BHTZOn8K.cjs.map} +1 -1
  176. package/dist/{lightbox-CovQtmyn.js → lightbox-BL3LWp-P.js} +9 -9
  177. package/dist/{lightbox-CovQtmyn.js.map → lightbox-BL3LWp-P.js.map} +1 -1
  178. package/dist/lightbox.cjs +1 -1
  179. package/dist/lightbox.js +1 -1
  180. package/dist/{list-CAijuky4.cjs → list-CHYa5VGY.cjs} +3 -3
  181. package/dist/{list-CAijuky4.cjs.map → list-CHYa5VGY.cjs.map} +1 -1
  182. package/dist/{list-C1pR9vhu.js → list-DLJL1JQj.js} +2 -2
  183. package/dist/{list-C1pR9vhu.js.map → list-DLJL1JQj.js.map} +1 -1
  184. package/dist/list.cjs +1 -1
  185. package/dist/list.js +1 -1
  186. package/dist/{magnetic-BJgB1dVi.cjs → magnetic-Bgh7aHHI.cjs} +1 -1
  187. package/dist/{magnetic-BJgB1dVi.cjs.map → magnetic-Bgh7aHHI.cjs.map} +1 -1
  188. package/dist/{magnetic-YwCNvtbB.js → magnetic-DxvoEz8_.js} +2 -2
  189. package/dist/{magnetic-YwCNvtbB.js.map → magnetic-DxvoEz8_.js.map} +1 -1
  190. package/dist/{menu-B59vZv9n.js → menu-BNq93w6X.js} +3 -3
  191. package/dist/{menu-B59vZv9n.js.map → menu-BNq93w6X.js.map} +1 -1
  192. package/dist/{menu-BaHO3Cip.cjs → menu-DAikvkeV.cjs} +3 -3
  193. package/dist/{menu-BaHO3Cip.cjs.map → menu-DAikvkeV.cjs.map} +1 -1
  194. package/dist/menu.cjs +1 -1
  195. package/dist/menu.js +1 -1
  196. package/dist/mixins-BOOu6q2n.cjs +298 -0
  197. package/dist/mixins-BOOu6q2n.cjs.map +1 -0
  198. package/dist/mixins-BWb9_e1s.js +680 -0
  199. package/dist/mixins-BWb9_e1s.js.map +1 -0
  200. package/dist/mixins.cjs +1 -1
  201. package/dist/mixins.js +2 -2
  202. package/dist/nav-drawer.cjs +1 -1
  203. package/dist/nav-drawer.js +1 -1
  204. package/dist/navigation-bar.cjs +1 -1
  205. package/dist/navigation-bar.js +1 -1
  206. package/dist/navigation-rail.cjs +3 -3
  207. package/dist/navigation-rail.cjs.map +1 -1
  208. package/dist/navigation-rail.js +2 -2
  209. package/dist/{notification-BeLoVa47.js → notification-CUmb9c3Y.js} +4 -4
  210. package/dist/{notification-BeLoVa47.js.map → notification-CUmb9c3Y.js.map} +1 -1
  211. package/dist/notification-Dy2azMyt.cjs +23 -0
  212. package/dist/{notification-BC9nG8Sr.cjs.map → notification-Dy2azMyt.cjs.map} +1 -1
  213. package/dist/notification.cjs +1 -1
  214. package/dist/notification.js +1 -1
  215. package/dist/{option-BWF4GBp-.cjs → option-CDgIKifG.cjs} +2 -2
  216. package/dist/{option-BWF4GBp-.cjs.map → option-CDgIKifG.cjs.map} +1 -1
  217. package/dist/{option-UvlSAcC4.js → option-DFvQ551b.js} +2 -2
  218. package/dist/{option-UvlSAcC4.js.map → option-DFvQ551b.js.map} +1 -1
  219. package/dist/option.cjs +1 -1
  220. package/dist/option.js +1 -1
  221. package/dist/{overlay-stack-DCDS17uj.js.map → overlay-stack-BR4iYivO.js.map} +1 -1
  222. package/dist/{overlay-stack-DPIe_aYv.cjs.map → overlay-stack-Dk0xETTy.cjs.map} +1 -1
  223. package/dist/overlay.cjs +2 -2
  224. package/dist/overlay.cjs.map +1 -1
  225. package/dist/{overlay.confirm-body-URtE1gI3.cjs → overlay.confirm-body-BkhNvr0c.cjs} +2 -2
  226. package/dist/{overlay.confirm-body-URtE1gI3.cjs.map → overlay.confirm-body-BkhNvr0c.cjs.map} +1 -1
  227. package/dist/{overlay.confirm-body-9W0B5QGv.js → overlay.confirm-body-uFp-0Zfh.js} +2 -2
  228. package/dist/{overlay.confirm-body-9W0B5QGv.js.map → overlay.confirm-body-uFp-0Zfh.js.map} +1 -1
  229. package/dist/overlay.js +8 -8
  230. package/dist/{overlay.service-DnZTcKyJ.cjs → overlay.service-1YWfUD2S.cjs} +1 -1
  231. package/dist/{overlay.service-DnZTcKyJ.cjs.map → overlay.service-1YWfUD2S.cjs.map} +1 -1
  232. package/dist/{overlay.service-CVqs2Gu1.js → overlay.service-BcF12kGb.js} +2 -2
  233. package/dist/{overlay.service-CVqs2Gu1.js.map → overlay.service-BcF12kGb.js.map} +1 -1
  234. package/dist/page.cjs +2 -2
  235. package/dist/page.cjs.map +1 -1
  236. package/dist/page.js +5 -5
  237. package/dist/{progress-CwzwY8Oe.cjs → progress-C02sWkmE.cjs} +2 -2
  238. package/dist/{progress-CwzwY8Oe.cjs.map → progress-C02sWkmE.cjs.map} +1 -1
  239. package/dist/{progress-C29Uw-WJ.js → progress-bLbGRuQ1.js} +2 -2
  240. package/dist/{progress-C29Uw-WJ.js.map → progress-bLbGRuQ1.js.map} +1 -1
  241. package/dist/progress.cjs +1 -1
  242. package/dist/progress.js +1 -1
  243. package/dist/radio-group-BA-jRct5.cjs +40 -0
  244. package/dist/radio-group-BA-jRct5.cjs.map +1 -0
  245. package/dist/{radio-group-CW8airhZ.js → radio-group-DA4eIGCj.js} +4 -4
  246. package/dist/radio-group-DA4eIGCj.js.map +1 -0
  247. package/dist/radio-group.cjs +1 -1
  248. package/dist/radio-group.js +1 -1
  249. package/dist/range.cjs +6 -4
  250. package/dist/range.cjs.map +1 -1
  251. package/dist/range.js +19 -15
  252. package/dist/range.js.map +1 -1
  253. package/dist/{reduced-motion-D-L12p7G.js.map → reduced-motion-D7LqTUMn.js.map} +1 -1
  254. package/dist/{reduced-motion-Ds-HjMzn.cjs.map → reduced-motion-Dzfp_w5x.cjs.map} +1 -1
  255. package/dist/{rxjs-utils-CVeJQ9KG.js.map → rxjs-utils-D9U4MW0Q.js.map} +1 -1
  256. package/dist/{rxjs-utils-DCUHg_Ml.cjs.map → rxjs-utils-kWPShgKu.cjs.map} +1 -1
  257. package/dist/rxjs-utils.cjs +1 -1
  258. package/dist/rxjs-utils.js +1 -1
  259. package/dist/{scroll-BotoGcMU.js → scroll-CG5up5oy.js} +2 -2
  260. package/dist/{scroll-BotoGcMU.js.map → scroll-CG5up5oy.js.map} +1 -1
  261. package/dist/{scroll-CmhmUebp.cjs → scroll-D8vBF_gY.cjs} +2 -2
  262. package/dist/{scroll-CmhmUebp.cjs.map → scroll-D8vBF_gY.cjs.map} +1 -1
  263. package/dist/{search-BLCRsxIC.cjs.map → search-DPKoC-dT.cjs.map} +1 -1
  264. package/dist/{search-BTz7-Rev.js.map → search-MvIBA93K.js.map} +1 -1
  265. package/dist/{select-Dbn-CImU.js → select-BrK1BJoU.js} +52 -73
  266. package/dist/select-BrK1BJoU.js.map +1 -0
  267. package/dist/select-Dh2j7Qc-.cjs +56 -0
  268. package/dist/select-Dh2j7Qc-.cjs.map +1 -0
  269. package/dist/select.cjs +1 -1
  270. package/dist/select.js +1 -1
  271. package/dist/skeleton.cjs +2 -2
  272. package/dist/skeleton.cjs.map +1 -1
  273. package/dist/skeleton.js +2 -2
  274. package/dist/skills/autocomplete.md +16 -3
  275. package/dist/skills/button.md +19 -0
  276. package/dist/skills/checkbox.md +19 -0
  277. package/dist/skills/date-range.md +19 -0
  278. package/dist/skills/form-ux-rules.md +55 -0
  279. package/dist/skills/form.md +121 -25
  280. package/dist/skills/input.md +19 -4
  281. package/dist/skills/range.md +15 -1
  282. package/dist/skills/schmancy/autocomplete.md +16 -3
  283. package/dist/skills/schmancy/button.md +19 -0
  284. package/dist/skills/schmancy/checkbox.md +19 -0
  285. package/dist/skills/schmancy/date-range.md +19 -0
  286. package/dist/skills/schmancy/form-ux-rules.md +55 -0
  287. package/dist/skills/schmancy/form.md +121 -25
  288. package/dist/skills/schmancy/input.md +19 -4
  289. package/dist/skills/schmancy/range.md +15 -1
  290. package/dist/skills/schmancy/select.md +13 -1
  291. package/dist/skills/schmancy/state.md +5 -0
  292. package/dist/skills/schmancy/switch.md +21 -2
  293. package/dist/skills/schmancy/textarea.md +13 -0
  294. package/dist/skills/select.md +13 -1
  295. package/dist/skills/state.md +5 -0
  296. package/dist/skills/switch.md +21 -2
  297. package/dist/skills/textarea.md +13 -0
  298. package/dist/slider.cjs +3 -3
  299. package/dist/slider.cjs.map +1 -1
  300. package/dist/slider.js +2 -2
  301. package/dist/{sound.service-kKfsN0m-.js → sound.service-BIN2W7Rv.js} +1 -1
  302. package/dist/{sound.service-kKfsN0m-.js.map → sound.service-BIN2W7Rv.js.map} +1 -1
  303. package/dist/{sound.service-BGs6m0Cm.cjs → sound.service-DyY78ukR.cjs} +1 -1
  304. package/dist/{sound.service-BGs6m0Cm.cjs.map → sound.service-DyY78ukR.cjs.map} +1 -1
  305. package/dist/{splash-screen-DtkjCJYo.js → splash-screen-BcjjJSlK.js} +2 -2
  306. package/dist/{splash-screen-DtkjCJYo.js.map → splash-screen-BcjjJSlK.js.map} +1 -1
  307. package/dist/{splash-screen-DlQUv-kV.cjs → splash-screen-Kr1sPtME.cjs} +2 -2
  308. package/dist/{splash-screen-DlQUv-kV.cjs.map → splash-screen-Kr1sPtME.cjs.map} +1 -1
  309. package/dist/splash-screen.cjs +1 -1
  310. package/dist/splash-screen.js +1 -1
  311. package/dist/{src-DEUjlTsX.cjs → src-B2-CU8fu.cjs} +11 -11
  312. package/dist/{src-DEUjlTsX.cjs.map → src-B2-CU8fu.cjs.map} +1 -1
  313. package/dist/{src-D6e0adHi.js → src-DvywUq7l.js} +38 -38
  314. package/dist/{src-D6e0adHi.js.map → src-DvywUq7l.js.map} +1 -1
  315. package/dist/state-avic94Ft.cjs +1 -0
  316. package/dist/{state-DNdCPITt.cjs.map → state-avic94Ft.cjs.map} +1 -1
  317. package/dist/{state-BusMG6sM.js → state-nm8yzMPp.js} +1 -2
  318. package/dist/{state-BusMG6sM.js.map → state-nm8yzMPp.js.map} +1 -1
  319. package/dist/state.cjs +1 -1
  320. package/dist/state.js +2 -2
  321. package/dist/steps.cjs +3 -3
  322. package/dist/steps.cjs.map +1 -1
  323. package/dist/steps.js +2 -2
  324. package/dist/{surface-A82O1kgu.js → surface-BtMMHKol.js} +2 -2
  325. package/dist/{surface-A82O1kgu.js.map → surface-BtMMHKol.js.map} +1 -1
  326. package/dist/surface-CgXeKdGL.cjs +7 -0
  327. package/dist/{surface-BpppoNXN.cjs.map → surface-CgXeKdGL.cjs.map} +1 -1
  328. package/dist/surface.cjs +1 -1
  329. package/dist/surface.js +1 -1
  330. package/dist/switch.cjs +3 -3
  331. package/dist/switch.cjs.map +1 -1
  332. package/dist/switch.js +27 -43
  333. package/dist/switch.js.map +1 -1
  334. package/dist/table.cjs +3 -3
  335. package/dist/table.cjs.map +1 -1
  336. package/dist/table.js +2 -2
  337. package/dist/{tabs-cVHHd1dY.js → tabs-CikPr7by.js} +2 -2
  338. package/dist/{tabs-cVHHd1dY.js.map → tabs-CikPr7by.js.map} +1 -1
  339. package/dist/{tabs-TO3UiBsm.cjs → tabs-CitVls3_.cjs} +2 -2
  340. package/dist/{tabs-TO3UiBsm.cjs.map → tabs-CitVls3_.cjs.map} +1 -1
  341. package/dist/tabs.cjs +1 -1
  342. package/dist/tabs.js +1 -1
  343. package/dist/teleport.cjs +1 -1
  344. package/dist/teleport.js +1 -1
  345. package/dist/textarea-CqV1wvmB.cjs +43 -0
  346. package/dist/textarea-CqV1wvmB.cjs.map +1 -0
  347. package/dist/textarea-DVkwQSis.js +186 -0
  348. package/dist/textarea-DVkwQSis.js.map +1 -0
  349. package/dist/textarea.cjs +1 -1
  350. package/dist/textarea.js +1 -1
  351. package/dist/{theme-CT408FqH.js → theme-BIWS4TOW.js} +9 -9
  352. package/dist/{theme-CT408FqH.js.map → theme-BIWS4TOW.js.map} +1 -1
  353. package/dist/theme-DMgjiKda.cjs +181 -0
  354. package/dist/{theme-CpuF3D3q.cjs.map → theme-DMgjiKda.cjs.map} +1 -1
  355. package/dist/{theme-button-pTb5-Wxx.js → theme-button-DC_shZ_7.js} +2 -2
  356. package/dist/{theme-button-pTb5-Wxx.js.map → theme-button-DC_shZ_7.js.map} +1 -1
  357. package/dist/theme-button-ENKa3TPT.cjs +8 -0
  358. package/dist/{theme-button-B6Xf-EiH.cjs.map → theme-button-ENKa3TPT.cjs.map} +1 -1
  359. package/dist/theme-button.cjs +1 -1
  360. package/dist/theme-button.js +1 -1
  361. package/dist/theme.cjs +1 -1
  362. package/dist/{theme.interface-B9TjbSBF.js.map → theme.interface-C8OHheXg.js.map} +1 -1
  363. package/dist/{theme.interface-BujperTo.cjs.map → theme.interface-CYo4UpWK.cjs.map} +1 -1
  364. package/dist/theme.js +4 -4
  365. package/dist/{theme.service-DIUo1mBP.js → theme.service-BOWIT_5k.js} +1 -1
  366. package/dist/{theme.service-DIUo1mBP.js.map → theme.service-BOWIT_5k.js.map} +1 -1
  367. package/dist/{theme.service-Cfk88qHK.cjs → theme.service-DkdH1t60.cjs} +1 -1
  368. package/dist/{theme.service-Cfk88qHK.cjs.map → theme.service-DkdH1t60.cjs.map} +1 -1
  369. package/dist/tree.cjs +2 -2
  370. package/dist/tree.cjs.map +1 -1
  371. package/dist/tree.js +2 -2
  372. package/dist/typography.cjs +2 -2
  373. package/dist/typography.cjs.map +1 -1
  374. package/dist/typography.js +2 -2
  375. package/dist/{utils-kND2Z9Xg.js → utils-Cj_nRRyx.js} +2 -2
  376. package/dist/{utils-kND2Z9Xg.js.map → utils-Cj_nRRyx.js.map} +1 -1
  377. package/dist/{utils-Dt5PpmaQ.cjs → utils-D2QUu4-g.cjs} +1 -1
  378. package/dist/{utils-Dt5PpmaQ.cjs.map → utils-D2QUu4-g.cjs.map} +1 -1
  379. package/dist/utils.cjs +1 -1
  380. package/dist/utils.js +4 -4
  381. package/dist/visually-hidden.cjs +2 -2
  382. package/dist/visually-hidden.cjs.map +1 -1
  383. package/dist/visually-hidden.js +2 -2
  384. package/dist/{window-CuBcOxbc.js → window-BTecgE_U.js} +7 -7
  385. package/dist/{window-CuBcOxbc.js.map → window-BTecgE_U.js.map} +1 -1
  386. package/dist/{window-CSKvv4Ts.cjs → window-DGydMS0g.cjs} +2 -2
  387. package/dist/{window-CSKvv4Ts.cjs.map → window-DGydMS0g.cjs.map} +1 -1
  388. package/dist/window.cjs +1 -1
  389. package/dist/window.js +1 -1
  390. package/package.json +1 -1
  391. package/skills/schmancy/autocomplete.md +16 -3
  392. package/skills/schmancy/button.md +19 -0
  393. package/skills/schmancy/checkbox.md +19 -0
  394. package/skills/schmancy/date-range.md +19 -0
  395. package/skills/schmancy/form-ux-rules.md +55 -0
  396. package/skills/schmancy/form.md +121 -25
  397. package/skills/schmancy/input.md +19 -4
  398. package/skills/schmancy/range.md +15 -1
  399. package/skills/schmancy/select.md +13 -1
  400. package/skills/schmancy/state.md +5 -0
  401. package/skills/schmancy/switch.md +21 -2
  402. package/skills/schmancy/textarea.md +13 -0
  403. package/src/button/button.test.ts +122 -0
  404. package/src/button/button.ts +36 -0
  405. package/src/{autocomplete → form/fields/autocomplete}/autocomplete.ts +48 -75
  406. package/src/{checkbox → form/fields/checkbox}/checkbox.test.ts +1 -1
  407. package/src/form/fields/checkbox/checkbox.ts +126 -0
  408. package/src/form/fields/date-range/date-range.test.ts +102 -0
  409. package/src/{date-range → form/fields/date-range}/date-range.ts +90 -7
  410. package/src/form/fields/input/input.test.ts +201 -0
  411. package/src/{input → form/fields/input}/input.ts +153 -238
  412. package/src/{radio-group → form/fields/radio-group}/radio-button.ts +1 -1
  413. package/src/{radio-group → form/fields/radio-group}/radio-group.ts +1 -1
  414. package/src/form/fields/range/range.test.ts +90 -0
  415. package/src/{range → form/fields/range}/range.ts +34 -13
  416. package/src/{select → form/fields/select}/select.ts +77 -108
  417. package/src/{switch → form/fields/switch}/switch.test.ts +1 -1
  418. package/src/{switch → form/fields/switch}/switch.ts +71 -51
  419. package/src/form/fields/textarea/textarea.test.ts +54 -0
  420. package/src/{textarea → form/fields/textarea}/textarea.ts +33 -72
  421. package/src/form/form-state.ts +31 -0
  422. package/src/form/form-summary.test.ts +105 -0
  423. package/src/form/form-summary.ts +171 -0
  424. package/src/form/form.test.ts +218 -35
  425. package/src/form/form.ts +330 -99
  426. package/src/form/index.ts +2 -0
  427. package/src/index.ts +9 -9
  428. package/types/mixins/formField.mixin.d.ts +90 -0
  429. package/types/src/button/button.d.ts +9 -0
  430. package/types/src/button/button.test.d.ts +3 -0
  431. package/types/src/{autocomplete → form/fields/autocomplete}/autocomplete.d.ts +6 -15
  432. package/types/src/form/fields/checkbox/checkbox.d.ts +47 -0
  433. package/types/src/{date-range → form/fields/date-range}/date-range.d.ts +22 -4
  434. package/types/src/form/fields/date-range/date-range.test.d.ts +1 -0
  435. package/types/src/{input → form/fields/input}/input.d.ts +20 -45
  436. package/types/src/form/fields/input/input.test.d.ts +1 -0
  437. package/types/src/{radio-group → form/fields/radio-group}/radio-button.d.ts +1 -1
  438. package/types/src/{radio-group → form/fields/radio-group}/radio-group.d.ts +1 -1
  439. package/types/src/form/fields/range/range.d.ts +28 -0
  440. package/types/src/form/fields/range/range.test.d.ts +1 -0
  441. package/types/src/{select → form/fields/select}/select.d.ts +23 -24
  442. package/types/src/form/fields/switch/switch.d.ts +57 -0
  443. package/types/src/{textarea → form/fields/textarea}/textarea.d.ts +6 -39
  444. package/types/src/form/fields/textarea/textarea.test.d.ts +1 -0
  445. package/types/src/form/form-state.d.ts +22 -0
  446. package/types/src/form/form-summary.d.ts +42 -0
  447. package/types/src/form/form-summary.test.d.ts +4 -0
  448. package/types/src/form/form.d.ts +79 -34
  449. package/types/src/form/form.test.d.ts +2 -2
  450. package/types/src/form/index.d.ts +2 -0
  451. package/types/src/index.d.ts +9 -9
  452. package/dist/active-host-CcIa2tmW.cjs +0 -1
  453. package/dist/active-host-CvNYoprt.js +0 -57
  454. package/dist/autocomplete-DWSuwSRS.js.map +0 -1
  455. package/dist/autocomplete-iCJOia-q.cjs +0 -115
  456. package/dist/autocomplete-iCJOia-q.cjs.map +0 -1
  457. package/dist/checkbox-NNReP9s_.cjs.map +0 -1
  458. package/dist/date-range-CaOxwZDq.cjs +0 -131
  459. package/dist/date-range-CaOxwZDq.cjs.map +0 -1
  460. package/dist/date-range-CgNujP8r.js.map +0 -1
  461. package/dist/date-range-inline-D4IjOOO0.cjs +0 -43
  462. package/dist/decorate-23nYs4Le.js +0 -7
  463. package/dist/decorate-DpFmy0nm.cjs +0 -1
  464. package/dist/float-CKmd-0-t.cjs +0 -1
  465. package/dist/form-CFvwnfuJ.js +0 -68
  466. package/dist/form-CFvwnfuJ.js.map +0 -1
  467. package/dist/form-Ceijw1aA.cjs +0 -1
  468. package/dist/form-Ceijw1aA.cjs.map +0 -1
  469. package/dist/input-D95GjINh.js.map +0 -1
  470. package/dist/input-D9s4jDAb.cjs +0 -51
  471. package/dist/input-D9s4jDAb.cjs.map +0 -1
  472. package/dist/mixins-BV0w2yIE.js +0 -627
  473. package/dist/mixins-BV0w2yIE.js.map +0 -1
  474. package/dist/mixins-DvAYa-F7.cjs +0 -298
  475. package/dist/mixins-DvAYa-F7.cjs.map +0 -1
  476. package/dist/notification-BC9nG8Sr.cjs +0 -23
  477. package/dist/radio-group-ByMD6Lsj.cjs +0 -40
  478. package/dist/radio-group-ByMD6Lsj.cjs.map +0 -1
  479. package/dist/radio-group-CW8airhZ.js.map +0 -1
  480. package/dist/select-BdBThja4.cjs +0 -56
  481. package/dist/select-BdBThja4.cjs.map +0 -1
  482. package/dist/select-Dbn-CImU.js.map +0 -1
  483. package/dist/state-DNdCPITt.cjs +0 -1
  484. package/dist/surface-BpppoNXN.cjs +0 -7
  485. package/dist/textarea-B9dy-yec.js +0 -211
  486. package/dist/textarea-B9dy-yec.js.map +0 -1
  487. package/dist/textarea-DFY0Flgv.cjs +0 -39
  488. package/dist/textarea-DFY0Flgv.cjs.map +0 -1
  489. package/dist/theme-CpuF3D3q.cjs +0 -181
  490. package/dist/theme-button-B6Xf-EiH.cjs +0 -8
  491. package/src/checkbox/checkbox.ts +0 -162
  492. package/types/src/checkbox/checkbox.d.ts +0 -71
  493. package/types/src/range/range.d.ts +0 -25
  494. package/types/src/switch/switch.d.ts +0 -53
  495. /package/dist/{animation-CO_Csq84.cjs → animation-CCOIW4wJ.cjs} +0 -0
  496. /package/dist/{animation-BK-8BwY8.js → animation-DCznELuT.js} +0 -0
  497. /package/dist/{context-DJTJnSK4.js → context-6oXCZmZN.js} +0 -0
  498. /package/dist/{context-BpCETidA.cjs → context-CRZeiCqq.cjs} +0 -0
  499. /package/dist/{hashContent-Bobsobip.cjs → hashContent-Ck6laKlk.cjs} +0 -0
  500. /package/dist/{hashContent-BU6jl5ih.js → hashContent-dJrI-9sc.js} +0 -0
  501. /package/dist/{lazy-Dq9mRRjT.cjs → lazy-CayEFyC3.cjs} +0 -0
  502. /package/dist/{lazy-B0ia54tT.js → lazy-D-bO2r4m.js} +0 -0
  503. /package/dist/{overlay-stack-DCDS17uj.js → overlay-stack-BR4iYivO.js} +0 -0
  504. /package/dist/{overlay-stack-DPIe_aYv.cjs → overlay-stack-Dk0xETTy.cjs} +0 -0
  505. /package/dist/{reduced-motion-D-L12p7G.js → reduced-motion-D7LqTUMn.js} +0 -0
  506. /package/dist/{reduced-motion-Ds-HjMzn.cjs → reduced-motion-Dzfp_w5x.cjs} +0 -0
  507. /package/dist/{rxjs-utils-CVeJQ9KG.js → rxjs-utils-D9U4MW0Q.js} +0 -0
  508. /package/dist/{rxjs-utils-DCUHg_Ml.cjs → rxjs-utils-kWPShgKu.cjs} +0 -0
  509. /package/dist/{search-BLCRsxIC.cjs → search-DPKoC-dT.cjs} +0 -0
  510. /package/dist/{search-BTz7-Rev.js → search-MvIBA93K.js} +0 -0
  511. /package/dist/{theme.interface-B9TjbSBF.js → theme.interface-C8OHheXg.js} +0 -0
  512. /package/dist/{theme.interface-BujperTo.cjs → theme.interface-CYo4UpWK.cjs} +0 -0
  513. /package/src/{autocomplete → form/fields/autocomplete}/autocomplete.scss +0 -0
  514. /package/src/{autocomplete → form/fields/autocomplete}/index.ts +0 -0
  515. /package/src/{checkbox → form/fields/checkbox}/index.ts +0 -0
  516. /package/src/{date-range → form/fields/date-range}/date-range-dialog.ts +0 -0
  517. /package/src/{date-range → form/fields/date-range}/date-range-helpers.ts +0 -0
  518. /package/src/{date-range → form/fields/date-range}/date-range-presets.ts +0 -0
  519. /package/src/{date-range → form/fields/date-range}/date-utils.ts +0 -0
  520. /package/src/{date-range → form/fields/date-range}/index.ts +0 -0
  521. /package/src/{input → form/fields/input}/index.ts +0 -0
  522. /package/src/{input → form/fields/input}/input.scss +0 -0
  523. /package/src/{radio-group → form/fields/radio-group}/index.ts +0 -0
  524. /package/src/{radio-group → form/fields/radio-group}/radio-group.scss +0 -0
  525. /package/src/{range → form/fields/range}/index.ts +0 -0
  526. /package/src/{select → form/fields/select}/index.ts +0 -0
  527. /package/src/{switch → form/fields/switch}/index.ts +0 -0
  528. /package/src/{textarea → form/fields/textarea}/index.ts +0 -0
  529. /package/src/{textarea → form/fields/textarea}/textarea.scss +0 -0
  530. /package/types/src/{autocomplete → form/fields/autocomplete}/index.d.ts +0 -0
  531. /package/types/src/{checkbox → form/fields/checkbox}/checkbox.test.d.ts +0 -0
  532. /package/types/src/{checkbox → form/fields/checkbox}/index.d.ts +0 -0
  533. /package/types/src/{date-range → form/fields/date-range}/date-range-dialog.d.ts +0 -0
  534. /package/types/src/{date-range → form/fields/date-range}/date-range-helpers.d.ts +0 -0
  535. /package/types/src/{date-range → form/fields/date-range}/date-range-presets.d.ts +0 -0
  536. /package/types/src/{date-range → form/fields/date-range}/date-utils.d.ts +0 -0
  537. /package/types/src/{date-range → form/fields/date-range}/index.d.ts +0 -0
  538. /package/types/src/{input → form/fields/input}/index.d.ts +0 -0
  539. /package/types/src/{radio-group → form/fields/radio-group}/index.d.ts +0 -0
  540. /package/types/src/{range → form/fields/range}/index.d.ts +0 -0
  541. /package/types/src/{select → form/fields/select}/index.d.ts +0 -0
  542. /package/types/src/{switch → form/fields/switch}/index.d.ts +0 -0
  543. /package/types/src/{switch → form/fields/switch}/switch.test.d.ts +0 -0
  544. /package/types/src/{textarea → form/fields/textarea}/index.d.ts +0 -0
@@ -20,13 +20,18 @@
20
20
  | name | string | `''` | Form submission name |
21
21
  | required | boolean | `false` | Whether selection is required |
22
22
  | multi | boolean | `false` | Enable multi-select with inline chips |
23
- | size | `'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Input height |
23
+ | size | `'xxs'\|'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Input height (M3 sizes 24–56dp). |
24
24
  | maxHeight | string | `'300px'` | Max dropdown height |
25
25
  | debounceMs | number | `200` | Search debounce in ms |
26
26
  | similarityThreshold | number | `0.3` | Minimum fuzzy match score (0-1) |
27
- | error | boolean | `false` | Error state |
28
- | validationMessage | string | `''` | Validation message |
27
+ | error | boolean | `false` | Error state (gated by `validateOn`). From `SchmancyFormField`. |
28
+ | validationMessage | string | `''` | Validation message. |
29
29
  | description | string | `''` | Screen reader description |
30
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. |
31
+ | disabled | boolean | `false` | Disabled state. |
32
+ | hint | string | `undefined` | Helper text below the field. |
33
+ | touched / dirty / submitted | boolean | — | Validation state from `SchmancyFormField`. |
34
+ | autocomplete | string | `'off'` | Native autocomplete attribute on inner input. |
30
35
 
31
36
  ## Events
32
37
  | Event | Detail | Description |
@@ -51,3 +56,11 @@
51
56
  ```
52
57
 
53
58
  Children must be `<schmancy-option>` elements. In multi mode, selected items appear as removable chips.
59
+
60
+ ## Form-field contract
61
+
62
+ Extends `SchmancyFormField()`. Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`. Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `reportValidity()`, `setCustomValidity()`, `resetForm()` (resets the BehaviorSubjects + clears the input).
63
+
64
+ Default `validateOn: 'dirty'` — a required-empty autocomplete shows no error until the user types-then-clears or submits. Error UI rendered in a `role="alert"` div linked via `aria-describedby`.
65
+
66
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -40,6 +40,25 @@
40
40
  - Hover: luminous glow shadow using primary color
41
41
  - Active: spring press `scale(0.97)` / `scale(0.92)` for icon-button
42
42
 
43
+ ## Submit-state mirroring (`type="submit"` only)
44
+
45
+ A `<schmancy-button type="submit">` inside a `<schmancy-form>` automatically reflects the form's submit state via a MutationObserver on the form's `aria-busy` attribute:
46
+
47
+ - While the form's `formSubmitState.status === 'submitting'` (form sets `aria-busy="true"`):
48
+ - Button mirrors `aria-busy="true"` onto itself.
49
+ - Broadcasts `:state(submitting)` for CSS targeting.
50
+ - **Stays focusable** — never gets the `disabled` attribute. Disabled buttons drop from the tab order; AT users would lose their place. WCAG 2.2 AA.
51
+ - Cleared automatically when the form's submit promise settles (success or error).
52
+
53
+ ```css
54
+ schmancy-button:state(submitting) {
55
+ opacity: 0.6;
56
+ /* show a spinner via ::before, swap label, etc. */
57
+ }
58
+ ```
59
+
60
+ `schmancy-button` is form-associated (`static formAssociated = true` + `attachInternals()`) — clicking a `type="submit"` inside any `<form>` ancestor (native or schmancy) calls `form.requestSubmit()`. Inside `<schmancy-form>` the click is also intercepted at the form host and bridged across the shadow boundary to the inner shadow-DOM `<form>`.
61
+
43
62
  ## Examples
44
63
  ```html
45
64
  <!-- Filled primary -->
@@ -18,6 +18,14 @@
18
18
  | disabled | boolean | `false` | Whether the checkbox is disabled |
19
19
  | required | boolean | `false` | Whether the checkbox is required |
20
20
  | size | `'xxs'\|'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Checkbox size |
21
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. From `SchmancyFormField`. |
22
+ | validationMessage | string | `''` | Error text — default `'Please check this box if you want to proceed.'` when required and unchecked. |
23
+ | error | boolean | `false` | Error state (gated by `validateOn`). |
24
+ | hint | string | `undefined` | Helper text. |
25
+ | touched / dirty / submitted | boolean | — | Validation state from `SchmancyFormField`. |
26
+
27
+ ## Attributes
28
+ - `true-value` — string written to FormData when checked. Default `'on'` (matches native checkbox semantics).
21
29
 
22
30
  ## Events
23
31
  | Event | Detail | Description |
@@ -33,4 +41,15 @@
33
41
  <schmancy-checkbox name="terms" required>
34
42
  Accept <a href="/terms">terms and conditions</a>
35
43
  </schmancy-checkbox>
44
+
45
+ <!-- Custom FormData string -->
46
+ <schmancy-checkbox name="newsletter" true-value="opt-in"></schmancy-checkbox>
36
47
  ```
48
+
49
+ ## Form-field contract
50
+
51
+ Extends `SchmancyFormField()`. `value` is the boolean state; FormData submission uses the `true-value` attribute (or `'on'`). Validity overrides the mixin's "non-empty value" semantics: required + unchecked → `internals.setValidity({ valueMissing: true })`. ARIA `aria-invalid` / `aria-required` reflect through `ElementInternals`.
52
+
53
+ Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `setCustomValidity()`, `resetForm()`. Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`.
54
+
55
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -27,6 +27,12 @@
27
27
  | collapse | boolean | `false` | Icon-only on mobile |
28
28
  | customPresets | array | `[]` | Additional preset ranges |
29
29
  | format | string | auto | Date format string |
30
+ | name | string | `''` | Form submission name. From `SchmancyFormField`. |
31
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. |
32
+ | validationMessage | string | `''` | Error message — default `'Please select a date range.'` when required and either bound is empty. |
33
+ | error | boolean | `false` | Error state (gated by `validateOn`). |
34
+ | hint | string | `undefined` | Helper text. |
35
+ | touched / dirty / submitted | boolean | — | Validation state. `dirty` tracks `dateFrom.value` / `dateTo.value` against the snapshots taken at first render. |
30
36
 
31
37
  ## Events
32
38
  | Event | Detail | Description |
@@ -48,3 +54,16 @@
48
54
  ```
49
55
 
50
56
  Built-in presets include Today, Yesterday, This Week, This Month, This Year, and more.
57
+
58
+ ## Form association
59
+
60
+ Extends `SchmancyFormField()`. Multi-entry FormData contribution:
61
+ - Set `name="dates"` and FormData receives **two** keys: `datesFrom` and `datesTo` (flat suffix shape, no bracket-key encoding).
62
+ - `internals.setFormValue(formData)` accepts a `FormData` object whose entries get appended to the parent form — native `new FormData(form)` sees both keys without consumer-side parsing.
63
+ - `<schmancy-form>`'s registry consumer also sees both keys via `toFormEntries()`.
64
+
65
+ `resetForm()` restores both `dateFrom.value` and `dateTo.value` to the snapshots captured at first render. Validity: required + either bound empty → `internals.setValidity({ valueMissing: true })`. Order/range constraints (start ≤ end, future-only, etc.) are out of scope — handle those in a domain schema layer.
66
+
67
+ Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`. Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `setCustomValidity()`, `resetForm()`.
68
+
69
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -0,0 +1,55 @@
1
+ # Form UX rules — Revolute pattern → schmancy mixin API
2
+
3
+ This is the mapping between the Revolute interview-bar form UX (the source-of-truth checklist for state-of-the-art form behaviour) and the `SchmancyFormField()` API that implements each rule. When you hit a UX question, find the rule here and use the named API — don't re-derive from scratch.
4
+
5
+ ## The four-phase validation contract
6
+
7
+ | Phase | UX rule | Implementation |
8
+ |---|---|---|
9
+ | 1 — Pristine | A field the user hasn't typed in shows no error, even if focused-then-blurred. The autofocus+cancel anti-pattern (focus a required field, click cancel, see "required") is forbidden. | `validateOn: 'dirty'` (default). `_shouldShowError()` returns `false` while `dirty === false`. |
10
+ | 2 — Dirty | User types and blurs → validate the field. Show error only if invalid. Empty required fields blurred-without-typing remain pristine. | `markTouched()` called on blur. Mixin's `willUpdate` sees `touched` change, sees `dirty` is true, calls `checkValidity()` which sets `this.error` because the gate is open. |
11
+ | 3 — Live correction | User returns to a field with an error → re-validate on every keystroke. Error clears immediately when valid. | Mixin's `willUpdate` re-runs `checkValidity()` on every value change while `_shouldShowError()` is true. |
12
+ | 4 — Submit | Submit click → validate **all** fields regardless of dirty. Focus the first invalid field. | `<schmancy-form>` calls `markSubmitted()` on every registered field. `submitted = true` overrides every `validateOn` mode and forces error display. The form then focuses the first field with `error === true`. |
13
+
14
+ After Phase 4, the field stays in Phase 3 (live re-validation) for the rest of the session because `submitted` persists until `resetForm()`.
15
+
16
+ ## Per-rule cross-reference
17
+
18
+ | UX rule | API | Notes |
19
+ |---|---|---|
20
+ | Default mode is "errors after the user has interacted" | `validateOn: 'dirty'` | Pristine fields stay clean; submit forces all errors. |
21
+ | Live search shows errors immediately | `validateOn="always"` | Bypass the dirty/touched gate entirely. |
22
+ | Wizard step holds errors until Next | `validateOn="submitted"` | Only `markSubmitted()` opens the gate. |
23
+ | Server-side error → specific field | `form.setFieldError(name, msg)` | RHF `setError` parity. Sets custom validity + marks submitted so the error shows. |
24
+ | Server-side error → form banner | `form.setFormError(msg, code?)` | Flips `formSubmitState` to `{ status: 'error', error: { message, code } }`. Top-of-form banners read this. |
25
+ | Async server-side check gating submit | `e.detail.until(promise)` | Form's `submit` event detail. Submit status reflects the promise outcome (`success` on resolve, `error` on reject). |
26
+ | Submit button must stay focusable while busy | `aria-busy="true"` on the host (auto) + `:state(submitting)` on `<schmancy-button[type=submit]>` (auto) | WCAG 2.2 AA. Disabled buttons drop from the tab order; we never disable. |
27
+ | Screen reader announces invalid fields | `internals.ariaInvalid` (auto) + `internals.ariaRequired` (auto) | Reflected through `ElementInternals` so AT reaches into shadow DOM. Not on the host as `aria-*` attributes. |
28
+ | Reset returns the form to pristine | `<schmancy-button type="reset">` or `form.reset()` | Mixin's `formResetCallback` → `resetForm()` clears `value`, `error`, `validationMessage`, `touched`, `submitted`. |
29
+ | Cross-field rules (password confirm) | `schema` prop with zod `.refine` | Validation seam is the schema, not the mixin. Cross-field violations surface on submit; map to a specific field via `form.setFieldError`. |
30
+ | Server-shape transforms (IBAN uppercase, trim) | `schema` prop with zod `.transform` | Runs during `schema.parse(rawFormData)` in `_onSubmit`. The `data` in the submit event is post-transform. |
31
+ | Multi-entry FormData (date range, tag input) | Override `toFormEntries()` + `internals.setFormValue(formData)` | Flat suffix keys (`${name}From`, `${name}To`) — no bracket-key encoding. Native `new FormData(form)` sees both keys. |
32
+ | Boolean state semantics (checkbox, switch) | Override `checkValidity()` | Required validity is `checked === true`, not the mixin's "non-empty value." |
33
+ | Numeric value (range) | `override value: number` | Narrows the mixin's wide union. Mixin's `dirty` getter uses `value !== _defaultValue` which works for primitives. |
34
+ | Two independent forms on one page | Each `<schmancy-form>` is its own context provider | `<schmancy-context .provides=${[formSubmitState]}>` is rendered inside each form. Submit state is isolated per instance — no cross-contamination. |
35
+ | Nested forms forbidden | `<schmancy-form>` `connectedCallback` checks for an ancestor `schmancy-form` and `console.error`s if found | Nested forms are platform-undefined; we surface the error early. |
36
+
37
+ ## What's NOT in scope
38
+
39
+ These are deferred to v2 and **not** in the current contract:
40
+
41
+ - `<schmancy-form-summary>` (top-of-form error banner with anchor links to invalid fields).
42
+ - `validateOn: 'length'` (validate once `value.length === maxlength` — Stripe card-number pattern).
43
+ - Per-field `errorMessages` i18n hook (the default `'This field is required'` is hardcoded English).
44
+ - First-class `useFieldArray` API for dynamic fields.
45
+ - Async-validation helpers (`isValidating`, `runAsyncValidator`, `:state(validating)`).
46
+ - Wizard `clearSubmitted()` (post-submit state currently persists until `resetForm`).
47
+ - Structured `ValidityStateFlags` exposure beyond `valueMissing` + `customError`.
48
+
49
+ If a consumer needs one of these, file an issue with the use case before adding it — every addition to the binding contract has a propagation cost across all 9 form components.
50
+
51
+ ## See also
52
+
53
+ - `form.md` — the `<schmancy-form>` API reference.
54
+ - `mixins.md` — `SchmancyFormField()` factory composition.
55
+ - `state.md` — `formSubmitState` singleton + per-form isolation.
@@ -1,49 +1,145 @@
1
1
  # schmancy-form
2
2
 
3
- > Form container that collects data from child controls, validates, and emits submit/reset events.
3
+ > Form container with isolated submit state, typed schema seam, and a unified validation UX contract every field implements.
4
4
 
5
5
  ## Usage
6
+
6
7
  ```html
7
- <schmancy-form @submit=${(e) => handleSubmit(e.detail)}>
8
+ <schmancy-form @submit=${(e) => handleSubmit(e.detail.data)}>
8
9
  <schmancy-input name="email" label="Email" required></schmancy-input>
9
10
  <schmancy-button type="submit">Submit</schmancy-button>
10
11
  </schmancy-form>
11
12
  ```
12
13
 
14
+ The submit detail is `{ data, formData, until }`:
15
+
16
+ ```ts
17
+ type SchmancyFormSubmitDetail<T = Record<string, FormDataEntryValue>> = {
18
+ data: T // typed when `schema` is set
19
+ formData: FormData // raw payload
20
+ until(p: Promise<unknown>): void // gate success/error on async outcome
21
+ }
22
+ ```
23
+
13
24
  ## Properties
25
+
14
26
  | Property | Type | Default | Description |
15
- |----------|------|---------|-------------|
16
- | novalidate | boolean | `false` | Skip validation on submit |
27
+ |---|---|---|---|
28
+ | `schema` | `ParseSchema` (zod / valibot / ArkType compatible) | | When set, parses raw FormData on submit; `e.detail.data` is typed `z.infer<TSchema>`. |
29
+ | `novalidate` | `boolean` | `true` | Skip native browser validation popups (we control display). |
17
30
 
18
31
  ## Events
32
+
19
33
  | Event | Detail | Description |
20
- |-------|--------|-------------|
21
- | submit | FormData | Form data from all child controls |
22
- | reset | - | When the form is reset |
34
+ |---|---|---|
35
+ | `submit` | `SchmancyFormSubmitDetail` | Fired after all registered fields pass validation. |
36
+ | `reset` | `CustomEvent` | Fired after the form resets. |
23
37
 
24
38
  ## Methods
39
+
25
40
  | Method | Returns | Description |
26
- |--------|---------|-------------|
27
- | submit() | boolean | Validates and dispatches submit event. Returns false if invalid. |
28
- | reset() | void | Resets all child controls to default values |
29
- | getFormData() | FormData | Collects current form data without submitting |
30
- | reportValidity() | boolean | Checks and shows validation on all controls |
41
+ |---|---|---|
42
+ | `submit()` | `boolean` | Programmatic submission via the inner form's `requestSubmit()`. |
43
+ | `reset()` | `void` | Resets every registered field. |
44
+ | `setFieldError(name, message)` | `boolean` | RHF `setError(name, ...)`-equivalent: maps a server-side error to a specific field. |
45
+ | `setFormError(message, code?)` | `void` | RHF `setError('root.serverError', ...)`-equivalent: structured form-level error. |
46
+ | `getFormData()` | `FormData` | Snapshot of the registered fields' contributed entries. |
47
+ | `reportValidity()` | `boolean` | Checks every registered field. |
48
+ | `checkValidity()` | `boolean` | Same as `reportValidity` without the side effect. |
49
+
50
+ ## Validation UX (binding contract)
51
+
52
+ Every field that extends `SchmancyFormField()` implements four phases:
53
+
54
+ | Phase | Trigger | Behaviour |
55
+ |---|---|---|
56
+ | 1 — Pristine | User hasn't changed the field | **No error shown**, ever. `dirty = false` is the gate. |
57
+ | 2 — Dirty | User typed something then blurred | Validate. **Show error only if invalid.** |
58
+ | 3 — Live correction | User returns to a field with an error | Re-validate on every keystroke. Error clears immediately when valid. |
59
+ | 4 — Submit | User clicks submit | Force-validate **all** fields regardless of `dirty`. Focus the first invalid field. |
60
+
61
+ The default mode is `validateOn="dirty"`. Override per-field for special cases:
62
+
63
+ ```html
64
+ <schmancy-input validateOn="always" ...></schmancy-input> <!-- live search -->
65
+ <schmancy-input validateOn="submitted" ...></schmancy-input> <!-- wizard step -->
66
+ ```
67
+
68
+ After a submit attempt, the field stays in live-correction mode (Phase 3) for the rest of the session — `resetForm()` is the only way back.
69
+
70
+ ## Server-side errors
71
+
72
+ ```ts
73
+ async _onSubmit(e: CustomEvent<SchmancyFormSubmitDetail>) {
74
+ const form = e.target as SchmancyForm
75
+ e.detail.until(
76
+ chargeCard(e.detail.data).catch(err => {
77
+ if (err.code === 'CARD_DECLINED') {
78
+ form.setFieldError('card', 'Card declined — check the number')
79
+ } else {
80
+ form.setFormError(err.message)
81
+ }
82
+ throw err // re-throw so submit-state flips to 'error'
83
+ }),
84
+ )
85
+ }
86
+ ```
87
+
88
+ ## CSS state hooks (free)
89
+
90
+ Every field broadcasts these via `:state(...)`:
91
+
92
+ ```css
93
+ schmancy-input:state(invalid) { --border-color: var(--color-error); }
94
+ schmancy-input:state(dirty) { --border-color: var(--color-primary); }
95
+ schmancy-input:state(touched) { /* user blurred at least once */ }
96
+ schmancy-input:state(submitted) { /* post-submit state */ }
97
+ schmancy-input:state(required) { /* required visual */ }
98
+
99
+ schmancy-button[type=submit]:state(submitting) { opacity: 0.6; } /* form busy */
100
+ ```
101
+
102
+ The `<schmancy-form>` host gets `aria-busy="true"` while submitting (WCAG 2.2 AA — disabled submit buttons drop from tab order; we keep them focusable and signal busy via aria).
103
+
104
+ ## Field-author contract
105
+
106
+ Components that extend `SchmancyFormField()` get FACE wiring, ARIA reflection (`internals.ariaInvalid` / `ariaRequired`), the validation UX state (`touched/dirty/submitted/validateOn`), the `_shouldShowError()` gate, the form-registry composed event (`FIELD_CONNECT_EVENT`), and reset/disabled propagation — all for free.
107
+
108
+ The component author must wire only two things:
109
+
110
+ ```ts
111
+ // 1. Call markTouched() on blur — tells the mixin the user has left the field
112
+ this.input.addEventListener('blur', () => this.markTouched())
113
+
114
+ // 2. Call emitChange() when value changes
115
+ this.value = newValue
116
+ this.emitChange({ value: newValue })
117
+ ```
118
+
119
+ Override only when validity semantics differ (checkbox uses `checked`, switch uses `checked`, date-range uses `dateFrom`/`dateTo`) or when FormData contribution is multi-entry (date-range emits `${name}From` and `${name}To`).
120
+
121
+ ## Submit triggers
122
+
123
+ `<schmancy-form>` listens on its host for `click` on `<button type=submit>` / `<schmancy-button type=submit>` and `keydown.Enter` on registered fields, then calls the inner shadow-DOM form's `requestSubmit()`. This bridges the gap that native form-association cannot cross from light-DOM slotted children to a shadow-DOM `<form>`.
31
124
 
32
125
  ## Examples
126
+
33
127
  ```html
34
- <!-- Form with validation -->
35
- <schmancy-form @submit=${(e) => save(e.detail)} @reset=${() => clearForm()}>
36
- <schmancy-input name="name" label="Name" required></schmancy-input>
37
- <schmancy-select name="role" label="Role" required>
38
- <schmancy-option value="admin" label="Admin"></schmancy-option>
39
- <schmancy-option value="user" label="User"></schmancy-option>
40
- </schmancy-select>
41
- <schmancy-checkbox name="active" label="Active"></schmancy-checkbox>
42
- <div class="flex gap-2">
43
- <schmancy-button type="submit">Save</schmancy-button>
44
- <schmancy-button type="reset">Reset</schmancy-button>
45
- </div>
128
+ <!-- Two independent checkout forms — each <schmancy-form> instance has its own
129
+ isolated submit state via <schmancy-context>; no cross-contamination. -->
130
+ <schmancy-form @submit=${(e) => pay('primary', e)}>
131
+ <schmancy-input name="card" required></schmancy-input>
132
+ <schmancy-button type="submit">Pay £50</schmancy-button>
133
+ </schmancy-form>
134
+
135
+ <schmancy-form @submit=${(e) => pay('backup', e)}>
136
+ <schmancy-input name="card" required></schmancy-input>
137
+ <schmancy-button type="submit">Pay £50</schmancy-button>
46
138
  </schmancy-form>
47
139
  ```
48
140
 
49
- Submit triggers on Enter key in inputs or clicking a submit-type button.
141
+ ## See also
142
+
143
+ - `form-ux-rules.md` — the Revolute UX contract → mixin API mapping.
144
+ - `mixins.md` — `SchmancyFormField()` factory composition.
145
+ - `state.md` — `formSubmitState` + `<schmancy-context>` isolation pattern.
@@ -22,7 +22,10 @@
22
22
  | validationMessage | string | `''` | Custom validation message |
23
23
  | hint | string | `undefined` | Hint text below the field |
24
24
  | size | `'xxs'\|'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Input height (24-56px) |
25
- | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'touched'` | When to show validation |
25
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When to display validation errors. Default suppresses errors on pristine fields until submit. |
26
+ | touched | boolean (read-only) | `false` | True after first blur — set by `markTouched()`. |
27
+ | dirty | boolean (getter) | — | True when `value` differs from the captured default. |
28
+ | submitted | boolean (read-only) | `false` | Set by `<schmancy-form>` on submit; flips field to live-correction mode. |
26
29
  | align | `'left'\|'center'\|'right'` | `'left'` | Text alignment |
27
30
  | pattern | string | `undefined` | Regex validation pattern |
28
31
  | inputmode | string | `undefined` | Virtual keyboard hint |
@@ -34,9 +37,21 @@
34
37
  ## Events
35
38
  | Event | Detail | Description |
36
39
  |-------|--------|-------------|
37
- | input | `{ value: string }` | Every keystroke |
38
- | change | `{ value: string }` | On blur/native change |
39
- | enter | `{ value: string }` | When Enter key is pressed |
40
+ | input | `{ value: string }` | Every keystroke (bubbles, composed) |
41
+ | change | `{ value: string }` | On blur/native change (bubbles, composed) |
42
+ | enter | `{ value: string }` | Enter key pressed |
43
+ | focus / blur | — | Standard focus events |
44
+
45
+ ## Public API (from `SchmancyFormField`)
46
+ - `markTouched()` / `markSubmitted()` — flip the `_shouldShowError()` gate.
47
+ - `checkValidity()` / `reportValidity()` — return current validity (used by `<schmancy-form>` and native `<form>`).
48
+ - `setCustomValidity(message)` — server-side error path. `<schmancy-form>` calls this from `setFieldError(name, msg)`.
49
+ - `resetForm()` — restores the captured default; clears `error`, `touched`, `submitted`.
50
+ - `internals.ariaInvalid` / `ariaRequired` — set automatically; reaches AT through shadow DOM.
51
+
52
+ `<schmancy-form>` auto-discovers this field via `FIELD_CONNECT_EVENT` (composed event). No registration needed.
53
+
54
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
40
55
 
41
56
  ## Examples
42
57
  ```html
@@ -20,9 +20,15 @@
20
20
  | `min` | number | `0` | Minimum value |
21
21
  | `max` | number | `1` | Maximum value |
22
22
  | `step` | number | `0.01` | Increment per tick |
23
- | `value` | number | `0` | Current value |
23
+ | `value` | number | `0` | Current value (narrowed override of the mixin's wide union). |
24
24
  | `label` | string | — | Optional label (current value displays on the right) |
25
25
  | `disabled` | boolean | `false` | Disabled state (38% opacity) |
26
+ | `name` | string | `''` | Form submission name. From `SchmancyFormField`. |
27
+ | `required` | boolean | `false` | Field must have a value to validate. |
28
+ | `validateOn` | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When errors display. |
29
+ | `validationMessage` | string | `''` | Error message. |
30
+ | `hint` | string | `undefined` | Helper text. |
31
+ | `touched / dirty / submitted` | boolean | — | Validation state from `SchmancyFormField`. |
26
32
 
27
33
  ## Events
28
34
  | Event | Payload | When |
@@ -34,6 +40,14 @@
34
40
  - Circular thumb with hover halo (8px primary glow at 12% opacity).
35
41
  - Disabled state: 38% opacity, not-allowed cursor.
36
42
 
43
+ ## Form-field contract
44
+
45
+ Extends `SchmancyFormField()`. FormData contributes `String(value)` under `name`. `markTouched()` fires on every input event (slider drag), so the field transitions to `touched` immediately on interaction — the `dirty` gate opens once value diverges from the captured default.
46
+
47
+ Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`. Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `setCustomValidity()`, `resetForm()`.
48
+
49
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
50
+
37
51
  ## Example — precise float control
38
52
  ```html
39
53
  <schmancy-range
@@ -20,13 +20,18 @@
20
20
  | name | string | `''` | Form submission name |
21
21
  | required | boolean | `false` | Whether selection is required |
22
22
  | multi | boolean | `false` | Enable multi-select with inline chips |
23
- | size | `'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Input height |
23
+ | size | `'xxs'\|'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Input height (M3 sizes 24–56dp). |
24
24
  | maxHeight | string | `'300px'` | Max dropdown height |
25
25
  | debounceMs | number | `200` | Search debounce in ms |
26
26
  | similarityThreshold | number | `0.3` | Minimum fuzzy match score (0-1) |
27
- | error | boolean | `false` | Error state |
28
- | validationMessage | string | `''` | Validation message |
27
+ | error | boolean | `false` | Error state (gated by `validateOn`). From `SchmancyFormField`. |
28
+ | validationMessage | string | `''` | Validation message. |
29
29
  | description | string | `''` | Screen reader description |
30
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. |
31
+ | disabled | boolean | `false` | Disabled state. |
32
+ | hint | string | `undefined` | Helper text below the field. |
33
+ | touched / dirty / submitted | boolean | — | Validation state from `SchmancyFormField`. |
34
+ | autocomplete | string | `'off'` | Native autocomplete attribute on inner input. |
30
35
 
31
36
  ## Events
32
37
  | Event | Detail | Description |
@@ -51,3 +56,11 @@
51
56
  ```
52
57
 
53
58
  Children must be `<schmancy-option>` elements. In multi mode, selected items appear as removable chips.
59
+
60
+ ## Form-field contract
61
+
62
+ Extends `SchmancyFormField()`. Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`. Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `reportValidity()`, `setCustomValidity()`, `resetForm()` (resets the BehaviorSubjects + clears the input).
63
+
64
+ Default `validateOn: 'dirty'` — a required-empty autocomplete shows no error until the user types-then-clears or submits. Error UI rendered in a `role="alert"` div linked via `aria-describedby`.
65
+
66
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -40,6 +40,25 @@
40
40
  - Hover: luminous glow shadow using primary color
41
41
  - Active: spring press `scale(0.97)` / `scale(0.92)` for icon-button
42
42
 
43
+ ## Submit-state mirroring (`type="submit"` only)
44
+
45
+ A `<schmancy-button type="submit">` inside a `<schmancy-form>` automatically reflects the form's submit state via a MutationObserver on the form's `aria-busy` attribute:
46
+
47
+ - While the form's `formSubmitState.status === 'submitting'` (form sets `aria-busy="true"`):
48
+ - Button mirrors `aria-busy="true"` onto itself.
49
+ - Broadcasts `:state(submitting)` for CSS targeting.
50
+ - **Stays focusable** — never gets the `disabled` attribute. Disabled buttons drop from the tab order; AT users would lose their place. WCAG 2.2 AA.
51
+ - Cleared automatically when the form's submit promise settles (success or error).
52
+
53
+ ```css
54
+ schmancy-button:state(submitting) {
55
+ opacity: 0.6;
56
+ /* show a spinner via ::before, swap label, etc. */
57
+ }
58
+ ```
59
+
60
+ `schmancy-button` is form-associated (`static formAssociated = true` + `attachInternals()`) — clicking a `type="submit"` inside any `<form>` ancestor (native or schmancy) calls `form.requestSubmit()`. Inside `<schmancy-form>` the click is also intercepted at the form host and bridged across the shadow boundary to the inner shadow-DOM `<form>`.
61
+
43
62
  ## Examples
44
63
  ```html
45
64
  <!-- Filled primary -->
@@ -18,6 +18,14 @@
18
18
  | disabled | boolean | `false` | Whether the checkbox is disabled |
19
19
  | required | boolean | `false` | Whether the checkbox is required |
20
20
  | size | `'xxs'\|'xs'\|'sm'\|'md'\|'lg'` | `'md'` | Checkbox size |
21
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. From `SchmancyFormField`. |
22
+ | validationMessage | string | `''` | Error text — default `'Please check this box if you want to proceed.'` when required and unchecked. |
23
+ | error | boolean | `false` | Error state (gated by `validateOn`). |
24
+ | hint | string | `undefined` | Helper text. |
25
+ | touched / dirty / submitted | boolean | — | Validation state from `SchmancyFormField`. |
26
+
27
+ ## Attributes
28
+ - `true-value` — string written to FormData when checked. Default `'on'` (matches native checkbox semantics).
21
29
 
22
30
  ## Events
23
31
  | Event | Detail | Description |
@@ -33,4 +41,15 @@
33
41
  <schmancy-checkbox name="terms" required>
34
42
  Accept <a href="/terms">terms and conditions</a>
35
43
  </schmancy-checkbox>
44
+
45
+ <!-- Custom FormData string -->
46
+ <schmancy-checkbox name="newsletter" true-value="opt-in"></schmancy-checkbox>
36
47
  ```
48
+
49
+ ## Form-field contract
50
+
51
+ Extends `SchmancyFormField()`. `value` is the boolean state; FormData submission uses the `true-value` attribute (or `'on'`). Validity overrides the mixin's "non-empty value" semantics: required + unchecked → `internals.setValidity({ valueMissing: true })`. ARIA `aria-invalid` / `aria-required` reflect through `ElementInternals`.
52
+
53
+ Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `setCustomValidity()`, `resetForm()`. Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`.
54
+
55
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -27,6 +27,12 @@
27
27
  | collapse | boolean | `false` | Icon-only on mobile |
28
28
  | customPresets | array | `[]` | Additional preset ranges |
29
29
  | format | string | auto | Date format string |
30
+ | name | string | `''` | Form submission name. From `SchmancyFormField`. |
31
+ | validateOn | `'always'\|'touched'\|'dirty'\|'submitted'` | `'dirty'` | When validation errors display. |
32
+ | validationMessage | string | `''` | Error message — default `'Please select a date range.'` when required and either bound is empty. |
33
+ | error | boolean | `false` | Error state (gated by `validateOn`). |
34
+ | hint | string | `undefined` | Helper text. |
35
+ | touched / dirty / submitted | boolean | — | Validation state. `dirty` tracks `dateFrom.value` / `dateTo.value` against the snapshots taken at first render. |
30
36
 
31
37
  ## Events
32
38
  | Event | Detail | Description |
@@ -48,3 +54,16 @@
48
54
  ```
49
55
 
50
56
  Built-in presets include Today, Yesterday, This Week, This Month, This Year, and more.
57
+
58
+ ## Form association
59
+
60
+ Extends `SchmancyFormField()`. Multi-entry FormData contribution:
61
+ - Set `name="dates"` and FormData receives **two** keys: `datesFrom` and `datesTo` (flat suffix shape, no bracket-key encoding).
62
+ - `internals.setFormValue(formData)` accepts a `FormData` object whose entries get appended to the parent form — native `new FormData(form)` sees both keys without consumer-side parsing.
63
+ - `<schmancy-form>`'s registry consumer also sees both keys via `toFormEntries()`.
64
+
65
+ `resetForm()` restores both `dateFrom.value` and `dateTo.value` to the snapshots captured at first render. Validity: required + either bound empty → `internals.setValidity({ valueMissing: true })`. Order/range constraints (start ≤ end, future-only, etc.) are out of scope — handle those in a domain schema layer.
66
+
67
+ Auto-discovered by `<schmancy-form>` via `FIELD_CONNECT_EVENT`. Public API: `markTouched()`, `markSubmitted()`, `checkValidity()`, `setCustomValidity()`, `resetForm()`.
68
+
69
+ See `form.md` and `form-ux-rules.md` for the binding 4-phase validation contract.
@@ -0,0 +1,55 @@
1
+ # Form UX rules — Revolute pattern → schmancy mixin API
2
+
3
+ This is the mapping between the Revolute interview-bar form UX (the source-of-truth checklist for state-of-the-art form behaviour) and the `SchmancyFormField()` API that implements each rule. When you hit a UX question, find the rule here and use the named API — don't re-derive from scratch.
4
+
5
+ ## The four-phase validation contract
6
+
7
+ | Phase | UX rule | Implementation |
8
+ |---|---|---|
9
+ | 1 — Pristine | A field the user hasn't typed in shows no error, even if focused-then-blurred. The autofocus+cancel anti-pattern (focus a required field, click cancel, see "required") is forbidden. | `validateOn: 'dirty'` (default). `_shouldShowError()` returns `false` while `dirty === false`. |
10
+ | 2 — Dirty | User types and blurs → validate the field. Show error only if invalid. Empty required fields blurred-without-typing remain pristine. | `markTouched()` called on blur. Mixin's `willUpdate` sees `touched` change, sees `dirty` is true, calls `checkValidity()` which sets `this.error` because the gate is open. |
11
+ | 3 — Live correction | User returns to a field with an error → re-validate on every keystroke. Error clears immediately when valid. | Mixin's `willUpdate` re-runs `checkValidity()` on every value change while `_shouldShowError()` is true. |
12
+ | 4 — Submit | Submit click → validate **all** fields regardless of dirty. Focus the first invalid field. | `<schmancy-form>` calls `markSubmitted()` on every registered field. `submitted = true` overrides every `validateOn` mode and forces error display. The form then focuses the first field with `error === true`. |
13
+
14
+ After Phase 4, the field stays in Phase 3 (live re-validation) for the rest of the session because `submitted` persists until `resetForm()`.
15
+
16
+ ## Per-rule cross-reference
17
+
18
+ | UX rule | API | Notes |
19
+ |---|---|---|
20
+ | Default mode is "errors after the user has interacted" | `validateOn: 'dirty'` | Pristine fields stay clean; submit forces all errors. |
21
+ | Live search shows errors immediately | `validateOn="always"` | Bypass the dirty/touched gate entirely. |
22
+ | Wizard step holds errors until Next | `validateOn="submitted"` | Only `markSubmitted()` opens the gate. |
23
+ | Server-side error → specific field | `form.setFieldError(name, msg)` | RHF `setError` parity. Sets custom validity + marks submitted so the error shows. |
24
+ | Server-side error → form banner | `form.setFormError(msg, code?)` | Flips `formSubmitState` to `{ status: 'error', error: { message, code } }`. Top-of-form banners read this. |
25
+ | Async server-side check gating submit | `e.detail.until(promise)` | Form's `submit` event detail. Submit status reflects the promise outcome (`success` on resolve, `error` on reject). |
26
+ | Submit button must stay focusable while busy | `aria-busy="true"` on the host (auto) + `:state(submitting)` on `<schmancy-button[type=submit]>` (auto) | WCAG 2.2 AA. Disabled buttons drop from the tab order; we never disable. |
27
+ | Screen reader announces invalid fields | `internals.ariaInvalid` (auto) + `internals.ariaRequired` (auto) | Reflected through `ElementInternals` so AT reaches into shadow DOM. Not on the host as `aria-*` attributes. |
28
+ | Reset returns the form to pristine | `<schmancy-button type="reset">` or `form.reset()` | Mixin's `formResetCallback` → `resetForm()` clears `value`, `error`, `validationMessage`, `touched`, `submitted`. |
29
+ | Cross-field rules (password confirm) | `schema` prop with zod `.refine` | Validation seam is the schema, not the mixin. Cross-field violations surface on submit; map to a specific field via `form.setFieldError`. |
30
+ | Server-shape transforms (IBAN uppercase, trim) | `schema` prop with zod `.transform` | Runs during `schema.parse(rawFormData)` in `_onSubmit`. The `data` in the submit event is post-transform. |
31
+ | Multi-entry FormData (date range, tag input) | Override `toFormEntries()` + `internals.setFormValue(formData)` | Flat suffix keys (`${name}From`, `${name}To`) — no bracket-key encoding. Native `new FormData(form)` sees both keys. |
32
+ | Boolean state semantics (checkbox, switch) | Override `checkValidity()` | Required validity is `checked === true`, not the mixin's "non-empty value." |
33
+ | Numeric value (range) | `override value: number` | Narrows the mixin's wide union. Mixin's `dirty` getter uses `value !== _defaultValue` which works for primitives. |
34
+ | Two independent forms on one page | Each `<schmancy-form>` is its own context provider | `<schmancy-context .provides=${[formSubmitState]}>` is rendered inside each form. Submit state is isolated per instance — no cross-contamination. |
35
+ | Nested forms forbidden | `<schmancy-form>` `connectedCallback` checks for an ancestor `schmancy-form` and `console.error`s if found | Nested forms are platform-undefined; we surface the error early. |
36
+
37
+ ## What's NOT in scope
38
+
39
+ These are deferred to v2 and **not** in the current contract:
40
+
41
+ - `<schmancy-form-summary>` (top-of-form error banner with anchor links to invalid fields).
42
+ - `validateOn: 'length'` (validate once `value.length === maxlength` — Stripe card-number pattern).
43
+ - Per-field `errorMessages` i18n hook (the default `'This field is required'` is hardcoded English).
44
+ - First-class `useFieldArray` API for dynamic fields.
45
+ - Async-validation helpers (`isValidating`, `runAsyncValidator`, `:state(validating)`).
46
+ - Wizard `clearSubmitted()` (post-submit state currently persists until `resetForm`).
47
+ - Structured `ValidityStateFlags` exposure beyond `valueMissing` + `customError`.
48
+
49
+ If a consumer needs one of these, file an issue with the use case before adding it — every addition to the binding contract has a propagation cost across all 9 form components.
50
+
51
+ ## See also
52
+
53
+ - `form.md` — the `<schmancy-form>` API reference.
54
+ - `mixins.md` — `SchmancyFormField()` factory composition.
55
+ - `state.md` — `formSubmitState` singleton + per-form isolation.