@giro-ds/react 8.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +910 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +307 -39
- package/dist/index.esm.js +913 -141
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +24 -2
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ReactElement, ComponentPropsWithoutRef, CSSProperties } from 'react';
|
|
2
|
+
import React__default, { ReactNode, ReactElement, RefObject, ComponentPropsWithoutRef, CSSProperties } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { Matcher } from 'react-day-picker';
|
|
5
5
|
import { RowData, ColumnDef } from '@tanstack/react-table';
|
|
@@ -18,6 +18,7 @@ type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
|
18
18
|
type Align = 'start' | 'center' | 'end';
|
|
19
19
|
/** Posição horizontal de um elemento secundário: 'right' (direita), 'left' (esquerda) ou 'both' (ambos os lados) */
|
|
20
20
|
type Position = 'right' | 'left' | 'both';
|
|
21
|
+
type Scale = 1 | 1.5 | 2;
|
|
21
22
|
/** Localidade do componente: 'pt-br' (Português do Brasil) ou 'en-us' (Inglês dos EUA) */
|
|
22
23
|
type Locale = 'pt-br' | 'en-us';
|
|
23
24
|
/** Props base compartilhadas por todos os componentes do design system */
|
|
@@ -78,7 +79,7 @@ interface BadgeProps extends BaseProps {
|
|
|
78
79
|
badgeValue?: number | string | null;
|
|
79
80
|
/** Label acessível para leitores de tela */
|
|
80
81
|
'aria-label'?: string;
|
|
81
|
-
/**
|
|
82
|
+
/** Quando `true`, aplica a variante de cor do Filter (fundo azul em vez do padrão vermelho) */
|
|
82
83
|
filterVariant?: boolean;
|
|
83
84
|
/** Classe CSS opcional */
|
|
84
85
|
className?: string;
|
|
@@ -114,6 +115,8 @@ type ButtonOwnPropsBase = {
|
|
|
114
115
|
type?: 'button' | 'submit' | 'reset';
|
|
115
116
|
/** Tamanho do botão */
|
|
116
117
|
size?: Size;
|
|
118
|
+
/** Escala visual aplicada ao botão */
|
|
119
|
+
scale?: Scale;
|
|
117
120
|
/** Define se o botão ocupa 100% da largura do container */
|
|
118
121
|
fullWidth?: boolean;
|
|
119
122
|
/** Label acessível para leitores de tela */
|
|
@@ -231,10 +234,12 @@ interface CalendarBaseProps extends Omit<BaseProps, 'disabled'> {
|
|
|
231
234
|
autoFocus?: boolean;
|
|
232
235
|
/** Substitui os `classNames` padrão do react-day-picker. */
|
|
233
236
|
classNames?: Partial<Record<string, string>>;
|
|
237
|
+
/** Escala visual aplicada ao componente */
|
|
238
|
+
scale?: Scale;
|
|
234
239
|
}
|
|
235
240
|
type CalendarProps = CalendarBaseProps;
|
|
236
241
|
|
|
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;
|
|
242
|
+
declare const Calendar: ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale, autoFocus, className, scale, id, "aria-label": ariaLabel, ...rest }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
238
243
|
|
|
239
244
|
/**
|
|
240
245
|
* Props do componente Callout
|
|
@@ -322,6 +327,8 @@ interface CheckboxProps extends BaseProps {
|
|
|
322
327
|
indeterminate?: boolean;
|
|
323
328
|
/** Classe CSS opcional */
|
|
324
329
|
className?: string;
|
|
330
|
+
/** Escala visual aplicada ao componente */
|
|
331
|
+
scale?: Scale;
|
|
325
332
|
}
|
|
326
333
|
|
|
327
334
|
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
@@ -361,6 +368,8 @@ interface ChipsProps extends BaseProps, Omit<React$1.HTMLAttributes<HTMLDivEleme
|
|
|
361
368
|
style?: React$1.CSSProperties;
|
|
362
369
|
/** Classe CSS opcional */
|
|
363
370
|
className?: string;
|
|
371
|
+
/** Escala visual aplicada ao componente */
|
|
372
|
+
scale?: Scale;
|
|
364
373
|
}
|
|
365
374
|
|
|
366
375
|
declare const MemoizedChips: React__default.NamedExoticComponent<ChipsProps>;
|
|
@@ -436,6 +445,10 @@ interface DatePickerProps extends BaseProps {
|
|
|
436
445
|
'data-testid'?: string;
|
|
437
446
|
/** Classe CSS opcional */
|
|
438
447
|
className?: string;
|
|
448
|
+
/** Escala visual aplicada ao componente */
|
|
449
|
+
datePickerScale?: Scale;
|
|
450
|
+
/** Escala visual aplicada ao calendário */
|
|
451
|
+
calendarScale?: Scale;
|
|
439
452
|
}
|
|
440
453
|
|
|
441
454
|
declare const _default$2: React__default.NamedExoticComponent<DatePickerProps>;
|
|
@@ -523,25 +536,32 @@ interface DrawerProps extends BaseProps {
|
|
|
523
536
|
closeOnEscape?: boolean;
|
|
524
537
|
/** Classe CSS opcional */
|
|
525
538
|
className?: string;
|
|
539
|
+
/** Conteúdo fixo exibido abaixo da área rolável, sem acompanhar o scroll */
|
|
540
|
+
footer?: ReactNode;
|
|
526
541
|
}
|
|
527
542
|
|
|
528
543
|
declare const Drawer: React__default.FC<DrawerProps>;
|
|
529
544
|
|
|
530
545
|
interface FilterItem$2 {
|
|
531
|
-
|
|
546
|
+
/** Identificador único do item (usado em `selectedIds` e `onApplyFilter`) */
|
|
547
|
+
id?: BaseProps['id'];
|
|
548
|
+
/** Texto principal exibido no item */
|
|
532
549
|
text: string;
|
|
550
|
+
/** Texto secundário exibido abaixo do texto principal */
|
|
533
551
|
subText?: string;
|
|
552
|
+
/** Ícone exibido à esquerda do texto */
|
|
534
553
|
icon?: ReactNode;
|
|
535
|
-
|
|
554
|
+
/** Desabilita o item, impedindo sua seleção */
|
|
555
|
+
disabled?: BaseProps['disabled'];
|
|
536
556
|
}
|
|
537
|
-
type FilterType = '
|
|
557
|
+
type FilterType = 'single' | 'multiple' | 'calendar';
|
|
538
558
|
/**
|
|
539
559
|
* Props do componente Filter
|
|
540
560
|
* @example
|
|
541
561
|
* ```tsx
|
|
542
562
|
* <Filter
|
|
543
563
|
* items={filterItems}
|
|
544
|
-
* type="
|
|
564
|
+
* type="multiple"
|
|
545
565
|
* placeholder="Filtrar por categoria"
|
|
546
566
|
* onApplyFilter={(ids) => handleFilter(ids)}
|
|
547
567
|
* buttonText="Filtros"
|
|
@@ -599,7 +619,27 @@ interface FilterProps extends BaseProps {
|
|
|
599
619
|
/** Idioma do calendário */
|
|
600
620
|
locale?: Locale;
|
|
601
621
|
/** Classe CSS opcional */
|
|
602
|
-
className?:
|
|
622
|
+
className?: BaseProps['className'];
|
|
623
|
+
/**
|
|
624
|
+
* Modo de exibição do filtro
|
|
625
|
+
* - `'simple'`: filtro simples com popover (padrão)
|
|
626
|
+
* - `'combined'`: filtro combinado com painel lateral onde o conteúdo é composto via children
|
|
627
|
+
*/
|
|
628
|
+
mode?: 'simple' | 'combined';
|
|
629
|
+
/** Largura do painel lateral no modo combined (ex: '400px', '50vw'). Quando omitido, usa o tamanho padrão do Drawer */
|
|
630
|
+
drawerWidth?: string;
|
|
631
|
+
/** Título do painel lateral (padrão: 'Filtrar') */
|
|
632
|
+
title?: string;
|
|
633
|
+
/** Número de filtros ativos exibido como badge no botão */
|
|
634
|
+
activeCount?: number;
|
|
635
|
+
/** Conteúdo customizado no cabeçalho do Drawer */
|
|
636
|
+
drawerHeaderContent?: ReactNode;
|
|
637
|
+
/** Conteúdo do painel lateral no modo combined */
|
|
638
|
+
children?: ReactNode;
|
|
639
|
+
/** Callback ao aplicar no modo combined: () => void */
|
|
640
|
+
onApply?: () => void;
|
|
641
|
+
/** Callback ao limpar no modo combined: () => void */
|
|
642
|
+
onClear?: () => void;
|
|
603
643
|
}
|
|
604
644
|
|
|
605
645
|
declare const Filter: React__default.FC<FilterProps>;
|
|
@@ -649,9 +689,9 @@ interface ListItemProps extends BaseProps {
|
|
|
649
689
|
icon?: React$1.ReactNode;
|
|
650
690
|
/** Valor do input (para variantes checkbox/radio) */
|
|
651
691
|
value?: string;
|
|
652
|
-
/**
|
|
692
|
+
/** Controla a visibilidade do subtexto explicitamente, independentemente de `subText` estar preenchido */
|
|
653
693
|
showSubText?: boolean;
|
|
654
|
-
/**
|
|
694
|
+
/** Força o estado visual de hover no item (útil para controle externo de foco/seleção) */
|
|
655
695
|
hovered?: boolean;
|
|
656
696
|
/** Classe CSS opcional */
|
|
657
697
|
className?: string;
|
|
@@ -710,7 +750,11 @@ interface MenuProps extends BaseProps {
|
|
|
710
750
|
items: MenuItemProps[];
|
|
711
751
|
/** Elemento trigger customizado para abrir o menu */
|
|
712
752
|
children?: ReactElement;
|
|
713
|
-
/**
|
|
753
|
+
/**
|
|
754
|
+
* Tipo de visualização dos itens do menu.
|
|
755
|
+
* - `'text'` (padrão): exibe texto e ícone lado a lado
|
|
756
|
+
* - `'icon'`: exibe apenas ícones, sem texto
|
|
757
|
+
*/
|
|
714
758
|
type?: 'text' | 'icon';
|
|
715
759
|
/** Callback executado quando um item é selecionado: (item) => void */
|
|
716
760
|
onItemSelect?: (items: MenuItemProps) => void;
|
|
@@ -736,6 +780,10 @@ interface MenuProps extends BaseProps {
|
|
|
736
780
|
onOpenChange?: (open: boolean) => void;
|
|
737
781
|
/** Classe CSS opcional */
|
|
738
782
|
className?: string;
|
|
783
|
+
/** Escala visual aplicada ao conteúdo do menu */
|
|
784
|
+
dropdownScale?: Scale;
|
|
785
|
+
/** Escala visual aplicada ao botão/trigger quando ele aceitar a prop `scale` */
|
|
786
|
+
buttonScale?: Scale;
|
|
739
787
|
}
|
|
740
788
|
|
|
741
789
|
declare const Menu: React__default.FC<MenuProps>;
|
|
@@ -790,9 +838,13 @@ interface ModalProps extends BaseProps {
|
|
|
790
838
|
declare const Modal: React$1.FC<ModalProps>;
|
|
791
839
|
|
|
792
840
|
interface PopoverProps {
|
|
793
|
-
|
|
794
|
-
|
|
841
|
+
/** Elemento que aciona a abertura do popover (geralmente um botão ou ícone) */
|
|
842
|
+
trigger: React$1.ReactNode;
|
|
843
|
+
/** Conteúdo exibido dentro do popover ao abrir */
|
|
844
|
+
content: React$1.ReactNode;
|
|
845
|
+
/** Alinhamento do popover em relação ao trigger no eixo perpendicular ao `side`. @default 'center' */
|
|
795
846
|
align?: Align;
|
|
847
|
+
/** Lado em que o popover aparece em relação ao trigger. @default 'bottom' */
|
|
796
848
|
side?: Side;
|
|
797
849
|
/** Distância em pixels entre o conteúdo e o trigger */
|
|
798
850
|
sideOffset?: number;
|
|
@@ -801,12 +853,12 @@ interface PopoverProps {
|
|
|
801
853
|
/** Callback chamado quando o estado de abertura muda */
|
|
802
854
|
onOpenChange?: (open: boolean) => void;
|
|
803
855
|
/**
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
856
|
+
* Quando `true`, o trigger atua como âncora de posicionamento e o popover
|
|
857
|
+
* é aberto/fechado exclusivamente via `open`/`onOpenChange` (modo DatePicker).
|
|
858
|
+
* Quando `false` (padrão), o trigger continua abrindo/fechando o popover
|
|
859
|
+
* normalmente, mas o estado pode ser sincronizado via `open`/`onOpenChange`
|
|
860
|
+
* (modo Filter).
|
|
861
|
+
*/
|
|
810
862
|
asAnchor?: boolean;
|
|
811
863
|
/** Callback chamado quando o foco automático é ativado ao abrir o popover */
|
|
812
864
|
onOpenAutoFocus?: (event: Event) => void;
|
|
@@ -836,7 +888,7 @@ declare const Popover: React$1.FC<PopoverProps>;
|
|
|
836
888
|
* value={1}
|
|
837
889
|
* decimal={true}
|
|
838
890
|
* decimalPlaces={2}
|
|
839
|
-
*
|
|
891
|
+
* valueIncrement={0.5}
|
|
840
892
|
* disabled={false}
|
|
841
893
|
* />
|
|
842
894
|
* ```
|
|
@@ -873,6 +925,8 @@ interface QuantityProps extends BaseProps {
|
|
|
873
925
|
inputAriaLabel?: string;
|
|
874
926
|
/** Classe CSS opcional */
|
|
875
927
|
className?: string;
|
|
928
|
+
/** Escala visual aplicada ao componente */
|
|
929
|
+
scale?: Scale;
|
|
876
930
|
}
|
|
877
931
|
|
|
878
932
|
declare const memorizedQuantity: React__default.NamedExoticComponent<QuantityProps>;
|
|
@@ -929,10 +983,79 @@ interface RadioGroupProps extends BaseProps {
|
|
|
929
983
|
ariaLabel?: string;
|
|
930
984
|
/** Orientação do layout dos radio buttons */
|
|
931
985
|
orientation?: "horizontal" | "vertical";
|
|
986
|
+
/** Escala visual aplicada ao grupo */
|
|
987
|
+
scale?: Scale;
|
|
932
988
|
}
|
|
933
989
|
|
|
934
990
|
declare const Radio: React__default.FC<RadioGroupProps>;
|
|
935
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Modo de exibição do VirtualKeyboard.
|
|
994
|
+
* - `native`: age como teclado nativo — aparecerá ao focar em um campo (implementação futura).
|
|
995
|
+
* - `fixed`: teclado sempre visível na tela com um TextField próprio acima dele.
|
|
996
|
+
*/
|
|
997
|
+
type VirtualKeyboardVariant = 'native' | 'fixed';
|
|
998
|
+
/** Layouts disponíveis para o VirtualKeyboard */
|
|
999
|
+
type VirtualKeyboardType = 'default' | 'numeric';
|
|
1000
|
+
/**
|
|
1001
|
+
* Props do componente VirtualKeyboard
|
|
1002
|
+
* @example
|
|
1003
|
+
* ```tsx
|
|
1004
|
+
* // Modo fixed: teclado sempre visível com TextField próprio
|
|
1005
|
+
* <VirtualKeyboard
|
|
1006
|
+
* variant="fixed"
|
|
1007
|
+
* type="default"
|
|
1008
|
+
* onChange={(value) => setValue(value)}
|
|
1009
|
+
* />
|
|
1010
|
+
* ```
|
|
1011
|
+
* @example
|
|
1012
|
+
* ```tsx
|
|
1013
|
+
* // Modo native: teclado gerenciado externamente (futuramente acionado por foco)
|
|
1014
|
+
* <VirtualKeyboard
|
|
1015
|
+
* variant="native"
|
|
1016
|
+
* type="numeric"
|
|
1017
|
+
* value={pin}
|
|
1018
|
+
* onChange={setPin}
|
|
1019
|
+
* maxLength={4}
|
|
1020
|
+
* />
|
|
1021
|
+
* ```
|
|
1022
|
+
*/
|
|
1023
|
+
interface VirtualKeyboardProps extends Omit<BaseProps, 'disabled'> {
|
|
1024
|
+
/**
|
|
1025
|
+
* Modo de exibição do teclado.
|
|
1026
|
+
* - `native`: comporta-se como teclado nativo (acionamento por foco — futuramente implementado).
|
|
1027
|
+
* - `fixed`: teclado fixo na tela com um TextField próprio acima.
|
|
1028
|
+
* @default 'native'
|
|
1029
|
+
*/
|
|
1030
|
+
variant?: VirtualKeyboardVariant;
|
|
1031
|
+
/** Valor controlado do input vinculado ao teclado */
|
|
1032
|
+
value?: string;
|
|
1033
|
+
/** Tipo do teclado (padrão: "default") */
|
|
1034
|
+
type?: VirtualKeyboardType;
|
|
1035
|
+
/** Callback executado quando o valor do input muda: (value) => void */
|
|
1036
|
+
onChange?: (value: string) => void;
|
|
1037
|
+
/** Callback executado quando uma tecla é pressionada: (key) => void */
|
|
1038
|
+
onKeyPress?: (key: string) => void;
|
|
1039
|
+
/** Limite máximo de caracteres */
|
|
1040
|
+
maxLength?: number;
|
|
1041
|
+
/** Controla a exibição do botão {emoticon} nos layouts suportados */
|
|
1042
|
+
Emoji?: boolean;
|
|
1043
|
+
/** Placeholder do TextField exibido no modo `fixed` */
|
|
1044
|
+
textFieldPlaceholder?: string;
|
|
1045
|
+
/** Texto de ajuda do TextField exibido no modo `fixed` */
|
|
1046
|
+
helperText?: string;
|
|
1047
|
+
/** Sinaliza erro no TextField exibido no modo `fixed` */
|
|
1048
|
+
error?: boolean;
|
|
1049
|
+
/** Mensagem de erro do TextField exibido no modo `fixed` */
|
|
1050
|
+
errorMessage?: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Ref para o campo de input que aciona o teclado no modo `native`.
|
|
1053
|
+
* O teclado aparece ao focar no elemento referenciado e some ao perder o foco.
|
|
1054
|
+
* Se omitido no modo `native`, o teclado permanece sempre visível.
|
|
1055
|
+
*/
|
|
1056
|
+
targetRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
936
1059
|
/**
|
|
937
1060
|
* Props do componente Search
|
|
938
1061
|
* @example
|
|
@@ -974,10 +1097,30 @@ interface SearchProps extends BaseProps, NativeInputProps {
|
|
|
974
1097
|
onClick?: (e: React$1.MouseEvent<HTMLDivElement>) => void;
|
|
975
1098
|
/** Callback executado ao pressionar mouse no componente: (e) => void */
|
|
976
1099
|
onMouseDown?: (e: React$1.MouseEvent<HTMLDivElement>) => void;
|
|
1100
|
+
/**
|
|
1101
|
+
* Modo de pesquisa:
|
|
1102
|
+
* - `'instant'` (padrão): dispara a busca a cada tecla digitada
|
|
1103
|
+
* - `'on-enter'`: dispara a busca somente ao pressionar Enter
|
|
1104
|
+
*/
|
|
1105
|
+
searchMode?: 'instant' | 'on-enter';
|
|
1106
|
+
/**
|
|
1107
|
+
* Callback executado quando a busca é acionada.
|
|
1108
|
+
* - No modo `'instant'`: chamado a cada mudança de valor
|
|
1109
|
+
* - No modo `'on-enter'`: chamado somente ao pressionar Enter
|
|
1110
|
+
*/
|
|
1111
|
+
onSearch?: (value: string) => void;
|
|
977
1112
|
/** ID para testes automatizados */
|
|
978
1113
|
'data-testid'?: string;
|
|
979
1114
|
/** Classe CSS opcional */
|
|
980
1115
|
className?: string;
|
|
1116
|
+
/** Habilita o teclado virtual */
|
|
1117
|
+
virtualKeyboard?: boolean;
|
|
1118
|
+
/** Variante do teclado virtual (padrão: 'default') */
|
|
1119
|
+
virtualKeyboardType?: VirtualKeyboardType;
|
|
1120
|
+
/** Comprimento máximo permitido pelo teclado virtual */
|
|
1121
|
+
virtualKeyboardMaxLength?: number;
|
|
1122
|
+
/** Escala visual aplicada ao componente */
|
|
1123
|
+
scale?: Scale;
|
|
981
1124
|
}
|
|
982
1125
|
|
|
983
1126
|
declare const Search: React__default.ForwardRefExoticComponent<SearchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1081,6 +1224,8 @@ interface SelectProps extends BaseProps {
|
|
|
1081
1224
|
isSearching?: boolean;
|
|
1082
1225
|
/** Classe CSS opcional */
|
|
1083
1226
|
className?: string;
|
|
1227
|
+
/** Escala visual aplicada ao componente */
|
|
1228
|
+
scale?: Scale;
|
|
1084
1229
|
}
|
|
1085
1230
|
|
|
1086
1231
|
declare const Select: React__default.FC<SelectProps>;
|
|
@@ -1167,7 +1312,7 @@ interface BaseFilterItem$1 {
|
|
|
1167
1312
|
tooltip?: string;
|
|
1168
1313
|
}
|
|
1169
1314
|
interface CheckboxFilterItem$1 extends BaseFilterItem$1 {
|
|
1170
|
-
type: '
|
|
1315
|
+
type: 'multiple' | 'single';
|
|
1171
1316
|
items: FilterItem$2[];
|
|
1172
1317
|
selectedIds?: string[];
|
|
1173
1318
|
onSelectionChange?: (selectedIds: string[]) => void;
|
|
@@ -1239,12 +1384,12 @@ interface BaseFilterItem {
|
|
|
1239
1384
|
onToggle?: (isOpen: boolean) => void;
|
|
1240
1385
|
}
|
|
1241
1386
|
/**
|
|
1242
|
-
* Props de filtro do tipo
|
|
1387
|
+
* Props de filtro do tipo multiple, single ou ícone.
|
|
1243
1388
|
* Renderiza uma lista de opções selecionáveis.
|
|
1244
1389
|
*/
|
|
1245
1390
|
interface CheckboxFilterItem extends BaseFilterItem {
|
|
1246
1391
|
/** Tipo do filtro */
|
|
1247
|
-
type: '
|
|
1392
|
+
type: 'multiple' | 'single';
|
|
1248
1393
|
/** Lista de itens disponíveis para seleção */
|
|
1249
1394
|
items: FilterItem$2[];
|
|
1250
1395
|
/** IDs dos itens atualmente selecionados */
|
|
@@ -1278,21 +1423,63 @@ interface CalendarFilterItem extends BaseFilterItem {
|
|
|
1278
1423
|
/** Placeholder exibido quando nenhuma data está selecionada */
|
|
1279
1424
|
placeholder?: string;
|
|
1280
1425
|
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Props de filtro do tipo combined.
|
|
1428
|
+
* Abre um painel lateral (Drawer) com conteúdo composto via children.
|
|
1429
|
+
*/
|
|
1430
|
+
interface CombinedFilterItem extends BaseFilterItem {
|
|
1431
|
+
/** Tipo do filtro */
|
|
1432
|
+
type: 'combined';
|
|
1433
|
+
/** Título do painel lateral (padrão: 'Filtrar') */
|
|
1434
|
+
title?: string;
|
|
1435
|
+
/** Largura do painel lateral (ex: '400px', '50vw') */
|
|
1436
|
+
drawerWidth?: string;
|
|
1437
|
+
/** Número de filtros ativos exibido como badge no botão */
|
|
1438
|
+
activeCount?: number;
|
|
1439
|
+
/** Conteúdo customizado no cabeçalho do Drawer */
|
|
1440
|
+
drawerHeaderContent?: ReactNode;
|
|
1441
|
+
/** Conteúdo do painel lateral */
|
|
1442
|
+
children?: ReactNode;
|
|
1443
|
+
/** Callback ao clicar em Aplicar */
|
|
1444
|
+
onApply?: () => void;
|
|
1445
|
+
/** Callback ao clicar em Limpar */
|
|
1446
|
+
onClear?: () => void;
|
|
1447
|
+
/** Variante visual do botão (padrão: 'outlined') */
|
|
1448
|
+
variant?: Variant;
|
|
1449
|
+
}
|
|
1281
1450
|
/**
|
|
1282
1451
|
* Union type representando um item de filtro da tabela.
|
|
1283
|
-
* Pode ser do tipo
|
|
1452
|
+
* Pode ser do tipo multiple/single, calendário ou combined (Drawer).
|
|
1284
1453
|
*/
|
|
1285
|
-
type FilterItem = CheckboxFilterItem | CalendarFilterItem;
|
|
1454
|
+
type FilterItem = CheckboxFilterItem | CalendarFilterItem | CombinedFilterItem;
|
|
1286
1455
|
/**
|
|
1287
1456
|
* Props do cabeçalho do TableV2, com busca global e filtros.
|
|
1288
1457
|
*/
|
|
1289
1458
|
interface TableV2HeaderProps {
|
|
1290
1459
|
/** Placeholder do campo de busca global */
|
|
1291
1460
|
searchPlaceholder?: string;
|
|
1292
|
-
/** Exibe o campo de busca (padrão: true) */
|
|
1293
|
-
showSearch?: boolean;
|
|
1294
1461
|
/** Items de filtro (Status, Data de início, etc.) */
|
|
1295
1462
|
filterItems?: FilterItem[];
|
|
1463
|
+
/** Habilita o teclado virtual */
|
|
1464
|
+
virtualKeyboard?: boolean;
|
|
1465
|
+
/** Tipo do teclado virtual (padrão: 'default') */
|
|
1466
|
+
virtualKeyboardType?: VirtualKeyboardType;
|
|
1467
|
+
/** Comprimento máximo permitido pelo teclado virtual */
|
|
1468
|
+
virtualKeyboardMaxLength?: number;
|
|
1469
|
+
/** Modo de busca: 'instant' chama onSearchChange a cada tecla; 'on-enter' chama apenas ao pressionar Enter (padrão) */
|
|
1470
|
+
searchMode?: 'instant' | 'on-enter';
|
|
1471
|
+
/**
|
|
1472
|
+
* Valor controlado do campo de busca.
|
|
1473
|
+
* Permite que o pai redefina o texto exibido no campo (ex: ao limpar filtros).
|
|
1474
|
+
*/
|
|
1475
|
+
searchValue?: string;
|
|
1476
|
+
/**
|
|
1477
|
+
* Callback chamado quando o valor da busca é confirmado.
|
|
1478
|
+
* A presença deste callback é o que exibe o campo de busca —
|
|
1479
|
+
* quando não fornecido, o campo de busca não é renderizado.
|
|
1480
|
+
* A paginação é automaticamente resetada para a página 1 ao buscar.
|
|
1481
|
+
*/
|
|
1482
|
+
onSearchChange?: (value: string) => void;
|
|
1296
1483
|
}
|
|
1297
1484
|
/**
|
|
1298
1485
|
* Props do rodapé do TableV2, com controles de paginação.
|
|
@@ -1308,6 +1495,14 @@ interface TableV2FooterProps {
|
|
|
1308
1495
|
onPageChange?: (page: number) => void;
|
|
1309
1496
|
/** Callback chamado quando o tamanho da página muda */
|
|
1310
1497
|
onPageSizeChange?: (pageSize: number) => void;
|
|
1498
|
+
/**
|
|
1499
|
+
* Página atual (1-based) para controle externo da paginação.
|
|
1500
|
+
* Quando fornecido, sincroniza o estado interno com este valor,
|
|
1501
|
+
* permitindo que o pai redefina a página — por exemplo, ao aplicar
|
|
1502
|
+
* um filtro externo que deva redefinir para a página 1.
|
|
1503
|
+
* Funciona tanto no modo client-side quanto no modo `manualPagination`.
|
|
1504
|
+
*/
|
|
1505
|
+
currentPage?: number;
|
|
1311
1506
|
}
|
|
1312
1507
|
/**
|
|
1313
1508
|
* Props para personalização do estado vazio da tabela.
|
|
@@ -1320,6 +1515,27 @@ interface EmptyStateProps {
|
|
|
1320
1515
|
/** Texto descritivo exibido no estado vazio */
|
|
1321
1516
|
emptyText?: ReactNode;
|
|
1322
1517
|
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Props de configuração de seleção de linhas do TableV2.
|
|
1520
|
+
*/
|
|
1521
|
+
interface TableV2RowSelectionProps<T = Record<string, unknown>> {
|
|
1522
|
+
/**
|
|
1523
|
+
* Keys das linhas selecionadas (modo controlado).
|
|
1524
|
+
* Quando fornecido, o componente não gerencia o estado de seleção internamente —
|
|
1525
|
+
* o pai é responsável por atualizar este array via `onRowChange`.
|
|
1526
|
+
*/
|
|
1527
|
+
selectedRowKeys?: (string | number)[];
|
|
1528
|
+
/**
|
|
1529
|
+
* Desabilita a seleção de uma linha específica.
|
|
1530
|
+
* Pode ser um booleano global ou uma função chamada por linha.
|
|
1531
|
+
*/
|
|
1532
|
+
disabled?: boolean | ((row: T, index: number) => boolean);
|
|
1533
|
+
/** Callback chamado quando a seleção de linhas muda.
|
|
1534
|
+
* Recebe os dados das linhas selecionadas e suas keys (índices). */
|
|
1535
|
+
onRowChange?: (selectedRows: T[], selectedKeys: (string | number)[]) => void;
|
|
1536
|
+
/** Desabilita o checkbox "selecionar todos" */
|
|
1537
|
+
disableSelectAll?: boolean;
|
|
1538
|
+
}
|
|
1323
1539
|
/**
|
|
1324
1540
|
* Definição de uma ação em massa disponível na barra de seleção.
|
|
1325
1541
|
*/
|
|
@@ -1355,7 +1571,7 @@ interface TableV2BulkActionsProps<T = Record<string, unknown>> {
|
|
|
1355
1571
|
* columns={columns}
|
|
1356
1572
|
* data={data}
|
|
1357
1573
|
* enableSorting
|
|
1358
|
-
*
|
|
1574
|
+
* rowSelection={{ onRowChange: (rows, keys) => console.log(rows, keys) }}
|
|
1359
1575
|
* loading={isLoading}
|
|
1360
1576
|
* />
|
|
1361
1577
|
* ```
|
|
@@ -1365,14 +1581,21 @@ interface TableV2Props<T = Record<string, unknown>> extends EmptyStateProps {
|
|
|
1365
1581
|
columns: ColumnDef<T, any>[];
|
|
1366
1582
|
/** Dados exibidos na tabela */
|
|
1367
1583
|
data: T[];
|
|
1368
|
-
/**
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1584
|
+
/**
|
|
1585
|
+
* Configuração de seleção de linhas via checkbox.
|
|
1586
|
+
* A presença deste objeto habilita a seleção. Use `disabled` para controlar
|
|
1587
|
+
* linhas específicas e `onRowChange` para reagir às mudanças.
|
|
1588
|
+
* @example
|
|
1589
|
+
* ```tsx
|
|
1590
|
+
* rowSelection={{
|
|
1591
|
+
* disabled: (row) => row.status !== 'pronto_para_fechar',
|
|
1592
|
+
* onRowChange: (rows, keys) => handleRowChange(rows, keys),
|
|
1593
|
+
* }}
|
|
1594
|
+
* ```
|
|
1595
|
+
*/
|
|
1596
|
+
rowSelection?: TableV2RowSelectionProps<T>;
|
|
1372
1597
|
/** Habilita ordenação de colunas ao clicar no cabeçalho */
|
|
1373
1598
|
enableSorting?: boolean;
|
|
1374
|
-
/** Callback chamado quando a seleção de linhas muda */
|
|
1375
|
-
onRowSelectionChange?: (selectedRows: T[]) => void;
|
|
1376
1599
|
/** Configuração das ações em massa exibidas quando há linhas selecionadas */
|
|
1377
1600
|
bulkActions?: TableV2BulkActionsProps<T>;
|
|
1378
1601
|
/** Header acima da tabela com busca + filtros */
|
|
@@ -1391,7 +1614,7 @@ interface TableV2Props<T = Record<string, unknown>> extends EmptyStateProps {
|
|
|
1391
1614
|
};
|
|
1392
1615
|
}
|
|
1393
1616
|
|
|
1394
|
-
declare const TableV2: <T>({ columns, data,
|
|
1617
|
+
declare const TableV2: <T>({ columns, data, rowSelection: rowSelectionConfig, enableSorting, bulkActions, header, footer, loading, emptyIcon, emptyTitle, emptyText, onRow, className, }: TableV2Props<T>) => react_jsx_runtime.JSX.Element;
|
|
1395
1618
|
|
|
1396
1619
|
/**
|
|
1397
1620
|
* Props do componente TextArea
|
|
@@ -1449,6 +1672,12 @@ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLT
|
|
|
1449
1672
|
height?: number;
|
|
1450
1673
|
/** Classe CSS opcional */
|
|
1451
1674
|
className?: string;
|
|
1675
|
+
/** Habilita o teclado virtual */
|
|
1676
|
+
virtualKeyboard?: boolean;
|
|
1677
|
+
/** Tipo do teclado virtual (padrão: 'default') */
|
|
1678
|
+
virtualKeyboardType?: VirtualKeyboardType;
|
|
1679
|
+
/** Comprimento máximo permitido pelo teclado virtual */
|
|
1680
|
+
virtualKeyboardMaxLength?: number;
|
|
1452
1681
|
}
|
|
1453
1682
|
|
|
1454
1683
|
declare const _default$1: React__default.NamedExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1514,6 +1743,16 @@ interface TextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
|
|
|
1514
1743
|
persistIcon?: boolean;
|
|
1515
1744
|
/** Classe CSS opcional */
|
|
1516
1745
|
className?: string;
|
|
1746
|
+
/** Habilita o teclado virtual */
|
|
1747
|
+
virtualKeyboard?: boolean;
|
|
1748
|
+
/** Tipo do teclado virtual (padrão: 'default') */
|
|
1749
|
+
virtualKeyboardType?: VirtualKeyboardType;
|
|
1750
|
+
/** Comprimento máximo permitido pelo teclado virtual */
|
|
1751
|
+
virtualKeyboardMaxLength?: number;
|
|
1752
|
+
/** Aplica variação visual para uso acoplado ao VirtualKeyboard no modo fixed */
|
|
1753
|
+
attachedToVirtualKeyboard?: boolean;
|
|
1754
|
+
/** Escala visual aplicada ao componente */
|
|
1755
|
+
scale?: Scale;
|
|
1517
1756
|
}
|
|
1518
1757
|
|
|
1519
1758
|
declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
@@ -1744,14 +1983,16 @@ interface SwitchProps extends BaseProps {
|
|
|
1744
1983
|
defaultChecked?: boolean;
|
|
1745
1984
|
/** Callback executado quando o estado muda: (checked) => void */
|
|
1746
1985
|
onCheckedChange?: (checked: boolean) => void;
|
|
1747
|
-
/** Nome do input */
|
|
1986
|
+
/** Nome do input — associa o switch a um campo de formulário (HTML `name`) */
|
|
1748
1987
|
name?: string;
|
|
1749
|
-
/** Valor do input */
|
|
1988
|
+
/** Valor enviado no formulário quando o switch está ativo (análogo ao `value` do `<input type="checkbox">`) */
|
|
1750
1989
|
value?: string;
|
|
1751
1990
|
/** Estado atual (modo controlado) */
|
|
1752
1991
|
checked?: boolean;
|
|
1753
1992
|
/** Classe CSS opcional */
|
|
1754
1993
|
className?: string;
|
|
1994
|
+
/** Escala visual aplicada ao componente */
|
|
1995
|
+
scale?: Scale;
|
|
1755
1996
|
}
|
|
1756
1997
|
|
|
1757
1998
|
declare const Switch: React$1.FC<SwitchProps>;
|
|
@@ -1813,6 +2054,33 @@ interface VerificationCodeProps extends BaseProps {
|
|
|
1813
2054
|
*/
|
|
1814
2055
|
declare const VerificationCode: React__default.FC<VerificationCodeProps>;
|
|
1815
2056
|
|
|
2057
|
+
/**
|
|
2058
|
+
* Componente VirtualKeyboard — teclado virtual on-screen para entradas controladas.
|
|
2059
|
+
*
|
|
2060
|
+
* @description Baseado em `react-simple-keyboard`, oferece apenas layouts nativos (QWERTY e numérico)
|
|
2061
|
+
* seguindo o visual padrão da biblioteca.
|
|
2062
|
+
*
|
|
2063
|
+
* Possui dois modos:
|
|
2064
|
+
* - **`native`** (padrão): age como teclado nativo — aparece ao focar no campo referenciado por `targetRef` e some ao perder o foco.
|
|
2065
|
+
* - **`fixed`**: teclado sempre visível com um TextField próprio acima.
|
|
2066
|
+
*
|
|
2067
|
+
* @example
|
|
2068
|
+
* ```tsx
|
|
2069
|
+
* // Modo fixed
|
|
2070
|
+
* <VirtualKeyboard variant="fixed" type="default" onChange={setValue} />
|
|
2071
|
+
* ```
|
|
2072
|
+
*
|
|
2073
|
+
* @example
|
|
2074
|
+
* ```tsx
|
|
2075
|
+
* // Modo native — aparece ao focar no input
|
|
2076
|
+
* const inputRef = useRef<HTMLInputElement>(null);
|
|
2077
|
+
* const [value, setValue] = useState('');
|
|
2078
|
+
* <input ref={inputRef} value={value} readOnly />
|
|
2079
|
+
* <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
|
|
2080
|
+
* ```
|
|
2081
|
+
*/
|
|
2082
|
+
declare const VirtualKeyboard: React__default.FC<VirtualKeyboardProps>;
|
|
2083
|
+
|
|
1816
2084
|
/**
|
|
1817
2085
|
* Configurações para simulação de API
|
|
1818
2086
|
*/
|
|
@@ -1909,5 +2177,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
|
|
|
1909
2177
|
|
|
1910
2178
|
declare const normalizeText: (text: React.ReactNode) => string;
|
|
1911
2179
|
|
|
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 };
|
|
2180
|
+
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, VirtualKeyboard, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
|
|
2181
|
+
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, VirtualKeyboardProps, VirtualKeyboardVariant };
|