@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.
- package/dist/index.cjs +429 -703
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +117 -171
- package/dist/index.esm.js +431 -705
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -4
- package/dist/components/Avatar/Avatar.types.d.ts +0 -23
- package/dist/components/Avatar/__tests__/Avatar.test.d.ts +0 -1
- package/dist/components/Avatar/index.d.ts +0 -2
- package/dist/components/Badge/Badge.d.ts +0 -4
- package/dist/components/Badge/Badge.types.d.ts +0 -37
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -4
- package/dist/components/Button/Button.types.d.ts +0 -62
- package/dist/components/Button/__tests__/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Calendar/Calendar.d.ts +0 -3
- package/dist/components/Calendar/Calendar.types.d.ts +0 -109
- package/dist/components/Calendar/__tests__/Calendar.test.d.ts +0 -1
- package/dist/components/Calendar/index.d.ts +0 -1
- package/dist/components/Callout/Callout.d.ts +0 -4
- package/dist/components/Callout/Callout.types.d.ts +0 -34
- package/dist/components/Callout/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -4
- package/dist/components/Checkbox/Checkbox.types.d.ts +0 -34
- package/dist/components/Checkbox/__tests__/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/Chips/Chips.d.ts +0 -4
- package/dist/components/Chips/Chips.types.d.ts +0 -34
- package/dist/components/Chips/index.d.ts +0 -1
- package/dist/components/Container/Container.d.ts +0 -2
- package/dist/components/Container/Container.types.d.ts +0 -15
- package/dist/components/Container/__tests__/Container.test.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.d.ts +0 -4
- package/dist/components/DatePicker/DatePicker.types.d.ts +0 -50
- package/dist/components/DatePicker/DateUtils.d.ts +0 -23
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/Dialog/Dialog.d.ts +0 -4
- package/dist/components/Dialog/Dialog.types.d.ts +0 -28
- package/dist/components/Dialog/__tests__/Dialog.test.d.ts +0 -1
- package/dist/components/Dialog/index.d.ts +0 -2
- package/dist/components/Drawer/Drawer.d.ts +0 -9
- package/dist/components/Drawer/Drawer.types.d.ts +0 -74
- package/dist/components/Drawer/index.d.ts +0 -1
- package/dist/components/Dropdown/Dropdown.d.ts +0 -4
- package/dist/components/Dropdown/Dropdown.types.d.ts +0 -91
- package/dist/components/Dropdown/DropdownUtils.d.ts +0 -8
- package/dist/components/Dropdown/index.d.ts +0 -2
- package/dist/components/Filter/Filter.d.ts +0 -4
- package/dist/components/Filter/Filter.types.d.ts +0 -65
- package/dist/components/Filter/index.d.ts +0 -2
- package/dist/components/ListItem/ListItem.d.ts +0 -4
- package/dist/components/ListItem/ListItem.types.d.ts +0 -52
- package/dist/components/ListItem/index.d.ts +0 -2
- package/dist/components/Menu/Menu.d.ts +0 -4
- package/dist/components/Menu/Menu.types.d.ts +0 -90
- package/dist/components/Menu/__tests__/Menu.test.d.ts +0 -1
- package/dist/components/Menu/components/MenuItem.d.ts +0 -3
- package/dist/components/Menu/hooks/useMenuLogic.d.ts +0 -15
- package/dist/components/Menu/hooks/useSearchLogic.d.ts +0 -13
- package/dist/components/Menu/index.d.ts +0 -2
- package/dist/components/Popover/Popover.d.ts +0 -4
- package/dist/components/Popover/Popover.types.d.ts +0 -8
- package/dist/components/Popover/__test__/Popover.test.d.ts +0 -1
- package/dist/components/Popover/index.d.ts +0 -2
- package/dist/components/Quantity/Quantity.d.ts +0 -4
- package/dist/components/Quantity/Quantity.types.d.ts +0 -38
- package/dist/components/Quantity/index.d.ts +0 -2
- package/dist/components/Radio/Radio.d.ts +0 -4
- package/dist/components/Radio/Radio.types.d.ts +0 -52
- package/dist/components/Radio/__tests__/Radio.test.d.ts +0 -1
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Search/Search.d.ts +0 -4
- package/dist/components/Search/Search.types.d.ts +0 -48
- package/dist/components/Search/__tests__/Search.test.d.ts +0 -1
- package/dist/components/Search/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -4
- package/dist/components/Select/Select.types.d.ts +0 -224
- package/dist/components/Select/__tests__/SelectRadix.test.d.ts +0 -1
- package/dist/components/Select/components/CheckboxSelectItem.d.ts +0 -4
- package/dist/components/Select/components/ExpandableSelectItem.d.ts +0 -11
- package/dist/components/Select/components/SelectItem.d.ts +0 -7
- package/dist/components/Select/hooks/useSelectLogic.d.ts +0 -3
- package/dist/components/Select/index.d.ts +0 -5
- package/dist/components/Switch/Switch.d.ts +0 -4
- package/dist/components/Switch/Switch.types.d.ts +0 -32
- package/dist/components/Switch/__tests__/Switch.test.d.ts +0 -1
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Table/EmptyRows150Color.d.ts +0 -8
- package/dist/components/Table/LoaderList.d.ts +0 -10
- package/dist/components/Table/MultiLineText/MultiLineText.d.ts +0 -14
- package/dist/components/Table/MultiLineText/index.d.ts +0 -2
- package/dist/components/Table/Table.d.ts +0 -3
- package/dist/components/Table/Table.types.d.ts +0 -70
- package/dist/components/Table/TableHeader.d.ts +0 -48
- package/dist/components/Table/TablePagination.d.ts +0 -13
- package/dist/components/Table/index.d.ts +0 -7
- package/dist/components/Table/utils/tableActions.d.ts +0 -21
- package/dist/components/TextField/TextField.d.ts +0 -4
- package/dist/components/TextField/TextField.types.d.ts +0 -69
- package/dist/components/TextField/__tests__/Textfield.test.d.ts +0 -1
- package/dist/components/TextField/index.d.ts +0 -2
- package/dist/components/TextField/utils/__tests__/validation.test.d.ts +0 -1
- package/dist/components/TextField/utils/index.d.ts +0 -2
- package/dist/components/TextField/utils/validation.d.ts +0 -8
- package/dist/components/Toast/Toast.d.ts +0 -34
- package/dist/components/Toast/Toast.types.d.ts +0 -57
- package/dist/components/Toast/__tests__/Toast.test.d.ts +0 -1
- package/dist/components/Toast/components/ToastContainer.d.ts +0 -22
- package/dist/components/Toast/components/ToastProvider.d.ts +0 -35
- package/dist/components/Toast/index.d.ts +0 -5
- package/dist/components/Tooltip/Tooltip.d.ts +0 -4
- package/dist/components/Tooltip/Tooltip.types.d.ts +0 -14
- package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/VerificationCode/VerificationCode.d.ts +0 -20
- package/dist/components/VerificationCode/VerificationCode.types.d.ts +0 -39
- package/dist/components/VerificationCode/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -59
- package/dist/contexts/ToastContext.d.ts +0 -43
- package/dist/hooks/ApiSimulation.d.ts +0 -53
- package/dist/hooks/InfiniteScroll.d.ts +0 -41
- package/dist/hooks/NormalizeText.d.ts +0 -1
- package/dist/hooks/useToast.d.ts +0 -46
- package/dist/shared/Label/index.d.ts +0 -15
- package/dist/shared/icons/CheckHalf.d.ts +0 -10
- package/dist/shared/icons/CheckSmall.d.ts +0 -10
- package/dist/shared/icons/index.d.ts +0 -4
- package/dist/types/common.types.d.ts +0 -12
- package/dist/types/index.d.ts +0 -1
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { Side, Align, BaseProps } from '../../types/common.types';
|
|
4
|
-
/**
|
|
5
|
-
* Representa um item do select
|
|
6
|
-
*/
|
|
7
|
-
export interface SelectItemProps extends BaseProps {
|
|
8
|
-
/** Texto principal do item */
|
|
9
|
-
text: ReactNode;
|
|
10
|
-
/** Subtítulo ou descrição do item */
|
|
11
|
-
subTitle?: ReactNode;
|
|
12
|
-
/** Ícone do item */
|
|
13
|
-
icon?: ReactNode;
|
|
14
|
-
/** Valor do item */
|
|
15
|
-
value: string;
|
|
16
|
-
/** Define se o item está selecionado */
|
|
17
|
-
selected?: boolean;
|
|
18
|
-
/** Subitens do select (para selects aninhados) */
|
|
19
|
-
children?: SelectItemProps[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Props de um item com checkbox
|
|
23
|
-
*/
|
|
24
|
-
export interface CheckboxItemProps extends SelectItemProps {
|
|
25
|
-
/** Estado de checked do checkbox */
|
|
26
|
-
checked: boolean;
|
|
27
|
-
/** Callback executado quando o estado muda: (checked) => void */
|
|
28
|
-
onCheckedChange: (checked: boolean) => void;
|
|
29
|
-
}
|
|
30
|
-
/** Variantes disponíveis para o Select */
|
|
31
|
-
export type SelectVariant = 'text' | 'icon' | 'checkbox';
|
|
32
|
-
/**
|
|
33
|
-
* Props do componente Select
|
|
34
|
-
* @example
|
|
35
|
-
* ```tsx
|
|
36
|
-
* <Select
|
|
37
|
-
* items={[
|
|
38
|
-
* { value: '1', text: 'Opção 1' },
|
|
39
|
-
* { value: '2', text: 'Opção 2' }
|
|
40
|
-
* ]}
|
|
41
|
-
* variant="text"
|
|
42
|
-
* placeholder="Selecione uma opção"
|
|
43
|
-
* onValueChange={(value) => console.log(value)}
|
|
44
|
-
* />
|
|
45
|
-
* ```
|
|
46
|
-
* @example
|
|
47
|
-
* ```tsx
|
|
48
|
-
* <Select
|
|
49
|
-
* items={options}
|
|
50
|
-
* variant="checkbox"
|
|
51
|
-
* multiple={true}
|
|
52
|
-
* search={true}
|
|
53
|
-
* label="Selecione múltiplas opções"
|
|
54
|
-
* helperText="Você pode selecionar mais de uma"
|
|
55
|
-
* required={true}
|
|
56
|
-
* />
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export interface SelectProps extends BaseProps {
|
|
60
|
-
/** Array de itens do select */
|
|
61
|
-
items: SelectItemProps[];
|
|
62
|
-
/** Callback executado quando o valor muda: (value) => void */
|
|
63
|
-
onValueChange?: (value: string | string[]) => void;
|
|
64
|
-
/** Callback executado quando o select abre/fecha: (open) => void */
|
|
65
|
-
onOpenChange?: (open: boolean) => void;
|
|
66
|
-
/** Variante visual do select */
|
|
67
|
-
variant: SelectVariant;
|
|
68
|
-
/** Define se o campo é obrigatório */
|
|
69
|
-
required?: boolean;
|
|
70
|
-
/** Valor(es) selecionado(s) */
|
|
71
|
-
value?: string | string[];
|
|
72
|
-
/** Habilita seleção múltipla */
|
|
73
|
-
multiple?: boolean;
|
|
74
|
-
/** Placeholder do campo */
|
|
75
|
-
placeholder?: string;
|
|
76
|
-
/** Habilita campo de busca */
|
|
77
|
-
search?: boolean;
|
|
78
|
-
/** Label do campo */
|
|
79
|
-
label?: string;
|
|
80
|
-
/** Texto de ajuda exibido abaixo do campo */
|
|
81
|
-
helperText?: string;
|
|
82
|
-
/** Largura máxima do select */
|
|
83
|
-
maxWidth?: number;
|
|
84
|
-
/** Mensagem de erro a ser exibida */
|
|
85
|
-
errorMessage?: string;
|
|
86
|
-
/** Label acessível para leitores de tela */
|
|
87
|
-
'aria-label'?: string;
|
|
88
|
-
/** ID para testes automatizados */
|
|
89
|
-
'data-testid'?: string;
|
|
90
|
-
/** Habilita tooltip */
|
|
91
|
-
tooltip?: boolean;
|
|
92
|
-
/** Texto do tooltip */
|
|
93
|
-
tooltipText?: string;
|
|
94
|
-
/** Lado onde o dropdown abre */
|
|
95
|
-
side?: Side;
|
|
96
|
-
/** Alinhamento do dropdown */
|
|
97
|
-
align?: Align;
|
|
98
|
-
/** Habilita scroll infinito */
|
|
99
|
-
enableInfiniteScroll?: boolean;
|
|
100
|
-
/** Callback executado ao chegar ao final do scroll: () => void */
|
|
101
|
-
onScrollEnd?: () => void;
|
|
102
|
-
/** Estado de carregamento de mais itens */
|
|
103
|
-
isLoadingMore?: boolean;
|
|
104
|
-
/** Habilita busca via API */
|
|
105
|
-
enableApiSearch?: boolean;
|
|
106
|
-
/** Callback executado na busca via API: (term) => void */
|
|
107
|
-
onApiSearch?: (term: string) => void;
|
|
108
|
-
/** Estado de busca em andamento */
|
|
109
|
-
isSearching?: boolean;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Estado interno do componente Select
|
|
113
|
-
*/
|
|
114
|
-
export interface SelectState {
|
|
115
|
-
/** Define se o select está aberto */
|
|
116
|
-
isOpen: boolean;
|
|
117
|
-
/** Valores selecionados */
|
|
118
|
-
selectedValues: string[];
|
|
119
|
-
/** Texto digitado no campo de busca */
|
|
120
|
-
searchInput: string;
|
|
121
|
-
/** Termo de busca aplicado */
|
|
122
|
-
searchTerm: string;
|
|
123
|
-
/** Define se o campo foi tocado */
|
|
124
|
-
touched: boolean;
|
|
125
|
-
/** Define se há erro de validação */
|
|
126
|
-
hasError: boolean;
|
|
127
|
-
}
|
|
128
|
-
/** Ações disponíveis para o reducer do Select */
|
|
129
|
-
export type SelectAction = {
|
|
130
|
-
type: 'SET_OPEN';
|
|
131
|
-
payload: boolean;
|
|
132
|
-
} | {
|
|
133
|
-
type: 'SET_SELECTED_VALUES';
|
|
134
|
-
payload: string[];
|
|
135
|
-
} | {
|
|
136
|
-
type: 'SET_SEARCH_INPUT';
|
|
137
|
-
payload: string;
|
|
138
|
-
} | {
|
|
139
|
-
type: 'SET_SEARCH_TERM';
|
|
140
|
-
payload: string;
|
|
141
|
-
} | {
|
|
142
|
-
type: 'SET_TOUCHED';
|
|
143
|
-
payload: boolean;
|
|
144
|
-
} | {
|
|
145
|
-
type: 'SET_ERROR';
|
|
146
|
-
payload: boolean;
|
|
147
|
-
} | {
|
|
148
|
-
type: 'RESET_SEARCH';
|
|
149
|
-
} | {
|
|
150
|
-
type: 'VALIDATE';
|
|
151
|
-
payload: {
|
|
152
|
-
required: boolean;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Props do hook useSelectLogic
|
|
157
|
-
*/
|
|
158
|
-
export interface UseSelectLogicProps {
|
|
159
|
-
/** Valor(es) controlado(s) */
|
|
160
|
-
value?: string | string[];
|
|
161
|
-
/** Define se o campo é obrigatório */
|
|
162
|
-
required?: boolean;
|
|
163
|
-
/** Habilita busca */
|
|
164
|
-
search?: boolean;
|
|
165
|
-
/** Callback executado quando o valor muda: (value) => void */
|
|
166
|
-
onValueChange?: (value: string | string[]) => void;
|
|
167
|
-
/** Callback executado quando o select abre/fecha: (open) => void */
|
|
168
|
-
onOpenChange?: (open: boolean) => void;
|
|
169
|
-
/** Habilita busca via API */
|
|
170
|
-
enableApiSearch?: boolean;
|
|
171
|
-
/** Callback executado na busca via API: (term) => void */
|
|
172
|
-
onApiSearch?: (term: string) => void;
|
|
173
|
-
/** Estado de busca em andamento */
|
|
174
|
-
isSearching?: boolean;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Retorno do hook useSelectLogic
|
|
178
|
-
*/
|
|
179
|
-
export interface UseSelectLogicReturn {
|
|
180
|
-
/** Estado atual do select */
|
|
181
|
-
state: SelectState;
|
|
182
|
-
/** Ações disponíveis */
|
|
183
|
-
actions: {
|
|
184
|
-
/** Define se o select está aberto */
|
|
185
|
-
setOpen: (open: boolean) => void;
|
|
186
|
-
/** Define os valores selecionados */
|
|
187
|
-
setSelectedValues: (values: string[]) => void;
|
|
188
|
-
/** Define o texto de busca */
|
|
189
|
-
setSearchInput: (input: string) => void;
|
|
190
|
-
/** Define o termo de busca aplicado */
|
|
191
|
-
setSearchTerm: (term: string) => void;
|
|
192
|
-
/** Define se o campo foi tocado */
|
|
193
|
-
setTouched: (touched: boolean) => void;
|
|
194
|
-
/** Define se há erro */
|
|
195
|
-
setError: (error: boolean) => void;
|
|
196
|
-
/** Reseta a busca */
|
|
197
|
-
resetSearch: () => void;
|
|
198
|
-
/** Valida o campo */
|
|
199
|
-
validate: () => void;
|
|
200
|
-
/** Manipula seleção simples */
|
|
201
|
-
handleSingleSelect: (value: string) => void;
|
|
202
|
-
/** Manipula seleção múltipla */
|
|
203
|
-
handleMultipleSelect: (value: string, checked: boolean) => void;
|
|
204
|
-
};
|
|
205
|
-
/** Valores computados */
|
|
206
|
-
computed: {
|
|
207
|
-
/** Texto a ser exibido no campo */
|
|
208
|
-
displayText: string;
|
|
209
|
-
/** Itens filtrados pela busca */
|
|
210
|
-
filteredItems: SelectItemProps[];
|
|
211
|
-
};
|
|
212
|
-
/** Referências */
|
|
213
|
-
refs: {
|
|
214
|
-
/** Referência do input de busca */
|
|
215
|
-
searchInputRef: React.RefObject<HTMLInputElement | null>;
|
|
216
|
-
};
|
|
217
|
-
/** Funções utilitárias */
|
|
218
|
-
utils: {
|
|
219
|
-
/** Obtém o texto a ser exibido */
|
|
220
|
-
getDisplayText: (selectedValues: string[], placeholder: string, variant: string, items: SelectItemProps[]) => string;
|
|
221
|
-
/** Filtra os itens pela busca */
|
|
222
|
-
getFilteredItems: (items: SelectItemProps[], searchTerm: string) => SelectItemProps[];
|
|
223
|
-
};
|
|
224
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SelectItemProps, SelectVariant } from '../Select.types';
|
|
3
|
-
interface ExpandableSelectItemProps {
|
|
4
|
-
item: SelectItemProps;
|
|
5
|
-
variant: SelectVariant;
|
|
6
|
-
onSelect: (value: string) => void;
|
|
7
|
-
selectedValues: string[];
|
|
8
|
-
level?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const ExpandableSelectItem: React.FC<ExpandableSelectItemProps>;
|
|
11
|
-
export default ExpandableSelectItem;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectItemProps, SelectVariant } from '../Select.types';
|
|
3
|
-
interface SelectItemComponentProps extends SelectItemProps {
|
|
4
|
-
variant?: SelectVariant;
|
|
5
|
-
}
|
|
6
|
-
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemComponentProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export default SelectItem;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { UseSelectLogicProps, UseSelectLogicReturn } from '../Select.types';
|
|
2
|
-
export declare function useSelectLogic({ value, required, search, onValueChange, onOpenChange, enableApiSearch, onApiSearch, isSearching, }: UseSelectLogicProps): UseSelectLogicReturn;
|
|
3
|
-
export default useSelectLogic;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default } from './Select';
|
|
2
|
-
export type { SelectProps, SelectItemProps, CheckboxItemProps, SelectVariant, SelectState, SelectAction, UseSelectLogicProps, UseSelectLogicReturn } from './Select.types';
|
|
3
|
-
export { useSelectLogic } from './hooks/useSelectLogic';
|
|
4
|
-
export { default as CheckboxSelectItem } from './components/CheckboxSelectItem';
|
|
5
|
-
export { default as SelectItem } from './components/SelectItem';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseProps } from '../../types/common.types';
|
|
2
|
-
/**
|
|
3
|
-
* Props do componente Switch
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* <Switch
|
|
7
|
-
* checked={isEnabled}
|
|
8
|
-
* onCheckedChange={setIsEnabled}
|
|
9
|
-
* />
|
|
10
|
-
* ```
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <Switch
|
|
14
|
-
* defaultChecked={true}
|
|
15
|
-
* disabled={isLoading}
|
|
16
|
-
* onCheckedChange={(checked) => console.log(checked)}
|
|
17
|
-
* name="notifications"
|
|
18
|
-
* />
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export interface SwitchProps extends BaseProps {
|
|
22
|
-
/** Estado inicial (modo não controlado) */
|
|
23
|
-
defaultChecked?: boolean;
|
|
24
|
-
/** Callback executado quando o estado muda: (checked) => void */
|
|
25
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
26
|
-
/** Nome do input */
|
|
27
|
-
name?: string;
|
|
28
|
-
/** Valor do input */
|
|
29
|
-
value?: string;
|
|
30
|
-
/** Estado atual (modo controlado) */
|
|
31
|
-
checked?: boolean;
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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,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,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DropdownItem } from '../Dropdown/Dropdown.types';
|
|
3
|
-
interface BaseFilterItem {
|
|
4
|
-
id?: string;
|
|
5
|
-
buttonText: string | React.ReactNode;
|
|
6
|
-
icon?: React.ReactElement;
|
|
7
|
-
position?: 'left' | 'right';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
onToggle?: (isOpen: boolean) => void;
|
|
10
|
-
tooltip?: string;
|
|
11
|
-
}
|
|
12
|
-
interface CheckboxFilterItem extends BaseFilterItem {
|
|
13
|
-
type: 'checkbox' | 'text' | 'icon';
|
|
14
|
-
items: DropdownItem[];
|
|
15
|
-
selectedIds?: string[];
|
|
16
|
-
onSelectionChange?: (selectedIds: string[]) => void;
|
|
17
|
-
placeholder?: string;
|
|
18
|
-
enableSearch?: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface CalendarFilterItem extends BaseFilterItem {
|
|
21
|
-
type: 'calendar';
|
|
22
|
-
selectedDate?: Date | null;
|
|
23
|
-
onDateSelect?: (date: Date) => void;
|
|
24
|
-
onClear?: () => void;
|
|
25
|
-
minDate?: Date;
|
|
26
|
-
maxDate?: Date;
|
|
27
|
-
locale?: string;
|
|
28
|
-
placeholder?: string;
|
|
29
|
-
}
|
|
30
|
-
export type FilterItem = CheckboxFilterItem | CalendarFilterItem;
|
|
31
|
-
declare const isCalendarFilter: (filter: FilterItem) => filter is CalendarFilterItem;
|
|
32
|
-
declare const isCheckboxFilter: (filter: FilterItem) => filter is CheckboxFilterItem;
|
|
33
|
-
export interface TableHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
34
|
-
searchValue?: string;
|
|
35
|
-
onSearchChange?: (value: string) => void;
|
|
36
|
-
searchPlaceholder?: string;
|
|
37
|
-
showSearch?: boolean;
|
|
38
|
-
showFilters?: boolean;
|
|
39
|
-
filters?: React.ReactNode;
|
|
40
|
-
filterItems?: FilterItem[];
|
|
41
|
-
className?: string;
|
|
42
|
-
onSearch?: (value: string) => void;
|
|
43
|
-
showClearSearch?: boolean;
|
|
44
|
-
}
|
|
45
|
-
declare const TableHeader: React.FC<TableHeaderProps>;
|
|
46
|
-
export type { CalendarFilterItem, CheckboxFilterItem };
|
|
47
|
-
export { isCalendarFilter, isCheckboxFilter };
|
|
48
|
-
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,69 +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
|
-
/** Mensagem de erro a ser exibida */
|
|
51
|
-
errorMessage?: string;
|
|
52
|
-
/** Ícone a ser exibido no campo */
|
|
53
|
-
icon?: React.ReactNode;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Parâmetros para validação do TextField
|
|
57
|
-
*/
|
|
58
|
-
export interface ValidationParams {
|
|
59
|
-
/** Valor a ser validado */
|
|
60
|
-
value: string;
|
|
61
|
-
/** Comprimento máximo permitido */
|
|
62
|
-
maxLength?: number;
|
|
63
|
-
/** Tipo do campo (influencia a validação) */
|
|
64
|
-
type?: TextFieldType;
|
|
65
|
-
/** Mensagem de erro customizada */
|
|
66
|
-
errorMessage?: string;
|
|
67
|
-
/** Define se o campo é obrigatório */
|
|
68
|
-
required?: boolean;
|
|
69
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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;
|