@giro-ds/react 5.0.0 → 6.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.
Files changed (135) hide show
  1. package/dist/index.cjs +232 -208
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +1656 -0
  4. package/dist/index.esm.js +234 -211
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/package.json +1 -1
  8. package/dist/dts-temp/components/Avatar/Avatar.d.ts +0 -4
  9. package/dist/dts-temp/components/Avatar/Avatar.types.d.ts +0 -23
  10. package/dist/dts-temp/components/Avatar/__tests__/Avatar.test.d.ts +0 -1
  11. package/dist/dts-temp/components/Avatar/index.d.ts +0 -2
  12. package/dist/dts-temp/components/Badge/Badge.d.ts +0 -4
  13. package/dist/dts-temp/components/Badge/Badge.types.d.ts +0 -37
  14. package/dist/dts-temp/components/Badge/index.d.ts +0 -2
  15. package/dist/dts-temp/components/Button/Button.d.ts +0 -4
  16. package/dist/dts-temp/components/Button/Button.types.d.ts +0 -62
  17. package/dist/dts-temp/components/Button/__tests__/Button.test.d.ts +0 -1
  18. package/dist/dts-temp/components/Button/index.d.ts +0 -2
  19. package/dist/dts-temp/components/Calendar/Calendar.d.ts +0 -3
  20. package/dist/dts-temp/components/Calendar/Calendar.types.d.ts +0 -55
  21. package/dist/dts-temp/components/Calendar/__tests__/Calendar.test.d.ts +0 -1
  22. package/dist/dts-temp/components/Calendar/index.d.ts +0 -1
  23. package/dist/dts-temp/components/Callout/Callout.d.ts +0 -4
  24. package/dist/dts-temp/components/Callout/Callout.types.d.ts +0 -34
  25. package/dist/dts-temp/components/Callout/index.d.ts +0 -1
  26. package/dist/dts-temp/components/Checkbox/Checkbox.d.ts +0 -4
  27. package/dist/dts-temp/components/Checkbox/Checkbox.types.d.ts +0 -34
  28. package/dist/dts-temp/components/Checkbox/__tests__/Checkbox.test.d.ts +0 -1
  29. package/dist/dts-temp/components/Checkbox/index.d.ts +0 -2
  30. package/dist/dts-temp/components/Chips/Chips.d.ts +0 -4
  31. package/dist/dts-temp/components/Chips/Chips.types.d.ts +0 -34
  32. package/dist/dts-temp/components/Chips/index.d.ts +0 -1
  33. package/dist/dts-temp/components/Container/Container.d.ts +0 -2
  34. package/dist/dts-temp/components/Container/Container.types.d.ts +0 -15
  35. package/dist/dts-temp/components/Container/__tests__/Container.test.d.ts +0 -1
  36. package/dist/dts-temp/components/DatePicker/DatePicker.d.ts +0 -4
  37. package/dist/dts-temp/components/DatePicker/DatePicker.types.d.ts +0 -52
  38. package/dist/dts-temp/components/DatePicker/Utils/DateUtils.d.ts +0 -6
  39. package/dist/dts-temp/components/DatePicker/__test__/DatePicker.test.d.ts +0 -1
  40. package/dist/dts-temp/components/DatePicker/index.d.ts +0 -2
  41. package/dist/dts-temp/components/Dialog/Dialog.d.ts +0 -4
  42. package/dist/dts-temp/components/Dialog/Dialog.types.d.ts +0 -27
  43. package/dist/dts-temp/components/Dialog/__tests__/Dialog.test.d.ts +0 -1
  44. package/dist/dts-temp/components/Dialog/index.d.ts +0 -2
  45. package/dist/dts-temp/components/Drawer/Drawer.d.ts +0 -4
  46. package/dist/dts-temp/components/Drawer/Drawer.types.d.ts +0 -76
  47. package/dist/dts-temp/components/Drawer/__tests__/Drawer.test.d.ts +0 -1
  48. package/dist/dts-temp/components/Drawer/index.d.ts +0 -1
  49. package/dist/dts-temp/components/Filter/Filter.d.ts +0 -4
  50. package/dist/dts-temp/components/Filter/Filter.types.d.ts +0 -74
  51. package/dist/dts-temp/components/Filter/index.d.ts +0 -2
  52. package/dist/dts-temp/components/ListItem/ListItem.d.ts +0 -4
  53. package/dist/dts-temp/components/ListItem/ListItem.types.d.ts +0 -52
  54. package/dist/dts-temp/components/ListItem/index.d.ts +0 -2
  55. package/dist/dts-temp/components/Menu/Menu.d.ts +0 -4
  56. package/dist/dts-temp/components/Menu/Menu.types.d.ts +0 -90
  57. package/dist/dts-temp/components/Menu/__tests__/Menu.test.d.ts +0 -1
  58. package/dist/dts-temp/components/Menu/components/MenuItem.d.ts +0 -3
  59. package/dist/dts-temp/components/Menu/hooks/useMenuLogic.d.ts +0 -15
  60. package/dist/dts-temp/components/Menu/hooks/useSearchLogic.d.ts +0 -13
  61. package/dist/dts-temp/components/Menu/index.d.ts +0 -2
  62. package/dist/dts-temp/components/Popover/Popover.d.ts +0 -4
  63. package/dist/dts-temp/components/Popover/Popover.types.d.ts +0 -25
  64. package/dist/dts-temp/components/Popover/__test__/Popover.test.d.ts +0 -1
  65. package/dist/dts-temp/components/Popover/index.d.ts +0 -2
  66. package/dist/dts-temp/components/Quantity/Quantity.d.ts +0 -4
  67. package/dist/dts-temp/components/Quantity/Quantity.types.d.ts +0 -38
  68. package/dist/dts-temp/components/Quantity/index.d.ts +0 -2
  69. package/dist/dts-temp/components/Radio/Radio.d.ts +0 -4
  70. package/dist/dts-temp/components/Radio/Radio.types.d.ts +0 -52
  71. package/dist/dts-temp/components/Radio/__tests__/Radio.test.d.ts +0 -1
  72. package/dist/dts-temp/components/Radio/index.d.ts +0 -2
  73. package/dist/dts-temp/components/Search/Search.d.ts +0 -4
  74. package/dist/dts-temp/components/Search/Search.types.d.ts +0 -48
  75. package/dist/dts-temp/components/Search/__tests__/Search.test.d.ts +0 -1
  76. package/dist/dts-temp/components/Search/index.d.ts +0 -2
  77. package/dist/dts-temp/components/Select/Select.d.ts +0 -4
  78. package/dist/dts-temp/components/Select/Select.types.d.ts +0 -224
  79. package/dist/dts-temp/components/Select/__tests__/SelectRadix.test.d.ts +0 -1
  80. package/dist/dts-temp/components/Select/components/CheckboxSelectItem.d.ts +0 -4
  81. package/dist/dts-temp/components/Select/components/ExpandableSelectItem.d.ts +0 -11
  82. package/dist/dts-temp/components/Select/components/SelectItem.d.ts +0 -7
  83. package/dist/dts-temp/components/Select/hooks/useSelectLogic.d.ts +0 -3
  84. package/dist/dts-temp/components/Select/index.d.ts +0 -5
  85. package/dist/dts-temp/components/Switch/Switch.d.ts +0 -4
  86. package/dist/dts-temp/components/Switch/Switch.types.d.ts +0 -32
  87. package/dist/dts-temp/components/Switch/__tests__/Switch.test.d.ts +0 -1
  88. package/dist/dts-temp/components/Switch/index.d.ts +0 -2
  89. package/dist/dts-temp/components/Table/EmptyRows150Color.d.ts +0 -8
  90. package/dist/dts-temp/components/Table/LoaderList.d.ts +0 -10
  91. package/dist/dts-temp/components/Table/MultiLineText/MultiLineText.d.ts +0 -14
  92. package/dist/dts-temp/components/Table/MultiLineText/index.d.ts +0 -2
  93. package/dist/dts-temp/components/Table/Table.d.ts +0 -3
  94. package/dist/dts-temp/components/Table/Table.types.d.ts +0 -70
  95. package/dist/dts-temp/components/Table/TableHeader.d.ts +0 -50
  96. package/dist/dts-temp/components/Table/TablePagination.d.ts +0 -13
  97. package/dist/dts-temp/components/Table/index.d.ts +0 -7
  98. package/dist/dts-temp/components/Table/utils/tableActions.d.ts +0 -21
  99. package/dist/dts-temp/components/TextArea/TextArea.d.ts +0 -4
  100. package/dist/dts-temp/components/TextArea/TextArea.types.d.ts +0 -56
  101. package/dist/dts-temp/components/TextArea/__tests__/TextArea.test.d.ts +0 -1
  102. package/dist/dts-temp/components/TextArea/index.d.ts +0 -2
  103. package/dist/dts-temp/components/TextField/TextField.d.ts +0 -4
  104. package/dist/dts-temp/components/TextField/TextField.types.d.ts +0 -77
  105. package/dist/dts-temp/components/TextField/__tests__/Textfield.test.d.ts +0 -1
  106. package/dist/dts-temp/components/TextField/index.d.ts +0 -2
  107. package/dist/dts-temp/components/TextField/utils/__tests__/validation.test.d.ts +0 -1
  108. package/dist/dts-temp/components/TextField/utils/index.d.ts +0 -2
  109. package/dist/dts-temp/components/TextField/utils/validation.d.ts +0 -8
  110. package/dist/dts-temp/components/Toast/Toast.d.ts +0 -34
  111. package/dist/dts-temp/components/Toast/Toast.types.d.ts +0 -57
  112. package/dist/dts-temp/components/Toast/__tests__/Toast.test.d.ts +0 -1
  113. package/dist/dts-temp/components/Toast/components/ToastContainer.d.ts +0 -22
  114. package/dist/dts-temp/components/Toast/components/ToastProvider.d.ts +0 -35
  115. package/dist/dts-temp/components/Toast/index.d.ts +0 -5
  116. package/dist/dts-temp/components/Tooltip/Tooltip.d.ts +0 -4
  117. package/dist/dts-temp/components/Tooltip/Tooltip.types.d.ts +0 -14
  118. package/dist/dts-temp/components/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
  119. package/dist/dts-temp/components/Tooltip/index.d.ts +0 -2
  120. package/dist/dts-temp/components/VerificationCode/VerificationCode.d.ts +0 -20
  121. package/dist/dts-temp/components/VerificationCode/VerificationCode.types.d.ts +0 -39
  122. package/dist/dts-temp/components/VerificationCode/index.d.ts +0 -2
  123. package/dist/dts-temp/components/index.d.ts +0 -59
  124. package/dist/dts-temp/contexts/ToastContext.d.ts +0 -43
  125. package/dist/dts-temp/hooks/ApiSimulation.d.ts +0 -53
  126. package/dist/dts-temp/hooks/InfiniteScroll.d.ts +0 -41
  127. package/dist/dts-temp/hooks/NormalizeText.d.ts +0 -1
  128. package/dist/dts-temp/hooks/useToast.d.ts +0 -46
  129. package/dist/dts-temp/index.d.ts +0 -1
  130. package/dist/dts-temp/shared/Label/index.d.ts +0 -15
  131. package/dist/dts-temp/shared/icons/CheckHalf.d.ts +0 -10
  132. package/dist/dts-temp/shared/icons/CheckSmall.d.ts +0 -10
  133. package/dist/dts-temp/shared/icons/index.d.ts +0 -4
  134. package/dist/dts-temp/types/common.types.d.ts +0 -12
  135. package/dist/dts-temp/types/index.d.ts +0 -1
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Componente de ícone SVG para estado vazio da tabela
4
- * Exibe um ícone de lupa com design personalizado do Zanthus Design System
5
- * @returns Elemento SVG para estado vazio
6
- */
7
- declare const EmptyRows150Color: React.FC;
8
- export default EmptyRows150Color;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { IContentLoaderProps } from 'react-content-loader';
3
- /**
4
- * Componente de loading para lista de tabela
5
- * Simula o carregamento de dados em formato de tabela usando ContentLoader
6
- * @param props - Propriedades adicionais para o ContentLoader
7
- * @returns Elemento de loading animado
8
- */
9
- declare const LoaderList: React.FC<IContentLoaderProps>;
10
- export default LoaderList;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- interface MultiLineTextProps {
3
- /** Texto a ser exibido como linha principal */
4
- text1: string;
5
- /** Texto a ser exibido como linha secundária */
6
- text2: string;
7
- }
8
- /**
9
- * Componente para exibir texto em duas linhas
10
- * Utilizado principalmente em tabelas para mostrar informações hierárquicas
11
- */
12
- declare const MultiLineText: React.FC<MultiLineTextProps>;
13
- export default MultiLineText;
14
- export type { MultiLineTextProps };
@@ -1,2 +0,0 @@
1
- export { default } from './MultiLineText';
2
- export type { MultiLineTextProps } from './MultiLineText';
@@ -1,3 +0,0 @@
1
- import type { TableRowData, TableProps } from './Table.types';
2
- declare const Table: <T extends TableRowData = TableRowData>({ columns, dataSource, className, loading, rowSelection, locale, onRow, ...rest }: TableProps<T>) => import("react/jsx-runtime").JSX.Element | null;
3
- export default Table;
@@ -1,70 +0,0 @@
1
- import { ReactNode, CSSProperties } from 'react';
2
- import { BaseProps } from '../../types';
3
- /**
4
- * Tipo base para dados da tabela. Use `<Table<SeuTipo>>` para type-safety completo.
5
- * @example <Table<User> dataSource={users} />
6
- */
7
- export type TableRowData = Record<string, any>;
8
- /** Tipos de coluna suportados */
9
- export type TableColumnType = 'text' | 'datetime' | 'custom';
10
- /** Opções de alinhamento de coluna */
11
- export type TableAlign = 'left' | 'center' | 'right';
12
- /**
13
- * Configuração de coluna da tabela
14
- * @typeParam T - Tipo dos dados da linha
15
- */
16
- export interface TableColumn<T = TableRowData> {
17
- /** Chave única identificadora da coluna */
18
- key: string;
19
- /** Conteúdo do cabeçalho da coluna */
20
- label: ReactNode;
21
- /** Tipo de dados da coluna */
22
- type?: TableColumnType;
23
- /** Formato de exibição (ex: 'dd/MM/yyyy' para datetime) */
24
- format?: string;
25
- /** Função customizada para renderizar o conteúdo da célula */
26
- render?: (row: T, index: number) => ReactNode;
27
- /** Alinhamento do conteúdo */
28
- align?: TableAlign;
29
- /** Estilos CSS customizados */
30
- style?: CSSProperties;
31
- }
32
- /**
33
- * Props do componente Table. Use genérico para autocomplete: `<Table<User>>`
34
- * @typeParam T - Tipo dos dados da linha
35
- */
36
- export interface TableProps<T = TableRowData> extends BaseProps {
37
- /** Configuração das colunas */
38
- columns: TableColumn<T>[];
39
- /** Array de dados a serem exibidos */
40
- dataSource: T[];
41
- /** Estado de carregamento */
42
- loading?: boolean;
43
- /** Configuração de seleção de linhas */
44
- rowSelection?: {
45
- /** Keys das linhas selecionadas (modo controlado) */
46
- selectedRowKeys?: (string | number)[];
47
- /** Callback quando seleção muda: (keys, rows) => void */
48
- onChange?: (keys: (string | number)[], rows: T[]) => void;
49
- /** Customiza props dos checkboxes: (row, index) => { disabled? } */
50
- getCheckboxProps?: (row: T, index: number) => {
51
- disabled?: boolean;
52
- };
53
- /** Desabilita o checkbox "selecionar todos" */
54
- disableSelectAll?: boolean;
55
- };
56
- /** Configurações de localização */
57
- locale?: {
58
- /** Texto quando não há dados */
59
- emptyText?: ReactNode;
60
- };
61
- /** Eventos de linha: (row, index) => { onClick?, onDoubleClick?, className? } */
62
- onRow?: (row: T, index: number) => {
63
- /** Clique simples na linha */
64
- onClick?: () => void;
65
- /** Clique duplo na linha */
66
- onDoubleClick?: () => void;
67
- /** Classe CSS da linha */
68
- className?: string;
69
- };
70
- }
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import type { Side, Align } from '../../types/common.types';
3
- import type { FilterItem as FilterListItem } from '../Filter';
4
- interface BaseFilterItem {
5
- id?: string;
6
- buttonText: string | React.ReactNode;
7
- icon?: React.ReactElement;
8
- side?: Side;
9
- align?: Exclude<Align, 'center'>;
10
- disabled?: boolean;
11
- onToggle?: (isOpen: boolean) => void;
12
- tooltip?: string;
13
- }
14
- interface CheckboxFilterItem extends BaseFilterItem {
15
- type: 'checkbox' | 'text' | 'icon';
16
- items: FilterListItem[];
17
- selectedIds?: string[];
18
- onSelectionChange?: (selectedIds: string[]) => void;
19
- placeholder?: string;
20
- enableSearch?: boolean;
21
- }
22
- interface CalendarFilterItem extends BaseFilterItem {
23
- type: 'calendar';
24
- selectedDate?: Date | null;
25
- onDateSelect?: (date: Date) => void;
26
- onClear?: () => void;
27
- minDate?: Date;
28
- maxDate?: Date;
29
- locale?: string;
30
- placeholder?: string;
31
- }
32
- export type FilterItem = CheckboxFilterItem | CalendarFilterItem;
33
- declare const isCalendarFilter: (filter: FilterItem) => filter is CalendarFilterItem;
34
- declare const isCheckboxFilter: (filter: FilterItem) => filter is CheckboxFilterItem;
35
- export interface TableHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
36
- searchValue?: string;
37
- onSearchChange?: (value: string) => void;
38
- searchPlaceholder?: string;
39
- showSearch?: boolean;
40
- showFilters?: boolean;
41
- filters?: React.ReactNode;
42
- filterItems?: FilterItem[];
43
- className?: string;
44
- onSearch?: (value: string) => void;
45
- showClearSearch?: boolean;
46
- }
47
- declare const TableHeader: React.FC<TableHeaderProps>;
48
- export type { CalendarFilterItem, CheckboxFilterItem };
49
- export { isCalendarFilter, isCheckboxFilter };
50
- export default TableHeader;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- export interface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {
3
- currentPage: number;
4
- totalItems: number;
5
- itemsPerPage: number;
6
- onPageChange: (page: number) => void;
7
- onItemsPerPageChange: (itemsPerPage: number) => void;
8
- pageSizeOptions?: number[];
9
- disabled?: boolean;
10
- className?: string;
11
- }
12
- declare const TablePagination: React.FC<TablePaginationProps>;
13
- export default TablePagination;
@@ -1,7 +0,0 @@
1
- export { default } from './Table';
2
- export { default as Table } from './Table';
3
- export type { TableProps, TableColumn, TableRowData, TableColumnType, TableAlign, } from './Table.types';
4
- export { default as TableHeader } from './TableHeader';
5
- export type { TableHeaderProps } from './TableHeader';
6
- export { default as TablePagination } from './TablePagination';
7
- export type { TablePaginationProps } from './TablePagination';
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- export interface TableAction {
3
- key: string;
4
- label: string | ((row: any) => string);
5
- icon?: React.ReactNode;
6
- danger?: boolean;
7
- disabled?: (row: any) => boolean;
8
- onClick: (row: any) => void;
9
- }
10
- export declare const createActionsColumn: (actions: TableAction[]) => {
11
- key: string;
12
- label: string;
13
- width: number;
14
- align: "center";
15
- render: (row: any) => import("react/jsx-runtime").JSX.Element;
16
- };
17
- declare const TableActionsMenu: React.NamedExoticComponent<{
18
- row: any;
19
- actions: TableAction[];
20
- }>;
21
- export default TableActionsMenu;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { TextAreaProps } from './TextArea.types';
3
- declare const _default: React.NamedExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
4
- export default _default;
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { Side, Align } from '../../types/common.types';
3
- /**
4
- * Props do componente TextArea
5
- * @example
6
- * ```tsx
7
- * <TextArea
8
- * label="Descrição"
9
- * value={description}
10
- * onChange={setDescription}
11
- * placeholder="Digite uma descrição"
12
- * />
13
- * ```
14
- * @example
15
- * ```tsx
16
- * <TextArea
17
- * label="Comentário"
18
- * required
19
- * maxLength={500}
20
- * showCharCount
21
- * helperText="Máximo de 500 caracteres"
22
- * errorMessage={error}
23
- * />
24
- * ```
25
- */
26
- export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'value'> {
27
- /** Valor controlado do campo */
28
- value?: string;
29
- /** Callback executado quando o valor muda: (value) => void */
30
- onChange?: (value: string) => void;
31
- /** Label do campo */
32
- label?: string;
33
- /** Texto de ajuda exibido abaixo do campo */
34
- helperText?: string;
35
- /** Habilita tooltip */
36
- tooltip?: boolean;
37
- /** Texto do tooltip */
38
- tooltipText?: string;
39
- /** Lado onde o tooltip aparece */
40
- side?: Side;
41
- /** Alinhamento do tooltip */
42
- align?: Align;
43
- /**
44
- * Mensagem de erro exibida no campo.
45
- * Usada tanto pela validação interna (required, etc.)
46
- * quanto pelo controle externo via formulários (react-hook-form, formik, etc.)
47
- */
48
- errorMessage?: string;
49
- /** Sinaliza erro externo para controle via formulários (react-hook-form, formik, etc.) */
50
- error?: boolean;
51
- /** Controla o redimensionamento do textarea */
52
- resize?: 'none' | 'vertical' | 'both';
53
- /** Exibe contador de caracteres (requer maxLength) */
54
- showCharCount?: boolean;
55
- height?: number;
56
- }
@@ -1,2 +0,0 @@
1
- export { default } from './TextArea';
2
- export type { TextAreaProps } from './TextArea.types';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { TextFieldProps } from './TextField.types';
3
- declare const _default: React.NamedExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
4
- export default _default;
@@ -1,77 +0,0 @@
1
- import React from 'react';
2
- import { Side, Align } from '../../types/common.types';
3
- /** Tipos de input suportados pelo TextField */
4
- export type TextFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
5
- /**
6
- * Props do componente TextField
7
- * @example
8
- * ```tsx
9
- * <TextField
10
- * label="Email"
11
- * type="email"
12
- * value={email}
13
- * onChange={setEmail}
14
- * placeholder="Digite seu email"
15
- * />
16
- * ```
17
- * @example
18
- * ```tsx
19
- * <TextField
20
- * label="Senha"
21
- * type="password"
22
- * required
23
- * helperText="Mínimo 8 caracteres"
24
- * errorMessage={error}
25
- * tooltip={true}
26
- * tooltipText="Deve conter letras e números"
27
- * icon={<LockIcon />}
28
- * />
29
- * ```
30
- */
31
- export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'type'> {
32
- /** Valor controlado do campo */
33
- value?: string | number;
34
- /** Callback executado quando o valor muda: (value) => void */
35
- onChange?: (value: string) => void;
36
- /** Label do campo */
37
- label?: string;
38
- /** Tipo do input */
39
- type?: TextFieldType;
40
- /** Texto de ajuda exibido abaixo do campo */
41
- helperText?: string;
42
- /** Habilita tooltip */
43
- tooltip?: boolean;
44
- /** Texto do tooltip */
45
- tooltipText?: string;
46
- /** Lado onde o tooltip aparece */
47
- side?: Side;
48
- /** Alinhamento do tooltip */
49
- align?: Align;
50
- /**
51
- * Mensagem de erro exibida no campo.
52
- * Usada tanto pela validação interna (required, formato, etc.)
53
- * quanto pelo controle externo via formulários (react-hook-form, formik, etc.)
54
- */
55
- errorMessage?: string;
56
- /** Sinaliza erro externo para controle via formulários (react-hook-form, formik, etc.) */
57
- error?: boolean;
58
- /** Ícone a ser exibido no campo */
59
- icon?: React.ReactNode;
60
- /** Mantém o ícone visível mesmo quando o campo tem valor */
61
- persistIcon?: boolean;
62
- }
63
- /**
64
- * Parâmetros para validação do TextField
65
- */
66
- export interface ValidationParams {
67
- /** Valor a ser validado */
68
- value: string;
69
- /** Comprimento máximo permitido */
70
- maxLength?: number;
71
- /** Tipo do campo (influencia a validação) */
72
- type?: TextFieldType;
73
- /** Mensagem de erro customizada */
74
- errorMessage?: string;
75
- /** Define se o campo é obrigatório */
76
- required?: boolean;
77
- }
@@ -1,2 +0,0 @@
1
- export { default } from './TextField';
2
- export type { TextFieldProps } from './TextField.types';
@@ -1,2 +0,0 @@
1
- export { validateInput } from './validation';
2
- export type { ValidationParams } from './validation';
@@ -1,8 +0,0 @@
1
- export interface ValidationParams {
2
- value: string;
3
- maxLength?: number;
4
- type?: string;
5
- errorMessage?: string;
6
- required?: boolean;
7
- }
8
- export declare const validateInput: ({ value, maxLength, errorMessage, required }: ValidationParams) => string;
@@ -1,34 +0,0 @@
1
- import * as React from "react";
2
- import { ToastProps } from './Toast.types';
3
- /**
4
- * Componente individual de notificação Toast.
5
- *
6
- * Consome o contexto do `ToastProvider` para gerenciar seu próprio ciclo de vida.
7
- * Cada instância recebe um `id` único gerado pelo provider e o utiliza para
8
- * se remover da fila ao ser fechada.
9
- *
10
- * Construído sobre `Toast.Root` do **Radix UI**, com suporte completo a
11
- * acessibilidade (ARIA) e gesto de swipe para a esquerda.
12
- *
13
- * @remarks
14
- * Este componente não deve ser usado diretamente. Utilize o hook `useToast`
15
- * para exibir toasts programaticamente.
16
- *
17
- * @example
18
- * ```tsx
19
- * // Uso indireto via hook (recomendado)
20
- * const { showToast } = useToast();
21
- *
22
- * showToast({
23
- * title: 'Item salvo',
24
- * iconType: 'Success',
25
- * duration: 3000,
26
- * });
27
- * ```
28
- *
29
- * @param props - {@link ToastProps} combinadas com o `id` único do toast
30
- */
31
- declare const Toast: React.FC<ToastProps & {
32
- id: string;
33
- }>;
34
- export default Toast;
@@ -1,57 +0,0 @@
1
- import { Toast } from 'radix-ui';
2
- import * as React from 'react';
3
- import { BaseProps } from '../../types';
4
- /**
5
- * Props do componente individual de notificação `Toast`.
6
- *
7
- * Estende {@link BaseProps} e os atributos nativos do `Toast.Root` do Radix UI,
8
- * excluindo as propriedades controladas internamente (`open`, `onOpenChange`,
9
- * `duration`, `className`).
10
- *
11
- * @example
12
- * ```tsx
13
- * showToast({
14
- * title: 'Sucesso!',
15
- * iconType: 'Success',
16
- * duration: 3000,
17
- * });
18
- * ```
19
- */
20
- export interface ToastProps extends BaseProps, Omit<React.ComponentPropsWithoutRef<typeof Toast.Root>, 'open' | 'onOpenChange' | 'duration' | 'className'> {
21
- /**
22
- * Título principal exibido no toast.
23
- */
24
- title: string;
25
- /**
26
- * Define se o toast fecha automaticamente após o tempo definido em `duration`.
27
- * @default true
28
- */
29
- automaticClose?: boolean;
30
- /**
31
- * Tempo em milissegundos até o toast fechar automaticamente.
32
- * Só tem efeito quando `automaticClose` é `true`.
33
- * @default 5000
34
- */
35
- duration?: number;
36
- /**
37
- * Ícone customizado exibido no toast.
38
- * Quando fornecido, substitui o ícone gerado automaticamente por `iconType`.
39
- */
40
- icon?: React.ReactNode;
41
- /**
42
- * Ícone exibido no botão de fechar o toast.
43
- * @default <Dismiss16Filled />
44
- */
45
- iconClosed?: React.ReactNode;
46
- /**
47
- * Tipo do ícone exibido automaticamente no toast.
48
- *
49
- * - `'Info'` → ícone informativo (`Info20Filled`)
50
- * - `'Success'` → ícone de sucesso (`CheckmarkCircle20Filled`)
51
- * - `'Alert'` → ícone de alerta/erro (`Warning20Filled`)
52
- *
53
- * Ignorado quando a prop `icon` for fornecida.
54
- * @default 'Info'
55
- */
56
- iconType?: 'Info' | 'Success' | 'Alert';
57
- }
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Componente responsável por renderizar todos os toasts ativos na tela.
4
- *
5
- * Lê a lista de toasts do contexto fornecido pelo `ToastProvider` e os
6
- * renderiza individualmente. Configura o `Toast.Provider` do Radix UI com
7
- * direção de swipe para a esquerda.
8
- *
9
- * @remarks
10
- * - Deve ser posicionado **dentro** do `ToastProvider`.
11
- * - Geralmente é colocado próximo à raiz da aplicação, após os demais filhos.
12
- * - Toasts sem `id` são ignorados automaticamente.
13
- *
14
- * @example
15
- * ```tsx
16
- * <ToastProvider>
17
- * <App />
18
- * <ToastContainer /> {/* Deve estar aqui *\/}
19
- * </ToastProvider>
20
- * ```
21
- */
22
- export declare const ToastContainer: React.FC;
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Provider que gerencia o estado global dos toasts na aplicação.
4
- *
5
- * Deve envolver toda a árvore de componentes que precisará exibir toasts.
6
- * Disponibiliza o contexto com `showToast` e `dismissToast` para todos os
7
- * componentes filhos via `useToast()`.
8
- *
9
- * @remarks
10
- * O `ToastContainer` deve ser renderizado **dentro** do `ToastProvider`.
11
- *
12
- * @example
13
- * ```tsx
14
- * // App.tsx ou layout principal
15
- * import { ToastProvider, ToastContainer } from '@giro-ds/react';
16
- *
17
- * function App() {
18
- * return (
19
- * <ToastProvider maxToasts={5}>
20
- * <Routes />
21
- * <ToastContainer />
22
- * </ToastProvider>
23
- * );
24
- * }
25
- * ```
26
- *
27
- * @param children - Árvore de componentes filhos da aplicação.
28
- * @param maxToasts - Número máximo de toasts exibidos simultaneamente.
29
- * Quando o limite é excedido, o toast mais antigo é removido automaticamente.
30
- * @default 5
31
- */
32
- export declare const ToastProvider: React.FC<{
33
- children: React.ReactNode;
34
- maxToasts?: number;
35
- }>;
@@ -1,5 +0,0 @@
1
- export { default as Toast } from './Toast';
2
- export { ToastProvider } from './components/ToastProvider';
3
- export { ToastContainer } from './components/ToastContainer';
4
- export { useToast } from '../../hooks/useToast';
5
- export type { ToastProps } from './Toast.types';
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { TooltipProps } from './Tooltip.types';
3
- declare const Tooltip: React.FC<TooltipProps>;
4
- export default Tooltip;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { BaseProps, Side, Align } from '@/types';
3
- export interface TooltipProps extends BaseProps {
4
- text: React.ReactNode;
5
- side?: Side;
6
- align?: Align;
7
- sideOffset?: number;
8
- /** Deslocamento em pixels no eixo de alinhamento */
9
- alignOffset?: number;
10
- /** Largura máxima do tooltip em pixels */
11
- maxWidth?: number;
12
- /** Elemento que dispara o tooltip ao hover */
13
- children: React.ReactNode;
14
- }
@@ -1,2 +0,0 @@
1
- export { default } from './Tooltip';
2
- export type { TooltipProps } from './Tooltip.types';
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import type { VerificationCodeProps } from './VerificationCode.types';
3
- /**
4
- * Componente VerificationCode para entrada de códigos de verificação
5
- *
6
- * @description Permite entrada de códigos com múltiplos dígitos,
7
- * suportando diferentes tipos de caracteres e navegação por teclado.
8
- *
9
- * @example
10
- * ```tsx
11
- * <VerificationCode
12
- * length={6}
13
- * inputType="numeric"
14
- * onComplete={(code) => console.log('Código:', code)}
15
- * hasError={false}
16
- * />
17
- * ```
18
- */
19
- declare const VerificationCode: React.FC<VerificationCodeProps>;
20
- export default VerificationCode;
@@ -1,39 +0,0 @@
1
- import { BaseProps } from '../../types/common.types';
2
- /** Tipos de entrada suportados pelo VerificationCode */
3
- export type InputType = 'numeric' | 'alpha' | 'alphanumeric';
4
- /**
5
- * Props do componente VerificationCode
6
- * @example
7
- * ```tsx
8
- * <VerificationCode
9
- * length={6}
10
- * inputType="numeric"
11
- * onComplete={(code) => handleVerification(code)}
12
- * />
13
- * ```
14
- * @example
15
- * ```tsx
16
- * <VerificationCode
17
- * length={4}
18
- * inputType="alphanumeric"
19
- * onComplete={handleCode}
20
- * hasError={!!error}
21
- * errorMessage="Código inválido"
22
- * disabled={isVerifying}
23
- * />
24
- * ```
25
- */
26
- export interface VerificationCodeProps extends BaseProps {
27
- /** Número de dígitos do código (padrão: 6) */
28
- length?: number;
29
- /** Tipo de entrada permitida (padrão: "numeric") */
30
- inputType?: InputType;
31
- /** Callback executado quando todos os campos são preenchidos: (value) => void */
32
- onComplete?: (value: string) => void;
33
- /** Define se o campo está em estado de erro */
34
- hasError?: boolean;
35
- /** Mensagem de erro exibida abaixo do componente */
36
- errorMessage?: string;
37
- /** Props adicionais passadas para os inputs */
38
- [key: string]: any;
39
- }
@@ -1,2 +0,0 @@
1
- export { default } from './VerificationCode';
2
- export type { VerificationCodeProps } from './VerificationCode.types';