tw-react-components 0.0.161 → 0.0.163

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 (32) hide show
  1. package/index.esm.js +206 -219
  2. package/package.json +1 -1
  3. package/src/components/Badge/index.d.ts +2 -3
  4. package/src/components/Block/index.d.ts +4 -10
  5. package/src/components/Button/index.d.ts +3 -11
  6. package/src/components/Card/index.d.ts +3 -7
  7. package/src/components/Dialog/Dialog.d.ts +5 -5
  8. package/src/components/DropdownMenu/index.d.ts +18 -17
  9. package/src/components/Flex/index.d.ts +2 -13
  10. package/src/components/Form/controls/custom/date-time/index.d.ts +3 -12
  11. package/src/components/Form/controls/custom/file.d.ts +2 -5
  12. package/src/components/Form/controls/custom/select/index.d.ts +4 -8
  13. package/src/components/Form/controls/primitive/BasicInput.d.ts +2 -14
  14. package/src/components/Form/controls/primitive/CheckBoxInput.d.ts +2 -1
  15. package/src/components/Form/controls/primitive/EmailInput.d.ts +2 -1
  16. package/src/components/Form/controls/primitive/NumberInput.d.ts +2 -4
  17. package/src/components/Form/controls/primitive/PasswordInput.d.ts +2 -1
  18. package/src/components/Form/controls/primitive/TextInput.d.ts +2 -1
  19. package/src/components/Form/controls/primitive/TextareaInput.d.ts +2 -1
  20. package/src/components/Form/controls/with-form.d.ts +10 -46
  21. package/src/components/Hint/index.d.ts +7 -9
  22. package/src/components/List/index.d.ts +12 -10
  23. package/src/components/Popover/index.d.ts +4 -3
  24. package/src/components/Separator/index.d.ts +2 -1
  25. package/src/components/Sheet/index.d.ts +6 -6
  26. package/src/components/Sidebar/index.d.ts +35 -35
  27. package/src/components/Switch/index.d.ts +3 -5
  28. package/src/components/Tabs/index.d.ts +4 -3
  29. package/src/helpers/index.d.ts +0 -1
  30. package/src/hooks/useOnSwipe.d.ts +1 -1
  31. package/src/hooks/useOutsideClick.d.ts +1 -1
  32. package/src/helpers/mergeRefs.d.ts +0 -2
@@ -1,5 +1,5 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
- import type { ComponentProps } from 'react';
2
+ import type { ComponentProps, FC } from 'react';
3
3
  import { Tooltip } from '../Tooltip';
4
4
  export declare const SIDEBAR_COOKIE_NAME = "sidebar:state";
5
5
  export declare const SIDEBAR_COOKIE_MAX_AGE: number;
@@ -18,28 +18,28 @@ export type SidebarContext = {
18
18
  };
19
19
  export declare const SidebarContext: import("react").Context<SidebarContext | null>;
20
20
  export declare function useSidebar(): SidebarContext;
21
- export declare const SidebarContextProvider: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
21
+ export declare const SidebarContextProvider: FC<ComponentProps<'div'> & {
22
22
  defaultOpen?: boolean;
23
23
  open?: boolean;
24
24
  onOpenChange?: (open: boolean) => void;
25
- }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
26
- export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
25
+ }>;
26
+ export declare const Sidebar: FC<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
27
27
  side?: "left" | "right";
28
28
  variant?: "sidebar" | "floating" | "inset";
29
29
  collapsible?: "offcanvas" | "icon" | "none";
30
- }, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
31
- Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
32
- Footer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
33
- Group: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
34
- GroupAction: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
30
+ }> & {
31
+ Content: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
32
+ Footer: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
33
+ Group: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
34
+ GroupAction: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
35
35
  asChild?: boolean;
36
- }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
37
- GroupContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
38
- GroupLabel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
36
+ }>;
37
+ GroupContent: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
38
+ GroupLabel: FC<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
39
39
  asChild?: boolean;
40
- }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
41
- Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
42
- Input: import("react").ForwardRefExoticComponent<Omit<{
40
+ }>;
41
+ Header: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
42
+ Input: FC<{
43
43
  inputClassName?: string;
44
44
  extensionClassName?: string;
45
45
  type?: import("../Form").InputType;
@@ -48,39 +48,39 @@ export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<imp
48
48
  size?: import("..").Size;
49
49
  hasErrors?: boolean;
50
50
  clearable?: boolean;
51
- suffixIcon?: import("react").FC<ComponentProps<"svg">>;
51
+ suffixIcon?: FC<ComponentProps<"svg">>;
52
52
  onClear?: () => void;
53
53
  onSuffixIconClick?: (event: import("react").MouseEvent<HTMLDivElement>) => void;
54
- } & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref" | "id" | "size"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
55
- Inset: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
56
- Menu: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
57
- MenuAction: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
54
+ } & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "id" | "size">>;
55
+ Inset: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>>;
56
+ Menu: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>>;
57
+ MenuAction: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
58
58
  asChild?: boolean;
59
59
  showOnHover?: boolean;
60
- }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
61
- MenuBadge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
62
- MenuButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
60
+ }>;
61
+ MenuBadge: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
62
+ MenuButton: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
63
63
  asChild?: boolean;
64
64
  isActive?: boolean;
65
65
  tooltip?: string | ComponentProps<typeof Tooltip>;
66
66
  } & VariantProps<(props?: ({
67
67
  variant?: "default" | "outline" | null | undefined;
68
68
  size?: "default" | "sm" | "lg" | null | undefined;
69
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
70
- MenuItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
71
- MenuSkeleton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
69
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>>;
70
+ MenuItem: FC<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>>;
71
+ MenuSkeleton: FC<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
72
72
  showIcon?: boolean;
73
- }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
74
- MenuSub: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
75
- MenuSubButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
73
+ }>;
74
+ MenuSub: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>>;
75
+ MenuSubButton: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
76
76
  asChild?: boolean;
77
77
  size?: "sm" | "md";
78
78
  isActive?: boolean;
79
- }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
80
- MenuSubItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
81
- Rail: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
82
- Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
83
- Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
79
+ }>;
80
+ MenuSubItem: FC<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>>;
81
+ Rail: FC<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
82
+ Separator: FC<import("@radix-ui/react-separator").SeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
83
+ Trigger: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
84
84
  size?: import("..").Size;
85
85
  color?: import("..").Color;
86
86
  variant?: import("../Button").ButtonVariant;
@@ -88,5 +88,5 @@ export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<imp
88
88
  prefixIcon?: import("lucide-react").LucideIcon;
89
89
  suffixIcon?: import("lucide-react").LucideIcon;
90
90
  unstyled?: boolean;
91
- } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
91
+ }>;
92
92
  };
@@ -1,9 +1,7 @@
1
1
  import * as SwitchPrimitives from '@radix-ui/react-switch';
2
- import type { ComponentProps, ComponentPropsWithoutRef } from 'react';
3
- export type SwitchProps = ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {
2
+ import type { ComponentProps, FC } from 'react';
3
+ export type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root> & {
4
4
  thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
5
5
  };
6
- declare const Switch: import("react").ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
7
- thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
8
- } & import("react").RefAttributes<HTMLButtonElement>>;
6
+ declare const Switch: FC<SwitchProps>;
9
7
  export { Switch };
@@ -1,6 +1,7 @@
1
1
  import * as TabsPrimitive from '@radix-ui/react-tabs';
2
- export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
3
- List: import("react").ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
4
- Trigger: import("react").ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
2
+ import type { FC } from 'react';
3
+ export declare const Tabs: FC<TabsPrimitive.TabsProps & import("react").RefAttributes<HTMLDivElement>> & {
4
+ List: FC<TabsPrimitive.TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
5
+ Trigger: FC<TabsPrimitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
6
  Content: import("react").ForwardRefExoticComponent<TabsPrimitive.TabsContentProps & import("react").RefAttributes<HTMLDivElement>>;
6
7
  };
@@ -4,5 +4,4 @@ export * from './generalComparator';
4
4
  export * from './getDisplayDate';
5
5
  export * from './getValueFromCookie';
6
6
  export * from './isEmpty';
7
- export * from './mergeRefs';
8
7
  export * from './resolveTargetObject';
@@ -1,4 +1,4 @@
1
1
  import type { RefObject } from 'react';
2
2
  type SwipeDirection = 'up' | 'left' | 'bottom' | 'right';
3
- export declare function useOnSwipe(element: RefObject<HTMLElement>, onSwipe: (direction: SwipeDirection) => any | false, minSwipeDistance?: number): void;
3
+ export declare function useOnSwipe(element: RefObject<HTMLElement | null>, onSwipe: (direction: SwipeDirection) => any | false, minSwipeDistance?: number): void;
4
4
  export {};
@@ -1,2 +1,2 @@
1
1
  import type { RefObject } from 'react';
2
- export declare function useOutsideClick(ref: RefObject<HTMLDivElement>, callback: () => void): void;
2
+ export declare function useOutsideClick(ref: RefObject<HTMLDivElement | null>, callback: () => void): void;
@@ -1,2 +0,0 @@
1
- import type { LegacyRef, MutableRefObject, RefCallback } from 'react';
2
- export declare function mergeRefs<T = any>(refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined | null>): RefCallback<T>;