@giro-ds/react 4.0.0 → 5.0.1

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 (132) hide show
  1. package/dist/index.cjs +429 -703
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +117 -171
  4. package/dist/index.esm.js +431 -705
  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/components/Avatar/Avatar.d.ts +0 -4
  9. package/dist/components/Avatar/Avatar.types.d.ts +0 -23
  10. package/dist/components/Avatar/__tests__/Avatar.test.d.ts +0 -1
  11. package/dist/components/Avatar/index.d.ts +0 -2
  12. package/dist/components/Badge/Badge.d.ts +0 -4
  13. package/dist/components/Badge/Badge.types.d.ts +0 -37
  14. package/dist/components/Badge/index.d.ts +0 -2
  15. package/dist/components/Button/Button.d.ts +0 -4
  16. package/dist/components/Button/Button.types.d.ts +0 -62
  17. package/dist/components/Button/__tests__/Button.test.d.ts +0 -1
  18. package/dist/components/Button/index.d.ts +0 -2
  19. package/dist/components/Calendar/Calendar.d.ts +0 -3
  20. package/dist/components/Calendar/Calendar.types.d.ts +0 -109
  21. package/dist/components/Calendar/__tests__/Calendar.test.d.ts +0 -1
  22. package/dist/components/Calendar/index.d.ts +0 -1
  23. package/dist/components/Callout/Callout.d.ts +0 -4
  24. package/dist/components/Callout/Callout.types.d.ts +0 -34
  25. package/dist/components/Callout/index.d.ts +0 -1
  26. package/dist/components/Checkbox/Checkbox.d.ts +0 -4
  27. package/dist/components/Checkbox/Checkbox.types.d.ts +0 -34
  28. package/dist/components/Checkbox/__tests__/Checkbox.test.d.ts +0 -1
  29. package/dist/components/Checkbox/index.d.ts +0 -2
  30. package/dist/components/Chips/Chips.d.ts +0 -4
  31. package/dist/components/Chips/Chips.types.d.ts +0 -34
  32. package/dist/components/Chips/index.d.ts +0 -1
  33. package/dist/components/Container/Container.d.ts +0 -2
  34. package/dist/components/Container/Container.types.d.ts +0 -15
  35. package/dist/components/Container/__tests__/Container.test.d.ts +0 -1
  36. package/dist/components/DatePicker/DatePicker.d.ts +0 -4
  37. package/dist/components/DatePicker/DatePicker.types.d.ts +0 -50
  38. package/dist/components/DatePicker/DateUtils.d.ts +0 -23
  39. package/dist/components/DatePicker/index.d.ts +0 -2
  40. package/dist/components/Dialog/Dialog.d.ts +0 -4
  41. package/dist/components/Dialog/Dialog.types.d.ts +0 -28
  42. package/dist/components/Dialog/__tests__/Dialog.test.d.ts +0 -1
  43. package/dist/components/Dialog/index.d.ts +0 -2
  44. package/dist/components/Drawer/Drawer.d.ts +0 -9
  45. package/dist/components/Drawer/Drawer.types.d.ts +0 -74
  46. package/dist/components/Drawer/index.d.ts +0 -1
  47. package/dist/components/Dropdown/Dropdown.d.ts +0 -4
  48. package/dist/components/Dropdown/Dropdown.types.d.ts +0 -91
  49. package/dist/components/Dropdown/DropdownUtils.d.ts +0 -8
  50. package/dist/components/Dropdown/index.d.ts +0 -2
  51. package/dist/components/Filter/Filter.d.ts +0 -4
  52. package/dist/components/Filter/Filter.types.d.ts +0 -65
  53. package/dist/components/Filter/index.d.ts +0 -2
  54. package/dist/components/ListItem/ListItem.d.ts +0 -4
  55. package/dist/components/ListItem/ListItem.types.d.ts +0 -52
  56. package/dist/components/ListItem/index.d.ts +0 -2
  57. package/dist/components/Menu/Menu.d.ts +0 -4
  58. package/dist/components/Menu/Menu.types.d.ts +0 -90
  59. package/dist/components/Menu/__tests__/Menu.test.d.ts +0 -1
  60. package/dist/components/Menu/components/MenuItem.d.ts +0 -3
  61. package/dist/components/Menu/hooks/useMenuLogic.d.ts +0 -15
  62. package/dist/components/Menu/hooks/useSearchLogic.d.ts +0 -13
  63. package/dist/components/Menu/index.d.ts +0 -2
  64. package/dist/components/Popover/Popover.d.ts +0 -4
  65. package/dist/components/Popover/Popover.types.d.ts +0 -8
  66. package/dist/components/Popover/__test__/Popover.test.d.ts +0 -1
  67. package/dist/components/Popover/index.d.ts +0 -2
  68. package/dist/components/Quantity/Quantity.d.ts +0 -4
  69. package/dist/components/Quantity/Quantity.types.d.ts +0 -38
  70. package/dist/components/Quantity/index.d.ts +0 -2
  71. package/dist/components/Radio/Radio.d.ts +0 -4
  72. package/dist/components/Radio/Radio.types.d.ts +0 -52
  73. package/dist/components/Radio/__tests__/Radio.test.d.ts +0 -1
  74. package/dist/components/Radio/index.d.ts +0 -2
  75. package/dist/components/Search/Search.d.ts +0 -4
  76. package/dist/components/Search/Search.types.d.ts +0 -48
  77. package/dist/components/Search/__tests__/Search.test.d.ts +0 -1
  78. package/dist/components/Search/index.d.ts +0 -2
  79. package/dist/components/Select/Select.d.ts +0 -4
  80. package/dist/components/Select/Select.types.d.ts +0 -224
  81. package/dist/components/Select/__tests__/SelectRadix.test.d.ts +0 -1
  82. package/dist/components/Select/components/CheckboxSelectItem.d.ts +0 -4
  83. package/dist/components/Select/components/ExpandableSelectItem.d.ts +0 -11
  84. package/dist/components/Select/components/SelectItem.d.ts +0 -7
  85. package/dist/components/Select/hooks/useSelectLogic.d.ts +0 -3
  86. package/dist/components/Select/index.d.ts +0 -5
  87. package/dist/components/Switch/Switch.d.ts +0 -4
  88. package/dist/components/Switch/Switch.types.d.ts +0 -32
  89. package/dist/components/Switch/__tests__/Switch.test.d.ts +0 -1
  90. package/dist/components/Switch/index.d.ts +0 -2
  91. package/dist/components/Table/EmptyRows150Color.d.ts +0 -8
  92. package/dist/components/Table/LoaderList.d.ts +0 -10
  93. package/dist/components/Table/MultiLineText/MultiLineText.d.ts +0 -14
  94. package/dist/components/Table/MultiLineText/index.d.ts +0 -2
  95. package/dist/components/Table/Table.d.ts +0 -3
  96. package/dist/components/Table/Table.types.d.ts +0 -70
  97. package/dist/components/Table/TableHeader.d.ts +0 -48
  98. package/dist/components/Table/TablePagination.d.ts +0 -13
  99. package/dist/components/Table/index.d.ts +0 -7
  100. package/dist/components/Table/utils/tableActions.d.ts +0 -21
  101. package/dist/components/TextField/TextField.d.ts +0 -4
  102. package/dist/components/TextField/TextField.types.d.ts +0 -69
  103. package/dist/components/TextField/__tests__/Textfield.test.d.ts +0 -1
  104. package/dist/components/TextField/index.d.ts +0 -2
  105. package/dist/components/TextField/utils/__tests__/validation.test.d.ts +0 -1
  106. package/dist/components/TextField/utils/index.d.ts +0 -2
  107. package/dist/components/TextField/utils/validation.d.ts +0 -8
  108. package/dist/components/Toast/Toast.d.ts +0 -34
  109. package/dist/components/Toast/Toast.types.d.ts +0 -57
  110. package/dist/components/Toast/__tests__/Toast.test.d.ts +0 -1
  111. package/dist/components/Toast/components/ToastContainer.d.ts +0 -22
  112. package/dist/components/Toast/components/ToastProvider.d.ts +0 -35
  113. package/dist/components/Toast/index.d.ts +0 -5
  114. package/dist/components/Tooltip/Tooltip.d.ts +0 -4
  115. package/dist/components/Tooltip/Tooltip.types.d.ts +0 -14
  116. package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
  117. package/dist/components/Tooltip/index.d.ts +0 -2
  118. package/dist/components/VerificationCode/VerificationCode.d.ts +0 -20
  119. package/dist/components/VerificationCode/VerificationCode.types.d.ts +0 -39
  120. package/dist/components/VerificationCode/index.d.ts +0 -2
  121. package/dist/components/index.d.ts +0 -59
  122. package/dist/contexts/ToastContext.d.ts +0 -43
  123. package/dist/hooks/ApiSimulation.d.ts +0 -53
  124. package/dist/hooks/InfiniteScroll.d.ts +0 -41
  125. package/dist/hooks/NormalizeText.d.ts +0 -1
  126. package/dist/hooks/useToast.d.ts +0 -46
  127. package/dist/shared/Label/index.d.ts +0 -15
  128. package/dist/shared/icons/CheckHalf.d.ts +0 -10
  129. package/dist/shared/icons/CheckSmall.d.ts +0 -10
  130. package/dist/shared/icons/index.d.ts +0 -4
  131. package/dist/types/common.types.d.ts +0 -12
  132. package/dist/types/index.d.ts +0 -1
@@ -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 +0,0 @@
1
- export {};
@@ -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 +0,0 @@
1
- export {};
@@ -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';
@@ -1,59 +0,0 @@
1
- export { default as Avatar } from './Avatar';
2
- export { type AvatarProps } from './Avatar/Avatar.types';
3
- export { default as Badge } from './Badge';
4
- export { type BadgeProps } from './Badge/Badge.types';
5
- export { default as Button } from './Button';
6
- export { type ButtonProps } from './Button/Button.types';
7
- export { default as Calendar } from './Calendar';
8
- export { type CalendarProps } from './Calendar/Calendar.types';
9
- export { default as Callout } from './Callout';
10
- export { type CalloutProps } from './Callout/Callout.types';
11
- export { default as Checkbox } from './Checkbox';
12
- export { type CheckboxProps } from './Checkbox/Checkbox.types';
13
- export { default as Chips } from './Chips';
14
- export { type ChipsProps } from './Chips/Chips.types';
15
- export { default as Container } from './Container/Container';
16
- export { type ContainerProps } from './Container/Container.types';
17
- export { default as DatePicker } from './DatePicker';
18
- export { type DatePickerProps } from './DatePicker/DatePicker.types';
19
- export { default as Dialog } from './Dialog';
20
- export { type DialogProps } from './Dialog/Dialog.types';
21
- export { default as Drawer } from './Drawer';
22
- export { type DrawerProps } from './Drawer/Drawer.types';
23
- export { default as Dropdown } from './Dropdown';
24
- export { type DropdownProps, type DropdownItem, type DropdownType } from './Dropdown/Dropdown.types';
25
- export { default as Filter } from './Filter';
26
- export { type FilterProps } from './Filter/Filter.types';
27
- export { default as ListItem } from './ListItem';
28
- export { type ListItemProps } from './ListItem/ListItem.types';
29
- export { default as Menu } from './Menu';
30
- export { type MenuProps } from './Menu/Menu.types';
31
- export { default as Popover } from './Popover';
32
- export { type PopoverProps } from './Popover/Popover.types';
33
- export { default as Quantity } from './Quantity';
34
- export { type QuantityProps } from './Quantity/Quantity.types';
35
- export { default as Radio } from './Radio';
36
- export { type RadioGroupProps, type RadioProps } from './Radio/Radio.types';
37
- export { default as Search } from './Search';
38
- export { type SearchProps } from './Search/Search.types';
39
- export { default as Select } from './Select';
40
- export { type SelectProps } from './Select/Select.types';
41
- export { default as Table } from './Table';
42
- export { default as TableHeader } from './Table/TableHeader';
43
- export { default as TablePagination } from './Table/TablePagination';
44
- export { type TableProps } from './Table/Table.types';
45
- export { type TablePaginationProps } from './Table/TablePagination';
46
- export { type TableHeaderProps, type FilterItem } from './Table/TableHeader';
47
- export { default as TextField } from './TextField';
48
- export { type TextFieldProps } from './TextField/TextField.types';
49
- export { Toast, ToastProvider, ToastContainer, useToast } from './Toast';
50
- export { type ToastProps } from './Toast/Toast.types';
51
- export { default as Tooltip } from './Tooltip';
52
- export { type TooltipProps } from './Tooltip/Tooltip.types';
53
- export { default as Switch } from './Switch';
54
- export { type SwitchProps } from './Switch/Switch.types';
55
- export { default as VerificationCode } from './VerificationCode';
56
- export { type VerificationCodeProps } from './VerificationCode/VerificationCode.types';
57
- export { default as useApiSimulation } from '../hooks/ApiSimulation';
58
- export { useInfiniteScroll } from '../hooks/InfiniteScroll';
59
- export { normalizeText } from '../hooks/NormalizeText';
@@ -1,43 +0,0 @@
1
- import * as React from 'react';
2
- import { ToastProps } from '../components/Toast/Toast.types';
3
- /**
4
- * Valor disponibilizado pelo contexto do sistema de Toast.
5
- *
6
- * Acessível via `useToast()` em componentes filhos do `ToastProvider`.
7
- *
8
- * @see {@link useToast}
9
- */
10
- export interface ToastContextValue {
11
- /** Lista de toasts atualmente visíveis na tela. */
12
- toasts: ToastProps[];
13
- /**
14
- * Exibe um novo toast na tela.
15
- *
16
- * Gera um `id` único automaticamente e adiciona o toast à fila.
17
- * Quando o limite de `maxToasts` é atingido, o toast mais antigo é removido.
18
- *
19
- * @param toast - Propriedades do toast a ser exibido (sem `id`).
20
- */
21
- showToast: (toast: Omit<ToastProps, 'id'>) => void;
22
- /**
23
- * Remove um toast específico da tela pelo seu `id`.
24
- *
25
- * @remarks
26
- * Geralmente não é necessário chamar este método manualmente, pois os toasts
27
- * se fecham automaticamente (via `duration`) ou pelo botão de fechar do usuário.
28
- *
29
- * @param id - ID único do toast a ser removido.
30
- */
31
- dismissToast: (id: string) => void;
32
- }
33
- /**
34
- * Contexto React que armazena o estado e as ações do sistema de Toast.
35
- *
36
- * @remarks
37
- * Não consuma este contexto diretamente. Utilize o hook `useToast()` para
38
- * acessar as funcionalidades de forma segura e com verificação de provider.
39
- *
40
- * @see {@link ToastContextValue}
41
- * @see {@link useToast}
42
- */
43
- export declare const ToastContext: React.Context<ToastContextValue | undefined>;
@@ -1,53 +0,0 @@
1
- /**
2
- * Configurações para simulação de API
3
- */
4
- export interface ApiSimulationConfig {
5
- /** Items por página */
6
- itemsPerPage?: number;
7
- /** Total de items no dataset */
8
- totalItems?: number;
9
- /** Delay em ms para simular latência */
10
- delay?: number;
11
- /** Taxa de erro (0-1) para simular falhas */
12
- errorRate?: number;
13
- /** Função geradora de items customizada */
14
- itemGenerator?: (index: number, searchQuery?: string) => any;
15
- /** Debug mode */
16
- debug?: boolean;
17
- }
18
- /**
19
- * Estado da simulação de API
20
- */
21
- export interface ApiSimulationState<T> {
22
- /** Items carregados */
23
- items: T[];
24
- /** Página atual */
25
- currentPage: number;
26
- /** Total de páginas */
27
- totalPages: number;
28
- /** Status do carregamento */
29
- status: 'idle' | 'loading' | 'succeeded' | 'failed';
30
- /** Erro atual (se houver) */
31
- error: string | null;
32
- /** Query de busca atual */
33
- searchQuery: string;
34
- /** Se há próxima página */
35
- hasNextPage: boolean;
36
- /** Se é a primeira página */
37
- isFirstPage: boolean;
38
- }
39
- export interface ApiSimulationActions {
40
- /** Carregar próxima página */
41
- loadNextPage: () => Promise<void>;
42
- /** Realizar nova busca */
43
- search: (query: string) => Promise<void>;
44
- /** Reset completo */
45
- reset: () => void;
46
- /** Retry da última operação */
47
- retry: () => Promise<void>;
48
- }
49
- export interface UseApiSimulationReturn<T> extends ApiSimulationState<T> {
50
- actions: ApiSimulationActions;
51
- }
52
- export declare function useApiSimulation<T = any>(config?: ApiSimulationConfig): UseApiSimulationReturn<T>;
53
- export default useApiSimulation;
@@ -1,41 +0,0 @@
1
- /**
2
- * Props para o hook useInfiniteScroll
3
- */
4
- interface UseInfiniteScrollProps {
5
- /** Status atual do carregamento */
6
- status: 'idle' | 'loading' | 'succeeded' | 'failed';
7
- /** Página atual */
8
- page: number;
9
- /** Última página disponível */
10
- lastPage: number;
11
- /** Callback para carregar próxima página */
12
- onLoadMore: () => void;
13
- /** Threshold para IntersectionObserver (0-1) */
14
- threshold?: number;
15
- /** Margem raiz para IntersectionObserver */
16
- rootMargin?: string;
17
- /** Habilita/desabilita o hook */
18
- enabled?: boolean;
19
- /** Debug mode - logs no console */
20
- debug?: boolean;
21
- }
22
- /**
23
- * Retorno do hook useInfiniteScroll
24
- */
25
- interface UseInfiniteScrollReturn {
26
- /** Ref para o elemento observador */
27
- observerRef: React.RefObject<HTMLDivElement | null>;
28
- /** Se o elemento está visível */
29
- isIntersecting: boolean;
30
- /** Se há próxima página */
31
- hasNextPage: boolean;
32
- /** Se todas as páginas foram carregadas */
33
- isCompleted: boolean;
34
- /** Função para reset manual */
35
- reset: () => void;
36
- }
37
- /**
38
- * Hook otimizado para scroll infinito usando IntersectionObserver
39
- */
40
- export declare function useInfiniteScroll({ status, page, lastPage, onLoadMore, threshold, rootMargin, enabled, debug }: UseInfiniteScrollProps): UseInfiniteScrollReturn;
41
- export {};
@@ -1 +0,0 @@
1
- export declare const normalizeText: (text: React.ReactNode) => string;
@@ -1,46 +0,0 @@
1
- import { ToastProps } from '../components/Toast/Toast.types';
2
- /**
3
- * Hook interno que acessa o `ToastContext` diretamente.
4
- *
5
- * @throws {Error} Lança um erro se utilizado fora de um `ToastProvider`:
6
- * *"useToastContext deve ser usado dentro de ToastProvider"*
7
- *
8
- * @returns O valor completo do contexto — `toasts`, `showToast` e `dismissToast`.
9
- *
10
- * @internal
11
- */
12
- export declare const useToastContext: () => import("../contexts/ToastContext").ToastContextValue;
13
- /**
14
- * Hook para exibir e remover toasts na aplicação.
15
- *
16
- * O componente que usa este hook deve ser filho de um `ToastProvider`.
17
- *
18
- * @throws {Error} Lança um erro se utilizado fora de um `ToastProvider`:
19
- * *"useToastContext deve ser usado dentro de ToastProvider"*
20
- *
21
- * @returns Objeto com os métodos `showToast` e `dismissToast`.
22
- *
23
- * @example
24
- * ```tsx
25
- * import { useToast } from '@giro-ds/react';
26
- *
27
- * function MeuComponente() {
28
- * const { showToast } = useToast();
29
- *
30
- * const handleSalvar = async () => {
31
- * try {
32
- * await salvarDados();
33
- * showToast({ title: 'Sucesso!', iconType: 'Success', duration: 3000 });
34
- * } catch (err) {
35
- * showToast({ title: 'Erro ao salvar', iconType: 'Alert', automaticClose: false });
36
- * }
37
- * };
38
- *
39
- * return <button onClick={handleSalvar}>Salvar</button>;
40
- * }
41
- * ```
42
- */
43
- export declare const useToast: () => {
44
- showToast: (toast: Omit<ToastProps, "id">) => void;
45
- dismissToast: (id: string) => void;
46
- };
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- interface LabelProps {
3
- children: React.ReactNode;
4
- htmlFor: string;
5
- required?: boolean;
6
- className?: string;
7
- tooltipText?: string;
8
- tooltip?: boolean;
9
- side?: "top" | "right" | "bottom" | "left";
10
- align?: "start" | "center" | "end";
11
- error?: boolean;
12
- disabled?: boolean;
13
- }
14
- declare const LabelComponent: ({ children, htmlFor, required, tooltip, tooltipText, side, align, className, error, disabled }: LabelProps) => import("react/jsx-runtime").JSX.Element;
15
- export default LabelComponent;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface CheckHalfProps {
3
- className?: string;
4
- width?: number | string;
5
- height?: number | string;
6
- fill?: string;
7
- [key: string]: any;
8
- }
9
- declare const CheckHalf: React.FC<CheckHalfProps>;
10
- export default CheckHalf;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface CheckSmallProps {
3
- className?: string;
4
- width?: number | string;
5
- height?: number | string;
6
- fill?: string;
7
- [key: string]: any;
8
- }
9
- declare const CheckSmall: React.FC<CheckSmallProps>;
10
- export default CheckSmall;
@@ -1,4 +0,0 @@
1
- export { default as CheckSmall } from './CheckSmall';
2
- export { default as CheckHalf } from './CheckHalf';
3
- export type { CheckSmallProps } from './CheckSmall';
4
- export type { CheckHalfProps } from './CheckHalf';
@@ -1,12 +0,0 @@
1
- export type Size = 'sm' | 'lg';
2
- export type Variant = 'filled' | 'outlined' | 'text';
3
- export type TextVariant = 'neutral' | 'brand' | 'color' | 'success' | 'alert';
4
- export type Side = 'top' | 'right' | 'bottom' | 'left';
5
- export type Align = 'start' | 'center' | 'end';
6
- export type Position = 'right' | 'left' | 'both';
7
- export type Locale = 'pt-br' | 'en-us';
8
- export interface BaseProps {
9
- id?: string;
10
- className?: string;
11
- disabled?: boolean;
12
- }
@@ -1 +0,0 @@
1
- export type * from './common.types';