@giro-ds/react 3.0.4 → 3.0.6

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.
Files changed (44) hide show
  1. package/dist/components/Avatar/Avatar.d.ts +1 -1
  2. package/dist/components/Avatar/Avatar.types.d.ts +21 -5
  3. package/dist/components/Badge/Badge.types.d.ts +25 -7
  4. package/dist/components/Button/Button.types.d.ts +41 -8
  5. package/dist/components/Calendar/Calendar.d.ts +2 -1
  6. package/dist/components/Calendar/Calendar.types.d.ts +56 -12
  7. package/dist/components/Callout/Callout.types.d.ts +28 -11
  8. package/dist/components/Checkbox/Checkbox.types.d.ts +28 -4
  9. package/dist/components/Chips/Chips.types.d.ts +28 -11
  10. package/dist/components/Container/Container.types.d.ts +11 -0
  11. package/dist/components/DatePicker/DatePicker.types.d.ts +36 -18
  12. package/dist/components/DatePicker/DateUtils.d.ts +1 -1
  13. package/dist/components/DatePicker/index.d.ts +1 -1
  14. package/dist/components/Dialog/Dialog.types.d.ts +35 -11
  15. package/dist/components/Drawer/Drawer.types.d.ts +58 -27
  16. package/dist/components/Dropdown/Dropdown.types.d.ts +47 -20
  17. package/dist/components/Filter/Filter.types.d.ts +47 -28
  18. package/dist/components/ListItem/ListItem.d.ts +0 -5
  19. package/dist/components/ListItem/ListItem.types.d.ts +35 -17
  20. package/dist/components/Menu/Menu.d.ts +1 -1
  21. package/dist/components/Menu/Menu.types.d.ts +60 -2
  22. package/dist/components/Quantity/Quantity.types.d.ts +31 -13
  23. package/dist/components/Radio/Radio.types.d.ts +39 -2
  24. package/dist/components/Search/Search.types.d.ts +34 -5
  25. package/dist/components/Select/Select.types.d.ts +117 -8
  26. package/dist/components/Switch/Switch.types.d.ts +26 -2
  27. package/dist/components/Table/Table.d.ts +1 -1
  28. package/dist/components/Table/Table.types.d.ts +2 -3
  29. package/dist/components/Table/TableHeader.d.ts +1 -1
  30. package/dist/components/Table/TablePagination.d.ts +1 -9
  31. package/dist/components/TextField/TextField.types.d.ts +49 -11
  32. package/dist/components/Toast/Toast.types.d.ts +37 -0
  33. package/dist/components/Tooltip/Tooltip.types.d.ts +32 -4
  34. package/dist/components/VerificationCode/VerificationCode.types.d.ts +29 -9
  35. package/dist/components/index.d.ts +1 -1
  36. package/dist/index.cjs +142 -170
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.ts +860 -250
  39. package/dist/index.esm.js +135 -181
  40. package/dist/index.esm.js.map +1 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/types/common.types.d.ts +12 -0
  43. package/dist/types/index.d.ts +1 -0
  44. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  import type { AvatarProps } from './Avatar.types';
2
- declare let Avatar: ({ id, icon, size, className }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare let Avatar: ({ id, icon, size, className, ...rest }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Avatar;
@@ -1,7 +1,23 @@
1
- import React from 'react';
2
- export interface AvatarProps {
3
- id?: string;
1
+ import * as React from 'react';
2
+ import { Size, BaseProps } from '../../types';
3
+ /**
4
+ * Props do componente Avatar
5
+ * @example
6
+ * ```tsx
7
+ * <Avatar icon={<UserIcon />} size="lg" />
8
+ * ```
9
+ * @example
10
+ * ```tsx
11
+ * <Avatar
12
+ * icon={<ProfileIcon />}
13
+ * size="sm"
14
+ * className="custom-avatar"
15
+ * />
16
+ * ```
17
+ */
18
+ export interface AvatarProps extends BaseProps {
19
+ /** Ícone ou conteúdo a ser exibido no avatar */
4
20
  icon: React.ReactNode;
5
- size?: 'small' | 'large';
6
- className?: string;
21
+ /** Tamanho do avatar */
22
+ size?: Size;
7
23
  }
@@ -1,19 +1,37 @@
1
1
  import { ReactNode } from 'react';
2
+ import { BaseProps } from '../../types';
3
+ /** Tipos de badge suportados */
2
4
  export type BadgeType = 'notification' | 'status';
5
+ /** Valores possíveis para exibição no badge */
3
6
  export type BadgeValue = number | string | null;
4
- export interface BadgeProps {
7
+ /**
8
+ * Props do componente Badge
9
+ * @example
10
+ * ```tsx
11
+ * <Badge type="notification" badgeValue={5}>
12
+ * <IconButton icon={<BellIcon />} />
13
+ * </Badge>
14
+ * ```
15
+ * @example
16
+ * ```tsx
17
+ * <Badge
18
+ * type="status"
19
+ * badgeValue="novo"
20
+ * aria-label="Novo item disponível"
21
+ * >
22
+ * <Avatar icon={<UserIcon />} />
23
+ * </Badge>
24
+ * ```
25
+ */
26
+ export interface BadgeProps extends BaseProps {
5
27
  /** Tipo de badge (notificação ou status) */
6
28
  type: BadgeType;
7
29
  /** Conteúdo a ser envolvido pelo badge */
8
30
  children?: ReactNode;
9
31
  /** Valor a ser exibido no badge (número, texto ou null) */
10
32
  badgeValue?: BadgeValue;
11
- /** Classes CSS adicionais */
12
- className?: string;
13
- /** ID único do componente */
14
- id?: string;
15
- /** Se o badge está desabilitado */
33
+ /** Valor máximo a ser exibido (ex: 99+ quando badgeValue > maxValue) */
16
34
  maxValue?: number;
17
- /** Props de acessibilidade customizadas */
35
+ /** Label acessível para leitores de tela */
18
36
  'aria-label'?: string;
19
37
  }
@@ -1,23 +1,56 @@
1
1
  import React from 'react';
2
- export interface ButtonProps extends React.HTMLAttributes<HTMLElement> {
2
+ import { Size, BaseProps, Variant, Position } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Button
5
+ * @example
6
+ * ```tsx
7
+ * <Button variant="filled" size="lg" onClick={handleClick}>
8
+ * Clique aqui
9
+ * </Button>
10
+ * ```
11
+ * @example
12
+ * ```tsx
13
+ * <Button
14
+ * variant="outlined"
15
+ * icon={<Icon />}
16
+ * iconPosition="left"
17
+ * loading={isLoading}
18
+ * >
19
+ * Salvar
20
+ * </Button>
21
+ * ```
22
+ */
23
+ export interface ButtonProps extends BaseProps, React.HTMLAttributes<HTMLElement> {
24
+ /** Elemento customizado a ser renderizado (ex: 'a', Link do React Router) */
3
25
  as?: React.ElementType;
26
+ /** Conteúdo do botão */
4
27
  children?: React.ReactNode;
5
- variant?: 'filled' | 'outlined' | 'text';
28
+ /** Variante visual do botão */
29
+ variant?: Variant;
30
+ /** Define se o botão exibe apenas ícone (sem texto) */
6
31
  iconOnly?: boolean;
7
- iconPosition?: 'left' | 'right' | 'both';
32
+ /** Posição do ícone em relação ao texto */
33
+ iconPosition?: Position;
34
+ /** URL de destino quando usado como link (renderiza <a>) */
8
35
  href?: string;
36
+ /** Rota de destino para roteadores (ex: React Router) */
9
37
  to?: string;
38
+ /** Define se o link abre em nova aba */
10
39
  external?: boolean;
40
+ /** Atributo target do HTML para links */
11
41
  target?: string;
42
+ /** Atributo rel do HTML para links */
12
43
  rel?: string;
44
+ /** Tipo HTML do botão */
13
45
  type?: 'button' | 'submit' | 'reset';
14
- disabled?: boolean;
15
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
16
- size?: 'lg' | 'sm';
17
- className?: string;
18
- id?: string;
46
+ /** Tamanho do botão */
47
+ size?: Size;
48
+ /** Ícone a ser exibido no botão */
19
49
  icon?: React.ReactNode;
50
+ /** Define se o botão ocupa 100% da largura do container */
20
51
  fullWidth?: boolean;
52
+ /** Label acessível para leitores de tela */
21
53
  ariaLabel?: string;
54
+ /** Estado de carregamento (exibe spinner) */
22
55
  loading?: boolean;
23
56
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import './i18n';
3
- import type { Locale, DateFormat, CalendarProps } from './Calendar.types';
3
+ import type { DateFormat, CalendarProps } from './Calendar.types';
4
+ import { Locale } from '../../types/common.types';
4
5
  declare const MemoizedCalendar: React.NamedExoticComponent<CalendarProps>;
5
6
  export default MemoizedCalendar;
6
7
  export type { CalendarProps, Locale, DateFormat };
@@ -1,42 +1,86 @@
1
- export type Locale = 'pt-br' | 'en-us';
1
+ import { Locale, BaseProps } from '../../types/common.types';
2
+ /** Formatos de exibição de data disponíveis */
2
3
  export type DateFormat = 'dd/mm/yyyy' | 'mm/dd/yyyy';
4
+ /**
5
+ * Representa um dia no calendário
6
+ */
3
7
  export interface DayItem {
8
+ /** Tipo do item (sempre 'day') */
4
9
  type: 'day';
10
+ /** Chave única para renderização */
5
11
  key: number;
12
+ /** Número do dia */
6
13
  day: number;
14
+ /** Objeto Date completo */
7
15
  date: Date;
16
+ /** Indica se é o dia atual */
8
17
  isToday: boolean;
18
+ /** Indica se o dia está selecionado */
9
19
  isSelected: boolean;
20
+ /** Label acessível do dia */
10
21
  label: string;
11
22
  }
23
+ /**
24
+ * Representa um espaço vazio no grid do calendário
25
+ */
12
26
  export interface EmptyItem {
27
+ /** Tipo do item (sempre 'empty') */
13
28
  type: 'empty';
29
+ /** Chave única para renderização */
14
30
  key: string;
15
31
  }
32
+ /** Item do calendário (pode ser um dia ou espaço vazio) */
16
33
  export type CalendarItem = DayItem | EmptyItem;
34
+ /**
35
+ * Representa um ano na visualização de seleção de ano
36
+ */
17
37
  export interface YearItem {
38
+ /** Número do ano */
18
39
  year: number;
40
+ /** Indica se é o ano atual */
19
41
  isCurrent: boolean;
42
+ /** Chave única para renderização */
20
43
  key: number;
21
44
  }
22
- export interface CalendarProps {
23
- /** Data do dia Atual */
45
+ /**
46
+ * Props do componente Calendar
47
+ * @example
48
+ * ```tsx
49
+ * <Calendar
50
+ * currentDate={new Date()}
51
+ * onDateChange={(date) => console.log(date)}
52
+ * locale="pt-br"
53
+ * />
54
+ * ```
55
+ * @example
56
+ * ```tsx
57
+ * <Calendar
58
+ * currentDate={new Date()}
59
+ * selectedDate={selectedDate}
60
+ * onDaySelect={handleDaySelect}
61
+ * minDate={new Date('2024-01-01')}
62
+ * maxDate={new Date('2024-12-31')}
63
+ * format="dd/mm/yyyy"
64
+ * />
65
+ * ```
66
+ */
67
+ export interface CalendarProps extends BaseProps {
68
+ /** Data do dia atual */
24
69
  currentDate: Date | null;
25
- /** Classe CSS adicional */
26
- className?: string;
27
- /** Dia Selecionado pelo usuário */
70
+ /** Dia selecionado pelo usuário */
28
71
  selectedDate?: Date | null;
29
- /** Função que é executada quando a data escolhida é alterada */
72
+ /** Callback executado quando a data escolhida é alterada: (date) => void */
30
73
  onDateChange?: (date: Date) => void;
31
- /** Função que é executada quando um dia é selecionado */
74
+ /** Callback executado quando um dia é selecionado: (date) => void */
32
75
  onDaySelect?: (date: Date) => void;
76
+ /** Callback executado ao limpar a seleção: () => void */
33
77
  onClear?: () => void;
78
+ /** Data mínima selecionável */
34
79
  minDate?: Date;
80
+ /** Data máxima selecionável */
35
81
  maxDate?: Date;
36
- /** Locale do calendário ('pt-br' ou 'en-us') */
82
+ /** Locale do calendário */
37
83
  locale?: Locale;
38
- /** Formato de exibição da data ('dd/mm/yyyy' ou 'mm/dd/yyyy') */
84
+ /** Formato de exibição da data */
39
85
  format?: DateFormat;
40
- /** Identificador do elemento raiz do calendário */
41
- id?: string;
42
86
  }
@@ -1,17 +1,34 @@
1
- import React from 'react';
2
- export interface CalloutProps {
3
- /** Define o tipo de callout */
4
- type?: 'neutral' | 'color' | 'brand' | 'alert' | 'success';
5
- /** Define o título com mais destaque */
1
+ import * as React from 'react';
2
+ import { TextVariant, BaseProps } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Callout
5
+ * @example
6
+ * ```tsx
7
+ * <Callout
8
+ * type="success"
9
+ * title="Sucesso!"
10
+ * text="Operação realizada com sucesso"
11
+ * icon={<CheckIcon />}
12
+ * />
13
+ * ```
14
+ * @example
15
+ * ```tsx
16
+ * <Callout
17
+ * type="alert"
18
+ * title="Atenção"
19
+ * text="Verifique os campos obrigatórios"
20
+ * />
21
+ * ```
22
+ */
23
+ export interface CalloutProps extends BaseProps {
24
+ /** Tipo visual do callout */
25
+ type?: TextVariant;
26
+ /** Título principal do callout (texto em destaque) */
6
27
  title?: string | null;
7
- /** Define o texto com menos destaque */
28
+ /** Texto descritivo do callout */
8
29
  text?: string;
9
- /** Define o ícone a ser importado */
30
+ /** Ícone a ser exibido no callout */
10
31
  icon?: React.ReactNode;
11
- /** Define a classe CSS adicional */
12
- className?: string;
13
- /** Define o id do callout */
14
- id?: string;
15
32
  /** Props adicionais para o elemento div */
16
33
  [key: string]: any;
17
34
  }
@@ -1,10 +1,34 @@
1
- export interface CheckboxProps {
2
- id?: string;
1
+ import React from 'react';
2
+ import { BaseProps } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Checkbox
5
+ * @example
6
+ * ```tsx
7
+ * <Checkbox
8
+ * label="Aceito os termos"
9
+ * checked={accepted}
10
+ * onCheckedChange={setAccepted}
11
+ * />
12
+ * ```
13
+ * @example
14
+ * ```tsx
15
+ * <Checkbox
16
+ * label="Selecionar todos"
17
+ * indeterminate={someSelected}
18
+ * onCheckedChange={handleSelectAll}
19
+ * disabled={isLoading}
20
+ * />
21
+ * ```
22
+ */
23
+ export interface CheckboxProps extends BaseProps {
24
+ /** Label ou conteúdo a ser exibido ao lado do checkbox */
3
25
  label?: React.ReactNode;
26
+ /** Callback executado quando o estado muda: (checked) => void */
4
27
  onCheckedChange?: (checked: boolean) => void;
28
+ /** Estado inicial (modo não controlado) */
5
29
  defaultChecked?: boolean;
30
+ /** Estado atual (modo controlado) */
6
31
  checked?: boolean;
7
- disabled?: boolean;
8
- className?: string;
32
+ /** Estado indeterminado (usado em selecionar todos com seleção parcial) */
9
33
  indeterminate?: boolean;
10
34
  }
@@ -1,17 +1,34 @@
1
- import React from 'react';
2
- export interface ChipsProps {
3
- /** Variante a ser escolhida para utilizar padrões de estilizações pré-definidos */
4
- type?: 'neutral' | 'brand' | 'color' | 'success' | 'alert';
5
- /** Texto a ser exibido dentro do componente */
1
+ import * as React from 'react';
2
+ import { TextVariant, BaseProps } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Chips
5
+ * @example
6
+ * ```tsx
7
+ * <Chips
8
+ * type="success"
9
+ * title="Ativo"
10
+ * leftIcon={<CheckIcon />}
11
+ * />
12
+ * ```
13
+ * @example
14
+ * ```tsx
15
+ * <Chips
16
+ * type="brand"
17
+ * title="Novo"
18
+ * rightIcon={<CloseIcon />}
19
+ * disabled={false}
20
+ * />
21
+ * ```
22
+ */
23
+ export interface ChipsProps extends BaseProps {
24
+ /** Tipo visual do chip */
25
+ type?: TextVariant;
26
+ /** Texto a ser exibido dentro do chip */
6
27
  title: string;
7
- /** Ícone react que ficará posicionado à esquerda no componente */
28
+ /** Ícone posicionado à esquerda do texto */
8
29
  leftIcon?: React.ReactNode;
9
- /** Ícone react que ficará posicionado à direita no componente */
30
+ /** Ícone posicionado à direita do texto */
10
31
  rightIcon?: React.ReactNode;
11
- /** Estado alterável para desabilitar */
12
- disabled?: boolean;
13
- /** Classe CSS adicional */
14
- className?: string;
15
32
  /** Props adicionais para o elemento div */
16
33
  [key: string]: any;
17
34
  }
@@ -1,4 +1,15 @@
1
1
  import React from 'react';
2
+ /**
3
+ * Props do componente Container
4
+ * @example
5
+ * ```tsx
6
+ * <Container>
7
+ * <h1>Conteúdo da página</h1>
8
+ * <p>Texto dentro do container</p>
9
+ * </Container>
10
+ * ```
11
+ */
2
12
  export interface ContainerProps {
13
+ /** Conteúdo a ser renderizado dentro do container */
3
14
  children: React.ReactNode;
4
15
  }
@@ -1,32 +1,50 @@
1
- export type DatePickerLocale = 'pt-br' | 'en-us';
2
- export type CalendarPosition = 'left' | 'right';
3
- export interface DatePickerProps {
1
+ import { Locale, BaseProps, Position } from '../../types/common.types';
2
+ /**
3
+ * Props do componente DatePicker
4
+ * @example
5
+ * ```tsx
6
+ * <DatePicker
7
+ * label="Data de nascimento"
8
+ * value={birthDate}
9
+ * onChange={setBirthDate}
10
+ * locale="pt-br"
11
+ * />
12
+ * ```
13
+ * @example
14
+ * ```tsx
15
+ * <DatePicker
16
+ * label="Data de início"
17
+ * required
18
+ * helperText="Selecione a data de início do projeto"
19
+ * minDate={new Date()}
20
+ * calendarPosition="right"
21
+ * error={errorMessage}
22
+ * />
23
+ * ```
24
+ */
25
+ export interface DatePickerProps extends BaseProps {
4
26
  /** Locale para formatação da data */
5
- locale?: DatePickerLocale;
6
- /** Posição do calendário */
7
- calendarPosition?: CalendarPosition;
8
- /** Texto de ajuda */
27
+ locale?: Locale;
28
+ /** Posição do calendário em relação ao campo */
29
+ calendarPosition?: Position;
30
+ /** Texto de ajuda exibido abaixo do campo */
9
31
  helperText?: string;
10
- /** Se o campo é obrigatório */
32
+ /** Define se o campo é obrigatório */
11
33
  required?: boolean;
12
- /** Label do campo */
34
+ /** Label do campo de data */
13
35
  label?: string;
14
36
  /** Valor controlado da data */
15
37
  value?: Date | null;
16
38
  /** Valor inicial para modo não controlado */
17
39
  defaultValue?: Date | null;
18
- /** Callback chamado quando a data muda */
40
+ /** Callback executado quando a data muda: (date) => void */
19
41
  onChange?: (date: Date | null) => void;
20
- /** Se o campo está desabilitado */
21
- disabled?: boolean;
22
- /** Mensagem de erro */
42
+ /** Mensagem de erro a ser exibida */
23
43
  error?: string;
24
- /** Data mínima permitida */
44
+ /** Data mínima selecionável */
25
45
  minDate?: Date;
26
- /** Data máxima permitida */
46
+ /** Data máxima selecionável */
27
47
  maxDate?: Date;
28
- /** Classes CSS adicionais */
29
- className?: string;
30
- /** ID para testes */
48
+ /** ID para testes automatizados */
31
49
  'data-testid'?: string;
32
50
  }
@@ -1,4 +1,4 @@
1
- export type Locale = 'pt-br' | 'en-us';
1
+ import { Locale } from '../../types/common.types';
2
2
  /**
3
3
  * Formata uma data para string conforme o locale.
4
4
  * @param date - Data a ser formatada
@@ -1,2 +1,2 @@
1
1
  export { default } from './DatePicker';
2
- export type { DatePickerProps, DatePickerLocale, CalendarPosition } from './DatePicker.types';
2
+ export type { DatePickerProps } from './DatePicker.types';
@@ -1,24 +1,48 @@
1
1
  import { ReactNode } from 'react';
2
- export interface DialogProps {
2
+ import { BaseProps } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Dialog
5
+ * @example
6
+ * ```tsx
7
+ * <Dialog
8
+ * show={isOpen}
9
+ * title="Confirmar exclusão"
10
+ * text="Tem certeza que deseja excluir este item?"
11
+ * textConfirm="Excluir"
12
+ * textCancel="Cancelar"
13
+ * fnConfirm={handleDelete}
14
+ * fnCancel={handleCancel}
15
+ * onClose={handleClose}
16
+ * />
17
+ * ```
18
+ * @example
19
+ * ```tsx
20
+ * <Dialog
21
+ * show={showDialog}
22
+ * title="Informação"
23
+ * onClose={() => setShowDialog(false)}
24
+ * >
25
+ * <p>Conteúdo customizado do dialog</p>
26
+ * </Dialog>
27
+ * ```
28
+ */
29
+ export interface DialogProps extends BaseProps {
30
+ /** Conteúdo customizado do dialog */
3
31
  children?: ReactNode;
4
- /** Se o Dialog está visível */
32
+ /** Define se o dialog está visível */
5
33
  show: boolean;
6
- /** Título exibido no cabeçalho do Dialog (obrigatório) */
34
+ /** Título exibido no cabeçalho do dialog */
7
35
  title: string;
8
- /** Texto do corpo do Dialog */
36
+ /** Texto ou conteúdo do corpo do dialog */
9
37
  text?: ReactNode;
10
38
  /** Texto do botão de confirmação */
11
39
  textConfirm?: string;
12
40
  /** Texto do botão de cancelamento */
13
41
  textCancel?: string;
14
- /** Função chamada ao confirmar */
42
+ /** Callback executado ao confirmar: () => void */
15
43
  fnConfirm?: () => void;
16
- /** Função chamada ao cancelar */
44
+ /** Callback executado ao cancelar: () => void */
17
45
  fnCancel?: () => void;
18
- /** Função chamada ao fechar o Dialog */
46
+ /** Callback executado ao fechar o dialog: () => void */
19
47
  onClose?: () => void;
20
- /** ID opcional para o Dialog */
21
- id?: string;
22
- /** Classe CSS opcional */
23
- className?: string;
24
48
  }
@@ -1,43 +1,74 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- export interface DrawerProps {
3
- /** Conteúdo do Drawer */
2
+ import { Variant, BaseProps } from '../../types/common.types';
3
+ /**
4
+ * Props do componente Drawer
5
+ * @example
6
+ * ```tsx
7
+ * <Drawer
8
+ * isOpen={isDrawerOpen}
9
+ * onClose={handleClose}
10
+ * title="Menu"
11
+ * >
12
+ * <nav>
13
+ * <a href="/home">Home</a>
14
+ * <a href="/about">Sobre</a>
15
+ * </nav>
16
+ * </Drawer>
17
+ * ```
18
+ * @example
19
+ * ```tsx
20
+ * <Drawer
21
+ * isOpen={showDrawer}
22
+ * onClose={() => setShowDrawer(false)}
23
+ * title="Configurações"
24
+ * customWidth="400px"
25
+ * closeOnOverlayClick={true}
26
+ * closeOnEscape={true}
27
+ * >
28
+ * <Settings />
29
+ * </Drawer>
30
+ * ```
31
+ */
32
+ export interface DrawerProps extends BaseProps {
33
+ /** Conteúdo a ser exibido dentro do drawer */
4
34
  children?: ReactNode;
5
- /** Largura do Drawer (use design tokens quando possível) */
35
+ /** Largura customizada do drawer (ex: '400px', '50%') */
6
36
  customWidth?: string;
7
- /** Callback quando o Drawer é fechado */
37
+ /** Callback executado ao fechar o drawer: () => void */
8
38
  onClose: () => void;
9
- /** Título do Drawer */
39
+ /** Título exibido no cabeçalho do drawer */
10
40
  title?: string;
11
- /** Determina se o drawer está aberto */
41
+ /** Define se o drawer está aberto */
12
42
  isOpen: boolean;
13
- /** Callback quando o Drawer é aberto */
43
+ /** Callback executado ao abrir o drawer: () => void */
14
44
  onOpen?: () => void;
15
- /** Classes CSS adicionais */
16
- className?: string;
17
- /** ID único do componente */
18
- id?: string;
19
- /** Se o drawer está desabilitado */
20
- disabled?: boolean;
21
- /** Callback chamado quando clica no overlay */
45
+ /** Callback executado ao clicar no overlay: () => void */
22
46
  onOverlayClick?: () => void;
23
- /** Se deve fechar ao clicar no overlay */
47
+ /** Define se o drawer fecha ao clicar no overlay */
24
48
  closeOnOverlayClick?: boolean;
25
- /** Se deve fechar ao pressionar ESC */
49
+ /** Define se o drawer fecha ao pressionar ESC */
26
50
  closeOnEscape?: boolean;
27
51
  }
28
- export interface DrawerExampleProps {
29
- /** Texto do botão */
52
+ /**
53
+ * Props do componente DrawerExample (trigger para abrir o drawer)
54
+ * @example
55
+ * ```tsx
56
+ * <DrawerExample
57
+ * text="Abrir menu"
58
+ * icon={<MenuIcon />}
59
+ * onOpen={handleOpen}
60
+ * />
61
+ * ```
62
+ */
63
+ export interface DrawerExampleProps extends BaseProps {
64
+ /** Texto do botão trigger */
30
65
  text?: string;
31
- /** Ícone do botão */
66
+ /** Ícone do botão trigger */
32
67
  icon?: ReactElement;
33
- /** Conteúdo do Drawer */
68
+ /** Conteúdo customizado do botão trigger */
34
69
  children?: ReactNode;
35
- /** Callback quando o Drawer é aberto */
70
+ /** Callback executado ao abrir: () => void */
36
71
  onOpen?: () => void;
37
- /** Classes CSS adicionais */
38
- className?: string;
39
- /** Variante do botão */
40
- variant?: 'filled' | 'outlined' | 'text';
41
- /** Se o botão está desabilitado */
42
- disabled?: boolean;
72
+ /** Variante visual do botão trigger */
73
+ variant?: Variant;
43
74
  }