@giro-ds/react 11.0.0 → 11.2.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
@@ -550,6 +550,41 @@ interface DrawerProps extends BaseProps {
550
550
 
551
551
  declare const Drawer: React__default.FC<DrawerProps>;
552
552
 
553
+ interface FileUploadProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'accept' | 'multiple'> {
554
+ /** Tipos de arquivo aceitos pelo seletor nativo (ex: "image/*", ".pdf,.docx") */
555
+ accept?: string;
556
+ /** Permite selecionar múltiplos arquivos */
557
+ multiple?: boolean;
558
+ /** Lista controlada de arquivos */
559
+ value?: File[];
560
+ /** Callback disparado quando a lista de arquivos muda */
561
+ onChange?: (files: File[]) => void;
562
+ /** Texto auxiliar exibido abaixo da zona de drop */
563
+ helperText?: string;
564
+ /** Sinaliza estado de erro */
565
+ error?: boolean;
566
+ /** Mensagem de erro exibida no helperText quando em estado de erro.
567
+ * Erros internos de tipo (accept), tamanho (maxFileSize) e quantidade (maxFilesQuantity)
568
+ * também preenchem o helperText com mensagens padrão. */
569
+ errorMessage?: string;
570
+ /** Mensagem de erro exibida abaixo do icone de erro, caso não tenha a mensagem não ira aparecer nada */
571
+ descriptionErrorMessage?: string;
572
+ /** Tamanho máximo em bytes por arquivo */
573
+ maxFileSize?: number;
574
+ /** Número máximo de arquivos permitidos (exige multiple=true para mais de 1) */
575
+ maxFilesQuantity?: number;
576
+ /** Quando true, o componente está desabilitado */
577
+ disabled?: boolean;
578
+ /** Classes CSS adicionais */
579
+ className?: string;
580
+ /** Identificador único */
581
+ id?: string;
582
+ /** Texto de instrução exibido na zona vazia */
583
+ description?: string;
584
+ }
585
+
586
+ declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLInputElement>>;
587
+
553
588
  interface FilterItem$2 {
554
589
  /** Identificador único do item (usado em `selectedIds` e `onApplyFilter`) */
555
590
  id?: BaseProps['id'];
@@ -831,6 +866,8 @@ interface ModalProps extends BaseProps {
831
866
  footer?: ReactNode;
832
867
  /** Largura customizada do modal (ex: '500px', '80%') */
833
868
  customWidth?: string;
869
+ /** Altura customizada do modal (ex: '500px', '80%') */
870
+ customHeight?: string;
834
871
  /** Define se o modal ocupa toda a tela. Tem prioridade sobre customWidth */
835
872
  fullscreen?: boolean;
836
873
  /** Classe CSS opcional */
@@ -1032,12 +1069,34 @@ interface VirtualKeyboardProps extends Omit<BaseProps, 'disabled'> {
1032
1069
  onChange?: (value: string) => void;
1033
1070
  /** Callback executado quando uma tecla é pressionada: (key) => void */
1034
1071
  onKeyPress?: (key: string) => void;
1072
+ /**
1073
+ * Callback executado sempre que o `type` do teclado muda.
1074
+ * Útil para que o consumidor saiba o tipo atual e possa reagir à mudança
1075
+ * (ex.: buscar dados diferentes, ajustar layout, etc.).
1076
+ *
1077
+ * Sempre dispara na montagem inicial, servindo como fallback para consulta do tipo atual.
1078
+ */
1079
+ onTypeChange?: (type: VirtualKeyboardType) => void;
1035
1080
  /** Limite máximo de caracteres */
1036
1081
  maxLength?: number;
1037
1082
  /** Controla a exibição do botão {emoticon} nos layouts suportados */
1038
1083
  Emoji?: boolean;
1039
1084
  /** Placeholder do TextField exibido no modo `fixed` */
1040
1085
  textFieldPlaceholder?: string;
1086
+ /** Escala do TextField exibido no modo `fixed` */
1087
+ textFieldScale?: 1 | 1.5 | 2;
1088
+ /**
1089
+ * Controla a exibição da tecla Enter no teclado.
1090
+ * @default true
1091
+ */
1092
+ showEnterKey?: boolean;
1093
+ /**
1094
+ * Controla a exibição da tecla de alternância entre os layouts default ("123") e numeric ("ABC").
1095
+ * Quando `false`, a tecla "123" (no layout default) é removida — a tecla espaço cresce para ocupar o espaço —
1096
+ * e a tecla "ABC" (no layout numeric) é substituída por um espaço vazio.
1097
+ * @default true
1098
+ */
1099
+ showTypeSwitchKey?: boolean;
1041
1100
  /** Texto de ajuda do TextField exibido no modo `fixed` */
1042
1101
  helperText?: string;
1043
1102
  /** Sinaliza erro no TextField exibido no modo `fixed` */
@@ -1963,61 +2022,57 @@ interface SwitchProps extends ScalableProps {
1963
2022
 
1964
2023
  declare const Switch: React$1.FC<SwitchProps>;
1965
2024
 
1966
- /** Tipos de entrada suportados pelo VerificationCode */
1967
- type InputType = 'numeric' | 'alpha' | 'alphanumeric';
2025
+ /** Tipos de validação suportados pelo VerificationCode */
2026
+ type OTPValidationType = 'numeric' | 'alphanumeric' | 'alpha';
1968
2027
  /**
1969
2028
  * Props do componente VerificationCode
1970
2029
  * @example
1971
2030
  * ```tsx
1972
2031
  * <VerificationCode
1973
2032
  * length={6}
1974
- * inputType="numeric"
1975
- * onComplete={(code) => handleVerification(code)}
2033
+ * validationType="numeric"
2034
+ * onValueChange={(v) => console.log(v)}
1976
2035
  * />
1977
2036
  * ```
1978
2037
  * @example
1979
2038
  * ```tsx
1980
2039
  * <VerificationCode
1981
2040
  * length={4}
1982
- * inputType="alphanumeric"
1983
- * onComplete={handleCode}
2041
+ * name="otp"
2042
+ * autoSubmit
2043
+ * onAutoSubmit={(v) => handleVerify(v)}
1984
2044
  * hasError={!!error}
1985
2045
  * errorMessage="Código inválido"
1986
- * disabled={isVerifying}
1987
2046
  * />
1988
2047
  * ```
1989
2048
  */
1990
2049
  interface VerificationCodeProps extends BaseProps {
1991
- /** Número de dígitos do código (padrão: 6) */
2050
+ /** Número de campos/dígitos (padrão: 6) */
1992
2051
  length?: number;
1993
- /** Tipo de entrada permitida (padrão: "numeric") */
1994
- inputType?: InputType;
1995
- /** Callback executado quando todos os campos são preenchidos: (value) => void */
1996
- onComplete?: (value: string) => void;
2052
+ /** Tipo de validação aceita pelo campo (padrão: 'numeric') */
2053
+ validationType?: OTPValidationType;
2054
+ /** Valor controlado do campo */
2055
+ value?: string;
2056
+ /** Valor inicial não controlado */
2057
+ defaultValue?: string;
2058
+ /** Callback chamado quando o valor muda */
2059
+ onValueChange?: (value: string) => void;
2060
+ /** Submete o formulário associado automaticamente ao completar */
2061
+ autoSubmit?: boolean;
2062
+ /** Callback chamado ao completar (quando autoSubmit está ativo) */
2063
+ onAutoSubmit?: (value: string) => void;
2064
+ /** Nome do campo para envio em formulários */
2065
+ name?: string;
2066
+ /** ID do formulário associado */
2067
+ form?: string;
1997
2068
  /** Define se o campo está em estado de erro */
1998
2069
  hasError?: boolean;
1999
2070
  /** Mensagem de erro exibida abaixo do componente */
2000
2071
  errorMessage?: string;
2001
- /** Props adicionais passadas para os inputs */
2002
- [key: string]: any;
2072
+ /** Define o campo como somente leitura */
2073
+ readOnly?: boolean;
2003
2074
  }
2004
2075
 
2005
- /**
2006
- * Componente VerificationCode para entrada de códigos de verificação
2007
- *
2008
- * @description Permite entrada de códigos com múltiplos dígitos,
2009
- * suportando diferentes tipos de caracteres e navegação por teclado.
2010
- *
2011
- * @example
2012
- * ```tsx
2013
- * <VerificationCode
2014
- * length={6}
2015
- * inputType="numeric"
2016
- * onComplete={(code) => console.log('Código:', code)}
2017
- * hasError={false}
2018
- * />
2019
- * ```
2020
- */
2021
2076
  declare const VerificationCode: React__default.FC<VerificationCodeProps>;
2022
2077
 
2023
2078
  /**
@@ -2143,5 +2198,5 @@ declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, thresho
2143
2198
 
2144
2199
  declare const normalizeText: (text: React.ReactNode) => string;
2145
2200
 
2146
- 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 };
2147
- 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 };
2201
+ 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, Table, TableHeader, TablePagination, TableV2, _default$1 as TextArea, _default as TextField, Toast, ToastContainer, ToastProvider, Tooltip, VerificationCode, VirtualKeyboard, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
2202
+ export type { AvatarProps, BadgeProps, ButtonProps, CalendarProps, CalloutProps, CardProps, CheckboxProps, ChipsProps, ContainerProps, DatePickerProps, DialogProps, DrawerProps, FileUploadProps, 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 };