@sunggang/ui-lib 0.1.80 → 0.1.82
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.css +680 -0
- package/index.esm.js +445 -111
- package/package.json +1 -1
- package/src/Type/index.d.ts +17 -6
- package/src/components/ui/button.d.ts +1 -0
- package/src/components/ui/input.d.ts +1 -2
- package/src/index.d.ts +1 -0
- package/src/lib/DataTable/BaseTable.d.ts +8 -0
- package/src/lib/Dropdown/Checkbox.d.ts +7 -0
- package/src/lib/Dropdown/DisabledItem.d.ts +6 -0
- package/src/lib/Dropdown/GroupItem.d.ts +8 -0
- package/src/lib/Dropdown/Icons.d.ts +8 -0
- package/src/lib/Dropdown/Item.d.ts +8 -0
- package/src/lib/Dropdown/Options.d.ts +12 -0
- package/src/lib/Dropdown/SearchInput.d.ts +9 -0
- package/src/lib/Dropdown/SelectContainer.d.ts +4 -0
- package/src/lib/Dropdown/SelectProvider.d.ts +23 -0
- package/src/lib/Dropdown/Spinner.d.ts +6 -0
- package/src/lib/Dropdown/TailwindColors.d.ts +4 -0
- package/src/lib/Dropdown/constants.d.ts +118 -0
- package/src/lib/Dropdown/demoList.d.ts +16 -0
- package/src/lib/Dropdown/index.d.ts +4 -0
- package/src/lib/Dropdown/type.d.ts +59 -0
- package/src/utils/hooks/useOnClickOutside.d.ts +2 -0
package/package.json
CHANGED
package/src/Type/index.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface ColumnDef {
|
|
3
|
-
|
|
4
|
-
header:
|
|
5
|
-
|
|
2
|
+
accessorKey: string;
|
|
3
|
+
header: ((props: {
|
|
4
|
+
column: any;
|
|
5
|
+
}) => JSX.Element) | string;
|
|
6
|
+
cell: (props: {
|
|
7
|
+
row: any;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
id?: string;
|
|
6
10
|
enableSorting?: boolean | undefined;
|
|
7
11
|
enableHiding?: boolean | undefined;
|
|
8
|
-
|
|
12
|
+
}
|
|
13
|
+
interface PaginationConfigType {
|
|
14
|
+
page: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
total: number;
|
|
17
|
+
onPageChange: (e: any) => void;
|
|
9
18
|
}
|
|
10
19
|
export interface DataTableProps {
|
|
11
20
|
data: any[];
|
|
@@ -17,5 +26,7 @@ export interface DataTableProps {
|
|
|
17
26
|
name: string;
|
|
18
27
|
};
|
|
19
28
|
mappingColumn: any;
|
|
20
|
-
paginationConfig
|
|
29
|
+
paginationConfig?: PaginationConfigType;
|
|
30
|
+
SearchSelectCP?: any;
|
|
21
31
|
}
|
|
32
|
+
export {};
|
|
@@ -6,6 +6,7 @@ declare const buttonVariants: (props?: ({
|
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
12
|
export { Button, buttonVariants };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export
|
|
3
|
-
}
|
|
2
|
+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
4
3
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
4
|
export { Input };
|
package/src/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './lib/Switch';
|
|
|
9
9
|
export * from './components/ui/dateRangePicker';
|
|
10
10
|
export * from './components/ui/reactDateRange';
|
|
11
11
|
export * from './lib/DataTable';
|
|
12
|
+
export * from './lib/DataTable/BaseTable';
|
|
12
13
|
export * from './lib/Function';
|
|
13
14
|
export * from './lib/BigCalender';
|
|
14
15
|
export * from './lib/BigCalender/dnd';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const BaseTable: ({ data, mappingColumn, columns, searchData, paginationConfig, SearchSelectCP, }: {
|
|
2
|
+
data: any;
|
|
3
|
+
mappingColumn: any;
|
|
4
|
+
columns: any;
|
|
5
|
+
searchData: any;
|
|
6
|
+
paginationConfig: any;
|
|
7
|
+
SearchSelectCP: any;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Option, Options as ListOption } from "./type";
|
|
3
|
+
interface OptionsProps {
|
|
4
|
+
list: ListOption;
|
|
5
|
+
noOptionsMessage: string;
|
|
6
|
+
text: string;
|
|
7
|
+
isMultiple: boolean;
|
|
8
|
+
value: Option | Option[] | null;
|
|
9
|
+
primaryColor: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Options: React.FC<OptionsProps>;
|
|
12
|
+
export default Options;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SearchInputProps {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export default SearchInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ClassNames, GroupOption, Option } from "./type";
|
|
3
|
+
interface Store {
|
|
4
|
+
value: Option | Option[] | null;
|
|
5
|
+
handleValueChange: (selected: Option) => void;
|
|
6
|
+
formatGroupLabel: ((data: GroupOption) => JSX.Element) | null;
|
|
7
|
+
formatOptionLabel: ((data: Option) => JSX.Element) | null;
|
|
8
|
+
classNames?: ClassNames;
|
|
9
|
+
}
|
|
10
|
+
interface Props {
|
|
11
|
+
value: Option | Option[] | null;
|
|
12
|
+
handleValueChange: (selected: Option) => void;
|
|
13
|
+
children: JSX.Element;
|
|
14
|
+
otherData: {
|
|
15
|
+
formatGroupLabel: ((data: GroupOption) => JSX.Element) | null;
|
|
16
|
+
formatOptionLabel: ((data: Option) => JSX.Element) | null;
|
|
17
|
+
classNames?: ClassNames;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare const SelectContext: React.Context<Store>;
|
|
21
|
+
export declare const useSelectContext: () => Store;
|
|
22
|
+
declare const SelectProvider: React.FC<Props>;
|
|
23
|
+
export default SelectProvider;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export declare const COLORS: string[];
|
|
2
|
+
export declare const DEFAULT_THEME = "blue";
|
|
3
|
+
export declare const THEME_DATA: {
|
|
4
|
+
bg: {
|
|
5
|
+
blue: string;
|
|
6
|
+
orange: string;
|
|
7
|
+
yellow: string;
|
|
8
|
+
red: string;
|
|
9
|
+
purple: string;
|
|
10
|
+
amber: string;
|
|
11
|
+
lime: string;
|
|
12
|
+
green: string;
|
|
13
|
+
emerald: string;
|
|
14
|
+
teal: string;
|
|
15
|
+
cyan: string;
|
|
16
|
+
sky: string;
|
|
17
|
+
indigo: string;
|
|
18
|
+
violet: string;
|
|
19
|
+
fuchsia: string;
|
|
20
|
+
pink: string;
|
|
21
|
+
rose: string;
|
|
22
|
+
};
|
|
23
|
+
bgHover: {
|
|
24
|
+
blue: string;
|
|
25
|
+
orange: string;
|
|
26
|
+
yellow: string;
|
|
27
|
+
red: string;
|
|
28
|
+
purple: string;
|
|
29
|
+
amber: string;
|
|
30
|
+
lime: string;
|
|
31
|
+
green: string;
|
|
32
|
+
emerald: string;
|
|
33
|
+
teal: string;
|
|
34
|
+
cyan: string;
|
|
35
|
+
sky: string;
|
|
36
|
+
indigo: string;
|
|
37
|
+
violet: string;
|
|
38
|
+
fuchsia: string;
|
|
39
|
+
pink: string;
|
|
40
|
+
rose: string;
|
|
41
|
+
};
|
|
42
|
+
ring: {
|
|
43
|
+
blue: string;
|
|
44
|
+
orange: string;
|
|
45
|
+
yellow: string;
|
|
46
|
+
red: string;
|
|
47
|
+
purple: string;
|
|
48
|
+
amber: string;
|
|
49
|
+
lime: string;
|
|
50
|
+
green: string;
|
|
51
|
+
emerald: string;
|
|
52
|
+
teal: string;
|
|
53
|
+
cyan: string;
|
|
54
|
+
sky: string;
|
|
55
|
+
indigo: string;
|
|
56
|
+
violet: string;
|
|
57
|
+
fuchsia: string;
|
|
58
|
+
pink: string;
|
|
59
|
+
rose: string;
|
|
60
|
+
};
|
|
61
|
+
borderFocus: {
|
|
62
|
+
blue: string;
|
|
63
|
+
orange: string;
|
|
64
|
+
yellow: string;
|
|
65
|
+
red: string;
|
|
66
|
+
purple: string;
|
|
67
|
+
amber: string;
|
|
68
|
+
lime: string;
|
|
69
|
+
green: string;
|
|
70
|
+
emerald: string;
|
|
71
|
+
teal: string;
|
|
72
|
+
cyan: string;
|
|
73
|
+
sky: string;
|
|
74
|
+
indigo: string;
|
|
75
|
+
violet: string;
|
|
76
|
+
fuchsia: string;
|
|
77
|
+
pink: string;
|
|
78
|
+
rose: string;
|
|
79
|
+
};
|
|
80
|
+
text: {
|
|
81
|
+
blue: string;
|
|
82
|
+
orange: string;
|
|
83
|
+
yellow: string;
|
|
84
|
+
red: string;
|
|
85
|
+
purple: string;
|
|
86
|
+
amber: string;
|
|
87
|
+
lime: string;
|
|
88
|
+
green: string;
|
|
89
|
+
emerald: string;
|
|
90
|
+
teal: string;
|
|
91
|
+
cyan: string;
|
|
92
|
+
sky: string;
|
|
93
|
+
indigo: string;
|
|
94
|
+
violet: string;
|
|
95
|
+
fuchsia: string;
|
|
96
|
+
pink: string;
|
|
97
|
+
rose: string;
|
|
98
|
+
};
|
|
99
|
+
textHover: {
|
|
100
|
+
blue: string;
|
|
101
|
+
orange: string;
|
|
102
|
+
yellow: string;
|
|
103
|
+
red: string;
|
|
104
|
+
purple: string;
|
|
105
|
+
amber: string;
|
|
106
|
+
lime: string;
|
|
107
|
+
green: string;
|
|
108
|
+
emerald: string;
|
|
109
|
+
teal: string;
|
|
110
|
+
cyan: string;
|
|
111
|
+
sky: string;
|
|
112
|
+
indigo: string;
|
|
113
|
+
violet: string;
|
|
114
|
+
fuchsia: string;
|
|
115
|
+
pink: string;
|
|
116
|
+
rose: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const demoOptions: ({
|
|
2
|
+
label: string;
|
|
3
|
+
options: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
}[];
|
|
8
|
+
value?: undefined;
|
|
9
|
+
disabled?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
options?: undefined;
|
|
15
|
+
})[];
|
|
16
|
+
export declare const SELECT_OPTIONS: string[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface Option {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
isSelected?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface GroupOption {
|
|
9
|
+
label: string;
|
|
10
|
+
options: Option[];
|
|
11
|
+
}
|
|
12
|
+
export type Options = Array<Option | GroupOption>;
|
|
13
|
+
export interface ClassNames {
|
|
14
|
+
menuButton?: (value?: {
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
}) => string;
|
|
17
|
+
menu?: string;
|
|
18
|
+
tagItem?: (value?: {
|
|
19
|
+
item?: Option;
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
}) => string;
|
|
22
|
+
tagItemText?: string;
|
|
23
|
+
tagItemIconContainer?: string;
|
|
24
|
+
tagItemIcon?: string;
|
|
25
|
+
list?: string;
|
|
26
|
+
listGroupLabel?: string;
|
|
27
|
+
listItem?: (value?: {
|
|
28
|
+
isSelected?: boolean;
|
|
29
|
+
}) => string;
|
|
30
|
+
listDisabledItem?: string;
|
|
31
|
+
ChevronIcon?: (value?: {
|
|
32
|
+
open?: boolean;
|
|
33
|
+
}) => string;
|
|
34
|
+
searchContainer?: string;
|
|
35
|
+
searchBox?: string;
|
|
36
|
+
searchIcon?: string;
|
|
37
|
+
closeIcon?: string;
|
|
38
|
+
}
|
|
39
|
+
export type SelectValue = Option | Option[] | null;
|
|
40
|
+
export interface SelectProps {
|
|
41
|
+
options: Options;
|
|
42
|
+
value: SelectValue;
|
|
43
|
+
onChange: (value: SelectValue) => void;
|
|
44
|
+
onSearchInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
isMultiple?: boolean;
|
|
47
|
+
isClearable?: boolean;
|
|
48
|
+
isSearchable?: boolean;
|
|
49
|
+
isDisabled?: boolean;
|
|
50
|
+
isGroupOption?: boolean;
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
menuIsOpen?: boolean;
|
|
53
|
+
searchInputPlaceholder?: string;
|
|
54
|
+
noOptionsMessage?: string;
|
|
55
|
+
primaryColor: string;
|
|
56
|
+
formatGroupLabel?: ((data: GroupOption) => JSX.Element) | null;
|
|
57
|
+
formatOptionLabel?: ((data: Option) => JSX.Element) | null;
|
|
58
|
+
classNames?: ClassNames;
|
|
59
|
+
}
|