@boxcustodia/library 2.0.0-alpha.7 → 2.0.0-alpha.8

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
@@ -11,7 +11,6 @@ import { Collection } from 'react-aria-components';
11
11
  import { Command } from 'cmdk';
12
12
  import { ComponentProps } from 'react';
13
13
  import { ComponentPropsWithoutRef } from 'react';
14
- import { ControllerRenderProps } from 'react-hook-form';
15
14
  import { CSSProperties } from 'react';
16
15
  import { default as default_2 } from 'react';
17
16
  import { DependencyList } from 'react';
@@ -20,11 +19,9 @@ import { DialogProps as DialogProps_2 } from '@radix-ui/react-dialog';
20
19
  import { Dispatch } from 'react';
21
20
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
22
21
  import { ElementType } from 'react';
23
- import { FieldError as FieldError_2 } from 'react-hook-form';
24
- import { FieldPath } from 'react-hook-form';
25
22
  import { Field as FieldPrimitive } from '@base-ui/react/field';
26
- import { FieldValues } from 'react-hook-form';
27
23
  import { FormEvent } from 'react';
24
+ import { Form as FormPrimitive } from '@base-ui/react/form';
28
25
  import { HTMLAttributes } from 'react';
29
26
  import { HTMLProps } from 'react';
30
27
  import { Input as InputPrimitive } from '@base-ui/react/input';
@@ -56,11 +53,8 @@ import { TreeItemContent as TreeItemContent_2 } from 'react-aria-components';
56
53
  import { TreeItemProps } from 'react-aria-components';
57
54
  import { TreeProps } from 'react-aria-components';
58
55
  import { useControllableState } from '@radix-ui/react-use-controllable-state';
59
- import { UseFormProps } from 'react-hook-form';
60
- import { UseFormReturn } from 'react-hook-form';
61
56
  import { useRender } from '@base-ui/react/use-render';
62
57
  import { VariantProps } from 'class-variance-authority';
63
- import { z } from 'zod';
64
58
 
65
59
  /**
66
60
  * Accessible confirmation dialog with cancel and action buttons.
@@ -354,13 +348,19 @@ export { CheckboxPrimitive }
354
348
  declare interface CheckboxProps extends Omit<CheckboxPrimitive.Root.Props, "children"> {
355
349
  children?: ReactNode;
356
350
  label?: ReactNode;
351
+ description?: ReactNode;
352
+ error?: FieldErrorProp;
353
+ tooltip?: ReactNode;
357
354
  indicatorProps?: CheckboxPrimitive.Indicator.Props;
358
355
  controlFirst?: boolean;
356
+ invalid?: boolean;
357
+ touched?: boolean;
358
+ dirty?: boolean;
359
359
  }
360
360
 
361
361
  export declare function CheckboxRoot({ className, ...props }: CheckboxPrimitive.Root.Props): React_2.ReactElement;
362
362
 
363
- declare function CheckboxSingle({ children, label, className, id, indicatorProps, controlFirst, ...props }: CheckboxProps): React_2.ReactElement;
363
+ declare function CheckboxSingle({ children, label, description, error, tooltip, className, indicatorProps, controlFirst, required, name, invalid, touched, dirty, ...props }: CheckboxProps): React_2.ReactElement;
364
364
 
365
365
  export declare type ClassName = string | undefined;
366
366
 
@@ -667,14 +667,21 @@ declare interface ExtendedProps_2 {
667
667
  */
668
668
  export declare const extractInitials: (string: string) => string;
669
669
 
670
- export declare function Field({ label, required, tooltip, description, error, controlFirst, children, className, ...props }: FieldProps): JSX.Element;
670
+ export declare function Field({ label, required, tooltip, description, error, controlFirst, children, className, invalid: invalidProp, ...props }: FieldProps): JSX.Element;
671
671
 
672
672
  export declare function FieldDescription({ className, ...props }: FieldPrimitive.Description.Props): JSX.Element;
673
673
 
674
674
  export declare function FieldError({ className, ...props }: FieldPrimitive.Error.Props): JSX.Element;
675
675
 
676
+ export declare type FieldErrorItem = {
677
+ message: ReactNode;
678
+ match: NonNullable<FieldErrorMatch>;
679
+ };
680
+
676
681
  export declare type FieldErrorMatch = FieldPrimitive.Error.Props["match"];
677
682
 
683
+ export declare type FieldErrorProp = string | FieldErrorItem | FieldErrorItem[];
684
+
678
685
  export declare function FieldLabel({ className, ...props }: FieldPrimitive.Label.Props): JSX.Element;
679
686
 
680
687
  export { FieldPrimitive }
@@ -684,10 +691,7 @@ export declare interface FieldProps extends FieldPrimitive.Root.Props {
684
691
  required?: boolean;
685
692
  tooltip?: ReactNode;
686
693
  description?: ReactNode;
687
- error?: string | {
688
- message: ReactNode;
689
- match: NonNullable<FieldErrorMatch>;
690
- };
694
+ error?: FieldErrorProp;
691
695
  controlFirst?: boolean;
692
696
  }
693
697
 
@@ -731,32 +735,9 @@ export declare const FileTypeGroups: Record<string, FileTypeValue[]>;
731
735
 
732
736
  export declare type FileTypeValue = (typeof FileType)[keyof typeof FileType];
733
737
 
734
- export declare const Form: <TFieldValues extends FieldValues = FieldValues>({ onSubmit, id, form, children, className, }: Props_10<TFieldValues>) => JSX.Element;
735
-
736
- export declare const FormControl: ({ className, ...props }: React_2.ComponentProps<typeof Slot>) => JSX.Element;
737
-
738
- export declare const FormDescription: ({ className, ...props }: React_2.ComponentProps<"p">) => JSX.Element;
738
+ export declare function Form({ className, ...props }: FormPrimitive.Props): default_2.ReactElement;
739
739
 
740
- export declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, render, itemProps, labelProps, controlProps, descriptionProps, messageProps, }: FormFieldProps<TFieldValues, TName>) => JSX.Element;
741
-
742
- declare type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
743
- name: TName;
744
- label?: string;
745
- description?: string;
746
- render: (field: ControllerRenderProps<TFieldValues, TName>) => React_2.ReactNode;
747
- className?: string;
748
- itemProps?: React_2.ComponentProps<typeof FormItem>;
749
- labelProps?: React_2.ComponentProps<typeof FormLabel>;
750
- controlProps?: React_2.ComponentProps<typeof FormControl>;
751
- descriptionProps?: React_2.ComponentProps<typeof FormDescription>;
752
- messageProps?: React_2.ComponentProps<typeof FormMessage>;
753
- };
754
-
755
- export declare const FormItem: ({ className, ...props }: React_2.ComponentProps<"div">) => JSX.Element;
756
-
757
- export declare const FormLabel: ({ className, ...props }: React_2.ComponentProps<"label">) => JSX.Element;
758
-
759
- export declare const FormMessage: ({ className, children, ...props }: React_2.ComponentProps<"p">) => JSX.Element | null;
740
+ export { FormPrimitive }
760
741
 
761
742
  export declare interface GenericMenuProps {
762
743
  trigger: default_2.ReactNode;
@@ -774,7 +755,7 @@ declare type GenericObject_2 = Record<string, any>;
774
755
 
775
756
  export declare const getFormData: (event: FormEvent<HTMLFormElement>) => Record<string, string>;
776
757
 
777
- export declare const Heading: <C extends React.ElementType = "h2">({ className, size, weight, as, ...props }: Props_11<C>) => JSX.Element;
758
+ export declare const Heading: <C extends React.ElementType = "h2">({ className, size, weight, as, ...props }: Props_10<C>) => JSX.Element;
778
759
 
779
760
  declare const HeadingVariants: (props?: ({
780
761
  size?: "sm" | "lg" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | null | undefined;
@@ -792,7 +773,7 @@ declare type HotkeyOptions = {
792
773
 
793
774
  export declare type ID = string | number;
794
775
 
795
- export declare function Input({ className, label, tooltip, description, error, required, ...inputProps }: InputProps): JSX.Element;
776
+ export declare function Input({ className, label, tooltip, description, error, required, name, invalid, touched, dirty, ...inputProps }: InputProps): JSX.Element;
796
777
 
797
778
  export { InputPrimitive }
798
779
 
@@ -800,10 +781,10 @@ export declare interface InputProps extends InputRootProps {
800
781
  label?: ReactNode;
801
782
  tooltip?: ReactNode;
802
783
  description?: ReactNode;
803
- error?: string | {
804
- message: ReactNode;
805
- match: NonNullable<FieldErrorMatch>;
806
- };
784
+ error?: FieldErrorProp;
785
+ invalid?: boolean;
786
+ touched?: boolean;
787
+ dirty?: boolean;
807
788
  }
808
789
 
809
790
  export declare function InputRoot({ className, onChange, ...props }: InputRootProps): JSX.Element;
@@ -859,7 +840,7 @@ export declare type LibraryProviderProps = {
859
840
  tooltipDelay?: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>["delay"];
860
841
  } & Omit<ToastProviderProps, "children">;
861
842
 
862
- export declare const Loader: ({ center, containerClassName, variant, size, ...props }: Props_12) => JSX.Element;
843
+ export declare const Loader: ({ center, containerClassName, variant, size, ...props }: Props_11) => JSX.Element;
863
844
 
864
845
  declare type LoaderVariants = VariantProps<typeof loaderVariants>;
865
846
 
@@ -1050,7 +1031,7 @@ declare type noop = (this: any, ...args: any[]) => any;
1050
1031
 
1051
1032
  export declare type Nullable<T> = T | null;
1052
1033
 
1053
- export declare const NumberInput: ({ value: prop, onChange, defaultValue: defaultProp, className, min, max, ...props }: Props_13) => JSX.Element;
1034
+ export declare const NumberInput: ({ value: prop, onChange, defaultValue: defaultProp, className, min, max, ...props }: Props_12) => JSX.Element;
1054
1035
 
1055
1036
  declare type OpenProps = {
1056
1037
  open?: boolean;
@@ -1069,22 +1050,22 @@ export declare type OverrideProps<T, TOverridden> = Omit<T, keyof TOverridden> &
1069
1050
 
1070
1051
  export declare type PageSize = (typeof TABLE_PAGE_SIZES)[number];
1071
1052
 
1072
- export declare const Pagination: ({ optionProps, className, containerProps, ...rangeProps }: Props_14) => JSX.Element;
1053
+ export declare const Pagination: ({ optionProps, className, containerProps, ...rangeProps }: Props_13) => JSX.Element;
1073
1054
 
1074
1055
  declare interface PaginationOptionProps extends ButtonHTMLAttributes<HTMLButtonElement> {
1075
1056
  isActive?: boolean;
1076
1057
  }
1077
1058
 
1078
- export declare function Password({ label, tooltip, description, error, required, ...passwordProps }: PasswordProps): JSX.Element;
1059
+ export declare function Password({ label, tooltip, description, error, required, name, invalid, touched, dirty, ...passwordProps }: PasswordProps): JSX.Element;
1079
1060
 
1080
1061
  export declare interface PasswordProps extends PasswordRootProps {
1081
1062
  label?: ReactNode;
1082
1063
  tooltip?: ReactNode;
1083
1064
  description?: ReactNode;
1084
- error?: string | {
1085
- message: ReactNode;
1086
- match: NonNullable<FieldErrorMatch>;
1087
- };
1065
+ error?: FieldErrorProp;
1066
+ invalid?: boolean;
1067
+ touched?: boolean;
1068
+ dirty?: boolean;
1088
1069
  }
1089
1070
 
1090
1071
  export declare function PasswordRoot({ className, showIcon, hideIcon, onShow, onHide, toggleable, ...rest }: PasswordRootProps): JSX.Element;
@@ -1097,7 +1078,7 @@ export declare interface PasswordRootProps extends InputRootProps {
1097
1078
  toggleable?: boolean;
1098
1079
  }
1099
1080
 
1100
- export declare const Popover: (props: Props_15) => JSX.Element;
1081
+ export declare const Popover: (props: Props_14) => JSX.Element;
1101
1082
 
1102
1083
  export declare const PopoverContent: ({ className, align, sideOffset, matchTriggerWidth, style, focus, ...props }: PopoverContentProps) => JSX.Element;
1103
1084
 
@@ -1146,24 +1127,16 @@ declare interface Props extends ExtendedProps {
1146
1127
  onSelect?: (value: AutoCompleteItem["value"], item: AutoCompleteItem) => any;
1147
1128
  }
1148
1129
 
1149
- declare type Props_10<TFieldValues extends FieldValues> = {
1150
- onSubmit: (data: TFieldValues) => void;
1151
- form: UseFormReturn<TFieldValues, any, any>;
1152
- children: React_2.ReactNode;
1153
- className?: string;
1154
- id?: string;
1155
- };
1156
-
1157
- declare type Props_11<C extends React.ElementType> = VariantProps<typeof HeadingVariants> & {
1130
+ declare type Props_10<C extends React.ElementType> = VariantProps<typeof HeadingVariants> & {
1158
1131
  as?: C;
1159
1132
  } & Omit<React.ComponentPropsWithoutRef<C>, "as">;
1160
1133
 
1161
- declare type Props_12 = LucideProps & LoaderVariants & {
1134
+ declare type Props_11 = LucideProps & LoaderVariants & {
1162
1135
  center?: boolean;
1163
1136
  containerClassName?: string;
1164
1137
  };
1165
1138
 
1166
- declare type Props_13 = OverrideProps<ComponentProps<"input">, {
1139
+ declare type Props_12 = OverrideProps<ComponentProps<"input">, {
1167
1140
  /** valor del input */
1168
1141
  value?: number;
1169
1142
  /** functión a ejecutar cuando el valor cambia */
@@ -1176,13 +1149,13 @@ declare type Props_13 = OverrideProps<ComponentProps<"input">, {
1176
1149
  max?: number;
1177
1150
  }>;
1178
1151
 
1179
- declare interface Props_14 extends useRangePaginationProps {
1152
+ declare interface Props_13 extends useRangePaginationProps {
1180
1153
  optionProps?: PaginationOptionProps;
1181
1154
  className?: string;
1182
1155
  containerProps?: HTMLProps<HTMLDivElement>;
1183
1156
  }
1184
1157
 
1185
- declare interface Props_15 {
1158
+ declare interface Props_14 {
1186
1159
  trigger?: ReactNode;
1187
1160
  children: ReactNode;
1188
1161
  rootProps?: ComponentPropsWithoutRef<typeof PopoverRoot>;
@@ -1196,12 +1169,12 @@ declare interface Props_15 {
1196
1169
  offset?: ComponentPropsWithoutRef<typeof PopoverContent>["sideOffset"];
1197
1170
  }
1198
1171
 
1199
- declare interface Props_16 extends ComponentPropsWithoutRef<typeof Slot> {
1172
+ declare interface Props_15 extends ComponentPropsWithoutRef<typeof Slot> {
1200
1173
  /** Si el componente está presente o no */
1201
1174
  when: ComponentProps<typeof Presence>["present"];
1202
1175
  }
1203
1176
 
1204
- declare type Props_17<T> = {
1177
+ declare type Props_16<T> = {
1205
1178
  data: T[];
1206
1179
  columns: ColumnDef<T>[];
1207
1180
  onRowClick?: (row: T) => void;
@@ -1209,12 +1182,16 @@ declare type Props_17<T> = {
1209
1182
  selected?: (row: T) => boolean;
1210
1183
  } & ExtendedProps_2 & Omit<ComponentPropsWithoutRef<typeof TableRoot>, "data" | "selected" | "onDoubleClick">;
1211
1184
 
1212
- declare type Props_18 = {
1185
+ declare type Props_17 = {
1213
1186
  setPageSize?: (value: PageSize) => void;
1214
1187
  pageSize?: PageSize;
1215
1188
  } & Omit<usePaginationProps, "pageSize"> & TablePaginationExtendedProps;
1216
1189
 
1217
- declare type Props_19 = ClosableProps | NonClosableProps;
1190
+ declare type Props_18 = ClosableProps | NonClosableProps;
1191
+
1192
+ declare type Props_19<T extends TreeNode> = TreeRootProps & {
1193
+ items: T[];
1194
+ };
1218
1195
 
1219
1196
  declare interface Props_2 extends HTMLProps<HTMLDivElement> {
1220
1197
  /**
@@ -1223,11 +1200,7 @@ declare interface Props_2 extends HTMLProps<HTMLDivElement> {
1223
1200
  src: string;
1224
1201
  }
1225
1202
 
1226
- declare type Props_20<T extends TreeNode> = TreeRootProps & {
1227
- items: T[];
1228
- };
1229
-
1230
- declare interface Props_21<T> extends UseAsyncOptions<T> {
1203
+ declare interface Props_20<T> extends UseAsyncOptions<T> {
1231
1204
  fn: () => Promise<T>;
1232
1205
  dependencies?: DependencyList;
1233
1206
  }
@@ -1441,7 +1414,7 @@ declare type Shortcut = Partial<{
1441
1414
  shortcutOptions: MenuShortcutProps_2["options"];
1442
1415
  }>;
1443
1416
 
1444
- export declare const Show: ({ when, ...props }: Props_16) => JSX.Element;
1417
+ export declare const Show: ({ when, ...props }: Props_15) => JSX.Element;
1445
1418
 
1446
1419
  export declare type SingleDateValue = {
1447
1420
  value?: DateSingle;
@@ -1540,7 +1513,7 @@ export declare interface TabContentProps extends HTMLProps<HTMLDivElement> {
1540
1513
  value: string;
1541
1514
  }
1542
1515
 
1543
- export declare const Table: <T>({ data, columns, onRowClick, onDoubleClick, selected, theadClassName, theadProps, tbodyClassName, tbodyProps, trClassName, trProps, thClassName, thProps, tdClassName, tdProps, ...tableProps }: Props_17<T>) => JSX.Element;
1516
+ export declare const Table: <T>({ data, columns, onRowClick, onDoubleClick, selected, theadClassName, theadProps, tbodyClassName, tbodyProps, trClassName, trProps, thClassName, thProps, tdClassName, tdProps, ...tableProps }: Props_16<T>) => JSX.Element;
1544
1517
 
1545
1518
  export declare const TABLE_PAGE_SIZES: number[];
1546
1519
 
@@ -1568,7 +1541,7 @@ declare type TableHeaderProps = React_2.ComponentProps<"thead">;
1568
1541
 
1569
1542
  declare type TableHeadProps = React_2.ComponentProps<"th">;
1570
1543
 
1571
- export declare const TablePagination: ({ containerClassName, containerProps, selectClassName, selectProps, sizes, ...props }: Props_18) => JSX.Element;
1544
+ export declare const TablePagination: ({ containerClassName, containerProps, selectClassName, selectProps, sizes, ...props }: Props_17) => JSX.Element;
1572
1545
 
1573
1546
  declare interface TablePaginationExtendedProps {
1574
1547
  containerClassName?: ClassName;
@@ -1623,7 +1596,7 @@ export declare interface TabTriggerProps extends Omit<HTMLProps<HTMLButtonElemen
1623
1596
  value: string;
1624
1597
  }
1625
1598
 
1626
- export declare const Tag: ({ className, color, variant, rounded, icon, closable, onClose, children, ...props }: Props_19) => JSX.Element;
1599
+ export declare const Tag: ({ className, color, variant, rounded, icon, closable, onClose, children, ...props }: Props_18) => JSX.Element;
1627
1600
 
1628
1601
  export declare type TagVariant = VariantProps<typeof tagVariants>;
1629
1602
 
@@ -1830,7 +1803,7 @@ export declare function TooltipRoot(props: RootProps): JSX.Element;
1830
1803
 
1831
1804
  export declare function TooltipTrigger({ className, ...props }: TriggerProps): JSX.Element;
1832
1805
 
1833
- export declare function Tree<T extends TreeNode>({ items, ...props }: Props_20<T>): JSX.Element;
1806
+ export declare function Tree<T extends TreeNode>({ items, ...props }: Props_19<T>): JSX.Element;
1834
1807
 
1835
1808
  export declare const TreeItem: <T extends object>({ className, ...props }: OverrideProps<TreeItemProps<T>, {
1836
1809
  id: string | number;
@@ -1920,7 +1893,7 @@ export declare function useArray<T>(defaultProp: T[]): readonly [T[], {
1920
1893
  readonly update: (predicate: ListIterateeCustom<T, boolean>, newItem: T | ((item: T) => T)) => void;
1921
1894
  }];
1922
1895
 
1923
- export declare function useAsync<T>({ fn, dependencies, onError, onSuccess, onFinish, }: Props_21<T>): AsyncState<T>;
1896
+ export declare function useAsync<T>({ fn, dependencies, onError, onSuccess, onFinish, }: Props_20<T>): AsyncState<T>;
1924
1897
 
1925
1898
  declare interface UseAsyncOptions<T> {
1926
1899
  onError?: (error: Error) => void;
@@ -1953,21 +1926,6 @@ export declare function useEventListener<K extends keyof HTMLElementEventMap, T
1953
1926
 
1954
1927
  export declare function useFocusTrap(active?: boolean): (instance: HTMLElement | null) => void;
1955
1928
 
1956
- export declare function useForm<T extends FieldValues = FieldValues>(schema: z.ZodType<T>, options?: Partial<UseFormProps<T>>): UseFormReturn<T, any, T>;
1957
-
1958
- export declare const useFormField: () => {
1959
- invalid: boolean;
1960
- isDirty: boolean;
1961
- isTouched: boolean;
1962
- isValidating: boolean;
1963
- error?: FieldError_2;
1964
- id: string;
1965
- name: string;
1966
- formItemId: string;
1967
- formDescriptionId: string;
1968
- formMessageId: string;
1969
- };
1970
-
1971
1929
  export declare function useHotkey(keys: string | string[], handler: (event: KeyboardEvent) => void, options?: HotkeyOptions): RefObject<any>;
1972
1930
 
1973
1931
  export declare function useHover<T extends HTMLElement>(options?: UseHoverOptions): {