@npm-questionpro/wick-ui-lib 0.16.3 → 0.17.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/table.d.ts +10 -0
- package/dist/src/components/button/WuButton.d.ts +0 -4
- package/dist/src/components/combobox/WuCombobox.d.ts +0 -4
- package/dist/src/components/formFields/WuInput/WuInput.d.ts +0 -4
- package/dist/src/components/formGroup/WuFormGroup.d.ts +0 -16
- package/dist/src/components/menu/WuMenu.d.ts +1 -4
- package/dist/src/components/menu/ui/WuMenuItem.d.ts +0 -4
- package/dist/src/components/modal/WuModal.d.ts +0 -4
- package/dist/src/components/navbar/primaryNavbar/WuPrimaryNavbar.d.ts +0 -3
- package/dist/src/components/navbar/secondaryNavbar/WuSecondaryNavbar.d.ts +0 -4
- package/dist/src/components/pagination/WuPagination.d.ts +12 -0
- package/dist/src/components/pagination/WuPagination.test.d.ts +1 -0
- package/dist/src/components/pagination/index.d.ts +2 -0
- package/dist/src/components/popover/WuPopover.d.ts +2 -6
- package/dist/src/components/select/WuSelect.d.ts +0 -8
- package/dist/src/components/table/components/dataTable/WuDataTable.d.ts +25 -0
- package/dist/src/components/table/components/dataTable/WuDataTable.test.d.ts +1 -0
- package/dist/src/components/table/components/table/WuTable.d.ts +26 -0
- package/dist/src/components/table/components/table/WuTable.test.d.ts +1 -0
- package/dist/src/components/table/index.d.ts +5 -0
- package/dist/src/components/table/types/IWuManualSorting.d.ts +4 -0
- package/dist/src/components/table/types/IWuTableColumnDef.d.ts +5 -0
- package/dist/src/components/table/ui/_body.d.ts +6 -0
- package/dist/src/components/table/ui/_header.d.ts +10 -0
- package/dist/src/components/table/utils/data.d.ts +23 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +9720 -7355
- package/dist/wick-ui-lib/es/index.js.map +1 -1
- package/dist/wick-ui-lib/umd/index.js +35 -14
- package/dist/wick-ui-lib/umd/index.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
|
|
@@ -3,10 +3,6 @@ export interface IWuButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEle
|
|
|
3
3
|
variant?: 'primary' | 'secondary' | 'outline' | 'rounded' | 'link' | 'iconOnly';
|
|
4
4
|
size?: 'md' | 'sm' | 'mobile';
|
|
5
5
|
color?: 'primary' | 'upgrade' | 'error';
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use `Icon` instead.
|
|
8
|
-
*/
|
|
9
|
-
icon?: ReactNode;
|
|
10
6
|
Icon?: ReactNode;
|
|
11
7
|
iconPosition?: 'left' | 'right';
|
|
12
8
|
floating?: boolean;
|
|
@@ -2,10 +2,6 @@ import { default as React } from 'react';
|
|
|
2
2
|
export interface IWuInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
label?: string;
|
|
4
4
|
labelPosition?: 'left' | 'top';
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use `Icon` instead.
|
|
7
|
-
*/
|
|
8
|
-
icon?: React.ReactNode;
|
|
9
5
|
Icon?: React.ReactNode;
|
|
10
6
|
iconPosition?: 'left' | 'right';
|
|
11
7
|
variant?: 'flat' | 'outlined';
|
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface IWuFormGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use `Label` instead.
|
|
5
|
-
*/
|
|
6
|
-
labelNode?: React.ReactNode;
|
|
7
3
|
Label?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use `Error` instead.
|
|
10
|
-
*/
|
|
11
|
-
errorNode?: React.ReactNode;
|
|
12
4
|
Error?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `Hint` instead.
|
|
15
|
-
*/
|
|
16
|
-
hintsNode?: React.ReactNode;
|
|
17
5
|
Hint?: React.ReactNode;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Use `Input` instead.
|
|
20
|
-
*/
|
|
21
|
-
inputNode?: React.ReactNode;
|
|
22
6
|
Input: React.ReactNode;
|
|
23
7
|
labelPosition?: 'left' | 'top';
|
|
24
8
|
dir?: 'ltr' | 'rtl';
|
|
@@ -3,10 +3,6 @@ import { default as React } from 'react';
|
|
|
3
3
|
export interface IWuMenuProps extends Omit<React.ComponentProps<typeof DropdownMenu>, 'open' | 'onOpenChange'> {
|
|
4
4
|
name?: string;
|
|
5
5
|
menuTitle?: string;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use `Trigger` instead.
|
|
8
|
-
*/
|
|
9
|
-
trigger?: React.ReactElement<HTMLBaseElement>;
|
|
10
6
|
Trigger?: React.ReactElement<HTMLBaseElement>;
|
|
11
7
|
variant?: 'flat' | 'outlined';
|
|
12
8
|
open?: boolean;
|
|
@@ -18,5 +14,6 @@ export interface IWuMenuProps extends Omit<React.ComponentProps<typeof DropdownM
|
|
|
18
14
|
alignOffset?: number;
|
|
19
15
|
side?: 'left' | 'right' | 'top' | 'bottom';
|
|
20
16
|
sideOffset?: number;
|
|
17
|
+
className?: string;
|
|
21
18
|
}
|
|
22
19
|
export declare const WuMenu: React.FC<IWuMenuProps>;
|
|
@@ -13,10 +13,6 @@ declare const BUTTON_VARIANTS: {
|
|
|
13
13
|
type IModalSize = keyof typeof MAX_WIDTH;
|
|
14
14
|
type IButtonVariant = keyof typeof BUTTON_VARIANTS;
|
|
15
15
|
export interface IWuModalProps extends React.ComponentProps<typeof Dialog> {
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Use `Trigger` instead.
|
|
18
|
-
*/
|
|
19
|
-
trigger?: ReactNode;
|
|
20
16
|
Trigger?: ReactNode;
|
|
21
17
|
children?: ReactNode;
|
|
22
18
|
size?: IModalSize;
|
|
@@ -4,9 +4,6 @@ interface INavLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
6
|
export interface IWuPrimaryNavbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use `Links` instead.
|
|
9
|
-
*/
|
|
10
7
|
linkNodes?: React.ReactElement<INavLinkProps>[];
|
|
11
8
|
Links: React.ReactElement<INavLinkProps>[];
|
|
12
9
|
children?: React.ReactNode;
|
|
@@ -11,10 +11,6 @@ export interface INavLinkNode {
|
|
|
11
11
|
imgOrIcon: React.ReactElement<INavImageProps>;
|
|
12
12
|
}
|
|
13
13
|
export interface IWuSecondaryNavbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use `Links` instead.
|
|
16
|
-
*/
|
|
17
|
-
linkNodes?: INavLinkNode[];
|
|
18
14
|
Links: INavLinkNode[];
|
|
19
15
|
children?: React.ReactNode;
|
|
20
16
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface IWuPaginationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
totalRows: number;
|
|
4
|
+
initialPage: number;
|
|
5
|
+
initialPageSize: number;
|
|
6
|
+
onPageChange?: (page: number) => void;
|
|
7
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
8
|
+
pageSizeOptions?: number[];
|
|
9
|
+
showFirstLastButtons?: boolean;
|
|
10
|
+
showPageSizeOptions?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const WuPagination: React.ForwardRefExoticComponent<IWuPaginationProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { PopoverContentProps } from '@radix-ui/react-popover';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { IWuButtonProps } from '../button';
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use `Trigger` instead.
|
|
7
|
-
*/
|
|
8
|
-
trigger?: React.ReactNode;
|
|
4
|
+
export type IWuPopoverProps = PopoverContentProps & {
|
|
9
5
|
Trigger: React.ReactNode;
|
|
10
6
|
children: React.ReactNode;
|
|
11
7
|
className?: string;
|
|
@@ -13,6 +9,6 @@ export interface IWuPopoverProps extends PopoverContentProps {
|
|
|
13
9
|
open?: boolean;
|
|
14
10
|
onOpenChange?: (open: boolean) => void;
|
|
15
11
|
modal?: boolean;
|
|
16
|
-
}
|
|
12
|
+
};
|
|
17
13
|
export declare const WuPopover: React.FC<IWuPopoverProps>;
|
|
18
14
|
export declare const WuPopoverClose: React.FC<IWuButtonProps>;
|
|
@@ -17,15 +17,7 @@ export interface IWuSelectProps<T> extends Omit<React.SelectHTMLAttributes<HTMLS
|
|
|
17
17
|
virtualizedThreshold?: number;
|
|
18
18
|
maxHeight?: number;
|
|
19
19
|
hasGroup?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Use `Header` instead.
|
|
22
|
-
*/
|
|
23
|
-
header?: React.ReactNode;
|
|
24
20
|
Header?: React.ReactNode;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use `CustomTrigger` instead.
|
|
27
|
-
*/
|
|
28
|
-
customTriggerChildren?: React.ReactNode;
|
|
29
21
|
CustomTrigger?: React.ReactNode;
|
|
30
22
|
selectAll?: {
|
|
31
23
|
enable: boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IWuManualSorting } from '../../types/IWuManualSorting';
|
|
3
|
+
import { IWuTableColumnDef } from '../../types/IWuTableColumnDef';
|
|
4
|
+
export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
5
|
+
data: T[];
|
|
6
|
+
columns: IWuTableColumnDef<T>[];
|
|
7
|
+
variant?: 'unstyled' | 'striped' | 'bordered';
|
|
8
|
+
size?: 'compact' | 'default';
|
|
9
|
+
pagination?: {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
initialPage: number;
|
|
12
|
+
initialPageSize: number;
|
|
13
|
+
totalRows: number;
|
|
14
|
+
onPageChange?: (page: number) => void;
|
|
15
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
16
|
+
pageSizeOptions?: number[];
|
|
17
|
+
showPageSizeOptions?: boolean;
|
|
18
|
+
};
|
|
19
|
+
sorting?: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
onSort: (sort: IWuManualSorting) => void;
|
|
22
|
+
};
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const WuDataTable: <T>({ data, columns, pagination, isLoading, variant, sorting, size, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ColumnSort } from '@tanstack/react-table';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { IWuTableColumnDef } from '../../types/IWuTableColumnDef';
|
|
4
|
+
export interface IWuTableProps<Data> extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
5
|
+
data: Data[];
|
|
6
|
+
columns: IWuTableColumnDef<Data>[];
|
|
7
|
+
variant?: 'striped' | 'unstyled' | 'bordered';
|
|
8
|
+
size?: 'compact' | 'default';
|
|
9
|
+
caption?: string;
|
|
10
|
+
pagination?: {
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
initialPage?: number;
|
|
13
|
+
initialPageSize?: number;
|
|
14
|
+
pageSizeOptions?: number[];
|
|
15
|
+
showPageSizeOptions?: boolean;
|
|
16
|
+
};
|
|
17
|
+
sort?: {
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
initial?: ColumnSort[];
|
|
20
|
+
};
|
|
21
|
+
filterText?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const WuTable: {
|
|
24
|
+
<T>({ data, columns, caption, variant, pagination, sort, filterText, size, ...rest }: IWuTableProps<T>): React.JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { WuDataTable } from './components/dataTable/WuDataTable';
|
|
2
|
+
export type { IWuDataTableProps } from './components/dataTable/WuDataTable';
|
|
3
|
+
export { WuTable } from './components/table/WuTable';
|
|
4
|
+
export type { IWuTableProps } from './components/table/WuTable';
|
|
5
|
+
export type { IWuTableColumnDef } from './types/IWuTableColumnDef';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Table } from '@tanstack/react-table';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { IWuManualSorting } from '../types/IWuManualSorting';
|
|
4
|
+
export declare const WuTableHeader: <T>({ table, sortableColumns, manual, onSort, size, }: {
|
|
5
|
+
table: Table<T>;
|
|
6
|
+
sortableColumns: string[];
|
|
7
|
+
manual?: boolean;
|
|
8
|
+
onSort?: (meta: IWuManualSorting) => void;
|
|
9
|
+
size?: "compact" | "default";
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const MOCK_DATA: {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
age: number;
|
|
5
|
+
occupation: string;
|
|
6
|
+
catchphrase: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const MOCK_COLUMNS: ({
|
|
9
|
+
accessorKey: string;
|
|
10
|
+
header: string;
|
|
11
|
+
sortable: boolean;
|
|
12
|
+
filterable?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
accessorKey: string;
|
|
15
|
+
header: string;
|
|
16
|
+
sortable?: undefined;
|
|
17
|
+
filterable?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
accessorKey: string;
|
|
20
|
+
header: string;
|
|
21
|
+
filterable: boolean;
|
|
22
|
+
sortable?: undefined;
|
|
23
|
+
})[];
|
package/dist/src/index.d.ts
CHANGED
|
@@ -12,12 +12,14 @@ export * from './components/menu';
|
|
|
12
12
|
export * from './components/menuIcon';
|
|
13
13
|
export * from './components/modal';
|
|
14
14
|
export * from './components/navbar';
|
|
15
|
+
export * from './components/pagination';
|
|
15
16
|
export * from './components/popover';
|
|
16
17
|
export * from './components/radio';
|
|
17
18
|
export * from './components/select';
|
|
18
19
|
export * from './components/sidebar';
|
|
19
20
|
export * from './components/stepper';
|
|
20
21
|
export * from './components/switcher';
|
|
22
|
+
export * from './components/table';
|
|
21
23
|
export * from './components/toast';
|
|
22
24
|
export * from './components/toggle';
|
|
23
25
|
export * from './components/tooltip';
|