@accelint/design-toolkit 9.7.0 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (892) hide show
  1. package/catalog-info.yaml +4 -4
  2. package/dist/components/accordion/context.d.ts +3 -3
  3. package/dist/components/accordion/context.js +1 -1
  4. package/dist/components/accordion/context.js.map +1 -1
  5. package/dist/components/accordion/group.d.ts +3 -3
  6. package/dist/components/accordion/group.js +1 -1
  7. package/dist/components/accordion/group.js.map +1 -1
  8. package/dist/components/accordion/header.d.ts +3 -3
  9. package/dist/components/accordion/header.js +1 -1
  10. package/dist/components/accordion/header.js.map +1 -1
  11. package/dist/components/accordion/index.d.ts +3 -3
  12. package/dist/components/accordion/index.js +1 -1
  13. package/dist/components/accordion/index.js.map +1 -1
  14. package/dist/components/accordion/panel.d.ts +3 -3
  15. package/dist/components/accordion/panel.js +1 -1
  16. package/dist/components/accordion/panel.js.map +1 -1
  17. package/dist/components/accordion/styles.module.css +1 -1
  18. package/dist/components/accordion/trigger.d.ts +3 -3
  19. package/dist/components/accordion/trigger.js +1 -1
  20. package/dist/components/accordion/trigger.js.map +1 -1
  21. package/dist/components/accordion/types.d.ts +1 -1
  22. package/dist/components/accordion/types.js +1 -1
  23. package/dist/components/action-bar/index.d.ts +3 -3
  24. package/dist/components/action-bar/index.js +1 -1
  25. package/dist/components/action-bar/index.js.map +1 -1
  26. package/dist/components/action-bar/styles.module.css +1 -1
  27. package/dist/components/action-bar/types.d.ts +1 -1
  28. package/dist/components/action-bar/types.js +1 -1
  29. package/dist/components/audio/index.d.ts +3 -3
  30. package/dist/components/audio/index.js +4 -9
  31. package/dist/components/audio/index.js.map +1 -1
  32. package/dist/components/audio/types.d.ts +1 -1
  33. package/dist/components/audio/types.js +1 -1
  34. package/dist/components/avatar/context.d.ts +5 -5
  35. package/dist/components/avatar/context.js +1 -1
  36. package/dist/components/avatar/context.js.map +1 -1
  37. package/dist/components/avatar/index.d.ts +3 -3
  38. package/dist/components/avatar/index.js +1 -1
  39. package/dist/components/avatar/index.js.map +1 -1
  40. package/dist/components/avatar/styles.module.css +1 -1
  41. package/dist/components/avatar/types.d.ts +1 -1
  42. package/dist/components/avatar/types.js +1 -1
  43. package/dist/components/badge/context.d.ts +5 -5
  44. package/dist/components/badge/context.js +1 -1
  45. package/dist/components/badge/context.js.map +1 -1
  46. package/dist/components/badge/index.d.ts +3 -3
  47. package/dist/components/badge/index.js +1 -1
  48. package/dist/components/badge/index.js.map +1 -1
  49. package/dist/components/badge/styles.module.css +1 -1
  50. package/dist/components/badge/types.d.ts +1 -1
  51. package/dist/components/badge/types.js +1 -1
  52. package/dist/components/breadcrumbs/index.d.ts +3 -3
  53. package/dist/components/breadcrumbs/index.js +1 -1
  54. package/dist/components/breadcrumbs/index.js.map +1 -1
  55. package/dist/components/breadcrumbs/item.d.ts +3 -3
  56. package/dist/components/breadcrumbs/item.js +1 -1
  57. package/dist/components/breadcrumbs/item.js.map +1 -1
  58. package/dist/components/breadcrumbs/styles.module.css +1 -1
  59. package/dist/components/breadcrumbs/types.d.ts +1 -1
  60. package/dist/components/breadcrumbs/types.js +1 -1
  61. package/dist/components/button/__internal__/clear.js +2 -1
  62. package/dist/components/button/__internal__/clear.js.map +1 -1
  63. package/dist/components/button/__internal__/styles.module.css +1 -1
  64. package/dist/components/button/context.d.ts +9 -9
  65. package/dist/components/button/context.js +1 -1
  66. package/dist/components/button/context.js.map +1 -1
  67. package/dist/components/button/index.d.ts +3 -3
  68. package/dist/components/button/index.js +1 -1
  69. package/dist/components/button/index.js.map +1 -1
  70. package/dist/components/button/link.d.ts +3 -3
  71. package/dist/components/button/link.js +1 -1
  72. package/dist/components/button/link.js.map +1 -1
  73. package/dist/components/button/styles.module.css +1 -1
  74. package/dist/components/button/toggle.d.ts +3 -3
  75. package/dist/components/button/toggle.js +1 -1
  76. package/dist/components/button/toggle.js.map +1 -1
  77. package/dist/components/button/types.d.ts +1 -1
  78. package/dist/components/button/types.js +1 -1
  79. package/dist/components/checkbox/context.d.ts +4 -4
  80. package/dist/components/checkbox/context.js +1 -1
  81. package/dist/components/checkbox/context.js.map +1 -1
  82. package/dist/components/checkbox/group.d.ts +3 -3
  83. package/dist/components/checkbox/group.js +13 -10
  84. package/dist/components/checkbox/group.js.map +1 -1
  85. package/dist/components/checkbox/index.d.ts +3 -3
  86. package/dist/components/checkbox/index.js +3 -3
  87. package/dist/components/checkbox/index.js.map +1 -1
  88. package/dist/components/checkbox/styles.module.css +8 -2
  89. package/dist/components/checkbox/types.d.ts +5 -1
  90. package/dist/components/checkbox/types.js +1 -1
  91. package/dist/components/chip/context.d.ts +5 -5
  92. package/dist/components/chip/context.js +1 -1
  93. package/dist/components/chip/context.js.map +1 -1
  94. package/dist/components/chip/deletable.d.ts +3 -3
  95. package/dist/components/chip/deletable.js +1 -1
  96. package/dist/components/chip/deletable.js.map +1 -1
  97. package/dist/components/chip/index.d.ts +3 -3
  98. package/dist/components/chip/index.js +1 -1
  99. package/dist/components/chip/index.js.map +1 -1
  100. package/dist/components/chip/list.d.ts +5 -5
  101. package/dist/components/chip/list.js +1 -1
  102. package/dist/components/chip/list.js.map +1 -1
  103. package/dist/components/chip/selectable.d.ts +3 -3
  104. package/dist/components/chip/selectable.js +1 -1
  105. package/dist/components/chip/selectable.js.map +1 -1
  106. package/dist/components/chip/styles.module.css +1 -1
  107. package/dist/components/chip/types.d.ts +1 -1
  108. package/dist/components/chip/types.js +1 -1
  109. package/dist/components/classification-badge/context.d.ts +5 -5
  110. package/dist/components/classification-badge/context.js +1 -1
  111. package/dist/components/classification-badge/context.js.map +1 -1
  112. package/dist/components/classification-badge/index.d.ts +3 -3
  113. package/dist/components/classification-badge/index.js +1 -1
  114. package/dist/components/classification-badge/index.js.map +1 -1
  115. package/dist/components/classification-badge/styles.module.css +1 -1
  116. package/dist/components/classification-badge/types.d.ts +1 -1
  117. package/dist/components/classification-badge/types.js +1 -1
  118. package/dist/components/classification-banner/context.d.ts +5 -5
  119. package/dist/components/classification-banner/context.js +1 -1
  120. package/dist/components/classification-banner/context.js.map +1 -1
  121. package/dist/components/classification-banner/index.d.ts +3 -3
  122. package/dist/components/classification-banner/index.js +1 -1
  123. package/dist/components/classification-banner/index.js.map +1 -1
  124. package/dist/components/classification-banner/styles.module.css +1 -1
  125. package/dist/components/classification-banner/types.d.ts +1 -1
  126. package/dist/components/classification-banner/types.js +1 -1
  127. package/dist/components/clock/index.d.ts +3 -3
  128. package/dist/components/clock/index.js +1 -1
  129. package/dist/components/clock/index.js.map +1 -1
  130. package/dist/components/clock/types.d.ts +1 -1
  131. package/dist/components/clock/types.js +1 -1
  132. package/dist/components/color-picker/index.d.ts +8 -46
  133. package/dist/components/color-picker/index.js +35 -53
  134. package/dist/components/color-picker/index.js.map +1 -1
  135. package/dist/components/color-picker/styles.module.css +6 -2
  136. package/dist/components/color-picker/types.d.ts +18 -5
  137. package/dist/components/color-picker/types.js +1 -1
  138. package/dist/components/combobox-field/context.d.ts +5 -5
  139. package/dist/components/combobox-field/context.js +1 -1
  140. package/dist/components/combobox-field/context.js.map +1 -1
  141. package/dist/components/combobox-field/index.d.ts +3 -3
  142. package/dist/components/combobox-field/index.js +20 -2
  143. package/dist/components/combobox-field/index.js.map +1 -1
  144. package/dist/components/combobox-field/styles.module.css +1 -1
  145. package/dist/components/combobox-field/types.d.ts +1 -1
  146. package/dist/components/combobox-field/types.js +1 -1
  147. package/dist/components/coordinate-field/context.d.ts +7 -7
  148. package/dist/components/coordinate-field/context.js +1 -1
  149. package/dist/components/coordinate-field/context.js.map +1 -1
  150. package/dist/components/coordinate-field/coordinate-utils.d.ts +1 -1
  151. package/dist/components/coordinate-field/coordinate-utils.js +9 -14
  152. package/dist/components/coordinate-field/coordinate-utils.js.map +1 -1
  153. package/dist/components/coordinate-field/index.d.ts +3 -3
  154. package/dist/components/coordinate-field/index.js +50 -44
  155. package/dist/components/coordinate-field/index.js.map +1 -1
  156. package/dist/components/coordinate-field/segment-configs.d.ts +1 -1
  157. package/dist/components/coordinate-field/segment-configs.js +1 -1
  158. package/dist/components/coordinate-field/segment-configs.js.map +1 -1
  159. package/dist/components/coordinate-field/segment.d.ts +3 -3
  160. package/dist/components/coordinate-field/segment.js +1 -1
  161. package/dist/components/coordinate-field/segment.js.map +1 -1
  162. package/dist/components/coordinate-field/styles.module.css +1 -1
  163. package/dist/components/coordinate-field/types.d.ts +6 -1
  164. package/dist/components/coordinate-field/types.js +1 -1
  165. package/dist/components/coordinate-field/types.js.map +1 -1
  166. package/dist/components/coordinate-field/width-utils.d.ts +1 -1
  167. package/dist/components/coordinate-field/width-utils.js +1 -1
  168. package/dist/components/coordinate-field/width-utils.js.map +1 -1
  169. package/dist/components/date-field/index.d.ts +3 -3
  170. package/dist/components/date-field/index.js +1 -1
  171. package/dist/components/date-field/index.js.map +1 -1
  172. package/dist/components/date-field/styles.module.css +1 -1
  173. package/dist/components/date-field/types.d.ts +1 -1
  174. package/dist/components/date-field/types.js +1 -1
  175. package/dist/components/deferred-collection/index.d.ts +3 -3
  176. package/dist/components/deferred-collection/index.js +1 -1
  177. package/dist/components/deferred-collection/index.js.map +1 -1
  178. package/dist/components/deferred-collection/types.d.ts +1 -1
  179. package/dist/components/deferred-collection/types.js +1 -1
  180. package/dist/components/details-list/context.d.ts +5 -5
  181. package/dist/components/details-list/context.js +1 -1
  182. package/dist/components/details-list/context.js.map +1 -1
  183. package/dist/components/details-list/index.d.ts +3 -3
  184. package/dist/components/details-list/index.js +1 -1
  185. package/dist/components/details-list/index.js.map +1 -1
  186. package/dist/components/details-list/label.d.ts +3 -3
  187. package/dist/components/details-list/label.js +1 -1
  188. package/dist/components/details-list/label.js.map +1 -1
  189. package/dist/components/details-list/styles.module.css +1 -1
  190. package/dist/components/details-list/types.d.ts +1 -1
  191. package/dist/components/details-list/types.js +1 -1
  192. package/dist/components/details-list/value.d.ts +3 -3
  193. package/dist/components/details-list/value.js +1 -1
  194. package/dist/components/details-list/value.js.map +1 -1
  195. package/dist/components/dialog/content.d.ts +3 -3
  196. package/dist/components/dialog/content.js +1 -1
  197. package/dist/components/dialog/content.js.map +1 -1
  198. package/dist/components/dialog/context.d.ts +3 -3
  199. package/dist/components/dialog/context.js +1 -1
  200. package/dist/components/dialog/context.js.map +1 -1
  201. package/dist/components/dialog/footer.d.ts +3 -3
  202. package/dist/components/dialog/footer.js +1 -1
  203. package/dist/components/dialog/footer.js.map +1 -1
  204. package/dist/components/dialog/index.d.ts +3 -3
  205. package/dist/components/dialog/index.js +1 -1
  206. package/dist/components/dialog/index.js.map +1 -1
  207. package/dist/components/dialog/styles.module.css +1 -1
  208. package/dist/components/dialog/title.d.ts +3 -3
  209. package/dist/components/dialog/title.js +1 -1
  210. package/dist/components/dialog/title.js.map +1 -1
  211. package/dist/components/dialog/trigger.d.ts +1 -1
  212. package/dist/components/dialog/trigger.js +1 -1
  213. package/dist/components/dialog/trigger.js.map +1 -1
  214. package/dist/components/dialog/types.d.ts +1 -1
  215. package/dist/components/dialog/types.js +1 -1
  216. package/dist/components/divider/context.d.ts +5 -5
  217. package/dist/components/divider/context.js +1 -1
  218. package/dist/components/divider/context.js.map +1 -1
  219. package/dist/components/divider/index.d.ts +3 -3
  220. package/dist/components/divider/index.js +1 -1
  221. package/dist/components/divider/index.js.map +1 -1
  222. package/dist/components/divider/styles.module.css +1 -1
  223. package/dist/components/divider/types.d.ts +1 -1
  224. package/dist/components/divider/types.js +1 -1
  225. package/dist/components/drawer/back.d.ts +3 -3
  226. package/dist/components/drawer/back.js +1 -1
  227. package/dist/components/drawer/back.js.map +1 -1
  228. package/dist/components/drawer/close.d.ts +3 -3
  229. package/dist/components/drawer/close.js +1 -1
  230. package/dist/components/drawer/close.js.map +1 -1
  231. package/dist/components/drawer/content.d.ts +3 -3
  232. package/dist/components/drawer/content.js +1 -1
  233. package/dist/components/drawer/content.js.map +1 -1
  234. package/dist/components/drawer/context.d.ts +4 -4
  235. package/dist/components/drawer/context.js +1 -1
  236. package/dist/components/drawer/context.js.map +1 -1
  237. package/dist/components/drawer/events.js +1 -1
  238. package/dist/components/drawer/events.js.map +1 -1
  239. package/dist/components/drawer/footer.d.ts +3 -3
  240. package/dist/components/drawer/footer.js +1 -1
  241. package/dist/components/drawer/footer.js.map +1 -1
  242. package/dist/components/drawer/header-title.d.ts +3 -3
  243. package/dist/components/drawer/header-title.js +1 -1
  244. package/dist/components/drawer/header-title.js.map +1 -1
  245. package/dist/components/drawer/header.d.ts +3 -3
  246. package/dist/components/drawer/header.js +1 -1
  247. package/dist/components/drawer/header.js.map +1 -1
  248. package/dist/components/drawer/index.d.ts +3 -3
  249. package/dist/components/drawer/index.js +1 -1
  250. package/dist/components/drawer/index.js.map +1 -1
  251. package/dist/components/drawer/layout-main.d.ts +3 -3
  252. package/dist/components/drawer/layout-main.js +1 -1
  253. package/dist/components/drawer/layout-main.js.map +1 -1
  254. package/dist/components/drawer/layout.d.ts +3 -3
  255. package/dist/components/drawer/layout.js +1 -1
  256. package/dist/components/drawer/layout.js.map +1 -1
  257. package/dist/components/drawer/menu-item.d.ts +3 -3
  258. package/dist/components/drawer/menu-item.js +3 -3
  259. package/dist/components/drawer/menu-item.js.map +1 -1
  260. package/dist/components/drawer/menu.d.ts +3 -3
  261. package/dist/components/drawer/menu.js +1 -1
  262. package/dist/components/drawer/menu.js.map +1 -1
  263. package/dist/components/drawer/panel.d.ts +3 -3
  264. package/dist/components/drawer/panel.js +1 -1
  265. package/dist/components/drawer/panel.js.map +1 -1
  266. package/dist/components/drawer/styles.module.css +1 -1
  267. package/dist/components/drawer/trigger.d.ts +3 -3
  268. package/dist/components/drawer/trigger.js +1 -1
  269. package/dist/components/drawer/trigger.js.map +1 -1
  270. package/dist/components/drawer/types.d.ts +2 -2
  271. package/dist/components/drawer/types.js +1 -1
  272. package/dist/components/drawer/view.d.ts +3 -3
  273. package/dist/components/drawer/view.js +1 -1
  274. package/dist/components/drawer/view.js.map +1 -1
  275. package/dist/components/flashcard/index.d.ts +10 -10
  276. package/dist/components/flashcard/index.js +1 -1
  277. package/dist/components/flashcard/index.js.map +1 -1
  278. package/dist/components/flashcard/styles.module.css +1 -1
  279. package/dist/components/flashcard/types.d.ts +1 -1
  280. package/dist/components/flashcard/types.js +1 -1
  281. package/dist/components/floating-card/context.d.ts +36 -0
  282. package/dist/components/floating-card/context.js +33 -0
  283. package/dist/components/floating-card/context.js.map +1 -0
  284. package/dist/components/floating-card/index.d.ts +65 -0
  285. package/dist/components/floating-card/index.js +81 -0
  286. package/dist/components/floating-card/index.js.map +1 -0
  287. package/dist/components/floating-card/provider.d.ts +64 -0
  288. package/dist/components/floating-card/provider.js +198 -0
  289. package/dist/components/floating-card/provider.js.map +1 -0
  290. package/dist/components/floating-card/styles.module.css +60 -0
  291. package/dist/components/hero/context.d.ts +3 -3
  292. package/dist/components/hero/context.js +1 -1
  293. package/dist/components/hero/context.js.map +1 -1
  294. package/dist/components/hero/index.d.ts +3 -3
  295. package/dist/components/hero/index.js +1 -1
  296. package/dist/components/hero/index.js.map +1 -1
  297. package/dist/components/hero/styles.module.css +1 -1
  298. package/dist/components/hero/subtitle.d.ts +3 -3
  299. package/dist/components/hero/subtitle.js +1 -1
  300. package/dist/components/hero/subtitle.js.map +1 -1
  301. package/dist/components/hero/title.d.ts +3 -3
  302. package/dist/components/hero/title.js +1 -1
  303. package/dist/components/hero/title.js.map +1 -1
  304. package/dist/components/hero/types.d.ts +1 -1
  305. package/dist/components/hero/types.js +1 -1
  306. package/dist/components/hotkey/context.d.ts +5 -5
  307. package/dist/components/hotkey/context.js +1 -1
  308. package/dist/components/hotkey/context.js.map +1 -1
  309. package/dist/components/hotkey/index.d.ts +3 -3
  310. package/dist/components/hotkey/index.js +1 -1
  311. package/dist/components/hotkey/index.js.map +1 -1
  312. package/dist/components/hotkey/set.d.ts +3 -3
  313. package/dist/components/hotkey/set.js +1 -1
  314. package/dist/components/hotkey/set.js.map +1 -1
  315. package/dist/components/hotkey/styles.module.css +1 -1
  316. package/dist/components/hotkey/types.d.ts +1 -1
  317. package/dist/components/hotkey/types.js +1 -1
  318. package/dist/components/icon/context.d.ts +5 -5
  319. package/dist/components/icon/context.js +1 -1
  320. package/dist/components/icon/context.js.map +1 -1
  321. package/dist/components/icon/index.d.ts +3 -3
  322. package/dist/components/icon/index.js +1 -1
  323. package/dist/components/icon/index.js.map +1 -1
  324. package/dist/components/icon/styles.module.css +1 -1
  325. package/dist/components/icon/types.d.ts +1 -1
  326. package/dist/components/icon/types.js +1 -1
  327. package/dist/components/input/context.d.ts +3 -3
  328. package/dist/components/input/context.js +1 -1
  329. package/dist/components/input/context.js.map +1 -1
  330. package/dist/components/input/index.d.ts +3 -3
  331. package/dist/components/input/index.js +1 -1
  332. package/dist/components/input/index.js.map +1 -1
  333. package/dist/components/input/styles.module.css +9 -1
  334. package/dist/components/input/types.d.ts +1 -1
  335. package/dist/components/input/types.js +1 -1
  336. package/dist/components/kanban/card-body.d.ts +3 -3
  337. package/dist/components/kanban/card-body.js +1 -1
  338. package/dist/components/kanban/card-body.js.map +1 -1
  339. package/dist/components/kanban/card-header-actions.d.ts +3 -3
  340. package/dist/components/kanban/card-header-actions.js +1 -1
  341. package/dist/components/kanban/card-header-actions.js.map +1 -1
  342. package/dist/components/kanban/card-header-title.d.ts +3 -3
  343. package/dist/components/kanban/card-header-title.js +1 -1
  344. package/dist/components/kanban/card-header-title.js.map +1 -1
  345. package/dist/components/kanban/card-header.d.ts +3 -3
  346. package/dist/components/kanban/card-header.js +1 -1
  347. package/dist/components/kanban/card-header.js.map +1 -1
  348. package/dist/components/kanban/card.d.ts +3 -3
  349. package/dist/components/kanban/card.js +1 -1
  350. package/dist/components/kanban/card.js.map +1 -1
  351. package/dist/components/kanban/column-actions.d.ts +3 -3
  352. package/dist/components/kanban/column-actions.js +1 -1
  353. package/dist/components/kanban/column-actions.js.map +1 -1
  354. package/dist/components/kanban/column-container.d.ts +3 -3
  355. package/dist/components/kanban/column-container.js +1 -1
  356. package/dist/components/kanban/column-container.js.map +1 -1
  357. package/dist/components/kanban/column-content.d.ts +3 -3
  358. package/dist/components/kanban/column-content.js +1 -1
  359. package/dist/components/kanban/column-content.js.map +1 -1
  360. package/dist/components/kanban/column-header-actions.d.ts +3 -3
  361. package/dist/components/kanban/column-header-actions.js +1 -1
  362. package/dist/components/kanban/column-header-actions.js.map +1 -1
  363. package/dist/components/kanban/column-header-drag-handle.d.ts +3 -3
  364. package/dist/components/kanban/column-header-drag-handle.js +1 -1
  365. package/dist/components/kanban/column-header-drag-handle.js.map +1 -1
  366. package/dist/components/kanban/column-header-title.d.ts +3 -3
  367. package/dist/components/kanban/column-header-title.js +1 -1
  368. package/dist/components/kanban/column-header-title.js.map +1 -1
  369. package/dist/components/kanban/column-header.d.ts +3 -3
  370. package/dist/components/kanban/column-header.js +1 -1
  371. package/dist/components/kanban/column-header.js.map +1 -1
  372. package/dist/components/kanban/column.d.ts +3 -3
  373. package/dist/components/kanban/column.js +1 -1
  374. package/dist/components/kanban/column.js.map +1 -1
  375. package/dist/components/kanban/context.d.ts +3 -3
  376. package/dist/components/kanban/context.js +1 -1
  377. package/dist/components/kanban/context.js.map +1 -1
  378. package/dist/components/kanban/header-actions.d.ts +3 -3
  379. package/dist/components/kanban/header-actions.js +1 -1
  380. package/dist/components/kanban/header-actions.js.map +1 -1
  381. package/dist/components/kanban/header-search.d.ts +3 -3
  382. package/dist/components/kanban/header-search.js +1 -1
  383. package/dist/components/kanban/header-search.js.map +1 -1
  384. package/dist/components/kanban/header-title.d.ts +3 -3
  385. package/dist/components/kanban/header-title.js +1 -1
  386. package/dist/components/kanban/header-title.js.map +1 -1
  387. package/dist/components/kanban/header.d.ts +3 -3
  388. package/dist/components/kanban/header.js +1 -1
  389. package/dist/components/kanban/header.js.map +1 -1
  390. package/dist/components/kanban/index.d.ts +1 -1
  391. package/dist/components/kanban/index.js +1 -1
  392. package/dist/components/kanban/kanban.d.ts +5 -5
  393. package/dist/components/kanban/kanban.js +1 -1
  394. package/dist/components/kanban/kanban.js.map +1 -1
  395. package/dist/components/kanban/mock-data.js +1 -1
  396. package/dist/components/kanban/mock-data.js.map +1 -1
  397. package/dist/components/kanban/styles.module.css +1 -1
  398. package/dist/components/kanban/types.d.ts +1 -1
  399. package/dist/components/kanban/types.js +1 -1
  400. package/dist/components/label/context.d.ts +5 -5
  401. package/dist/components/label/context.js +1 -1
  402. package/dist/components/label/context.js.map +1 -1
  403. package/dist/components/label/index.d.ts +3 -3
  404. package/dist/components/label/index.js +1 -1
  405. package/dist/components/label/index.js.map +1 -1
  406. package/dist/components/label/styles.module.css +1 -1
  407. package/dist/components/label/types.d.ts +1 -1
  408. package/dist/components/label/types.js +1 -1
  409. package/dist/components/lines/index.d.ts +3 -3
  410. package/dist/components/lines/index.js +1 -1
  411. package/dist/components/lines/index.js.map +1 -1
  412. package/dist/components/lines/styles.module.css +1 -1
  413. package/dist/components/lines/types.d.ts +1 -1
  414. package/dist/components/lines/types.js +1 -1
  415. package/dist/components/link/context.d.ts +3 -3
  416. package/dist/components/link/context.js +1 -1
  417. package/dist/components/link/context.js.map +1 -1
  418. package/dist/components/link/index.d.ts +3 -3
  419. package/dist/components/link/index.js +1 -1
  420. package/dist/components/link/index.js.map +1 -1
  421. package/dist/components/link/styles.module.css +1 -1
  422. package/dist/components/link/types.d.ts +1 -1
  423. package/dist/components/link/types.js +1 -1
  424. package/dist/components/list/context.d.ts +3 -3
  425. package/dist/components/list/context.js +1 -1
  426. package/dist/components/list/context.js.map +1 -1
  427. package/dist/components/list/index.d.ts +3 -3
  428. package/dist/components/list/index.js +1 -1
  429. package/dist/components/list/index.js.map +1 -1
  430. package/dist/components/list/item-content.d.ts +3 -3
  431. package/dist/components/list/item-content.js +1 -1
  432. package/dist/components/list/item-content.js.map +1 -1
  433. package/dist/components/list/item-description.d.ts +3 -3
  434. package/dist/components/list/item-description.js +1 -1
  435. package/dist/components/list/item-description.js.map +1 -1
  436. package/dist/components/list/item-title.d.ts +3 -3
  437. package/dist/components/list/item-title.js +1 -1
  438. package/dist/components/list/item-title.js.map +1 -1
  439. package/dist/components/list/item.d.ts +3 -3
  440. package/dist/components/list/item.js +1 -1
  441. package/dist/components/list/item.js.map +1 -1
  442. package/dist/components/list/styles.module.css +1 -1
  443. package/dist/components/list/types.d.ts +1 -1
  444. package/dist/components/list/types.js +1 -1
  445. package/dist/components/media-controls/context.d.ts +5 -5
  446. package/dist/components/media-controls/context.js +1 -1
  447. package/dist/components/media-controls/fullscreen-button.d.ts +3 -3
  448. package/dist/components/media-controls/fullscreen-button.js +1 -1
  449. package/dist/components/media-controls/index.d.ts +3 -3
  450. package/dist/components/media-controls/index.js +1 -1
  451. package/dist/components/media-controls/mute-button.d.ts +3 -3
  452. package/dist/components/media-controls/mute-button.js +1 -1
  453. package/dist/components/media-controls/play-button.d.ts +3 -3
  454. package/dist/components/media-controls/play-button.js +1 -1
  455. package/dist/components/media-controls/playback-rate.d.ts +3 -3
  456. package/dist/components/media-controls/playback-rate.js +3 -8
  457. package/dist/components/media-controls/playback-rate.js.map +1 -1
  458. package/dist/components/media-controls/seek-button.d.ts +3 -3
  459. package/dist/components/media-controls/seek-button.js +3 -8
  460. package/dist/components/media-controls/seek-button.js.map +1 -1
  461. package/dist/components/media-controls/time-display.d.ts +3 -3
  462. package/dist/components/media-controls/time-display.js +1 -1
  463. package/dist/components/media-controls/time-range.d.ts +3 -3
  464. package/dist/components/media-controls/time-range.js +1 -1
  465. package/dist/components/media-controls/types.d.ts +1 -1
  466. package/dist/components/media-controls/types.js +1 -1
  467. package/dist/components/media-controls/volume-slider.d.ts +3 -3
  468. package/dist/components/media-controls/volume-slider.js +1 -1
  469. package/dist/components/menu/context.d.ts +3 -3
  470. package/dist/components/menu/context.js +1 -1
  471. package/dist/components/menu/context.js.map +1 -1
  472. package/dist/components/menu/index.d.ts +3 -3
  473. package/dist/components/menu/index.js +1 -1
  474. package/dist/components/menu/index.js.map +1 -1
  475. package/dist/components/menu/item-description.d.ts +3 -3
  476. package/dist/components/menu/item-description.js +1 -1
  477. package/dist/components/menu/item-description.js.map +1 -1
  478. package/dist/components/menu/item-label.d.ts +3 -3
  479. package/dist/components/menu/item-label.js +1 -1
  480. package/dist/components/menu/item-label.js.map +1 -1
  481. package/dist/components/menu/item.d.ts +3 -3
  482. package/dist/components/menu/item.js +1 -1
  483. package/dist/components/menu/item.js.map +1 -1
  484. package/dist/components/menu/section.d.ts +3 -3
  485. package/dist/components/menu/section.js +1 -1
  486. package/dist/components/menu/section.js.map +1 -1
  487. package/dist/components/menu/separator.d.ts +3 -3
  488. package/dist/components/menu/separator.js +1 -1
  489. package/dist/components/menu/separator.js.map +1 -1
  490. package/dist/components/menu/styles.module.css +1 -1
  491. package/dist/components/menu/submenu.d.ts +3 -3
  492. package/dist/components/menu/submenu.js +1 -1
  493. package/dist/components/menu/submenu.js.map +1 -1
  494. package/dist/components/menu/trigger.d.ts +1 -1
  495. package/dist/components/menu/trigger.js +1 -1
  496. package/dist/components/menu/trigger.js.map +1 -1
  497. package/dist/components/menu/types.d.ts +1 -1
  498. package/dist/components/menu/types.js +1 -1
  499. package/dist/components/notice/events.js +1 -1
  500. package/dist/components/notice/events.js.map +1 -1
  501. package/dist/components/notice/index.d.ts +3 -3
  502. package/dist/components/notice/index.js +1 -1
  503. package/dist/components/notice/index.js.map +1 -1
  504. package/dist/components/notice/list.d.ts +3 -3
  505. package/dist/components/notice/list.js +2 -2
  506. package/dist/components/notice/list.js.map +1 -1
  507. package/dist/components/notice/notice-icon.d.ts +3 -3
  508. package/dist/components/notice/notice-icon.js +1 -1
  509. package/dist/components/notice/notice-icon.js.map +1 -1
  510. package/dist/components/notice/styles.module.css +1 -1
  511. package/dist/components/notice/types.d.ts +2 -2
  512. package/dist/components/notice/types.js +1 -1
  513. package/dist/components/notice/utils.d.ts +1 -1
  514. package/dist/components/notice/utils.js +1 -1
  515. package/dist/components/notice/utils.js.map +1 -1
  516. package/dist/components/options/context.d.ts +3 -3
  517. package/dist/components/options/context.js +1 -1
  518. package/dist/components/options/context.js.map +1 -1
  519. package/dist/components/options/index.d.ts +3 -3
  520. package/dist/components/options/index.js +1 -1
  521. package/dist/components/options/index.js.map +1 -1
  522. package/dist/components/options/item-content.d.ts +3 -3
  523. package/dist/components/options/item-content.js +1 -1
  524. package/dist/components/options/item-content.js.map +1 -1
  525. package/dist/components/options/item-description.d.ts +3 -3
  526. package/dist/components/options/item-description.js +1 -1
  527. package/dist/components/options/item-description.js.map +1 -1
  528. package/dist/components/options/item-label.d.ts +4 -3
  529. package/dist/components/options/item-label.js +21 -5
  530. package/dist/components/options/item-label.js.map +1 -1
  531. package/dist/components/options/item.d.ts +3 -3
  532. package/dist/components/options/item.js +1 -1
  533. package/dist/components/options/item.js.map +1 -1
  534. package/dist/components/options/section.d.ts +3 -3
  535. package/dist/components/options/section.js +1 -1
  536. package/dist/components/options/section.js.map +1 -1
  537. package/dist/components/options/styles.module.css +45 -1
  538. package/dist/components/options/types.d.ts +1 -1
  539. package/dist/components/options/types.js +1 -1
  540. package/dist/components/pagination/context.d.ts +3 -3
  541. package/dist/components/pagination/context.js +1 -1
  542. package/dist/components/pagination/context.js.map +1 -1
  543. package/dist/components/pagination/index.d.ts +3 -3
  544. package/dist/components/pagination/index.js +1 -1
  545. package/dist/components/pagination/index.js.map +1 -1
  546. package/dist/components/pagination/next.d.ts +3 -3
  547. package/dist/components/pagination/next.js +1 -1
  548. package/dist/components/pagination/next.js.map +1 -1
  549. package/dist/components/pagination/pages.d.ts +3 -3
  550. package/dist/components/pagination/pages.js +1 -1
  551. package/dist/components/pagination/pages.js.map +1 -1
  552. package/dist/components/pagination/prev.d.ts +3 -3
  553. package/dist/components/pagination/prev.js +1 -1
  554. package/dist/components/pagination/prev.js.map +1 -1
  555. package/dist/components/pagination/styles.module.css +1 -1
  556. package/dist/components/pagination/types.d.ts +1 -1
  557. package/dist/components/pagination/types.js +1 -1
  558. package/dist/components/pagination/utils.js +1 -1
  559. package/dist/components/pagination/utils.js.map +1 -1
  560. package/dist/components/popover/content.d.ts +3 -3
  561. package/dist/components/popover/content.js +1 -1
  562. package/dist/components/popover/content.js.map +1 -1
  563. package/dist/components/popover/footer.d.ts +3 -3
  564. package/dist/components/popover/footer.js +1 -1
  565. package/dist/components/popover/footer.js.map +1 -1
  566. package/dist/components/popover/index.d.ts +3 -3
  567. package/dist/components/popover/index.js +1 -1
  568. package/dist/components/popover/index.js.map +1 -1
  569. package/dist/components/popover/styles.module.css +1 -1
  570. package/dist/components/popover/title.d.ts +3 -3
  571. package/dist/components/popover/title.js +1 -1
  572. package/dist/components/popover/title.js.map +1 -1
  573. package/dist/components/popover/trigger.d.ts +3 -3
  574. package/dist/components/popover/trigger.js +1 -1
  575. package/dist/components/popover/trigger.js.map +1 -1
  576. package/dist/components/popover/types.d.ts +1 -1
  577. package/dist/components/popover/types.js +1 -1
  578. package/dist/components/query-builder/action-element.d.ts +3 -3
  579. package/dist/components/query-builder/action-element.js +1 -1
  580. package/dist/components/query-builder/action-element.js.map +1 -1
  581. package/dist/components/query-builder/actions.d.ts +5 -5
  582. package/dist/components/query-builder/actions.js +1 -1
  583. package/dist/components/query-builder/actions.js.map +1 -1
  584. package/dist/components/query-builder/combinator-selector.d.ts +3 -3
  585. package/dist/components/query-builder/combinator-selector.js +1 -1
  586. package/dist/components/query-builder/combinator-selector.js.map +1 -1
  587. package/dist/components/query-builder/constants.js +1 -1
  588. package/dist/components/query-builder/constants.js.map +1 -1
  589. package/dist/components/query-builder/index.d.ts +3 -3
  590. package/dist/components/query-builder/index.js +1 -1
  591. package/dist/components/query-builder/index.js.map +1 -1
  592. package/dist/components/query-builder/rule-group.d.ts +5 -5
  593. package/dist/components/query-builder/rule-group.js +1 -1
  594. package/dist/components/query-builder/rule-group.js.map +1 -1
  595. package/dist/components/query-builder/rule.d.ts +3 -3
  596. package/dist/components/query-builder/rule.js +1 -1
  597. package/dist/components/query-builder/rule.js.map +1 -1
  598. package/dist/components/query-builder/styles.module.css +1 -1
  599. package/dist/components/query-builder/types.d.ts +1 -1
  600. package/dist/components/query-builder/types.js +1 -1
  601. package/dist/components/query-builder/utils.d.ts +1 -1
  602. package/dist/components/query-builder/utils.js +1 -1
  603. package/dist/components/query-builder/utils.js.map +1 -1
  604. package/dist/components/query-builder/value-editor.d.ts +3 -3
  605. package/dist/components/query-builder/value-editor.js +1 -1
  606. package/dist/components/query-builder/value-editor.js.map +1 -1
  607. package/dist/components/query-builder/value-selector.d.ts +3 -3
  608. package/dist/components/query-builder/value-selector.js +1 -1
  609. package/dist/components/query-builder/value-selector.js.map +1 -1
  610. package/dist/components/radio/context.d.ts +11 -5
  611. package/dist/components/radio/context.js +8 -2
  612. package/dist/components/radio/context.js.map +1 -1
  613. package/dist/components/radio/group.d.ts +3 -3
  614. package/dist/components/radio/group.js +14 -11
  615. package/dist/components/radio/group.js.map +1 -1
  616. package/dist/components/radio/index.d.ts +5 -6
  617. package/dist/components/radio/index.js +8 -4
  618. package/dist/components/radio/index.js.map +1 -1
  619. package/dist/components/radio/styles.module.css +7 -5
  620. package/dist/components/radio/types.d.ts +5 -1
  621. package/dist/components/radio/types.js +1 -1
  622. package/dist/components/search-field/context.d.ts +5 -5
  623. package/dist/components/search-field/context.js +1 -1
  624. package/dist/components/search-field/context.js.map +1 -1
  625. package/dist/components/search-field/index.d.ts +3 -3
  626. package/dist/components/search-field/index.js +1 -1
  627. package/dist/components/search-field/index.js.map +1 -1
  628. package/dist/components/search-field/styles.module.css +1 -1
  629. package/dist/components/search-field/types.d.ts +1 -1
  630. package/dist/components/search-field/types.js +1 -1
  631. package/dist/components/select-field/context.d.ts +5 -5
  632. package/dist/components/select-field/context.js +1 -1
  633. package/dist/components/select-field/context.js.map +1 -1
  634. package/dist/components/select-field/index.d.ts +3 -3
  635. package/dist/components/select-field/index.js +1 -1
  636. package/dist/components/select-field/index.js.map +1 -1
  637. package/dist/components/select-field/styles.module.css +1 -1
  638. package/dist/components/select-field/types.d.ts +1 -1
  639. package/dist/components/select-field/types.js +1 -1
  640. package/dist/components/sidenav/avatar.d.ts +3 -3
  641. package/dist/components/sidenav/avatar.js +1 -1
  642. package/dist/components/sidenav/avatar.js.map +1 -1
  643. package/dist/components/sidenav/content.d.ts +3 -3
  644. package/dist/components/sidenav/content.js +1 -1
  645. package/dist/components/sidenav/content.js.map +1 -1
  646. package/dist/components/sidenav/context.d.ts +3 -3
  647. package/dist/components/sidenav/context.js +1 -1
  648. package/dist/components/sidenav/context.js.map +1 -1
  649. package/dist/components/sidenav/events.js +1 -1
  650. package/dist/components/sidenav/events.js.map +1 -1
  651. package/dist/components/sidenav/footer.d.ts +3 -3
  652. package/dist/components/sidenav/footer.js +1 -1
  653. package/dist/components/sidenav/footer.js.map +1 -1
  654. package/dist/components/sidenav/header.d.ts +3 -3
  655. package/dist/components/sidenav/header.js +1 -1
  656. package/dist/components/sidenav/header.js.map +1 -1
  657. package/dist/components/sidenav/index.d.ts +3 -3
  658. package/dist/components/sidenav/index.js +1 -1
  659. package/dist/components/sidenav/index.js.map +1 -1
  660. package/dist/components/sidenav/item.d.ts +3 -3
  661. package/dist/components/sidenav/item.js +1 -1
  662. package/dist/components/sidenav/item.js.map +1 -1
  663. package/dist/components/sidenav/link.d.ts +3 -3
  664. package/dist/components/sidenav/link.js +1 -1
  665. package/dist/components/sidenav/link.js.map +1 -1
  666. package/dist/components/sidenav/menu-item.d.ts +3 -3
  667. package/dist/components/sidenav/menu-item.js +1 -1
  668. package/dist/components/sidenav/menu-item.js.map +1 -1
  669. package/dist/components/sidenav/menu.d.ts +3 -3
  670. package/dist/components/sidenav/menu.js +1 -1
  671. package/dist/components/sidenav/menu.js.map +1 -1
  672. package/dist/components/sidenav/styles.module.css +1 -1
  673. package/dist/components/sidenav/trigger.d.ts +3 -3
  674. package/dist/components/sidenav/trigger.js +2 -2
  675. package/dist/components/sidenav/trigger.js.map +1 -1
  676. package/dist/components/sidenav/types.d.ts +2 -2
  677. package/dist/components/sidenav/types.js +1 -1
  678. package/dist/components/skeleton/index.d.ts +3 -3
  679. package/dist/components/skeleton/index.js +1 -1
  680. package/dist/components/skeleton/index.js.map +1 -1
  681. package/dist/components/skeleton/styles.module.css +1 -1
  682. package/dist/components/skeleton/types.d.ts +1 -1
  683. package/dist/components/skeleton/types.js +1 -1
  684. package/dist/components/slider/index.d.ts +3 -3
  685. package/dist/components/slider/index.js +1 -1
  686. package/dist/components/slider/index.js.map +1 -1
  687. package/dist/components/slider/styles.module.css +4 -3
  688. package/dist/components/slider/types.d.ts +1 -1
  689. package/dist/components/slider/types.js +1 -1
  690. package/dist/components/status-indicator/index.d.ts +3 -3
  691. package/dist/components/status-indicator/index.js +1 -1
  692. package/dist/components/status-indicator/types.d.ts +1 -1
  693. package/dist/components/status-indicator/types.js +1 -1
  694. package/dist/components/switch/context.d.ts +5 -5
  695. package/dist/components/switch/context.js +1 -1
  696. package/dist/components/switch/context.js.map +1 -1
  697. package/dist/components/switch/index.d.ts +3 -3
  698. package/dist/components/switch/index.js +1 -1
  699. package/dist/components/switch/index.js.map +1 -1
  700. package/dist/components/switch/styles.module.css +1 -1
  701. package/dist/components/switch/types.d.ts +1 -1
  702. package/dist/components/switch/types.js +1 -1
  703. package/dist/components/table/body.d.ts +3 -3
  704. package/dist/components/table/body.js +1 -1
  705. package/dist/components/table/body.js.map +1 -1
  706. package/dist/components/table/cell.d.ts +3 -3
  707. package/dist/components/table/cell.js +1 -1
  708. package/dist/components/table/cell.js.map +1 -1
  709. package/dist/components/table/constants/table.d.ts +1 -1
  710. package/dist/components/table/constants/table.js +1 -1
  711. package/dist/components/table/constants/table.js.map +1 -1
  712. package/dist/components/table/context.d.ts +3 -3
  713. package/dist/components/table/context.js +1 -1
  714. package/dist/components/table/context.js.map +1 -1
  715. package/dist/components/table/header-cell.d.ts +3 -3
  716. package/dist/components/table/header-cell.js +1 -1
  717. package/dist/components/table/header-cell.js.map +1 -1
  718. package/dist/components/table/header.d.ts +3 -3
  719. package/dist/components/table/header.js +1 -1
  720. package/dist/components/table/header.js.map +1 -1
  721. package/dist/components/table/index.d.ts +3 -3
  722. package/dist/components/table/index.js +1 -1
  723. package/dist/components/table/index.js.map +1 -1
  724. package/dist/components/table/row.d.ts +3 -3
  725. package/dist/components/table/row.js +1 -1
  726. package/dist/components/table/row.js.map +1 -1
  727. package/dist/components/table/styles.module.css +1 -1
  728. package/dist/components/table/types.d.ts +1 -1
  729. package/dist/components/table/types.js +1 -1
  730. package/dist/components/tabs/constants.d.ts +1 -1
  731. package/dist/components/tabs/constants.js +1 -1
  732. package/dist/components/tabs/context.d.ts +7 -7
  733. package/dist/components/tabs/context.js +1 -1
  734. package/dist/components/tabs/context.js.map +1 -1
  735. package/dist/components/tabs/index.d.ts +3 -3
  736. package/dist/components/tabs/index.js +1 -1
  737. package/dist/components/tabs/index.js.map +1 -1
  738. package/dist/components/tabs/list.d.ts +3 -3
  739. package/dist/components/tabs/list.js +1 -1
  740. package/dist/components/tabs/list.js.map +1 -1
  741. package/dist/components/tabs/panel.d.ts +3 -3
  742. package/dist/components/tabs/panel.js +1 -1
  743. package/dist/components/tabs/panel.js.map +1 -1
  744. package/dist/components/tabs/styles.module.css +1 -1
  745. package/dist/components/tabs/tab.d.ts +3 -3
  746. package/dist/components/tabs/tab.js +1 -1
  747. package/dist/components/tabs/tab.js.map +1 -1
  748. package/dist/components/tabs/types.d.ts +1 -1
  749. package/dist/components/tabs/types.js +1 -1
  750. package/dist/components/text-area-field/context.d.ts +5 -5
  751. package/dist/components/text-area-field/context.js +1 -1
  752. package/dist/components/text-area-field/context.js.map +1 -1
  753. package/dist/components/text-area-field/index.d.ts +3 -3
  754. package/dist/components/text-area-field/index.js +1 -1
  755. package/dist/components/text-area-field/index.js.map +1 -1
  756. package/dist/components/text-area-field/styles.module.css +1 -1
  757. package/dist/components/text-area-field/types.d.ts +1 -1
  758. package/dist/components/text-area-field/types.js +1 -1
  759. package/dist/components/text-field/context.d.ts +5 -5
  760. package/dist/components/text-field/context.js +1 -1
  761. package/dist/components/text-field/context.js.map +1 -1
  762. package/dist/components/text-field/index.d.ts +3 -3
  763. package/dist/components/text-field/index.js +1 -1
  764. package/dist/components/text-field/index.js.map +1 -1
  765. package/dist/components/text-field/styles.module.css +1 -1
  766. package/dist/components/text-field/types.d.ts +1 -1
  767. package/dist/components/text-field/types.js +1 -1
  768. package/dist/components/time-field/index.d.ts +3 -3
  769. package/dist/components/time-field/index.js +1 -1
  770. package/dist/components/time-field/index.js.map +1 -1
  771. package/dist/components/time-field/styles.module.css +1 -1
  772. package/dist/components/time-field/types.d.ts +1 -1
  773. package/dist/components/time-field/types.js +1 -1
  774. package/dist/components/tooltip/context.d.ts +3 -3
  775. package/dist/components/tooltip/context.js +1 -1
  776. package/dist/components/tooltip/context.js.map +1 -1
  777. package/dist/components/tooltip/index.d.ts +3 -3
  778. package/dist/components/tooltip/index.js +1 -1
  779. package/dist/components/tooltip/index.js.map +1 -1
  780. package/dist/components/tooltip/styles.module.css +1 -1
  781. package/dist/components/tooltip/trigger.d.ts +3 -3
  782. package/dist/components/tooltip/trigger.js +2 -2
  783. package/dist/components/tooltip/trigger.js.map +1 -1
  784. package/dist/components/tooltip/types.d.ts +1 -1
  785. package/dist/components/tooltip/types.js +1 -1
  786. package/dist/components/tree/context.d.ts +4 -4
  787. package/dist/components/tree/context.js +1 -1
  788. package/dist/components/tree/context.js.map +1 -1
  789. package/dist/components/tree/index.d.ts +3 -3
  790. package/dist/components/tree/index.js +1 -1
  791. package/dist/components/tree/index.js.map +1 -1
  792. package/dist/components/tree/item-actions.d.ts +3 -3
  793. package/dist/components/tree/item-actions.js +1 -1
  794. package/dist/components/tree/item-actions.js.map +1 -1
  795. package/dist/components/tree/item-content.d.ts +3 -3
  796. package/dist/components/tree/item-content.js +1 -1
  797. package/dist/components/tree/item-content.js.map +1 -1
  798. package/dist/components/tree/item-description.d.ts +3 -3
  799. package/dist/components/tree/item-description.js +1 -1
  800. package/dist/components/tree/item-description.js.map +1 -1
  801. package/dist/components/tree/item-label.d.ts +3 -3
  802. package/dist/components/tree/item-label.js +1 -1
  803. package/dist/components/tree/item-label.js.map +1 -1
  804. package/dist/components/tree/item-prefix-icon.d.ts +3 -3
  805. package/dist/components/tree/item-prefix-icon.js +1 -1
  806. package/dist/components/tree/item-prefix-icon.js.map +1 -1
  807. package/dist/components/tree/item.d.ts +3 -3
  808. package/dist/components/tree/item.js +1 -1
  809. package/dist/components/tree/item.js.map +1 -1
  810. package/dist/components/tree/lines.d.ts +3 -3
  811. package/dist/components/tree/lines.js +1 -1
  812. package/dist/components/tree/lines.js.map +1 -1
  813. package/dist/components/tree/styles.module.css +1 -1
  814. package/dist/components/tree/types.d.ts +1 -1
  815. package/dist/components/tree/types.js +1 -1
  816. package/dist/components/video/index.d.ts +3 -3
  817. package/dist/components/video/index.js +4 -9
  818. package/dist/components/video/index.js.map +1 -1
  819. package/dist/components/video/types.d.ts +1 -1
  820. package/dist/components/video/types.js +1 -1
  821. package/dist/components/view-stack/context.d.ts +3 -3
  822. package/dist/components/view-stack/context.js +1 -1
  823. package/dist/components/view-stack/context.js.map +1 -1
  824. package/dist/components/view-stack/events.js +1 -1
  825. package/dist/components/view-stack/events.js.map +1 -1
  826. package/dist/components/view-stack/index.d.ts +3 -3
  827. package/dist/components/view-stack/index.js +2 -2
  828. package/dist/components/view-stack/index.js.map +1 -1
  829. package/dist/components/view-stack/trigger.d.ts +3 -3
  830. package/dist/components/view-stack/trigger.js +1 -1
  831. package/dist/components/view-stack/trigger.js.map +1 -1
  832. package/dist/components/view-stack/types.d.ts +2 -2
  833. package/dist/components/view-stack/types.js +1 -1
  834. package/dist/components/view-stack/view.d.ts +3 -3
  835. package/dist/components/view-stack/view.js +1 -1
  836. package/dist/components/view-stack/view.js.map +1 -1
  837. package/dist/hooks/coordinate-field/index.d.ts +1 -1
  838. package/dist/hooks/coordinate-field/index.js +1 -1
  839. package/dist/hooks/coordinate-field/use-coordinate-copy.d.ts +1 -1
  840. package/dist/hooks/coordinate-field/use-coordinate-copy.js +4 -9
  841. package/dist/hooks/coordinate-field/use-coordinate-copy.js.map +1 -1
  842. package/dist/hooks/coordinate-field/use-coordinate-field-state.d.ts +1 -1
  843. package/dist/hooks/coordinate-field/use-coordinate-field-state.js +1 -1
  844. package/dist/hooks/coordinate-field/use-coordinate-field-state.js.map +1 -1
  845. package/dist/hooks/coordinate-field/use-coordinate-field.d.ts +1 -1
  846. package/dist/hooks/coordinate-field/use-coordinate-field.js +1 -1
  847. package/dist/hooks/coordinate-field/use-coordinate-field.js.map +1 -1
  848. package/dist/hooks/coordinate-field/use-coordinate-focus.d.ts +1 -1
  849. package/dist/hooks/coordinate-field/use-coordinate-focus.js +1 -1
  850. package/dist/hooks/coordinate-field/use-coordinate-focus.js.map +1 -1
  851. package/dist/hooks/coordinate-field/use-coordinate-paste.d.ts +1 -1
  852. package/dist/hooks/coordinate-field/use-coordinate-paste.js +1 -1
  853. package/dist/hooks/coordinate-field/use-coordinate-paste.js.map +1 -1
  854. package/dist/hooks/coordinate-field/use-timeout-cleanup.js +1 -1
  855. package/dist/hooks/coordinate-field/use-timeout-cleanup.js.map +1 -1
  856. package/dist/hooks/kanban/index.d.ts +1 -1
  857. package/dist/hooks/kanban/index.js +1 -1
  858. package/dist/hooks/kanban/index.js.map +1 -1
  859. package/dist/hooks/use-frame-delay/index.js +1 -1
  860. package/dist/hooks/use-frame-delay/index.js.map +1 -1
  861. package/dist/hooks/use-tree/actions/cache.d.ts +1 -1
  862. package/dist/hooks/use-tree/actions/cache.js +1 -1
  863. package/dist/hooks/use-tree/actions/cache.js.map +1 -1
  864. package/dist/hooks/use-tree/actions/index.d.ts +1 -1
  865. package/dist/hooks/use-tree/actions/index.js +1 -1
  866. package/dist/hooks/use-tree/actions/index.js.map +1 -1
  867. package/dist/hooks/use-tree/state/index.d.ts +1 -1
  868. package/dist/hooks/use-tree/state/index.js +1 -1
  869. package/dist/hooks/use-tree/state/index.js.map +1 -1
  870. package/dist/hooks/use-tree/state/utils.d.ts +1 -1
  871. package/dist/hooks/use-tree/state/utils.js +1 -1
  872. package/dist/hooks/use-tree/state/utils.js.map +1 -1
  873. package/dist/hooks/use-tree/types.d.ts +1 -1
  874. package/dist/hooks/use-tree/types.js +1 -1
  875. package/dist/index.d.ts +5 -3
  876. package/dist/index.js +8 -6
  877. package/dist/lib/types.d.ts +1 -1
  878. package/dist/lib/types.js +1 -1
  879. package/dist/lib/utils.d.ts +1 -1
  880. package/dist/lib/utils.js +1 -1
  881. package/dist/lib/utils.js.map +1 -1
  882. package/dist/node_modules/.pnpm/@react-aria_collections@3.0.0-rc.7_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/collections/dist/BaseCollection.js +134 -0
  883. package/dist/node_modules/.pnpm/@react-aria_collections@3.0.0-rc.7_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/collections/dist/BaseCollection.js.map +1 -0
  884. package/dist/providers/portal.d.ts +3 -3
  885. package/dist/providers/portal.js +2 -2
  886. package/dist/providers/portal.js.map +1 -1
  887. package/dist/providers/theme-provider.d.ts +3 -3
  888. package/dist/providers/theme-provider.js +1 -1
  889. package/dist/providers/theme-provider.js.map +1 -1
  890. package/dist/utils/logger/index.js +31 -0
  891. package/dist/utils/logger/index.js.map +1 -0
  892. package/package.json +25 -12
@@ -1 +1 @@
1
- {"version":3,"file":"view.js","names":[],"sources":["../../../src/components/view-stack/view.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport { isUUID } from '@accelint/core';\nimport 'client-only';\nimport { Fragment, useContext, useEffect } from 'react';\nimport { ViewStackContext } from './context';\nimport type { ViewStackViewProps } from './types';\n\n/**\n * ViewStackView - Individual view in a ViewStack\n *\n * Represents a single view that can be pushed onto the ViewStack\n *\n * @example\n * ```tsx\n * <ViewStack id=\"app-stack\">\n * <ViewStackView id=\"home-view\">\n * <h1>Home Screen</h1>\n * <p>Welcome to the app</p>\n * </ViewStackView>\n * <ViewStackView id=\"details-view\">\n * <h1>Details Screen</h1>\n * <p>Detailed information</p>\n * </ViewStackView>\n * </ViewStack>\n * ```\n *\n * @param props - {@link ViewStackViewProps}\n * @param props.id - Unique identifier for the view.\n * @param props.children - View content to render when active.\n * @returns The rendered view content if active, or null.\n */\nexport function ViewStackView({ id, children }: ViewStackViewProps) {\n const { parent, view, register, unregister } = useContext(ViewStackContext);\n\n if (!parent) {\n throw new Error('ViewStackView must be implemented within a ViewStack');\n }\n\n if (!isUUID(id)) {\n throw new Error(`ViewStackView's id must be a UniqueId`);\n }\n\n useEffect(() => {\n register(id);\n\n return () => unregister(id);\n }, [register, unregister, id]);\n\n return view === id ? <Fragment key={id}>{children}</Fragment> : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,cAAc,EAAE,IAAI,YAAgC;CAClE,MAAM,EAAE,QAAQ,MAAM,UAAU,eAAe,WAAW,iBAAiB;AAE3E,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,uDAAuD;AAGzE,KAAI,CAAC,OAAO,GAAG,CACb,OAAM,IAAI,MAAM,wCAAwC;AAG1D,iBAAgB;AACd,WAAS,GAAG;AAEZ,eAAa,WAAW,GAAG;IAC1B;EAAC;EAAU;EAAY;EAAG,CAAC;AAE9B,QAAO,SAAS,KAAK,oBAAC,YAAmB,YAAL,GAAyB,GAAG"}
1
+ {"version":3,"file":"view.js","names":[],"sources":["../../../src/components/view-stack/view.tsx"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport { isUUID } from '@accelint/core';\nimport 'client-only';\nimport { Fragment, useContext, useEffect } from 'react';\nimport { ViewStackContext } from './context';\nimport type { ViewStackViewProps } from './types';\n\n/**\n * ViewStackView - Individual view in a ViewStack\n *\n * Represents a single view that can be pushed onto the ViewStack\n *\n * @example\n * ```tsx\n * <ViewStack id=\"app-stack\">\n * <ViewStackView id=\"home-view\">\n * <h1>Home Screen</h1>\n * <p>Welcome to the app</p>\n * </ViewStackView>\n * <ViewStackView id=\"details-view\">\n * <h1>Details Screen</h1>\n * <p>Detailed information</p>\n * </ViewStackView>\n * </ViewStack>\n * ```\n *\n * @param props - {@link ViewStackViewProps}\n * @param props.id - Unique identifier for the view.\n * @param props.children - View content to render when active.\n * @returns The rendered view content if active, or null.\n */\nexport function ViewStackView({ id, children }: ViewStackViewProps) {\n const { parent, view, register, unregister } = useContext(ViewStackContext);\n\n if (!parent) {\n throw new Error('ViewStackView must be implemented within a ViewStack');\n }\n\n if (!isUUID(id)) {\n throw new Error(`ViewStackView's id must be a UniqueId`);\n }\n\n useEffect(() => {\n register(id);\n\n return () => unregister(id);\n }, [register, unregister, id]);\n\n return view === id ? <Fragment key={id}>{children}</Fragment> : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,cAAc,EAAE,IAAI,YAAgC;CAClE,MAAM,EAAE,QAAQ,MAAM,UAAU,eAAe,WAAW,iBAAiB;AAE3E,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,uDAAuD;AAGzE,KAAI,CAAC,OAAO,GAAG,CACb,OAAM,IAAI,MAAM,wCAAwC;AAG1D,iBAAgB;AACd,WAAS,GAAG;AAEZ,eAAa,WAAW,GAAG;IAC1B;EAAC;EAAU;EAAY;EAAG,CAAC;AAE9B,QAAO,SAAS,KAAK,oBAAC,YAAmB,YAAL,GAAyB,GAAG"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -11,17 +11,12 @@
11
11
  */
12
12
 
13
13
 
14
+ import { createLoggerDomain } from "../../utils/logger/index.js";
14
15
  import { getAllCoordinateFormats } from "../../components/coordinate-field/coordinate-utils.js";
15
16
  import { useState } from "react";
16
- import { getLogger } from "@accelint/logger";
17
17
 
18
18
  //#region src/hooks/coordinate-field/use-coordinate-copy.ts
19
- const logger = getLogger({
20
- enabled: process.env.NODE_ENV !== "production",
21
- level: "debug",
22
- prefix: "[CoordinateField]",
23
- pretty: true
24
- });
19
+ const logger = createLoggerDomain("[CoordinateField]");
25
20
  const COPY_FEEDBACK_DURATION_MS = 2e3;
26
21
  /**
27
22
  * Handles copying coordinates to clipboard with format conversion and visual feedback
@@ -84,7 +79,7 @@ function useCoordinateCopy({ currentValue, validationErrors, isDisabled, registe
84
79
  setCopiedFormat(null);
85
80
  }, COPY_FEEDBACK_DURATION_MS));
86
81
  } catch (err) {
87
- logger.withError(err).warn("Fallback copy to clipboard failed");
82
+ logger.withError(err).error("Fallback copy to clipboard failed");
88
83
  }
89
84
  document.body.removeChild(textArea);
90
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-coordinate-copy.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-copy.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { getLogger } from '@accelint/logger';\nimport { useState } from 'react';\n\nconst logger = getLogger({\n enabled: process.env.NODE_ENV !== 'production',\n level: 'debug',\n prefix: '[CoordinateField]',\n pretty: true,\n});\n\nimport { getAllCoordinateFormats } from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n} from '../../components/coordinate-field/types';\nimport type { UseTimeoutCleanupResult } from './use-timeout-cleanup';\n\nconst COPY_FEEDBACK_DURATION_MS = 2000;\n\n/** Options for the useCoordinateCopy hook */\nexport interface UseCoordinateCopyOptions {\n /** Current coordinate value to copy (null if empty) */\n currentValue: CoordinateValue | null;\n /** Array of validation error messages */\n validationErrors: string[];\n /** Whether copying is disabled */\n isDisabled: boolean;\n /** Function to register timeouts for cleanup */\n registerTimeout: UseTimeoutCleanupResult['registerTimeout'];\n}\n\n/** Return value from the useCoordinateCopy hook */\nexport interface UseCoordinateCopyResult {\n /** Currently copied format (for visual feedback) or null */\n copiedFormat: CoordinateSystem | null;\n /** Copy coordinate in specified format to clipboard */\n handleCopyFormat: (formatToCopy: CoordinateSystem) => Promise<void>;\n /** Whether copy format buttons should be enabled */\n isFormatButtonEnabled: boolean;\n}\n\n/**\n * Handles copying coordinates to clipboard with format conversion and visual feedback\n *\n * @example\n * ```tsx\n * function CoordinateField() {\n * const { registerTimeout } = useTimeoutCleanup();\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n * const [errors, setErrors] = useState<string[]>([]);\n *\n * const { copiedFormat, handleCopyFormat, isFormatButtonEnabled } = useCoordinateCopy({\n * currentValue: value,\n * validationErrors: errors,\n * isDisabled: false,\n * registerTimeout,\n * });\n *\n * return (\n * <Button\n * onPress={() => handleCopyFormat('dd')}\n * isDisabled={!isFormatButtonEnabled}\n * >\n * {copiedFormat === 'dd' ? <Check /> : <Copy />}\n * </Button>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateCopyOptions}\n * @param options.currentValue - Current coordinate value to copy (null if empty).\n * @param options.validationErrors - Array of validation error messages.\n * @param options.isDisabled - Whether copying is disabled.\n * @param options.registerTimeout - Function to register timeouts for cleanup.\n * @returns {@link UseCoordinateCopyResult} Copy utilities and feedback state.\n */\nexport function useCoordinateCopy({\n currentValue,\n validationErrors,\n isDisabled,\n registerTimeout,\n}: UseCoordinateCopyOptions): UseCoordinateCopyResult {\n const [copiedFormat, setCopiedFormat] = useState<CoordinateSystem | null>(\n null,\n );\n\n /**\n * Fallback clipboard copy for browsers that don't support navigator.clipboard API.\n * Creates a temporary textarea, copies text using document.execCommand('copy'),\n * and provides visual feedback by setting copiedFormat state for 2 seconds.\n *\n * @param text - The coordinate string to copy to clipboard\n * @param formatToCopy - The coordinate format being copied (for UI feedback)\n */\n const fallbackCopyToClipboard = (\n text: string,\n formatToCopy: CoordinateSystem,\n ) => {\n // Create temporary textarea for copy operation\n const textArea = document.createElement('textarea');\n textArea.value = text;\n // Position off-screen so it's not visible to user\n textArea.style.position = 'fixed';\n textArea.style.left = '-999999px';\n textArea.style.top = '-999999px';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n document.execCommand('copy');\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (err) {\n logger.withError(err).warn('Fallback copy to clipboard failed');\n }\n\n // Clean up temporary textarea\n document.body.removeChild(textArea);\n };\n\n /**\n * Handles copying a coordinate in the specified format to the clipboard.\n * Uses modern clipboard API (navigator.clipboard.writeText) with fallback\n * to document.execCommand for older browsers.\n *\n * Sets copiedFormat state to show visual feedback (Check icon) for 2 seconds.\n *\n * @param formatToCopy - The coordinate format to copy (dd, ddm, dms, mgrs, utm)\n */\n const handleCopyFormat = async (formatToCopy: CoordinateSystem) => {\n if (!currentValue) {\n return;\n }\n\n const allFormats = getAllCoordinateFormats(currentValue);\n const formatResult = allFormats[formatToCopy];\n\n if (!formatResult.isValid) {\n return;\n }\n\n try {\n // Modern clipboard API - copy and show feedback\n await navigator.clipboard.writeText(formatResult.value);\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (_err) {\n // Fall back to document.execCommand for older browsers\n fallbackCopyToClipboard(formatResult.value, formatToCopy);\n }\n };\n\n const isFormatButtonEnabled =\n currentValue !== null && validationErrors.length === 0 && !isDisabled;\n\n return {\n copiedFormat,\n handleCopyFormat,\n isFormatButtonEnabled,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAeA,MAAM,SAAS,UAAU;CACvB,SAAS,QAAQ,IAAI,aAAa;CAClC,OAAO;CACP,QAAQ;CACR,QAAQ;CACT,CAAC;AASF,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DlC,SAAgB,kBAAkB,EAChC,cACA,kBACA,YACA,mBACoD;CACpD,MAAM,CAAC,cAAc,mBAAmB,SACtC,KACD;;;;;;;;;CAUD,MAAM,2BACJ,MACA,iBACG;EAEH,MAAM,WAAW,SAAS,cAAc,WAAW;AACnD,WAAS,QAAQ;AAEjB,WAAS,MAAM,WAAW;AAC1B,WAAS,MAAM,OAAO;AACtB,WAAS,MAAM,MAAM;AACrB,WAAS,KAAK,YAAY,SAAS;AACnC,WAAS,OAAO;AAChB,WAAS,QAAQ;AAEjB,MAAI;AACF,YAAS,YAAY,OAAO;AAG5B,mBAAgB,aAAa;AAG7B,mBACE,iBAAiB;AACf,oBAAgB,KAAK;MACpB,0BAA0B,CAC9B;WACM,KAAK;AACZ,UAAO,UAAU,IAAI,CAAC,KAAK,oCAAoC;;AAIjE,WAAS,KAAK,YAAY,SAAS;;;;;;;;;;;CAYrC,MAAM,mBAAmB,OAAO,iBAAmC;AACjE,MAAI,CAAC,aACH;EAIF,MAAM,eADa,wBAAwB,aAAa,CACxB;AAEhC,MAAI,CAAC,aAAa,QAChB;AAGF,MAAI;AAEF,SAAM,UAAU,UAAU,UAAU,aAAa,MAAM;AAGvD,mBAAgB,aAAa;AAG7B,mBACE,iBAAiB;AACf,oBAAgB,KAAK;MACpB,0BAA0B,CAC9B;WACM,MAAM;AAEb,2BAAwB,aAAa,OAAO,aAAa;;;AAO7D,QAAO;EACL;EACA;EACA,uBALA,iBAAiB,QAAQ,iBAAiB,WAAW,KAAK,CAAC;EAM5D"}
1
+ {"version":3,"file":"use-coordinate-copy.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-copy.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useState } from 'react';\nimport { createLoggerDomain } from '@/utils/logger';\n\nconst logger = createLoggerDomain('[CoordinateField]');\n\nimport { getAllCoordinateFormats } from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n} from '../../components/coordinate-field/types';\nimport type { UseTimeoutCleanupResult } from './use-timeout-cleanup';\n\nconst COPY_FEEDBACK_DURATION_MS = 2000;\n\n/** Options for the useCoordinateCopy hook */\nexport interface UseCoordinateCopyOptions {\n /** Current coordinate value to copy (null if empty) */\n currentValue: CoordinateValue | null;\n /** Array of validation error messages */\n validationErrors: string[];\n /** Whether copying is disabled */\n isDisabled: boolean;\n /** Function to register timeouts for cleanup */\n registerTimeout: UseTimeoutCleanupResult['registerTimeout'];\n}\n\n/** Return value from the useCoordinateCopy hook */\nexport interface UseCoordinateCopyResult {\n /** Currently copied format (for visual feedback) or null */\n copiedFormat: CoordinateSystem | null;\n /** Copy coordinate in specified format to clipboard */\n handleCopyFormat: (formatToCopy: CoordinateSystem) => Promise<void>;\n /** Whether copy format buttons should be enabled */\n isFormatButtonEnabled: boolean;\n}\n\n/**\n * Handles copying coordinates to clipboard with format conversion and visual feedback\n *\n * @example\n * ```tsx\n * function CoordinateField() {\n * const { registerTimeout } = useTimeoutCleanup();\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n * const [errors, setErrors] = useState<string[]>([]);\n *\n * const { copiedFormat, handleCopyFormat, isFormatButtonEnabled } = useCoordinateCopy({\n * currentValue: value,\n * validationErrors: errors,\n * isDisabled: false,\n * registerTimeout,\n * });\n *\n * return (\n * <Button\n * onPress={() => handleCopyFormat('dd')}\n * isDisabled={!isFormatButtonEnabled}\n * >\n * {copiedFormat === 'dd' ? <Check /> : <Copy />}\n * </Button>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateCopyOptions}\n * @param options.currentValue - Current coordinate value to copy (null if empty).\n * @param options.validationErrors - Array of validation error messages.\n * @param options.isDisabled - Whether copying is disabled.\n * @param options.registerTimeout - Function to register timeouts for cleanup.\n * @returns {@link UseCoordinateCopyResult} Copy utilities and feedback state.\n */\nexport function useCoordinateCopy({\n currentValue,\n validationErrors,\n isDisabled,\n registerTimeout,\n}: UseCoordinateCopyOptions): UseCoordinateCopyResult {\n const [copiedFormat, setCopiedFormat] = useState<CoordinateSystem | null>(\n null,\n );\n\n /**\n * Fallback clipboard copy for browsers that don't support navigator.clipboard API.\n * Creates a temporary textarea, copies text using document.execCommand('copy'),\n * and provides visual feedback by setting copiedFormat state for 2 seconds.\n *\n * @param text - The coordinate string to copy to clipboard\n * @param formatToCopy - The coordinate format being copied (for UI feedback)\n */\n const fallbackCopyToClipboard = (\n text: string,\n formatToCopy: CoordinateSystem,\n ) => {\n // Create temporary textarea for copy operation\n const textArea = document.createElement('textarea');\n textArea.value = text;\n // Position off-screen so it's not visible to user\n textArea.style.position = 'fixed';\n textArea.style.left = '-999999px';\n textArea.style.top = '-999999px';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n document.execCommand('copy');\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (err) {\n logger.withError(err).error('Fallback copy to clipboard failed');\n }\n\n // Clean up temporary textarea\n document.body.removeChild(textArea);\n };\n\n /**\n * Handles copying a coordinate in the specified format to the clipboard.\n * Uses modern clipboard API (navigator.clipboard.writeText) with fallback\n * to document.execCommand for older browsers.\n *\n * Sets copiedFormat state to show visual feedback (Check icon) for 2 seconds.\n *\n * @param formatToCopy - The coordinate format to copy (dd, ddm, dms, mgrs, utm)\n */\n const handleCopyFormat = async (formatToCopy: CoordinateSystem) => {\n if (!currentValue) {\n return;\n }\n\n const allFormats = getAllCoordinateFormats(currentValue);\n const formatResult = allFormats[formatToCopy];\n\n if (!formatResult.isValid) {\n return;\n }\n\n try {\n // Modern clipboard API - copy and show feedback\n await navigator.clipboard.writeText(formatResult.value);\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (_err) {\n // Fall back to document.execCommand for older browsers\n fallbackCopyToClipboard(formatResult.value, formatToCopy);\n }\n };\n\n const isFormatButtonEnabled =\n currentValue !== null && validationErrors.length === 0 && !isDisabled;\n\n return {\n copiedFormat,\n handleCopyFormat,\n isFormatButtonEnabled,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAeA,MAAM,SAAS,mBAAmB,oBAAoB;AAStD,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DlC,SAAgB,kBAAkB,EAChC,cACA,kBACA,YACA,mBACoD;CACpD,MAAM,CAAC,cAAc,mBAAmB,SACtC,KACD;;;;;;;;;CAUD,MAAM,2BACJ,MACA,iBACG;EAEH,MAAM,WAAW,SAAS,cAAc,WAAW;AACnD,WAAS,QAAQ;AAEjB,WAAS,MAAM,WAAW;AAC1B,WAAS,MAAM,OAAO;AACtB,WAAS,MAAM,MAAM;AACrB,WAAS,KAAK,YAAY,SAAS;AACnC,WAAS,OAAO;AAChB,WAAS,QAAQ;AAEjB,MAAI;AACF,YAAS,YAAY,OAAO;AAG5B,mBAAgB,aAAa;AAG7B,mBACE,iBAAiB;AACf,oBAAgB,KAAK;MACpB,0BAA0B,CAC9B;WACM,KAAK;AACZ,UAAO,UAAU,IAAI,CAAC,MAAM,oCAAoC;;AAIlE,WAAS,KAAK,YAAY,SAAS;;;;;;;;;;;CAYrC,MAAM,mBAAmB,OAAO,iBAAmC;AACjE,MAAI,CAAC,aACH;EAIF,MAAM,eADa,wBAAwB,aAAa,CACxB;AAEhC,MAAI,CAAC,aAAa,QAChB;AAGF,MAAI;AAEF,SAAM,UAAU,UAAU,UAAU,aAAa,MAAM;AAGvD,mBAAgB,aAAa;AAG7B,mBACE,iBAAiB;AACf,oBAAgB,KAAK;MACpB,0BAA0B,CAC9B;WACM,MAAM;AAEb,2BAAwB,aAAa,OAAO,aAAa;;;AAO7D,QAAO;EACL;EACA;EACA,uBALA,iBAAiB,QAAQ,iBAAiB,WAAW,KAAK,CAAC;EAM5D"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"use-coordinate-field-state.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-field-state.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n type Dispatch,\n type SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n areAllSegmentsFilled,\n convertDDToDisplaySegments,\n convertDisplaySegmentsToDD,\n validateCoordinateSegments,\n} from '../../components/coordinate-field/coordinate-utils';\nimport { getSegmentConfigs } from '../../components/coordinate-field/segment-configs';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n SegmentConfig,\n} from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinateFieldState hook */\nexport interface UseCoordinateFieldStateOptions {\n /** Controlled coordinate value */\n value?: CoordinateValue | null;\n /** Default value for uncontrolled mode */\n defaultValue?: CoordinateValue;\n /** Coordinate format system (dd, ddm, dms, mgrs, utm) */\n format: CoordinateSystem;\n /** Callback when coordinate value changes */\n onChange?:\n | Dispatch<SetStateAction<CoordinateValue | null>>\n | ((value: CoordinateValue | null) => void);\n /** Callback for validation errors */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n /** Register timeouts for cleanup on unmount */\n registerTimeout?: (timeoutId: NodeJS.Timeout) => void;\n}\n\n/** Return value from the useCoordinateFieldState hook */\nexport interface UseCoordinateFieldStateResult {\n /** Current coordinate value (null if incomplete/invalid) */\n currentValue: CoordinateValue | null;\n /** Array of display values for each segment */\n segmentValues: string[];\n /** Array of validation error messages */\n validationErrors: string[];\n /** All segment configurations including literals */\n segmentConfigs: SegmentConfig[];\n /** Only editable segment configurations */\n editableSegmentConfigs: SegmentConfig[];\n /** Handle change of a single segment */\n handleSegmentChange: (index: number, newValue: string) => void;\n /** Set all segment values at once */\n setSegmentValues: (values: string[]) => void;\n /** Set validation errors */\n setValidationErrors: (errors: string[]) => void;\n /** First validation error or null */\n effectiveErrorMessage: string | null;\n /** Apply a pasted coordinate value */\n applyPastedCoordinate: (pastedValue: CoordinateValue) => void;\n /** Immediately run pending validation */\n flushPendingValidation: () => void;\n}\n\n/**\n * Manages coordinate segment values, validation, and format conversion\n *\n * @example\n * ```tsx\n * function CoordinateInputs() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n * const { registerTimeout } = useTimeoutCleanup();\n *\n * const {\n * currentValue,\n * segmentValues,\n * validationErrors,\n * editableSegmentConfigs,\n * handleSegmentChange,\n * } = useCoordinateFieldState({\n * value,\n * format: 'ddm',\n * onChange: setValue,\n * onError: (msg) => console.error(msg),\n * registerTimeout,\n * });\n *\n * return (\n * <div>\n * {editableSegmentConfigs.map((config, i) => (\n * <input\n * key={i}\n * value={segmentValues[i]}\n * onChange={(e) => handleSegmentChange(i, e.target.value)}\n * placeholder={config.placeholder}\n * />\n * ))}\n * {validationErrors.map((error, i) => (\n * <span key={i}>{error}</span>\n * ))}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateFieldStateOptions}\n * @param options.value - Controlled coordinate value.\n * @param options.defaultValue - Default value for uncontrolled mode.\n * @param options.format - Coordinate format system (dd, ddm, dms, mgrs, utm).\n * @param options.onChange - Callback when coordinate value changes.\n * @param options.onError - Callback for validation errors.\n * @param options.registerTimeout - Register timeouts for cleanup on unmount.\n * @returns {@link UseCoordinateFieldStateResult} Segment state, validation, and change handlers.\n */\nexport function useCoordinateFieldState({\n value,\n defaultValue,\n format,\n onChange,\n onError,\n registerTimeout,\n}: UseCoordinateFieldStateOptions): UseCoordinateFieldStateResult {\n const [internalValue, setInternalValue] = useState<CoordinateValue | null>(\n defaultValue || null,\n );\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n const validationTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const currentValue = value !== undefined ? value : internalValue;\n\n const clearValidationTimeout = () => {\n if (validationTimeoutRef.current) {\n clearTimeout(validationTimeoutRef.current);\n validationTimeoutRef.current = null;\n }\n };\n\n const handleChange = (newValue: CoordinateValue | null) => {\n if (value === undefined) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n };\n\n const segmentConfigs = useMemo(() => getSegmentConfigs(format), [format]);\n\n const editableSegmentConfigs = useMemo(\n () => segmentConfigs.flat().filter((config) => config.type !== 'literal'),\n [segmentConfigs],\n );\n\n const [segmentValues, setSegmentValues] = useState<string[]>(() => {\n const initialValue = value !== undefined ? value : defaultValue;\n if (!initialValue) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n const segments = convertDDToDisplaySegments(initialValue, format);\n if (!segments) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n return segments;\n });\n\n const convertValueToSegmentsOrClear = useCallback(\n (valueToConvert: CoordinateValue | null) => {\n // Clear any pending validation when value changes\n clearValidationTimeout();\n\n const segments = valueToConvert\n ? convertDDToDisplaySegments(valueToConvert, format)\n : null;\n\n setSegmentValues(\n segments || new Array(editableSegmentConfigs.length).fill(''),\n );\n setValidationErrors([]);\n },\n [format, editableSegmentConfigs.length],\n );\n\n const prevFormatRef = useRef(format);\n\n useEffect(() => {\n if (prevFormatRef.current !== format) {\n prevFormatRef.current = format;\n const valueToConvert = value !== undefined ? value : internalValue;\n convertValueToSegmentsOrClear(valueToConvert);\n }\n }, [format, value, internalValue, convertValueToSegmentsOrClear]);\n\n useEffect(() => {\n if (value !== undefined) {\n convertValueToSegmentsOrClear(value);\n }\n }, [value, convertValueToSegmentsOrClear]);\n\n /**\n * Validates segment values and updates the coordinate state\n *\n * When validation fails, calls onError with \"Invalid coordinate value\" message\n * and context containing the detailed validation errors from @accelint/geo.\n *\n * @param updatedValues - Array of segment values to validate\n */\n const validateAndUpdateCoordinate = (updatedValues: string[]) => {\n const errors = validateCoordinateSegments(updatedValues, format);\n\n if (errors.length > 0) {\n setValidationErrors(errors);\n onError?.('Invalid coordinate value', {\n errors,\n format,\n segments: updatedValues,\n });\n handleChange(null);\n return;\n }\n\n const ddValue = convertDisplaySegmentsToDD(updatedValues, format);\n if (!ddValue) {\n const errorMsg = 'Invalid coordinate value';\n setValidationErrors([errorMsg]);\n onError?.(errorMsg, { format, segments: updatedValues });\n handleChange(null);\n return;\n }\n\n setValidationErrors([]);\n handleChange(ddValue);\n };\n\n const handleSegmentChange = (index: number, newValue: string) => {\n const updatedValues = [...segmentValues];\n updatedValues[index] = newValue;\n setSegmentValues(updatedValues);\n\n if (areAllSegmentsFilled(updatedValues)) {\n // Clear any pending validation timeout\n clearValidationTimeout();\n\n // Debounce validation by 400ms when all segments are full\n const timeoutId = setTimeout(() => {\n validateAndUpdateCoordinate(updatedValues);\n validationTimeoutRef.current = null;\n }, 400);\n\n validationTimeoutRef.current = timeoutId;\n registerTimeout?.(timeoutId);\n } else {\n // Clear any pending validation when segments become incomplete\n clearValidationTimeout();\n setValidationErrors([]);\n if (currentValue !== null) {\n handleChange(null);\n }\n }\n };\n\n const applyPastedCoordinate = (pastedValue: CoordinateValue) => {\n // Clear any pending validation when applying pasted coordinate\n clearValidationTimeout();\n\n const segments = convertDDToDisplaySegments(pastedValue, format);\n\n if (segments) {\n setSegmentValues(segments);\n setValidationErrors([]);\n handleChange(pastedValue);\n }\n };\n\n const flushPendingValidation = () => {\n if (validationTimeoutRef.current) {\n clearValidationTimeout();\n\n // Immediately validate if all segments are filled\n if (areAllSegmentsFilled(segmentValues)) {\n validateAndUpdateCoordinate(segmentValues);\n }\n }\n };\n\n const effectiveErrorMessage = useMemo(\n () => validationErrors[0] || null,\n [validationErrors],\n );\n\n return {\n currentValue,\n segmentValues,\n validationErrors,\n segmentConfigs,\n editableSegmentConfigs,\n handleSegmentChange,\n setSegmentValues,\n setValidationErrors,\n effectiveErrorMessage,\n applyPastedCoordinate,\n flushPendingValidation,\n };\n}\n"],"mappings":";;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ACnC,MAAI,qBAAqB,SAAS;AAChC,2BAAwB;AAGxB,OAAI,qBAAqB,cAAc,CACrC,6BAA4B,cAAc;;;AAUhD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,uBAd4B,cACtB,iBAAiB,MAAM,MAC7B,CAAC,iBAAiB,CACnB;EAYC;EACA;EACD"}
1
+ {"version":3,"file":"use-coordinate-field-state.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-field-state.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n type Dispatch,\n type SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n areAllSegmentsFilled,\n convertDDToDisplaySegments,\n convertDisplaySegmentsToDD,\n validateCoordinateSegments,\n} from '../../components/coordinate-field/coordinate-utils';\nimport { getSegmentConfigs } from '../../components/coordinate-field/segment-configs';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n SegmentConfig,\n} from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinateFieldState hook */\nexport interface UseCoordinateFieldStateOptions {\n /** Controlled coordinate value */\n value?: CoordinateValue | null;\n /** Default value for uncontrolled mode */\n defaultValue?: CoordinateValue;\n /** Coordinate format system (dd, ddm, dms, mgrs, utm) */\n format: CoordinateSystem;\n /** Callback when coordinate value changes */\n onChange?:\n | Dispatch<SetStateAction<CoordinateValue | null>>\n | ((value: CoordinateValue | null) => void);\n /** Callback for validation errors */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n /** Register timeouts for cleanup on unmount */\n registerTimeout?: (timeoutId: NodeJS.Timeout) => void;\n}\n\n/** Return value from the useCoordinateFieldState hook */\nexport interface UseCoordinateFieldStateResult {\n /** Current coordinate value (null if incomplete/invalid) */\n currentValue: CoordinateValue | null;\n /** Array of display values for each segment */\n segmentValues: string[];\n /** Array of validation error messages */\n validationErrors: string[];\n /** All segment configurations including literals */\n segmentConfigs: SegmentConfig[];\n /** Only editable segment configurations */\n editableSegmentConfigs: SegmentConfig[];\n /** Handle change of a single segment */\n handleSegmentChange: (index: number, newValue: string) => void;\n /** Set all segment values at once */\n setSegmentValues: (values: string[]) => void;\n /** Set validation errors */\n setValidationErrors: (errors: string[]) => void;\n /** First validation error or null */\n effectiveErrorMessage: string | null;\n /** Apply a pasted coordinate value */\n applyPastedCoordinate: (pastedValue: CoordinateValue) => void;\n /** Immediately run pending validation */\n flushPendingValidation: () => void;\n}\n\n/**\n * Manages coordinate segment values, validation, and format conversion\n *\n * @example\n * ```tsx\n * function CoordinateInputs() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n * const { registerTimeout } = useTimeoutCleanup();\n *\n * const {\n * currentValue,\n * segmentValues,\n * validationErrors,\n * editableSegmentConfigs,\n * handleSegmentChange,\n * } = useCoordinateFieldState({\n * value,\n * format: 'ddm',\n * onChange: setValue,\n * onError: (msg) => console.error(msg),\n * registerTimeout,\n * });\n *\n * return (\n * <div>\n * {editableSegmentConfigs.map((config, i) => (\n * <input\n * key={i}\n * value={segmentValues[i]}\n * onChange={(e) => handleSegmentChange(i, e.target.value)}\n * placeholder={config.placeholder}\n * />\n * ))}\n * {validationErrors.map((error, i) => (\n * <span key={i}>{error}</span>\n * ))}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateFieldStateOptions}\n * @param options.value - Controlled coordinate value.\n * @param options.defaultValue - Default value for uncontrolled mode.\n * @param options.format - Coordinate format system (dd, ddm, dms, mgrs, utm).\n * @param options.onChange - Callback when coordinate value changes.\n * @param options.onError - Callback for validation errors.\n * @param options.registerTimeout - Register timeouts for cleanup on unmount.\n * @returns {@link UseCoordinateFieldStateResult} Segment state, validation, and change handlers.\n */\nexport function useCoordinateFieldState({\n value,\n defaultValue,\n format,\n onChange,\n onError,\n registerTimeout,\n}: UseCoordinateFieldStateOptions): UseCoordinateFieldStateResult {\n const [internalValue, setInternalValue] = useState<CoordinateValue | null>(\n defaultValue || null,\n );\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n const validationTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const currentValue = value !== undefined ? value : internalValue;\n\n const clearValidationTimeout = () => {\n if (validationTimeoutRef.current) {\n clearTimeout(validationTimeoutRef.current);\n validationTimeoutRef.current = null;\n }\n };\n\n const handleChange = (newValue: CoordinateValue | null) => {\n if (value === undefined) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n };\n\n const segmentConfigs = useMemo(() => getSegmentConfigs(format), [format]);\n\n const editableSegmentConfigs = useMemo(\n () => segmentConfigs.flat().filter((config) => config.type !== 'literal'),\n [segmentConfigs],\n );\n\n const [segmentValues, setSegmentValues] = useState<string[]>(() => {\n const initialValue = value !== undefined ? value : defaultValue;\n if (!initialValue) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n const segments = convertDDToDisplaySegments(initialValue, format);\n if (!segments) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n return segments;\n });\n\n const convertValueToSegmentsOrClear = useCallback(\n (valueToConvert: CoordinateValue | null) => {\n // Clear any pending validation when value changes\n clearValidationTimeout();\n\n const segments = valueToConvert\n ? convertDDToDisplaySegments(valueToConvert, format)\n : null;\n\n setSegmentValues(\n segments || new Array(editableSegmentConfigs.length).fill(''),\n );\n setValidationErrors([]);\n },\n [format, editableSegmentConfigs.length],\n );\n\n const prevFormatRef = useRef(format);\n\n useEffect(() => {\n if (prevFormatRef.current !== format) {\n prevFormatRef.current = format;\n const valueToConvert = value !== undefined ? value : internalValue;\n convertValueToSegmentsOrClear(valueToConvert);\n }\n }, [format, value, internalValue, convertValueToSegmentsOrClear]);\n\n useEffect(() => {\n if (value !== undefined) {\n convertValueToSegmentsOrClear(value);\n }\n }, [value, convertValueToSegmentsOrClear]);\n\n /**\n * Validates segment values and updates the coordinate state\n *\n * When validation fails, calls onError with \"Invalid coordinate value\" message\n * and context containing the detailed validation errors from @accelint/geo.\n *\n * @param updatedValues - Array of segment values to validate\n */\n const validateAndUpdateCoordinate = (updatedValues: string[]) => {\n const errors = validateCoordinateSegments(updatedValues, format);\n\n if (errors.length > 0) {\n setValidationErrors(errors);\n onError?.('Invalid coordinate value', {\n errors,\n format,\n segments: updatedValues,\n });\n handleChange(null);\n return;\n }\n\n const ddValue = convertDisplaySegmentsToDD(updatedValues, format);\n if (!ddValue) {\n const errorMsg = 'Invalid coordinate value';\n setValidationErrors([errorMsg]);\n onError?.(errorMsg, { format, segments: updatedValues });\n handleChange(null);\n return;\n }\n\n setValidationErrors([]);\n handleChange(ddValue);\n };\n\n const handleSegmentChange = (index: number, newValue: string) => {\n const updatedValues = [...segmentValues];\n updatedValues[index] = newValue;\n setSegmentValues(updatedValues);\n\n if (areAllSegmentsFilled(updatedValues)) {\n // Clear any pending validation timeout\n clearValidationTimeout();\n\n // Debounce validation by 400ms when all segments are full\n const timeoutId = setTimeout(() => {\n validateAndUpdateCoordinate(updatedValues);\n validationTimeoutRef.current = null;\n }, 400);\n\n validationTimeoutRef.current = timeoutId;\n registerTimeout?.(timeoutId);\n } else {\n // Clear any pending validation when segments become incomplete\n clearValidationTimeout();\n setValidationErrors([]);\n if (currentValue !== null) {\n handleChange(null);\n }\n }\n };\n\n const applyPastedCoordinate = (pastedValue: CoordinateValue) => {\n // Clear any pending validation when applying pasted coordinate\n clearValidationTimeout();\n\n const segments = convertDDToDisplaySegments(pastedValue, format);\n\n if (segments) {\n setSegmentValues(segments);\n setValidationErrors([]);\n handleChange(pastedValue);\n }\n };\n\n const flushPendingValidation = () => {\n if (validationTimeoutRef.current) {\n clearValidationTimeout();\n\n // Immediately validate if all segments are filled\n if (areAllSegmentsFilled(segmentValues)) {\n validateAndUpdateCoordinate(segmentValues);\n }\n }\n };\n\n const effectiveErrorMessage = useMemo(\n () => validationErrors[0] || null,\n [validationErrors],\n );\n\n return {\n currentValue,\n segmentValues,\n validationErrors,\n segmentConfigs,\n editableSegmentConfigs,\n handleSegmentChange,\n setSegmentValues,\n setValidationErrors,\n effectiveErrorMessage,\n applyPastedCoordinate,\n flushPendingValidation,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,SAAgB,wBAAwB,EACtC,OACA,cACA,QACA,UACA,SACA,mBACgE;CAChE,MAAM,CAAC,eAAe,oBAAoB,SACxC,gBAAgB,KACjB;CACD,MAAM,CAAC,kBAAkB,uBAAuB,SAAmB,EAAE,CAAC;CACtE,MAAM,uBAAuB,OAA8B,KAAK;CAEhE,MAAM,eAAe,UAAU,SAAY,QAAQ;CAEnD,MAAM,+BAA+B;AACnC,MAAI,qBAAqB,SAAS;AAChC,gBAAa,qBAAqB,QAAQ;AAC1C,wBAAqB,UAAU;;;CAInC,MAAM,gBAAgB,aAAqC;AACzD,MAAI,UAAU,OACZ,kBAAiB,SAAS;AAE5B,aAAW,SAAS;;CAGtB,MAAM,iBAAiB,cAAc,kBAAkB,OAAO,EAAE,CAAC,OAAO,CAAC;CAEzE,MAAM,yBAAyB,cACvB,eAAe,MAAM,CAAC,QAAQ,WAAW,OAAO,SAAS,UAAU,EACzE,CAAC,eAAe,CACjB;CAED,MAAM,CAAC,eAAe,oBAAoB,eAAyB;EACjE,MAAM,eAAe,UAAU,SAAY,QAAQ;AACnD,MAAI,CAAC,aACH,QAAO,IAAI,MAAM,uBAAuB,OAAO,CAAC,KAAK,GAAG;EAG1D,MAAM,WAAW,2BAA2B,cAAc,OAAO;AACjE,MAAI,CAAC,SACH,QAAO,IAAI,MAAM,uBAAuB,OAAO,CAAC,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AU;AAC/B,qBAAkB,UAAU;SACvB;AAEL,2BAAwB;AACxB,uBAAoB,EAAE,CAAC;AACvB,OAAI,iBAAiB,KACnB,cAAa,KAAK;;;CAKxB,MAAM,yBAAyB,gBAAiC;AAE9D,0BAAwB;EAExB,MAAM,WAAW,2BAA2B,aAAa,OAAO;AAEhE,MAAI,UAAU;AACZ,oBAAiB,SAAS;AAC1B,uBAAoB,EAAE,CAAC;AACvB,gBAAa,YAAY;;;CAI7B,MAAM,+BAA+B;AACnC,MAAI,qBAAqB,SAAS;AAChC,2BAAwB;AAGxB,OAAI,qBAAqB,cAAc,CACrC,6BAA4B,cAAc;;;AAUhD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,uBAd4B,cACtB,iBAAiB,MAAM,MAC7B,CAAC,iBAAiB,CACnB;EAYC;EACA;EACD"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"use-coordinate-field.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-field.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useId } from '@react-aria/utils';\nimport { useMemo } from 'react';\nimport { useCoordinateCopy } from './use-coordinate-copy';\nimport { useCoordinateFieldState } from './use-coordinate-field-state';\nimport { useCoordinateFocus } from './use-coordinate-focus';\nimport { useCoordinatePaste } from './use-coordinate-paste';\nimport { useTimeoutCleanup } from './use-timeout-cleanup';\nimport type { ValidationResult } from 'react-aria-components';\nimport type {\n CoordinateFieldProps,\n CoordinateSystem,\n CoordinateValue,\n} from '../../components/coordinate-field/types';\n\nconst FOCUS_DELAY_MS = 0;\n\n/** Return value from the useCoordinateField hook */\nexport interface UseCoordinateFieldResult {\n /** Coordinate state management utilities */\n state: ReturnType<typeof useCoordinateFieldState>;\n /** Focus management utilities */\n focus: ReturnType<typeof useCoordinateFocus>;\n /** Paste handling utilities */\n paste: ReturnType<typeof useCoordinatePaste>;\n /** Copy handling utilities */\n copy: ReturnType<typeof useCoordinateCopy>;\n /** Register timeouts for cleanup */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n /** ARIA props for the field container */\n fieldProps: {\n id: string;\n role: 'group';\n 'aria-labelledby': string | undefined;\n 'aria-describedby': string | undefined;\n 'aria-label': string | undefined;\n 'aria-details': string | undefined;\n 'aria-invalid': boolean | undefined;\n 'aria-required': boolean | undefined;\n 'aria-disabled': boolean | undefined;\n };\n /** Props for the label element */\n labelProps: {\n id: string;\n htmlFor: string;\n };\n /** Props for the description element */\n descriptionProps: {\n id: string;\n };\n /** Props for the error message element */\n errorProps: {\n id: string;\n };\n /** Validation result for react-aria */\n validation: ValidationResult;\n /** Generated element IDs */\n ids: {\n fieldId: string;\n labelId: string;\n descriptionId: string;\n errorId: string;\n };\n /** First error message or null */\n effectiveErrorMessage: string | null;\n /** Whether the field is in an invalid state */\n isInvalid: boolean;\n}\n\n/**\n * Manages coordinate field state, focus, copy, paste, and accessibility props\n *\n * @example\n * ```tsx\n * function CoordinateFieldComponent() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n *\n * const {\n * state,\n * focus,\n * paste,\n * copy,\n * fieldProps,\n * labelProps,\n * isInvalid,\n * effectiveErrorMessage,\n * } = useCoordinateField({\n * value,\n * onChange: setValue,\n * format: 'dd',\n * label: 'Location',\n * });\n *\n * return (\n * <div {...fieldProps}>\n * <label {...labelProps}>Location</label>\n * {state.editableSegmentConfigs.map((config, index) => (\n * <input\n * key={index}\n * ref={focus.segmentRefs[index]}\n * value={state.segmentValues[index]}\n * onChange={(e) => state.handleSegmentChange(index, e.target.value)}\n * />\n * ))}\n * {isInvalid && <span>{effectiveErrorMessage}</span>}\n * </div>\n * );\n * }\n * ```\n *\n * @param props - {@link CoordinateFieldProps}\n * @param customAriaLabel - Custom aria-label for the field.\n * @param customAriaDescribedby - Custom aria-describedby IDs.\n * @param customAriaDetails - Custom aria-details ID.\n * @returns {@link UseCoordinateFieldResult} Combined state, focus, copy, paste utilities and accessibility props.\n */\nexport function useCoordinateField(\n props: CoordinateFieldProps,\n customAriaLabel?: string,\n customAriaDescribedby?: string,\n customAriaDetails?: string,\n): UseCoordinateFieldResult {\n const {\n description,\n errorMessage: errorMessageProp,\n format = 'dd' as CoordinateSystem,\n value,\n defaultValue,\n onChange,\n onError,\n isDisabled = false,\n isInvalid: isInvalidProp = false,\n isRequired = false,\n id: idProp,\n } = props;\n\n const fieldId = useId(idProp);\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n const { registerTimeout } = useTimeoutCleanup();\n\n const state = useCoordinateFieldState({\n value,\n defaultValue,\n format,\n onChange,\n onError,\n registerTimeout,\n });\n\n const focus = useCoordinateFocus({\n editableSegmentConfigs: state.editableSegmentConfigs,\n });\n\n const handlePasteValueApplied = (pastedValue: CoordinateValue) => {\n state.applyPastedCoordinate(pastedValue);\n\n // Defer focus until after React commits state updates to the DOM.\n // applyPastedCoordinate triggers setSegmentValues which updates the input\n // elements, and we need those updates to complete before focusing.\n registerTimeout(\n setTimeout(() => {\n focus.focusFirstSegment();\n }, FOCUS_DELAY_MS),\n );\n };\n\n const paste = useCoordinatePaste({\n onValueApplied: handlePasteValueApplied,\n onError,\n });\n\n const copy = useCoordinateCopy({\n currentValue: state.currentValue,\n validationErrors: state.validationErrors,\n isDisabled,\n registerTimeout,\n });\n\n const effectiveErrorMessage = useMemo(\n () => errorMessageProp || state.effectiveErrorMessage,\n [errorMessageProp, state.effectiveErrorMessage],\n );\n\n const isInvalid = isInvalidProp || effectiveErrorMessage !== null;\n\n const describedByIds = [\n description && descriptionId,\n effectiveErrorMessage && errorId,\n customAriaDescribedby,\n ].filter(Boolean);\n const describedBy =\n describedByIds.length > 0 ? describedByIds.join(' ') : undefined;\n\n const labelProps = {\n id: labelId,\n htmlFor: fieldId,\n };\n\n // Only use aria-labelledby when we have a visible label (not using aria-label)\n // When aria-label is provided (e.g., in small size), it takes precedence\n const ariaLabelledBy = customAriaLabel ? undefined : labelId;\n\n const fieldProps = {\n id: fieldId,\n role: 'group' as const,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': describedBy,\n 'aria-label': customAriaLabel || undefined,\n 'aria-details': customAriaDetails || undefined,\n 'aria-invalid': isInvalid || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n };\n\n const descriptionProps = {\n id: descriptionId,\n };\n\n const errorProps = {\n id: errorId,\n };\n\n const validation: ValidationResult = useMemo(\n () => ({\n isInvalid,\n validationErrors: effectiveErrorMessage ? [effectiveErrorMessage] : [],\n validationDetails: {} as ValidityState,\n }),\n [isInvalid, effectiveErrorMessage],\n );\n\n return {\n state,\n focus,\n paste,\n copy,\n registerTimeout,\n fieldProps,\n labelProps,\n descriptionProps,\n errorProps,\n validation,\n ids: {\n fieldId,\n labelId,\n descriptionId,\n errorId,\n },\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A,YAnCiB;GACjB,IAAI;GACJ,MAAM;GACN,mBAAmB;GACnB,oBAAoB;GACpB,cAAc,mBAAmB;GACjC,gBAAgB,qBAAqB;GACrC,gBAAgB,aAAa;GAC7B,iBAAiB,cAAc;GAC/B,iBAAiB,cAAc;GAChC;EA0BC;EACA,kBAzBuB,EACvB,IAAI,eACL;EAwBC,YAtBiB,EACjB,IAAI,SACL;EAqBC,YAnBmC,eAC5B;GACL;GACA,kBAAkB,wBAAwB,CAAC,sBAAsB,GAAG,EAAE;GACtE,mBAAmB,EAAE;GACtB,GACD,CAAC,WAAW,sBAAsB,CACnC;EAaC,KAAK;GACH;GACA;GACA;GACA;GACD;EACD;EACA;EACD"}
1
+ {"version":3,"file":"use-coordinate-field.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-field.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useId } from '@react-aria/utils';\nimport { useMemo } from 'react';\nimport { useCoordinateCopy } from './use-coordinate-copy';\nimport { useCoordinateFieldState } from './use-coordinate-field-state';\nimport { useCoordinateFocus } from './use-coordinate-focus';\nimport { useCoordinatePaste } from './use-coordinate-paste';\nimport { useTimeoutCleanup } from './use-timeout-cleanup';\nimport type { ValidationResult } from 'react-aria-components';\nimport type {\n CoordinateFieldProps,\n CoordinateSystem,\n CoordinateValue,\n} from '../../components/coordinate-field/types';\n\nconst FOCUS_DELAY_MS = 0;\n\n/** Return value from the useCoordinateField hook */\nexport interface UseCoordinateFieldResult {\n /** Coordinate state management utilities */\n state: ReturnType<typeof useCoordinateFieldState>;\n /** Focus management utilities */\n focus: ReturnType<typeof useCoordinateFocus>;\n /** Paste handling utilities */\n paste: ReturnType<typeof useCoordinatePaste>;\n /** Copy handling utilities */\n copy: ReturnType<typeof useCoordinateCopy>;\n /** Register timeouts for cleanup */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n /** ARIA props for the field container */\n fieldProps: {\n id: string;\n role: 'group';\n 'aria-labelledby': string | undefined;\n 'aria-describedby': string | undefined;\n 'aria-label': string | undefined;\n 'aria-details': string | undefined;\n 'aria-invalid': boolean | undefined;\n 'aria-required': boolean | undefined;\n 'aria-disabled': boolean | undefined;\n };\n /** Props for the label element */\n labelProps: {\n id: string;\n htmlFor: string;\n };\n /** Props for the description element */\n descriptionProps: {\n id: string;\n };\n /** Props for the error message element */\n errorProps: {\n id: string;\n };\n /** Validation result for react-aria */\n validation: ValidationResult;\n /** Generated element IDs */\n ids: {\n fieldId: string;\n labelId: string;\n descriptionId: string;\n errorId: string;\n };\n /** First error message or null */\n effectiveErrorMessage: string | null;\n /** Whether the field is in an invalid state */\n isInvalid: boolean;\n}\n\n/**\n * Manages coordinate field state, focus, copy, paste, and accessibility props\n *\n * @example\n * ```tsx\n * function CoordinateFieldComponent() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n *\n * const {\n * state,\n * focus,\n * paste,\n * copy,\n * fieldProps,\n * labelProps,\n * isInvalid,\n * effectiveErrorMessage,\n * } = useCoordinateField({\n * value,\n * onChange: setValue,\n * format: 'dd',\n * label: 'Location',\n * });\n *\n * return (\n * <div {...fieldProps}>\n * <label {...labelProps}>Location</label>\n * {state.editableSegmentConfigs.map((config, index) => (\n * <input\n * key={index}\n * ref={focus.segmentRefs[index]}\n * value={state.segmentValues[index]}\n * onChange={(e) => state.handleSegmentChange(index, e.target.value)}\n * />\n * ))}\n * {isInvalid && <span>{effectiveErrorMessage}</span>}\n * </div>\n * );\n * }\n * ```\n *\n * @param props - {@link CoordinateFieldProps}\n * @param customAriaLabel - Custom aria-label for the field.\n * @param customAriaDescribedby - Custom aria-describedby IDs.\n * @param customAriaDetails - Custom aria-details ID.\n * @returns {@link UseCoordinateFieldResult} Combined state, focus, copy, paste utilities and accessibility props.\n */\nexport function useCoordinateField(\n props: CoordinateFieldProps,\n customAriaLabel?: string,\n customAriaDescribedby?: string,\n customAriaDetails?: string,\n): UseCoordinateFieldResult {\n const {\n description,\n errorMessage: errorMessageProp,\n format = 'dd' as CoordinateSystem,\n value,\n defaultValue,\n onChange,\n onError,\n isDisabled = false,\n isInvalid: isInvalidProp = false,\n isRequired = false,\n id: idProp,\n } = props;\n\n const fieldId = useId(idProp);\n const labelId = useId();\n const descriptionId = useId();\n const errorId = useId();\n\n const { registerTimeout } = useTimeoutCleanup();\n\n const state = useCoordinateFieldState({\n value,\n defaultValue,\n format,\n onChange,\n onError,\n registerTimeout,\n });\n\n const focus = useCoordinateFocus({\n editableSegmentConfigs: state.editableSegmentConfigs,\n });\n\n const handlePasteValueApplied = (pastedValue: CoordinateValue) => {\n state.applyPastedCoordinate(pastedValue);\n\n // Defer focus until after React commits state updates to the DOM.\n // applyPastedCoordinate triggers setSegmentValues which updates the input\n // elements, and we need those updates to complete before focusing.\n registerTimeout(\n setTimeout(() => {\n focus.focusFirstSegment();\n }, FOCUS_DELAY_MS),\n );\n };\n\n const paste = useCoordinatePaste({\n onValueApplied: handlePasteValueApplied,\n onError,\n });\n\n const copy = useCoordinateCopy({\n currentValue: state.currentValue,\n validationErrors: state.validationErrors,\n isDisabled,\n registerTimeout,\n });\n\n const effectiveErrorMessage = useMemo(\n () => errorMessageProp || state.effectiveErrorMessage,\n [errorMessageProp, state.effectiveErrorMessage],\n );\n\n const isInvalid = isInvalidProp || effectiveErrorMessage !== null;\n\n const describedByIds = [\n description && descriptionId,\n effectiveErrorMessage && errorId,\n customAriaDescribedby,\n ].filter(Boolean);\n const describedBy =\n describedByIds.length > 0 ? describedByIds.join(' ') : undefined;\n\n const labelProps = {\n id: labelId,\n htmlFor: fieldId,\n };\n\n // Only use aria-labelledby when we have a visible label (not using aria-label)\n // When aria-label is provided (e.g., in small size), it takes precedence\n const ariaLabelledBy = customAriaLabel ? undefined : labelId;\n\n const fieldProps = {\n id: fieldId,\n role: 'group' as const,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': describedBy,\n 'aria-label': customAriaLabel || undefined,\n 'aria-details': customAriaDetails || undefined,\n 'aria-invalid': isInvalid || undefined,\n 'aria-required': isRequired || undefined,\n 'aria-disabled': isDisabled || undefined,\n };\n\n const descriptionProps = {\n id: descriptionId,\n };\n\n const errorProps = {\n id: errorId,\n };\n\n const validation: ValidationResult = useMemo(\n () => ({\n isInvalid,\n validationErrors: effectiveErrorMessage ? [effectiveErrorMessage] : [],\n validationDetails: {} as ValidityState,\n }),\n [isInvalid, effectiveErrorMessage],\n );\n\n return {\n state,\n focus,\n paste,\n copy,\n registerTimeout,\n fieldProps,\n labelProps,\n descriptionProps,\n errorProps,\n validation,\n ids: {\n fieldId,\n labelId,\n descriptionId,\n errorId,\n },\n effectiveErrorMessage,\n isInvalid,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGvB,SAAgB,mBACd,OACA,iBACA,uBACA,mBAC0B;CAC1B,MAAM,EACJ,aACA,cAAc,kBACd,SAAS,MACT,OACA,cACA,UACA,SACA,aAAa,OACb,WAAW,gBAAgB,OAC3B,aAAa,OACb,IAAI,WACF;CAEJ,MAAM,UAAU,MAAM,OAAO;CAC7B,MAAM,UAAU,OAAO;CACvB,MAAM,gBAAgB,OAAO;CAC7B,MAAM,UAAU,OAAO;CAEvB,MAAM,EAAE,oBAAoB,mBAAmB;CAE/C,MAAM,QAAQ,wBAAwB;EACpC;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,QAAQ,mBAAmB,EAC/B,wBAAwB,MAAM,wBAC/B,CAAC;CAEF,MAAM,2BAA2B,gBAAiC;AAChE,QAAM,sBAAsB,YAAY;AAKxC,kBACE,iBAAiB;AACf,SAAM,mBAAmB;KACxB,eAAe,CACnB;;CAGH,MAAM,QAAQ,mBAAmB;EAC/B,gBAAgB;EAChB;EACD,CAAC;CAEF,MAAM,OAAO,kBAAkB;EAC7B,cAAc,MAAM;EACpB,kBAAkB,MAAM;EACxB;EACA;EACD,CAAC;CAEF,MAAM,wBAAwB,cACtB,oBAAoB,MAAM,uBAChC,CAAC,kBAAkB,MAAM,sBAAsB,CAChD;CAED,MAAM,YAAY,iBAAiB,0BAA0B;CAE7D,MAAM,iBAAiB;EACrB,eAAe;EACf,yBAAyB;EACzB;EACD,CAAC,OAAO,QAAQ;CACjB,MAAM,cACJ,eAAe,SAAS,IAAI,eAAe,KAAK,IAAI,GAAG;CAEzD,MAAM,aAAa;EACjB,IAAI;EACJ,SAAS;EACV;CAID,MAAM,iBAAiB,kBAAkB,SAAY;AA+BrD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA,YAnCiB;GACjB,IAAI;GACJ,MAAM;GACN,mBAAmB;GACnB,oBAAoB;GACpB,cAAc,mBAAmB;GACjC,gBAAgB,qBAAqB;GACrC,gBAAgB,aAAa;GAC7B,iBAAiB,cAAc;GAC/B,iBAAiB,cAAc;GAChC;EA0BC;EACA,kBAzBuB,EACvB,IAAI,eACL;EAwBC,YAtBiB,EACjB,IAAI,SACL;EAqBC,YAnBmC,eAC5B;GACL;GACA,kBAAkB,wBAAwB,CAAC,sBAAsB,GAAG,EAAE;GACtE,mBAAmB,EAAE;GACtB,GACD,CAAC,WAAW,sBAAsB,CACnC;EAaC,KAAK;GACH;GACA;GACA;GACA;GACD;EACD;EACA;EACD"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"use-coordinate-focus.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-focus.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createRef,\n type KeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport type { SegmentConfig } from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinateFocus hook */\nexport interface UseCoordinateFocusOptions {\n /** Array of editable segment configurations */\n editableSegmentConfigs: SegmentConfig[];\n}\n\n/** Return value from the useCoordinateFocus hook */\nexport interface UseCoordinateFocusResult {\n /** Array of refs for each input segment */\n segmentRefs: React.RefObject<HTMLInputElement>[];\n /** Index of the currently focused segment (-1 if none) */\n focusedSegmentIndex: number;\n /** Focus a specific segment by index */\n focusSegment: (index: number) => void;\n /** Focus the next segment after the current index */\n focusNextSegment: (currentIndex: number) => void;\n /** Focus the previous segment before the current index */\n focusPreviousSegment: (currentIndex: number) => void;\n /** Focus the first segment */\n focusFirstSegment: () => void;\n /** Focus the last segment */\n focusLastSegment: () => void;\n /** Handle keyboard navigation (Home/End keys) */\n handleSegmentKeyDown: (\n index: number,\n e: KeyboardEvent<HTMLInputElement>,\n ) => void;\n /** Update the focused segment index state */\n setFocusedSegmentIndex: (index: number) => void;\n}\n\n/**\n * Manages focus navigation between coordinate input segments\n *\n * @example\n * ```tsx\n * function CoordinateSegments({ configs }: { configs: SegmentConfig[] }) {\n * const {\n * segmentRefs,\n * focusedSegmentIndex,\n * focusNextSegment,\n * focusPreviousSegment,\n * handleSegmentKeyDown,\n * setFocusedSegmentIndex,\n * } = useCoordinateFocus({ editableSegmentConfigs: configs });\n *\n * return (\n * <div>\n * {configs.map((config, i) => (\n * <input\n * key={i}\n * ref={segmentRefs[i]}\n * onFocus={() => setFocusedSegmentIndex(i)}\n * onKeyDown={(e) => {\n * handleSegmentKeyDown(i, e);\n * if (e.key === 'ArrowRight') focusNextSegment(i);\n * if (e.key === 'ArrowLeft') focusPreviousSegment(i);\n * }}\n * aria-current={focusedSegmentIndex === i || undefined}\n * />\n * ))}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateFocusOptions}\n * @param options.editableSegmentConfigs - Array of editable segment configurations.\n * @returns {@link UseCoordinateFocusResult} Focus management utilities and state.\n */\nexport function useCoordinateFocus({\n editableSegmentConfigs,\n}: UseCoordinateFocusOptions): UseCoordinateFocusResult {\n const segmentRefsInternal = useRef<React.RefObject<HTMLInputElement>[]>([]);\n const [focusedSegmentIndex, setFocusedSegmentIndex] = useState<number>(-1);\n\n useEffect(() => {\n segmentRefsInternal.current = editableSegmentConfigs.map((_, i) => {\n const existingRef = segmentRefsInternal.current[i];\n if (existingRef) {\n return existingRef;\n }\n return createRef<HTMLInputElement>() as React.RefObject<HTMLInputElement>;\n });\n }, [editableSegmentConfigs]);\n\n const focusSegment = (index: number) => {\n if (index >= 0 && index < segmentRefsInternal.current.length) {\n segmentRefsInternal.current[index]?.current?.focus();\n }\n };\n\n const focusNextSegment = (currentIndex: number) => {\n focusSegment(currentIndex + 1);\n };\n\n const focusPreviousSegment = (currentIndex: number) => {\n focusSegment(currentIndex - 1);\n };\n\n const focusFirstSegment = () => {\n focusSegment(0);\n };\n\n const focusLastSegment = () => {\n focusSegment(segmentRefsInternal.current.length - 1);\n };\n\n const handleSegmentKeyDown = (\n _index: number,\n e: KeyboardEvent<HTMLInputElement>,\n ) => {\n if (e.key === 'Home') {\n e.preventDefault();\n focusFirstSegment();\n } else if (e.key === 'End') {\n e.preventDefault();\n focusLastSegment();\n }\n };\n\n return {\n segmentRefs: segmentRefsInternal.current,\n focusedSegmentIndex,\n focusSegment,\n focusNextSegment,\n focusPreviousSegment,\n focusFirstSegment,\n focusLastSegment,\n handleSegmentKeyDown,\n setFocusedSegmentIndex,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,mBAAmB,EACjC,0BACsD;CACtD,MAAM,sBAAsB,OAA4C,EAAE,CAAC;CAC3E,MAAM,CAAC,qBAAqB,0BAA0B,SAAiB,GAAG;AAE1E,iBAAgB;AACd,sBAAoB,UAAU,uBAAuB,KAAK,GAAG,MAAM;GACjE,MAAM,cAAc,oBAAoB,QAAQ;AAChD,OAAI,YACF,QAAO;AAET,UAAO,WAA6B;IACpC;IACD,CAAC,uBAAuB,CAAC;CAE5B,MAAM,gBAAgB,UAAkB;AACtC,MAAI,SAAS,KAAK,QAAQ,oBAAoB,QAAQ,OACpD,qBAAoB,QAAQ,QAAQ,SAAS,OAAO;;CAIxD,MAAM,oBAAoB,iBAAyB;AACjD,eAAa,eAAe,EAAE;;CAGhC,MAAM,wBAAwB,iBAAyB;AACrD,eAAa,eAAe,EAAE;;CAGhC,MAAM,0BAA0B;AAC9B,eAAa,EAAE;;CAGjB,MAAM,yBAAyB;AAC7B,eAAa,oBAAoB,QAAQ,SAAS,EAAE;;CAGtD,MAAM,wBACJ,QACA,MACG;AACH,MAAI,EAAE,QAAQ,QAAQ;AACpB,KAAE,gBAAgB;AAClB,sBAAmB;aACV,EAAE,QAAQ,OAAO;AAC1B,KAAE,gBAAgB;AAClB,qBAAkB;;;AAItB,QAAO;EACL,aAAa,oBAAoB;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"use-coordinate-focus.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-focus.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n createRef,\n type KeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport type { SegmentConfig } from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinateFocus hook */\nexport interface UseCoordinateFocusOptions {\n /** Array of editable segment configurations */\n editableSegmentConfigs: SegmentConfig[];\n}\n\n/** Return value from the useCoordinateFocus hook */\nexport interface UseCoordinateFocusResult {\n /** Array of refs for each input segment */\n segmentRefs: React.RefObject<HTMLInputElement>[];\n /** Index of the currently focused segment (-1 if none) */\n focusedSegmentIndex: number;\n /** Focus a specific segment by index */\n focusSegment: (index: number) => void;\n /** Focus the next segment after the current index */\n focusNextSegment: (currentIndex: number) => void;\n /** Focus the previous segment before the current index */\n focusPreviousSegment: (currentIndex: number) => void;\n /** Focus the first segment */\n focusFirstSegment: () => void;\n /** Focus the last segment */\n focusLastSegment: () => void;\n /** Handle keyboard navigation (Home/End keys) */\n handleSegmentKeyDown: (\n index: number,\n e: KeyboardEvent<HTMLInputElement>,\n ) => void;\n /** Update the focused segment index state */\n setFocusedSegmentIndex: (index: number) => void;\n}\n\n/**\n * Manages focus navigation between coordinate input segments\n *\n * @example\n * ```tsx\n * function CoordinateSegments({ configs }: { configs: SegmentConfig[] }) {\n * const {\n * segmentRefs,\n * focusedSegmentIndex,\n * focusNextSegment,\n * focusPreviousSegment,\n * handleSegmentKeyDown,\n * setFocusedSegmentIndex,\n * } = useCoordinateFocus({ editableSegmentConfigs: configs });\n *\n * return (\n * <div>\n * {configs.map((config, i) => (\n * <input\n * key={i}\n * ref={segmentRefs[i]}\n * onFocus={() => setFocusedSegmentIndex(i)}\n * onKeyDown={(e) => {\n * handleSegmentKeyDown(i, e);\n * if (e.key === 'ArrowRight') focusNextSegment(i);\n * if (e.key === 'ArrowLeft') focusPreviousSegment(i);\n * }}\n * aria-current={focusedSegmentIndex === i || undefined}\n * />\n * ))}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinateFocusOptions}\n * @param options.editableSegmentConfigs - Array of editable segment configurations.\n * @returns {@link UseCoordinateFocusResult} Focus management utilities and state.\n */\nexport function useCoordinateFocus({\n editableSegmentConfigs,\n}: UseCoordinateFocusOptions): UseCoordinateFocusResult {\n const segmentRefsInternal = useRef<React.RefObject<HTMLInputElement>[]>([]);\n const [focusedSegmentIndex, setFocusedSegmentIndex] = useState<number>(-1);\n\n useEffect(() => {\n segmentRefsInternal.current = editableSegmentConfigs.map((_, i) => {\n const existingRef = segmentRefsInternal.current[i];\n if (existingRef) {\n return existingRef;\n }\n return createRef<HTMLInputElement>() as React.RefObject<HTMLInputElement>;\n });\n }, [editableSegmentConfigs]);\n\n const focusSegment = (index: number) => {\n if (index >= 0 && index < segmentRefsInternal.current.length) {\n segmentRefsInternal.current[index]?.current?.focus();\n }\n };\n\n const focusNextSegment = (currentIndex: number) => {\n focusSegment(currentIndex + 1);\n };\n\n const focusPreviousSegment = (currentIndex: number) => {\n focusSegment(currentIndex - 1);\n };\n\n const focusFirstSegment = () => {\n focusSegment(0);\n };\n\n const focusLastSegment = () => {\n focusSegment(segmentRefsInternal.current.length - 1);\n };\n\n const handleSegmentKeyDown = (\n _index: number,\n e: KeyboardEvent<HTMLInputElement>,\n ) => {\n if (e.key === 'Home') {\n e.preventDefault();\n focusFirstSegment();\n } else if (e.key === 'End') {\n e.preventDefault();\n focusLastSegment();\n }\n };\n\n return {\n segmentRefs: segmentRefsInternal.current,\n focusedSegmentIndex,\n focusSegment,\n focusNextSegment,\n focusPreviousSegment,\n focusFirstSegment,\n focusLastSegment,\n handleSegmentKeyDown,\n setFocusedSegmentIndex,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,mBAAmB,EACjC,0BACsD;CACtD,MAAM,sBAAsB,OAA4C,EAAE,CAAC;CAC3E,MAAM,CAAC,qBAAqB,0BAA0B,SAAiB,GAAG;AAE1E,iBAAgB;AACd,sBAAoB,UAAU,uBAAuB,KAAK,GAAG,MAAM;GACjE,MAAM,cAAc,oBAAoB,QAAQ;AAChD,OAAI,YACF,QAAO;AAET,UAAO,WAA6B;IACpC;IACD,CAAC,uBAAuB,CAAC;CAE5B,MAAM,gBAAgB,UAAkB;AACtC,MAAI,SAAS,KAAK,QAAQ,oBAAoB,QAAQ,OACpD,qBAAoB,QAAQ,QAAQ,SAAS,OAAO;;CAIxD,MAAM,oBAAoB,iBAAyB;AACjD,eAAa,eAAe,EAAE;;CAGhC,MAAM,wBAAwB,iBAAyB;AACrD,eAAa,eAAe,EAAE;;CAGhC,MAAM,0BAA0B;AAC9B,eAAa,EAAE;;CAGjB,MAAM,yBAAyB;AAC7B,eAAa,oBAAoB,QAAQ,SAAS,EAAE;;CAGtD,MAAM,wBACJ,QACA,MACG;AACH,MAAI,EAAE,QAAQ,QAAQ;AACpB,KAAE,gBAAgB;AAClB,sBAAmB;aACV,EAAE,QAAQ,OAAO;AAC1B,KAAE,gBAAgB;AAClB,qBAAkB;;;AAItB,QAAO;EACL,aAAa,oBAAoB;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"use-coordinate-paste.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-paste.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n deduplicateMatchesByLocation,\n isCompleteCoordinate,\n parseCoordinatePaste,\n} from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n ParsedCoordinateMatch,\n} from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinatePaste hook */\nexport interface UseCoordinatePasteOptions {\n /** Callback when a coordinate value is successfully parsed and applied */\n onValueApplied: (value: CoordinateValue) => void;\n /** Optional error callback for invalid paste attempts */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n}\n\n/** Return value from the useCoordinatePaste hook */\nexport interface UseCoordinatePasteResult {\n /** Array of parsed coordinate matches for disambiguation */\n disambiguationMatches: ParsedCoordinateMatch[];\n /** Whether the disambiguation modal is visible */\n showDisambiguationModal: boolean;\n /** Currently selected format in disambiguation modal */\n selectedDisambiguationFormat: CoordinateSystem | null;\n /** Paste event handler for coordinate input */\n handleInputPaste: (e: React.ClipboardEvent<HTMLDivElement>) => void;\n /** Confirm selection in disambiguation modal */\n handleDisambiguationSelect: () => void;\n /** Control disambiguation modal visibility */\n setShowDisambiguationModal: (show: boolean) => void;\n /** Set the selected format in disambiguation modal */\n setSelectedDisambiguationFormat: (format: CoordinateSystem | null) => void;\n /** Reset disambiguation modal state */\n cleanupDisambiguationModal: () => void;\n}\n\n/**\n * Handles paste events with coordinate parsing and disambiguation when multiple formats match\n *\n * @example\n * ```tsx\n * function CoordinateFieldWithPaste() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n *\n * const {\n * disambiguationMatches,\n * showDisambiguationModal,\n * selectedDisambiguationFormat,\n * handleInputPaste,\n * handleDisambiguationSelect,\n * setShowDisambiguationModal,\n * setSelectedDisambiguationFormat,\n * } = useCoordinatePaste({\n * onValueApplied: setValue,\n * onError: (msg) => console.error(msg),\n * });\n *\n * return (\n * <>\n * <div onPaste={handleInputPaste}>\n * // ...Coordinate input segments\n * </div>\n * {showDisambiguationModal && (\n * <Dialog onClose={() => setShowDisambiguationModal(false)}>\n * {disambiguationMatches.map((match) => (\n * <Radio\n * key={match.format}\n * value={match.format}\n * isSelected={selectedDisambiguationFormat === match.format}\n * onChange={() => setSelectedDisambiguationFormat(match.format)}\n * >\n * {match.format}: {match.matched}\n * </Radio>\n * ))}\n * <Button onPress={handleDisambiguationSelect}>Confirm</Button>\n * </Dialog>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinatePasteOptions}\n * @param options.onValueApplied - Callback when a coordinate value is successfully parsed and applied.\n * @param options.onError - Optional error callback for invalid paste attempts.\n * @returns {@link UseCoordinatePasteResult} Paste handling utilities and disambiguation state.\n */\nexport function useCoordinatePaste({\n onValueApplied,\n onError,\n}: UseCoordinatePasteOptions): UseCoordinatePasteResult {\n const [disambiguationMatches, setDisambiguationMatches] = useState<\n ParsedCoordinateMatch[]\n >([]);\n const [showDisambiguationModal, setShowDisambiguationModal] = useState(false);\n const [selectedDisambiguationFormat, setSelectedDisambiguationFormat] =\n useState<CoordinateSystem | null>(null);\n\n /**\n * Handles paste failure when no coordinate formats match\n * Calls onError with \"Invalid coordinate format\" message\n */\n const handlePasteNoMatches = (pastedText: string) => {\n const errorMsg = 'Invalid coordinate format';\n onError?.(errorMsg, { pastedText });\n };\n\n const handlePasteSingleMatch = (match: ParsedCoordinateMatch | undefined) => {\n if (match) {\n onValueApplied(match.value);\n }\n };\n\n const handlePasteMultipleMatches = (matches: ParsedCoordinateMatch[]) => {\n setDisambiguationMatches(matches);\n const firstMatch = matches[0];\n if (firstMatch) {\n setSelectedDisambiguationFormat(firstMatch.format);\n }\n setShowDisambiguationModal(true);\n };\n\n const handleCoordinatePaste = (pastedText: string) => {\n const allMatches = parseCoordinatePaste(pastedText);\n\n if (allMatches.length === 0) {\n handlePasteNoMatches(pastedText);\n return;\n }\n\n // Deduplicate matches by location - only show modal for different locations\n const matches = deduplicateMatchesByLocation(allMatches);\n\n if (matches.length === 1) {\n handlePasteSingleMatch(matches[0]);\n } else {\n handlePasteMultipleMatches(matches);\n }\n };\n\n const handleInputPaste = (e: React.ClipboardEvent<HTMLDivElement>) => {\n const pastedText = e.clipboardData?.getData('text/plain');\n if (pastedText && isCompleteCoordinate(pastedText)) {\n e.preventDefault();\n handleCoordinatePaste(pastedText);\n }\n };\n\n const cleanupDisambiguationModal = () => {\n setShowDisambiguationModal(false);\n setDisambiguationMatches([]);\n setSelectedDisambiguationFormat(null);\n };\n\n const handleDisambiguationSelect = () => {\n if (selectedDisambiguationFormat) {\n const match = disambiguationMatches.find(\n (m) => m.format === selectedDisambiguationFormat,\n );\n if (match) {\n onValueApplied(match.value);\n }\n }\n cleanupDisambiguationModal();\n };\n\n return {\n disambiguationMatches,\n showDisambiguationModal,\n selectedDisambiguationFormat,\n handleInputPaste,\n handleDisambiguationSelect,\n setShowDisambiguationModal,\n setSelectedDisambiguationFormat,\n cleanupDisambiguationModal,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,SAAgB,mBAAmB,EACjC,gBACA,WACsD;CACtD,MAAM,CAAC,uBAAuB,4BAA4B,SAExD,EAAE,CAAC;CACL,MAAM,CAAC,yBAAyB,8BAA8B,SAAS,MAAM;CAC7E,MAAM,CAAC,8BAA8B,mCACnC,SAAkC,KAAK;;;;;CAMzC,MAAM,wBAAwB,eAAuB;AAEnD,YADiB,6BACG,EAAE,YAAY,CAAC;;CAGrC,MAAM,0BAA0B,UAA6C;AAC3E,MAAI,MACF,gBAAe,MAAM,MAAM;;CAI/B,MAAM,8BAA8B,YAAqC;AACvE,2BAAyB,QAAQ;EACjC,MAAM,aAAa,QAAQ;AAC3B,MAAI,WACF,iCAAgC,WAAW,OAAO;AAEpD,6BAA2B,KAAK;;CAGlC,MAAM,yBAAyB,eAAuB;EACpD,MAAM,aAAa,qBAAqB,WAAW;AAEnD,MAAI,WAAW,WAAW,GAAG;AAC3B,wBAAqB,WAAW;AAChC;;EAIF,MAAM,UAAU,6BAA6B,WAAW;AAExD,MAAI,QAAQ,WAAW,EACrB,wBAAuB,QAAQ,GAAG;MAElC,4BAA2B,QAAQ;;CAIvC,MAAM,oBAAoB,MAA4C;EACpE,MAAM,aAAa,EAAE,eAAe,QAAQ,aAAa;AACzD,MAAI,cAAc,qBAAqB,WAAW,EAAE;AAClD,KAAE,gBAAgB;AAClB,yBAAsB,WAAW;;;CAIrC,MAAM,mCAAmC;AACvC,6BAA2B,MAAM;AACjC,2BAAyB,EAAE,CAAC;AAC5B,kCAAgC,KAAK;;CAGvC,MAAM,mCAAmC;AACvC,MAAI,8BAA8B;GAChC,MAAM,QAAQ,sBAAsB,MACjC,MAAM,EAAE,WAAW,6BACrB;AACD,OAAI,MACF,gBAAe,MAAM,MAAM;;AAG/B,8BAA4B;;AAG9B,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"use-coordinate-paste.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-paste.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n deduplicateMatchesByLocation,\n isCompleteCoordinate,\n parseCoordinatePaste,\n} from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n ParsedCoordinateMatch,\n} from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinatePaste hook */\nexport interface UseCoordinatePasteOptions {\n /** Callback when a coordinate value is successfully parsed and applied */\n onValueApplied: (value: CoordinateValue) => void;\n /** Optional error callback for invalid paste attempts */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n}\n\n/** Return value from the useCoordinatePaste hook */\nexport interface UseCoordinatePasteResult {\n /** Array of parsed coordinate matches for disambiguation */\n disambiguationMatches: ParsedCoordinateMatch[];\n /** Whether the disambiguation modal is visible */\n showDisambiguationModal: boolean;\n /** Currently selected format in disambiguation modal */\n selectedDisambiguationFormat: CoordinateSystem | null;\n /** Paste event handler for coordinate input */\n handleInputPaste: (e: React.ClipboardEvent<HTMLDivElement>) => void;\n /** Confirm selection in disambiguation modal */\n handleDisambiguationSelect: () => void;\n /** Control disambiguation modal visibility */\n setShowDisambiguationModal: (show: boolean) => void;\n /** Set the selected format in disambiguation modal */\n setSelectedDisambiguationFormat: (format: CoordinateSystem | null) => void;\n /** Reset disambiguation modal state */\n cleanupDisambiguationModal: () => void;\n}\n\n/**\n * Handles paste events with coordinate parsing and disambiguation when multiple formats match\n *\n * @example\n * ```tsx\n * function CoordinateFieldWithPaste() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n *\n * const {\n * disambiguationMatches,\n * showDisambiguationModal,\n * selectedDisambiguationFormat,\n * handleInputPaste,\n * handleDisambiguationSelect,\n * setShowDisambiguationModal,\n * setSelectedDisambiguationFormat,\n * } = useCoordinatePaste({\n * onValueApplied: setValue,\n * onError: (msg) => console.error(msg),\n * });\n *\n * return (\n * <>\n * <div onPaste={handleInputPaste}>\n * // ...Coordinate input segments\n * </div>\n * {showDisambiguationModal && (\n * <Dialog onClose={() => setShowDisambiguationModal(false)}>\n * {disambiguationMatches.map((match) => (\n * <Radio\n * key={match.format}\n * value={match.format}\n * isSelected={selectedDisambiguationFormat === match.format}\n * onChange={() => setSelectedDisambiguationFormat(match.format)}\n * >\n * {match.format}: {match.matched}\n * </Radio>\n * ))}\n * <Button onPress={handleDisambiguationSelect}>Confirm</Button>\n * </Dialog>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinatePasteOptions}\n * @param options.onValueApplied - Callback when a coordinate value is successfully parsed and applied.\n * @param options.onError - Optional error callback for invalid paste attempts.\n * @returns {@link UseCoordinatePasteResult} Paste handling utilities and disambiguation state.\n */\nexport function useCoordinatePaste({\n onValueApplied,\n onError,\n}: UseCoordinatePasteOptions): UseCoordinatePasteResult {\n const [disambiguationMatches, setDisambiguationMatches] = useState<\n ParsedCoordinateMatch[]\n >([]);\n const [showDisambiguationModal, setShowDisambiguationModal] = useState(false);\n const [selectedDisambiguationFormat, setSelectedDisambiguationFormat] =\n useState<CoordinateSystem | null>(null);\n\n /**\n * Handles paste failure when no coordinate formats match\n * Calls onError with \"Invalid coordinate format\" message\n */\n const handlePasteNoMatches = (pastedText: string) => {\n const errorMsg = 'Invalid coordinate format';\n onError?.(errorMsg, { pastedText });\n };\n\n const handlePasteSingleMatch = (match: ParsedCoordinateMatch | undefined) => {\n if (match) {\n onValueApplied(match.value);\n }\n };\n\n const handlePasteMultipleMatches = (matches: ParsedCoordinateMatch[]) => {\n setDisambiguationMatches(matches);\n const firstMatch = matches[0];\n if (firstMatch) {\n setSelectedDisambiguationFormat(firstMatch.format);\n }\n setShowDisambiguationModal(true);\n };\n\n const handleCoordinatePaste = (pastedText: string) => {\n const allMatches = parseCoordinatePaste(pastedText);\n\n if (allMatches.length === 0) {\n handlePasteNoMatches(pastedText);\n return;\n }\n\n // Deduplicate matches by location - only show modal for different locations\n const matches = deduplicateMatchesByLocation(allMatches);\n\n if (matches.length === 1) {\n handlePasteSingleMatch(matches[0]);\n } else {\n handlePasteMultipleMatches(matches);\n }\n };\n\n const handleInputPaste = (e: React.ClipboardEvent<HTMLDivElement>) => {\n const pastedText = e.clipboardData?.getData('text/plain');\n if (pastedText && isCompleteCoordinate(pastedText)) {\n e.preventDefault();\n handleCoordinatePaste(pastedText);\n }\n };\n\n const cleanupDisambiguationModal = () => {\n setShowDisambiguationModal(false);\n setDisambiguationMatches([]);\n setSelectedDisambiguationFormat(null);\n };\n\n const handleDisambiguationSelect = () => {\n if (selectedDisambiguationFormat) {\n const match = disambiguationMatches.find(\n (m) => m.format === selectedDisambiguationFormat,\n );\n if (match) {\n onValueApplied(match.value);\n }\n }\n cleanupDisambiguationModal();\n };\n\n return {\n disambiguationMatches,\n showDisambiguationModal,\n selectedDisambiguationFormat,\n handleInputPaste,\n handleDisambiguationSelect,\n setShowDisambiguationModal,\n setSelectedDisambiguationFormat,\n cleanupDisambiguationModal,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;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1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"use-timeout-cleanup.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-timeout-cleanup.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useRef } from 'react';\n\n/** Return value from the useTimeoutCleanup hook */\nexport interface UseTimeoutCleanupResult {\n /** Register a timeout for automatic cleanup on unmount */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n}\n\n/**\n * Registers timeouts for automatic cleanup on component unmount\n *\n * @example\n * ```tsx\n * function ComponentWithTimeouts() {\n * const { registerTimeout } = useTimeoutCleanup();\n * const [message, setMessage] = useState('');\n *\n * const handleClick = () => {\n * setMessage('Saving...');\n *\n * registerTimeout(\n * setTimeout(() => {\n * setMessage('Saved!');\n * }, 1000)\n * );\n * };\n *\n * return (\n * <div>\n * <Button onPress={handleClick}>Save</Button>\n * <span>{message}</span>\n * </div>\n * );\n * }\n * ```\n *\n * @returns {@link UseTimeoutCleanupResult} Timeout registration function.\n */\nexport function useTimeoutCleanup(): UseTimeoutCleanupResult {\n const timeoutIdsRef = useRef<Set<NodeJS.Timeout>>(new Set());\n\n const registerTimeout = (timeoutId: NodeJS.Timeout) => {\n timeoutIdsRef.current.add(timeoutId);\n };\n\n useEffect(() => {\n return () => {\n timeoutIdsRef.current.forEach(clearTimeout);\n timeoutIdsRef.current.clear();\n };\n }, []);\n\n return { registerTimeout };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAgB,oBAA6C;CAC3D,MAAM,gBAAgB,uBAA4B,IAAI,KAAK,CAAC;CAE5D,MAAM,mBAAmB,cAA8B;AACrD,gBAAc,QAAQ,IAAI,UAAU;;AAGtC,iBAAgB;AACd,eAAa;AACX,iBAAc,QAAQ,QAAQ,aAAa;AAC3C,iBAAc,QAAQ,OAAO;;IAE9B,EAAE,CAAC;AAEN,QAAO,EAAE,iBAAiB"}
1
+ {"version":3,"file":"use-timeout-cleanup.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-timeout-cleanup.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useRef } from 'react';\n\n/** Return value from the useTimeoutCleanup hook */\nexport interface UseTimeoutCleanupResult {\n /** Register a timeout for automatic cleanup on unmount */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n}\n\n/**\n * Registers timeouts for automatic cleanup on component unmount\n *\n * @example\n * ```tsx\n * function ComponentWithTimeouts() {\n * const { registerTimeout } = useTimeoutCleanup();\n * const [message, setMessage] = useState('');\n *\n * const handleClick = () => {\n * setMessage('Saving...');\n *\n * registerTimeout(\n * setTimeout(() => {\n * setMessage('Saved!');\n * }, 1000)\n * );\n * };\n *\n * return (\n * <div>\n * <Button onPress={handleClick}>Save</Button>\n * <span>{message}</span>\n * </div>\n * );\n * }\n * ```\n *\n * @returns {@link UseTimeoutCleanupResult} Timeout registration function.\n */\nexport function useTimeoutCleanup(): UseTimeoutCleanupResult {\n const timeoutIdsRef = useRef<Set<NodeJS.Timeout>>(new Set());\n\n const registerTimeout = (timeoutId: NodeJS.Timeout) => {\n timeoutIdsRef.current.add(timeoutId);\n };\n\n useEffect(() => {\n return () => {\n timeoutIdsRef.current.forEach(clearTimeout);\n timeoutIdsRef.current.clear();\n };\n }, []);\n\n return { registerTimeout };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAgB,oBAA6C;CAC3D,MAAM,gBAAgB,uBAA4B,IAAI,KAAK,CAAC;CAE5D,MAAM,mBAAmB,cAA8B;AACrD,gBAAc,QAAQ,IAAI,UAAU;;AAGtC,iBAAgB;AACd,eAAa;AACX,iBAAc,QAAQ,QAAQ,aAAa;AAC3C,iBAAc,QAAQ,OAAO;;IAE9B,EAAE,CAAC;AAEN,QAAO,EAAE,iBAAiB"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["closestEdge: 'top' | 'bottom' | undefined"],"sources":["../../../src/hooks/kanban/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useDndContext, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { calculateClosestEdge } from '@/components/kanban/context';\nimport type {\n KanbanCardData,\n KanbanColumnData,\n} from '@/components/kanban/types';\n\n/**\n * Hook that provides drag-and-drop interactions for a kanban column.\n *\n * This hook integrates with `@dnd-kit/core` to enable dropping cards into columns.\n * It tracks hover states, validates drop targets based on the column's `canDrop` property,\n * and provides visual feedback states for both the column itself and cards within it.\n *\n * @param column - The kanban column data object containing the column's id, canDrop status, and other properties\n *\n * @returns An object containing:\n * - `ref` - Ref callback to attach to the droppable column DOM element\n * - `isHighlighted` - Boolean indicating if the column should be visually highlighted (when a card from another column is being dragged)\n * - `isActive` - Boolean indicating if the column is actively being hovered over and can accept the drop\n *\n * @example\n * ```tsx\n * function KanbanColumn({ column }: { column: KanbanColumnData }) {\n * const { ref, isHighlighted, isActive } = useColumnInteractions(column);\n *\n * return (\n * <div\n * ref={ref}\n * className={cn({\n * 'ring-2 ring-blue-300': isHighlighted && !isActive, // Potential drop target\n * 'ring-2 ring-blue-500 bg-blue-50': isActive, // Active drop target\n * })}\n * >\n * <h2>{column.title}</h2>\n * {column.cards.map(card => <Card key={card.id} card={card} />)}\n * </div>\n * );\n * }\n * ```\n */\nexport function useColumnInteractions(column: KanbanColumnData) {\n const { setNodeRef, isOver, active } = useDroppable({\n id: column.id,\n data: column,\n });\n\n // Get the global over state to detect when hovering over cards in this column\n const { over } = useDndContext();\n\n // Check if we're over the column itself OR over a card that belongs to this column\n const isOverColumn = isOver || over?.data?.current?.columnId === column.id;\n\n const isHighlighted = Boolean(\n isOverColumn ||\n (active &&\n active.data.current?.columnId !== column.id &&\n column.canDrop !== false),\n );\n\n const isActive = isOverColumn && column.canDrop !== false;\n\n return {\n ref: setNodeRef,\n isHighlighted,\n isActive,\n };\n}\n\n/**\n * Hook that provides drag-and-drop interactions for a kanban card.\n *\n * This hook integrates with `@dnd-kit/sortable` to enable dragging, dropping, and reordering\n * of cards within and between columns. It handles transform animations, drag state tracking,\n * and edge detection for insertion positioning.\n *\n * @param card - The kanban card data object containing the card's id and other properties\n *\n * @returns An object containing:\n * - `ref` - Ref callback to attach to the draggable card DOM element\n * - `isDragging` - Boolean indicating if this card is currently being dragged\n * - `closestEdge` - The closest edge ('top' or 'bottom') when another card is hovering over this card, or null if not hovering\n * - `style` - CSS style object with transform and transition properties for drag animations\n * - `attributes` - Accessibility and drag attributes to spread on the card element\n * - `listeners` - Event listeners to spread on the drag handle element\n *\n * @example\n * ```tsx\n * function KanbanCard({ card }: { card: KanbanCardData }) {\n * const { ref, isDragging, closestEdge, style, attributes, listeners } = useCardInteractions(card);\n *\n * return (\n * <div ref={ref} style={style} {...attributes} {...listeners}>\n * {card.title}\n * {closestEdge && <DropIndicator edge={closestEdge} />}\n * </div>\n * );\n * }\n * ```\n */\nexport function useCardInteractions(card: KanbanCardData) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n over,\n active,\n } = useSortable({\n id: card.id,\n data: card,\n });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n // Determine closest edge based on over position\n let closestEdge: 'top' | 'bottom' | undefined;\n\n if (over && over.id === card.id && active) {\n closestEdge = calculateClosestEdge(over, active);\n }\n\n return {\n ref: setNodeRef,\n isDragging,\n closestEdge,\n style,\n attributes,\n listeners,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,sBAAsB,QAA0B;CAC9D,MAAM,EAAE,YAAY,QAAQ,WAAW,aAAa;EAClD,IAAI,OAAO;EACX,MAAM;EACP,CAAC;CAGF,MAAM,EAAE,SAAS,eAAe;CAGhC,MAAM,eAAe,UAAU,MAAM,MAAM,SAAS,aAAa,OAAO;AAWxE,QAAO;EACL,KAAK;EACL,eAXoB,QACpB,gBACG,UACC,OAAO,KAAK,SAAS,aAAa,OAAO,MACzC,OAAO,YAAY,MACxB;EAOC,UALe,gBAAgB,OAAO,YAAY;EAMnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCH,SAAgB,oBAAoB,MAAsB;CACxD,MAAM,EACJ,YACA,WACA,YACA,WACA,YACA,YACA,MACA,WACE,YAAY;EACd,IAAI,KAAK;EACT,MAAM;EACP,CAAC;CAEF,MAAM,QAAQ;EACZ,WAAW,IAAI,UAAU,SAAS,UAAU;EAC5C;EACD;CAGD,IAAIA;AAEJ,KAAI,QAAQ,KAAK,OAAO,KAAK,MAAM,OACjC,eAAc,qBAAqB,MAAM,OAAO;AAGlD,QAAO;EACL,KAAK;EACL;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"index.js","names":["closestEdge: 'top' | 'bottom' | undefined"],"sources":["../../../src/hooks/kanban/index.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useDndContext, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { calculateClosestEdge } from '@/components/kanban/context';\nimport type {\n KanbanCardData,\n KanbanColumnData,\n} from '@/components/kanban/types';\n\n/**\n * Hook that provides drag-and-drop interactions for a kanban column.\n *\n * This hook integrates with `@dnd-kit/core` to enable dropping cards into columns.\n * It tracks hover states, validates drop targets based on the column's `canDrop` property,\n * and provides visual feedback states for both the column itself and cards within it.\n *\n * @param column - The kanban column data object containing the column's id, canDrop status, and other properties\n *\n * @returns An object containing:\n * - `ref` - Ref callback to attach to the droppable column DOM element\n * - `isHighlighted` - Boolean indicating if the column should be visually highlighted (when a card from another column is being dragged)\n * - `isActive` - Boolean indicating if the column is actively being hovered over and can accept the drop\n *\n * @example\n * ```tsx\n * function KanbanColumn({ column }: { column: KanbanColumnData }) {\n * const { ref, isHighlighted, isActive } = useColumnInteractions(column);\n *\n * return (\n * <div\n * ref={ref}\n * className={cn({\n * 'ring-2 ring-blue-300': isHighlighted && !isActive, // Potential drop target\n * 'ring-2 ring-blue-500 bg-blue-50': isActive, // Active drop target\n * })}\n * >\n * <h2>{column.title}</h2>\n * {column.cards.map(card => <Card key={card.id} card={card} />)}\n * </div>\n * );\n * }\n * ```\n */\nexport function useColumnInteractions(column: KanbanColumnData) {\n const { setNodeRef, isOver, active } = useDroppable({\n id: column.id,\n data: column,\n });\n\n // Get the global over state to detect when hovering over cards in this column\n const { over } = useDndContext();\n\n // Check if we're over the column itself OR over a card that belongs to this column\n const isOverColumn = isOver || over?.data?.current?.columnId === column.id;\n\n const isHighlighted = Boolean(\n isOverColumn ||\n (active &&\n active.data.current?.columnId !== column.id &&\n column.canDrop !== false),\n );\n\n const isActive = isOverColumn && column.canDrop !== false;\n\n return {\n ref: setNodeRef,\n isHighlighted,\n isActive,\n };\n}\n\n/**\n * Hook that provides drag-and-drop interactions for a kanban card.\n *\n * This hook integrates with `@dnd-kit/sortable` to enable dragging, dropping, and reordering\n * of cards within and between columns. It handles transform animations, drag state tracking,\n * and edge detection for insertion positioning.\n *\n * @param card - The kanban card data object containing the card's id and other properties\n *\n * @returns An object containing:\n * - `ref` - Ref callback to attach to the draggable card DOM element\n * - `isDragging` - Boolean indicating if this card is currently being dragged\n * - `closestEdge` - The closest edge ('top' or 'bottom') when another card is hovering over this card, or null if not hovering\n * - `style` - CSS style object with transform and transition properties for drag animations\n * - `attributes` - Accessibility and drag attributes to spread on the card element\n * - `listeners` - Event listeners to spread on the drag handle element\n *\n * @example\n * ```tsx\n * function KanbanCard({ card }: { card: KanbanCardData }) {\n * const { ref, isDragging, closestEdge, style, attributes, listeners } = useCardInteractions(card);\n *\n * return (\n * <div ref={ref} style={style} {...attributes} {...listeners}>\n * {card.title}\n * {closestEdge && <DropIndicator edge={closestEdge} />}\n * </div>\n * );\n * }\n * ```\n */\nexport function useCardInteractions(card: KanbanCardData) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n over,\n active,\n } = useSortable({\n id: card.id,\n data: card,\n });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n // Determine closest edge based on over position\n let closestEdge: 'top' | 'bottom' | undefined;\n\n if (over && over.id === card.id && active) {\n closestEdge = calculateClosestEdge(over, active);\n }\n\n return {\n ref: setNodeRef,\n isDragging,\n closestEdge,\n style,\n attributes,\n listeners,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,sBAAsB,QAA0B;CAC9D,MAAM,EAAE,YAAY,QAAQ,WAAW,aAAa;EAClD,IAAI,OAAO;EACX,MAAM;EACP,CAAC;CAGF,MAAM,EAAE,SAAS,eAAe;CAGhC,MAAM,eAAe,UAAU,MAAM,MAAM,SAAS,aAAa,OAAO;AAWxE,QAAO;EACL,KAAK;EACL,eAXoB,QACpB,gBACG,UACC,OAAO,KAAK,SAAS,aAAa,OAAO,MACzC,OAAO,YAAY,MACxB;EAOC,UALe,gBAAgB,OAAO,YAAY;EAMnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCH,SAAgB,oBAAoB,MAAsB;CACxD,MAAM,EACJ,YACA,WACA,YACA,WACA,YACA,YACA,MACA,WACE,YAAY;EACd,IAAI,KAAK;EACT,MAAM;EACP,CAAC;CAEF,MAAM,QAAQ;EACZ,WAAW,IAAI,UAAU,SAAS,UAAU;EAC5C;EACD;CAGD,IAAIA;AAEJ,KAAI,QAAQ,KAAK,OAAO,KAAK,MAAM,OACjC,eAAc,qBAAqB,MAAM,OAAO;AAGlD,QAAO;EACL,KAAK;EACL;EACA;EACA;EACA;EACA;EACD"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["animationId: number"],"sources":["../../../src/hooks/use-frame-delay/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useState } from 'react';\n\nexport interface UseFrameDelayOptions {\n /** Number of animation frames to wait (default: 2) */\n frames?: number;\n /** Callback fired when delay completes */\n onReady?: () => void;\n}\n\nexport interface UseFrameDelayResult {\n /** Whether the delay has completed */\n isReady: boolean;\n}\n\n/**\n * Delays execution by a specified number of animation frames.\n *\n * Useful for deferring expensive renders to allow the browser to paint\n * a loading state first.\n *\n * @param options - {@link UseFrameDelayOptions}\n * @param options.frames - Number of animation frames to wait (default: 2).\n * @param options.onReady - Callback fired when delay completes.\n * @returns {@link UseFrameDelayResult} Object with isReady boolean.\n *\n * @example\n * ```tsx\n * // Pattern 1: Reactive\n * function DeferredContent() {\n * const { isReady } = useFrameDelay();\n * if (!isReady) return <Fallback />;\n * return <ExpensiveContent />;\n * }\n *\n * // Pattern 2: Callback\n * function WithCallback() {\n * const [loaded, setLoaded] = useState(false);\n * useFrameDelay({ onReady: () => setLoaded(true) });\n * return loaded ? <Content /> : <Loading />;\n * }\n * ```\n */\nexport function useFrameDelay(\n options: UseFrameDelayOptions = {},\n): UseFrameDelayResult {\n const { frames = 2, onReady } = options;\n const [isReady, setIsReady] = useState(false);\n\n useEffect(() => {\n let frameCount = 0;\n let animationId: number;\n\n const tick = () => {\n frameCount++;\n if (frameCount >= frames) {\n setIsReady(true);\n onReady?.();\n } else {\n animationId = requestAnimationFrame(tick);\n }\n };\n\n animationId = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(animationId);\n }, [frames, onReady]);\n\n return { isReady };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,cACd,UAAgC,EAAE,EACb;CACrB,MAAM,EAAE,SAAS,GAAG,YAAY;CAChC,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;AAE7C,iBAAgB;EACd,IAAI,aAAa;EACjB,IAAIA;EAEJ,MAAM,aAAa;AACjB;AACA,OAAI,cAAc,QAAQ;AACxB,eAAW,KAAK;AAChB,eAAW;SAEX,eAAc,sBAAsB,KAAK;;AAI7C,gBAAc,sBAAsB,KAAK;AACzC,eAAa,qBAAqB,YAAY;IAC7C,CAAC,QAAQ,QAAQ,CAAC;AAErB,QAAO,EAAE,SAAS"}
1
+ {"version":3,"file":"index.js","names":["animationId: number"],"sources":["../../../src/hooks/use-frame-delay/index.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useState } from 'react';\n\nexport interface UseFrameDelayOptions {\n /** Number of animation frames to wait (default: 2) */\n frames?: number;\n /** Callback fired when delay completes */\n onReady?: () => void;\n}\n\nexport interface UseFrameDelayResult {\n /** Whether the delay has completed */\n isReady: boolean;\n}\n\n/**\n * Delays execution by a specified number of animation frames.\n *\n * Useful for deferring expensive renders to allow the browser to paint\n * a loading state first.\n *\n * @param options - {@link UseFrameDelayOptions}\n * @param options.frames - Number of animation frames to wait (default: 2).\n * @param options.onReady - Callback fired when delay completes.\n * @returns {@link UseFrameDelayResult} Object with isReady boolean.\n *\n * @example\n * ```tsx\n * // Pattern 1: Reactive\n * function DeferredContent() {\n * const { isReady } = useFrameDelay();\n * if (!isReady) return <Fallback />;\n * return <ExpensiveContent />;\n * }\n *\n * // Pattern 2: Callback\n * function WithCallback() {\n * const [loaded, setLoaded] = useState(false);\n * useFrameDelay({ onReady: () => setLoaded(true) });\n * return loaded ? <Content /> : <Loading />;\n * }\n * ```\n */\nexport function useFrameDelay(\n options: UseFrameDelayOptions = {},\n): UseFrameDelayResult {\n const { frames = 2, onReady } = options;\n const [isReady, setIsReady] = useState(false);\n\n useEffect(() => {\n let frameCount = 0;\n let animationId: number;\n\n const tick = () => {\n frameCount++;\n if (frameCount >= frames) {\n setIsReady(true);\n onReady?.();\n } else {\n animationId = requestAnimationFrame(tick);\n }\n };\n\n animationId = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(animationId);\n }, [frames, onReady]);\n\n return { isReady };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,cACd,UAAgC,EAAE,EACb;CACrB,MAAM,EAAE,SAAS,GAAG,YAAY;CAChC,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;AAE7C,iBAAgB;EACd,IAAI,aAAa;EACjB,IAAIA;EAEJ,MAAM,aAAa;AACjB;AACA,OAAI,cAAc,QAAQ;AACxB,eAAW,KAAK;AAChB,eAAW;SAEX,eAAc,sBAAsB,KAAK;;AAI7C,gBAAc,sBAAsB,KAAK;AACzC,eAAa,qBAAqB,YAAY;IAC7C,CAAC,QAAQ,QAAQ,CAAC;AAErB,QAAO,EAAE,SAAS"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"cache.js","names":["index: number","parentKey: Key | null","key"],"sources":["../../../../src/hooks/use-tree/actions/cache.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { Key } from '@react-types/shared';\nimport type { TreeNode } from '../types';\n\ntype CacheTreeNode<T> = Omit<TreeNode<T>, 'children'> & {\n children?: Key[];\n};\n\n/**\n * This is a cache created only for performance reasons and is considered\n * to be only a temporary mirror of the data. The data is *always* correct\n * cache should be updated according to the data, only. If the data and\n * the cache do not match, the cache is invalidated and rebuilt.\n *\n * This will initialize once on load with data, then\n * updated with each tree operation.\n */\nexport class Cache<T> {\n protected cache: { lookup: Map<Key, CacheTreeNode<T>>; roots: Key[] } = {\n lookup: new Map(),\n roots: [],\n };\n\n constructor(nodes: TreeNode<T>[] = []) {\n this.rebuild(nodes);\n }\n\n /**\n * Recursively creates the cache object from tree data\n */\n rebuild(\n nodes: TreeNode<T>[],\n lookup: Map<Key, CacheTreeNode<T>> = new Map(),\n parentKey: Key | null = null,\n ) {\n nodes.forEach((node) => {\n const { children, ...rest } = node;\n\n lookup.set(node.key, {\n isDisabled: false,\n isExpanded: false,\n isSelected: false,\n isVisible: false,\n isVisibleComputed: false,\n ...rest,\n parentKey,\n ...(children ? { children: children.map((child) => child.key) } : {}),\n });\n\n if (node.children) {\n this.rebuild(node.children, lookup, node.key);\n }\n });\n\n const cache = { lookup, roots: nodes.map((node) => node.key) };\n\n if (!parentKey) {\n this.cache = cache;\n }\n\n this.deriveVisibility();\n return cache;\n }\n\n protected get(key: Key) {\n const node = this.cache.lookup.get(key);\n\n if (node === undefined) {\n throw new Error(`Key of ${key} does not exist in tree`);\n }\n\n return node;\n }\n\n protected set(key: Key, node: CacheTreeNode<T>) {\n this.cache.lookup.set(key, node);\n }\n\n protected delete(key: Key) {\n this.cache.lookup.delete(key);\n }\n\n protected addToParent(parentKey: Key, childKey: Key, idx: number) {\n const parent = this.get(parentKey);\n const child = this.get(childKey);\n const index = Math.max(0, idx);\n\n this.set(childKey, {\n ...child,\n parentKey,\n });\n\n const children = (parent.children ?? []).slice(0);\n\n children.splice(index, 0, childKey);\n\n this.set(parentKey, {\n ...parent,\n children,\n });\n }\n\n protected addToRoot(key: Key, idx: number) {\n const node = this.get(key);\n const index = Math.max(0, idx);\n\n this.set(key, {\n ...node,\n parentKey: null,\n });\n\n this.cache.roots.splice(index, 0, key);\n }\n\n protected removeFromParent(parentKey: Key, childKey: Key) {\n const parent = this.get(parentKey);\n const child = this.get(childKey);\n\n this.set(childKey, {\n ...child,\n parentKey: null,\n });\n\n this.cache.lookup.set(parentKey, {\n ...parent,\n children: parent.children?.filter((key) => key !== childKey),\n });\n }\n\n protected removeFromRoot(key: Key) {\n const node = this.get(key);\n const idx = this.cache.roots.indexOf(key);\n\n if (idx >= 0) {\n this.set(key, {\n ...node,\n parentKey: null,\n });\n\n this.cache.roots.splice(idx, 1);\n }\n }\n\n protected parentOrSibling(target: Key | null, position: 'before' | 'after') {\n let index: number;\n let parentKey: Key | null = null;\n\n if (target === null) {\n index = position === 'before' ? 0 : this.cache.roots.length;\n } else {\n const targetNode = this.get(target);\n\n if (targetNode.parentKey) {\n const parent = this.get(targetNode.parentKey);\n\n parentKey = parent.key;\n index = parent.children?.indexOf(target) ?? 0;\n } else {\n index = this.cache.roots.indexOf(target);\n }\n }\n\n return { parentKey, index };\n }\n\n protected traverse(key: Key) {\n const node = this.get(key);\n\n this.cache.lookup.set(key, {\n ...node,\n isVisibleComputed: this.calculateVisibility(key),\n });\n\n node.children?.map((child) => this.traverse(child));\n }\n\n protected calculateVisibility(key: Key) {\n let current = this.get(key);\n const ancestry = [current];\n\n while (current.parentKey) {\n const parent = this.get(current.parentKey);\n if (parent) {\n ancestry.push(parent);\n }\n current = parent;\n }\n\n return ancestry.every((n) => n.isVisible);\n }\n\n protected deriveVisibility() {\n return this.cache.roots.map((key) => this.traverse(key));\n }\n /**\n * Recursively builds a TreeNode from a key\n *\n * @param key\n */\n protected buildNode(key: Key): TreeNode<T> {\n const node = this.get(key);\n\n const children = (node.children ?? []).reduce(\n (acc: TreeNode<T>[], child) => {\n const childNode = this.cache.lookup.get(child);\n\n if (childNode && childNode.parentKey === key) {\n acc.push(this.buildNode(child));\n }\n\n return acc;\n },\n [],\n );\n\n return {\n ...node,\n children,\n };\n }\n\n /**\n * Builds a tree structure from cache\n *\n * TODO: optimization - rebuild only from change to root\n * Rebuild only from the changed node up the tree to avoid\n * rebuilding the entire tree\n *\n * @param deriveVisible boolean - if true, will recompute visibility for nodes based on ancestry\n */\n toTree(deriveVisible?: boolean): TreeNode<T>[] {\n if (deriveVisible) {\n this.deriveVisibility();\n }\n return this.cache.roots.map((key) => this.buildNode(key));\n }\n\n /**\n * CACHE FUNCTIONS\n * These manage cache operations. No cache operations should ever be done\n * outside this file.\n **/\n getNode(key: Key): TreeNode<T> {\n const node = this.get(key);\n\n return {\n ...node,\n children: node.children?.map((key) => this.buildNode(key)),\n };\n }\n\n getAllKeys() {\n return this.cache.lookup.keys();\n }\n\n getAllNodes() {\n return this.cache.lookup.values();\n }\n\n setNode(key: Key, node: TreeNode<T>) {\n this.set(key, {\n ...node,\n children: (node.children ?? []).map((child) => child.key),\n });\n }\n\n setAllNodes({ parentKey, children, ...rest }: Partial<TreeNode<T>>) {\n for (const node of this.cache.lookup.values()) {\n this.set(node.key, {\n ...node,\n ...rest,\n });\n }\n }\n\n deleteNode(key: Key) {\n const node = this.cache.lookup.get(key);\n\n if (!node) {\n return;\n }\n\n // remove children\n node.children?.map((key) => this.deleteNode(key));\n\n // remove node from previous parent or root\n node.parentKey\n ? this.removeFromParent(node.parentKey, key)\n : this.removeFromRoot(key);\n\n // remove the actual node\n this.delete(key);\n }\n\n addNodes(\n target: Key | null,\n nodes: TreeNode<T>[],\n position: 'before' | 'after',\n ) {\n const { parentKey, index } = this.parentOrSibling(target, position);\n const idx = index + (position === 'before' ? 0 : 1);\n\n nodes.map((node, i) => this.insertNode(parentKey, node, idx + i));\n }\n\n insertNode(parentKey: Key | null, node: TreeNode<T>, idx: number) {\n const { children, ...rest } = node;\n\n this.set(node.key, {\n isDisabled: false,\n isExpanded: false,\n isSelected: false,\n isVisible: false,\n isVisibleComputed: false,\n ...rest,\n parentKey,\n ...(children ? { children: children.map((child) => child.key) } : {}),\n });\n\n node.children?.map((child, i) => this.insertNode(node.key, child, i));\n\n parentKey === null\n ? this.addToRoot(node.key, idx)\n : this.addToParent(parentKey, node.key, idx);\n }\n\n moveNodes(target: Key | null, nodes: Set<Key>, position: 'before' | 'after') {\n const { parentKey, index } = this.parentOrSibling(target, position);\n const idx = index + (position === 'before' ? 0 : 1);\n\n Array.from(nodes).map((key, i) => this.moveNode(parentKey, key, idx + i));\n }\n\n moveNode(parentKey: Key | null, key: Key, idx: number) {\n const node = this.get(key);\n\n // remove from previous parent\n node.parentKey\n ? this.removeFromParent(node.parentKey, key)\n : this.removeFromRoot(key);\n\n // add as child to new parent or root at position\n parentKey\n ? this.addToParent(parentKey, key, idx)\n : this.addToRoot(key, idx);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,QAAb,MAAsB;CACpB,AAAU,QAA8D;EACtE,wBAAQ,IAAI,KAAK;EACjB,OAAO,EAAE;EACV;CAED,YAAY,QAAuB,EAAE,EAAE;AACrC,OAAK,QAAQ,MAAM;;;;;CAMrB,QACE,OACA,yBAAqC,IAAI,KAAK,EAC9C,YAAwB,MACxB;AACA,QAAM,SAAS,SAAS;GACtB,MAAM,EAAE,UAAU,GAAG,SAAS;AAE9B,UAAO,IAAI,KAAK,KAAK;IACnB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,GAAG;IACH;IACA,GAAI,WAAW,EAAE,UAAU,SAAS,KAAK,UAAU,MAAM,IAAI,EAAE,GAAG,EAAE;IACrE,CAAC;AAEF,OAAI,KAAK,SACP,MAAK,QAAQ,KAAK,UAAU,QAAQ,KAAK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sourcesContent":["// __private-exports\n/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { Key } from '@react-types/shared';\nimport type { TreeNode } from '../types';\n\ntype CacheTreeNode<T> = Omit<TreeNode<T>, 'children'> & {\n children?: Key[];\n};\n\n/**\n * This is a cache created only for performance reasons and is considered\n * to be only a temporary mirror of the data. The data is *always* correct\n * cache should be updated according to the data, only. If the data and\n * the cache do not match, the cache is invalidated and rebuilt.\n *\n * This will initialize once on load with data, then\n * updated with each tree operation.\n */\nexport class Cache<T> {\n protected cache: { lookup: Map<Key, CacheTreeNode<T>>; roots: Key[] } = {\n lookup: new Map(),\n roots: [],\n };\n\n constructor(nodes: TreeNode<T>[] = []) {\n this.rebuild(nodes);\n }\n\n /**\n * Recursively creates the cache object from tree data\n */\n rebuild(\n nodes: TreeNode<T>[],\n lookup: Map<Key, CacheTreeNode<T>> = new Map(),\n parentKey: Key | null = null,\n ) {\n nodes.forEach((node) => {\n const { children, ...rest } = node;\n\n lookup.set(node.key, {\n isDisabled: false,\n isExpanded: false,\n isSelected: false,\n isVisible: false,\n isVisibleComputed: false,\n ...rest,\n parentKey,\n ...(children ? { children: children.map((child) => child.key) } : {}),\n });\n\n if (node.children) {\n this.rebuild(node.children, lookup, node.key);\n }\n });\n\n const cache = { lookup, roots: nodes.map((node) => node.key) };\n\n if (!parentKey) {\n this.cache = cache;\n }\n\n this.deriveVisibility();\n return cache;\n }\n\n protected get(key: Key) {\n const node = this.cache.lookup.get(key);\n\n if (node === undefined) {\n throw new Error(`Key of ${key} does not exist in tree`);\n }\n\n return node;\n }\n\n protected set(key: Key, node: CacheTreeNode<T>) {\n this.cache.lookup.set(key, node);\n }\n\n protected delete(key: Key) {\n this.cache.lookup.delete(key);\n }\n\n protected addToParent(parentKey: Key, childKey: Key, idx: number) {\n const parent = this.get(parentKey);\n const child = this.get(childKey);\n const index = Math.max(0, idx);\n\n this.set(childKey, {\n ...child,\n parentKey,\n });\n\n const children = (parent.children ?? []).slice(0);\n\n children.splice(index, 0, childKey);\n\n this.set(parentKey, {\n ...parent,\n children,\n });\n }\n\n protected addToRoot(key: Key, idx: number) {\n const node = this.get(key);\n const index = Math.max(0, idx);\n\n this.set(key, {\n ...node,\n parentKey: null,\n });\n\n this.cache.roots.splice(index, 0, key);\n }\n\n protected removeFromParent(parentKey: Key, childKey: Key) {\n const parent = this.get(parentKey);\n const child = this.get(childKey);\n\n this.set(childKey, {\n ...child,\n parentKey: null,\n });\n\n this.cache.lookup.set(parentKey, {\n ...parent,\n children: parent.children?.filter((key) => key !== childKey),\n });\n }\n\n protected removeFromRoot(key: Key) {\n const node = this.get(key);\n const idx = this.cache.roots.indexOf(key);\n\n if (idx >= 0) {\n this.set(key, {\n ...node,\n parentKey: null,\n });\n\n this.cache.roots.splice(idx, 1);\n }\n }\n\n protected parentOrSibling(target: Key | null, position: 'before' | 'after') {\n let index: number;\n let parentKey: Key | null = null;\n\n if (target === null) {\n index = position === 'before' ? 0 : this.cache.roots.length;\n } else {\n const targetNode = this.get(target);\n\n if (targetNode.parentKey) {\n const parent = this.get(targetNode.parentKey);\n\n parentKey = parent.key;\n index = parent.children?.indexOf(target) ?? 0;\n } else {\n index = this.cache.roots.indexOf(target);\n }\n }\n\n return { parentKey, index };\n }\n\n protected traverse(key: Key) {\n const node = this.get(key);\n\n this.cache.lookup.set(key, {\n ...node,\n isVisibleComputed: this.calculateVisibility(key),\n });\n\n node.children?.map((child) => this.traverse(child));\n }\n\n protected calculateVisibility(key: Key) {\n let current = this.get(key);\n const ancestry = [current];\n\n while (current.parentKey) {\n const parent = this.get(current.parentKey);\n if (parent) {\n ancestry.push(parent);\n }\n current = parent;\n }\n\n return ancestry.every((n) => n.isVisible);\n }\n\n protected deriveVisibility() {\n return this.cache.roots.map((key) => this.traverse(key));\n }\n /**\n * Recursively builds a TreeNode from a key\n *\n * @param key\n */\n protected buildNode(key: Key): TreeNode<T> {\n const node = this.get(key);\n\n const children = (node.children ?? []).reduce(\n (acc: TreeNode<T>[], child) => {\n const childNode = this.cache.lookup.get(child);\n\n if (childNode && childNode.parentKey === key) {\n acc.push(this.buildNode(child));\n }\n\n return acc;\n },\n [],\n );\n\n return {\n ...node,\n children,\n };\n }\n\n /**\n * Builds a tree structure from cache\n *\n * TODO: optimization - rebuild only from change to root\n * Rebuild only from the changed node up the tree to avoid\n * rebuilding the entire tree\n *\n * @param deriveVisible boolean - if true, will recompute visibility for nodes based on ancestry\n */\n toTree(deriveVisible?: boolean): TreeNode<T>[] {\n if (deriveVisible) {\n this.deriveVisibility();\n }\n return this.cache.roots.map((key) => this.buildNode(key));\n }\n\n /**\n * CACHE FUNCTIONS\n * These manage cache operations. No cache operations should ever be done\n * outside this file.\n **/\n getNode(key: Key): TreeNode<T> {\n const node = this.get(key);\n\n return {\n ...node,\n children: node.children?.map((key) => this.buildNode(key)),\n };\n }\n\n getAllKeys() {\n return this.cache.lookup.keys();\n }\n\n getAllNodes() {\n return this.cache.lookup.values();\n }\n\n setNode(key: Key, node: TreeNode<T>) {\n this.set(key, {\n ...node,\n children: (node.children ?? []).map((child) => child.key),\n });\n }\n\n setAllNodes({ parentKey, children, ...rest }: Partial<TreeNode<T>>) {\n for (const node of this.cache.lookup.values()) {\n this.set(node.key, {\n ...node,\n ...rest,\n });\n }\n }\n\n deleteNode(key: Key) {\n const node = this.cache.lookup.get(key);\n\n if (!node) {\n return;\n }\n\n // remove children\n node.children?.map((key) => this.deleteNode(key));\n\n // remove node from previous parent or root\n node.parentKey\n ? this.removeFromParent(node.parentKey, key)\n : this.removeFromRoot(key);\n\n // remove the actual node\n this.delete(key);\n }\n\n addNodes(\n target: Key | null,\n nodes: TreeNode<T>[],\n position: 'before' | 'after',\n ) {\n const { parentKey, index } = this.parentOrSibling(target, position);\n const idx = index + (position === 'before' ? 0 : 1);\n\n nodes.map((node, i) => this.insertNode(parentKey, node, idx + i));\n }\n\n insertNode(parentKey: Key | null, node: TreeNode<T>, idx: number) {\n const { children, ...rest } = node;\n\n this.set(node.key, {\n isDisabled: false,\n isExpanded: false,\n isSelected: false,\n isVisible: false,\n isVisibleComputed: false,\n ...rest,\n parentKey,\n ...(children ? { children: children.map((child) => child.key) } : {}),\n });\n\n node.children?.map((child, i) => this.insertNode(node.key, child, i));\n\n parentKey === null\n ? this.addToRoot(node.key, idx)\n : this.addToParent(parentKey, node.key, idx);\n }\n\n moveNodes(target: Key | null, nodes: Set<Key>, position: 'before' | 'after') {\n const { parentKey, index } = this.parentOrSibling(target, position);\n const idx = index + (position === 'before' ? 0 : 1);\n\n Array.from(nodes).map((key, i) => this.moveNode(parentKey, key, idx + i));\n }\n\n moveNode(parentKey: Key | null, key: Key, idx: number) {\n const node = this.get(key);\n\n // remove from previous parent\n node.parentKey\n ? this.removeFromParent(node.parentKey, key)\n : this.removeFromRoot(key);\n\n // add as child to new parent or root at position\n parentKey\n ? this.addToParent(parentKey, key, idx)\n : this.addToRoot(key, idx);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,QAAb,MAAsB;CACpB,AAAU,QAA8D;EACtE,wBAAQ,IAAI,KAAK;EACjB,OAAO,EAAE;EACV;CAED,YAAY,QAAuB,EAAE,EAAE;AACrC,OAAK,QAAQ,MAAM;;;;;CAMrB,QACE,OACA,yBAAqC,IAAI,KAAK,EAC9C,YAAwB,MACxB;AACA,QAAM,SAAS,SAAS;GACtB,MAAM,EAAE,UAAU,GAAG,SAAS;AAE9B,UAAO,IAAI,KAAK,KAAK;IACnB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,mBAAm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Ae,IAAI;AAG5B,cACI,KAAK,YAAY,WAAW,KAAK,IAAI,GACrC,KAAK,UAAU,KAAK,IAAI"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
2
+ * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at https://www.apache.org/licenses/LICENSE-2.0