@primereact/headless 11.0.0-alpha.9 → 11.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (592) hide show
  1. package/LICENSE.md +45 -0
  2. package/README.md +35 -0
  3. package/accordion/index.d.ts +3 -0
  4. package/accordion/index.mjs +1 -1
  5. package/accordion/index.mjs.map +1 -1
  6. package/accordion/useAccordion.d.ts +7 -6
  7. package/accordion/useAccordion.props.d.ts +2 -2
  8. package/accordion/useAccordionPanel.d.ts +46 -0
  9. package/accordion/useAccordionPanel.props.d.ts +2 -0
  10. package/animateonscroll/index.d.ts +1 -0
  11. package/animateonscroll/index.mjs +1 -1
  12. package/animateonscroll/index.mjs.map +1 -1
  13. package/animateonscroll/useAnimateOnScroll.d.ts +6 -1
  14. package/animateonscroll/useAnimateOnScroll.props.d.ts +2 -2
  15. package/autocomplete/index.d.ts +3 -0
  16. package/autocomplete/index.mjs +2 -0
  17. package/autocomplete/index.mjs.map +1 -0
  18. package/autocomplete/useAutoComplete.d.ts +198 -0
  19. package/autocomplete/useAutoComplete.props.d.ts +2 -0
  20. package/avatar/index.d.ts +1 -0
  21. package/avatar/index.mjs +1 -1
  22. package/avatar/index.mjs.map +1 -1
  23. package/avatar/useAvatar.d.ts +5 -1
  24. package/avatar/useAvatar.props.d.ts +2 -2
  25. package/avatargroup/index.d.ts +3 -0
  26. package/avatargroup/index.mjs +2 -0
  27. package/avatargroup/index.mjs.map +1 -0
  28. package/avatargroup/useAvatarGroup.d.ts +6 -0
  29. package/avatargroup/useAvatarGroup.props.d.ts +2 -0
  30. package/badge/index.d.ts +1 -0
  31. package/badge/index.mjs +1 -1
  32. package/badge/index.mjs.map +1 -1
  33. package/badge/useBadge.d.ts +7 -1
  34. package/badge/useBadge.props.d.ts +2 -2
  35. package/breadcrumb/index.d.ts +1 -0
  36. package/breadcrumb/index.mjs +1 -1
  37. package/breadcrumb/index.mjs.map +1 -1
  38. package/breadcrumb/useBreadcrumb.d.ts +18 -2
  39. package/breadcrumb/useBreadcrumb.props.d.ts +2 -2
  40. package/button/index.d.ts +1 -0
  41. package/button/index.mjs +1 -1
  42. package/button/index.mjs.map +1 -1
  43. package/button/useButton.d.ts +6 -1
  44. package/button/useButton.props.d.ts +2 -2
  45. package/card/index.d.ts +1 -0
  46. package/card/index.mjs +1 -1
  47. package/card/index.mjs.map +1 -1
  48. package/card/useCard.d.ts +6 -1
  49. package/card/useCard.props.d.ts +2 -2
  50. package/carousel/index.d.ts +1 -0
  51. package/carousel/index.mjs +1 -1
  52. package/carousel/index.mjs.map +1 -1
  53. package/carousel/useCarousel.d.ts +101 -5
  54. package/carousel/useCarousel.props.d.ts +2 -2
  55. package/checkbox/index.d.ts +1 -0
  56. package/checkbox/index.mjs +1 -1
  57. package/checkbox/index.mjs.map +1 -1
  58. package/checkbox/useCheckbox.d.ts +44 -3
  59. package/checkbox/useCheckbox.props.d.ts +2 -2
  60. package/checkboxgroup/index.d.ts +3 -0
  61. package/checkboxgroup/index.mjs +2 -0
  62. package/checkboxgroup/index.mjs.map +1 -0
  63. package/checkboxgroup/useCheckboxGroup.d.ts +11 -0
  64. package/checkboxgroup/useCheckboxGroup.props.d.ts +2 -0
  65. package/chip/index.d.ts +1 -0
  66. package/chip/index.mjs +1 -1
  67. package/chip/index.mjs.map +1 -1
  68. package/chip/useChip.d.ts +9 -3
  69. package/chip/useChip.props.d.ts +2 -2
  70. package/collapsible/index.d.ts +3 -0
  71. package/collapsible/index.mjs +2 -0
  72. package/collapsible/index.mjs.map +1 -0
  73. package/collapsible/useCollapsible.d.ts +33 -0
  74. package/collapsible/useCollapsible.props.d.ts +2 -0
  75. package/compare/index.d.ts +3 -0
  76. package/compare/index.mjs +2 -0
  77. package/compare/index.mjs.map +1 -0
  78. package/compare/useCompare.d.ts +2 -0
  79. package/compare/useCompare.props.d.ts +2 -0
  80. package/contextmenu/index.d.ts +1 -0
  81. package/contextmenu/index.mjs +1 -1
  82. package/contextmenu/index.mjs.map +1 -1
  83. package/contextmenu/submenu/index.d.ts +2 -0
  84. package/contextmenu/submenu/index.mjs +2 -0
  85. package/contextmenu/submenu/index.mjs.map +1 -0
  86. package/contextmenu/submenu/useContextMenuSubmenu.d.ts +121 -0
  87. package/contextmenu/submenu/useContextMenuSubmenu.props.d.ts +2 -0
  88. package/contextmenu/useContextMenu.d.ts +413 -1
  89. package/contextmenu/useContextMenu.props.d.ts +2 -2
  90. package/datatable/features/index.d.ts +28 -0
  91. package/datatable/features/index.mjs +11 -0
  92. package/datatable/features/index.mjs.map +1 -0
  93. package/datatable/features/useDataTableColumnReorder.d.ts +52 -0
  94. package/datatable/features/useDataTableColumnResize.d.ts +20 -0
  95. package/datatable/features/useDataTableEditing.d.ts +69 -0
  96. package/datatable/features/useDataTableExpansion.d.ts +32 -0
  97. package/datatable/features/useDataTableExport.d.ts +43 -0
  98. package/datatable/features/useDataTableFilter.d.ts +95 -0
  99. package/datatable/features/useDataTableGrouping.d.ts +11 -0
  100. package/datatable/features/useDataTableKeyboard.d.ts +23 -0
  101. package/datatable/features/useDataTablePagination.d.ts +32 -0
  102. package/datatable/features/useDataTableRowReorder.d.ts +42 -0
  103. package/datatable/features/useDataTableSelection.d.ts +28 -0
  104. package/datatable/features/useDataTableSort.d.ts +51 -0
  105. package/datatable/features/useDataTableTree.d.ts +31 -0
  106. package/datatable/index.d.ts +7 -0
  107. package/datatable/index.mjs +11 -0
  108. package/datatable/index.mjs.map +1 -0
  109. package/datatable/useDataTable.d.ts +237 -0
  110. package/datatable/useDataTable.props.d.ts +2 -0
  111. package/datatable/useDataTableRow.d.ts +30 -0
  112. package/datatable/useDataTableRow.props.d.ts +2 -0
  113. package/datatable/utils/compareValues.d.ts +20 -0
  114. package/datatable/utils/index.d.ts +1 -0
  115. package/datatable/utils/index.mjs +2 -0
  116. package/datatable/utils/index.mjs.map +1 -0
  117. package/dataview/index.d.ts +1 -0
  118. package/dataview/index.mjs +1 -1
  119. package/dataview/index.mjs.map +1 -1
  120. package/dataview/useDataView.d.ts +25 -1
  121. package/dataview/useDataView.props.d.ts +2 -2
  122. package/datepicker/index.d.ts +1 -0
  123. package/datepicker/index.mjs +1 -1
  124. package/datepicker/index.mjs.map +1 -1
  125. package/datepicker/useDatePicker.d.ts +2 -114
  126. package/datepicker/useDatePicker.props.d.ts +2 -2
  127. package/dialog/index.d.ts +1 -0
  128. package/dialog/index.mjs +1 -1
  129. package/dialog/index.mjs.map +1 -1
  130. package/dialog/useDialog.d.ts +274 -24
  131. package/dialog/useDialog.props.d.ts +2 -2
  132. package/divider/index.d.ts +1 -0
  133. package/divider/index.mjs +1 -1
  134. package/divider/index.mjs.map +1 -1
  135. package/divider/useDivider.d.ts +14 -1
  136. package/divider/useDivider.props.d.ts +2 -2
  137. package/dnd/index.d.ts +11 -0
  138. package/dnd/index.mjs +2 -0
  139. package/dnd/index.mjs.map +1 -0
  140. package/dnd/useDnd.d.ts +45 -0
  141. package/dnd/useDnd.props.d.ts +2 -0
  142. package/dnd/useDraggable.d.ts +14 -0
  143. package/dnd/useDraggable.props.d.ts +2 -0
  144. package/dnd/useDroppable.d.ts +11 -0
  145. package/dnd/useDroppable.props.d.ts +2 -0
  146. package/dnd/useSortable.d.ts +11 -0
  147. package/dnd/useSortable.props.d.ts +2 -0
  148. package/dnd/useSortableContainer.d.ts +24 -0
  149. package/dnd/useSortableContainer.props.d.ts +2 -0
  150. package/drawer/index.d.ts +1 -0
  151. package/drawer/index.mjs +1 -1
  152. package/drawer/index.mjs.map +1 -1
  153. package/drawer/useDrawer.d.ts +78 -16
  154. package/drawer/useDrawer.props.d.ts +2 -2
  155. package/fieldset/index.d.ts +1 -0
  156. package/fieldset/index.mjs +1 -1
  157. package/fieldset/index.mjs.map +1 -1
  158. package/fieldset/useFieldset.d.ts +80 -1
  159. package/fieldset/useFieldset.props.d.ts +2 -2
  160. package/fileupload/index.d.ts +1 -0
  161. package/fileupload/index.mjs +1 -1
  162. package/fileupload/index.mjs.map +1 -1
  163. package/fileupload/useFileUpload.d.ts +73 -4
  164. package/fileupload/useFileUpload.props.d.ts +2 -2
  165. package/floatlabel/index.d.ts +3 -0
  166. package/floatlabel/index.mjs +2 -0
  167. package/floatlabel/index.mjs.map +1 -0
  168. package/floatlabel/useFloatLabel.d.ts +6 -0
  169. package/floatlabel/useFloatLabel.props.d.ts +2 -0
  170. package/fluid/index.d.ts +1 -0
  171. package/fluid/index.mjs +1 -1
  172. package/fluid/index.mjs.map +1 -1
  173. package/fluid/useFluid.d.ts +6 -1
  174. package/fluid/useFluid.props.d.ts +2 -2
  175. package/focustrap/index.d.ts +1 -0
  176. package/focustrap/index.mjs +1 -1
  177. package/focustrap/index.mjs.map +1 -1
  178. package/focustrap/useFocusTrap.d.ts +16 -3
  179. package/focustrap/useFocusTrap.props.d.ts +2 -2
  180. package/gallery/index.d.ts +1 -0
  181. package/gallery/index.mjs +1 -1
  182. package/gallery/index.mjs.map +1 -1
  183. package/gallery/item/index.mjs +1 -1
  184. package/gallery/item/index.mjs.map +1 -1
  185. package/gallery/item/useGalleryItem.d.ts +17 -7
  186. package/gallery/item/useGalleryItem.props.d.ts +2 -2
  187. package/gallery/useGallery.d.ts +147 -6
  188. package/gallery/useGallery.props.d.ts +2 -2
  189. package/iconfield/index.d.ts +1 -0
  190. package/iconfield/index.mjs +1 -1
  191. package/iconfield/index.mjs.map +1 -1
  192. package/iconfield/useIconField.d.ts +6 -1
  193. package/iconfield/useIconField.props.d.ts +2 -2
  194. package/iftalabel/index.d.ts +3 -0
  195. package/iftalabel/index.mjs +2 -0
  196. package/iftalabel/index.mjs.map +1 -0
  197. package/iftalabel/useIftaLabel.d.ts +6 -0
  198. package/iftalabel/useIftaLabel.props.d.ts +2 -0
  199. package/inplace/index.d.ts +1 -0
  200. package/inplace/index.mjs +1 -1
  201. package/inplace/index.mjs.map +1 -1
  202. package/inplace/useInplace.d.ts +21 -2
  203. package/inplace/useInplace.props.d.ts +2 -2
  204. package/{colorpicker → inputcolor}/colorManager.d.ts +3 -2
  205. package/inputcolor/index.d.ts +4 -0
  206. package/inputcolor/index.mjs +2 -0
  207. package/inputcolor/index.mjs.map +1 -0
  208. package/inputcolor/useInputColor.d.ts +119 -0
  209. package/inputcolor/useInputColor.props.d.ts +2 -0
  210. package/inputgroup/index.d.ts +1 -0
  211. package/inputgroup/index.mjs +1 -1
  212. package/inputgroup/index.mjs.map +1 -1
  213. package/inputgroup/useInputGroup.d.ts +6 -1
  214. package/inputgroup/useInputGroup.props.d.ts +2 -2
  215. package/inputnumber/index.d.ts +1 -0
  216. package/inputnumber/index.mjs +1 -1
  217. package/inputnumber/index.mjs.map +1 -1
  218. package/inputnumber/useInputNumber.d.ts +55 -17
  219. package/inputnumber/useInputNumber.props.d.ts +2 -2
  220. package/inputotp/index.d.ts +1 -0
  221. package/inputotp/index.mjs +1 -1
  222. package/inputotp/index.mjs.map +1 -1
  223. package/inputotp/useInputOtp.d.ts +25 -6
  224. package/inputotp/useInputOtp.props.d.ts +2 -2
  225. package/inputpassword/index.d.ts +3 -0
  226. package/inputpassword/index.mjs +2 -0
  227. package/inputpassword/index.mjs.map +1 -0
  228. package/inputpassword/useInputPassword.d.ts +15 -0
  229. package/inputpassword/useInputPassword.props.d.ts +2 -0
  230. package/inputtags/index.d.ts +1 -0
  231. package/inputtags/index.mjs +1 -1
  232. package/inputtags/index.mjs.map +1 -1
  233. package/inputtags/useInputTags.d.ts +42 -12
  234. package/inputtags/useInputTags.props.d.ts +2 -2
  235. package/inputtext/index.d.ts +1 -0
  236. package/inputtext/index.mjs +1 -1
  237. package/inputtext/index.mjs.map +1 -1
  238. package/inputtext/useInputText.d.ts +8 -1
  239. package/inputtext/useInputText.props.d.ts +2 -2
  240. package/knob/index.d.ts +1 -0
  241. package/knob/index.mjs +1 -1
  242. package/knob/index.mjs.map +1 -1
  243. package/knob/useKnob.d.ts +51 -10
  244. package/knob/useKnob.props.d.ts +2 -2
  245. package/label/index.d.ts +1 -0
  246. package/label/index.mjs +1 -1
  247. package/label/index.mjs.map +1 -1
  248. package/label/useLabel.d.ts +6 -1
  249. package/label/useLabel.props.d.ts +2 -2
  250. package/listbox/index.d.ts +3 -0
  251. package/listbox/index.mjs +1 -1
  252. package/listbox/index.mjs.map +1 -1
  253. package/listbox/useListbox.d.ts +56 -18
  254. package/listbox/useListbox.props.d.ts +2 -2
  255. package/listbox/useListboxOption.d.ts +21 -0
  256. package/listbox/useListboxOption.props.d.ts +2 -0
  257. package/menu/checkboxitem/index.d.ts +2 -0
  258. package/menu/checkboxitem/index.mjs +2 -0
  259. package/menu/checkboxitem/index.mjs.map +1 -0
  260. package/menu/checkboxitem/useMenuCheckboxItem.d.ts +112 -0
  261. package/menu/checkboxitem/useMenuCheckboxItem.props.d.ts +2 -0
  262. package/menu/index.d.ts +1 -0
  263. package/menu/index.mjs +1 -1
  264. package/menu/index.mjs.map +1 -1
  265. package/menu/radioitem/index.d.ts +2 -0
  266. package/menu/radioitem/index.mjs +2 -0
  267. package/menu/radioitem/index.mjs.map +1 -0
  268. package/menu/radioitem/useMenuRadioItem.d.ts +106 -0
  269. package/menu/radioitem/useMenuRadioItem.props.d.ts +2 -0
  270. package/menu/submenu/index.d.ts +2 -0
  271. package/menu/submenu/index.mjs +2 -0
  272. package/menu/submenu/index.mjs.map +1 -0
  273. package/menu/submenu/useMenuSubmenu.d.ts +97 -0
  274. package/menu/submenu/useMenuSubmenu.props.d.ts +2 -0
  275. package/menu/useMenu.d.ts +215 -22
  276. package/menu/useMenu.props.d.ts +2 -2
  277. package/message/index.d.ts +1 -0
  278. package/message/index.mjs +1 -1
  279. package/message/index.mjs.map +1 -1
  280. package/message/useMessage.d.ts +13 -1
  281. package/message/useMessage.props.d.ts +2 -2
  282. package/metergroup/index.d.ts +1 -0
  283. package/metergroup/index.mjs +1 -1
  284. package/metergroup/index.mjs.map +1 -1
  285. package/metergroup/useMeterGroup.d.ts +36 -5
  286. package/metergroup/useMeterGroup.props.d.ts +2 -2
  287. package/navigationmenu/index.d.ts +3 -0
  288. package/navigationmenu/index.mjs +2 -0
  289. package/navigationmenu/index.mjs.map +1 -0
  290. package/navigationmenu/useNavigationMenu.d.ts +30 -0
  291. package/navigationmenu/useNavigationMenu.props.d.ts +2 -0
  292. package/orderlist/index.d.ts +3 -0
  293. package/orderlist/index.mjs +2 -0
  294. package/orderlist/index.mjs.map +1 -0
  295. package/orderlist/useOrderList.d.ts +73 -0
  296. package/orderlist/useOrderList.props.d.ts +2 -0
  297. package/organizationchart/index.d.ts +3 -0
  298. package/organizationchart/index.mjs +2 -0
  299. package/organizationchart/index.mjs.map +1 -0
  300. package/organizationchart/useOrganizationChart.d.ts +69 -0
  301. package/organizationchart/useOrganizationChart.props.d.ts +2 -0
  302. package/overlaybadge/index.d.ts +3 -0
  303. package/overlaybadge/index.mjs +2 -0
  304. package/overlaybadge/index.mjs.map +1 -0
  305. package/overlaybadge/useOverlayBadge.d.ts +1 -0
  306. package/overlaybadge/useOverlayBadge.props.d.ts +2 -0
  307. package/package.json +12 -15
  308. package/paginator/index.d.ts +1 -0
  309. package/paginator/index.mjs +1 -1
  310. package/paginator/index.mjs.map +1 -1
  311. package/paginator/usePaginator.d.ts +47 -1
  312. package/paginator/usePaginator.props.d.ts +2 -2
  313. package/panel/index.d.ts +1 -0
  314. package/panel/index.mjs +1 -1
  315. package/panel/index.mjs.map +1 -1
  316. package/panel/usePanel.d.ts +76 -8
  317. package/panel/usePanel.props.d.ts +2 -2
  318. package/picklist/index.d.ts +3 -0
  319. package/picklist/index.mjs +2 -0
  320. package/picklist/index.mjs.map +1 -0
  321. package/picklist/usePickList.d.ts +153 -0
  322. package/picklist/usePickList.props.d.ts +2 -0
  323. package/popover/index.d.ts +1 -0
  324. package/popover/index.mjs +1 -7
  325. package/popover/index.mjs.map +1 -1
  326. package/popover/usePopover.d.ts +65 -12
  327. package/popover/usePopover.props.d.ts +2 -2
  328. package/portal/index.d.ts +1 -0
  329. package/portal/index.mjs +1 -1
  330. package/portal/index.mjs.map +1 -1
  331. package/portal/usePortal.d.ts +4 -2
  332. package/portal/usePortal.props.d.ts +2 -2
  333. package/positioner/index.d.ts +3 -0
  334. package/positioner/index.mjs +2 -0
  335. package/positioner/index.mjs.map +1 -0
  336. package/positioner/usePositioner.anchor.d.ts +7 -0
  337. package/positioner/usePositioner.d.ts +11 -0
  338. package/positioner/usePositioner.fallback.d.ts +13 -0
  339. package/positioner/usePositioner.props.d.ts +2 -0
  340. package/positioner/usePositioner.utils.d.ts +21 -0
  341. package/progressbar/index.d.ts +1 -0
  342. package/progressbar/index.mjs +1 -1
  343. package/progressbar/index.mjs.map +1 -1
  344. package/progressbar/useProgressBar.d.ts +13 -1
  345. package/progressbar/useProgressBar.props.d.ts +2 -2
  346. package/progressspinner/index.d.ts +1 -0
  347. package/progressspinner/index.mjs +1 -1
  348. package/progressspinner/index.mjs.map +1 -1
  349. package/progressspinner/useProgressSpinner.d.ts +50 -1
  350. package/progressspinner/useProgressSpinner.props.d.ts +2 -2
  351. package/radiobutton/index.d.ts +1 -0
  352. package/radiobutton/index.mjs +1 -1
  353. package/radiobutton/index.mjs.map +1 -1
  354. package/radiobutton/useRadioButton.d.ts +41 -3
  355. package/radiobutton/useRadioButton.props.d.ts +2 -2
  356. package/radiobuttongroup/index.d.ts +3 -0
  357. package/radiobuttongroup/index.mjs +2 -0
  358. package/radiobuttongroup/index.mjs.map +1 -0
  359. package/radiobuttongroup/useRadioButtonGroup.d.ts +11 -0
  360. package/radiobuttongroup/useRadioButtonGroup.props.d.ts +2 -0
  361. package/rating/index.d.ts +3 -0
  362. package/rating/index.mjs +1 -1
  363. package/rating/index.mjs.map +1 -1
  364. package/rating/useRating.d.ts +46 -12
  365. package/rating/useRating.props.d.ts +2 -2
  366. package/rating/useRatingOption.d.ts +69 -0
  367. package/rating/useRatingOption.props.d.ts +2 -0
  368. package/scrollarea/index.d.ts +1 -0
  369. package/scrollarea/index.mjs +1 -1
  370. package/scrollarea/index.mjs.map +1 -1
  371. package/scrollarea/useScrollArea.d.ts +120 -15
  372. package/scrollarea/useScrollArea.props.d.ts +2 -2
  373. package/select/index.d.ts +3 -0
  374. package/select/index.mjs +2 -0
  375. package/select/index.mjs.map +1 -0
  376. package/select/useSelect.d.ts +190 -0
  377. package/select/useSelect.props.d.ts +2 -0
  378. package/select/useSelect.test.d.ts +1 -0
  379. package/sidebar/index.d.ts +7 -0
  380. package/sidebar/index.mjs +2 -0
  381. package/sidebar/index.mjs.map +1 -0
  382. package/sidebar/useSidebar.d.ts +117 -0
  383. package/sidebar/useSidebar.props.d.ts +2 -0
  384. package/sidebar/useSidebarLayout.d.ts +24 -0
  385. package/sidebar/useSidebarLayout.props.d.ts +2 -0
  386. package/sidebar/useSidebarMenuItem.d.ts +11 -0
  387. package/sidebar/useSidebarMenuItem.props.d.ts +2 -0
  388. package/skeleton/index.d.ts +1 -0
  389. package/skeleton/index.mjs +1 -1
  390. package/skeleton/index.mjs.map +1 -1
  391. package/skeleton/useSkeleton.d.ts +7 -1
  392. package/skeleton/useSkeleton.props.d.ts +2 -2
  393. package/slider/index.d.ts +1 -0
  394. package/slider/index.mjs +1 -1
  395. package/slider/index.mjs.map +1 -1
  396. package/slider/useSlider.d.ts +81 -48
  397. package/slider/useSlider.props.d.ts +2 -2
  398. package/speeddial/index.d.ts +1 -0
  399. package/speeddial/index.mjs +1 -1
  400. package/speeddial/index.mjs.map +1 -1
  401. package/speeddial/useSpeedDial.d.ts +89 -32
  402. package/speeddial/useSpeedDial.props.d.ts +2 -2
  403. package/splitter/index.d.ts +1 -0
  404. package/splitter/index.mjs +1 -1
  405. package/splitter/index.mjs.map +1 -1
  406. package/splitter/useSplitter.d.ts +57 -14
  407. package/splitter/useSplitter.props.d.ts +2 -2
  408. package/stepper/index.d.ts +1 -0
  409. package/stepper/index.mjs +1 -1
  410. package/stepper/index.mjs.map +1 -1
  411. package/stepper/useStepper.d.ts +47 -2
  412. package/stepper/useStepper.props.d.ts +2 -2
  413. package/styleclass/index.d.ts +1 -0
  414. package/styleclass/index.mjs +1 -1
  415. package/styleclass/index.mjs.map +1 -1
  416. package/styleclass/useStyleClass.d.ts +5 -1
  417. package/styleclass/useStyleClass.props.d.ts +2 -2
  418. package/tabs/index.d.ts +1 -0
  419. package/tabs/index.mjs +1 -1
  420. package/tabs/index.mjs.map +1 -1
  421. package/tabs/useTabs.d.ts +42 -3
  422. package/tabs/useTabs.props.d.ts +2 -2
  423. package/tag/index.d.ts +1 -0
  424. package/tag/index.mjs +1 -1
  425. package/tag/index.mjs.map +1 -1
  426. package/tag/useTag.d.ts +6 -1
  427. package/tag/useTag.props.d.ts +2 -2
  428. package/terminal/index.d.ts +1 -0
  429. package/terminal/index.mjs +1 -1
  430. package/terminal/index.mjs.map +1 -1
  431. package/terminal/useTerminal.d.ts +23 -2
  432. package/terminal/useTerminal.props.d.ts +2 -2
  433. package/textarea/index.d.ts +1 -0
  434. package/textarea/index.mjs +1 -1
  435. package/textarea/index.mjs.map +1 -1
  436. package/textarea/useTextarea.d.ts +9 -2
  437. package/textarea/useTextarea.props.d.ts +2 -2
  438. package/timeline/index.d.ts +1 -0
  439. package/timeline/index.mjs +1 -1
  440. package/timeline/index.mjs.map +1 -1
  441. package/timeline/useTimeline.d.ts +41 -1
  442. package/timeline/useTimeline.props.d.ts +2 -2
  443. package/toast/index.d.ts +1 -1
  444. package/toast/index.mjs +1 -1
  445. package/toast/index.mjs.map +1 -1
  446. package/toast/useToast.d.ts +85 -23
  447. package/toast/useToast.props.d.ts +2 -2
  448. package/toaster/ToastManager.d.ts +14 -0
  449. package/toaster/index.d.ts +4 -0
  450. package/toaster/index.mjs +2 -0
  451. package/toaster/index.mjs.map +1 -0
  452. package/toaster/useToaster.d.ts +50 -0
  453. package/toaster/useToaster.props.d.ts +2 -0
  454. package/togglebutton/index.d.ts +1 -0
  455. package/togglebutton/index.mjs +1 -1
  456. package/togglebutton/index.mjs.map +1 -1
  457. package/togglebutton/useToggleButton.d.ts +5 -3
  458. package/togglebutton/useToggleButton.props.d.ts +2 -2
  459. package/togglebuttongroup/index.d.ts +3 -0
  460. package/togglebuttongroup/index.mjs +2 -0
  461. package/togglebuttongroup/index.mjs.map +1 -0
  462. package/togglebuttongroup/useToggleButtonGroup.d.ts +17 -0
  463. package/togglebuttongroup/useToggleButtonGroup.props.d.ts +2 -0
  464. package/toggleswitch/index.d.ts +3 -0
  465. package/toggleswitch/index.mjs +2 -0
  466. package/toggleswitch/index.mjs.map +1 -0
  467. package/toggleswitch/useToggleSwitch.d.ts +48 -0
  468. package/toggleswitch/useToggleSwitch.props.d.ts +2 -0
  469. package/toolbar/index.d.ts +1 -0
  470. package/toolbar/index.mjs +1 -1
  471. package/toolbar/index.mjs.map +1 -1
  472. package/toolbar/useToolbar.d.ts +7 -1
  473. package/toolbar/useToolbar.props.d.ts +2 -2
  474. package/tooltip/index.d.ts +1 -0
  475. package/tooltip/index.mjs +1 -1
  476. package/tooltip/index.mjs.map +1 -1
  477. package/tooltip/useTooltip.d.ts +43 -24
  478. package/tooltip/useTooltip.props.d.ts +2 -2
  479. package/tooltipmanager/index.d.ts +2 -0
  480. package/tooltipmanager/index.mjs +2 -0
  481. package/tooltipmanager/index.mjs.map +1 -0
  482. package/tooltipmanager/useTooltipManager.d.ts +12 -0
  483. package/tooltipmanager/useTooltipManager.props.d.ts +2 -0
  484. package/tooltipmanager/useTooltipManager.test.d.ts +0 -0
  485. package/tree/TreeDragDropService.d.ts +13 -5
  486. package/tree/index.d.ts +7 -0
  487. package/tree/index.mjs +1 -1
  488. package/tree/index.mjs.map +1 -1
  489. package/tree/useTree.d.ts +96 -16
  490. package/tree/useTree.props.d.ts +2 -2
  491. package/tree/useTreeDragDrop.d.ts +24 -0
  492. package/tree/useTreeFlatten.d.ts +13 -0
  493. package/tree/useTreeKeyboard.d.ts +18 -0
  494. package/tree/useTreeNode.d.ts +45 -0
  495. package/tree/useTreeNode.props.d.ts +2 -0
  496. package/tree/useTreeSelection.d.ts +31 -0
  497. package/utils/itemKey.d.ts +10 -0
  498. package/LICENSE +0 -21
  499. package/colorpicker/index.d.ts +0 -3
  500. package/colorpicker/index.mjs +0 -2
  501. package/colorpicker/index.mjs.map +0 -1
  502. package/colorpicker/input/index.d.ts +0 -2
  503. package/colorpicker/input/index.mjs +0 -2
  504. package/colorpicker/input/index.mjs.map +0 -1
  505. package/colorpicker/input/useColorPickerInput.d.ts +0 -11
  506. package/colorpicker/input/useColorPickerInput.props.d.ts +0 -2
  507. package/colorpicker/slider/index.d.ts +0 -2
  508. package/colorpicker/slider/index.mjs +0 -2
  509. package/colorpicker/slider/index.mjs.map +0 -1
  510. package/colorpicker/slider/useColorPickerSlider.d.ts +0 -13
  511. package/colorpicker/slider/useColorPickerSlider.props.d.ts +0 -2
  512. package/colorpicker/useColorPicker.d.ts +0 -26
  513. package/colorpicker/useColorPicker.props.d.ts +0 -2
  514. package/commandmenu/index.d.ts +0 -2
  515. package/commandmenu/index.mjs +0 -2
  516. package/commandmenu/index.mjs.map +0 -1
  517. package/commandmenu/useCommandMenu.d.ts +0 -11
  518. package/commandmenu/useCommandMenu.props.d.ts +0 -2
  519. package/confirmdialog/index.d.ts +0 -2
  520. package/confirmdialog/index.mjs +0 -2
  521. package/confirmdialog/index.mjs.map +0 -1
  522. package/confirmdialog/useConfirmDialog.d.ts +0 -1
  523. package/confirmdialog/useConfirmDialog.props.d.ts +0 -2
  524. package/confirmpopup/index.d.ts +0 -2
  525. package/confirmpopup/index.mjs +0 -2
  526. package/confirmpopup/index.mjs.map +0 -1
  527. package/confirmpopup/useConfirmPopup.d.ts +0 -25
  528. package/confirmpopup/useConfirmPopup.props.d.ts +0 -2
  529. package/imagecompare/index.d.ts +0 -2
  530. package/imagecompare/index.mjs +0 -2
  531. package/imagecompare/index.mjs.map +0 -1
  532. package/imagecompare/useImageCompare.d.ts +0 -8
  533. package/imagecompare/useImageCompare.props.d.ts +0 -2
  534. package/menu/sub/index.d.ts +0 -2
  535. package/menu/sub/index.mjs +0 -2
  536. package/menu/sub/index.mjs.map +0 -1
  537. package/menu/sub/useMenuSub.d.ts +0 -19
  538. package/menu/sub/useMenuSub.props.d.ts +0 -2
  539. package/orgchart/index.d.ts +0 -2
  540. package/orgchart/index.mjs +0 -2
  541. package/orgchart/index.mjs.map +0 -1
  542. package/orgchart/useOrgChart.d.ts +0 -20
  543. package/orgchart/useOrgChart.props.d.ts +0 -2
  544. package/overlay/index.d.ts +0 -2
  545. package/overlay/index.mjs +0 -2
  546. package/overlay/index.mjs.map +0 -1
  547. package/overlay/useOverlay.d.ts +0 -16
  548. package/overlay/useOverlay.props.d.ts +0 -2
  549. package/password/index.d.ts +0 -2
  550. package/password/index.mjs +0 -2
  551. package/password/index.mjs.map +0 -1
  552. package/password/usePassword.d.ts +0 -35
  553. package/password/usePassword.props.d.ts +0 -2
  554. package/placer/index.d.ts +0 -2
  555. package/placer/index.mjs +0 -2
  556. package/placer/index.mjs.map +0 -1
  557. package/placer/usePlacer.d.ts +0 -12
  558. package/placer/usePlacer.props.d.ts +0 -2
  559. package/switch/index.d.ts +0 -2
  560. package/switch/index.mjs +0 -2
  561. package/switch/index.mjs.map +0 -1
  562. package/switch/useSwitch.d.ts +0 -7
  563. package/switch/useSwitch.props.d.ts +0 -2
  564. package/toast/item/index.css +0 -2
  565. package/toast/item/index.css.map +0 -1
  566. package/toast/item/index.d.ts +0 -2
  567. package/toast/item/index.mjs +0 -2
  568. package/toast/item/index.mjs.map +0 -1
  569. package/toast/item/useToastItem.d.ts +0 -25
  570. package/toast/item/useToastItem.props.d.ts +0 -2
  571. package/toast/toastStore.d.ts +0 -40
  572. package/tooltip/group/index.d.ts +0 -2
  573. package/tooltip/group/index.mjs +0 -2
  574. package/tooltip/group/index.mjs.map +0 -1
  575. package/tooltip/group/useTooltipGroup.d.ts +0 -9
  576. package/tooltip/group/useTooltipGroup.props.d.ts +0 -2
  577. /package/{colorpicker/input/useColorPickerInput.test.d.ts → autocomplete/useAutoComplete.test.d.ts} +0 -0
  578. /package/{colorpicker/slider/useColorPickerSlider.test.d.ts → checkboxgroup/useCheckboxGroup.test.d.ts} +0 -0
  579. /package/{colorpicker/useColorPicker.test.d.ts → collapsible/useCollapsible.test.d.ts} +0 -0
  580. /package/{commandmenu/useCommandMenu.test.d.ts → compare/useCompare.test.d.ts} +0 -0
  581. /package/{confirmdialog/useConfirmDialog.test.d.ts → floatlabel/useFloatLabel.test.d.ts} +0 -0
  582. /package/{confirmpopup/useConfirmPopup.test.d.ts → iftalabel/useIftaLabel.test.d.ts} +0 -0
  583. /package/{imagecompare/useImageCompare.test.d.ts → inputcolor/useInputColor.test.d.ts} +0 -0
  584. /package/{orgchart/useOrgChart.test.d.ts → inputpassword/useInputPassword.test.d.ts} +0 -0
  585. /package/{overlay/useOverlay.test.d.ts → navigationmenu/useNavigationMenu.test.d.ts} +0 -0
  586. /package/{password/usePassword.test.d.ts → organizationchart/useOrganizationChart.test.d.ts} +0 -0
  587. /package/{placer/usePlacer.test.d.ts → overlaybadge/useOverlayBadge.test.d.ts} +0 -0
  588. /package/{progressspinner/useProgressSpinner.test.d.ts → positioner/usePositioner.test.d.ts} +0 -0
  589. /package/{rating/useRating.test.d.ts → radiobuttongroup/useRadioButtonGroup.test.d.ts} +0 -0
  590. /package/{switch/useSwitch.test.d.ts → toaster/useToaster.test.d.ts} +0 -0
  591. /package/{toast/item/useToastItem.test.d.ts → togglebuttongroup/useToggleButtonGroup.test.d.ts} +0 -0
  592. /package/{tooltip/group/useTooltipGroup.test.d.ts → toggleswitch/useToggleSwitch.test.d.ts} +0 -0
@@ -1,14 +1,31 @@
1
- import type { CarouselInstance } from '@primereact/types/shared/carousel';
1
+ import type { GalleryPendingAction } from '@primereact/types/headless/gallery';
2
+ import type { CarouselRootInstance } from '@primereact/types/primitive/carousel';
2
3
  import * as React from 'react';
3
- export declare const useGallery: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/shared/gallery").useGalleryProps, unknown, {
4
+ export declare const useGallery: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/headless/gallery").UseGalleryProps, unknown, {
4
5
  state: {
5
6
  isFullscreen: boolean;
6
7
  activeIndex: number;
8
+ zoomed: boolean;
9
+ rotated: boolean;
10
+ flipped: boolean;
11
+ pendingAction: GalleryPendingAction | null;
7
12
  };
8
- registerItem: (ref: HTMLDivElement | null) => number;
13
+ registerItem: (index: number | null) => number;
9
14
  handleNext: () => void;
10
15
  handlePrev: () => void;
11
- createCustomEvent: (action: string) => () => void;
16
+ selectItem: (index: number) => void;
17
+ reportItemState: (itemState: {
18
+ zoomed: boolean;
19
+ rotated: boolean;
20
+ flipped: boolean;
21
+ scale: number;
22
+ rotation: number;
23
+ flip: {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ }) => void;
28
+ clearPendingAction: () => void;
12
29
  toggleFullScreen: () => void;
13
30
  handleClickAction: (action?: string) => void;
14
31
  actions: {
@@ -24,8 +41,132 @@ export declare const useGallery: (inProps?: unknown) => import("@primereact/type
24
41
  toggleFullScreen: () => void;
25
42
  };
26
43
  contentRef: React.RefObject<HTMLDivElement | null>;
27
- toolbarRef: React.RefObject<HTMLDivElement | null>;
28
- thumbnailRef: React.RefObject<CarouselInstance | null>;
44
+ thumbnailRef: React.RefObject<CarouselRootInstance | null>;
29
45
  prevRef: React.RefObject<HTMLButtonElement | null>;
30
46
  nextRef: React.RefObject<HTMLButtonElement | null>;
47
+ rootProps: {
48
+ 'data-flipped'?: "" | undefined;
49
+ 'data-rotated'?: "" | undefined;
50
+ 'data-zoomed'?: "" | undefined;
51
+ 'data-fullscreen'?: "" | undefined;
52
+ ref: React.RefObject<HTMLDivElement>;
53
+ id: string | undefined;
54
+ tabIndex: number;
55
+ 'data-scope': "gallery";
56
+ 'data-part': "root";
57
+ onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
58
+ };
59
+ nextProps: {
60
+ 'data-scope': "gallery";
61
+ 'data-part': "next";
62
+ onClick: () => void;
63
+ };
64
+ prevProps: {
65
+ 'data-scope': "gallery";
66
+ 'data-part': "prev";
67
+ onClick: () => void;
68
+ };
69
+ thumbnailProps: {
70
+ 'data-scope': "gallery";
71
+ 'data-part': "thumbnail";
72
+ slide: number;
73
+ };
74
+ thumbnailContentProps: {
75
+ 'data-scope': "gallery";
76
+ 'data-part': "thumbnailContent";
77
+ };
78
+ thumbnailItemProps: (index: number | undefined) => {
79
+ onClick: () => void;
80
+ 'data-active'?: "" | undefined;
81
+ 'data-scope': "gallery";
82
+ 'data-part': "thumbnailItem";
83
+ };
84
+ toolbarProps: {
85
+ 'data-scope': "gallery";
86
+ 'data-part': "toolbar";
87
+ };
88
+ toolbarItemProps: (action: string | undefined) => {
89
+ 'data-scope': "gallery";
90
+ 'data-part': "toolbarItem";
91
+ onClick: () => void;
92
+ };
93
+ headerProps: {
94
+ 'data-scope': "gallery";
95
+ 'data-part': "header";
96
+ };
97
+ footerProps: {
98
+ 'data-scope': "gallery";
99
+ 'data-part': "footer";
100
+ };
101
+ backdropProps: {
102
+ 'data-scope': "gallery";
103
+ 'data-part': "backdrop";
104
+ };
105
+ contentProps: {
106
+ ref: React.RefObject<HTMLDivElement | null>;
107
+ 'data-scope': "gallery";
108
+ 'data-part': "content";
109
+ };
110
+ downloadProps: {
111
+ 'data-scope': "gallery";
112
+ 'data-part': "download";
113
+ 'data-action': "download";
114
+ onClick: () => void;
115
+ };
116
+ flipXProps: {
117
+ 'data-scope': "gallery";
118
+ 'data-part': "flipX";
119
+ 'data-action': "flip-x";
120
+ onClick: () => void;
121
+ };
122
+ flipYProps: {
123
+ 'data-scope': "gallery";
124
+ 'data-part': "flipY";
125
+ 'data-action': "flip-y";
126
+ onClick: () => void;
127
+ };
128
+ rotateLeftProps: {
129
+ 'data-scope': "gallery";
130
+ 'data-part': "rotateLeft";
131
+ 'data-action': "rotate-left";
132
+ onClick: () => void;
133
+ };
134
+ rotateRightProps: {
135
+ 'data-scope': "gallery";
136
+ 'data-part': "rotateRight";
137
+ 'data-action': "rotate-right";
138
+ onClick: () => void;
139
+ };
140
+ fullScreenProps: {
141
+ onClick: () => void;
142
+ 'data-fullscreen'?: "" | undefined;
143
+ 'data-scope': "gallery";
144
+ 'data-part': "fullScreen";
145
+ 'data-action': "fullscreen";
146
+ };
147
+ zoomInProps: {
148
+ 'data-scope': "gallery";
149
+ 'data-part': "zoomIn";
150
+ 'data-action': "zoom-in";
151
+ disabled: true | undefined;
152
+ onClick: () => void;
153
+ };
154
+ zoomOutProps: {
155
+ 'data-scope': "gallery";
156
+ 'data-part': "zoomOut";
157
+ 'data-action': "zoom-out";
158
+ disabled: true | undefined;
159
+ onClick: () => void;
160
+ };
161
+ zoomToggleProps: {
162
+ 'data-scope': "gallery";
163
+ 'data-part': "zoomToggle";
164
+ 'data-action': "zoom-toggle";
165
+ onClick: () => void;
166
+ };
167
+ getItemProps: (index: number) => {
168
+ 'data-active'?: "" | undefined;
169
+ 'data-scope': "gallery";
170
+ 'data-part': "item";
171
+ };
31
172
  }>;
@@ -1,2 +1,2 @@
1
- import type { useGalleryProps } from '@primereact/types/shared/gallery';
2
- export declare const defaultProps: useGalleryProps;
1
+ import type { UseGalleryProps } from '@primereact/types/headless/gallery';
2
+ export declare const defaultProps: UseGalleryProps;
@@ -1,2 +1,3 @@
1
1
  export * from './useIconField';
2
2
  export * from './useIconField.props';
3
+ export type * from '@primereact/types/headless/iconfield';
@@ -1,2 +1,2 @@
1
- import{withHeadless as o}from"@primereact/core/headless";var e={};var s=o({name:"useIconField",defaultProps:e});export{e as defaultProps,s as useIconField};
1
+ import{withHeadless as e}from"@primereact/core/headless";var o={};var i=e({name:"useIconField",defaultProps:o,setup(){return{rootProps:{"data-scope":"iconfield","data-part":"root"}}}});export{o as defaultProps,i as useIconField};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/iconfield/useIconField.ts","../../src/iconfield/useIconField.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { defaultProps } from './useIconField.props';\n\nexport const useIconField = withHeadless({\n name: 'useIconField',\n defaultProps\n});\n","import type { useIconFieldProps } from '@primereact/types/shared/iconfield';\n\nexport const defaultProps: useIconFieldProps = {};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,4BCEtB,IAAMC,EAAkC,CAAC,EDCzC,IAAMC,EAAeC,EAAa,CACrC,KAAM,eACN,aAAAC,CACJ,CAAC","names":["withHeadless","defaultProps","useIconField","withHeadless","defaultProps"]}
1
+ {"version":3,"sources":["../../src/iconfield/useIconField.ts","../../src/iconfield/useIconField.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { defaultProps } from './useIconField.props';\n\nexport const useIconField = withHeadless({\n name: 'useIconField',\n defaultProps,\n setup() {\n // prop getters\n const rootProps = {\n 'data-scope': 'iconfield',\n 'data-part': 'root'\n };\n\n return {\n rootProps\n };\n }\n});\n","import type { UseIconFieldProps } from '@primereact/types/headless/iconfield';\n\nexport const defaultProps: UseIconFieldProps = {};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,4BCEtB,IAAMC,EAAkC,CAAC,EDCzC,IAAMC,EAAeC,EAAa,CACrC,KAAM,eACN,aAAAC,EACA,OAAQ,CAOJ,MAAO,CACH,UANc,CACd,aAAc,YACd,YAAa,MACjB,CAIA,CACJ,CACJ,CAAC","names":["withHeadless","defaultProps","useIconField","withHeadless","defaultProps"]}
@@ -1 +1,6 @@
1
- export declare const useIconField: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/shared/iconfield").useIconFieldProps, unknown, Record<PropertyKey, unknown>>;
1
+ export declare const useIconField: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/headless/iconfield").UseIconFieldProps, unknown, {
2
+ rootProps: {
3
+ 'data-scope': string;
4
+ 'data-part': string;
5
+ };
6
+ }>;
@@ -1,2 +1,2 @@
1
- import type { useIconFieldProps } from '@primereact/types/shared/iconfield';
2
- export declare const defaultProps: useIconFieldProps;
1
+ import type { UseIconFieldProps } from '@primereact/types/headless/iconfield';
2
+ export declare const defaultProps: UseIconFieldProps;
@@ -0,0 +1,3 @@
1
+ export * from './useIftaLabel';
2
+ export * from './useIftaLabel.props';
3
+ export type * from '@primereact/types/headless/iftalabel';
@@ -0,0 +1,2 @@
1
+ import{withHeadless as t}from"@primereact/core/headless";var e={};var s=t({name:"useIftaLabel",defaultProps:e,setup(){return{rootProps:{"data-scope":"iftalabel","data-part":"root"}}}});export{e as defaultProps,s as useIftaLabel};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/iftalabel/useIftaLabel.ts","../../src/iftalabel/useIftaLabel.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { defaultProps } from './useIftaLabel.props';\n\nexport const useIftaLabel = withHeadless({\n name: 'useIftaLabel',\n defaultProps,\n setup() {\n // prop getters\n const rootProps = {\n 'data-scope': 'iftalabel',\n 'data-part': 'root'\n };\n\n return {\n rootProps\n };\n }\n});\n","import type { UseIftaLabelProps } from '@primereact/types/headless/iftalabel';\n\nexport const defaultProps: UseIftaLabelProps = {};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,4BCEtB,IAAMC,EAAkC,CAAC,EDCzC,IAAMC,EAAeC,EAAa,CACrC,KAAM,eACN,aAAAC,EACA,OAAQ,CAOJ,MAAO,CACH,UANc,CACd,aAAc,YACd,YAAa,MACjB,CAIA,CACJ,CACJ,CAAC","names":["withHeadless","defaultProps","useIftaLabel","withHeadless","defaultProps"]}
@@ -0,0 +1,6 @@
1
+ export declare const useIftaLabel: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/headless/iftalabel").UseIftaLabelProps, unknown, {
2
+ rootProps: {
3
+ 'data-scope': string;
4
+ 'data-part': string;
5
+ };
6
+ }>;
@@ -0,0 +1,2 @@
1
+ import type { UseIftaLabelProps } from '@primereact/types/headless/iftalabel';
2
+ export declare const defaultProps: UseIftaLabelProps;
@@ -1,2 +1,3 @@
1
1
  export * from './useInplace';
2
2
  export * from './useInplace.props';
3
+ export type * from '@primereact/types/headless/inplace';
package/inplace/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{withHeadless as s}from"@primereact/core/headless";import*as o from"react";var c={active:!1,onActiveChange:void 0};var d=s({name:"useInplace",defaultProps:c,setup:({props:e})=>{let[i,t]=o.useState(e.active),a={active:i};return{state:a,open:()=>t(!0),close:()=>t(!1),onActiveChange:()=>{var n;(n=e==null?void 0:e.onActiveChange)==null||n.call(e,a.active)}}}});export{c as defaultProps,d as useInplace};
1
+ var y=Object.defineProperty;var l=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var r=(a,e,t)=>e in a?y(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,o=(a,e)=>{for(var t in e||(e={}))b.call(e,t)&&r(a,t,e[t]);if(l)for(var t of l(e))P.call(e,t)&&r(a,t,e[t]);return a};import{withHeadless as h}from"@primereact/core/headless";import{useControlledState as x}from"@primereact/hooks/use-controlled-state";var p={active:void 0,defaultActive:!1,disabled:!1,onActiveChange:void 0};var I=h({name:"useInplace",defaultProps:p,setup:({props:a})=>{var d;let[e,t]=x({value:a.active,defaultValue:(d=a.defaultActive)!=null?d:!1,onChange:a.onActiveChange}),f={active:e},s=()=>t([!0,{originalEvent:void 0,active:!0}]),c=()=>t([!1,{originalEvent:void 0,active:!1}]);function i(n){n.defaultPrevented||(n.preventDefault(),(n.code==="Enter"||n.code==="Space")&&s())}let u=o({"data-scope":"inplace","data-part":"root",[e?"data-active":"data-inactive"]:""},a.disabled&&{"data-disabled":""}),v=o({"data-scope":"inplace","data-part":"display",tabIndex:0,onClick:s,onKeyDown:i,[e?"data-active":"data-inactive"]:""},a.disabled&&{"data-disabled":""}),m=o({"data-scope":"inplace","data-part":"close",onClick:c,[e?"data-active":"data-inactive"]:""},a.disabled&&{"data-disabled":""});return{state:f,open:s,close:c,onDisplayKeyDown:i,rootProps:u,displayProps:v,closeProps:m}}});export{p as defaultProps,I as useInplace};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/inplace/useInplace.ts","../../src/inplace/useInplace.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport * as React from 'react';\nimport { defaultProps } from './useInplace.props';\n\nexport const useInplace = withHeadless({\n name: 'useInplace',\n defaultProps,\n setup: ({ props }) => {\n const [activeState, setActiveState] = React.useState<boolean | undefined>(props.active);\n\n const state = {\n active: activeState\n };\n\n // methods\n const open = () => setActiveState(true);\n const close = () => setActiveState(false);\n\n const onActiveChange = () => {\n props?.onActiveChange?.(state.active);\n };\n\n return {\n state,\n open,\n close,\n onActiveChange\n };\n }\n});\n","import type { useInplaceProps } from '@primereact/types/shared/inplace';\n\nexport const defaultProps: useInplaceProps = {\n active: false,\n onActiveChange: undefined\n};\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,4BAC7B,UAAYC,MAAW,QCChB,IAAMC,EAAgC,CACzC,OAAQ,GACR,eAAgB,MACpB,EDDO,IAAMC,EAAaC,EAAa,CACnC,KAAM,aACN,aAAAC,EACA,MAAO,CAAC,CAAE,MAAAC,CAAM,IAAM,CAClB,GAAM,CAACC,EAAaC,CAAc,EAAU,WAA8BF,EAAM,MAAM,EAEhFG,EAAQ,CACV,OAAQF,CACZ,EAUA,MAAO,CACH,MAAAE,EACA,KATS,IAAMD,EAAe,EAAI,EAUlC,MATU,IAAMA,EAAe,EAAK,EAUpC,eARmB,IAAM,CAlBrC,IAAAE,GAmBYA,EAAAJ,GAAA,YAAAA,EAAO,iBAAP,MAAAI,EAAA,KAAAJ,EAAwBG,EAAM,OAClC,CAOA,CACJ,CACJ,CAAC","names":["withHeadless","React","defaultProps","useInplace","withHeadless","defaultProps","props","activeState","setActiveState","state","_a"]}
1
+ {"version":3,"sources":["../../src/inplace/useInplace.ts","../../src/inplace/useInplace.props.ts"],"sourcesContent":["import { withHeadless } from '@primereact/core/headless';\nimport { useControlledState } from '@primereact/hooks/use-controlled-state';\nimport { defaultProps } from './useInplace.props';\n\nexport const useInplace = withHeadless({\n name: 'useInplace',\n defaultProps,\n setup: ({ props }) => {\n const [activeState, setActiveState] = useControlledState({\n value: props.active,\n defaultValue: props.defaultActive ?? false,\n onChange: props.onActiveChange\n });\n\n const state = {\n active: activeState\n };\n\n // methods\n const open = () =>\n setActiveState([\n true,\n {\n originalEvent: undefined,\n active: true\n }\n ]);\n const close = () =>\n setActiveState([\n false,\n {\n originalEvent: undefined,\n active: false\n }\n ]);\n\n function onDisplayKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (event.defaultPrevented) return;\n\n event.preventDefault();\n\n if (event.code === 'Enter' || event.code === 'Space') {\n open();\n }\n }\n\n const rootProps = {\n 'data-scope': 'inplace',\n 'data-part': 'root',\n [activeState ? 'data-active' : 'data-inactive']: '' as const,\n ...(props.disabled && { 'data-disabled': '' as const })\n };\n\n const displayProps = {\n 'data-scope': 'inplace',\n 'data-part': 'display',\n tabIndex: 0 as const,\n onClick: open,\n onKeyDown: onDisplayKeyDown,\n [activeState ? 'data-active' : 'data-inactive']: '' as const,\n ...(props.disabled && { 'data-disabled': '' as const })\n };\n\n const closeProps = {\n 'data-scope': 'inplace',\n 'data-part': 'close',\n onClick: close,\n [activeState ? 'data-active' : 'data-inactive']: '' as const,\n ...(props.disabled && { 'data-disabled': '' as const })\n };\n\n return {\n state,\n open,\n close,\n onDisplayKeyDown,\n // prop getters\n rootProps,\n displayProps,\n closeProps\n };\n }\n});\n","import type { UseInplaceProps } from '@primereact/types/headless/inplace';\n\nexport const defaultProps: UseInplaceProps = {\n active: undefined,\n defaultActive: false,\n disabled: false,\n onActiveChange: undefined\n};\n"],"mappings":"yVAAA,OAAS,gBAAAA,MAAoB,4BAC7B,OAAS,sBAAAC,MAA0B,yCCC5B,IAAMC,EAAgC,CACzC,OAAQ,OACR,cAAe,GACf,SAAU,GACV,eAAgB,MACpB,EDHO,IAAMC,EAAaC,EAAa,CACnC,KAAM,aACN,aAAAC,EACA,MAAO,CAAC,CAAE,MAAAC,CAAM,IAAM,CAP1B,IAAAC,EAQQ,GAAM,CAACC,EAAaC,CAAc,EAAIC,EAAmB,CACrD,MAAOJ,EAAM,OACb,cAAcC,EAAAD,EAAM,gBAAN,KAAAC,EAAuB,GACrC,SAAUD,EAAM,cACpB,CAAC,EAEKK,EAAQ,CACV,OAAQH,CACZ,EAGMI,EAAO,IACTH,EAAe,CACX,GACA,CACI,cAAe,OACf,OAAQ,EACZ,CACJ,CAAC,EACCI,EAAQ,IACVJ,EAAe,CACX,GACA,CACI,cAAe,OACf,OAAQ,EACZ,CACJ,CAAC,EAEL,SAASK,EAAiBC,EAA4C,CAC9DA,EAAM,mBAEVA,EAAM,eAAe,GAEjBA,EAAM,OAAS,SAAWA,EAAM,OAAS,UACzCH,EAAK,EAEb,CAEA,IAAMI,EAAYC,EAAA,CACd,aAAc,UACd,YAAa,OACb,CAACT,EAAc,cAAgB,eAAe,EAAG,IAC7CF,EAAM,UAAY,CAAE,gBAAiB,EAAY,GAGnDY,EAAeD,EAAA,CACjB,aAAc,UACd,YAAa,UACb,SAAU,EACV,QAASL,EACT,UAAWE,EACX,CAACN,EAAc,cAAgB,eAAe,EAAG,IAC7CF,EAAM,UAAY,CAAE,gBAAiB,EAAY,GAGnDa,EAAaF,EAAA,CACf,aAAc,UACd,YAAa,QACb,QAASJ,EACT,CAACL,EAAc,cAAgB,eAAe,EAAG,IAC7CF,EAAM,UAAY,CAAE,gBAAiB,EAAY,GAGzD,MAAO,CACH,MAAAK,EACA,KAAAC,EACA,MAAAC,EACA,iBAAAC,EAEA,UAAAE,EACA,aAAAE,EACA,WAAAC,CACJ,CACJ,CACJ,CAAC","names":["withHeadless","useControlledState","defaultProps","useInplace","withHeadless","defaultProps","props","_a","activeState","setActiveState","useControlledState","state","open","close","onDisplayKeyDown","event","rootProps","__spreadValues","displayProps","closeProps"]}
@@ -1,8 +1,27 @@
1
- export declare const useInplace: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/shared/inplace").useInplaceProps, unknown, {
1
+ export declare const useInplace: (inProps?: unknown) => import("@primereact/types/core").HeadlessInstance<import("@primereact/types/headless/inplace").UseInplaceProps, unknown, {
2
2
  state: {
3
3
  active: boolean | undefined;
4
4
  };
5
5
  open: () => void;
6
6
  close: () => void;
7
- onActiveChange: () => void;
7
+ onDisplayKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
8
+ rootProps: {
9
+ 'data-disabled'?: "" | undefined;
10
+ 'data-scope': string;
11
+ 'data-part': string;
12
+ };
13
+ displayProps: {
14
+ 'data-disabled'?: "" | undefined;
15
+ 'data-scope': string;
16
+ 'data-part': string;
17
+ tabIndex: 0;
18
+ onClick: () => void;
19
+ onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
20
+ };
21
+ closeProps: {
22
+ 'data-disabled'?: "" | undefined;
23
+ 'data-scope': string;
24
+ 'data-part': string;
25
+ onClick: () => void;
26
+ };
8
27
  }>;
@@ -1,2 +1,2 @@
1
- import type { useInplaceProps } from '@primereact/types/shared/inplace';
2
- export declare const defaultProps: useInplaceProps;
1
+ import type { UseInplaceProps } from '@primereact/types/headless/inplace';
2
+ export declare const defaultProps: UseInplaceProps;
@@ -1,4 +1,4 @@
1
- import type { Color2DAxes, Color3DAxes, ColorChannel, ColorChannelRange, ColorInputChannel, ColorInstance, ColorOutput, ColorSliderChannel, ColorSpace } from '@primereact/types/shared/colorpicker';
1
+ import type { Color2DAxes, Color3DAxes, ColorChannel, ColorChannelRange, ColorInputChannel, ColorInstance, ColorOutput, ColorSliderChannel, ColorSpace } from '@primereact/types/headless/inputcolor';
2
2
  export declare const isEqual: (a: unknown, b: unknown) => boolean;
3
3
  declare abstract class Color {
4
4
  abstract clone(): ColorInstance;
@@ -60,6 +60,7 @@ export declare class RGBColor extends Color {
60
60
  private alpha;
61
61
  constructor(red: number, green: number, blue: number, alpha: number);
62
62
  static parse(value: string): RGBColor | undefined;
63
+ private static expandShortHex;
63
64
  private static parseHexColor;
64
65
  private static parseRgbFunction;
65
66
  private toHSB;
@@ -94,7 +95,7 @@ export declare const parseColor: (color: string) => ColorInstance;
94
95
  export declare function getChannelGradient(channel: ColorSliderChannel, value: ColorInstance, orientation: 'horizontal' | 'vertical'): string;
95
96
  export declare function getChannelColor(color: ColorInstance, channel: ColorChannel): ColorInstance;
96
97
  export declare function getAreaGradient(color: ColorInstance, axes: Color2DAxes): {
97
- '--area-gradient': string;
98
+ '--px-area-gradient': string;
98
99
  };
99
100
  export declare function getInputChannelValue(color: ColorInstance, channel: ColorInputChannel, format?: ColorSpace): string;
100
101
  export declare function getInputChannelRange(color: ColorInstance, channel?: ColorInputChannel): ColorChannelRange | undefined;
@@ -0,0 +1,4 @@
1
+ export * from './colorManager';
2
+ export * from './useInputColor';
3
+ export * from './useInputColor.props';
4
+ export type * from '@primereact/types/headless/inputcolor';
@@ -0,0 +1,2 @@
1
+ var Mt=Object.defineProperty,Et=Object.defineProperties;var Ft=Object.getOwnPropertyDescriptors;var at=Object.getOwnPropertySymbols;var Nt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;var st=(n,t,e)=>t in n?Mt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,X=(n,t)=>{for(var e in t||(t={}))Nt.call(t,e)&&st(n,e,t[e]);if(at)for(var e of at(t))Vt.call(t,e)&&st(n,e,t[e]);return n},ot=(n,t)=>Et(n,Ft(t));var Ht=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,It=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,yt=/^#?([a-fA-F0-9]{3,8})$/,Gt=/^rgba?\(\s*([^)]+)\s*\)$/,$t=/oklch\(\s*([\d.]+)%?\s+([\d.]+)\s+([\d.]+)(deg)?(?:\s*\/\s*([\d.]+))?\)/i;function R(n,t,e){return Math.min(Math.max(n,t),e)}var Kt=(n,t)=>JSON.stringify(n)===JSON.stringify(t),B=(n,t)=>[n[0]*t[0]+n[1]*t[1]+n[2]*t[2],n[3]*t[0]+n[4]*t[1]+n[5]*t[2],n[6]*t[0]+n[7]*t[1]+n[8]*t[2]];function Bt(n,t,e,r){let i=R(n,t,e)-t,o=Math.round(i/r),l=t+o*r,h=(r.toString().split(".")[1]||"").length;return parseFloat(l.toFixed(h))}var v=class{getChannelValue(t){if(t in this)return this[t];throw new Error(`Unknown color channel: ${t}`)}withChannelValue(t,e){let{min:r,max:a}=this.getChannelRange(t);if(t in this){let i=this.clone();return i[t]=R(e,r,a),i}throw new Error(`Unknown color channel: ${t}`)}getSpaceAxes(t){let{xChannel:e,yChannel:r}=t;if(e===r)throw new Error("xChannel and yChannel cannot be the same");let a=this.getChannels().find(i=>i!==e&&i!==r);if(!a)throw new Error("zChannel not found");return{xChannel:e,yChannel:r,zChannel:a}}incChannelValue(t,e){let{min:r,max:a,step:i}=this.getChannelRange(t),o=Bt(R(this.getChannelValue(t)+e,r,a),r,a,i);return this.withChannelValue(t,o)}decChannelValue(t,e){return this.incChannelValue(t,-e)}},P=class n extends v{constructor(t,e,r,a){super(),this.hue=t,this.saturation=e,this.brightness=r,this.alpha=a}static parse(t){var l;let e=t.match(Ht);if(!e)return;let[r,a,i,o]=((l=e[1])!=null?l:e[2]).split(",").map(h=>Number(h.trim().replace("%","")));return new n(r%360,R(a,0,100),R(i,0,100),R(o!=null?o:1,0,1))}toRGB(){let t=this.hue,e=this.saturation/100,r=this.brightness/100;function a(i){let o=(i+t/60)%6;return r-r*e*Math.max(0,Math.min(o,4-o,1))}return new L(Math.round(a(5)*255),Math.round(a(3)*255),Math.round(a(1)*255),Number(this.alpha.toFixed(2)))}toHSL(){let t=this.hue,e=this.saturation/100,r=this.brightness/100,a=r*(1-e/2);return a===0||a===1?e=0:e=(r-a)/Math.min(a,1-a),new D(Number(t.toFixed(2)),Number((e*100).toFixed(2)),Number((a*100).toFixed(2)),Number(this.alpha.toFixed(2)))}toFormat(t){switch(t){case"hsba":return this;case"rgba":return this.toRGB();case"hsla":return this.toHSL();case"oklcha":return this.toRGB().toFormat("oklcha");default:throw new Error(`Invalid format: ${t}`)}}toString(t){switch(t){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.brightness.toFixed(2)}%)`;case"hsba":return`hsba(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.brightness.toFixed(2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");case"oklch":return this.toRGB().toFormat("oklcha").toString("oklch");default:return this.toFormat(t).toString(t)}}toJSON(){return{hue:this.hue,saturation:this.saturation,brightness:this.brightness,alpha:this.alpha}}clone(){return new n(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(t){switch(t){case"hue":return{min:0,max:360,step:1};case"saturation":case"brightness":return{min:0,max:100,step:1};case"alpha":return{min:0,max:1,step:.01};default:throw new Error(`Unknown color channel: ${t}`)}}getFormat(){return"hsba"}getChannels(){return["hue","saturation","brightness"]}},D=class n extends v{constructor(t,e,r,a){super(),this.hue=t,this.saturation=e,this.lightness=r,this.alpha=a}static parse(t){var l,h;let e=t.match(It);if(!e)return;let[r,a,i,o]=(h=(l=e[1]||e[2])==null?void 0:l.split(",").map(d=>Number(d.trim().replace("%",""))))!=null?h:[];return new n(r%360,R(a,0,100),R(i,0,100),R(o!=null?o:1,0,1))}toRGB(){let t=this.hue,e=this.saturation/100,r=this.lightness/100;function a(i){let o=(i+t/30)%12,l=e*Math.min(r,1-r);return r-l*Math.max(-1,Math.min(o-3,9-o,1))}return new L(Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255),Number(this.alpha.toFixed(2)))}toHSB(){let t=this.hue,e=this.saturation/100,r=this.lightness/100,a=r+e*Math.min(r,1-r);return a===0?e=0:e=2*(1-r/a),new P(Number(t.toFixed(2)),Number((e*100).toFixed(2)),Number((a*100).toFixed(2)),Number(this.alpha.toFixed(2)))}toFormat(t){switch(t){case"hsla":return this;case"rgba":return this.toRGB();case"hsba":return this.toHSB();case"oklcha":return this.toRGB().toFormat("oklcha");default:throw new Error(`Invalid format: ${t}`)}}toString(t){switch(t){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.lightness.toFixed(2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.lightness.toFixed(2)}%, ${this.alpha})`;case"rgb":return this.toRGB().toString("rgb");case"hsb":return this.toHSB().toString("hsb");case"oklch":return this.toRGB().toFormat("oklcha").toString("oklch");default:return this.toFormat(t).toString(t)}}toJSON(){return{hue:this.hue,saturation:this.saturation,lightness:this.lightness,alpha:this.alpha}}clone(){return new n(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(t){switch(t){case"hue":return{min:0,max:360,step:1};case"saturation":case"lightness":return{min:0,max:100,step:1};case"alpha":return{min:0,max:1,step:.01};default:throw new Error(`Unknown color channel: ${t}`)}}getFormat(){return"hsla"}getChannels(){return["hue","saturation","lightness"]}},L=class n extends v{constructor(t,e,r,a){super(),this.red=t,this.green=e,this.blue=r,this.alpha=a}static parse(t){var r;if(!t)return;let e=t.trim();return(r=this.parseHexColor(e))!=null?r:this.parseRgbFunction(e)}static expandShortHex(t){return t.split("").map(e=>e+e).join("")}static parseHexColor(t){let e=t.match(yt);if(!e)return;let r=e[1];if(r.length<=4&&(r=this.expandShortHex(r)),![6,8].includes(r.length))return;let a=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16),l=r.length===8?parseInt(r.slice(6,8),16)/255:1;return new n(a,i,o,l)}static parseRgbFunction(t){let e=t.match(Gt);if(!(e!=null&&e[1]))return;let[r,a,i,o]=e[1].split(",").map(w=>w.trim()),l=R(Number(r),0,255),h=R(Number(a),0,255),d=R(Number(i),0,255),c=o!==void 0?R(Number(o),0,1):1;if(![l,h,d,c].some(w=>Number.isNaN(w)))return new n(l,h,d,c)}toHSB(){let[t,e,r]=[this.red/255,this.green/255,this.blue/255],a=Math.max(t,e,r),i=Math.min(t,e,r),o=a-i,l=a,h=a===0?0:o/a,d=0;if(o!==0){switch(a){case t:d=(e-r)/o%6;break;case e:d=(r-t)/o+2;break;case r:d=(t-e)/o+4;break}d*=60,d<0&&(d+=360)}return new P(Number(d.toFixed(2)),Number((h*100).toFixed(2)),Number((l*100).toFixed(2)),Number(this.alpha.toFixed(2)))}toHSL(){let[t,e,r]=[this.red/255,this.green/255,this.blue/255],a=Math.max(t,e,r),i=Math.min(t,e,r),o=(a+i)/2,l=a-i,h=0,d=-1;if(l!==0){switch(a){case t:h=(e-r)/l%6;break;case e:h=(r-t)/l+2;break;case r:h=(t-e)/l+4;break}h*=60,h<0&&(h+=360)}return o===0||o===1?d=0:d=l/(1-Math.abs(2*a-l-1)),new D(Number(h.toFixed(2)),Number((d*100).toFixed(2)),Number((o*100).toFixed(2)),Number(this.alpha.toFixed(2)))}toOKLCH(){let e=[this.red/255,this.green/255,this.blue/255].map(N=>Math.abs(N)<=.04045?N/12.92:(N<0?-1:1)*((Math.abs(N)+.055)/1.055)**2.4),r=B([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],e),i=B([.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],r).map(N=>Math.cbrt(N)),[o,l,h]=B([.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],i),d=Math.sqrt(l**2+h**2),c=Math.abs(l)<2e-4&&Math.abs(h)<2e-4?NaN:(Math.atan2(h,l)*180/Math.PI%360+360)%360,w=Number(Math.min(1,Math.max(0,o)).toFixed(4)),C=Number(d.toFixed(4)),T=Number.isNaN(c)?NaN:Number(c.toFixed(2));return new U(w,C,T,Number(this.alpha.toFixed(2)))}toHexInt(){return this.red<<16|this.green<<8|this.blue}toFormat(t){switch(t){case"rgba":return this;case"hsla":return this.toHSL();case"hsba":return this.toHSB();case"oklcha":return this.toOKLCH();default:throw new Error(`Invalid format: ${t}`)}}toString(t){switch(t){case"hex":return`#${this.red.toString(16).padStart(2,"0")}${this.green.toString(16).padStart(2,"0")}${this.blue.toString(16).padStart(2,"0")}`;case"hexa":return`#${this.red.toString(16).padStart(2,"0")}${this.green.toString(16).padStart(2,"0")}${this.blue.toString(16).padStart(2,"0")}${Math.round(this.alpha*255).toString(16).padStart(2,"0")}`;case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"rgba":case"css":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");case"oklch":return this.toOKLCH().toString("oklch");default:return this.toFormat(t).toString(t)}}toJSON(){return{red:this.red,green:this.green,blue:this.blue,alpha:this.alpha}}clone(){return new n(this.red,this.green,this.blue,this.alpha)}getChannelRange(t){switch(t){case"red":case"green":case"blue":return{min:0,max:255,step:1};case"alpha":return{min:0,max:1,step:.01};default:throw new Error(`Unknown color channel: ${t}`)}}getFormat(){return"rgba"}getChannels(){return["red","green","blue"]}},U=class n extends v{constructor(t,e,r,a){super(),this.L=t,this.C=e,this.H=r,this.alpha=a}static parse(t){if(!t)return;let e=t.trim().match($t);if(!e)return;let r=Number(e[1])/100,a=Number(e[2]),i=Number(e[3]),o=e[5]!==void 0?Number(e[5]):1;return new n(r,a,i,o)}toRGB(){let t=this.L,e=Number.isNaN(this.H)?0:this.C*Math.cos(this.H*Math.PI/180),r=Number.isNaN(this.H)?0:this.C*Math.sin(this.H*Math.PI/180),i=B([1,.3963377774,.2158037573,1,-.1055613458,-.0638541728,1,-.0894841775,-1.291485548],[t,e,r]).map(c=>c**3),o=B([1.2268798758,-.5578149945,.2813910457,-.0405757452,1.1122868033,-.0717110581,-.0763729367,-.4214933324,1.5869240198],i),[l,h,d]=B([3.240969942,-1.537383178,-.49861076,-.969243636,1.875967502,.041555057,.05563008,-.203976959,1.056971514],o);return[l,h,d]=[l,h,d].map(c=>Math.abs(c)>.0031308?(c<0?-1:1)*(1.055*Math.abs(c)**(1/2.4)-.055):12.92*c),new L(Math.round(R(l,0,1)*255),Math.round(R(h,0,1)*255),Math.round(R(d,0,1)*255),Number(this.alpha.toFixed(2)))}toJSON(){return{L:this.L,C:this.C,H:this.H,alpha:this.alpha}}clone(){return new n(this.L,this.C,this.H,this.alpha)}toFormat(t){switch(t){case"oklcha":return this;case"rgba":return this.toRGB();case"hsla":return this.toRGB().toFormat("hsla");case"hsba":return this.toRGB().toFormat("hsba");default:throw new Error(`Invalid format: ${t}`)}}toString(t){switch(t){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"oklch":{let e=Number.isNaN(this.L)?0:Number((this.L*100).toFixed(2)),r=Number.isNaN(this.C)?0:Number(this.C.toFixed(4)),a=Number.isNaN(this.H)?0:Number(this.H.toFixed(2));return`oklch(${e}% ${r} ${a})`}case"oklcha":case"css":{let e=Number.isNaN(this.L)?0:Number((this.L*100).toFixed(2)),r=Number.isNaN(this.C)?0:Number(this.C.toFixed(4)),a=Number.isNaN(this.H)?0:Number(this.H.toFixed(2)),i=Number.isNaN(this.alpha)?1:Number(this.alpha.toFixed(2));return`oklch(${e}% ${r} ${a} / ${i})`}case"hsl":return this.toRGB().toString("hsl");case"hsb":return this.toRGB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(t).toString(t)}}getChannelRange(t){switch(t){case"L":return{min:0,max:1,step:.01};case"C":return{min:0,max:.4,step:.01};case"H":return{min:0,max:360,step:1};case"alpha":return{min:0,max:1,step:.01};default:throw new Error(`Unknown color channel: ${t}`)}}getFormat(){return"oklcha"}getChannels(){return["L","C","H"]}},H=n=>{var e,r,a;let t=(a=(r=(e=L.parse(n))!=null?e:D.parse(n))!=null?r:P.parse(n))!=null?a:void 0;if(!t)throw new Error(`Invalid color: ${n}`);return t};function it(n,t,e){let{min:r,max:a}=t.getChannelRange(n),i=e==="horizontal"?"right":"bottom";switch(n){case"hue":return`linear-gradient(to ${i}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;case"lightness":{let o=t.withChannelValue(n,r).toString("css"),l=t.withChannelValue(n,(a-r)/2).toString("css"),h=t.withChannelValue(n,a).toString("css");return`linear-gradient(to ${i}, ${o}, ${l}, ${h})`}case"red":case"green":case"blue":case"saturation":case"brightness":case"alpha":{let o=t.withChannelValue(n,r).toString("css"),l=t.withChannelValue(n,a).toString("css");return`linear-gradient(to ${i}, ${o}, ${l})`}default:throw new Error(`Unknown color channel: ${n}`)}}function lt(n,t){switch(t){case"hue":return H(`hsl(${n.getChannelValue("hue")}, 100%, 50%)`);case"red":case"green":case"blue":case"lightness":case"brightness":case"saturation":return n.withChannelValue("alpha",1);case"alpha":return n;default:throw new Error(`Unknown color channel: ${t}`)}}var vt={hue:n=>[0,60,120,180,240,300,360].map(t=>n.withChannelValue("hue",t).toString("css")).join(", "),saturation:n=>`${n.withChannelValue("saturation",0).toString("css")}, transparent`,lightness:()=>"black, transparent, white",brightness:()=>"black, transparent"};function ht(n,t){let{xChannel:e,zChannel:r}=n.getSpaceAxes(t),a=n.getChannelValue(r),i=n.getFormat(),l=H((i==="rgba"||i==="oklcha"?"hsba":i)==="hsla"?"hsl(0, 100%, 50%)":"hsb(0, 100%, 100%)").withChannelValue(r,a),h=n.getChannels(),d=w=>w===e?"right":"top",c=h.filter(w=>w!==r).map(w=>`linear-gradient(to ${d(w)}, ${vt[w](l)})`).reverse();return r==="hue"&&c.push(l.toString("css")),{"--px-area-gradient":c.join(", ")}}function K(n,t,e="hsba"){let r=n.getFormat()==="hsla";switch(t){case"hex":return n.getChannelValue("alpha")<n.getChannelRange("alpha").max?n.toString("hexa"):n.toString("hex");case"css":return n.toFormat(e).toString("css");case"red":case"green":case"blue":return n.toFormat("rgba").getChannelValue(t).toString();case"hue":return n.toFormat(r?"hsla":"hsba").getChannelValue("hue").toString();case"saturation":return n.toFormat(r?"hsla":"hsba").getChannelValue("saturation").toString();case"lightness":return n.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return n.toFormat("hsba").getChannelValue("brightness").toString();case"C":return n.toFormat("oklcha").getChannelValue("C").toString();case"H":return n.toFormat("oklcha").getChannelValue("H").toString();case"L":return n.toFormat("oklcha").getChannelValue("L").toString();default:return n.getChannelValue(t).toString()}}function ut(n,t="hex"){switch(t){case"hex":return{min:H("#000000").toHexInt(),max:H("#FFFFFF").toHexInt(),step:1};case"css":return;case"red":case"green":case"blue":return n.toFormat("rgba").getChannelRange(t);case"hue":case"lightness":case"saturation":return n.toFormat("hsla").getChannelRange(t);case"brightness":return n.toFormat("hsba").getChannelRange(t);case"L":case"C":case"H":return n.toFormat("oklcha").getChannelRange(t);default:return n.getChannelRange(t)}}import{withHeadless as Lt}from"@primereact/core/headless";import{useControlledState as kt}from"@primereact/hooks/use-controlled-state";import*as V from"react";var ct={defaultValue:void 0,value:void 0,format:"hsba",disabled:!1,onValueChange:void 0,onValueChangeEnd:void 0};var At=/^[0-9a-fA-F]{3,8}$/;function Xt(n){return At.test(n)}function Pt(n){return n.startsWith("#")?n:Xt(n)?`#${n}`:n}function Dt(n){return n.replace("to bottom","to top")}var Qt=Lt({name:"useInputColor",defaultProps:ct,setup({props:n}){var rt;let{format:t="hsba",disabled:e}=n,[r,a]=V.useState(!1),i=V.useRef([]),o=V.useRef({x:0,y:0}),l=V.useRef((rt=n.defaultValue)!=null?rt:H("#ff0000").toFormat(n.format||"hsba")),[h,d]=kt({value:n.value,defaultValue:l.current,onChange:n.onValueChange}),c=V.useMemo(()=>h!=null?h:H("#ff0000").toFormat(t),[h,t]),w=t.startsWith("hsl")?"hsla":"hsba",C=V.useMemo(()=>c.toFormat(w),[c,w]),T={value:c,isAreaDragging:r},N=(s,u)=>{d([s,X({color:s.toString(t),value:s},u!=null&&u.originalEvent?{originalEvent:u.originalEvent}:{})]),O(s)},z=(s,u,x)=>{if(!x||e)return;let p=x.getBoundingClientRect(),f=Math.max(0,Math.min(1,(s-o.current.x-p.left)/p.width)),g=Math.max(0,Math.min(1,(u-o.current.y-p.top)/p.height)),{xChannel:b,yChannel:E}=_(),G=C.getChannelRange(b),y=C.getChannelRange(E),k=f*(G.max-G.min)+G.min,A=(1-g)*(y.max-y.min)+y.min,F=k-C.getChannelValue(b),m=A-C.getChannelValue(E),S=C.incChannelValue(b,F).incChannelValue(E,m);N(S)},J=s=>{var f;let u=s.currentTarget;if(!u||s.button!==0)return;let x=s.target,p=(f=x==null?void 0:x.closest)==null?void 0:f.call(x,'[data-part="area-handle"], .p-input-color-area-handle');if(p){let g=p.getBoundingClientRect(),b=g.left+g.width/2,E=g.top+g.height/2;o.current={x:s.clientX-b,y:s.clientY-E}}else o.current={x:0,y:0};u.setPointerCapture(s.pointerId),a(!0),z(s.clientX,s.clientY,u)},Y=s=>{r&&z(s.clientX,s.clientY,s.currentTarget)},j=s=>{let u=s.currentTarget;u&&(u.releasePointerCapture(s.pointerId),a(!1),o.current={x:0,y:0},n.onValueChangeEnd&&n.onValueChangeEnd({originalEvent:s,color:c.toString(t),value:c}))},q=s=>{n.onValueChangeEnd&&n.onValueChangeEnd({originalEvent:s,color:c.toString(t),value:c})},W=s=>{if(e)return;let u=s.key;if(!["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"].includes(u))return;s.preventDefault();let{xChannel:x,yChannel:p}=_(),{step:f}=C.getChannelRange(x),{step:g}=C.getChannelRange(p),b=C;u==="ArrowRight"&&(b=b.incChannelValue(x,f)),u==="ArrowLeft"&&(b=b.decChannelValue(x,f)),u==="ArrowUp"&&(b=b.incChannelValue(p,g)),u==="ArrowDown"&&(b=b.decChannelValue(p,g)),N(b),n.onValueChangeEnd&&n.onValueChangeEnd({originalEvent:s,color:b.toString(t),value:b})},_=()=>{let s=C.getChannels();return{xChannel:s[1],yChannel:s[2]}},Q=()=>{if(typeof window!="undefined"&&!window.EyeDropper||e)return;new window.EyeDropper().open().then(u=>{let x=H(u.sRGBHex);N(x)}).catch(u=>{console.error("Error opening eyedropper",u)})},M=_(),{min:Z,max:dt}=C.getChannelRange(M.xChannel),{min:tt,max:gt}=C.getChannelRange(M.yChannel),mt=C.getChannelValue(M.xChannel),Ct=C.getChannelValue(M.yChannel),et=ot(X({},ht(C,M)),{"--px-handle-background":C.withChannelValue("alpha",1).toString("css"),"--px-handle-position-left":(mt-Z)/(dt-Z)*100+"%","--px-handle-position-top":(1-(Ct-tt)/(gt-tt))*100+"%"}),nt={"--px-swatch-background":c.toString("css")},pt=({channel:s="hue",orientation:u="horizontal",disabled:x}={})=>{let p=e||x,f=s==="alpha"?C:c.getChannels().includes(s)?c:C.getChannels().includes(s)?C:c.toFormat(t),g=f.getChannelRange(s),b=f.getChannelValue(s),E=it(s,f,u),y={"--px-slider-background":u==="vertical"?Dt(E):E,"--px-slider-handle-background":lt(f,s).toString("css")},k=F=>{if(p)return;let m=Array.isArray(F.value)?F.value[0]:F.value;if(m===void 0||Number.isNaN(m))return;let S=f.withChannelValue(s,m);N(S,{originalEvent:F.originalEvent})},A=F=>{if(p||!n.onValueChangeEnd)return;let m=Array.isArray(F.value)?F.value[0]:F.value;if(m===void 0||Number.isNaN(m))return;let S=f.withChannelValue(s,m);n.onValueChangeEnd({originalEvent:F.originalEvent,color:S.toString(t),value:S})};return{"data-scope":"inputcolor","data-part":"slider","data-orientation":u,"data-channel":s,orientation:u,style:y,value:b,min:g.min,max:g.max,step:g.step,disabled:p,onValueChange:k,onValueChangeEnd:A}},bt=s=>{let u=s.elementRef.current;i.current.includes(u)||i.current.push(u)},O=s=>{requestAnimationFrame(()=>{let u=s||c;i.current.forEach(p=>{let f=p.getAttribute("data-channel");if(f){let g=K(u,f,t);p.value=String(g)}})})};V.useEffect(()=>{O()},[c,t]);let xt=({channel:s="hex",disabled:u}={})=>{let x=e||u,p=c,f=t,g=ut(p,s),b=K(p,s,f),E=s==="hex"||s==="css",G=m=>{if(x)return;let S;if(E)try{S=H(s==="hex"?Pt(String(m)):String(m))}catch(I){S=p}else{let I=p;s!=="alpha"&&(I=I.toFormat(f));let $=Number.parseFloat(String(m)),wt=Number.isNaN($)?I.getChannelValue(s):$;S=I.withChannelValue(s,wt)}return N(S),S},y=m=>{let S=m.currentTarget,I=E?S.value:S.valueAsNumber,$=G(I);!$||!n.onValueChangeEnd||n.onValueChangeEnd({originalEvent:m,color:$.toString(t),value:$})},k=m=>{let S=m.currentTarget,I=E?S.value:S.valueAsNumber;G(I)},A=m=>{y(m)},F=m=>{m.defaultPrevented||m.key==="Enter"&&(y(m),m.preventDefault())};return{"data-scope":"inputcolor","data-part":"input",type:E?"text":"number",spellCheck:!1,autoComplete:"off",disabled:!!x,"data-channel":s,"aria-label":s,min:g==null?void 0:g.min,max:g==null?void 0:g.max,step:g==null?void 0:g.step,channelValue:b,onChange:k,onBlur:A,onKeyDown:F}},ft=X(X({"data-scope":"inputcolor","data-part":"root"},e&&{"data-disabled":""}),r&&{"data-dragging":""}),St={"data-scope":"inputcolor","data-part":"area",style:et,onPointerDown:J,onPointerMove:Y,onPointerUp:j},Rt={"data-scope":"inputcolor","data-part":"area-handle",role:"slider",tabIndex:e?-1:0,"aria-disabled":e,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C.getChannelValue(M.xChannel),"aria-label":`${M.xChannel} and ${M.yChannel}`,"aria-roledescription":"2d slider","aria-valuetext":`${M.xChannel} ${C.getChannelValue(M.xChannel)}, ${M.yChannel} ${C.getChannelValue(M.yChannel)}`,onKeyDown:W,onBlur:q};return{state:T,value:h,areaValue:C,areaChannels:M,rootProps:ft,areaProps:St,areaHandleProps:Rt,swatchProps:{"data-scope":"inputcolor","data-part":"swatch",style:nt},eyeDropperProps:{"data-scope":"inputcolor","data-part":"eye-dropper",disabled:!!e,onClick:Q},sliderHandleProps:{"data-scope":"inputcolor","data-part":"slider-handle",role:"slider",tabIndex:e?-1:0,"aria-disabled":e},getInputProps:xt,getSliderProps:pt,setValue:d,handleAreaPointerDown:J,handleAreaPointerMove:Y,handleAreaPointerUp:j,handleAreaBlur:q,handleAreaKeyDown:W,areaStyles:et,swatchStyles:nt,openEyeDropper:Q,syncChannelInputs:O,registerInputEl:bt}}});export{P as HSBColor,D as HSLColor,U as OKLCHColor,L as RGBColor,ct as defaultProps,ht as getAreaGradient,lt as getChannelColor,it as getChannelGradient,ut as getInputChannelRange,K as getInputChannelValue,Kt as isEqual,H as parseColor,Qt as useInputColor};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/inputcolor/colorManager.ts","../../src/inputcolor/useInputColor.ts","../../src/inputcolor/useInputColor.props.ts"],"sourcesContent":["import type { Color2DAxes, Color3DAxes, ColorChannel, ColorChannelRange, ColorInputChannel, ColorInstance, ColorOutput, ColorSliderChannel, ColorSpace } from '@primereact/types/headless/inputcolor';\n\n// CONSTANTS\nconst RGB_MAX = 255;\n// Matches hsb(...) or hsba(...)\nconst HSB_REGEX = /hsb\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%)\\)|hsba\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d(.\\d+)?)\\)/;\n// Matches hsl(...) or hsla(...)\nconst HSL_REGEX = /hsl\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%)\\)|hsla\\(([-+]?\\d+(?:.\\d+)?\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d+(?:.\\d+)?%\\s*,\\s*[-+]?\\d(.\\d+)?)\\)/;\n// Matches #rgb, #rgba, #rrggbb, #rrggbbaa (hash optional)\nconst HEX_REGEX = /^#?([a-fA-F0-9]{3,8})$/;\n// Matches rgb(...) or rgba(...)\nconst RGB_REGEX = /^rgba?\\(\\s*([^)]+)\\s*\\)$/;\n// Matches oklch(L C H / a)\nconst OKLCH_REGEX = /oklch\\(\\s*([\\d.]+)%?\\s+([\\d.]+)\\s+([\\d.]+)(deg)?(?:\\s*\\/\\s*([\\d.]+))?\\)/i;\n\n// UTILS\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(Math.max(value, min), max);\n}\n\nexport const isEqual = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b);\n\nconst multiplyMatrices = (A: number[], B: number[]) => {\n return [A[0] * B[0] + A[1] * B[1] + A[2] * B[2], A[3] * B[0] + A[4] * B[1] + A[5] * B[2], A[6] * B[0] + A[7] * B[1] + A[8] * B[2]];\n};\n\n/**\n * Snaps a value to the nearest step increment within min/max bounds\n * @example snap(23.7, 0, 100, 5) => 25\n * @example snap(0.234, 0, 1, 0.01) => 0.23\n */\nfunction snap(value: number, min: number, max: number, step: number) {\n const clamped = clamp(value, min, max);\n\n const offset = clamped - min;\n const steps = Math.round(offset / step);\n\n const snapped = min + steps * step;\n\n const precision = (step.toString().split('.')[1] || '').length;\n\n return parseFloat(snapped.toFixed(precision));\n}\n\nabstract class Color {\n abstract clone(): ColorInstance;\n abstract toString(format: ColorOutput): string;\n abstract toFormat(format: ColorSpace): ColorInstance;\n abstract toJSON(): Record<string, number>;\n abstract getChannelRange(channel: ColorChannel): ColorChannelRange;\n abstract getFormat(): ColorSpace;\n abstract getChannels(): [ColorChannel, ColorChannel, ColorChannel];\n\n getChannelValue(channel: ColorChannel): number {\n if (channel in this) {\n return this[channel as keyof this] as number;\n }\n\n throw new Error(`Unknown color channel: ${channel}`);\n }\n\n withChannelValue(channel: ColorChannel, value: number): ColorInstance {\n const { min, max } = this.getChannelRange(channel);\n\n if (channel in this) {\n const cloned = this.clone();\n\n // @ts-expect-error - channel\n cloned[channel] = clamp(value, min, max);\n\n return cloned;\n }\n\n throw new Error(`Unknown color channel: ${channel}`);\n }\n\n getSpaceAxes(xyChannels: Color2DAxes): Color3DAxes {\n const { xChannel, yChannel } = xyChannels;\n\n if (xChannel === yChannel) {\n throw new Error('xChannel and yChannel cannot be the same');\n }\n\n const zChannel = this.getChannels().find((channel) => channel !== xChannel && channel !== yChannel);\n\n if (!zChannel) {\n throw new Error('zChannel not found');\n }\n\n return { xChannel, yChannel, zChannel };\n }\n\n incChannelValue(channel: ColorChannel, step: number): ColorInstance {\n const { min, max, step: availableStep } = this.getChannelRange(channel);\n\n const value = snap(clamp(this.getChannelValue(channel) + step, min, max), min, max, availableStep);\n\n return this.withChannelValue(channel, value);\n }\n\n decChannelValue(channel: ColorChannel, step: number): ColorInstance {\n return this.incChannelValue(channel, -step);\n }\n}\n\nexport class HSBColor extends Color {\n private hue: number;\n private saturation: number;\n private brightness: number;\n private alpha: number;\n\n constructor(hue: number, saturation: number, brightness: number, alpha: number) {\n super();\n this.hue = hue;\n this.saturation = saturation;\n this.brightness = brightness;\n this.alpha = alpha;\n }\n\n static parse(value: string): HSBColor | undefined {\n const match = value.match(HSB_REGEX);\n\n if (!match) return undefined;\n\n const [h, s, b, a] = (match[1] ?? match[2]).split(',').map((n) => Number(n.trim().replace('%', '')));\n\n return new HSBColor(h % 360, clamp(s, 0, 100), clamp(b, 0, 100), clamp(a ?? 1, 0, 1));\n }\n\n private toRGB(): RGBColor {\n const h = this.hue;\n const s = this.saturation / 100;\n const b = this.brightness / 100;\n\n function f(n: number) {\n const k = (n + h / 60) % 6;\n\n return b - b * s * Math.max(0, Math.min(k, 4 - k, 1));\n }\n\n return new RGBColor(Math.round(f(5) * RGB_MAX), Math.round(f(3) * RGB_MAX), Math.round(f(1) * RGB_MAX), Number(this.alpha.toFixed(2)));\n }\n\n private toHSL(): HSLColor {\n const h = this.hue;\n let s = this.saturation / 100;\n const b = this.brightness / 100;\n\n const l = b * (1 - s / 2);\n\n if (l === 0 || l === 1) {\n s = 0;\n } else {\n s = (b - l) / Math.min(l, 1 - l);\n }\n\n return new HSLColor(Number(h.toFixed(2)), Number((s * 100).toFixed(2)), Number((l * 100).toFixed(2)), Number(this.alpha.toFixed(2)));\n }\n\n toFormat(format: ColorSpace): ColorInstance {\n switch (format) {\n case 'hsba':\n return this;\n case 'rgba':\n return this.toRGB();\n case 'hsla':\n return this.toHSL();\n case 'oklcha':\n return this.toRGB().toFormat('oklcha');\n default:\n throw new Error(`Invalid format: ${format}`);\n }\n }\n\n toString(format: ColorOutput): string {\n switch (format) {\n case 'css':\n return this.toHSL().toString('css');\n case 'hex':\n return this.toRGB().toString('hex');\n case 'hexa':\n return this.toRGB().toString('hexa');\n case 'hsb':\n return `hsb(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.brightness.toFixed(2)}%)`;\n case 'hsba':\n return `hsba(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.brightness.toFixed(2)}%, ${this.alpha})`;\n case 'hsl':\n return this.toHSL().toString('hsl');\n case 'rgb':\n return this.toRGB().toString('rgb');\n case 'oklch':\n return this.toRGB().toFormat('oklcha').toString('oklch');\n default:\n return this.toFormat(format).toString(format);\n }\n }\n\n toJSON() {\n return {\n hue: this.hue,\n saturation: this.saturation,\n brightness: this.brightness,\n alpha: this.alpha\n };\n }\n\n clone(): ColorInstance {\n return new HSBColor(this.hue, this.saturation, this.brightness, this.alpha);\n }\n\n getChannelRange(channel: ColorChannel): ColorChannelRange {\n switch (channel) {\n case 'hue':\n return { min: 0, max: 360, step: 1 };\n case 'saturation':\n case 'brightness':\n return { min: 0, max: 100, step: 1 };\n case 'alpha':\n return { min: 0, max: 1, step: 0.01 };\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n }\n\n getFormat(): ColorSpace {\n return 'hsba';\n }\n\n getChannels(): [ColorChannel, ColorChannel, ColorChannel] {\n return ['hue', 'saturation', 'brightness'];\n }\n}\n\nexport class HSLColor extends Color {\n private hue: number;\n private saturation: number;\n private lightness: number;\n private alpha: number;\n\n constructor(hue: number, saturation: number, lightness: number, alpha: number) {\n super();\n this.hue = hue;\n this.saturation = saturation;\n this.lightness = lightness;\n this.alpha = alpha;\n }\n\n static parse(value: string): HSLColor | undefined {\n const match = value.match(HSL_REGEX);\n\n if (!match) return undefined;\n\n const [h, s, l, a] = (match[1] || match[2])?.split(',').map((n) => Number(n.trim().replace('%', ''))) ?? [];\n\n return new HSLColor(h % 360, clamp(s, 0, 100), clamp(l, 0, 100), clamp(a ?? 1, 0, 1));\n }\n\n private toRGB(): RGBColor {\n const h = this.hue;\n const s = this.saturation / 100;\n const l = this.lightness / 100;\n\n function f(n: number) {\n const k = (n + h / 30) % 12;\n const a = s * Math.min(l, 1 - l);\n\n return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n }\n\n return new RGBColor(Math.round(f(0) * RGB_MAX), Math.round(f(8) * RGB_MAX), Math.round(f(4) * RGB_MAX), Number(this.alpha.toFixed(2)));\n }\n\n private toHSB(): HSBColor {\n const h = this.hue;\n let s = this.saturation / 100;\n const l = this.lightness / 100;\n\n const b = l + s * Math.min(l, 1 - l);\n\n if (b === 0) {\n s = 0;\n } else {\n s = 2 * (1 - l / b);\n }\n\n return new HSBColor(Number(h.toFixed(2)), Number((s * 100).toFixed(2)), Number((b * 100).toFixed(2)), Number(this.alpha.toFixed(2)));\n }\n\n toFormat(format: ColorSpace): ColorInstance {\n switch (format) {\n case 'hsla':\n return this;\n case 'rgba':\n return this.toRGB();\n case 'hsba':\n return this.toHSB();\n case 'oklcha':\n return this.toRGB().toFormat('oklcha');\n default:\n throw new Error(`Invalid format: ${format}`);\n }\n }\n\n toString(format: ColorOutput): string {\n switch (format) {\n case 'hex':\n return this.toRGB().toString('hex');\n case 'hexa':\n return this.toRGB().toString('hexa');\n case 'hsl':\n return `hsl(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.lightness.toFixed(2)}%)`;\n case 'css':\n case 'hsla':\n return `hsla(${this.hue}, ${this.saturation.toFixed(2)}%, ${this.lightness.toFixed(2)}%, ${this.alpha})`;\n case 'rgb':\n return this.toRGB().toString('rgb');\n case 'hsb':\n return this.toHSB().toString('hsb');\n case 'oklch':\n return this.toRGB().toFormat('oklcha').toString('oklch');\n default:\n return this.toFormat(format).toString(format);\n }\n }\n\n toJSON(): Record<string, number> {\n return {\n hue: this.hue,\n saturation: this.saturation,\n lightness: this.lightness,\n alpha: this.alpha\n };\n }\n\n clone(): ColorInstance {\n return new HSLColor(this.hue, this.saturation, this.lightness, this.alpha);\n }\n\n getChannelRange(channel: ColorChannel): ColorChannelRange {\n switch (channel) {\n case 'hue':\n return { min: 0, max: 360, step: 1 };\n case 'saturation':\n case 'lightness':\n return { min: 0, max: 100, step: 1 };\n case 'alpha':\n return { min: 0, max: 1, step: 0.01 };\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n }\n\n getFormat(): ColorSpace {\n return 'hsla';\n }\n\n getChannels(): [ColorChannel, ColorChannel, ColorChannel] {\n return ['hue', 'saturation', 'lightness'];\n }\n}\n\nexport class RGBColor extends Color {\n private red: number;\n private green: number;\n private blue: number;\n private alpha: number;\n\n constructor(red: number, green: number, blue: number, alpha: number) {\n super();\n this.red = red;\n this.green = green;\n this.blue = blue;\n this.alpha = alpha;\n }\n\n static parse(value: string): RGBColor | undefined {\n if (!value) return undefined;\n\n const input = value.trim();\n\n return this.parseHexColor(input) ?? this.parseRgbFunction(input);\n }\n\n private static expandShortHex(hex: string) {\n return hex\n .split('')\n .map((c) => c + c)\n .join('');\n }\n\n private static parseHexColor(input: string): RGBColor | undefined {\n const match = input.match(HEX_REGEX);\n\n if (!match) return undefined;\n\n let hex = match[1];\n\n // Expand shorthand (#abc -> #aabbcc, #abcd -> #aabbccdd)\n if (hex.length <= 4) {\n hex = this.expandShortHex(hex);\n }\n\n if (![6, 8].includes(hex.length)) return undefined;\n\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / RGB_MAX : 1;\n\n return new RGBColor(r, g, b, a);\n }\n\n private static parseRgbFunction(input: string): RGBColor | undefined {\n const match = input.match(RGB_REGEX);\n\n if (!match?.[1]) return undefined;\n\n const [rStr, gStr, bStr, aStr] = match[1].split(',').map((v) => v.trim());\n\n const r = clamp(Number(rStr), 0, RGB_MAX);\n const g = clamp(Number(gStr), 0, RGB_MAX);\n const b = clamp(Number(bStr), 0, RGB_MAX);\n const a = aStr !== undefined ? clamp(Number(aStr), 0, 1) : 1;\n\n if ([r, g, b, a].some((v) => Number.isNaN(v))) return undefined;\n\n return new RGBColor(r, g, b, a);\n }\n\n private toHSB(): HSBColor {\n const [r, g, b] = [this.red / RGB_MAX, this.green / RGB_MAX, this.blue / RGB_MAX];\n\n const mmax = Math.max(r, g, b);\n const mmin = Math.min(r, g, b);\n\n const chroma = mmax - mmin;\n const brightness = mmax;\n\n const saturation = mmax === 0 ? 0 : chroma / mmax;\n\n let hue = 0;\n\n if (chroma !== 0) {\n switch (mmax) {\n case r:\n hue = ((g - b) / chroma) % 6;\n break;\n case g:\n hue = (b - r) / chroma + 2;\n break;\n case b:\n hue = (r - g) / chroma + 4;\n break;\n }\n\n hue *= 60;\n\n if (hue < 0) {\n hue += 360;\n }\n }\n\n return new HSBColor(Number(hue.toFixed(2)), Number((saturation * 100).toFixed(2)), Number((brightness * 100).toFixed(2)), Number(this.alpha.toFixed(2)));\n }\n\n private toHSL(): HSLColor {\n const [r, g, b] = [this.red / RGB_MAX, this.green / RGB_MAX, this.blue / RGB_MAX];\n\n const mmax = Math.max(r, g, b);\n const mmin = Math.min(r, g, b);\n\n const lightness = (mmax + mmin) / 2;\n const chroma = mmax - mmin;\n\n let hue = 0;\n let saturation = -1;\n\n if (chroma !== 0) {\n switch (mmax) {\n case r:\n hue = ((g - b) / chroma) % 6;\n break;\n case g:\n hue = (b - r) / chroma + 2;\n break;\n case b:\n hue = (r - g) / chroma + 4;\n break;\n }\n\n hue *= 60;\n\n if (hue < 0) {\n hue += 360;\n }\n }\n\n if (lightness === 0 || lightness === 1) {\n saturation = 0;\n } else {\n saturation = chroma / (1 - Math.abs(2 * mmax - chroma - 1));\n }\n\n return new HSLColor(Number(hue.toFixed(2)), Number((saturation * 100).toFixed(2)), Number((lightness * 100).toFixed(2)), Number(this.alpha.toFixed(2)));\n }\n\n private toOKLCH(): OKLCHColor {\n const rgb = [this.red / RGB_MAX, this.green / RGB_MAX, this.blue / RGB_MAX];\n\n const rgbLinear = rgb.map((c) => (Math.abs(c) <= 0.04045 ? c / 12.92 : (c < 0 ? -1 : 1) * ((Math.abs(c) + 0.055) / 1.055) ** 2.4));\n\n const xyz = multiplyMatrices([0.41239079926595934, 0.357584339383878, 0.1804807884018343, 0.21263900587151027, 0.715168678767756, 0.07219231536073371, 0.01933081871559182, 0.11919477979462598, 0.9505321522496607], rgbLinear);\n\n const LMS = multiplyMatrices([0.819022437996703, 0.3619062600528904, -0.1288737815209879, 0.0329836539323885, 0.9292868615863434, 0.0361446663506424, 0.0481771893596242, 0.2642395317527308, 0.6335478284694309], xyz);\n\n const LMSg = LMS.map((val) => Math.cbrt(val));\n\n const [L, a, b] = multiplyMatrices([0.210454268309314, 0.7936177747023054, -0.0040720430116193, 1.9779985324311684, -2.4285922420485799, 0.450593709617411, 0.0259040424655478, 0.7827717124575296, -0.8086757549230774], LMSg);\n\n const C = Math.sqrt(a ** 2 + b ** 2);\n const H = Math.abs(a) < 0.0002 && Math.abs(b) < 0.0002 ? NaN : ((((Math.atan2(b, a) * 180) / Math.PI) % 360) + 360) % 360;\n\n const outL = Number(Math.min(1, Math.max(0, L)).toFixed(4));\n\n const outC = Number(C.toFixed(4));\n\n const outH = Number.isNaN(H) ? NaN : Number(H.toFixed(2));\n\n return new OKLCHColor(outL, outC, outH, Number(this.alpha.toFixed(2)));\n }\n\n toHexInt(): number {\n return (this.red << 16) | (this.green << 8) | this.blue;\n }\n\n toFormat(format: ColorSpace): ColorInstance {\n switch (format) {\n case 'rgba':\n return this;\n case 'hsla':\n return this.toHSL();\n case 'hsba':\n return this.toHSB();\n case 'oklcha':\n return this.toOKLCH();\n default:\n throw new Error(`Invalid format: ${format}`);\n }\n }\n\n toString(format: ColorOutput): string {\n switch (format) {\n case 'hex':\n return `#${this.red.toString(16).padStart(2, '0')}${this.green.toString(16).padStart(2, '0')}${this.blue.toString(16).padStart(2, '0')}`;\n case 'hexa':\n return `#${this.red.toString(16).padStart(2, '0')}${this.green.toString(16).padStart(2, '0')}${this.blue.toString(16).padStart(2, '0')}${Math.round(this.alpha * RGB_MAX)\n .toString(16)\n .padStart(2, '0')}`;\n case 'rgb':\n return `rgb(${this.red}, ${this.green}, ${this.blue})`;\n case 'rgba':\n case 'css':\n return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;\n case 'hsl':\n return this.toHSL().toString('hsl');\n case 'hsb':\n return this.toHSB().toString('hsb');\n case 'oklch':\n return this.toOKLCH().toString('oklch');\n default:\n return this.toFormat(format).toString(format);\n }\n }\n\n toJSON(): Record<string, number> {\n return {\n red: this.red,\n green: this.green,\n blue: this.blue,\n alpha: this.alpha\n };\n }\n\n clone(): ColorInstance {\n return new RGBColor(this.red, this.green, this.blue, this.alpha);\n }\n\n getChannelRange(channel: ColorChannel): ColorChannelRange {\n switch (channel) {\n case 'red':\n case 'green':\n case 'blue':\n return { min: 0, max: RGB_MAX, step: 1 };\n case 'alpha':\n return { min: 0, max: 1, step: 0.01 };\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n }\n\n getFormat(): ColorSpace {\n return 'rgba';\n }\n\n getChannels(): [ColorChannel, ColorChannel, ColorChannel] {\n return ['red', 'green', 'blue'];\n }\n}\n\nexport class OKLCHColor extends Color {\n private L: number; // 0–1\n private C: number; // ~0–0.4 typical usable range\n private H: number; // 0–360\n private alpha: number; // 0–1\n\n constructor(L: number, C: number, H: number, alpha: number) {\n super();\n this.L = L;\n this.C = C;\n this.H = H;\n this.alpha = alpha;\n }\n\n static parse(value: string): OKLCHColor | undefined {\n if (!value) return undefined;\n\n const m = value.trim().match(OKLCH_REGEX);\n\n if (!m) return;\n\n const l = Number(m[1]) / 100;\n const c = Number(m[2]);\n const h = Number(m[3]);\n const alpha = m[5] !== undefined ? Number(m[5]) : 1;\n\n return new OKLCHColor(l, c, h, alpha);\n }\n\n private toRGB(): RGBColor {\n const L = this.L;\n const a = Number.isNaN(this.H) ? 0 : this.C * Math.cos((this.H * Math.PI) / 180);\n const b = Number.isNaN(this.H) ? 0 : this.C * Math.sin((this.H * Math.PI) / 180);\n\n const LMSg = multiplyMatrices([1, 0.3963377774, 0.2158037573, 1, -0.1055613458, -0.0638541728, 1, -0.0894841775, -1.291485548], [L, a, b]);\n\n const LMS = LMSg.map((v) => v ** 3);\n\n const xyz = multiplyMatrices([1.2268798758, -0.5578149945, 0.2813910457, -0.0405757452, 1.1122868033, -0.0717110581, -0.0763729367, -0.4214933324, 1.5869240198], LMS);\n\n let [r, g, b2] = multiplyMatrices([3.240969942, -1.537383178, -0.49861076, -0.969243636, 1.875967502, 0.041555057, 0.05563008, -0.203976959, 1.056971514], xyz);\n\n [r, g, b2] = [r, g, b2].map((c) => (Math.abs(c) > 0.0031308 ? (c < 0 ? -1 : 1) * (1.055 * Math.abs(c) ** (1 / 2.4) - 0.055) : 12.92 * c));\n\n return new RGBColor(Math.round(clamp(r, 0, 1) * RGB_MAX), Math.round(clamp(g, 0, 1) * RGB_MAX), Math.round(clamp(b2, 0, 1) * RGB_MAX), Number(this.alpha.toFixed(2)));\n }\n\n toJSON(): Record<string, number> {\n return {\n L: this.L,\n C: this.C,\n H: this.H,\n alpha: this.alpha\n };\n }\n\n clone(): ColorInstance {\n return new OKLCHColor(this.L, this.C, this.H, this.alpha);\n }\n\n toFormat(format: ColorSpace): ColorInstance {\n switch (format) {\n case 'oklcha':\n return this;\n case 'rgba':\n return this.toRGB();\n case 'hsla':\n return this.toRGB().toFormat('hsla');\n case 'hsba':\n return this.toRGB().toFormat('hsba');\n default:\n throw new Error(`Invalid format: ${format}`);\n }\n }\n\n toString(format: ColorOutput): string {\n switch (format) {\n case 'hex':\n return this.toRGB().toString('hex');\n case 'hexa':\n return this.toRGB().toString('hexa');\n\n case 'oklch': {\n const l = Number.isNaN(this.L) ? 0 : Number((this.L * 100).toFixed(2));\n const c = Number.isNaN(this.C) ? 0 : Number(this.C.toFixed(4));\n const h = Number.isNaN(this.H) ? 0 : Number(this.H.toFixed(2));\n\n return `oklch(${l}% ${c} ${h})`;\n }\n\n case 'oklcha':\n\n case 'css': {\n const l = Number.isNaN(this.L) ? 0 : Number((this.L * 100).toFixed(2));\n const c = Number.isNaN(this.C) ? 0 : Number(this.C.toFixed(4));\n const h = Number.isNaN(this.H) ? 0 : Number(this.H.toFixed(2));\n const a = Number.isNaN(this.alpha) ? 1 : Number(this.alpha.toFixed(2));\n\n return `oklch(${l}% ${c} ${h} / ${a})`;\n }\n\n case 'hsl':\n return this.toRGB().toString('hsl');\n case 'hsb':\n return this.toRGB().toString('hsb');\n case 'rgb':\n return this.toRGB().toString('rgb');\n default:\n return this.toFormat(format).toString(format);\n }\n }\n\n getChannelRange(channel: ColorChannel): ColorChannelRange {\n switch (channel) {\n case 'L':\n return { min: 0, max: 1, step: 0.01 };\n case 'C':\n return { min: 0, max: 0.4, step: 0.01 };\n case 'H':\n return { min: 0, max: 360, step: 1 };\n case 'alpha':\n return { min: 0, max: 1, step: 0.01 };\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n }\n\n getFormat(): ColorSpace {\n return 'oklcha';\n }\n\n getChannels(): [ColorChannel, ColorChannel, ColorChannel] {\n return ['L', 'C', 'H'];\n }\n}\n\nexport const parseColor = (color: string): ColorInstance => {\n const parsedColor = RGBColor.parse(color) ?? HSLColor.parse(color) ?? HSBColor.parse(color) ?? undefined;\n\n if (!parsedColor) {\n throw new Error(`Invalid color: ${color}`);\n }\n\n return parsedColor;\n};\n\nexport function getChannelGradient(channel: ColorSliderChannel, value: ColorInstance, orientation: 'horizontal' | 'vertical') {\n const { min, max } = value.getChannelRange(channel);\n\n const direction = orientation === 'horizontal' ? 'right' : 'bottom';\n\n switch (channel) {\n case 'hue':\n return `linear-gradient(to ${direction}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;\n\n case 'lightness': {\n const start = value.withChannelValue(channel, min).toString('css');\n const middle = value.withChannelValue(channel, (max - min) / 2).toString('css');\n const end = value.withChannelValue(channel, max).toString('css');\n\n return `linear-gradient(to ${direction}, ${start}, ${middle}, ${end})`;\n }\n\n case 'red':\n case 'green':\n case 'blue':\n case 'saturation':\n case 'brightness':\n\n case 'alpha': {\n const start = value.withChannelValue(channel, min).toString('css');\n const end = value.withChannelValue(channel, max).toString('css');\n\n return `linear-gradient(to ${direction}, ${start}, ${end})`;\n }\n\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n}\n\nexport function getChannelColor(color: ColorInstance, channel: ColorChannel) {\n switch (channel) {\n case 'hue':\n return parseColor(`hsl(${color.getChannelValue('hue')}, 100%, 50%)`);\n\n case 'red':\n case 'green':\n case 'blue':\n case 'lightness':\n case 'brightness':\n case 'saturation':\n return color.withChannelValue('alpha', 1);\n\n case 'alpha': {\n return color;\n }\n\n default:\n throw new Error(`Unknown color channel: ${channel}`);\n }\n}\n\nconst channelGenerators = {\n hue: (color: ColorInstance) => [0, 60, 120, 180, 240, 300, 360].map((h) => color.withChannelValue('hue', h).toString('css')).join(', '),\n\n saturation: (color: ColorInstance) => `${color.withChannelValue('saturation', 0).toString('css')}, transparent`,\n\n lightness: () => 'black, transparent, white',\n brightness: () => 'black, transparent'\n};\n\nexport function getAreaGradient(color: ColorInstance, axes: Color2DAxes) {\n const { xChannel, zChannel } = color.getSpaceAxes(axes);\n const zValue = color.getChannelValue(zChannel);\n const baseFormat = color.getFormat();\n\n const format = baseFormat === 'rgba' || baseFormat === 'oklcha' ? 'hsba' : baseFormat;\n\n const base = (format === 'hsla' ? parseColor('hsl(0, 100%, 50%)') : parseColor('hsb(0, 100%, 100%)')).withChannelValue(zChannel, zValue);\n\n const channels = color.getChannels();\n\n const direction = (c: string) => (c === xChannel ? 'right' : 'top');\n\n const layers = channels\n .filter((c) => c !== zChannel)\n .map((c) => `linear-gradient(to ${direction(c)}, ${channelGenerators[c as keyof typeof channelGenerators](base)})`)\n .reverse();\n\n if (zChannel === 'hue') {\n layers.push(base.toString('css'));\n }\n\n return {\n '--px-area-gradient': layers.join(', ')\n };\n}\n\nexport function getInputChannelValue(color: ColorInstance, channel: ColorInputChannel, format: ColorSpace = 'hsba') {\n const isHSL = color.getFormat() === 'hsla';\n\n switch (channel) {\n case 'hex': {\n if (color.getChannelValue('alpha') < color.getChannelRange('alpha').max) {\n return color.toString('hexa');\n }\n\n return color.toString('hex');\n }\n\n case 'css':\n return color.toFormat(format).toString('css');\n\n case 'red':\n case 'green':\n case 'blue':\n return color.toFormat('rgba').getChannelValue(channel).toString();\n\n case 'hue':\n return color\n .toFormat(isHSL ? 'hsla' : 'hsba')\n .getChannelValue('hue')\n .toString();\n\n case 'saturation':\n return color\n .toFormat(isHSL ? 'hsla' : 'hsba')\n .getChannelValue('saturation')\n .toString();\n\n case 'lightness':\n return color.toFormat('hsla').getChannelValue('lightness').toString();\n\n case 'brightness':\n return color.toFormat('hsba').getChannelValue('brightness').toString();\n\n case 'C':\n return color.toFormat('oklcha').getChannelValue('C').toString();\n case 'H':\n return color.toFormat('oklcha').getChannelValue('H').toString();\n case 'L':\n return color.toFormat('oklcha').getChannelValue('L').toString();\n default:\n return color.getChannelValue(channel).toString();\n }\n}\n\nexport function getInputChannelRange(color: ColorInstance, channel: ColorInputChannel = 'hex'): ColorChannelRange | undefined {\n switch (channel) {\n case 'hex': {\n return {\n min: (parseColor('#000000') as RGBColor).toHexInt(),\n max: (parseColor('#FFFFFF') as RGBColor).toHexInt(),\n step: 1\n };\n }\n\n case 'css':\n return undefined;\n\n case 'red':\n case 'green':\n case 'blue':\n return color.toFormat('rgba').getChannelRange(channel);\n\n case 'hue':\n case 'lightness':\n case 'saturation':\n return color.toFormat('hsla').getChannelRange(channel);\n\n case 'brightness':\n return color.toFormat('hsba').getChannelRange(channel);\n\n case 'L':\n case 'C':\n case 'H':\n return color.toFormat('oklcha').getChannelRange(channel);\n\n default:\n return color.getChannelRange(channel);\n }\n}\n","import { withHeadless } from '@primereact/core/headless';\nimport { useControlledState } from '@primereact/hooks/use-controlled-state';\nimport type { ColorInputChannel, ColorInstance, ColorSliderChannel } from '@primereact/types/headless/inputcolor';\nimport * as React from 'react';\nimport { getAreaGradient, getChannelColor, getChannelGradient, getInputChannelRange, getInputChannelValue, parseColor } from './colorManager';\nimport { defaultProps } from './useInputColor.props';\n\nconst HEX_REGEX = /^[0-9a-fA-F]{3,8}$/;\n\nfunction isValidHex(value: string) {\n return HEX_REGEX.test(value);\n}\n\nfunction prefixHex(value: string) {\n if (value.startsWith('#')) return value;\n\n if (isValidHex(value)) return `#${value}`;\n\n return value;\n}\n\nfunction flipVerticalGradient(gradient: string) {\n return gradient.replace('to bottom', 'to top');\n}\n\nexport const useInputColor = withHeadless({\n name: 'useInputColor',\n defaultProps,\n setup({ props }) {\n const { format = 'hsba', disabled } = props;\n const [isAreaDragging, setIsAreaDragging] = React.useState(false);\n const inputElRefs = React.useRef<HTMLInputElement[]>([]);\n const areaDragOffset = React.useRef({ x: 0, y: 0 });\n\n const defaultValueRef = React.useRef<ColorInstance | undefined>(props.defaultValue ?? parseColor('#ff0000').toFormat(props.format || 'hsba'));\n\n const [value, setValue] = useControlledState({\n value: props.value,\n defaultValue: defaultValueRef.current,\n onChange: props.onValueChange\n });\n\n const ensuredValue: ColorInstance = React.useMemo(() => {\n return ((value as ColorInstance | undefined) ?? parseColor('#ff0000').toFormat(format)) as ColorInstance;\n }, [value, format]);\n\n const areaFormat = format.startsWith('hsl') ? 'hsla' : 'hsba';\n const areaValue = React.useMemo(() => {\n return ensuredValue.toFormat(areaFormat);\n }, [ensuredValue, areaFormat]);\n\n const state = {\n value: ensuredValue,\n isAreaDragging\n };\n\n const commitColor = (nextColor: ColorInstance, options?: { originalEvent?: React.SyntheticEvent }) => {\n setValue([\n nextColor,\n {\n color: nextColor.toString(format),\n value: nextColor,\n ...(options?.originalEvent ? { originalEvent: options.originalEvent } : {})\n }\n ]);\n\n syncChannelInputs(nextColor);\n };\n\n const moveArea = (x: number, y: number, element: HTMLElement) => {\n if (!element || disabled) return;\n\n const rect = element.getBoundingClientRect();\n const nx = Math.max(0, Math.min(1, (x - areaDragOffset.current.x - rect.left) / rect.width));\n const ny = Math.max(0, Math.min(1, (y - areaDragOffset.current.y - rect.top) / rect.height));\n\n const { xChannel, yChannel } = getAreaChannels();\n\n const xRange = areaValue.getChannelRange(xChannel);\n const yRange = areaValue.getChannelRange(yChannel);\n\n const xValue = nx * (xRange.max - xRange.min) + xRange.min;\n const yValue = (1 - ny) * (yRange.max - yRange.min) + yRange.min;\n\n const xDelta = xValue - areaValue.getChannelValue(xChannel);\n const yDelta = yValue - areaValue.getChannelValue(yChannel);\n\n const newColor = areaValue.incChannelValue(xChannel, xDelta).incChannelValue(yChannel, yDelta);\n\n commitColor(newColor);\n };\n\n const handleAreaPointerDown = (event: React.PointerEvent<HTMLElement>) => {\n const element = event.currentTarget as HTMLElement;\n\n if (!element || event.button !== 0) return;\n\n const target = event.target as HTMLElement | null;\n const handle = target?.closest?.('[data-part=\"area-handle\"], .p-input-color-area-handle') as HTMLElement | null;\n\n if (handle) {\n const handleRect = handle.getBoundingClientRect();\n const handleCenterX = handleRect.left + handleRect.width / 2;\n const handleCenterY = handleRect.top + handleRect.height / 2;\n\n areaDragOffset.current = {\n x: event.clientX - handleCenterX,\n y: event.clientY - handleCenterY\n };\n } else {\n areaDragOffset.current = { x: 0, y: 0 };\n }\n\n element.setPointerCapture(event.pointerId);\n setIsAreaDragging(true);\n moveArea(event.clientX, event.clientY, element);\n };\n\n const handleAreaPointerMove = (event: React.PointerEvent<HTMLElement>) => {\n if (!isAreaDragging) return;\n\n moveArea(event.clientX, event.clientY, event.currentTarget as HTMLElement);\n };\n\n const handleAreaPointerUp = (event: React.PointerEvent<HTMLElement>) => {\n const element = event.currentTarget as HTMLElement;\n\n if (!element) return;\n\n element.releasePointerCapture(event.pointerId);\n setIsAreaDragging(false);\n areaDragOffset.current = { x: 0, y: 0 };\n\n if (props.onValueChangeEnd) {\n props.onValueChangeEnd({\n originalEvent: event,\n color: ensuredValue.toString(format),\n value: ensuredValue\n });\n }\n };\n\n const handleAreaBlur = (event: React.FocusEvent<HTMLElement>) => {\n if (!props.onValueChangeEnd) return;\n\n props.onValueChangeEnd({\n originalEvent: event,\n color: ensuredValue.toString(format),\n value: ensuredValue\n });\n };\n\n const handleAreaKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (disabled) return;\n\n const key = event.key;\n\n if (!['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'].includes(key)) return;\n\n event.preventDefault();\n\n const { xChannel, yChannel } = getAreaChannels();\n const { step: stepX } = areaValue.getChannelRange(xChannel);\n const { step: stepY } = areaValue.getChannelRange(yChannel);\n\n let next = areaValue;\n\n if (key === 'ArrowRight') next = next.incChannelValue(xChannel, stepX);\n\n if (key === 'ArrowLeft') next = next.decChannelValue(xChannel, stepX);\n\n if (key === 'ArrowUp') next = next.incChannelValue(yChannel, stepY);\n\n if (key === 'ArrowDown') next = next.decChannelValue(yChannel, stepY);\n\n commitColor(next);\n\n if (props.onValueChangeEnd) {\n props.onValueChangeEnd({\n originalEvent: event,\n color: next.toString(format),\n value: next\n });\n }\n };\n\n const getAreaChannels = () => {\n const channels = areaValue.getChannels();\n\n return {\n xChannel: channels[1],\n yChannel: channels[2]\n };\n };\n\n const openEyeDropper = () => {\n // @ts-expect-error - EyeDropper is not supported by some browsers\n if ((typeof window !== 'undefined' && !window.EyeDropper) || disabled) return;\n\n const eyeDropper = new (window as Window & typeof globalThis & { EyeDropper: new () => { open: () => Promise<{ sRGBHex: string }> } }).EyeDropper();\n\n eyeDropper\n .open()\n .then((result: { sRGBHex: string }) => {\n const newColor = parseColor(result.sRGBHex);\n\n commitColor(newColor);\n })\n .catch((e: Error) => {\n // User cancelled the eyedropper\n // eslint-disable-next-line no-console\n console.error('Error opening eyedropper', e);\n });\n };\n\n const areaChannels = getAreaChannels();\n const { min: minX, max: maxX } = areaValue.getChannelRange(areaChannels.xChannel);\n const { min: minY, max: maxY } = areaValue.getChannelRange(areaChannels.yChannel);\n const xValue = areaValue.getChannelValue(areaChannels.xChannel);\n const yValue = areaValue.getChannelValue(areaChannels.yChannel);\n\n const areaStyles = {\n ...getAreaGradient(areaValue, areaChannels),\n '--px-handle-background': areaValue.withChannelValue('alpha', 1).toString('css'),\n '--px-handle-position-left': ((xValue - minX) / (maxX - minX)) * 100 + '%',\n '--px-handle-position-top': (1 - (yValue - minY) / (maxY - minY)) * 100 + '%'\n } as React.CSSProperties;\n\n const swatchStyles = {\n '--px-swatch-background': ensuredValue.toString('css')\n } as React.CSSProperties;\n\n const getSliderProps = ({\n channel = 'hue',\n orientation = 'horizontal',\n disabled: sliderDisabled\n }: {\n channel?: ColorSliderChannel;\n orientation?: 'horizontal' | 'vertical';\n disabled?: boolean;\n } = {}) => {\n const isDisabled = disabled || sliderDisabled;\n const workingValue = channel === 'alpha' ? areaValue : ensuredValue.getChannels().includes(channel) ? ensuredValue : areaValue.getChannels().includes(channel) ? areaValue : ensuredValue.toFormat(format);\n\n const channelRange = workingValue.getChannelRange(channel);\n const channelValue = workingValue.getChannelValue(channel);\n\n const baseGradient = getChannelGradient(channel, workingValue, orientation);\n const sliderBackground = orientation === 'vertical' ? flipVerticalGradient(baseGradient) : baseGradient;\n\n const sliderStyle = {\n '--px-slider-background': sliderBackground,\n '--px-slider-handle-background': getChannelColor(workingValue, channel).toString('css')\n } as React.CSSProperties;\n\n const onValueChange = (event: { originalEvent: React.SyntheticEvent; value: number | number[] | undefined }) => {\n if (isDisabled) return;\n\n const nextValue = Array.isArray(event.value) ? event.value[0] : event.value;\n\n if (nextValue === undefined || Number.isNaN(nextValue)) return;\n\n const nextColor = workingValue.withChannelValue(channel, nextValue);\n\n commitColor(nextColor, { originalEvent: event.originalEvent });\n };\n\n const onValueChangeEnd = (event: { originalEvent: React.SyntheticEvent; value: number | number[] | undefined }) => {\n if (isDisabled || !props.onValueChangeEnd) return;\n\n const nextValue = Array.isArray(event.value) ? event.value[0] : event.value;\n\n if (nextValue === undefined || Number.isNaN(nextValue)) return;\n\n const nextColor = workingValue.withChannelValue(channel, nextValue);\n\n props.onValueChangeEnd({\n originalEvent: event.originalEvent,\n color: nextColor.toString(format),\n value: nextColor\n });\n };\n\n return {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'slider' as const,\n 'data-orientation': orientation,\n 'data-channel': channel,\n orientation,\n style: sliderStyle,\n value: channelValue,\n min: channelRange.min,\n max: channelRange.max,\n step: channelRange.step,\n disabled: isDisabled,\n onValueChange,\n onValueChangeEnd\n };\n };\n\n const registerInputEl = (el: { elementRef: React.RefObject<HTMLInputElement> }) => {\n const element = el.elementRef.current;\n\n if (inputElRefs.current.includes(element)) return;\n\n inputElRefs.current.push(element);\n };\n\n const syncChannelInputs = (color?: ColorInstance) => {\n requestAnimationFrame(() => {\n const base = color || ensuredValue;\n\n const channelInputs = inputElRefs.current;\n\n channelInputs.forEach((input) => {\n const channel = input.getAttribute('data-channel');\n\n if (channel) {\n const channelValue = getInputChannelValue(base, channel as ColorInputChannel, format);\n\n input.value = String(channelValue);\n }\n });\n });\n };\n\n React.useEffect(() => {\n syncChannelInputs();\n }, [ensuredValue, format]);\n\n // prop getters\n\n const getInputProps = ({\n channel = 'hex',\n disabled: inputDisabled\n }: {\n channel?: ColorInputChannel;\n disabled?: boolean;\n } = {}) => {\n const isDisabled = disabled || inputDisabled;\n const colorValue = ensuredValue as ColorInstance;\n const colorFormat = format;\n const channelRange = getInputChannelRange(colorValue, channel);\n const channelValue = getInputChannelValue(colorValue, channel, colorFormat);\n const isCssChannel = channel === 'hex' || channel === 'css';\n\n const changeValue = (value: string | number) => {\n if (isDisabled) return undefined;\n\n let newColor: ColorInstance;\n\n if (isCssChannel) {\n try {\n newColor = parseColor(channel === 'hex' ? prefixHex(String(value)) : String(value));\n } catch {\n newColor = colorValue;\n }\n } else {\n let current = colorValue;\n\n if (channel !== 'alpha') {\n current = current.toFormat(colorFormat);\n }\n\n const parsed = Number.parseFloat(String(value));\n const valueAsNumber = Number.isNaN(parsed) ? current.getChannelValue(channel) : parsed;\n\n newColor = current.withChannelValue(channel, valueAsNumber);\n }\n\n commitColor(newColor);\n\n return newColor;\n };\n\n const commitInputValue = (event: React.FocusEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>) => {\n const currentTarget = event.currentTarget as HTMLInputElement;\n const value = isCssChannel ? currentTarget.value : currentTarget.valueAsNumber;\n const nextColor = changeValue(value);\n\n if (!nextColor || !props.onValueChangeEnd) return;\n\n props.onValueChangeEnd({\n originalEvent: event,\n color: nextColor.toString(format),\n value: nextColor\n });\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const currentTarget = event.currentTarget as HTMLInputElement;\n const value = isCssChannel ? currentTarget.value : currentTarget.valueAsNumber;\n\n changeValue(value);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n commitInputValue(event);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.defaultPrevented) return;\n\n if (event.key === 'Enter') {\n commitInputValue(event);\n event.preventDefault();\n }\n };\n\n return {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'input' as const,\n type: (isCssChannel ? 'text' : 'number') as 'text' | 'number',\n spellCheck: false as const,\n autoComplete: 'off' as const,\n disabled: !!isDisabled,\n 'data-channel': channel,\n 'aria-label': channel,\n min: channelRange?.min,\n max: channelRange?.max,\n step: channelRange?.step,\n channelValue,\n onChange: handleChange,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown\n };\n };\n\n const rootProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'root' as const,\n ...(disabled && { 'data-disabled': '' as const }),\n ...(isAreaDragging && { 'data-dragging': '' as const })\n };\n\n const areaProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'area' as const,\n style: areaStyles,\n onPointerDown: handleAreaPointerDown,\n onPointerMove: handleAreaPointerMove,\n onPointerUp: handleAreaPointerUp\n };\n\n const areaHandleProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'area-handle' as const,\n role: 'slider' as const,\n tabIndex: disabled ? -1 : 0,\n 'aria-disabled': disabled,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'aria-valuenow': areaValue.getChannelValue(areaChannels.xChannel),\n 'aria-label': `${areaChannels.xChannel} and ${areaChannels.yChannel}`,\n 'aria-roledescription': '2d slider',\n 'aria-valuetext': `${areaChannels.xChannel} ${areaValue.getChannelValue(areaChannels.xChannel)}, ${areaChannels.yChannel} ${areaValue.getChannelValue(areaChannels.yChannel)}`,\n onKeyDown: handleAreaKeyDown,\n onBlur: handleAreaBlur\n };\n\n const swatchProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'swatch' as const,\n style: swatchStyles\n };\n\n const eyeDropperProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'eye-dropper' as const,\n disabled: !!disabled,\n onClick: openEyeDropper\n };\n\n const sliderHandleProps = {\n 'data-scope': 'inputcolor' as const,\n 'data-part': 'slider-handle' as const,\n role: 'slider' as const,\n tabIndex: disabled ? -1 : 0,\n 'aria-disabled': disabled\n };\n\n return {\n state,\n value,\n areaValue,\n areaChannels,\n // prop getters\n rootProps,\n areaProps,\n areaHandleProps,\n swatchProps,\n eyeDropperProps,\n sliderHandleProps,\n getInputProps,\n getSliderProps,\n // methods\n setValue,\n handleAreaPointerDown,\n handleAreaPointerMove,\n handleAreaPointerUp,\n handleAreaBlur,\n handleAreaKeyDown,\n areaStyles,\n swatchStyles,\n openEyeDropper,\n syncChannelInputs,\n registerInputEl\n };\n }\n});\n","import type { UseInputColorProps } from '@primereact/types/headless/inputcolor';\n\nexport const defaultProps: UseInputColorProps = {\n defaultValue: undefined,\n value: undefined,\n format: 'hsba',\n disabled: false,\n onValueChange: undefined,\n onValueChangeEnd: undefined\n};\n"],"mappings":"8bAKA,IAAMA,GAAY,kLAEZC,GAAY,kLAEZC,GAAY,yBAEZC,GAAY,2BAEZC,GAAc,2EAGpB,SAASC,EAAMC,EAAeC,EAAaC,EAAa,CACpD,OAAO,KAAK,IAAI,KAAK,IAAIF,EAAOC,CAAG,EAAGC,CAAG,CAC7C,CAEO,IAAMC,GAAU,CAACC,EAAYC,IAAe,KAAK,UAAUD,CAAC,IAAM,KAAK,UAAUC,CAAC,EAEnFC,EAAmB,CAACC,EAAaC,IAC5B,CAACD,EAAE,CAAC,EAAIC,EAAE,CAAC,EAAID,EAAE,CAAC,EAAIC,EAAE,CAAC,EAAID,EAAE,CAAC,EAAIC,EAAE,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Aa,QACThB,GAAY,CAAE,gBAAiB,EAAY,GAC3CC,GAAkB,CAAE,gBAAiB,EAAY,GAGnDmG,GAAY,CACd,aAAc,aACd,YAAa,OACb,MAAOzC,GACP,cAAexB,EACf,cAAeO,EACf,YAAaC,CACjB,EAEM0D,GAAkB,CACpB,aAAc,aACd,YAAa,cACb,KAAM,SACN,SAAUrG,EAAW,GAAK,EAC1B,gBAAiBA,EACjB,gBAAiB,EACjB,gBAAiB,IACjB,gBAAiBW,EAAU,gBAAgB2C,EAAa,QAAQ,EAChE,aAAc,GAAGA,EAAa,QAAQ,QAAQA,EAAa,QAAQ,GACnE,uBAAwB,YACxB,iBAAkB,GAAGA,EAAa,QAAQ,IAAI3C,EAAU,gBAAgB2C,EAAa,QAAQ,CAAC,KAAKA,EAAa,QAAQ,IAAI3C,EAAU,gBAAgB2C,EAAa,QAAQ,CAAC,GAC5K,UAAWT,EACX,OAAQD,CACZ,EAuBA,MAAO,CACH,MAAAhC,EACA,MAAAtB,EACA,UAAAqB,EACA,aAAA2C,EAEA,UAAA6C,GACA,UAAAC,GACA,gBAAAC,GACA,YA9BgB,CAChB,aAAc,aACd,YAAa,SACb,MAAOvC,EACX,EA2BI,gBAzBoB,CACpB,aAAc,aACd,YAAa,cACb,SAAU,CAAC,CAAC9D,EACZ,QAASmD,CACb,EAqBI,kBAnBsB,CACtB,aAAc,aACd,YAAa,gBACb,KAAM,SACN,SAAUnD,EAAW,GAAK,EAC1B,gBAAiBA,CACrB,EAcI,cAAAoF,GACA,eAAArB,GAEA,SAAAxD,EACA,sBAAA4B,EACA,sBAAAO,EACA,oBAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,WAAAc,GACA,aAAAG,GACA,eAAAX,EACA,kBAAAlC,EACA,gBAAA6D,EACJ,CACJ,CACJ,CAAC","names":["HSB_REGEX","HSL_REGEX","HEX_REGEX","RGB_REGEX","OKLCH_REGEX","clamp","value","min","max","isEqual","a","b","multiplyMatrices","A","B","snap","step","offset","steps","snapped","precision","Color","channel","cloned","xyChannels","xChannel","yChannel","zChannel","availableStep","HSBColor","_HSBColor","hue","saturation","brightness","alpha","_a","match","h","s","n","f","k","RGBColor","l","HSLColor","format","_HSLColor","lightness","_b","_RGBColor","red","green","blue","input","hex","c","r","g","rStr","gStr","bStr","aStr","v","mmax","mmin","chroma","rgbLinear","xyz","LMSg","val","L","C","H","outL","outC","outH","OKLCHColor","_OKLCHColor","m","LMS","b2","parseColor","color","_c","parsedColor","getChannelGradient","orientation","direction","start","middle","end","getChannelColor","channelGenerators","getAreaGradient","axes","zValue","baseFormat","base","channels","layers","getInputChannelValue","isHSL","getInputChannelRange","withHeadless","useControlledState","React","defaultProps","HEX_REGEX","isValidHex","value","prefixHex","flipVerticalGradient","gradient","useInputColor","withHeadless","defaultProps","props","_a","format","disabled","isAreaDragging","setIsAreaDragging","inputElRefs","areaDragOffset","defaultValueRef","parseColor","setValue","useControlledState","ensuredValue","areaFormat","areaValue","state","commitColor","nextColor","options","__spreadValues","syncChannelInputs","moveArea","x","y","element","rect","nx","ny","xChannel","yChannel","getAreaChannels","xRange","yRange","xValue","yValue","xDelta","yDelta","newColor","handleAreaPointerDown","event","target","handle","handleRect","handleCenterX","handleCenterY","handleAreaPointerMove","handleAreaPointerUp","handleAreaBlur","handleAreaKeyDown","key","stepX","stepY","next","channels","openEyeDropper","result","e","areaChannels","minX","maxX","minY","maxY","areaStyles","__spreadProps","getAreaGradient","swatchStyles","getSliderProps","channel","orientation","sliderDisabled","isDisabled","workingValue","channelRange","channelValue","baseGradient","getChannelGradient","sliderStyle","getChannelColor","onValueChange","nextValue","onValueChangeEnd","registerInputEl","el","color","base","input","getInputChannelValue","getInputProps","inputDisabled","colorValue","colorFormat","getInputChannelRange","isCssChannel","changeValue","current","parsed","valueAsNumber","commitInputValue","currentTarget","handleChange","handleBlur","handleKeyDown","rootProps","areaProps","areaHandleProps"]}