@esperanca-ui/componentes 2.1.1
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/README.md +120 -0
- package/dist/componentes-esperanca.es.js +20794 -0
- package/dist/componentes-esperanca.es.js.map +1 -0
- package/dist/componentes-esperanca.umd.js +100 -0
- package/dist/componentes-esperanca.umd.js.map +1 -0
- package/dist/components/Background/Background.d.ts +14 -0
- package/dist/components/Background/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Card/Card.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.d.ts +16 -0
- package/dist/components/ComboBox/ComboBox.d.ts +26 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +11 -0
- package/dist/components/FormSidebar/FormSidebar.d.ts +23 -0
- package/dist/components/Grid/Grid.d.ts +13 -0
- package/dist/components/Grid/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +15 -0
- package/dist/components/Loading/Loading.d.ts +8 -0
- package/dist/components/MetricCard/MetricCard.d.ts +11 -0
- package/dist/components/Modal/Modal.d.ts +12 -0
- package/dist/components/PageHeader/PageHeader.d.ts +12 -0
- package/dist/components/Portal/Portal.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts +36 -0
- package/dist/components/Sidebar/Sidebar.d.ts +81 -0
- package/dist/components/Table/DataTable.d.ts +36 -0
- package/dist/components/Textarea/Textarea.d.ts +15 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +16 -0
- package/dist/components/ThemeProvider/index.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +18 -0
- package/dist/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/hooks/useAnnouncements.d.ts +4 -0
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useFocusTrap.d.ts +1 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +4 -0
- package/dist/hooks/useMediaQuery.d.ts +10 -0
- package/dist/hooks/useTheme.d.ts +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/style.css +1 -0
- package/dist/utils/aria.d.ts +16 -0
- package/dist/utils/responsive.d.ts +9 -0
- package/dist/utils/styles.d.ts +4 -0
- package/package.json +51 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BackgroundProps {
|
|
4
|
+
theme?: 'light' | 'dark';
|
|
5
|
+
gradient?: string;
|
|
6
|
+
pattern?: 'none' | 'dots' | 'grid' | 'waves';
|
|
7
|
+
opacity?: number;
|
|
8
|
+
blendMode?: React.CSSProperties['mixBlendMode'];
|
|
9
|
+
fullScreen?: boolean;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
export declare function Background({ theme, gradient, pattern, opacity, blendMode, fullScreen, children, className, style, }: BackgroundProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The visual style of the button.
|
|
6
|
+
* @default 'primary'
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'ghost' | 'outline';
|
|
9
|
+
/**
|
|
10
|
+
* The size of the button.
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the button will take up the full width of its container.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If `true`, the button will be in a loading state.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The text to display when the button is in a loading state.
|
|
26
|
+
*/
|
|
27
|
+
loadingText?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* An icon to display to the left of the button's text.
|
|
30
|
+
*/
|
|
31
|
+
leftIcon?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* An icon to display to the right of the button's text.
|
|
34
|
+
*/
|
|
35
|
+
rightIcon?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export declare function Button({ variant, size, fullWidth, isLoading, loadingText, leftIcon, rightIcon, className, style, type, disabled, children, ...buttonProps }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
variant?: 'elevated' | 'outlined' | 'filled' | 'glass';
|
|
5
|
+
interactive?: boolean;
|
|
6
|
+
glassOpacity?: number;
|
|
7
|
+
glassBlur?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const CardBase: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
12
|
+
export declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
13
|
+
export declare const CardBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
16
|
+
Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
Title: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
Description: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
Body: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
Footer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
helperText?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
wrapperClassName?: string;
|
|
10
|
+
inputClassName?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ComboBoxOption = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface ComboBoxProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'children' | 'value' | 'onChange'> {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
helperText?: React.ReactNode;
|
|
11
|
+
error?: React.ReactNode;
|
|
12
|
+
options: ComboBoxOption[];
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
wrapperClassName?: string;
|
|
15
|
+
selectClassName?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
value?: string | number;
|
|
20
|
+
onChange?: (value: string | number, option: ComboBoxOption) => void;
|
|
21
|
+
searchable?: boolean;
|
|
22
|
+
searchPlaceholder?: string;
|
|
23
|
+
emptyText?: string;
|
|
24
|
+
maxRenderedItems?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { ModalProps } from '../Modal/Modal';
|
|
3
|
+
|
|
4
|
+
export interface ConfirmDialogProps extends Omit<ModalProps, 'children' | 'footer'> {
|
|
5
|
+
message: ReactNode;
|
|
6
|
+
confirmLabel?: string;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
isDestructive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type FormSidebarRenderProps<T> = {
|
|
4
|
+
data: T | null;
|
|
5
|
+
close: () => void;
|
|
6
|
+
};
|
|
7
|
+
type FormSidebarContent<T> = React.ReactNode | ((props: FormSidebarRenderProps<T>) => React.ReactNode);
|
|
8
|
+
export interface FormSidebarProps<T = unknown> {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
title?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
data?: T | null;
|
|
14
|
+
children: FormSidebarContent<T>;
|
|
15
|
+
closeOnOverlayClick?: boolean;
|
|
16
|
+
closeLabel?: string;
|
|
17
|
+
side?: 'left' | 'right';
|
|
18
|
+
width?: number | string;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function FormSidebar<T = unknown>({ isOpen, onClose, title, subtitle, data, children, closeOnOverlayClick, closeLabel, side, width, className, style, }: FormSidebarProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
columns?: number | {
|
|
5
|
+
base?: number;
|
|
6
|
+
sm?: number;
|
|
7
|
+
md?: number;
|
|
8
|
+
lg?: number;
|
|
9
|
+
xl?: number;
|
|
10
|
+
};
|
|
11
|
+
gap?: number | string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Grid: React.FC<GridProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Grid';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
helperText?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
leftAdornment?: React.ReactNode;
|
|
8
|
+
rightAdornment?: React.ReactNode;
|
|
9
|
+
wrapperClassName?: string;
|
|
10
|
+
inputClassName?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LoadingProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
variant?: 'spinner' | 'dots' | 'skeleton';
|
|
6
|
+
skeletonLines?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const Loading: React.FC<LoadingProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardProps } from '../Card/Card';
|
|
3
|
+
|
|
4
|
+
export interface MetricCardProps extends Omit<CardProps, 'title'> {
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
value: React.ReactNode;
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
tone?: 'neutral' | 'success' | 'danger' | 'warning' | 'info';
|
|
10
|
+
}
|
|
11
|
+
export declare const MetricCard: React.ForwardRefExoticComponent<MetricCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
10
|
+
closeOnOverlayClick?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PageHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
inverted?: boolean;
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
breadcrumbs?: React.ReactNode;
|
|
9
|
+
tabs?: React.ReactNode;
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const PageHeader: ({ title, description, inverted, actions, breadcrumbs, tabs, sticky, className, style, ...props }: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
helperText?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
inputClassName?: string;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type RadioOption = {
|
|
13
|
+
id?: string;
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
value: string | number;
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export interface RadioGroupProps {
|
|
20
|
+
name: string;
|
|
21
|
+
options: RadioOption[];
|
|
22
|
+
value?: string | number;
|
|
23
|
+
defaultValue?: string | number;
|
|
24
|
+
onChange?: (value: string | number, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
25
|
+
label?: React.ReactNode;
|
|
26
|
+
helperText?: React.ReactNode;
|
|
27
|
+
error?: React.ReactNode;
|
|
28
|
+
direction?: 'vertical' | 'horizontal';
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
containerClassName?: string;
|
|
32
|
+
optionClassName?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
36
|
+
export declare function RadioGroup({ name, options, value, defaultValue, onChange, label, helperText, error, direction, disabled, required, containerClassName, optionClassName, className, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const defaultIconMap: {
|
|
4
|
+
home: import('react-icons/lib').IconType;
|
|
5
|
+
users: import('react-icons/lib').IconType;
|
|
6
|
+
settings: import('react-icons/lib').IconType;
|
|
7
|
+
api: import('react-icons/lib').IconType;
|
|
8
|
+
clients: import('react-icons/lib').IconType;
|
|
9
|
+
};
|
|
10
|
+
export type SidebarIconName = keyof typeof defaultIconMap | string;
|
|
11
|
+
export type SidebarIconMap = Record<string, React.ComponentType<{
|
|
12
|
+
className?: string;
|
|
13
|
+
}>>;
|
|
14
|
+
export type SidebarItem = {
|
|
15
|
+
id?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
badge?: string | number;
|
|
18
|
+
path?: string;
|
|
19
|
+
iconName?: SidebarIconName;
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
};
|
|
23
|
+
export type SidebarSection = {
|
|
24
|
+
heading?: string;
|
|
25
|
+
items: SidebarItem[];
|
|
26
|
+
};
|
|
27
|
+
export type SidebarRenderLink = (item: SidebarItem, options: {
|
|
28
|
+
className: string;
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
}) => React.ReactNode;
|
|
32
|
+
export interface SidebarProps {
|
|
33
|
+
menuItems?: SidebarItem[];
|
|
34
|
+
sections?: SidebarSection[];
|
|
35
|
+
collapsed?: boolean;
|
|
36
|
+
defaultCollapsed?: boolean;
|
|
37
|
+
pinned?: boolean;
|
|
38
|
+
defaultPinned?: boolean;
|
|
39
|
+
onPinChange?: (pinned: boolean) => void;
|
|
40
|
+
activePath?: string;
|
|
41
|
+
isActive?: (item: SidebarItem) => boolean;
|
|
42
|
+
renderLink?: SidebarRenderLink;
|
|
43
|
+
onItemClick?: (item: SidebarItem) => void;
|
|
44
|
+
iconMap?: SidebarIconMap;
|
|
45
|
+
isMobileOpen?: boolean;
|
|
46
|
+
onCloseMobile?: () => void;
|
|
47
|
+
closeOnSelect?: boolean;
|
|
48
|
+
logoSrc?: string;
|
|
49
|
+
logoAlt?: string;
|
|
50
|
+
logo?: React.ReactNode;
|
|
51
|
+
brandText?: string;
|
|
52
|
+
userName?: string;
|
|
53
|
+
userEmail?: string;
|
|
54
|
+
userAvatar?: string;
|
|
55
|
+
onLogout?: () => void;
|
|
56
|
+
theme?: 'light' | 'dark';
|
|
57
|
+
onToggleTheme?: () => void;
|
|
58
|
+
showMobileToggle?: boolean;
|
|
59
|
+
onToggleMobile?: () => void;
|
|
60
|
+
colors?: {
|
|
61
|
+
border?: string;
|
|
62
|
+
background?: string;
|
|
63
|
+
surface?: string;
|
|
64
|
+
text?: string;
|
|
65
|
+
muted?: string;
|
|
66
|
+
tint?: string;
|
|
67
|
+
hover?: string;
|
|
68
|
+
activeBg?: string;
|
|
69
|
+
danger?: string;
|
|
70
|
+
dangerBg?: string;
|
|
71
|
+
overlay?: string;
|
|
72
|
+
footerBg?: string;
|
|
73
|
+
badgeColor?: string;
|
|
74
|
+
badgeBg?: string;
|
|
75
|
+
brandColor?: string;
|
|
76
|
+
};
|
|
77
|
+
className?: string;
|
|
78
|
+
style?: React.CSSProperties;
|
|
79
|
+
}
|
|
80
|
+
export declare function Sidebar({ menuItems, sections, collapsed, defaultCollapsed, pinned, defaultPinned, onPinChange, activePath, isActive, renderLink, onItemClick, iconMap, isMobileOpen, onCloseMobile, closeOnSelect, logoSrc, logoAlt, logo, brandText, userName, userEmail, userAvatar, onLogout, theme, onToggleTheme, showMobileToggle, onToggleMobile, colors, className, style, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface Column<T> {
|
|
4
|
+
header: string;
|
|
5
|
+
accessor: keyof T | 'actions';
|
|
6
|
+
render?: (row: T) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface PaginationProps {
|
|
9
|
+
currentPage: number;
|
|
10
|
+
totalPages: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
totalRecords: number;
|
|
13
|
+
}
|
|
14
|
+
interface DataTableProps<T> {
|
|
15
|
+
data: T[];
|
|
16
|
+
columns: Column<T>[];
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
variant?: 'default' | 'glass';
|
|
19
|
+
layoutMode?: 'fit' | 'scroll';
|
|
20
|
+
onLayoutModeChange?: (mode: 'fit' | 'scroll') => void;
|
|
21
|
+
layoutModeStorageKey?: string;
|
|
22
|
+
allColumns?: Column<T>[];
|
|
23
|
+
preferences?: {
|
|
24
|
+
hiddenColumns?: string[];
|
|
25
|
+
columnOrder?: string[];
|
|
26
|
+
};
|
|
27
|
+
toggleColumnVisibility?: (accessor: string) => void;
|
|
28
|
+
setColumnOrder?: (order: string[]) => void;
|
|
29
|
+
pagination?: PaginationProps;
|
|
30
|
+
onPageChange?: (page: number) => void;
|
|
31
|
+
onPageSizeChange?: (size: number) => void;
|
|
32
|
+
/** Chave usada para salvar a preferência de itens por página no localStorage */
|
|
33
|
+
pageSizeStorageKey?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function DataTable<T extends Record<string, any>>({ columns, data, isLoading, variant, layoutMode, onLayoutModeChange, layoutModeStorageKey, allColumns, preferences, toggleColumnVisibility, setColumnOrder, pagination, onPageChange, onPageSizeChange, pageSizeStorageKey }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
helperText?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
textareaClassName?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
autoResize?: boolean;
|
|
13
|
+
showCount?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type Theme = 'light' | 'dark' | 'system';
|
|
4
|
+
export interface ThemeContextType {
|
|
5
|
+
theme: Theme;
|
|
6
|
+
setTheme: (theme: Theme) => void;
|
|
7
|
+
actualTheme: 'light' | 'dark';
|
|
8
|
+
}
|
|
9
|
+
export declare const ThemeContext: React.Context<ThemeContextType | undefined>;
|
|
10
|
+
export interface ThemeProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
defaultTheme?: Theme;
|
|
13
|
+
storageKey?: string;
|
|
14
|
+
themeVars?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ThemeProvider';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ToastProps {
|
|
4
|
+
id: string;
|
|
5
|
+
message: ReactNode;
|
|
6
|
+
type?: 'success' | 'error' | 'info' | 'warning';
|
|
7
|
+
duration?: number;
|
|
8
|
+
onClose: (id: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Toast: React.FC<ToastProps>;
|
|
11
|
+
export interface ToastContextType {
|
|
12
|
+
addToast: (message: ReactNode, type?: ToastProps['type'], duration?: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ToastContext: React.Context<ToastContextType | undefined>;
|
|
15
|
+
export declare const ToastProvider: React.FC<{
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const useToast: () => ToastContextType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFocusTrap: <T extends HTMLElement = HTMLDivElement>(active?: boolean) => import('react').RefObject<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useMediaQuery: (query: string) => boolean;
|
|
2
|
+
export declare const breakpoints: {
|
|
3
|
+
readonly sm: "(min-width: 640px)";
|
|
4
|
+
readonly md: "(min-width: 768px)";
|
|
5
|
+
readonly lg: "(min-width: 1024px)";
|
|
6
|
+
readonly xl: "(min-width: 1280px)";
|
|
7
|
+
readonly '2xl': "(min-width: 1536px)";
|
|
8
|
+
};
|
|
9
|
+
export type BreakpointKey = keyof typeof breakpoints;
|
|
10
|
+
export declare const useBreakpoint: (breakpoint: BreakpointKey) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTheme: () => import('../components/ThemeProvider').ThemeContextType;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
export { DataTable } from './components/Table/DataTable';
|
|
3
|
+
export { Sidebar } from './components/Sidebar/Sidebar';
|
|
4
|
+
export { FormSidebar } from './components/FormSidebar/FormSidebar';
|
|
5
|
+
export { Input } from './components/Input/Input';
|
|
6
|
+
export { ComboBox } from './components/ComboBox/ComboBox';
|
|
7
|
+
export { Checkbox } from './components/Checkbox/Checkbox';
|
|
8
|
+
export { Radio, RadioGroup } from './components/Radio/Radio';
|
|
9
|
+
export { Button } from './components/Button/Button';
|
|
10
|
+
export { Textarea } from './components/Textarea/Textarea';
|
|
11
|
+
export { PageHeader } from './components/PageHeader/PageHeader';
|
|
12
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardBody, CardFooter } from './components/Card/Card';
|
|
13
|
+
export { MetricCard } from './components/MetricCard/MetricCard';
|
|
14
|
+
export { Background } from './components/Background/Background';
|
|
15
|
+
export { ThemeProvider } from './components/ThemeProvider/ThemeProvider';
|
|
16
|
+
export { Grid } from './components/Grid/Grid';
|
|
17
|
+
export { Modal } from './components/Modal/Modal';
|
|
18
|
+
export { ConfirmDialog } from './components/ConfirmDialog/ConfirmDialog';
|
|
19
|
+
export { ToastProvider, useToast } from './components/Toast/Toast';
|
|
20
|
+
export { Tooltip } from './components/Tooltip/Tooltip';
|
|
21
|
+
export { Loading } from './components/Loading/Loading';
|
|
22
|
+
export { Portal } from './components/Portal/Portal';
|
|
23
|
+
export { useTheme } from './hooks/useTheme';
|
|
24
|
+
export { useKeyboardNavigation } from './hooks/useKeyboardNavigation';
|
|
25
|
+
export { useFocusTrap } from './hooks/useFocusTrap';
|
|
26
|
+
export { useAnnouncements } from './hooks/useAnnouncements';
|
|
27
|
+
export { useMediaQuery, useBreakpoint } from './hooks/useMediaQuery';
|
|
28
|
+
export { mergeClasses, createComponentClasses } from './utils/styles';
|
|
29
|
+
export type { InputProps } from './components/Input/Input';
|
|
30
|
+
export type { ComboBoxProps, ComboBoxOption } from './components/ComboBox/ComboBox';
|
|
31
|
+
export type { CheckboxProps } from './components/Checkbox/Checkbox';
|
|
32
|
+
export type { RadioProps, RadioGroupProps, RadioOption } from './components/Radio/Radio';
|
|
33
|
+
export type { ButtonProps } from './components/Button/Button';
|
|
34
|
+
export type { TextareaProps } from './components/Textarea/Textarea';
|
|
35
|
+
export type { PageHeaderProps } from './components/PageHeader/PageHeader';
|
|
36
|
+
export type { CardProps } from './components/Card/Card';
|
|
37
|
+
export type { MetricCardProps } from './components/MetricCard/MetricCard';
|
|
38
|
+
export type { BackgroundProps } from './components/Background/Background';
|
|
39
|
+
export type { ThemeProviderProps, Theme } from './components/ThemeProvider/ThemeProvider';
|
|
40
|
+
export type { GridProps } from './components/Grid/Grid';
|
|
41
|
+
export type { ModalProps } from './components/Modal/Modal';
|
|
42
|
+
export type { ConfirmDialogProps } from './components/ConfirmDialog/ConfirmDialog';
|
|
43
|
+
export type { ToastProps } from './components/Toast/Toast';
|
|
44
|
+
export type { TooltipProps } from './components/Tooltip/Tooltip';
|
|
45
|
+
export type { LoadingProps } from './components/Loading/Loading';
|
|
46
|
+
export type { PortalProps } from './components/Portal/Portal';
|