@kapiuara/ui 0.15.3 → 0.17.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 (288) hide show
  1. package/LICENSE +19 -15
  2. package/README.md +505 -13
  3. package/dist/components/chat/KapiChatThread.js +4 -4
  4. package/dist/components/chat/KapiComposer.js +8 -8
  5. package/dist/components/data/KapiDataTable.d.ts +1 -1
  6. package/dist/components/data/KapiDataTable.js +25 -25
  7. package/dist/components/data/KapiPaginationFooter.js +1 -1
  8. package/dist/components/data/KapiSheet.d.ts +105 -0
  9. package/dist/components/data/KapiSheet.js +75 -0
  10. package/dist/components/data/KapiSparkline.d.ts +2 -1
  11. package/dist/components/data/KapiSparkline.js +29 -26
  12. package/dist/components/data/KapiTable.d.ts +2 -2
  13. package/dist/components/data/KapiTable.js +347 -329
  14. package/dist/components/data/KapiTableFilter.js +6 -6
  15. package/dist/components/data/KapiTableFooter.d.ts +22 -0
  16. package/dist/components/data/KapiTableFooter.js +55 -0
  17. package/dist/components/data/KapiTableRow.js +53 -52
  18. package/dist/components/data/KapiTableToolbar.d.ts +4 -2
  19. package/dist/components/data/KapiTableToolbar.js +71 -69
  20. package/dist/components/data/index.d.ts +3 -1
  21. package/dist/components/data/tableCells.d.ts +17 -5
  22. package/dist/components/data/tableCells.js +52 -53
  23. package/dist/components/data/tableLogic.d.ts +2 -0
  24. package/dist/components/data/tableLogic.js +66 -66
  25. package/dist/components/data/tableSlots.d.ts +9 -0
  26. package/dist/components/data/tableSlots.js +12 -0
  27. package/dist/components/data/tableSpanLogic.d.ts +35 -0
  28. package/dist/components/data/tableSpanLogic.js +47 -0
  29. package/dist/components/data/tableTypes.d.ts +54 -1
  30. package/dist/components/data/useTableSelection.d.ts +4 -2
  31. package/dist/components/data/useTableSelection.js +29 -25
  32. package/dist/components/display/KapiAnchor.d.ts +36 -0
  33. package/dist/components/display/KapiAnchor.js +36 -0
  34. package/dist/components/display/KapiAnnotation.js +68 -63
  35. package/dist/components/display/KapiAvatar.d.ts +6 -4
  36. package/dist/components/display/KapiAvatar.js +33 -28
  37. package/dist/components/display/KapiBadge.d.ts +6 -5
  38. package/dist/components/display/KapiBadge.js +25 -19
  39. package/dist/components/display/KapiCodeBlock.d.ts +48 -0
  40. package/dist/components/display/KapiCodeBlock.js +44 -0
  41. package/dist/components/display/KapiCommentComposer.js +6 -6
  42. package/dist/components/display/KapiDiff.d.ts +62 -0
  43. package/dist/components/display/KapiDiff.js +118 -0
  44. package/dist/components/display/KapiHighlight.d.ts +27 -0
  45. package/dist/components/display/KapiHighlight.js +21 -0
  46. package/dist/components/display/KapiIconTile.d.ts +2 -1
  47. package/dist/components/display/KapiIconTile.js +23 -21
  48. package/dist/components/display/KapiStat.d.ts +3 -2
  49. package/dist/components/display/KapiStat.js +32 -26
  50. package/dist/components/display/KapiTag.d.ts +4 -3
  51. package/dist/components/display/KapiTag.js +29 -24
  52. package/dist/components/display/KapiText.d.ts +43 -0
  53. package/dist/components/display/KapiText.js +33 -0
  54. package/dist/components/display/KapiTimeline.d.ts +5 -2
  55. package/dist/components/display/KapiTimeline.js +31 -23
  56. package/dist/components/display/KapiTitle.d.ts +33 -0
  57. package/dist/components/display/KapiTitle.js +29 -0
  58. package/dist/components/display/annotationLogic.d.ts +2 -1
  59. package/dist/components/display/annotationLogic.js +7 -6
  60. package/dist/components/display/codeBlockSlots.d.ts +10 -0
  61. package/dist/components/display/codeBlockSlots.js +13 -0
  62. package/dist/components/display/diffLogic.d.ts +58 -0
  63. package/dist/components/display/diffLogic.js +96 -0
  64. package/dist/components/display/diffSlots.d.ts +14 -0
  65. package/dist/components/display/diffSlots.js +17 -0
  66. package/dist/components/display/highlightLogic.d.ts +18 -0
  67. package/dist/components/display/highlightLogic.js +26 -0
  68. package/dist/components/display/highlightSlots.d.ts +5 -0
  69. package/dist/components/display/highlightSlots.js +8 -0
  70. package/dist/components/display/iconTileLogic.d.ts +2 -2
  71. package/dist/components/display/iconTileLogic.js +7 -6
  72. package/dist/components/display/index.d.ts +15 -0
  73. package/dist/components/display/statLogic.d.ts +2 -1
  74. package/dist/components/display/statLogic.js +7 -6
  75. package/dist/components/display/tagLogic.d.ts +2 -1
  76. package/dist/components/display/tagLogic.js +7 -6
  77. package/dist/components/display/textLogic.d.ts +32 -0
  78. package/dist/components/display/textLogic.js +19 -0
  79. package/dist/components/display/timelineLogic.d.ts +20 -2
  80. package/dist/components/display/timelineLogic.js +10 -2
  81. package/dist/components/feedback/KapiAlert.d.ts +8 -4
  82. package/dist/components/feedback/KapiAlert.js +39 -34
  83. package/dist/components/feedback/KapiFab.js +108 -108
  84. package/dist/components/feedback/KapiProgress.js +63 -54
  85. package/dist/components/feedback/KapiToastContainer.js +9 -9
  86. package/dist/components/feedback/KapiTour.js +12 -12
  87. package/dist/components/feedback/progressLogic.d.ts +2 -1
  88. package/dist/components/feedback/progressLogic.js +9 -8
  89. package/dist/components/inputs/KapiAutocomplete.d.ts +6 -0
  90. package/dist/components/inputs/KapiAutocomplete.js +86 -85
  91. package/dist/components/inputs/KapiButton.d.ts +7 -4
  92. package/dist/components/inputs/KapiButton.js +47 -42
  93. package/dist/components/inputs/KapiChecklist.d.ts +7 -1
  94. package/dist/components/inputs/KapiChecklist.js +53 -52
  95. package/dist/components/inputs/KapiCopyButton.d.ts +40 -0
  96. package/dist/components/inputs/KapiCopyButton.js +35 -0
  97. package/dist/components/inputs/KapiDatePicker.d.ts +7 -1
  98. package/dist/components/inputs/KapiDatePicker.js +118 -116
  99. package/dist/components/inputs/KapiDateRangePicker.d.ts +7 -1
  100. package/dist/components/inputs/KapiDateRangePicker.js +136 -135
  101. package/dist/components/inputs/KapiFacetedSearch.js +5 -5
  102. package/dist/components/inputs/KapiField.d.ts +9 -1
  103. package/dist/components/inputs/KapiField.js +43 -42
  104. package/dist/components/inputs/KapiFileUpload.js +6 -6
  105. package/dist/components/inputs/KapiInput.d.ts +29 -1
  106. package/dist/components/inputs/KapiInput.js +74 -51
  107. package/dist/components/inputs/KapiMaskedInput.js +26 -26
  108. package/dist/components/inputs/KapiNumberStepper.d.ts +7 -1
  109. package/dist/components/inputs/KapiNumberStepper.js +24 -23
  110. package/dist/components/inputs/KapiPinInput.d.ts +72 -0
  111. package/dist/components/inputs/KapiPinInput.js +75 -0
  112. package/dist/components/inputs/KapiPropsForm.d.ts +34 -0
  113. package/dist/components/inputs/KapiPropsForm.js +78 -0
  114. package/dist/components/inputs/KapiRating.d.ts +7 -1
  115. package/dist/components/inputs/KapiRating.js +39 -38
  116. package/dist/components/inputs/KapiSearchChip.js +5 -5
  117. package/dist/components/inputs/KapiSegmented.d.ts +13 -5
  118. package/dist/components/inputs/KapiSegmented.js +81 -77
  119. package/dist/components/inputs/KapiSelect.d.ts +21 -1
  120. package/dist/components/inputs/KapiSelect.js +251 -245
  121. package/dist/components/inputs/KapiSelectMenu.d.ts +4 -2
  122. package/dist/components/inputs/KapiSelectMenu.js +131 -133
  123. package/dist/components/inputs/KapiSlider.d.ts +10 -3
  124. package/dist/components/inputs/KapiSlider.js +67 -63
  125. package/dist/components/inputs/KapiTagInput.d.ts +7 -1
  126. package/dist/components/inputs/KapiTagInput.js +70 -69
  127. package/dist/components/inputs/KapiTextarea.d.ts +7 -1
  128. package/dist/components/inputs/KapiTextarea.js +51 -50
  129. package/dist/components/inputs/copyLogic.d.ts +1 -0
  130. package/dist/components/inputs/copyLogic.js +12 -0
  131. package/dist/components/inputs/fieldLogic.d.ts +21 -1
  132. package/dist/components/inputs/fieldLogic.js +18 -11
  133. package/dist/components/inputs/index.d.ts +9 -1
  134. package/dist/components/inputs/inputLogic.d.ts +16 -1
  135. package/dist/components/inputs/inputLogic.js +3 -3
  136. package/dist/components/inputs/ownField.d.ts +3 -1
  137. package/dist/components/inputs/ownField.js +28 -27
  138. package/dist/components/inputs/pinInputLogic.d.ts +34 -0
  139. package/dist/components/inputs/pinInputLogic.js +37 -0
  140. package/dist/components/inputs/propsFormLogic.d.ts +53 -0
  141. package/dist/components/inputs/propsFormLogic.js +11 -0
  142. package/dist/components/inputs/segmentedLogic.d.ts +7 -0
  143. package/dist/components/inputs/segmentedLogic.js +2 -2
  144. package/dist/components/inputs/selectSlots.d.ts +24 -0
  145. package/dist/components/inputs/selectSlots.js +27 -0
  146. package/dist/components/layout/KapiAccessCard.d.ts +5 -1
  147. package/dist/components/layout/KapiAccessCard.js +43 -39
  148. package/dist/components/layout/KapiAccountMenu.js +7 -7
  149. package/dist/components/layout/KapiBox.d.ts +31 -0
  150. package/dist/components/layout/KapiBox.js +26 -0
  151. package/dist/components/layout/KapiCard.d.ts +16 -4
  152. package/dist/components/layout/KapiCard.js +46 -34
  153. package/dist/components/layout/KapiCenter.d.ts +13 -0
  154. package/dist/components/layout/KapiCenter.js +23 -0
  155. package/dist/components/layout/KapiCol.d.ts +22 -0
  156. package/dist/components/layout/KapiCol.js +23 -0
  157. package/dist/components/layout/KapiCollapse.d.ts +39 -0
  158. package/dist/components/layout/KapiCollapse.js +20 -0
  159. package/dist/components/layout/KapiContextSlot.js +4 -4
  160. package/dist/components/layout/KapiDivider.d.ts +11 -2
  161. package/dist/components/layout/KapiDivider.js +30 -24
  162. package/dist/components/layout/KapiGrid.d.ts +29 -3
  163. package/dist/components/layout/KapiGrid.js +39 -17
  164. package/dist/components/layout/KapiNotificationBell.js +10 -10
  165. package/dist/components/layout/KapiPageHeader.d.ts +10 -1
  166. package/dist/components/layout/KapiPageHeader.js +94 -92
  167. package/dist/components/layout/KapiPanelParts.d.ts +11 -2
  168. package/dist/components/layout/KapiPanelParts.js +73 -56
  169. package/dist/components/layout/KapiRail.d.ts +10 -1
  170. package/dist/components/layout/KapiRail.js +125 -122
  171. package/dist/components/layout/KapiRoot.d.ts +55 -5
  172. package/dist/components/layout/KapiRoot.js +57 -38
  173. package/dist/components/layout/KapiShell.d.ts +44 -3
  174. package/dist/components/layout/KapiShell.js +54 -50
  175. package/dist/components/layout/accessCardLogic.d.ts +8 -1
  176. package/dist/components/layout/accessCardLogic.js +11 -7
  177. package/dist/components/layout/cardSlots.d.ts +9 -0
  178. package/dist/components/layout/cardSlots.js +12 -0
  179. package/dist/components/layout/gridSpanLogic.d.ts +46 -0
  180. package/dist/components/layout/gridSpanLogic.js +39 -0
  181. package/dist/components/layout/index.d.ts +13 -4
  182. package/dist/components/layout/layoutPrimitives.d.ts +11 -0
  183. package/dist/components/layout/layoutPrimitives.js +12 -1
  184. package/dist/components/layout/pageHeaderSlots.d.ts +12 -0
  185. package/dist/components/layout/pageHeaderSlots.js +15 -0
  186. package/dist/components/layout/railLogic.d.ts +16 -3
  187. package/dist/components/layout/railSlots.d.ts +12 -0
  188. package/dist/components/layout/railSlots.js +15 -0
  189. package/dist/components/layout/shellSlots.d.ts +6 -0
  190. package/dist/components/layout/shellSlots.js +9 -0
  191. package/dist/components/layout/useGridBreakpoint.d.ts +12 -0
  192. package/dist/components/layout/useGridBreakpoint.js +35 -0
  193. package/dist/components/locale/labelRegistry.d.ts +10 -0
  194. package/dist/components/navigation/KapiAccordion.js +9 -9
  195. package/dist/components/navigation/KapiBreadcrumb.d.ts +18 -2
  196. package/dist/components/navigation/KapiBreadcrumb.js +23 -16
  197. package/dist/components/navigation/KapiContextPanel.d.ts +17 -4
  198. package/dist/components/navigation/KapiContextPanel.js +152 -136
  199. package/dist/components/navigation/KapiNavBadge.d.ts +6 -3
  200. package/dist/components/navigation/KapiNavBadge.js +26 -22
  201. package/dist/components/navigation/KapiPanelGroup.d.ts +16 -4
  202. package/dist/components/navigation/KapiPanelGroup.js +66 -65
  203. package/dist/components/navigation/KapiTabs.d.ts +12 -0
  204. package/dist/components/navigation/KapiTabs.js +87 -71
  205. package/dist/components/navigation/KapiToc.d.ts +48 -0
  206. package/dist/components/navigation/KapiToc.js +66 -0
  207. package/dist/components/navigation/KapiTree.js +10 -10
  208. package/dist/components/navigation/MiniNavItem.d.ts +7 -2
  209. package/dist/components/navigation/MiniNavItem.js +41 -36
  210. package/dist/components/navigation/breadcrumbLogic.d.ts +4 -2
  211. package/dist/components/navigation/breadcrumbLogic.js +1 -1
  212. package/dist/components/navigation/index.d.ts +3 -0
  213. package/dist/components/navigation/navLink.d.ts +21 -0
  214. package/dist/components/navigation/navLink.js +26 -0
  215. package/dist/components/navigation/navLinkLogic.d.ts +18 -0
  216. package/dist/components/navigation/navLinkLogic.js +22 -0
  217. package/dist/components/navigation/tocLogic.d.ts +35 -0
  218. package/dist/components/navigation/tocLogic.js +11 -0
  219. package/dist/components/navigation/tocSlots.d.ts +8 -0
  220. package/dist/components/navigation/tocSlots.js +11 -0
  221. package/dist/components/overlays/KapiCommandPalette.js +6 -6
  222. package/dist/components/overlays/KapiContextMenu.d.ts +8 -0
  223. package/dist/components/overlays/KapiContextMenu.js +5 -5
  224. package/dist/components/overlays/KapiMenuButton.js +7 -7
  225. package/dist/components/overlays/KapiModal.d.ts +9 -0
  226. package/dist/components/overlays/KapiModal.js +79 -77
  227. package/dist/components/overlays/KapiOffcanvas.js +24 -24
  228. package/dist/components/overlays/KapiPhotoView.js +10 -10
  229. package/dist/components/overlays/KapiPopover.js +6 -6
  230. package/dist/components/overlays/KapiShapeSheet.js +4 -4
  231. package/dist/components/overlays/KapiTooltip.js +18 -18
  232. package/dist/components/overlays/index.d.ts +1 -1
  233. package/dist/components/overlays/menuList.js +127 -117
  234. package/dist/components/overlays/modalSlots.d.ts +11 -0
  235. package/dist/components/overlays/modalSlots.js +14 -0
  236. package/dist/components/slotCatalog.d.ts +123 -0
  237. package/dist/components/slotCatalog.js +27 -0
  238. package/dist/components/slotsLogic.d.ts +34 -0
  239. package/dist/components/slotsLogic.js +18 -0
  240. package/dist/components/tone.d.ts +26 -0
  241. package/dist/components/tone.js +15 -14
  242. package/dist/css/base.css +1 -1
  243. package/dist/css/components/data/KapiEventCalendar.css +1 -1
  244. package/dist/css/components/data/KapiTable.css +1 -1
  245. package/dist/css/components/display/KapiAnnotation.css +1 -1
  246. package/dist/css/components/display/KapiCodeBlock.css +1 -0
  247. package/dist/css/components/display/KapiDiff.css +1 -0
  248. package/dist/css/components/display/display.css +1 -1
  249. package/dist/css/components/display/typography.css +1 -0
  250. package/dist/css/components/feedback/feedback.css +1 -1
  251. package/dist/css/components/inputs/KapiButton.css +1 -1
  252. package/dist/css/components/inputs/KapiDatePicker.css +1 -1
  253. package/dist/css/components/inputs/KapiPinInput.css +1 -0
  254. package/dist/css/components/inputs/KapiSelect.css +1 -1
  255. package/dist/css/components/inputs/inputsExtra.css +1 -1
  256. package/dist/css/components/layout/KapiAccessCard.css +1 -1
  257. package/dist/css/components/layout/KapiBox.css +1 -0
  258. package/dist/css/components/layout/KapiCollapse.css +1 -0
  259. package/dist/css/components/layout/KapiDivider.css +1 -1
  260. package/dist/css/components/layout/KapiRail.css +1 -1
  261. package/dist/css/components/layout/gridSpan.css +1 -0
  262. package/dist/css/components/navigation/KapiToc.css +1 -0
  263. package/dist/css/components/navigation/navigation.css +1 -1
  264. package/dist/hooks/asyncResourceLogic.d.ts +11 -0
  265. package/dist/hooks/asyncResourceLogic.js +4 -0
  266. package/dist/hooks/densityLogic.d.ts +15 -0
  267. package/dist/hooks/densityLogic.js +4 -0
  268. package/dist/hooks/index.d.ts +7 -0
  269. package/dist/hooks/themeColorsLogic.d.ts +19 -0
  270. package/dist/hooks/themeColorsLogic.js +4 -2
  271. package/dist/hooks/themeDeriveLogic.d.ts +16 -0
  272. package/dist/hooks/themeDeriveLogic.js +27 -17
  273. package/dist/hooks/toneFamilyLogic.d.ts +146 -0
  274. package/dist/hooks/toneFamilyLogic.js +164 -0
  275. package/dist/hooks/useAsyncResource.d.ts +45 -0
  276. package/dist/hooks/useAsyncResource.js +24 -0
  277. package/dist/hooks/useKapiTheme.d.ts +16 -3
  278. package/dist/hooks/useKapiTheme.js +130 -117
  279. package/dist/hooks/useToneFamilies.d.ts +40 -0
  280. package/dist/hooks/useToneFamilies.js +50 -0
  281. package/dist/index.d.ts +3 -1
  282. package/dist/index.js +227 -204
  283. package/dist/kapi.css +1 -1
  284. package/dist/kapi.layered.css +1 -1
  285. package/dist/logic.d.ts +41 -0
  286. package/dist/logic.js +42 -0
  287. package/dist/styles/rawHeights.d.ts +8 -0
  288. package/package.json +14 -3
@@ -1,162 +1,164 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/layout/KapiPageHeader.css";
3
3
  import "#kapi-css/components/navigation/navigation.css";
4
- import { computedStyleOf as e, docOf as t } from "../../hooks/ownerDocument.js";
5
- import { useMergedRefs as n } from "../../hooks/mergeRefs.js";
6
- import { prefersReducedMotion as r } from "../../hooks/reducedMotion.js";
7
- import { maxTransitionMs as i } from "../overlays/dialogUtils.js";
4
+ import { useMergedRefs as e } from "../../hooks/mergeRefs.js";
5
+ import { computedStyleOf as t, docOf as n } from "../../hooks/ownerDocument.js";
6
+ import { slot as r } from "../slotsLogic.js";
7
+ import { prefersReducedMotion as i } from "../../hooks/reducedMotion.js";
8
+ import { maxTransitionMs as a } from "../overlays/dialogUtils.js";
8
9
  /* empty css */
9
- import { KapiBreadcrumb as a } from "../navigation/KapiBreadcrumb.js";
10
- import { useReopenBus as o } from "./reopenBus.js";
11
- import { useScrollCollapse as s } from "../../hooks/useScrollCollapse.js";
12
- import { pageHeaderBox as c } from "./pageHeaderLogic.js";
10
+ import { KapiBreadcrumb as o } from "../navigation/KapiBreadcrumb.js";
11
+ import { useReopenBus as s } from "./reopenBus.js";
12
+ import { useScrollCollapse as c } from "../../hooks/useScrollCollapse.js";
13
+ import { pageHeaderBox as l } from "./pageHeaderLogic.js";
13
14
  /* empty css */
14
- import { useEffect as l, useLayoutEffect as u, useRef as d } from "react";
15
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
16
- import { ChevronsLeft as h, ChevronsRight as g } from "lucide-react";
15
+ import { PAGEHEADER_SLOTS as u } from "./pageHeaderSlots.js";
16
+ import { useEffect as d, useLayoutEffect as f, useRef as p } from "react";
17
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
18
+ import { ChevronsLeft as _, ChevronsRight as v } from "lucide-react";
17
19
  //#region src/components/layout/KapiPageHeader.tsx
18
- var _ = "kapi-pageheader--collapsed", v = "kapi-pageheader--animating", y = "kapi-pageheader--measuring", b = 80, x = (e, t) => {
20
+ var y = "kapi-pageheader--collapsed", b = "kapi-pageheader--animating", x = "kapi-pageheader--measuring", S = 80, C = (e, t) => {
19
21
  let n = e.style.height;
20
- e.classList.add(y), e.style.height = "", e.classList.toggle(_, !1);
22
+ e.classList.add(x), e.style.height = "", e.classList.toggle(y, !1);
21
23
  let r = e.getBoundingClientRect().height;
22
- e.classList.toggle(_, !0);
24
+ e.classList.toggle(y, !0);
23
25
  let i = e.getBoundingClientRect().height;
24
- return e.classList.toggle(_, t), e.style.height = n, e.getBoundingClientRect(), e.classList.remove(y), {
26
+ return e.classList.toggle(y, t), e.style.height = n, e.getBoundingClientRect(), e.classList.remove(x), {
25
27
  expanded: r,
26
28
  collapsed: i
27
29
  };
28
- }, S = (e, t) => {
29
- let n = c(e, t);
30
+ }, w = (e, t) => {
31
+ let n = l(e, t);
30
32
  return t ? n : {
31
33
  height: null,
32
34
  reserve: n.reserve
33
35
  };
34
- }, C = (e, t, n) => {
36
+ }, T = (e, t, n) => {
35
37
  let r = () => {
36
38
  t.height === null ? e.style.removeProperty("height") : e.style.height = `${t.height}px`, e.style.setProperty("--kapi-pageheader-reserve", `${t.reserve}px`);
37
39
  };
38
40
  n ? r() : (e.style.transition = "none", r(), e.getBoundingClientRect(), e.style.transition = "");
39
41
  };
40
- function w({ title: _, subtitle: y, meta: w, actions: T, chip: E, breadcrumbs: D, collapseOnScroll: O = !0, sticky: k = !0, scrollRoot: A = null, responsive: j = !0, className: M, ref: N, ...P }) {
41
- let { collapsed: F, sentinelRef: I } = s({ root: A }), L = O && F, R = d(null), z = n(R, N), B = d({
42
+ function E({ title: y, subtitle: x, meta: E, actions: D, chip: O, breadcrumbs: k, collapseOnScroll: A = !0, sticky: j = !0, scrollRoot: M = null, responsive: N = !0, className: P, classNames: F, ref: I, ...L }) {
43
+ let { collapsed: R, sentinelRef: z } = c({ root: M }), B = A && R, V = p(null), H = e(V, I), U = p({
42
44
  expanded: 0,
43
45
  collapsed: 0
44
- }), V = d(L);
45
- V.current = L;
46
- let H = d(!1), U = d(!1);
47
- u(() => {
48
- let e = R.current;
46
+ }), W = p(B);
47
+ W.current = B;
48
+ let G = p(!1), K = p(!1);
49
+ f(() => {
50
+ let e = V.current;
49
51
  if (!e) return;
50
- let n = () => {
51
- U.current || (B.current = x(e, V.current), C(e, S(B.current, V.current), !1));
52
+ let t = () => {
53
+ K.current || (U.current = C(e, W.current), T(e, w(U.current, W.current), !1));
52
54
  };
53
- n();
55
+ t();
54
56
  let r = !0;
55
- if (t(e)?.fonts?.ready.then(() => {
56
- r && n();
57
+ if (n(e)?.fonts?.ready.then(() => {
58
+ r && t();
57
59
  }), typeof ResizeObserver > "u") return () => {
58
60
  r = !1;
59
61
  };
60
62
  let i = e.getBoundingClientRect().width, a = new ResizeObserver((e) => {
61
- let t = e[e.length - 1];
62
- if (!t) return;
63
- let r = t.borderBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
64
- r !== i && (i = r, n());
63
+ let n = e[e.length - 1];
64
+ if (!n) return;
65
+ let r = n.borderBoxSize?.[0]?.inlineSize ?? n.contentRect.width;
66
+ r !== i && (i = r, t());
65
67
  });
66
68
  return a.observe(e), () => {
67
69
  r = !1, a.disconnect();
68
70
  };
69
71
  }, [
70
- _,
71
72
  y,
72
- w,
73
- T,
73
+ x,
74
74
  E,
75
75
  D,
76
76
  O,
77
- j
78
- ]), u(() => {
79
- let t = R.current;
80
- if (!t) return;
81
- let { expanded: n } = B.current, a = c(B.current, L), o = H.current && !r(t);
82
- H.current = !0;
77
+ k,
78
+ A,
79
+ N
80
+ ]), f(() => {
81
+ let e = V.current;
82
+ if (!e) return;
83
+ let { expanded: n } = U.current, r = l(U.current, B), o = G.current && !i(e);
84
+ G.current = !0;
83
85
  let s = () => {
84
- U.current = !1, t.classList.remove(v), L || t.style.removeProperty("height");
86
+ K.current = !1, e.classList.remove(b), B || e.style.removeProperty("height");
85
87
  };
86
88
  if (!o) {
87
- C(t, S(B.current, L), !1);
89
+ T(e, w(U.current, B), !1);
88
90
  return;
89
91
  }
90
- t.style.height === "" && n > 0 && (t.style.height = `${n}px`, t.getBoundingClientRect()), U.current = !0, t.classList.add(v), C(t, a, !0);
91
- let l = (e) => {
92
- e.target === t && e.propertyName === "height" && s();
92
+ e.style.height === "" && n > 0 && (e.style.height = `${n}px`, e.getBoundingClientRect()), K.current = !0, e.classList.add(b), T(e, r, !0);
93
+ let c = (t) => {
94
+ t.target === e && t.propertyName === "height" && s();
93
95
  };
94
- t.addEventListener("transitionend", l);
95
- let u = e(t), d = window.setTimeout(s, i(u.transitionDuration, u.transitionDelay) + b);
96
+ e.addEventListener("transitionend", c);
97
+ let u = t(e), d = window.setTimeout(s, a(u.transitionDuration, u.transitionDelay) + S);
96
98
  return () => {
97
- t.removeEventListener("transitionend", l), window.clearTimeout(d);
99
+ e.removeEventListener("transitionend", c), window.clearTimeout(d);
98
100
  };
99
- }, [L]);
100
- let W = [
101
+ }, [B]);
102
+ let q = [
101
103
  "kapi-pageheader",
102
- k && "kapi-pageheader--sticky",
103
- j && "kapi-pageheader--cq",
104
- L && "kapi-pageheader--collapsed",
105
- M
106
- ].filter(Boolean).join(" "), G = o(), K = G?.addHost;
107
- l(() => K?.(), [K]);
108
- let q = G?.info ?? null, J = q?.side === "right" ? h : g;
109
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
110
- ref: I,
104
+ j && "kapi-pageheader--sticky",
105
+ N && "kapi-pageheader--cq",
106
+ B && "kapi-pageheader--collapsed",
107
+ P
108
+ ].filter(Boolean).join(" "), J = s(), Y = J?.addHost;
109
+ d(() => Y?.(), [Y]);
110
+ let X = J?.info ?? null, Z = X?.side === "right" ? _ : v;
111
+ return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
112
+ ref: z,
111
113
  className: "kapi-pageheader__sentinel",
112
114
  "aria-hidden": !0
113
- }), /* @__PURE__ */ m("header", {
114
- ...P,
115
- ref: z,
116
- className: W,
115
+ }), /* @__PURE__ */ g("header", {
116
+ ...L,
117
+ ref: H,
118
+ ...r(u, "root", F, q),
117
119
  children: [
118
- q && /* @__PURE__ */ p("button", {
120
+ X && /* @__PURE__ */ h("button", {
119
121
  type: "button",
120
- className: "kapi-paneltoggle kapi-pageheader__reopen",
121
- onClick: q.expand,
122
- "aria-label": q.label,
123
- children: /* @__PURE__ */ p(J, {
122
+ ...r(u, "reopen", F, "kapi-paneltoggle"),
123
+ onClick: X.expand,
124
+ "aria-label": X.label,
125
+ children: /* @__PURE__ */ h(Z, {
124
126
  className: "kapi-flip-rtl",
125
127
  size: 16,
126
128
  strokeWidth: 2,
127
129
  "aria-hidden": "true"
128
130
  })
129
131
  }),
130
- /* @__PURE__ */ m("div", {
131
- className: "kapi-pageheader__main",
132
+ /* @__PURE__ */ g("div", {
133
+ ...r(u, "main", F),
132
134
  children: [
133
- D && D.length > 0 && /* @__PURE__ */ p(a, {
134
- className: "kapi-pageheader__breadcrumb",
135
- items: D
135
+ k && k.length > 0 && /* @__PURE__ */ h(o, {
136
+ ...r(u, "breadcrumb", F),
137
+ items: k
136
138
  }),
137
- /* @__PURE__ */ m("div", {
138
- className: "kapi-pageheader__titlerow",
139
- children: [/* @__PURE__ */ p("h1", {
140
- className: "kapi-pageheader__title",
141
- children: _
142
- }), E]
139
+ /* @__PURE__ */ g("div", {
140
+ ...r(u, "titleRow", F),
141
+ children: [/* @__PURE__ */ h("h1", {
142
+ ...r(u, "title", F),
143
+ children: y
144
+ }), O]
143
145
  }),
144
- y && /* @__PURE__ */ p("div", {
145
- className: "kapi-pageheader__subtitle",
146
- children: y
146
+ x && /* @__PURE__ */ h("div", {
147
+ ...r(u, "subtitle", F),
148
+ children: x
147
149
  }),
148
- w && /* @__PURE__ */ p("div", {
149
- className: "kapi-pageheader__meta",
150
- children: w
150
+ E && /* @__PURE__ */ h("div", {
151
+ ...r(u, "meta", F),
152
+ children: E
151
153
  })
152
154
  ]
153
155
  }),
154
- T && /* @__PURE__ */ p("div", {
155
- className: "kapi-pageheader__actions",
156
- children: T
156
+ D && /* @__PURE__ */ h("div", {
157
+ ...r(u, "actions", F),
158
+ children: D
157
159
  })
158
160
  ]
159
161
  })] });
160
162
  }
161
163
  //#endregion
162
- export { w as KapiPageHeader };
164
+ export { E as KapiPageHeader };
@@ -1,6 +1,7 @@
1
1
  import { type KapiNavBadgeValue } from "../navigation/navBadgeLogic.js";
2
2
  import type { KapiTone } from "../tone.js";
3
3
  import type { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ReactNode, Ref } from "react";
4
+ import { type KapiRender } from "../renderSlot.js";
4
5
  type DivProps = HTMLAttributes<HTMLDivElement> & {
5
6
  /** Ref al `<div>` raíz. */
6
7
  ref?: Ref<HTMLDivElement> | undefined;
@@ -41,8 +42,16 @@ export declare const KapiPanelList: ({ children, ...rest }: Omit<DivProps, "chil
41
42
  children: ReactNode;
42
43
  }) => import("react").JSX.Element;
43
44
  export type KapiPanelItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
44
- /** Ref al `<button>` del ítem. */
45
+ /** Ref al `<button>` del ítem (o al elemento de `render`). */
45
46
  ref?: Ref<HTMLButtonElement> | undefined;
47
+ /**
48
+ * Dibuja OTRO elemento con el aspecto del ítem: el `<Link>` de tu router, para navegar sin recargar la
49
+ * página. Las clases se unen, los estilos se funden y los handlers corren los dos (primero el tuyo).
50
+ * `aria-current` sale de `active`; `disabled` pasa a `aria-disabled` y frena el clic.
51
+ *
52
+ * <KapiPanelItem render={<Link to="/listado" />}>Listado</KapiPanelItem>
53
+ */
54
+ render?: KapiRender | undefined;
46
55
  /** Marca el ítem actual (resaltado y `aria-current="page"`). */
47
56
  active?: boolean | undefined;
48
57
  /** Contenido a la derecha (badge, contador…). */
@@ -59,5 +68,5 @@ export type KapiPanelItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "
59
68
  children: ReactNode;
60
69
  };
61
70
  /** Ítem de navegación del panel contextual. `aria-current` sale de `active`; `icon` va antes del texto. */
62
- export declare const KapiPanelItem: ({ active, trailing, badge, badgeTone, badgeLabel, icon, className, type, children, ...rest }: KapiPanelItemProps) => import("react").JSX.Element;
71
+ export declare const KapiPanelItem: ({ active, trailing, badge, badgeTone, badgeLabel, icon, className, type, children, render, disabled, ref, ...rest }: KapiPanelItemProps) => import("react").JSX.Element;
63
72
  export {};
@@ -2,81 +2,98 @@
2
2
  import "#kapi-css/components/layout/KapiPanelParts.css";
3
3
  import "#kapi-css/components/navigation/navigation.css";
4
4
  import { joinClasses as e } from "../rootProps.js";
5
- import { useLabels as t } from "../locale/KapiLocaleProvider.js";
6
- import { searchChipName as n } from "../inputs/searchChipLogic.js";
7
- import { DEFAULT_SEARCH_CHIP_LABELS as r } from "../inputs/KapiSearchChip.js";
5
+ import { renderSlot as t } from "../renderSlot.js";
6
+ import { useLabels as n } from "../locale/KapiLocaleProvider.js";
7
+ import { searchChipName as r } from "../inputs/searchChipLogic.js";
8
+ import { DEFAULT_SEARCH_CHIP_LABELS as i } from "../inputs/KapiSearchChip.js";
8
9
  import "../navigation/navBadgeLogic.js";
9
- import { KapiNavBadge as i } from "../navigation/KapiNavBadge.js";
10
- import { CtxSlidingList as a } from "../navigation/CtxSlidingList.js";
10
+ import { KapiNavBadge as a } from "../navigation/KapiNavBadge.js";
11
+ import { CtxSlidingList as o } from "../navigation/CtxSlidingList.js";
11
12
  /* empty css */
12
- import { useKapiPanelMini as o } from "../navigation/panelMini.js";
13
- import { MiniNavItem as s } from "../navigation/MiniNavItem.js";
13
+ import { useKapiPanelMini as s } from "../navigation/panelMini.js";
14
+ import { MiniNavItem as c } from "../navigation/MiniNavItem.js";
14
15
  /* empty css */
15
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
16
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
16
17
  //#region src/components/layout/KapiPanelParts.tsx
17
- var u = ({ className: t, ...n }) => /* @__PURE__ */ c("div", {
18
+ var f = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
18
19
  ...n,
19
20
  className: e("kapi-ct", t)
20
- }), d = ({ className: t, ...n }) => /* @__PURE__ */ c("div", {
21
+ }), p = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
21
22
  ...n,
22
23
  className: e("kapi-ctxdivider", t)
23
- }), f = ({ className: t, ...n }) => /* @__PURE__ */ c("div", {
24
+ }), m = ({ className: t, ...n }) => /* @__PURE__ */ u("div", {
24
25
  ...n,
25
26
  className: e("kapi-hint", t)
26
- }), p = ({ className: i, placeholder: a, "aria-label": o, ...s }) => {
27
- let l = t("searchChip", r, void 0);
28
- return /* @__PURE__ */ c("input", {
27
+ }), h = ({ className: t, placeholder: a, "aria-label": o, ...s }) => {
28
+ let c = n("searchChip", i, void 0);
29
+ return /* @__PURE__ */ u("input", {
29
30
  ...s,
30
31
  type: "search",
31
- className: e("kapi-ctxsearch kapi-ctxsearch--input", i),
32
+ className: e("kapi-ctxsearch kapi-ctxsearch--input", t),
32
33
  placeholder: a,
33
- "aria-label": n({
34
+ "aria-label": r({
34
35
  ariaLabel: o,
35
36
  placeholder: a,
36
- fallback: l.search
37
+ fallback: c.search
37
38
  })
38
39
  });
39
- }, m = ({ children: e, ...t }) => /* @__PURE__ */ c(a, {
40
+ }, g = ({ children: e, ...t }) => /* @__PURE__ */ u(o, {
40
41
  ...t,
41
42
  children: e
42
- }), h = ({ active: t = !1, trailing: n, badge: r, badgeTone: a, badgeLabel: u, icon: d, className: f, type: p = "button", children: m, ...h }) => {
43
- let { mini: g } = o();
44
- return g ? /* @__PURE__ */ c(s, {
45
- ...h,
46
- type: p,
47
- className: f,
48
- label: m,
49
- icon: d,
50
- active: t,
51
- badge: r,
52
- badgeTone: a,
53
- badgeLabel: u
54
- }) : /* @__PURE__ */ l("button", {
55
- ...h,
56
- type: p,
57
- className: e("kapi-ctxitem", t && "kapi-ctxitem--on", f),
58
- "aria-current": t ? "page" : void 0,
59
- children: [
60
- d == null || d === !1 ? m : /* @__PURE__ */ l("span", {
61
- className: "kapi-ctxitem__lead",
62
- children: [/* @__PURE__ */ c("span", {
63
- className: "kapi-ctxitem__icon",
64
- "aria-hidden": "true",
65
- children: d
66
- }), /* @__PURE__ */ c("span", {
67
- className: "kapi-ctxitem__label",
68
- children: m
69
- })]
70
- }),
71
- /* @__PURE__ */ c(i, {
72
- value: r,
73
- tone: a,
74
- label: u,
75
- max: 999
76
- }),
77
- n
78
- ]
43
+ }), _ = ({ active: n = !1, trailing: r, badge: i, badgeTone: o, badgeLabel: f, icon: p, className: m, type: h = "button", children: g, render: _, disabled: v, ref: y, ...b }) => {
44
+ let { mini: x } = s();
45
+ if (x) return /* @__PURE__ */ u(c, {
46
+ ...b,
47
+ ref: y,
48
+ type: h,
49
+ className: m,
50
+ disabled: v,
51
+ render: _,
52
+ label: g,
53
+ icon: p,
54
+ active: n,
55
+ badge: i,
56
+ badgeTone: o,
57
+ badgeLabel: f
79
58
  });
59
+ let S = e("kapi-ctxitem", n && "kapi-ctxitem--on", m), C = /* @__PURE__ */ d(l, { children: [
60
+ p == null || p === !1 ? g : /* @__PURE__ */ d("span", {
61
+ className: "kapi-ctxitem__lead",
62
+ children: [/* @__PURE__ */ u("span", {
63
+ className: "kapi-ctxitem__icon",
64
+ "aria-hidden": "true",
65
+ children: p
66
+ }), /* @__PURE__ */ u("span", {
67
+ className: "kapi-ctxitem__label",
68
+ children: g
69
+ })]
70
+ }),
71
+ /* @__PURE__ */ u(a, {
72
+ value: i,
73
+ tone: o,
74
+ label: f,
75
+ max: 999
76
+ }),
77
+ r
78
+ ] });
79
+ return _ === void 0 ? /* @__PURE__ */ u("button", {
80
+ ...b,
81
+ ref: y,
82
+ type: h,
83
+ disabled: v,
84
+ className: S,
85
+ "aria-current": n ? "page" : void 0,
86
+ children: C
87
+ }) : t(_, {
88
+ ...b,
89
+ className: S
90
+ }, {
91
+ "aria-current": n ? "page" : void 0,
92
+ "aria-disabled": v || void 0,
93
+ ...v ? { onClick: (e) => e.preventDefault() } : {},
94
+ ref: y,
95
+ children: C
96
+ }, (e) => /* @__PURE__ */ u("a", { ...e }));
80
97
  };
81
98
  //#endregion
82
- export { d as KapiPanelDivider, f as KapiPanelHint, h as KapiPanelItem, u as KapiPanelLabel, m as KapiPanelList, p as KapiPanelSearch };
99
+ export { p as KapiPanelDivider, m as KapiPanelHint, _ as KapiPanelItem, f as KapiPanelLabel, g as KapiPanelList, h as KapiPanelSearch };
@@ -1,5 +1,6 @@
1
1
  import { type HTMLAttributes, type ReactNode, type Ref } from "react";
2
2
  import { type KapiRailEntry, type KapiRailItem, type KapiRailPinned, type KapiRailSeparator, type KapiRailZone, type KapiRailVariant } from "./railLogic.js";
3
+ import type { KapiClassNames } from "../slotCatalog.js";
3
4
  import { type KapiLinkLabels } from "../locale/linkLabels.js";
4
5
  import type { KapiLabelsOverride } from "../labelsLogic.js";
5
6
  export type { KapiRailEntry, KapiRailItem, KapiRailPinned, KapiRailSeparator, KapiRailVariant, KapiRailZone };
@@ -15,6 +16,8 @@ export type KapiRailLabels = {
15
16
  };
16
17
  export declare const DEFAULT_RAIL_LABELS: KapiRailLabels;
17
18
  /** Atributos nativos (`id`, `style`, `data-*`…) van al `<nav>`. `Id` se infiere de `items`. */
19
+ /** Partes de `KapiRail` que acepta `classNames`: `root`, `brand`, `start`, `scroll`, `indicator`, `item`, `label`, `separator` y `end`. */
20
+ export type KapiRailClassNames = KapiClassNames<"rail">;
18
21
  export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & {
19
22
  /**
20
23
  * Ítems del rail. Intercala `{ separator: true }` para dibujar un divisor entre grupos. Con `pinned: "start"`
@@ -22,6 +25,12 @@ export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTML
22
25
  * (en vertical) y la única que, en la barra inferior del celular, esconde en «Más» lo que no entra.
23
26
  */
24
27
  items: readonly KapiRailEntry<Id>[];
28
+ /**
29
+ * Clases por parte: `classNames={{ item: "mi-item", indicator: "mi-pildora" }}`. Se suman a las propias.
30
+ * `root` es el `<nav>` (lo mismo que `className`). Cada parte además lleva `data-slot="rail-<parte>"`;
31
+ * el ítem activo se alcanza con `[data-slot="rail-item"][aria-current="page"]`.
32
+ */
33
+ classNames?: KapiRailClassNames | undefined;
25
34
  /** id del ítem activo (controlado por la app: derívalo de tu router). */
26
35
  activeId?: Id | undefined;
27
36
  /** Se llama con el `id` del ítem clickeado (la app navega y actualiza `activeId`). */
@@ -49,4 +58,4 @@ export type KapiRailProps<Id extends string = string> = Omit<HTMLAttributes<HTML
49
58
  * En móvil se convierte en barra inferior (shell.css): muestra los ítems del medio que entran y manda el
50
59
  * resto a un ítem «Más» que abre un menú hacia arriba. Los ítems fijos y el footer no se tocan.
51
60
  */
52
- export declare const KapiRail: <Id extends string = string>({ items, activeId, onSelect, brand, footer, variant, "aria-label": ariaLabel, labels, className, ref, ...rest }: KapiRailProps<Id>) => import("react").JSX.Element;
61
+ export declare const KapiRail: <Id extends string = string>({ items, activeId, onSelect, brand, footer, variant, "aria-label": ariaLabel, labels, className, classNames, ref, ...rest }: KapiRailProps<Id>) => import("react").JSX.Element;