@pk-design/react-tailwind 1.0.6 → 1.1.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/react-tailwind.cjs.js +1593 -362
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +1579 -360
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +3 -0
- package/dist/types/components/Alert/Alert.test.d.ts +1 -0
- package/dist/types/components/Alert/Alert.types.d.ts +34 -0
- package/dist/types/components/Alert/index.d.ts +2 -35
- package/dist/types/components/Badge/Badge.d.ts +3 -0
- package/dist/types/components/Badge/Badge.test.d.ts +1 -0
- package/dist/types/components/Badge/Badge.types.d.ts +22 -0
- package/dist/types/components/Badge/index.d.ts +2 -24
- package/dist/types/components/Banner/Banner.d.ts +3 -0
- package/dist/types/components/Banner/Banner.test.d.ts +1 -0
- package/dist/types/components/Banner/Banner.types.d.ts +14 -0
- package/dist/types/components/Banner/index.d.ts +2 -16
- package/dist/types/components/BodyText/BodyText.d.ts +3 -0
- package/dist/types/components/BodyText/BodyText.test.d.ts +1 -0
- package/dist/types/components/BodyText/BodyText.types.d.ts +27 -0
- package/dist/types/components/BodyText/index.d.ts +2 -28
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.test.d.ts +1 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.types.d.ts +29 -0
- package/dist/types/components/Breadcrumb/index.d.ts +2 -30
- package/dist/types/components/Button/Button.d.ts +2 -3
- package/dist/types/components/Button/Button.test.d.ts +1 -0
- package/dist/types/components/Button/Button.types.d.ts +171 -0
- package/dist/types/components/Button/index.d.ts +1 -1
- package/dist/types/components/Card/Card.d.ts +3 -0
- package/dist/types/components/Card/Card.test.d.ts +1 -0
- package/dist/types/components/Card/Card.types.d.ts +23 -0
- package/dist/types/components/Card/index.d.ts +2 -9
- package/dist/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/types/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.types.d.ts +14 -0
- package/dist/types/components/Checkbox/index.d.ts +2 -13
- package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
- package/dist/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +1 -0
- package/dist/types/components/CheckboxGroup/CheckboxGroup.types.d.ts +55 -0
- package/dist/types/components/CheckboxGroup/index.d.ts +2 -56
- package/dist/types/components/DataTable/DataTable.d.ts +2 -0
- package/dist/types/components/DataTable/DataTable.icons.d.ts +4 -0
- package/dist/types/components/DataTable/DataTable.test.d.ts +1 -0
- package/dist/types/components/DataTable/DataTable.types.d.ts +63 -0
- package/dist/types/components/DataTable/DataTable.utils.d.ts +12 -0
- package/dist/types/components/DataTable/DataTable.utils.test.d.ts +1 -0
- package/dist/types/components/DataTable/index.d.ts +4 -0
- package/dist/types/components/DetailedInformation/DetailedInformation.d.ts +2 -0
- package/dist/types/components/DetailedInformation/DetailedInformation.test.d.ts +1 -0
- package/dist/types/components/DetailedInformation/DetailedInformation.types.d.ts +54 -0
- package/dist/types/components/DetailedInformation/index.d.ts +2 -63
- package/dist/types/components/Drawer/Drawer.d.ts +1 -1
- package/dist/types/components/Drawer/Drawer.test.d.ts +1 -0
- package/dist/types/components/Drawer/{type.d.ts → Drawer.types.d.ts} +1 -1
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/types/components/Dropdown/Dropdown.test.d.ts +1 -0
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +107 -0
- package/dist/types/components/Dropdown/index.d.ts +2 -62
- package/dist/types/components/HeadingText/HeadingText.d.ts +9 -0
- package/dist/types/components/HeadingText/HeadingText.types.d.ts +5 -0
- package/dist/types/components/HeadingText/index.d.ts +2 -12
- package/dist/types/components/Input/Input.d.ts +6 -0
- package/dist/types/components/Input/Input.test.d.ts +1 -0
- package/dist/types/components/Input/Input.types.d.ts +12 -0
- package/dist/types/components/Input/index.d.ts +2 -13
- package/dist/types/components/Label/Label.d.ts +6 -0
- package/dist/types/components/Label/index.d.ts +1 -5
- package/dist/types/components/Pagination/Pagination.d.ts +1 -31
- package/dist/types/components/Pagination/Pagination.test.d.ts +1 -0
- package/dist/types/components/Pagination/Pagination.types.d.ts +36 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/Pagination/usePagination.d.ts +1 -5
- package/dist/types/components/PasswordInput/PasswordInput.d.ts +6 -0
- package/dist/types/components/PasswordInput/PasswordInput.test.d.ts +1 -0
- package/dist/types/components/PasswordInput/index.d.ts +1 -6
- package/dist/types/components/Radio/Radio.d.ts +2 -0
- package/dist/types/components/Radio/Radio.test.d.ts +1 -0
- package/dist/types/components/Radio/Radio.types.d.ts +14 -0
- package/dist/types/components/Radio/index.d.ts +2 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/types/components/RadioGroup/RadioGroup.test.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.types.d.ts +65 -0
- package/dist/types/components/RadioGroup/index.d.ts +2 -0
- package/dist/types/components/RadioSwitch/RadioSwitch.d.ts +7 -0
- package/dist/types/components/RadioSwitch/RadioSwitch.test.d.ts +1 -0
- package/dist/types/components/RadioSwitch/RadioSwitch.types.d.ts +47 -0
- package/dist/types/components/RadioSwitch/index.d.ts +2 -0
- package/dist/types/components/RangeInput/-backup.d.ts +10 -0
- package/dist/types/components/RangeInput/RangeInput.d.ts +2 -0
- package/dist/types/components/RangeInput/RangeInput.test.d.ts +1 -0
- package/dist/types/components/RangeInput/RangeInput.types.d.ts +14 -0
- package/dist/types/components/RangeInput/index.d.ts +1 -10
- package/dist/types/components/RangeSlider/RangeSlider.d.ts +3 -0
- package/dist/types/components/RangeSlider/RangeSlider.test.d.ts +1 -0
- package/dist/types/components/RangeSlider/RangeSlider.types.d.ts +68 -0
- package/dist/types/components/RangeSlider/index.d.ts +2 -0
- package/dist/types/components/SelectBox/SelectBox.d.ts +2 -0
- package/dist/types/components/SelectBox/SelectBox.test.d.ts +1 -0
- package/dist/types/components/SelectBox/SelectBox.types.d.ts +94 -0
- package/dist/types/components/SelectBox/index.d.ts +2 -40
- package/dist/types/components/Table/Table.d.ts +10 -0
- package/dist/types/components/Table/Table.test.d.ts +1 -0
- package/dist/types/components/Table/Table.types.d.ts +91 -0
- package/dist/types/components/Table/index.d.ts +2 -48
- package/dist/types/components/Tabs/Tabs.d.ts +3 -0
- package/dist/types/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.types.d.ts +48 -0
- package/dist/types/components/Tabs/index.d.ts +1 -2
- package/dist/types/components/TextContent/TextContent.d.ts +3 -0
- package/dist/types/components/TextContent/TextContent.test.d.ts +1 -0
- package/dist/types/components/TextContent/TextContent.types.d.ts +23 -0
- package/dist/types/components/TextContent/index.d.ts +2 -10
- package/dist/types/components/Textarea/Textarea.d.ts +2 -0
- package/dist/types/components/Textarea/Textarea.test.d.ts +1 -0
- package/dist/types/components/Textarea/Textarea.types.d.ts +6 -0
- package/dist/types/components/Textarea/index.d.ts +2 -7
- package/dist/types/components/Toast/Toast.d.ts +4 -8
- package/dist/types/components/Toast/Toast.test.d.ts +1 -0
- package/dist/types/components/Toast/Toast.types.d.ts +117 -0
- package/dist/types/components/Toast/ToastProvider.d.ts +2 -11
- package/dist/types/components/Toast/ToastProvider.test.d.ts +1 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.d.ts +3 -0
- package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.test.d.ts +1 -0
- package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.types.d.ts +18 -0
- package/dist/types/components/VirtualizedDataTable/VirtualizedRow.d.ts +5 -0
- package/dist/types/components/VirtualizedDataTable/index.d.ts +2 -0
- package/dist/types/components/_Dialog/Dialog.d.ts +4 -0
- package/dist/types/components/_Dialog/Dialog.types.d.ts +53 -0
- package/dist/types/components/_Dialog/index.d.ts +2 -0
- package/dist/types/components/common-type.d.ts +2 -1
- package/dist/types/hooks/use-debounce.d.ts +2 -0
- package/dist/types/hooks/use-is-mobile.d.ts +1 -0
- package/dist/types/hooks/use-is-tablet.d.ts +1 -0
- package/dist/types/index.d.ts +11 -6
- package/dist/types/utils/get.d.ts +1 -0
- package/package.json +20 -4
- package/dist/types/components/Button/type.d.ts +0 -58
- package/dist/types/components/RadioButton/index.d.ts +0 -7
- package/dist/types/components/RadioButtonGroup/index.d.ts +0 -19
- package/dist/types/components/RadioSwtich/index.d.ts +0 -14
- package/dist/types/components/Tag/index.d.ts +0 -12
- package/dist/types/components/hooks/use-debounce.d.ts +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Single tab item.
|
|
4
|
+
*/
|
|
5
|
+
export type TabsItem = {
|
|
6
|
+
/** Visible label for the tab */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** Content rendered inside the TabPanel for this tab */
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
/** Optional icon (ReactNode) shown before the label */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** optional id or key; if missing index will be used */
|
|
13
|
+
id?: string | number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Tabs component props
|
|
17
|
+
*/
|
|
18
|
+
export interface TabsProps {
|
|
19
|
+
/**
|
|
20
|
+
* Tabs data (label + panel). Order defines visual order.
|
|
21
|
+
*/
|
|
22
|
+
tabs: TabsItem[];
|
|
23
|
+
/**
|
|
24
|
+
* Variant for the tab list's appearance.
|
|
25
|
+
* Only supported values: "underline" | "segmented" | "solid"
|
|
26
|
+
*
|
|
27
|
+
* - "underline" (default): modern underline indicator under active tab
|
|
28
|
+
* - "segmented": segmented pill style where selected tab looks like a pill
|
|
29
|
+
* - "solid": solid nav tabs (selected tab has solid background)
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'underline' | 'segmented' | 'solid';
|
|
32
|
+
/**
|
|
33
|
+
* Starting tab index (controlled by TabGroup defaultIndex)
|
|
34
|
+
*/
|
|
35
|
+
defaultIndex?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Extra classes for the outer group container
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Extra classes to apply to the TabList wrapper
|
|
42
|
+
*/
|
|
43
|
+
listClass?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Extra classes to apply to individual TabPanel wrapper
|
|
46
|
+
*/
|
|
47
|
+
panelClass?: string;
|
|
48
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Tabs: React.FC;
|
|
1
|
+
export * from './Tabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface TextContentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Render extra-small sized text (`text-xs/5`).
|
|
5
|
+
*/
|
|
6
|
+
xsmall?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Render small sized text (`text-sm/6`).
|
|
9
|
+
*/
|
|
10
|
+
small?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Render bold/semibold text (`font-semibold`).
|
|
13
|
+
*/
|
|
14
|
+
strong?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Apply muted gray tone (commonly used for secondary text).
|
|
17
|
+
*/
|
|
18
|
+
muted?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Apply error color styling (`text-red-500`).
|
|
21
|
+
*/
|
|
22
|
+
error?: boolean;
|
|
23
|
+
}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
xsmall?: boolean;
|
|
4
|
-
small?: boolean;
|
|
5
|
-
strong?: boolean;
|
|
6
|
-
muted?: boolean;
|
|
7
|
-
error?: boolean;
|
|
8
|
-
as?: keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
9
|
-
}
|
|
10
|
-
export declare const TextContent: React.FC<TextContentProps>;
|
|
1
|
+
export * from './TextContent';
|
|
2
|
+
export * from './TextContent.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import type { InputCustomProps } from '../common-type';
|
|
3
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, InputCustomProps {
|
|
4
|
+
rightGroup?: ReactNode | null;
|
|
5
|
+
leftGroup?: ReactNode | null;
|
|
6
|
+
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, InputCustomProps {
|
|
4
|
-
rightGroup?: ReactNode | null;
|
|
5
|
-
leftGroup?: ReactNode | null;
|
|
6
|
-
}
|
|
7
|
-
export declare const Textarea: React.FC<TextareaProps>;
|
|
1
|
+
export * from './Textarea';
|
|
2
|
+
export * from './Textarea.types';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
}
|
|
8
|
-
declare const Toast: React.FC<ToastProps>;
|
|
9
|
-
export default Toast;
|
|
2
|
+
import { ToastProps } from './Toast.types';
|
|
3
|
+
export declare const Toast: React.FC<ToastProps & {
|
|
4
|
+
isTop?: boolean;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props passed to the Toast UI component.
|
|
3
|
+
* This component is rendered internally by the ToastProvider.
|
|
4
|
+
*/
|
|
5
|
+
export interface ToastProps {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier of the toast instance.
|
|
8
|
+
* Generated internally by ToastProvider.
|
|
9
|
+
*/
|
|
10
|
+
id: number;
|
|
11
|
+
/**
|
|
12
|
+
* The message text displayed inside the toast.
|
|
13
|
+
*/
|
|
14
|
+
message: string;
|
|
15
|
+
/**
|
|
16
|
+
* Visual style of the toast based on its purpose.
|
|
17
|
+
* - `success` — positive confirmations
|
|
18
|
+
* - `error` — failures or critical issues
|
|
19
|
+
* - `info` — general helpful information
|
|
20
|
+
* - `warning` — caution or attention required
|
|
21
|
+
*/
|
|
22
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
23
|
+
/**
|
|
24
|
+
* Triggers removal of the toast.
|
|
25
|
+
* Managed internally by the ToastProvider.
|
|
26
|
+
*/
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Optional additional class names to customize the toast container.
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Utility type mapping the 4 possible toast types.
|
|
35
|
+
*/
|
|
36
|
+
export type ToastType = ToastProps['type'];
|
|
37
|
+
/**
|
|
38
|
+
* Options passed when calling `showToast()`.
|
|
39
|
+
*/
|
|
40
|
+
export interface ToastOptions {
|
|
41
|
+
/**
|
|
42
|
+
* The toast visual style.
|
|
43
|
+
* Defaults to `"info"` if not provided.
|
|
44
|
+
*/
|
|
45
|
+
type?: ToastType;
|
|
46
|
+
/**
|
|
47
|
+
* Duration the toast stays visible (in milliseconds).
|
|
48
|
+
* Defaults to 3000 ms.
|
|
49
|
+
*/
|
|
50
|
+
duration?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Should the toast automatically close after its duration?
|
|
53
|
+
* Defaults to `true`.
|
|
54
|
+
*/
|
|
55
|
+
autoClose?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* If true, hovering over the toast pauses auto-close timer.
|
|
58
|
+
* Defaults to `true`.
|
|
59
|
+
*/
|
|
60
|
+
pauseOnHover?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Internal structure stored inside the ToastProvider state.
|
|
64
|
+
* This is NOT exposed publicly.
|
|
65
|
+
*/
|
|
66
|
+
export interface IToast {
|
|
67
|
+
/** Unique toast ID */
|
|
68
|
+
id: number;
|
|
69
|
+
/** Toast message */
|
|
70
|
+
message: string;
|
|
71
|
+
/** Toast type variant */
|
|
72
|
+
type: ToastType;
|
|
73
|
+
/** Toast lifetime in milliseconds */
|
|
74
|
+
duration: number;
|
|
75
|
+
/** Whether the toast will auto-close */
|
|
76
|
+
autoClose: boolean;
|
|
77
|
+
/** Whether hover pauses auto closing */
|
|
78
|
+
pauseOnHover: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The methods exposed by the ToastProvider context.
|
|
82
|
+
* Accessible through the `useToast()` hook.
|
|
83
|
+
*/
|
|
84
|
+
export interface ToastContextType {
|
|
85
|
+
/**
|
|
86
|
+
* Imperatively show a toast message.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* showToast("Saved!", { type: "success" })
|
|
90
|
+
*/
|
|
91
|
+
showToast: (message: string, options?: ToastOptions) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Manually closes a toast by ID.
|
|
94
|
+
* Normally handled internally.
|
|
95
|
+
*/
|
|
96
|
+
closeToast: (id: number) => void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* All supported toast placements.
|
|
100
|
+
* Used by `<ToastProvider placement=\"...\"/>`
|
|
101
|
+
*/
|
|
102
|
+
export type ToastPlacement = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
103
|
+
/**
|
|
104
|
+
* Props for the ToastProvider.
|
|
105
|
+
* Wrap your application with this provider to enable toast notifications.
|
|
106
|
+
*/
|
|
107
|
+
export interface ToastProviderProps {
|
|
108
|
+
/**
|
|
109
|
+
* Your application or subtree where toast notifications should be available.
|
|
110
|
+
*/
|
|
111
|
+
children: React.ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Controls where toasts appear on the screen.
|
|
114
|
+
* Defaults to `"top-right"`.
|
|
115
|
+
*/
|
|
116
|
+
placement?: ToastPlacement;
|
|
117
|
+
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
-
type
|
|
3
|
-
interface ToastOptions {
|
|
4
|
-
type?: ToastType;
|
|
5
|
-
duration?: number;
|
|
6
|
-
autoClose?: boolean;
|
|
7
|
-
}
|
|
8
|
-
interface ToastContextType {
|
|
9
|
-
showToast: (message: string, options?: ToastOptions) => void;
|
|
10
|
-
closeToast: (id: number) => void;
|
|
11
|
-
}
|
|
2
|
+
import type { ToastContextType, ToastPlacement } from './Toast.types';
|
|
12
3
|
export declare const useToast: () => ToastContextType;
|
|
13
4
|
export declare const ToastProvider: React.FC<{
|
|
14
5
|
children: ReactNode;
|
|
6
|
+
placement?: ToastPlacement;
|
|
15
7
|
}>;
|
|
16
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataTableColumn, DataTableProps } from '../DataTable';
|
|
2
|
+
/**
|
|
3
|
+
* Props for VirtualizedDataTable
|
|
4
|
+
*/
|
|
5
|
+
export interface VirtualizedDataTableProps extends DataTableProps {
|
|
6
|
+
/** Height of each row in pixels (required for virtualization) */
|
|
7
|
+
rowHeight?: number;
|
|
8
|
+
/** Max height (px) the table body can take. AutoSizer will size to available space. */
|
|
9
|
+
maxHeight?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Row props passed to the custom rowComponent API of react-window.
|
|
13
|
+
* react-window will also pass index, style, and aria attributes.
|
|
14
|
+
*/
|
|
15
|
+
export type VirtualizedRowProps = {
|
|
16
|
+
items: any[];
|
|
17
|
+
columns: DataTableColumn[];
|
|
18
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RowComponentProps } from 'react-window';
|
|
2
|
+
import { VirtualizedRowProps } from './VirtualizedDataTable.types';
|
|
3
|
+
export declare const VirtualizedRow: ({ index, style, items, columns, gridTemplate, }: RowComponentProps<VirtualizedRowProps & {
|
|
4
|
+
gridTemplate: string;
|
|
5
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Available dialog placement modes.
|
|
4
|
+
*/
|
|
5
|
+
export type DialogPosition = 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
/**
|
|
7
|
+
* Sizes for the dialog panel when in center/top modes.
|
|
8
|
+
*/
|
|
9
|
+
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
10
|
+
export interface DialogProps {
|
|
11
|
+
/**
|
|
12
|
+
* Controls the visibility of the dialog.
|
|
13
|
+
*/
|
|
14
|
+
open: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Called when clicking overlay or pressing the ESC key.
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Dialog position on the screen.
|
|
21
|
+
* @default "center"
|
|
22
|
+
*/
|
|
23
|
+
position?: DialogPosition;
|
|
24
|
+
/**
|
|
25
|
+
* Controls dialog width for center/top/bottom modes.
|
|
26
|
+
* @default "md"
|
|
27
|
+
*/
|
|
28
|
+
size?: DialogSize;
|
|
29
|
+
/**
|
|
30
|
+
* Custom classes for overlay.
|
|
31
|
+
*/
|
|
32
|
+
overlayClass?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom classes for the panel.
|
|
35
|
+
*/
|
|
36
|
+
panelClass?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Child content of the dialog panel.
|
|
39
|
+
*/
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Controls if Dialog should have a backdrop
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
backdrop?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Controls if Dialog should close on ESC key press
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
closeOnEscape?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export type DialogSizeMap = Record<DialogSize, string>;
|
|
53
|
+
export type DialogPositionClassMap = Record<DialogPosition, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
|
2
2
|
export interface InputCustomProps {
|
|
3
3
|
/**
|
|
4
4
|
* Input field label
|
|
@@ -29,3 +29,4 @@ export interface InputCustomProps {
|
|
|
29
29
|
*/
|
|
30
30
|
showErrorMessage?: boolean;
|
|
31
31
|
}
|
|
32
|
+
export type PolymorphicProps<C extends ElementType, Props> = Props & Omit<ComponentPropsWithoutRef<C>, keyof Props | 'as'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsTablet: () => boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/Button';
|
|
|
7
7
|
export * from './components/Card';
|
|
8
8
|
export * from './components/Checkbox';
|
|
9
9
|
export * from './components/CheckboxGroup';
|
|
10
|
+
export * from './components/DataTable';
|
|
10
11
|
export * from './components/DetailedInformation';
|
|
11
12
|
export * from './components/Dot';
|
|
12
13
|
export * from './components/Drawer';
|
|
@@ -18,19 +19,23 @@ export * from './components/Label';
|
|
|
18
19
|
export * from './components/Loader';
|
|
19
20
|
export * from './components/Pagination';
|
|
20
21
|
export * from './components/PasswordInput';
|
|
21
|
-
export * from './components/
|
|
22
|
-
export * from './components/
|
|
23
|
-
export * from './components/
|
|
22
|
+
export * from './components/Radio';
|
|
23
|
+
export * from './components/RadioGroup';
|
|
24
|
+
export * from './components/RadioSwitch';
|
|
24
25
|
export * from './components/RangeInput';
|
|
26
|
+
export * from './components/RangeSlider';
|
|
25
27
|
export * from './components/SelectBox';
|
|
26
|
-
export * from './components/Table';
|
|
27
28
|
export * from './components/Tabs';
|
|
28
|
-
export * from './components/
|
|
29
|
+
export * from './components/Table';
|
|
29
30
|
export * from './components/TextContent';
|
|
30
31
|
export * from './components/Textarea';
|
|
31
32
|
export * from './components/Toast';
|
|
33
|
+
export * from './components/VirtualizedDataTable';
|
|
32
34
|
export * from './components/common-type';
|
|
33
|
-
export * from './
|
|
35
|
+
export * from './hooks/use-debounce';
|
|
36
|
+
export * from './hooks/use-is-mobile';
|
|
37
|
+
export * from './hooks/use-is-tablet';
|
|
34
38
|
export * from './utils/build-classname';
|
|
35
39
|
export * from './utils/is-array';
|
|
36
40
|
export * from './utils/is-empty';
|
|
41
|
+
export * from './utils/get';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function get<T = any, R = any>(obj: T, path: string, defaultValue?: R): R;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pk-design/react-tailwind",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "dist/react-tailwind.cjs.js",
|
|
5
5
|
"module": "dist/react-tailwind.es.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"prepare": "husky",
|
|
21
21
|
"format": "prettier --write .",
|
|
22
22
|
"lint": "prettier --check .",
|
|
23
|
-
"prepublishOnly": "pnpm run build"
|
|
23
|
+
"prepublishOnly": "pnpm run build",
|
|
24
|
+
"predeploy": "cd my-ui-pages && pnpm run build",
|
|
25
|
+
"deploy": "gh-pages -d my-ui-pages/dist -b gh-pages",
|
|
26
|
+
"test": "jest --watch",
|
|
27
|
+
"test:ci": "jest --runInBand --ci"
|
|
24
28
|
},
|
|
25
29
|
"peerDependencies": {
|
|
26
30
|
"@headlessui/react": "^2.2.9",
|
|
@@ -34,12 +38,15 @@
|
|
|
34
38
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
35
39
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
36
40
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
37
|
-
"@semantic-release/changelog": "
|
|
41
|
+
"@semantic-release/changelog": "~6.0.3",
|
|
38
42
|
"@semantic-release/git": "^10.0.1",
|
|
39
|
-
"@semantic-release/github": "^12.0.2",
|
|
40
43
|
"@semantic-release/npm": "^13.1.1",
|
|
41
44
|
"@semantic-release/release-notes-generator": "^13.0.0",
|
|
42
45
|
"@svgr/rollup": "^8.1.0",
|
|
46
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
47
|
+
"@testing-library/react": "^16.3.0",
|
|
48
|
+
"@testing-library/user-event": "^14.6.1",
|
|
49
|
+
"@types/jest": "^30.0.0",
|
|
43
50
|
"@types/node": "^24.10.0",
|
|
44
51
|
"@types/react": "^19.2.2",
|
|
45
52
|
"@types/react-dom": "^19.2.2",
|
|
@@ -52,12 +59,17 @@
|
|
|
52
59
|
"gh-pages": "^6.3.0",
|
|
53
60
|
"globals": "^16.4.0",
|
|
54
61
|
"husky": "^9.1.7",
|
|
62
|
+
"identity-obj-proxy": "^3.0.0",
|
|
63
|
+
"jest": "^30.2.0",
|
|
64
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
65
|
+
"jsdom-testing-mocks": "^1.16.0",
|
|
55
66
|
"lint-staged": "^16.2.6",
|
|
56
67
|
"prettier": "^3.6.2",
|
|
57
68
|
"rollup": "^4.24.0",
|
|
58
69
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
70
|
"rollup-plugin-postcss": "^4.0.2",
|
|
60
71
|
"semantic-release": "23.0.0",
|
|
72
|
+
"ts-jest": "^29.4.5",
|
|
61
73
|
"tslib": "^2.8.1",
|
|
62
74
|
"typescript": "~5.9.3",
|
|
63
75
|
"typescript-eslint": "^8.45.0"
|
|
@@ -93,5 +105,9 @@
|
|
|
93
105
|
"overrides": {
|
|
94
106
|
"conventional-changelog-writer": "6.0.1"
|
|
95
107
|
}
|
|
108
|
+
},
|
|
109
|
+
"dependencies": {
|
|
110
|
+
"@semantic-release/github": "~10.3.5",
|
|
111
|
+
"react-window": "^2.2.3"
|
|
96
112
|
}
|
|
97
113
|
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes, type HTMLAttributeAnchorTarget, type JSX, type JSXElementConstructor } from 'react';
|
|
2
|
-
export type ButtonTheme = 'primary' | 'secondary' | 'danger';
|
|
3
|
-
export type ButtonVariant = 'outlined' | 'default' | 'plain';
|
|
4
|
-
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
-
export type ThemedButtonClass = {
|
|
6
|
-
[key in ButtonTheme]: {
|
|
7
|
-
[key in ButtonVariant]: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export type SizeButtonClass = {
|
|
11
|
-
[key in ButtonSize]: string;
|
|
12
|
-
};
|
|
13
|
-
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
|
-
/**
|
|
15
|
-
* Controls button theme
|
|
16
|
-
* @default "primary"
|
|
17
|
-
*/
|
|
18
|
-
theme?: ButtonTheme;
|
|
19
|
-
/**
|
|
20
|
-
* Controls button variant
|
|
21
|
-
* @default "default"
|
|
22
|
-
*/
|
|
23
|
-
variant?: ButtonVariant;
|
|
24
|
-
/**
|
|
25
|
-
* Controls button size
|
|
26
|
-
* @default "md"
|
|
27
|
-
*/
|
|
28
|
-
size?: ButtonSize;
|
|
29
|
-
/**
|
|
30
|
-
* When treating button as Link, use "to"
|
|
31
|
-
*/
|
|
32
|
-
to?: string;
|
|
33
|
-
/**
|
|
34
|
-
* When treating button as Link, "target" for href behaviour
|
|
35
|
-
*/
|
|
36
|
-
target?: HTMLAttributeAnchorTarget;
|
|
37
|
-
/**
|
|
38
|
-
* When render button as some other JSX Element
|
|
39
|
-
*/
|
|
40
|
-
as?: keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
41
|
-
/**
|
|
42
|
-
* Controls the loading state of the button
|
|
43
|
-
*/
|
|
44
|
-
loading?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Text to appear when button is in loading state
|
|
47
|
-
* @default ""
|
|
48
|
-
*/
|
|
49
|
-
loadingText?: string;
|
|
50
|
-
/**
|
|
51
|
-
* 50% border radius for button
|
|
52
|
-
*/
|
|
53
|
-
rounded?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Renders icon only buttons with unique padding on X axis
|
|
56
|
-
*/
|
|
57
|
-
iconOnly?: boolean;
|
|
58
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React, { type InputHTMLAttributes } from 'react';
|
|
2
|
-
import { type InputCustomProps } from '../common-type';
|
|
3
|
-
export interface RadioButtonProps extends InputHTMLAttributes<HTMLInputElement>, InputCustomProps {
|
|
4
|
-
type?: 'radio';
|
|
5
|
-
wrapperClass?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const RadioButton: React.FC<RadioButtonProps>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { type ChangeEvent, type ReactNode } from 'react';
|
|
2
|
-
type RadionButtonGroupItem = {
|
|
3
|
-
label: string;
|
|
4
|
-
value: any;
|
|
5
|
-
};
|
|
6
|
-
export interface RadioButtonGroupProps {
|
|
7
|
-
name: string;
|
|
8
|
-
label?: ReactNode;
|
|
9
|
-
labelClass?: string;
|
|
10
|
-
labelWrapperClass?: string;
|
|
11
|
-
labelHint?: ReactNode;
|
|
12
|
-
containerClass?: string;
|
|
13
|
-
value?: any;
|
|
14
|
-
options: string[] | RadionButtonGroupItem[];
|
|
15
|
-
row?: boolean;
|
|
16
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare const RadioButtonGroup: React.FC<RadioButtonGroupProps>;
|
|
19
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type RadioGroupProps } from '@headlessui/react';
|
|
3
|
-
export type RadioSwitchItem = string | {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
};
|
|
8
|
-
export type RadioSwitchProps = RadioGroupProps & {
|
|
9
|
-
label?: string;
|
|
10
|
-
selected: string;
|
|
11
|
-
onChange: (value: string) => void;
|
|
12
|
-
items: RadioSwitchItem[];
|
|
13
|
-
};
|
|
14
|
-
export declare const RadioSwitch: React.FC<RadioSwitchProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { type HTMLAttributes, type JSX, type JSXElementConstructor } from 'react';
|
|
2
|
-
export type TagVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'error';
|
|
3
|
-
export interface TagProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
-
as?: keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
5
|
-
text: string;
|
|
6
|
-
onClose?: () => void;
|
|
7
|
-
variant?: TagVariant;
|
|
8
|
-
}
|
|
9
|
-
export type VariantMap = {
|
|
10
|
-
[k in TagVariant]: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const Tag: React.FC<TagProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDebounce: <T>(value: T, delay: number) => T;
|