@proyecto-viviana/solid-stately 0.5.1 → 0.6.0-rc.1

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 (418) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/README.md +59 -29
  4. package/dist/autocomplete/createAutocompleteState.d.ts +2 -1
  5. package/dist/autocomplete/createAutocompleteState.d.ts.map +1 -0
  6. package/dist/autocomplete/index.d.ts +1 -0
  7. package/dist/autocomplete/index.d.ts.map +1 -0
  8. package/dist/calendar/IncompleteDate.d.ts +2 -1
  9. package/dist/calendar/IncompleteDate.d.ts.map +1 -0
  10. package/dist/calendar/createCalendarState.d.ts +10 -9
  11. package/dist/calendar/createCalendarState.d.ts.map +1 -0
  12. package/dist/calendar/createDateFieldState.d.ts +4 -20
  13. package/dist/calendar/createDateFieldState.d.ts.map +1 -0
  14. package/dist/calendar/createDatePickerState.d.ts +4 -7
  15. package/dist/calendar/createDatePickerState.d.ts.map +1 -0
  16. package/dist/calendar/createRangeCalendarState.d.ts +9 -7
  17. package/dist/calendar/createRangeCalendarState.d.ts.map +1 -0
  18. package/dist/calendar/createTimeFieldState.d.ts +5 -24
  19. package/dist/calendar/createTimeFieldState.d.ts.map +1 -0
  20. package/dist/calendar/index.d.ts +1 -0
  21. package/dist/calendar/index.d.ts.map +1 -0
  22. package/dist/calendar/intl/index.d.ts +1 -0
  23. package/dist/calendar/intl/index.d.ts.map +1 -0
  24. package/dist/checkbox/createCheckboxGroupState.d.ts +3 -0
  25. package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -0
  26. package/dist/checkbox/index.d.ts +1 -0
  27. package/dist/checkbox/index.d.ts.map +1 -0
  28. package/dist/collections/ListCollection.d.ts +5 -0
  29. package/dist/collections/ListCollection.d.ts.map +1 -0
  30. package/dist/collections/createListState.d.ts +2 -6
  31. package/dist/collections/createListState.d.ts.map +1 -0
  32. package/dist/collections/createMenuState.d.ts +74 -13
  33. package/dist/collections/createMenuState.d.ts.map +1 -0
  34. package/dist/collections/createSelectionState.d.ts +2 -5
  35. package/dist/collections/createSelectionState.d.ts.map +1 -0
  36. package/dist/collections/getChildNodes.d.ts +6 -3
  37. package/dist/collections/getChildNodes.d.ts.map +1 -0
  38. package/dist/collections/index.d.ts +2 -1
  39. package/dist/collections/index.d.ts.map +1 -0
  40. package/dist/collections/types.d.ts +36 -2
  41. package/dist/collections/types.d.ts.map +1 -0
  42. package/dist/color/Color.d.ts +7 -1
  43. package/dist/color/Color.d.ts.map +1 -0
  44. package/dist/color/createColorAreaState.d.ts +6 -5
  45. package/dist/color/createColorAreaState.d.ts.map +1 -0
  46. package/dist/color/createColorFieldState.d.ts +4 -5
  47. package/dist/color/createColorFieldState.d.ts.map +1 -0
  48. package/dist/color/createColorSliderState.d.ts +4 -5
  49. package/dist/color/createColorSliderState.d.ts.map +1 -0
  50. package/dist/color/createColorWheelState.d.ts +2 -5
  51. package/dist/color/createColorWheelState.d.ts.map +1 -0
  52. package/dist/color/getColorChannels.d.ts +3 -0
  53. package/dist/color/getColorChannels.d.ts.map +1 -0
  54. package/dist/color/index.d.ts +2 -1
  55. package/dist/color/index.d.ts.map +1 -0
  56. package/dist/color/intl/index.d.ts +1 -0
  57. package/dist/color/intl/index.d.ts.map +1 -0
  58. package/dist/color/types.d.ts +2 -1
  59. package/dist/color/types.d.ts.map +1 -0
  60. package/dist/combobox/createComboBoxState.d.ts +92 -29
  61. package/dist/combobox/createComboBoxState.d.ts.map +1 -0
  62. package/dist/combobox/index.d.ts +2 -1
  63. package/dist/combobox/index.d.ts.map +1 -0
  64. package/dist/data/createAsyncList.d.ts +1 -7
  65. package/dist/data/createAsyncList.d.ts.map +1 -0
  66. package/dist/data/createListData.d.ts +1 -6
  67. package/dist/data/createListData.d.ts.map +1 -0
  68. package/dist/data/createTreeData.d.ts +1 -6
  69. package/dist/data/createTreeData.d.ts.map +1 -0
  70. package/dist/data/index.d.ts +1 -0
  71. package/dist/data/index.d.ts.map +1 -0
  72. package/dist/datepicker/index.d.ts +1 -0
  73. package/dist/datepicker/index.d.ts.map +1 -0
  74. package/dist/disclosure/createDisclosureState.d.ts +2 -5
  75. package/dist/disclosure/createDisclosureState.d.ts.map +1 -0
  76. package/dist/disclosure/index.d.ts +1 -0
  77. package/dist/disclosure/index.d.ts.map +1 -0
  78. package/dist/dnd/createDragState.d.ts +2 -6
  79. package/dist/dnd/createDragState.d.ts.map +1 -0
  80. package/dist/dnd/createDraggableCollectionState.d.ts +44 -11
  81. package/dist/dnd/createDraggableCollectionState.d.ts.map +1 -0
  82. package/dist/dnd/createDropState.d.ts +2 -6
  83. package/dist/dnd/createDropState.d.ts.map +1 -0
  84. package/dist/dnd/createDroppableCollectionState.d.ts +34 -11
  85. package/dist/dnd/createDroppableCollectionState.d.ts.map +1 -0
  86. package/dist/dnd/index.d.ts +3 -2
  87. package/dist/dnd/index.d.ts.map +1 -0
  88. package/dist/dnd/types.d.ts +17 -0
  89. package/dist/dnd/types.d.ts.map +1 -0
  90. package/dist/form/createFormValidationState.d.ts +2 -9
  91. package/{src → dist}/form/createFormValidationState.d.ts.map +1 -1
  92. package/dist/form/index.d.ts +1 -0
  93. package/dist/form/index.d.ts.map +1 -0
  94. package/dist/grid/createGridState.d.ts +4 -3
  95. package/dist/grid/createGridState.d.ts.map +1 -0
  96. package/dist/grid/index.d.ts +1 -0
  97. package/dist/grid/index.d.ts.map +1 -0
  98. package/dist/grid/types.d.ts +23 -1
  99. package/dist/grid/types.d.ts.map +1 -0
  100. package/dist/index.d.ts +7 -5
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +2947 -969
  103. package/dist/index.js.map +1 -1
  104. package/dist/menu/index.d.ts +3 -1
  105. package/dist/menu/index.d.ts.map +1 -0
  106. package/dist/numberfield/createNumberFieldState.d.ts +37 -9
  107. package/dist/numberfield/createNumberFieldState.d.ts.map +1 -0
  108. package/dist/numberfield/index.d.ts +1 -0
  109. package/dist/numberfield/index.d.ts.map +1 -0
  110. package/dist/overlays/createOverlayTriggerState.d.ts +12 -1
  111. package/dist/overlays/createOverlayTriggerState.d.ts.map +1 -0
  112. package/dist/overlays/index.d.ts +1 -0
  113. package/dist/overlays/index.d.ts.map +1 -0
  114. package/dist/private/flags/flags.d.ts +5 -0
  115. package/dist/private/flags/flags.d.ts.map +1 -0
  116. package/dist/private/flags/flags.js +26 -0
  117. package/dist/private/flags/flags.js.map +1 -0
  118. package/dist/radio/createRadioGroupState.d.ts +1 -0
  119. package/dist/radio/createRadioGroupState.d.ts.map +1 -0
  120. package/dist/radio/index.d.ts +1 -0
  121. package/dist/radio/index.d.ts.map +1 -0
  122. package/dist/searchfield/createSearchFieldState.d.ts +2 -5
  123. package/dist/searchfield/createSearchFieldState.d.ts.map +1 -0
  124. package/dist/searchfield/index.d.ts +1 -0
  125. package/dist/searchfield/index.d.ts.map +1 -0
  126. package/dist/select/createSelectState.d.ts +100 -33
  127. package/dist/select/createSelectState.d.ts.map +1 -0
  128. package/dist/select/index.d.ts +2 -1
  129. package/dist/select/index.d.ts.map +1 -0
  130. package/dist/selection/Selection.d.ts +2 -1
  131. package/dist/selection/Selection.d.ts.map +1 -0
  132. package/dist/selection/SelectionManager.d.ts +1 -19
  133. package/dist/selection/SelectionManager.d.ts.map +1 -0
  134. package/dist/selection/createMultipleSelectionState.d.ts +2 -13
  135. package/dist/selection/createMultipleSelectionState.d.ts.map +1 -0
  136. package/dist/selection/index.d.ts +1 -0
  137. package/dist/selection/index.d.ts.map +1 -0
  138. package/dist/slider/createSliderState.d.ts +37 -14
  139. package/dist/slider/createSliderState.d.ts.map +1 -0
  140. package/dist/slider/index.d.ts +1 -0
  141. package/dist/slider/index.d.ts.map +1 -0
  142. package/dist/ssr/index.d.ts +2 -13
  143. package/dist/ssr/index.d.ts.map +1 -0
  144. package/dist/steplist/createStepListState.d.ts +10 -18
  145. package/dist/steplist/createStepListState.d.ts.map +1 -0
  146. package/dist/steplist/index.d.ts +1 -0
  147. package/dist/steplist/index.d.ts.map +1 -0
  148. package/dist/table/TableCollection.d.ts +1 -0
  149. package/dist/table/TableCollection.d.ts.map +1 -0
  150. package/dist/table/createTableColumnResizeState.d.ts +2 -9
  151. package/dist/table/createTableColumnResizeState.d.ts.map +1 -0
  152. package/dist/table/createTableState.d.ts +3 -6
  153. package/dist/table/createTableState.d.ts.map +1 -0
  154. package/dist/table/createTreeGridState.d.ts +3 -9
  155. package/dist/table/createTreeGridState.d.ts.map +1 -0
  156. package/dist/table/index.d.ts +1 -0
  157. package/dist/table/index.d.ts.map +1 -0
  158. package/dist/table/types.d.ts +37 -3
  159. package/dist/table/types.d.ts.map +1 -0
  160. package/dist/tabs/createTabListState.d.ts +2 -5
  161. package/dist/tabs/createTabListState.d.ts.map +1 -0
  162. package/dist/tabs/index.d.ts +1 -0
  163. package/dist/tabs/index.d.ts.map +1 -0
  164. package/dist/textfield/createTextFieldState.d.ts +1 -0
  165. package/dist/textfield/createTextFieldState.d.ts.map +1 -0
  166. package/dist/textfield/index.d.ts +1 -0
  167. package/dist/textfield/index.d.ts.map +1 -0
  168. package/dist/toast/createToastState.d.ts +2 -5
  169. package/dist/toast/createToastState.d.ts.map +1 -0
  170. package/dist/toast/index.d.ts +1 -0
  171. package/dist/toast/index.d.ts.map +1 -0
  172. package/dist/toggle/createToggleGroupState.d.ts +1 -0
  173. package/dist/toggle/createToggleGroupState.d.ts.map +1 -0
  174. package/dist/toggle/createToggleState.d.ts +1 -0
  175. package/dist/toggle/createToggleState.d.ts.map +1 -0
  176. package/dist/toggle/index.d.ts +1 -0
  177. package/dist/toggle/index.d.ts.map +1 -0
  178. package/dist/tokenfield/TokenFieldValue.d.ts +96 -0
  179. package/dist/tokenfield/TokenFieldValue.d.ts.map +1 -0
  180. package/dist/tokenfield/createTokenFieldState.d.ts +33 -0
  181. package/dist/tokenfield/createTokenFieldState.d.ts.map +1 -0
  182. package/dist/tokenfield/index.d.ts +3 -0
  183. package/dist/tokenfield/index.d.ts.map +1 -0
  184. package/dist/tooltip/createTooltipTriggerState.d.ts +9 -8
  185. package/dist/tooltip/createTooltipTriggerState.d.ts.map +1 -0
  186. package/dist/tooltip/index.d.ts +1 -0
  187. package/dist/tooltip/index.d.ts.map +1 -0
  188. package/dist/tree/TreeCollection.d.ts +1 -0
  189. package/dist/tree/TreeCollection.d.ts.map +1 -0
  190. package/dist/tree/createTreeState.d.ts +3 -8
  191. package/dist/tree/createTreeState.d.ts.map +1 -0
  192. package/dist/tree/index.d.ts +1 -0
  193. package/dist/tree/index.d.ts.map +1 -0
  194. package/dist/tree/types.d.ts +19 -1
  195. package/dist/tree/types.d.ts.map +1 -0
  196. package/dist/utils/index.d.ts +3 -1
  197. package/dist/utils/index.d.ts.map +1 -0
  198. package/dist/utils/owner.d.ts +9 -0
  199. package/dist/utils/owner.d.ts.map +1 -0
  200. package/dist/utils/reactivity.d.ts +24 -0
  201. package/dist/utils/reactivity.d.ts.map +1 -0
  202. package/package.json +21 -9
  203. package/src/autocomplete/createAutocompleteState.ts +18 -4
  204. package/src/calendar/IncompleteDate.ts +15 -1
  205. package/src/calendar/createCalendarState.ts +321 -125
  206. package/src/calendar/createDateFieldState.ts +45 -31
  207. package/src/calendar/createDatePickerState.ts +47 -26
  208. package/src/calendar/createRangeCalendarState.ts +173 -86
  209. package/src/calendar/createTimeFieldState.ts +26 -7
  210. package/src/calendar/intl/index.ts +37 -2
  211. package/src/checkbox/createCheckboxGroupState.ts +45 -13
  212. package/src/collections/ListCollection.ts +31 -0
  213. package/src/collections/createListState.ts +27 -10
  214. package/src/collections/createMenuState.ts +190 -15
  215. package/src/collections/createSelectionState.ts +33 -13
  216. package/src/collections/getChildNodes.ts +20 -3
  217. package/src/collections/index.ts +6 -0
  218. package/src/collections/types.ts +35 -2
  219. package/src/color/Color.ts +61 -22
  220. package/src/color/createColorAreaState.ts +48 -4
  221. package/src/color/createColorFieldState.ts +114 -38
  222. package/src/color/createColorSliderState.ts +61 -9
  223. package/src/color/createColorWheelState.ts +29 -9
  224. package/src/color/getColorChannels.ts +16 -0
  225. package/src/color/index.ts +1 -0
  226. package/src/color/intl/index.ts +38 -3
  227. package/src/color/types.ts +1 -1
  228. package/src/combobox/createComboBoxState.ts +530 -297
  229. package/src/combobox/index.ts +4 -0
  230. package/src/data/createAsyncList.ts +41 -6
  231. package/src/data/createListData.ts +27 -4
  232. package/src/data/createTreeData.ts +30 -6
  233. package/src/disclosure/createDisclosureState.ts +40 -19
  234. package/src/dnd/createDragState.ts +22 -4
  235. package/src/dnd/createDraggableCollectionState.ts +145 -11
  236. package/src/dnd/createDropState.ts +21 -3
  237. package/src/dnd/createDroppableCollectionState.ts +127 -11
  238. package/src/dnd/index.ts +4 -0
  239. package/src/dnd/types.ts +16 -0
  240. package/src/form/createFormValidationState.ts +69 -37
  241. package/src/grid/createGridState.ts +196 -111
  242. package/src/grid/types.ts +22 -1
  243. package/src/index.ts +33 -2
  244. package/src/menu/index.ts +7 -0
  245. package/src/numberfield/createNumberFieldState.ts +247 -98
  246. package/src/overlays/createOverlayTriggerState.ts +31 -4
  247. package/src/private/flags/flags.ts +25 -0
  248. package/src/radio/createRadioGroupState.ts +23 -6
  249. package/src/searchfield/createSearchFieldState.ts +18 -3
  250. package/src/select/createSelectState.ts +317 -130
  251. package/src/select/index.ts +8 -1
  252. package/src/selection/Selection.ts +15 -1
  253. package/src/selection/SelectionManager.ts +17 -1
  254. package/src/selection/createMultipleSelectionState.ts +45 -26
  255. package/src/slider/createSliderState.ts +243 -104
  256. package/src/ssr/index.ts +34 -4
  257. package/src/steplist/createStepListState.ts +184 -130
  258. package/src/table/TableCollection.ts +14 -0
  259. package/src/table/createTableColumnResizeState.ts +71 -14
  260. package/src/table/createTableState.ts +26 -4
  261. package/src/table/createTreeGridState.ts +22 -6
  262. package/src/table/types.ts +38 -5
  263. package/src/tabs/createTabListState.ts +63 -43
  264. package/src/textfield/createTextFieldState.ts +17 -3
  265. package/src/toast/createToastState.ts +28 -3
  266. package/src/toggle/createToggleGroupState.ts +20 -5
  267. package/src/toggle/createToggleState.ts +19 -4
  268. package/src/tokenfield/TokenFieldValue.ts +499 -0
  269. package/src/tokenfield/createTokenFieldState.ts +88 -0
  270. package/src/tokenfield/index.ts +15 -0
  271. package/src/tooltip/createTooltipTriggerState.ts +49 -13
  272. package/src/tree/TreeCollection.ts +14 -0
  273. package/src/tree/createTreeState.ts +70 -36
  274. package/src/tree/types.ts +18 -1
  275. package/src/utils/index.ts +10 -1
  276. package/src/utils/owner.ts +20 -0
  277. package/src/utils/reactivity.ts +53 -1
  278. package/src/autocomplete/createAutocompleteState.d.ts +0 -48
  279. package/src/autocomplete/createAutocompleteState.d.ts.map +0 -1
  280. package/src/autocomplete/index.d.ts +0 -6
  281. package/src/autocomplete/index.d.ts.map +0 -1
  282. package/src/calendar/createCalendarState.d.ts +0 -152
  283. package/src/calendar/createCalendarState.d.ts.map +0 -1
  284. package/src/calendar/createDateFieldState.d.ts +0 -145
  285. package/src/calendar/createDateFieldState.d.ts.map +0 -1
  286. package/src/calendar/createRangeCalendarState.d.ts +0 -171
  287. package/src/calendar/createRangeCalendarState.d.ts.map +0 -1
  288. package/src/calendar/createTimeFieldState.d.ts +0 -97
  289. package/src/calendar/createTimeFieldState.d.ts.map +0 -1
  290. package/src/calendar/index.d.ts +0 -80
  291. package/src/calendar/index.d.ts.map +0 -1
  292. package/src/checkbox/createCheckboxGroupState.d.ts +0 -73
  293. package/src/checkbox/createCheckboxGroupState.d.ts.map +0 -1
  294. package/src/checkbox/index.d.ts +0 -6
  295. package/src/checkbox/index.d.ts.map +0 -1
  296. package/src/collections/ListCollection.d.ts +0 -40
  297. package/src/collections/ListCollection.d.ts.map +0 -1
  298. package/src/collections/createListState.d.ts +0 -94
  299. package/src/collections/createListState.d.ts.map +0 -1
  300. package/src/collections/createMenuState.d.ts +0 -55
  301. package/src/collections/createMenuState.d.ts.map +0 -1
  302. package/src/collections/createSelectionState.d.ts +0 -89
  303. package/src/collections/createSelectionState.d.ts.map +0 -1
  304. package/src/collections/index.d.ts +0 -38
  305. package/src/collections/index.d.ts.map +0 -1
  306. package/src/collections/types.d.ts +0 -147
  307. package/src/collections/types.d.ts.map +0 -1
  308. package/src/color/Color.d.ts +0 -43
  309. package/src/color/Color.d.ts.map +0 -1
  310. package/src/color/createColorAreaState.d.ts +0 -78
  311. package/src/color/createColorAreaState.d.ts.map +0 -1
  312. package/src/color/createColorFieldState.d.ts +0 -57
  313. package/src/color/createColorFieldState.d.ts.map +0 -1
  314. package/src/color/createColorSliderState.d.ts +0 -69
  315. package/src/color/createColorSliderState.d.ts.map +0 -1
  316. package/src/color/createColorWheelState.d.ts +0 -53
  317. package/src/color/createColorWheelState.d.ts.map +0 -1
  318. package/src/color/index.d.ts +0 -39
  319. package/src/color/index.d.ts.map +0 -1
  320. package/src/color/types.d.ts +0 -111
  321. package/src/color/types.d.ts.map +0 -1
  322. package/src/combobox/createComboBoxState.d.ts +0 -127
  323. package/src/combobox/createComboBoxState.d.ts.map +0 -1
  324. package/src/combobox/index.d.ts +0 -13
  325. package/src/combobox/index.d.ts.map +0 -1
  326. package/src/disclosure/createDisclosureState.d.ts +0 -68
  327. package/src/disclosure/createDisclosureState.d.ts.map +0 -1
  328. package/src/disclosure/index.d.ts +0 -10
  329. package/src/disclosure/index.d.ts.map +0 -1
  330. package/src/dnd/createDragState.d.ts +0 -68
  331. package/src/dnd/createDragState.d.ts.map +0 -1
  332. package/src/dnd/createDraggableCollectionState.d.ts +0 -68
  333. package/src/dnd/createDraggableCollectionState.d.ts.map +0 -1
  334. package/src/dnd/createDropState.d.ts +0 -80
  335. package/src/dnd/createDropState.d.ts.map +0 -1
  336. package/src/dnd/createDroppableCollectionState.d.ts +0 -107
  337. package/src/dnd/createDroppableCollectionState.d.ts.map +0 -1
  338. package/src/dnd/index.d.ts +0 -60
  339. package/src/dnd/index.d.ts.map +0 -1
  340. package/src/dnd/types.d.ts +0 -277
  341. package/src/dnd/types.d.ts.map +0 -1
  342. package/src/form/createFormValidationState.d.ts +0 -102
  343. package/src/form/index.d.ts +0 -16
  344. package/src/form/index.d.ts.map +0 -1
  345. package/src/grid/createGridState.d.ts +0 -15
  346. package/src/grid/createGridState.d.ts.map +0 -1
  347. package/src/grid/index.d.ts +0 -7
  348. package/src/grid/index.d.ts.map +0 -1
  349. package/src/grid/types.d.ts +0 -163
  350. package/src/grid/types.d.ts.map +0 -1
  351. package/src/index.d.ts +0 -311
  352. package/src/index.d.ts.map +0 -1
  353. package/src/numberfield/createNumberFieldState.d.ts +0 -67
  354. package/src/numberfield/createNumberFieldState.d.ts.map +0 -1
  355. package/src/numberfield/index.d.ts +0 -6
  356. package/src/numberfield/index.d.ts.map +0 -1
  357. package/src/overlays/createOverlayTriggerState.d.ts +0 -34
  358. package/src/overlays/createOverlayTriggerState.d.ts.map +0 -1
  359. package/src/overlays/index.d.ts +0 -6
  360. package/src/overlays/index.d.ts.map +0 -1
  361. package/src/radio/createRadioGroupState.d.ts +0 -79
  362. package/src/radio/createRadioGroupState.d.ts.map +0 -1
  363. package/src/radio/index.d.ts +0 -7
  364. package/src/radio/index.d.ts.map +0 -1
  365. package/src/searchfield/createSearchFieldState.d.ts +0 -27
  366. package/src/searchfield/createSearchFieldState.d.ts.map +0 -1
  367. package/src/searchfield/index.d.ts +0 -3
  368. package/src/searchfield/index.d.ts.map +0 -1
  369. package/src/select/createSelectState.d.ts +0 -75
  370. package/src/select/createSelectState.d.ts.map +0 -1
  371. package/src/select/index.d.ts +0 -2
  372. package/src/select/index.d.ts.map +0 -1
  373. package/src/slider/createSliderState.d.ts +0 -72
  374. package/src/slider/createSliderState.d.ts.map +0 -1
  375. package/src/slider/index.d.ts +0 -3
  376. package/src/slider/index.d.ts.map +0 -1
  377. package/src/ssr/index.d.ts +0 -28
  378. package/src/ssr/index.d.ts.map +0 -1
  379. package/src/table/TableCollection.d.ts +0 -54
  380. package/src/table/TableCollection.d.ts.map +0 -1
  381. package/src/table/createTableState.d.ts +0 -15
  382. package/src/table/createTableState.d.ts.map +0 -1
  383. package/src/table/index.d.ts +0 -18
  384. package/src/table/index.d.ts.map +0 -1
  385. package/src/table/types.d.ts +0 -145
  386. package/src/table/types.d.ts.map +0 -1
  387. package/src/tabs/createTabListState.d.ts +0 -70
  388. package/src/tabs/createTabListState.d.ts.map +0 -1
  389. package/src/tabs/index.d.ts +0 -8
  390. package/src/tabs/index.d.ts.map +0 -1
  391. package/src/textfield/createTextFieldState.d.ts +0 -32
  392. package/src/textfield/createTextFieldState.d.ts.map +0 -1
  393. package/src/textfield/index.d.ts +0 -6
  394. package/src/textfield/index.d.ts.map +0 -1
  395. package/src/toast/createToastState.d.ts +0 -129
  396. package/src/toast/createToastState.d.ts.map +0 -1
  397. package/src/toast/index.d.ts +0 -12
  398. package/src/toast/index.d.ts.map +0 -1
  399. package/src/toggle/createToggleState.d.ts +0 -34
  400. package/src/toggle/createToggleState.d.ts.map +0 -1
  401. package/src/toggle/index.d.ts +0 -2
  402. package/src/toggle/index.d.ts.map +0 -1
  403. package/src/tooltip/createTooltipTriggerState.d.ts +0 -39
  404. package/src/tooltip/createTooltipTriggerState.d.ts.map +0 -1
  405. package/src/tooltip/index.d.ts +0 -7
  406. package/src/tooltip/index.d.ts.map +0 -1
  407. package/src/tree/TreeCollection.d.ts +0 -43
  408. package/src/tree/TreeCollection.d.ts.map +0 -1
  409. package/src/tree/createTreeState.d.ts +0 -17
  410. package/src/tree/createTreeState.d.ts.map +0 -1
  411. package/src/tree/index.d.ts +0 -13
  412. package/src/tree/index.d.ts.map +0 -1
  413. package/src/tree/types.d.ts +0 -162
  414. package/src/tree/types.d.ts.map +0 -1
  415. package/src/utils/index.d.ts +0 -2
  416. package/src/utils/index.d.ts.map +0 -1
  417. package/src/utils/reactivity.d.ts +0 -28
  418. package/src/utils/reactivity.d.ts.map +0 -1
@@ -1,9 +1,42 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ /*
14
+ * Copyright 2024 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */
24
+
25
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@react-types/shared/src/collections.d.ts
26
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@react-types/shared/src/selection.d.ts
27
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/collections/BaseCollection.ts
28
+
1
29
  /**
2
30
  * Core types for collection state management.
3
- * Simplified from @react-stately/collections for SolidJS.
31
+ * Collection state types for SolidJS.
32
+ *
33
+ * Ported from:
34
+ * - packages/@react-types/shared/src/collections.d.ts
35
+ * - packages/@react-types/shared/src/selection.d.ts
36
+ * - packages/react-aria/src/collections/BaseCollection.ts
4
37
  */
5
38
 
6
- import type { JSX } from "solid-js";
39
+ import type { JSX } from "@solidjs/web";
7
40
 
8
41
  /** A unique identifier for an item in a collection. */
9
42
  export type Key = string | number;
@@ -1,6 +1,20 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/color/Color.ts
14
+
1
15
  /**
2
16
  * Color class implementation.
3
- * Based on @react-stately/color.
17
+ * Ported from packages/react-stately/src/color/Color.ts.
4
18
  *
5
19
  * Provides color manipulation, conversion, and formatting.
6
20
  */
@@ -12,9 +26,6 @@ import type {
12
26
  ColorChannel,
13
27
  ColorChannelRange,
14
28
  ColorAxes,
15
- RGBColor,
16
- HSLColor,
17
- HSBColor,
18
29
  } from "./types";
19
30
  import { getColorStringForLocale, formatColorMessage, type ColorStringKey } from "./intl";
20
31
 
@@ -73,6 +84,17 @@ function clamp(value: number, min: number, max: number): number {
73
84
  return Math.min(Math.max(value, min), max);
74
85
  }
75
86
 
87
+ /**
88
+ * Normalizes a hue value to [0, 360).
89
+ * Preserves 360 so linear hue sliders can reach the end of their track.
90
+ */
91
+ export function normalizeHue(hue: number): number {
92
+ if (hue === 360) {
93
+ return hue;
94
+ }
95
+ return ((hue % 360) + 360) % 360;
96
+ }
97
+
76
98
  /**
77
99
  * Round to fixed decimal places.
78
100
  */
@@ -563,7 +585,7 @@ class HSLColorImpl implements Color {
563
585
  constructor(hue: number, saturation: number, lightness: number, alpha: number = 1) {
564
586
  // Store raw like upstream HSLColor's constructor — precision comes from the
565
587
  // conversion (toFixed(_, 2)); rounding to integers here diverged from S2.
566
- this.hue = clamp(hue % 360, 0, 360);
588
+ this.hue = clamp(normalizeHue(hue), 0, 360);
567
589
  this.saturation = clamp(saturation, 0, 100);
568
590
  this.lightness = clamp(lightness, 0, 100);
569
591
  this.alpha = clamp(toFixed(alpha, 2), 0, 1);
@@ -583,9 +605,16 @@ class HSLColorImpl implements Color {
583
605
  }
584
606
  case "hsb":
585
607
  case "hsba": {
586
- const { r, g, b } = hslToRgb(this.hue, this.saturation, this.lightness);
587
- const hsb = rgbToHsb(r, g, b);
588
- return new HSBColorImpl(hsb.h, hsb.s, hsb.b, this.alpha);
608
+ const saturation = this.saturation / 100;
609
+ const lightness = this.lightness / 100;
610
+ const brightness = lightness + saturation * Math.min(lightness, 1 - lightness);
611
+ const hsbSaturation = brightness === 0 ? 0 : 2 * (1 - lightness / brightness);
612
+ return new HSBColorImpl(
613
+ toFixed(this.hue, 2),
614
+ toFixed(hsbSaturation * 100, 2),
615
+ toFixed(brightness * 100, 2),
616
+ this.alpha,
617
+ );
589
618
  }
590
619
  default:
591
620
  throw new Error(`Unsupported format: ${format}`);
@@ -688,7 +717,7 @@ class HSLColorImpl implements Color {
688
717
  return { style: "percent" };
689
718
  }
690
719
  if (channel === "hue") {
691
- return { style: "unit", unit: "degree", unitDisplay: "narrow", maximumFractionDigits: 0 };
720
+ return { style: "unit", unit: "degree", unitDisplay: "narrow" };
692
721
  }
693
722
  return { style: "percent", maximumFractionDigits: 0 };
694
723
  }
@@ -738,7 +767,7 @@ class HSBColorImpl implements Color {
738
767
 
739
768
  constructor(hue: number, saturation: number, brightness: number, alpha: number = 1) {
740
769
  // Store raw like upstream HSBColor's constructor (see HSLColorImpl).
741
- this.hue = clamp(hue % 360, 0, 360);
770
+ this.hue = clamp(normalizeHue(hue), 0, 360);
742
771
  this.saturation = clamp(saturation, 0, 100);
743
772
  this.brightness = clamp(brightness, 0, 100);
744
773
  this.alpha = clamp(toFixed(alpha, 2), 0, 1);
@@ -758,9 +787,19 @@ class HSBColorImpl implements Color {
758
787
  }
759
788
  case "hsl":
760
789
  case "hsla": {
761
- const { r, g, b } = hsbToRgb(this.hue, this.saturation, this.brightness);
762
- const hsl = rgbToHsl(r, g, b);
763
- return new HSLColorImpl(hsl.h, hsl.s, hsl.l, this.alpha);
790
+ const saturation = this.saturation / 100;
791
+ const brightness = this.brightness / 100;
792
+ const lightness = brightness * (1 - saturation / 2);
793
+ const hslSaturation =
794
+ lightness === 0 || lightness === 1
795
+ ? 0
796
+ : (brightness - lightness) / Math.min(lightness, 1 - lightness);
797
+ return new HSLColorImpl(
798
+ toFixed(this.hue, 2),
799
+ toFixed(hslSaturation * 100, 2),
800
+ toFixed(lightness * 100, 2),
801
+ this.alpha,
802
+ );
764
803
  }
765
804
  default:
766
805
  throw new Error(`Unsupported format: ${format}`);
@@ -862,7 +901,7 @@ class HSBColorImpl implements Color {
862
901
  return { style: "percent" };
863
902
  }
864
903
  if (channel === "hue") {
865
- return { style: "unit", unit: "degree", unitDisplay: "narrow", maximumFractionDigits: 0 };
904
+ return { style: "unit", unit: "degree", unitDisplay: "narrow" };
866
905
  }
867
906
  return { style: "percent", maximumFractionDigits: 0 };
868
907
  }
@@ -956,24 +995,24 @@ export function parseColor(value: string): Color {
956
995
 
957
996
  // HSL/HSLA format
958
997
  const hslMatch = trimmed.match(
959
- /^hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([\d.]+))?\s*\)$/,
998
+ /^hsla?\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*(?:,\s*([-+]?\d+(?:\.\d+)?))?\s*\)$/,
960
999
  );
961
1000
  if (hslMatch) {
962
- const h = parseInt(hslMatch[1], 10);
963
- const s = parseInt(hslMatch[2], 10);
964
- const l = parseInt(hslMatch[3], 10);
1001
+ const h = parseFloat(hslMatch[1]);
1002
+ const s = parseFloat(hslMatch[2]);
1003
+ const l = parseFloat(hslMatch[3]);
965
1004
  const a = hslMatch[4] !== undefined ? parseFloat(hslMatch[4]) : 1;
966
1005
  return new HSLColorImpl(h, s, l, a);
967
1006
  }
968
1007
 
969
1008
  // HSB/HSBA format
970
1009
  const hsbMatch = trimmed.match(
971
- /^hsba?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*([\d.]+))?\s*\)$/,
1010
+ /^hsba?\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*(?:,\s*([-+]?\d+(?:\.\d+)?))?\s*\)$/,
972
1011
  );
973
1012
  if (hsbMatch) {
974
- const h = parseInt(hsbMatch[1], 10);
975
- const s = parseInt(hsbMatch[2], 10);
976
- const b = parseInt(hsbMatch[3], 10);
1013
+ const h = parseFloat(hsbMatch[1]);
1014
+ const s = parseFloat(hsbMatch[2]);
1015
+ const b = parseFloat(hsbMatch[3]);
977
1016
  const a = hsbMatch[4] !== undefined ? parseFloat(hsbMatch[4]) : 1;
978
1017
  return new HSBColorImpl(h, s, b, a);
979
1018
  }
@@ -1,11 +1,27 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/color/useColorAreaState.ts
14
+
1
15
  /**
2
16
  * ColorArea state management.
3
17
  * Based on @react-stately/color useColorAreaState.
4
18
  */
5
19
 
6
- import { createSignal, createMemo, type Accessor } from "solid-js";
20
+ import { createMemo } from "solid-js";
21
+ import type { Accessor } from "solid-js";
7
22
  import type { Color, ColorChannel, ColorAxes, ColorSpace } from "./types";
8
23
  import { normalizeColor } from "./Color";
24
+ import { createInternalSignal } from "../utils";
9
25
 
10
26
  export interface ColorAreaStateOptions {
11
27
  /** The current color value (controlled). */
@@ -29,6 +45,8 @@ export interface ColorAreaStateOptions {
29
45
  export interface ColorAreaState {
30
46
  /** The current color value. */
31
47
  readonly value: Color;
48
+ /** The color a native form reset restores. */
49
+ readonly defaultValue: Color;
32
50
  /** The X axis channel. */
33
51
  readonly xChannel: ColorChannel;
34
52
  /** The Y axis channel. */
@@ -56,6 +74,8 @@ export interface ColorAreaState {
56
74
  setXValue(value: number): void;
57
75
  /** Set the Y channel value. */
58
76
  setYValue(value: number): void;
77
+ /** Replace the color. */
78
+ setValue(value: Color | string): void;
59
79
  /** Set color from a point (0-1, 0-1). */
60
80
  setColorFromPoint(x: number, y: number): void;
61
81
  /** Get the thumb position as percentages. */
@@ -87,8 +107,15 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
87
107
  };
88
108
 
89
109
  // Internal value state
90
- const [internalValue, setInternalValue] = createSignal<Color | null>(null);
91
- const [isDragging, setIsDragging] = createSignal(false);
110
+ const [internalValue, setInternalValue] = createInternalSignal<Color | null>(null);
111
+ // Pin useColorAreaState returns the first controlled color as defaultValue
112
+ // so a native form reset restores that color. The built-in red is only the
113
+ // uncontrolled fallback when no defaultValue was passed.
114
+ const firstOptions = getOptions();
115
+ const controlledInitial =
116
+ firstOptions.value !== undefined ? normalizeValue(firstOptions.value) : undefined;
117
+ const initialValue = normalizeValue(firstOptions.defaultValue ?? "#ff0000");
118
+ const [isDragging, setIsDragging] = createInternalSignal(false);
92
119
 
93
120
  // Initialize internal value
94
121
  const initValue = () => {
@@ -141,10 +168,13 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
141
168
  const xChannelPageStep = createMemo(() => xRange().pageSize);
142
169
  const yChannelPageStep = createMemo(() => yRange().pageSize);
143
170
 
171
+ let lastValue: Color | null = internalValue();
172
+
144
173
  // Update value
145
174
  const updateValue = (newColor: Color) => {
146
175
  const opts = getOptions();
147
176
  const nextColor = opts.colorSpace ? newColor.toFormat(opts.colorSpace) : newColor;
177
+ lastValue = nextColor;
148
178
 
149
179
  // Controlled mode
150
180
  if (opts.value !== undefined) {
@@ -163,6 +193,10 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
163
193
  // Get Y value
164
194
  const getYValue = () => value().getChannelValue(yChannel());
165
195
 
196
+ const setValue = (newValue: Color | string) => {
197
+ updateValue(normalizeValue(newValue));
198
+ };
199
+
166
200
  // Set X value
167
201
  const setXValue = (newValue: number) => {
168
202
  const range = xRange();
@@ -245,7 +279,13 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
245
279
 
246
280
  // Call onChangeEnd when dragging ends
247
281
  if (wasDragging && !dragging) {
248
- getOptions().onChangeEnd?.(value());
282
+ const opts = getOptions();
283
+ const current =
284
+ lastValue ??
285
+ (opts.value !== undefined ? normalizeValue(opts.value) : null) ??
286
+ internalValue() ??
287
+ value();
288
+ opts.onChangeEnd?.(current);
249
289
  }
250
290
  };
251
291
 
@@ -258,6 +298,9 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
258
298
  get value() {
259
299
  return value();
260
300
  },
301
+ get defaultValue() {
302
+ return controlledInitial ?? initialValue;
303
+ },
261
304
  get xChannel() {
262
305
  return xChannel();
263
306
  },
@@ -289,6 +332,7 @@ export function createColorAreaState(options: Accessor<ColorAreaStateOptions>):
289
332
  getYValue,
290
333
  setXValue,
291
334
  setYValue,
335
+ setValue,
292
336
  setColorFromPoint,
293
337
  getThumbPosition,
294
338
  incrementX,
@@ -1,11 +1,28 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/color/useColorChannelFieldState.ts
14
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-stately/src/color/useColorFieldState.ts
15
+
1
16
  /**
2
17
  * ColorField state management.
3
18
  * Based on @react-stately/color useColorFieldState and useColorChannelFieldState.
4
19
  */
5
20
 
6
- import { createEffect, createMemo, createSignal, type Accessor } from "solid-js";
21
+ import { createEffect, createMemo } from "solid-js";
22
+ import type { Accessor } from "solid-js";
7
23
  import type { Color, ColorChannel, ColorChannelRange, ColorFormat, ColorSpace } from "./types";
8
24
  import { createRGBColor, normalizeColor, parseColor } from "./Color";
25
+ import { createInternalSignal, readNow } from "../utils";
9
26
 
10
27
  const HEX_COLOR_MAX = 0xffffff;
11
28
  const PARTIAL_HEX_PATTERN = /^#?[0-9a-f]{0,6}$/i;
@@ -40,6 +57,8 @@ export interface ColorFieldState {
40
57
  readonly value: Color | null;
41
58
  /** The color used for channel calculations. */
42
59
  readonly colorValue: Color;
60
+ /** The color a native form reset restores. */
61
+ readonly defaultColorValue: Color | null;
43
62
  /** The current input text. */
44
63
  readonly inputValue: string;
45
64
  /** The numeric value exposed by channel fields. */
@@ -145,7 +164,13 @@ function formatColorValue(
145
164
  return displayColor.formatChannelValue(channel, locale);
146
165
  }
147
166
 
148
- return displayColor.toString(format ?? "hex");
167
+ const formatted = displayColor.toString(format ?? "hex");
168
+ const resolvedFormat = format ?? "hex";
169
+ if (resolvedFormat === "hex" || resolvedFormat === "hexa") {
170
+ return formatted.toUpperCase();
171
+ }
172
+
173
+ return formatted;
149
174
  }
150
175
 
151
176
  function normalizeHexInput(value: string): string {
@@ -189,9 +214,18 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
189
214
  const getOptions = () => options();
190
215
  const initialOptions = getOptions();
191
216
  const initialValue = getDefaultValue(initialOptions);
192
-
193
- const [internalValue, setInternalValue] = createSignal<Color | null>(initialValue);
194
- const [inputValue, setInputValueInternal] = createSignal(
217
+ // Form reset restores the first defaultValue, or the first controlled color
218
+ // when that default was omitted. An explicit null default falls through.
219
+ const initialDefault =
220
+ initialOptions.defaultValue !== undefined
221
+ ? normalizeNullableColor(initialOptions.defaultValue)
222
+ : undefined;
223
+ const firstColor =
224
+ initialOptions.value !== undefined ? normalizeNullableColor(initialOptions.value) : undefined;
225
+ const defaultColorValue = initialDefault ?? firstColor ?? null;
226
+
227
+ const [internalValue, setInternalValue] = createInternalSignal<Color | null>(initialValue);
228
+ const [inputValue, setInputValueInternal] = createInternalSignal(
195
229
  formatColorValue(
196
230
  initialValue,
197
231
  initialOptions.channel,
@@ -200,7 +234,10 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
200
234
  initialOptions.locale ?? "en-US",
201
235
  ),
202
236
  );
203
- const [invalidInput, setInvalidInput] = createSignal(false);
237
+ const [invalidInput, setInvalidInput] = createInternalSignal(false);
238
+ // Formatted channel text may round the accepted number. Only user edits
239
+ // should parse that text back into a new numerical value.
240
+ let isChannelInputEdited = false;
204
241
 
205
242
  const channel = createMemo(() => getOptions().channel);
206
243
  const colorSpace = createMemo(() => getOptions().colorSpace);
@@ -223,10 +260,14 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
223
260
  const formatCurrentValue = (color: Color | null = value()) =>
224
261
  formatColorValue(color, channel(), colorSpace(), getOptions().colorFormat, locale());
225
262
 
226
- createEffect(() => {
227
- setInputValueInternal(formatCurrentValue());
228
- setInvalidInput(false);
229
- });
263
+ createEffect(
264
+ () => formatCurrentValue(),
265
+ (formatted) => {
266
+ isChannelInputEdited = false;
267
+ setInputValueInternal(formatted);
268
+ setInvalidInput(false);
269
+ },
270
+ );
230
271
 
231
272
  const updateValue = (newColor: Color | null) => {
232
273
  const opts = getOptions();
@@ -236,11 +277,13 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
236
277
  }
237
278
 
238
279
  opts.onChange?.(newColor);
280
+ isChannelInputEdited = false;
239
281
  setInputValueInternal(formatCurrentValue(newColor));
240
282
  setInvalidInput(false);
241
283
  };
242
284
 
243
285
  const setInputValue = (text: string) => {
286
+ isChannelInputEdited = true;
244
287
  setInputValueInternal(text);
245
288
  setInvalidInput(false);
246
289
  };
@@ -249,45 +292,74 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
249
292
  updateValue(newColor);
250
293
  };
251
294
 
295
+ // Methods can run before Solid's value memo observes an earlier write.
296
+ const currentValue = () => {
297
+ const opts = getOptions();
298
+ return opts.value !== undefined ? normalizeNullableColor(opts.value) : readNow(internalValue);
299
+ };
300
+
252
301
  const commit = () => {
253
- const text = inputValue().trim();
302
+ const text = readNow(inputValue).trim();
254
303
  const opts = getOptions();
255
304
  const chan = channel();
305
+ const current = currentValue();
256
306
 
257
307
  if (!text) {
258
- updateValue(null);
259
- return;
260
- }
261
-
262
- if (chan) {
263
- const displayColor = colorValue();
308
+ if (current !== null) updateValue(null);
309
+ } else if (chan) {
310
+ const displayColor = getDisplayColor(current, colorSpace());
264
311
  const rawValue = parseChannelValue(text, displayColor, chan);
265
- if (rawValue == null) {
266
- setInputValueInternal(formatCurrentValue());
267
- setInvalidInput(false);
268
- return;
312
+ if (isChannelInputEdited && rawValue !== null) {
313
+ const next = displayColor.withChannelValue(chan, rawValue);
314
+ if (current === null || next.getChannelValue(chan) !== displayColor.getChannelValue(chan)) {
315
+ updateValue(next);
316
+ }
317
+ }
318
+ } else {
319
+ try {
320
+ const next = parseHexValue(text, opts.colorFormat);
321
+ // Whole hex edits compare RGB; hexa also edits alpha. This is not
322
+ // the equality policy for channel edits or the public color setter.
323
+ if (
324
+ current === null ||
325
+ next.toHexInt() !== current.toHexInt() ||
326
+ (opts.colorFormat === "hexa" &&
327
+ next.getChannelValue("alpha") !== current.getChannelValue("alpha"))
328
+ ) {
329
+ updateValue(next);
330
+ }
331
+ } catch {
332
+ // Invalid text rolls back to the accepted color below.
269
333
  }
270
-
271
- updateValue(displayColor.withChannelValue(chan, rawValue));
272
- return;
273
334
  }
274
335
 
336
+ // Read after onChange: a controlled parent may accept or refuse the
337
+ // request. Later signal acceptance is handled by the formatting effect.
338
+ isChannelInputEdited = false;
339
+ setInputValueInternal(formatCurrentValue(currentValue()));
340
+ setInvalidInput(false);
341
+ };
342
+
343
+ const incrementHex = (amount: number) => {
344
+ // Step the text being edited. A missing or unparseable hex starts at black,
345
+ // matching useColorFieldState's addColorValue(parsedValue, step).
346
+ const text = readNow(inputValue);
347
+ let parsed: Color | null = null;
275
348
  try {
276
- updateValue(parseHexValue(text, opts.colorFormat));
349
+ parsed = parseColor(text.startsWith("#") ? text : `#${text}`);
277
350
  } catch {
278
- setInputValueInternal(formatCurrentValue());
279
- setInvalidInput(false);
351
+ parsed = null;
280
352
  }
281
- };
282
353
 
283
- const incrementHex = (amount: number) => {
284
- const currentColor = value();
285
- if (!currentColor) {
354
+ const base = parsed ?? hexIntToColor(0);
355
+ const nextColor = hexIntToColor(base.toFormat("rgb").toHexInt() + amount);
356
+ const current = value();
357
+ if (current && current.toFormat("rgb").toHexInt() === nextColor.toHexInt()) {
286
358
  return;
287
359
  }
288
360
 
289
- const newColor = hexIntToColor(currentColor.toFormat("rgb").toHexInt() + amount);
290
- updateValue(getOptions().colorFormat ? newColor.toFormat(getOptions().colorFormat!) : newColor);
361
+ const format = getOptions().colorFormat;
362
+ updateValue(format ? nextColor.toFormat(format) : nextColor);
291
363
  };
292
364
 
293
365
  const updateChannel = (amount: number | "min" | "max") => {
@@ -296,17 +368,20 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
296
368
  return;
297
369
  }
298
370
 
299
- const displayColor = colorValue();
371
+ const current = currentValue();
372
+ const displayColor = getDisplayColor(current, colorSpace());
300
373
  const range = displayColor.getChannelRange(chan);
301
- const currentValue = displayColor.getChannelValue(chan);
374
+ const currentChannel = displayColor.getChannelValue(chan);
302
375
  const nextValue =
303
376
  amount === "min"
304
377
  ? range.minValue
305
378
  : amount === "max"
306
379
  ? range.maxValue
307
- : Math.min(range.maxValue, Math.max(range.minValue, currentValue + amount));
380
+ : Math.min(range.maxValue, Math.max(range.minValue, currentChannel + amount));
308
381
 
309
- updateValue(displayColor.withChannelValue(chan, nextValue));
382
+ const next = displayColor.withChannelValue(chan, nextValue);
383
+ if (current !== null && next.getChannelValue(chan) === currentChannel) return;
384
+ updateValue(next);
310
385
  };
311
386
 
312
387
  const increment = () => {
@@ -350,7 +425,7 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
350
425
  };
351
426
 
352
427
  const validate = (candidate?: string) => {
353
- const text = (candidate ?? inputValue()).trim();
428
+ const text = (candidate ?? readNow(inputValue)).trim();
354
429
  const chan = channel();
355
430
 
356
431
  if (!text) {
@@ -371,6 +446,7 @@ export function createColorFieldState(options: Accessor<ColorFieldStateOptions>)
371
446
  get colorValue() {
372
447
  return colorValue();
373
448
  },
449
+ defaultColorValue,
374
450
  get inputValue() {
375
451
  return inputValue();
376
452
  },