analytica-frontend-lib 1.0.87 → 1.0.89
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/CheckBox/CheckboxList/index.js +429 -0
- package/dist/CheckBox/CheckboxList/index.mjs +415 -0
- package/dist/Quiz/index.js +2 -2
- package/dist/Quiz/index.mjs +2 -2
- package/dist/index.css +4 -4
- package/dist/index.d.mts +2205 -0
- package/dist/index.d.ts +2205 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/styles.css +4 -4
- package/package.json +2 -2
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2205 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ElementType, ReactNode, ComponentPropsWithoutRef, ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, HtmlHTMLAttributes, ComponentType } from 'react';
|
|
4
|
+
import * as zustand from 'zustand';
|
|
5
|
+
import { StoreApi } from 'zustand';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Base text component props
|
|
9
|
+
*/
|
|
10
|
+
type BaseTextProps = {
|
|
11
|
+
/** Content to be displayed */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/** Text size variant */
|
|
14
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
|
|
15
|
+
/** Font weight variant */
|
|
16
|
+
weight?: 'hairline' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
|
|
17
|
+
/** Color variant - white for light backgrounds, black for dark backgrounds */
|
|
18
|
+
color?: string;
|
|
19
|
+
/** Additional CSS classes to apply */
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Polymorphic text component props that ensures type safety based on the 'as' prop
|
|
24
|
+
*/
|
|
25
|
+
type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
|
|
26
|
+
/** HTML tag to render */
|
|
27
|
+
as?: T;
|
|
28
|
+
} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;
|
|
29
|
+
/**
|
|
30
|
+
* Text component for Analytica Ensino platforms
|
|
31
|
+
*
|
|
32
|
+
* A flexible polymorphic text component with multiple sizes, weights, and colors.
|
|
33
|
+
* Automatically adapts to dark and light themes with full type safety.
|
|
34
|
+
*
|
|
35
|
+
* @param children - The content to display
|
|
36
|
+
* @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)
|
|
37
|
+
* @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)
|
|
38
|
+
* @param color - The color variant - adapts to theme
|
|
39
|
+
* @param as - The HTML tag to render - determines allowed attributes via TypeScript
|
|
40
|
+
* @param className - Additional CSS classes
|
|
41
|
+
* @param props - HTML attributes valid for the chosen tag only
|
|
42
|
+
* @returns A styled text element with type-safe attributes
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Text size="lg" weight="bold" color="text-info-800">
|
|
47
|
+
* This is a large, bold text
|
|
48
|
+
* </Text>
|
|
49
|
+
*
|
|
50
|
+
* <Text as="a" href="/link" target="_blank">
|
|
51
|
+
* Link with type-safe anchor attributes
|
|
52
|
+
* </Text>
|
|
53
|
+
*
|
|
54
|
+
* <Text as="button" onClick={handleClick} disabled>
|
|
55
|
+
* Button with type-safe button attributes
|
|
56
|
+
* </Text>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare const Text: <T extends ElementType = "p">({ children, size, weight, color, as, className, ...props }: TextProps<T>) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Button component props interface
|
|
63
|
+
*/
|
|
64
|
+
type ButtonProps = {
|
|
65
|
+
/** Content to be displayed inside the button */
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
/** Ícone à esquerda do texto */
|
|
68
|
+
iconLeft?: ReactNode;
|
|
69
|
+
/** Ícone à direita do texto */
|
|
70
|
+
iconRight?: ReactNode;
|
|
71
|
+
/** Size of the button */
|
|
72
|
+
size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
|
73
|
+
/** Visual variant of the button */
|
|
74
|
+
variant?: 'solid' | 'outline' | 'link';
|
|
75
|
+
/** Action type of the button */
|
|
76
|
+
action?: 'primary' | 'positive' | 'negative';
|
|
77
|
+
/** Additional CSS classes to apply */
|
|
78
|
+
className?: string;
|
|
79
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
80
|
+
/**
|
|
81
|
+
* Button component for Analytica Ensino platforms
|
|
82
|
+
*
|
|
83
|
+
* A flexible button component with multiple variants, sizes and actions.
|
|
84
|
+
*
|
|
85
|
+
* @param children - The content to display inside the button
|
|
86
|
+
* @param size - The size variant (extra-small, small, medium, large, extra-large)
|
|
87
|
+
* @param variant - The visual style variant (solid, outline, link)
|
|
88
|
+
* @param action - The action type (primary, positive, negative)
|
|
89
|
+
* @param className - Additional CSS classes
|
|
90
|
+
* @param props - All other standard button HTML attributes
|
|
91
|
+
* @returns A styled button element
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <Button variant="solid" action="primary" size="medium" onClick={() => console.log('clicked')}>
|
|
96
|
+
* Click me
|
|
97
|
+
* </Button>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
declare const Button: ({ children, iconLeft, iconRight, size, variant, action, className, disabled, type, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Badge component props interface
|
|
104
|
+
*/
|
|
105
|
+
type BadgeProps = {
|
|
106
|
+
/** Content to be displayed inside the badge */
|
|
107
|
+
children?: ReactNode;
|
|
108
|
+
/** Ícone à direita do texto */
|
|
109
|
+
iconRight?: ReactNode;
|
|
110
|
+
/** Ícone à esquerda do texto */
|
|
111
|
+
iconLeft?: ReactNode;
|
|
112
|
+
/** Size of the badge */
|
|
113
|
+
size?: 'small' | 'medium' | 'large';
|
|
114
|
+
/** Visual variant of the badge */
|
|
115
|
+
variant?: 'solid' | 'outlined' | 'exams' | 'examsOutlined' | 'resultStatus' | 'notification';
|
|
116
|
+
/** Action type of the badge */
|
|
117
|
+
action?: 'error' | 'warning' | 'success' | 'info' | 'muted' | 'exam1' | 'exam2' | 'exam3' | 'exam4' | 'positive' | 'negative';
|
|
118
|
+
/** Additional CSS classes to apply */
|
|
119
|
+
className?: string;
|
|
120
|
+
notificationActive?: boolean;
|
|
121
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
122
|
+
/**
|
|
123
|
+
* Badge component for Analytica Ensino platforms
|
|
124
|
+
*
|
|
125
|
+
* A flexible button component with multiple variants, sizes and actions.
|
|
126
|
+
*
|
|
127
|
+
* @param children - The content to display inside the badge
|
|
128
|
+
* @param size - The size variant (extra-small, small, medium, large, extra-large)
|
|
129
|
+
* @param variant - The visual style variant (solid, outline, link)
|
|
130
|
+
* @param action - The action type (primary, positive, negative)
|
|
131
|
+
* @param className - Additional CSS classes
|
|
132
|
+
* @param props - All other standard div HTML attributes
|
|
133
|
+
* @returns A styled badge element
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <Badge variant="solid" action="info" size="medium">
|
|
138
|
+
* Information
|
|
139
|
+
* </Badge>
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
declare const Badge: ({ children, iconLeft, iconRight, size, variant, action, className, notificationActive, ...props }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
143
|
+
|
|
144
|
+
type AlertProps = {
|
|
145
|
+
title?: string;
|
|
146
|
+
description: string;
|
|
147
|
+
variant?: 'solid' | 'outline';
|
|
148
|
+
action?: 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
149
|
+
className?: string;
|
|
150
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
151
|
+
declare const Alert: ({ variant, title, description, action, className, ...props }: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* IconButton component for Analytica Ensino platforms
|
|
155
|
+
*
|
|
156
|
+
* Um botão compacto apenas com ícone, ideal para menus dropdown,
|
|
157
|
+
* barras de ferramentas e ações secundárias.
|
|
158
|
+
* Oferece dois tamanhos com estilo consistente.
|
|
159
|
+
* Estado ativo permanece até ser clicado novamente ou outro botão ser ativado.
|
|
160
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
161
|
+
*
|
|
162
|
+
* @param icon - O ícone a ser exibido no botão
|
|
163
|
+
* @param size - Tamanho do botão (sm, md)
|
|
164
|
+
* @param active - Estado ativo/selecionado do botão
|
|
165
|
+
* @param className - Classes CSS adicionais
|
|
166
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
167
|
+
* @returns Um elemento button compacto estilizado apenas com ícone
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```tsx
|
|
171
|
+
* <IconButton
|
|
172
|
+
* icon={<MoreVerticalIcon />}
|
|
173
|
+
* size="sm"
|
|
174
|
+
* onClick={() => openMenu()}
|
|
175
|
+
* />
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```tsx
|
|
180
|
+
* // Botão ativo em uma barra de ferramentas - permanece ativo até outro clique
|
|
181
|
+
* <IconButton
|
|
182
|
+
* icon={<BoldIcon />}
|
|
183
|
+
* active={isBold}
|
|
184
|
+
* onClick={toggleBold}
|
|
185
|
+
* />
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* // Usando ref para controle programático
|
|
191
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
192
|
+
*
|
|
193
|
+
* <IconButton
|
|
194
|
+
* ref={buttonRef}
|
|
195
|
+
* icon={<EditIcon />}
|
|
196
|
+
* size="md"
|
|
197
|
+
* onClick={() => startEditing()}
|
|
198
|
+
* />
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare const IconButton: react.ForwardRefExoticComponent<{
|
|
202
|
+
/** Ícone a ser exibido no botão */
|
|
203
|
+
icon: ReactNode;
|
|
204
|
+
/** Tamanho do botão */
|
|
205
|
+
size?: "sm" | "md";
|
|
206
|
+
/** Estado de seleção/ativo do botão - permanece ativo até ser clicado novamente ou outro botão ser ativado */
|
|
207
|
+
active?: boolean;
|
|
208
|
+
/** Additional CSS classes to apply */
|
|
209
|
+
className?: string;
|
|
210
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* IconRoundedButton component props interface
|
|
214
|
+
*/
|
|
215
|
+
type IconRoundedButtonProps = {
|
|
216
|
+
/** Ícone a ser exibido no botão */
|
|
217
|
+
icon: ReactNode;
|
|
218
|
+
/** Additional CSS classes to apply */
|
|
219
|
+
className?: string;
|
|
220
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
221
|
+
/**
|
|
222
|
+
* IconRoundedButton component for Analytica Ensino platforms
|
|
223
|
+
*
|
|
224
|
+
* Um botão redondo simples que exibe apenas um ícone.
|
|
225
|
+
* Ideal para ações como navegação, fechar, editar, etc.
|
|
226
|
+
*
|
|
227
|
+
* @param icon - O ícone a ser exibido no botão
|
|
228
|
+
* @param className - Classes CSS adicionais
|
|
229
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
230
|
+
* @returns Um elemento button estilizado e redondo
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```tsx
|
|
234
|
+
* <IconRoundedButton
|
|
235
|
+
* icon={<ChevronRightIcon />}
|
|
236
|
+
* onClick={() => console.log('clicked')}
|
|
237
|
+
* />
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
declare const IconRoundedButton: ({ icon, className, disabled, ...props }: IconRoundedButtonProps) => react_jsx_runtime.JSX.Element;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* NavButton component for Analytica Ensino platforms
|
|
244
|
+
*
|
|
245
|
+
* Um botão de navegação com ícone e texto para navegação principal.
|
|
246
|
+
* Ideal para menus de navegação, sidebar, tabs de navegação, etc.
|
|
247
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
248
|
+
*
|
|
249
|
+
* @param icon - O ícone a ser exibido no botão
|
|
250
|
+
* @param label - O texto/label a ser exibido
|
|
251
|
+
* @param selected - Estado de seleção do botão
|
|
252
|
+
* @param className - Classes CSS adicionais
|
|
253
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
254
|
+
* @returns Um elemento button estilizado para navegação
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```tsx
|
|
258
|
+
* <NavButton
|
|
259
|
+
* icon={<HomeIcon />}
|
|
260
|
+
* label="Início"
|
|
261
|
+
* selected={false}
|
|
262
|
+
* onClick={() => navigate('/')}
|
|
263
|
+
* />
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```tsx
|
|
268
|
+
* // Usando ref para foco programático
|
|
269
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
270
|
+
*
|
|
271
|
+
* const handleFocus = () => {
|
|
272
|
+
* buttonRef.current?.focus();
|
|
273
|
+
* };
|
|
274
|
+
*
|
|
275
|
+
* <NavButton
|
|
276
|
+
* ref={buttonRef}
|
|
277
|
+
* icon={<HomeIcon />}
|
|
278
|
+
* label="Dashboard"
|
|
279
|
+
* selected={isActive}
|
|
280
|
+
* onClick={() => setActiveTab('dashboard')}
|
|
281
|
+
* />
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
declare const NavButton: react.ForwardRefExoticComponent<{
|
|
285
|
+
/** Ícone a ser exibido no botão */
|
|
286
|
+
icon: ReactNode;
|
|
287
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
288
|
+
label: string;
|
|
289
|
+
/** Estado de seleção do botão */
|
|
290
|
+
selected?: boolean;
|
|
291
|
+
/** Additional CSS classes to apply */
|
|
292
|
+
className?: string;
|
|
293
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* SelectionButton component for Analytica Ensino platforms
|
|
297
|
+
*
|
|
298
|
+
* Um botão com ícone e texto para ações e navegação com estado de seleção.
|
|
299
|
+
* Ideal para filtros, tags, categorias, seleção de tipos, etc.
|
|
300
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
301
|
+
*
|
|
302
|
+
* @param icon - O ícone a ser exibido no botão
|
|
303
|
+
* @param label - O texto/label a ser exibido
|
|
304
|
+
* @param selected - Estado de seleção do botão
|
|
305
|
+
* @param className - Classes CSS adicionais
|
|
306
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
307
|
+
* @returns Um elemento button estilizado
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```tsx
|
|
311
|
+
* <SelectionButton
|
|
312
|
+
* icon={<TagIcon />}
|
|
313
|
+
* label="Categoria"
|
|
314
|
+
* selected={false}
|
|
315
|
+
* onClick={() => handleSelection()}
|
|
316
|
+
* />
|
|
317
|
+
* ```
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```tsx
|
|
321
|
+
* // Usando ref para foco programático
|
|
322
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
323
|
+
*
|
|
324
|
+
* const handleFocus = () => {
|
|
325
|
+
* buttonRef.current?.focus();
|
|
326
|
+
* };
|
|
327
|
+
*
|
|
328
|
+
* <SelectionButton
|
|
329
|
+
* ref={buttonRef}
|
|
330
|
+
* icon={<TagIcon />}
|
|
331
|
+
* label="Categoria"
|
|
332
|
+
* selected={isSelected}
|
|
333
|
+
* onClick={() => setSelected(!isSelected)}
|
|
334
|
+
* />
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
declare const SelectionButton: react.ForwardRefExoticComponent<{
|
|
338
|
+
/** Ícone a ser exibido no botão */
|
|
339
|
+
icon: ReactNode;
|
|
340
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
341
|
+
label: string;
|
|
342
|
+
/** Estado de seleção do botão */
|
|
343
|
+
selected?: boolean;
|
|
344
|
+
/** Additional CSS classes to apply */
|
|
345
|
+
className?: string;
|
|
346
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
347
|
+
|
|
348
|
+
declare const Table: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & react.RefAttributes<HTMLTableElement>>;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* CheckBox size variants
|
|
352
|
+
*/
|
|
353
|
+
type CheckBoxSize = 'small' | 'medium' | 'large';
|
|
354
|
+
/**
|
|
355
|
+
* CheckBox visual state
|
|
356
|
+
*/
|
|
357
|
+
type CheckBoxState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';
|
|
358
|
+
/**
|
|
359
|
+
* CheckBox component for Analytica Ensino platforms
|
|
360
|
+
*
|
|
361
|
+
* A checkbox component with essential states, sizes and themes.
|
|
362
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
363
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```tsx
|
|
367
|
+
* // Basic checkbox
|
|
368
|
+
* <CheckBox label="Option" />
|
|
369
|
+
*
|
|
370
|
+
* // Small size
|
|
371
|
+
* <CheckBox size="small" label="Small option" />
|
|
372
|
+
*
|
|
373
|
+
* // Invalid state
|
|
374
|
+
* <CheckBox state="invalid" label="Required field" />
|
|
375
|
+
*
|
|
376
|
+
* // Disabled state
|
|
377
|
+
* <CheckBox disabled label="Disabled option" />
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
380
|
+
declare const CheckBox: react.ForwardRefExoticComponent<{
|
|
381
|
+
/** Label text to display next to the checkbox */
|
|
382
|
+
label?: ReactNode;
|
|
383
|
+
/** Size variant of the checkbox */
|
|
384
|
+
size?: CheckBoxSize;
|
|
385
|
+
/** Visual state of the checkbox */
|
|
386
|
+
state?: CheckBoxState;
|
|
387
|
+
/** Indeterminate state for partial selections */
|
|
388
|
+
indeterminate?: boolean;
|
|
389
|
+
/** Error message to display */
|
|
390
|
+
errorMessage?: string;
|
|
391
|
+
/** Helper text to display */
|
|
392
|
+
helperText?: string;
|
|
393
|
+
/** Additional CSS classes */
|
|
394
|
+
className?: string;
|
|
395
|
+
/** Label CSS classes */
|
|
396
|
+
labelClassName?: string;
|
|
397
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & react.RefAttributes<HTMLInputElement>>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* CheckboxList size variants
|
|
401
|
+
*/
|
|
402
|
+
type CheckboxListSize = 'small' | 'medium' | 'large';
|
|
403
|
+
/**
|
|
404
|
+
* CheckboxList visual state
|
|
405
|
+
*/
|
|
406
|
+
type CheckboxListState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';
|
|
407
|
+
/**
|
|
408
|
+
* CheckboxList store interface
|
|
409
|
+
*/
|
|
410
|
+
interface CheckboxListStore {
|
|
411
|
+
values: string[];
|
|
412
|
+
setValues: (values: string[]) => void;
|
|
413
|
+
toggleValue: (value: string) => void;
|
|
414
|
+
onValuesChange?: (values: string[]) => void;
|
|
415
|
+
disabled: boolean;
|
|
416
|
+
name: string;
|
|
417
|
+
}
|
|
418
|
+
type CheckboxListStoreApi = StoreApi<CheckboxListStore>;
|
|
419
|
+
/**
|
|
420
|
+
* CheckboxList component for flexible checkbox group composition
|
|
421
|
+
*
|
|
422
|
+
* Uses Zustand for state management with automatic store injection.
|
|
423
|
+
* Allows complete control over layout and styling by composing with CheckboxListItem.
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```tsx
|
|
427
|
+
* <CheckboxList defaultValues={["option1"]} onValuesChange={setValues}>
|
|
428
|
+
* <div className="flex items-center gap-3">
|
|
429
|
+
* <CheckboxListItem value="option1" id="c1" />
|
|
430
|
+
* <label htmlFor="c1">Option 1</label>
|
|
431
|
+
* </div>
|
|
432
|
+
* <div className="flex items-center gap-3">
|
|
433
|
+
* <CheckboxListItem value="option2" id="c2" />
|
|
434
|
+
* <label htmlFor="c2">Option 2</label>
|
|
435
|
+
* </div>
|
|
436
|
+
* </CheckboxList>
|
|
437
|
+
* ```
|
|
438
|
+
*/
|
|
439
|
+
declare const CheckboxList: react.ForwardRefExoticComponent<{
|
|
440
|
+
/** Current selected values */
|
|
441
|
+
values?: string[];
|
|
442
|
+
/** Default selected values for uncontrolled usage */
|
|
443
|
+
defaultValues?: string[];
|
|
444
|
+
/** Callback when selection changes */
|
|
445
|
+
onValuesChange?: (values: string[]) => void;
|
|
446
|
+
/** Group name for all checkboxes */
|
|
447
|
+
name?: string;
|
|
448
|
+
/** Disabled state for the entire group */
|
|
449
|
+
disabled?: boolean;
|
|
450
|
+
/** Additional CSS classes */
|
|
451
|
+
className?: string;
|
|
452
|
+
/** Children components */
|
|
453
|
+
children: ReactNode;
|
|
454
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValues"> & react.RefAttributes<HTMLDivElement>>;
|
|
455
|
+
/**
|
|
456
|
+
* CheckboxListItem component for use within CheckboxList
|
|
457
|
+
*
|
|
458
|
+
* A checkbox without label that works within CheckboxList context.
|
|
459
|
+
* Provides just the checkbox input for maximum flexibility in composition.
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```tsx
|
|
463
|
+
* <CheckboxList defaultValues={["option1"]}>
|
|
464
|
+
* <div className="flex items-center gap-3">
|
|
465
|
+
* <CheckboxListItem value="option1" id="c1" />
|
|
466
|
+
* <label htmlFor="c1">Option 1</label>
|
|
467
|
+
* </div>
|
|
468
|
+
* </CheckboxList>
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
declare const CheckboxListItem: react.ForwardRefExoticComponent<{
|
|
472
|
+
/** Value for this checkbox item */
|
|
473
|
+
value: string;
|
|
474
|
+
/** Store reference (automatically injected by CheckboxList) */
|
|
475
|
+
store?: CheckboxListStoreApi;
|
|
476
|
+
/** Disabled state for this specific item */
|
|
477
|
+
disabled?: boolean;
|
|
478
|
+
/** Size variant */
|
|
479
|
+
size?: CheckboxListSize;
|
|
480
|
+
/** Visual state */
|
|
481
|
+
state?: CheckboxListState;
|
|
482
|
+
/** Additional CSS classes */
|
|
483
|
+
className?: string;
|
|
484
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Radio size variants
|
|
488
|
+
*/
|
|
489
|
+
type RadioSize = 'small' | 'medium' | 'large' | 'extraLarge';
|
|
490
|
+
/**
|
|
491
|
+
* Radio visual state
|
|
492
|
+
*/
|
|
493
|
+
type RadioState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';
|
|
494
|
+
/**
|
|
495
|
+
* Radio component for Analytica Ensino platforms
|
|
496
|
+
*
|
|
497
|
+
* A radio button component with essential states, sizes and themes.
|
|
498
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
499
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```tsx
|
|
503
|
+
* // Basic radio
|
|
504
|
+
* <Radio name="option" value="1" label="Option 1" />
|
|
505
|
+
*
|
|
506
|
+
* // Small size
|
|
507
|
+
* <Radio size="small" name="option" value="2" label="Small option" />
|
|
508
|
+
*
|
|
509
|
+
* // Invalid state
|
|
510
|
+
* <Radio state="invalid" name="option" value="3" label="Required field" />
|
|
511
|
+
*
|
|
512
|
+
* // Disabled state
|
|
513
|
+
* <Radio disabled name="option" value="4" label="Disabled option" />
|
|
514
|
+
*
|
|
515
|
+
* // Default checked (uncontrolled)
|
|
516
|
+
* <Radio defaultChecked name="option" value="5" label="Initially checked" />
|
|
517
|
+
* ```
|
|
518
|
+
*/
|
|
519
|
+
declare const Radio: react.ForwardRefExoticComponent<{
|
|
520
|
+
/** Label text to display next to the radio */
|
|
521
|
+
label?: ReactNode;
|
|
522
|
+
/** Size variant of the radio */
|
|
523
|
+
size?: RadioSize;
|
|
524
|
+
/** Visual state of the radio */
|
|
525
|
+
state?: RadioState;
|
|
526
|
+
/** Error message to display */
|
|
527
|
+
errorMessage?: string;
|
|
528
|
+
/** Helper text to display */
|
|
529
|
+
helperText?: string;
|
|
530
|
+
/** Additional CSS classes */
|
|
531
|
+
className?: string;
|
|
532
|
+
/** Label CSS classes */
|
|
533
|
+
labelClassName?: string;
|
|
534
|
+
/** Radio group name */
|
|
535
|
+
name?: string;
|
|
536
|
+
/** Radio value */
|
|
537
|
+
value?: string;
|
|
538
|
+
/** Default checked state for uncontrolled radios */
|
|
539
|
+
defaultChecked?: boolean;
|
|
540
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "defaultChecked" | "type"> & react.RefAttributes<HTMLInputElement>>;
|
|
541
|
+
/**
|
|
542
|
+
* RadioGroup store interface
|
|
543
|
+
*/
|
|
544
|
+
interface RadioGroupStore {
|
|
545
|
+
value: string;
|
|
546
|
+
setValue: (value: string) => void;
|
|
547
|
+
onValueChange?: (value: string) => void;
|
|
548
|
+
disabled: boolean;
|
|
549
|
+
name: string;
|
|
550
|
+
}
|
|
551
|
+
type RadioGroupStoreApi = StoreApi<RadioGroupStore>;
|
|
552
|
+
/**
|
|
553
|
+
* RadioGroup component for flexible radio group composition
|
|
554
|
+
*
|
|
555
|
+
* Uses Zustand for state management with automatic store injection.
|
|
556
|
+
* Allows complete control over layout and styling by composing with RadioGroupItem.
|
|
557
|
+
*
|
|
558
|
+
* @example
|
|
559
|
+
* ```tsx
|
|
560
|
+
* <RadioGroup defaultValue="option1" onValueChange={setValue}>
|
|
561
|
+
* <div className="flex items-center gap-3">
|
|
562
|
+
* <RadioGroupItem value="option1" id="r1" />
|
|
563
|
+
* <label htmlFor="r1">Option 1</label>
|
|
564
|
+
* </div>
|
|
565
|
+
* <div className="flex items-center gap-3">
|
|
566
|
+
* <RadioGroupItem value="option2" id="r2" />
|
|
567
|
+
* <label htmlFor="r2">Option 2</label>
|
|
568
|
+
* </div>
|
|
569
|
+
* </RadioGroup>
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<{
|
|
573
|
+
/** Current selected value */
|
|
574
|
+
value?: string;
|
|
575
|
+
/** Default selected value for uncontrolled usage */
|
|
576
|
+
defaultValue?: string;
|
|
577
|
+
/** Callback when selection changes */
|
|
578
|
+
onValueChange?: (value: string) => void;
|
|
579
|
+
/** Group name for all radios */
|
|
580
|
+
name?: string;
|
|
581
|
+
/** Disabled state for the entire group */
|
|
582
|
+
disabled?: boolean;
|
|
583
|
+
/** Additional CSS classes */
|
|
584
|
+
className?: string;
|
|
585
|
+
/** Children components */
|
|
586
|
+
children: ReactNode;
|
|
587
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & react.RefAttributes<HTMLDivElement>>;
|
|
588
|
+
/**
|
|
589
|
+
* RadioGroupItem component for use within RadioGroup
|
|
590
|
+
*
|
|
591
|
+
* A radio button without label that works within RadioGroup context.
|
|
592
|
+
* Provides just the radio input for maximum flexibility in composition.
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* ```tsx
|
|
596
|
+
* <RadioGroup defaultValue="option1">
|
|
597
|
+
* <div className="flex items-center gap-3">
|
|
598
|
+
* <RadioGroupItem value="option1" id="r1" />
|
|
599
|
+
* <label htmlFor="r1">Option 1</label>
|
|
600
|
+
* </div>
|
|
601
|
+
* </RadioGroup>
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
declare const RadioGroupItem: react.ForwardRefExoticComponent<{
|
|
605
|
+
/** Value for this radio item */
|
|
606
|
+
value: string;
|
|
607
|
+
/** Store reference (automatically injected by RadioGroup) */
|
|
608
|
+
store?: RadioGroupStoreApi;
|
|
609
|
+
/** Disabled state for this specific item */
|
|
610
|
+
disabled?: boolean;
|
|
611
|
+
/** Size variant */
|
|
612
|
+
size?: RadioSize;
|
|
613
|
+
/** Visual state */
|
|
614
|
+
state?: RadioState;
|
|
615
|
+
/** Additional CSS classes */
|
|
616
|
+
className?: string;
|
|
617
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "checked" | "type" | "name" | "onChange"> & react.RefAttributes<HTMLInputElement>>;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* TextArea size variants
|
|
621
|
+
*/
|
|
622
|
+
type TextAreaSize = 'small' | 'medium' | 'large' | 'extraLarge';
|
|
623
|
+
/**
|
|
624
|
+
* TextArea visual state
|
|
625
|
+
*/
|
|
626
|
+
type TextAreaState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';
|
|
627
|
+
/**
|
|
628
|
+
* TextArea component for Analytica Ensino platforms
|
|
629
|
+
*
|
|
630
|
+
* A textarea component with essential states, sizes and themes.
|
|
631
|
+
* Uses exact design specifications with 288px width, 96px height, and specific
|
|
632
|
+
* color values. Includes Text component integration for consistent typography.
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* ```tsx
|
|
636
|
+
* // Basic textarea
|
|
637
|
+
* <TextArea label="Description" placeholder="Enter description..." />
|
|
638
|
+
*
|
|
639
|
+
* // Small size
|
|
640
|
+
* <TextArea size="small" label="Comment" />
|
|
641
|
+
*
|
|
642
|
+
* // Invalid state
|
|
643
|
+
* <TextArea state="invalid" label="Required field" errorMessage="This field is required" />
|
|
644
|
+
*
|
|
645
|
+
* // Disabled state
|
|
646
|
+
* <TextArea disabled label="Read-only field" />
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
declare const TextArea: react.ForwardRefExoticComponent<{
|
|
650
|
+
/** Label text to display above the textarea */
|
|
651
|
+
label?: ReactNode;
|
|
652
|
+
/** Size variant of the textarea */
|
|
653
|
+
size?: TextAreaSize;
|
|
654
|
+
/** Visual state of the textarea */
|
|
655
|
+
state?: TextAreaState;
|
|
656
|
+
/** Error message to display */
|
|
657
|
+
errorMessage?: string;
|
|
658
|
+
/** Helper text to display */
|
|
659
|
+
helperMessage?: string;
|
|
660
|
+
/** Additional CSS classes */
|
|
661
|
+
className?: string;
|
|
662
|
+
/** Label CSS classes */
|
|
663
|
+
labelClassName?: string;
|
|
664
|
+
} & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
665
|
+
|
|
666
|
+
type ToastPosition$1 = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'default';
|
|
667
|
+
type ToastProps = {
|
|
668
|
+
title: string;
|
|
669
|
+
description?: string;
|
|
670
|
+
onClose: () => void;
|
|
671
|
+
/** Visual variant of the badge */
|
|
672
|
+
variant?: 'solid' | 'outlined';
|
|
673
|
+
/** Action type of the badge */
|
|
674
|
+
action?: 'warning' | 'success' | 'info';
|
|
675
|
+
position?: ToastPosition$1;
|
|
676
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
677
|
+
declare const Toast: ({ variant, action, className, onClose, title, description, position, ...props }: ToastProps) => react_jsx_runtime.JSX.Element;
|
|
678
|
+
|
|
679
|
+
declare const Toaster: () => react_jsx_runtime.JSX.Element;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Divider component props interface
|
|
683
|
+
*/
|
|
684
|
+
type DividerProps = {
|
|
685
|
+
/** Orientation of the divider */
|
|
686
|
+
orientation?: 'horizontal' | 'vertical';
|
|
687
|
+
/** Additional CSS classes to apply */
|
|
688
|
+
className?: string;
|
|
689
|
+
} & HTMLAttributes<HTMLHRElement>;
|
|
690
|
+
/**
|
|
691
|
+
* Divider component for Analytica Ensino platforms
|
|
692
|
+
*
|
|
693
|
+
* A simple divider component that creates a visual separation between content sections.
|
|
694
|
+
* Can be used both horizontally and vertically.
|
|
695
|
+
*
|
|
696
|
+
* @param orientation - The orientation of the divider (horizontal or vertical)
|
|
697
|
+
* @param className - Additional CSS classes
|
|
698
|
+
* @param props - All other standard hr HTML attributes
|
|
699
|
+
* @returns A styled divider element
|
|
700
|
+
*
|
|
701
|
+
* @example
|
|
702
|
+
* ```tsx
|
|
703
|
+
* <Divider orientation="horizontal" />
|
|
704
|
+
* <Divider orientation="vertical" className="h-8" />
|
|
705
|
+
* ```
|
|
706
|
+
*/
|
|
707
|
+
declare const Divider: ({ orientation, className, ...props }: DividerProps) => react_jsx_runtime.JSX.Element;
|
|
708
|
+
|
|
709
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'default';
|
|
710
|
+
type ToastData = {
|
|
711
|
+
id: string;
|
|
712
|
+
title: string;
|
|
713
|
+
description?: string;
|
|
714
|
+
variant?: 'solid' | 'outlined';
|
|
715
|
+
action?: 'warning' | 'success' | 'info';
|
|
716
|
+
position?: ToastPosition;
|
|
717
|
+
};
|
|
718
|
+
type ToastStore = {
|
|
719
|
+
toasts: ToastData[];
|
|
720
|
+
addToast: (toast: Omit<ToastData, 'id'>) => void;
|
|
721
|
+
removeToast: (id: string) => void;
|
|
722
|
+
};
|
|
723
|
+
declare const useToastStore: zustand.UseBoundStore<zustand.StoreApi<ToastStore>>;
|
|
724
|
+
|
|
725
|
+
declare const Input: react.ForwardRefExoticComponent<{
|
|
726
|
+
/** Label text displayed above the input */
|
|
727
|
+
label?: string;
|
|
728
|
+
/** Helper text displayed below the input */
|
|
729
|
+
helperText?: string;
|
|
730
|
+
/** Error message displayed below the input */
|
|
731
|
+
errorMessage?: string;
|
|
732
|
+
/** Size of the input */
|
|
733
|
+
size?: "small" | "medium" | "large" | "extra-large";
|
|
734
|
+
/** Visual variant of the input */
|
|
735
|
+
variant?: "outlined" | "underlined" | "rounded";
|
|
736
|
+
/** Current state of the input */
|
|
737
|
+
state?: "default" | "error" | "disabled" | "read-only";
|
|
738
|
+
/** Icon to display on the left side of the input */
|
|
739
|
+
iconLeft?: ReactNode;
|
|
740
|
+
/** Icon to display on the right side of the input */
|
|
741
|
+
iconRight?: ReactNode;
|
|
742
|
+
/** Additional CSS classes to apply to the input */
|
|
743
|
+
className?: string;
|
|
744
|
+
/** Additional CSS classes to apply to the container */
|
|
745
|
+
containerClassName?: string;
|
|
746
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & react.RefAttributes<HTMLInputElement>>;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Chips component props interface
|
|
750
|
+
*/
|
|
751
|
+
type ChipsProps = {
|
|
752
|
+
/** Content to be displayed inside the chip */
|
|
753
|
+
children: ReactNode;
|
|
754
|
+
/** Se o chip está selecionado (mostra check automaticamente) */
|
|
755
|
+
selected?: boolean;
|
|
756
|
+
/** Additional CSS classes to apply */
|
|
757
|
+
className?: string;
|
|
758
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
|
|
759
|
+
/**
|
|
760
|
+
* Chips component for Analytica Ensino platforms
|
|
761
|
+
*
|
|
762
|
+
* Um componente de chip seguindo exatamente o design do Figma.
|
|
763
|
+
* Suporte a dois estados principais: default (sem ícone) e selected (com ícone de check).
|
|
764
|
+
* Quando selecionado, automaticamente mostra o ícone de check.
|
|
765
|
+
*
|
|
766
|
+
* @param children - O conteúdo a ser exibido dentro do chip
|
|
767
|
+
* @param selected - Se o chip está selecionado (mostra check automaticamente)
|
|
768
|
+
* @param className - Classes CSS adicionais
|
|
769
|
+
* @param props - Todos os outros atributos padrão de button HTML
|
|
770
|
+
* @returns Um elemento de chip estilizado
|
|
771
|
+
*
|
|
772
|
+
* @example
|
|
773
|
+
* ```tsx
|
|
774
|
+
* <Chips onClick={() => console.log('clicked')}>
|
|
775
|
+
* Label
|
|
776
|
+
* </Chips>
|
|
777
|
+
*
|
|
778
|
+
* <Chips selected onClick={() => console.log('selected')}>
|
|
779
|
+
* Selected Label
|
|
780
|
+
* </Chips>
|
|
781
|
+
* ```
|
|
782
|
+
*/
|
|
783
|
+
declare const Chips: ({ children, selected, className, disabled, type, ...props }: ChipsProps) => react_jsx_runtime.JSX.Element;
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* Progress bar size variants
|
|
787
|
+
*/
|
|
788
|
+
type ProgressBarSize = 'small' | 'medium';
|
|
789
|
+
/**
|
|
790
|
+
* Progress bar color variants
|
|
791
|
+
*/
|
|
792
|
+
type ProgressBarVariant = 'blue' | 'green';
|
|
793
|
+
/**
|
|
794
|
+
* Progress bar layout variants
|
|
795
|
+
*/
|
|
796
|
+
type ProgressBarLayout = 'default' | 'stacked' | 'compact';
|
|
797
|
+
/**
|
|
798
|
+
* ProgressBar component props interface
|
|
799
|
+
*/
|
|
800
|
+
type ProgressBarProps = {
|
|
801
|
+
/** Progress value between 0 and 100 */
|
|
802
|
+
value: number;
|
|
803
|
+
/** Maximum value (defaults to 100) */
|
|
804
|
+
max?: number;
|
|
805
|
+
/** Size variant of the progress bar */
|
|
806
|
+
size?: ProgressBarSize;
|
|
807
|
+
/** Color variant of the progress bar */
|
|
808
|
+
variant?: ProgressBarVariant;
|
|
809
|
+
/** Layout variant of the progress bar */
|
|
810
|
+
layout?: ProgressBarLayout;
|
|
811
|
+
/** Optional label to display */
|
|
812
|
+
label?: ReactNode;
|
|
813
|
+
/** Show percentage text */
|
|
814
|
+
showPercentage?: boolean;
|
|
815
|
+
/**
|
|
816
|
+
* Show hit count (e.g., "28 de 30") instead of percentage
|
|
817
|
+
*
|
|
818
|
+
* PRIORITY: When both showHitCount and showPercentage are true,
|
|
819
|
+
* showHitCount takes precedence (stacked and compact layouts only).
|
|
820
|
+
* Default layout does not support showHitCount.
|
|
821
|
+
*/
|
|
822
|
+
showHitCount?: boolean;
|
|
823
|
+
/** Additional CSS classes */
|
|
824
|
+
className?: string;
|
|
825
|
+
/** Label CSS classes */
|
|
826
|
+
labelClassName?: string;
|
|
827
|
+
/** Percentage text CSS classes */
|
|
828
|
+
percentageClassName?: string;
|
|
829
|
+
/** Custom width for stacked layout (defaults to w-[380px]) */
|
|
830
|
+
stackedWidth?: string;
|
|
831
|
+
/** Custom height for stacked layout (defaults to h-[35px]) */
|
|
832
|
+
stackedHeight?: string;
|
|
833
|
+
/** Custom width for compact layout (defaults to w-[131px]) */
|
|
834
|
+
compactWidth?: string;
|
|
835
|
+
/** Custom height for compact layout (defaults to h-[24px]) */
|
|
836
|
+
compactHeight?: string;
|
|
837
|
+
};
|
|
838
|
+
/**
|
|
839
|
+
* ProgressBar component for Analytica Ensino platforms
|
|
840
|
+
*
|
|
841
|
+
* A progress bar component with size and color variants designed for tracking
|
|
842
|
+
* activity progress (blue) and performance metrics (green).
|
|
843
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
844
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
845
|
+
*
|
|
846
|
+
* CONTENT DISPLAY PRIORITY (Consistent across all layouts):
|
|
847
|
+
* 1. showHitCount (highest) - "X de Y" format (stacked/compact only)
|
|
848
|
+
* 2. showPercentage - "X%" format
|
|
849
|
+
* 3. label (lowest) - Custom label text
|
|
850
|
+
*
|
|
851
|
+
* When multiple display options are enabled, higher priority options take precedence.
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```tsx
|
|
855
|
+
* // Basic progress bar
|
|
856
|
+
* <ProgressBar value={65} />
|
|
857
|
+
*
|
|
858
|
+
* // Activity progress (blue)
|
|
859
|
+
* <ProgressBar variant="blue" value={45} label="Progress" showPercentage />
|
|
860
|
+
*
|
|
861
|
+
* // Performance metrics (green)
|
|
862
|
+
* <ProgressBar variant="green" size="medium" value={85} label="Performance" />
|
|
863
|
+
*
|
|
864
|
+
* // Small size with custom max value
|
|
865
|
+
* <ProgressBar size="small" value={3} max={5} showPercentage />
|
|
866
|
+
*
|
|
867
|
+
* // Stacked layout with fixed width and hit count
|
|
868
|
+
* <ProgressBar layout="stacked" variant="green" value={28} max={30} label="Fáceis" showHitCount />
|
|
869
|
+
*
|
|
870
|
+
* // Compact layout for small cards
|
|
871
|
+
* <ProgressBar layout="compact" variant="blue" value={70} label="Questão 08" />
|
|
872
|
+
* ```
|
|
873
|
+
*/
|
|
874
|
+
declare const ProgressBar: ({ value, max, size, variant, layout, label, showPercentage, showHitCount, className, labelClassName, percentageClassName, stackedWidth, stackedHeight, compactWidth, compactHeight, }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Progress circle size variants
|
|
878
|
+
*/
|
|
879
|
+
type ProgressCircleSize = 'small' | 'medium';
|
|
880
|
+
/**
|
|
881
|
+
* Progress circle color variants
|
|
882
|
+
*/
|
|
883
|
+
type ProgressCircleVariant = 'blue' | 'green';
|
|
884
|
+
/**
|
|
885
|
+
* ProgressCircle component props interface
|
|
886
|
+
*/
|
|
887
|
+
type ProgressCircleProps = {
|
|
888
|
+
/** Progress value between 0 and 100 */
|
|
889
|
+
value: number;
|
|
890
|
+
/** Maximum value (defaults to 100) */
|
|
891
|
+
max?: number;
|
|
892
|
+
/** Size variant of the progress circle */
|
|
893
|
+
size?: ProgressCircleSize;
|
|
894
|
+
/** Color variant of the progress circle */
|
|
895
|
+
variant?: ProgressCircleVariant;
|
|
896
|
+
/** Optional label to display below percentage */
|
|
897
|
+
label?: ReactNode;
|
|
898
|
+
/** Show percentage text */
|
|
899
|
+
showPercentage?: boolean;
|
|
900
|
+
/** Additional CSS classes */
|
|
901
|
+
className?: string;
|
|
902
|
+
/** Label CSS classes */
|
|
903
|
+
labelClassName?: string;
|
|
904
|
+
/** Percentage text CSS classes */
|
|
905
|
+
percentageClassName?: string;
|
|
906
|
+
};
|
|
907
|
+
/**
|
|
908
|
+
* ProgressCircle component for Analytica Ensino platforms
|
|
909
|
+
*
|
|
910
|
+
* A circular progress indicator with size and color variants designed for tracking
|
|
911
|
+
* activity progress (blue) and performance metrics (green).
|
|
912
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
913
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
914
|
+
*
|
|
915
|
+
* @example
|
|
916
|
+
* ```tsx
|
|
917
|
+
* // Basic progress circle
|
|
918
|
+
* <ProgressCircle value={65} />
|
|
919
|
+
*
|
|
920
|
+
* // Activity progress (blue)
|
|
921
|
+
* <ProgressCircle variant="blue" value={45} label="CONCLUÍDO" showPercentage />
|
|
922
|
+
*
|
|
923
|
+
* // Performance metrics (green)
|
|
924
|
+
* <ProgressCircle variant="green" size="medium" value={85} label="MÉDIA" />
|
|
925
|
+
*
|
|
926
|
+
* // Small size with custom max value
|
|
927
|
+
* <ProgressCircle size="small" value={3} max={5} showPercentage />
|
|
928
|
+
* ```
|
|
929
|
+
*/
|
|
930
|
+
declare const ProgressCircle: ({ value, max, size, variant, label, showPercentage, className, labelClassName, percentageClassName, }: ProgressCircleProps) => react_jsx_runtime.JSX.Element;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Stepper size variants
|
|
934
|
+
*/
|
|
935
|
+
type StepperSize = 'small' | 'medium' | 'large' | 'extraLarge';
|
|
936
|
+
/**
|
|
937
|
+
* Step state variants
|
|
938
|
+
*/
|
|
939
|
+
type StepState = 'pending' | 'current' | 'completed';
|
|
940
|
+
/**
|
|
941
|
+
* Individual step data interface
|
|
942
|
+
*/
|
|
943
|
+
interface StepData {
|
|
944
|
+
/** Unique identifier for the step */
|
|
945
|
+
id: string;
|
|
946
|
+
/** Label text for the step */
|
|
947
|
+
label: string;
|
|
948
|
+
/** Current state of the step */
|
|
949
|
+
state: StepState;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Stepper component props interface
|
|
953
|
+
*/
|
|
954
|
+
type StepperProps = {
|
|
955
|
+
/** Array of step data */
|
|
956
|
+
steps: StepData[];
|
|
957
|
+
/** Size variant of the stepper */
|
|
958
|
+
size?: StepperSize;
|
|
959
|
+
/** Current active step index */
|
|
960
|
+
currentStep?: number;
|
|
961
|
+
/** Additional CSS classes */
|
|
962
|
+
className?: string;
|
|
963
|
+
/** Step container CSS classes */
|
|
964
|
+
stepClassName?: string;
|
|
965
|
+
/** Progress indicator (e.g., "Etapa 2 de 4") */
|
|
966
|
+
showProgress?: boolean;
|
|
967
|
+
/** Custom progress text */
|
|
968
|
+
progressText?: string;
|
|
969
|
+
/** Make stepper responsive (vertical on mobile) */
|
|
970
|
+
responsive?: boolean;
|
|
971
|
+
};
|
|
972
|
+
/**
|
|
973
|
+
* Stepper component for Analytica Ensino platforms
|
|
974
|
+
*
|
|
975
|
+
* A progress stepper component that displays a sequence of steps with different states.
|
|
976
|
+
* Follows the exact design specifications with proper spacing, colors, and layout.
|
|
977
|
+
* Fully responsive for mobile, tablets, and laptops.
|
|
978
|
+
*
|
|
979
|
+
* Design specifications:
|
|
980
|
+
* - Based on exact CSS specifications from Figma design
|
|
981
|
+
* - Fully responsive: mobile (320px+) -> tablets (640px+) -> laptops (1024px+)
|
|
982
|
+
* - Progressive sizing with responsive breakpoints that adapt to device type
|
|
983
|
+
* - Consistent gaps that scale with screen size and device capabilities
|
|
984
|
+
* - Consistent color scheme: pending (gray), current (dark blue), completed (light blue)
|
|
985
|
+
* - Responsive design with overflow scroll on smaller devices
|
|
986
|
+
* - Optimized text sizing and layout for each device category
|
|
987
|
+
*
|
|
988
|
+
* @example
|
|
989
|
+
* ```tsx
|
|
990
|
+
* // Basic stepper - automatically responsive for all devices
|
|
991
|
+
* <Stepper steps={steps} currentStep={1} />
|
|
992
|
+
*
|
|
993
|
+
* // Custom styling with full responsive behavior
|
|
994
|
+
* <Stepper steps={steps} size="medium" showProgress responsive />
|
|
995
|
+
* ```
|
|
996
|
+
*/
|
|
997
|
+
declare const Stepper: ({ steps: initialSteps, size, currentStep, className, stepClassName, showProgress, progressText, responsive, }: StepperProps) => react_jsx_runtime.JSX.Element;
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* Activity status types for calendar days
|
|
1001
|
+
*/
|
|
1002
|
+
type ActivityStatus = 'near-deadline' | 'overdue' | 'in-deadline';
|
|
1003
|
+
/**
|
|
1004
|
+
* Activity data for a specific day
|
|
1005
|
+
*/
|
|
1006
|
+
interface CalendarActivity {
|
|
1007
|
+
id: string;
|
|
1008
|
+
status: ActivityStatus;
|
|
1009
|
+
title?: string;
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Calendar variant types
|
|
1013
|
+
*/
|
|
1014
|
+
type CalendarVariant = 'navigation' | 'selection';
|
|
1015
|
+
/**
|
|
1016
|
+
* Calendar component props
|
|
1017
|
+
*/
|
|
1018
|
+
interface CalendarProps {
|
|
1019
|
+
/** Calendar variant - navigation (compact) or selection (full) */
|
|
1020
|
+
variant?: CalendarVariant;
|
|
1021
|
+
/** Currently selected date */
|
|
1022
|
+
selectedDate?: Date;
|
|
1023
|
+
/** Function called when a date is selected */
|
|
1024
|
+
onDateSelect?: (date: Date) => void;
|
|
1025
|
+
/** Function called when month changes */
|
|
1026
|
+
onMonthChange?: (date: Date) => void;
|
|
1027
|
+
/** Activities data for calendar days */
|
|
1028
|
+
activities?: Record<string, CalendarActivity[]>;
|
|
1029
|
+
/** Show activities indicators */
|
|
1030
|
+
showActivities?: boolean;
|
|
1031
|
+
/** Additional CSS classes */
|
|
1032
|
+
className?: string;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Calendar component for Analytica Ensino platforms
|
|
1036
|
+
*
|
|
1037
|
+
* A comprehensive calendar component with activity indicators,
|
|
1038
|
+
* date selection, and navigation capabilities.
|
|
1039
|
+
*/
|
|
1040
|
+
declare const Calendar: ({ variant, selectedDate, onDateSelect, onMonthChange, activities, showActivities, className, }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Modal component props interface
|
|
1044
|
+
*/
|
|
1045
|
+
type ModalProps = {
|
|
1046
|
+
/** Whether the modal is open */
|
|
1047
|
+
isOpen: boolean;
|
|
1048
|
+
/** Function to close the modal */
|
|
1049
|
+
onClose: () => void;
|
|
1050
|
+
/** Modal title */
|
|
1051
|
+
title: string;
|
|
1052
|
+
/** Modal description/content */
|
|
1053
|
+
children: ReactNode;
|
|
1054
|
+
/** Size of the modal */
|
|
1055
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1056
|
+
/** Additional CSS classes for the modal content */
|
|
1057
|
+
className?: string;
|
|
1058
|
+
/** Whether clicking the backdrop should close the modal */
|
|
1059
|
+
closeOnBackdropClick?: boolean;
|
|
1060
|
+
/** Whether pressing Escape should close the modal */
|
|
1061
|
+
closeOnEscape?: boolean;
|
|
1062
|
+
/** Footer content (typically buttons) */
|
|
1063
|
+
footer?: ReactNode;
|
|
1064
|
+
/** Hide the close button */
|
|
1065
|
+
hideCloseButton?: boolean;
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* Modal component for Analytica Ensino platforms
|
|
1069
|
+
*
|
|
1070
|
+
* A flexible modal component with multiple size variants and customizable behavior.
|
|
1071
|
+
*
|
|
1072
|
+
* @param isOpen - Whether the modal is currently open
|
|
1073
|
+
* @param onClose - Callback function called when the modal should be closed
|
|
1074
|
+
* @param title - The title displayed at the top of the modal
|
|
1075
|
+
* @param children - The main content of the modal
|
|
1076
|
+
* @param size - The size variant (xs, sm, md, lg, xl)
|
|
1077
|
+
* @param className - Additional CSS classes for the modal content
|
|
1078
|
+
* @param closeOnBackdropClick - Whether clicking the backdrop closes the modal (default: true)
|
|
1079
|
+
* @param closeOnEscape - Whether pressing Escape closes the modal (default: true)
|
|
1080
|
+
* @param footer - Footer content, typically action buttons
|
|
1081
|
+
* @param hideCloseButton - Whether to hide the X close button (default: false)
|
|
1082
|
+
* @returns A modal overlay with content
|
|
1083
|
+
*
|
|
1084
|
+
* @example
|
|
1085
|
+
* ```tsx
|
|
1086
|
+
* <Modal
|
|
1087
|
+
* isOpen={isModalOpen}
|
|
1088
|
+
* onClose={() => setIsModalOpen(false)}
|
|
1089
|
+
* title="Invite your team"
|
|
1090
|
+
* size="md"
|
|
1091
|
+
* footer={
|
|
1092
|
+
* <div className="flex gap-3">
|
|
1093
|
+
* <Button variant="outline" onClick={() => setIsModalOpen(false)}>Cancel</Button>
|
|
1094
|
+
* <Button variant="solid" onClick={handleExplore}>Explore</Button>
|
|
1095
|
+
* </div>
|
|
1096
|
+
* }
|
|
1097
|
+
* >
|
|
1098
|
+
* Elevate user interactions with our versatile modals.
|
|
1099
|
+
* </Modal>
|
|
1100
|
+
* ```
|
|
1101
|
+
*/
|
|
1102
|
+
declare const Modal: ({ isOpen, onClose, title, children, size, className, closeOnBackdropClick, closeOnEscape, footer, hideCloseButton, }: ModalProps) => react_jsx_runtime.JSX.Element | null;
|
|
1103
|
+
|
|
1104
|
+
interface CardAccordationProps extends HTMLAttributes<HTMLDivElement> {
|
|
1105
|
+
trigger: ReactNode;
|
|
1106
|
+
children: ReactNode;
|
|
1107
|
+
defaultExpanded?: boolean;
|
|
1108
|
+
onToggleExpanded?: (isExpanded: boolean) => void;
|
|
1109
|
+
}
|
|
1110
|
+
declare const CardAccordation: react.ForwardRefExoticComponent<CardAccordationProps & react.RefAttributes<HTMLDivElement>>;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Interface para definir uma alternativa
|
|
1114
|
+
*/
|
|
1115
|
+
interface Alternative {
|
|
1116
|
+
value: string;
|
|
1117
|
+
label: string;
|
|
1118
|
+
status?: 'correct' | 'incorrect' | 'neutral';
|
|
1119
|
+
disabled?: boolean;
|
|
1120
|
+
description?: string;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Props do componente AlternativesList
|
|
1124
|
+
*/
|
|
1125
|
+
interface AlternativesListProps {
|
|
1126
|
+
/** Lista de alternativas */
|
|
1127
|
+
alternatives: Alternative[];
|
|
1128
|
+
/** Nome do grupo de radio */
|
|
1129
|
+
name?: string;
|
|
1130
|
+
/** Valor selecionado por padrão */
|
|
1131
|
+
defaultValue?: string;
|
|
1132
|
+
/** Valor controlado */
|
|
1133
|
+
value?: string;
|
|
1134
|
+
/** Callback quando uma alternativa é selecionada */
|
|
1135
|
+
onValueChange?: (value: string) => void;
|
|
1136
|
+
/** Se o componente está desabilitado */
|
|
1137
|
+
disabled?: boolean;
|
|
1138
|
+
/** Layout das alternativas */
|
|
1139
|
+
layout?: 'default' | 'compact' | 'detailed';
|
|
1140
|
+
/** Classes CSS adicionais */
|
|
1141
|
+
className?: string;
|
|
1142
|
+
/** Modo de exibição: interativo (com radios funcionais) ou readonly (apenas visual) */
|
|
1143
|
+
mode?: 'interactive' | 'readonly';
|
|
1144
|
+
/** Valor selecionado pelo usuário (apenas para modo readonly) */
|
|
1145
|
+
selectedValue?: string;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Componente reutilizável para exibir lista de alternativas com RadioGroup
|
|
1149
|
+
*
|
|
1150
|
+
* Suporta dois modos:
|
|
1151
|
+
* - `interactive`: Permite interação com radios (padrão)
|
|
1152
|
+
* - `readonly`: Apenas exibição visual dos estados
|
|
1153
|
+
*
|
|
1154
|
+
* @example
|
|
1155
|
+
* ```tsx
|
|
1156
|
+
* // Modo interativo (padrão)
|
|
1157
|
+
* <AlternativesList
|
|
1158
|
+
* mode="interactive"
|
|
1159
|
+
* alternatives={[
|
|
1160
|
+
* { value: "a", label: "Alternativa A", status: "correct" },
|
|
1161
|
+
* { value: "b", label: "Alternativa B", status: "incorrect" },
|
|
1162
|
+
* { value: "c", label: "Alternativa C" }
|
|
1163
|
+
* ]}
|
|
1164
|
+
* defaultValue="a"
|
|
1165
|
+
* onValueChange={(value) => console.log(value)}
|
|
1166
|
+
* />
|
|
1167
|
+
*
|
|
1168
|
+
* // Modo readonly - mostra seleção do usuário
|
|
1169
|
+
* <AlternativesList
|
|
1170
|
+
* mode="readonly"
|
|
1171
|
+
* selectedValue="b" // O que o usuário selecionou
|
|
1172
|
+
* alternatives={[
|
|
1173
|
+
* { value: "a", label: "Resposta A", status: "correct" }, // Mostra como correta
|
|
1174
|
+
* { value: "b", label: "Resposta B" }, // Mostra radio selecionado + badge incorreto
|
|
1175
|
+
* { value: "c", label: "Resposta C" }
|
|
1176
|
+
* ]}
|
|
1177
|
+
* />
|
|
1178
|
+
* ```
|
|
1179
|
+
*/
|
|
1180
|
+
declare const AlternativesList: ({ alternatives, name, defaultValue, value, onValueChange, disabled, layout, className, mode, selectedValue, }: AlternativesListProps) => react_jsx_runtime.JSX.Element;
|
|
1181
|
+
|
|
1182
|
+
interface AlertDialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
1183
|
+
/** Title of the alert dialog */
|
|
1184
|
+
title: string;
|
|
1185
|
+
/** Whether the alert dialog is open (controlled mode) */
|
|
1186
|
+
isOpen: boolean;
|
|
1187
|
+
/** Function called when the alert dialog is opened or closed (controlled mode) */
|
|
1188
|
+
onChangeOpen: (open: boolean) => void;
|
|
1189
|
+
/** Whether clicking the backdrop should close the alert dialog */
|
|
1190
|
+
closeOnBackdropClick?: boolean;
|
|
1191
|
+
/** Whether pressing Escape should close the alert dialog */
|
|
1192
|
+
closeOnEscape?: boolean;
|
|
1193
|
+
/** Additional CSS classes for the alert dialog content */
|
|
1194
|
+
className?: string;
|
|
1195
|
+
/** Function called when submit button is clicked */
|
|
1196
|
+
onSubmit?: (value?: unknown) => void;
|
|
1197
|
+
/** Value to pass to onSubmit function */
|
|
1198
|
+
submitValue?: unknown;
|
|
1199
|
+
/** Function called when cancel button is clicked */
|
|
1200
|
+
onCancel?: (value?: unknown) => void;
|
|
1201
|
+
/** Value to pass to onCancel function */
|
|
1202
|
+
cancelValue?: unknown;
|
|
1203
|
+
/** Description of the alert dialog */
|
|
1204
|
+
description: string;
|
|
1205
|
+
/** Label of the cancel button */
|
|
1206
|
+
cancelButtonLabel?: string;
|
|
1207
|
+
/** Label of the submit button */
|
|
1208
|
+
submitButtonLabel?: string;
|
|
1209
|
+
/** Size of the alert dialog */
|
|
1210
|
+
size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
|
1211
|
+
}
|
|
1212
|
+
declare const AlertDialog: react.ForwardRefExoticComponent<AlertDialogProps & react.RefAttributes<HTMLDivElement>>;
|
|
1213
|
+
|
|
1214
|
+
interface Choice {
|
|
1215
|
+
value: string;
|
|
1216
|
+
label: string;
|
|
1217
|
+
status?: 'correct' | 'incorrect' | 'neutral';
|
|
1218
|
+
disabled?: boolean;
|
|
1219
|
+
}
|
|
1220
|
+
interface MultipleChoiceListProps extends HtmlHTMLAttributes<HTMLDivElement> {
|
|
1221
|
+
choices: Choice[];
|
|
1222
|
+
disabled?: boolean;
|
|
1223
|
+
name?: string;
|
|
1224
|
+
selectedValues?: string[];
|
|
1225
|
+
onHandleSelectedValues?: (values: string[]) => void;
|
|
1226
|
+
mode?: 'interactive' | 'readonly';
|
|
1227
|
+
}
|
|
1228
|
+
declare const MultipleChoiceList: ({ disabled, className, choices, name, selectedValues, onHandleSelectedValues, mode, }: MultipleChoiceListProps) => react_jsx_runtime.JSX.Element;
|
|
1229
|
+
|
|
1230
|
+
interface DropdownStore {
|
|
1231
|
+
open: boolean;
|
|
1232
|
+
setOpen: (open: boolean) => void;
|
|
1233
|
+
}
|
|
1234
|
+
type DropdownStoreApi = StoreApi<DropdownStore>;
|
|
1235
|
+
interface DropdownMenuProps {
|
|
1236
|
+
children: ReactNode;
|
|
1237
|
+
open?: boolean;
|
|
1238
|
+
onOpenChange?: (open: boolean) => void;
|
|
1239
|
+
}
|
|
1240
|
+
declare const DropdownMenu: ({ children, open: propOpen, onOpenChange, }: DropdownMenuProps) => react_jsx_runtime.JSX.Element;
|
|
1241
|
+
declare const DropdownMenuTrigger: {
|
|
1242
|
+
({ className, children, onClick, store: externalStore, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1243
|
+
disabled?: boolean;
|
|
1244
|
+
store?: DropdownStoreApi;
|
|
1245
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1246
|
+
displayName: string;
|
|
1247
|
+
};
|
|
1248
|
+
declare const MenuLabel: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1249
|
+
inset?: boolean;
|
|
1250
|
+
store?: DropdownStoreApi;
|
|
1251
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1252
|
+
declare const DropdownMenuContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1253
|
+
align?: "start" | "center" | "end";
|
|
1254
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
1255
|
+
variant?: "menu" | "profile";
|
|
1256
|
+
sideOffset?: number;
|
|
1257
|
+
store?: DropdownStoreApi;
|
|
1258
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1259
|
+
declare const DropdownMenuItem: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1260
|
+
inset?: boolean;
|
|
1261
|
+
size?: "small" | "medium";
|
|
1262
|
+
iconLeft?: ReactNode;
|
|
1263
|
+
iconRight?: ReactNode;
|
|
1264
|
+
disabled?: boolean;
|
|
1265
|
+
variant?: "profile" | "menu";
|
|
1266
|
+
store?: DropdownStoreApi;
|
|
1267
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1268
|
+
declare const DropdownMenuSeparator: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1269
|
+
store?: DropdownStoreApi;
|
|
1270
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1271
|
+
declare const ProfileMenuTrigger: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1272
|
+
store?: DropdownStoreApi;
|
|
1273
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1274
|
+
declare const ProfileMenuHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1275
|
+
name: string;
|
|
1276
|
+
email: string;
|
|
1277
|
+
store?: DropdownStoreApi;
|
|
1278
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1279
|
+
declare const ProfileMenuSection: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
1280
|
+
store?: DropdownStoreApi;
|
|
1281
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
1282
|
+
declare const ProfileMenuFooter: {
|
|
1283
|
+
({ className, disabled, onClick, store: externalStore, ...props }: HTMLAttributes<HTMLButtonElement> & {
|
|
1284
|
+
disabled?: boolean;
|
|
1285
|
+
store?: DropdownStoreApi;
|
|
1286
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1287
|
+
displayName: string;
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
interface SelectStore {
|
|
1291
|
+
open: boolean;
|
|
1292
|
+
setOpen: (open: boolean) => void;
|
|
1293
|
+
value: string;
|
|
1294
|
+
setValue: (value: string) => void;
|
|
1295
|
+
selectedLabel: ReactNode;
|
|
1296
|
+
setSelectedLabel: (label: ReactNode) => void;
|
|
1297
|
+
onValueChange?: (value: string) => void;
|
|
1298
|
+
}
|
|
1299
|
+
type SelectStoreApi = StoreApi<SelectStore>;
|
|
1300
|
+
interface SelectProps {
|
|
1301
|
+
children: ReactNode;
|
|
1302
|
+
defaultValue?: string;
|
|
1303
|
+
value?: string;
|
|
1304
|
+
onValueChange?: (value: string) => void;
|
|
1305
|
+
size?: 'small' | 'medium' | 'large' | 'extra-large';
|
|
1306
|
+
label?: string;
|
|
1307
|
+
helperText?: string;
|
|
1308
|
+
errorMessage?: string;
|
|
1309
|
+
id?: string;
|
|
1310
|
+
}
|
|
1311
|
+
declare const Select: ({ children, defaultValue, value: propValue, onValueChange, size, label, helperText, errorMessage, id, }: SelectProps) => react_jsx_runtime.JSX.Element;
|
|
1312
|
+
declare const SelectValue: ({ placeholder, store: externalStore, }: {
|
|
1313
|
+
placeholder?: string;
|
|
1314
|
+
store?: SelectStoreApi;
|
|
1315
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1316
|
+
interface SelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1317
|
+
className?: string;
|
|
1318
|
+
invalid?: boolean;
|
|
1319
|
+
variant?: 'outlined' | 'underlined' | 'rounded';
|
|
1320
|
+
store?: SelectStoreApi;
|
|
1321
|
+
size?: 'small' | 'medium' | 'large' | 'extra-large';
|
|
1322
|
+
selectId?: string;
|
|
1323
|
+
}
|
|
1324
|
+
declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1325
|
+
interface SelectContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
1326
|
+
className?: string;
|
|
1327
|
+
align?: 'start' | 'center' | 'end';
|
|
1328
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1329
|
+
store?: SelectStoreApi;
|
|
1330
|
+
}
|
|
1331
|
+
declare const SelectContent: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1332
|
+
interface SelectItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
1333
|
+
value: string;
|
|
1334
|
+
disabled?: boolean;
|
|
1335
|
+
store?: SelectStoreApi;
|
|
1336
|
+
}
|
|
1337
|
+
declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1338
|
+
|
|
1339
|
+
type MenuVariant = 'menu' | 'menu2' | 'breadcrumb';
|
|
1340
|
+
interface MenuStore {
|
|
1341
|
+
value: string;
|
|
1342
|
+
setValue: (value: string) => void;
|
|
1343
|
+
onValueChange?: (value: string) => void;
|
|
1344
|
+
}
|
|
1345
|
+
type MenuStoreApi = StoreApi<MenuStore>;
|
|
1346
|
+
interface MenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
1347
|
+
children: ReactNode;
|
|
1348
|
+
defaultValue: string;
|
|
1349
|
+
value?: string;
|
|
1350
|
+
variant?: MenuVariant;
|
|
1351
|
+
onValueChange?: (value: string) => void;
|
|
1352
|
+
}
|
|
1353
|
+
declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<HTMLDivElement>>;
|
|
1354
|
+
interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
|
|
1355
|
+
children: ReactNode;
|
|
1356
|
+
variant?: MenuVariant;
|
|
1357
|
+
}
|
|
1358
|
+
declare const MenuContent: react.ForwardRefExoticComponent<MenuContentProps & react.RefAttributes<HTMLUListElement>>;
|
|
1359
|
+
interface MenuItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
1360
|
+
value: string;
|
|
1361
|
+
disabled?: boolean;
|
|
1362
|
+
store?: MenuStoreApi;
|
|
1363
|
+
variant?: MenuVariant;
|
|
1364
|
+
separator?: boolean;
|
|
1365
|
+
}
|
|
1366
|
+
declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
1367
|
+
interface MenuOverflowProps extends HTMLAttributes<HTMLDivElement> {
|
|
1368
|
+
children: ReactNode;
|
|
1369
|
+
defaultValue: string;
|
|
1370
|
+
value?: string;
|
|
1371
|
+
onValueChange?: (value: string) => void;
|
|
1372
|
+
}
|
|
1373
|
+
declare const MenuOverflow: ({ children, className, defaultValue, value, onValueChange, ...props }: MenuOverflowProps) => react_jsx_runtime.JSX.Element;
|
|
1374
|
+
|
|
1375
|
+
interface CardActivitiesResultsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1376
|
+
icon: ReactNode;
|
|
1377
|
+
title: string;
|
|
1378
|
+
subTitle: string;
|
|
1379
|
+
header: string;
|
|
1380
|
+
description?: string;
|
|
1381
|
+
extended?: boolean;
|
|
1382
|
+
action?: 'warning' | 'success' | 'error' | 'info';
|
|
1383
|
+
}
|
|
1384
|
+
declare const CardActivitiesResults: react.ForwardRefExoticComponent<CardActivitiesResultsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1385
|
+
interface CardQuestionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1386
|
+
header: string;
|
|
1387
|
+
state?: 'done' | 'undone';
|
|
1388
|
+
onClickButton?: (valueButton?: unknown) => void;
|
|
1389
|
+
valueButton?: unknown;
|
|
1390
|
+
}
|
|
1391
|
+
declare const CardQuestions: react.ForwardRefExoticComponent<CardQuestionProps & react.RefAttributes<HTMLDivElement>>;
|
|
1392
|
+
interface CardProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
1393
|
+
header: string;
|
|
1394
|
+
subhead?: string;
|
|
1395
|
+
initialDate?: string;
|
|
1396
|
+
endDate?: string;
|
|
1397
|
+
progress?: number;
|
|
1398
|
+
direction?: 'horizontal' | 'vertical';
|
|
1399
|
+
icon: ReactNode;
|
|
1400
|
+
color?: string;
|
|
1401
|
+
progressVariant?: 'blue' | 'green';
|
|
1402
|
+
showDates?: boolean;
|
|
1403
|
+
}
|
|
1404
|
+
declare const CardProgress: react.ForwardRefExoticComponent<CardProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1405
|
+
interface CardTopicProps extends HTMLAttributes<HTMLDivElement> {
|
|
1406
|
+
header: string;
|
|
1407
|
+
subHead?: string[];
|
|
1408
|
+
progress: number;
|
|
1409
|
+
showPercentage?: boolean;
|
|
1410
|
+
progressVariant?: 'blue' | 'green';
|
|
1411
|
+
}
|
|
1412
|
+
declare const CardTopic: react.ForwardRefExoticComponent<CardTopicProps & react.RefAttributes<HTMLDivElement>>;
|
|
1413
|
+
interface CardPerformanceProps extends HTMLAttributes<HTMLDivElement> {
|
|
1414
|
+
header: string;
|
|
1415
|
+
description?: string;
|
|
1416
|
+
progress?: number;
|
|
1417
|
+
labelProgress?: string;
|
|
1418
|
+
actionVariant?: 'button' | 'caret';
|
|
1419
|
+
progressVariant?: 'blue' | 'green';
|
|
1420
|
+
onClickButton?: (valueButton?: unknown) => void;
|
|
1421
|
+
valueButton?: unknown;
|
|
1422
|
+
}
|
|
1423
|
+
declare const CardPerformance: react.ForwardRefExoticComponent<CardPerformanceProps & react.RefAttributes<HTMLDivElement>>;
|
|
1424
|
+
interface CardResultsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1425
|
+
header: string;
|
|
1426
|
+
icon: ReactNode;
|
|
1427
|
+
correct_answers: number;
|
|
1428
|
+
incorrect_answers: number;
|
|
1429
|
+
direction?: 'row' | 'col';
|
|
1430
|
+
color?: string;
|
|
1431
|
+
}
|
|
1432
|
+
declare const CardResults: react.ForwardRefExoticComponent<CardResultsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1433
|
+
interface CardStatusProps extends HTMLAttributes<HTMLDivElement> {
|
|
1434
|
+
header: string;
|
|
1435
|
+
status?: 'correct' | 'incorrect';
|
|
1436
|
+
label?: string;
|
|
1437
|
+
}
|
|
1438
|
+
declare const CardStatus: react.ForwardRefExoticComponent<CardStatusProps & react.RefAttributes<HTMLDivElement>>;
|
|
1439
|
+
interface CardSimuladoProps extends HTMLAttributes<HTMLDivElement> {
|
|
1440
|
+
title: string;
|
|
1441
|
+
duration?: string;
|
|
1442
|
+
info: string;
|
|
1443
|
+
backgroundColor: 'enem' | 'prova' | 'simuladao' | 'vestibular';
|
|
1444
|
+
}
|
|
1445
|
+
declare const CardSimulado: react.ForwardRefExoticComponent<CardSimuladoProps & react.RefAttributes<HTMLDivElement>>;
|
|
1446
|
+
interface CardTestProps extends Omit<HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
1447
|
+
title: string;
|
|
1448
|
+
duration?: string;
|
|
1449
|
+
questionsCount?: number;
|
|
1450
|
+
additionalInfo?: string;
|
|
1451
|
+
selected?: boolean;
|
|
1452
|
+
onSelect?: (selected: boolean) => void;
|
|
1453
|
+
}
|
|
1454
|
+
declare const CardTest: react.ForwardRefExoticComponent<CardTestProps & react.RefAttributes<HTMLElement>>;
|
|
1455
|
+
interface SimulationItem {
|
|
1456
|
+
id: string;
|
|
1457
|
+
title: string;
|
|
1458
|
+
type: 'enem' | 'prova' | 'simulado' | 'vestibular';
|
|
1459
|
+
info: string;
|
|
1460
|
+
}
|
|
1461
|
+
interface SimulationHistoryData {
|
|
1462
|
+
date: string;
|
|
1463
|
+
simulations: SimulationItem[];
|
|
1464
|
+
}
|
|
1465
|
+
interface CardSimulationHistoryProps extends HTMLAttributes<HTMLDivElement> {
|
|
1466
|
+
data: SimulationHistoryData[];
|
|
1467
|
+
onSimulationClick?: (simulation: SimulationItem) => void;
|
|
1468
|
+
}
|
|
1469
|
+
declare const CardSimulationHistory: react.ForwardRefExoticComponent<CardSimulationHistoryProps & react.RefAttributes<HTMLDivElement>>;
|
|
1470
|
+
|
|
1471
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
1472
|
+
variant?: 'text' | 'circular' | 'rectangular' | 'rounded';
|
|
1473
|
+
width?: string | number;
|
|
1474
|
+
height?: string | number;
|
|
1475
|
+
animation?: 'pulse' | 'none';
|
|
1476
|
+
lines?: number;
|
|
1477
|
+
spacing?: 'none' | 'small' | 'medium' | 'large';
|
|
1478
|
+
}
|
|
1479
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLDivElement>>;
|
|
1480
|
+
declare const SkeletonText: react.ForwardRefExoticComponent<Omit<SkeletonProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
|
|
1481
|
+
declare const SkeletonCircle: react.ForwardRefExoticComponent<Omit<SkeletonProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
|
|
1482
|
+
declare const SkeletonRectangle: react.ForwardRefExoticComponent<Omit<SkeletonProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
|
|
1483
|
+
declare const SkeletonRounded: react.ForwardRefExoticComponent<Omit<SkeletonProps, "variant"> & react.RefAttributes<HTMLDivElement>>;
|
|
1484
|
+
interface SkeletonCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
1485
|
+
showAvatar?: boolean;
|
|
1486
|
+
showTitle?: boolean;
|
|
1487
|
+
showDescription?: boolean;
|
|
1488
|
+
showActions?: boolean;
|
|
1489
|
+
lines?: number;
|
|
1490
|
+
}
|
|
1491
|
+
declare const SkeletonCard: react.ForwardRefExoticComponent<SkeletonCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
1492
|
+
interface SkeletonListProps extends HTMLAttributes<HTMLDivElement> {
|
|
1493
|
+
items?: number;
|
|
1494
|
+
showAvatar?: boolean;
|
|
1495
|
+
showTitle?: boolean;
|
|
1496
|
+
showDescription?: boolean;
|
|
1497
|
+
lines?: number;
|
|
1498
|
+
}
|
|
1499
|
+
declare const SkeletonList: react.ForwardRefExoticComponent<SkeletonListProps & react.RefAttributes<HTMLDivElement>>;
|
|
1500
|
+
interface SkeletonTableProps extends HTMLAttributes<HTMLDivElement> {
|
|
1501
|
+
rows?: number;
|
|
1502
|
+
columns?: number;
|
|
1503
|
+
showHeader?: boolean;
|
|
1504
|
+
}
|
|
1505
|
+
declare const SkeletonTable: react.ForwardRefExoticComponent<SkeletonTableProps & react.RefAttributes<HTMLDivElement>>;
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Props interface for the NotFound component
|
|
1509
|
+
*
|
|
1510
|
+
* @interface NotFoundProps
|
|
1511
|
+
* @property {string} [title] - Custom title text (default: "Página não encontrada")
|
|
1512
|
+
* @property {string} [description] - Custom description text
|
|
1513
|
+
* @property {string} [buttonText] - Custom button text (default: "Voltar")
|
|
1514
|
+
* @property {() => void} [onButtonClick] - Callback function for button click
|
|
1515
|
+
* @property {string} [className] - Additional CSS classes for the container
|
|
1516
|
+
* @property {'404' | '500' | 'custom'} [errorType] - Type of error to display (default: '404')
|
|
1517
|
+
* @property {string} [customErrorCode] - Custom error code when errorType is 'custom'
|
|
1518
|
+
*/
|
|
1519
|
+
interface NotFoundProps {
|
|
1520
|
+
title?: string;
|
|
1521
|
+
description?: string;
|
|
1522
|
+
buttonText?: string;
|
|
1523
|
+
onButtonClick?: () => void;
|
|
1524
|
+
className?: string;
|
|
1525
|
+
errorType?: '404' | '500' | 'custom';
|
|
1526
|
+
customErrorCode?: string;
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1529
|
+
* NotFound component for displaying error pages
|
|
1530
|
+
*
|
|
1531
|
+
* A reusable component for displaying 404, 500, or custom error pages
|
|
1532
|
+
* with configurable content and navigation button.
|
|
1533
|
+
*
|
|
1534
|
+
* @param {NotFoundProps} props - The component props
|
|
1535
|
+
* @returns {JSX.Element} The NotFound component
|
|
1536
|
+
*
|
|
1537
|
+
* @example
|
|
1538
|
+
* ```typescript
|
|
1539
|
+
* // Basic 404 page
|
|
1540
|
+
* <NotFound onButtonClick={() => navigate('/dashboard')} />
|
|
1541
|
+
*
|
|
1542
|
+
* // Custom error page
|
|
1543
|
+
* <NotFound
|
|
1544
|
+
* errorType="500"
|
|
1545
|
+
* title="Erro interno do servidor"
|
|
1546
|
+
* description="Algo deu errado. Tente novamente mais tarde."
|
|
1547
|
+
* buttonText="Tentar novamente"
|
|
1548
|
+
* onButtonClick={() => window.location.reload()}
|
|
1549
|
+
* />
|
|
1550
|
+
*
|
|
1551
|
+
* // Custom error code
|
|
1552
|
+
* <NotFound
|
|
1553
|
+
* errorType="custom"
|
|
1554
|
+
* customErrorCode="403"
|
|
1555
|
+
* title="Acesso negado"
|
|
1556
|
+
* description="Você não tem permissão para acessar esta página."
|
|
1557
|
+
* />
|
|
1558
|
+
* ```
|
|
1559
|
+
*/
|
|
1560
|
+
declare const NotFound: ({ title, description, buttonText, onButtonClick, className, errorType, customErrorCode, }: NotFoundProps) => react_jsx_runtime.JSX.Element;
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Interface for basic authentication tokens
|
|
1564
|
+
*
|
|
1565
|
+
* @interface AuthTokens
|
|
1566
|
+
* @property {string} token - Main authentication token
|
|
1567
|
+
* @property {string} refreshToken - Token used to refresh the main token
|
|
1568
|
+
* @property {unknown} [key] - Additional properties that can be included
|
|
1569
|
+
*/
|
|
1570
|
+
interface AuthTokens {
|
|
1571
|
+
token: string;
|
|
1572
|
+
refreshToken: string;
|
|
1573
|
+
[key: string]: unknown;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Interface for basic user information
|
|
1577
|
+
*
|
|
1578
|
+
* @interface AuthUser
|
|
1579
|
+
* @property {string} id - Unique user identifier
|
|
1580
|
+
* @property {string} [name] - Optional user name
|
|
1581
|
+
* @property {string} [email] - Optional user email
|
|
1582
|
+
* @property {unknown} [key] - Additional user properties
|
|
1583
|
+
*/
|
|
1584
|
+
interface AuthUser {
|
|
1585
|
+
id: string;
|
|
1586
|
+
name?: string;
|
|
1587
|
+
email?: string;
|
|
1588
|
+
[key: string]: unknown;
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* Interface for basic session information
|
|
1592
|
+
*
|
|
1593
|
+
* @interface SessionInfo
|
|
1594
|
+
* @property {string} [institutionId] - Optional institution identifier
|
|
1595
|
+
* @property {string} [profileId] - Optional profile identifier
|
|
1596
|
+
* @property {string} [schoolId] - Optional school identifier
|
|
1597
|
+
* @property {string} [schoolYearId] - Optional school year identifier
|
|
1598
|
+
* @property {string} [classId] - Optional class identifier
|
|
1599
|
+
* @property {unknown} [key] - Additional session properties
|
|
1600
|
+
*/
|
|
1601
|
+
interface SessionInfo {
|
|
1602
|
+
institutionId?: string;
|
|
1603
|
+
profileId?: string;
|
|
1604
|
+
schoolId?: string;
|
|
1605
|
+
schoolYearId?: string;
|
|
1606
|
+
classId?: string;
|
|
1607
|
+
[key: string]: unknown;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Interface for authentication state
|
|
1611
|
+
*
|
|
1612
|
+
* @interface AuthState
|
|
1613
|
+
* @property {boolean} isAuthenticated - Whether the user is authenticated
|
|
1614
|
+
* @property {boolean} isLoading - Whether authentication is being checked
|
|
1615
|
+
* @property {AuthUser | null} [user] - Current user information
|
|
1616
|
+
* @property {SessionInfo | null} [sessionInfo] - Current session information
|
|
1617
|
+
* @property {AuthTokens | null} [tokens] - Current authentication tokens
|
|
1618
|
+
*/
|
|
1619
|
+
interface AuthState {
|
|
1620
|
+
isAuthenticated: boolean;
|
|
1621
|
+
isLoading: boolean;
|
|
1622
|
+
user?: AuthUser | null;
|
|
1623
|
+
sessionInfo?: SessionInfo | null;
|
|
1624
|
+
tokens?: AuthTokens | null;
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Interface for authentication context functions and state
|
|
1628
|
+
*
|
|
1629
|
+
* @interface AuthContextType
|
|
1630
|
+
* @extends {AuthState}
|
|
1631
|
+
* @property {() => Promise<boolean>} checkAuth - Function to check authentication status
|
|
1632
|
+
* @property {() => void} signOut - Function to sign out the user
|
|
1633
|
+
*/
|
|
1634
|
+
interface AuthContextType extends AuthState {
|
|
1635
|
+
checkAuth: () => Promise<boolean>;
|
|
1636
|
+
signOut: () => void;
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Props for the AuthProvider component
|
|
1640
|
+
*
|
|
1641
|
+
* @interface AuthProviderProps
|
|
1642
|
+
* @property {ReactNode} children - Child components
|
|
1643
|
+
* @property {() => Promise<boolean> | boolean} [checkAuthFn] - Function to check if user is authenticated
|
|
1644
|
+
* @property {() => void} [signOutFn] - Function to handle logout
|
|
1645
|
+
* @property {Partial<AuthState>} [initialAuthState] - Initial authentication state
|
|
1646
|
+
* @property {() => AuthUser | null | undefined} [getUserFn] - Function to get user data
|
|
1647
|
+
* @property {() => SessionInfo | null | undefined} [getSessionFn] - Function to get session info
|
|
1648
|
+
* @property {() => AuthTokens | null | undefined} [getTokensFn] - Function to get tokens
|
|
1649
|
+
*/
|
|
1650
|
+
interface AuthProviderProps {
|
|
1651
|
+
children: ReactNode;
|
|
1652
|
+
/**
|
|
1653
|
+
* Função para verificar se o usuário está autenticado
|
|
1654
|
+
* Deve retornar uma Promise<boolean>
|
|
1655
|
+
*/
|
|
1656
|
+
checkAuthFn?: () => Promise<boolean> | boolean;
|
|
1657
|
+
/**
|
|
1658
|
+
* Função para fazer logout
|
|
1659
|
+
*/
|
|
1660
|
+
signOutFn?: () => void;
|
|
1661
|
+
/**
|
|
1662
|
+
* Estado de autenticação inicial
|
|
1663
|
+
*/
|
|
1664
|
+
initialAuthState?: Partial<AuthState>;
|
|
1665
|
+
/**
|
|
1666
|
+
* Função para obter dados do usuário (opcional)
|
|
1667
|
+
*/
|
|
1668
|
+
getUserFn?: () => AuthUser | null | undefined;
|
|
1669
|
+
/**
|
|
1670
|
+
* Função para obter informações da sessão (opcional)
|
|
1671
|
+
*/
|
|
1672
|
+
getSessionFn?: () => SessionInfo | null | undefined;
|
|
1673
|
+
/**
|
|
1674
|
+
* Função para obter tokens (opcional)
|
|
1675
|
+
*/
|
|
1676
|
+
getTokensFn?: () => AuthTokens | null | undefined;
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* Authentication provider that manages global auth state
|
|
1680
|
+
* Compatible with any store (Zustand, Redux, Context, etc.)
|
|
1681
|
+
*
|
|
1682
|
+
* @param {AuthProviderProps} props - The provider props
|
|
1683
|
+
* @returns {JSX.Element} The provider component
|
|
1684
|
+
*
|
|
1685
|
+
* @example
|
|
1686
|
+
* ```tsx
|
|
1687
|
+
* <AuthProvider
|
|
1688
|
+
* checkAuthFn={checkAuthFunction}
|
|
1689
|
+
* signOutFn={signOutFunction}
|
|
1690
|
+
* getUserFn={getUserFunction}
|
|
1691
|
+
* >
|
|
1692
|
+
* <App />
|
|
1693
|
+
* </AuthProvider>
|
|
1694
|
+
* ```
|
|
1695
|
+
*/
|
|
1696
|
+
declare const AuthProvider: ({ children, checkAuthFn, signOutFn, initialAuthState, getUserFn, getSessionFn, getTokensFn, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
|
|
1697
|
+
/**
|
|
1698
|
+
* Hook to use the authentication context
|
|
1699
|
+
*
|
|
1700
|
+
* @throws {Error} When used outside of AuthProvider
|
|
1701
|
+
* @returns {AuthContextType} The authentication context
|
|
1702
|
+
*
|
|
1703
|
+
* @example
|
|
1704
|
+
* ```tsx
|
|
1705
|
+
* const { isAuthenticated, user, signOut } = useAuth();
|
|
1706
|
+
* ```
|
|
1707
|
+
*/
|
|
1708
|
+
declare const useAuth: () => AuthContextType;
|
|
1709
|
+
/**
|
|
1710
|
+
* Props for the ProtectedRoute component
|
|
1711
|
+
*
|
|
1712
|
+
* @interface ProtectedRouteProps
|
|
1713
|
+
* @property {ReactNode} children - Components to render when authenticated
|
|
1714
|
+
* @property {string} [redirectTo] - Path to redirect when not authenticated (default: '/')
|
|
1715
|
+
* @property {ReactNode} [loadingComponent] - Custom loading component
|
|
1716
|
+
* @property {(authState: AuthState) => boolean} [additionalCheck] - Additional authentication check
|
|
1717
|
+
*/
|
|
1718
|
+
interface ProtectedRouteProps {
|
|
1719
|
+
children: ReactNode;
|
|
1720
|
+
/**
|
|
1721
|
+
* Path para redirecionamento quando não autenticado
|
|
1722
|
+
*/
|
|
1723
|
+
redirectTo?: string;
|
|
1724
|
+
/**
|
|
1725
|
+
* Componente de loading personalizado
|
|
1726
|
+
*/
|
|
1727
|
+
loadingComponent?: ReactNode;
|
|
1728
|
+
/**
|
|
1729
|
+
* Função adicional de verificação (ex: verificar permissões específicas)
|
|
1730
|
+
*/
|
|
1731
|
+
additionalCheck?: (authState: AuthState) => boolean;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* Componente para proteger rotas que requerem autenticação
|
|
1735
|
+
*
|
|
1736
|
+
* @example
|
|
1737
|
+
* ```tsx
|
|
1738
|
+
* <ProtectedRoute redirectTo="/login">
|
|
1739
|
+
* <PainelPage />
|
|
1740
|
+
* </ProtectedRoute>
|
|
1741
|
+
* ```
|
|
1742
|
+
*/
|
|
1743
|
+
declare const ProtectedRoute: ({ children, redirectTo, loadingComponent, additionalCheck, }: ProtectedRouteProps) => react_jsx_runtime.JSX.Element | null;
|
|
1744
|
+
/**
|
|
1745
|
+
* Props for the PublicRoute component
|
|
1746
|
+
*
|
|
1747
|
+
* @interface PublicRouteProps
|
|
1748
|
+
* @property {ReactNode} children - Components to render
|
|
1749
|
+
* @property {string} [redirectTo] - Path to redirect to (default: '/painel')
|
|
1750
|
+
* @property {boolean} [redirectIfAuthenticated] - Whether to redirect if authenticated
|
|
1751
|
+
* @property {boolean} [checkAuthBeforeRender] - Whether to check auth before rendering
|
|
1752
|
+
*/
|
|
1753
|
+
interface PublicRouteProps {
|
|
1754
|
+
children: ReactNode;
|
|
1755
|
+
/**
|
|
1756
|
+
* Path para redirecionamento
|
|
1757
|
+
*/
|
|
1758
|
+
redirectTo?: string;
|
|
1759
|
+
/**
|
|
1760
|
+
* Se deve redirecionar quando usuário estiver autenticado
|
|
1761
|
+
*/
|
|
1762
|
+
redirectIfAuthenticated?: boolean;
|
|
1763
|
+
/**
|
|
1764
|
+
* Se deve verificar autenticação antes de renderizar
|
|
1765
|
+
*/
|
|
1766
|
+
checkAuthBeforeRender?: boolean;
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* Componente para rotas públicas (login, recuperação de senha, etc.)
|
|
1770
|
+
* Opcionalmente redireciona se o usuário já estiver autenticado
|
|
1771
|
+
*
|
|
1772
|
+
* @example
|
|
1773
|
+
* ```tsx
|
|
1774
|
+
* <PublicRoute redirectTo="/painel" redirectIfAuthenticated={true}>
|
|
1775
|
+
* <LoginPage />
|
|
1776
|
+
* </PublicRoute>
|
|
1777
|
+
* ```
|
|
1778
|
+
*/
|
|
1779
|
+
declare const PublicRoute: ({ children, redirectTo, redirectIfAuthenticated, checkAuthBeforeRender, }: PublicRouteProps) => react_jsx_runtime.JSX.Element;
|
|
1780
|
+
/**
|
|
1781
|
+
* Higher-Order Component to protect components with authentication
|
|
1782
|
+
*
|
|
1783
|
+
* @template P - Component props type
|
|
1784
|
+
* @param {ComponentType<P>} Component - Component to wrap with authentication
|
|
1785
|
+
* @param {Omit<ProtectedRouteProps, 'children'>} [options] - Protection options
|
|
1786
|
+
* @returns {(props: P) => JSX.Element} Wrapped component
|
|
1787
|
+
*
|
|
1788
|
+
* @example
|
|
1789
|
+
* ```tsx
|
|
1790
|
+
* const ProtectedComponent = withAuth(MyComponent, {
|
|
1791
|
+
* redirectTo: "/login",
|
|
1792
|
+
* loadingComponent: <CustomSpinner />
|
|
1793
|
+
* });
|
|
1794
|
+
* ```
|
|
1795
|
+
*/
|
|
1796
|
+
declare const withAuth: <P extends object>(Component: ComponentType<P>, options?: Omit<ProtectedRouteProps, "children">) => (props: P) => react_jsx_runtime.JSX.Element;
|
|
1797
|
+
/**
|
|
1798
|
+
* Hook for authentication guard with custom checks
|
|
1799
|
+
*
|
|
1800
|
+
* @param {object} [options] - Guard options
|
|
1801
|
+
* @param {boolean} [options.requireAuth=true] - Whether authentication is required
|
|
1802
|
+
* @param {(authState: AuthState) => boolean} [options.customCheck] - Custom check function
|
|
1803
|
+
* @returns {object} Guard result with canAccess, isLoading, and authState
|
|
1804
|
+
*
|
|
1805
|
+
* @example
|
|
1806
|
+
* ```tsx
|
|
1807
|
+
* const { canAccess, isLoading } = useAuthGuard({
|
|
1808
|
+
* requireAuth: true,
|
|
1809
|
+
* customCheck: (authState) => authState.user?.role === 'admin'
|
|
1810
|
+
* });
|
|
1811
|
+
* ```
|
|
1812
|
+
*/
|
|
1813
|
+
declare const useAuthGuard: (options?: {
|
|
1814
|
+
requireAuth?: boolean;
|
|
1815
|
+
customCheck?: (authState: AuthState) => boolean;
|
|
1816
|
+
}) => {
|
|
1817
|
+
canAccess: boolean;
|
|
1818
|
+
isLoading: boolean;
|
|
1819
|
+
authState: AuthContextType;
|
|
1820
|
+
};
|
|
1821
|
+
/**
|
|
1822
|
+
* Hook to check authentication on specific routes
|
|
1823
|
+
* Useful for conditional checks within components
|
|
1824
|
+
*
|
|
1825
|
+
* @param {string} [fallbackPath='/'] - Path to redirect when not authenticated
|
|
1826
|
+
* @returns {object} Object with isAuthenticated, isLoading, and redirectToLogin function
|
|
1827
|
+
*
|
|
1828
|
+
* @example
|
|
1829
|
+
* ```tsx
|
|
1830
|
+
* const { isAuthenticated, redirectToLogin } = useRouteAuth();
|
|
1831
|
+
*
|
|
1832
|
+
* if (!isAuthenticated) {
|
|
1833
|
+
* return redirectToLogin();
|
|
1834
|
+
* }
|
|
1835
|
+
* ```
|
|
1836
|
+
*/
|
|
1837
|
+
declare const useRouteAuth: (fallbackPath?: string) => {
|
|
1838
|
+
isAuthenticated: boolean;
|
|
1839
|
+
isLoading: boolean;
|
|
1840
|
+
redirectToLogin: () => react_jsx_runtime.JSX.Element;
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* Get the root domain from the current window location
|
|
1844
|
+
* Handles localhost and subdomain cases
|
|
1845
|
+
*
|
|
1846
|
+
* @returns {string} The root domain URL
|
|
1847
|
+
*/
|
|
1848
|
+
declare const getRootDomain: () => string;
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Generic adapter for integrating AuthProvider with Zustand stores
|
|
1852
|
+
* Users should import this file and pass their store instance
|
|
1853
|
+
*
|
|
1854
|
+
* @template S - Zustand store type that contains auth-related state
|
|
1855
|
+
* @param {object} useAuthStore - Zustand store hook with getState method
|
|
1856
|
+
* @param {() => S} useAuthStore.getState - Function to get current store state
|
|
1857
|
+
* @returns {object} Adapter object with auth functions
|
|
1858
|
+
*
|
|
1859
|
+
* @example
|
|
1860
|
+
* ```typescript
|
|
1861
|
+
* // Define your Zustand store type
|
|
1862
|
+
* interface AuthStore {
|
|
1863
|
+
* sessionInfo?: SessionInfo;
|
|
1864
|
+
* tokens?: AuthTokens;
|
|
1865
|
+
* user?: AuthUser;
|
|
1866
|
+
* signOut: () => void;
|
|
1867
|
+
* }
|
|
1868
|
+
*
|
|
1869
|
+
* // Create the adapter
|
|
1870
|
+
* const authAdapter = createZustandAuthAdapter(useAuthStore);
|
|
1871
|
+
*
|
|
1872
|
+
* // Use with AuthProvider
|
|
1873
|
+
* <AuthProvider
|
|
1874
|
+
* checkAuthFn={authAdapter.checkAuth}
|
|
1875
|
+
* signOutFn={authAdapter.signOut}
|
|
1876
|
+
* getUserFn={authAdapter.getUser}
|
|
1877
|
+
* getSessionFn={authAdapter.getSessionInfo}
|
|
1878
|
+
* getTokensFn={authAdapter.getTokens}
|
|
1879
|
+
* >
|
|
1880
|
+
* <App />
|
|
1881
|
+
* </AuthProvider>
|
|
1882
|
+
* ```
|
|
1883
|
+
*/
|
|
1884
|
+
declare function createZustandAuthAdapter<S extends {
|
|
1885
|
+
sessionInfo?: unknown;
|
|
1886
|
+
tokens?: unknown;
|
|
1887
|
+
user?: unknown;
|
|
1888
|
+
signOut?: () => void;
|
|
1889
|
+
}>(useAuthStore: {
|
|
1890
|
+
getState: () => S;
|
|
1891
|
+
}): {
|
|
1892
|
+
/**
|
|
1893
|
+
* Check if the user is authenticated based on sessionInfo and tokens
|
|
1894
|
+
*
|
|
1895
|
+
* @returns {Promise<boolean>} Promise that resolves to authentication status
|
|
1896
|
+
*/
|
|
1897
|
+
checkAuth: () => Promise<boolean>;
|
|
1898
|
+
/**
|
|
1899
|
+
* Get the current user from the store
|
|
1900
|
+
*
|
|
1901
|
+
* @returns {unknown} Current user data from the store
|
|
1902
|
+
*/
|
|
1903
|
+
getUser: () => unknown;
|
|
1904
|
+
/**
|
|
1905
|
+
* Get the current session information from the store
|
|
1906
|
+
*
|
|
1907
|
+
* @returns {unknown} Current session info from the store
|
|
1908
|
+
*/
|
|
1909
|
+
getSessionInfo: () => unknown;
|
|
1910
|
+
/**
|
|
1911
|
+
* Get the current authentication tokens from the store
|
|
1912
|
+
*
|
|
1913
|
+
* @returns {unknown} Current tokens from the store
|
|
1914
|
+
*/
|
|
1915
|
+
getTokens: () => unknown;
|
|
1916
|
+
/**
|
|
1917
|
+
* Sign out the user by calling the store's signOut function if available
|
|
1918
|
+
*
|
|
1919
|
+
* @returns {void}
|
|
1920
|
+
*/
|
|
1921
|
+
signOut: () => void;
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* Options interface for the useUrlAuthentication hook
|
|
1926
|
+
*
|
|
1927
|
+
* @template Tokens - Type for authentication tokens
|
|
1928
|
+
* @template Session - Type for session information
|
|
1929
|
+
* @template Profile - Type for profile information
|
|
1930
|
+
*
|
|
1931
|
+
* @interface UseUrlAuthOptions
|
|
1932
|
+
* @property {(tokens: Tokens) => void} setTokens - Function to set authentication tokens
|
|
1933
|
+
* @property {(session: Session) => void} setSessionInfo - Function to set session information
|
|
1934
|
+
* @property {(profile: Profile) => void} [setSelectedProfile] - Optional function to set selected profile
|
|
1935
|
+
* @property {object} api - API instance with get method
|
|
1936
|
+
* @property {(endpoint: string, config: unknown) => Promise<unknown>} api.get - API get method
|
|
1937
|
+
* @property {string} endpoint - API endpoint to fetch session data
|
|
1938
|
+
* @property {(searchParams: URLSearchParams) => object} [extractParams] - Custom parameter extraction function
|
|
1939
|
+
* @property {() => void} [clearParamsFromURL] - Function to clear URL parameters after processing
|
|
1940
|
+
*/
|
|
1941
|
+
interface UseUrlAuthOptions<Tokens = unknown, Session = unknown, Profile = unknown> {
|
|
1942
|
+
setTokens: (tokens: Tokens) => void;
|
|
1943
|
+
setSessionInfo: (session: Session) => void;
|
|
1944
|
+
setSelectedProfile?: (profile: Profile) => void;
|
|
1945
|
+
api: {
|
|
1946
|
+
get: (endpoint: string, config: unknown) => Promise<unknown>;
|
|
1947
|
+
};
|
|
1948
|
+
endpoint: string;
|
|
1949
|
+
extractParams?: (searchParams: URLSearchParams) => {
|
|
1950
|
+
sessionId: string;
|
|
1951
|
+
token: string;
|
|
1952
|
+
refreshToken: string;
|
|
1953
|
+
};
|
|
1954
|
+
clearParamsFromURL?: () => void;
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Hook for handling URL-based authentication
|
|
1958
|
+
* Extracts authentication parameters from URL and processes them
|
|
1959
|
+
*
|
|
1960
|
+
* @template Tokens - Type for authentication tokens
|
|
1961
|
+
* @template Session - Type for session information
|
|
1962
|
+
* @template Profile - Type for profile information
|
|
1963
|
+
*
|
|
1964
|
+
* @param {UseUrlAuthOptions<Tokens, Session, Profile>} options - Configuration options
|
|
1965
|
+
* @returns {void}
|
|
1966
|
+
*
|
|
1967
|
+
* @example
|
|
1968
|
+
* ```typescript
|
|
1969
|
+
* useUrlAuthentication({
|
|
1970
|
+
* setTokens: (tokens) => authStore.setTokens(tokens),
|
|
1971
|
+
* setSessionInfo: (session) => authStore.setSessionInfo(session),
|
|
1972
|
+
* setSelectedProfile: (profile) => authStore.setProfile(profile),
|
|
1973
|
+
* api: apiInstance,
|
|
1974
|
+
* endpoint: '/auth/session',
|
|
1975
|
+
* clearParamsFromURL: () => navigate('/', { replace: true })
|
|
1976
|
+
* });
|
|
1977
|
+
* ```
|
|
1978
|
+
*/
|
|
1979
|
+
declare function useUrlAuthentication<Tokens = unknown, Session = unknown, Profile = unknown>(options: UseUrlAuthOptions<Tokens, Session, Profile>): void;
|
|
1980
|
+
|
|
1981
|
+
/**
|
|
1982
|
+
* Type definition for API client with get method
|
|
1983
|
+
*
|
|
1984
|
+
* @template T - Type extending object with get method
|
|
1985
|
+
*/
|
|
1986
|
+
type ApiClient<T = unknown> = {
|
|
1987
|
+
get: (endpoint: string, config?: T) => Promise<unknown>;
|
|
1988
|
+
};
|
|
1989
|
+
/**
|
|
1990
|
+
* Creates a memoized API configuration object compatible with useUrlAuthentication
|
|
1991
|
+
*
|
|
1992
|
+
* This hook wraps an API client instance to create a consistent interface
|
|
1993
|
+
* for the useUrlAuthentication hook, ensuring proper memoization to prevent
|
|
1994
|
+
* unnecessary re-renders.
|
|
1995
|
+
*
|
|
1996
|
+
* @template T - Generic type for API client configuration
|
|
1997
|
+
* @param {ApiClient<T>} api - Axios instance or any API client with a get method
|
|
1998
|
+
* @returns {object} Memoized API configuration object with get method
|
|
1999
|
+
*
|
|
2000
|
+
* @example
|
|
2001
|
+
* ```typescript
|
|
2002
|
+
* import { useApiConfig } from 'analytica-frontend-lib';
|
|
2003
|
+
* import { useApi } from './services/apiService';
|
|
2004
|
+
*
|
|
2005
|
+
* function App() {
|
|
2006
|
+
* const api = useApi();
|
|
2007
|
+
* const apiConfig = useApiConfig(api);
|
|
2008
|
+
*
|
|
2009
|
+
* useUrlAuthentication({
|
|
2010
|
+
* setTokens,
|
|
2011
|
+
* setSessionInfo,
|
|
2012
|
+
* setSelectedProfile,
|
|
2013
|
+
* api: apiConfig,
|
|
2014
|
+
* endpoint: '/auth/session-info',
|
|
2015
|
+
* });
|
|
2016
|
+
* }
|
|
2017
|
+
* ```
|
|
2018
|
+
*/
|
|
2019
|
+
declare function useApiConfig<T = unknown>(api: ApiClient<T>): {
|
|
2020
|
+
get: (endpoint: string, config: unknown) => Promise<unknown>;
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
declare enum QUESTION_DIFFICULTY {
|
|
2024
|
+
FACIL = "FACIL",
|
|
2025
|
+
MEDIO = "MEDIO",
|
|
2026
|
+
DIFICIL = "DIFICIL"
|
|
2027
|
+
}
|
|
2028
|
+
declare enum QUESTION_TYPE {
|
|
2029
|
+
ALTERNATIVA = "ALTERNATIVA",
|
|
2030
|
+
DISSERTATIVA = "DISSERTATIVA",
|
|
2031
|
+
MULTIPLA_CHOICE = "MULTIPLA_CHOICE"
|
|
2032
|
+
}
|
|
2033
|
+
declare enum QUESTION_STATUS {
|
|
2034
|
+
APROVADO = "APROVADO",
|
|
2035
|
+
REPROVADO = "REPROVADO"
|
|
2036
|
+
}
|
|
2037
|
+
interface Question {
|
|
2038
|
+
id: string;
|
|
2039
|
+
questionText: string;
|
|
2040
|
+
description: string;
|
|
2041
|
+
type: QUESTION_TYPE;
|
|
2042
|
+
status: QUESTION_STATUS;
|
|
2043
|
+
difficulty: QUESTION_DIFFICULTY;
|
|
2044
|
+
examBoard: string;
|
|
2045
|
+
examYear: string;
|
|
2046
|
+
answerKey: null | string;
|
|
2047
|
+
institutionIds: string[];
|
|
2048
|
+
knowledgeMatrix: {
|
|
2049
|
+
areaKnowledgeId: string;
|
|
2050
|
+
subjectId: string;
|
|
2051
|
+
topicId: string;
|
|
2052
|
+
subtopicId: string;
|
|
2053
|
+
contentId: string;
|
|
2054
|
+
}[];
|
|
2055
|
+
options: {
|
|
2056
|
+
id: string;
|
|
2057
|
+
option: string;
|
|
2058
|
+
isCorrect: boolean;
|
|
2059
|
+
}[];
|
|
2060
|
+
}
|
|
2061
|
+
interface Simulado {
|
|
2062
|
+
id: string;
|
|
2063
|
+
title: string;
|
|
2064
|
+
category: string;
|
|
2065
|
+
questions: Question[];
|
|
2066
|
+
}
|
|
2067
|
+
interface Atividade {
|
|
2068
|
+
id: string;
|
|
2069
|
+
title: string;
|
|
2070
|
+
questions: Question[];
|
|
2071
|
+
}
|
|
2072
|
+
interface Aula {
|
|
2073
|
+
id: string;
|
|
2074
|
+
title: string;
|
|
2075
|
+
questions: Question[];
|
|
2076
|
+
}
|
|
2077
|
+
interface UserAnswerItem {
|
|
2078
|
+
questionId: string;
|
|
2079
|
+
activityId: string;
|
|
2080
|
+
userId: string;
|
|
2081
|
+
answer: string | null;
|
|
2082
|
+
optionId: string | null;
|
|
2083
|
+
}
|
|
2084
|
+
interface QuizState {
|
|
2085
|
+
bySimulated?: Simulado;
|
|
2086
|
+
byActivity?: Atividade;
|
|
2087
|
+
byQuestionary?: Aula;
|
|
2088
|
+
currentQuestionIndex: number;
|
|
2089
|
+
selectedAnswers: Record<string, string>;
|
|
2090
|
+
userAnswers: UserAnswerItem[];
|
|
2091
|
+
timeElapsed: number;
|
|
2092
|
+
isStarted: boolean;
|
|
2093
|
+
isFinished: boolean;
|
|
2094
|
+
userId: string;
|
|
2095
|
+
setBySimulated: (simulado: Simulado) => void;
|
|
2096
|
+
setByActivity: (atividade: Atividade) => void;
|
|
2097
|
+
setByQuestionary: (aula: Aula) => void;
|
|
2098
|
+
setUserId: (userId: string) => void;
|
|
2099
|
+
setUserAnswers: (userAnswers: UserAnswerItem[]) => void;
|
|
2100
|
+
goToNextQuestion: () => void;
|
|
2101
|
+
goToPreviousQuestion: () => void;
|
|
2102
|
+
goToQuestion: (index: number) => void;
|
|
2103
|
+
getActiveQuiz: () => {
|
|
2104
|
+
quiz: Simulado | Atividade | Aula;
|
|
2105
|
+
type: 'bySimulated' | 'byActivity' | 'byQuestionary';
|
|
2106
|
+
} | null;
|
|
2107
|
+
selectAnswer: (questionId: string, answerId: string) => void;
|
|
2108
|
+
selectMultipleAnswer: (questionId: string, answerIds: string[]) => void;
|
|
2109
|
+
skipQuestion: () => void;
|
|
2110
|
+
addUserAnswer: (questionId: string, answerId?: string) => void;
|
|
2111
|
+
startQuiz: () => void;
|
|
2112
|
+
finishQuiz: () => void;
|
|
2113
|
+
resetQuiz: () => void;
|
|
2114
|
+
updateTime: (time: number) => void;
|
|
2115
|
+
startTimer: () => void;
|
|
2116
|
+
stopTimer: () => void;
|
|
2117
|
+
getCurrentQuestion: () => Question | null;
|
|
2118
|
+
getTotalQuestions: () => number;
|
|
2119
|
+
getAnsweredQuestions: () => number;
|
|
2120
|
+
getUnansweredQuestions: () => number[];
|
|
2121
|
+
getSkippedQuestions: () => number;
|
|
2122
|
+
getProgress: () => number;
|
|
2123
|
+
isQuestionAnswered: (questionId: string) => boolean;
|
|
2124
|
+
isQuestionSkipped: (questionId: string) => boolean;
|
|
2125
|
+
getCurrentAnswer: () => string | undefined;
|
|
2126
|
+
getAllCurrentAnswer: () => UserAnswerItem[] | undefined;
|
|
2127
|
+
getQuizTitle: () => string;
|
|
2128
|
+
formatTime: (seconds: number) => string;
|
|
2129
|
+
getUserAnswers: () => UserAnswerItem[];
|
|
2130
|
+
getUnansweredQuestionsFromUserAnswers: () => number[];
|
|
2131
|
+
getQuestionsGroupedBySubject: () => {
|
|
2132
|
+
[key: string]: Question[];
|
|
2133
|
+
};
|
|
2134
|
+
getUserId: () => string;
|
|
2135
|
+
setCurrentQuestion: (question: Question) => void;
|
|
2136
|
+
getUserAnswerByQuestionId: (questionId: string) => UserAnswerItem | null;
|
|
2137
|
+
isQuestionAnsweredByUserAnswers: (questionId: string) => boolean;
|
|
2138
|
+
getQuestionStatusFromUserAnswers: (questionId: string) => 'answered' | 'unanswered' | 'skipped';
|
|
2139
|
+
getUserAnswersForActivity: () => UserAnswerItem[];
|
|
2140
|
+
}
|
|
2141
|
+
declare const useQuizStore: zustand.UseBoundStore<Omit<zustand.StoreApi<QuizState>, "setState" | "devtools"> & {
|
|
2142
|
+
setState(partial: QuizState | Partial<QuizState> | ((state: QuizState) => QuizState | Partial<QuizState>), replace?: false | undefined, action?: (string | {
|
|
2143
|
+
[x: string]: unknown;
|
|
2144
|
+
[x: number]: unknown;
|
|
2145
|
+
[x: symbol]: unknown;
|
|
2146
|
+
type: string;
|
|
2147
|
+
}) | undefined): void;
|
|
2148
|
+
setState(state: QuizState | ((state: QuizState) => QuizState), replace: true, action?: (string | {
|
|
2149
|
+
[x: string]: unknown;
|
|
2150
|
+
[x: number]: unknown;
|
|
2151
|
+
[x: symbol]: unknown;
|
|
2152
|
+
type: string;
|
|
2153
|
+
}) | undefined): void;
|
|
2154
|
+
devtools: {
|
|
2155
|
+
cleanup: () => void;
|
|
2156
|
+
};
|
|
2157
|
+
}>;
|
|
2158
|
+
|
|
2159
|
+
declare const Quiz: react.ForwardRefExoticComponent<{
|
|
2160
|
+
children: ReactNode;
|
|
2161
|
+
className?: string;
|
|
2162
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2163
|
+
declare const QuizHeaderResult: react.ForwardRefExoticComponent<{
|
|
2164
|
+
className?: string;
|
|
2165
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2166
|
+
declare const QuizTitle: react.ForwardRefExoticComponent<{
|
|
2167
|
+
className?: string;
|
|
2168
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2169
|
+
declare const QuizHeader: () => react_jsx_runtime.JSX.Element;
|
|
2170
|
+
declare const QuizContent: react.ForwardRefExoticComponent<{
|
|
2171
|
+
type?: "Alternativas" | "Dissertativa";
|
|
2172
|
+
variant?: "result" | "default";
|
|
2173
|
+
className?: string;
|
|
2174
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2175
|
+
interface QuizAlternativeInterface {
|
|
2176
|
+
variant?: 'result' | 'default';
|
|
2177
|
+
}
|
|
2178
|
+
declare const QuizAlternative: ({ variant }: QuizAlternativeInterface) => react_jsx_runtime.JSX.Element;
|
|
2179
|
+
declare const QuizQuestionList: ({ filterType, onQuestionClick, }?: {
|
|
2180
|
+
filterType?: string;
|
|
2181
|
+
onQuestionClick?: () => void;
|
|
2182
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
2183
|
+
declare const QuizFooter: react.ForwardRefExoticComponent<{
|
|
2184
|
+
className?: string;
|
|
2185
|
+
variant?: "result" | "default";
|
|
2186
|
+
onGoToSimulated?: () => void;
|
|
2187
|
+
onDetailResult?: () => void;
|
|
2188
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2189
|
+
declare const QuizResultHeaderTitle: react.ForwardRefExoticComponent<{
|
|
2190
|
+
className?: string;
|
|
2191
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2192
|
+
declare const QuizResultTitle: react.ForwardRefExoticComponent<{
|
|
2193
|
+
className?: string;
|
|
2194
|
+
} & react.RefAttributes<HTMLParagraphElement>>;
|
|
2195
|
+
declare const QuizResultPerformance: react.ForwardRefExoticComponent<react.RefAttributes<HTMLDivElement>>;
|
|
2196
|
+
declare const QuizListResult: react.ForwardRefExoticComponent<{
|
|
2197
|
+
className?: string;
|
|
2198
|
+
onSubjectClick?: (subject: string) => void;
|
|
2199
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
2200
|
+
declare const QuizListResultByMateria: ({ subject, onQuestionClick, }: {
|
|
2201
|
+
subject: string;
|
|
2202
|
+
onQuestionClick: (question: Question) => void;
|
|
2203
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
2204
|
+
|
|
2205
|
+
export { Alert, AlertDialog, AlternativesList, AuthProvider, Badge, Button, Calendar, CardAccordation, CardActivitiesResults, CardPerformance, CardProgress, CardQuestions, CardResults, CardSimulado, CardSimulationHistory, CardStatus, CardTest, CardTopic, CheckBox, CheckboxList, CheckboxListItem, Chips, Divider, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, IconButton, IconRoundedButton, Input, Menu, MenuContent, MenuItem, MenuLabel, MenuOverflow, Modal, MultipleChoiceList, NavButton, NotFound, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, ProgressBar, ProgressCircle, ProtectedRoute, PublicRoute, Quiz, QuizAlternative, QuizContent, QuizFooter, QuizHeader, QuizHeaderResult, QuizListResult, QuizListResultByMateria, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTitle, Radio, RadioGroup, RadioGroupItem, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, SelectionButton, Skeleton, SkeletonCard, SkeletonCircle, SkeletonList, SkeletonRectangle, SkeletonRounded, SkeletonTable, SkeletonText, Stepper, Table, Text, TextArea, Toast, Toaster, createZustandAuthAdapter, getRootDomain, useApiConfig, useAuth, useAuthGuard, useQuizStore, useRouteAuth, useToastStore, useUrlAuthentication, withAuth };
|