@kapiuara/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/README.md +764 -2
  2. package/dist/components/data/KapiPagination.d.ts +36 -0
  3. package/dist/components/data/KapiPagination.js +102 -0
  4. package/dist/components/data/KapiTable.d.ts +245 -0
  5. package/dist/components/data/KapiTable.js +748 -0
  6. package/dist/components/data/KapiTableFilter.d.ts +48 -0
  7. package/dist/components/data/KapiTableFilter.js +81 -0
  8. package/dist/components/data/index.d.ts +10 -0
  9. package/dist/components/data/tableLogic.d.ts +197 -0
  10. package/dist/components/data/tableLogic.js +145 -0
  11. package/dist/components/data/tableResizeLogic.d.ts +28 -0
  12. package/dist/components/data/tableResizeLogic.js +20 -0
  13. package/dist/components/display/KapiAnnotation.d.ts +32 -0
  14. package/dist/components/display/KapiAnnotation.js +130 -0
  15. package/dist/components/display/KapiAvatar.d.ts +27 -0
  16. package/dist/components/display/KapiAvatar.js +43 -0
  17. package/dist/components/display/KapiAvatarGroup.d.ts +19 -0
  18. package/dist/components/display/KapiAvatarGroup.js +38 -0
  19. package/dist/components/display/KapiBadge.d.ts +21 -0
  20. package/dist/components/display/KapiBadge.js +28 -0
  21. package/dist/components/display/KapiComment.d.ts +27 -0
  22. package/dist/components/display/KapiComment.js +66 -0
  23. package/dist/components/display/KapiCommentComposer.d.ts +49 -0
  24. package/dist/components/display/KapiCommentComposer.js +76 -0
  25. package/dist/components/display/KapiDescriptionList.d.ts +19 -0
  26. package/dist/components/display/KapiDescriptionList.js +35 -0
  27. package/dist/components/display/KapiFileItem.d.ts +39 -0
  28. package/dist/components/display/KapiFileItem.js +74 -0
  29. package/dist/components/display/KapiFileViewer.d.ts +51 -0
  30. package/dist/components/display/KapiFileViewer.js +107 -0
  31. package/dist/components/display/KapiIconTile.d.ts +16 -0
  32. package/dist/components/display/KapiIconTile.js +29 -0
  33. package/dist/components/display/KapiStat.d.ts +24 -0
  34. package/dist/components/display/KapiStat.js +41 -0
  35. package/dist/components/display/KapiTag.d.ts +27 -0
  36. package/dist/components/display/KapiTag.js +44 -0
  37. package/dist/components/display/KapiTimeline.d.ts +15 -0
  38. package/dist/components/display/KapiTimeline.js +30 -0
  39. package/dist/components/display/annotationLogic.d.ts +26 -0
  40. package/dist/components/display/annotationLogic.js +17 -0
  41. package/dist/components/display/avatarGroupLogic.d.ts +14 -0
  42. package/dist/components/display/avatarGroupLogic.js +13 -0
  43. package/dist/components/display/avatarLogic.d.ts +5 -0
  44. package/dist/components/display/avatarLogic.js +9 -0
  45. package/dist/components/display/commentLogic.d.ts +18 -0
  46. package/dist/components/display/commentLogic.js +7 -0
  47. package/dist/components/display/fileItemLogic.d.ts +9 -0
  48. package/dist/components/display/fileItemLogic.js +12 -0
  49. package/dist/components/display/iconTileLogic.d.ts +13 -0
  50. package/dist/components/display/iconTileLogic.js +13 -0
  51. package/dist/components/display/index.d.ts +40 -0
  52. package/dist/components/display/statLogic.d.ts +10 -0
  53. package/dist/components/display/statLogic.js +10 -0
  54. package/dist/components/display/tagLogic.d.ts +11 -0
  55. package/dist/components/display/tagLogic.js +10 -0
  56. package/dist/components/display/timelineLogic.d.ts +5 -0
  57. package/dist/components/display/timelineLogic.js +4 -0
  58. package/dist/components/feedback/KapiAlert.d.ts +28 -0
  59. package/dist/components/feedback/KapiAlert.js +53 -0
  60. package/dist/components/feedback/KapiBulkBar.d.ts +30 -0
  61. package/dist/components/feedback/KapiBulkBar.js +34 -0
  62. package/dist/components/feedback/KapiCountdown.d.ts +26 -0
  63. package/dist/components/feedback/KapiCountdown.js +43 -0
  64. package/dist/components/feedback/KapiEmpty.d.ts +14 -0
  65. package/dist/components/feedback/KapiEmpty.js +31 -0
  66. package/dist/components/feedback/KapiFab.d.ts +34 -0
  67. package/dist/components/feedback/KapiFab.js +116 -0
  68. package/dist/components/feedback/KapiOfflineBanner.d.ts +25 -0
  69. package/dist/components/feedback/KapiOfflineBanner.js +40 -0
  70. package/dist/components/feedback/KapiProgress.d.ts +24 -0
  71. package/dist/components/feedback/KapiProgress.js +94 -0
  72. package/dist/components/feedback/KapiSkeleton.d.ts +12 -0
  73. package/dist/components/feedback/KapiSkeleton.js +16 -0
  74. package/dist/components/feedback/KapiToastContainer.d.ts +16 -0
  75. package/dist/components/feedback/KapiToastContainer.js +81 -0
  76. package/dist/components/feedback/KapiTour.d.ts +40 -0
  77. package/dist/components/feedback/KapiTour.js +157 -0
  78. package/dist/components/feedback/KapiUnsavedBar.d.ts +35 -0
  79. package/dist/components/feedback/KapiUnsavedBar.js +47 -0
  80. package/dist/components/feedback/bulkBarLogic.d.ts +2 -0
  81. package/dist/components/feedback/bulkBarLogic.js +7 -0
  82. package/dist/components/feedback/countdownLogic.d.ts +74 -0
  83. package/dist/components/feedback/countdownLogic.js +70 -0
  84. package/dist/components/feedback/fabLogic.d.ts +17 -0
  85. package/dist/components/feedback/fabLogic.js +10 -0
  86. package/dist/components/feedback/index.d.ts +33 -0
  87. package/dist/components/feedback/offlineBannerLogic.d.ts +10 -0
  88. package/dist/components/feedback/offlineBannerLogic.js +8 -0
  89. package/dist/components/feedback/progressLogic.d.ts +17 -0
  90. package/dist/components/feedback/progressLogic.js +16 -0
  91. package/dist/components/feedback/toastStore.d.ts +62 -0
  92. package/dist/components/feedback/toastStore.js +38 -0
  93. package/dist/components/feedback/tourLogic.d.ts +64 -0
  94. package/dist/components/feedback/tourLogic.js +31 -0
  95. package/dist/components/feedback/unsavedBarLogic.d.ts +2 -0
  96. package/dist/components/feedback/unsavedBarLogic.js +8 -0
  97. package/dist/components/inputs/KapiAutocomplete.d.ts +81 -0
  98. package/dist/components/inputs/KapiAutocomplete.js +205 -0
  99. package/dist/components/inputs/KapiButton.d.ts +23 -0
  100. package/dist/components/inputs/KapiButton.js +25 -0
  101. package/dist/components/inputs/KapiCalendar.d.ts +35 -0
  102. package/dist/components/inputs/KapiCalendar.js +60 -0
  103. package/dist/components/inputs/KapiCalendarGrid.d.ts +29 -0
  104. package/dist/components/inputs/KapiCalendarGrid.js +65 -0
  105. package/dist/components/inputs/KapiCheckCard.d.ts +28 -0
  106. package/dist/components/inputs/KapiCheckCard.js +41 -0
  107. package/dist/components/inputs/KapiCheckbox.d.ts +7 -0
  108. package/dist/components/inputs/KapiCheckbox.js +5 -0
  109. package/dist/components/inputs/KapiDatePicker.d.ts +46 -0
  110. package/dist/components/inputs/KapiDatePicker.js +189 -0
  111. package/dist/components/inputs/KapiDateRangePicker.d.ts +49 -0
  112. package/dist/components/inputs/KapiDateRangePicker.js +179 -0
  113. package/dist/components/inputs/KapiFacetedSearch.d.ts +45 -0
  114. package/dist/components/inputs/KapiFacetedSearch.js +188 -0
  115. package/dist/components/inputs/KapiField.d.ts +33 -0
  116. package/dist/components/inputs/KapiField.js +60 -0
  117. package/dist/components/inputs/KapiFileUpload.d.ts +58 -0
  118. package/dist/components/inputs/KapiFileUpload.js +134 -0
  119. package/dist/components/inputs/KapiIconButton.d.ts +13 -0
  120. package/dist/components/inputs/KapiIconButton.js +16 -0
  121. package/dist/components/inputs/KapiInput.d.ts +92 -0
  122. package/dist/components/inputs/KapiInput.js +123 -0
  123. package/dist/components/inputs/KapiInputGroup.d.ts +37 -0
  124. package/dist/components/inputs/KapiInputGroup.js +29 -0
  125. package/dist/components/inputs/KapiMaskedInput.d.ts +52 -0
  126. package/dist/components/inputs/KapiMaskedInput.js +78 -0
  127. package/dist/components/inputs/KapiNumberStepper.d.ts +44 -0
  128. package/dist/components/inputs/KapiNumberStepper.js +100 -0
  129. package/dist/components/inputs/KapiRadio.d.ts +7 -0
  130. package/dist/components/inputs/KapiRadio.js +5 -0
  131. package/dist/components/inputs/KapiRating.d.ts +55 -0
  132. package/dist/components/inputs/KapiRating.js +99 -0
  133. package/dist/components/inputs/KapiSegmented.d.ts +41 -0
  134. package/dist/components/inputs/KapiSegmented.js +83 -0
  135. package/dist/components/inputs/KapiSelect.d.ts +109 -0
  136. package/dist/components/inputs/KapiSelect.js +443 -0
  137. package/dist/components/inputs/KapiSlider.d.ts +42 -0
  138. package/dist/components/inputs/KapiSlider.js +70 -0
  139. package/dist/components/inputs/KapiSwitch.d.ts +13 -0
  140. package/dist/components/inputs/KapiSwitch.js +28 -0
  141. package/dist/components/inputs/KapiTagInput.d.ts +79 -0
  142. package/dist/components/inputs/KapiTagInput.js +115 -0
  143. package/dist/components/inputs/KapiTextarea.d.ts +32 -0
  144. package/dist/components/inputs/KapiTextarea.js +67 -0
  145. package/dist/components/inputs/asyncSelectLogic.d.ts +42 -0
  146. package/dist/components/inputs/asyncSelectLogic.js +46 -0
  147. package/dist/components/inputs/autocompleteLogic.d.ts +73 -0
  148. package/dist/components/inputs/autocompleteLogic.js +67 -0
  149. package/dist/components/inputs/checkControl.d.ts +20 -0
  150. package/dist/components/inputs/checkControl.js +31 -0
  151. package/dist/components/inputs/datePickerLogic.d.ts +92 -0
  152. package/dist/components/inputs/datePickerLogic.js +174 -0
  153. package/dist/components/inputs/dateRangeLogic.d.ts +31 -0
  154. package/dist/components/inputs/dateRangeLogic.js +44 -0
  155. package/dist/components/inputs/facetedSearchLogic.d.ts +69 -0
  156. package/dist/components/inputs/facetedSearchLogic.js +39 -0
  157. package/dist/components/inputs/fieldLogic.d.ts +67 -0
  158. package/dist/components/inputs/fieldLogic.js +35 -0
  159. package/dist/components/inputs/fileUploadLogic.d.ts +13 -0
  160. package/dist/components/inputs/fileUploadLogic.js +9 -0
  161. package/dist/components/inputs/index.d.ts +55 -0
  162. package/dist/components/inputs/inputGroupLogic.d.ts +22 -0
  163. package/dist/components/inputs/inputGroupLogic.js +9 -0
  164. package/dist/components/inputs/inputLogic.d.ts +25 -0
  165. package/dist/components/inputs/inputLogic.js +10 -0
  166. package/dist/components/inputs/maskLogic.d.ts +34 -0
  167. package/dist/components/inputs/maskLogic.js +57 -0
  168. package/dist/components/inputs/numberStepLogic.d.ts +14 -0
  169. package/dist/components/inputs/numberStepLogic.js +21 -0
  170. package/dist/components/inputs/ratingLogic.d.ts +9 -0
  171. package/dist/components/inputs/ratingLogic.js +22 -0
  172. package/dist/components/inputs/segmentedLogic.d.ts +6 -0
  173. package/dist/components/inputs/segmentedLogic.js +14 -0
  174. package/dist/components/inputs/selectLogic.d.ts +89 -0
  175. package/dist/components/inputs/selectLogic.js +82 -0
  176. package/dist/components/inputs/sliderLogic.d.ts +9 -0
  177. package/dist/components/inputs/sliderLogic.js +17 -0
  178. package/dist/components/inputs/tagInputLogic.d.ts +40 -0
  179. package/dist/components/inputs/tagInputLogic.js +40 -0
  180. package/dist/components/inputs/textareaLogic.d.ts +17 -0
  181. package/dist/components/inputs/textareaLogic.js +13 -0
  182. package/dist/components/inputs/useCalendarFocus.d.ts +13 -0
  183. package/dist/components/inputs/useCalendarFocus.js +25 -0
  184. package/dist/components/inputs/useDatePopSide.d.ts +15 -0
  185. package/dist/components/inputs/useDatePopSide.js +20 -0
  186. package/dist/components/labelsLogic.d.ts +6 -0
  187. package/dist/components/labelsLogic.js +11 -0
  188. package/dist/components/layout/KapiAccessCard.d.ts +40 -0
  189. package/dist/components/layout/KapiAccessCard.js +66 -0
  190. package/dist/components/layout/KapiAccountMenu.d.ts +61 -0
  191. package/dist/components/layout/KapiAccountMenu.js +212 -0
  192. package/dist/components/layout/KapiCard.d.ts +43 -0
  193. package/dist/components/layout/KapiCard.js +53 -0
  194. package/dist/components/layout/KapiCluster.d.ts +15 -0
  195. package/dist/components/layout/KapiCluster.js +21 -0
  196. package/dist/components/layout/KapiContextSlot.d.ts +45 -0
  197. package/dist/components/layout/KapiContextSlot.js +92 -0
  198. package/dist/components/layout/KapiDivider.d.ts +16 -0
  199. package/dist/components/layout/KapiDivider.js +41 -0
  200. package/dist/components/layout/KapiGrid.d.ts +19 -0
  201. package/dist/components/layout/KapiGrid.js +25 -0
  202. package/dist/components/layout/KapiNotificationBell.d.ts +75 -0
  203. package/dist/components/layout/KapiNotificationBell.js +196 -0
  204. package/dist/components/layout/KapiPageHeader.d.ts +28 -0
  205. package/dist/components/layout/KapiPageHeader.js +47 -0
  206. package/dist/components/layout/KapiPanelParts.d.ts +35 -0
  207. package/dist/components/layout/KapiPanelParts.js +63 -0
  208. package/dist/components/layout/KapiRail.d.ts +40 -0
  209. package/dist/components/layout/KapiRail.js +102 -0
  210. package/dist/components/layout/KapiScrollArea.d.ts +40 -0
  211. package/dist/components/layout/KapiScrollArea.js +49 -0
  212. package/dist/components/layout/KapiShell.d.ts +40 -0
  213. package/dist/components/layout/KapiShell.js +48 -0
  214. package/dist/components/layout/KapiStack.d.ts +11 -0
  215. package/dist/components/layout/KapiStack.js +19 -0
  216. package/dist/components/layout/accessCardLogic.d.ts +18 -0
  217. package/dist/components/layout/accessCardLogic.js +11 -0
  218. package/dist/components/layout/cardLogic.d.ts +9 -0
  219. package/dist/components/layout/cardLogic.js +11 -0
  220. package/dist/components/layout/index.d.ts +33 -0
  221. package/dist/components/layout/layoutPrimitives.d.ts +51 -0
  222. package/dist/components/layout/layoutPrimitives.js +58 -0
  223. package/dist/components/layout/notificationBellLogic.d.ts +20 -0
  224. package/dist/components/layout/notificationBellLogic.js +14 -0
  225. package/dist/components/layout/railLogic.d.ts +52 -0
  226. package/dist/components/layout/railLogic.js +16 -0
  227. package/dist/components/locale/KapiLocaleProvider.d.ts +29 -0
  228. package/dist/components/locale/KapiLocaleProvider.js +27 -0
  229. package/dist/components/locale/index.d.ts +5 -0
  230. package/dist/components/locale/labelRegistry.d.ts +110 -0
  231. package/dist/components/locale/linkLabels.d.ts +6 -0
  232. package/dist/components/locale/linkLabels.js +4 -0
  233. package/dist/components/navigation/CtxSlidingList.d.ts +11 -0
  234. package/dist/components/navigation/CtxSlidingList.js +24 -0
  235. package/dist/components/navigation/KapiAccordion.d.ts +24 -0
  236. package/dist/components/navigation/KapiAccordion.js +68 -0
  237. package/dist/components/navigation/KapiBreadcrumb.d.ts +23 -0
  238. package/dist/components/navigation/KapiBreadcrumb.js +32 -0
  239. package/dist/components/navigation/KapiCollapsiblePanel.d.ts +63 -0
  240. package/dist/components/navigation/KapiCollapsiblePanel.js +83 -0
  241. package/dist/components/navigation/KapiContextPanel.d.ts +117 -0
  242. package/dist/components/navigation/KapiContextPanel.js +265 -0
  243. package/dist/components/navigation/KapiFilterChips.d.ts +30 -0
  244. package/dist/components/navigation/KapiFilterChips.js +40 -0
  245. package/dist/components/navigation/KapiNavBadge.d.ts +26 -0
  246. package/dist/components/navigation/KapiNavBadge.js +33 -0
  247. package/dist/components/navigation/KapiPanelGroup.d.ts +69 -0
  248. package/dist/components/navigation/KapiPanelGroup.js +149 -0
  249. package/dist/components/navigation/KapiSteps.d.ts +43 -0
  250. package/dist/components/navigation/KapiSteps.js +63 -0
  251. package/dist/components/navigation/KapiTabs.d.ts +56 -0
  252. package/dist/components/navigation/KapiTabs.js +81 -0
  253. package/dist/components/navigation/KapiTree.d.ts +56 -0
  254. package/dist/components/navigation/KapiTree.js +157 -0
  255. package/dist/components/navigation/KapiWizard.d.ts +49 -0
  256. package/dist/components/navigation/KapiWizard.js +104 -0
  257. package/dist/components/navigation/MiniNavItem.d.ts +35 -0
  258. package/dist/components/navigation/MiniNavItem.js +57 -0
  259. package/dist/components/navigation/accordionLogic.d.ts +4 -0
  260. package/dist/components/navigation/accordionLogic.js +4 -0
  261. package/dist/components/navigation/activeItemLogic.d.ts +7 -0
  262. package/dist/components/navigation/activeItemLogic.js +4 -0
  263. package/dist/components/navigation/breadcrumbLogic.d.ts +8 -0
  264. package/dist/components/navigation/breadcrumbLogic.js +4 -0
  265. package/dist/components/navigation/contextPanelLogic.d.ts +27 -0
  266. package/dist/components/navigation/contextPanelLogic.js +11 -0
  267. package/dist/components/navigation/filterChipsLogic.d.ts +23 -0
  268. package/dist/components/navigation/filterChipsLogic.js +20 -0
  269. package/dist/components/navigation/index.d.ts +39 -0
  270. package/dist/components/navigation/navBadgeLogic.d.ts +26 -0
  271. package/dist/components/navigation/navBadgeLogic.js +16 -0
  272. package/dist/components/navigation/panelGroupLogic.d.ts +15 -0
  273. package/dist/components/navigation/panelGroupLogic.js +13 -0
  274. package/dist/components/navigation/panelMini.d.ts +13 -0
  275. package/dist/components/navigation/panelMini.js +9 -0
  276. package/dist/components/navigation/panelMiniLogic.d.ts +19 -0
  277. package/dist/components/navigation/panelMiniLogic.js +6 -0
  278. package/dist/components/navigation/stepsLogic.d.ts +25 -0
  279. package/dist/components/navigation/stepsLogic.js +10 -0
  280. package/dist/components/navigation/tabsLogic.d.ts +12 -0
  281. package/dist/components/navigation/tabsLogic.js +14 -0
  282. package/dist/components/navigation/treeLogic.d.ts +80 -0
  283. package/dist/components/navigation/treeLogic.js +91 -0
  284. package/dist/components/navigation/wizardLogic.d.ts +11 -0
  285. package/dist/components/navigation/wizardLogic.js +7 -0
  286. package/dist/components/overlays/KapiCanvasForm.d.ts +42 -0
  287. package/dist/components/overlays/KapiCanvasForm.js +60 -0
  288. package/dist/components/overlays/KapiCommandPalette.d.ts +58 -0
  289. package/dist/components/overlays/KapiCommandPalette.js +152 -0
  290. package/dist/components/overlays/KapiConfirm.d.ts +48 -0
  291. package/dist/components/overlays/KapiConfirm.js +94 -0
  292. package/dist/components/overlays/KapiContextMenu.d.ts +51 -0
  293. package/dist/components/overlays/KapiContextMenu.js +90 -0
  294. package/dist/components/overlays/KapiDialogHost.d.ts +23 -0
  295. package/dist/components/overlays/KapiDialogHost.js +129 -0
  296. package/dist/components/overlays/KapiDropdown.d.ts +30 -0
  297. package/dist/components/overlays/KapiDropdown.js +84 -0
  298. package/dist/components/overlays/KapiLoading.d.ts +14 -0
  299. package/dist/components/overlays/KapiLoading.js +43 -0
  300. package/dist/components/overlays/KapiMenuButton.d.ts +25 -0
  301. package/dist/components/overlays/KapiMenuButton.js +109 -0
  302. package/dist/components/overlays/KapiModal.d.ts +61 -0
  303. package/dist/components/overlays/KapiModal.js +106 -0
  304. package/dist/components/overlays/KapiOffcanvas.d.ts +96 -0
  305. package/dist/components/overlays/KapiOffcanvas.js +209 -0
  306. package/dist/components/overlays/KapiOffcanvasStack.d.ts +58 -0
  307. package/dist/components/overlays/KapiOffcanvasStack.js +84 -0
  308. package/dist/components/overlays/KapiPhotoView.d.ts +60 -0
  309. package/dist/components/overlays/KapiPhotoView.js +122 -0
  310. package/dist/components/overlays/KapiPopover.d.ts +46 -0
  311. package/dist/components/overlays/KapiPopover.js +68 -0
  312. package/dist/components/overlays/KapiShapeSheet.d.ts +34 -0
  313. package/dist/components/overlays/KapiShapeSheet.js +82 -0
  314. package/dist/components/overlays/KapiSplitModal.d.ts +41 -0
  315. package/dist/components/overlays/KapiSplitModal.js +125 -0
  316. package/dist/components/overlays/KapiTooltip.d.ts +38 -0
  317. package/dist/components/overlays/KapiTooltip.js +105 -0
  318. package/dist/components/overlays/canvasFormLogic.d.ts +18 -0
  319. package/dist/components/overlays/canvasFormLogic.js +16 -0
  320. package/dist/components/overlays/commandPaletteLogic.d.ts +29 -0
  321. package/dist/components/overlays/commandPaletteLogic.js +19 -0
  322. package/dist/components/overlays/dialogStore.d.ts +114 -0
  323. package/dist/components/overlays/dialogStore.js +76 -0
  324. package/dist/components/overlays/dialogUtils.d.ts +72 -0
  325. package/dist/components/overlays/dialogUtils.js +62 -0
  326. package/dist/components/overlays/exitPresenceLogic.d.ts +14 -0
  327. package/dist/components/overlays/exitPresenceLogic.js +5 -0
  328. package/dist/components/overlays/index.d.ts +38 -0
  329. package/dist/components/overlays/menuButtonLogic.d.ts +58 -0
  330. package/dist/components/overlays/menuButtonLogic.js +9 -0
  331. package/dist/components/overlays/menuKeyboardLogic.d.ts +25 -0
  332. package/dist/components/overlays/menuKeyboardLogic.js +30 -0
  333. package/dist/components/overlays/offcanvasCompanion.d.ts +16 -0
  334. package/dist/components/overlays/offcanvasCompanion.js +6 -0
  335. package/dist/components/overlays/offcanvasResize.d.ts +22 -0
  336. package/dist/components/overlays/offcanvasResize.js +10 -0
  337. package/dist/components/overlays/offcanvasSide.d.ts +30 -0
  338. package/dist/components/overlays/offcanvasSide.js +29 -0
  339. package/dist/components/overlays/offcanvasStack.d.ts +76 -0
  340. package/dist/components/overlays/offcanvasStack.js +72 -0
  341. package/dist/components/overlays/overlayPortal.d.ts +9 -0
  342. package/dist/components/overlays/overlayPortal.js +6 -0
  343. package/dist/components/overlays/popoverLogic.d.ts +94 -0
  344. package/dist/components/overlays/popoverLogic.js +47 -0
  345. package/dist/components/overlays/splitModalLayout.d.ts +8 -0
  346. package/dist/components/overlays/splitModalLayout.js +5 -0
  347. package/dist/components/overlays/useExitPresence.d.ts +14 -0
  348. package/dist/components/overlays/useExitPresence.js +34 -0
  349. package/dist/components/overlays/useNativeDialog.d.ts +30 -0
  350. package/dist/components/overlays/useNativeDialog.js +56 -0
  351. package/dist/components/rootProps.d.ts +17 -0
  352. package/dist/components/rootProps.js +4 -0
  353. package/dist/hooks/breakpointOpenLogic.d.ts +7 -0
  354. package/dist/hooks/breakpointOpenLogic.js +4 -0
  355. package/dist/hooks/dateFormat.d.ts +12 -0
  356. package/dist/hooks/dateFormat.js +15 -0
  357. package/dist/hooks/downloadLogic.d.ts +31 -0
  358. package/dist/hooks/downloadLogic.js +85 -0
  359. package/dist/hooks/focusLogic.d.ts +18 -0
  360. package/dist/hooks/focusLogic.js +17 -0
  361. package/dist/hooks/growOriginLogic.d.ts +22 -0
  362. package/dist/hooks/growOriginLogic.js +10 -0
  363. package/dist/hooks/hotkeyLogic.d.ts +22 -0
  364. package/dist/hooks/hotkeyLogic.js +32 -0
  365. package/dist/hooks/index.d.ts +49 -0
  366. package/dist/hooks/kapiRoot.d.ts +16 -0
  367. package/dist/hooks/kapiRoot.js +9 -0
  368. package/dist/hooks/onlineStatusLogic.d.ts +31 -0
  369. package/dist/hooks/onlineStatusLogic.js +28 -0
  370. package/dist/hooks/persistentStateLogic.d.ts +12 -0
  371. package/dist/hooks/persistentStateLogic.js +17 -0
  372. package/dist/hooks/rafThrottle.d.ts +33 -0
  373. package/dist/hooks/rafThrottle.js +33 -0
  374. package/dist/hooks/recentLogic.d.ts +9 -0
  375. package/dist/hooks/recentLogic.js +10 -0
  376. package/dist/hooks/reducedMotion.d.ts +13 -0
  377. package/dist/hooks/reducedMotion.js +5 -0
  378. package/dist/hooks/rightClick.d.ts +37 -0
  379. package/dist/hooks/rightClick.js +30 -0
  380. package/dist/hooks/scrollCollapseLogic.d.ts +12 -0
  381. package/dist/hooks/scrollCollapseLogic.js +4 -0
  382. package/dist/hooks/scrollEdgesLogic.d.ts +49 -0
  383. package/dist/hooks/scrollEdgesLogic.js +19 -0
  384. package/dist/hooks/slidingIndicatorLogic.d.ts +25 -0
  385. package/dist/hooks/slidingIndicatorLogic.js +15 -0
  386. package/dist/hooks/storageLogic.d.ts +15 -0
  387. package/dist/hooks/storageLogic.js +24 -0
  388. package/dist/hooks/unsavedGuardLogic.d.ts +17 -0
  389. package/dist/hooks/unsavedGuardLogic.js +17 -0
  390. package/dist/hooks/useDragScroll.d.ts +12 -0
  391. package/dist/hooks/useDragScroll.js +32 -0
  392. package/dist/hooks/useGlobalRightClick.d.ts +14 -0
  393. package/dist/hooks/useGlobalRightClick.js +35 -0
  394. package/dist/hooks/useGrowOrigin.d.ts +13 -0
  395. package/dist/hooks/useGrowOrigin.js +16 -0
  396. package/dist/hooks/useHotkey.d.ts +15 -0
  397. package/dist/hooks/useHotkey.js +31 -0
  398. package/dist/hooks/useKapiTheme.d.ts +69 -0
  399. package/dist/hooks/useKapiTheme.js +88 -0
  400. package/dist/hooks/useMediaQuery.d.ts +6 -0
  401. package/dist/hooks/useMediaQuery.js +13 -0
  402. package/dist/hooks/useObjectUrl.d.ts +6 -0
  403. package/dist/hooks/useObjectUrl.js +19 -0
  404. package/dist/hooks/useOnlineStatus.d.ts +7 -0
  405. package/dist/hooks/useOnlineStatus.js +7 -0
  406. package/dist/hooks/usePersistentState.d.ts +19 -0
  407. package/dist/hooks/usePersistentState.js +37 -0
  408. package/dist/hooks/usePlacement.d.ts +36 -0
  409. package/dist/hooks/usePlacement.js +84 -0
  410. package/dist/hooks/useRecent.d.ts +17 -0
  411. package/dist/hooks/useRecent.js +16 -0
  412. package/dist/hooks/useScrollCollapse.d.ts +10 -0
  413. package/dist/hooks/useScrollCollapse.js +27 -0
  414. package/dist/hooks/useScrollEdges.d.ts +32 -0
  415. package/dist/hooks/useScrollEdges.js +91 -0
  416. package/dist/hooks/useSlidingIndicator.d.ts +23 -0
  417. package/dist/hooks/useSlidingIndicator.js +51 -0
  418. package/dist/hooks/useUnsavedGuard.d.ts +70 -0
  419. package/dist/hooks/useUnsavedGuard.js +47 -0
  420. package/dist/index.d.ts +12 -0
  421. package/dist/index.js +162 -0
  422. package/dist/kapi.css +2 -0
  423. package/dist/kapi.layered.css +4 -0
  424. package/package.json +86 -4
@@ -0,0 +1,94 @@
1
+ "use client";
2
+ /* empty css */
3
+ import { circleDash as e, clampPercent as t, formatPercent as n, progressClasses as r } from "./progressLogic.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/components/feedback/KapiProgress.tsx
6
+ var o = {
7
+ sm: 36,
8
+ md: 56,
9
+ lg: 84
10
+ }, s = {
11
+ sm: 4,
12
+ md: 6,
13
+ lg: 8
14
+ };
15
+ function c({ value: c, variant: l = "bar", tone: u = "primary", size: d = "md", label: f, showValue: p = !1, "aria-label": m, className: h, ...g }) {
16
+ let _ = t(c), v = r({
17
+ tone: u,
18
+ size: d,
19
+ variant: l,
20
+ className: h
21
+ }), y = {
22
+ role: "progressbar",
23
+ "aria-valuemin": 0,
24
+ "aria-valuemax": 100,
25
+ "aria-valuenow": Math.round(_),
26
+ "aria-label": typeof f == "string" ? f : m
27
+ };
28
+ if (l === "circle") {
29
+ let t = o[d], r = s[d], c = (t - r) / 2, { circumference: l, offset: u } = e(_, c);
30
+ return /* @__PURE__ */ a("div", {
31
+ ...g,
32
+ className: v,
33
+ children: [/* @__PURE__ */ a("div", {
34
+ className: "kapi-progress__ring",
35
+ style: {
36
+ width: t,
37
+ height: t
38
+ },
39
+ ...y,
40
+ children: [/* @__PURE__ */ a("svg", {
41
+ width: t,
42
+ height: t,
43
+ viewBox: `0 0 ${t} ${t}`,
44
+ "aria-hidden": !0,
45
+ children: [/* @__PURE__ */ i("circle", {
46
+ className: "kapi-progress__track",
47
+ cx: t / 2,
48
+ cy: t / 2,
49
+ r: c,
50
+ strokeWidth: r
51
+ }), /* @__PURE__ */ i("circle", {
52
+ className: "kapi-progress__arc",
53
+ cx: t / 2,
54
+ cy: t / 2,
55
+ r: c,
56
+ strokeWidth: r,
57
+ strokeDasharray: l,
58
+ strokeDashoffset: u,
59
+ transform: `rotate(-90 ${t / 2} ${t / 2})`
60
+ })]
61
+ }), p && /* @__PURE__ */ i("span", {
62
+ className: "kapi-progress__center",
63
+ children: n(_)
64
+ })]
65
+ }), f && /* @__PURE__ */ i("span", {
66
+ className: "kapi-progress__label",
67
+ children: f
68
+ })]
69
+ });
70
+ }
71
+ return /* @__PURE__ */ a("div", {
72
+ ...g,
73
+ className: v,
74
+ children: [(f || p) && /* @__PURE__ */ a("div", {
75
+ className: "kapi-progress__head",
76
+ children: [f && /* @__PURE__ */ i("span", {
77
+ className: "kapi-progress__label",
78
+ children: f
79
+ }), p && /* @__PURE__ */ i("span", {
80
+ className: "kapi-progress__value",
81
+ children: n(_)
82
+ })]
83
+ }), /* @__PURE__ */ i("div", {
84
+ className: "kapi-progress__bar",
85
+ ...y,
86
+ children: /* @__PURE__ */ i("div", {
87
+ className: "kapi-progress__fill",
88
+ style: { width: `${_}%` }
89
+ })
90
+ })]
91
+ });
92
+ }
93
+ //#endregion
94
+ export { c as KapiProgress };
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from "react";
2
+ /** Atributos nativos (`id`, `data-*`…) van al `<span>`; `style` se combina con las medidas (gana `style`). */
3
+ export type KapiSkeletonProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
4
+ /** Ancho: número en px o cualquier medida CSS (`"60%"`). */
5
+ width?: number | string;
6
+ /** Alto: número en px o cualquier medida CSS. */
7
+ height?: number | string;
8
+ /** Radio del borde: número en px o cualquier medida CSS. */
9
+ radius?: number | string;
10
+ };
11
+ /** Placeholder con shimmer: `{cargando ? <KapiSkeleton width="60%" height={16} /> : <Contenido />}`. */
12
+ export declare const KapiSkeleton: ({ width, height, radius, className, style, ...rest }: KapiSkeletonProps) => import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ //#region src/components/feedback/KapiSkeleton.tsx
4
+ var t = ({ width: t = "100%", height: n = 14, radius: r = 8, className: i, style: a, ...o }) => /* @__PURE__ */ e("span", {
5
+ ...o,
6
+ className: `kapi-sk${i ? ` ${i}` : ""}`,
7
+ style: {
8
+ width: t,
9
+ height: n,
10
+ borderRadius: r,
11
+ ...a
12
+ },
13
+ "aria-hidden": "true"
14
+ });
15
+ //#endregion
16
+ export { t as KapiSkeleton };
@@ -0,0 +1,16 @@
1
+ import "./feedback.css";
2
+ import { type KapiRootProps } from "../rootProps";
3
+ import type { KapiLabelsOverride } from "../labelsLogic";
4
+ export type KapiToastLabels = {
5
+ close: string;
6
+ };
7
+ export declare const DEFAULT_TOAST_LABELS: KapiToastLabels;
8
+ /** `className`/`style`/`id` van a la pila de toasts (portaleada a `.kapi`). */
9
+ export type KapiToastContainerProps = KapiRootProps & {
10
+ /** Etiqueta accesible del botón de cierre. Gana sobre `labels.close` ("Cerrar"). */
11
+ closeLabel?: string;
12
+ /** Textos fijos (clave `toast`). */
13
+ labels?: KapiLabelsOverride<KapiToastLabels> | undefined;
14
+ };
15
+ /** Montalo una vez en la app: apila los toasts (nunca se encilman) en `.kapi`. */
16
+ export declare const KapiToastContainer: ({ closeLabel: closeLabelProp, labels, className, style, id }: KapiToastContainerProps) => import("react").ReactPortal | null;
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { useLabels as e } from "../locale/KapiLocaleProvider.js";
3
+ import { useKapiRoot as t } from "../../hooks/kapiRoot.js";
4
+ import { joinClasses as n } from "../rootProps.js";
5
+ /* empty css */
6
+ import { toastStore as r } from "./toastStore.js";
7
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
+ import { useSyncExternalStore as o } from "react";
9
+ import { AlertTriangle as s, CheckCircle2 as c, Info as l, XCircle as u } from "lucide-react";
10
+ import { createPortal as d } from "react-dom";
11
+ //#region src/components/feedback/KapiToastContainer.tsx
12
+ var f = { close: "Cerrar" }, p = {
13
+ success: {
14
+ Icon: c,
15
+ color: "var(--kapi-success)"
16
+ },
17
+ error: {
18
+ Icon: u,
19
+ color: "var(--kapi-danger)"
20
+ },
21
+ info: {
22
+ Icon: l,
23
+ color: "var(--kapi-info)"
24
+ },
25
+ warning: {
26
+ Icon: s,
27
+ color: "var(--kapi-warning)"
28
+ }
29
+ }, m = ({ closeLabel: s, labels: c, className: l, style: u, id: m }) => {
30
+ let h = e("toast", f, c), g = s ?? h.close, _ = o(r.subscribe, r.getSnapshot, r.getSnapshot), v = t();
31
+ return v ? d(/* @__PURE__ */ i("div", {
32
+ id: m,
33
+ className: n("kapi-toasts", l),
34
+ style: u,
35
+ "aria-live": "polite",
36
+ children: _.map((e) => {
37
+ let { Icon: t, color: n } = p[e.variant];
38
+ return /* @__PURE__ */ a("div", {
39
+ className: `kapi-toast ${e.leaving ? "kapi-toast--out" : "kapi-toast--in"}`,
40
+ onAnimationEnd: (t) => {
41
+ e.leaving && t.animationName === "kapi-toast-out" && r.remove(e.id);
42
+ },
43
+ children: [
44
+ /* @__PURE__ */ i("span", {
45
+ className: `kapi-toast__icon kapi-toast__icon--${e.variant}`,
46
+ children: /* @__PURE__ */ i(t, {
47
+ size: 18,
48
+ strokeWidth: 2.2,
49
+ color: n
50
+ })
51
+ }),
52
+ /* @__PURE__ */ i("span", {
53
+ className: "kapi-toast__msg",
54
+ children: e.message
55
+ }),
56
+ e.action && /* @__PURE__ */ i("button", {
57
+ type: "button",
58
+ className: "kapi-toast__action",
59
+ onClick: () => {
60
+ try {
61
+ e.action?.onClick();
62
+ } finally {
63
+ r.dismiss(e.id);
64
+ }
65
+ },
66
+ children: e.action.label
67
+ }),
68
+ /* @__PURE__ */ i("button", {
69
+ type: "button",
70
+ className: "kapi-toast__x",
71
+ "aria-label": g,
72
+ onClick: () => r.dismiss(e.id),
73
+ children: "×"
74
+ })
75
+ ]
76
+ }, e.id);
77
+ })
78
+ }), v) : null;
79
+ };
80
+ //#endregion
81
+ export { f as DEFAULT_TOAST_LABELS, m as KapiToastContainer };
@@ -0,0 +1,40 @@
1
+ import "./feedback.css";
2
+ import { type TourStep } from "./tourLogic";
3
+ import { type KapiRootProps } from "../rootProps";
4
+ import type { KapiLabelsOverride } from "../labelsLogic";
5
+ export type KapiTourLabels = {
6
+ next: string;
7
+ back: string;
8
+ done: string;
9
+ close: string;
10
+ of: string;
11
+ };
12
+ /** `className`/`style`/`id` van al popover del paso (el diálogo); la posición calculada gana sobre `style`. */
13
+ export type KapiTourProps = KapiRootProps & {
14
+ /** Pasos del tour (se saltean los cuyo selector no existe). */
15
+ steps: readonly TourStep[];
16
+ /** Controlado: el tour se muestra mientras sea true. */
17
+ open: boolean;
18
+ /** Se llama al cerrar (X, Escape o "Listo") y cuando no hay pasos disponibles. */
19
+ onClose: () => void;
20
+ /**
21
+ * Si se pasa, al cerrar se marca como visto en localStorage con esta clave (`true` = `kapi:tour-seen`).
22
+ * Para aislar dos apps del mismo origen usa una clave con namespace, p. ej. `"tramites:tour-seen"`
23
+ * (las claves `*:tour-seen` heredan el `v2_tour_seen` viejo en la primera lectura).
24
+ */
25
+ markSeen?: boolean | string;
26
+ /** Textos fijos (clave `tour`). */
27
+ labels?: KapiLabelsOverride<KapiTourLabels> | undefined;
28
+ };
29
+ /**
30
+ * Tour guiado genérico: spotlight + popover, recalcula en resize/scroll, Escape cierra.
31
+ * Accesible: el popover es un diálogo modal que recibe el foco en cada paso, atrapa Tab, y al cerrar
32
+ * el foco vuelve a donde estaba antes de abrir.
33
+ */
34
+ export declare const KapiTour: ({ steps, open, onClose, markSeen, labels, className, style, id }: KapiTourProps) => import("react").ReactPortal | null;
35
+ /** Estado mínimo para controlar un tour: `const t = useKapiTour(); <KapiTour open={t.open} onClose={t.close} .../>`. */
36
+ export declare const useKapiTour: (initialOpen?: boolean) => {
37
+ open: boolean;
38
+ start: () => void;
39
+ close: () => void;
40
+ };
@@ -0,0 +1,157 @@
1
+ "use client";
2
+ import { useLabels as e } from "../locale/KapiLocaleProvider.js";
3
+ import { useKapiRoot as t } from "../../hooks/kapiRoot.js";
4
+ import { onViewportChange as n } from "../../hooks/rafThrottle.js";
5
+ import { usePlacement as r } from "../../hooks/usePlacement.js";
6
+ import { joinClasses as i } from "../rootProps.js";
7
+ import { trapTabKey as a } from "../../hooks/focusLogic.js";
8
+ /* empty css */
9
+ import { TOUR_PLACEMENT as o, filterAvailableSteps as s, highlightBox as c, markTourSeen as l } from "./tourLogic.js";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ import { useCallback as f, useEffect as p, useId as m, useLayoutEffect as h, useRef as g, useState as _ } from "react";
12
+ import { createPortal as v } from "react-dom";
13
+ //#region src/components/feedback/KapiTour.tsx
14
+ var y = {
15
+ next: "Siguiente",
16
+ back: "Atrás",
17
+ done: "Listo",
18
+ close: "Cerrar",
19
+ of: "de"
20
+ }, b = ({ steps: b, open: x, onClose: S, markSeen: C, labels: w, className: T, style: E, id: D }) => {
21
+ let O = e("tour", y, w), k = t(), [A, j] = _([]), [M, N] = _(0), [P, F] = _(null), I = g(null), L = m(), R = f(() => {
22
+ C && l(typeof C == "string" ? C : void 0), S();
23
+ }, [C, S]), z = b.map((e) => e.element).join("|"), B = g(b);
24
+ B.current = b, p(() => {
25
+ if (!x) {
26
+ j([]);
27
+ return;
28
+ }
29
+ let e = s(B.current, (e) => document.querySelector(e) !== null);
30
+ e.length ? (j(e), N(0)) : R();
31
+ }, [x, z]);
32
+ let V = x ? A[M] : void 0;
33
+ h(() => {
34
+ if (!x) return;
35
+ let e = document.activeElement instanceof HTMLElement ? document.activeElement : null;
36
+ return () => {
37
+ e?.isConnected && e.focus();
38
+ };
39
+ }, [x]), p(() => {
40
+ V && k && I.current?.focus();
41
+ }, [V, k]), h(() => {
42
+ if (!V) return;
43
+ let e = document.querySelector(V.element);
44
+ if (!e) {
45
+ F(null);
46
+ return;
47
+ }
48
+ e.scrollIntoView({
49
+ block: "nearest",
50
+ inline: "nearest"
51
+ });
52
+ let t = () => F(c(e.getBoundingClientRect()));
53
+ return t(), n(t);
54
+ }, [V]);
55
+ let { style: H, update: U } = r({
56
+ open: !!V && !!k,
57
+ anchor: () => {
58
+ let e = V ? document.querySelector(V.element) : null;
59
+ return e ? e.getBoundingClientRect() : null;
60
+ },
61
+ floatingRef: I,
62
+ measure: !1,
63
+ estimate: {
64
+ width: 300,
65
+ height: 180
66
+ },
67
+ ...o,
68
+ width: { max: 300 },
69
+ hideUntilPlaced: !1
70
+ });
71
+ if (h(() => {
72
+ V && U();
73
+ }, [V, U]), p(() => {
74
+ if (!V) return;
75
+ let e = (e) => {
76
+ e.key === "Escape" && (e.preventDefault(), R());
77
+ };
78
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
79
+ }, [V, R]), !k || !V) return null;
80
+ let W = M === A.length - 1;
81
+ return v(/* @__PURE__ */ d("div", {
82
+ className: "kapi-tour",
83
+ children: [P && /* @__PURE__ */ u("div", {
84
+ className: "kapi-tour__hl",
85
+ style: P
86
+ }), /* @__PURE__ */ d("div", {
87
+ ref: I,
88
+ id: D,
89
+ className: i("kapi-tour__pop", T),
90
+ style: {
91
+ ...E,
92
+ ...H
93
+ },
94
+ role: "dialog",
95
+ "aria-modal": "true",
96
+ "aria-label": V.title,
97
+ "aria-describedby": L,
98
+ tabIndex: -1,
99
+ onKeyDown: (e) => {
100
+ e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), R()) : a(e, I.current);
101
+ },
102
+ children: [
103
+ /* @__PURE__ */ u("button", {
104
+ type: "button",
105
+ className: "kapi-tour__x",
106
+ onClick: R,
107
+ "aria-label": O.close,
108
+ children: "×"
109
+ }),
110
+ /* @__PURE__ */ u("div", {
111
+ className: "kapi-tour__title",
112
+ children: V.title
113
+ }),
114
+ /* @__PURE__ */ u("div", {
115
+ className: "kapi-tour__desc",
116
+ id: L,
117
+ children: V.description
118
+ }),
119
+ /* @__PURE__ */ d("div", {
120
+ className: "kapi-tour__foot",
121
+ children: [/* @__PURE__ */ d("span", {
122
+ className: "kapi-tour__prog",
123
+ children: [
124
+ M + 1,
125
+ " ",
126
+ O.of,
127
+ " ",
128
+ A.length
129
+ ]
130
+ }), /* @__PURE__ */ d("div", {
131
+ className: "kapi-tour__foot-actions",
132
+ children: [M > 0 && /* @__PURE__ */ u("button", {
133
+ type: "button",
134
+ className: "kapi-btn",
135
+ onClick: () => N(M - 1),
136
+ children: O.back
137
+ }), /* @__PURE__ */ u("button", {
138
+ type: "button",
139
+ className: "kapi-btn kapi-btn--primary",
140
+ onClick: () => W ? R() : N(M + 1),
141
+ children: W ? O.done : O.next
142
+ })]
143
+ })]
144
+ })
145
+ ]
146
+ })]
147
+ }), k);
148
+ }, x = (e = !1) => {
149
+ let [t, n] = _(e);
150
+ return {
151
+ open: t,
152
+ start: f(() => n(!0), []),
153
+ close: f(() => n(!1), [])
154
+ };
155
+ };
156
+ //#endregion
157
+ export { b as KapiTour, x as useKapiTour };
@@ -0,0 +1,35 @@
1
+ import type { HTMLAttributes } from "react";
2
+ import "./KapiUnsavedBar.css";
3
+ import type { KapiLabelsOverride } from "../labelsLogic";
4
+ /** Atributos nativos (`id`, `style`, `data-*`…) van a la región; `role` y `aria-label` son propios. */
5
+ export type KapiUnsavedBarProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "role" | "aria-label"> & {
6
+ /** Cantidad de cambios; sin valor muestra "Cambios sin guardar". */
7
+ count?: number;
8
+ /** Click en "Descartar". */
9
+ onDiscard: () => void;
10
+ /** Click en "Guardar". */
11
+ onSave: () => void;
12
+ /** Guardando: deshabilita ambos botones y marca Guardar como ocupado. */
13
+ saving?: boolean;
14
+ /** Gana sobre `labels.discard` ("Descartar"). */
15
+ discardLabel?: string;
16
+ /** Gana sobre `labels.save` ("Guardar"). */
17
+ saveLabel?: string;
18
+ /** Texto del conteo. Default `unsavedCountLabel` ("Cambios sin guardar" / "N cambios sin guardar"). */
19
+ countLabel?: (count?: number) => string;
20
+ /** Textos fijos (nombre de la región, botones y "Guardando…"). */
21
+ labels?: KapiLabelsOverride<KapiUnsavedBarLabels> | undefined;
22
+ };
23
+ export type KapiUnsavedBarLabels = {
24
+ region: string;
25
+ saving: string;
26
+ discard: string;
27
+ save: string;
28
+ };
29
+ export declare const DEFAULT_UNSAVED_BAR_LABELS: KapiUnsavedBarLabels;
30
+ /**
31
+ * Barra sticky de "cambios sin guardar": a la izquierda el conteo, a la derecha
32
+ * Descartar (ghost) y Guardar (primary). Renderizala sólo mientras haya cambios.
33
+ * Combinala con `useUnsavedGuard` para proteger la navegación.
34
+ */
35
+ export declare const KapiUnsavedBar: ({ count, onDiscard, onSave, saving, discardLabel, saveLabel, className, countLabel, labels, ...rest }: KapiUnsavedBarProps) => import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { KapiButton as e } from "../inputs/KapiButton.js";
3
+ import { useLabels as t } from "../locale/KapiLocaleProvider.js";
4
+ import { unsavedCountLabel as n } from "./unsavedBarLogic.js";
5
+ /* empty css */
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
7
+ //#region src/components/feedback/KapiUnsavedBar.tsx
8
+ var a = {
9
+ region: "Cambios sin guardar",
10
+ saving: "Guardando…",
11
+ discard: "Descartar",
12
+ save: "Guardar"
13
+ }, o = ({ count: o, onDiscard: s, onSave: c, saving: l = !1, discardLabel: u, saveLabel: d, className: f, countLabel: p = n, labels: m, ...h }) => {
14
+ let g = t("unsavedBar", a, m);
15
+ return /* @__PURE__ */ i("div", {
16
+ ...h,
17
+ className: `kapi-unsaved-bar${f ? ` ${f}` : ""}`,
18
+ role: "region",
19
+ "aria-label": g.region,
20
+ children: [/* @__PURE__ */ i("span", {
21
+ className: "kapi-unsaved-bar__label",
22
+ role: "status",
23
+ children: [/* @__PURE__ */ r("span", {
24
+ className: "kapi-unsaved-bar__dot",
25
+ "aria-hidden": "true"
26
+ }), p(o)]
27
+ }), /* @__PURE__ */ i("div", {
28
+ className: "kapi-unsaved-bar__actions",
29
+ children: [/* @__PURE__ */ r(e, {
30
+ size: "sm",
31
+ variant: "ghost",
32
+ onClick: s,
33
+ disabled: l,
34
+ children: u ?? g.discard
35
+ }), /* @__PURE__ */ r(e, {
36
+ size: "sm",
37
+ variant: "primary",
38
+ onClick: c,
39
+ disabled: l,
40
+ "aria-busy": l || void 0,
41
+ children: l ? g.saving : d ?? g.save
42
+ })]
43
+ })]
44
+ });
45
+ };
46
+ //#endregion
47
+ export { a as DEFAULT_UNSAVED_BAR_LABELS, o as KapiUnsavedBar };
@@ -0,0 +1,2 @@
1
+ /** Etiqueta del conteo de filas seleccionadas ("filas" es femenino). */
2
+ export declare const selectedCountLabel: (n: number) => string;
@@ -0,0 +1,7 @@
1
+ //#region src/components/feedback/bulkBarLogic.ts
2
+ var e = (e) => {
3
+ let t = Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : 0;
4
+ return t === 1 ? "1 seleccionada" : `${t} seleccionadas`;
5
+ };
6
+ //#endregion
7
+ export { e as selectedCountLabel };
@@ -0,0 +1,74 @@
1
+ /** Pure time math for KapiCountdown. No DOM, no clock access: `now` is always injected. */
2
+ export type KapiCountdownTarget = Date | string | number;
3
+ /** Coarse state of a deadline, derived from the remaining milliseconds. */
4
+ export type KapiCountdownBucket = "far" | "near" | "overdue";
5
+ /** Badge color roles a bucket can map to (mirrors KapiBadge variants). */
6
+ export type KapiCountdownTone = "neutral" | "primary" | "success" | "info" | "warning" | "danger";
7
+ export type KapiCountdownToneMap = Record<KapiCountdownBucket, KapiCountdownTone>;
8
+ export type CountdownBreakdown = {
9
+ /** True when the target is now or in the past (remaining <= 0). */
10
+ overdue: boolean;
11
+ days: number;
12
+ hours: number;
13
+ minutes: number;
14
+ seconds: number;
15
+ };
16
+ export declare const SECOND_MS = 1000;
17
+ export declare const MINUTE_MS: number;
18
+ export declare const HOUR_MS: number;
19
+ export declare const DAY_MS: number;
20
+ /** A deadline within this window is "near" unless overridden. */
21
+ export declare const DEFAULT_NEAR_MS: number;
22
+ export declare const DEFAULT_TONES: KapiCountdownToneMap;
23
+ /** Target to epoch milliseconds. Returns `NaN` for anything unparseable. */
24
+ export declare const parseTarget: (to: KapiCountdownTarget) => number;
25
+ /** Milliseconds left until `target` (negative once passed). `NaN` for an invalid target. */
26
+ export declare const remainingMs: (target: KapiCountdownTarget, now: number) => number;
27
+ /**
28
+ * Splits a duration into d/h/m/s. Uses the absolute value (the sign only sets `overdue`)
29
+ * and floors, so partial seconds never round a deadline up.
30
+ */
31
+ export declare const breakdown: (ms: number) => CountdownBreakdown;
32
+ /** Which bucket a remaining time falls in. `nearMs` itself is still "near"; <= 0 is overdue. */
33
+ export declare const bucketFor: (ms: number, nearMs?: number) => KapiCountdownBucket;
34
+ /** Merges a partial tone override over the defaults. */
35
+ export declare const resolveTones: (tones?: Partial<KapiCountdownToneMap>) => KapiCountdownToneMap;
36
+ /** Ticking clock label: `HH:MM:SS`, prefixed by `Nd ` when a day or more remains. Zero when overdue. */
37
+ export declare const formatClock: (ms: number) => string;
38
+ /** Forms of one unit keyed by `Intl.PluralRules` category; `other` is the fallback. */
39
+ export type KapiCountdownUnitForms = {
40
+ one: string;
41
+ other: string;
42
+ } & Partial<Record<Intl.LDMLPluralRule, string>>;
43
+ /** Locale used for plural rules when none is given (matches the Spanish default copy). */
44
+ export declare const DEFAULT_COUNTDOWN_LOCALE = "es";
45
+ /**
46
+ * Human duration using the two most significant units: "3 días y 4 horas",
47
+ * "5 minutos y 2 segundos", "7 segundos". Zero gives "0 segundos". Unit words and the
48
+ * conjunction come from `labels` (missing keys use the Spanish defaults); the plural form is picked
49
+ * with `Intl.PluralRules(locale)`, or `es` for the default Spanish unit words.
50
+ */
51
+ export declare const formatDuration: (ms: number, labels?: KapiCountdownLabels, locale?: string) => string;
52
+ export type KapiCountdownLabels = {
53
+ /** Chip text once the deadline passed (shown alone when exactly zero). */
54
+ overdue: string;
55
+ /** Prefix of the overdue elapsed time, e.g. "Venció hace". */
56
+ overduePrefix: string;
57
+ /** Prefix of the tooltip while running, e.g. "Faltan". */
58
+ remainingPrefix: string;
59
+ day?: KapiCountdownUnitForms;
60
+ hour?: KapiCountdownUnitForms;
61
+ minute?: KapiCountdownUnitForms;
62
+ second?: KapiCountdownUnitForms;
63
+ /** Joins the two units, e.g. "y" in "3 días y 4 horas". */
64
+ conjunction?: string;
65
+ /** Remaining time under one second, e.g. "menos de 1 segundo". */
66
+ lessThanSecond?: string;
67
+ };
68
+ export declare const DEFAULT_COUNTDOWN_LABELS: Required<KapiCountdownLabels>;
69
+ /** Alias kept for existing imports. */
70
+ export declare const DEFAULT_LABELS: Required<KapiCountdownLabels>;
71
+ /** Short chip text: the ticking clock while running, "Vencido" once the deadline passed. */
72
+ export declare const chipText: (ms: number, labels?: KapiCountdownLabels) => string;
73
+ /** Full sentence for the tooltip / accessible name. */
74
+ export declare const describe: (ms: number, labels?: KapiCountdownLabels, locale?: string) => string;
@@ -0,0 +1,70 @@
1
+ import { withLabels as e } from "../labelsLogic.js";
2
+ //#region src/components/feedback/countdownLogic.ts
3
+ var t = 1e3, n = 60 * t, r = 60 * n, i = 24 * r, a = i, o = {
4
+ far: "info",
5
+ near: "warning",
6
+ overdue: "danger"
7
+ }, s = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? Number.isFinite(e) ? e : NaN : typeof e == "string" && e.trim() !== "" ? new Date(e).getTime() : NaN, c = (e, t) => s(e) - t, l = (e) => {
8
+ let a = Number.isFinite(e) ? e : 0, o = Math.floor(Math.abs(a) / t) * t;
9
+ return {
10
+ overdue: a <= 0,
11
+ days: Math.floor(o / i),
12
+ hours: Math.floor(o % i / r),
13
+ minutes: Math.floor(o % r / n),
14
+ seconds: Math.floor(o % n / t)
15
+ };
16
+ }, u = (e, t = a) => !Number.isFinite(e) || e <= 0 ? "overdue" : e <= t ? "near" : "far", d = (e) => ({
17
+ ...o,
18
+ ...e
19
+ }), f = (e) => String(e).padStart(2, "0"), p = (e) => {
20
+ let t = l(e);
21
+ if (t.overdue) return "00:00:00";
22
+ let n = `${f(t.hours)}:${f(t.minutes)}:${f(t.seconds)}`;
23
+ return t.days > 0 ? `${t.days}d ${n}` : n;
24
+ }, m = "es", h = /* @__PURE__ */ new Map(), g = (e) => {
25
+ let t = h.get(e);
26
+ if (!t) {
27
+ try {
28
+ t = new Intl.PluralRules(e);
29
+ } catch {
30
+ t = new Intl.PluralRules("es");
31
+ }
32
+ h.set(e, t);
33
+ }
34
+ return t;
35
+ }, _ = (t) => t === b ? b : e(b, t), v = (e, t, n, r) => {
36
+ let i = n[t];
37
+ return `${e} ${i[g(i === b[t] ? "es" : r).select(e)] ?? i.other}`;
38
+ }, y = (e, t = x, n = "es") => {
39
+ let r = l(e), i = _(t), a = (e, t) => v(e, t, i, n), o = [];
40
+ return r.days > 0 ? (o.push(a(r.days, "day")), r.hours > 0 && o.push(a(r.hours, "hour"))) : r.hours > 0 ? (o.push(a(r.hours, "hour")), r.minutes > 0 && o.push(a(r.minutes, "minute"))) : r.minutes > 0 ? (o.push(a(r.minutes, "minute")), r.seconds > 0 && o.push(a(r.seconds, "second"))) : o.push(a(r.seconds, "second")), o.join(` ${i.conjunction} `);
41
+ }, b = {
42
+ overdue: "Vencido",
43
+ overduePrefix: "Venció hace",
44
+ remainingPrefix: "Faltan",
45
+ day: {
46
+ one: "día",
47
+ other: "días"
48
+ },
49
+ hour: {
50
+ one: "hora",
51
+ other: "horas"
52
+ },
53
+ minute: {
54
+ one: "minuto",
55
+ other: "minutos"
56
+ },
57
+ second: {
58
+ one: "segundo",
59
+ other: "segundos"
60
+ },
61
+ conjunction: "y",
62
+ lessThanSecond: "menos de 1 segundo"
63
+ }, x = b, S = (e, t = x) => u(e) === "overdue" ? t.overdue : p(e), C = (e, t = x, n = "es") => {
64
+ if (!Number.isFinite(e)) return "";
65
+ if (e <= 0) return Math.floor(Math.abs(e) / 1e3) === 0 ? t.overdue : `${t.overduePrefix} ${y(e, t, n)}`;
66
+ let r = e < 1e3 ? t.lessThanSecond ?? b.lessThanSecond : y(e, t, n);
67
+ return `${t.remainingPrefix} ${r}`;
68
+ };
69
+ //#endregion
70
+ export { i as DAY_MS, b as DEFAULT_COUNTDOWN_LABELS, m as DEFAULT_COUNTDOWN_LOCALE, x as DEFAULT_LABELS, a as DEFAULT_NEAR_MS, o as DEFAULT_TONES, r as HOUR_MS, n as MINUTE_MS, t as SECOND_MS, l as breakdown, u as bucketFor, S as chipText, C as describe, p as formatClock, y as formatDuration, s as parseTarget, c as remainingMs, d as resolveTones };