@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.1.80",
3
+ "version": "0.1.82",
4
4
  "dependencies": {
5
5
  "@iconify/react": "^4.1.1",
6
6
  "@mdx-js/react": "^3.0.1",
@@ -1,11 +1,20 @@
1
- /// <reference types="react" />
2
1
  export interface ColumnDef {
3
- id: string;
4
- header: React.ReactNode;
5
- cell: React.ReactNode;
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
- accessorKey?: string | undefined;
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: any;
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 interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
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,7 @@
1
+ declare const Checkbox: ({ children, checked, onChange, id }: {
2
+ children: any;
3
+ checked: any;
4
+ onChange: any;
5
+ id: any;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default Checkbox;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface DisabledItemProps {
3
+ children: JSX.Element | string;
4
+ }
5
+ declare const DisabledItem: React.FC<DisabledItemProps>;
6
+ export default DisabledItem;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { GroupOption } from './type';
3
+ interface GroupItemProps {
4
+ item: GroupOption;
5
+ primaryColor: string;
6
+ }
7
+ declare const GroupItem: React.FC<GroupItemProps>;
8
+ export default GroupItem;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface Props {
3
+ className?: string;
4
+ }
5
+ export declare const CloseIcon: React.FC<Props>;
6
+ export declare const ChevronIcon: React.FC<Props>;
7
+ export declare const SearchIcon: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Option } from './type';
3
+ interface ItemProps {
4
+ item: Option;
5
+ primaryColor: string;
6
+ }
7
+ declare const Item: React.FC<ItemProps>;
8
+ export default Item;
@@ -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,4 @@
1
+ declare const SelectContainer: ({ children }: {
2
+ children: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default SelectContainer;
@@ -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,6 @@
1
+ import React from "react";
2
+ interface Props {
3
+ primaryColor?: string;
4
+ }
5
+ declare const Spinner: React.FC<Props>;
6
+ export default Spinner;
@@ -0,0 +1,4 @@
1
+ declare const TailwindColors: ({ changeColor }: {
2
+ changeColor: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default TailwindColors;
@@ -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,4 @@
1
+ import React from 'react';
2
+ import { SelectProps } from './type';
3
+ declare const DropDown: React.FC<SelectProps>;
4
+ export default DropDown;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export default function useOnClickOutside(ref: React.RefObject<HTMLDivElement>, handler: (e?: MouseEvent | TouchEvent) => void): void;