@npm-questionpro/wick-ui-lib 0.5.0 → 0.8.0
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/src/base/ui/command.d.ts +80 -0
- package/dist/src/base/ui/dialog.d.ts +16 -15
- package/dist/src/components/appHeader/WuAppHeader.d.ts +4 -0
- package/dist/src/components/appHeader/ui/WuAppHeaderMenu.d.ts +4 -0
- package/dist/src/components/calendar/components/datePicker/WuDatePicker.d.ts +5 -1
- package/dist/src/components/calendar/components/dateRangePicker/WuDateRangePicker.d.ts +6 -1
- package/dist/src/components/calendar/ui/_footer.d.ts +2 -0
- package/dist/src/components/calendar/ui/_sidebar.d.ts +3 -2
- package/dist/src/components/calendar/ui/_trigger.d.ts +1 -0
- package/dist/src/components/combobox/WuCombobox.d.ts +21 -0
- package/dist/src/components/combobox/WuCombobox.test.d.ts +1 -0
- package/dist/src/components/combobox/index.d.ts +3 -0
- package/dist/src/components/combobox/types/IWuComboboxOptions.d.ts +17 -0
- package/dist/src/components/combobox/ui/_item.d.ts +15 -0
- package/dist/src/components/combobox/ui/_tags.d.ts +6 -0
- package/dist/src/components/combobox/ui/_trigger.d.ts +15 -0
- package/dist/src/components/combobox/utils/index.d.ts +2 -0
- package/dist/src/components/combobox/utils/renderItems.d.ts +9 -0
- package/dist/src/components/combobox/utils/separateOptions.d.ts +7 -0
- package/dist/src/components/combobox/utils/useResizeContent.d.ts +3 -0
- package/dist/src/components/modal/WuModal.d.ts +28 -18
- package/dist/src/components/navbar/primaryNavbar/WuPrimaryNavbar.d.ts +1 -0
- package/dist/src/components/navbar/secondaryNavbar/WuSecondaryNavbar.d.ts +1 -0
- package/dist/src/components/select/WuSelect.d.ts +19 -12
- package/dist/src/components/select/types/IWuSelectOptions.d.ts +6 -8
- package/dist/src/components/select/ui/_item.d.ts +15 -0
- package/dist/src/components/select/ui/_trigger.d.ts +15 -0
- package/dist/src/components/select/utils/renderItems.d.ts +8 -0
- package/dist/src/components/select/utils/useOptionDestructure.d.ts +3 -0
- package/dist/src/components/select/utils/useResizeContent.d.ts +3 -0
- package/dist/src/components/stepper/WuStepper.d.ts +1 -0
- package/dist/src/components/tooltip/WuTooltip.d.ts +2 -2
- package/dist/src/components/virtualScroll/WuVirtualScroll.d.ts +1 -0
- package/dist/src/docs/Icons.d.ts +3 -1
- package/dist/src/docs/iconClasses.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +7868 -6067
- package/dist/wick-ui-lib/es/index.js.map +1 -1
- package/dist/wick-ui-lib/umd/index.js +23 -20
- package/dist/wick-ui-lib/umd/index.js.map +1 -1
- package/package.json +7 -4
- package/dist/src/components/select/hooks/useOptionDestructure.d.ts +0 -3
- package/dist/src/components/select/ui/WuSelectItem.d.ts +0 -12
- package/dist/src/components/select/ui/WuSelectTrigger.d.ts +0 -13
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { DialogProps } from '@radix-ui/react-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
} & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
shouldFilter?: boolean;
|
|
12
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
disablePointerSelection?: boolean;
|
|
18
|
+
vimBindings?: boolean;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const CommandDialog: ({ children, ...props }: DialogProps) => JSX.Element;
|
|
21
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
22
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
23
|
+
} & {
|
|
24
|
+
asChild?: boolean;
|
|
25
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
|
|
26
|
+
value?: string;
|
|
27
|
+
onValueChange?: (search: string) => void;
|
|
28
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
32
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
33
|
+
} & {
|
|
34
|
+
asChild?: boolean;
|
|
35
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
36
|
+
label?: string;
|
|
37
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
41
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
42
|
+
} & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
48
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
49
|
+
} & {
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
52
|
+
heading?: React.ReactNode;
|
|
53
|
+
value?: string;
|
|
54
|
+
forceMount?: boolean;
|
|
55
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
} & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
61
|
+
alwaysRender?: boolean;
|
|
62
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
64
|
+
children?: React.ReactNode;
|
|
65
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
66
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
67
|
+
} & {
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
onSelect?: (value: string) => void;
|
|
72
|
+
value?: string;
|
|
73
|
+
keywords?: string[];
|
|
74
|
+
forceMount?: boolean;
|
|
75
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
declare const CommandShortcut: {
|
|
77
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX.Element;
|
|
78
|
+
displayName: string;
|
|
79
|
+
};
|
|
80
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import { default as React, ComponentPropsWithoutRef, HTMLAttributes } from 'react';
|
|
1
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
-
|
|
3
|
-
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
-
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
-
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
3
|
+
interface IDialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
9
4
|
hideCloseButton?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const
|
|
12
|
-
|
|
5
|
+
}
|
|
6
|
+
export declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
7
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
9
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const DialogContent: React.ForwardRefExoticComponent<IDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const DialogHeader: {
|
|
13
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
15
|
-
declare const DialogFooter: {
|
|
16
|
-
({ className, ...props }:
|
|
16
|
+
export declare const DialogFooter: {
|
|
17
|
+
({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
17
18
|
displayName: string;
|
|
18
19
|
};
|
|
19
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
20
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
21
|
-
export {
|
|
20
|
+
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
export {};
|
|
@@ -12,5 +12,9 @@ export interface IWuAppHeaderProps extends React.HTMLAttributes<HTMLBaseElement>
|
|
|
12
12
|
onLogout?: () => void;
|
|
13
13
|
homeLink?: string;
|
|
14
14
|
dir?: 'ltr' | 'rtl';
|
|
15
|
+
brandColor?: {
|
|
16
|
+
base: string;
|
|
17
|
+
hover: string;
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
20
|
export declare const WuAppHeader: React.FC<IWuAppHeaderProps>;
|
|
@@ -8,6 +8,10 @@ export type IWuDatePickerProps = {
|
|
|
8
8
|
maxDate?: Date;
|
|
9
9
|
className?: string;
|
|
10
10
|
dir?: 'ltr' | 'rtl';
|
|
11
|
-
onChange?: (date
|
|
11
|
+
onChange?: (date?: Date) => void;
|
|
12
|
+
label?: string;
|
|
13
|
+
labelPosition?: 'top' | 'left';
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
showResetButton?: boolean;
|
|
12
16
|
};
|
|
13
17
|
export declare const WuDatePicker: React.FC<IWuDatePickerProps>;
|
|
@@ -9,12 +9,17 @@ export interface IWuDateRangePickerProps {
|
|
|
9
9
|
maxDate?: Date;
|
|
10
10
|
className?: string;
|
|
11
11
|
dir?: 'ltr' | 'rtl';
|
|
12
|
-
onChange?: (date: DateRange) => void;
|
|
12
|
+
onChange?: (date: DateRange | undefined) => void;
|
|
13
13
|
minDateToSelect?: number;
|
|
14
14
|
maxDateToSelect?: number;
|
|
15
15
|
presetRanges?: {
|
|
16
16
|
label: string;
|
|
17
17
|
value: number;
|
|
18
18
|
}[];
|
|
19
|
+
label?: string;
|
|
20
|
+
labelPosition?: 'top' | 'left';
|
|
21
|
+
onReset?: () => void;
|
|
22
|
+
showResetButton?: boolean;
|
|
23
|
+
placeholder?: string;
|
|
19
24
|
}
|
|
20
25
|
export declare const WuDateRangePicker: React.FC<IWuDateRangePickerProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
current
|
|
4
|
+
interface IWuDateRangePickerSidebarProps {
|
|
5
|
+
current?: DateRange;
|
|
6
6
|
onSelect: (date: DateRange) => void;
|
|
7
7
|
presetRanges?: {
|
|
8
8
|
label: string;
|
|
@@ -10,3 +10,4 @@ export interface IWuDateRangePickerSidebarProps {
|
|
|
10
10
|
}[];
|
|
11
11
|
}
|
|
12
12
|
export declare const WuDateRangeSidebar: React.FC<IWuDateRangePickerSidebarProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IWuComboboxProps<T> {
|
|
2
|
+
data: T[];
|
|
3
|
+
accessorKey: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
defaultValue?: T | T[];
|
|
8
|
+
value?: T | T[];
|
|
9
|
+
header?: React.ReactNode;
|
|
10
|
+
virtualizedThreshold?: number;
|
|
11
|
+
isEllipse?: boolean;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
variant?: 'flat' | 'outlined';
|
|
14
|
+
dir?: 'ltr' | 'rtl';
|
|
15
|
+
label?: string;
|
|
16
|
+
maxHeight?: number;
|
|
17
|
+
onSelect?: (value: T | T[]) => void;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
hasGroup?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const WuCombobox: <T>({ data, accessorKey, value, defaultValue, header, virtualizedThreshold, isEllipse, placeholder, variant, dir, onSelect, label, maxHeight, multiple, hasGroup, }: IWuComboboxProps<T>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type IWuComboboxItem<T> = T & {
|
|
4
|
+
type?: 'option';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
isAdmin?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface IWuComboboxGroup<T> {
|
|
10
|
+
type: 'group';
|
|
11
|
+
label: string;
|
|
12
|
+
options: IWuComboboxItem<T>[];
|
|
13
|
+
}
|
|
14
|
+
export interface IWuComboboxDivider {
|
|
15
|
+
type: 'divider';
|
|
16
|
+
}
|
|
17
|
+
export type IWuComboboxOption<T> = IWuComboboxItem<T> | IWuComboboxGroup<T> | IWuComboboxDivider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IWuComboboxItem } from '../types/IWuComboboxOptions';
|
|
3
|
+
|
|
4
|
+
export interface IWuComboboxItemProps<T> {
|
|
5
|
+
option: IWuComboboxItem<T>;
|
|
6
|
+
accessorKey: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
value?: IWuComboboxItem<T> | IWuComboboxItem<T>[];
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
onSelect: (value: IWuComboboxItem<T>) => void;
|
|
13
|
+
dir?: 'ltr' | 'rtl';
|
|
14
|
+
}
|
|
15
|
+
export declare const WuComboboxItem: <T>({ option, value, multiple, onSelect, accessorKey, dir, }: IWuComboboxItemProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IWuComboboxItem } from '../types/IWuComboboxOptions';
|
|
2
|
+
|
|
3
|
+
export interface IWuComboboxTriggerProps<T> {
|
|
4
|
+
accessorKey: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
isEllipse?: boolean;
|
|
10
|
+
selectedOptions?: IWuComboboxItem<T> | IWuComboboxItem<T>[];
|
|
11
|
+
variant?: 'flat' | 'outlined';
|
|
12
|
+
dir?: 'ltr' | 'rtl';
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const WuComboboxTrigger: <T>({ placeholder, isEllipse, selectedOptions, variant, dir, accessorKey, multiple, }: IWuComboboxTriggerProps<T>) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IWuComboboxOption } from '../types/IWuComboboxOptions';
|
|
3
|
+
import { IWuComboboxItemProps } from '../ui/_item';
|
|
4
|
+
|
|
5
|
+
type IRenderComboboxItemsProps<T> = Omit<IWuComboboxItemProps<T>, 'option'> & {
|
|
6
|
+
option: IWuComboboxOption<T>;
|
|
7
|
+
};
|
|
8
|
+
export declare const RenderItems: <T>(props: IRenderComboboxItemsProps<T>) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IWuComboboxDivider, IWuComboboxGroup, IWuComboboxItem, IWuComboboxOption } from '../types/IWuComboboxOptions';
|
|
2
|
+
|
|
3
|
+
export declare const separateOptions: <T>(options: IWuComboboxOption<T>[]) => {
|
|
4
|
+
groups: IWuComboboxGroup<T>[];
|
|
5
|
+
dividers: IWuComboboxDivider[];
|
|
6
|
+
allOptions: IWuComboboxItem<T>[];
|
|
7
|
+
};
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import { Dialog, DialogClose
|
|
2
|
-
import { default as React } from 'react';
|
|
1
|
+
import { Dialog, DialogClose } from '../../base/ui/dialog';
|
|
2
|
+
import { default as React, FC, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
+
declare const MAX_WIDTH: {
|
|
5
|
+
readonly sm: "400px";
|
|
6
|
+
readonly md: "600px";
|
|
7
|
+
readonly lg: "1200px";
|
|
8
|
+
};
|
|
9
|
+
declare const BUTTON_VARIANTS: {
|
|
10
|
+
readonly primary: "bg-primary-500 text-white hover:bg-opacity-70";
|
|
11
|
+
readonly secondary: "hover:bg-primary-500 hover:bg-gray-100 text-primary-500";
|
|
12
|
+
readonly iconOnly: "p-2 hover:bg-text-200 min-w-[auto] disabled:grayscale disabled:opacity-80 focus-visible:ring-offset-0 focus:bg-primary-100";
|
|
13
|
+
};
|
|
14
|
+
type IModalSize = keyof typeof MAX_WIDTH;
|
|
15
|
+
type IButtonVariant = keyof typeof BUTTON_VARIANTS;
|
|
4
16
|
export interface IWuModalProps extends React.ComponentProps<typeof Dialog> {
|
|
5
|
-
trigger?:
|
|
6
|
-
children?:
|
|
7
|
-
size?:
|
|
17
|
+
trigger?: ReactNode;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
size?: IModalSize;
|
|
8
20
|
hideCloseButton?: boolean;
|
|
9
21
|
preventClickOutside?: boolean;
|
|
10
22
|
onOpenChange?: (open: boolean) => void;
|
|
11
23
|
open?: boolean;
|
|
12
24
|
dir?: 'ltr' | 'rtl';
|
|
25
|
+
maxWidth?: string;
|
|
26
|
+
maxHeight?: string;
|
|
13
27
|
}
|
|
14
|
-
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare const WuModalFooter: React.FC<React.ComponentProps<typeof DialogFooter>>;
|
|
22
|
-
/** Modal Close button component */
|
|
23
|
-
export interface IWuModalCloseProps extends React.ComponentProps<typeof DialogClose> {
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
variant?: 'primary' | 'secondary' | 'iconOnly';
|
|
28
|
+
export declare const WuModal: FC<IWuModalProps>;
|
|
29
|
+
export declare const WuModalContent: FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
30
|
+
export declare const WuModalHeader: FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
31
|
+
export declare const WuModalFooter: FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
32
|
+
interface IModalCloseProps extends React.ComponentProps<typeof DialogClose> {
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
variant?: IButtonVariant;
|
|
26
35
|
}
|
|
27
|
-
export declare const WuModalClose:
|
|
36
|
+
export declare const WuModalClose: FC<IModalCloseProps>;
|
|
37
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { default as React } from 'react';
|
|
|
3
3
|
export interface IWuPrimaryNavbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
linkNodes: React.ReactElement[];
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* This is the primary navbar component. Every link supports custom style and className.
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { IWuSelectOption } from './types/IWuSelectOptions';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
multiple?: boolean;
|
|
8
|
-
defaultValue?: T | T[];
|
|
9
|
-
onSelect?: (value: T | T[]) => void;
|
|
10
|
-
width?: number;
|
|
11
|
-
maxHeight?: number;
|
|
12
|
-
virtualizedThreshold?: number;
|
|
3
|
+
type IValue<T> = T | T[];
|
|
4
|
+
export interface IWuSelectProps<T> extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'defaultValue' | 'onSelect'> {
|
|
5
|
+
defaultValue?: IValue<T>;
|
|
13
6
|
label?: string;
|
|
7
|
+
value?: IValue<T>;
|
|
8
|
+
data: T[];
|
|
9
|
+
accessorKey: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
onSelect?: (value: IValue<T>) => void;
|
|
14
|
+
multiple?: boolean;
|
|
14
15
|
variant?: 'flat' | 'outlined';
|
|
15
16
|
dir?: 'ltr' | 'rtl';
|
|
16
|
-
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
virtualizedThreshold?: number;
|
|
19
|
+
maxHeight?: number;
|
|
20
|
+
hasGroup?: boolean;
|
|
21
|
+
header?: React.ReactNode;
|
|
22
|
+
customTriggerChildren?: React.ReactNode;
|
|
17
23
|
}
|
|
18
|
-
export declare const WuSelect: <T>({
|
|
24
|
+
export declare const WuSelect: <T>({ data, onSelect, multiple, defaultValue, value: controlledValue, accessorKey, variant, dir, placeholder, label, virtualizedThreshold, maxHeight, hasGroup, header, customTriggerChildren, ...rest }: IWuSelectProps<T>) => React.JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export type IWuSelectItem<T> = T & {
|
|
4
4
|
type?: 'option';
|
|
5
|
-
value: T;
|
|
6
|
-
label: string;
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
icon?: React.ReactNode;
|
|
9
7
|
isAdmin?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface
|
|
8
|
+
};
|
|
9
|
+
export interface IWuSelectGroupItem<T> {
|
|
12
10
|
type: 'group';
|
|
13
11
|
label: string;
|
|
14
|
-
options:
|
|
12
|
+
options: IWuSelectItem<T>[];
|
|
15
13
|
}
|
|
16
|
-
export interface
|
|
14
|
+
export interface IWuSelectDivider {
|
|
17
15
|
type: 'divider';
|
|
18
16
|
}
|
|
19
|
-
export type IWuSelectOption<T> =
|
|
17
|
+
export type IWuSelectOption<T> = IWuSelectItem<T> | IWuSelectGroupItem<T> | IWuSelectDivider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IWuSelectItem } from '../types/IWuSelectOptions';
|
|
3
|
+
|
|
4
|
+
export interface IWuSelectItemProps<T> {
|
|
5
|
+
option: IWuSelectItem<T>;
|
|
6
|
+
accessorKey: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
value: unknown | unknown[];
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
onSelect: (value: IWuSelectItem<T>) => void;
|
|
13
|
+
dir: 'ltr' | 'rtl';
|
|
14
|
+
}
|
|
15
|
+
export declare const WuSelectItem: <T>({ option, value, multiple, onSelect, accessorKey, dir, }: IWuSelectItemProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IWuSelectTriggerProps<T> {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
value: T | T[];
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
variant?: 'flat' | 'outlined';
|
|
8
|
+
dir?: 'ltr' | 'rtl';
|
|
9
|
+
accessorKey: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
customTriggerChildren?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const WuSelectTrigger: <T>({ placeholder, value, multiple, accessorKey, variant, dir, customTriggerChildren, }: IWuSelectTriggerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IWuSelectOption } from '../types/IWuSelectOptions';
|
|
2
|
+
import { IWuSelectItemProps } from '../ui/_item';
|
|
3
|
+
|
|
4
|
+
type IRenderSelectItemsProps<T> = Omit<IWuSelectItemProps<T>, 'option'> & {
|
|
5
|
+
option: IWuSelectOption<T>;
|
|
6
|
+
};
|
|
7
|
+
export declare const RenderItems: <T>(props: IRenderSelectItemsProps<T>) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export interface IWuStepperProps extends Omit<React.InputHTMLAttributes<HTMLInpu
|
|
|
8
8
|
label?: string;
|
|
9
9
|
defaultValue: number;
|
|
10
10
|
dir?: 'ltr' | 'rtl';
|
|
11
|
+
labelPosition?: 'left' | 'top';
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* This extends the native input element. So it supports all attributes of input.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export interface IWuTooltipProps extends React.HTMLAttributes<HTMLBaseElement> {
|
|
4
|
-
content: string;
|
|
3
|
+
export interface IWuTooltipProps extends Omit<React.HTMLAttributes<HTMLBaseElement>, 'content'> {
|
|
4
|
+
content: string | React.ReactNode;
|
|
5
5
|
duration?: number;
|
|
6
6
|
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
7
7
|
children: React.ReactNode;
|
|
@@ -6,5 +6,6 @@ export interface IWuVirtualScrollProps {
|
|
|
6
6
|
list: unknown[];
|
|
7
7
|
callback: (index: number, item: unknown) => JSX.Element;
|
|
8
8
|
dir?: 'rtl' | 'ltr';
|
|
9
|
+
className?: string;
|
|
9
10
|
}
|
|
10
11
|
export declare const WuVirtualScroll: React.ForwardRefExoticComponent<IWuVirtualScrollProps & React.RefAttributes<VirtuosoHandle>>;
|
package/dist/src/docs/Icons.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON_CLASSES: string[];
|
package/dist/src/index.d.ts
CHANGED