@kapiuara/ui 0.0.0-stage → 0.1.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 (425) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +764 -2
  3. package/dist/components/data/KapiPagination.d.ts +36 -0
  4. package/dist/components/data/KapiPagination.js +102 -0
  5. package/dist/components/data/KapiTable.d.ts +245 -0
  6. package/dist/components/data/KapiTable.js +748 -0
  7. package/dist/components/data/KapiTableFilter.d.ts +48 -0
  8. package/dist/components/data/KapiTableFilter.js +81 -0
  9. package/dist/components/data/index.d.ts +10 -0
  10. package/dist/components/data/tableLogic.d.ts +197 -0
  11. package/dist/components/data/tableLogic.js +145 -0
  12. package/dist/components/data/tableResizeLogic.d.ts +28 -0
  13. package/dist/components/data/tableResizeLogic.js +20 -0
  14. package/dist/components/display/KapiAnnotation.d.ts +32 -0
  15. package/dist/components/display/KapiAnnotation.js +130 -0
  16. package/dist/components/display/KapiAvatar.d.ts +27 -0
  17. package/dist/components/display/KapiAvatar.js +43 -0
  18. package/dist/components/display/KapiAvatarGroup.d.ts +19 -0
  19. package/dist/components/display/KapiAvatarGroup.js +38 -0
  20. package/dist/components/display/KapiBadge.d.ts +21 -0
  21. package/dist/components/display/KapiBadge.js +28 -0
  22. package/dist/components/display/KapiComment.d.ts +27 -0
  23. package/dist/components/display/KapiComment.js +66 -0
  24. package/dist/components/display/KapiCommentComposer.d.ts +49 -0
  25. package/dist/components/display/KapiCommentComposer.js +76 -0
  26. package/dist/components/display/KapiDescriptionList.d.ts +19 -0
  27. package/dist/components/display/KapiDescriptionList.js +35 -0
  28. package/dist/components/display/KapiFileItem.d.ts +39 -0
  29. package/dist/components/display/KapiFileItem.js +74 -0
  30. package/dist/components/display/KapiFileViewer.d.ts +51 -0
  31. package/dist/components/display/KapiFileViewer.js +107 -0
  32. package/dist/components/display/KapiIconTile.d.ts +16 -0
  33. package/dist/components/display/KapiIconTile.js +29 -0
  34. package/dist/components/display/KapiStat.d.ts +24 -0
  35. package/dist/components/display/KapiStat.js +41 -0
  36. package/dist/components/display/KapiTag.d.ts +27 -0
  37. package/dist/components/display/KapiTag.js +44 -0
  38. package/dist/components/display/KapiTimeline.d.ts +15 -0
  39. package/dist/components/display/KapiTimeline.js +30 -0
  40. package/dist/components/display/annotationLogic.d.ts +26 -0
  41. package/dist/components/display/annotationLogic.js +17 -0
  42. package/dist/components/display/avatarGroupLogic.d.ts +14 -0
  43. package/dist/components/display/avatarGroupLogic.js +13 -0
  44. package/dist/components/display/avatarLogic.d.ts +5 -0
  45. package/dist/components/display/avatarLogic.js +9 -0
  46. package/dist/components/display/commentLogic.d.ts +18 -0
  47. package/dist/components/display/commentLogic.js +7 -0
  48. package/dist/components/display/fileItemLogic.d.ts +9 -0
  49. package/dist/components/display/fileItemLogic.js +12 -0
  50. package/dist/components/display/iconTileLogic.d.ts +13 -0
  51. package/dist/components/display/iconTileLogic.js +13 -0
  52. package/dist/components/display/index.d.ts +40 -0
  53. package/dist/components/display/statLogic.d.ts +10 -0
  54. package/dist/components/display/statLogic.js +10 -0
  55. package/dist/components/display/tagLogic.d.ts +11 -0
  56. package/dist/components/display/tagLogic.js +10 -0
  57. package/dist/components/display/timelineLogic.d.ts +5 -0
  58. package/dist/components/display/timelineLogic.js +4 -0
  59. package/dist/components/feedback/KapiAlert.d.ts +28 -0
  60. package/dist/components/feedback/KapiAlert.js +53 -0
  61. package/dist/components/feedback/KapiBulkBar.d.ts +30 -0
  62. package/dist/components/feedback/KapiBulkBar.js +34 -0
  63. package/dist/components/feedback/KapiCountdown.d.ts +26 -0
  64. package/dist/components/feedback/KapiCountdown.js +43 -0
  65. package/dist/components/feedback/KapiEmpty.d.ts +14 -0
  66. package/dist/components/feedback/KapiEmpty.js +31 -0
  67. package/dist/components/feedback/KapiFab.d.ts +34 -0
  68. package/dist/components/feedback/KapiFab.js +116 -0
  69. package/dist/components/feedback/KapiOfflineBanner.d.ts +25 -0
  70. package/dist/components/feedback/KapiOfflineBanner.js +40 -0
  71. package/dist/components/feedback/KapiProgress.d.ts +24 -0
  72. package/dist/components/feedback/KapiProgress.js +94 -0
  73. package/dist/components/feedback/KapiSkeleton.d.ts +12 -0
  74. package/dist/components/feedback/KapiSkeleton.js +16 -0
  75. package/dist/components/feedback/KapiToastContainer.d.ts +16 -0
  76. package/dist/components/feedback/KapiToastContainer.js +81 -0
  77. package/dist/components/feedback/KapiTour.d.ts +40 -0
  78. package/dist/components/feedback/KapiTour.js +157 -0
  79. package/dist/components/feedback/KapiUnsavedBar.d.ts +35 -0
  80. package/dist/components/feedback/KapiUnsavedBar.js +47 -0
  81. package/dist/components/feedback/bulkBarLogic.d.ts +2 -0
  82. package/dist/components/feedback/bulkBarLogic.js +7 -0
  83. package/dist/components/feedback/countdownLogic.d.ts +74 -0
  84. package/dist/components/feedback/countdownLogic.js +70 -0
  85. package/dist/components/feedback/fabLogic.d.ts +17 -0
  86. package/dist/components/feedback/fabLogic.js +10 -0
  87. package/dist/components/feedback/index.d.ts +33 -0
  88. package/dist/components/feedback/offlineBannerLogic.d.ts +10 -0
  89. package/dist/components/feedback/offlineBannerLogic.js +8 -0
  90. package/dist/components/feedback/progressLogic.d.ts +17 -0
  91. package/dist/components/feedback/progressLogic.js +16 -0
  92. package/dist/components/feedback/toastStore.d.ts +62 -0
  93. package/dist/components/feedback/toastStore.js +38 -0
  94. package/dist/components/feedback/tourLogic.d.ts +64 -0
  95. package/dist/components/feedback/tourLogic.js +31 -0
  96. package/dist/components/feedback/unsavedBarLogic.d.ts +2 -0
  97. package/dist/components/feedback/unsavedBarLogic.js +8 -0
  98. package/dist/components/inputs/KapiAutocomplete.d.ts +81 -0
  99. package/dist/components/inputs/KapiAutocomplete.js +205 -0
  100. package/dist/components/inputs/KapiButton.d.ts +23 -0
  101. package/dist/components/inputs/KapiButton.js +25 -0
  102. package/dist/components/inputs/KapiCalendar.d.ts +35 -0
  103. package/dist/components/inputs/KapiCalendar.js +60 -0
  104. package/dist/components/inputs/KapiCalendarGrid.d.ts +29 -0
  105. package/dist/components/inputs/KapiCalendarGrid.js +65 -0
  106. package/dist/components/inputs/KapiCheckCard.d.ts +28 -0
  107. package/dist/components/inputs/KapiCheckCard.js +41 -0
  108. package/dist/components/inputs/KapiCheckbox.d.ts +7 -0
  109. package/dist/components/inputs/KapiCheckbox.js +5 -0
  110. package/dist/components/inputs/KapiDatePicker.d.ts +46 -0
  111. package/dist/components/inputs/KapiDatePicker.js +189 -0
  112. package/dist/components/inputs/KapiDateRangePicker.d.ts +49 -0
  113. package/dist/components/inputs/KapiDateRangePicker.js +179 -0
  114. package/dist/components/inputs/KapiFacetedSearch.d.ts +45 -0
  115. package/dist/components/inputs/KapiFacetedSearch.js +188 -0
  116. package/dist/components/inputs/KapiField.d.ts +33 -0
  117. package/dist/components/inputs/KapiField.js +60 -0
  118. package/dist/components/inputs/KapiFileUpload.d.ts +58 -0
  119. package/dist/components/inputs/KapiFileUpload.js +134 -0
  120. package/dist/components/inputs/KapiIconButton.d.ts +13 -0
  121. package/dist/components/inputs/KapiIconButton.js +16 -0
  122. package/dist/components/inputs/KapiInput.d.ts +92 -0
  123. package/dist/components/inputs/KapiInput.js +123 -0
  124. package/dist/components/inputs/KapiInputGroup.d.ts +37 -0
  125. package/dist/components/inputs/KapiInputGroup.js +29 -0
  126. package/dist/components/inputs/KapiMaskedInput.d.ts +52 -0
  127. package/dist/components/inputs/KapiMaskedInput.js +78 -0
  128. package/dist/components/inputs/KapiNumberStepper.d.ts +44 -0
  129. package/dist/components/inputs/KapiNumberStepper.js +100 -0
  130. package/dist/components/inputs/KapiRadio.d.ts +7 -0
  131. package/dist/components/inputs/KapiRadio.js +5 -0
  132. package/dist/components/inputs/KapiRating.d.ts +55 -0
  133. package/dist/components/inputs/KapiRating.js +99 -0
  134. package/dist/components/inputs/KapiSegmented.d.ts +41 -0
  135. package/dist/components/inputs/KapiSegmented.js +83 -0
  136. package/dist/components/inputs/KapiSelect.d.ts +109 -0
  137. package/dist/components/inputs/KapiSelect.js +443 -0
  138. package/dist/components/inputs/KapiSlider.d.ts +42 -0
  139. package/dist/components/inputs/KapiSlider.js +70 -0
  140. package/dist/components/inputs/KapiSwitch.d.ts +13 -0
  141. package/dist/components/inputs/KapiSwitch.js +28 -0
  142. package/dist/components/inputs/KapiTagInput.d.ts +79 -0
  143. package/dist/components/inputs/KapiTagInput.js +115 -0
  144. package/dist/components/inputs/KapiTextarea.d.ts +32 -0
  145. package/dist/components/inputs/KapiTextarea.js +67 -0
  146. package/dist/components/inputs/asyncSelectLogic.d.ts +42 -0
  147. package/dist/components/inputs/asyncSelectLogic.js +46 -0
  148. package/dist/components/inputs/autocompleteLogic.d.ts +73 -0
  149. package/dist/components/inputs/autocompleteLogic.js +67 -0
  150. package/dist/components/inputs/checkControl.d.ts +20 -0
  151. package/dist/components/inputs/checkControl.js +31 -0
  152. package/dist/components/inputs/datePickerLogic.d.ts +92 -0
  153. package/dist/components/inputs/datePickerLogic.js +174 -0
  154. package/dist/components/inputs/dateRangeLogic.d.ts +31 -0
  155. package/dist/components/inputs/dateRangeLogic.js +44 -0
  156. package/dist/components/inputs/facetedSearchLogic.d.ts +69 -0
  157. package/dist/components/inputs/facetedSearchLogic.js +39 -0
  158. package/dist/components/inputs/fieldLogic.d.ts +67 -0
  159. package/dist/components/inputs/fieldLogic.js +35 -0
  160. package/dist/components/inputs/fileUploadLogic.d.ts +13 -0
  161. package/dist/components/inputs/fileUploadLogic.js +9 -0
  162. package/dist/components/inputs/index.d.ts +55 -0
  163. package/dist/components/inputs/inputGroupLogic.d.ts +22 -0
  164. package/dist/components/inputs/inputGroupLogic.js +9 -0
  165. package/dist/components/inputs/inputLogic.d.ts +25 -0
  166. package/dist/components/inputs/inputLogic.js +10 -0
  167. package/dist/components/inputs/maskLogic.d.ts +34 -0
  168. package/dist/components/inputs/maskLogic.js +57 -0
  169. package/dist/components/inputs/numberStepLogic.d.ts +14 -0
  170. package/dist/components/inputs/numberStepLogic.js +21 -0
  171. package/dist/components/inputs/ratingLogic.d.ts +9 -0
  172. package/dist/components/inputs/ratingLogic.js +22 -0
  173. package/dist/components/inputs/segmentedLogic.d.ts +6 -0
  174. package/dist/components/inputs/segmentedLogic.js +14 -0
  175. package/dist/components/inputs/selectLogic.d.ts +89 -0
  176. package/dist/components/inputs/selectLogic.js +82 -0
  177. package/dist/components/inputs/sliderLogic.d.ts +9 -0
  178. package/dist/components/inputs/sliderLogic.js +17 -0
  179. package/dist/components/inputs/tagInputLogic.d.ts +40 -0
  180. package/dist/components/inputs/tagInputLogic.js +40 -0
  181. package/dist/components/inputs/textareaLogic.d.ts +17 -0
  182. package/dist/components/inputs/textareaLogic.js +13 -0
  183. package/dist/components/inputs/useCalendarFocus.d.ts +13 -0
  184. package/dist/components/inputs/useCalendarFocus.js +25 -0
  185. package/dist/components/inputs/useDatePopSide.d.ts +15 -0
  186. package/dist/components/inputs/useDatePopSide.js +20 -0
  187. package/dist/components/labelsLogic.d.ts +6 -0
  188. package/dist/components/labelsLogic.js +11 -0
  189. package/dist/components/layout/KapiAccessCard.d.ts +40 -0
  190. package/dist/components/layout/KapiAccessCard.js +66 -0
  191. package/dist/components/layout/KapiAccountMenu.d.ts +61 -0
  192. package/dist/components/layout/KapiAccountMenu.js +212 -0
  193. package/dist/components/layout/KapiCard.d.ts +43 -0
  194. package/dist/components/layout/KapiCard.js +53 -0
  195. package/dist/components/layout/KapiCluster.d.ts +15 -0
  196. package/dist/components/layout/KapiCluster.js +21 -0
  197. package/dist/components/layout/KapiContextSlot.d.ts +45 -0
  198. package/dist/components/layout/KapiContextSlot.js +92 -0
  199. package/dist/components/layout/KapiDivider.d.ts +16 -0
  200. package/dist/components/layout/KapiDivider.js +41 -0
  201. package/dist/components/layout/KapiGrid.d.ts +19 -0
  202. package/dist/components/layout/KapiGrid.js +25 -0
  203. package/dist/components/layout/KapiNotificationBell.d.ts +75 -0
  204. package/dist/components/layout/KapiNotificationBell.js +196 -0
  205. package/dist/components/layout/KapiPageHeader.d.ts +28 -0
  206. package/dist/components/layout/KapiPageHeader.js +47 -0
  207. package/dist/components/layout/KapiPanelParts.d.ts +35 -0
  208. package/dist/components/layout/KapiPanelParts.js +63 -0
  209. package/dist/components/layout/KapiRail.d.ts +40 -0
  210. package/dist/components/layout/KapiRail.js +102 -0
  211. package/dist/components/layout/KapiScrollArea.d.ts +40 -0
  212. package/dist/components/layout/KapiScrollArea.js +49 -0
  213. package/dist/components/layout/KapiShell.d.ts +40 -0
  214. package/dist/components/layout/KapiShell.js +48 -0
  215. package/dist/components/layout/KapiStack.d.ts +11 -0
  216. package/dist/components/layout/KapiStack.js +19 -0
  217. package/dist/components/layout/accessCardLogic.d.ts +18 -0
  218. package/dist/components/layout/accessCardLogic.js +11 -0
  219. package/dist/components/layout/cardLogic.d.ts +9 -0
  220. package/dist/components/layout/cardLogic.js +11 -0
  221. package/dist/components/layout/index.d.ts +33 -0
  222. package/dist/components/layout/layoutPrimitives.d.ts +51 -0
  223. package/dist/components/layout/layoutPrimitives.js +58 -0
  224. package/dist/components/layout/notificationBellLogic.d.ts +20 -0
  225. package/dist/components/layout/notificationBellLogic.js +14 -0
  226. package/dist/components/layout/railLogic.d.ts +52 -0
  227. package/dist/components/layout/railLogic.js +16 -0
  228. package/dist/components/locale/KapiLocaleProvider.d.ts +29 -0
  229. package/dist/components/locale/KapiLocaleProvider.js +27 -0
  230. package/dist/components/locale/index.d.ts +5 -0
  231. package/dist/components/locale/labelRegistry.d.ts +110 -0
  232. package/dist/components/locale/linkLabels.d.ts +6 -0
  233. package/dist/components/locale/linkLabels.js +4 -0
  234. package/dist/components/navigation/CtxSlidingList.d.ts +11 -0
  235. package/dist/components/navigation/CtxSlidingList.js +24 -0
  236. package/dist/components/navigation/KapiAccordion.d.ts +24 -0
  237. package/dist/components/navigation/KapiAccordion.js +68 -0
  238. package/dist/components/navigation/KapiBreadcrumb.d.ts +23 -0
  239. package/dist/components/navigation/KapiBreadcrumb.js +32 -0
  240. package/dist/components/navigation/KapiCollapsiblePanel.d.ts +63 -0
  241. package/dist/components/navigation/KapiCollapsiblePanel.js +83 -0
  242. package/dist/components/navigation/KapiContextPanel.d.ts +117 -0
  243. package/dist/components/navigation/KapiContextPanel.js +265 -0
  244. package/dist/components/navigation/KapiFilterChips.d.ts +30 -0
  245. package/dist/components/navigation/KapiFilterChips.js +40 -0
  246. package/dist/components/navigation/KapiNavBadge.d.ts +26 -0
  247. package/dist/components/navigation/KapiNavBadge.js +33 -0
  248. package/dist/components/navigation/KapiPanelGroup.d.ts +69 -0
  249. package/dist/components/navigation/KapiPanelGroup.js +149 -0
  250. package/dist/components/navigation/KapiSteps.d.ts +43 -0
  251. package/dist/components/navigation/KapiSteps.js +63 -0
  252. package/dist/components/navigation/KapiTabs.d.ts +56 -0
  253. package/dist/components/navigation/KapiTabs.js +81 -0
  254. package/dist/components/navigation/KapiTree.d.ts +56 -0
  255. package/dist/components/navigation/KapiTree.js +157 -0
  256. package/dist/components/navigation/KapiWizard.d.ts +49 -0
  257. package/dist/components/navigation/KapiWizard.js +104 -0
  258. package/dist/components/navigation/MiniNavItem.d.ts +35 -0
  259. package/dist/components/navigation/MiniNavItem.js +57 -0
  260. package/dist/components/navigation/accordionLogic.d.ts +4 -0
  261. package/dist/components/navigation/accordionLogic.js +4 -0
  262. package/dist/components/navigation/activeItemLogic.d.ts +7 -0
  263. package/dist/components/navigation/activeItemLogic.js +4 -0
  264. package/dist/components/navigation/breadcrumbLogic.d.ts +8 -0
  265. package/dist/components/navigation/breadcrumbLogic.js +4 -0
  266. package/dist/components/navigation/contextPanelLogic.d.ts +27 -0
  267. package/dist/components/navigation/contextPanelLogic.js +11 -0
  268. package/dist/components/navigation/filterChipsLogic.d.ts +23 -0
  269. package/dist/components/navigation/filterChipsLogic.js +20 -0
  270. package/dist/components/navigation/index.d.ts +39 -0
  271. package/dist/components/navigation/navBadgeLogic.d.ts +26 -0
  272. package/dist/components/navigation/navBadgeLogic.js +16 -0
  273. package/dist/components/navigation/panelGroupLogic.d.ts +15 -0
  274. package/dist/components/navigation/panelGroupLogic.js +13 -0
  275. package/dist/components/navigation/panelMini.d.ts +13 -0
  276. package/dist/components/navigation/panelMini.js +9 -0
  277. package/dist/components/navigation/panelMiniLogic.d.ts +19 -0
  278. package/dist/components/navigation/panelMiniLogic.js +6 -0
  279. package/dist/components/navigation/stepsLogic.d.ts +25 -0
  280. package/dist/components/navigation/stepsLogic.js +10 -0
  281. package/dist/components/navigation/tabsLogic.d.ts +12 -0
  282. package/dist/components/navigation/tabsLogic.js +14 -0
  283. package/dist/components/navigation/treeLogic.d.ts +80 -0
  284. package/dist/components/navigation/treeLogic.js +91 -0
  285. package/dist/components/navigation/wizardLogic.d.ts +11 -0
  286. package/dist/components/navigation/wizardLogic.js +7 -0
  287. package/dist/components/overlays/KapiCanvasForm.d.ts +42 -0
  288. package/dist/components/overlays/KapiCanvasForm.js +60 -0
  289. package/dist/components/overlays/KapiCommandPalette.d.ts +58 -0
  290. package/dist/components/overlays/KapiCommandPalette.js +152 -0
  291. package/dist/components/overlays/KapiConfirm.d.ts +48 -0
  292. package/dist/components/overlays/KapiConfirm.js +94 -0
  293. package/dist/components/overlays/KapiContextMenu.d.ts +51 -0
  294. package/dist/components/overlays/KapiContextMenu.js +90 -0
  295. package/dist/components/overlays/KapiDialogHost.d.ts +23 -0
  296. package/dist/components/overlays/KapiDialogHost.js +129 -0
  297. package/dist/components/overlays/KapiDropdown.d.ts +30 -0
  298. package/dist/components/overlays/KapiDropdown.js +84 -0
  299. package/dist/components/overlays/KapiLoading.d.ts +14 -0
  300. package/dist/components/overlays/KapiLoading.js +43 -0
  301. package/dist/components/overlays/KapiMenuButton.d.ts +25 -0
  302. package/dist/components/overlays/KapiMenuButton.js +109 -0
  303. package/dist/components/overlays/KapiModal.d.ts +61 -0
  304. package/dist/components/overlays/KapiModal.js +106 -0
  305. package/dist/components/overlays/KapiOffcanvas.d.ts +96 -0
  306. package/dist/components/overlays/KapiOffcanvas.js +209 -0
  307. package/dist/components/overlays/KapiOffcanvasStack.d.ts +58 -0
  308. package/dist/components/overlays/KapiOffcanvasStack.js +84 -0
  309. package/dist/components/overlays/KapiPhotoView.d.ts +60 -0
  310. package/dist/components/overlays/KapiPhotoView.js +122 -0
  311. package/dist/components/overlays/KapiPopover.d.ts +46 -0
  312. package/dist/components/overlays/KapiPopover.js +68 -0
  313. package/dist/components/overlays/KapiShapeSheet.d.ts +34 -0
  314. package/dist/components/overlays/KapiShapeSheet.js +82 -0
  315. package/dist/components/overlays/KapiSplitModal.d.ts +41 -0
  316. package/dist/components/overlays/KapiSplitModal.js +125 -0
  317. package/dist/components/overlays/KapiTooltip.d.ts +38 -0
  318. package/dist/components/overlays/KapiTooltip.js +105 -0
  319. package/dist/components/overlays/canvasFormLogic.d.ts +18 -0
  320. package/dist/components/overlays/canvasFormLogic.js +16 -0
  321. package/dist/components/overlays/commandPaletteLogic.d.ts +29 -0
  322. package/dist/components/overlays/commandPaletteLogic.js +19 -0
  323. package/dist/components/overlays/dialogStore.d.ts +114 -0
  324. package/dist/components/overlays/dialogStore.js +76 -0
  325. package/dist/components/overlays/dialogUtils.d.ts +72 -0
  326. package/dist/components/overlays/dialogUtils.js +62 -0
  327. package/dist/components/overlays/exitPresenceLogic.d.ts +14 -0
  328. package/dist/components/overlays/exitPresenceLogic.js +5 -0
  329. package/dist/components/overlays/index.d.ts +38 -0
  330. package/dist/components/overlays/menuButtonLogic.d.ts +58 -0
  331. package/dist/components/overlays/menuButtonLogic.js +9 -0
  332. package/dist/components/overlays/menuKeyboardLogic.d.ts +25 -0
  333. package/dist/components/overlays/menuKeyboardLogic.js +30 -0
  334. package/dist/components/overlays/offcanvasCompanion.d.ts +16 -0
  335. package/dist/components/overlays/offcanvasCompanion.js +6 -0
  336. package/dist/components/overlays/offcanvasResize.d.ts +22 -0
  337. package/dist/components/overlays/offcanvasResize.js +10 -0
  338. package/dist/components/overlays/offcanvasSide.d.ts +30 -0
  339. package/dist/components/overlays/offcanvasSide.js +29 -0
  340. package/dist/components/overlays/offcanvasStack.d.ts +76 -0
  341. package/dist/components/overlays/offcanvasStack.js +72 -0
  342. package/dist/components/overlays/overlayPortal.d.ts +9 -0
  343. package/dist/components/overlays/overlayPortal.js +6 -0
  344. package/dist/components/overlays/popoverLogic.d.ts +94 -0
  345. package/dist/components/overlays/popoverLogic.js +47 -0
  346. package/dist/components/overlays/splitModalLayout.d.ts +8 -0
  347. package/dist/components/overlays/splitModalLayout.js +5 -0
  348. package/dist/components/overlays/useExitPresence.d.ts +14 -0
  349. package/dist/components/overlays/useExitPresence.js +34 -0
  350. package/dist/components/overlays/useNativeDialog.d.ts +30 -0
  351. package/dist/components/overlays/useNativeDialog.js +56 -0
  352. package/dist/components/rootProps.d.ts +17 -0
  353. package/dist/components/rootProps.js +4 -0
  354. package/dist/hooks/breakpointOpenLogic.d.ts +7 -0
  355. package/dist/hooks/breakpointOpenLogic.js +4 -0
  356. package/dist/hooks/dateFormat.d.ts +12 -0
  357. package/dist/hooks/dateFormat.js +15 -0
  358. package/dist/hooks/downloadLogic.d.ts +31 -0
  359. package/dist/hooks/downloadLogic.js +85 -0
  360. package/dist/hooks/focusLogic.d.ts +18 -0
  361. package/dist/hooks/focusLogic.js +17 -0
  362. package/dist/hooks/growOriginLogic.d.ts +22 -0
  363. package/dist/hooks/growOriginLogic.js +10 -0
  364. package/dist/hooks/hotkeyLogic.d.ts +22 -0
  365. package/dist/hooks/hotkeyLogic.js +32 -0
  366. package/dist/hooks/index.d.ts +49 -0
  367. package/dist/hooks/kapiRoot.d.ts +16 -0
  368. package/dist/hooks/kapiRoot.js +9 -0
  369. package/dist/hooks/onlineStatusLogic.d.ts +31 -0
  370. package/dist/hooks/onlineStatusLogic.js +28 -0
  371. package/dist/hooks/persistentStateLogic.d.ts +12 -0
  372. package/dist/hooks/persistentStateLogic.js +17 -0
  373. package/dist/hooks/rafThrottle.d.ts +33 -0
  374. package/dist/hooks/rafThrottle.js +33 -0
  375. package/dist/hooks/recentLogic.d.ts +9 -0
  376. package/dist/hooks/recentLogic.js +10 -0
  377. package/dist/hooks/reducedMotion.d.ts +13 -0
  378. package/dist/hooks/reducedMotion.js +5 -0
  379. package/dist/hooks/rightClick.d.ts +37 -0
  380. package/dist/hooks/rightClick.js +30 -0
  381. package/dist/hooks/scrollCollapseLogic.d.ts +12 -0
  382. package/dist/hooks/scrollCollapseLogic.js +4 -0
  383. package/dist/hooks/scrollEdgesLogic.d.ts +49 -0
  384. package/dist/hooks/scrollEdgesLogic.js +19 -0
  385. package/dist/hooks/slidingIndicatorLogic.d.ts +25 -0
  386. package/dist/hooks/slidingIndicatorLogic.js +15 -0
  387. package/dist/hooks/storageLogic.d.ts +15 -0
  388. package/dist/hooks/storageLogic.js +24 -0
  389. package/dist/hooks/unsavedGuardLogic.d.ts +17 -0
  390. package/dist/hooks/unsavedGuardLogic.js +17 -0
  391. package/dist/hooks/useDragScroll.d.ts +12 -0
  392. package/dist/hooks/useDragScroll.js +32 -0
  393. package/dist/hooks/useGlobalRightClick.d.ts +14 -0
  394. package/dist/hooks/useGlobalRightClick.js +35 -0
  395. package/dist/hooks/useGrowOrigin.d.ts +13 -0
  396. package/dist/hooks/useGrowOrigin.js +16 -0
  397. package/dist/hooks/useHotkey.d.ts +15 -0
  398. package/dist/hooks/useHotkey.js +31 -0
  399. package/dist/hooks/useKapiTheme.d.ts +69 -0
  400. package/dist/hooks/useKapiTheme.js +88 -0
  401. package/dist/hooks/useMediaQuery.d.ts +6 -0
  402. package/dist/hooks/useMediaQuery.js +13 -0
  403. package/dist/hooks/useObjectUrl.d.ts +6 -0
  404. package/dist/hooks/useObjectUrl.js +19 -0
  405. package/dist/hooks/useOnlineStatus.d.ts +7 -0
  406. package/dist/hooks/useOnlineStatus.js +7 -0
  407. package/dist/hooks/usePersistentState.d.ts +19 -0
  408. package/dist/hooks/usePersistentState.js +37 -0
  409. package/dist/hooks/usePlacement.d.ts +36 -0
  410. package/dist/hooks/usePlacement.js +84 -0
  411. package/dist/hooks/useRecent.d.ts +17 -0
  412. package/dist/hooks/useRecent.js +16 -0
  413. package/dist/hooks/useScrollCollapse.d.ts +10 -0
  414. package/dist/hooks/useScrollCollapse.js +27 -0
  415. package/dist/hooks/useScrollEdges.d.ts +32 -0
  416. package/dist/hooks/useScrollEdges.js +91 -0
  417. package/dist/hooks/useSlidingIndicator.d.ts +23 -0
  418. package/dist/hooks/useSlidingIndicator.js +51 -0
  419. package/dist/hooks/useUnsavedGuard.d.ts +70 -0
  420. package/dist/hooks/useUnsavedGuard.js +47 -0
  421. package/dist/index.d.ts +12 -0
  422. package/dist/index.js +162 -0
  423. package/dist/kapi.css +2 -0
  424. package/dist/kapi.layered.css +4 -0
  425. package/package.json +87 -4
@@ -0,0 +1,24 @@
1
+ //#region src/hooks/storageLogic.ts
2
+ var e = "kapi", t = (e, t) => `${e || "kapi"}:${t}`, n = () => {
3
+ try {
4
+ return typeof localStorage > "u" ? null : localStorage;
5
+ } catch {
6
+ return null;
7
+ }
8
+ }, r = (e, t, n) => {
9
+ if (e && t !== n) try {
10
+ let r = e.getItem(t);
11
+ if (r === null) return;
12
+ e.getItem(n) === null && e.setItem(n, r), e.removeItem(t);
13
+ } catch {}
14
+ }, i = (e, t, n) => {
15
+ if (!e) return null;
16
+ n && r(e, n, t);
17
+ try {
18
+ return e.getItem(t);
19
+ } catch {
20
+ return null;
21
+ }
22
+ };
23
+ //#endregion
24
+ export { e as DEFAULT_STORAGE_NAMESPACE, n as defaultStorage, r as migrateLegacy, i as readWithLegacy, t as storageKey };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Lógica pura del guard de "cambios sin guardar": una compuerta que convierte la
3
+ * decisión del usuario (Quedarme / Descartar y salir) en una promesa. Sin React ni DOM.
4
+ */
5
+ export type LeaveGate = {
6
+ /** Si no hay cambios resuelve `true` ya; si los hay, abre la confirmación y espera. */
7
+ request: (dirty: boolean) => Promise<boolean>;
8
+ /** Resuelve la consulta pendiente (`true` = salir, `false` = quedarse). No-op si no hay. */
9
+ settle: (leave: boolean) => void;
10
+ /** ¿Hay una confirmación esperando respuesta? */
11
+ isPending: () => boolean;
12
+ };
13
+ /**
14
+ * Crea la compuerta. `onOpenChange(true)` se invoca al pedir confirmación y
15
+ * `onOpenChange(false)` al resolverla. Pedidos concurrentes comparten la misma promesa.
16
+ */
17
+ export declare const createLeaveGate: (onOpenChange: (open: boolean) => void) => LeaveGate;
@@ -0,0 +1,17 @@
1
+ //#region src/hooks/unsavedGuardLogic.ts
2
+ var e = (e) => {
3
+ let t = null, n = null;
4
+ return {
5
+ request: (r) => r ? t || (t = new Promise((e) => {
6
+ n = e;
7
+ }), e(!0), t) : Promise.resolve(!0),
8
+ settle: (r) => {
9
+ if (!n) return;
10
+ let i = n;
11
+ n = null, t = null, e(!1), i(r);
12
+ },
13
+ isPending: () => t !== null
14
+ };
15
+ };
16
+ //#endregion
17
+ export { e as createLeaveGate };
@@ -0,0 +1,12 @@
1
+ import { type RefObject } from "react";
2
+ export type UseDragScrollOptions = {
3
+ /** Se dispara con DOBLE click derecho (sin arrastrar): abrir un menú custom ahí. */
4
+ onMenu?: ((x: number, y: number) => void) | undefined;
5
+ };
6
+ /**
7
+ * Drag-to-scroll con CLICK SECUNDARIO (derecho): mantené el botón derecho y
8
+ * arrastrá para mover el scroll del elemento. El click izquierdo queda libre.
9
+ * El menú nativo se suprime en el área; con doble click derecho se llama `onMenu`.
10
+ * Devolvé el ref al contenedor scrolleable (`<div ref={ref} />`).
11
+ */
12
+ export declare const useDragScroll: <T extends HTMLElement = HTMLDivElement>(options?: UseDragScrollOptions) => RefObject<T | null>;
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { exceedsDragThreshold as e, isDoubleRightClick as t, isInteractiveTarget as n } from "./rightClick.js";
3
+ import { useEffect as r, useRef as i } from "react";
4
+ //#region src/hooks/useDragScroll.ts
5
+ var a = (a = {}) => {
6
+ let o = i(null), s = i(a);
7
+ return s.current = a, r(() => {
8
+ let r = o.current;
9
+ if (!r) return;
10
+ let i = !1, a = !1, c = 0, l = 0, u = 0, d = 0, f = 0, p = (e) => {
11
+ e.button === 2 && (n(e.target) || (e.stopPropagation(), i = !0, a = !1, c = e.pageX, l = e.pageY, u = r.scrollLeft, d = r.scrollTop));
12
+ }, m = (t) => {
13
+ if (!i) return;
14
+ let n = t.pageX - c, o = t.pageY - l;
15
+ !a && e(n, o) && (a = !0, r.classList.add("kapi-grabbing")), a && (t.preventDefault(), r.scrollLeft = u - n, r.scrollTop = d - o);
16
+ }, h = () => {
17
+ i = !1, r.classList.remove("kapi-grabbing");
18
+ }, g = (e) => {
19
+ if (e.preventDefault(), e.stopPropagation(), a) {
20
+ a = !1, f = 0;
21
+ return;
22
+ }
23
+ let n = Date.now();
24
+ t(n, f) ? (s.current.onMenu?.(e.clientX, e.clientY), f = 0) : f = n;
25
+ };
26
+ return r.addEventListener("mousedown", p), window.addEventListener("mousemove", m), window.addEventListener("mouseup", h), r.addEventListener("contextmenu", g), () => {
27
+ r.removeEventListener("mousedown", p), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", h), r.removeEventListener("contextmenu", g);
28
+ };
29
+ }, []), o;
30
+ };
31
+ //#endregion
32
+ export { a as useDragScroll };
@@ -0,0 +1,14 @@
1
+ export type UseGlobalRightClickOptions = {
2
+ /** Doble click derecho (sin arrastrar) → posición para abrir el menú del sistema. */
3
+ onMenu?: ((x: number, y: number) => void) | undefined;
4
+ /** Desactivá la mecánica completa (incluida la supresión del menú nativo). */
5
+ enabled?: boolean | undefined;
6
+ };
7
+ /**
8
+ * Interacción GLOBAL con botón derecho (la usa KapiShell):
9
+ * - arrastrar con el derecho → scrollea el contenedor scrolleable bajo el cursor.
10
+ * - doble click derecho (sin arrastrar) → `onMenu(x, y)` (menú custom del sistema).
11
+ * - se suprime el menú nativo del navegador, salvo en táctil (long-press de Android).
12
+ * Los contenedores con `useDragScroll` manejan su propio drag/menú (cortan la propagación).
13
+ */
14
+ export declare const useGlobalRightClick: ({ onMenu, enabled }?: UseGlobalRightClickOptions) => void;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { exceedsDragThreshold as e, findScrollableAncestor as t, isDoubleRightClick as n, isInteractiveTarget as r, shouldInterceptContextMenu as i } from "./rightClick.js";
3
+ import { useEffect as a, useRef as o } from "react";
4
+ //#region src/hooks/useGlobalRightClick.ts
5
+ var s = ({ onMenu: s, enabled: c = !0 } = {}) => {
6
+ let l = o(s);
7
+ l.current = s, a(() => {
8
+ if (!c) return;
9
+ let a = 0, o = !1, s = !1, u = null, d = 0, f = 0, p = 0, m = 0, h = null, g = (e) => {
10
+ h = e.pointerType;
11
+ }, _ = (e) => {
12
+ e.button === 2 && (r(e.target) || (u = t(e.target), u && (o = !0, s = !1, d = e.pageX, f = e.pageY, p = u.scrollLeft, m = u.scrollTop)));
13
+ }, v = (t) => {
14
+ if (!o || !u) return;
15
+ let n = t.pageX - d, r = t.pageY - f;
16
+ !s && e(n, r) && (s = !0, document.body.style.userSelect = "none"), s && (t.preventDefault(), u.scrollLeft = p - n, u.scrollTop = m - r);
17
+ }, y = () => {
18
+ o = !1, u = null, document.body.style.userSelect = "";
19
+ }, b = (e) => {
20
+ let t = "pointerType" in e ? e.pointerType : void 0;
21
+ if (!i(t, h)) return;
22
+ if (e.preventDefault(), s) {
23
+ s = !1, a = 0;
24
+ return;
25
+ }
26
+ let r = Date.now();
27
+ n(r, a) ? (l.current?.(e.clientX, e.clientY), a = 0) : a = r;
28
+ };
29
+ return document.addEventListener("pointerdown", g, !0), document.addEventListener("mousedown", _), window.addEventListener("mousemove", v), window.addEventListener("mouseup", y), document.addEventListener("contextmenu", b), () => {
30
+ document.removeEventListener("pointerdown", g, !0), document.removeEventListener("mousedown", _), window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", y), document.removeEventListener("contextmenu", b);
31
+ };
32
+ }, [c]);
33
+ };
34
+ //#endregion
35
+ export { s as useGlobalRightClick };
@@ -0,0 +1,13 @@
1
+ import { type MouseEvent } from "react";
2
+ import { type GrowOrigin } from "./growOriginLogic";
3
+ export type { GrowOrigin } from "./growOriginLogic";
4
+ /**
5
+ * Captura el centro del botón disparador para que un overlay (p. ej. `KapiModal`
6
+ * con `growFrom`) "crezca" desde ahí. Uso: `onClick={(e) => { grow.capture(e); setOpen(true); }}`
7
+ * y `grow.clear()` al cerrar.
8
+ */
9
+ export declare const useGrowOrigin: () => {
10
+ origin: GrowOrigin | null;
11
+ capture: (e: MouseEvent) => void;
12
+ clear: () => void;
13
+ };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { rectCenter as e } from "./growOriginLogic.js";
3
+ import { useCallback as t, useState as n } from "react";
4
+ //#region src/hooks/useGrowOrigin.ts
5
+ var r = () => {
6
+ let [r, i] = n(null);
7
+ return {
8
+ origin: r,
9
+ capture: t((t) => {
10
+ i(e(t.currentTarget.getBoundingClientRect()));
11
+ }, []),
12
+ clear: t(() => i(null), [])
13
+ };
14
+ };
15
+ //#endregion
16
+ export { r as useGrowOrigin };
@@ -0,0 +1,15 @@
1
+ export type UseHotkeyOptions = {
2
+ /** Listen only while true. Default true. */
3
+ enabled?: boolean;
4
+ /** Call `preventDefault()` on a match (blocks e.g. the browser's Ctrl+K). Default true. */
5
+ preventDefault?: boolean;
6
+ /** Also fire while typing in inputs, textareas or contenteditable. Default true when the combo has a modifier, false otherwise. */
7
+ allowInInputs?: boolean;
8
+ };
9
+ /**
10
+ * Global keyboard shortcut. `combo` is `+`-separated: modifiers `mod` (Ctrl or Cmd), `ctrl`, `meta`/`cmd`,
11
+ * `alt`, `shift`, then the key: `"mod+k"`, `"ctrl+shift+p"`, `"/"`. The handler may be an inline function.
12
+ *
13
+ * @example useHotkey("mod+k", () => setOpen((o) => !o));
14
+ */
15
+ export declare const useHotkey: (combo: string, handler: (event: KeyboardEvent) => void, options?: UseHotkeyOptions) => void;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { matchesHotkey as e, parseHotkey as t } from "./hotkeyLogic.js";
3
+ import { useEffect as n, useRef as r } from "react";
4
+ //#region src/hooks/useHotkey.ts
5
+ var i = (i, a, o = {}) => {
6
+ let { enabled: s = !0, preventDefault: c = !0, allowInInputs: l } = o, u = r(a);
7
+ n(() => {
8
+ u.current = a;
9
+ }), n(() => {
10
+ if (!s) return;
11
+ let n = t(i);
12
+ if (!n) return;
13
+ let r = n.mod || n.ctrl || n.meta || n.alt, a = l ?? r, o = (t) => {
14
+ if (!(t.defaultPrevented || t.isComposing || !e(t, n))) {
15
+ if (!a) {
16
+ let e = t.target;
17
+ if (e instanceof HTMLElement && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))) return;
18
+ }
19
+ c && t.preventDefault(), u.current(t);
20
+ }
21
+ };
22
+ return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
23
+ }, [
24
+ i,
25
+ s,
26
+ c,
27
+ l
28
+ ]);
29
+ };
30
+ //#endregion
31
+ export { i as useHotkey };
@@ -0,0 +1,69 @@
1
+ import { type CSSProperties } from "react";
2
+ export type KapiTheme = "light" | "dark";
3
+ /** Lo que elige la persona: un tema fijo o `system` (sigue a `prefers-color-scheme` del SO). */
4
+ export type KapiThemePreference = KapiTheme | "system";
5
+ /** Media query del modo oscuro del SO. */
6
+ export declare const DARK_SCHEME_QUERY = "(prefers-color-scheme: dark)";
7
+ export type KapiFontKey = "nunito" | "roboto" | "system";
8
+ /** Movimiento: `auto` sigue al SO (prefers-reduced-motion); `reduced` lo apaga siempre. */
9
+ export type KapiMotion = "auto" | "reduced";
10
+ /** Preferencias del tema que se guardan. */
11
+ export type KapiThemeStorageName = "theme" | "accent" | "font" | "motion";
12
+ /** Claves de localStorage del tema para un namespace (default `kapi` → `kapi:theme`…). */
13
+ export declare const themeStorageKeys: (namespace?: string) => Record<KapiThemeStorageName, string>;
14
+ /** Claves viejas (sin namespace): se migran a las nuevas en la primera lectura y se borran. */
15
+ export declare const LEGACY_THEME_KEYS: Record<KapiThemeStorageName, string>;
16
+ export declare const THEME_KEY: string;
17
+ export declare const ACCENT_KEY: string;
18
+ export declare const FONT_KEY: string;
19
+ export declare const MOTION_KEY: string;
20
+ /** Fuentes disponibles. Cambiar la familia es setear el token --kapi-font. */
21
+ export declare const FONTS: Record<KapiFontKey, string>;
22
+ export type KapiThemeState = {
23
+ /** Tema que se ve (con `system`, el que resuelve el SO). */
24
+ theme: KapiTheme;
25
+ /** Preferencia elegida (`light`, `dark` o `system`). */
26
+ preference: KapiThemePreference;
27
+ /** Color de acento (hex) o "" para el primario por defecto. */
28
+ accent: string;
29
+ font: KapiFontKey;
30
+ /** Preferencia de movimiento del usuario (independiente del `prefers-reduced-motion` del SO). */
31
+ motion: KapiMotion;
32
+ /** Fija un tema (deja de seguir al SO). */
33
+ setTheme: (t: KapiTheme) => void;
34
+ /** Elige `light`, `dark` o `system`. */
35
+ setPreference: (p: KapiThemePreference) => void;
36
+ /** Alterna sobre el tema que se ve y lo deja fijo. */
37
+ toggle: () => void;
38
+ setAccent: (hex?: string | null) => void;
39
+ setFont: (f: KapiFontKey) => void;
40
+ setMotion: (m: KapiMotion) => void;
41
+ /** Alterna entre `auto` y `reduced`. */
42
+ toggleMotion: () => void;
43
+ };
44
+ /** Lee de localStorage tolerando entornos sin storage (SSR, modo privado). */
45
+ export declare const readStored: (key: string, fallback: string) => string;
46
+ export declare const isTheme: (v: string) => v is KapiTheme;
47
+ export declare const isThemePreference: (v: string) => v is KapiThemePreference;
48
+ /** Tema que se ve: `system` sigue al SO; `light`/`dark` lo ignoran. */
49
+ export declare const resolveTheme: (preference: KapiThemePreference, systemDark: boolean) => KapiTheme;
50
+ /** Preferencia guardada en el namespace (o `light`, el default de siempre). Migra `v2_theme`. */
51
+ export declare const readThemePreference: (namespace?: string) => KapiThemePreference;
52
+ /** Alternar desde el tema que se ve: queda el opuesto, explícito. */
53
+ export declare const toggledPreference: (shown: KapiTheme) => KapiTheme;
54
+ export declare const isFontKey: (v: string) => v is KapiFontKey;
55
+ export declare const isMotion: (v: string) => v is KapiMotion;
56
+ /** Style de la raíz .kapi derivado del estado (fuente + acento como tokens). */
57
+ export declare const themeRootStyle: (state: Pick<KapiThemeState, "font" | "accent">) => CSSProperties;
58
+ export declare const KapiThemeContext: import("react").Context<KapiThemeState>;
59
+ export type KapiThemeStateOptions = {
60
+ /**
61
+ * Namespace de las claves de localStorage (default `kapi` → `kapi:theme`, `kapi:accent`…).
62
+ * Dos apps del design system en el mismo origen pasan uno distinto para no pisarse las preferencias.
63
+ */
64
+ namespace?: string | undefined;
65
+ };
66
+ /** Crea el estado del tema (lo usa KapiShell; usalo directo si armás tu propia raíz). */
67
+ export declare const useKapiThemeState: ({ namespace }?: KapiThemeStateOptions) => KapiThemeState;
68
+ /** Consume el tema desde cualquier componente dentro de <KapiShell>. */
69
+ export declare const useKapiTheme: () => KapiThemeState;
@@ -0,0 +1,88 @@
1
+ "use client";
2
+ import { defaultStorage as e, readWithLegacy as t, storageKey as n } from "./storageLogic.js";
3
+ import { useMediaQuery as r } from "./useMediaQuery.js";
4
+ import { createContext as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useState as l } from "react";
5
+ //#region src/hooks/useKapiTheme.ts
6
+ var u = "(prefers-color-scheme: dark)", d = (e) => ({
7
+ theme: n(e, "theme"),
8
+ accent: n(e, "accent"),
9
+ font: n(e, "font"),
10
+ motion: n(e, "motion")
11
+ }), f = {
12
+ theme: "v2_theme",
13
+ accent: "v2_accent",
14
+ font: "v2_font",
15
+ motion: "v2_motion"
16
+ };
17
+ d().theme, d().accent, d().font, d().motion;
18
+ var p = {
19
+ nunito: "'Nunito Variable', 'Nunito', system-ui, sans-serif",
20
+ roboto: "'Roboto', system-ui, sans-serif",
21
+ system: "system-ui, -apple-system, 'Segoe UI', sans-serif"
22
+ }, m = (n, r, i) => t(e(), d(n)[r], f[r]) || i, h = (e, t) => {
23
+ try {
24
+ localStorage.setItem(e, t);
25
+ } catch {}
26
+ }, g = (e) => e === "light" || e === "dark", _ = (e) => g(e) || e === "system", v = (e, t) => e === "system" ? t ? "dark" : "light" : e, y = (e) => {
27
+ let t = m(e, "theme", "light");
28
+ return _(t) ? t : "light";
29
+ }, b = (e) => e === "dark" ? "light" : "dark", x = (e) => e in p, S = (e) => e === "auto" || e === "reduced", C = (e) => ({
30
+ "--kapi-font": p[e.font] ?? p.nunito,
31
+ ...e.accent ? { "--kapi-primary": e.accent } : {}
32
+ }), w = i({
33
+ theme: "light",
34
+ preference: "light",
35
+ accent: "",
36
+ font: "nunito",
37
+ motion: "auto",
38
+ setTheme: () => {},
39
+ setPreference: () => {},
40
+ toggle: () => {},
41
+ setAccent: () => {},
42
+ setFont: () => {},
43
+ setMotion: () => {},
44
+ toggleMotion: () => {}
45
+ }), T = ({ namespace: e } = {}) => {
46
+ let t = c(() => d(e), [e]), [n, i] = l(() => y(e)), o = v(n, r(u)), [f, p] = l(() => m(e, "accent", "")), [g, _] = l(() => {
47
+ let t = m(e, "font", "nunito");
48
+ return x(t) ? t : "nunito";
49
+ }), [C, w] = l(() => {
50
+ let t = m(e, "motion", "auto");
51
+ return S(t) ? t : "auto";
52
+ }), [T, E] = l(e);
53
+ if (T !== e) {
54
+ E(e), i(y(e)), p(m(e, "accent", ""));
55
+ let t = m(e, "font", "nunito");
56
+ _(x(t) ? t : "nunito");
57
+ let n = m(e, "motion", "auto");
58
+ w(S(n) ? n : "auto");
59
+ }
60
+ s(() => h(t.theme, n), [t, n]), s(() => h(t.accent, f), [t, f]), s(() => h(t.font, g), [t, g]), s(() => h(t.motion, C), [t, C]);
61
+ let D = a(() => i(b(o)), [o]), O = a((e) => i(e), []), k = a((e) => p(e || ""), []), A = a(() => w((e) => e === "reduced" ? "auto" : "reduced"), []);
62
+ return c(() => ({
63
+ theme: o,
64
+ preference: n,
65
+ accent: f,
66
+ font: g,
67
+ motion: C,
68
+ setTheme: O,
69
+ setPreference: i,
70
+ toggle: D,
71
+ setAccent: k,
72
+ setFont: _,
73
+ setMotion: w,
74
+ toggleMotion: A
75
+ }), [
76
+ o,
77
+ n,
78
+ f,
79
+ g,
80
+ C,
81
+ O,
82
+ D,
83
+ k,
84
+ A
85
+ ]);
86
+ }, E = () => o(w);
87
+ //#endregion
88
+ export { u as DARK_SCHEME_QUERY, p as FONTS, w as KapiThemeContext, f as LEGACY_THEME_KEYS, x as isFontKey, S as isMotion, g as isTheme, _ as isThemePreference, y as readThemePreference, v as resolveTheme, C as themeRootStyle, d as themeStorageKeys, b as toggledPreference, E as useKapiTheme, T as useKapiThemeState };
@@ -0,0 +1,6 @@
1
+ /** Breakpoint móvil del shell (mantener sincronizado con shell.css). */
2
+ export declare const SHELL_MOBILE_QUERY = "(max-width: 768px)";
3
+ /** `matchMedia` seguro (SSR / jsdom sin matchMedia → false). */
4
+ export declare const matchesQuery: (query: string) => boolean;
5
+ /** true mientras el viewport cumple la media query. */
6
+ export declare const useMediaQuery: (query: string) => boolean;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { useEffect as e, useState as t } from "react";
3
+ //#region src/hooks/useMediaQuery.ts
4
+ var n = "(max-width: 768px)", r = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, i = (n) => {
5
+ let [i, a] = t(() => r(n));
6
+ return e(() => {
7
+ if (typeof window.matchMedia != "function") return;
8
+ let e = window.matchMedia(n), t = () => a(e.matches);
9
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
10
+ }, [n]), i;
11
+ };
12
+ //#endregion
13
+ export { n as SHELL_MOBILE_QUERY, r as matchesQuery, i as useMediaQuery };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * URL temporal (`blob:`) para mostrar o descargar un Blob. Se revoca al cambiar de Blob y al
3
+ * desmontar; con `null`/`undefined` devuelve `null`. El primer render con un Blob nuevo devuelve
4
+ * `null`: la URL se crea en un efecto (así StrictMode no la revoca y la deja en uso).
5
+ */
6
+ export declare const useObjectUrl: (source: Blob | null | undefined) => string | null;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { useEffect as e, useState as t } from "react";
3
+ //#region src/hooks/useObjectUrl.ts
4
+ var n = (n) => {
5
+ let [r, i] = t(null);
6
+ return e(() => {
7
+ if (!n || typeof URL.createObjectURL != "function") {
8
+ i(null);
9
+ return;
10
+ }
11
+ let e = URL.createObjectURL(n);
12
+ return i({
13
+ source: n,
14
+ url: e
15
+ }), () => URL.revokeObjectURL(e);
16
+ }, [n]), r && n && r.source === n ? r.url : null;
17
+ };
18
+ //#endregion
19
+ export { n as useObjectUrl };
@@ -0,0 +1,7 @@
1
+ import { type OnlineStatus } from "./onlineStatusLogic";
2
+ /**
3
+ * ¿Hay conexión? Sigue los eventos `online`/`offline` de la ventana. En SSR devuelve conectado.
4
+ * `since`: instante (`Date.now()`) del último cambio observado, o `null` si no cambió.
5
+ * Ojo: `navigator.onLine === true` sólo garantiza red local, no que el servidor responda.
6
+ */
7
+ export declare const useOnlineStatus: () => OnlineStatus;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { SERVER_ONLINE_STATUS as e, createOnlineStore as t } from "./onlineStatusLogic.js";
3
+ import { useSyncExternalStore as n } from "react";
4
+ //#region src/hooks/useOnlineStatus.ts
5
+ var r = null, i = () => r ??= t(), a = (e) => i().subscribe(e), o = () => i().getSnapshot(), s = () => e, c = () => n(a, o, s);
6
+ //#endregion
7
+ export { c as useOnlineStatus };
@@ -0,0 +1,19 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ export type PersistentStateOptions = {
3
+ /** Versión del esquema guardado; si no coincide se descarta lo guardado. Default 1. */
4
+ version?: number;
5
+ /**
6
+ * Namespace de la clave: con él se guarda en `${namespace}:${key}` (como las claves del design system,
7
+ * p. ej. `kapi:theme`), así dos apps en el mismo origen no se pisan. Sin él la clave queda tal
8
+ * cual (compatible con lo guardado antes).
9
+ */
10
+ namespace?: string;
11
+ };
12
+ /**
13
+ * Estado persistido en localStorage (seguro en SSR y con storage bloqueado).
14
+ * Con `key = null` es estado en memoria puro, sin tocar el storage. Con `options.namespace` la
15
+ * clave real es `${namespace}:${key}`.
16
+ */
17
+ export declare const usePersistentState: <T>(rawKey: string | null, initialValue: T, options?: PersistentStateOptions) => [T, Dispatch<SetStateAction<T>>, {
18
+ clear: () => void;
19
+ }];
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { storageKey as e } from "./storageLogic.js";
3
+ import { parseStored as t, serializeStored as n } from "./persistentStateLogic.js";
4
+ import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
5
+ //#region src/hooks/usePersistentState.ts
6
+ var s = (e, n, r) => {
7
+ if (typeof window > "u") return r;
8
+ try {
9
+ return t(window.localStorage.getItem(e), n, r);
10
+ } catch {
11
+ return r;
12
+ }
13
+ }, c = (t, c, l) => {
14
+ let u = l?.version ?? 1, d = l?.namespace, f = t === null || !d ? t : e(d, t), [p, m] = o(() => f === null ? c : s(f, u, c)), h = a(f);
15
+ return i(() => {
16
+ h.current !== f && (h.current = f, m(f === null ? c : s(f, u, c)));
17
+ }, [f, u]), i(() => {
18
+ if (f !== null && typeof window < "u" && h.current === f) try {
19
+ window.localStorage.setItem(f, n(p, u));
20
+ } catch {}
21
+ }, [
22
+ f,
23
+ p,
24
+ u
25
+ ]), [
26
+ p,
27
+ m,
28
+ { clear: r(() => {
29
+ if (f !== null && typeof window < "u") try {
30
+ window.localStorage.removeItem(f);
31
+ } catch {}
32
+ m(c);
33
+ }, [f]) }
34
+ ];
35
+ };
36
+ //#endregion
37
+ export { c as usePersistentState };
@@ -0,0 +1,36 @@
1
+ import { type CSSProperties, type RefObject } from "react";
2
+ import { type KapiPlacePopoverOptions, type KapiPopoverAnchor, type KapiPopoverPlacement, type KapiPopoverSize } from "../components/overlays/popoverLogic";
3
+ export type UsePlacementOptions = KapiPlacePopoverOptions & {
4
+ /** Sólo se posiciona (y escucha scroll/resize) mientras está abierto. */
5
+ open: boolean;
6
+ /** Condición extra (p. ej. que el portal ya tenga raíz). Default `true`. */
7
+ enabled?: boolean;
8
+ /** Elemento ancla, o función que devuelve el rect/punto/`null` (sin ancla). */
9
+ anchor: RefObject<HTMLElement | null> | (() => KapiPopoverAnchor);
10
+ /** El elemento flotante: se mide (`offsetWidth/Height`) y se observa su tamaño. */
11
+ floatingRef: RefObject<HTMLElement | null>;
12
+ /** Tamaño a usar mientras no hay medida (o siempre, con `measure: false`). */
13
+ estimate?: KapiPopoverSize | undefined;
14
+ /** Medir el elemento flotante. Default `true`. */
15
+ measure?: boolean;
16
+ /**
17
+ * Ocultar (`visibility: hidden`) hasta la primera medición. Default `true`. Los menús que toman el
18
+ * foco al abrir lo apagan: un elemento oculto no puede recibir foco.
19
+ */
20
+ hideUntilPlaced?: boolean;
21
+ };
22
+ export type UsePlacementResult = {
23
+ /** `null` hasta la primera medición (y con `open` en false). */
24
+ placement: KapiPopoverPlacement | null;
25
+ /** `top`/`left`/`width`/`minWidth` listos para `position: fixed`; oculto hasta medir. */
26
+ style: CSSProperties;
27
+ /** Recalcula ya (p. ej. si cambió el contenido sin cambiar de tamaño observable). */
28
+ update: () => void;
29
+ };
30
+ /**
31
+ * Posiciona un elemento flotante con el motor `placePopover`: mide el ancla y el flotante (o usa
32
+ * `estimate`), se reubica con scroll/resize (`onViewportChange`, uno por frame) y con cambios de
33
+ * tamaño (`ResizeObserver`). La primera medición es sincrónica en el layout effect; una guarda de
34
+ * igualdad evita re-renders en loop; mientras no hay medida, `style` lo deja oculto.
35
+ */
36
+ export declare function usePlacement({ open, enabled, anchor, floatingRef, estimate, measure, hideUntilPlaced, ...place }: UsePlacementOptions): UsePlacementResult;
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ import { placePopover as e, samePlacement as t } from "../components/overlays/popoverLogic.js";
3
+ import { onViewportChange as n } from "./rafThrottle.js";
4
+ import { useCallback as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
5
+ //#region src/hooks/usePlacement.ts
6
+ var s = (e) => typeof e == "object" ? `max:${e.max}` : String(e);
7
+ function c({ open: c, enabled: l = !0, anchor: u, floatingRef: d, estimate: f, measure: p = !0, hideUntilPlaced: m = !0, ...h }) {
8
+ let [g, _] = o(null), v = a({
9
+ anchor: u,
10
+ floatingRef: d,
11
+ estimate: f,
12
+ measure: p,
13
+ place: h
14
+ });
15
+ i(() => {
16
+ v.current = {
17
+ anchor: u,
18
+ floatingRef: d,
19
+ estimate: f,
20
+ measure: p,
21
+ place: h
22
+ };
23
+ });
24
+ let y = r(() => {
25
+ let { anchor: n, floatingRef: r, estimate: i, measure: a, place: o } = v.current, s;
26
+ if (typeof n == "function") s = n();
27
+ else if (n.current) s = n.current.getBoundingClientRect();
28
+ else return;
29
+ let c = r.current, l = a && c ? {
30
+ width: c.offsetWidth,
31
+ height: c.offsetHeight
32
+ } : null, u = l && (l.width > 0 || l.height > 0 || !i) ? l : i ?? {
33
+ width: 0,
34
+ height: 0
35
+ }, d = e(s, u, {
36
+ width: window.innerWidth,
37
+ height: window.innerHeight
38
+ }, o);
39
+ _((e) => t(e, d) ? e : d);
40
+ }, []), b = [
41
+ h.side,
42
+ h.align,
43
+ h.offset,
44
+ h.margin,
45
+ String(h.flip),
46
+ String(h.shift),
47
+ h.mainMin,
48
+ s(h.width),
49
+ h.dir,
50
+ h.fallback?.x,
51
+ h.fallback?.y,
52
+ f?.width,
53
+ f?.height,
54
+ p
55
+ ].join("|");
56
+ return i(() => {
57
+ if (!c || !l) {
58
+ _(null);
59
+ return;
60
+ }
61
+ y();
62
+ let e = n(y), t = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => y()), { anchor: r, floatingRef: i } = v.current;
63
+ return i.current && t?.observe(i.current), typeof r != "function" && r.current && t?.observe(r.current), () => {
64
+ e(), t?.disconnect();
65
+ };
66
+ }, [
67
+ c,
68
+ l,
69
+ b,
70
+ y
71
+ ]), {
72
+ placement: g,
73
+ style: {
74
+ top: g?.top ?? 0,
75
+ left: g?.left ?? 0,
76
+ width: g?.width,
77
+ minWidth: g?.minWidth,
78
+ visibility: g || !m ? void 0 : "hidden"
79
+ },
80
+ update: y
81
+ };
82
+ }
83
+ //#endregion
84
+ export { c as usePlacement };