tw-react-components 0.0.164 → 0.0.166
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/README.md +173 -1
- package/index.esm.js +292 -255
- package/package.json +1 -1
- package/src/components/Badge/index.d.ts +1 -0
- package/src/components/Block/index.d.ts +1 -0
- package/src/components/Button/index.d.ts +1 -0
- package/src/components/Collapsible/index.d.ts +14 -3
- package/src/components/DataTable/index.d.ts +2 -1
- package/src/components/Dialog/ConfirmDialog.d.ts +1 -0
- package/src/components/Dialog/Dialog.d.ts +27 -9
- package/src/components/Dialog/FormDialog.d.ts +2 -1
- package/src/components/Dialog/ListSorterDialog.d.ts +2 -1
- package/src/components/Dialog/PdfViewerDialog.d.ts +1 -0
- package/src/components/DropdownMenu/index.d.ts +62 -29
- package/src/components/Form/controls/Label.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/DateSelector.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/DaysView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/MonthsView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/TimeSelector.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/YearsView.d.ts +1 -0
- package/src/components/Form/controls/custom/date-time/index.d.ts +1 -1
- package/src/components/Form/controls/custom/file.d.ts +1 -1
- package/src/components/Form/controls/custom/select/index.d.ts +2 -2
- package/src/components/Form/controls/primitive/BasicInput.d.ts +3 -1
- package/src/components/Hint/index.d.ts +7 -3
- package/src/components/Layout/index.d.ts +8 -9
- package/src/components/List/index.d.ts +34 -20
- package/src/components/ListSorter/index.d.ts +2 -1
- package/src/components/Navbar/index.d.ts +1 -0
- package/src/components/Pagination/index.d.ts +1 -0
- package/src/components/Popover/index.d.ts +4 -1
- package/src/components/Separator/index.d.ts +4 -1
- package/src/components/Sheet/index.d.ts +21 -5
- package/src/components/Sidebar/index.d.ts +107 -63
- package/src/components/Skeleton/index.d.ts +4 -1
- package/src/components/Spinner/index.d.ts +1 -0
- package/src/components/Switch/index.d.ts +2 -2
- package/src/components/Table/index.d.ts +30 -8
- package/src/components/Tabs/index.d.ts +18 -5
- package/src/components/ThemeSelector/index.d.ts +1 -0
- package/src/components/Tooltip/index.d.ts +1 -0
- package/src/helpers/getDisplayDate.d.ts +6 -1
- package/src/helpers/getValueFromCookie.d.ts +1 -1
- package/src/test-setup.d.ts +1 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { ComponentProps, FC } from 'react';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import { BasicInput } from '../Form';
|
|
5
|
+
import { Separator } from '../Separator';
|
|
3
6
|
import { Tooltip } from '../Tooltip';
|
|
4
7
|
export declare const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
5
8
|
export declare const SIDEBAR_COOKIE_MAX_AGE: number;
|
|
@@ -18,75 +21,116 @@ export type SidebarContext = {
|
|
|
18
21
|
};
|
|
19
22
|
export declare const SidebarContext: import("react").Context<SidebarContext | null>;
|
|
20
23
|
export declare function useSidebar(): SidebarContext;
|
|
21
|
-
export
|
|
24
|
+
export type SidebarContextProviderProps = ComponentProps<'div'> & {
|
|
22
25
|
defaultOpen?: boolean;
|
|
23
26
|
open?: boolean;
|
|
24
27
|
onOpenChange?: (open: boolean) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
28
|
+
};
|
|
29
|
+
export declare const SidebarContextProvider: FC<SidebarContextProviderProps>;
|
|
30
|
+
export type SidebarProps = ComponentProps<'div'> & {
|
|
31
|
+
side?: 'left' | 'right';
|
|
32
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
33
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
34
|
+
dataTestId?: string;
|
|
35
|
+
};
|
|
36
|
+
export type SidebarTriggerProps = ComponentProps<typeof Button> & {
|
|
37
|
+
dataTestId?: string;
|
|
38
|
+
};
|
|
39
|
+
export type SidebarRailProps = ComponentProps<'button'> & {
|
|
40
|
+
dataTestId?: string;
|
|
41
|
+
};
|
|
42
|
+
export type SidebarInsetProps = ComponentProps<'main'> & {
|
|
43
|
+
dataTestId?: string;
|
|
44
|
+
};
|
|
45
|
+
export type SidebarInputProps = ComponentProps<typeof BasicInput> & {
|
|
46
|
+
dataTestId?: string;
|
|
47
|
+
};
|
|
48
|
+
export type SidebarHeaderProps = ComponentProps<'div'> & {
|
|
49
|
+
dataTestId?: string;
|
|
50
|
+
};
|
|
51
|
+
export type SidebarFooterProps = ComponentProps<'div'> & {
|
|
52
|
+
dataTestId?: string;
|
|
53
|
+
};
|
|
54
|
+
export type SidebarSeparatorProps = ComponentProps<typeof Separator> & {
|
|
55
|
+
dataTestId?: string;
|
|
56
|
+
};
|
|
57
|
+
export type SidebarContentProps = ComponentProps<'div'> & {
|
|
58
|
+
dataTestId?: string;
|
|
59
|
+
};
|
|
60
|
+
export type SidebarGroupProps = ComponentProps<'div'> & {
|
|
61
|
+
dataTestId?: string;
|
|
62
|
+
};
|
|
63
|
+
export type SidebarGroupLabelProps = ComponentProps<'div'> & {
|
|
64
|
+
asChild?: boolean;
|
|
65
|
+
dataTestId?: string;
|
|
66
|
+
};
|
|
67
|
+
export type SidebarGroupActionProps = ComponentProps<'button'> & {
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
dataTestId?: string;
|
|
70
|
+
};
|
|
71
|
+
export type SidebarGroupContentProps = ComponentProps<'div'> & {
|
|
72
|
+
dataTestId?: string;
|
|
73
|
+
};
|
|
74
|
+
export type SidebarMenuProps = ComponentProps<'ul'> & {
|
|
75
|
+
dataTestId?: string;
|
|
76
|
+
};
|
|
77
|
+
export type SidebarMenuItemProps = ComponentProps<'li'> & {
|
|
78
|
+
dataTestId?: string;
|
|
79
|
+
};
|
|
80
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
81
|
+
variant?: "default" | "outline" | null | undefined;
|
|
82
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
83
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
84
|
+
export type SidebarMenuButtonProps = ComponentProps<'button'> & {
|
|
85
|
+
asChild?: boolean;
|
|
86
|
+
isActive?: boolean;
|
|
87
|
+
tooltip?: string | ComponentProps<typeof Tooltip>;
|
|
88
|
+
dataTestId?: string;
|
|
89
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>;
|
|
90
|
+
export type SidebarMenuActionProps = ComponentProps<'button'> & {
|
|
91
|
+
asChild?: boolean;
|
|
92
|
+
showOnHover?: boolean;
|
|
93
|
+
dataTestId?: string;
|
|
94
|
+
};
|
|
95
|
+
export type SidebarMenuBadgeProps = ComponentProps<'div'> & {
|
|
96
|
+
dataTestId?: string;
|
|
97
|
+
};
|
|
98
|
+
export type SidebarMenuSkeletonProps = ComponentProps<'div'> & {
|
|
99
|
+
showIcon?: boolean;
|
|
100
|
+
dataTestId?: string;
|
|
101
|
+
};
|
|
102
|
+
export type SidebarMenuSubProps = ComponentProps<'ul'> & {
|
|
103
|
+
dataTestId?: string;
|
|
104
|
+
};
|
|
105
|
+
export type SidebarMenuSubItemProps = ComponentProps<'li'> & {
|
|
106
|
+
dataTestId?: string;
|
|
107
|
+
};
|
|
108
|
+
export declare const Sidebar: FC<SidebarProps> & {
|
|
109
|
+
Content: FC<SidebarContentProps>;
|
|
110
|
+
Footer: FC<SidebarFooterProps>;
|
|
111
|
+
Group: FC<SidebarGroupProps>;
|
|
112
|
+
GroupAction: FC<SidebarGroupActionProps>;
|
|
113
|
+
GroupContent: FC<SidebarGroupContentProps>;
|
|
114
|
+
GroupLabel: FC<SidebarGroupLabelProps>;
|
|
115
|
+
Header: FC<SidebarHeaderProps>;
|
|
116
|
+
Input: FC<SidebarInputProps>;
|
|
117
|
+
Inset: FC<SidebarInsetProps>;
|
|
118
|
+
Menu: FC<SidebarMenuProps>;
|
|
119
|
+
MenuAction: FC<SidebarMenuActionProps>;
|
|
120
|
+
MenuBadge: FC<SidebarMenuBadgeProps>;
|
|
121
|
+
MenuButton: FC<SidebarMenuButtonProps>;
|
|
122
|
+
MenuItem: FC<SidebarMenuItemProps>;
|
|
123
|
+
MenuSkeleton: FC<SidebarMenuSkeletonProps>;
|
|
124
|
+
MenuSub: FC<SidebarMenuSubProps>;
|
|
75
125
|
MenuSubButton: FC<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
76
126
|
asChild?: boolean;
|
|
77
127
|
size?: "sm" | "md";
|
|
78
128
|
isActive?: boolean;
|
|
129
|
+
dataTestId?: string;
|
|
79
130
|
}>;
|
|
80
|
-
MenuSubItem: FC<
|
|
81
|
-
Rail: FC<
|
|
82
|
-
Separator: FC<
|
|
83
|
-
Trigger: FC<
|
|
84
|
-
size?: import("..").Size;
|
|
85
|
-
color?: import("..").Color;
|
|
86
|
-
variant?: import("../Button").ButtonVariant;
|
|
87
|
-
rounded?: boolean;
|
|
88
|
-
prefixIcon?: import("lucide-react").LucideIcon;
|
|
89
|
-
suffixIcon?: import("lucide-react").LucideIcon;
|
|
90
|
-
unstyled?: boolean;
|
|
91
|
-
}>;
|
|
131
|
+
MenuSubItem: FC<SidebarMenuSubItemProps>;
|
|
132
|
+
Rail: FC<SidebarRailProps>;
|
|
133
|
+
Separator: FC<SidebarSeparatorProps>;
|
|
134
|
+
Trigger: FC<SidebarTriggerProps>;
|
|
92
135
|
};
|
|
136
|
+
export {};
|
|
@@ -2,6 +2,6 @@ import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
|
2
2
|
import type { ComponentProps, FC } from 'react';
|
|
3
3
|
export type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root> & {
|
|
4
4
|
thumbProps?: ComponentProps<typeof SwitchPrimitives.Thumb>;
|
|
5
|
+
dataTestId?: string;
|
|
5
6
|
};
|
|
6
|
-
declare const Switch: FC<SwitchProps>;
|
|
7
|
-
export { Switch };
|
|
7
|
+
export declare const Switch: FC<SwitchProps>;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
HeadCell: FC<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>>;
|
|
5
|
-
Body: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
6
|
-
Row: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>>;
|
|
7
|
-
Cell: FC<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>>;
|
|
8
|
-
Footer: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>>;
|
|
1
|
+
import type { ComponentProps, FC } from 'react';
|
|
2
|
+
type TableProps = ComponentProps<'table'> & {
|
|
3
|
+
dataTestId?: string;
|
|
9
4
|
};
|
|
5
|
+
type TableHeadProps = ComponentProps<'thead'> & {
|
|
6
|
+
dataTestId?: string;
|
|
7
|
+
};
|
|
8
|
+
type TableHeadCellProps = ComponentProps<'th'> & {
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
};
|
|
11
|
+
type TableBodyProps = ComponentProps<'tbody'> & {
|
|
12
|
+
dataTestId?: string;
|
|
13
|
+
};
|
|
14
|
+
type TableRowProps = ComponentProps<'tr'> & {
|
|
15
|
+
dataTestId?: string;
|
|
16
|
+
};
|
|
17
|
+
type TableCellProps = ComponentProps<'td'> & {
|
|
18
|
+
dataTestId?: string;
|
|
19
|
+
};
|
|
20
|
+
type TableFooterProps = ComponentProps<'tfoot'> & {
|
|
21
|
+
dataTestId?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const Table: FC<TableProps> & {
|
|
24
|
+
Head: FC<TableHeadProps>;
|
|
25
|
+
HeadCell: FC<TableHeadCellProps>;
|
|
26
|
+
Body: FC<TableBodyProps>;
|
|
27
|
+
Row: FC<TableRowProps>;
|
|
28
|
+
Cell: FC<TableCellProps>;
|
|
29
|
+
Footer: FC<TableFooterProps>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Trigger: FC<TabsPrimitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
Content: import("react").ForwardRefExoticComponent<TabsPrimitive.TabsContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2
|
+
import type { ComponentProps, FC } from 'react';
|
|
3
|
+
type TabsProps = ComponentProps<typeof TabsPrimitive.Root> & {
|
|
4
|
+
dataTestId?: string;
|
|
7
5
|
};
|
|
6
|
+
type TabsListProps = ComponentProps<typeof TabsPrimitive.List> & {
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
};
|
|
9
|
+
type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
type TabsContentProps = ComponentProps<typeof TabsPrimitive.Content> & {
|
|
13
|
+
dataTestId?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const Tabs: FC<TabsProps> & {
|
|
16
|
+
List: FC<TabsListProps>;
|
|
17
|
+
Trigger: FC<TabsTriggerProps>;
|
|
18
|
+
Content: FC<TabsContentProps>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import 'dayjs/locale/en';
|
|
2
|
+
export declare function getDisplayDate(date: Date, { format, locale, offset, }: {
|
|
3
|
+
format?: string;
|
|
4
|
+
locale?: string;
|
|
5
|
+
offset?: number;
|
|
6
|
+
}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getValueFromCookie<T extends string | boolean>(key: string, _default: T): T;
|
|
1
|
+
export declare function getValueFromCookie<T extends string | number | boolean>(key: string, _default: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|