@juanarenas31/metrik-ui 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ComponentPropsWithoutRef, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, SVGAttributes, TdHTMLAttributes, ThHTMLAttributes, RefObject } from 'react';
2
+ import { HTMLAttributes, ComponentPropsWithoutRef, ButtonHTMLAttributes, ReactNode, ComponentType, ComponentProps, CSSProperties, InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, SVGAttributes, TdHTMLAttributes, ThHTMLAttributes, RefObject } from 'react';
3
3
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -8,10 +8,17 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
8
8
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
9
9
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
10
10
  import { DayPickerProps, DateRange } from 'react-day-picker';
11
+ import * as recharts_types_util_payload_getUniqPayload from 'recharts/types/util/payload/getUniqPayload';
12
+ import * as recharts_types_component_Tooltip from 'recharts/types/component/Tooltip';
13
+ import * as recharts_types_util_types from 'recharts/types/util/types';
14
+ import * as recharts_types_component_DefaultTooltipContent from 'recharts/types/component/DefaultTooltipContent';
15
+ import * as RechartsPrimitive from 'recharts';
11
16
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
12
17
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
13
18
  import * as DialogPrimitive from '@radix-ui/react-dialog';
14
19
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
20
+ import { ColumnDef } from '@tanstack/react-table';
21
+ export { ColumnDef } from '@tanstack/react-table';
15
22
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
16
23
  import * as _radix_ui_react_slot from '@radix-ui/react-slot';
17
24
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -132,6 +139,70 @@ declare const CardDescription: react.ForwardRefExoticComponent<DivProps & react.
132
139
  declare const CardContent: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
133
140
  declare const CardFooter: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
134
141
 
142
+ declare const THEMES: {
143
+ readonly light: "";
144
+ readonly dark: ".dark";
145
+ };
146
+ type ChartConfig = {
147
+ [k in string]: {
148
+ label?: ReactNode;
149
+ icon?: ComponentType;
150
+ } & ({
151
+ color?: string;
152
+ theme?: never;
153
+ } | {
154
+ color?: never;
155
+ theme: Record<keyof typeof THEMES, string>;
156
+ });
157
+ };
158
+ type ChartContextProps = {
159
+ config: ChartConfig;
160
+ };
161
+ declare function useChart(): ChartContextProps;
162
+ declare const ChartContainer: react.ForwardRefExoticComponent<Omit<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & {
163
+ config: ChartConfig;
164
+ children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
165
+ }, "ref"> & react.RefAttributes<HTMLDivElement>>;
166
+ declare function ChartStyle({ id, config }: {
167
+ id: string;
168
+ config: ChartConfig;
169
+ }): react_jsx_runtime.JSX.Element | null;
170
+ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
171
+ declare const ChartTooltipContent: react.ForwardRefExoticComponent<Omit<RechartsPrimitive.DefaultTooltipContentProps<recharts_types_component_DefaultTooltipContent.ValueType, recharts_types_component_DefaultTooltipContent.NameType> & {
172
+ accessibilityLayer?: boolean;
173
+ active?: boolean | undefined;
174
+ includeHidden?: boolean | undefined;
175
+ allowEscapeViewBox?: recharts_types_util_types.AllowInDimension;
176
+ animationDuration?: recharts_types_util_types.AnimationDuration;
177
+ animationEasing?: recharts_types_util_types.AnimationTiming;
178
+ content?: recharts_types_component_Tooltip.ContentType<recharts_types_component_DefaultTooltipContent.ValueType, recharts_types_component_DefaultTooltipContent.NameType> | undefined;
179
+ coordinate?: Partial<recharts_types_util_types.Coordinate>;
180
+ cursor?: boolean | react.ReactElement | react.SVGProps<SVGElement>;
181
+ filterNull?: boolean;
182
+ defaultIndex?: number;
183
+ isAnimationActive?: boolean;
184
+ offset?: number;
185
+ payloadUniqBy?: recharts_types_util_payload_getUniqPayload.UniqueOption<recharts_types_component_DefaultTooltipContent.Payload<recharts_types_component_DefaultTooltipContent.ValueType, recharts_types_component_DefaultTooltipContent.NameType>> | undefined;
186
+ position?: Partial<recharts_types_util_types.Coordinate>;
187
+ reverseDirection?: recharts_types_util_types.AllowInDimension;
188
+ shared?: boolean;
189
+ trigger?: "hover" | "click";
190
+ useTranslate3d?: boolean;
191
+ viewBox?: recharts_types_util_types.CartesianViewBox;
192
+ wrapperStyle?: CSSProperties;
193
+ } & react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & {
194
+ hideLabel?: boolean;
195
+ hideIndicator?: boolean;
196
+ indicator?: "line" | "dot" | "dashed";
197
+ nameKey?: string;
198
+ labelKey?: string;
199
+ }, "ref"> & react.RefAttributes<HTMLDivElement>>;
200
+ declare const ChartLegend: typeof RechartsPrimitive.Legend;
201
+ declare const ChartLegendContent: react.ForwardRefExoticComponent<Omit<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
202
+ hideIcon?: boolean;
203
+ nameKey?: string;
204
+ }, "ref"> & react.RefAttributes<HTMLDivElement>>;
205
+
135
206
  interface CheckboxProps extends ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
136
207
  }
137
208
  declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
@@ -271,6 +342,26 @@ declare const CommandItem: react.ForwardRefExoticComponent<Omit<{
271
342
  } & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
272
343
  declare function CommandShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
273
344
 
345
+ declare const containerVariants: (props?: ({
346
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "prose" | "full" | null | undefined;
347
+ padding?: "none" | "sm" | "md" | "lg" | null | undefined;
348
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
349
+ type ContainerVariants = VariantProps<typeof containerVariants>;
350
+
351
+ interface ContainerProps extends HTMLAttributes<HTMLDivElement>, ContainerVariants {
352
+ /** Renderiza el hijo en lugar de un `<div>` (Radix Slot). */
353
+ asChild?: boolean;
354
+ }
355
+ /**
356
+ * Contenedor centrado con ancho máximo y padding horizontal responsive.
357
+ * La pieza base para componer el layout de una página.
358
+ *
359
+ * @example
360
+ * <Container size="lg">…</Container>
361
+ * <Container asChild><main>…</main></Container>
362
+ */
363
+ declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLDivElement>>;
364
+
274
365
  declare const ContextMenu: react.FC<ContextMenuPrimitive.ContextMenuProps>;
275
366
  declare const ContextMenuTrigger: react.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & react.RefAttributes<HTMLSpanElement>>;
276
367
  declare const ContextMenuGroup: react.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
@@ -294,6 +385,27 @@ declare const ContextMenuSubTrigger: react.ForwardRefExoticComponent<Omit<Contex
294
385
  } & react.RefAttributes<HTMLDivElement>>;
295
386
  declare const ContextMenuSubContent: react.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
296
387
 
388
+ interface DataTableProps<TData, TValue> {
389
+ columns: ColumnDef<TData, TValue>[];
390
+ data: TData[];
391
+ /** Columna por la que filtrar con el input de búsqueda. */
392
+ filterColumn?: string;
393
+ filterPlaceholder?: string;
394
+ /** Filas por página. */
395
+ pageSize?: number;
396
+ /** Oculta la barra superior (búsqueda + columnas). */
397
+ hideToolbar?: boolean;
398
+ className?: string;
399
+ }
400
+ /**
401
+ * Tabla de datos con orden, filtro, paginación y visibilidad de columnas,
402
+ * construida sobre TanStack Table.
403
+ *
404
+ * @example
405
+ * <DataTable columns={columns} data={rows} filterColumn="programa" />
406
+ */
407
+ declare function DataTable<TData, TValue>({ columns, data, filterColumn, filterPlaceholder, pageSize, hideToolbar, className, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
408
+
297
409
  interface DateRangePillProps {
298
410
  value?: DateRange;
299
411
  onValueChange?: (range: DateRange | undefined) => void;
@@ -404,6 +516,26 @@ declare const FormControl: react.ForwardRefExoticComponent<Omit<_radix_ui_react_
404
516
  declare function FormDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
405
517
  declare function FormMessage({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element | null;
406
518
 
519
+ declare const gridVariants: (props?: ({
520
+ cols?: 1 | 2 | 3 | 4 | 5 | 6 | 12 | null | undefined;
521
+ gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
522
+ flow?: "col" | "row" | "dense" | null | undefined;
523
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
524
+ type GridVariants = VariantProps<typeof gridVariants>;
525
+
526
+ interface GridProps extends HTMLAttributes<HTMLDivElement>, GridVariants {
527
+ asChild?: boolean;
528
+ }
529
+ /**
530
+ * Layout en cuadrícula CSS, con columnas y `gap` tipados. Para columnas
531
+ * responsive usa `className` (p. ej. `className="md:grid-cols-3"`).
532
+ *
533
+ * @example
534
+ * <Grid cols={3} gap="lg">…</Grid>
535
+ * <Grid cols={1} className="md:grid-cols-2 lg:grid-cols-4">…</Grid>
536
+ */
537
+ declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLDivElement>>;
538
+
407
539
  declare const HoverCard: react.FC<HoverCardPrimitive.HoverCardProps>;
408
540
  declare const HoverCardTrigger: react.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & react.RefAttributes<HTMLAnchorElement>>;
409
541
  declare const HoverCardContent: react.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
@@ -522,6 +654,27 @@ interface SpinnerProps extends SVGAttributes<SVGSVGElement> {
522
654
  }
523
655
  declare const Spinner: react.ForwardRefExoticComponent<SpinnerProps & react.RefAttributes<SVGSVGElement>>;
524
656
 
657
+ declare const stackVariants: (props?: ({
658
+ direction?: "col" | "row" | "row-reverse" | "col-reverse" | null | undefined;
659
+ gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
660
+ align?: "center" | "end" | "start" | "baseline" | "stretch" | null | undefined;
661
+ justify?: "center" | "end" | "start" | "between" | "around" | "evenly" | null | undefined;
662
+ wrap?: boolean | null | undefined;
663
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
664
+ type StackVariants = VariantProps<typeof stackVariants>;
665
+
666
+ interface StackProps extends HTMLAttributes<HTMLDivElement>, StackVariants {
667
+ asChild?: boolean;
668
+ }
669
+ /**
670
+ * Layout flex en una dirección, con `gap`, alineación y justificación tipados.
671
+ *
672
+ * @example
673
+ * <Stack gap="lg">…</Stack>
674
+ * <Stack direction="row" align="center" justify="between">…</Stack>
675
+ */
676
+ declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLDivElement>>;
677
+
525
678
  interface SwitchProps extends ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
526
679
  }
527
680
  declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
@@ -643,4 +796,4 @@ declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>
643
796
 
644
797
  declare function useToggle(initial?: boolean): [boolean, () => void, (v: boolean) => void];
645
798
 
646
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertVariants, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, type BadgeVariants, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, type ButtonVariants, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, type ChipOption, ChipSelector, type ChipSelectorProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DateRangePill, type DateRangePillProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type DisclosureControls, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, FloatingDatePicker, type FloatingDatePickerProps, FloatingFileInput, type FloatingFileInputProps, FloatingInput, type FloatingInputProps, FloatingSelect, type FloatingSelectProps, FloatingTextarea, type FloatingTextareaProps, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, type InputProps, type InputVariants, Label, type LabelProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, RichTextEditor, type RichTextEditorProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Slider, Spinner, type SpinnerProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, Toaster, Toggle, ToggleGroup, ToggleGroupItem, type ToggleProps, type ToggleVariants, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, VisuallyHidden, alertVariants, badgeVariants, buttonVariants, cn, inputVariants, toggleVariants, useBreakpoint, useClickOutside, useDebounce, useDisclosure, useLocalStorage, useMediaQuery, useTheme, useToggle };
799
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertVariants, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, type BadgeVariants, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, type ButtonVariants, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, type CheckboxProps, type ChipOption, ChipSelector, type ChipSelectorProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, type ContainerProps, type ContainerVariants, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, type DataTableProps, DateRangePill, type DateRangePillProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type DisclosureControls, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, FloatingDatePicker, type FloatingDatePickerProps, FloatingFileInput, type FloatingFileInputProps, FloatingInput, type FloatingInputProps, FloatingSelect, type FloatingSelectProps, FloatingTextarea, type FloatingTextareaProps, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormLabel, FormMessage, Grid, type GridProps, type GridVariants, HoverCard, HoverCardContent, HoverCardTrigger, Input, type InputProps, type InputVariants, Label, type LabelProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, RichTextEditor, type RichTextEditorProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Slider, Spinner, type SpinnerProps, Stack, type StackProps, type StackVariants, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, Toaster, Toggle, ToggleGroup, ToggleGroupItem, type ToggleProps, type ToggleVariants, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, VisuallyHidden, alertVariants, badgeVariants, buttonVariants, cn, containerVariants, gridVariants, inputVariants, stackVariants, toggleVariants, useBreakpoint, useChart, useClickOutside, useDebounce, useDisclosure, useLocalStorage, useMediaQuery, useTheme, useToggle };