@vector-business-services/cristal-ds-web 0.13.1 → 0.15.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 +201 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +92 -287
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +51 -23
- package/dist/index.d.ts +51 -23
- package/dist/index.js +203 -108
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, InputHTMLAttributes,
|
|
2
|
+
import { HTMLAttributes, ReactNode, InputHTMLAttributes, ButtonHTMLAttributes, CSSProperties, RefObject, SyntheticEvent, MouseEvent } from 'react';
|
|
3
3
|
import { AutoCompleteProps as AutoCompleteProps$1 } from 'primereact/autocomplete';
|
|
4
4
|
import { CheckboxChangeEvent } from 'primereact/checkbox';
|
|
5
5
|
import { ChipRemoveEvent } from 'primereact/chip';
|
|
@@ -22,7 +22,7 @@ interface AccordionTabProps {
|
|
|
22
22
|
}
|
|
23
23
|
/** Só descreve o item: quem desenha é o Accordion. */
|
|
24
24
|
declare function AccordionTab(_props: AccordionTabProps): null;
|
|
25
|
-
interface AccordionProps {
|
|
25
|
+
interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
26
26
|
/** Mais de um item aberto ao mesmo tempo. */
|
|
27
27
|
multiple?: boolean;
|
|
28
28
|
/**
|
|
@@ -139,7 +139,7 @@ interface ChartAxis {
|
|
|
139
139
|
/** Distância entre as marcas (ex.: 50). */
|
|
140
140
|
stepSize?: number;
|
|
141
141
|
}
|
|
142
|
-
interface ChartProps {
|
|
142
|
+
interface ChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'> {
|
|
143
143
|
/** Linhas com área (Chart / Line) ou barras (Chart / Bar). Padrão: line. */
|
|
144
144
|
type?: 'line' | 'bar';
|
|
145
145
|
/** Barras empilhadas: as séries somam numa barra só por rótulo. */
|
|
@@ -164,13 +164,14 @@ interface ChartProps {
|
|
|
164
164
|
id?: string;
|
|
165
165
|
className?: string;
|
|
166
166
|
}
|
|
167
|
-
declare
|
|
167
|
+
declare const Chart: react.ForwardRefExoticComponent<ChartProps & react.RefAttributes<HTMLDivElement>>;
|
|
168
168
|
|
|
169
169
|
/** Label Position no Figma: lado da caixa em relação ao rótulo. */
|
|
170
170
|
type CheckboxPosition = 'left' | 'right';
|
|
171
171
|
/** Label Type no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
172
172
|
type CheckboxLabelSize = 'default' | 'full';
|
|
173
|
-
|
|
173
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
174
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
174
175
|
/** Texto ao lado da caixa (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
175
176
|
label: ReactNode;
|
|
176
177
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -240,7 +241,12 @@ type DrawerBehavior = 'full' | 'fixed';
|
|
|
240
241
|
* tela toda) são do Cristal, nas faixas usuais de drawer.
|
|
241
242
|
*/
|
|
242
243
|
type DrawerSize = 'small' | 'medium' | 'large' | 'full';
|
|
243
|
-
|
|
244
|
+
/** Controle do Drawer pela ref: o elemento só existe com a gaveta aberta. */
|
|
245
|
+
interface DrawerHandle {
|
|
246
|
+
/** A raiz da gaveta, o role=dialog (null fechada). */
|
|
247
|
+
getElement: () => HTMLDivElement | null;
|
|
248
|
+
}
|
|
249
|
+
interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children' | 'content'> {
|
|
244
250
|
visible: boolean;
|
|
245
251
|
/** Pedido para fechar (X, Esc ou clique no overlay). */
|
|
246
252
|
onHide: () => void;
|
|
@@ -269,7 +275,7 @@ interface DrawerProps {
|
|
|
269
275
|
id?: string;
|
|
270
276
|
className?: string;
|
|
271
277
|
}
|
|
272
|
-
declare
|
|
278
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<DrawerHandle>>;
|
|
273
279
|
|
|
274
280
|
/** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
|
|
275
281
|
type TooltipType = 'plain' | 'rich';
|
|
@@ -339,7 +345,7 @@ interface MenuItem {
|
|
|
339
345
|
id?: string;
|
|
340
346
|
className?: string;
|
|
341
347
|
}
|
|
342
|
-
interface MenuProps {
|
|
348
|
+
interface MenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
343
349
|
model: MenuItem[];
|
|
344
350
|
density?: MenuDensity;
|
|
345
351
|
/** Abre sobre a tela, posicionado no elemento que chamou `toggle`/`show` pela ref. */
|
|
@@ -391,7 +397,7 @@ interface MenubarUser {
|
|
|
391
397
|
/** URL da foto. Sem foto, o avatar mostra a inicial do nome (Type=No Image). */
|
|
392
398
|
avatar?: string;
|
|
393
399
|
}
|
|
394
|
-
interface MenubarProps {
|
|
400
|
+
interface MenubarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
395
401
|
/** Logo à esquerda (.Nav Logo no Figma); o padrão é o logo da Vector. */
|
|
396
402
|
logo?: ReactNode;
|
|
397
403
|
/** Menu principal aberto: deixa o botão de menu no estado Active. */
|
|
@@ -430,6 +436,8 @@ interface MenuPrincipalItem {
|
|
|
430
436
|
icon: ReactNode;
|
|
431
437
|
/** Texto da tag no canto (Show Tag no Figma, onde é "Experimente"). */
|
|
432
438
|
tag?: string;
|
|
439
|
+
/** Ícone da tag. Padrão: DribbbleLogo, o do Figma. */
|
|
440
|
+
tagIcon?: ReactNode;
|
|
433
441
|
/** Ação do item; o menu popup fecha depois dela. */
|
|
434
442
|
command?: (event: MenuItemCommandEvent) => void;
|
|
435
443
|
/** Link do item; sem ele o clique não navega. */
|
|
@@ -446,7 +454,7 @@ interface MenuPrincipalGroup {
|
|
|
446
454
|
id?: string;
|
|
447
455
|
}
|
|
448
456
|
type MenuPrincipalEntry = MenuPrincipalItem | MenuPrincipalGroup;
|
|
449
|
-
interface MenuPrincipalProps {
|
|
457
|
+
interface MenuPrincipalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
450
458
|
/** Itens soltos e grupos, na ordem; o divisor tracejado entra antes e depois de cada grupo. */
|
|
451
459
|
model: MenuPrincipalEntry[];
|
|
452
460
|
/** Abre sobre a tela, posicionado no elemento que chamou `toggle`/`show` pela ref. */
|
|
@@ -470,7 +478,7 @@ declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps
|
|
|
470
478
|
|
|
471
479
|
/** Type no Figma. */
|
|
472
480
|
type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
|
|
473
|
-
interface MessageProps {
|
|
481
|
+
interface MessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {
|
|
474
482
|
/** Padrão: info. */
|
|
475
483
|
type?: MessageType;
|
|
476
484
|
/** Texto (Message no Figma). */
|
|
@@ -487,10 +495,20 @@ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefA
|
|
|
487
495
|
* vira tela cheia, como o Responsive=360 do Figma).
|
|
488
496
|
*/
|
|
489
497
|
type ModalSize = 'small' | 'medium' | 'large';
|
|
490
|
-
|
|
498
|
+
/** Controle do Modal pela ref: o elemento só existe com o modal aberto. */
|
|
499
|
+
interface ModalHandle {
|
|
500
|
+
/** O role=dialog do modal (null fechado). */
|
|
501
|
+
getElement: () => HTMLDivElement | null;
|
|
502
|
+
}
|
|
503
|
+
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children' | 'content' | 'onClick'> {
|
|
491
504
|
visible: boolean;
|
|
492
|
-
/** Pedido para fechar (X ou
|
|
505
|
+
/** Pedido para fechar (X, Esc ou clique fora, com dismissableMask). */
|
|
493
506
|
onHide: () => void;
|
|
507
|
+
/**
|
|
508
|
+
* Fecha com o clique no overlay, fora do modal. Padrão: true, como o Drawer. Desligue quando
|
|
509
|
+
* fechar por engano faz perder algo (formulário preenchido, confirmação importante).
|
|
510
|
+
*/
|
|
511
|
+
dismissableMask?: boolean;
|
|
494
512
|
/** Título do cabeçalho; também é o nome acessível do modal. */
|
|
495
513
|
title: string;
|
|
496
514
|
/** Padrão: large. */
|
|
@@ -507,7 +525,7 @@ interface ModalProps {
|
|
|
507
525
|
id?: string;
|
|
508
526
|
className?: string;
|
|
509
527
|
}
|
|
510
|
-
declare
|
|
528
|
+
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<ModalHandle>>;
|
|
511
529
|
|
|
512
530
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
513
531
|
type MultiSelectVariant = 'outline' | 'filled';
|
|
@@ -515,7 +533,11 @@ type MultiSelectVariant = 'outline' | 'filled';
|
|
|
515
533
|
type MultiSelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
516
534
|
/** Density da lista no Figma: itens de 40px (normal) ou 32px (compact). */
|
|
517
535
|
type MultiSelectDensity = 'normal' | 'compact';
|
|
518
|
-
|
|
536
|
+
/**
|
|
537
|
+
* As demais props vão para o MultiSelect do Prime: as aria-* no combobox (aria-describedby soma com
|
|
538
|
+
* a dica) e o resto na caixa do campo.
|
|
539
|
+
*/
|
|
540
|
+
interface MultiSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'children' | 'placeholder'> {
|
|
519
541
|
variant?: MultiSelectVariant;
|
|
520
542
|
size?: MultiSelectSize;
|
|
521
543
|
density?: MultiSelectDensity;
|
|
@@ -618,7 +640,7 @@ interface PaginatorPageChangeEvent {
|
|
|
618
640
|
page: number;
|
|
619
641
|
pageCount: number;
|
|
620
642
|
}
|
|
621
|
-
interface PaginatorProps {
|
|
643
|
+
interface PaginatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
622
644
|
totalRecords: number;
|
|
623
645
|
/** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
|
|
624
646
|
first?: number;
|
|
@@ -641,7 +663,8 @@ declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttri
|
|
|
641
663
|
|
|
642
664
|
/** Label Size no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
643
665
|
type RadioLabelSize = 'default' | 'full';
|
|
644
|
-
|
|
666
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
667
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
645
668
|
/** Texto ao lado do controle (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
646
669
|
label: ReactNode;
|
|
647
670
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -663,7 +686,7 @@ interface RadioProps {
|
|
|
663
686
|
}
|
|
664
687
|
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
665
688
|
|
|
666
|
-
interface ScrollPanelProps {
|
|
689
|
+
interface ScrollPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
667
690
|
children?: ReactNode;
|
|
668
691
|
/** O que a área mostra, para o leitor de tela (ex.: "Histórico da carga"). */
|
|
669
692
|
'aria-label'?: string;
|
|
@@ -687,7 +710,7 @@ interface SegmentControlOption {
|
|
|
687
710
|
icon?: ReactNode;
|
|
688
711
|
disabled?: boolean;
|
|
689
712
|
}
|
|
690
|
-
interface SegmentControlProps {
|
|
713
|
+
interface SegmentControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange' | 'defaultValue' | 'unselectable'> {
|
|
691
714
|
options: SegmentControlOption[];
|
|
692
715
|
/** Valor do segmento ativo (controlado). */
|
|
693
716
|
value?: string | number;
|
|
@@ -706,7 +729,11 @@ declare const SegmentControl: react.ForwardRefExoticComponent<SegmentControlProp
|
|
|
706
729
|
type SelectVariant = 'outline' | 'filled';
|
|
707
730
|
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
708
731
|
type SelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
709
|
-
|
|
732
|
+
/**
|
|
733
|
+
* As demais props vão para o Dropdown do Prime: as aria-* no combobox (aria-describedby soma com a
|
|
734
|
+
* dica) e o resto na caixa do campo.
|
|
735
|
+
*/
|
|
736
|
+
interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'children' | 'placeholder'> {
|
|
710
737
|
variant?: SelectVariant;
|
|
711
738
|
size?: SelectSize;
|
|
712
739
|
/** Rótulo acima do campo (Label no Figma). Sem rótulo, passe `aria-label`. */
|
|
@@ -740,7 +767,8 @@ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAtt
|
|
|
740
767
|
type SwitchSize = 'medium' | 'small';
|
|
741
768
|
/** Label Position no Figma: lado do rótulo em relação ao switch. */
|
|
742
769
|
type SwitchLabelPosition = 'right' | 'left';
|
|
743
|
-
|
|
770
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
771
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
744
772
|
/** Texto ao lado do switch (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
745
773
|
label: ReactNode;
|
|
746
774
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -775,7 +803,7 @@ interface TabPanelProps {
|
|
|
775
803
|
}
|
|
776
804
|
/** Só descreve a aba: quem desenha é o Tabs. */
|
|
777
805
|
declare function TabPanel(_props: TabPanelProps): null;
|
|
778
|
-
interface TabsProps {
|
|
806
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
779
807
|
/** Aba ativa (controlado). Sem ela, o Tabs controla sozinho. */
|
|
780
808
|
activeIndex?: number;
|
|
781
809
|
onTabChange?: (index: number) => void;
|
|
@@ -833,4 +861,4 @@ interface ToastProps {
|
|
|
833
861
|
declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
|
|
834
862
|
|
|
835
863
|
export { Accordion, AccordionTab, AutoComplete, Badge, Button, Card, Chart, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Message, Modal, MultiSelect, PageHeader, Paginator, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Toast, Tooltip };
|
|
836
|
-
export type { AccordionProps, AccordionTabProps, AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChartAxis, ChartColor, ChartProps, ChartSeries, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerProps, DrawerSide, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, MenuProps, MenubarProps, MenubarTool, MenubarUser, MessageProps, MessageType, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PaginatorPageChangeEvent, PaginatorProps, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, ToastHandle, ToastMessage, ToastPosition, ToastProps, ToastType, TooltipPosition, TooltipProps, TooltipType };
|
|
864
|
+
export type { AccordionProps, AccordionTabProps, AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChartAxis, ChartColor, ChartProps, ChartSeries, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerHandle, DrawerProps, DrawerSide, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, MenuProps, MenubarProps, MenubarTool, MenubarUser, MessageProps, MessageType, ModalHandle, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PaginatorPageChangeEvent, PaginatorProps, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, ToastHandle, ToastMessage, ToastPosition, ToastProps, ToastType, TooltipPosition, TooltipProps, TooltipType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, InputHTMLAttributes,
|
|
2
|
+
import { HTMLAttributes, ReactNode, InputHTMLAttributes, ButtonHTMLAttributes, CSSProperties, RefObject, SyntheticEvent, MouseEvent } from 'react';
|
|
3
3
|
import { AutoCompleteProps as AutoCompleteProps$1 } from 'primereact/autocomplete';
|
|
4
4
|
import { CheckboxChangeEvent } from 'primereact/checkbox';
|
|
5
5
|
import { ChipRemoveEvent } from 'primereact/chip';
|
|
@@ -22,7 +22,7 @@ interface AccordionTabProps {
|
|
|
22
22
|
}
|
|
23
23
|
/** Só descreve o item: quem desenha é o Accordion. */
|
|
24
24
|
declare function AccordionTab(_props: AccordionTabProps): null;
|
|
25
|
-
interface AccordionProps {
|
|
25
|
+
interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
26
26
|
/** Mais de um item aberto ao mesmo tempo. */
|
|
27
27
|
multiple?: boolean;
|
|
28
28
|
/**
|
|
@@ -139,7 +139,7 @@ interface ChartAxis {
|
|
|
139
139
|
/** Distância entre as marcas (ex.: 50). */
|
|
140
140
|
stepSize?: number;
|
|
141
141
|
}
|
|
142
|
-
interface ChartProps {
|
|
142
|
+
interface ChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'> {
|
|
143
143
|
/** Linhas com área (Chart / Line) ou barras (Chart / Bar). Padrão: line. */
|
|
144
144
|
type?: 'line' | 'bar';
|
|
145
145
|
/** Barras empilhadas: as séries somam numa barra só por rótulo. */
|
|
@@ -164,13 +164,14 @@ interface ChartProps {
|
|
|
164
164
|
id?: string;
|
|
165
165
|
className?: string;
|
|
166
166
|
}
|
|
167
|
-
declare
|
|
167
|
+
declare const Chart: react.ForwardRefExoticComponent<ChartProps & react.RefAttributes<HTMLDivElement>>;
|
|
168
168
|
|
|
169
169
|
/** Label Position no Figma: lado da caixa em relação ao rótulo. */
|
|
170
170
|
type CheckboxPosition = 'left' | 'right';
|
|
171
171
|
/** Label Type no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
172
172
|
type CheckboxLabelSize = 'default' | 'full';
|
|
173
|
-
|
|
173
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
174
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
174
175
|
/** Texto ao lado da caixa (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
175
176
|
label: ReactNode;
|
|
176
177
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -240,7 +241,12 @@ type DrawerBehavior = 'full' | 'fixed';
|
|
|
240
241
|
* tela toda) são do Cristal, nas faixas usuais de drawer.
|
|
241
242
|
*/
|
|
242
243
|
type DrawerSize = 'small' | 'medium' | 'large' | 'full';
|
|
243
|
-
|
|
244
|
+
/** Controle do Drawer pela ref: o elemento só existe com a gaveta aberta. */
|
|
245
|
+
interface DrawerHandle {
|
|
246
|
+
/** A raiz da gaveta, o role=dialog (null fechada). */
|
|
247
|
+
getElement: () => HTMLDivElement | null;
|
|
248
|
+
}
|
|
249
|
+
interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children' | 'content'> {
|
|
244
250
|
visible: boolean;
|
|
245
251
|
/** Pedido para fechar (X, Esc ou clique no overlay). */
|
|
246
252
|
onHide: () => void;
|
|
@@ -269,7 +275,7 @@ interface DrawerProps {
|
|
|
269
275
|
id?: string;
|
|
270
276
|
className?: string;
|
|
271
277
|
}
|
|
272
|
-
declare
|
|
278
|
+
declare const Drawer: react.ForwardRefExoticComponent<DrawerProps & react.RefAttributes<DrawerHandle>>;
|
|
273
279
|
|
|
274
280
|
/** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
|
|
275
281
|
type TooltipType = 'plain' | 'rich';
|
|
@@ -339,7 +345,7 @@ interface MenuItem {
|
|
|
339
345
|
id?: string;
|
|
340
346
|
className?: string;
|
|
341
347
|
}
|
|
342
|
-
interface MenuProps {
|
|
348
|
+
interface MenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
343
349
|
model: MenuItem[];
|
|
344
350
|
density?: MenuDensity;
|
|
345
351
|
/** Abre sobre a tela, posicionado no elemento que chamou `toggle`/`show` pela ref. */
|
|
@@ -391,7 +397,7 @@ interface MenubarUser {
|
|
|
391
397
|
/** URL da foto. Sem foto, o avatar mostra a inicial do nome (Type=No Image). */
|
|
392
398
|
avatar?: string;
|
|
393
399
|
}
|
|
394
|
-
interface MenubarProps {
|
|
400
|
+
interface MenubarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
395
401
|
/** Logo à esquerda (.Nav Logo no Figma); o padrão é o logo da Vector. */
|
|
396
402
|
logo?: ReactNode;
|
|
397
403
|
/** Menu principal aberto: deixa o botão de menu no estado Active. */
|
|
@@ -430,6 +436,8 @@ interface MenuPrincipalItem {
|
|
|
430
436
|
icon: ReactNode;
|
|
431
437
|
/** Texto da tag no canto (Show Tag no Figma, onde é "Experimente"). */
|
|
432
438
|
tag?: string;
|
|
439
|
+
/** Ícone da tag. Padrão: DribbbleLogo, o do Figma. */
|
|
440
|
+
tagIcon?: ReactNode;
|
|
433
441
|
/** Ação do item; o menu popup fecha depois dela. */
|
|
434
442
|
command?: (event: MenuItemCommandEvent) => void;
|
|
435
443
|
/** Link do item; sem ele o clique não navega. */
|
|
@@ -446,7 +454,7 @@ interface MenuPrincipalGroup {
|
|
|
446
454
|
id?: string;
|
|
447
455
|
}
|
|
448
456
|
type MenuPrincipalEntry = MenuPrincipalItem | MenuPrincipalGroup;
|
|
449
|
-
interface MenuPrincipalProps {
|
|
457
|
+
interface MenuPrincipalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
450
458
|
/** Itens soltos e grupos, na ordem; o divisor tracejado entra antes e depois de cada grupo. */
|
|
451
459
|
model: MenuPrincipalEntry[];
|
|
452
460
|
/** Abre sobre a tela, posicionado no elemento que chamou `toggle`/`show` pela ref. */
|
|
@@ -470,7 +478,7 @@ declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps
|
|
|
470
478
|
|
|
471
479
|
/** Type no Figma. */
|
|
472
480
|
type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
|
|
473
|
-
interface MessageProps {
|
|
481
|
+
interface MessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {
|
|
474
482
|
/** Padrão: info. */
|
|
475
483
|
type?: MessageType;
|
|
476
484
|
/** Texto (Message no Figma). */
|
|
@@ -487,10 +495,20 @@ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefA
|
|
|
487
495
|
* vira tela cheia, como o Responsive=360 do Figma).
|
|
488
496
|
*/
|
|
489
497
|
type ModalSize = 'small' | 'medium' | 'large';
|
|
490
|
-
|
|
498
|
+
/** Controle do Modal pela ref: o elemento só existe com o modal aberto. */
|
|
499
|
+
interface ModalHandle {
|
|
500
|
+
/** O role=dialog do modal (null fechado). */
|
|
501
|
+
getElement: () => HTMLDivElement | null;
|
|
502
|
+
}
|
|
503
|
+
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children' | 'content' | 'onClick'> {
|
|
491
504
|
visible: boolean;
|
|
492
|
-
/** Pedido para fechar (X ou
|
|
505
|
+
/** Pedido para fechar (X, Esc ou clique fora, com dismissableMask). */
|
|
493
506
|
onHide: () => void;
|
|
507
|
+
/**
|
|
508
|
+
* Fecha com o clique no overlay, fora do modal. Padrão: true, como o Drawer. Desligue quando
|
|
509
|
+
* fechar por engano faz perder algo (formulário preenchido, confirmação importante).
|
|
510
|
+
*/
|
|
511
|
+
dismissableMask?: boolean;
|
|
494
512
|
/** Título do cabeçalho; também é o nome acessível do modal. */
|
|
495
513
|
title: string;
|
|
496
514
|
/** Padrão: large. */
|
|
@@ -507,7 +525,7 @@ interface ModalProps {
|
|
|
507
525
|
id?: string;
|
|
508
526
|
className?: string;
|
|
509
527
|
}
|
|
510
|
-
declare
|
|
528
|
+
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<ModalHandle>>;
|
|
511
529
|
|
|
512
530
|
/** Type no Figma: Outline (com borda) e Filled (com fundo). */
|
|
513
531
|
type MultiSelectVariant = 'outline' | 'filled';
|
|
@@ -515,7 +533,11 @@ type MultiSelectVariant = 'outline' | 'filled';
|
|
|
515
533
|
type MultiSelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
516
534
|
/** Density da lista no Figma: itens de 40px (normal) ou 32px (compact). */
|
|
517
535
|
type MultiSelectDensity = 'normal' | 'compact';
|
|
518
|
-
|
|
536
|
+
/**
|
|
537
|
+
* As demais props vão para o MultiSelect do Prime: as aria-* no combobox (aria-describedby soma com
|
|
538
|
+
* a dica) e o resto na caixa do campo.
|
|
539
|
+
*/
|
|
540
|
+
interface MultiSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'children' | 'placeholder'> {
|
|
519
541
|
variant?: MultiSelectVariant;
|
|
520
542
|
size?: MultiSelectSize;
|
|
521
543
|
density?: MultiSelectDensity;
|
|
@@ -618,7 +640,7 @@ interface PaginatorPageChangeEvent {
|
|
|
618
640
|
page: number;
|
|
619
641
|
pageCount: number;
|
|
620
642
|
}
|
|
621
|
-
interface PaginatorProps {
|
|
643
|
+
interface PaginatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
622
644
|
totalRecords: number;
|
|
623
645
|
/** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
|
|
624
646
|
first?: number;
|
|
@@ -641,7 +663,8 @@ declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttri
|
|
|
641
663
|
|
|
642
664
|
/** Label Size no Figma: Default (uma linha, com reticências) e Full (quebra em várias linhas). */
|
|
643
665
|
type RadioLabelSize = 'default' | 'full';
|
|
644
|
-
|
|
666
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
667
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
645
668
|
/** Texto ao lado do controle (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
646
669
|
label: ReactNode;
|
|
647
670
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -663,7 +686,7 @@ interface RadioProps {
|
|
|
663
686
|
}
|
|
664
687
|
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
665
688
|
|
|
666
|
-
interface ScrollPanelProps {
|
|
689
|
+
interface ScrollPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
667
690
|
children?: ReactNode;
|
|
668
691
|
/** O que a área mostra, para o leitor de tela (ex.: "Histórico da carga"). */
|
|
669
692
|
'aria-label'?: string;
|
|
@@ -687,7 +710,7 @@ interface SegmentControlOption {
|
|
|
687
710
|
icon?: ReactNode;
|
|
688
711
|
disabled?: boolean;
|
|
689
712
|
}
|
|
690
|
-
interface SegmentControlProps {
|
|
713
|
+
interface SegmentControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange' | 'defaultValue' | 'unselectable'> {
|
|
691
714
|
options: SegmentControlOption[];
|
|
692
715
|
/** Valor do segmento ativo (controlado). */
|
|
693
716
|
value?: string | number;
|
|
@@ -706,7 +729,11 @@ declare const SegmentControl: react.ForwardRefExoticComponent<SegmentControlProp
|
|
|
706
729
|
type SelectVariant = 'outline' | 'filled';
|
|
707
730
|
/** Size no Figma: 32, 36, 42 e 48px de altura do campo. */
|
|
708
731
|
type SelectSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
709
|
-
|
|
732
|
+
/**
|
|
733
|
+
* As demais props vão para o Dropdown do Prime: as aria-* no combobox (aria-describedby soma com a
|
|
734
|
+
* dica) e o resto na caixa do campo.
|
|
735
|
+
*/
|
|
736
|
+
interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'children' | 'placeholder'> {
|
|
710
737
|
variant?: SelectVariant;
|
|
711
738
|
size?: SelectSize;
|
|
712
739
|
/** Rótulo acima do campo (Label no Figma). Sem rótulo, passe `aria-label`. */
|
|
@@ -740,7 +767,8 @@ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAtt
|
|
|
740
767
|
type SwitchSize = 'medium' | 'small';
|
|
741
768
|
/** Label Position no Figma: lado do rótulo em relação ao switch. */
|
|
742
769
|
type SwitchLabelPosition = 'right' | 'left';
|
|
743
|
-
|
|
770
|
+
/** As demais props vão no <input> (aria-describedby, onBlur, data-*...); className e style, na raiz. */
|
|
771
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'checked' | 'defaultChecked' | 'defaultValue' | 'size' | 'type' | 'children'> {
|
|
744
772
|
/** Texto ao lado do switch (Label no Figma). Sem rótulo visível, vira o nome acessível. */
|
|
745
773
|
label: ReactNode;
|
|
746
774
|
/** Mostra o rótulo. Padrão: true. */
|
|
@@ -775,7 +803,7 @@ interface TabPanelProps {
|
|
|
775
803
|
}
|
|
776
804
|
/** Só descreve a aba: quem desenha é o Tabs. */
|
|
777
805
|
declare function TabPanel(_props: TabPanelProps): null;
|
|
778
|
-
interface TabsProps {
|
|
806
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
779
807
|
/** Aba ativa (controlado). Sem ela, o Tabs controla sozinho. */
|
|
780
808
|
activeIndex?: number;
|
|
781
809
|
onTabChange?: (index: number) => void;
|
|
@@ -833,4 +861,4 @@ interface ToastProps {
|
|
|
833
861
|
declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
|
|
834
862
|
|
|
835
863
|
export { Accordion, AccordionTab, AutoComplete, Badge, Button, Card, Chart, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Message, Modal, MultiSelect, PageHeader, Paginator, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Toast, Tooltip };
|
|
836
|
-
export type { AccordionProps, AccordionTabProps, AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChartAxis, ChartColor, ChartProps, ChartSeries, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerProps, DrawerSide, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, MenuProps, MenubarProps, MenubarTool, MenubarUser, MessageProps, MessageType, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PaginatorPageChangeEvent, PaginatorProps, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, ToastHandle, ToastMessage, ToastPosition, ToastProps, ToastType, TooltipPosition, TooltipProps, TooltipType };
|
|
864
|
+
export type { AccordionProps, AccordionTabProps, AutoCompleteProps, AutoCompleteSize, AutoCompleteVariant, BadgeProps, BadgeSize, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChartAxis, ChartColor, ChartProps, ChartSeries, CheckboxLabelSize, CheckboxPosition, CheckboxProps, ChipProps, ChipSize, ChipVariant, DividerOrientation, DividerProps, DividerVariant, DrawerBehavior, DrawerHandle, DrawerProps, DrawerSide, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, MenuProps, MenubarProps, MenubarTool, MenubarUser, MessageProps, MessageType, ModalHandle, ModalProps, ModalSize, MultiSelectDensity, MultiSelectProps, MultiSelectSize, MultiSelectVariant, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PaginatorPageChangeEvent, PaginatorProps, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, ToastHandle, ToastMessage, ToastPosition, ToastProps, ToastType, TooltipPosition, TooltipProps, TooltipType };
|