tw-react-components 0.0.161 → 0.0.164
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/index.esm.js +206 -219
- package/package.json +1 -1
- package/src/components/Badge/index.d.ts +2 -3
- package/src/components/Block/index.d.ts +4 -10
- package/src/components/Button/index.d.ts +3 -11
- package/src/components/Card/index.d.ts +3 -7
- package/src/components/Dialog/Dialog.d.ts +5 -5
- package/src/components/DropdownMenu/index.d.ts +18 -17
- package/src/components/Flex/index.d.ts +2 -13
- package/src/components/Form/controls/custom/date-time/index.d.ts +3 -12
- package/src/components/Form/controls/custom/file.d.ts +2 -5
- package/src/components/Form/controls/custom/select/index.d.ts +4 -8
- package/src/components/Form/controls/primitive/BasicInput.d.ts +2 -14
- package/src/components/Form/controls/primitive/CheckBoxInput.d.ts +2 -1
- package/src/components/Form/controls/primitive/EmailInput.d.ts +2 -1
- package/src/components/Form/controls/primitive/NumberInput.d.ts +2 -4
- package/src/components/Form/controls/primitive/PasswordInput.d.ts +2 -1
- package/src/components/Form/controls/primitive/TextInput.d.ts +2 -1
- package/src/components/Form/controls/primitive/TextareaInput.d.ts +2 -1
- package/src/components/Form/controls/with-form.d.ts +11 -47
- package/src/components/Hint/index.d.ts +7 -9
- package/src/components/List/index.d.ts +12 -10
- package/src/components/Popover/index.d.ts +4 -3
- package/src/components/Separator/index.d.ts +2 -1
- package/src/components/Sheet/index.d.ts +6 -6
- package/src/components/Sidebar/index.d.ts +35 -35
- package/src/components/Switch/index.d.ts +3 -5
- package/src/components/Tabs/index.d.ts +4 -3
- package/src/helpers/index.d.ts +0 -1
- package/src/hooks/useOnSwipe.d.ts +1 -1
- package/src/hooks/useOutsideClick.d.ts +1 -1
- 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:
|
|
21
|
+
export declare const SidebarContextProvider: FC<ComponentProps<'div'> & {
|
|
22
22
|
defaultOpen?: boolean;
|
|
23
23
|
open?: boolean;
|
|
24
24
|
onOpenChange?: (open: boolean) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare const Sidebar:
|
|
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
|
-
}
|
|
31
|
-
Content:
|
|
32
|
-
Footer:
|
|
33
|
-
Group:
|
|
34
|
-
GroupAction:
|
|
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
|
-
}
|
|
37
|
-
GroupContent:
|
|
38
|
-
GroupLabel:
|
|
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
|
-
}
|
|
41
|
-
Header:
|
|
42
|
-
Input:
|
|
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?:
|
|
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>, "
|
|
55
|
-
Inset:
|
|
56
|
-
Menu:
|
|
57
|
-
MenuAction:
|
|
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
|
-
}
|
|
61
|
-
MenuBadge:
|
|
62
|
-
MenuButton:
|
|
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
|
|
70
|
-
MenuItem:
|
|
71
|
-
MenuSkeleton:
|
|
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
|
-
}
|
|
74
|
-
MenuSub:
|
|
75
|
-
MenuSubButton:
|
|
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
|
-
}
|
|
80
|
-
MenuSubItem:
|
|
81
|
-
Rail:
|
|
82
|
-
Separator:
|
|
83
|
-
Trigger:
|
|
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
|
-
}
|
|
91
|
+
}>;
|
|
92
92
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
-
import type { ComponentProps,
|
|
3
|
-
export type SwitchProps =
|
|
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:
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
};
|
package/src/helpers/index.d.ts
CHANGED
|
@@ -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;
|