@juanarenas31/metrik-ui 0.2.0 → 0.3.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.
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>>;
@@ -294,6 +365,27 @@ declare const ContextMenuSubTrigger: react.ForwardRefExoticComponent<Omit<Contex
294
365
  } & react.RefAttributes<HTMLDivElement>>;
295
366
  declare const ContextMenuSubContent: react.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
296
367
 
368
+ interface DataTableProps<TData, TValue> {
369
+ columns: ColumnDef<TData, TValue>[];
370
+ data: TData[];
371
+ /** Columna por la que filtrar con el input de búsqueda. */
372
+ filterColumn?: string;
373
+ filterPlaceholder?: string;
374
+ /** Filas por página. */
375
+ pageSize?: number;
376
+ /** Oculta la barra superior (búsqueda + columnas). */
377
+ hideToolbar?: boolean;
378
+ className?: string;
379
+ }
380
+ /**
381
+ * Tabla de datos con orden, filtro, paginación y visibilidad de columnas,
382
+ * construida sobre TanStack Table.
383
+ *
384
+ * @example
385
+ * <DataTable columns={columns} data={rows} filterColumn="programa" />
386
+ */
387
+ declare function DataTable<TData, TValue>({ columns, data, filterColumn, filterPlaceholder, pageSize, hideToolbar, className, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
388
+
297
389
  interface DateRangePillProps {
298
390
  value?: DateRange;
299
391
  onValueChange?: (range: DateRange | undefined) => void;
@@ -643,4 +735,4 @@ declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>
643
735
 
644
736
  declare function useToggle(initial?: boolean): [boolean, () => void, (v: boolean) => void];
645
737
 
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 };
738
+ 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, 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, 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, useChart, useClickOutside, useDebounce, useDisclosure, useLocalStorage, useMediaQuery, useTheme, useToggle };