@astra-kit/ui 0.0.0-stage → 0.0.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 (304) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +384 -2
  4. package/THIRD_PARTY_NOTICES.md +31 -0
  5. package/assets/fonts/geist-LICENSE.txt +93 -0
  6. package/assets/fonts/geist-latin-variable.woff2 +0 -0
  7. package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  8. package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  9. package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
  10. package/assets/fonts/inter-LICENSE.txt +93 -0
  11. package/assets/fonts/inter-latin-variable.woff2 +0 -0
  12. package/dist/adapters/unpic-image.d.ts +3 -0
  13. package/dist/adapters/unpic-image.js +98 -0
  14. package/dist/components/account-menu.d.ts +67 -0
  15. package/dist/components/account-menu.js +440 -0
  16. package/dist/components/action-button.d.ts +25 -0
  17. package/dist/components/action-button.js +264 -0
  18. package/dist/components/alert.d.ts +31 -0
  19. package/dist/components/alert.js +503 -0
  20. package/dist/components/animated-collapse.d.ts +19 -0
  21. package/dist/components/animated-collapse.js +170 -0
  22. package/dist/components/animated-count.d.ts +13 -0
  23. package/dist/components/animated-count.js +105 -0
  24. package/dist/components/animated-list-item.d.ts +25 -0
  25. package/dist/components/animated-list-item.js +134 -0
  26. package/dist/components/animated-theme-toggler.d.ts +12 -0
  27. package/dist/components/animated-theme-toggler.js +200 -0
  28. package/dist/components/avatar.d.ts +65 -0
  29. package/dist/components/avatar.js +463 -0
  30. package/dist/components/badge.d.ts +21 -0
  31. package/dist/components/badge.js +297 -0
  32. package/dist/components/button-interaction.d.ts +23 -0
  33. package/dist/components/button-interaction.js +22 -0
  34. package/dist/components/button-label.d.ts +8 -0
  35. package/dist/components/button-label.js +203 -0
  36. package/dist/components/button.d.ts +23 -0
  37. package/dist/components/button.js +145 -0
  38. package/dist/components/calendar.d.ts +47 -0
  39. package/dist/components/calendar.js +155 -0
  40. package/dist/components/card.d.ts +38 -0
  41. package/dist/components/card.js +904 -0
  42. package/dist/components/carousel.d.ts +71 -0
  43. package/dist/components/carousel.js +585 -0
  44. package/dist/components/checkbox.d.ts +15 -0
  45. package/dist/components/checkbox.js +324 -0
  46. package/dist/components/control-button.d.ts +16 -0
  47. package/dist/components/control-button.js +215 -0
  48. package/dist/components/data-table.d.ts +118 -0
  49. package/dist/components/data-table.js +895 -0
  50. package/dist/components/dialog-surface.d.ts +49 -0
  51. package/dist/components/dialog-surface.js +220 -0
  52. package/dist/components/dialog.d.ts +92 -0
  53. package/dist/components/dialog.js +320 -0
  54. package/dist/components/dropdown-menu.d.ts +57 -0
  55. package/dist/components/dropdown-menu.js +107 -0
  56. package/dist/components/field.d.ts +53 -0
  57. package/dist/components/field.js +710 -0
  58. package/dist/components/file-upload.d.ts +88 -0
  59. package/dist/components/file-upload.js +776 -0
  60. package/dist/components/filter-presets-bar.d.ts +73 -0
  61. package/dist/components/filter-presets-bar.js +510 -0
  62. package/dist/components/filter-query-bar.d.ts +21 -0
  63. package/dist/components/filter-query-bar.js +881 -0
  64. package/dist/components/filter-query-grammar.d.ts +188 -0
  65. package/dist/components/filter-query-grammar.js +875 -0
  66. package/dist/components/form.d.ts +29 -0
  67. package/dist/components/form.js +330 -0
  68. package/dist/components/highlighter.d.ts +15 -0
  69. package/dist/components/highlighter.js +152 -0
  70. package/dist/components/hover-card.d.ts +50 -0
  71. package/dist/components/hover-card.js +80 -0
  72. package/dist/components/input-group.d.ts +16 -0
  73. package/dist/components/input-group.js +277 -0
  74. package/dist/components/input.d.ts +17 -0
  75. package/dist/components/input.js +120 -0
  76. package/dist/components/label.d.ts +4 -0
  77. package/dist/components/label.js +43 -0
  78. package/dist/components/link.d.ts +9 -0
  79. package/dist/components/link.js +43 -0
  80. package/dist/components/morph-text.d.ts +14 -0
  81. package/dist/components/morph-text.js +210 -0
  82. package/dist/components/pagination.d.ts +59 -0
  83. package/dist/components/pagination.js +190 -0
  84. package/dist/components/popover.d.ts +17 -0
  85. package/dist/components/popover.js +40 -0
  86. package/dist/components/presence-swap.d.ts +22 -0
  87. package/dist/components/presence-swap.js +209 -0
  88. package/dist/components/primitives/alert-dialog.d.ts +68 -0
  89. package/dist/components/primitives/alert-dialog.js +629 -0
  90. package/dist/components/primitives/avatar.d.ts +46 -0
  91. package/dist/components/primitives/avatar.js +265 -0
  92. package/dist/components/primitives/calendar.d.ts +37 -0
  93. package/dist/components/primitives/calendar.js +1250 -0
  94. package/dist/components/primitives/carousel.d.ts +106 -0
  95. package/dist/components/primitives/carousel.js +928 -0
  96. package/dist/components/primitives/dialog.d.ts +62 -0
  97. package/dist/components/primitives/dialog.js +490 -0
  98. package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
  99. package/dist/components/primitives/dropdown-menu-items.js +265 -0
  100. package/dist/components/primitives/dropdown-menu.d.ts +64 -0
  101. package/dist/components/primitives/dropdown-menu.js +560 -0
  102. package/dist/components/primitives/hover-card.d.ts +50 -0
  103. package/dist/components/primitives/hover-card.js +507 -0
  104. package/dist/components/primitives/pagination.d.ts +65 -0
  105. package/dist/components/primitives/pagination.js +373 -0
  106. package/dist/components/primitives/popover.d.ts +22 -0
  107. package/dist/components/primitives/popover.js +213 -0
  108. package/dist/components/primitives/select.d.ts +37 -0
  109. package/dist/components/primitives/select.js +428 -0
  110. package/dist/components/primitives/tooltip.d.ts +30 -0
  111. package/dist/components/primitives/tooltip.js +277 -0
  112. package/dist/components/progress-ring.d.ts +20 -0
  113. package/dist/components/progress-ring.js +53 -0
  114. package/dist/components/radio-group.d.ts +34 -0
  115. package/dist/components/radio-group.js +392 -0
  116. package/dist/components/reaction-button.d.ts +30 -0
  117. package/dist/components/reaction-button.js +189 -0
  118. package/dist/components/rich-link-editor.d.ts +25 -0
  119. package/dist/components/rich-link-editor.js +320 -0
  120. package/dist/components/rich-markdown-content.d.ts +10 -0
  121. package/dist/components/rich-markdown-content.js +56 -0
  122. package/dist/components/rich-text-content.d.ts +19 -0
  123. package/dist/components/rich-text-content.js +26 -0
  124. package/dist/components/select.d.ts +55 -0
  125. package/dist/components/select.js +188 -0
  126. package/dist/components/separator.d.ts +3 -0
  127. package/dist/components/separator.js +48 -0
  128. package/dist/components/sheet.d.ts +19 -0
  129. package/dist/components/sheet.js +420 -0
  130. package/dist/components/sidebar-panel-context.d.ts +17 -0
  131. package/dist/components/sidebar-panel-context.js +14 -0
  132. package/dist/components/sidebar.d.ts +195 -0
  133. package/dist/components/sidebar.js +2041 -0
  134. package/dist/components/skeleton.d.ts +23 -0
  135. package/dist/components/skeleton.js +334 -0
  136. package/dist/components/split-button.d.ts +36 -0
  137. package/dist/components/split-button.js +306 -0
  138. package/dist/components/svgs/whatsappIcon.d.ts +3 -0
  139. package/dist/components/svgs/whatsappIcon.js +14 -0
  140. package/dist/components/switch.d.ts +13 -0
  141. package/dist/components/switch.js +444 -0
  142. package/dist/components/table.d.ts +10 -0
  143. package/dist/components/table.js +298 -0
  144. package/dist/components/tabs.d.ts +36 -0
  145. package/dist/components/tabs.js +636 -0
  146. package/dist/components/textarea.d.ts +16 -0
  147. package/dist/components/textarea.js +111 -0
  148. package/dist/components/themed-toaster.d.ts +7 -0
  149. package/dist/components/themed-toaster.js +86 -0
  150. package/dist/components/toaster.d.ts +12 -0
  151. package/dist/components/toaster.js +62 -0
  152. package/dist/components/tooltip.d.ts +43 -0
  153. package/dist/components/tooltip.js +65 -0
  154. package/dist/components/typing-animation.d.ts +34 -0
  155. package/dist/components/typing-animation.js +389 -0
  156. package/dist/constants/action-button.d.ts +20 -0
  157. package/dist/constants/action-button.js +17 -0
  158. package/dist/constants/alert.d.ts +16 -0
  159. package/dist/constants/alert.js +13 -0
  160. package/dist/constants/avatar.d.ts +38 -0
  161. package/dist/constants/avatar.js +32 -0
  162. package/dist/constants/badge.d.ts +6 -0
  163. package/dist/constants/badge.js +6 -0
  164. package/dist/constants/button.d.ts +16 -0
  165. package/dist/constants/button.js +16 -0
  166. package/dist/constants/calendar.d.ts +36 -0
  167. package/dist/constants/calendar.js +34 -0
  168. package/dist/constants/card.d.ts +23 -0
  169. package/dist/constants/card.js +20 -0
  170. package/dist/constants/carousel.d.ts +55 -0
  171. package/dist/constants/carousel.js +74 -0
  172. package/dist/constants/checkbox.d.ts +17 -0
  173. package/dist/constants/checkbox.js +17 -0
  174. package/dist/constants/dialog.d.ts +11 -0
  175. package/dist/constants/dialog.js +10 -0
  176. package/dist/constants/dropdown-menu.d.ts +10 -0
  177. package/dist/constants/dropdown-menu.js +37 -0
  178. package/dist/constants/field.d.ts +24 -0
  179. package/dist/constants/field.js +24 -0
  180. package/dist/constants/hover-card.d.ts +37 -0
  181. package/dist/constants/hover-card.js +85 -0
  182. package/dist/constants/morph-text.d.ts +13 -0
  183. package/dist/constants/morph-text.js +13 -0
  184. package/dist/constants/motion.d.ts +12 -0
  185. package/dist/constants/motion.js +12 -0
  186. package/dist/constants/pagination.d.ts +20 -0
  187. package/dist/constants/pagination.js +20 -0
  188. package/dist/constants/popover.d.ts +7 -0
  189. package/dist/constants/popover.js +33 -0
  190. package/dist/constants/radio-group.d.ts +10 -0
  191. package/dist/constants/radio-group.js +10 -0
  192. package/dist/constants/select.d.ts +7 -0
  193. package/dist/constants/select.js +34 -0
  194. package/dist/constants/sidebar.d.ts +9 -0
  195. package/dist/constants/sidebar.js +17 -0
  196. package/dist/constants/skeleton.d.ts +17 -0
  197. package/dist/constants/skeleton.js +17 -0
  198. package/dist/constants/split-button.d.ts +7 -0
  199. package/dist/constants/split-button.js +5 -0
  200. package/dist/constants/switch.d.ts +33 -0
  201. package/dist/constants/switch.js +41 -0
  202. package/dist/constants/tabs.d.ts +17 -0
  203. package/dist/constants/tabs.js +17 -0
  204. package/dist/constants/toast.d.ts +3 -0
  205. package/dist/constants/toast.js +3 -0
  206. package/dist/constants/tooltip.d.ts +13 -0
  207. package/dist/constants/tooltip.js +52 -0
  208. package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
  209. package/dist/hooks/use-horizontal-swipe.js +80 -0
  210. package/dist/hooks/use-is-hydrated.d.ts +6 -0
  211. package/dist/hooks/use-is-hydrated.js +20 -0
  212. package/dist/hooks/use-mobile.d.ts +1 -0
  213. package/dist/hooks/use-mobile.js +19 -0
  214. package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
  215. package/dist/hooks/use-prefers-reduced-motion.js +27 -0
  216. package/dist/hooks/use-rich-link-editor.d.ts +55 -0
  217. package/dist/hooks/use-rich-link-editor.js +515 -0
  218. package/dist/hooks/use-sidebar-persistence.d.ts +6 -0
  219. package/dist/hooks/use-sidebar-persistence.js +52 -0
  220. package/dist/hooks/use-today.d.ts +7 -0
  221. package/dist/hooks/use-today.js +50 -0
  222. package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
  223. package/dist/hooks/use-viewer-time-zone.js +20 -0
  224. package/dist/hooks.d.ts +11 -0
  225. package/dist/hooks.js +11 -0
  226. package/dist/index.d.ts +71 -0
  227. package/dist/index.js +69 -0
  228. package/dist/lib/browser-clipboard.d.ts +13 -0
  229. package/dist/lib/browser-clipboard.js +48 -0
  230. package/dist/lib/column-filter-value.d.ts +12 -0
  231. package/dist/lib/column-filter-value.js +52 -0
  232. package/dist/lib/file-acceptance.d.ts +43 -0
  233. package/dist/lib/file-acceptance.js +107 -0
  234. package/dist/lib/format-file-size.d.ts +16 -0
  235. package/dist/lib/format-file-size.js +34 -0
  236. package/dist/lib/fuzzy-search.d.ts +17 -0
  237. package/dist/lib/fuzzy-search.js +183 -0
  238. package/dist/lib/horizontal-swipe.d.ts +23 -0
  239. package/dist/lib/horizontal-swipe.js +29 -0
  240. package/dist/lib/image-dimensions.d.ts +2 -0
  241. package/dist/lib/image-dimensions.js +7 -0
  242. package/dist/lib/name-initials.d.ts +7 -0
  243. package/dist/lib/name-initials.js +11 -0
  244. package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
  245. package/dist/lib/rich-text/link-markdown-constants.js +458 -0
  246. package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
  247. package/dist/lib/rich-text/link-markdown-types.js +1 -0
  248. package/dist/lib/rich-text/link-markdown.d.ts +193 -0
  249. package/dist/lib/rich-text/link-markdown.js +592 -0
  250. package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
  251. package/dist/lib/rich-text/rich-markdown.js +105 -0
  252. package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
  253. package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
  254. package/dist/lib/toast-layer.d.ts +24 -0
  255. package/dist/lib/toast-layer.js +76 -0
  256. package/dist/lib/utils.d.ts +2 -0
  257. package/dist/lib/utils.js +2 -0
  258. package/dist/lib/year-month-filter.d.ts +16 -0
  259. package/dist/lib/year-month-filter.js +46 -0
  260. package/dist/motion/arc-floating-slot.d.ts +40 -0
  261. package/dist/motion/arc-floating-slot.js +177 -0
  262. package/dist/motion/arc-press.d.ts +6 -0
  263. package/dist/motion/arc-press.js +59 -0
  264. package/dist/motion/arc-swap.d.ts +22 -0
  265. package/dist/motion/arc-swap.js +49 -0
  266. package/dist/motion/arc-tokens.d.ts +53 -0
  267. package/dist/motion/arc-tokens.js +73 -0
  268. package/dist/motion/glide-indicator.d.ts +69 -0
  269. package/dist/motion/glide-indicator.js +309 -0
  270. package/dist/motion/glide-slot.d.ts +9 -0
  271. package/dist/motion/glide-slot.js +71 -0
  272. package/dist/motion/motion-slot.d.ts +12 -0
  273. package/dist/motion/motion-slot.js +376 -0
  274. package/dist/motion/overlay-warmth.d.ts +24 -0
  275. package/dist/motion/overlay-warmth.js +70 -0
  276. package/dist/motion/presence.d.ts +40 -0
  277. package/dist/motion/presence.js +101 -0
  278. package/dist/motion/surface-keyframes.d.ts +24 -0
  279. package/dist/motion/surface-keyframes.js +141 -0
  280. package/dist/motion/tokens.d.ts +81 -0
  281. package/dist/motion/tokens.js +67 -0
  282. package/dist/motion/use-attached-element.d.ts +7 -0
  283. package/dist/motion/use-attached-element.js +22 -0
  284. package/dist/motion/use-morph-width.d.ts +13 -0
  285. package/dist/motion/use-morph-width.js +59 -0
  286. package/dist/next.d.ts +14 -0
  287. package/dist/next.js +79 -0
  288. package/dist/providers/astra-ui-provider.d.ts +27 -0
  289. package/dist/providers/astra-ui-provider.js +100 -0
  290. package/dist/providers/native-provider.d.ts +4 -0
  291. package/dist/providers/native-provider.js +45 -0
  292. package/dist/sonner.d.ts +7 -0
  293. package/dist/sonner.js +8 -0
  294. package/dist/styles.css +2 -0
  295. package/dist/tanstack.d.ts +11 -0
  296. package/dist/tanstack.js +50 -0
  297. package/dist/theme.d.ts +3 -0
  298. package/dist/theme.js +1 -0
  299. package/dist/types/data-table.d.ts +27 -0
  300. package/dist/types/data-table.js +1 -0
  301. package/fonts.css +5 -0
  302. package/package.json +450 -4
  303. package/styles.css +4 -0
  304. package/theme.css +248 -0
@@ -0,0 +1,324 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Arc's Checkbox (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md): an 18px square whose fill springs in
5
+ * while the check draws itself, and whose check morphs into the dash of the indeterminate state instead of swapping.
6
+ * Only the square answers a press, so the hit area and the label never move. With a `label` or `description` it renders
7
+ * Arc's labelled field; without them it renders the bare control, for rows, tables and forms that place their own
8
+ * label.
9
+ */
10
+ import { useId, useState } from "react";
11
+ import { Checkbox as CheckboxPrimitive } from "radix-ui";
12
+ import { motion } from "motion/react";
13
+ import { CHECKBOX_DESCRIPTION_ID_SUFFIX, CHECKBOX_FILL_HIDDEN_SCALE, CHECKBOX_MARK_PATH, CHECKBOX_MARK_STROKE_WIDTH, CHECKBOX_MARK_VIEW_BOX } from "../constants/checkbox.js";
14
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
15
+ import { cn } from "../lib/utils.js";
16
+ import { ARC_DURATION, ARC_EASE, ARC_SPRING_MORPH, ARC_SPRING_SNAPPY } from "../motion/arc-tokens.js";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
+ /**
19
+ * Arc's control recipe. The bare box keeps its 18px layout box and widens its hit area to 44px with a pseudo-element,
20
+ * so existing rows keep their spacing; the labelled field gives the box Arc's full control height instead. The square
21
+ * dips on press, hover answers only on hover-capable fine pointers, and keyboard focus uses the theme's outline.
22
+ */
23
+ const checkboxClassName = "peer group/checkbox relative grid shrink-0 cursor-pointer place-items-center rounded-(--radius-control) border-0 bg-transparent p-0 text-(--control-glyph) [-webkit-tap-highlight-color:transparent] group-has-disabled/field:opacity-50 disabled:cursor-not-allowed disabled:opacity-50 not-data-[labelled]:size-[18px] not-data-[labelled]:rounded-[5px] not-data-[labelled]:after:absolute not-data-[labelled]:after:-inset-[13px] data-[labelled]:size-(--control-height-md) hover-fine:data-[state=unchecked]:not-disabled:[&_[data-slot=checkbox-visual]]:border-text-muted active:not-disabled:[&_[data-slot=checkbox-visual]]:scale-95 active:not-disabled:[&_[data-slot=checkbox-visual]]:[transition:border-color_var(--duration-fast)_var(--ease-standard),scale_var(--duration-instant)_var(--ease-standard)] data-[state=checked]:[&_[data-slot=checkbox-visual]]:border-(--control-on) data-[state=indeterminate]:[&_[data-slot=checkbox-visual]]:border-(--control-on) aria-invalid:data-[state=unchecked]:[&_[data-slot=checkbox-visual]]:border-danger motion-reduce:[&_[data-slot=checkbox-visual]]:scale-100 motion-reduce:[&_[data-slot=checkbox-visual]]:transition-none";
24
+ /** The square: a border on the surface that the fill covers when checked. */
25
+ const visualClassName = "relative block size-[18px] rounded-[5px] border border-border-strong bg-surface [transition:border-color_var(--duration-fast)_var(--ease-standard),scale_var(--duration-spring)_var(--ease-spring)]";
26
+ /**
27
+ * A choice that can be on, off or indeterminate, controlled or uncontrolled like Radix's checkbox.
28
+ * @param checkboxProps - Every Radix checkbox prop, including `ref`, plus optional Arc `label` and `description`.
29
+ * @returns The labelled field when `label` or `description` is passed, otherwise the bare control.
30
+ */
31
+ function Checkbox(t0) {
32
+ const $ = _c(65);
33
+ let ariaDescribedBy;
34
+ let checked;
35
+ let className;
36
+ let defaultChecked;
37
+ let description;
38
+ let id;
39
+ let label;
40
+ let onCheckedChange;
41
+ let props;
42
+ if ($[0] !== t0) {
43
+ ({className, label, description, id, checked, defaultChecked, onCheckedChange, "aria-describedby": ariaDescribedBy, ...props} = t0);
44
+ $[0] = t0;
45
+ $[1] = ariaDescribedBy;
46
+ $[2] = checked;
47
+ $[3] = className;
48
+ $[4] = defaultChecked;
49
+ $[5] = description;
50
+ $[6] = id;
51
+ $[7] = label;
52
+ $[8] = onCheckedChange;
53
+ $[9] = props;
54
+ } else {
55
+ ariaDescribedBy = $[1];
56
+ checked = $[2];
57
+ className = $[3];
58
+ defaultChecked = $[4];
59
+ description = $[5];
60
+ id = $[6];
61
+ label = $[7];
62
+ onCheckedChange = $[8];
63
+ props = $[9];
64
+ }
65
+ const generatedId = useId();
66
+ const controlId = id ?? generatedId;
67
+ const descriptionId = `${controlId}-${CHECKBOX_DESCRIPTION_ID_SUFFIX}`;
68
+ const reduceMotion = usePrefersReducedMotion();
69
+ const [uncontrolledState, setUncontrolledState] = useState(defaultChecked ?? false);
70
+ const state = checked ?? uncontrolledState;
71
+ const isOn = state !== false;
72
+ const isField = Boolean(label || description);
73
+ const t1 = isOn ? ARC_DURATION.instant : ARC_DURATION.fast;
74
+ let t2;
75
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
76
+ t2 = [...ARC_EASE.standard];
77
+ $[10] = t2;
78
+ } else {
79
+ t2 = $[10];
80
+ }
81
+ let t3;
82
+ if ($[11] !== t1) {
83
+ t3 = {
84
+ duration: t1,
85
+ ease: t2
86
+ };
87
+ $[11] = t1;
88
+ $[12] = t3;
89
+ } else {
90
+ t3 = $[12];
91
+ }
92
+ const fade = t3;
93
+ let t4;
94
+ if ($[13] !== ariaDescribedBy || $[14] !== description || $[15] !== descriptionId) {
95
+ t4 = [ariaDescribedBy, description ? descriptionId : undefined].filter(Boolean).join(" ") || undefined;
96
+ $[13] = ariaDescribedBy;
97
+ $[14] = description;
98
+ $[15] = descriptionId;
99
+ $[16] = t4;
100
+ } else {
101
+ t4 = $[16];
102
+ }
103
+ const describedBy = t4;
104
+ const t5 = isField ? "" : undefined;
105
+ let t6;
106
+ if ($[17] !== className) {
107
+ t6 = cn(checkboxClassName, className);
108
+ $[17] = className;
109
+ $[18] = t6;
110
+ } else {
111
+ t6 = $[18];
112
+ }
113
+ const t7 = isField ? controlId : id;
114
+ let t8;
115
+ if ($[19] !== checked || $[20] !== onCheckedChange) {
116
+ t8 = (nextState) => {
117
+ if (checked === undefined) {
118
+ setUncontrolledState(nextState);
119
+ }
120
+ onCheckedChange?.(nextState);
121
+ };
122
+ $[19] = checked;
123
+ $[20] = onCheckedChange;
124
+ $[21] = t8;
125
+ } else {
126
+ t8 = $[21];
127
+ }
128
+ const t9 = isOn ? 1 : 0;
129
+ const t10 = isOn ? 1 : CHECKBOX_FILL_HIDDEN_SCALE;
130
+ let t11;
131
+ if ($[22] !== t10 || $[23] !== t9) {
132
+ t11 = {
133
+ opacity: t9,
134
+ scale: t10
135
+ };
136
+ $[22] = t10;
137
+ $[23] = t9;
138
+ $[24] = t11;
139
+ } else {
140
+ t11 = $[24];
141
+ }
142
+ let t12;
143
+ if ($[25] !== fade || $[26] !== reduceMotion) {
144
+ t12 = reduceMotion ? { duration: 0 } : {
145
+ scale: ARC_SPRING_SNAPPY,
146
+ opacity: fade
147
+ };
148
+ $[25] = fade;
149
+ $[26] = reduceMotion;
150
+ $[27] = t12;
151
+ } else {
152
+ t12 = $[27];
153
+ }
154
+ let t13;
155
+ if ($[28] !== t11 || $[29] !== t12) {
156
+ t13 = /* @__PURE__ */ _jsx(motion.span, {
157
+ className: "absolute -inset-px rounded-[inherit] bg-(--control-on)",
158
+ initial: false,
159
+ animate: t11,
160
+ transition: t12
161
+ });
162
+ $[28] = t11;
163
+ $[29] = t12;
164
+ $[30] = t13;
165
+ } else {
166
+ t13 = $[30];
167
+ }
168
+ const t14 = state === "indeterminate" ? CHECKBOX_MARK_PATH.dash : CHECKBOX_MARK_PATH.check;
169
+ const t15 = isOn ? 1 : 0;
170
+ const t16 = isOn ? 1 : 0;
171
+ let t17;
172
+ if ($[31] !== t14 || $[32] !== t15 || $[33] !== t16) {
173
+ t17 = {
174
+ d: t14,
175
+ pathLength: t15,
176
+ opacity: t16
177
+ };
178
+ $[31] = t14;
179
+ $[32] = t15;
180
+ $[33] = t16;
181
+ $[34] = t17;
182
+ } else {
183
+ t17 = $[34];
184
+ }
185
+ let t18;
186
+ if ($[35] !== fade || $[36] !== reduceMotion) {
187
+ t18 = reduceMotion ? { duration: 0 } : {
188
+ d: ARC_SPRING_MORPH,
189
+ pathLength: ARC_SPRING_SNAPPY,
190
+ opacity: fade
191
+ };
192
+ $[35] = fade;
193
+ $[36] = reduceMotion;
194
+ $[37] = t18;
195
+ } else {
196
+ t18 = $[37];
197
+ }
198
+ let t19;
199
+ if ($[38] !== t17 || $[39] !== t18) {
200
+ t19 = /* @__PURE__ */ _jsx(CheckboxPrimitive.Indicator, {
201
+ forceMount: true,
202
+ asChild: true,
203
+ children: /* @__PURE__ */ _jsx("svg", {
204
+ "data-slot": "checkbox-indicator",
205
+ className: "absolute -inset-px size-[18px] overflow-visible",
206
+ viewBox: CHECKBOX_MARK_VIEW_BOX,
207
+ fill: "none",
208
+ focusable: "false",
209
+ children: /* @__PURE__ */ _jsx(motion.path, {
210
+ initial: false,
211
+ animate: t17,
212
+ transition: t18,
213
+ stroke: "currentColor",
214
+ strokeWidth: CHECKBOX_MARK_STROKE_WIDTH,
215
+ strokeLinecap: "round",
216
+ strokeLinejoin: "round"
217
+ })
218
+ })
219
+ });
220
+ $[38] = t17;
221
+ $[39] = t18;
222
+ $[40] = t19;
223
+ } else {
224
+ t19 = $[40];
225
+ }
226
+ let t20;
227
+ if ($[41] !== t13 || $[42] !== t19) {
228
+ t20 = /* @__PURE__ */ _jsxs("span", {
229
+ "data-slot": "checkbox-visual",
230
+ className: visualClassName,
231
+ "aria-hidden": "true",
232
+ children: [t13, t19]
233
+ });
234
+ $[41] = t13;
235
+ $[42] = t19;
236
+ $[43] = t20;
237
+ } else {
238
+ t20 = $[43];
239
+ }
240
+ let t21;
241
+ if ($[44] !== describedBy || $[45] !== props || $[46] !== state || $[47] !== t20 || $[48] !== t5 || $[49] !== t6 || $[50] !== t7 || $[51] !== t8) {
242
+ t21 = /* @__PURE__ */ _jsx(CheckboxPrimitive.Root, {
243
+ "data-slot": "checkbox",
244
+ "data-labelled": t5,
245
+ className: t6,
246
+ ...props,
247
+ id: t7,
248
+ checked: state,
249
+ "aria-describedby": describedBy,
250
+ onCheckedChange: t8,
251
+ children: t20
252
+ });
253
+ $[44] = describedBy;
254
+ $[45] = props;
255
+ $[46] = state;
256
+ $[47] = t20;
257
+ $[48] = t5;
258
+ $[49] = t6;
259
+ $[50] = t7;
260
+ $[51] = t8;
261
+ $[52] = t21;
262
+ } else {
263
+ t21 = $[52];
264
+ }
265
+ const control = t21;
266
+ if (!isField) {
267
+ return control;
268
+ }
269
+ let t22;
270
+ if ($[53] !== controlId || $[54] !== label) {
271
+ t22 = label ? /* @__PURE__ */ _jsx("label", {
272
+ htmlFor: controlId,
273
+ "data-slot": "checkbox-label",
274
+ className: "cursor-pointer text-sm leading-(--leading-body) font-medium text-foreground",
275
+ children: label
276
+ }) : null;
277
+ $[53] = controlId;
278
+ $[54] = label;
279
+ $[55] = t22;
280
+ } else {
281
+ t22 = $[55];
282
+ }
283
+ let t23;
284
+ if ($[56] !== description || $[57] !== descriptionId) {
285
+ t23 = description ? /* @__PURE__ */ _jsx("span", {
286
+ id: descriptionId,
287
+ "data-slot": "checkbox-description",
288
+ className: "text-xs leading-(--leading-body) text-text-muted",
289
+ children: description
290
+ }) : null;
291
+ $[56] = description;
292
+ $[57] = descriptionId;
293
+ $[58] = t23;
294
+ } else {
295
+ t23 = $[58];
296
+ }
297
+ let t24;
298
+ if ($[59] !== t22 || $[60] !== t23) {
299
+ t24 = /* @__PURE__ */ _jsxs("div", {
300
+ className: "ml-px grid min-w-0 gap-0.5 pt-[calc((var(--control-height-md)-var(--text-sm)*var(--leading-body))/2)]",
301
+ children: [t22, t23]
302
+ });
303
+ $[59] = t22;
304
+ $[60] = t23;
305
+ $[61] = t24;
306
+ } else {
307
+ t24 = $[61];
308
+ }
309
+ let t25;
310
+ if ($[62] !== control || $[63] !== t24) {
311
+ t25 = /* @__PURE__ */ _jsxs("div", {
312
+ "data-slot": "checkbox-field",
313
+ className: "inline-flex min-w-0 items-start",
314
+ children: [control, t24]
315
+ });
316
+ $[62] = control;
317
+ $[63] = t24;
318
+ $[64] = t25;
319
+ } else {
320
+ t25 = $[64];
321
+ }
322
+ return t25;
323
+ }
324
+ export { Checkbox };
@@ -0,0 +1,16 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ /**
4
+ * Class recipe. Press scale is driven by Motion alone, so `transform` never gets a CSS transition,
5
+ * and anchors of floating layers never scale because Radix measures them on pointerdown.
6
+ */
7
+ declare const controlButtonVariants: (props?: ({
8
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
9
+ size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ declare function ControlButton({ className, variant, size, asChild, loading, children, ref, ...props }: ButtonPrimitive.Props & VariantProps<typeof controlButtonVariants> & {
12
+ asChild?: boolean;
13
+ /** Shows a spinner, sets `aria-busy` and swallows clicks while keeping keyboard focus. */
14
+ loading?: boolean;
15
+ }): import("react").JSX.Element;
16
+ export { ControlButton, controlButtonVariants };
@@ -0,0 +1,215 @@
1
+ "use client";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ /**
4
+ * Internal compact control for composite components (dialog close buttons, carousel and pagination arrows, calendar
5
+ * cells, table and editor actions) that need icon sizes, a link variant or `asChild`, which the public Arc `Button`
6
+ * leaves out. Keeps Arc's press feedback and label motion (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md).
7
+ * Not exported from the package: consumers use `Button`.
8
+ */
9
+ import { Children, cloneElement, isValidElement } from "react";
10
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
11
+ import { cva } from "class-variance-authority";
12
+ import { Slot } from "radix-ui";
13
+ import { useIsPresent } from "motion/react";
14
+ import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
15
+ import { cn } from "../lib/utils.js";
16
+ import { useArcPress } from "../motion/arc-press.js";
17
+ import { useAttachedElement } from "../motion/use-attached-element.js";
18
+ import { ButtonLabel } from "./button-label.js";
19
+ import { LEAVING_ATTRIBUTES, LOADING_INERT_HANDLERS } from "./button-interaction.js";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ /**
22
+ * Class recipe. Press scale is driven by Motion alone, so `transform` never gets a CSS transition,
23
+ * and anchors of floating layers never scale because Radix measures them on pointerdown.
24
+ */
25
+ const controlButtonVariants = cva("group/button relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap outline-none select-none [-webkit-tap-highlight-color:transparent] transition-[color,background-color,border-color,opacity,box-shadow] duration-150 ease-out focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-busy:cursor-progress aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 motion-reduce:transition-none dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&:is([aria-haspopup]:not([aria-haspopup=false]),[data-state],[role=combobox])]:transform-none! [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
26
+ variants: {
27
+ variant: {
28
+ default: "border-foreground bg-foreground text-background hover:not-disabled:opacity-90 hover:not-disabled:shadow-xs active:not-disabled:opacity-85",
29
+ outline: "border-border bg-background text-foreground hover:not-disabled:bg-muted hover:not-disabled:shadow-xs active:not-disabled:bg-muted aria-expanded:bg-muted disabled:bg-muted disabled:text-muted-foreground disabled:opacity-100",
30
+ secondary: "bg-muted text-foreground hover:not-disabled:bg-muted/70 active:not-disabled:bg-muted/70 aria-expanded:bg-muted/70",
31
+ ghost: "text-muted-foreground hover:not-disabled:bg-muted hover:not-disabled:text-foreground active:not-disabled:bg-muted active:not-disabled:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground disabled:text-muted-foreground/60 disabled:opacity-100",
32
+ destructive: "border-border bg-background text-destructive hover:not-disabled:border-destructive hover:not-disabled:bg-muted active:not-disabled:border-destructive active:not-disabled:bg-muted focus-visible:border-destructive/40 focus-visible:ring-destructive/20 disabled:bg-muted disabled:text-destructive/55 disabled:opacity-100 dark:focus-visible:ring-destructive/40",
33
+ link: "text-primary underline-offset-4 hover:underline"
34
+ },
35
+ size: {
36
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
37
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
38
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
39
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
40
+ icon: "size-8",
41
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
42
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
43
+ "icon-lg": "size-9"
44
+ }
45
+ },
46
+ defaultVariants: {
47
+ variant: "default",
48
+ size: "default"
49
+ }
50
+ });
51
+ /**
52
+ * Wraps the content of an `asChild` element in the Arc label, so links morph and spin like buttons.
53
+ * While loading, the child's own activation handlers are dropped too, because Slot runs them before ours.
54
+ * Children given as render functions keep their content untouched.
55
+ */
56
+ function withArcLabel(children, loading, renderLabel) {
57
+ const child = Children.only(children);
58
+ if (!isValidElement(child)) return child;
59
+ const content = child.props.children;
60
+ const overrides = loading ? LOADING_INERT_HANDLERS : undefined;
61
+ const label = typeof content === "function" ? content : renderLabel(content);
62
+ return cloneElement(child, overrides, label);
63
+ }
64
+ function ControlButton(t0) {
65
+ const $ = _c(40);
66
+ let children;
67
+ let className;
68
+ let props;
69
+ let ref;
70
+ let t1;
71
+ let t2;
72
+ let t3;
73
+ let t4;
74
+ if ($[0] !== t0) {
75
+ ({className, variant: t1, size: t2, asChild: t3, loading: t4, children, ref, ...props} = t0);
76
+ $[0] = t0;
77
+ $[1] = children;
78
+ $[2] = className;
79
+ $[3] = props;
80
+ $[4] = ref;
81
+ $[5] = t1;
82
+ $[6] = t2;
83
+ $[7] = t3;
84
+ $[8] = t4;
85
+ } else {
86
+ children = $[1];
87
+ className = $[2];
88
+ props = $[3];
89
+ ref = $[4];
90
+ t1 = $[5];
91
+ t2 = $[6];
92
+ t3 = $[7];
93
+ t4 = $[8];
94
+ }
95
+ const variant = t1 === undefined ? "default" : t1;
96
+ const size = t2 === undefined ? "default" : t2;
97
+ const asChild = t3 === undefined ? false : t3;
98
+ const loading = t4 === undefined ? false : t4;
99
+ const reduceMotion = usePrefersReducedMotion();
100
+ const isPresent = useIsPresent();
101
+ const [element, attach] = useAttachedElement(ref);
102
+ useArcPress(element, !reduceMotion && variant !== "link");
103
+ let t5;
104
+ if ($[9] !== loading || $[10] !== reduceMotion) {
105
+ t5 = (content) => /* @__PURE__ */ _jsx(ButtonLabel, {
106
+ loading,
107
+ reduceMotion,
108
+ children: content
109
+ });
110
+ $[9] = loading;
111
+ $[10] = reduceMotion;
112
+ $[11] = t5;
113
+ } else {
114
+ t5 = $[11];
115
+ }
116
+ const renderLabel = t5;
117
+ let t6;
118
+ if ($[12] !== className || $[13] !== size || $[14] !== variant) {
119
+ t6 = cn(controlButtonVariants({
120
+ variant,
121
+ size,
122
+ className
123
+ }));
124
+ $[12] = className;
125
+ $[13] = size;
126
+ $[14] = variant;
127
+ $[15] = t6;
128
+ } else {
129
+ t6 = $[15];
130
+ }
131
+ const t7 = loading || undefined;
132
+ const t8 = loading || props["aria-disabled"] || undefined;
133
+ const t9 = loading ? LOADING_INERT_HANDLERS : undefined;
134
+ const t10 = isPresent ? undefined : LEAVING_ATTRIBUTES;
135
+ let t11;
136
+ if ($[16] !== props || $[17] !== size || $[18] !== t10 || $[19] !== t6 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9 || $[23] !== variant) {
137
+ t11 = {
138
+ "data-slot": "button",
139
+ "data-variant": variant,
140
+ "data-size": size,
141
+ className: t6,
142
+ "aria-busy": t7,
143
+ ...props,
144
+ "aria-disabled": t8,
145
+ ...t9,
146
+ ...t10
147
+ };
148
+ $[16] = props;
149
+ $[17] = size;
150
+ $[18] = t10;
151
+ $[19] = t6;
152
+ $[20] = t7;
153
+ $[21] = t8;
154
+ $[22] = t9;
155
+ $[23] = variant;
156
+ $[24] = t11;
157
+ } else {
158
+ t11 = $[24];
159
+ }
160
+ const sharedProps = t11;
161
+ if (asChild) {
162
+ const t12 = sharedProps;
163
+ let t13;
164
+ if ($[25] !== children || $[26] !== loading || $[27] !== renderLabel) {
165
+ t13 = withArcLabel(children, loading, renderLabel);
166
+ $[25] = children;
167
+ $[26] = loading;
168
+ $[27] = renderLabel;
169
+ $[28] = t13;
170
+ } else {
171
+ t13 = $[28];
172
+ }
173
+ let t14;
174
+ if ($[29] !== attach || $[30] !== t12 || $[31] !== t13) {
175
+ t14 = /* @__PURE__ */ _jsx(Slot.Root, {
176
+ ref: attach,
177
+ ...t12,
178
+ children: t13
179
+ });
180
+ $[29] = attach;
181
+ $[30] = t12;
182
+ $[31] = t13;
183
+ $[32] = t14;
184
+ } else {
185
+ t14 = $[32];
186
+ }
187
+ return t14;
188
+ }
189
+ const t12 = sharedProps;
190
+ let t13;
191
+ if ($[33] !== children || $[34] !== renderLabel) {
192
+ t13 = renderLabel(children);
193
+ $[33] = children;
194
+ $[34] = renderLabel;
195
+ $[35] = t13;
196
+ } else {
197
+ t13 = $[35];
198
+ }
199
+ let t14;
200
+ if ($[36] !== attach || $[37] !== t12 || $[38] !== t13) {
201
+ t14 = /* @__PURE__ */ _jsx(ButtonPrimitive, {
202
+ ref: attach,
203
+ ...t12,
204
+ children: t13
205
+ });
206
+ $[36] = attach;
207
+ $[37] = t12;
208
+ $[38] = t13;
209
+ $[39] = t14;
210
+ } else {
211
+ t14 = $[39];
212
+ }
213
+ return t14;
214
+ }
215
+ export { ControlButton, controlButtonVariants };
@@ -0,0 +1,118 @@
1
+ import * as React from "react";
2
+ import type { ColumnDef, OnChangeFn, SortingState, VisibilityState } from "@tanstack/react-table";
3
+ import { type AppliedFilter, type FilterQualifierConfig } from "./filter-query-grammar.js";
4
+ import { type DropdownItem } from "./primitives/dropdown-menu-items.js";
5
+ export type { DataTableColumnFilterValue } from "../types/data-table.js";
6
+ /**
7
+ * Controles imperativos de la barra unificada que la tabla expone vía
8
+ * `queryFilterControlsRef`, para que el consumidor sincronice la barra desde
9
+ * fuera (p. ej. al clickear un chip de carpeta).
10
+ */
11
+ export interface DataTableQueryFilterControls {
12
+ /** Devuelve el texto actual de la barra unificada. */
13
+ getQueryText: () => string;
14
+ /** Reemplaza el texto completo de la barra y aplica los filtros parseados. */
15
+ setQueryText: (query: string) => void;
16
+ /**
17
+ * Reemplaza los filtros de carpeta de la barra: deja un único `carpeta:<id>`
18
+ * (o ninguno si `folderId` es `null`), preservando el resto de los filtros.
19
+ */
20
+ setSingleFolderFilter: (folderId: string | null) => void;
21
+ }
22
+ export interface DataTableProps<TData, TValue> {
23
+ columns: ColumnDef<TData, TValue>[];
24
+ data: TData[];
25
+ emptyMessage: string;
26
+ toolbarActions?: React.ReactNode;
27
+ onVisibleRowsChange?: (visibleRows: TData[]) => void;
28
+ onCellClick?: (event: React.MouseEvent<HTMLTableCellElement>, row: TData, columnId: string) => void;
29
+ getRowClassName?: (row: TData) => string | undefined;
30
+ sorting?: SortingState;
31
+ onSortingChange?: (sorting: SortingState) => void;
32
+ columnVisibility?: VisibilityState;
33
+ onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
34
+ filterColumnId?: string;
35
+ filterLabel?: string;
36
+ filterPlaceholder?: string;
37
+ filterExtraContent?: React.ReactNode;
38
+ filterValue?: string;
39
+ onFilterValueChange?: (value: string) => void;
40
+ /**
41
+ * Cuando se provee, agrega una barra de query unificada estilo GitHub
42
+ * (autocompletado de `clave:valor`) por encima de los controles de filtro
43
+ * clásicos. Ambas vistas comparten la misma fuente de verdad: la barra parsea
44
+ * la query y escribe en los canales de descripción, exclusiones y avanzados,
45
+ * y se re-sincroniza cuando esos controles clásicos cambian.
46
+ */
47
+ queryFilterConfig?: FilterQualifierConfig[];
48
+ queryFilterPlaceholder?: string;
49
+ queryFilterLabel?: string;
50
+ /**
51
+ * Notifica los filtros estructurados parseados desde la barra unificada
52
+ * (cualquier kind, con o sin columna, incluyendo negados) para que el
53
+ * consumidor los aplique con su propio predicado de dominio.
54
+ */
55
+ onAppliedFiltersChange?: (appliedFilters: AppliedFilter[]) => void;
56
+ /** Ref para acceder a los controles imperativos de la barra unificada. */
57
+ queryFilterControlsRef?: React.MutableRefObject<DataTableQueryFilterControls | null>;
58
+ /** Acción opcional dentro del input de la barra unificada, al final derecho. */
59
+ queryFilterTrailingAction?: React.ReactNode;
60
+ /**
61
+ * Agrupa visualmente las filas por adyacencia: cuando la clave de grupo de una
62
+ * fila difiere de la anterior se intercala una fila de encabezado. Las filas
63
+ * deben venir pre-ordenadas por grupo. El objeto debe ser memoizado por el
64
+ * consumidor (invalida la memo del cuerpo de la tabla).
65
+ */
66
+ rowGroups?: {
67
+ getGroupKey: (row: TData) => string;
68
+ /**
69
+ * Valor de orden del grupo de una fila (comparable con <). Cuando se
70
+ * provee, los grupos se ordenan por este valor; si no, quedan en orden de
71
+ * primera aparición. Las filas se particionan por clave en ambos casos,
72
+ * así que un grupo nunca se repite aunque las filas lleguen intercaladas
73
+ * (p. ej. con orden manual del usuario).
74
+ */
75
+ getGroupSortValue?: (row: TData) => number | string;
76
+ renderGroupHeader: (groupKey: string, groupRowCount: number) => React.ReactNode;
77
+ /** Grupos cuyas filas están colapsadas (solo se ve su encabezado). */
78
+ collapsedGroupKeys?: ReadonlySet<string>;
79
+ /**
80
+ * Colapsa/expande el grupo desde su encabezado (estilo accordion). Sin este
81
+ * callback los encabezados no son interactivos.
82
+ */
83
+ onGroupToggle?: (groupKey: string) => void;
84
+ };
85
+ showExcludeFilterToggle?: boolean;
86
+ excludeFilterValues?: string[];
87
+ onExcludeFilterValuesChange?: (values: string[]) => void;
88
+ excludeFilterPlaceholder?: string;
89
+ excludeFilterLabel?: string;
90
+ excludeFilterToggleLabel?: string;
91
+ excludeFilterRowsCountByValue?: Record<string, number>;
92
+ excludeFilterUniqueRowsCount?: number;
93
+ showColumnVisibilityToggle?: boolean;
94
+ columnVisibilityButtonLabel?: string;
95
+ columnVisibilityMenuLabel?: string;
96
+ /**
97
+ * Ítems extra al tope del menú de columnas (p. ej. preferencias de vista), con la
98
+ * forma de los `items` de `DropdownMenu`; se separan de la sección de columnas con un separador.
99
+ */
100
+ columnVisibilityMenuExtraItems?: DropdownItem[];
101
+ sortingBadgeLabelOverrides?: Record<string, string>;
102
+ /**
103
+ * Ids de columnas de orden "internas" (p. ej. la posición de grupo) que el
104
+ * badge de orden y su botón "Quitar orden" deben ignorar.
105
+ */
106
+ sortingBadgeIgnoredColumnIds?: ReadonlySet<string>;
107
+ selectAllColumnsLabel?: string;
108
+ deselectAllColumnsLabel?: string;
109
+ hideableColumnsDefaultVisibility?: VisibilityState;
110
+ }
111
+ export interface DataTableColumnMeta {
112
+ label?: string;
113
+ cellClassName?: string;
114
+ headerClassName?: string;
115
+ isClickable?: boolean;
116
+ onHeaderClick?: (event: React.MouseEvent<HTMLTableCellElement>) => void;
117
+ }
118
+ export declare function DataTable<TData, TValue>({ columns, data, emptyMessage, toolbarActions, onVisibleRowsChange, onCellClick, getRowClassName, sorting: controlledSorting, onSortingChange, columnVisibility: controlledColumnVisibility, onColumnVisibilityChange, filterColumnId, filterLabel, filterPlaceholder, filterExtraContent, filterValue: controlledFilterValue, onFilterValueChange, queryFilterConfig, queryFilterPlaceholder, queryFilterLabel, onAppliedFiltersChange, queryFilterControlsRef, queryFilterTrailingAction, rowGroups, showExcludeFilterToggle, excludeFilterValues: controlledExcludeFilterValues, onExcludeFilterValuesChange, excludeFilterPlaceholder, excludeFilterLabel, excludeFilterToggleLabel, excludeFilterRowsCountByValue, excludeFilterUniqueRowsCount, showColumnVisibilityToggle, columnVisibilityButtonLabel, columnVisibilityMenuLabel, columnVisibilityMenuExtraItems, sortingBadgeLabelOverrides, sortingBadgeIgnoredColumnIds, selectAllColumnsLabel, deselectAllColumnsLabel, hideableColumnsDefaultVisibility, }: DataTableProps<TData, TValue>): React.JSX.Element;