beez-ui 0.4.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 (121) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +113 -0
  4. package/assets/fonts/geist-LICENSE.txt +93 -0
  5. package/assets/fonts/geist-latin-variable.woff2 +0 -0
  6. package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  7. package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  8. package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
  9. package/assets/fonts/poppins-LICENSE.txt +93 -0
  10. package/assets/fonts/poppins-latin-600.woff2 +0 -0
  11. package/dist/adapters/unpic-image.d.ts +3 -0
  12. package/dist/adapters/unpic-image.js +20 -0
  13. package/dist/components/alert-dialog.d.ts +18 -0
  14. package/dist/components/alert-dialog.js +42 -0
  15. package/dist/components/alert.d.ts +10 -0
  16. package/dist/components/alert.js +28 -0
  17. package/dist/components/animated-theme-toggler.d.ts +8 -0
  18. package/dist/components/animated-theme-toggler.js +88 -0
  19. package/dist/components/avatar.d.ts +16 -0
  20. package/dist/components/avatar.js +26 -0
  21. package/dist/components/badge.d.ts +9 -0
  22. package/dist/components/badge.js +24 -0
  23. package/dist/components/button.d.ts +10 -0
  24. package/dist/components/button.js +37 -0
  25. package/dist/components/calendar.d.ts +10 -0
  26. package/dist/components/calendar.js +77 -0
  27. package/dist/components/card.d.ts +11 -0
  28. package/dist/components/card.js +24 -0
  29. package/dist/components/carousel.d.ts +28 -0
  30. package/dist/components/carousel.js +98 -0
  31. package/dist/components/checkbox.d.ts +4 -0
  32. package/dist/components/checkbox.js +9 -0
  33. package/dist/components/data-table.d.ts +117 -0
  34. package/dist/components/data-table.js +612 -0
  35. package/dist/components/dialog.d.ts +17 -0
  36. package/dist/components/dialog.js +37 -0
  37. package/dist/components/dropdown-menu.d.ts +29 -0
  38. package/dist/components/dropdown-menu.js +51 -0
  39. package/dist/components/filter-query-bar.d.ts +21 -0
  40. package/dist/components/filter-query-bar.js +526 -0
  41. package/dist/components/filter-query-grammar.d.ts +188 -0
  42. package/dist/components/filter-query-grammar.js +830 -0
  43. package/dist/components/form.d.ts +24 -0
  44. package/dist/components/form.js +59 -0
  45. package/dist/components/highlighter.d.ts +15 -0
  46. package/dist/components/highlighter.js +91 -0
  47. package/dist/components/hover-card.d.ts +6 -0
  48. package/dist/components/hover-card.js +14 -0
  49. package/dist/components/input-group.d.ts +16 -0
  50. package/dist/components/input-group.js +57 -0
  51. package/dist/components/input.d.ts +3 -0
  52. package/dist/components/input.js +7 -0
  53. package/dist/components/label.d.ts +4 -0
  54. package/dist/components/label.js +8 -0
  55. package/dist/components/link.d.ts +9 -0
  56. package/dist/components/link.js +11 -0
  57. package/dist/components/pagination.d.ts +18 -0
  58. package/dist/components/pagination.js +28 -0
  59. package/dist/components/popover.d.ts +10 -0
  60. package/dist/components/popover.js +26 -0
  61. package/dist/components/radio-group.d.ts +5 -0
  62. package/dist/components/radio-group.js +11 -0
  63. package/dist/components/select.d.ts +15 -0
  64. package/dist/components/select.js +36 -0
  65. package/dist/components/separator.d.ts +3 -0
  66. package/dist/components/separator.js +8 -0
  67. package/dist/components/sheet.d.ts +14 -0
  68. package/dist/components/sheet.js +37 -0
  69. package/dist/components/sidebar.d.ts +71 -0
  70. package/dist/components/sidebar.js +221 -0
  71. package/dist/components/skeleton.d.ts +2 -0
  72. package/dist/components/skeleton.js +6 -0
  73. package/dist/components/svgs/whatsappIcon.d.ts +3 -0
  74. package/dist/components/svgs/whatsappIcon.js +3 -0
  75. package/dist/components/switch.d.ts +6 -0
  76. package/dist/components/switch.js +8 -0
  77. package/dist/components/table.d.ts +10 -0
  78. package/dist/components/table.js +28 -0
  79. package/dist/components/tabs.d.ts +11 -0
  80. package/dist/components/tabs.js +29 -0
  81. package/dist/components/textarea.d.ts +3 -0
  82. package/dist/components/textarea.js +6 -0
  83. package/dist/components/themed-toaster.d.ts +4 -0
  84. package/dist/components/themed-toaster.js +27 -0
  85. package/dist/components/tooltip.d.ts +7 -0
  86. package/dist/components/tooltip.js +17 -0
  87. package/dist/components/typing-animation.d.ts +34 -0
  88. package/dist/components/typing-animation.js +155 -0
  89. package/dist/constants/sidebar.d.ts +9 -0
  90. package/dist/constants/sidebar.js +20 -0
  91. package/dist/hooks/use-mobile.d.ts +1 -0
  92. package/dist/hooks/use-mobile.js +19 -0
  93. package/dist/hooks/use-sidebar-persistence.d.ts +4 -0
  94. package/dist/hooks/use-sidebar-persistence.js +45 -0
  95. package/dist/index.d.ts +48 -0
  96. package/dist/index.js +47 -0
  97. package/dist/lib/image-dimensions.d.ts +2 -0
  98. package/dist/lib/image-dimensions.js +7 -0
  99. package/dist/lib/utils.d.ts +2 -0
  100. package/dist/lib/utils.js +2 -0
  101. package/dist/lib/year-month-filter.d.ts +16 -0
  102. package/dist/lib/year-month-filter.js +48 -0
  103. package/dist/next.d.ts +14 -0
  104. package/dist/next.js +27 -0
  105. package/dist/providers/beez-ui-provider.d.ts +27 -0
  106. package/dist/providers/beez-ui-provider.js +18 -0
  107. package/dist/providers/native-provider.d.ts +4 -0
  108. package/dist/providers/native-provider.js +11 -0
  109. package/dist/sonner.d.ts +2 -0
  110. package/dist/sonner.js +3 -0
  111. package/dist/styles.css +2 -0
  112. package/dist/tanstack.d.ts +11 -0
  113. package/dist/tanstack.js +38 -0
  114. package/dist/theme.d.ts +3 -0
  115. package/dist/theme.js +1 -0
  116. package/dist/types/data-table.d.ts +27 -0
  117. package/dist/types/data-table.js +1 -0
  118. package/fonts.css +5 -0
  119. package/package.json +335 -0
  120. package/styles.css +4 -0
  121. package/theme.css +87 -0
@@ -0,0 +1,88 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useRef, useSyncExternalStore } from "react";
4
+ import { Monitor, Moon, Sun, SunMoon } from "lucide-react";
5
+ import { flushSync } from "react-dom";
6
+ import { useTheme } from "next-themes";
7
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from "./dropdown-menu.js";
8
+ import { cn } from "../lib/utils.js";
9
+ const THEME_OPTIONS = [
10
+ {
11
+ icon: Sun,
12
+ label: "Claro",
13
+ value: "light",
14
+ },
15
+ {
16
+ icon: Moon,
17
+ label: "Oscuro",
18
+ value: "dark",
19
+ },
20
+ {
21
+ icon: Monitor,
22
+ label: "Sistema",
23
+ value: "system",
24
+ },
25
+ ];
26
+ /** Restricts transition styling to theme changes initiated by this component. */
27
+ const THEME_TRANSITION_CLASS = "BeezThemeTransition";
28
+ /** Respects user preferences when deciding whether to animate a theme change. */
29
+ const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
30
+ export const AnimatedThemeToggler = ({ className, duration = 400, disabled, theme: controlledTheme, resolvedTheme: controlledResolvedTheme, onThemeChange: controlledOnThemeChange, ...props }) => {
31
+ const providerTheme = useTheme();
32
+ const theme = controlledTheme ?? providerTheme.theme;
33
+ const resolvedTheme = controlledResolvedTheme ?? providerTheme.resolvedTheme;
34
+ const onThemeChange = controlledOnThemeChange ?? providerTheme.setTheme;
35
+ const buttonRef = useRef(null);
36
+ const isHydrated = useSyncExternalStore(() => () => undefined, () => true, () => false);
37
+ const isThemeReady = isHydrated &&
38
+ (resolvedTheme === "light" || resolvedTheme === "dark");
39
+ const isDark = resolvedTheme === "dark";
40
+ const selectedTheme = theme === "light" || theme === "dark" || theme === "system"
41
+ ? theme
42
+ : "system";
43
+ const isDisabled = !isThemeReady || disabled;
44
+ const selectTheme = useCallback((nextTheme) => {
45
+ const button = buttonRef.current;
46
+ if (!button || typeof document === "undefined" || isDisabled) {
47
+ return;
48
+ }
49
+ const { top, left, width, height } = button.getBoundingClientRect();
50
+ const x = left + width / 2;
51
+ const y = top + height / 2;
52
+ const viewportWidth = window.visualViewport?.width ?? window.innerWidth;
53
+ const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
54
+ const maxRadius = Math.hypot(Math.max(x, viewportWidth - x), Math.max(y, viewportHeight - y));
55
+ const applyTheme = () => {
56
+ onThemeChange(nextTheme);
57
+ };
58
+ if (typeof document.startViewTransition !== "function" ||
59
+ typeof document.documentElement.animate !== "function" ||
60
+ window.matchMedia?.(REDUCED_MOTION_QUERY).matches) {
61
+ applyTheme();
62
+ return;
63
+ }
64
+ document.documentElement.classList.add(THEME_TRANSITION_CLASS);
65
+ const transition = document.startViewTransition(() => {
66
+ flushSync(applyTheme);
67
+ });
68
+ void transition.ready.then(() => {
69
+ return document.documentElement.animate({
70
+ clipPath: [
71
+ `circle(0px at ${x}px ${y}px)`,
72
+ `circle(${maxRadius}px at ${x}px ${y}px)`,
73
+ ],
74
+ }, {
75
+ duration,
76
+ easing: "ease-in-out",
77
+ pseudoElement: "::view-transition-new(root)",
78
+ }).finished;
79
+ }).catch(() => {
80
+ // Skipped transitions retain the applied theme without an unhandled rejection.
81
+ }).finally(() => {
82
+ document.documentElement.classList.remove(THEME_TRANSITION_CLASS);
83
+ });
84
+ }, [duration, isDisabled, onThemeChange]);
85
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", ref: buttonRef, disabled: isDisabled, className: cn(className), ...props, children: [!isThemeReady ? _jsx(SunMoon, { "aria-hidden": "true" }) : isDark ? _jsx(Moon, { "aria-hidden": "true" }) : _jsx(Sun, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: "Alternar tema" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-44 rounded-xl p-2", side: "bottom", sideOffset: 8, children: _jsx(DropdownMenuRadioGroup, { onValueChange: (nextTheme) => {
86
+ selectTheme(nextTheme);
87
+ }, value: selectedTheme, children: THEME_OPTIONS.map(({ icon: Icon, label, value }) => (_jsxs(DropdownMenuRadioItem, { className: "h-11 gap-3 px-3 pr-9 text-base", value: value, children: [_jsx(Icon, { "aria-hidden": "true", className: "size-5" }), _jsx("span", { children: label })] }, value))) }) })] }));
88
+ };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
3
+ /** Accepts native image props and nullable image sources from application results. */
4
+ export type AvatarImageProps = Omit<React.ComponentProps<"img">, "src"> & {
5
+ src?: string | null;
6
+ };
7
+ declare function Avatar({ className, size, ...props }: AvatarPrimitive.Root.Props & {
8
+ size?: "default" | "sm" | "lg";
9
+ }): React.JSX.Element;
10
+ /** Delegates loading, failure and fallback synchronization to the avatar primitive. */
11
+ declare function AvatarImage({ alt, className, src, ...props }: AvatarImageProps): React.JSX.Element;
12
+ declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): React.JSX.Element;
13
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
14
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
15
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
16
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
4
+ import { cn } from "../lib/utils.js";
5
+ import { useBeezUIComponents } from "../providers/beez-ui-provider.js";
6
+ function Avatar({ className, size = "default", ...props }) {
7
+ return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className), ...props }));
8
+ }
9
+ /** Delegates loading, failure and fallback synchronization to the avatar primitive. */
10
+ function AvatarImage({ alt = "", className, src, ...props }) {
11
+ const { Image: ImageComponent = "img" } = useBeezUIComponents();
12
+ return (_jsx(AvatarPrimitive.Image, { render: _jsx(ImageComponent, {}), keepMounted: true, alt: alt, "data-slot": "avatar-image", className: cn("absolute inset-0 aspect-square size-full rounded-full object-cover data-[loading]:opacity-0 data-[error]:hidden", className), src: src ?? undefined, loading: "lazy", decoding: "async", ...props }));
13
+ }
14
+ function AvatarFallback({ className, ...props }) {
15
+ return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
16
+ }
17
+ function AvatarBadge({ className, ...props }) {
18
+ return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
19
+ }
20
+ function AvatarGroup({ className, ...props }) {
21
+ return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
22
+ }
23
+ function AvatarGroupCount({ className, ...props }) {
24
+ return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
25
+ }
26
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): React.JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { Slot } from "radix-ui";
4
+ import { cn } from "../lib/utils.js";
5
+ const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
+ destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
11
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
12
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
+ link: "text-primary underline-offset-4 hover:underline",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ });
20
+ function Badge({ className, variant = "default", asChild = false, ...props }) {
21
+ const Comp = asChild ? Slot.Root : "span";
22
+ return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
23
+ }
24
+ export { Badge, badgeVariants };
@@ -0,0 +1,10 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
5
+ size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
4
+ import { cva } from "class-variance-authority";
5
+ import { Slot } from "radix-ui";
6
+ import { cn } from "../lib/utils.js";
7
+ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
11
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
12
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
13
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
14
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
15
+ link: "text-primary underline-offset-4 hover:underline",
16
+ },
17
+ size: {
18
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
19
+ 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",
20
+ 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",
21
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
22
+ icon: "size-8",
23
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
24
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
25
+ "icon-lg": "size-9",
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ variant: "default",
30
+ size: "default",
31
+ },
32
+ });
33
+ function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
34
+ const Comp = asChild ? Slot.Root : ButtonPrimitive;
35
+ return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
36
+ }
37
+ export { Button, buttonVariants };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { DayPicker, type DayButton, type Locale } from "react-day-picker";
3
+ import { Button } from "./button.js";
4
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
5
+ buttonVariant?: React.ComponentProps<typeof Button>["variant"];
6
+ }): React.JSX.Element;
7
+ declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React.ComponentProps<typeof DayButton> & {
8
+ locale?: Partial<Locale>;
9
+ }): React.JSX.Element;
10
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { es } from "react-day-picker/locale";
5
+ import { DayPicker, getDefaultClassNames, } from "react-day-picker";
6
+ import { cn } from "../lib/utils.js";
7
+ import { Button, buttonVariants } from "./button.js";
8
+ import { ChevronLeft, ChevronRight, ChevronDown } from "lucide-react";
9
+ function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale = es, formatters, components, ...props }) {
10
+ const defaultClassNames = getDefaultClassNames();
11
+ return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, locale: locale, formatters: {
12
+ formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
13
+ ...formatters,
14
+ }, classNames: {
15
+ root: cn("w-fit", defaultClassNames.root),
16
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
17
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
18
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
19
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
20
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
21
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
22
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
23
+ dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
24
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
25
+ caption_label: cn("font-medium select-none", captionLayout === "label"
26
+ ? "text-sm"
27
+ : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
28
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
29
+ weekdays: cn("flex", defaultClassNames.weekdays),
30
+ weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
31
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
32
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
33
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
34
+ day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber
35
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
36
+ : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
37
+ range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
38
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
39
+ range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
40
+ today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
41
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
42
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
43
+ hidden: cn("invisible", defaultClassNames.hidden),
44
+ ...classNames,
45
+ }, components: {
46
+ Root: ({ className, rootRef, ...props }) => {
47
+ return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
48
+ },
49
+ Chevron: ({ className, orientation, ...props }) => {
50
+ if (orientation === "left") {
51
+ return (_jsx(ChevronLeft, { className: cn("size-4", className), ...props }));
52
+ }
53
+ if (orientation === "right") {
54
+ return (_jsx(ChevronRight, { className: cn("size-4", className), ...props }));
55
+ }
56
+ return (_jsx(ChevronDown, { className: cn("size-4", className), ...props }));
57
+ },
58
+ DayButton: ({ ...props }) => (_jsx(CalendarDayButton, { locale: locale, ...props })),
59
+ WeekNumber: ({ children, ...props }) => {
60
+ return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
61
+ },
62
+ ...components,
63
+ }, ...props }));
64
+ }
65
+ function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
66
+ const defaultClassNames = getDefaultClassNames();
67
+ const ref = React.useRef(null);
68
+ React.useEffect(() => {
69
+ if (modifiers.focused)
70
+ ref.current?.focus();
71
+ }, [modifiers.focused]);
72
+ return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(locale?.code), "data-selected-single": modifiers.selected &&
73
+ !modifiers.range_start &&
74
+ !modifiers.range_end &&
75
+ !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className), ...props }));
76
+ }
77
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
3
+ size?: "default" | "sm";
4
+ }): React.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ function Card({ className, size = "default", ...props }) {
4
+ return (_jsx("div", { "data-slot": "card", "data-size": size, className: cn("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className), ...props }));
5
+ }
6
+ function CardHeader({ className, ...props }) {
7
+ return (_jsx("div", { "data-slot": "card-header", className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", className), ...props }));
8
+ }
9
+ function CardTitle({ className, ...props }) {
10
+ return (_jsx("div", { "data-slot": "card-title", className: cn("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className), ...props }));
11
+ }
12
+ function CardDescription({ className, ...props }) {
13
+ return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
14
+ }
15
+ function CardAction({ className, ...props }) {
16
+ return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
17
+ }
18
+ function CardContent({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "card-content", className: cn("px-4 group-data-[size=sm]/card:px-3", className), ...props }));
20
+ }
21
+ function CardFooter({ className, ...props }) {
22
+ return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", className), ...props }));
23
+ }
24
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
3
+ import { Button } from "./button.js";
4
+ type CarouselApi = UseEmblaCarouselType[1];
5
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
+ type CarouselOptions = UseCarouselParameters[0];
7
+ type CarouselPlugin = UseCarouselParameters[1];
8
+ type CarouselProps = {
9
+ opts?: CarouselOptions;
10
+ plugins?: CarouselPlugin;
11
+ orientation?: "horizontal" | "vertical";
12
+ setApi?: (api: CarouselApi) => void;
13
+ };
14
+ type CarouselContextProps = {
15
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
16
+ api: ReturnType<typeof useEmblaCarousel>[1];
17
+ scrollPrev: () => void;
18
+ scrollNext: () => void;
19
+ canScrollPrev: boolean;
20
+ canScrollNext: boolean;
21
+ } & CarouselProps;
22
+ declare function useCarousel(): CarouselContextProps;
23
+ declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
24
+ declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
25
+ declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
26
+ declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
27
+ declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
28
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel, };
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import useEmblaCarousel from "embla-carousel-react";
5
+ import { cn } from "../lib/utils.js";
6
+ import { Button } from "./button.js";
7
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
8
+ const CarouselContext = React.createContext(null);
9
+ function useCarousel() {
10
+ const context = React.useContext(CarouselContext);
11
+ if (!context) {
12
+ throw new Error("useCarousel must be used within a <Carousel />");
13
+ }
14
+ return context;
15
+ }
16
+ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
17
+ const [carouselRef, api] = useEmblaCarousel({
18
+ ...opts,
19
+ axis: orientation === "horizontal" ? "x" : "y",
20
+ }, plugins);
21
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
22
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
23
+ const onSelect = React.useCallback((api) => {
24
+ if (!api)
25
+ return;
26
+ setCanScrollPrev(api.canScrollPrev());
27
+ setCanScrollNext(api.canScrollNext());
28
+ }, []);
29
+ const scrollPrev = React.useCallback(() => {
30
+ api?.scrollPrev();
31
+ }, [api]);
32
+ const scrollNext = React.useCallback(() => {
33
+ api?.scrollNext();
34
+ }, [api]);
35
+ const handleKeyDown = React.useCallback((event) => {
36
+ if (event.key === "ArrowLeft") {
37
+ event.preventDefault();
38
+ scrollPrev();
39
+ }
40
+ else if (event.key === "ArrowRight") {
41
+ event.preventDefault();
42
+ scrollNext();
43
+ }
44
+ }, [scrollPrev, scrollNext]);
45
+ React.useEffect(() => {
46
+ if (!api || !setApi)
47
+ return;
48
+ setApi(api);
49
+ }, [api, setApi]);
50
+ React.useEffect(() => {
51
+ if (!api)
52
+ return;
53
+ let isMounted = true;
54
+ queueMicrotask(() => {
55
+ if (isMounted) {
56
+ onSelect(api);
57
+ }
58
+ });
59
+ api.on("reInit", onSelect);
60
+ api.on("select", onSelect);
61
+ return () => {
62
+ isMounted = false;
63
+ api?.off("reInit", onSelect);
64
+ api?.off("select", onSelect);
65
+ };
66
+ }, [api, onSelect]);
67
+ return (_jsx(CarouselContext.Provider, { value: {
68
+ carouselRef,
69
+ api: api,
70
+ opts,
71
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
72
+ scrollPrev,
73
+ scrollNext,
74
+ canScrollPrev,
75
+ canScrollNext,
76
+ }, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn("relative", className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
77
+ }
78
+ function CarouselContent({ className, ...props }) {
79
+ const { carouselRef, orientation } = useCarousel();
80
+ return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className), ...props }) }));
81
+ }
82
+ function CarouselItem({ className, ...props }) {
83
+ const { orientation } = useCarousel();
84
+ return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className), ...props }));
85
+ }
86
+ function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
87
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
88
+ return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
89
+ ? "top-1/2 -left-12 -translate-y-1/2"
90
+ : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
91
+ }
92
+ function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
93
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
94
+ return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
95
+ ? "top-1/2 -right-12 -translate-y-1/2"
96
+ : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ChevronRightIcon, {}), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
97
+ }
98
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Checkbox as CheckboxPrimitive } from "radix-ui";
3
+ declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
4
+ export { Checkbox };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Checkbox as CheckboxPrimitive } from "radix-ui";
4
+ import { CheckIcon } from "lucide-react";
5
+ import { cn } from "../lib/utils.js";
6
+ function Checkbox({ className, ...props }) {
7
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
8
+ }
9
+ export { Checkbox };
@@ -0,0 +1,117 @@
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
+ export type { DataTableColumnFilterValue } from "../types/data-table.js";
5
+ /**
6
+ * Controles imperativos de la barra unificada que la tabla expone vía
7
+ * `queryFilterControlsRef`, para que el consumidor sincronice la barra desde
8
+ * fuera (p. ej. al clickear un chip de carpeta).
9
+ */
10
+ export interface DataTableQueryFilterControls {
11
+ /** Devuelve el texto actual de la barra unificada. */
12
+ getQueryText: () => string;
13
+ /** Reemplaza el texto completo de la barra y aplica los filtros parseados. */
14
+ setQueryText: (query: string) => void;
15
+ /**
16
+ * Reemplaza los filtros de carpeta de la barra: deja un único `carpeta:<id>`
17
+ * (o ninguno si `folderId` es `null`), preservando el resto de los filtros.
18
+ */
19
+ setSingleFolderFilter: (folderId: string | null) => void;
20
+ }
21
+ export interface DataTableProps<TData, TValue> {
22
+ columns: ColumnDef<TData, TValue>[];
23
+ data: TData[];
24
+ emptyMessage: string;
25
+ toolbarActions?: React.ReactNode;
26
+ onVisibleRowsChange?: (visibleRows: TData[]) => void;
27
+ onCellClick?: (event: React.MouseEvent<HTMLTableCellElement>, row: TData, columnId: string) => void;
28
+ getRowClassName?: (row: TData) => string | undefined;
29
+ sorting?: SortingState;
30
+ onSortingChange?: (sorting: SortingState) => void;
31
+ columnVisibility?: VisibilityState;
32
+ onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
33
+ filterColumnId?: string;
34
+ filterLabel?: string;
35
+ filterPlaceholder?: string;
36
+ filterExtraContent?: React.ReactNode;
37
+ filterValue?: string;
38
+ onFilterValueChange?: (value: string) => void;
39
+ /**
40
+ * Cuando se provee, agrega una barra de query unificada estilo GitHub
41
+ * (autocompletado de `clave:valor`) por encima de los controles de filtro
42
+ * clásicos. Ambas vistas comparten la misma fuente de verdad: la barra parsea
43
+ * la query y escribe en los canales de descripción, exclusiones y avanzados,
44
+ * y se re-sincroniza cuando esos controles clásicos cambian.
45
+ */
46
+ queryFilterConfig?: FilterQualifierConfig[];
47
+ queryFilterPlaceholder?: string;
48
+ queryFilterLabel?: string;
49
+ /**
50
+ * Notifica los filtros estructurados parseados desde la barra unificada
51
+ * (cualquier kind, con o sin columna, incluyendo negados) para que el
52
+ * consumidor los aplique con su propio predicado de dominio.
53
+ */
54
+ onAppliedFiltersChange?: (appliedFilters: AppliedFilter[]) => void;
55
+ /** Ref para acceder a los controles imperativos de la barra unificada. */
56
+ queryFilterControlsRef?: React.MutableRefObject<DataTableQueryFilterControls | null>;
57
+ /** Acción opcional dentro del input de la barra unificada, al final derecho. */
58
+ queryFilterTrailingAction?: React.ReactNode;
59
+ /**
60
+ * Agrupa visualmente las filas por adyacencia: cuando la clave de grupo de una
61
+ * fila difiere de la anterior se intercala una fila de encabezado. Las filas
62
+ * deben venir pre-ordenadas por grupo. El objeto debe ser memoizado por el
63
+ * consumidor (invalida la memo del cuerpo de la tabla).
64
+ */
65
+ rowGroups?: {
66
+ getGroupKey: (row: TData) => string;
67
+ /**
68
+ * Valor de orden del grupo de una fila (comparable con <). Cuando se
69
+ * provee, los grupos se ordenan por este valor; si no, quedan en orden de
70
+ * primera aparición. Las filas se particionan por clave en ambos casos,
71
+ * así que un grupo nunca se repite aunque las filas lleguen intercaladas
72
+ * (p. ej. con orden manual del usuario).
73
+ */
74
+ getGroupSortValue?: (row: TData) => number | string;
75
+ renderGroupHeader: (groupKey: string, groupRowCount: number) => React.ReactNode;
76
+ /** Grupos cuyas filas están colapsadas (solo se ve su encabezado). */
77
+ collapsedGroupKeys?: ReadonlySet<string>;
78
+ /**
79
+ * Colapsa/expande el grupo desde su encabezado (estilo accordion). Sin este
80
+ * callback los encabezados no son interactivos.
81
+ */
82
+ onGroupToggle?: (groupKey: string) => void;
83
+ };
84
+ showExcludeFilterToggle?: boolean;
85
+ excludeFilterValues?: string[];
86
+ onExcludeFilterValuesChange?: (values: string[]) => void;
87
+ excludeFilterPlaceholder?: string;
88
+ excludeFilterLabel?: string;
89
+ excludeFilterToggleLabel?: string;
90
+ excludeFilterRowsCountByValue?: Record<string, number>;
91
+ excludeFilterUniqueRowsCount?: number;
92
+ showColumnVisibilityToggle?: boolean;
93
+ columnVisibilityButtonLabel?: string;
94
+ columnVisibilityMenuLabel?: string;
95
+ /**
96
+ * Ítems extra al tope del menú de columnas (p. ej. preferencias de vista);
97
+ * se separan de la sección de columnas con un separador.
98
+ */
99
+ columnVisibilityMenuExtraContent?: React.ReactNode;
100
+ sortingBadgeLabelOverrides?: Record<string, string>;
101
+ /**
102
+ * Ids de columnas de orden "internas" (p. ej. la posición de grupo) que el
103
+ * badge de orden y su botón "Quitar orden" deben ignorar.
104
+ */
105
+ sortingBadgeIgnoredColumnIds?: ReadonlySet<string>;
106
+ selectAllColumnsLabel?: string;
107
+ deselectAllColumnsLabel?: string;
108
+ hideableColumnsDefaultVisibility?: VisibilityState;
109
+ }
110
+ export interface DataTableColumnMeta {
111
+ label?: string;
112
+ cellClassName?: string;
113
+ headerClassName?: string;
114
+ isClickable?: boolean;
115
+ onHeaderClick?: (event: React.MouseEvent<HTMLTableCellElement>) => void;
116
+ }
117
+ 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, columnVisibilityMenuExtraContent, sortingBadgeLabelOverrides, sortingBadgeIgnoredColumnIds, selectAllColumnsLabel, deselectAllColumnsLabel, hideableColumnsDefaultVisibility, }: DataTableProps<TData, TValue>): React.JSX.Element;