@vector-business-services/cristal-ds-web 0.9.0 → 0.11.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
@@ -1,11 +1,42 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } from 'react';
2
+ import { ReactNode, InputHTMLAttributes, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } 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';
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';
10
+
11
+ /** Um item (.Accordion Item no Figma) e o conteúdo dele. */
12
+ interface AccordionTabProps {
13
+ /** Título (Accordion Item Title no Figma). Com headerContent, não aparece. */
14
+ header: string;
15
+ /** Texto abaixo do título (Show Description no Figma). */
16
+ description?: string;
17
+ /** Cabeçalho livre no lugar do título e da descrição (Type=Custom no Figma). */
18
+ headerContent?: ReactNode;
19
+ disabled?: boolean;
20
+ /** Conteúdo do item aberto (Accordion Item Body no Figma). */
21
+ children?: ReactNode;
22
+ }
23
+ /** Só descreve o item: quem desenha é o Accordion. */
24
+ declare function AccordionTab(_props: AccordionTabProps): null;
25
+ interface AccordionProps {
26
+ /** Mais de um item aberto ao mesmo tempo. */
27
+ multiple?: boolean;
28
+ /**
29
+ * Item(ns) aberto(s) (controlado): o índice, ou a lista com `multiple`; null fecha todos. Sem
30
+ * ele, o Accordion controla sozinho e começa com o primeiro aberto, como nos exemplos do Figma.
31
+ */
32
+ activeIndex?: number | number[] | null;
33
+ onTabChange?: (activeIndex: number | number[] | null) => void;
34
+ /** Os itens, como `<AccordionTab>`. */
35
+ children: ReactNode;
36
+ id?: string;
37
+ className?: string;
38
+ }
39
+ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
9
40
 
10
41
  /** Type no Figma: Outline (com borda) e Filled (com fundo). */
11
42
  type InputVariant = 'outline' | 'filled';
@@ -349,6 +380,20 @@ interface MenuPrincipalHandle {
349
380
  }
350
381
  declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps & react.RefAttributes<MenuPrincipalHandle>>;
351
382
 
383
+ /** Type no Figma. */
384
+ type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
385
+ interface MessageProps {
386
+ /** Padrão: info. */
387
+ type?: MessageType;
388
+ /** Texto (Message no Figma). */
389
+ children: ReactNode;
390
+ /** Show Icon no Figma. Padrão: true. */
391
+ showIcon?: boolean;
392
+ id?: string;
393
+ className?: string;
394
+ }
395
+ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefAttributes<HTMLDivElement>>;
396
+
352
397
  /**
353
398
  * Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
354
399
  * vira tela cheia, como o Responsive=360 do Figma).
@@ -467,6 +512,34 @@ interface PageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>
467
512
  }
468
513
  declare const PageHeader: react.ForwardRefExoticComponent<PageHeaderProps & react.RefAttributes<HTMLDivElement>>;
469
514
 
515
+ /** O que o onPageChange recebe (o mesmo evento do Prime). */
516
+ interface PaginatorPageChangeEvent {
517
+ /** Índice do primeiro item da página. */
518
+ first: number;
519
+ /** Itens por página. */
520
+ rows: number;
521
+ /** Página, a partir de 0. */
522
+ page: number;
523
+ pageCount: number;
524
+ }
525
+ interface PaginatorProps {
526
+ totalRecords: number;
527
+ /** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
528
+ first?: number;
529
+ /** Itens por página (controlado). Padrão: o primeiro de rowsPerPageOptions, ou 10. */
530
+ rows?: number;
531
+ /** Opções do Select de itens por página; sem elas, o Select não aparece. */
532
+ rowsPerPageOptions?: number[];
533
+ /** Quantos números de página aparecem. Padrão: 5, como no Figma. */
534
+ pageLinkSize?: number;
535
+ onPageChange?: (event: PaginatorPageChangeEvent) => void;
536
+ /** Nome do Select para o leitor de tela. */
537
+ rowsPerPageLabel?: string;
538
+ id?: string;
539
+ className?: string;
540
+ }
541
+ declare const Paginator: react.ForwardRefExoticComponent<PaginatorProps & react.RefAttributes<HTMLDivElement>>;
542
+
470
543
  type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
471
544
  declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
472
545
 
@@ -631,6 +704,38 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
631
704
  }
632
705
  declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
633
706
 
707
+ /** Type no Figma. */
708
+ type ToastType = 'warning' | 'danger' | 'success' | 'info';
709
+ /** Onde as mensagens aparecem na tela (o position do Prime). Padrão: top-right. */
710
+ type ToastPosition = NonNullable<ToastProps$1['position']>;
711
+ /** Uma mensagem, passada para `show()`. */
712
+ interface ToastMessage {
713
+ type: ToastType;
714
+ /** Title no Figma. */
715
+ title: string;
716
+ /** Message no Figma (Show Message content). */
717
+ message?: string;
718
+ /** Show Icon no Figma. Padrão: true. */
719
+ showIcon?: boolean;
720
+ /** Tempo na tela, em ms. Padrão do Prime: 3000. */
721
+ life?: number;
722
+ /** Fica até alguém fechar. */
723
+ sticky?: boolean;
724
+ }
725
+ /** O que a ref do Toast entrega. */
726
+ interface ToastHandle {
727
+ show: (message: ToastMessage | ToastMessage[]) => void;
728
+ clear: () => void;
729
+ }
730
+ interface ToastProps {
731
+ position?: ToastPosition;
732
+ /** Nome do X para o leitor de tela. */
733
+ closeLabel?: string;
734
+ id?: string;
735
+ className?: string;
736
+ }
737
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
738
+
634
739
  /** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
635
740
  type TooltipType = 'plain' | 'rich';
636
741
  type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
@@ -652,5 +757,5 @@ interface TooltipProps {
652
757
  }
653
758
  declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
654
759
 
655
- export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Modal, MultiSelect, PageHeader, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
656
- 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, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
760
+ export { Accordion, AccordionTab, 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 };
761
+ export type { AccordionProps, AccordionTabProps, 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
@@ -1,11 +1,42 @@
1
1
  import * as react from 'react';
2
- import { InputHTMLAttributes, ReactNode, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } from 'react';
2
+ import { ReactNode, InputHTMLAttributes, HTMLAttributes, ButtonHTMLAttributes, CSSProperties, SyntheticEvent, MouseEvent, RefObject } 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';
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';
10
+
11
+ /** Um item (.Accordion Item no Figma) e o conteúdo dele. */
12
+ interface AccordionTabProps {
13
+ /** Título (Accordion Item Title no Figma). Com headerContent, não aparece. */
14
+ header: string;
15
+ /** Texto abaixo do título (Show Description no Figma). */
16
+ description?: string;
17
+ /** Cabeçalho livre no lugar do título e da descrição (Type=Custom no Figma). */
18
+ headerContent?: ReactNode;
19
+ disabled?: boolean;
20
+ /** Conteúdo do item aberto (Accordion Item Body no Figma). */
21
+ children?: ReactNode;
22
+ }
23
+ /** Só descreve o item: quem desenha é o Accordion. */
24
+ declare function AccordionTab(_props: AccordionTabProps): null;
25
+ interface AccordionProps {
26
+ /** Mais de um item aberto ao mesmo tempo. */
27
+ multiple?: boolean;
28
+ /**
29
+ * Item(ns) aberto(s) (controlado): o índice, ou a lista com `multiple`; null fecha todos. Sem
30
+ * ele, o Accordion controla sozinho e começa com o primeiro aberto, como nos exemplos do Figma.
31
+ */
32
+ activeIndex?: number | number[] | null;
33
+ onTabChange?: (activeIndex: number | number[] | null) => void;
34
+ /** Os itens, como `<AccordionTab>`. */
35
+ children: ReactNode;
36
+ id?: string;
37
+ className?: string;
38
+ }
39
+ declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
9
40
 
10
41
  /** Type no Figma: Outline (com borda) e Filled (com fundo). */
11
42
  type InputVariant = 'outline' | 'filled';
@@ -349,6 +380,20 @@ interface MenuPrincipalHandle {
349
380
  }
350
381
  declare const MenuPrincipal: react.ForwardRefExoticComponent<MenuPrincipalProps & react.RefAttributes<MenuPrincipalHandle>>;
351
382
 
383
+ /** Type no Figma. */
384
+ type MessageType = 'info' | 'warning' | 'success' | 'danger' | 'highlight' | 'neutral';
385
+ interface MessageProps {
386
+ /** Padrão: info. */
387
+ type?: MessageType;
388
+ /** Texto (Message no Figma). */
389
+ children: ReactNode;
390
+ /** Show Icon no Figma. Padrão: true. */
391
+ showIcon?: boolean;
392
+ id?: string;
393
+ className?: string;
394
+ }
395
+ declare const Message: react.ForwardRefExoticComponent<MessageProps & react.RefAttributes<HTMLDivElement>>;
396
+
352
397
  /**
353
398
  * Size no Figma: Small (520px), Medium (768px) e Large (1200 x 720px; abaixo de 768px de tela
354
399
  * vira tela cheia, como o Responsive=360 do Figma).
@@ -467,6 +512,34 @@ interface PageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>
467
512
  }
468
513
  declare const PageHeader: react.ForwardRefExoticComponent<PageHeaderProps & react.RefAttributes<HTMLDivElement>>;
469
514
 
515
+ /** O que o onPageChange recebe (o mesmo evento do Prime). */
516
+ interface PaginatorPageChangeEvent {
517
+ /** Índice do primeiro item da página. */
518
+ first: number;
519
+ /** Itens por página. */
520
+ rows: number;
521
+ /** Página, a partir de 0. */
522
+ page: number;
523
+ pageCount: number;
524
+ }
525
+ interface PaginatorProps {
526
+ totalRecords: number;
527
+ /** Índice do primeiro item da página (controlado). Sem ele, o Paginator controla sozinho. */
528
+ first?: number;
529
+ /** Itens por página (controlado). Padrão: o primeiro de rowsPerPageOptions, ou 10. */
530
+ rows?: number;
531
+ /** Opções do Select de itens por página; sem elas, o Select não aparece. */
532
+ rowsPerPageOptions?: number[];
533
+ /** Quantos números de página aparecem. Padrão: 5, como no Figma. */
534
+ pageLinkSize?: number;
535
+ onPageChange?: (event: PaginatorPageChangeEvent) => void;
536
+ /** Nome do Select para o leitor de tela. */
537
+ rowsPerPageLabel?: string;
538
+ id?: string;
539
+ className?: string;
540
+ }
541
+ declare const Paginator: react.ForwardRefExoticComponent<PaginatorProps & react.RefAttributes<HTMLDivElement>>;
542
+
470
543
  type PanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'onToggle'>;
471
544
  declare const Panel: react.ForwardRefExoticComponent<PanelProps & react.RefAttributes<HTMLDivElement>>;
472
545
 
@@ -631,6 +704,38 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
631
704
  }
632
705
  declare const Tag: react.ForwardRefExoticComponent<TagProps & react.RefAttributes<HTMLSpanElement>>;
633
706
 
707
+ /** Type no Figma. */
708
+ type ToastType = 'warning' | 'danger' | 'success' | 'info';
709
+ /** Onde as mensagens aparecem na tela (o position do Prime). Padrão: top-right. */
710
+ type ToastPosition = NonNullable<ToastProps$1['position']>;
711
+ /** Uma mensagem, passada para `show()`. */
712
+ interface ToastMessage {
713
+ type: ToastType;
714
+ /** Title no Figma. */
715
+ title: string;
716
+ /** Message no Figma (Show Message content). */
717
+ message?: string;
718
+ /** Show Icon no Figma. Padrão: true. */
719
+ showIcon?: boolean;
720
+ /** Tempo na tela, em ms. Padrão do Prime: 3000. */
721
+ life?: number;
722
+ /** Fica até alguém fechar. */
723
+ sticky?: boolean;
724
+ }
725
+ /** O que a ref do Toast entrega. */
726
+ interface ToastHandle {
727
+ show: (message: ToastMessage | ToastMessage[]) => void;
728
+ clear: () => void;
729
+ }
730
+ interface ToastProps {
731
+ position?: ToastPosition;
732
+ /** Nome do X para o leitor de tela. */
733
+ closeLabel?: string;
734
+ id?: string;
735
+ className?: string;
736
+ }
737
+ declare const Toast: react.ForwardRefExoticComponent<ToastProps & react.RefAttributes<ToastHandle>>;
738
+
634
739
  /** Type no Figma: Plain (rótulo curto, uma linha) e Rich (texto de até 300px, quebra linha). */
635
740
  type TooltipType = 'plain' | 'rich';
636
741
  type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
@@ -652,5 +757,5 @@ interface TooltipProps {
652
757
  }
653
758
  declare function Tooltip({ target, content, type, position, event, showDelay, hideDelay, disabled, id, className, }: TooltipProps): react.JSX.Element;
654
759
 
655
- export { AutoComplete, Badge, Button, Card, Checkbox, Chip, Divider, Drawer, IconButton, Input, Menu, MenuPrincipal, Menubar, Modal, MultiSelect, PageHeader, Panel, Radio, ScrollPanel, SegmentControl, Select, Switch, TabPanel, Tabs, Tag, Tooltip };
656
- 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, PageHeaderProps, PageHeaderTab, PageHeaderVariant, PanelProps, RadioLabelSize, RadioProps, ScrollPanelProps, SegmentControlOption, SegmentControlProps, SegmentControlVariant, SelectProps, SelectSize, SelectVariant, SwitchLabelPosition, SwitchProps, SwitchSize, TabPanelProps, TabsProps, TagProps, TagSize, TagVariant, TooltipPosition, TooltipProps, TooltipType };
760
+ export { Accordion, AccordionTab, 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 };
761
+ export type { AccordionProps, AccordionTabProps, 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 };