@vector-business-services/cristal-ds-web 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +725 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +989 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +251 -3
- package/dist/index.d.ts +251 -3
- package/dist/index.js +716 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, SyntheticEvent, MouseEvent, RefObject } from 'react';
|
|
2
|
+
import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } from 'react';
|
|
3
3
|
import { AutoCompleteProps as AutoCompleteProps$1 } from 'primereact/autocomplete';
|
|
4
|
+
import { CheckboxChangeEvent } from 'primereact/checkbox';
|
|
4
5
|
import { ChipRemoveEvent } from 'primereact/chip';
|
|
5
6
|
import { MenuItemCommandEvent } from 'primereact/menuitem';
|
|
7
|
+
import { RadioButtonChangeEvent } from 'primereact/radiobutton';
|
|
8
|
+
import { InputSwitchChangeEvent } from 'primereact/inputswitch';
|
|
6
9
|
|
|
7
10
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
8
11
|
type InputVariant = 'outline' | 'filled';
|
|
@@ -68,6 +71,43 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
68
71
|
}
|
|
69
72
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
70
73
|
|
|
74
|
+
/** Padding no Figma: X-Small (8px), Small (12px), Medium (16px), Large (20px) e X-Large (24px). */
|
|
75
|
+
type CardPadding = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
76
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
77
|
+
padding?: CardPadding;
|
|
78
|
+
/** Outline no Figma: borda de 1px em stroke/neutral/base. */
|
|
79
|
+
outline?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
|
|
83
|
+
/** Label Position no Figma: lado da caixa em relação ao rótulo. */
|
|
84
|
+
type CheckboxPosition = 'left' | 'right';
|
|
85
|
+
/** Label Type no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
86
|
+
type CheckboxLabelSize = 'default' | 'full';
|
|
87
|
+
interface CheckboxProps {
|
|
88
|
+
/** Texto ao lado da caixa (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
89
|
+
label: ReactNode;
|
|
90
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
91
|
+
showLabel?: boolean;
|
|
92
|
+
/** Lado da caixa. Padrão: left. */
|
|
93
|
+
position?: CheckboxPosition;
|
|
94
|
+
/** Padrão: default. */
|
|
95
|
+
labelSize?: CheckboxLabelSize;
|
|
96
|
+
checked?: boolean;
|
|
97
|
+
/** Type=Indeterminate no Figma: traço no lugar do check; o leitor de tela anuncia "misto". */
|
|
98
|
+
indeterminate?: boolean;
|
|
99
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
required?: boolean;
|
|
102
|
+
name?: string;
|
|
103
|
+
value?: unknown;
|
|
104
|
+
/** Vai no <input>. */
|
|
105
|
+
id?: string;
|
|
106
|
+
className?: string;
|
|
107
|
+
style?: CSSProperties;
|
|
108
|
+
}
|
|
109
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
110
|
+
|
|
71
111
|
/** Type no Figma. */
|
|
72
112
|
type ChipVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'highlight' | 'inverse' | 'outline' | 'neutral' | 'on-image';
|
|
73
113
|
/** Size no Figma: small = 24px, medium = 28px, large = 32px, x-large = 36px de altura. */
|
|
@@ -102,6 +142,37 @@ interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>
|
|
|
102
142
|
}
|
|
103
143
|
declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
|
|
104
144
|
|
|
145
|
+
/** Side no Figma: de que lado da tela a gaveta abre. */
|
|
146
|
+
type DrawerSide = 'right' | 'left';
|
|
147
|
+
/**
|
|
148
|
+
* Behavior no Figma: Full Body (tudo rola junto) ou Fixed Body (cabeçalho e rodapé fixos, só o
|
|
149
|
+
* corpo rola).
|
|
150
|
+
*/
|
|
151
|
+
type DrawerBehavior = 'full' | 'fixed';
|
|
152
|
+
interface DrawerProps {
|
|
153
|
+
visible: boolean;
|
|
154
|
+
/** Pedido para fechar (X, Esc ou clique no overlay). */
|
|
155
|
+
onHide: () => void;
|
|
156
|
+
/** Título do cabeçalho; também é o nome acessível da gaveta. */
|
|
157
|
+
title: string;
|
|
158
|
+
/** Subtítulo descritivo, até 2 linhas. */
|
|
159
|
+
subtitle?: ReactNode;
|
|
160
|
+
/** Padrão: right. */
|
|
161
|
+
side?: DrawerSide;
|
|
162
|
+
/** Padrão: full. */
|
|
163
|
+
behavior?: DrawerBehavior;
|
|
164
|
+
/** Mostra o botão de voltar antes do título. */
|
|
165
|
+
onBack?: () => void;
|
|
166
|
+
backLabel?: string;
|
|
167
|
+
closeLabel?: string;
|
|
168
|
+
/** Botões do rodapé, alinhados à direita. */
|
|
169
|
+
footer?: ReactNode;
|
|
170
|
+
children?: ReactNode;
|
|
171
|
+
id?: string;
|
|
172
|
+
className?: string;
|
|
173
|
+
}
|
|
174
|
+
declare function Drawer({ visible, onHide, title, subtitle, side, behavior, onBack, backLabel, closeLabel, footer, children, id, className, }: DrawerProps): react.JSX.Element;
|
|
175
|
+
|
|
105
176
|
/**
|
|
106
177
|
* Hierarchy no Figma: Primary (Filled), Secondary (Tonal), Tertiary (Outlined) e Other (Icon),
|
|
107
178
|
* que aqui é `ghost`: só o ícone, com fundo no hover.
|
|
@@ -218,6 +289,33 @@ interface MenubarProps {
|
|
|
218
289
|
}
|
|
219
290
|
declare const Menubar: react.ForwardRefExoticComponent<MenubarProps & react.RefAttributes<HTMLDivElement>>;
|
|
220
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
|
|
294
|
+
* vira tela cheia, como o Responsive=360 do Figma).
|
|
295
|
+
*/
|
|
296
|
+
type ModalSize = 'small' | 'medium' | 'large';
|
|
297
|
+
interface ModalProps {
|
|
298
|
+
visible: boolean;
|
|
299
|
+
/** Pedido para fechar (X ou Esc). */
|
|
300
|
+
onHide: () => void;
|
|
301
|
+
/** Título do cabeçalho; também é o nome acessível do modal. */
|
|
302
|
+
title: string;
|
|
303
|
+
/** Padrão: large. */
|
|
304
|
+
size?: ModalSize;
|
|
305
|
+
/** Mostra o botão de ajuda (QuestionMark) ao lado do X, no small e no medium. */
|
|
306
|
+
onHelp?: () => void;
|
|
307
|
+
helpLabel?: string;
|
|
308
|
+
closeLabel?: string;
|
|
309
|
+
/** Botões do rodapé, à direita. */
|
|
310
|
+
footer?: ReactNode;
|
|
311
|
+
/** Conteúdo do rodapé à esquerda (ex.: o botão secundário dos Two/Tree Buttons do Figma). */
|
|
312
|
+
footerStart?: ReactNode;
|
|
313
|
+
children?: ReactNode;
|
|
314
|
+
id?: string;
|
|
315
|
+
className?: string;
|
|
316
|
+
}
|
|
317
|
+
declare function Modal({ visible, onHide, title, size, onHelp, helpLabel, closeLabel, footer, footerStart, children, id, className, }: ModalProps): react.JSX.Element;
|
|
318
|
+
|
|
221
319
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
222
320
|
type MultiSelectVariant = 'outline' | 'filled';
|
|
223
321
|
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
@@ -270,6 +368,156 @@ interface MultiSelectProps {
|
|
|
270
368
|
}
|
|
271
369
|
declare const MultiSelect: react.ForwardRefExoticComponent<MultiSelectProps & react.RefAttributes<HTMLInputElement>>;
|
|
272
370
|
|
|
371
|
+
type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
|
|
372
|
+
declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
373
|
+
|
|
374
|
+
/** Label Size no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
375
|
+
type RadioLabelSize = 'default' | 'full';
|
|
376
|
+
interface RadioProps {
|
|
377
|
+
/** Texto ao lado do controle (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
378
|
+
label: ReactNode;
|
|
379
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
380
|
+
showLabel?: boolean;
|
|
381
|
+
/** Padrão: default. */
|
|
382
|
+
labelSize?: RadioLabelSize;
|
|
383
|
+
checked?: boolean;
|
|
384
|
+
/** Valor da opção, devolvido no `onChange`. */
|
|
385
|
+
value?: unknown;
|
|
386
|
+
/** Nome do grupo: radios com o mesmo `name` se excluem e navegam pelas setas. */
|
|
387
|
+
name?: string;
|
|
388
|
+
onChange?: (event: RadioButtonChangeEvent) => void;
|
|
389
|
+
disabled?: boolean;
|
|
390
|
+
required?: boolean;
|
|
391
|
+
/** Vai no <input>. */
|
|
392
|
+
id?: string;
|
|
393
|
+
className?: string;
|
|
394
|
+
style?: CSSProperties;
|
|
395
|
+
}
|
|
396
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
397
|
+
|
|
398
|
+
interface ScrollPanelProps {
|
|
399
|
+
children?: ReactNode;
|
|
400
|
+
/** O que a área mostra, para o leitor de tela (ex.: "Histórico da carga"). */
|
|
401
|
+
'aria-label'?: string;
|
|
402
|
+
'aria-labelledby'?: string;
|
|
403
|
+
/** Dê uma altura (ou max-height) para a área rolar. */
|
|
404
|
+
style?: CSSProperties;
|
|
405
|
+
id?: string;
|
|
406
|
+
className?: string;
|
|
407
|
+
}
|
|
408
|
+
declare const ScrollPanel: react.ForwardRefExoticComponent<ScrollPanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* No Figma: Primary é o Header Segment Control (pílula em fill/brand/subtlest) e Secondary é o
|
|
412
|
+
* Segment Control (cinza, com ícones).
|
|
413
|
+
*/
|
|
414
|
+
type SegmentControlVariant = 'primary' | 'secondary';
|
|
415
|
+
interface SegmentControlOption {
|
|
416
|
+
label: string;
|
|
417
|
+
value: string | number;
|
|
418
|
+
/** Ícone de 16px antes do texto (o Secondary do Figma usa). */
|
|
419
|
+
icon?: ReactNode;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
}
|
|
422
|
+
interface SegmentControlProps {
|
|
423
|
+
options: SegmentControlOption[];
|
|
424
|
+
/** Valor do segmento ativo (controlado). */
|
|
425
|
+
value?: string | number;
|
|
426
|
+
onChange?: (value: string | number) => void;
|
|
427
|
+
variant?: SegmentControlVariant;
|
|
428
|
+
/** O que o grupo controla, para o leitor de tela (ex.: "Visualização"). */
|
|
429
|
+
'aria-label'?: string;
|
|
430
|
+
'aria-labelledby'?: string;
|
|
431
|
+
disabled?: boolean;
|
|
432
|
+
id?: string;
|
|
433
|
+
className?: string;
|
|
434
|
+
}
|
|
435
|
+
declare const SegmentControl: react.ForwardRefExoticComponent<SegmentControlProps & react.RefAttributes<HTMLDivElement>>;
|
|
436
|
+
|
|
437
|
+
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
438
|
+
type SelectVariant = 'outline' | 'filled';
|
|
439
|
+
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
440
|
+
type SelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
441
|
+
interface SelectProps {
|
|
442
|
+
variant?: SelectVariant;
|
|
443
|
+
size?: SelectSize;
|
|
444
|
+
/** Rótulo acima do campo (Label no Figma). Sem rótulo, passe `aria-label`. */
|
|
445
|
+
label?: string;
|
|
446
|
+
'aria-label'?: string;
|
|
447
|
+
/** Opções da lista. */
|
|
448
|
+
options: unknown[];
|
|
449
|
+
/** Campo da opção usado como texto (padrão: `label`). */
|
|
450
|
+
optionLabel?: string;
|
|
451
|
+
/** Campo da opção usado como valor; sem ele, o valor é a própria opção. */
|
|
452
|
+
optionValue?: string;
|
|
453
|
+
/** Valor selecionado (controlado). */
|
|
454
|
+
value?: unknown;
|
|
455
|
+
onChange?: (value: unknown) => void;
|
|
456
|
+
/** Texto do campo vazio (Field Text no Figma). */
|
|
457
|
+
placeholder?: string;
|
|
458
|
+
/** Dica abaixo do campo (Hint Info no Figma). */
|
|
459
|
+
hint?: string;
|
|
460
|
+
/** Mensagem de erro: deixa o campo no estado Error e mostra a dica de erro no lugar da dica. */
|
|
461
|
+
error?: string;
|
|
462
|
+
required?: boolean;
|
|
463
|
+
disabled?: boolean;
|
|
464
|
+
/** Vai no campo (combobox). */
|
|
465
|
+
id?: string;
|
|
466
|
+
name?: string;
|
|
467
|
+
className?: string;
|
|
468
|
+
}
|
|
469
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLInputElement>>;
|
|
470
|
+
|
|
471
|
+
/** Size no Figma: Medium (48x28) e Small (32x20). */
|
|
472
|
+
type SwitchSize = 'medium' | 'small';
|
|
473
|
+
/** Label Position no Figma: lado do rótulo em relação ao switch. */
|
|
474
|
+
type SwitchLabelPosition = 'right' | 'left';
|
|
475
|
+
interface SwitchProps {
|
|
476
|
+
/** Texto ao lado do switch (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
477
|
+
label: ReactNode;
|
|
478
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
479
|
+
showLabel?: boolean;
|
|
480
|
+
/** Padrão: right. */
|
|
481
|
+
labelPosition?: SwitchLabelPosition;
|
|
482
|
+
/** Padrão: medium. */
|
|
483
|
+
size?: SwitchSize;
|
|
484
|
+
checked?: boolean;
|
|
485
|
+
onChange?: (event: InputSwitchChangeEvent) => void;
|
|
486
|
+
disabled?: boolean;
|
|
487
|
+
name?: string;
|
|
488
|
+
/** Vai no <input>. */
|
|
489
|
+
id?: string;
|
|
490
|
+
className?: string;
|
|
491
|
+
style?: CSSProperties;
|
|
492
|
+
}
|
|
493
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
|
|
494
|
+
|
|
495
|
+
/** Uma aba (.Tab Item no Figma) e o conteúdo dela. */
|
|
496
|
+
interface TabPanelProps {
|
|
497
|
+
/** Texto da aba (Label no Figma). */
|
|
498
|
+
header: string;
|
|
499
|
+
/** Ícone antes do texto (Leading Icon no Figma). */
|
|
500
|
+
leftIcon?: ReactNode;
|
|
501
|
+
/** Contador depois do texto (Badge no Figma). */
|
|
502
|
+
badge?: ReactNode;
|
|
503
|
+
/** Mostra o X (Tab Btn no Figma) e é chamado ao fechar a aba (clique no X ou Delete na aba). */
|
|
504
|
+
onClose?: () => void;
|
|
505
|
+
disabled?: boolean;
|
|
506
|
+
children?: ReactNode;
|
|
507
|
+
}
|
|
508
|
+
/** Só descreve a aba: quem desenha é o Tabs. */
|
|
509
|
+
declare function TabPanel(_props: TabPanelProps): null;
|
|
510
|
+
interface TabsProps {
|
|
511
|
+
/** Aba ativa (controlado). Sem ela, o Tabs controla sozinho. */
|
|
512
|
+
activeIndex?: number;
|
|
513
|
+
onTabChange?: (index: number) => void;
|
|
514
|
+
/** As abas, como `<TabPanel>`. */
|
|
515
|
+
children: ReactNode;
|
|
516
|
+
id?: string;
|
|
517
|
+
className?: string;
|
|
518
|
+
}
|
|
519
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
520
|
+
|
|
273
521
|
/** Type no Figma. */
|
|
274
522
|
type TagVariant = 'default' | 'success' | 'warning' | 'danger' | 'info' | 'purple' | 'gray' | 'inverse' | 'outline';
|
|
275
523
|
/** Size no Figma: small = 24px, medium = 28px, large = 32px, x-large = 36px de altura. */
|
|
@@ -305,5 +553,5 @@ interface TooltipProps {
|
|
|
305
553
|
}
|
|
306
554
|
declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
|
|
307
555
|
|
|
308
|
-
export { AutoComplete, Badge, Button, Chip, Divider, IconButton, Input, Menu, Menubar, MultiSelect, Tag, Tooltip };
|
|
309
|
-
export type { AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuProps, MenubarProps, MenubarTool, MenubarUser, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
|
|
556
|
+
export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, Menubar, Modal, MultiSelect, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
|
|
557
|
+
export type { AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerProps, DrawerSide, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuProps, MenubarProps, MenubarTool, MenubarUser, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, SyntheticEvent, MouseEvent, RefObject } from 'react';
|
|
2
|
+
import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } from 'react';
|
|
3
3
|
import { AutoCompleteProps as AutoCompleteProps$1 } from 'primereact/autocomplete';
|
|
4
|
+
import { CheckboxChangeEvent } from 'primereact/checkbox';
|
|
4
5
|
import { ChipRemoveEvent } from 'primereact/chip';
|
|
5
6
|
import { MenuItemCommandEvent } from 'primereact/menuitem';
|
|
7
|
+
import { RadioButtonChangeEvent } from 'primereact/radiobutton';
|
|
8
|
+
import { InputSwitchChangeEvent } from 'primereact/inputswitch';
|
|
6
9
|
|
|
7
10
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
8
11
|
type InputVariant = 'outline' | 'filled';
|
|
@@ -68,6 +71,43 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
68
71
|
}
|
|
69
72
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
70
73
|
|
|
74
|
+
/** Padding no Figma: X-Small (8px), Small (12px), Medium (16px), Large (20px) e X-Large (24px). */
|
|
75
|
+
type CardPadding = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
76
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
77
|
+
padding?: CardPadding;
|
|
78
|
+
/** Outline no Figma: borda de 1px em stroke/neutral/base. */
|
|
79
|
+
outline?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
|
|
83
|
+
/** Label Position no Figma: lado da caixa em relação ao rótulo. */
|
|
84
|
+
type CheckboxPosition = 'left' | 'right';
|
|
85
|
+
/** Label Type no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
86
|
+
type CheckboxLabelSize = 'default' | 'full';
|
|
87
|
+
interface CheckboxProps {
|
|
88
|
+
/** Texto ao lado da caixa (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
89
|
+
label: ReactNode;
|
|
90
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
91
|
+
showLabel?: boolean;
|
|
92
|
+
/** Lado da caixa. Padrão: left. */
|
|
93
|
+
position?: CheckboxPosition;
|
|
94
|
+
/** Padrão: default. */
|
|
95
|
+
labelSize?: CheckboxLabelSize;
|
|
96
|
+
checked?: boolean;
|
|
97
|
+
/** Type=Indeterminate no Figma: traço no lugar do check; o leitor de tela anuncia "misto". */
|
|
98
|
+
indeterminate?: boolean;
|
|
99
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
required?: boolean;
|
|
102
|
+
name?: string;
|
|
103
|
+
value?: unknown;
|
|
104
|
+
/** Vai no <input>. */
|
|
105
|
+
id?: string;
|
|
106
|
+
className?: string;
|
|
107
|
+
style?: CSSProperties;
|
|
108
|
+
}
|
|
109
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
110
|
+
|
|
71
111
|
/** Type no Figma. */
|
|
72
112
|
type ChipVariant = 'default' | 'success' | 'danger' | 'warning' | 'info' | 'highlight' | 'inverse' | 'outline' | 'neutral' | 'on-image';
|
|
73
113
|
/** Size no Figma: small = 24px, medium = 28px, large = 32px, x-large = 36px de altura. */
|
|
@@ -102,6 +142,37 @@ interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>
|
|
|
102
142
|
}
|
|
103
143
|
declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
|
|
104
144
|
|
|
145
|
+
/** Side no Figma: de que lado da tela a gaveta abre. */
|
|
146
|
+
type DrawerSide = 'right' | 'left';
|
|
147
|
+
/**
|
|
148
|
+
* Behavior no Figma: Full Body (tudo rola junto) ou Fixed Body (cabeçalho e rodapé fixos, só o
|
|
149
|
+
* corpo rola).
|
|
150
|
+
*/
|
|
151
|
+
type DrawerBehavior = 'full' | 'fixed';
|
|
152
|
+
interface DrawerProps {
|
|
153
|
+
visible: boolean;
|
|
154
|
+
/** Pedido para fechar (X, Esc ou clique no overlay). */
|
|
155
|
+
onHide: () => void;
|
|
156
|
+
/** Título do cabeçalho; também é o nome acessível da gaveta. */
|
|
157
|
+
title: string;
|
|
158
|
+
/** Subtítulo descritivo, até 2 linhas. */
|
|
159
|
+
subtitle?: ReactNode;
|
|
160
|
+
/** Padrão: right. */
|
|
161
|
+
side?: DrawerSide;
|
|
162
|
+
/** Padrão: full. */
|
|
163
|
+
behavior?: DrawerBehavior;
|
|
164
|
+
/** Mostra o botão de voltar antes do título. */
|
|
165
|
+
onBack?: () => void;
|
|
166
|
+
backLabel?: string;
|
|
167
|
+
closeLabel?: string;
|
|
168
|
+
/** Botões do rodapé, alinhados à direita. */
|
|
169
|
+
footer?: ReactNode;
|
|
170
|
+
children?: ReactNode;
|
|
171
|
+
id?: string;
|
|
172
|
+
className?: string;
|
|
173
|
+
}
|
|
174
|
+
declare function Drawer({ visible, onHide, title, subtitle, side, behavior, onBack, backLabel, closeLabel, footer, children, id, className, }: DrawerProps): react.JSX.Element;
|
|
175
|
+
|
|
105
176
|
/**
|
|
106
177
|
* Hierarchy no Figma: Primary (Filled), Secondary (Tonal), Tertiary (Outlined) e Other (Icon),
|
|
107
178
|
* que aqui é `ghost`: só o ícone, com fundo no hover.
|
|
@@ -218,6 +289,33 @@ interface MenubarProps {
|
|
|
218
289
|
}
|
|
219
290
|
declare const Menubar: react.ForwardRefExoticComponent<MenubarProps & react.RefAttributes<HTMLDivElement>>;
|
|
220
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
|
|
294
|
+
* vira tela cheia, como o Responsive=360 do Figma).
|
|
295
|
+
*/
|
|
296
|
+
type ModalSize = 'small' | 'medium' | 'large';
|
|
297
|
+
interface ModalProps {
|
|
298
|
+
visible: boolean;
|
|
299
|
+
/** Pedido para fechar (X ou Esc). */
|
|
300
|
+
onHide: () => void;
|
|
301
|
+
/** Título do cabeçalho; também é o nome acessível do modal. */
|
|
302
|
+
title: string;
|
|
303
|
+
/** Padrão: large. */
|
|
304
|
+
size?: ModalSize;
|
|
305
|
+
/** Mostra o botão de ajuda (QuestionMark) ao lado do X, no small e no medium. */
|
|
306
|
+
onHelp?: () => void;
|
|
307
|
+
helpLabel?: string;
|
|
308
|
+
closeLabel?: string;
|
|
309
|
+
/** Botões do rodapé, à direita. */
|
|
310
|
+
footer?: ReactNode;
|
|
311
|
+
/** Conteúdo do rodapé à esquerda (ex.: o botão secundário dos Two/Tree Buttons do Figma). */
|
|
312
|
+
footerStart?: ReactNode;
|
|
313
|
+
children?: ReactNode;
|
|
314
|
+
id?: string;
|
|
315
|
+
className?: string;
|
|
316
|
+
}
|
|
317
|
+
declare function Modal({ visible, onHide, title, size, onHelp, helpLabel, closeLabel, footer, footerStart, children, id, className, }: ModalProps): react.JSX.Element;
|
|
318
|
+
|
|
221
319
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
222
320
|
type MultiSelectVariant = 'outline' | 'filled';
|
|
223
321
|
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
@@ -270,6 +368,156 @@ interface MultiSelectProps {
|
|
|
270
368
|
}
|
|
271
369
|
declare const MultiSelect: react.ForwardRefExoticComponent<MultiSelectProps & react.RefAttributes<HTMLInputElement>>;
|
|
272
370
|
|
|
371
|
+
type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
|
|
372
|
+
declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
373
|
+
|
|
374
|
+
/** Label Size no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
375
|
+
type RadioLabelSize = 'default' | 'full';
|
|
376
|
+
interface RadioProps {
|
|
377
|
+
/** Texto ao lado do controle (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
378
|
+
label: ReactNode;
|
|
379
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
380
|
+
showLabel?: boolean;
|
|
381
|
+
/** Padrão: default. */
|
|
382
|
+
labelSize?: RadioLabelSize;
|
|
383
|
+
checked?: boolean;
|
|
384
|
+
/** Valor da opção, devolvido no `onChange`. */
|
|
385
|
+
value?: unknown;
|
|
386
|
+
/** Nome do grupo: radios com o mesmo `name` se excluem e navegam pelas setas. */
|
|
387
|
+
name?: string;
|
|
388
|
+
onChange?: (event: RadioButtonChangeEvent) => void;
|
|
389
|
+
disabled?: boolean;
|
|
390
|
+
required?: boolean;
|
|
391
|
+
/** Vai no <input>. */
|
|
392
|
+
id?: string;
|
|
393
|
+
className?: string;
|
|
394
|
+
style?: CSSProperties;
|
|
395
|
+
}
|
|
396
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
397
|
+
|
|
398
|
+
interface ScrollPanelProps {
|
|
399
|
+
children?: ReactNode;
|
|
400
|
+
/** O que a área mostra, para o leitor de tela (ex.: "Histórico da carga"). */
|
|
401
|
+
'aria-label'?: string;
|
|
402
|
+
'aria-labelledby'?: string;
|
|
403
|
+
/** Dê uma altura (ou max-height) para a área rolar. */
|
|
404
|
+
style?: CSSProperties;
|
|
405
|
+
id?: string;
|
|
406
|
+
className?: string;
|
|
407
|
+
}
|
|
408
|
+
declare const ScrollPanel: react.ForwardRefExoticComponent<ScrollPanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* No Figma: Primary é o Header Segment Control (pílula em fill/brand/subtlest) e Secondary é o
|
|
412
|
+
* Segment Control (cinza, com ícones).
|
|
413
|
+
*/
|
|
414
|
+
type SegmentControlVariant = 'primary' | 'secondary';
|
|
415
|
+
interface SegmentControlOption {
|
|
416
|
+
label: string;
|
|
417
|
+
value: string | number;
|
|
418
|
+
/** Ícone de 16px antes do texto (o Secondary do Figma usa). */
|
|
419
|
+
icon?: ReactNode;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
}
|
|
422
|
+
interface SegmentControlProps {
|
|
423
|
+
options: SegmentControlOption[];
|
|
424
|
+
/** Valor do segmento ativo (controlado). */
|
|
425
|
+
value?: string | number;
|
|
426
|
+
onChange?: (value: string | number) => void;
|
|
427
|
+
variant?: SegmentControlVariant;
|
|
428
|
+
/** O que o grupo controla, para o leitor de tela (ex.: "Visualização"). */
|
|
429
|
+
'aria-label'?: string;
|
|
430
|
+
'aria-labelledby'?: string;
|
|
431
|
+
disabled?: boolean;
|
|
432
|
+
id?: string;
|
|
433
|
+
className?: string;
|
|
434
|
+
}
|
|
435
|
+
declare const SegmentControl: react.ForwardRefExoticComponent<SegmentControlProps & react.RefAttributes<HTMLDivElement>>;
|
|
436
|
+
|
|
437
|
+
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
438
|
+
type SelectVariant = 'outline' | 'filled';
|
|
439
|
+
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
440
|
+
type SelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
441
|
+
interface SelectProps {
|
|
442
|
+
variant?: SelectVariant;
|
|
443
|
+
size?: SelectSize;
|
|
444
|
+
/** Rótulo acima do campo (Label no Figma). Sem rótulo, passe `aria-label`. */
|
|
445
|
+
label?: string;
|
|
446
|
+
'aria-label'?: string;
|
|
447
|
+
/** Opções da lista. */
|
|
448
|
+
options: unknown[];
|
|
449
|
+
/** Campo da opção usado como texto (padrão: `label`). */
|
|
450
|
+
optionLabel?: string;
|
|
451
|
+
/** Campo da opção usado como valor; sem ele, o valor é a própria opção. */
|
|
452
|
+
optionValue?: string;
|
|
453
|
+
/** Valor selecionado (controlado). */
|
|
454
|
+
value?: unknown;
|
|
455
|
+
onChange?: (value: unknown) => void;
|
|
456
|
+
/** Texto do campo vazio (Field Text no Figma). */
|
|
457
|
+
placeholder?: string;
|
|
458
|
+
/** Dica abaixo do campo (Hint Info no Figma). */
|
|
459
|
+
hint?: string;
|
|
460
|
+
/** Mensagem de erro: deixa o campo no estado Error e mostra a dica de erro no lugar da dica. */
|
|
461
|
+
error?: string;
|
|
462
|
+
required?: boolean;
|
|
463
|
+
disabled?: boolean;
|
|
464
|
+
/** Vai no campo (combobox). */
|
|
465
|
+
id?: string;
|
|
466
|
+
name?: string;
|
|
467
|
+
className?: string;
|
|
468
|
+
}
|
|
469
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLInputElement>>;
|
|
470
|
+
|
|
471
|
+
/** Size no Figma: Medium (48x28) e Small (32x20). */
|
|
472
|
+
type SwitchSize = 'medium' | 'small';
|
|
473
|
+
/** Label Position no Figma: lado do rótulo em relação ao switch. */
|
|
474
|
+
type SwitchLabelPosition = 'right' | 'left';
|
|
475
|
+
interface SwitchProps {
|
|
476
|
+
/** Texto ao lado do switch (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
477
|
+
label: ReactNode;
|
|
478
|
+
/** Mostra o rótulo. Padrão: true. */
|
|
479
|
+
showLabel?: boolean;
|
|
480
|
+
/** Padrão: right. */
|
|
481
|
+
labelPosition?: SwitchLabelPosition;
|
|
482
|
+
/** Padrão: medium. */
|
|
483
|
+
size?: SwitchSize;
|
|
484
|
+
checked?: boolean;
|
|
485
|
+
onChange?: (event: InputSwitchChangeEvent) => void;
|
|
486
|
+
disabled?: boolean;
|
|
487
|
+
name?: string;
|
|
488
|
+
/** Vai no <input>. */
|
|
489
|
+
id?: string;
|
|
490
|
+
className?: string;
|
|
491
|
+
style?: CSSProperties;
|
|
492
|
+
}
|
|
493
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
|
|
494
|
+
|
|
495
|
+
/** Uma aba (.Tab Item no Figma) e o conteúdo dela. */
|
|
496
|
+
interface TabPanelProps {
|
|
497
|
+
/** Texto da aba (Label no Figma). */
|
|
498
|
+
header: string;
|
|
499
|
+
/** Ícone antes do texto (Leading Icon no Figma). */
|
|
500
|
+
leftIcon?: ReactNode;
|
|
501
|
+
/** Contador depois do texto (Badge no Figma). */
|
|
502
|
+
badge?: ReactNode;
|
|
503
|
+
/** Mostra o X (Tab Btn no Figma) e é chamado ao fechar a aba (clique no X ou Delete na aba). */
|
|
504
|
+
onClose?: () => void;
|
|
505
|
+
disabled?: boolean;
|
|
506
|
+
children?: ReactNode;
|
|
507
|
+
}
|
|
508
|
+
/** Só descreve a aba: quem desenha é o Tabs. */
|
|
509
|
+
declare function TabPanel(_props: TabPanelProps): null;
|
|
510
|
+
interface TabsProps {
|
|
511
|
+
/** Aba ativa (controlado). Sem ela, o Tabs controla sozinho. */
|
|
512
|
+
activeIndex?: number;
|
|
513
|
+
onTabChange?: (index: number) => void;
|
|
514
|
+
/** As abas, como `<TabPanel>`. */
|
|
515
|
+
children: ReactNode;
|
|
516
|
+
id?: string;
|
|
517
|
+
className?: string;
|
|
518
|
+
}
|
|
519
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
520
|
+
|
|
273
521
|
/** Type no Figma. */
|
|
274
522
|
type TagVariant = 'default' | 'success' | 'warning' | 'danger' | 'info' | 'purple' | 'gray' | 'inverse' | 'outline';
|
|
275
523
|
/** Size no Figma: small = 24px, medium = 28px, large = 32px, x-large = 36px de altura. */
|
|
@@ -305,5 +553,5 @@ interface TooltipProps {
|
|
|
305
553
|
}
|
|
306
554
|
declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
|
|
307
555
|
|
|
308
|
-
export { AutoComplete, Badge, Button, Chip, Divider, IconButton, Input, Menu, Menubar, MultiSelect, Tag, Tooltip };
|
|
309
|
-
export type { AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuProps, MenubarProps, MenubarTool, MenubarUser, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
|
|
556
|
+
export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, Menubar, Modal, MultiSelect, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
|
|
557
|
+
export type { AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerProps, DrawerSide, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuProps, MenubarProps, MenubarTool, MenubarUser, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
|