tw-react-components 0.0.164 → 0.0.167
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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tw-react-components",
|
|
3
3
|
"description": "A set of React components build with TailwindCSS to make a nice dashboard.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.167",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://bacali95.github.io/tw-react-components",
|
|
7
7
|
"type": "module",
|
|
@@ -3,5 +3,6 @@ import type { ButtonProps, ButtonVariant } from '../Button';
|
|
|
3
3
|
export type BadgeVariant = Exclude<ButtonVariant, 'text'>;
|
|
4
4
|
export type BadgeProps = Omit<ButtonProps, 'variant'> & {
|
|
5
5
|
variant?: BadgeVariant;
|
|
6
|
+
dataTestId?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const Badge: FC<BadgeProps>;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { ComponentProps, FC } from 'react';
|
|
3
|
+
type CollapsibleRootProps = ComponentProps<typeof CollapsiblePrimitive.Root> & {
|
|
4
|
+
dataTestId?: string;
|
|
5
5
|
};
|
|
6
|
+
type CollapsibleTriggerProps = ComponentProps<typeof CollapsiblePrimitive.Trigger> & {
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
};
|
|
9
|
+
type CollapsibleContentProps = ComponentProps<typeof CollapsiblePrimitive.Content> & {
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Collapsible: FC<CollapsibleRootProps> & {
|
|
13
|
+
Trigger: FC<CollapsibleTriggerProps>;
|
|
14
|
+
Content: FC<CollapsibleContentProps>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -63,6 +63,7 @@ export type DataTableProps<T> = {
|
|
|
63
63
|
noDataMessage?: ReactNode;
|
|
64
64
|
onRowClick?: DataTableAction<T>['onClick'];
|
|
65
65
|
rowClassName?: (item: T, rowIndex: number) => string | undefined;
|
|
66
|
+
dataTestId?: string;
|
|
66
67
|
};
|
|
67
|
-
export declare function DataTable<T>({ className, columns, rows, sorting, pagination, actions, isLoading, rowExtraContent, noDataMessage, onRowClick, rowClassName, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare function DataTable<T>({ className, columns, rows, sorting, pagination, actions, isLoading, rowExtraContent, noDataMessage, onRowClick, rowClassName, dataTestId, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
68
69
|
export {};
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
-
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import type { ComponentProps, FC, HTMLAttributes } from 'react';
|
|
3
|
+
type DialogOverlayProps = ComponentProps<typeof DialogPrimitive.Overlay> & {
|
|
4
|
+
dataTestId?: string;
|
|
5
|
+
};
|
|
6
|
+
type DialogContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
|
|
7
|
+
fullScreen?: boolean;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
};
|
|
10
|
+
type DialogHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
};
|
|
13
|
+
type DialogFooterProps = HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
dataTestId?: string;
|
|
15
|
+
};
|
|
16
|
+
type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title> & {
|
|
17
|
+
dataTestId?: string;
|
|
18
|
+
};
|
|
19
|
+
type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description> & {
|
|
20
|
+
dataTestId?: string;
|
|
21
|
+
};
|
|
3
22
|
export declare const Dialog: FC<DialogPrimitive.DialogProps> & {
|
|
4
23
|
Portal: FC<DialogPrimitive.DialogPortalProps>;
|
|
5
|
-
Overlay: FC<
|
|
24
|
+
Overlay: FC<DialogOverlayProps>;
|
|
6
25
|
Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
26
|
Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
Content: FC<
|
|
9
|
-
fullScreen?: boolean;
|
|
10
|
-
}>;
|
|
27
|
+
Content: FC<DialogContentProps>;
|
|
11
28
|
Header: {
|
|
12
|
-
({ className, ...props }:
|
|
29
|
+
({ className, dataTestId, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
30
|
displayName: string;
|
|
14
31
|
};
|
|
15
32
|
Footer: {
|
|
16
|
-
({ className, ...props }:
|
|
33
|
+
({ className, dataTestId, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
17
34
|
displayName: string;
|
|
18
35
|
};
|
|
19
|
-
Title: FC<
|
|
20
|
-
Description: FC<
|
|
36
|
+
Title: FC<DialogTitleProps>;
|
|
37
|
+
Description: FC<DialogDescriptionProps>;
|
|
21
38
|
};
|
|
39
|
+
export {};
|
|
@@ -15,6 +15,7 @@ type Props<T extends FieldValues> = {
|
|
|
15
15
|
onSubmit: SubmitHandler<T>;
|
|
16
16
|
onInvalid?: SubmitErrorHandler<T>;
|
|
17
17
|
onClose: () => void;
|
|
18
|
+
dataTestId?: string;
|
|
18
19
|
};
|
|
19
|
-
export declare const FormDialog: <T extends FieldValues>({ className, formClassName, open, title, form, children, submitLabel, cancelLabel, extraAction, as: As, onSubmit, onInvalid, onClose, }: PropsWithChildren<Props<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const FormDialog: <T extends FieldValues>({ className, formClassName, open, title, form, children, submitLabel, cancelLabel, extraAction, as: As, onSubmit, onInvalid, onClose, dataTestId, }: PropsWithChildren<Props<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -4,9 +4,10 @@ export type ListSorterDialogProps<T extends ListSorterItem> = {
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
title: string;
|
|
6
6
|
onClose: () => void;
|
|
7
|
+
dataTestId?: string;
|
|
7
8
|
} & Omit<ListSorterProps<T>, 'onChange'> & {
|
|
8
9
|
cancelLabel?: string;
|
|
9
10
|
submitLabel?: string;
|
|
10
11
|
onSubmit: (items: T[]) => void;
|
|
11
12
|
};
|
|
12
|
-
export declare function ListSorterDialog<T extends ListSorterItem>({ className, open, title, items, idResolver, renderer, cancelLabel, submitLabel, onSubmit, onClose, }: ListSorterDialogProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ListSorterDialog<T extends ListSorterItem>({ className, open, title, items, idResolver, renderer, cancelLabel, submitLabel, onSubmit, onClose, dataTestId, }: ListSorterDialogProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,65 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
-
import type { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import type { ComponentProps, FC, HTMLAttributes } from 'react';
|
|
3
|
+
type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger> & {
|
|
4
|
+
dataTestId?: string;
|
|
5
|
+
};
|
|
6
|
+
type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenuPrimitive.Group> & {
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
};
|
|
9
|
+
type DropdownMenuPortalProps = ComponentProps<typeof DropdownMenuPrimitive.Portal> & {
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
type DropdownMenuSubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub> & {
|
|
13
|
+
dataTestId?: string;
|
|
14
|
+
};
|
|
15
|
+
type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenuPrimitive.RadioGroup> & {
|
|
16
|
+
dataTestId?: string;
|
|
17
|
+
};
|
|
18
|
+
type DropdownMenuSubTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
dataTestId?: string;
|
|
21
|
+
};
|
|
22
|
+
type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenuPrimitive.SubContent> & {
|
|
23
|
+
dataTestId?: string;
|
|
24
|
+
};
|
|
25
|
+
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content> & {
|
|
26
|
+
dataTestId?: string;
|
|
27
|
+
};
|
|
28
|
+
type DropdownMenuItemProps = ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
29
|
+
inset?: boolean;
|
|
30
|
+
dataTestId?: string;
|
|
31
|
+
};
|
|
32
|
+
type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
33
|
+
dataTestId?: string;
|
|
34
|
+
};
|
|
35
|
+
type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
36
|
+
dataTestId?: string;
|
|
37
|
+
};
|
|
38
|
+
type DropdownMenuLabelProps = ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
39
|
+
inset?: boolean;
|
|
40
|
+
dataTestId?: string;
|
|
41
|
+
};
|
|
42
|
+
type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator> & {
|
|
43
|
+
dataTestId?: string;
|
|
44
|
+
};
|
|
45
|
+
type DropdownMenuShortcutProps = HTMLAttributes<HTMLSpanElement> & {
|
|
46
|
+
dataTestId?: string;
|
|
47
|
+
};
|
|
3
48
|
export declare const DropdownMenu: FC<DropdownMenuPrimitive.DropdownMenuProps> & {
|
|
4
|
-
Trigger:
|
|
5
|
-
Content: FC<
|
|
6
|
-
Item: FC<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}>;
|
|
20
|
-
Shortcut: {
|
|
21
|
-
({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
24
|
-
Group: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
-
Portal: FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
26
|
-
Sub: FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
27
|
-
SubContent: FC<DropdownMenuPrimitive.DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
-
SubTrigger: FC<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
29
|
-
inset?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
RadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
Trigger: FC<DropdownMenuTriggerProps>;
|
|
50
|
+
Content: FC<DropdownMenuContentProps>;
|
|
51
|
+
Item: FC<DropdownMenuItemProps>;
|
|
52
|
+
CheckboxItem: FC<DropdownMenuCheckboxItemProps>;
|
|
53
|
+
RadioItem: FC<DropdownMenuRadioItemProps>;
|
|
54
|
+
Label: FC<DropdownMenuLabelProps>;
|
|
55
|
+
Separator: FC<DropdownMenuSeparatorProps>;
|
|
56
|
+
Icon: FC<import("../List").ListIconProps>;
|
|
57
|
+
Shortcut: FC<DropdownMenuShortcutProps>;
|
|
58
|
+
Group: FC<DropdownMenuGroupProps>;
|
|
59
|
+
Portal: FC<DropdownMenuPortalProps>;
|
|
60
|
+
Sub: FC<DropdownMenuSubProps>;
|
|
61
|
+
SubContent: FC<DropdownMenuSubContentProps>;
|
|
62
|
+
SubTrigger: FC<DropdownMenuSubTriggerProps>;
|
|
63
|
+
RadioGroup: FC<DropdownMenuRadioGroupProps>;
|
|
32
64
|
};
|
|
65
|
+
export {};
|
|
@@ -13,5 +13,5 @@ export type DateTimeInputProps = {
|
|
|
13
13
|
displayLocale?: string;
|
|
14
14
|
ref?: Ref<HTMLDivElement>;
|
|
15
15
|
onChange?: (date?: Date | null) => void;
|
|
16
|
-
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'label' | 'name' | 'description' | 'placeholder' | 'required' | 'disabled' | 'onBlur' | 'size' | 'readOnly'>;
|
|
16
|
+
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'label' | 'name' | 'description' | 'placeholder' | 'required' | 'disabled' | 'onBlur' | 'size' | 'readOnly' | 'dataTestId'>;
|
|
17
17
|
export declare const DateTimeInput: FC<DateTimeInputProps>;
|
|
@@ -4,5 +4,5 @@ export type FileInputProps = {
|
|
|
4
4
|
value?: string | null;
|
|
5
5
|
onChange?: (item?: string) => void;
|
|
6
6
|
onFileChange?: (file?: File) => void;
|
|
7
|
-
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'placeholder' | 'description' | 'size' | 'accept' | 'required' | 'hasErrors' | 'disabled'>;
|
|
7
|
+
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'placeholder' | 'description' | 'size' | 'accept' | 'required' | 'hasErrors' | 'disabled' | 'dataTestId'>;
|
|
8
8
|
export declare const FileInput: FC<FileInputProps>;
|
|
@@ -30,5 +30,5 @@ export type SelectInputProps<T = any> = {
|
|
|
30
30
|
multiple: true;
|
|
31
31
|
value: T[];
|
|
32
32
|
onChange?: (item?: T[]) => void;
|
|
33
|
-
}) & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'description' | 'size' | 'placeholder' | 'required' | 'hasErrors' | 'disabled' | 'readOnly' | 'ref'>;
|
|
34
|
-
export declare const SelectInput: <T>({ className, items, renderItem, value, multiple, clearable, allowAddition, onNewItemAdded, search, searchPredicate, selectPredicate, onChange, readOnly, parentRef, ...props }: SelectInputProps<T>) => JSX.Element;
|
|
33
|
+
}) & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'description' | 'size' | 'placeholder' | 'required' | 'hasErrors' | 'disabled' | 'readOnly' | 'ref' | 'dataTestId'>;
|
|
34
|
+
export declare const SelectInput: <T>({ className, items, renderItem, value, multiple, clearable, allowAddition, onNewItemAdded, search, searchPredicate, selectPredicate, onChange, readOnly, parentRef, dataTestId, ...props }: SelectInputProps<T>) => JSX.Element;
|
|
@@ -13,12 +13,14 @@ export type BasicInputProps<Type extends InputType> = {
|
|
|
13
13
|
suffixIcon?: FC<ComponentProps<'svg'>>;
|
|
14
14
|
onClear?: () => void;
|
|
15
15
|
onSuffixIconClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
16
|
+
dataTestId?: string;
|
|
16
17
|
} & Omit<Type extends 'textarea' ? ComponentProps<'textarea'> : ComponentProps<'input'>, 'id' | 'size'>;
|
|
17
|
-
export declare const BasicInput: <Type extends InputType>({ className, inputClassName, extensionClassName, type, label, description, size, hasErrors, clearable, suffixIcon: SuffixIcon, onClear, onSuffixIconClick, ...props }: BasicInputProps<Type>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const BasicInput: <Type extends InputType>({ className, inputClassName, extensionClassName, type, label, description, size, hasErrors, clearable, suffixIcon: SuffixIcon, onClear, onSuffixIconClick, dataTestId, ...props }: BasicInputProps<Type>) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export declare const BasicInputExtension: FC<PropsWithChildren<{
|
|
19
20
|
className?: string;
|
|
20
21
|
size: Size;
|
|
21
22
|
hasErrors?: boolean;
|
|
22
23
|
disabled?: boolean;
|
|
24
|
+
dataTestId?: string;
|
|
23
25
|
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
24
26
|
}>>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { FC, PropsWithChildren, Ref } from 'react';
|
|
2
2
|
import type { BadgeProps, BadgeVariant } from '../Badge';
|
|
3
3
|
import type { Color, Size } from '../types';
|
|
4
|
+
export type HintRootProps = PropsWithChildren<{
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
dataTestId?: string;
|
|
7
|
+
}>;
|
|
4
8
|
export type HintPlacement = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
5
9
|
export type HintVariant = BadgeVariant;
|
|
6
10
|
export type HintDotProps = {
|
|
@@ -9,13 +13,13 @@ export type HintDotProps = {
|
|
|
9
13
|
color?: Color;
|
|
10
14
|
ping?: boolean;
|
|
11
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
|
+
dataTestId?: string;
|
|
12
17
|
};
|
|
13
18
|
export type HintBadgeProps = BadgeProps & {
|
|
14
19
|
placement?: HintPlacement;
|
|
20
|
+
dataTestId?: string;
|
|
15
21
|
};
|
|
16
|
-
export declare const Hint: FC<
|
|
17
|
-
ref?: Ref<HTMLDivElement>;
|
|
18
|
-
}>> & {
|
|
22
|
+
export declare const Hint: FC<HintRootProps> & {
|
|
19
23
|
Dot: FC<HintDotProps>;
|
|
20
24
|
Badge: FC<HintBadgeProps>;
|
|
21
25
|
};
|
|
@@ -3,33 +3,32 @@ import type { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react';
|
|
|
3
3
|
import type { NavLinkProps, useLocation } from 'react-router';
|
|
4
4
|
import type { NavbarProps } from '../Navbar';
|
|
5
5
|
import { Sidebar } from '../Sidebar';
|
|
6
|
-
export type
|
|
6
|
+
export type LayoutSidebarItem = {
|
|
7
7
|
pathname: string;
|
|
8
8
|
title: string;
|
|
9
9
|
Icon?: LucideIcon;
|
|
10
10
|
hidden?: boolean;
|
|
11
|
-
items?:
|
|
11
|
+
items?: LayoutSidebarItem[];
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type LayoutSidebarProps = ComponentProps<typeof Sidebar> & {
|
|
14
14
|
basePath?: string;
|
|
15
15
|
header?: ReactNode;
|
|
16
16
|
items: (({
|
|
17
17
|
type: 'item';
|
|
18
|
-
} &
|
|
18
|
+
} & LayoutSidebarItem) | {
|
|
19
19
|
type: 'group';
|
|
20
20
|
title?: string;
|
|
21
21
|
hidden?: boolean;
|
|
22
|
-
items:
|
|
22
|
+
items: LayoutSidebarItem[];
|
|
23
23
|
})[];
|
|
24
24
|
extraContent?: ReactNode;
|
|
25
25
|
footer?: ReactNode;
|
|
26
26
|
};
|
|
27
|
-
type
|
|
27
|
+
export type LayoutProps = {
|
|
28
28
|
className?: string;
|
|
29
|
-
sidebarProps:
|
|
29
|
+
sidebarProps: LayoutSidebarProps;
|
|
30
30
|
navbarProps?: NavbarProps;
|
|
31
31
|
NavLink: FC<NavLinkProps>;
|
|
32
32
|
useLocation: typeof useLocation;
|
|
33
33
|
};
|
|
34
|
-
export declare const Layout: FC<PropsWithChildren<
|
|
35
|
-
export {};
|
|
34
|
+
export declare const Layout: FC<PropsWithChildren<LayoutProps>>;
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import type { LucideIcon } from 'lucide-react';
|
|
2
|
-
import type { FC, Ref } from 'react';
|
|
2
|
+
import type { ComponentProps, FC, Ref } from 'react';
|
|
3
3
|
import type { Size } from '../types';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
export type ListContentProps = ComponentProps<'div'> & {
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ListItemProps = ComponentProps<'div'> & {
|
|
8
|
+
size?: Size;
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ListLabelProps = ComponentProps<'div'> & {
|
|
13
|
+
size?: Size;
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
dataTestId?: string;
|
|
16
|
+
};
|
|
17
|
+
export type ListIndicatorProps = ComponentProps<'div'> & {
|
|
18
|
+
icon: LucideIcon;
|
|
19
|
+
iconClassName: string;
|
|
20
|
+
dataTestId?: string;
|
|
21
|
+
};
|
|
22
|
+
export type ListIconProps = {
|
|
23
|
+
className?: string;
|
|
24
|
+
icon: LucideIcon;
|
|
25
|
+
ref?: Ref<SVGSVGElement>;
|
|
26
|
+
dataTestId?: string;
|
|
27
|
+
};
|
|
28
|
+
export type ListSeparatorProps = ComponentProps<'div'> & {
|
|
29
|
+
dataTestId?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const List: FC<ListContentProps> & {
|
|
32
|
+
Item: FC<ListItemProps>;
|
|
33
|
+
Label: FC<ListLabelProps>;
|
|
34
|
+
Indicator: FC<ListIndicatorProps>;
|
|
35
|
+
Icon: FC<ListIconProps>;
|
|
36
|
+
Separator: FC<ListSeparatorProps>;
|
|
23
37
|
};
|
|
@@ -4,8 +4,9 @@ export type ListSorterItem = number | string | boolean | Record<'rank', number>;
|
|
|
4
4
|
export type ListSorterProps<T extends ListSorterItem> = {
|
|
5
5
|
className?: string;
|
|
6
6
|
items: T[];
|
|
7
|
+
dataTestId?: string;
|
|
7
8
|
idResolver: (item: T, index: number) => string;
|
|
8
9
|
renderer: (item: T, index: number, listeners?: SyntheticListenerMap) => ReactNode;
|
|
9
10
|
onChange: (items: T[]) => void;
|
|
10
11
|
};
|
|
11
|
-
export declare function ListSorter<T extends ListSorterItem>({ className, items, idResolver, renderer, onChange, }: ListSorterProps<T>): ReactElement;
|
|
12
|
+
export declare function ListSorter<T extends ListSorterItem>({ className, items, dataTestId, idResolver, renderer, onChange, }: ListSorterProps<T>): ReactElement;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
export declare const Popover: FC<PopoverPrimitive.PopoverProps> & {
|
|
4
|
-
Trigger:
|
|
4
|
+
Trigger: FC<PopoverPrimitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
}>;
|
|
5
7
|
Content: FC<PopoverPrimitive.PopoverContentProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
6
8
|
container?: HTMLElement | null;
|
|
9
|
+
dataTestId?: string;
|
|
7
10
|
}>;
|
|
8
11
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
2
|
import type { ComponentProps, FC } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type SeparatorProps = ComponentProps<typeof SeparatorPrimitive.Root> & {
|
|
4
|
+
dataTestId?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const Separator: FC<SeparatorProps>;
|
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import type { ComponentProps, FC, HTMLAttributes } from 'react';
|
|
4
|
+
type SheetOverlayProps = ComponentProps<typeof SheetPrimitive.Overlay> & {
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
};
|
|
4
7
|
declare const sheetVariants: (props?: ({
|
|
5
8
|
side?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
6
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
10
|
interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
11
|
+
dataTestId?: string;
|
|
8
12
|
}
|
|
13
|
+
type SheetHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
dataTestId?: string;
|
|
15
|
+
};
|
|
16
|
+
type SheetFooterProps = HTMLAttributes<HTMLDivElement> & {
|
|
17
|
+
dataTestId?: string;
|
|
18
|
+
};
|
|
19
|
+
type SheetTitleProps = ComponentProps<typeof SheetPrimitive.Title> & {
|
|
20
|
+
dataTestId?: string;
|
|
21
|
+
};
|
|
22
|
+
type SheetDescriptionProps = ComponentProps<typeof SheetPrimitive.Description> & {
|
|
23
|
+
dataTestId?: string;
|
|
24
|
+
};
|
|
9
25
|
export declare const Sheet: FC<SheetPrimitive.DialogProps> & {
|
|
10
26
|
Portal: FC<SheetPrimitive.DialogPortalProps>;
|
|
11
|
-
Overlay: FC<
|
|
27
|
+
Overlay: FC<SheetOverlayProps>;
|
|
12
28
|
Trigger: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
29
|
Close: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
30
|
Content: FC<SheetContentProps>;
|
|
15
31
|
Header: {
|
|
16
|
-
({ className, ...props }:
|
|
32
|
+
({ className, dataTestId, ...props }: SheetHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
33
|
displayName: string;
|
|
18
34
|
};
|
|
19
35
|
Footer: {
|
|
20
|
-
({ className, ...props }:
|
|
36
|
+
({ className, dataTestId, ...props }: SheetFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
21
37
|
displayName: string;
|
|
22
38
|
};
|
|
23
|
-
Title: FC<
|
|
24
|
-
Description: FC<
|
|
39
|
+
Title: FC<SheetTitleProps>;
|
|
40
|
+
Description: FC<SheetDescriptionProps>;
|
|
25
41
|
};
|
|
26
42
|
export {};
|