@giro-ds/react 12.0.0 → 12.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/dist/index.cjs +248 -366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +200 -192
- package/dist/index.esm.js +250 -366
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +3 -3
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ReactElement, RefObject, ComponentPropsWithoutRef
|
|
2
|
+
import React__default, { ReactNode, ReactElement, RefObject, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { DateRange, Matcher } from 'react-day-picker';
|
|
4
4
|
export { DateRange } from 'react-day-picker';
|
|
5
5
|
import { RowData, ColumnDef } from '@tanstack/react-table';
|
|
@@ -97,7 +97,7 @@ declare const Badge: React__default.FC<BadgeProps>;
|
|
|
97
97
|
/**
|
|
98
98
|
* Props base compartilhadas por todas as configurações de tooltip do botão.
|
|
99
99
|
*/
|
|
100
|
-
interface BaseTooltipConfig$
|
|
100
|
+
interface BaseTooltipConfig$4 {
|
|
101
101
|
/** Lado em que o tooltip será exibido */
|
|
102
102
|
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
103
103
|
/** Alinhamento do tooltip */
|
|
@@ -107,14 +107,14 @@ interface BaseTooltipConfig$3 {
|
|
|
107
107
|
* Configuração de tooltip com texto.
|
|
108
108
|
* Exibe um tooltip ao redor do botão — útil especialmente para botões icon-only.
|
|
109
109
|
*/
|
|
110
|
-
interface WithTooltip$
|
|
110
|
+
interface WithTooltip$4 extends BaseTooltipConfig$4 {
|
|
111
111
|
/** Texto do tooltip exibido no hover */
|
|
112
112
|
tooltipText: string;
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Configuração sem tooltip.
|
|
116
116
|
*/
|
|
117
|
-
interface WithoutTooltip$
|
|
117
|
+
interface WithoutTooltip$4 {
|
|
118
118
|
tooltipText?: never;
|
|
119
119
|
tooltipSide?: never;
|
|
120
120
|
tooltipAlign?: never;
|
|
@@ -123,7 +123,7 @@ interface WithoutTooltip$3 {
|
|
|
123
123
|
* Union type representando a configuração de tooltip do botão.
|
|
124
124
|
* Pode ter tooltip com texto (e opcionalmente side/align) ou sem tooltip.
|
|
125
125
|
*/
|
|
126
|
-
type ButtonTooltipConfig = WithTooltip$
|
|
126
|
+
type ButtonTooltipConfig = WithTooltip$4 | WithoutTooltip$4;
|
|
127
127
|
/**
|
|
128
128
|
* Props base do Button, independentes da variante iconOnly/icon.
|
|
129
129
|
* `target`, `rel`, `type` e `onClick` são declarados aqui para garantir
|
|
@@ -211,12 +211,7 @@ type ButtonAsCustom = ButtonOwnProps & Omit<React__default.HTMLAttributes<HTMLEl
|
|
|
211
211
|
*/
|
|
212
212
|
type ButtonProps = ButtonAsButton | ButtonAsAnchor | ButtonAsCustom;
|
|
213
213
|
|
|
214
|
-
declare const Button:
|
|
215
|
-
({ ref, as, children, variant, iconPosition, href, to, external, target, rel, disabled, onClick, size, scale, className, type, id, icon, fullWidth, ariaLabel, iconOnly, loading, tooltipText, tooltipSide, tooltipAlign, ...rest }: ButtonProps & {
|
|
216
|
-
ref?: React__default.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
217
|
-
}): React__default.JSX.Element;
|
|
218
|
-
displayName: string;
|
|
219
|
-
};
|
|
214
|
+
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
220
215
|
|
|
221
216
|
/** Formato de exibição da data aceito pelo componente. */
|
|
222
217
|
type DateFormat = 'dd/mm/yyyy' | 'mm/dd/yyyy' | (string & {});
|
|
@@ -626,14 +621,9 @@ interface FileUploadProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
626
621
|
description?: string;
|
|
627
622
|
}
|
|
628
623
|
|
|
629
|
-
declare const FileUpload:
|
|
630
|
-
({ ref, value, onChange, helperText, error, errorMessage, maxFileSize, maxFilesQuantity, disabled, className, id, accept, multiple, description, descriptionErrorMessage, ...rest }: FileUploadProps & {
|
|
631
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
632
|
-
}): React__default.JSX.Element;
|
|
633
|
-
displayName: string;
|
|
634
|
-
};
|
|
624
|
+
declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
635
625
|
|
|
636
|
-
interface FilterItem$
|
|
626
|
+
interface FilterItem$1 {
|
|
637
627
|
/** Identificador único do item (usado em `selectedIds` e `onApplyFilter`) */
|
|
638
628
|
id?: BaseProps['id'];
|
|
639
629
|
/** Texto principal exibido no item */
|
|
@@ -672,7 +662,7 @@ type FilterTypes = 'single' | 'multiple' | 'calendar';
|
|
|
672
662
|
*/
|
|
673
663
|
interface FilterProps extends BaseProps {
|
|
674
664
|
/** Array de itens para filtros do tipo dropdown */
|
|
675
|
-
items?: FilterItem$
|
|
665
|
+
items?: FilterItem$1[];
|
|
676
666
|
/** Tipo do filtro (dropdown ou calendário) */
|
|
677
667
|
type?: FilterTypes;
|
|
678
668
|
/** IDs dos itens selecionados */
|
|
@@ -736,7 +726,7 @@ interface FilterProps extends BaseProps {
|
|
|
736
726
|
declare const Filter: React__default.FC<FilterProps>;
|
|
737
727
|
|
|
738
728
|
/** Variantes disponíveis para o ListItem */
|
|
739
|
-
type ListItemVariant = 'text' | 'checkbox' | '
|
|
729
|
+
type ListItemVariant = 'text' | 'checkbox' | 'icon';
|
|
740
730
|
/**
|
|
741
731
|
* Props do componente ListItem
|
|
742
732
|
* @example
|
|
@@ -764,11 +754,9 @@ interface ListItemProps extends BaseProps {
|
|
|
764
754
|
variant?: ListItemVariant;
|
|
765
755
|
/** Texto principal do item */
|
|
766
756
|
text?: string;
|
|
767
|
-
/** Nome do input (para variantes checkbox/radio) */
|
|
768
|
-
name?: string;
|
|
769
757
|
/** Texto secundário/descrição do item */
|
|
770
758
|
subText?: string;
|
|
771
|
-
/** Estado de checked (para
|
|
759
|
+
/** Estado de checked (para variante checkbox) */
|
|
772
760
|
checked?: boolean;
|
|
773
761
|
/** Estado de selecionado (para variantes text/icon) */
|
|
774
762
|
selected?: boolean;
|
|
@@ -778,14 +766,18 @@ interface ListItemProps extends BaseProps {
|
|
|
778
766
|
onChange?: (checked: boolean) => void;
|
|
779
767
|
/** Ícone do item (para variante icon) */
|
|
780
768
|
icon?: React$1.ReactNode;
|
|
781
|
-
/**
|
|
782
|
-
|
|
783
|
-
/**
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
|
|
787
|
-
/**
|
|
788
|
-
|
|
769
|
+
/** Largura do item. Quando não informada, ocupa 100% do container */
|
|
770
|
+
customWidth?: React$1.CSSProperties['width'];
|
|
771
|
+
/** Escala visual do componente (1, 1.5 ou 2) */
|
|
772
|
+
scale?: Scale;
|
|
773
|
+
/** Itens filhos para criar estrutura de árvore (outros ListItems) */
|
|
774
|
+
children?: React$1.ReactNode;
|
|
775
|
+
/** Estado inicial de expansão — modo não controlado (default: false) */
|
|
776
|
+
defaultExpanded?: boolean;
|
|
777
|
+
/** Estado de expansão controlado */
|
|
778
|
+
expanded?: boolean;
|
|
779
|
+
/** Callback executado quando o estado de expansão muda */
|
|
780
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
789
781
|
}
|
|
790
782
|
|
|
791
783
|
declare const ListItem: React__default.FC<ListItemProps>;
|
|
@@ -1218,17 +1210,12 @@ interface SearchProps extends ScalableProps, NativeInputProps {
|
|
|
1218
1210
|
virtualKeyboard?: VirtualKeyboardType;
|
|
1219
1211
|
}
|
|
1220
1212
|
|
|
1221
|
-
declare const Search:
|
|
1222
|
-
({ ref, placeholder, disabled, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, searchMode, onSearch, id, scale, className, style, virtualKeyboard, "data-testid": testId, ...rest }: SearchProps & {
|
|
1223
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
1224
|
-
}): React__default.JSX.Element;
|
|
1225
|
-
displayName: string;
|
|
1226
|
-
};
|
|
1213
|
+
declare const Search: React__default.ForwardRefExoticComponent<SearchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1227
1214
|
|
|
1228
1215
|
/**
|
|
1229
1216
|
* Props base compartilhadas por todas as configurações de tooltip do select.
|
|
1230
1217
|
*/
|
|
1231
|
-
interface BaseTooltipConfig$
|
|
1218
|
+
interface BaseTooltipConfig$3 {
|
|
1232
1219
|
/** Lado em que o tooltip será exibido */
|
|
1233
1220
|
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
1234
1221
|
/** Alinhamento do tooltip */
|
|
@@ -1238,14 +1225,14 @@ interface BaseTooltipConfig$2 {
|
|
|
1238
1225
|
* Configuração de tooltip com texto.
|
|
1239
1226
|
* Exibe um tooltip ao redor da label do select.
|
|
1240
1227
|
*/
|
|
1241
|
-
interface WithTooltip$
|
|
1228
|
+
interface WithTooltip$3 extends BaseTooltipConfig$3 {
|
|
1242
1229
|
/** Texto do tooltip exibido no hover */
|
|
1243
1230
|
tooltipText: string;
|
|
1244
1231
|
}
|
|
1245
1232
|
/**
|
|
1246
1233
|
* Configuração sem tooltip.
|
|
1247
1234
|
*/
|
|
1248
|
-
interface WithoutTooltip$
|
|
1235
|
+
interface WithoutTooltip$3 {
|
|
1249
1236
|
tooltipText?: never;
|
|
1250
1237
|
tooltipSide?: never;
|
|
1251
1238
|
tooltipAlign?: never;
|
|
@@ -1254,7 +1241,7 @@ interface WithoutTooltip$2 {
|
|
|
1254
1241
|
* Union type representando a configuração de tooltip do select.
|
|
1255
1242
|
* Pode ter tooltip com texto (e opcionalmente side/align) ou sem tooltip.
|
|
1256
1243
|
*/
|
|
1257
|
-
type SelectTooltipConfig = WithTooltip$
|
|
1244
|
+
type SelectTooltipConfig = WithTooltip$3 | WithoutTooltip$3;
|
|
1258
1245
|
/**
|
|
1259
1246
|
* Representa um item do select
|
|
1260
1247
|
*/
|
|
@@ -1357,132 +1344,6 @@ type SelectProps = SelectPropsBase & SelectTooltipConfig;
|
|
|
1357
1344
|
|
|
1358
1345
|
declare const Select: React__default.FC<SelectProps>;
|
|
1359
1346
|
|
|
1360
|
-
/**
|
|
1361
|
-
* Tipo base para dados da tabela. Use `<Table<SeuTipo>>` para type-safety completo.
|
|
1362
|
-
* @example <Table<User> dataSource={users} />
|
|
1363
|
-
*/
|
|
1364
|
-
type TableRowData = Record<string, any>;
|
|
1365
|
-
/** Tipos de coluna suportados */
|
|
1366
|
-
type TableColumnType = 'text' | 'datetime' | 'custom';
|
|
1367
|
-
/** Opções de alinhamento de coluna */
|
|
1368
|
-
type TableAlign = 'left' | 'center' | 'right';
|
|
1369
|
-
/**
|
|
1370
|
-
* Configuração de coluna da tabela
|
|
1371
|
-
* @typeParam T - Tipo dos dados da linha
|
|
1372
|
-
*/
|
|
1373
|
-
interface TableColumn<T = TableRowData> {
|
|
1374
|
-
/** Chave única identificadora da coluna */
|
|
1375
|
-
key: string;
|
|
1376
|
-
/** Conteúdo do cabeçalho da coluna */
|
|
1377
|
-
label: ReactNode;
|
|
1378
|
-
/** Tipo de dados da coluna */
|
|
1379
|
-
type?: TableColumnType;
|
|
1380
|
-
/** Formato de exibição (ex: 'dd/MM/yyyy' para datetime) */
|
|
1381
|
-
format?: string;
|
|
1382
|
-
/** Função customizada para renderizar o conteúdo da célula */
|
|
1383
|
-
render?: (row: T, index: number) => ReactNode;
|
|
1384
|
-
/** Alinhamento do conteúdo */
|
|
1385
|
-
align?: TableAlign;
|
|
1386
|
-
/** Estilos CSS customizados */
|
|
1387
|
-
style?: CSSProperties;
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Props do componente Table. Use genérico para autocomplete: `<Table<User>>`
|
|
1391
|
-
* @typeParam T - Tipo dos dados da linha
|
|
1392
|
-
*/
|
|
1393
|
-
interface TableProps<T = TableRowData> extends BaseProps {
|
|
1394
|
-
/** Configuração das colunas */
|
|
1395
|
-
columns: TableColumn<T>[];
|
|
1396
|
-
/** Array de dados a serem exibidos */
|
|
1397
|
-
dataSource: T[];
|
|
1398
|
-
/** Estado de carregamento */
|
|
1399
|
-
loading?: boolean;
|
|
1400
|
-
/** Configuração de seleção de linhas */
|
|
1401
|
-
rowSelection?: {
|
|
1402
|
-
/** Keys das linhas selecionadas (modo controlado) */
|
|
1403
|
-
selectedRowKeys?: (string | number)[];
|
|
1404
|
-
/** Callback quando seleção muda: (keys, rows) => void */
|
|
1405
|
-
onChange?: (keys: (string | number)[], rows: T[]) => void;
|
|
1406
|
-
/** Customiza props dos checkboxes: (row, index) => { disabled? } */
|
|
1407
|
-
getCheckboxProps?: (row: T, index: number) => {
|
|
1408
|
-
disabled?: boolean;
|
|
1409
|
-
};
|
|
1410
|
-
/** Desabilita o checkbox "selecionar todos" */
|
|
1411
|
-
disableSelectAll?: boolean;
|
|
1412
|
-
};
|
|
1413
|
-
/** Configurações de localização */
|
|
1414
|
-
locale?: {
|
|
1415
|
-
/** Texto quando não há dados */
|
|
1416
|
-
emptyText?: ReactNode;
|
|
1417
|
-
};
|
|
1418
|
-
/** Eventos de linha: (row, index) => { onClick?, onDoubleClick?, className? } */
|
|
1419
|
-
onRow?: (row: T, index: number) => {
|
|
1420
|
-
/** Clique simples na linha */
|
|
1421
|
-
onClick?: () => void;
|
|
1422
|
-
/** Clique duplo na linha */
|
|
1423
|
-
onDoubleClick?: () => void;
|
|
1424
|
-
/** Classe CSS da linha */
|
|
1425
|
-
className?: string;
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
declare const Table: <T extends TableRowData = TableRowData>({ columns, dataSource, className, loading, rowSelection, locale, onRow, ...rest }: TableProps<T>) => React__default.JSX.Element | null;
|
|
1430
|
-
|
|
1431
|
-
interface BaseFilterItem$1 {
|
|
1432
|
-
id?: string;
|
|
1433
|
-
buttonText: string | React__default.ReactNode;
|
|
1434
|
-
icon?: React__default.ReactElement;
|
|
1435
|
-
side?: Side;
|
|
1436
|
-
align?: Exclude<Align, 'center'>;
|
|
1437
|
-
disabled?: boolean;
|
|
1438
|
-
onToggle?: (isOpen: boolean) => void;
|
|
1439
|
-
tooltip?: string;
|
|
1440
|
-
}
|
|
1441
|
-
interface CheckboxFilterItem$1 extends BaseFilterItem$1 {
|
|
1442
|
-
type: 'multiple' | 'single';
|
|
1443
|
-
items: FilterItem$2[];
|
|
1444
|
-
selectedIds?: string[];
|
|
1445
|
-
onSelectionChange?: (selectedIds: string[]) => void;
|
|
1446
|
-
placeholder?: string;
|
|
1447
|
-
enableSearch?: boolean;
|
|
1448
|
-
}
|
|
1449
|
-
interface CalendarFilterItem$1 extends BaseFilterItem$1 {
|
|
1450
|
-
type: 'calendar';
|
|
1451
|
-
selectedDate?: Date | null;
|
|
1452
|
-
onDateSelect?: (date: Date) => void;
|
|
1453
|
-
onClear?: () => void;
|
|
1454
|
-
minDate?: Date;
|
|
1455
|
-
maxDate?: Date;
|
|
1456
|
-
locale?: string;
|
|
1457
|
-
placeholder?: string;
|
|
1458
|
-
}
|
|
1459
|
-
type FilterItem$1 = CheckboxFilterItem$1 | CalendarFilterItem$1;
|
|
1460
|
-
interface TableHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
1461
|
-
searchValue?: string;
|
|
1462
|
-
onSearchChange?: (value: string) => void;
|
|
1463
|
-
searchPlaceholder?: string;
|
|
1464
|
-
showSearch?: boolean;
|
|
1465
|
-
showFilters?: boolean;
|
|
1466
|
-
filters?: React__default.ReactNode;
|
|
1467
|
-
filterItems?: FilterItem$1[];
|
|
1468
|
-
className?: string;
|
|
1469
|
-
onSearch?: (value: string) => void;
|
|
1470
|
-
showClearSearch?: boolean;
|
|
1471
|
-
}
|
|
1472
|
-
declare const TableHeader: React__default.FC<TableHeaderProps>;
|
|
1473
|
-
|
|
1474
|
-
interface TablePaginationProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
1475
|
-
currentPage: number;
|
|
1476
|
-
totalItems: number;
|
|
1477
|
-
itemsPerPage: number;
|
|
1478
|
-
onPageChange: (page: number) => void;
|
|
1479
|
-
onItemsPerPageChange: (itemsPerPage: number) => void;
|
|
1480
|
-
pageSizeOptions?: number[];
|
|
1481
|
-
disabled?: boolean;
|
|
1482
|
-
className?: string;
|
|
1483
|
-
}
|
|
1484
|
-
declare const TablePagination: React__default.FC<TablePaginationProps>;
|
|
1485
|
-
|
|
1486
1347
|
declare module '@tanstack/react-table' {
|
|
1487
1348
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
1488
1349
|
/** Alinhamento do conteúdo da célula */
|
|
@@ -1518,7 +1379,7 @@ interface CheckboxFilterItem extends BaseFilterItem {
|
|
|
1518
1379
|
/** Tipo do filtro */
|
|
1519
1380
|
type: 'multiple' | 'single';
|
|
1520
1381
|
/** Lista de itens disponíveis para seleção */
|
|
1521
|
-
items: FilterItem$
|
|
1382
|
+
items: FilterItem$1[];
|
|
1522
1383
|
/** IDs dos itens atualmente selecionados */
|
|
1523
1384
|
selectedIds?: string[];
|
|
1524
1385
|
/** Callback chamado quando a seleção muda */
|
|
@@ -1579,10 +1440,42 @@ interface CombinedFilterItem extends BaseFilterItem {
|
|
|
1579
1440
|
* Pode ser do tipo multiple/single, calendário ou combined (Drawer).
|
|
1580
1441
|
*/
|
|
1581
1442
|
type FilterItem = CheckboxFilterItem | CalendarFilterItem | CombinedFilterItem;
|
|
1443
|
+
/**
|
|
1444
|
+
* Item de um ToggleButton de vista da tabela.
|
|
1445
|
+
*/
|
|
1446
|
+
interface ViewToggleItem {
|
|
1447
|
+
/** Valor único do item */
|
|
1448
|
+
value: string;
|
|
1449
|
+
/** Ícone exibido no botão (iconOnly) */
|
|
1450
|
+
icon: ReactNode;
|
|
1451
|
+
/** Texto do tooltip exibido no hover */
|
|
1452
|
+
tooltipText?: string;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Props do ToggleButton de alternância de vistas no cabeçalho do TableV2.
|
|
1456
|
+
*/
|
|
1457
|
+
interface TableV2ViewToggleProps<T = Record<string, unknown>> {
|
|
1458
|
+
/** Exatamente 2 itens icon-only para alternar entre as vistas */
|
|
1459
|
+
items: [ViewToggleItem, ViewToggleItem];
|
|
1460
|
+
/** Valor controlado do item selecionado */
|
|
1461
|
+
value?: string;
|
|
1462
|
+
/** Valor selecionado inicial (não controlado) */
|
|
1463
|
+
defaultValue?: string;
|
|
1464
|
+
/** Callback chamado quando a vista selecionada muda */
|
|
1465
|
+
onValueChange?: (value: string) => void;
|
|
1466
|
+
/**
|
|
1467
|
+
* Mapa de vistas: cada chave corresponde ao `value` de um item do toggle.
|
|
1468
|
+
* Quando presente, o TableV2 alterna internamente entre as colunas e dados de cada vista.
|
|
1469
|
+
*/
|
|
1470
|
+
views?: Record<string, {
|
|
1471
|
+
columns: ColumnDef<T, any>[];
|
|
1472
|
+
data: T[];
|
|
1473
|
+
}>;
|
|
1474
|
+
}
|
|
1582
1475
|
/**
|
|
1583
1476
|
* Props do cabeçalho do TableV2, com busca global e filtros.
|
|
1584
1477
|
*/
|
|
1585
|
-
interface TableV2HeaderProps {
|
|
1478
|
+
interface TableV2HeaderProps<T = Record<string, unknown>> {
|
|
1586
1479
|
/** Placeholder do campo de busca global */
|
|
1587
1480
|
searchPlaceholder?: string;
|
|
1588
1481
|
/** Items de filtro (Status, Data de início, etc.) */
|
|
@@ -1603,6 +1496,12 @@ interface TableV2HeaderProps {
|
|
|
1603
1496
|
* A paginação é automaticamente resetada para a página 1 ao buscar.
|
|
1604
1497
|
*/
|
|
1605
1498
|
onSearchChange?: (value: string) => void;
|
|
1499
|
+
/**
|
|
1500
|
+
* Quando presente, exibe um ToggleButton de 2 vistas (iconOnly) ao lado do Search.
|
|
1501
|
+
* Use `views` para que o TableV2 alterne internamente entre colunas e dados.
|
|
1502
|
+
* Use `onValueChange` se preferir controlar externamente.
|
|
1503
|
+
*/
|
|
1504
|
+
viewToggle?: TableV2ViewToggleProps<T>;
|
|
1606
1505
|
}
|
|
1607
1506
|
/**
|
|
1608
1507
|
* Props do rodapé do TableV2, com controles de paginação.
|
|
@@ -1722,7 +1621,7 @@ interface TableV2Props<T = Record<string, unknown>> extends EmptyStateProps {
|
|
|
1722
1621
|
/** Configuração das ações em massa exibidas quando há linhas selecionadas */
|
|
1723
1622
|
bulkActions?: TableV2BulkActionsProps<T>;
|
|
1724
1623
|
/** Header acima da tabela com busca + filtros */
|
|
1725
|
-
header?: TableV2HeaderProps
|
|
1624
|
+
header?: TableV2HeaderProps<T>;
|
|
1726
1625
|
/** Footer com paginação */
|
|
1727
1626
|
footer?: TableV2FooterProps;
|
|
1728
1627
|
/** Classe CSS personalizada para o componente */
|
|
@@ -1742,7 +1641,7 @@ declare const TableV2: <T>({ columns, data, rowSelection: rowSelectionConfig, en
|
|
|
1742
1641
|
/**
|
|
1743
1642
|
* Props base compartilhadas por todas as configurações de tooltip do TextArea.
|
|
1744
1643
|
*/
|
|
1745
|
-
interface BaseTooltipConfig$
|
|
1644
|
+
interface BaseTooltipConfig$2 {
|
|
1746
1645
|
/** Lado em que o tooltip será exibido */
|
|
1747
1646
|
tooltipSide?: Side;
|
|
1748
1647
|
/** Alinhamento do tooltip */
|
|
@@ -1752,14 +1651,14 @@ interface BaseTooltipConfig$1 {
|
|
|
1752
1651
|
* Configuração de tooltip com texto.
|
|
1753
1652
|
* Exibe um tooltip ao redor da label do TextArea.
|
|
1754
1653
|
*/
|
|
1755
|
-
interface WithTooltip$
|
|
1654
|
+
interface WithTooltip$2 extends BaseTooltipConfig$2 {
|
|
1756
1655
|
/** Texto do tooltip exibido no hover */
|
|
1757
1656
|
tooltipText: string;
|
|
1758
1657
|
}
|
|
1759
1658
|
/**
|
|
1760
1659
|
* Configuração sem tooltip.
|
|
1761
1660
|
*/
|
|
1762
|
-
interface WithoutTooltip$
|
|
1661
|
+
interface WithoutTooltip$2 {
|
|
1763
1662
|
tooltipText?: never;
|
|
1764
1663
|
tooltipSide?: never;
|
|
1765
1664
|
tooltipAlign?: never;
|
|
@@ -1768,7 +1667,7 @@ interface WithoutTooltip$1 {
|
|
|
1768
1667
|
* Union type representando a configuração de tooltip do TextArea.
|
|
1769
1668
|
* Pode ter tooltip com texto (e opcionalmente side/align) ou sem tooltip.
|
|
1770
1669
|
*/
|
|
1771
|
-
type TextAreaTooltipConfig = WithTooltip$
|
|
1670
|
+
type TextAreaTooltipConfig = WithTooltip$2 | WithoutTooltip$2;
|
|
1772
1671
|
/**
|
|
1773
1672
|
* Props base do componente TextArea.
|
|
1774
1673
|
*/
|
|
@@ -1808,19 +1707,14 @@ interface TextAreaPropsBase extends Omit<React__default.TextareaHTMLAttributes<H
|
|
|
1808
1707
|
*/
|
|
1809
1708
|
type TextAreaProps = TextAreaPropsBase & TextAreaTooltipConfig;
|
|
1810
1709
|
|
|
1811
|
-
declare const _default$1: React__default.
|
|
1812
|
-
({ ref, className, value, label, placeholder, onChange, disabled, maxLength, required, helperText, tooltipText, tooltipSide, tooltipAlign, errorMessage, error, id, onBlur, onFocus, name, resize, charCount, height, virtualKeyboard, ...rest }: TextAreaProps & {
|
|
1813
|
-
ref?: React__default.Ref<HTMLTextAreaElement>;
|
|
1814
|
-
}): React__default.JSX.Element;
|
|
1815
|
-
displayName: string;
|
|
1816
|
-
}>;
|
|
1710
|
+
declare const _default$1: React__default.NamedExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
1817
1711
|
|
|
1818
1712
|
/** Tipos de input suportados pelo TextField */
|
|
1819
1713
|
type TextFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
1820
1714
|
/**
|
|
1821
1715
|
* Props base compartilhadas por todas as configurações de tooltip do TextField.
|
|
1822
1716
|
*/
|
|
1823
|
-
interface BaseTooltipConfig {
|
|
1717
|
+
interface BaseTooltipConfig$1 {
|
|
1824
1718
|
/** Lado em que o tooltip será exibido */
|
|
1825
1719
|
tooltipSide?: Side;
|
|
1826
1720
|
/** Alinhamento do tooltip */
|
|
@@ -1830,14 +1724,14 @@ interface BaseTooltipConfig {
|
|
|
1830
1724
|
* Configuração de tooltip com texto.
|
|
1831
1725
|
* Exibe um tooltip ao redor da label do TextField.
|
|
1832
1726
|
*/
|
|
1833
|
-
interface WithTooltip extends BaseTooltipConfig {
|
|
1727
|
+
interface WithTooltip$1 extends BaseTooltipConfig$1 {
|
|
1834
1728
|
/** Texto do tooltip exibido no hover */
|
|
1835
1729
|
tooltipText: string;
|
|
1836
1730
|
}
|
|
1837
1731
|
/**
|
|
1838
1732
|
* Configuração sem tooltip.
|
|
1839
1733
|
*/
|
|
1840
|
-
interface WithoutTooltip {
|
|
1734
|
+
interface WithoutTooltip$1 {
|
|
1841
1735
|
tooltipText?: never;
|
|
1842
1736
|
tooltipSide?: never;
|
|
1843
1737
|
tooltipAlign?: never;
|
|
@@ -1846,7 +1740,7 @@ interface WithoutTooltip {
|
|
|
1846
1740
|
* Union type representando a configuração de tooltip do TextField.
|
|
1847
1741
|
* Pode ter tooltip com texto (e opcionalmente side/align) ou sem tooltip.
|
|
1848
1742
|
*/
|
|
1849
|
-
type TextFieldTooltipConfig = WithTooltip | WithoutTooltip;
|
|
1743
|
+
type TextFieldTooltipConfig = WithTooltip$1 | WithoutTooltip$1;
|
|
1850
1744
|
/**
|
|
1851
1745
|
* Props base do componente TextField
|
|
1852
1746
|
* @example
|
|
@@ -1910,12 +1804,7 @@ interface TextFieldPropsBase extends ScalableProps, Omit<React__default.InputHTM
|
|
|
1910
1804
|
*/
|
|
1911
1805
|
type TextFieldProps = TextFieldPropsBase & TextFieldTooltipConfig;
|
|
1912
1806
|
|
|
1913
|
-
declare const _default: React__default.
|
|
1914
|
-
({ ref, className, style, value, label, placeholder, type, onChange, disabled, maxLength, required, helperText, tooltipText, tooltipSide, tooltipAlign, errorMessage, error, id, icon, scale, onBlur, onFocus, name, persistIcon, virtualKeyboard, attachedToVirtualKeyboard, disableAutoComplete, ...rest }: TextFieldProps & {
|
|
1915
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
1916
|
-
}): React__default.JSX.Element;
|
|
1917
|
-
displayName: string;
|
|
1918
|
-
}>;
|
|
1807
|
+
declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1919
1808
|
|
|
1920
1809
|
/**
|
|
1921
1810
|
* Props do componente individual de notificação `Toast`.
|
|
@@ -2153,6 +2042,125 @@ interface SwitchProps extends ScalableProps {
|
|
|
2153
2042
|
|
|
2154
2043
|
declare const Switch: React$1.FC<SwitchProps>;
|
|
2155
2044
|
|
|
2045
|
+
/** Modo do componente: 'simple' (toggle único) ou 'combined' (grupo de toggles) */
|
|
2046
|
+
type ToggleButtonMode = 'simple' | 'combined';
|
|
2047
|
+
/** Tipo de seleção do grupo: 'single' (um item) ou 'multiple' (múltiplos itens) */
|
|
2048
|
+
type ToggleGroupType = 'single' | 'multiple';
|
|
2049
|
+
/** Orientação do grupo de toggles */
|
|
2050
|
+
type ToggleButtonOrientation = 'horizontal' | 'vertical';
|
|
2051
|
+
interface BaseTooltipConfig {
|
|
2052
|
+
tooltipSide?: 'top' | 'bottom' | 'left' | 'right';
|
|
2053
|
+
tooltipAlign?: 'start' | 'center' | 'end';
|
|
2054
|
+
}
|
|
2055
|
+
interface WithTooltip extends BaseTooltipConfig {
|
|
2056
|
+
/** Texto do tooltip exibido no hover */
|
|
2057
|
+
tooltipText: string;
|
|
2058
|
+
}
|
|
2059
|
+
interface WithoutTooltip {
|
|
2060
|
+
tooltipText?: never;
|
|
2061
|
+
tooltipSide?: never;
|
|
2062
|
+
tooltipAlign?: never;
|
|
2063
|
+
}
|
|
2064
|
+
type ToggleButtonTooltipConfig = WithTooltip | WithoutTooltip;
|
|
2065
|
+
/**
|
|
2066
|
+
* Item de um ToggleGroup
|
|
2067
|
+
*/
|
|
2068
|
+
interface ToggleGroupItem {
|
|
2069
|
+
/** Valor único do item (usado em `value` e `onValueChange`) */
|
|
2070
|
+
value: string;
|
|
2071
|
+
/** Conteúdo textual ou nó React exibido no item */
|
|
2072
|
+
label?: ReactNode;
|
|
2073
|
+
/** Ícone exibido à esquerda do label */
|
|
2074
|
+
icon?: ReactNode;
|
|
2075
|
+
/** Exibe somente o ícone, sem label */
|
|
2076
|
+
iconOnly?: boolean;
|
|
2077
|
+
/** Desabilita o item, impedindo sua seleção */
|
|
2078
|
+
disabled?: boolean;
|
|
2079
|
+
}
|
|
2080
|
+
/** @internal */
|
|
2081
|
+
type ToggleGroupSingleSelectionProps = {
|
|
2082
|
+
selectionType?: 'single';
|
|
2083
|
+
/** Valor do Toggle selecionado controlado */
|
|
2084
|
+
value?: string;
|
|
2085
|
+
/** Valor do Toggle selecionado padrão (não controlado) */
|
|
2086
|
+
defaultValue?: string;
|
|
2087
|
+
/**
|
|
2088
|
+
* Callback chamado quando o Toggle selecionado muda.
|
|
2089
|
+
* Retorna o `value` do Toggle selecionado.
|
|
2090
|
+
*/
|
|
2091
|
+
onValueChange?: (value: string) => void;
|
|
2092
|
+
};
|
|
2093
|
+
/** @internal */
|
|
2094
|
+
type ToggleGroupMultipleSelectionProps = {
|
|
2095
|
+
selectionType: 'multiple';
|
|
2096
|
+
/** Valores dos Toggles selecionados controlados */
|
|
2097
|
+
value?: string[];
|
|
2098
|
+
/** Valores dos Toggles selecionados padrão (não controlados) */
|
|
2099
|
+
defaultValue?: string[];
|
|
2100
|
+
/**
|
|
2101
|
+
* Callback chamado quando os Toggles selecionados mudam.
|
|
2102
|
+
* Retorna um array com os `value`s dos Toggles selecionados.
|
|
2103
|
+
*/
|
|
2104
|
+
onValueChange?: (value: string[]) => void;
|
|
2105
|
+
};
|
|
2106
|
+
/**
|
|
2107
|
+
* Props específicas do ToggleGroup (modo `combined`).
|
|
2108
|
+
*
|
|
2109
|
+
* Use a prop `onValueChange` para saber qual Toggle está selecionado:
|
|
2110
|
+
* - `selectionType="single"` → `onValueChange: (value: string) => void`
|
|
2111
|
+
* - `selectionType="multiple"` → `onValueChange: (value: string[]) => void`
|
|
2112
|
+
*/
|
|
2113
|
+
type ToggleGroupProps = {
|
|
2114
|
+
/** Orientação do grupo: `'horizontal'` (padrão) ou `'vertical'` */
|
|
2115
|
+
orientation?: ToggleButtonOrientation;
|
|
2116
|
+
/** Items do grupo de toggles */
|
|
2117
|
+
items?: ToggleGroupItem[];
|
|
2118
|
+
} & (ToggleGroupSingleSelectionProps | ToggleGroupMultipleSelectionProps);
|
|
2119
|
+
/**
|
|
2120
|
+
* Props do componente ToggleButton
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```tsx
|
|
2123
|
+
* // Toggle único (modo simple — padrão)
|
|
2124
|
+
* <ToggleButton mode="simple" onPressedChange={(pressed) => console.log(pressed)}>
|
|
2125
|
+
* Negrito
|
|
2126
|
+
* </ToggleButton>
|
|
2127
|
+
* ```
|
|
2128
|
+
* @example
|
|
2129
|
+
* ```tsx
|
|
2130
|
+
* // Grupo de toggles (modo combined)
|
|
2131
|
+
* <ToggleButton
|
|
2132
|
+
* mode="combined"
|
|
2133
|
+
* type="single"
|
|
2134
|
+
* items={[
|
|
2135
|
+
* { value: 'left', label: 'Esquerda' },
|
|
2136
|
+
* { value: 'center', label: 'Centro' },
|
|
2137
|
+
* { value: 'right', label: 'Direita' },
|
|
2138
|
+
* ]}
|
|
2139
|
+
* onValueChange={(value) => console.log(value)}
|
|
2140
|
+
* />
|
|
2141
|
+
* ```
|
|
2142
|
+
*/
|
|
2143
|
+
type ToggleButtonProps = ScalableProps & {
|
|
2144
|
+
/** Modo do componente: `'simple'` (toggle único, padrão) ou `'combined'` (grupo de toggles) */
|
|
2145
|
+
mode?: ToggleButtonMode;
|
|
2146
|
+
/** Tamanho do componente: `'lg'` (padrão) ou `'sm'` */
|
|
2147
|
+
size?: Size;
|
|
2148
|
+
/** Ícone exibido à esquerda do conteúdo (modo simple) */
|
|
2149
|
+
icon?: ReactNode;
|
|
2150
|
+
/** Exibe somente o ícone, sem texto (modo simple) */
|
|
2151
|
+
iconOnly?: boolean;
|
|
2152
|
+
/** Conteúdo do botão (modo combined) */
|
|
2153
|
+
children?: ReactNode;
|
|
2154
|
+
/** Estado pressionado controlado (modo simple) */
|
|
2155
|
+
pressed?: boolean;
|
|
2156
|
+
/** Estado pressionado padrão não controlado (modo simple) */
|
|
2157
|
+
defaultPressed?: boolean;
|
|
2158
|
+
/** Callback ao alterar estado pressionado: `(pressed: boolean) => void` (modo simple) */
|
|
2159
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
2160
|
+
} & ToggleGroupProps & ToggleButtonTooltipConfig;
|
|
2161
|
+
|
|
2162
|
+
declare const ToggleButton: React__default.FC<ToggleButtonProps>;
|
|
2163
|
+
|
|
2156
2164
|
/** Tipos de validação suportados pelo VerificationCode */
|
|
2157
2165
|
type OTPValidationType = 'numeric' | 'alphanumeric' | 'alpha';
|
|
2158
2166
|
/**
|
|
@@ -2329,5 +2337,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
|
|
|
2329
2337
|
|
|
2330
2338
|
declare const normalizeText: (text: React.ReactNode) => string;
|
|
2331
2339
|
|
|
2332
|
-
export { Avatar, Badge, Button, Calendar, Callout, Card, Checkbox, MemoizedChips as Chips, Container, _default$2 as DatePicker, Dialog, Drawer, FileUpload, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch,
|
|
2333
|
-
export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CardProps, CheckboxProps, ChipsProps, ContainerProps, DatePickerProps, DialogProps, DrawerProps, FileUploadProps,
|
|
2340
|
+
export { Avatar, Badge, Button, Calendar, Callout, Card, Checkbox, MemoizedChips as Chips, Container, _default$2 as DatePicker, Dialog, Drawer, FileUpload, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch, TableV2, _default$1 as TextArea, _default as TextField, Toast, ToastContainer, ToastProvider, ToggleButton, Tooltip, VerificationCode, VirtualKeyboard, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
|
|
2341
|
+
export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CardProps, CheckboxProps, ChipsProps, ContainerProps, DatePickerProps, DialogProps, DrawerProps, FileUploadProps, FilterProps, ListItemProps, MenuProps, ModalProps, PopoverProps, QuantityProps, RadioGroupProps, RadioProps, SearchProps, SelectProps, SwitchProps, TableV2FooterProps, TableV2HeaderProps, TableV2Props, TextAreaProps, TextFieldProps, ToastProps, ToggleButtonMode, ToggleButtonOrientation, ToggleButtonProps, ToggleGroupItem, ToggleGroupType, TooltipProps, VerificationCodeProps, VirtualKeyboardProps, VirtualKeyboardVariant };
|