@giro-ds/react 9.0.0 → 10.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.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
- /** Prop que sinaliza se o Badge será usado no Filter ou não, pois no Filter ele tem uma cor diferente */
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
@@ -289,6 +294,27 @@ interface CalloutProps extends Omit<BaseProps, 'disabled'>, Omit<React$1.HTMLAtt
289
294
 
290
295
  declare const Callout: React__default.FC<CalloutProps>;
291
296
 
297
+ /**
298
+ * Props do componente Card
299
+ * @example
300
+ * ```tsx
301
+ * <Card>
302
+ * <h1>Conteúdo da página</h1>
303
+ * <p>Texto dentro do card</p>
304
+ * </Card>
305
+ * ```
306
+ */
307
+ interface CardProps {
308
+ /** Conteúdo a ser renderizado dentro do card */
309
+ children: React__default.ReactNode;
310
+ /** Classe CSS customizada aplicada ao elemento raiz do card */
311
+ className?: string;
312
+ /** Define se o card é interativo, aplicando estilos de hover e cursor pointer */
313
+ hoverable?: boolean;
314
+ }
315
+
316
+ declare function Card({ children, className, hoverable }: CardProps): react_jsx_runtime.JSX.Element;
317
+
292
318
  /**
293
319
  * Props do componente Checkbox
294
320
  * @example
@@ -322,6 +348,8 @@ interface CheckboxProps extends BaseProps {
322
348
  indeterminate?: boolean;
323
349
  /** Classe CSS opcional */
324
350
  className?: string;
351
+ /** Escala visual aplicada ao componente */
352
+ scale?: Scale;
325
353
  }
326
354
 
327
355
  declare const Checkbox: React$1.FC<CheckboxProps>;
@@ -361,6 +389,8 @@ interface ChipsProps extends BaseProps, Omit<React$1.HTMLAttributes<HTMLDivEleme
361
389
  style?: React$1.CSSProperties;
362
390
  /** Classe CSS opcional */
363
391
  className?: string;
392
+ /** Escala visual aplicada ao componente */
393
+ scale?: Scale;
364
394
  }
365
395
 
366
396
  declare const MemoizedChips: React__default.NamedExoticComponent<ChipsProps>;
@@ -436,6 +466,10 @@ interface DatePickerProps extends BaseProps {
436
466
  'data-testid'?: string;
437
467
  /** Classe CSS opcional */
438
468
  className?: string;
469
+ /** Escala visual aplicada ao componente */
470
+ datePickerScale?: Scale;
471
+ /** Escala visual aplicada ao calendário */
472
+ calendarScale?: Scale;
439
473
  }
440
474
 
441
475
  declare const _default$2: React__default.NamedExoticComponent<DatePickerProps>;
@@ -530,10 +564,15 @@ interface DrawerProps extends BaseProps {
530
564
  declare const Drawer: React__default.FC<DrawerProps>;
531
565
 
532
566
  interface FilterItem$2 {
567
+ /** Identificador único do item (usado em `selectedIds` e `onApplyFilter`) */
533
568
  id?: BaseProps['id'];
569
+ /** Texto principal exibido no item */
534
570
  text: string;
571
+ /** Texto secundário exibido abaixo do texto principal */
535
572
  subText?: string;
573
+ /** Ícone exibido à esquerda do texto */
536
574
  icon?: ReactNode;
575
+ /** Desabilita o item, impedindo sua seleção */
537
576
  disabled?: BaseProps['disabled'];
538
577
  }
539
578
  type FilterType = 'single' | 'multiple' | 'calendar';
@@ -671,9 +710,9 @@ interface ListItemProps extends BaseProps {
671
710
  icon?: React$1.ReactNode;
672
711
  /** Valor do input (para variantes checkbox/radio) */
673
712
  value?: string;
674
- /** Define se deve mostrar o subtexto */
713
+ /** Controla a visibilidade do subtexto explicitamente, independentemente de `subText` estar preenchido */
675
714
  showSubText?: boolean;
676
- /** Estado de hover */
715
+ /** Força o estado visual de hover no item (útil para controle externo de foco/seleção) */
677
716
  hovered?: boolean;
678
717
  /** Classe CSS opcional */
679
718
  className?: string;
@@ -732,7 +771,11 @@ interface MenuProps extends BaseProps {
732
771
  items: MenuItemProps[];
733
772
  /** Elemento trigger customizado para abrir o menu */
734
773
  children?: ReactElement;
735
- /** Tipo de visualização do menu */
774
+ /**
775
+ * Tipo de visualização dos itens do menu.
776
+ * - `'text'` (padrão): exibe texto e ícone lado a lado
777
+ * - `'icon'`: exibe apenas ícones, sem texto
778
+ */
736
779
  type?: 'text' | 'icon';
737
780
  /** Callback executado quando um item é selecionado: (item) => void */
738
781
  onItemSelect?: (items: MenuItemProps) => void;
@@ -758,6 +801,10 @@ interface MenuProps extends BaseProps {
758
801
  onOpenChange?: (open: boolean) => void;
759
802
  /** Classe CSS opcional */
760
803
  className?: string;
804
+ /** Escala visual aplicada ao conteúdo do menu */
805
+ dropdownScale?: Scale;
806
+ /** Escala visual aplicada ao botão/trigger quando ele aceitar a prop `scale` */
807
+ buttonScale?: Scale;
761
808
  }
762
809
 
763
810
  declare const Menu: React__default.FC<MenuProps>;
@@ -812,9 +859,13 @@ interface ModalProps extends BaseProps {
812
859
  declare const Modal: React$1.FC<ModalProps>;
813
860
 
814
861
  interface PopoverProps {
815
- trigger: React.ReactNode;
816
- content: React.ReactNode;
862
+ /** Elemento que aciona a abertura do popover (geralmente um botão ou ícone) */
863
+ trigger: React$1.ReactNode;
864
+ /** Conteúdo exibido dentro do popover ao abrir */
865
+ content: React$1.ReactNode;
866
+ /** Alinhamento do popover em relação ao trigger no eixo perpendicular ao `side`. @default 'center' */
817
867
  align?: Align;
868
+ /** Lado em que o popover aparece em relação ao trigger. @default 'bottom' */
818
869
  side?: Side;
819
870
  /** Distância em pixels entre o conteúdo e o trigger */
820
871
  sideOffset?: number;
@@ -823,12 +874,12 @@ interface PopoverProps {
823
874
  /** Callback chamado quando o estado de abertura muda */
824
875
  onOpenChange?: (open: boolean) => void;
825
876
  /**
826
- * Quando `true`, o trigger atua como âncora de posicionamento e o popover
827
- * é aberto/fechado exclusivamente via `open`/`onOpenChange` (modo DatePicker).
828
- * Quando `false` (padrão), o trigger continua abrindo/fechando o popover
829
- * normalmente, mas o estado pode ser sincronizado via `open`/`onOpenChange`
830
- * (modo Filter).
831
- */
877
+ * Quando `true`, o trigger atua como âncora de posicionamento e o popover
878
+ * é aberto/fechado exclusivamente via `open`/`onOpenChange` (modo DatePicker).
879
+ * Quando `false` (padrão), o trigger continua abrindo/fechando o popover
880
+ * normalmente, mas o estado pode ser sincronizado via `open`/`onOpenChange`
881
+ * (modo Filter).
882
+ */
832
883
  asAnchor?: boolean;
833
884
  /** Callback chamado quando o foco automático é ativado ao abrir o popover */
834
885
  onOpenAutoFocus?: (event: Event) => void;
@@ -858,7 +909,7 @@ declare const Popover: React$1.FC<PopoverProps>;
858
909
  * value={1}
859
910
  * decimal={true}
860
911
  * decimalPlaces={2}
861
- * step={0.5}
912
+ * valueIncrement={0.5}
862
913
  * disabled={false}
863
914
  * />
864
915
  * ```
@@ -895,6 +946,8 @@ interface QuantityProps extends BaseProps {
895
946
  inputAriaLabel?: string;
896
947
  /** Classe CSS opcional */
897
948
  className?: string;
949
+ /** Escala visual aplicada ao componente */
950
+ scale?: Scale;
898
951
  }
899
952
 
900
953
  declare const memorizedQuantity: React__default.NamedExoticComponent<QuantityProps>;
@@ -951,10 +1004,79 @@ interface RadioGroupProps extends BaseProps {
951
1004
  ariaLabel?: string;
952
1005
  /** Orientação do layout dos radio buttons */
953
1006
  orientation?: "horizontal" | "vertical";
1007
+ /** Escala visual aplicada ao grupo */
1008
+ scale?: Scale;
954
1009
  }
955
1010
 
956
1011
  declare const Radio: React__default.FC<RadioGroupProps>;
957
1012
 
1013
+ /**
1014
+ * Modo de exibição do VirtualKeyboard.
1015
+ * - `native`: age como teclado nativo — aparecerá ao focar em um campo (implementação futura).
1016
+ * - `fixed`: teclado sempre visível na tela com um TextField próprio acima dele.
1017
+ */
1018
+ type VirtualKeyboardVariant = 'native' | 'fixed';
1019
+ /** Layouts disponíveis para o VirtualKeyboard */
1020
+ type VirtualKeyboardType = 'default' | 'numeric';
1021
+ /**
1022
+ * Props do componente VirtualKeyboard
1023
+ * @example
1024
+ * ```tsx
1025
+ * // Modo fixed: teclado sempre visível com TextField próprio
1026
+ * <VirtualKeyboard
1027
+ * variant="fixed"
1028
+ * type="default"
1029
+ * onChange={(value) => setValue(value)}
1030
+ * />
1031
+ * ```
1032
+ * @example
1033
+ * ```tsx
1034
+ * // Modo native: teclado gerenciado externamente (futuramente acionado por foco)
1035
+ * <VirtualKeyboard
1036
+ * variant="native"
1037
+ * type="numeric"
1038
+ * value={pin}
1039
+ * onChange={setPin}
1040
+ * maxLength={4}
1041
+ * />
1042
+ * ```
1043
+ */
1044
+ interface VirtualKeyboardProps extends Omit<BaseProps, 'disabled'> {
1045
+ /**
1046
+ * Modo de exibição do teclado.
1047
+ * - `native`: comporta-se como teclado nativo (acionamento por foco — futuramente implementado).
1048
+ * - `fixed`: teclado fixo na tela com um TextField próprio acima.
1049
+ * @default 'native'
1050
+ */
1051
+ variant?: VirtualKeyboardVariant;
1052
+ /** Valor controlado do input vinculado ao teclado */
1053
+ value?: string;
1054
+ /** Tipo do teclado (padrão: "default") */
1055
+ type?: VirtualKeyboardType;
1056
+ /** Callback executado quando o valor do input muda: (value) => void */
1057
+ onChange?: (value: string) => void;
1058
+ /** Callback executado quando uma tecla é pressionada: (key) => void */
1059
+ onKeyPress?: (key: string) => void;
1060
+ /** Limite máximo de caracteres */
1061
+ maxLength?: number;
1062
+ /** Controla a exibição do botão {emoticon} nos layouts suportados */
1063
+ Emoji?: boolean;
1064
+ /** Placeholder do TextField exibido no modo `fixed` */
1065
+ textFieldPlaceholder?: string;
1066
+ /** Texto de ajuda do TextField exibido no modo `fixed` */
1067
+ helperText?: string;
1068
+ /** Sinaliza erro no TextField exibido no modo `fixed` */
1069
+ error?: boolean;
1070
+ /** Mensagem de erro do TextField exibido no modo `fixed` */
1071
+ errorMessage?: string;
1072
+ /**
1073
+ * Ref para o campo de input que aciona o teclado no modo `native`.
1074
+ * O teclado aparece ao focar no elemento referenciado e some ao perder o foco.
1075
+ * Se omitido no modo `native`, o teclado permanece sempre visível.
1076
+ */
1077
+ targetRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
1078
+ }
1079
+
958
1080
  /**
959
1081
  * Props do componente Search
960
1082
  * @example
@@ -1012,6 +1134,10 @@ interface SearchProps extends BaseProps, NativeInputProps {
1012
1134
  'data-testid'?: string;
1013
1135
  /** Classe CSS opcional */
1014
1136
  className?: string;
1137
+ /** Tipo do teclado virtual (padrão: undefined = desabilitado) */
1138
+ virtualKeyboard?: VirtualKeyboardType;
1139
+ /** Escala visual aplicada ao componente */
1140
+ scale?: Scale;
1015
1141
  }
1016
1142
 
1017
1143
  declare const Search: React__default.ForwardRefExoticComponent<SearchProps & React__default.RefAttributes<HTMLInputElement>>;
@@ -1115,6 +1241,8 @@ interface SelectProps extends BaseProps {
1115
1241
  isSearching?: boolean;
1116
1242
  /** Classe CSS opcional */
1117
1243
  className?: string;
1244
+ /** Escala visual aplicada ao componente */
1245
+ scale?: Scale;
1118
1246
  }
1119
1247
 
1120
1248
  declare const Select: React__default.FC<SelectProps>;
@@ -1349,6 +1477,8 @@ interface TableV2HeaderProps {
1349
1477
  searchPlaceholder?: string;
1350
1478
  /** Items de filtro (Status, Data de início, etc.) */
1351
1479
  filterItems?: FilterItem[];
1480
+ /** Habilita o teclado virtual */
1481
+ virtualKeyboard?: VirtualKeyboardType;
1352
1482
  /** Modo de busca: 'instant' chama onSearchChange a cada tecla; 'on-enter' chama apenas ao pressionar Enter (padrão) */
1353
1483
  searchMode?: 'instant' | 'on-enter';
1354
1484
  /**
@@ -1555,6 +1685,8 @@ interface TextAreaProps extends Omit<React__default.TextareaHTMLAttributes<HTMLT
1555
1685
  height?: number;
1556
1686
  /** Classe CSS opcional */
1557
1687
  className?: string;
1688
+ /** Tipo do teclado virtual (padrão: undefined = desabilitado) */
1689
+ virtualKeyboard?: VirtualKeyboardType;
1558
1690
  }
1559
1691
 
1560
1692
  declare const _default$1: React__default.NamedExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
@@ -1603,9 +1735,9 @@ interface TextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
1603
1735
  /** Texto do tooltip */
1604
1736
  tooltipText?: string;
1605
1737
  /** Lado onde o tooltip aparece */
1606
- side?: Side;
1738
+ tooltipSide?: Side;
1607
1739
  /** Alinhamento do tooltip */
1608
- align?: Align;
1740
+ tooltipAlign?: Align;
1609
1741
  /**
1610
1742
  * Mensagem de erro exibida no campo.
1611
1743
  * Usada tanto pela validação interna (required, formato, etc.)
@@ -1620,6 +1752,14 @@ interface TextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
1620
1752
  persistIcon?: boolean;
1621
1753
  /** Classe CSS opcional */
1622
1754
  className?: string;
1755
+ /** Tipo do teclado virtual (padrão: undefined = desabilitado) */
1756
+ virtualKeyboard?: VirtualKeyboardType;
1757
+ /** Aplica variação visual para uso acoplado ao VirtualKeyboard no modo fixed, essa prop é de uso exclusivo do VirtualKeyboard no modo fixed */
1758
+ attachedToVirtualKeyboard?: boolean;
1759
+ /** Escala visual aplicada ao componente */
1760
+ scale?: Scale;
1761
+ /** Desabilita o autocomplete nativo do browser (padrão: false) */
1762
+ disableAutoComplete?: boolean;
1623
1763
  }
1624
1764
 
1625
1765
  declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
@@ -1850,14 +1990,16 @@ interface SwitchProps extends BaseProps {
1850
1990
  defaultChecked?: boolean;
1851
1991
  /** Callback executado quando o estado muda: (checked) => void */
1852
1992
  onCheckedChange?: (checked: boolean) => void;
1853
- /** Nome do input */
1993
+ /** Nome do input — associa o switch a um campo de formulário (HTML `name`) */
1854
1994
  name?: string;
1855
- /** Valor do input */
1995
+ /** Valor enviado no formulário quando o switch está ativo (análogo ao `value` do `<input type="checkbox">`) */
1856
1996
  value?: string;
1857
1997
  /** Estado atual (modo controlado) */
1858
1998
  checked?: boolean;
1859
1999
  /** Classe CSS opcional */
1860
2000
  className?: string;
2001
+ /** Escala visual aplicada ao componente */
2002
+ scale?: Scale;
1861
2003
  }
1862
2004
 
1863
2005
  declare const Switch: React$1.FC<SwitchProps>;
@@ -1919,6 +2061,33 @@ interface VerificationCodeProps extends BaseProps {
1919
2061
  */
1920
2062
  declare const VerificationCode: React__default.FC<VerificationCodeProps>;
1921
2063
 
2064
+ /**
2065
+ * Componente VirtualKeyboard — teclado virtual on-screen para entradas controladas.
2066
+ *
2067
+ * @description Baseado em `react-simple-keyboard`, oferece apenas layouts nativos (QWERTY e numérico)
2068
+ * seguindo o visual padrão da biblioteca.
2069
+ *
2070
+ * Possui dois modos:
2071
+ * - **`native`** (padrão): age como teclado nativo — aparece ao focar no campo referenciado por `targetRef` e some ao perder o foco.
2072
+ * - **`fixed`**: teclado sempre visível com um TextField próprio acima.
2073
+ *
2074
+ * @example
2075
+ * ```tsx
2076
+ * // Modo fixed
2077
+ * <VirtualKeyboard variant="fixed" type="default" onChange={setValue} />
2078
+ * ```
2079
+ *
2080
+ * @example
2081
+ * ```tsx
2082
+ * // Modo native — aparece ao focar no input
2083
+ * const inputRef = useRef<HTMLInputElement>(null);
2084
+ * const [value, setValue] = useState('');
2085
+ * <input ref={inputRef} value={value} readOnly />
2086
+ * <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
2087
+ * ```
2088
+ */
2089
+ declare const VirtualKeyboard: React__default.FC<VirtualKeyboardProps>;
2090
+
1922
2091
  /**
1923
2092
  * Configurações para simulação de API
1924
2093
  */
@@ -2015,5 +2184,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
2015
2184
 
2016
2185
  declare const normalizeText: (text: React.ReactNode) => string;
2017
2186
 
2018
- 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 };
2019
- 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 };
2187
+ export { Avatar, Badge, Button, Calendar, Callout, Card, 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 };
2188
+ export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CardProps, 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 };