@rovula/ui 0.0.10 → 0.0.12
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/cjs/bundle.css +66 -2
- package/dist/cjs/bundle.js +23 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +14 -3
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +8 -6
- package/dist/cjs/types/components/DataTable/DataTable.d.ts +9 -0
- package/dist/cjs/types/components/DataTable/DataTable.stories.d.ts +22 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +29 -3
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +31 -30
- package/dist/cjs/types/components/Label/Label.stories.d.ts +1 -1
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
- package/dist/cjs/types/components/Table/Table.d.ts +3 -1
- package/dist/cjs/types/components/Table/Table.stories.d.ts +4 -1
- package/dist/cjs/types/components/Text/Text.d.ts +3 -3
- package/dist/cjs/types/components/Text/Text.stories.d.ts +3 -9
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +20 -2
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +28 -1
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/components/Button/Button.js +4 -3
- package/dist/components/DataTable/DataTable.js +71 -0
- package/dist/components/DataTable/DataTable.stories.js +57 -0
- package/dist/components/Dropdown/Dropdown.js +15 -5
- package/dist/components/Dropdown/Dropdown.stories.js +48 -0
- package/dist/components/Table/Table.js +6 -6
- package/dist/components/Text/Text.js +3 -2
- package/dist/components/TextInput/TextInput.js +5 -7
- package/dist/components/TextInput/TextInput.stories.js +22 -0
- package/dist/esm/bundle.css +66 -2
- package/dist/esm/bundle.js +23 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +14 -3
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +8 -6
- package/dist/esm/types/components/DataTable/DataTable.d.ts +9 -0
- package/dist/esm/types/components/DataTable/DataTable.stories.d.ts +22 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +29 -3
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +31 -30
- package/dist/esm/types/components/Label/Label.stories.d.ts +1 -1
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
- package/dist/esm/types/components/Table/Table.d.ts +3 -1
- package/dist/esm/types/components/Table/Table.stories.d.ts +4 -1
- package/dist/esm/types/components/Text/Text.d.ts +3 -3
- package/dist/esm/types/components/Text/Text.stories.d.ts +3 -9
- package/dist/esm/types/components/TextInput/TextInput.d.ts +20 -2
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +28 -1
- package/dist/esm/types/index.d.ts +4 -0
- package/dist/index.d.ts +74 -8
- package/dist/index.js +1 -0
- package/dist/src/theme/global.css +85 -2
- package/package.json +3 -1
- package/src/components/Button/Button.tsx +47 -39
- package/src/components/DataTable/DataTable.stories.tsx +72 -0
- package/src/components/DataTable/DataTable.tsx +171 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +87 -3
- package/src/components/Dropdown/Dropdown.tsx +147 -109
- package/src/components/Table/Table.tsx +17 -8
- package/src/components/Text/Text.tsx +21 -19
- package/src/components/TextInput/TextInput.stories.tsx +46 -1
- package/src/components/TextInput/TextInput.tsx +7 -7
- package/src/index.ts +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
type ButtonProps = {
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export type ButtonProps = {
|
|
3
3
|
title?: string;
|
|
4
4
|
size?: "sm" | "md" | "lg";
|
|
5
5
|
color?: "primary" | "secondary" | "success" | "tertiary" | "info" | "warning" | "error";
|
|
@@ -11,5 +11,16 @@ type ButtonProps = {
|
|
|
11
11
|
startIcon?: ReactElement;
|
|
12
12
|
endIcon?: ReactElement;
|
|
13
13
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
14
|
-
declare const Button:
|
|
14
|
+
declare const Button: React.ForwardRefExoticComponent<{
|
|
15
|
+
title?: string | undefined;
|
|
16
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
17
|
+
color?: "primary" | "secondary" | "tertiary" | "success" | "info" | "warning" | "error" | undefined;
|
|
18
|
+
variant?: "solid" | "outline" | "flat" | "link" | undefined;
|
|
19
|
+
disabled?: boolean | undefined;
|
|
20
|
+
isLoading?: boolean | undefined;
|
|
21
|
+
fullwidth?: boolean | undefined;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
24
|
+
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
25
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
26
|
export default Button;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.
|
|
4
|
+
component: React.ForwardRefExoticComponent<{
|
|
5
5
|
title?: string | undefined;
|
|
6
6
|
size?: "sm" | "md" | "lg" | undefined;
|
|
7
7
|
color?: "primary" | "secondary" | "tertiary" | "success" | "info" | "warning" | "error" | undefined;
|
|
@@ -12,7 +12,7 @@ declare const meta: {
|
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
14
14
|
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
15
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
15
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
tags: string[];
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: string;
|
|
@@ -299,6 +299,8 @@ declare const meta: {
|
|
|
299
299
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
300
300
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
301
301
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
302
|
+
ref?: React.LegacyRef<HTMLButtonElement> | undefined;
|
|
303
|
+
key?: React.Key | null | undefined;
|
|
302
304
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
303
305
|
};
|
|
304
306
|
export default meta;
|
|
@@ -317,7 +319,7 @@ export declare const Solid: {
|
|
|
317
319
|
children?: React.ReactNode;
|
|
318
320
|
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
319
321
|
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
320
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
322
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
321
323
|
};
|
|
322
324
|
export declare const Outline: {
|
|
323
325
|
args: {
|
|
@@ -335,7 +337,7 @@ export declare const Outline: {
|
|
|
335
337
|
children?: React.ReactNode;
|
|
336
338
|
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
337
339
|
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
338
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
340
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
339
341
|
};
|
|
340
342
|
export declare const Flat: {
|
|
341
343
|
args: {
|
|
@@ -353,7 +355,7 @@ export declare const Flat: {
|
|
|
353
355
|
children?: React.ReactNode;
|
|
354
356
|
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
355
357
|
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
356
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
358
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
357
359
|
};
|
|
358
360
|
export declare const Link: {
|
|
359
361
|
args: {
|
|
@@ -371,5 +373,5 @@ export declare const Link: {
|
|
|
371
373
|
children?: React.ReactNode;
|
|
372
374
|
startIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
373
375
|
endIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
374
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
376
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
375
377
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDef, SortingState } from "@tanstack/react-table";
|
|
2
|
+
export interface DataTableProps<TData, TValue> {
|
|
3
|
+
columns: ColumnDef<TData, TValue>[];
|
|
4
|
+
data: TData[];
|
|
5
|
+
manualSorting?: boolean;
|
|
6
|
+
onSorting?: (sorting: SortingState) => void;
|
|
7
|
+
fetchMoreData?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, fetchMoreData, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataTable } from "./DataTable";
|
|
2
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DataTable;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
11
|
+
columns: ColumnDef<unknown, unknown>[];
|
|
12
|
+
data: unknown[];
|
|
13
|
+
manualSorting?: boolean | undefined;
|
|
14
|
+
onSorting?: ((sorting: import("@tanstack/react-table").SortingState) => void) | undefined;
|
|
15
|
+
fetchMoreData?: (() => void) | undefined;
|
|
16
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export declare const Default: {
|
|
20
|
+
args: {};
|
|
21
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
1
2
|
import { InputProps } from "../TextInput/TextInput";
|
|
2
|
-
type
|
|
3
|
+
type RenderLabelCallbackArg = {
|
|
3
4
|
value: string;
|
|
4
5
|
label: string;
|
|
6
|
+
handleOnClick: () => void;
|
|
7
|
+
className: string;
|
|
5
8
|
};
|
|
6
|
-
type
|
|
9
|
+
export type Options = {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
renderLabel?: (config: RenderLabelCallbackArg) => ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export type DropdownProps = {
|
|
7
15
|
id?: string;
|
|
8
16
|
label?: string;
|
|
9
17
|
size?: "sm" | "md" | "lg";
|
|
@@ -22,5 +30,23 @@ type DropdownProps = {
|
|
|
22
30
|
onChangeText?: InputProps["onChange"];
|
|
23
31
|
onSelect?: (value: Options) => void;
|
|
24
32
|
} & Omit<InputProps, "value">;
|
|
25
|
-
declare const Dropdown:
|
|
33
|
+
declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
34
|
+
id?: string | undefined;
|
|
35
|
+
label?: string | undefined;
|
|
36
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
37
|
+
rounded?: "none" | "normal" | "full" | undefined;
|
|
38
|
+
variant?: "outline" | "flat" | "underline" | undefined;
|
|
39
|
+
helperText?: string | undefined;
|
|
40
|
+
errorMessage?: string | undefined;
|
|
41
|
+
filterMode?: boolean | undefined;
|
|
42
|
+
fullwidth?: boolean | undefined;
|
|
43
|
+
disabled?: boolean | undefined;
|
|
44
|
+
error?: boolean | undefined;
|
|
45
|
+
required?: boolean | undefined;
|
|
46
|
+
className?: string | undefined;
|
|
47
|
+
options: Options[];
|
|
48
|
+
value?: Options | undefined;
|
|
49
|
+
onChangeText?: InputProps["onChange"];
|
|
50
|
+
onSelect?: ((value: Options) => void) | undefined;
|
|
51
|
+
} & Omit<InputProps, "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
26
52
|
export default Dropdown;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Options } from "./Dropdown";
|
|
2
3
|
declare const meta: {
|
|
3
4
|
title: string;
|
|
4
|
-
component:
|
|
5
|
+
component: React.ForwardRefExoticComponent<{
|
|
5
6
|
id?: string | undefined;
|
|
6
7
|
label?: string | undefined;
|
|
7
8
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -15,20 +16,11 @@ declare const meta: {
|
|
|
15
16
|
error?: boolean | undefined;
|
|
16
17
|
required?: boolean | undefined;
|
|
17
18
|
className?: string | undefined;
|
|
18
|
-
options:
|
|
19
|
-
|
|
20
|
-
label: string;
|
|
21
|
-
}[];
|
|
22
|
-
value?: {
|
|
23
|
-
value: string;
|
|
24
|
-
label: string;
|
|
25
|
-
} | undefined;
|
|
19
|
+
options: Options[];
|
|
20
|
+
value?: Options | undefined;
|
|
26
21
|
onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
27
|
-
onSelect?: ((value:
|
|
28
|
-
|
|
29
|
-
label: string;
|
|
30
|
-
}) => void) | undefined;
|
|
31
|
-
} & Omit<import("../TextInput/TextInput").InputProps, "value">) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
onSelect?: ((value: Options) => void) | undefined;
|
|
23
|
+
} & Omit<import("../..").InputProps, "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
32
24
|
tags: string[];
|
|
33
25
|
parameters: {
|
|
34
26
|
layout: string;
|
|
@@ -47,19 +39,10 @@ declare const meta: {
|
|
|
47
39
|
error?: boolean | undefined;
|
|
48
40
|
required?: boolean | undefined;
|
|
49
41
|
className?: string | undefined;
|
|
50
|
-
options:
|
|
51
|
-
|
|
52
|
-
label: string;
|
|
53
|
-
}[];
|
|
54
|
-
value?: {
|
|
55
|
-
value: string;
|
|
56
|
-
label: string;
|
|
57
|
-
} | undefined;
|
|
42
|
+
options: Options[];
|
|
43
|
+
value?: Options | undefined;
|
|
58
44
|
onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
59
|
-
onSelect?: (((value:
|
|
60
|
-
value: string;
|
|
61
|
-
label: string;
|
|
62
|
-
}) => void) & React.ReactEventHandler<HTMLInputElement>) | undefined;
|
|
45
|
+
onSelect?: (((value: Options) => void) & React.ReactEventHandler<HTMLInputElement>) | undefined;
|
|
63
46
|
color?: string | undefined;
|
|
64
47
|
title?: string | undefined;
|
|
65
48
|
children?: React.ReactNode;
|
|
@@ -351,6 +334,9 @@ declare const meta: {
|
|
|
351
334
|
src?: string | undefined;
|
|
352
335
|
step?: string | number | undefined;
|
|
353
336
|
width?: string | number | undefined;
|
|
337
|
+
labelClassName?: string | undefined;
|
|
338
|
+
ref?: React.LegacyRef<HTMLInputElement> | undefined;
|
|
339
|
+
key?: React.Key | null | undefined;
|
|
354
340
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
355
341
|
};
|
|
356
342
|
export default meta;
|
|
@@ -358,10 +344,25 @@ export declare const Default: {
|
|
|
358
344
|
args: {
|
|
359
345
|
label: string;
|
|
360
346
|
fullwidth: boolean;
|
|
361
|
-
options:
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
347
|
+
options: Options[];
|
|
348
|
+
};
|
|
349
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
350
|
+
};
|
|
351
|
+
export declare const WithRef: {
|
|
352
|
+
args: {
|
|
353
|
+
label: string;
|
|
354
|
+
fullwidth: boolean;
|
|
355
|
+
options: Options[];
|
|
356
|
+
filterMode: boolean;
|
|
357
|
+
};
|
|
358
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
359
|
+
};
|
|
360
|
+
export declare const CustomOption: {
|
|
361
|
+
args: {
|
|
362
|
+
label: string;
|
|
363
|
+
fullwidth: boolean;
|
|
364
|
+
options: Options[];
|
|
365
|
+
filterMode: boolean;
|
|
365
366
|
};
|
|
366
367
|
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
367
368
|
};
|
|
@@ -273,8 +273,8 @@ declare const meta: {
|
|
|
273
273
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLLabelElement> | undefined;
|
|
274
274
|
onTransitionEnd?: React.TransitionEventHandler<HTMLLabelElement> | undefined;
|
|
275
275
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLLabelElement> | undefined;
|
|
276
|
-
key?: React.Key | null | undefined;
|
|
277
276
|
htmlFor?: string | undefined;
|
|
277
|
+
key?: React.Key | null | undefined;
|
|
278
278
|
asChild?: boolean | undefined;
|
|
279
279
|
ref?: React.LegacyRef<HTMLLabelElement> | undefined;
|
|
280
280
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
@@ -276,8 +276,8 @@ declare const meta: {
|
|
|
276
276
|
onTransitionEnd?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
277
277
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
278
278
|
required?: boolean | undefined;
|
|
279
|
-
key?: React.Key | null | undefined;
|
|
280
279
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
280
|
+
key?: React.Key | null | undefined;
|
|
281
281
|
asChild?: boolean | undefined;
|
|
282
282
|
loop?: boolean | undefined;
|
|
283
283
|
onValueChange?: ((value: string) => void) | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Table: React.ForwardRefExoticComponent<
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<{
|
|
3
|
+
rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
|
|
4
|
+
} & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
5
|
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
6
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
7
|
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.ForwardRefExoticComponent<
|
|
4
|
+
component: React.ForwardRefExoticComponent<{
|
|
5
|
+
rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
|
|
6
|
+
} & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
5
7
|
tags: string[];
|
|
6
8
|
parameters: {
|
|
7
9
|
layout: string;
|
|
8
10
|
};
|
|
9
11
|
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
12
|
+
rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
|
|
10
13
|
defaultChecked?: boolean | undefined;
|
|
11
14
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
12
15
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React
|
|
2
|
-
type TextProps = {
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TextProps = {
|
|
3
3
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "label1" | "label2";
|
|
4
4
|
color?: "primary" | "secondary" | "success" | "tertiary" | "info" | "warning" | "error";
|
|
5
5
|
children?: React.ReactNode;
|
|
@@ -8,5 +8,5 @@ type TextProps = {
|
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
id?: string;
|
|
10
10
|
};
|
|
11
|
-
declare const Text:
|
|
11
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<keyof JSX.IntrinsicElements | undefined>>;
|
|
12
12
|
export default Text;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.
|
|
5
|
-
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "label1" | "label2" | undefined;
|
|
6
|
-
color?: "primary" | "secondary" | "tertiary" | "success" | "info" | "warning" | "error" | undefined;
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
className?: string | undefined;
|
|
9
|
-
tag?: keyof JSX.IntrinsicElements | undefined;
|
|
10
|
-
style?: React.CSSProperties | undefined;
|
|
11
|
-
id?: string | undefined;
|
|
12
|
-
}>;
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./Text").TextProps & React.RefAttributes<keyof JSX.IntrinsicElements | undefined>>;
|
|
13
5
|
tags: string[];
|
|
14
6
|
parameters: {
|
|
15
7
|
layout: string;
|
|
@@ -22,6 +14,8 @@ declare const meta: {
|
|
|
22
14
|
tag?: keyof JSX.IntrinsicElements | undefined;
|
|
23
15
|
style?: React.CSSProperties | undefined;
|
|
24
16
|
id?: string | undefined;
|
|
17
|
+
ref?: React.LegacyRef<keyof JSX.IntrinsicElements | undefined> | undefined;
|
|
18
|
+
key?: React.Key | null | undefined;
|
|
25
19
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
26
20
|
};
|
|
27
21
|
export default meta;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export type InputProps = {
|
|
3
3
|
id?: string;
|
|
4
4
|
label?: string;
|
|
@@ -15,6 +15,24 @@ export type InputProps = {
|
|
|
15
15
|
hasClearIcon?: boolean;
|
|
16
16
|
endIcon?: ReactNode;
|
|
17
17
|
className?: string;
|
|
18
|
+
labelClassName?: string;
|
|
18
19
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
|
|
19
|
-
declare const TextInput:
|
|
20
|
+
export declare const TextInput: React.ForwardRefExoticComponent<{
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
label?: string | undefined;
|
|
23
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
24
|
+
rounded?: "none" | "normal" | "full" | undefined;
|
|
25
|
+
variant?: "outline" | "flat" | "underline" | undefined;
|
|
26
|
+
type?: React.HTMLInputTypeAttribute | undefined;
|
|
27
|
+
helperText?: string | undefined;
|
|
28
|
+
errorMessage?: string | undefined;
|
|
29
|
+
fullwidth?: boolean | undefined;
|
|
30
|
+
disabled?: boolean | undefined;
|
|
31
|
+
error?: boolean | undefined;
|
|
32
|
+
required?: boolean | undefined;
|
|
33
|
+
hasClearIcon?: boolean | undefined;
|
|
34
|
+
endIcon?: ReactNode;
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
labelClassName?: string | undefined;
|
|
37
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
20
38
|
export default TextInput;
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.
|
|
4
|
+
component: React.ForwardRefExoticComponent<{
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
8
|
+
rounded?: "none" | "normal" | "full" | undefined;
|
|
9
|
+
variant?: "outline" | "flat" | "underline" | undefined;
|
|
10
|
+
type?: React.HTMLInputTypeAttribute | undefined;
|
|
11
|
+
helperText?: string | undefined;
|
|
12
|
+
errorMessage?: string | undefined;
|
|
13
|
+
fullwidth?: boolean | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
error?: boolean | undefined;
|
|
16
|
+
required?: boolean | undefined;
|
|
17
|
+
hasClearIcon?: boolean | undefined;
|
|
18
|
+
endIcon?: React.ReactNode;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
labelClassName?: string | undefined;
|
|
21
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
22
|
tags: string[];
|
|
6
23
|
parameters: {
|
|
7
24
|
layout: string;
|
|
@@ -22,6 +39,7 @@ declare const meta: {
|
|
|
22
39
|
hasClearIcon?: boolean | undefined;
|
|
23
40
|
endIcon?: React.ReactNode;
|
|
24
41
|
className?: string | undefined;
|
|
42
|
+
labelClassName?: string | undefined;
|
|
25
43
|
color?: string | undefined;
|
|
26
44
|
title?: string | undefined;
|
|
27
45
|
children?: React.ReactNode;
|
|
@@ -312,6 +330,8 @@ declare const meta: {
|
|
|
312
330
|
src?: string | undefined;
|
|
313
331
|
step?: string | number | undefined;
|
|
314
332
|
width?: string | number | undefined;
|
|
333
|
+
ref?: React.LegacyRef<HTMLInputElement> | undefined;
|
|
334
|
+
key?: React.Key | null | undefined;
|
|
315
335
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
316
336
|
};
|
|
317
337
|
export default meta;
|
|
@@ -322,3 +342,10 @@ export declare const Default: {
|
|
|
322
342
|
};
|
|
323
343
|
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
324
344
|
};
|
|
345
|
+
export declare const CustomLabel: {
|
|
346
|
+
args: {
|
|
347
|
+
label: string;
|
|
348
|
+
fullwidth: boolean;
|
|
349
|
+
};
|
|
350
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
351
|
+
};
|
|
@@ -8,7 +8,11 @@ export { Checkbox } from "./components/Checkbox/Checkbox";
|
|
|
8
8
|
export { Label } from "./components/Label/Label";
|
|
9
9
|
export { Input } from "./components/Input/Input";
|
|
10
10
|
export * from "./components/Table/Table";
|
|
11
|
+
export * from "./components/DataTable/DataTable";
|
|
11
12
|
export * from "./components/Dialog/Dialog";
|
|
12
13
|
export * from "./components/AlertDialog/AlertDialog";
|
|
14
|
+
export type { ButtonProps } from "./components/Button/Button";
|
|
15
|
+
export type { InputProps } from "./components/TextInput/TextInput";
|
|
16
|
+
export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
|
|
13
17
|
export { resloveTimestamp, getStartDateOfDay, getEndDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, } from "./utils/datetime";
|
|
14
18
|
export { cn } from "./utils/cn";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, {
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { ReactElement, ReactNode } from 'react';
|
|
4
3
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
4
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
6
5
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
7
6
|
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
+
import { ColumnDef, SortingState } from '@tanstack/react-table';
|
|
8
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
10
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
10
11
|
import { ClassValue } from 'clsx';
|
|
@@ -21,7 +22,18 @@ type ButtonProps = {
|
|
|
21
22
|
startIcon?: ReactElement;
|
|
22
23
|
endIcon?: ReactElement;
|
|
23
24
|
} & React__default.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
24
|
-
declare const Button:
|
|
25
|
+
declare const Button: React__default.ForwardRefExoticComponent<{
|
|
26
|
+
title?: string | undefined;
|
|
27
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
28
|
+
color?: "primary" | "secondary" | "tertiary" | "success" | "info" | "warning" | "error" | undefined;
|
|
29
|
+
variant?: "solid" | "outline" | "flat" | "link" | undefined;
|
|
30
|
+
disabled?: boolean | undefined;
|
|
31
|
+
isLoading?: boolean | undefined;
|
|
32
|
+
fullwidth?: boolean | undefined;
|
|
33
|
+
children?: React__default.ReactNode;
|
|
34
|
+
startIcon?: React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | undefined;
|
|
35
|
+
endIcon?: React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | undefined;
|
|
36
|
+
} & React__default.ButtonHTMLAttributes<HTMLButtonElement> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
25
37
|
|
|
26
38
|
type InputProps$1 = {
|
|
27
39
|
id?: string;
|
|
@@ -39,8 +51,26 @@ type InputProps$1 = {
|
|
|
39
51
|
hasClearIcon?: boolean;
|
|
40
52
|
endIcon?: ReactNode;
|
|
41
53
|
className?: string;
|
|
54
|
+
labelClassName?: string;
|
|
42
55
|
} & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size">;
|
|
43
|
-
declare const TextInput:
|
|
56
|
+
declare const TextInput: React__default.ForwardRefExoticComponent<{
|
|
57
|
+
id?: string | undefined;
|
|
58
|
+
label?: string | undefined;
|
|
59
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
60
|
+
rounded?: "none" | "normal" | "full" | undefined;
|
|
61
|
+
variant?: "outline" | "flat" | "underline" | undefined;
|
|
62
|
+
type?: React__default.HTMLInputTypeAttribute | undefined;
|
|
63
|
+
helperText?: string | undefined;
|
|
64
|
+
errorMessage?: string | undefined;
|
|
65
|
+
fullwidth?: boolean | undefined;
|
|
66
|
+
disabled?: boolean | undefined;
|
|
67
|
+
error?: boolean | undefined;
|
|
68
|
+
required?: boolean | undefined;
|
|
69
|
+
hasClearIcon?: boolean | undefined;
|
|
70
|
+
endIcon?: ReactNode;
|
|
71
|
+
className?: string | undefined;
|
|
72
|
+
labelClassName?: string | undefined;
|
|
73
|
+
} & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
44
74
|
|
|
45
75
|
type TextProps = {
|
|
46
76
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "label1" | "label2";
|
|
@@ -51,7 +81,7 @@ type TextProps = {
|
|
|
51
81
|
style?: React__default.CSSProperties;
|
|
52
82
|
id?: string;
|
|
53
83
|
};
|
|
54
|
-
declare const Text:
|
|
84
|
+
declare const Text: React__default.ForwardRefExoticComponent<TextProps & React__default.RefAttributes<keyof JSX.IntrinsicElements | undefined>>;
|
|
55
85
|
|
|
56
86
|
type Tab = {
|
|
57
87
|
label: string;
|
|
@@ -65,9 +95,16 @@ type TabsProps = {
|
|
|
65
95
|
};
|
|
66
96
|
declare const Tabs: React__default.FC<TabsProps>;
|
|
67
97
|
|
|
98
|
+
type RenderLabelCallbackArg = {
|
|
99
|
+
value: string;
|
|
100
|
+
label: string;
|
|
101
|
+
handleOnClick: () => void;
|
|
102
|
+
className: string;
|
|
103
|
+
};
|
|
68
104
|
type Options = {
|
|
69
105
|
value: string;
|
|
70
106
|
label: string;
|
|
107
|
+
renderLabel?: (config: RenderLabelCallbackArg) => ReactNode;
|
|
71
108
|
};
|
|
72
109
|
type DropdownProps = {
|
|
73
110
|
id?: string;
|
|
@@ -88,7 +125,25 @@ type DropdownProps = {
|
|
|
88
125
|
onChangeText?: InputProps$1["onChange"];
|
|
89
126
|
onSelect?: (value: Options) => void;
|
|
90
127
|
} & Omit<InputProps$1, "value">;
|
|
91
|
-
declare const Dropdown:
|
|
128
|
+
declare const Dropdown: React__default.ForwardRefExoticComponent<{
|
|
129
|
+
id?: string | undefined;
|
|
130
|
+
label?: string | undefined;
|
|
131
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
132
|
+
rounded?: "none" | "normal" | "full" | undefined;
|
|
133
|
+
variant?: "outline" | "flat" | "underline" | undefined;
|
|
134
|
+
helperText?: string | undefined;
|
|
135
|
+
errorMessage?: string | undefined;
|
|
136
|
+
filterMode?: boolean | undefined;
|
|
137
|
+
fullwidth?: boolean | undefined;
|
|
138
|
+
disabled?: boolean | undefined;
|
|
139
|
+
error?: boolean | undefined;
|
|
140
|
+
required?: boolean | undefined;
|
|
141
|
+
className?: string | undefined;
|
|
142
|
+
options: Options[];
|
|
143
|
+
value?: Options | undefined;
|
|
144
|
+
onChangeText?: InputProps$1["onChange"];
|
|
145
|
+
onSelect?: ((value: Options) => void) | undefined;
|
|
146
|
+
} & Omit<InputProps$1, "value"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
92
147
|
|
|
93
148
|
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
94
149
|
|
|
@@ -98,7 +153,9 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
98
153
|
}
|
|
99
154
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
100
155
|
|
|
101
|
-
declare const Table: React.ForwardRefExoticComponent<
|
|
156
|
+
declare const Table: React.ForwardRefExoticComponent<{
|
|
157
|
+
rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
|
|
158
|
+
} & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
102
159
|
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
103
160
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
104
161
|
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -107,6 +164,15 @@ declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<
|
|
|
107
164
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
108
165
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
109
166
|
|
|
167
|
+
interface DataTableProps<TData, TValue> {
|
|
168
|
+
columns: ColumnDef<TData, TValue>[];
|
|
169
|
+
data: TData[];
|
|
170
|
+
manualSorting?: boolean;
|
|
171
|
+
onSorting?: (sorting: SortingState) => void;
|
|
172
|
+
fetchMoreData?: () => void;
|
|
173
|
+
}
|
|
174
|
+
declare function DataTable<TData, TValue>({ data, columns, manualSorting, onSorting, fetchMoreData, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
175
|
+
|
|
110
176
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
111
177
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
112
178
|
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -153,4 +219,4 @@ declare const getTimestampUTC: (date: Date) => number;
|
|
|
153
219
|
|
|
154
220
|
declare function cn(...inputs: ClassValue[]): string;
|
|
155
221
|
|
|
156
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Button, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, Input, Label, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, resloveTimestamp };
|
|
222
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Button, type ButtonProps, Checkbox, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownProps, Input, type InputProps$1 as InputProps, Label, type Options, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, resloveTimestamp };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { Checkbox } from "./components/Checkbox/Checkbox";
|
|
|
10
10
|
export { Label } from "./components/Label/Label";
|
|
11
11
|
export { Input } from "./components/Input/Input";
|
|
12
12
|
export * from "./components/Table/Table";
|
|
13
|
+
export * from "./components/DataTable/DataTable";
|
|
13
14
|
export * from "./components/Dialog/Dialog";
|
|
14
15
|
export * from "./components/AlertDialog/AlertDialog";
|
|
15
16
|
// UTILS
|