@vector-business-services/cristal-ds-web 0.8.0 → 0.10.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.d.cts CHANGED
@@ -6,6 +6,7 @@ import { ChipRemoveEvent } from 'primereact/chip';
6
6
  import { MenuItemCommandEvent } from 'primereact/menuitem';
7
7
  import { RadioButtonChangeEvent } from 'primereact/radiobutton';
8
8
  import { InputSwitchChangeEvent } from 'primereact/inputswitch';
9
+ import { ToastProps as ToastProps$1 } from 'primereact/toast';
9
10
 
10
11
  /** Type no Figma: Outline (com borda) e Filled (com fundo). */
11
12
  type InputVariant = 'outline' | 'filled';
@@ -349,6 +350,20 @@ interface MenuPrincipalHandle {
349
350
  }
350
351
  declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps & react.RefAttributes<MenuPrincipalHandle>>;
351
352
 
353
+ /** Type no Figma. */
354
+ type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
355
+ interface MessageProps {
356
+ /** Padrão: info. */
357
+ type?: MessageType;
358
+ /** Texto (Message no Figma). */
359
+ children: ReactNode;
360
+ /** Show Icon no Figma. Padrão: true. */
361
+ showIcon?: boolean;
362
+ id?: string;
363
+ className?: string;
364
+ }
365
+ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefAttributes<HTMLDivElement>>;
366
+
352
367
  /**
353
368
  * Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
354
369
  * vira tela cheia, como o Responsive=360 do Figma).
@@ -428,6 +443,73 @@ interface MultiSelectProps {
428
443
  }
429
444
  declare const MultiSelect: react.ForwardRefExoticComponent<MultiSelectProps & react.RefAttributes<HTMLInputElement>>;
430
445
 
446
+ /**
447
+ * Type no Figma: o estilo das abas. Primary tem o ícone em círculo e o fundo azul na aba ativa;
448
+ * Secondary é só o texto, com o sublinhado na ativa.
449
+ */
450
+ type PageHeaderVariant = 'primary' | 'secondary';
451
+ /** Uma aba (.Page Header Tab Item ou .Page Header Tab Secondary Item no Figma). */
452
+ interface PageHeaderTab {
453
+ label: string;
454
+ /** Ícone de 16px. No primary fica no círculo de 32px; no secondary é opcional. */
455
+ icon?: ReactNode;
456
+ disabled?: boolean;
457
+ }
458
+ interface PageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
459
+ /** Título da página (Page Title no Figma). */
460
+ title: string;
461
+ /** Padrão: primary. */
462
+ variant?: PageHeaderVariant;
463
+ /** Mostra o botão de voltar antes do título (Show Back Button no Figma). */
464
+ onBack?: () => void;
465
+ backLabel?: string;
466
+ /** Texto da Tag depois do título (Show Tag no Figma). */
467
+ tag?: ReactNode;
468
+ /** Segment Control das ferramentas (Show Segment Control no Figma): um `<SegmentControl>`. */
469
+ segmentControl?: ReactNode;
470
+ /** Botões das ferramentas (Show Buttons no Figma), 8px entre eles. */
471
+ actions?: ReactNode;
472
+ /** Mostra o botão de expandir, o último das ferramentas. */
473
+ onExpand?: () => void;
474
+ expandLabel?: string;
475
+ /** Abas abaixo do título (Show Tabs no Figma). */
476
+ tabs?: PageHeaderTab[];
477
+ /** Aba ativa (controlado). Sem ela, o PageHeader controla sozinho. */
478
+ activeTab?: number;
479
+ onTabChange?: (index: number) => void;
480
+ /** Nome das abas para o leitor de tela. Padrão: o título. */
481
+ tabsLabel?: string;
482
+ }
483
+ declare const PageHeader: react.ForwardRefExoticComponent<PageHeaderProps & react.RefAttributes<HTMLDivElement>>;
484
+
485
+ /** O que o onPageChange recebe (o mesmo evento do Prime). */
486
+ interface PaginatorPageChangeEvent {
487
+ /** Índice do primeiro item da página. */
488
+ first: number;
489
+ /** Itens por página. */
490
+ rows: number;
491
+ /** Página, a partir de 0. */
492
+ page: number;
493
+ pageCount: number;
494
+ }
495
+ interface PaginatorProps {
496
+ totalRecords: number;
497
+ /** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
498
+ first?: number;
499
+ /** Itens por página (controlado). Padrão: o primeiro de rowsPerPageOptions, ou 10. */
500
+ rows?: number;
501
+ /** Opções do Select de itens por página; sem elas, o Select não aparece. */
502
+ rowsPerPageOptions?: number[];
503
+ /** Quantos números de página aparecem. Padrão: 5, como no Figma. */
504
+ pageLinkSize?: number;
505
+ onPageChange?: (event: PaginatorPageChangeEvent) => void;
506
+ /** Nome do Select para o leitor de tela. */
507
+ rowsPerPageLabel?: string;
508
+ id?: string;
509
+ className?: string;
510
+ }
511
+ declare const Paginator: react.ForwardRefExoticComponent<PaginatorProps & react.RefAttributes<HTMLDivElement>>;
512
+
431
513
  type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
432
514
  declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
433
515
 
@@ -592,6 +674,38 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
592
674
  }
593
675
  declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
594
676
 
677
+ /** Type no Figma. */
678
+ type ToastType = 'warning' | 'danger' | 'success' | 'info';
679
+ /** Onde as mensagens aparecem na tela (o position do Prime). Padrão: top-right. */
680
+ type ToastPosition = NonNullable<ToastProps$1['position']>;
681
+ /** Uma mensagem, passada para `show()`. */
682
+ interface ToastMessage {
683
+ type: ToastType;
684
+ /** Title no Figma. */
685
+ title: string;
686
+ /** Message no Figma (Show Message content). */
687
+ message?: string;
688
+ /** Show Icon no Figma. Padrão: true. */
689
+ showIcon?: boolean;
690
+ /** Tempo na tela, em ms. Padrão do Prime: 3000. */
691
+ life?: number;
692
+ /** Fica até alguém fechar. */
693
+ sticky?: boolean;
694
+ }
695
+ /** O que a ref do Toast entrega. */
696
+ interface ToastHandle {
697
+ show: (message: ToastMessage | ToastMessage[]) => void;
698
+ clear: () => void;
699
+ }
700
+ interface ToastProps {
701
+ position?: ToastPosition;
702
+ /** Nome do X para o leitor de tela. */
703
+ closeLabel?: string;
704
+ id?: string;
705
+ className?: string;
706
+ }
707
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
708
+
595
709
  /** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
596
710
  type TooltipType = 'plain' | 'rich';
597
711
  type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
@@ -613,5 +727,5 @@ interface TooltipProps {
613
727
  }
614
728
  declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
615
729
 
616
- export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Modal, MultiSelect, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
617
- 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, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, 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 };
730
+ export { AutoComplete, Badge, Button, Card, 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 };
731
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ChipRemoveEvent } from 'primereact/chip';
6
6
  import { MenuItemCommandEvent } from 'primereact/menuitem';
7
7
  import { RadioButtonChangeEvent } from 'primereact/radiobutton';
8
8
  import { InputSwitchChangeEvent } from 'primereact/inputswitch';
9
+ import { ToastProps as ToastProps$1 } from 'primereact/toast';
9
10
 
10
11
  /** Type no Figma: Outline (com borda) e Filled (com fundo). */
11
12
  type InputVariant = 'outline' | 'filled';
@@ -349,6 +350,20 @@ interface MenuPrincipalHandle {
349
350
  }
350
351
  declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps & react.RefAttributes<MenuPrincipalHandle>>;
351
352
 
353
+ /** Type no Figma. */
354
+ type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
355
+ interface MessageProps {
356
+ /** Padrão: info. */
357
+ type?: MessageType;
358
+ /** Texto (Message no Figma). */
359
+ children: ReactNode;
360
+ /** Show Icon no Figma. Padrão: true. */
361
+ showIcon?: boolean;
362
+ id?: string;
363
+ className?: string;
364
+ }
365
+ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefAttributes<HTMLDivElement>>;
366
+
352
367
  /**
353
368
  * Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
354
369
  * vira tela cheia, como o Responsive=360 do Figma).
@@ -428,6 +443,73 @@ interface MultiSelectProps {
428
443
  }
429
444
  declare const MultiSelect: react.ForwardRefExoticComponent<MultiSelectProps & react.RefAttributes<HTMLInputElement>>;
430
445
 
446
+ /**
447
+ * Type no Figma: o estilo das abas. Primary tem o ícone em círculo e o fundo azul na aba ativa;
448
+ * Secondary é só o texto, com o sublinhado na ativa.
449
+ */
450
+ type PageHeaderVariant = 'primary' | 'secondary';
451
+ /** Uma aba (.Page Header Tab Item ou .Page Header Tab Secondary Item no Figma). */
452
+ interface PageHeaderTab {
453
+ label: string;
454
+ /** Ícone de 16px. No primary fica no círculo de 32px; no secondary é opcional. */
455
+ icon?: ReactNode;
456
+ disabled?: boolean;
457
+ }
458
+ interface PageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
459
+ /** Título da página (Page Title no Figma). */
460
+ title: string;
461
+ /** Padrão: primary. */
462
+ variant?: PageHeaderVariant;
463
+ /** Mostra o botão de voltar antes do título (Show Back Button no Figma). */
464
+ onBack?: () => void;
465
+ backLabel?: string;
466
+ /** Texto da Tag depois do título (Show Tag no Figma). */
467
+ tag?: ReactNode;
468
+ /** Segment Control das ferramentas (Show Segment Control no Figma): um `<SegmentControl>`. */
469
+ segmentControl?: ReactNode;
470
+ /** Botões das ferramentas (Show Buttons no Figma), 8px entre eles. */
471
+ actions?: ReactNode;
472
+ /** Mostra o botão de expandir, o último das ferramentas. */
473
+ onExpand?: () => void;
474
+ expandLabel?: string;
475
+ /** Abas abaixo do título (Show Tabs no Figma). */
476
+ tabs?: PageHeaderTab[];
477
+ /** Aba ativa (controlado). Sem ela, o PageHeader controla sozinho. */
478
+ activeTab?: number;
479
+ onTabChange?: (index: number) => void;
480
+ /** Nome das abas para o leitor de tela. Padrão: o título. */
481
+ tabsLabel?: string;
482
+ }
483
+ declare const PageHeader: react.ForwardRefExoticComponent<PageHeaderProps & react.RefAttributes<HTMLDivElement>>;
484
+
485
+ /** O que o onPageChange recebe (o mesmo evento do Prime). */
486
+ interface PaginatorPageChangeEvent {
487
+ /** Índice do primeiro item da página. */
488
+ first: number;
489
+ /** Itens por página. */
490
+ rows: number;
491
+ /** Página, a partir de 0. */
492
+ page: number;
493
+ pageCount: number;
494
+ }
495
+ interface PaginatorProps {
496
+ totalRecords: number;
497
+ /** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
498
+ first?: number;
499
+ /** Itens por página (controlado). Padrão: o primeiro de rowsPerPageOptions, ou 10. */
500
+ rows?: number;
501
+ /** Opções do Select de itens por página; sem elas, o Select não aparece. */
502
+ rowsPerPageOptions?: number[];
503
+ /** Quantos números de página aparecem. Padrão: 5, como no Figma. */
504
+ pageLinkSize?: number;
505
+ onPageChange?: (event: PaginatorPageChangeEvent) => void;
506
+ /** Nome do Select para o leitor de tela. */
507
+ rowsPerPageLabel?: string;
508
+ id?: string;
509
+ className?: string;
510
+ }
511
+ declare const Paginator: react.ForwardRefExoticComponent<PaginatorProps & react.RefAttributes<HTMLDivElement>>;
512
+
431
513
  type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
432
514
  declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
433
515
 
@@ -592,6 +674,38 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
592
674
  }
593
675
  declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
594
676
 
677
+ /** Type no Figma. */
678
+ type ToastType = 'warning' | 'danger' | 'success' | 'info';
679
+ /** Onde as mensagens aparecem na tela (o position do Prime). Padrão: top-right. */
680
+ type ToastPosition = NonNullable<ToastProps$1['position']>;
681
+ /** Uma mensagem, passada para `show()`. */
682
+ interface ToastMessage {
683
+ type: ToastType;
684
+ /** Title no Figma. */
685
+ title: string;
686
+ /** Message no Figma (Show Message content). */
687
+ message?: string;
688
+ /** Show Icon no Figma. Padrão: true. */
689
+ showIcon?: boolean;
690
+ /** Tempo na tela, em ms. Padrão do Prime: 3000. */
691
+ life?: number;
692
+ /** Fica até alguém fechar. */
693
+ sticky?: boolean;
694
+ }
695
+ /** O que a ref do Toast entrega. */
696
+ interface ToastHandle {
697
+ show: (message: ToastMessage | ToastMessage[]) => void;
698
+ clear: () => void;
699
+ }
700
+ interface ToastProps {
701
+ position?: ToastPosition;
702
+ /** Nome do X para o leitor de tela. */
703
+ closeLabel?: string;
704
+ id?: string;
705
+ className?: string;
706
+ }
707
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
708
+
595
709
  /** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
596
710
  type TooltipType = 'plain' | 'rich';
597
711
  type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
@@ -613,5 +727,5 @@ interface TooltipProps {
613
727
  }
614
728
  declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
615
729
 
616
- export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Modal, MultiSelect, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
617
- 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, DrawerSize, IconButtonProps, IconButtonSize, IconButtonVariant, InputProps, InputSize, InputVariant, MenuDensity, MenuHandle, MenuItem, MenuPrincipalEntry, MenuPrincipalGroup, MenuPrincipalHandle, MenuPrincipalItem, MenuPrincipalProps, 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 };
730
+ export { AutoComplete, Badge, Button, Card, 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 };
731
+ 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, 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 };