@giro-ds/react 6.0.2 → 8.0.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/index.cjs +347 -180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +284 -43
- package/dist/index.esm.js +346 -183
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +3 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, ReactElement, ComponentPropsWithoutRef, CSSProperties } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { Matcher } from 'react-day-picker';
|
|
5
|
+
import { RowData, ColumnDef } from '@tanstack/react-table';
|
|
6
|
+
export { ColumnDef as TableColumnDefinition, createColumnHelper as createTableColumnHelper } from '@tanstack/react-table';
|
|
5
7
|
import { Toast as Toast$1 } from 'radix-ui';
|
|
6
8
|
|
|
7
9
|
/** Tamanho do componente: 'sm' (pequeno) ou 'lg' (grande) */
|
|
@@ -48,44 +50,38 @@ interface AvatarProps extends Omit<BaseProps, 'disabled'> {
|
|
|
48
50
|
src?: string;
|
|
49
51
|
/** Texto alternativo da imagem do avatar, usado como as iniciais do nome */
|
|
50
52
|
initialLetters?: string;
|
|
53
|
+
/** Classe CSS opcional */
|
|
54
|
+
className?: string;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
declare const Avatar: React__default.FC<AvatarProps>;
|
|
54
58
|
|
|
55
|
-
/** Tipos de badge suportados */
|
|
56
|
-
type BadgeType = 'notification' | 'status';
|
|
57
|
-
/** Valores possíveis para exibição no badge */
|
|
58
|
-
type BadgeValue = number | string | null;
|
|
59
59
|
/**
|
|
60
60
|
* Props do componente Badge
|
|
61
61
|
* @example
|
|
62
62
|
* ```tsx
|
|
63
|
-
*
|
|
63
|
+
* // Modo overlay: badge flutua sobre o children
|
|
64
|
+
* <Badge badgeValue={5}>
|
|
64
65
|
* <IconButton icon={<BellIcon />} />
|
|
65
66
|
* </Badge>
|
|
66
67
|
* ```
|
|
67
68
|
* @example
|
|
68
69
|
* ```tsx
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* badgeValue="novo"
|
|
72
|
-
* aria-label="Novo item disponível"
|
|
73
|
-
* >
|
|
74
|
-
* <Avatar icon={<UserIcon />} />
|
|
75
|
-
* </Badge>
|
|
70
|
+
* // Modo inline: badge standalone ao lado de outros elementos
|
|
71
|
+
* <Badge badgeValue="+3" aria-label="3 novos itens" />
|
|
76
72
|
* ```
|
|
77
73
|
*/
|
|
78
74
|
interface BadgeProps extends BaseProps {
|
|
79
|
-
/**
|
|
80
|
-
type: BadgeType;
|
|
81
|
-
/** Conteúdo a ser envolvido pelo badge */
|
|
75
|
+
/** Conteúdo a ser envolvido pelo badge. Quando presente, o badge é posicionado sobre o children (modo overlay). */
|
|
82
76
|
children?: ReactNode;
|
|
83
|
-
/** Valor
|
|
84
|
-
badgeValue?:
|
|
85
|
-
/** Valor máximo a ser exibido (ex: 99+ quando badgeValue > maxValue) */
|
|
86
|
-
maxValue?: number;
|
|
77
|
+
/** Valor exibido no badge — aceita número ou string formatada (ex: "+3") */
|
|
78
|
+
badgeValue?: number | string | null;
|
|
87
79
|
/** Label acessível para leitores de tela */
|
|
88
80
|
'aria-label'?: string;
|
|
81
|
+
/** Prop que sinaliza se o Badge será usado no Filter ou não, pois no Filter ele tem uma cor diferente */
|
|
82
|
+
filterVariant?: boolean;
|
|
83
|
+
/** Classe CSS opcional */
|
|
84
|
+
className?: string;
|
|
89
85
|
}
|
|
90
86
|
|
|
91
87
|
declare const Badge: React__default.FC<BadgeProps>;
|
|
@@ -130,6 +126,10 @@ type ButtonOwnPropsBase = {
|
|
|
130
126
|
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
131
127
|
/** Alinhamento do tooltip */
|
|
132
128
|
tooltipAlign?: 'start' | 'center' | 'end';
|
|
129
|
+
/**
|
|
130
|
+
* Classe CSS adicional para customização. Use com moderação e prefira as variantes e estilos pré-definidos do design system.
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
133
|
/** Handler de clique; tipado em HTMLElement para ser compatível com todos os modos */
|
|
134
134
|
onClick?: React__default.MouseEventHandler<HTMLElement>;
|
|
135
135
|
} & BaseProps;
|
|
@@ -234,14 +234,14 @@ interface CalendarBaseProps extends Omit<BaseProps, 'disabled'> {
|
|
|
234
234
|
}
|
|
235
235
|
type CalendarProps = CalendarBaseProps;
|
|
236
236
|
|
|
237
|
-
declare const Calendar: ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale, autoFocus, id, "aria-label": ariaLabel, }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
237
|
+
declare const Calendar: ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale, autoFocus, className, id, "aria-label": ariaLabel, ...rest }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* Props do componente Callout
|
|
241
241
|
* @example
|
|
242
242
|
* ```tsx
|
|
243
243
|
* <Callout
|
|
244
|
-
*
|
|
244
|
+
* variant="success"
|
|
245
245
|
* title="Sucesso!"
|
|
246
246
|
* text="Operação realizada com sucesso"
|
|
247
247
|
* icon={<CheckIcon />}
|
|
@@ -250,21 +250,39 @@ declare const Calendar: ({ selected, currentDate, defaultMonth, startMonth, endM
|
|
|
250
250
|
* @example
|
|
251
251
|
* ```tsx
|
|
252
252
|
* <Callout
|
|
253
|
-
*
|
|
253
|
+
* variant="alert"
|
|
254
254
|
* title="Atenção"
|
|
255
255
|
* text="Verifique os campos obrigatórios"
|
|
256
|
+
* dismiss
|
|
257
|
+
* onDismiss={() => setVisible(false)}
|
|
256
258
|
* />
|
|
257
259
|
* ```
|
|
258
260
|
*/
|
|
259
|
-
interface CalloutProps extends BaseProps {
|
|
260
|
-
/**
|
|
261
|
-
|
|
262
|
-
/** Título principal do callout
|
|
263
|
-
title?:
|
|
264
|
-
/**
|
|
265
|
-
text
|
|
261
|
+
interface CalloutProps extends Omit<BaseProps, 'disabled'>, Omit<React$1.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
262
|
+
/** Variante semântica do callout */
|
|
263
|
+
variant?: Exclude<TextVariant, 'color'>;
|
|
264
|
+
/** Título principal do callout */
|
|
265
|
+
title?: React$1.ReactNode;
|
|
266
|
+
/** Conteúdo descritivo do callout */
|
|
267
|
+
text: React$1.ReactNode;
|
|
266
268
|
/** Ícone a ser exibido no callout */
|
|
267
269
|
icon?: React$1.ReactNode;
|
|
270
|
+
/** Callback chamado ao clicar no botão de fechar. */
|
|
271
|
+
onDismiss?: () => void;
|
|
272
|
+
/** Exibe o botão de fechar. Requer onDismiss. */
|
|
273
|
+
dismiss?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Nome do token de cor de fundo (sem `--`). Sobrescreve a cor da variante.
|
|
276
|
+
* @example backgroundColor="color-brand-secondary-medium"
|
|
277
|
+
*/
|
|
278
|
+
backgroundColor?: string;
|
|
279
|
+
/**
|
|
280
|
+
* Nome do token de cor do texto e ícone (sem `--`). Sobrescreve a cor padrão.
|
|
281
|
+
* @example textColor="color-neutral-low-default"
|
|
282
|
+
*/
|
|
283
|
+
textColor?: string;
|
|
284
|
+
/** Classe CSS opcional */
|
|
285
|
+
className?: string;
|
|
268
286
|
/** Props adicionais para o elemento div */
|
|
269
287
|
[key: string]: any;
|
|
270
288
|
}
|
|
@@ -302,6 +320,8 @@ interface CheckboxProps extends BaseProps {
|
|
|
302
320
|
checked?: boolean;
|
|
303
321
|
/** Estado indeterminado (usado em selecionar todos com seleção parcial) */
|
|
304
322
|
indeterminate?: boolean;
|
|
323
|
+
/** Classe CSS opcional */
|
|
324
|
+
className?: string;
|
|
305
325
|
}
|
|
306
326
|
|
|
307
327
|
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
@@ -339,6 +359,8 @@ interface ChipsProps extends BaseProps, Omit<React$1.HTMLAttributes<HTMLDivEleme
|
|
|
339
359
|
rightIcon?: React$1.ReactNode;
|
|
340
360
|
/** Estilos inline adicionais */
|
|
341
361
|
style?: React$1.CSSProperties;
|
|
362
|
+
/** Classe CSS opcional */
|
|
363
|
+
className?: string;
|
|
342
364
|
}
|
|
343
365
|
|
|
344
366
|
declare const MemoizedChips: React__default.NamedExoticComponent<ChipsProps>;
|
|
@@ -356,9 +378,11 @@ declare const MemoizedChips: React__default.NamedExoticComponent<ChipsProps>;
|
|
|
356
378
|
interface ContainerProps {
|
|
357
379
|
/** Conteúdo a ser renderizado dentro do container */
|
|
358
380
|
children: React__default.ReactNode;
|
|
381
|
+
/** Classe CSS customizada aplicada ao elemento raiz do container */
|
|
382
|
+
className?: string;
|
|
359
383
|
}
|
|
360
384
|
|
|
361
|
-
declare function Container({ children }: ContainerProps): react_jsx_runtime.JSX.Element;
|
|
385
|
+
declare function Container({ children, className }: ContainerProps): react_jsx_runtime.JSX.Element;
|
|
362
386
|
|
|
363
387
|
/**
|
|
364
388
|
* Props do componente DatePicker
|
|
@@ -410,6 +434,8 @@ interface DatePickerProps extends BaseProps {
|
|
|
410
434
|
maxDate?: Date;
|
|
411
435
|
/** ID para testes automatizados */
|
|
412
436
|
'data-testid'?: string;
|
|
437
|
+
/** Classe CSS opcional */
|
|
438
|
+
className?: string;
|
|
413
439
|
}
|
|
414
440
|
|
|
415
441
|
declare const _default$2: React__default.NamedExoticComponent<DatePickerProps>;
|
|
@@ -439,6 +465,8 @@ interface DialogProps extends BaseProps, React.HTMLAttributes<HTMLDivElement> {
|
|
|
439
465
|
onPrimaryAction?: () => void;
|
|
440
466
|
/** Função chamada ao executar a ação secundária */
|
|
441
467
|
onSecondaryAction?: () => void;
|
|
468
|
+
/** Classe CSS opcional */
|
|
469
|
+
className?: string;
|
|
442
470
|
}
|
|
443
471
|
|
|
444
472
|
declare const Dialog: React$1.FC<DialogProps>;
|
|
@@ -493,11 +521,13 @@ interface DrawerProps extends BaseProps {
|
|
|
493
521
|
closeOnOverlayClick?: boolean;
|
|
494
522
|
/** Define se o drawer fecha ao pressionar ESC */
|
|
495
523
|
closeOnEscape?: boolean;
|
|
524
|
+
/** Classe CSS opcional */
|
|
525
|
+
className?: string;
|
|
496
526
|
}
|
|
497
527
|
|
|
498
528
|
declare const Drawer: React__default.FC<DrawerProps>;
|
|
499
529
|
|
|
500
|
-
interface FilterItem$
|
|
530
|
+
interface FilterItem$2 {
|
|
501
531
|
id?: string;
|
|
502
532
|
text: string;
|
|
503
533
|
subText?: string;
|
|
@@ -531,7 +561,7 @@ type FilterType = 'text' | 'checkbox' | 'icon' | 'calendar';
|
|
|
531
561
|
*/
|
|
532
562
|
interface FilterProps extends BaseProps {
|
|
533
563
|
/** Array de itens para filtros do tipo dropdown */
|
|
534
|
-
items?: FilterItem$
|
|
564
|
+
items?: FilterItem$2[];
|
|
535
565
|
/** Tipo do filtro (dropdown ou calendário) */
|
|
536
566
|
type?: FilterType;
|
|
537
567
|
/** IDs dos itens selecionados */
|
|
@@ -568,6 +598,8 @@ interface FilterProps extends BaseProps {
|
|
|
568
598
|
maxDate?: Date;
|
|
569
599
|
/** Idioma do calendário */
|
|
570
600
|
locale?: Locale;
|
|
601
|
+
/** Classe CSS opcional */
|
|
602
|
+
className?: string;
|
|
571
603
|
}
|
|
572
604
|
|
|
573
605
|
declare const Filter: React__default.FC<FilterProps>;
|
|
@@ -621,6 +653,8 @@ interface ListItemProps extends BaseProps {
|
|
|
621
653
|
showSubText?: boolean;
|
|
622
654
|
/** Estado de hover */
|
|
623
655
|
hovered?: boolean;
|
|
656
|
+
/** Classe CSS opcional */
|
|
657
|
+
className?: string;
|
|
624
658
|
}
|
|
625
659
|
|
|
626
660
|
declare const ListItem: React__default.FC<ListItemProps>;
|
|
@@ -700,6 +734,8 @@ interface MenuProps extends BaseProps {
|
|
|
700
734
|
onApiSearch?: (searchTerm: string) => void;
|
|
701
735
|
/** Callback executado quando o menu abre/fecha: (open) => void */
|
|
702
736
|
onOpenChange?: (open: boolean) => void;
|
|
737
|
+
/** Classe CSS opcional */
|
|
738
|
+
className?: string;
|
|
703
739
|
}
|
|
704
740
|
|
|
705
741
|
declare const Menu: React__default.FC<MenuProps>;
|
|
@@ -747,6 +783,8 @@ interface ModalProps extends BaseProps {
|
|
|
747
783
|
customWidth?: string;
|
|
748
784
|
/** Define se o modal ocupa toda a tela. Tem prioridade sobre customWidth */
|
|
749
785
|
fullscreen?: boolean;
|
|
786
|
+
/** Classe CSS opcional */
|
|
787
|
+
className?: string;
|
|
750
788
|
}
|
|
751
789
|
|
|
752
790
|
declare const Modal: React$1.FC<ModalProps>;
|
|
@@ -776,6 +814,8 @@ interface PopoverProps {
|
|
|
776
814
|
onCloseAutoFocus?: (event: Event) => void;
|
|
777
815
|
/** Quando `true`, exibe uma seta apontando para o trigger */
|
|
778
816
|
showArrow?: boolean;
|
|
817
|
+
/** Classe CSS opcional */
|
|
818
|
+
className?: string;
|
|
779
819
|
}
|
|
780
820
|
|
|
781
821
|
declare const Popover: React$1.FC<PopoverProps>;
|
|
@@ -825,12 +865,14 @@ interface QuantityProps extends BaseProps {
|
|
|
825
865
|
minValue?: number;
|
|
826
866
|
/** Valor máximo permitido */
|
|
827
867
|
maxValue?: number;
|
|
828
|
-
/** Aria label
|
|
868
|
+
/** Aria label para o botão de decremento. Padrão: 'Diminuir quantidade' */
|
|
829
869
|
decrementAriaLabel?: string;
|
|
830
|
-
/** Aria label
|
|
870
|
+
/** Aria label para o botão de incremento. Padrão: 'Aumentar quantidade' */
|
|
831
871
|
incrementAriaLabel?: string;
|
|
832
|
-
/** Aria label
|
|
872
|
+
/** Aria label para a entrada de quantidade. Padrão: 'Quantidade' */
|
|
833
873
|
inputAriaLabel?: string;
|
|
874
|
+
/** Classe CSS opcional */
|
|
875
|
+
className?: string;
|
|
834
876
|
}
|
|
835
877
|
|
|
836
878
|
declare const memorizedQuantity: React__default.NamedExoticComponent<QuantityProps>;
|
|
@@ -847,6 +889,8 @@ interface RadioProps {
|
|
|
847
889
|
label: string;
|
|
848
890
|
/** Estado desabilitado do item */
|
|
849
891
|
disabled?: boolean;
|
|
892
|
+
/** Classe CSS opcional */
|
|
893
|
+
className?: string;
|
|
850
894
|
}
|
|
851
895
|
/**
|
|
852
896
|
* Props do componente RadioGroup
|
|
@@ -932,6 +976,8 @@ interface SearchProps extends BaseProps, NativeInputProps {
|
|
|
932
976
|
onMouseDown?: (e: React$1.MouseEvent<HTMLDivElement>) => void;
|
|
933
977
|
/** ID para testes automatizados */
|
|
934
978
|
'data-testid'?: string;
|
|
979
|
+
/** Classe CSS opcional */
|
|
980
|
+
className?: string;
|
|
935
981
|
}
|
|
936
982
|
|
|
937
983
|
declare const Search: React__default.ForwardRefExoticComponent<SearchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1033,6 +1079,8 @@ interface SelectProps extends BaseProps {
|
|
|
1033
1079
|
onApiSearch?: (term: string) => void;
|
|
1034
1080
|
/** Estado de busca em andamento */
|
|
1035
1081
|
isSearching?: boolean;
|
|
1082
|
+
/** Classe CSS opcional */
|
|
1083
|
+
className?: string;
|
|
1036
1084
|
}
|
|
1037
1085
|
|
|
1038
1086
|
declare const Select: React__default.FC<SelectProps>;
|
|
@@ -1108,7 +1156,7 @@ interface TableProps<T = TableRowData> extends BaseProps {
|
|
|
1108
1156
|
|
|
1109
1157
|
declare const Table: <T extends TableRowData = TableRowData>({ columns, dataSource, className, loading, rowSelection, locale, onRow, ...rest }: TableProps<T>) => react_jsx_runtime.JSX.Element | null;
|
|
1110
1158
|
|
|
1111
|
-
interface BaseFilterItem {
|
|
1159
|
+
interface BaseFilterItem$1 {
|
|
1112
1160
|
id?: string;
|
|
1113
1161
|
buttonText: string | React__default.ReactNode;
|
|
1114
1162
|
icon?: React__default.ReactElement;
|
|
@@ -1118,15 +1166,15 @@ interface BaseFilterItem {
|
|
|
1118
1166
|
onToggle?: (isOpen: boolean) => void;
|
|
1119
1167
|
tooltip?: string;
|
|
1120
1168
|
}
|
|
1121
|
-
interface CheckboxFilterItem extends BaseFilterItem {
|
|
1169
|
+
interface CheckboxFilterItem$1 extends BaseFilterItem$1 {
|
|
1122
1170
|
type: 'checkbox' | 'text' | 'icon';
|
|
1123
|
-
items: FilterItem$
|
|
1171
|
+
items: FilterItem$2[];
|
|
1124
1172
|
selectedIds?: string[];
|
|
1125
1173
|
onSelectionChange?: (selectedIds: string[]) => void;
|
|
1126
1174
|
placeholder?: string;
|
|
1127
1175
|
enableSearch?: boolean;
|
|
1128
1176
|
}
|
|
1129
|
-
interface CalendarFilterItem extends BaseFilterItem {
|
|
1177
|
+
interface CalendarFilterItem$1 extends BaseFilterItem$1 {
|
|
1130
1178
|
type: 'calendar';
|
|
1131
1179
|
selectedDate?: Date | null;
|
|
1132
1180
|
onDateSelect?: (date: Date) => void;
|
|
@@ -1136,7 +1184,7 @@ interface CalendarFilterItem extends BaseFilterItem {
|
|
|
1136
1184
|
locale?: string;
|
|
1137
1185
|
placeholder?: string;
|
|
1138
1186
|
}
|
|
1139
|
-
type FilterItem = CheckboxFilterItem | CalendarFilterItem;
|
|
1187
|
+
type FilterItem$1 = CheckboxFilterItem$1 | CalendarFilterItem$1;
|
|
1140
1188
|
interface TableHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
1141
1189
|
searchValue?: string;
|
|
1142
1190
|
onSearchChange?: (value: string) => void;
|
|
@@ -1144,7 +1192,7 @@ interface TableHeaderProps extends React__default.HTMLAttributes<HTMLDivElement>
|
|
|
1144
1192
|
showSearch?: boolean;
|
|
1145
1193
|
showFilters?: boolean;
|
|
1146
1194
|
filters?: React__default.ReactNode;
|
|
1147
|
-
filterItems?: FilterItem[];
|
|
1195
|
+
filterItems?: FilterItem$1[];
|
|
1148
1196
|
className?: string;
|
|
1149
1197
|
onSearch?: (value: string) => void;
|
|
1150
1198
|
showClearSearch?: boolean;
|
|
@@ -1163,6 +1211,188 @@ interface TablePaginationProps extends React__default.HTMLAttributes<HTMLDivElem
|
|
|
1163
1211
|
}
|
|
1164
1212
|
declare const TablePagination: React__default.FC<TablePaginationProps>;
|
|
1165
1213
|
|
|
1214
|
+
declare module '@tanstack/react-table' {
|
|
1215
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
1216
|
+
/** Alinhamento do conteúdo da célula */
|
|
1217
|
+
align?: 'left' | 'center' | 'right';
|
|
1218
|
+
/** Altura máxima do conteúdo da célula (ex: 48, '3rem'). Aplica overflow: hidden */
|
|
1219
|
+
maxHeight?: number | string;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Props base compartilhadas por todos os tipos de filtro da tabela.
|
|
1224
|
+
*/
|
|
1225
|
+
interface BaseFilterItem {
|
|
1226
|
+
/** Identificador único do filtro */
|
|
1227
|
+
id?: string;
|
|
1228
|
+
/** Texto ou nó exibido no botão que abre o filtro */
|
|
1229
|
+
buttonText: string | ReactNode;
|
|
1230
|
+
/** Ícone exibido no botão do filtro */
|
|
1231
|
+
icon?: ReactElement;
|
|
1232
|
+
/** Lado em que o dropdown do filtro será exibido */
|
|
1233
|
+
side?: Side;
|
|
1234
|
+
/** Alinhamento do dropdown do filtro */
|
|
1235
|
+
align?: Exclude<Align, 'center'>;
|
|
1236
|
+
/** Desabilita o botão do filtro */
|
|
1237
|
+
disabled?: boolean;
|
|
1238
|
+
/** Callback chamado quando o estado de abertura do filtro muda */
|
|
1239
|
+
onToggle?: (isOpen: boolean) => void;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Props de filtro do tipo checkbox, texto ou ícone.
|
|
1243
|
+
* Renderiza uma lista de opções selecionáveis.
|
|
1244
|
+
*/
|
|
1245
|
+
interface CheckboxFilterItem extends BaseFilterItem {
|
|
1246
|
+
/** Tipo do filtro */
|
|
1247
|
+
type: 'checkbox' | 'text' | 'icon';
|
|
1248
|
+
/** Lista de itens disponíveis para seleção */
|
|
1249
|
+
items: FilterItem$2[];
|
|
1250
|
+
/** IDs dos itens atualmente selecionados */
|
|
1251
|
+
selectedIds?: string[];
|
|
1252
|
+
/** Callback chamado quando a seleção muda */
|
|
1253
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
1254
|
+
/** Placeholder do campo de busca interno do filtro */
|
|
1255
|
+
placeholder?: string;
|
|
1256
|
+
/** Habilita campo de busca dentro do dropdown */
|
|
1257
|
+
enableSearch?: boolean;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Props de filtro do tipo calendário.
|
|
1261
|
+
* Renderiza um seletor de data.
|
|
1262
|
+
*/
|
|
1263
|
+
interface CalendarFilterItem extends BaseFilterItem {
|
|
1264
|
+
/** Tipo do filtro */
|
|
1265
|
+
type: 'calendar';
|
|
1266
|
+
/** Data atualmente selecionada */
|
|
1267
|
+
selectedDate?: Date | null;
|
|
1268
|
+
/** Callback chamado quando uma data é selecionada */
|
|
1269
|
+
onDateSelect?: (date: Date) => void;
|
|
1270
|
+
/** Callback chamado ao limpar a data selecionada */
|
|
1271
|
+
onClear?: () => void;
|
|
1272
|
+
/** Data mínima permitida para seleção */
|
|
1273
|
+
minDate?: Date;
|
|
1274
|
+
/** Data máxima permitida para seleção */
|
|
1275
|
+
maxDate?: Date;
|
|
1276
|
+
/** Locale utilizado para formatar datas no calendário */
|
|
1277
|
+
locale?: Locale;
|
|
1278
|
+
/** Placeholder exibido quando nenhuma data está selecionada */
|
|
1279
|
+
placeholder?: string;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Union type representando um item de filtro da tabela.
|
|
1283
|
+
* Pode ser do tipo checkbox/texto/ícone ou calendário.
|
|
1284
|
+
*/
|
|
1285
|
+
type FilterItem = CheckboxFilterItem | CalendarFilterItem;
|
|
1286
|
+
/**
|
|
1287
|
+
* Props do cabeçalho do TableV2, com busca global e filtros.
|
|
1288
|
+
*/
|
|
1289
|
+
interface TableV2HeaderProps {
|
|
1290
|
+
/** Placeholder do campo de busca global */
|
|
1291
|
+
searchPlaceholder?: string;
|
|
1292
|
+
/** Exibe o campo de busca (padrão: true) */
|
|
1293
|
+
showSearch?: boolean;
|
|
1294
|
+
/** Items de filtro (Status, Data de início, etc.) */
|
|
1295
|
+
filterItems?: FilterItem[];
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Props do rodapé do TableV2, com controles de paginação.
|
|
1299
|
+
*/
|
|
1300
|
+
interface TableV2FooterProps {
|
|
1301
|
+
/** Total de itens (para calcular número de páginas) */
|
|
1302
|
+
totalItems: number;
|
|
1303
|
+
/** Itens por página inicial (padrão: 10) */
|
|
1304
|
+
defaultPageSize?: number;
|
|
1305
|
+
/** Opções do seletor de itens por página */
|
|
1306
|
+
pageSizeOptions?: number[];
|
|
1307
|
+
/** Callback chamado quando a página muda */
|
|
1308
|
+
onPageChange?: (page: number) => void;
|
|
1309
|
+
/** Callback chamado quando o tamanho da página muda */
|
|
1310
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Props para personalização do estado vazio da tabela.
|
|
1314
|
+
*/
|
|
1315
|
+
interface EmptyStateProps {
|
|
1316
|
+
/** Ícone exibido no estado vazio */
|
|
1317
|
+
emptyIcon?: ReactNode;
|
|
1318
|
+
/** Título exibido no estado vazio */
|
|
1319
|
+
emptyTitle?: ReactNode;
|
|
1320
|
+
/** Texto descritivo exibido no estado vazio */
|
|
1321
|
+
emptyText?: ReactNode;
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Definição de uma ação em massa disponível na barra de seleção.
|
|
1325
|
+
*/
|
|
1326
|
+
interface BulkAction {
|
|
1327
|
+
/** Label do botão de ação */
|
|
1328
|
+
label: ReactNode;
|
|
1329
|
+
/** Callback ao clicar no botão */
|
|
1330
|
+
onClick: () => void;
|
|
1331
|
+
/** Desabilita o botão */
|
|
1332
|
+
disabled?: boolean;
|
|
1333
|
+
/** Variante visual do botão (padrão: 'outlined') */
|
|
1334
|
+
variant?: 'filled' | 'outlined' | 'text';
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Props da barra de ações em massa do TableV2.
|
|
1338
|
+
* Exibida quando há linhas selecionadas.
|
|
1339
|
+
*/
|
|
1340
|
+
interface TableV2BulkActionsProps<T = Record<string, unknown>> {
|
|
1341
|
+
/** Função que retorna o label da barra de ações em massa.
|
|
1342
|
+
* Recebe a contagem de itens selecionados e os itens originais.
|
|
1343
|
+
* Se não fornecido, exibe "{count} itens selecionados". */
|
|
1344
|
+
label?: (count: number, selectedRows: T[]) => ReactNode;
|
|
1345
|
+
/** Lista de ações disponíveis quando há itens selecionados */
|
|
1346
|
+
actions: BulkAction[];
|
|
1347
|
+
/** Callback chamado ao clicar no botão de limpar seleção (X) */
|
|
1348
|
+
onClear?: () => void;
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Props do componente TableV2.
|
|
1352
|
+
* @example
|
|
1353
|
+
* ```tsx
|
|
1354
|
+
* <TableV2
|
|
1355
|
+
* columns={columns}
|
|
1356
|
+
* data={data}
|
|
1357
|
+
* enableSorting
|
|
1358
|
+
* enableRowSelection
|
|
1359
|
+
* loading={isLoading}
|
|
1360
|
+
* />
|
|
1361
|
+
* ```
|
|
1362
|
+
*/
|
|
1363
|
+
interface TableV2Props<T = Record<string, unknown>> extends EmptyStateProps {
|
|
1364
|
+
/** Definições das colunas da tabela */
|
|
1365
|
+
columns: ColumnDef<T, any>[];
|
|
1366
|
+
/** Dados exibidos na tabela */
|
|
1367
|
+
data: T[];
|
|
1368
|
+
/** Habilita filtros individuais por coluna no <th> */
|
|
1369
|
+
enableFilters?: boolean;
|
|
1370
|
+
/** Habilita seleção de linhas via checkbox */
|
|
1371
|
+
enableRowSelection?: boolean;
|
|
1372
|
+
/** Habilita ordenação de colunas ao clicar no cabeçalho */
|
|
1373
|
+
enableSorting?: boolean;
|
|
1374
|
+
/** Callback chamado quando a seleção de linhas muda */
|
|
1375
|
+
onRowSelectionChange?: (selectedRows: T[]) => void;
|
|
1376
|
+
/** Configuração das ações em massa exibidas quando há linhas selecionadas */
|
|
1377
|
+
bulkActions?: TableV2BulkActionsProps<T>;
|
|
1378
|
+
/** Header acima da tabela com busca + filtros */
|
|
1379
|
+
header?: TableV2HeaderProps;
|
|
1380
|
+
/** Footer com paginação */
|
|
1381
|
+
footer?: TableV2FooterProps;
|
|
1382
|
+
/** Classe CSS personalizada para o componente */
|
|
1383
|
+
className?: string;
|
|
1384
|
+
/** Estado de carregamento — exibe skeleton animado no lugar da tabela */
|
|
1385
|
+
loading?: boolean;
|
|
1386
|
+
/** Eventos e classe aplicados por linha */
|
|
1387
|
+
onRow?: (row: T, index: number) => {
|
|
1388
|
+
onClick?: () => void;
|
|
1389
|
+
onDoubleClick?: () => void;
|
|
1390
|
+
className?: string;
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
declare const TableV2: <T>({ columns, data, enableFilters, enableRowSelection, enableSorting, onRowSelectionChange, bulkActions, header, footer, loading, emptyIcon, emptyTitle, emptyText, onRow, className, }: TableV2Props<T>) => react_jsx_runtime.JSX.Element;
|
|
1395
|
+
|
|
1166
1396
|
/**
|
|
1167
1397
|
* Props do componente TextArea
|
|
1168
1398
|
* @example
|
|
@@ -1215,7 +1445,10 @@ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLT
|
|
|
1215
1445
|
resize?: 'none' | 'vertical' | 'both';
|
|
1216
1446
|
/** Exibe contador de caracteres (requer maxLength) */
|
|
1217
1447
|
showCharCount?: boolean;
|
|
1448
|
+
/** Altura do textarea em pixels */
|
|
1218
1449
|
height?: number;
|
|
1450
|
+
/** Classe CSS opcional */
|
|
1451
|
+
className?: string;
|
|
1219
1452
|
}
|
|
1220
1453
|
|
|
1221
1454
|
declare const _default$1: React__default.NamedExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1279,6 +1512,8 @@ interface TextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
|
|
|
1279
1512
|
icon?: React__default.ReactNode;
|
|
1280
1513
|
/** Mantém o ícone visível mesmo quando o campo tem valor */
|
|
1281
1514
|
persistIcon?: boolean;
|
|
1515
|
+
/** Classe CSS opcional */
|
|
1516
|
+
className?: string;
|
|
1282
1517
|
}
|
|
1283
1518
|
|
|
1284
1519
|
declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1336,6 +1571,8 @@ interface ToastProps extends BaseProps, Omit<React$1.ComponentPropsWithoutRef<ty
|
|
|
1336
1571
|
* @default 'Info'
|
|
1337
1572
|
*/
|
|
1338
1573
|
iconType?: 'Info' | 'Success' | 'Alert';
|
|
1574
|
+
/** Classe CSS opcional */
|
|
1575
|
+
className?: string;
|
|
1339
1576
|
}
|
|
1340
1577
|
|
|
1341
1578
|
/**
|
|
@@ -1477,6 +1714,8 @@ interface TooltipProps extends BaseProps {
|
|
|
1477
1714
|
maxWidth?: number;
|
|
1478
1715
|
/** Elemento que dispara o tooltip ao hover */
|
|
1479
1716
|
children: React__default.ReactNode;
|
|
1717
|
+
/** Classe CSS opcional */
|
|
1718
|
+
className?: string;
|
|
1480
1719
|
}
|
|
1481
1720
|
|
|
1482
1721
|
declare const Tooltip: React__default.FC<TooltipProps>;
|
|
@@ -1511,6 +1750,8 @@ interface SwitchProps extends BaseProps {
|
|
|
1511
1750
|
value?: string;
|
|
1512
1751
|
/** Estado atual (modo controlado) */
|
|
1513
1752
|
checked?: boolean;
|
|
1753
|
+
/** Classe CSS opcional */
|
|
1754
|
+
className?: string;
|
|
1514
1755
|
}
|
|
1515
1756
|
|
|
1516
1757
|
declare const Switch: React$1.FC<SwitchProps>;
|
|
@@ -1668,5 +1909,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
|
|
|
1668
1909
|
|
|
1669
1910
|
declare const normalizeText: (text: React.ReactNode) => string;
|
|
1670
1911
|
|
|
1671
|
-
export { Avatar, Badge, Button, Calendar, Callout, Checkbox, MemoizedChips as Chips, Container, _default$2 as DatePicker, Dialog, Drawer, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch, Table, TableHeader, TablePagination, _default$1 as TextArea, _default as TextField, Toast, ToastContainer, ToastProvider, Tooltip, VerificationCode, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
|
|
1672
|
-
export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CheckboxProps, ChipsProps, ContainerProps, DatePickerProps, DialogProps, DrawerProps, FilterItem, FilterProps, ListItemProps, MenuProps, ModalProps, PopoverProps, QuantityProps, RadioGroupProps, RadioProps, SearchProps, SelectProps, SwitchProps, TableHeaderProps, TablePaginationProps, TableProps, TextAreaProps, TextFieldProps, ToastProps, TooltipProps, VerificationCodeProps };
|
|
1912
|
+
export { Avatar, Badge, Button, Calendar, Callout, Checkbox, MemoizedChips as Chips, Container, _default$2 as DatePicker, Dialog, Drawer, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch, Table, TableHeader, TablePagination, TableV2, _default$1 as TextArea, _default as TextField, Toast, ToastContainer, ToastProvider, Tooltip, VerificationCode, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
|
|
1913
|
+
export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CheckboxProps, ChipsProps, ContainerProps, DatePickerProps, DialogProps, DrawerProps, FilterItem$1 as FilterItem, FilterProps, ListItemProps, MenuProps, ModalProps, PopoverProps, QuantityProps, RadioGroupProps, RadioProps, SearchProps, SelectProps, SwitchProps, TableHeaderProps, TablePaginationProps, TableProps, TableV2FooterProps, TableV2HeaderProps, TableV2Props, TextAreaProps, TextFieldProps, ToastProps, TooltipProps, VerificationCodeProps };
|