@bricks-toolkit/toolkit 0.1.12 → 0.1.14
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/Button.types-BsQYqZml.d.ts +27 -0
- package/dist/Button.types-D-srlWFf.d.mts +27 -0
- package/dist/TextInput.types-DRI8HQza.d.mts +32 -0
- package/dist/TextInput.types-DRI8HQza.d.ts +32 -0
- package/dist/Tooltip.types-PbUasE3C.d.mts +36 -0
- package/dist/Tooltip.types-PbUasE3C.d.ts +36 -0
- package/dist/avatar/index.d.mts +29 -0
- package/dist/avatar/index.d.ts +29 -0
- package/dist/badge/index.d.mts +57 -0
- package/dist/badge/index.d.ts +57 -0
- package/dist/breadcrumbs/index.d.mts +32 -0
- package/dist/breadcrumbs/index.d.ts +32 -0
- package/dist/button/index.d.mts +8 -0
- package/dist/button/index.d.ts +8 -0
- package/dist/card/index.d.mts +42 -0
- package/dist/card/index.d.ts +42 -0
- package/dist/checkbox/index.d.mts +36 -0
- package/dist/checkbox/index.d.ts +36 -0
- package/dist/{chunk-B2FU2E2X.cjs → chunk-AJM3NV5N.cjs} +8 -0
- package/dist/{chunk-TBMIMUU4.mjs → chunk-G6CGG4QD.mjs} +8 -0
- package/dist/combo-box/index.d.mts +62 -0
- package/dist/combo-box/index.d.ts +62 -0
- package/dist/date-picker/index.d.mts +32 -0
- package/dist/date-picker/index.d.ts +32 -0
- package/dist/dialog/index.d.mts +61 -0
- package/dist/dialog/index.d.ts +61 -0
- package/dist/dropdown-menu/index.d.mts +34 -0
- package/dist/dropdown-menu/index.d.ts +34 -0
- package/dist/email/index.d.mts +38 -0
- package/dist/email/index.d.ts +38 -0
- package/dist/file-upload/index.d.mts +27 -0
- package/dist/file-upload/index.d.ts +27 -0
- package/dist/header/index.d.mts +28 -0
- package/dist/header/index.d.ts +28 -0
- package/dist/icon-button/index.d.mts +16 -0
- package/dist/icon-button/index.d.ts +16 -0
- package/dist/image/index.d.mts +48 -0
- package/dist/image/index.d.ts +48 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +141 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.mjs +1 -1
- package/dist/link/index.d.mts +25 -0
- package/dist/link/index.d.ts +25 -0
- package/dist/loader/index.d.mts +21 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/modal/index.d.mts +116 -0
- package/dist/modal/index.d.ts +116 -0
- package/dist/multi-select/index.d.mts +59 -0
- package/dist/multi-select/index.d.ts +59 -0
- package/dist/otp-input/index.d.mts +57 -0
- package/dist/otp-input/index.d.ts +57 -0
- package/dist/password-input/index.d.mts +32 -0
- package/dist/password-input/index.d.ts +32 -0
- package/dist/phone/index.cjs +2 -2
- package/dist/phone/index.d.mts +42 -0
- package/dist/phone/index.d.ts +42 -0
- package/dist/phone/index.mjs +1 -1
- package/dist/radio-button/index.d.mts +56 -0
- package/dist/radio-button/index.d.ts +56 -0
- package/dist/search-input/index.d.mts +22 -0
- package/dist/search-input/index.d.ts +22 -0
- package/dist/select/index.d.mts +36 -0
- package/dist/select/index.d.ts +36 -0
- package/dist/sidebar/index.d.mts +96 -0
- package/dist/sidebar/index.d.ts +96 -0
- package/dist/skeleton/index.d.mts +76 -0
- package/dist/skeleton/index.d.ts +76 -0
- package/dist/styles.d.mts +2 -0
- package/dist/styles.d.ts +2 -0
- package/dist/table/index.d.mts +92 -0
- package/dist/table/index.d.ts +92 -0
- package/dist/tabs/index.d.mts +26 -0
- package/dist/tabs/index.d.ts +26 -0
- package/dist/text-input/index.d.mts +7 -0
- package/dist/text-input/index.d.ts +7 -0
- package/dist/theme-provider/index.d.mts +122 -0
- package/dist/theme-provider/index.d.ts +122 -0
- package/dist/theme.css +62 -0
- package/dist/time-picker/index.d.mts +32 -0
- package/dist/time-picker/index.d.ts +32 -0
- package/dist/toaster/index.d.mts +28 -0
- package/dist/toaster/index.d.ts +28 -0
- package/dist/tooltip/index.d.mts +7 -0
- package/dist/tooltip/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { T as TextInputProps } from '../TextInput.types-DRI8HQza.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
interface SearchInputProps extends TextInputProps {
|
|
5
|
+
/**
|
|
6
|
+
* The delay in milliseconds before the onDebouncedChange callback is called.
|
|
7
|
+
* @default 300
|
|
8
|
+
*/
|
|
9
|
+
debounce?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Callback function called after the debounce delay with the current input value.
|
|
12
|
+
*/
|
|
13
|
+
onDebouncedChange?: (value: string) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* SearchInput component - A debounced input field for search functionality.
|
|
18
|
+
* Built on top of TextInput, it includes a search icon by default and handles debouncing.
|
|
19
|
+
*/
|
|
20
|
+
declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
|
|
22
|
+
export { SearchInput, type SearchInputProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SelectHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
|
|
4
|
+
type SelectSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
type SelectState = 'default' | 'error' | 'success' | 'warning';
|
|
6
|
+
interface SelectOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
12
|
+
label?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
helperText?: string;
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
successMessage?: string;
|
|
17
|
+
warningMessage?: string;
|
|
18
|
+
variant?: SelectVariant;
|
|
19
|
+
size?: SelectSize;
|
|
20
|
+
state?: SelectState;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
leftElement?: ReactNode;
|
|
23
|
+
rightElement?: ReactNode;
|
|
24
|
+
wrapperClassName?: string;
|
|
25
|
+
inputGroupClassName?: string;
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
labelClassName?: string;
|
|
28
|
+
helperClassName?: string;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
options?: SelectOption[];
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
35
|
+
|
|
36
|
+
export { Select, type SelectOption, type SelectProps, type SelectSize, type SelectState, type SelectVariant };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SelectHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
|
|
4
|
+
type SelectSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
type SelectState = 'default' | 'error' | 'success' | 'warning';
|
|
6
|
+
interface SelectOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
12
|
+
label?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
helperText?: string;
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
successMessage?: string;
|
|
17
|
+
warningMessage?: string;
|
|
18
|
+
variant?: SelectVariant;
|
|
19
|
+
size?: SelectSize;
|
|
20
|
+
state?: SelectState;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
leftElement?: ReactNode;
|
|
23
|
+
rightElement?: ReactNode;
|
|
24
|
+
wrapperClassName?: string;
|
|
25
|
+
inputGroupClassName?: string;
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
labelClassName?: string;
|
|
28
|
+
helperClassName?: string;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
options?: SelectOption[];
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
35
|
+
|
|
36
|
+
export { Select, type SelectOption, type SelectProps, type SelectSize, type SelectState, type SelectVariant };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ReactNode, ElementType, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
interface SidebarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
href?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
badge?: ReactNode;
|
|
11
|
+
/** Optional component to use for the item (e.g., NavLink) */
|
|
12
|
+
component?: ElementType;
|
|
13
|
+
/** Optional props for the custom component */
|
|
14
|
+
componentProps?: Record<string, unknown>;
|
|
15
|
+
/** Optional nested items */
|
|
16
|
+
items?: SidebarItem[];
|
|
17
|
+
/** Whether the item is currently expanded (for nested items) */
|
|
18
|
+
isExpanded?: boolean;
|
|
19
|
+
/** Whether the item should be hidden */
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface SidebarGroup {
|
|
23
|
+
id: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
items: SidebarItem[];
|
|
26
|
+
/** Whether the group should be hidden */
|
|
27
|
+
hidden?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface SidebarClassNames {
|
|
30
|
+
root?: string;
|
|
31
|
+
header?: string;
|
|
32
|
+
content?: string;
|
|
33
|
+
footer?: string;
|
|
34
|
+
group?: string;
|
|
35
|
+
groupLabel?: string;
|
|
36
|
+
item?: string;
|
|
37
|
+
itemIcon?: string;
|
|
38
|
+
itemLabel?: string;
|
|
39
|
+
itemActive?: string;
|
|
40
|
+
itemCollapsed?: string;
|
|
41
|
+
toggleButton?: string;
|
|
42
|
+
}
|
|
43
|
+
interface SidebarStyles {
|
|
44
|
+
root?: CSSProperties;
|
|
45
|
+
header?: CSSProperties;
|
|
46
|
+
content?: CSSProperties;
|
|
47
|
+
footer?: CSSProperties;
|
|
48
|
+
group?: CSSProperties;
|
|
49
|
+
groupLabel?: CSSProperties;
|
|
50
|
+
item?: CSSProperties;
|
|
51
|
+
itemIcon?: CSSProperties;
|
|
52
|
+
itemLabel?: CSSProperties;
|
|
53
|
+
toggleButton?: CSSProperties;
|
|
54
|
+
}
|
|
55
|
+
interface SidebarProps {
|
|
56
|
+
/** Groups of navigation items to display in the sidebar. */
|
|
57
|
+
groups: SidebarGroup[];
|
|
58
|
+
/** Whether the sidebar is in its collapsed state. */
|
|
59
|
+
isCollapsed?: boolean;
|
|
60
|
+
/** Callback triggered when the collapsed state changes. */
|
|
61
|
+
onToggleCollapse?: (isCollapsed: boolean) => void;
|
|
62
|
+
/** Optional logo or brand element to display at the top. */
|
|
63
|
+
logo?: ReactNode;
|
|
64
|
+
/** Optional footer content. */
|
|
65
|
+
footer?: ReactNode;
|
|
66
|
+
/** Additional CSS classes for the container. */
|
|
67
|
+
className?: string;
|
|
68
|
+
/** Whether to show the glass effect. */
|
|
69
|
+
glass?: boolean;
|
|
70
|
+
/** Custom width for expanded state (default: 288px / 72rem) */
|
|
71
|
+
width?: string | number;
|
|
72
|
+
/** Custom width for collapsed state (default: 80px / 20rem) */
|
|
73
|
+
collapsedWidth?: string | number;
|
|
74
|
+
/** Whether to show the built-in collapse toggle button */
|
|
75
|
+
showToggleButton?: boolean;
|
|
76
|
+
/** Position of the toggle button ('top' | 'bottom' | 'center') */
|
|
77
|
+
togglePosition?: 'top' | 'bottom' | 'center';
|
|
78
|
+
/** Placement of the sidebar */
|
|
79
|
+
position?: 'left' | 'right';
|
|
80
|
+
/** Whether icons should be centered when collapsed */
|
|
81
|
+
centerIcons?: boolean;
|
|
82
|
+
/** Deep customization of CSS classes */
|
|
83
|
+
classNames?: SidebarClassNames;
|
|
84
|
+
/** Deep customization of inline styles */
|
|
85
|
+
styles?: SidebarStyles;
|
|
86
|
+
/** Custom render function for items */
|
|
87
|
+
renderItem?: (item: SidebarItem, isCollapsed: boolean) => ReactNode;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface SidebarComponent {
|
|
91
|
+
(props: SidebarProps): React.JSX.Element;
|
|
92
|
+
displayName?: string;
|
|
93
|
+
}
|
|
94
|
+
declare const Sidebar: SidebarComponent;
|
|
95
|
+
|
|
96
|
+
export { Sidebar, type SidebarGroup, type SidebarItem, type SidebarProps };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ReactNode, ElementType, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
interface SidebarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
href?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
badge?: ReactNode;
|
|
11
|
+
/** Optional component to use for the item (e.g., NavLink) */
|
|
12
|
+
component?: ElementType;
|
|
13
|
+
/** Optional props for the custom component */
|
|
14
|
+
componentProps?: Record<string, unknown>;
|
|
15
|
+
/** Optional nested items */
|
|
16
|
+
items?: SidebarItem[];
|
|
17
|
+
/** Whether the item is currently expanded (for nested items) */
|
|
18
|
+
isExpanded?: boolean;
|
|
19
|
+
/** Whether the item should be hidden */
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface SidebarGroup {
|
|
23
|
+
id: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
items: SidebarItem[];
|
|
26
|
+
/** Whether the group should be hidden */
|
|
27
|
+
hidden?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface SidebarClassNames {
|
|
30
|
+
root?: string;
|
|
31
|
+
header?: string;
|
|
32
|
+
content?: string;
|
|
33
|
+
footer?: string;
|
|
34
|
+
group?: string;
|
|
35
|
+
groupLabel?: string;
|
|
36
|
+
item?: string;
|
|
37
|
+
itemIcon?: string;
|
|
38
|
+
itemLabel?: string;
|
|
39
|
+
itemActive?: string;
|
|
40
|
+
itemCollapsed?: string;
|
|
41
|
+
toggleButton?: string;
|
|
42
|
+
}
|
|
43
|
+
interface SidebarStyles {
|
|
44
|
+
root?: CSSProperties;
|
|
45
|
+
header?: CSSProperties;
|
|
46
|
+
content?: CSSProperties;
|
|
47
|
+
footer?: CSSProperties;
|
|
48
|
+
group?: CSSProperties;
|
|
49
|
+
groupLabel?: CSSProperties;
|
|
50
|
+
item?: CSSProperties;
|
|
51
|
+
itemIcon?: CSSProperties;
|
|
52
|
+
itemLabel?: CSSProperties;
|
|
53
|
+
toggleButton?: CSSProperties;
|
|
54
|
+
}
|
|
55
|
+
interface SidebarProps {
|
|
56
|
+
/** Groups of navigation items to display in the sidebar. */
|
|
57
|
+
groups: SidebarGroup[];
|
|
58
|
+
/** Whether the sidebar is in its collapsed state. */
|
|
59
|
+
isCollapsed?: boolean;
|
|
60
|
+
/** Callback triggered when the collapsed state changes. */
|
|
61
|
+
onToggleCollapse?: (isCollapsed: boolean) => void;
|
|
62
|
+
/** Optional logo or brand element to display at the top. */
|
|
63
|
+
logo?: ReactNode;
|
|
64
|
+
/** Optional footer content. */
|
|
65
|
+
footer?: ReactNode;
|
|
66
|
+
/** Additional CSS classes for the container. */
|
|
67
|
+
className?: string;
|
|
68
|
+
/** Whether to show the glass effect. */
|
|
69
|
+
glass?: boolean;
|
|
70
|
+
/** Custom width for expanded state (default: 288px / 72rem) */
|
|
71
|
+
width?: string | number;
|
|
72
|
+
/** Custom width for collapsed state (default: 80px / 20rem) */
|
|
73
|
+
collapsedWidth?: string | number;
|
|
74
|
+
/** Whether to show the built-in collapse toggle button */
|
|
75
|
+
showToggleButton?: boolean;
|
|
76
|
+
/** Position of the toggle button ('top' | 'bottom' | 'center') */
|
|
77
|
+
togglePosition?: 'top' | 'bottom' | 'center';
|
|
78
|
+
/** Placement of the sidebar */
|
|
79
|
+
position?: 'left' | 'right';
|
|
80
|
+
/** Whether icons should be centered when collapsed */
|
|
81
|
+
centerIcons?: boolean;
|
|
82
|
+
/** Deep customization of CSS classes */
|
|
83
|
+
classNames?: SidebarClassNames;
|
|
84
|
+
/** Deep customization of inline styles */
|
|
85
|
+
styles?: SidebarStyles;
|
|
86
|
+
/** Custom render function for items */
|
|
87
|
+
renderItem?: (item: SidebarItem, isCollapsed: boolean) => ReactNode;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface SidebarComponent {
|
|
91
|
+
(props: SidebarProps): React.JSX.Element;
|
|
92
|
+
displayName?: string;
|
|
93
|
+
}
|
|
94
|
+
declare const Sidebar: SidebarComponent;
|
|
95
|
+
|
|
96
|
+
export { Sidebar, type SidebarGroup, type SidebarItem, type SidebarProps };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type SkeletonVariant = 'default' | 'wave' | 'pulse';
|
|
4
|
+
type SkeletonShape = 'rectangle' | 'circle' | 'rounded';
|
|
5
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Animation style of the skeleton. Defaults to 'wave'. */
|
|
7
|
+
variant?: SkeletonVariant;
|
|
8
|
+
/** Shape of the skeleton block. Defaults to 'rectangle'. */
|
|
9
|
+
shape?: SkeletonShape;
|
|
10
|
+
/** Explicit width (e.g. '100%', '200px'). Falls back to the element's natural width. */
|
|
11
|
+
width?: string | number;
|
|
12
|
+
/** Explicit height (e.g. '1rem', 48). Falls back to the element's natural height. */
|
|
13
|
+
height?: string | number;
|
|
14
|
+
}
|
|
15
|
+
interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** Number of text lines to render. Defaults to 3. */
|
|
17
|
+
lines?: number;
|
|
18
|
+
/** Animation variant forwarded to each line. Defaults to 'wave'. */
|
|
19
|
+
variant?: SkeletonVariant;
|
|
20
|
+
/** When true the last line is shorter (≈ 60 %) to look like natural prose. Defaults to true. */
|
|
21
|
+
shortLast?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface SkeletonAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
24
|
+
/** Diameter of the avatar circle in pixels. Defaults to 40. */
|
|
25
|
+
size?: number;
|
|
26
|
+
/** Animation variant. Defaults to 'wave'. */
|
|
27
|
+
variant?: SkeletonVariant;
|
|
28
|
+
}
|
|
29
|
+
interface SkeletonCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/** Show a header image placeholder at the top of the card. Defaults to true. */
|
|
31
|
+
showImage?: boolean;
|
|
32
|
+
/** Height of the image placeholder in pixels. Defaults to 160. */
|
|
33
|
+
imageHeight?: number;
|
|
34
|
+
/** Number of text-line skeletons in the body. Defaults to 3. */
|
|
35
|
+
lines?: number;
|
|
36
|
+
/** Animation variant forwarded to all children. Defaults to 'wave'. */
|
|
37
|
+
variant?: SkeletonVariant;
|
|
38
|
+
}
|
|
39
|
+
interface SkeletonTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
/** Number of rows to render. Defaults to 5. */
|
|
41
|
+
rows?: number;
|
|
42
|
+
/** Number of columns to render. Defaults to 4. */
|
|
43
|
+
columns?: number;
|
|
44
|
+
/** Animation variant. Defaults to 'wave'. */
|
|
45
|
+
variant?: SkeletonVariant;
|
|
46
|
+
/** Show a header row above the body rows. Defaults to true. */
|
|
47
|
+
showHeader?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Primitive skeleton block. Use this as the building brick for any custom
|
|
52
|
+
* layout skeleton you need.
|
|
53
|
+
*/
|
|
54
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* Multi-line text placeholder. The last line is intentionally shorter to
|
|
57
|
+
* mimic natural prose paragraph endings.
|
|
58
|
+
*/
|
|
59
|
+
declare const SkeletonText: React.ForwardRefExoticComponent<SkeletonTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
/**
|
|
61
|
+
* Circular avatar placeholder. Pairs naturally with SkeletonText to build
|
|
62
|
+
* user-card or comment-thread loaders.
|
|
63
|
+
*/
|
|
64
|
+
declare const SkeletonAvatar: React.ForwardRefExoticComponent<SkeletonAvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
/**
|
|
66
|
+
* Pre-composed card skeleton mirroring the Card component structure:
|
|
67
|
+
* optional hero image → title → description lines → action bar.
|
|
68
|
+
*/
|
|
69
|
+
declare const SkeletonCard: React.ForwardRefExoticComponent<SkeletonCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
/**
|
|
71
|
+
* Full table placeholder matching the Table component's visual grid.
|
|
72
|
+
* Renders a configurable number of column headers and body rows.
|
|
73
|
+
*/
|
|
74
|
+
declare const SkeletonTable: React.ForwardRefExoticComponent<SkeletonTableProps & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
|
|
76
|
+
export { Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, type SkeletonShape, SkeletonTable, type SkeletonTableProps, SkeletonText, type SkeletonTextProps, type SkeletonVariant };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type SkeletonVariant = 'default' | 'wave' | 'pulse';
|
|
4
|
+
type SkeletonShape = 'rectangle' | 'circle' | 'rounded';
|
|
5
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Animation style of the skeleton. Defaults to 'wave'. */
|
|
7
|
+
variant?: SkeletonVariant;
|
|
8
|
+
/** Shape of the skeleton block. Defaults to 'rectangle'. */
|
|
9
|
+
shape?: SkeletonShape;
|
|
10
|
+
/** Explicit width (e.g. '100%', '200px'). Falls back to the element's natural width. */
|
|
11
|
+
width?: string | number;
|
|
12
|
+
/** Explicit height (e.g. '1rem', 48). Falls back to the element's natural height. */
|
|
13
|
+
height?: string | number;
|
|
14
|
+
}
|
|
15
|
+
interface SkeletonTextProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** Number of text lines to render. Defaults to 3. */
|
|
17
|
+
lines?: number;
|
|
18
|
+
/** Animation variant forwarded to each line. Defaults to 'wave'. */
|
|
19
|
+
variant?: SkeletonVariant;
|
|
20
|
+
/** When true the last line is shorter (≈ 60 %) to look like natural prose. Defaults to true. */
|
|
21
|
+
shortLast?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface SkeletonAvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
24
|
+
/** Diameter of the avatar circle in pixels. Defaults to 40. */
|
|
25
|
+
size?: number;
|
|
26
|
+
/** Animation variant. Defaults to 'wave'. */
|
|
27
|
+
variant?: SkeletonVariant;
|
|
28
|
+
}
|
|
29
|
+
interface SkeletonCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/** Show a header image placeholder at the top of the card. Defaults to true. */
|
|
31
|
+
showImage?: boolean;
|
|
32
|
+
/** Height of the image placeholder in pixels. Defaults to 160. */
|
|
33
|
+
imageHeight?: number;
|
|
34
|
+
/** Number of text-line skeletons in the body. Defaults to 3. */
|
|
35
|
+
lines?: number;
|
|
36
|
+
/** Animation variant forwarded to all children. Defaults to 'wave'. */
|
|
37
|
+
variant?: SkeletonVariant;
|
|
38
|
+
}
|
|
39
|
+
interface SkeletonTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
/** Number of rows to render. Defaults to 5. */
|
|
41
|
+
rows?: number;
|
|
42
|
+
/** Number of columns to render. Defaults to 4. */
|
|
43
|
+
columns?: number;
|
|
44
|
+
/** Animation variant. Defaults to 'wave'. */
|
|
45
|
+
variant?: SkeletonVariant;
|
|
46
|
+
/** Show a header row above the body rows. Defaults to true. */
|
|
47
|
+
showHeader?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Primitive skeleton block. Use this as the building brick for any custom
|
|
52
|
+
* layout skeleton you need.
|
|
53
|
+
*/
|
|
54
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* Multi-line text placeholder. The last line is intentionally shorter to
|
|
57
|
+
* mimic natural prose paragraph endings.
|
|
58
|
+
*/
|
|
59
|
+
declare const SkeletonText: React.ForwardRefExoticComponent<SkeletonTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
/**
|
|
61
|
+
* Circular avatar placeholder. Pairs naturally with SkeletonText to build
|
|
62
|
+
* user-card or comment-thread loaders.
|
|
63
|
+
*/
|
|
64
|
+
declare const SkeletonAvatar: React.ForwardRefExoticComponent<SkeletonAvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
+
/**
|
|
66
|
+
* Pre-composed card skeleton mirroring the Card component structure:
|
|
67
|
+
* optional hero image → title → description lines → action bar.
|
|
68
|
+
*/
|
|
69
|
+
declare const SkeletonCard: React.ForwardRefExoticComponent<SkeletonCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
/**
|
|
71
|
+
* Full table placeholder matching the Table component's visual grid.
|
|
72
|
+
* Renders a configurable number of column headers and body rows.
|
|
73
|
+
*/
|
|
74
|
+
declare const SkeletonTable: React.ForwardRefExoticComponent<SkeletonTableProps & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
|
|
76
|
+
export { Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, type SkeletonShape, SkeletonTable, type SkeletonTableProps, SkeletonText, type SkeletonTextProps, type SkeletonVariant };
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type TableAlign = 'left' | 'center' | 'right';
|
|
4
|
+
type TableSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
interface TableColumn<T> {
|
|
6
|
+
/** Unique key identifying this column (also used as data accessor when render is omitted). */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Header label shown in <th>. */
|
|
9
|
+
header: ReactNode;
|
|
10
|
+
/** Custom cell renderer. Receives the row object and its index. */
|
|
11
|
+
render?: (row: T, rowIndex: number) => ReactNode;
|
|
12
|
+
/** When true a sort toggle is shown in the header. */
|
|
13
|
+
sortable?: boolean;
|
|
14
|
+
/** Column width, e.g. '120px' or '10%'. */
|
|
15
|
+
width?: CSSProperties['width'];
|
|
16
|
+
/** Text alignment for both header and cells. Defaults to 'left'. */
|
|
17
|
+
align?: TableAlign;
|
|
18
|
+
/** Extra class applied to every <td> in this column. */
|
|
19
|
+
cellClassName?: string;
|
|
20
|
+
/** Extra class applied to the <th> of this column. */
|
|
21
|
+
headerClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
type SortDirection = 'asc' | 'desc';
|
|
24
|
+
interface SortState {
|
|
25
|
+
key: string;
|
|
26
|
+
direction: SortDirection;
|
|
27
|
+
}
|
|
28
|
+
type TableHeaderVariant = 'light' | 'dark';
|
|
29
|
+
interface TableProps<T extends object> {
|
|
30
|
+
/** Array of data rows. */
|
|
31
|
+
data: T[];
|
|
32
|
+
/** Column definitions. */
|
|
33
|
+
columns: TableColumn<T>[];
|
|
34
|
+
/** Returns a unique key for each row (required for React reconciliation). */
|
|
35
|
+
rowKey: (row: T) => string | number;
|
|
36
|
+
/** Show a loading skeleton overlay. */
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/** Message (or element) shown when data is empty. */
|
|
39
|
+
emptyMessage?: ReactNode;
|
|
40
|
+
/** Alternate row background colours. */
|
|
41
|
+
striped?: boolean;
|
|
42
|
+
/** Render outer and inner borders. */
|
|
43
|
+
bordered?: boolean;
|
|
44
|
+
/** Highlight row on hover. */
|
|
45
|
+
hoverable?: boolean;
|
|
46
|
+
/** Makes the header stick to the top when scrolling. */
|
|
47
|
+
stickyHeader?: boolean;
|
|
48
|
+
/** Cell padding size. Defaults to 'md'. */
|
|
49
|
+
size?: TableSize;
|
|
50
|
+
/** External sort state (controlled). When omitted, sorting is internal. */
|
|
51
|
+
sortState?: SortState;
|
|
52
|
+
/** Called when the user clicks a sortable header. */
|
|
53
|
+
onSortChange?: (sort: SortState) => void;
|
|
54
|
+
/** Additional class for the outer wrapper. */
|
|
55
|
+
className?: string;
|
|
56
|
+
/** Additional class for the <table> element. */
|
|
57
|
+
tableClassName?: string;
|
|
58
|
+
/** Pagination configuration. If null or undefined, pagination is hidden. */
|
|
59
|
+
pagination?: PaginationProps | null;
|
|
60
|
+
/** Variant for the table header */
|
|
61
|
+
headerVariant?: TableHeaderVariant;
|
|
62
|
+
}
|
|
63
|
+
interface PaginationProps {
|
|
64
|
+
/** Total number of items across all pages. */
|
|
65
|
+
total: number;
|
|
66
|
+
/** Current page index (1-based). */
|
|
67
|
+
page: number;
|
|
68
|
+
/** Number of rows per page. */
|
|
69
|
+
pageSize: number;
|
|
70
|
+
/** Total number of pages. */
|
|
71
|
+
totalPages?: number;
|
|
72
|
+
/** Whether there is a next page. */
|
|
73
|
+
hasNextPage?: boolean;
|
|
74
|
+
/** Whether there is a previous page. */
|
|
75
|
+
hasPrevPage?: boolean;
|
|
76
|
+
/** Called when the user navigates to a new page. */
|
|
77
|
+
onPageChange: (page: number) => void;
|
|
78
|
+
/** Called when the user picks a new page size. */
|
|
79
|
+
onPageSizeChange?: (size: number) => void;
|
|
80
|
+
/** Available page-size options. Defaults to [10, 20, 50]. */
|
|
81
|
+
pageSizeOptions?: number[];
|
|
82
|
+
/** Show the page-size selector. Defaults to true when onPageSizeChange is provided. */
|
|
83
|
+
showSizeChanger?: boolean;
|
|
84
|
+
/** Additional class for the pagination wrapper. */
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare function Table<T extends object>({ data, columns, rowKey, loading, emptyMessage, striped, bordered, hoverable, stickyHeader, size, sortState: externalSort, onSortChange, className, tableClassName, pagination, headerVariant, }: TableProps<T>): React__default.JSX.Element;
|
|
89
|
+
|
|
90
|
+
declare function Pagination({ total, page, pageSize, totalPages: propTotalPages, hasNextPage: propHasNextPage, hasPrevPage: propHasPrevPage, onPageChange, onPageSizeChange, pageSizeOptions, showSizeChanger, className, }: PaginationProps): React__default.JSX.Element;
|
|
91
|
+
|
|
92
|
+
export { Pagination, type PaginationProps, type SortDirection, type SortState, Table, type TableAlign, type TableColumn, type TableHeaderVariant, type TableProps, type TableSize };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type TableAlign = 'left' | 'center' | 'right';
|
|
4
|
+
type TableSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
interface TableColumn<T> {
|
|
6
|
+
/** Unique key identifying this column (also used as data accessor when render is omitted). */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Header label shown in <th>. */
|
|
9
|
+
header: ReactNode;
|
|
10
|
+
/** Custom cell renderer. Receives the row object and its index. */
|
|
11
|
+
render?: (row: T, rowIndex: number) => ReactNode;
|
|
12
|
+
/** When true a sort toggle is shown in the header. */
|
|
13
|
+
sortable?: boolean;
|
|
14
|
+
/** Column width, e.g. '120px' or '10%'. */
|
|
15
|
+
width?: CSSProperties['width'];
|
|
16
|
+
/** Text alignment for both header and cells. Defaults to 'left'. */
|
|
17
|
+
align?: TableAlign;
|
|
18
|
+
/** Extra class applied to every <td> in this column. */
|
|
19
|
+
cellClassName?: string;
|
|
20
|
+
/** Extra class applied to the <th> of this column. */
|
|
21
|
+
headerClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
type SortDirection = 'asc' | 'desc';
|
|
24
|
+
interface SortState {
|
|
25
|
+
key: string;
|
|
26
|
+
direction: SortDirection;
|
|
27
|
+
}
|
|
28
|
+
type TableHeaderVariant = 'light' | 'dark';
|
|
29
|
+
interface TableProps<T extends object> {
|
|
30
|
+
/** Array of data rows. */
|
|
31
|
+
data: T[];
|
|
32
|
+
/** Column definitions. */
|
|
33
|
+
columns: TableColumn<T>[];
|
|
34
|
+
/** Returns a unique key for each row (required for React reconciliation). */
|
|
35
|
+
rowKey: (row: T) => string | number;
|
|
36
|
+
/** Show a loading skeleton overlay. */
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/** Message (or element) shown when data is empty. */
|
|
39
|
+
emptyMessage?: ReactNode;
|
|
40
|
+
/** Alternate row background colours. */
|
|
41
|
+
striped?: boolean;
|
|
42
|
+
/** Render outer and inner borders. */
|
|
43
|
+
bordered?: boolean;
|
|
44
|
+
/** Highlight row on hover. */
|
|
45
|
+
hoverable?: boolean;
|
|
46
|
+
/** Makes the header stick to the top when scrolling. */
|
|
47
|
+
stickyHeader?: boolean;
|
|
48
|
+
/** Cell padding size. Defaults to 'md'. */
|
|
49
|
+
size?: TableSize;
|
|
50
|
+
/** External sort state (controlled). When omitted, sorting is internal. */
|
|
51
|
+
sortState?: SortState;
|
|
52
|
+
/** Called when the user clicks a sortable header. */
|
|
53
|
+
onSortChange?: (sort: SortState) => void;
|
|
54
|
+
/** Additional class for the outer wrapper. */
|
|
55
|
+
className?: string;
|
|
56
|
+
/** Additional class for the <table> element. */
|
|
57
|
+
tableClassName?: string;
|
|
58
|
+
/** Pagination configuration. If null or undefined, pagination is hidden. */
|
|
59
|
+
pagination?: PaginationProps | null;
|
|
60
|
+
/** Variant for the table header */
|
|
61
|
+
headerVariant?: TableHeaderVariant;
|
|
62
|
+
}
|
|
63
|
+
interface PaginationProps {
|
|
64
|
+
/** Total number of items across all pages. */
|
|
65
|
+
total: number;
|
|
66
|
+
/** Current page index (1-based). */
|
|
67
|
+
page: number;
|
|
68
|
+
/** Number of rows per page. */
|
|
69
|
+
pageSize: number;
|
|
70
|
+
/** Total number of pages. */
|
|
71
|
+
totalPages?: number;
|
|
72
|
+
/** Whether there is a next page. */
|
|
73
|
+
hasNextPage?: boolean;
|
|
74
|
+
/** Whether there is a previous page. */
|
|
75
|
+
hasPrevPage?: boolean;
|
|
76
|
+
/** Called when the user navigates to a new page. */
|
|
77
|
+
onPageChange: (page: number) => void;
|
|
78
|
+
/** Called when the user picks a new page size. */
|
|
79
|
+
onPageSizeChange?: (size: number) => void;
|
|
80
|
+
/** Available page-size options. Defaults to [10, 20, 50]. */
|
|
81
|
+
pageSizeOptions?: number[];
|
|
82
|
+
/** Show the page-size selector. Defaults to true when onPageSizeChange is provided. */
|
|
83
|
+
showSizeChanger?: boolean;
|
|
84
|
+
/** Additional class for the pagination wrapper. */
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare function Table<T extends object>({ data, columns, rowKey, loading, emptyMessage, striped, bordered, hoverable, stickyHeader, size, sortState: externalSort, onSortChange, className, tableClassName, pagination, headerVariant, }: TableProps<T>): React__default.JSX.Element;
|
|
89
|
+
|
|
90
|
+
declare function Pagination({ total, page, pageSize, totalPages: propTotalPages, hasNextPage: propHasNextPage, hasPrevPage: propHasPrevPage, onPageChange, onPageSizeChange, pageSizeOptions, showSizeChanger, className, }: PaginationProps): React__default.JSX.Element;
|
|
91
|
+
|
|
92
|
+
export { Pagination, type PaginationProps, type SortDirection, type SortState, Table, type TableAlign, type TableColumn, type TableHeaderVariant, type TableProps, type TableSize };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
type TabsVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
|
|
4
|
+
type TabsSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
interface TabItem {
|
|
6
|
+
id: string;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
12
|
+
items: TabItem[];
|
|
13
|
+
defaultSelectedId?: string;
|
|
14
|
+
selectedId?: string;
|
|
15
|
+
onChange?: (id: string) => void;
|
|
16
|
+
variant?: TabsVariant;
|
|
17
|
+
size?: TabsSize;
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
tabListClassName?: string;
|
|
20
|
+
tabClassName?: string;
|
|
21
|
+
tabPanelClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
|
|
26
|
+
export { type TabItem, Tabs, type TabsProps, type TabsSize, type TabsVariant };
|